Documentation
¶
Index ¶
- type BlockEvents
- type Client
- func (c *Client) Close() error
- func (c *Client) ExecuteScriptAtBlockHeight(ctx context.Context) error
- func (c *Client) ExecuteScriptAtBlockID(ctx context.Context) error
- func (c *Client) ExecuteScriptAtLatestBlock(ctx context.Context, script []byte) (cadence.Value, error)
- func (c *Client) GetAccount(ctx context.Context, address flow.Address) (*flow.Account, error)
- func (c *Client) GetBlockByHeight(ctx context.Context, height uint64) (*flow.Block, error)
- func (c *Client) GetBlockByID(ctx context.Context, blockID flow.Identifier) (*flow.Block, error)
- func (c *Client) GetBlockHeaderByHeight(ctx context.Context, height uint64) (*flow.BlockHeader, error)
- func (c *Client) GetBlockHeaderByID(ctx context.Context, blockID flow.Identifier) (*flow.BlockHeader, error)
- func (c *Client) GetCollection(ctx context.Context, colID flow.Identifier) (*flow.Collection, error)
- func (c *Client) GetEventsForBlockIDs(ctx context.Context, eventType string, blockIDs []flow.Identifier) ([]BlockEvents, error)
- func (c *Client) GetEventsForHeightRange(ctx context.Context, query EventRangeQuery) ([]BlockEvents, error)
- func (c *Client) GetLatestBlock(ctx context.Context, isSealed bool) (*flow.Block, error)
- func (c *Client) GetLatestBlockHeader(ctx context.Context, isSealed bool) (*flow.BlockHeader, error)
- func (c *Client) GetTransaction(ctx context.Context, txID flow.Identifier) (*flow.Transaction, error)
- func (c *Client) GetTransactionResult(ctx context.Context, txID flow.Identifier) (*flow.TransactionResult, error)
- func (c *Client) Ping(ctx context.Context) error
- func (c *Client) SendTransaction(ctx context.Context, transaction flow.Transaction) error
- type EventRangeQuery
- type RPCClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockEvents ¶
type BlockEvents struct {
BlockID flow.Identifier
Height uint64
Events []flow.Event
}
BlockEvents are the events that occurred in a specific block.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client is a gRPC Client for the Flow Access API.
func New ¶
func New(addr string, opts ...grpc.DialOption) (*Client, error)
New initializes a Flow client with the default gRPC provider.
An error will be returned if the host is unreachable.
func NewFromRPCClient ¶
NewFromRPCClient initializes a Flow client using a pre-configured gRPC provider.
func (*Client) ExecuteScriptAtBlockHeight ¶
ExecuteScriptAtBlockHeight executes a ready-only Cadence script against the execution state at the given block height.
func (*Client) ExecuteScriptAtBlockID ¶
ExecuteScriptAtBlockID executes a ready-only Cadence script against the execution state at the block with the given ID.
func (*Client) ExecuteScriptAtLatestBlock ¶
func (c *Client) ExecuteScriptAtLatestBlock(ctx context.Context, script []byte) (cadence.Value, error)
ExecuteScriptAtLatestBlock executes a read-only Cadence script against the latest sealed execution state.
func (*Client) GetAccount ¶
GetAccount gets an account by address.
func (*Client) GetBlockByHeight ¶
GetBlockByHeight gets a full block by height.
func (*Client) GetBlockByID ¶
GetBlockByID gets a full block by ID.
func (*Client) GetBlockHeaderByHeight ¶
func (c *Client) GetBlockHeaderByHeight(ctx context.Context, height uint64) (*flow.BlockHeader, error)
GetBlockHeaderByHeight gets a block header by height.
func (*Client) GetBlockHeaderByID ¶
func (c *Client) GetBlockHeaderByID(ctx context.Context, blockID flow.Identifier) (*flow.BlockHeader, error)
GetBlockHeaderByID gets a block header by ID.
func (*Client) GetCollection ¶
func (c *Client) GetCollection(ctx context.Context, colID flow.Identifier) (*flow.Collection, error)
GetCollection gets a collection by ID.
func (*Client) GetEventsForBlockIDs ¶
func (c *Client) GetEventsForBlockIDs( ctx context.Context, eventType string, blockIDs []flow.Identifier, ) ([]BlockEvents, error)
GetEventsForBlockIDs retrieves events with the given type from the specified block IDs.
func (*Client) GetEventsForHeightRange ¶
func (c *Client) GetEventsForHeightRange(ctx context.Context, query EventRangeQuery) ([]BlockEvents, error)
GetEventsForHeightRange retrieves events for all sealed blocks between the start and end block heights (inclusive) with the given type.
func (*Client) GetLatestBlock ¶
GetLatestBlock gets the full payload of the latest sealed or unsealed block.
func (*Client) GetLatestBlockHeader ¶
func (c *Client) GetLatestBlockHeader( ctx context.Context, isSealed bool, ) (*flow.BlockHeader, error)
GetLatestBlockHeader gets the latest sealed or unsealed block header.
func (*Client) GetTransaction ¶
func (c *Client) GetTransaction(ctx context.Context, txID flow.Identifier) (*flow.Transaction, error)
GetTransaction gets a transaction by ID.
func (*Client) GetTransactionResult ¶
func (c *Client) GetTransactionResult(ctx context.Context, txID flow.Identifier) (*flow.TransactionResult, error)
GetTransactionResult gets the result of a transaction.
func (*Client) SendTransaction ¶
SendTransaction submits a transaction to the network.
type EventRangeQuery ¶
type EventRangeQuery struct {
// The event type to search for. If empty, no filtering by type is done.
Type string
// The block height to begin looking for events
StartHeight uint64
// The block height to end looking for events (inclusive)
EndHeight uint64
}
EventRangeQuery defines a query for Flow events.
type RPCClient ¶
type RPCClient interface {
access.AccessAPIClient
}
An RPCClient is an RPC client for the Flow Access API.