Documentation ¶
Index ¶
- type Chain
- func (c *Chain) GetBlock(blockHash types.Hash) (*types.SignedBlock, error)
- func (c *Chain) GetBlockHash(blockNumber uint64) (types.Hash, error)
- func (c *Chain) GetBlockHashLatest() (types.Hash, error)
- func (c *Chain) GetBlockLatest() (*types.SignedBlock, error)
- func (c *Chain) GetFinalizedHead() (types.Hash, error)
- func (c *Chain) GetHeader(blockHash types.Hash) (*types.Header, error)
- func (c *Chain) GetHeaderLatest() (*types.Header, error)
- func (c *Chain) SubscribeFinalizedHeads() (*FinalizedHeadsSubscription, error)
- func (c *Chain) SubscribeNewHeads() (*NewHeadsSubscription, error)
- type FinalizedHeadsSubscription
- type NewHeadsSubscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
Chain exposes methods for retrieval of chain data
func (*Chain) GetBlock ¶ added in v0.0.3
GetBlock returns the header and body of the relay chain block with the given hash
func (*Chain) GetBlockHash ¶
GetBlockHash returns the block hash for a specific block height
func (*Chain) GetBlockHashLatest ¶
GetBlockHashLatest returns the latest block hash
func (*Chain) GetBlockLatest ¶ added in v0.0.3
func (c *Chain) GetBlockLatest() (*types.SignedBlock, error)
GetBlockLatest returns the header and body of the latest relay chain block
func (*Chain) GetFinalizedHead ¶ added in v0.0.3
GetFinalizedHead returns the hash of the last finalized block in the canon chain
func (*Chain) GetHeaderLatest ¶ added in v0.0.3
GetHeaderLatest retrieves the header of the latest block
func (*Chain) SubscribeFinalizedHeads ¶ added in v1.0.0
func (c *Chain) SubscribeFinalizedHeads() (*FinalizedHeadsSubscription, error)
SubscribeFinalizedHeads subscribes the best finalized headers, returning a subscription that will receive server notifications containing the Header.
func (*Chain) SubscribeNewHeads ¶ added in v1.0.0
func (c *Chain) SubscribeNewHeads() (*NewHeadsSubscription, error)
SubscribeNewHeads subscribes the best headers, returning a subscription that will receive server notifications containing the Header.
type FinalizedHeadsSubscription ¶ added in v1.0.0
type FinalizedHeadsSubscription struct {
// contains filtered or unexported fields
}
FinalizedHeadsSubscription is a subscription established through one of the Client's subscribe methods.
func (*FinalizedHeadsSubscription) Chan ¶ added in v1.0.0
func (s *FinalizedHeadsSubscription) Chan() <-chan types.Header
Chan returns the subscription channel.
The channel is closed when Unsubscribe is called on the subscription.
func (*FinalizedHeadsSubscription) Err ¶ added in v1.0.0
func (s *FinalizedHeadsSubscription) Err() <-chan error
Err returns the subscription error channel. The intended use of Err is to schedule resubscription when the client connection is closed unexpectedly.
The error channel receives a value when the subscription has ended due to an error. The received error is nil if Close has been called on the underlying client and no other error has occurred.
The error channel is closed when Unsubscribe is called on the subscription.
func (*FinalizedHeadsSubscription) Unsubscribe ¶ added in v1.0.0
func (s *FinalizedHeadsSubscription) Unsubscribe()
Unsubscribe unsubscribes the notification and closes the error channel. It can safely be called more than once.
type NewHeadsSubscription ¶ added in v1.0.0
type NewHeadsSubscription struct {
// contains filtered or unexported fields
}
NewHeadsSubscription is a subscription established through one of the Client's subscribe methods.
func (*NewHeadsSubscription) Chan ¶ added in v1.0.0
func (s *NewHeadsSubscription) Chan() <-chan types.Header
Chan returns the subscription channel.
The channel is closed when Unsubscribe is called on the subscription.
func (*NewHeadsSubscription) Err ¶ added in v1.0.0
func (s *NewHeadsSubscription) Err() <-chan error
Err returns the subscription error channel. The intended use of Err is to schedule resubscription when the client connection is closed unexpectedly.
The error channel receives a value when the subscription has ended due to an error. The received error is nil if Close has been called on the underlying client and no other error has occurred.
The error channel is closed when Unsubscribe is called on the subscription.
func (*NewHeadsSubscription) Unsubscribe ¶ added in v1.0.0
func (s *NewHeadsSubscription) Unsubscribe()
Unsubscribe unsubscribes the notification and closes the error channel. It can safely be called more than once.