node

package
v0.0.0-...-cf96749 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PolkadotNode

type PolkadotNode struct {
	*websocket.Client
}

PolkadotNode represents a Polkadot node

func NewPolkadotNode

func NewPolkadotNode(url string) (*PolkadotNode, error)

NewPolkadotNode creates a new Polkadot node

func (*PolkadotNode) ExtrinsicSign

func (n *PolkadotNode) ExtrinsicSign(ext extrinsic.Extrinsic, signer sr25519.Pair) (extrinsic.Extrinsic, error)

ExtrinsicSign signs an extrinsic

func (*PolkadotNode) GetBestNumber

func (n *PolkadotNode) GetBestNumber() (uint64, error)

GetBestNumber gets the best block number

func (*PolkadotNode) GetBlock

func (n *PolkadotNode) GetBlock(hash types.Hash) (types.Block, error)

GetBlock gets a block by its hash

func (*PolkadotNode) GetBlockHash

func (n *PolkadotNode) GetBlockHash(height uint64) (types.Hash, error)

GetBlockHash gets the hash of a block by its height

func (*PolkadotNode) GetEventRecords

func (n *PolkadotNode) GetEventRecords(hash types.Hash, event types.Event) ([]events.EventRecord, error)

GetEventRecords gets the event records for a block

func (*PolkadotNode) GetFinalizedHead

func (n *PolkadotNode) GetFinalizedHead() (types.Header, error)

GetFinalizedHead gets the finalized head of the chain

func (*PolkadotNode) GetMetadata

func (n *PolkadotNode) GetMetadata() (types.Metadata, error)

GetMetadata gets the metadata of the chain

func (*PolkadotNode) GetStorage

func (n *PolkadotNode) GetStorage(item types.StorageKey) (types.StorageData, error)

GetStorage gets the value of a storage item

func (*PolkadotNode) QuerySubscribe

func (n *PolkadotNode) QuerySubscribe(query query.Subscription) (query.Subscriber, error)

QuerySubscribe subscribes to a query

func (*PolkadotNode) SubmitExtrinsic

func (n *PolkadotNode) SubmitExtrinsic(ext extrinsic.Extrinsic) (types.Hash, error)

SubmitExtrinsic submits an extrinsic

Jump to

Keyboard shortcuts

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