Documentation ¶
Index ¶
- Constants
- func DefaultClientOptions() *options
- type BaseClient
- func (c *BaseClient) ExecuteScriptAtBlockHeight(ctx context.Context, blockQuery HeightQuery, script []byte, ...) (cadence.Value, error)
- func (c *BaseClient) ExecuteScriptAtBlockID(ctx context.Context, blockID flow.Identifier, script []byte, ...) (cadence.Value, error)
- func (c *BaseClient) GetAccountAtBlockHeight(ctx context.Context, address flow.Address, blockQuery HeightQuery, ...) (*flow.Account, error)
- func (c *BaseClient) GetBlockByID(ctx context.Context, blockID flow.Identifier, opts ...queryOpts) (*flow.Block, error)
- func (c *BaseClient) GetBlocksByHeights(ctx context.Context, heightQuery HeightQuery, opts ...queryOpts) ([]*flow.Block, error)
- func (c *BaseClient) GetCollection(ctx context.Context, ID flow.Identifier, opts ...queryOpts) (*flow.Collection, error)
- func (c *BaseClient) GetEventsForBlockIDs(ctx context.Context, eventType string, blockIDs []flow.Identifier) ([]flow.BlockEvents, error)
- func (c *BaseClient) GetEventsForHeightRange(ctx context.Context, eventType string, heightQuery HeightQuery) ([]flow.BlockEvents, error)
- func (c *BaseClient) GetExecutionResultForBlockID(ctx context.Context, blockID flow.Identifier) (*flow.ExecutionResult, error)
- func (c *BaseClient) GetLatestProtocolStateSnapshot(ctx context.Context) ([]byte, error)
- func (c *BaseClient) GetNetworkParameters(ctx context.Context) (*flow.NetworkParameters, error)
- func (c *BaseClient) GetNodeVersionInfo(ctx context.Context) (*flow.NodeVersionInfo, error)
- func (c *BaseClient) GetTransaction(ctx context.Context, ID flow.Identifier, opts ...queryOpts) (*flow.Transaction, error)
- func (c *BaseClient) GetTransactionResult(ctx context.Context, ID flow.Identifier, opts ...queryOpts) (*flow.TransactionResult, error)
- func (c *BaseClient) Ping(ctx context.Context) error
- func (c *BaseClient) SendTransaction(ctx context.Context, tx flow.Transaction, opts ...queryOpts) error
- func (c *BaseClient) SetJSONOptions(options []json.Option)
- type Client
- func (c *Client) Close() error
- func (c *Client) ExecuteScriptAtBlockHeight(ctx context.Context, height uint64, script []byte, arguments []cadence.Value) (cadence.Value, error)
- func (c *Client) ExecuteScriptAtBlockID(ctx context.Context, blockID flow.Identifier, script []byte, ...) (cadence.Value, error)
- func (c *Client) ExecuteScriptAtLatestBlock(ctx context.Context, script []byte, arguments []cadence.Value) (cadence.Value, error)
- func (c *Client) GetAccount(ctx context.Context, address flow.Address) (*flow.Account, error)
- func (c *Client) GetAccountAtBlockHeight(ctx context.Context, address flow.Address, blockHeight uint64) (*flow.Account, error)
- func (c *Client) GetAccountAtLatestBlock(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, ID flow.Identifier) (*flow.Collection, error)
- func (c *Client) GetEventsForBlockIDs(ctx context.Context, eventType string, blockIDs []flow.Identifier) ([]flow.BlockEvents, error)
- func (c *Client) GetEventsForHeightRange(ctx context.Context, eventType string, startHeight uint64, endHeight uint64) ([]flow.BlockEvents, error)
- func (c *Client) GetExecutionDataByBlockID(ctx context.Context, blockID flow.Identifier) (*flow.ExecutionData, error)
- func (c *Client) GetExecutionResultForBlockID(ctx context.Context, blockID flow.Identifier) (*flow.ExecutionResult, 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) GetLatestProtocolStateSnapshot(ctx context.Context) ([]byte, error)
- func (c *Client) GetNetworkParameters(ctx context.Context) (*flow.NetworkParameters, error)
- func (c *Client) GetNodeVersionInfo(ctx context.Context) (*flow.NodeVersionInfo, error)
- func (c *Client) GetTransaction(ctx context.Context, ID flow.Identifier) (*flow.Transaction, error)
- func (c *Client) GetTransactionResult(ctx context.Context, ID flow.Identifier) (*flow.TransactionResult, error)
- func (c *Client) GetTransactionResultsByBlockID(ctx context.Context, blockID flow.Identifier) ([]*flow.TransactionResult, error)
- func (c *Client) GetTransactionsByBlockID(ctx context.Context, blockID flow.Identifier) ([]*flow.Transaction, error)
- func (c *Client) Ping(ctx context.Context) error
- func (c *Client) SendTransaction(ctx context.Context, tx flow.Transaction) error
- func (c *Client) SubscribeEventsByBlockHeight(ctx context.Context, startHeight uint64, filter flow.EventFilter, ...) (<-chan flow.BlockEvents, <-chan error, error)
- func (c *Client) SubscribeEventsByBlockID(ctx context.Context, startBlockID flow.Identifier, filter flow.EventFilter, ...) (<-chan flow.BlockEvents, <-chan error, error)
- func (c *Client) SubscribeExecutionDataByBlockHeight(ctx context.Context, startHeight uint64) (<-chan flow.ExecutionDataStreamResponse, <-chan error, error)
- func (c *Client) SubscribeExecutionDataByBlockID(ctx context.Context, startBlockID flow.Identifier) (<-chan flow.ExecutionDataStreamResponse, <-chan error, error)
- type ClientOption
- type ExpandOpts
- type HTTPError
- type HeightQuery
- type SelectOpts
Constants ¶
const ( EmulatorHost = "http://127.0.0.1:8888/v1" TestnetHost = "https://rest-testnet.onflow.org/v1" MainnetHost = "https://rest-mainnet.onflow.org/v1" CanarynetHost = "https://rest-canary.onflow.org/v1" PreviewnetHost = "https://rest-previewnet.onflow.org/v1" )
const ( // FINAL points to latest finalised block height. FINAL uint64 = math.MaxUint64 - 1 // SEALED points to latest sealed block height. SEALED uint64 = math.MaxUint64 - 2 )
special height values definition.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶ added in v1.0.0
func DefaultClientOptions() *options
Types ¶
type BaseClient ¶
type BaseClient struct {
// contains filtered or unexported fields
}
BaseClient provides an API specific to the HTTP.
Use this client if you need advance access to the HTTP API. If you don't require special methods use the Client instead.
func NewBaseClient ¶
func NewBaseClient(host string) (*BaseClient, error)
NewBaseClient creates a new BaseClient. BaseClient provides an API specific to the HTTP.
Use this client if you need advance access to the HTTP API. If you don't require special methods use the Client instead.
func (*BaseClient) ExecuteScriptAtBlockHeight ¶
func (c *BaseClient) ExecuteScriptAtBlockHeight( ctx context.Context, blockQuery HeightQuery, script []byte, arguments []cadence.Value, opts ...queryOpts, ) (cadence.Value, error)
func (*BaseClient) ExecuteScriptAtBlockID ¶
func (*BaseClient) GetAccountAtBlockHeight ¶
func (c *BaseClient) GetAccountAtBlockHeight( ctx context.Context, address flow.Address, blockQuery HeightQuery, opts ...queryOpts, ) (*flow.Account, error)
func (*BaseClient) GetBlockByID ¶
func (c *BaseClient) GetBlockByID(ctx context.Context, blockID flow.Identifier, opts ...queryOpts) (*flow.Block, error)
func (*BaseClient) GetBlocksByHeights ¶
func (c *BaseClient) GetBlocksByHeights( ctx context.Context, heightQuery HeightQuery, opts ...queryOpts, ) ([]*flow.Block, error)
GetBlocksByHeights requests the blocks by the specified block query.
func (*BaseClient) GetCollection ¶
func (c *BaseClient) GetCollection( ctx context.Context, ID flow.Identifier, opts ...queryOpts, ) (*flow.Collection, error)
func (*BaseClient) GetEventsForBlockIDs ¶
func (c *BaseClient) GetEventsForBlockIDs( ctx context.Context, eventType string, blockIDs []flow.Identifier, ) ([]flow.BlockEvents, error)
func (*BaseClient) GetEventsForHeightRange ¶
func (c *BaseClient) GetEventsForHeightRange( ctx context.Context, eventType string, heightQuery HeightQuery, ) ([]flow.BlockEvents, error)
func (*BaseClient) GetExecutionResultForBlockID ¶
func (c *BaseClient) GetExecutionResultForBlockID(ctx context.Context, blockID flow.Identifier) (*flow.ExecutionResult, error)
func (*BaseClient) GetLatestProtocolStateSnapshot ¶
func (c *BaseClient) GetLatestProtocolStateSnapshot(ctx context.Context) ([]byte, error)
func (*BaseClient) GetNetworkParameters ¶ added in v0.41.15
func (c *BaseClient) GetNetworkParameters(ctx context.Context) (*flow.NetworkParameters, error)
func (*BaseClient) GetNodeVersionInfo ¶ added in v1.0.0
func (c *BaseClient) GetNodeVersionInfo(ctx context.Context) (*flow.NodeVersionInfo, error)
func (*BaseClient) GetTransaction ¶
func (c *BaseClient) GetTransaction( ctx context.Context, ID flow.Identifier, opts ...queryOpts, ) (*flow.Transaction, error)
func (*BaseClient) GetTransactionResult ¶
func (c *BaseClient) GetTransactionResult( ctx context.Context, ID flow.Identifier, opts ...queryOpts, ) (*flow.TransactionResult, error)
func (*BaseClient) SendTransaction ¶
func (c *BaseClient) SendTransaction( ctx context.Context, tx flow.Transaction, opts ...queryOpts, ) error
func (*BaseClient) SetJSONOptions ¶ added in v0.26.3
func (c *BaseClient) SetJSONOptions(options []json.Option)
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements all common HTTP methods providing a network agnostic API.
func NewClient ¶
func NewClient(host string, opts ...ClientOption) (*Client, error)
NewClient creates an HTTP client exposing all the common access APIs. Client will use provided host for connection.
func (*Client) ExecuteScriptAtBlockHeight ¶
func (*Client) ExecuteScriptAtBlockID ¶
func (*Client) ExecuteScriptAtLatestBlock ¶
func (*Client) GetAccount ¶
GetAccount is an alias for GetAccountAtLatestBlock.
func (*Client) GetAccountAtBlockHeight ¶
func (*Client) GetAccountAtLatestBlock ¶
func (*Client) GetBlockByHeight ¶
func (*Client) GetBlockByID ¶
func (*Client) GetBlockHeaderByHeight ¶
func (*Client) GetBlockHeaderByID ¶
func (*Client) GetCollection ¶
func (*Client) GetEventsForBlockIDs ¶
func (*Client) GetEventsForHeightRange ¶
func (*Client) GetExecutionDataByBlockID ¶ added in v0.41.19
func (*Client) GetExecutionResultForBlockID ¶
func (*Client) GetLatestBlock ¶
func (*Client) GetLatestBlockHeader ¶
func (*Client) GetLatestProtocolStateSnapshot ¶
func (*Client) GetNetworkParameters ¶ added in v0.41.15
func (*Client) GetNodeVersionInfo ¶ added in v1.0.0
func (*Client) GetTransaction ¶
func (*Client) GetTransactionResult ¶
func (*Client) GetTransactionResultsByBlockID ¶ added in v0.31.0
func (*Client) GetTransactionsByBlockID ¶ added in v0.31.0
func (*Client) SendTransaction ¶
func (*Client) SubscribeEventsByBlockHeight ¶ added in v0.41.19
func (*Client) SubscribeEventsByBlockID ¶ added in v0.41.19
func (*Client) SubscribeExecutionDataByBlockHeight ¶ added in v0.41.19
type ClientOption ¶ added in v1.0.0
type ClientOption func(*options)
ClientOption is a configuration option for the client.
func WithJSONOptions ¶ added in v1.0.0
func WithJSONOptions(jsonOpts ...jsoncdc.Option) ClientOption
WithJSONOptions wraps a json.Option into a ClientOption.
type ExpandOpts ¶
type ExpandOpts struct {
Expands []string
}
ExpandOpts allows you to define a list of fields that you want to retrieve as extra data in the response.
Be sure to follow the documentation for allowed values found here https://docs.onflow.org/http-api/
type HeightQuery ¶
HeightQuery defines all the possible heights you can pass when fetching blocks.
Make sure you only pass either heights or special heights or start and end height else an error will be returned. You can refer to the docs for querying blocks found here https://docs.onflow.org/http-api/#tag/Blocks/paths/~1blocks/get
type SelectOpts ¶
type SelectOpts struct {
Selects []string
}
SelectOpts allows you to define a list of fields that you only want to fetch in the response filtering out any other data.
Be sure to follow the documentation for allowed values found here https://docs.onflow.org/http-api/
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) |