starknet

package
v0.6.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(newStream NewStreamFunc, protocolID protocol.ID, log utils.Logger) *Client

func (*Client) GetBlocks

func (c *Client) GetBlocks(ctx context.Context, req *spec.GetBlocks) (Stream[*spec.BlockHeader], error)

func (*Client) GetEvents

func (c *Client) GetEvents(ctx context.Context, req *spec.GetEvents) (*spec.Events, error)

func (*Client) GetReceipts

func (c *Client) GetReceipts(ctx context.Context, req *spec.GetReceipts) (*spec.Receipts, error)

func (*Client) GetSignatures

func (c *Client) GetSignatures(ctx context.Context, req *spec.GetSignatures) (*spec.Signatures, error)

func (*Client) GetTransactions

func (c *Client) GetTransactions(ctx context.Context, req *spec.GetTransactions) (*spec.Transactions, error)

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(bcReader blockchain.Reader, log utils.Logger) *Handler

func (*Handler) HandleGetBlocks

func (h *Handler) HandleGetBlocks(req *spec.GetBlocks) (Stream[proto.Message], error)

func (*Handler) HandleGetEvents

func (h *Handler) HandleGetEvents(req *spec.GetEvents) (*spec.Events, error)

func (*Handler) HandleGetReceipts

func (h *Handler) HandleGetReceipts(req *spec.GetReceipts) (*spec.Receipts, error)

func (*Handler) HandleGetSignatures

func (h *Handler) HandleGetSignatures(req *spec.GetSignatures) (*spec.Signatures, error)

func (*Handler) HandleGetTransactions

func (h *Handler) HandleGetTransactions(req *spec.GetTransactions) (*spec.Transactions, error)

func (*Handler) StreamHandler

func (h *Handler) StreamHandler(stream network.Stream)

type NewStreamFunc

type NewStreamFunc func(ctx context.Context, pids ...protocol.ID) (network.Stream, error)

type Stream

type Stream[T any] func() (T, bool)

Stream represents a series of messages that can be accessed by invoking Stream a number of times. After stream is entirely consumed of elements, it should return false as its second return value

func StaticStream

func StaticStream[T any](elems ...T) Stream[T]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL