Documentation ¶
Index ¶
- func TestPolkadotProtocol(t *testing.T)
- type PolkadotProtocol
- func (p *PolkadotProtocol) ExtrinsicSign(ext *types.Extrinsic, signer *ecdsa.PrivateKey) (*types.Extrinsic, error)
- func (p *PolkadotProtocol) GetBestNumber() (uint64, error)
- func (p *PolkadotProtocol) GetBlock(hash string) (*types.Block, error)
- func (p *PolkadotProtocol) GetBlockHash(height uint64) (string, error)
- func (p *PolkadotProtocol) GetFinalizedHead() (*types.Header, error)
- func (p *PolkadotProtocol) GetMetadata() (*types.Metadata, error)
- func (p *PolkadotProtocol) GetStorage(key string) (string, error)
- func (p *PolkadotProtocol) QuerySubscribe(query *types.Query) (*types.Subscriber, error)
- func (p *PolkadotProtocol) SubmitExtrinsic(ext *types.Extrinsic) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestPolkadotProtocol ¶
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
Click to show internal directories.
Click to hide internal directories.