rpc

package
v0.0.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const BoundedDataMaxLen = 32 // Adjust the maximum length as needed

BoundedDataMaxLen is the maximum length for the bounded data

View Source
const MaxCells = 10000

Variables

This section is empty.

Functions

func GetBlockHash

func GetBlockHash(client client.Client, blockNumber uint64) (types.Hash, error)

func GetBlockHashLatest

func GetBlockHashLatest(client client.Client) (types.Hash, error)

func GetFinalizedHead

func GetFinalizedHead(client client.Client) (types.Hash, error)

func GetHeader

func GetHeader(client1 client.Client, blockHash types.Hash) (*header.Header, error)

func GetHeaderLatest

func GetHeaderLatest(client1 client.Client) (*header.Header, error)

func SubmitExtrinsic

func SubmitExtrinsic(xt extrinsic.Extrinsic, client client.Client) (types.Hash, error)

Types

type ArbitraryMessage

type ArbitraryMessage struct {
	BoundedData
}

ArbitraryMessage struct represents the ArbitraryMessage variant

type Block

type Block struct {
	Header     header.Header `json:"header"`
	Extrinsics []extrinsic.Extrinsic
}

Block encoded with header and extrinsics

type BoundedData

type BoundedData struct {
	Data []byte
}

type Cell

type Cell struct {
	Row uint64 `json:"row"`
	Col uint64 `json:"col"`
}

func NewCell

func NewCell(row, col uint64) Cell

type DataProof

type DataProof struct {
	Roots          TxDataRoot
	Proof          []types.Hash
	NumberOfLeaves uint32 // Change to uint32 to match Rust u32
	LeafIndex      uint32 // Change to uint32 to match Rust u32
	Leaf           types.Hash
}

DataProof struct represents the data proof response

type ExtrinsicStatusSubscription

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

func SubmitAndWatchExtrinsic

func SubmitAndWatchExtrinsic(xt extrinsic.Extrinsic, client client.Client) (*ExtrinsicStatusSubscription, error)

SubmitAndWatchExtrinsic will submit and subscribe to watch an extrinsic until unsubscribed, returning a subscription that will receive server notifications containing the extrinsic status updates.

func (*ExtrinsicStatusSubscription) Chan

Chan returns the subscription channel.

The channel is closed when Unsubscribe is called on the subscription.

func (*ExtrinsicStatusSubscription) Err

func (s *ExtrinsicStatusSubscription) 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 (*ExtrinsicStatusSubscription) Unsubscribe

func (s *ExtrinsicStatusSubscription) Unsubscribe()

Unsubscribe unsubscribes the notification and closes the error channel. It can safely be called more than once.

type FungibleToken

type FungibleToken struct {
	AssetID types.Hash
	Amount  uint128 // Define uint128 type as needed
}

FungibleToken struct represents the FungibleToken variant

type GDataProof

type GDataProof struct {
	RawScalar big.Int `json:"RawScalar"` // For U256
	Proof     GProof  `json:"Proof"`
}

func (*GDataProof) MarshalJSON

func (g *GDataProof) MarshalJSON() ([]byte, error)

func (*GDataProof) UnmarshalJSON

func (g *GDataProof) UnmarshalJSON(data []byte) error

type GProof

type GProof struct {
	Data [48]byte `json:"Data"`
}

type Message

type Message interface {
	// contains filtered or unexported methods
}

Message interface represents the enum variants

type ProofResponse

type ProofResponse struct {
	DataProof DataProof
	Message   Message // Interface to capture different message types
}

type SignedBlock

type SignedBlock struct {
	Block         Block               `json:"block"`
	Justification types.Justification `json:"justification"`
}

func GetAvailBlock

func GetAvailBlock(blockHash types.Hash, client1 client.Client) (*SignedBlock, error)

GetBlock returns the header and body of the relay chain block with the given hash

func GetAvailBlockLatest

func GetAvailBlockLatest(client1 client.Client) (*SignedBlock, error)

type TxDataRoot

type TxDataRoot struct {
	DataRoot   types.Hash
	BlobRoot   types.Hash
	BridgeRoot types.Hash
}

Jump to

Keyboard shortcuts

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