Documentation ¶
Index ¶
- type Client
- func (c *Client) FetchBlockMerkleProof(ctx context.Context, rootHeight uint64, hotshotHeight uint64) (types.HotShotBlockMerkleProof, error)
- func (c *Client) FetchHeaderByHeight(ctx context.Context, blockHeight uint64) (types.Header, error)
- func (c *Client) FetchHeadersByRange(ctx context.Context, from uint64, until uint64) ([]types.Header, error)
- func (c *Client) FetchLatestBlockHeight(ctx context.Context) (uint64, error)
- func (c *Client) FetchTransactionsInBlock(ctx context.Context, blockHeight uint64, namespace uint64) (TransactionsInBlock, error)
- func (c *Client) SubmitTransaction(ctx context.Context, tx types.Transaction) error
- type NamespaceResponse
- type QueryService
- type SubmitAPI
- type TransactionsInBlock
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 (*Client) FetchBlockMerkleProof ¶ added in v0.0.10
func (c *Client) FetchBlockMerkleProof(ctx context.Context, rootHeight uint64, hotshotHeight uint64) (types.HotShotBlockMerkleProof, error)
Fetches a block merkle proof at the snapshot rootHeight for the leaf at the provided HotShot height
func (*Client) FetchHeaderByHeight ¶
func (*Client) FetchHeadersByRange ¶ added in v0.0.14
func (*Client) FetchLatestBlockHeight ¶
func (*Client) FetchTransactionsInBlock ¶
func (*Client) SubmitTransaction ¶
type NamespaceResponse ¶
type NamespaceResponse struct { Proof *json.RawMessage `json:"proof"` Transactions *[]types.Transaction `json:"transactions"` }
type QueryService ¶
type QueryService interface { // Get the latest block number FetchLatestBlockHeight(ctx context.Context) (uint64, error) // Get the header for block number `height`. FetchHeaderByHeight(ctx context.Context, height uint64) (types.Header, error) // Get the headers starting from the given :from up until the given :until FetchHeadersByRange(ctx context.Context, from uint64, until uint64) ([]types.Header, error) // Get the transactions belonging to the given namespace in the block with the given header, // along with a proof that these are all such transactions. FetchTransactionsInBlock(ctx context.Context, header *types.Header, namespace uint64) (TransactionsInBlock, error) }
Interface to the Espresso Sequencer query service.
type SubmitAPI ¶
type SubmitAPI interface { // Submit a transaction to the espresso sequencer. SubmitTransaction(ctx context.Context, tx types.Transaction) error }
Interface to the Espresso Sequencer submit API
type TransactionsInBlock ¶
type TransactionsInBlock struct { // The transactions. Transactions []types.Bytes `json:"transactions"` // A proof that these are all the transactions in the block with the requested namespace. Proof types.NamespaceProof `json:"proof"` }
Response to `FetchTransactionsInBlock`
func (*TransactionsInBlock) UnmarshalJSON ¶
func (t *TransactionsInBlock) UnmarshalJSON(b []byte) error
Click to show internal directories.
Click to hide internal directories.