protocol

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestPolkadotProtocol

func TestPolkadotProtocol(t *testing.T)

Types

type PolkadotProtocol

type PolkadotProtocol struct {
	// contains filtered or unexported fields
}

PolkadotProtocol represents the Polkadot protocol

func NewPolkadotProtocol

func NewPolkadotProtocol(nodeURL string) (*PolkadotProtocol, error)

NewPolkadotProtocol creates a new PolkadotProtocol instance

func (*PolkadotProtocol) ExtrinsicSign

func (p *PolkadotProtocol) ExtrinsicSign(ext *types.Extrinsic, signer *ecdsa.PrivateKey) (*types.Extrinsic, error)

ExtrinsicSign signs an extrinsic with a given signer

func (*PolkadotProtocol) GetBestNumber

func (p *PolkadotProtocol) GetBestNumber() (uint64, error)

GetBestNumber returns the best block number

func (*PolkadotProtocol) GetBlock

func (p *PolkadotProtocol) GetBlock(hash string) (*types.Block, error)

GetBlock returns the block at a given hash

func (*PolkadotProtocol) GetBlockHash

func (p *PolkadotProtocol) GetBlockHash(height uint64) (string, error)

GetBlockHash returns the block hash at a given height

func (*PolkadotProtocol) GetFinalizedHead

func (p *PolkadotProtocol) GetFinalizedHead() (*types.Header, error)

GetFinalizedHead returns the finalized head of the chain

func (*PolkadotProtocol) GetMetadata

func (p *PolkadotProtocol) GetMetadata() (*types.Metadata, error)

GetMetadata returns the metadata of the chain

func (*PolkadotProtocol) GetStorage

func (p *PolkadotProtocol) GetStorage(key string) (string, error)

GetStorage returns the storage value at a given key

func (*PolkadotProtocol) QuerySubscribe

func (p *PolkadotProtocol) QuerySubscribe(query *types.Query) (*types.Subscriber, error)

QuerySubscribe subscribes to a query

func (*PolkadotProtocol) SubmitExtrinsic

func (p *PolkadotProtocol) SubmitExtrinsic(ext *types.Extrinsic) (string, error)

SubmitExtrinsic submits an extrinsic to the network

Jump to

Keyboard shortcuts

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