tx_input

package
v0.0.0-...-4f6eca2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LocalPayloadMutatorFns = map[extensions.SignedExtensionName]extrinsic.PayloadMutatorFn{

	"SubtensorSignedExtension":   func(payload *extrinsic.Payload) {},
	"CommitmentsSignedExtension": func(payload *extrinsic.Payload) {},
}

Functions

func CreatePayload

func CreatePayload(meta *Metadata, encodedCall []byte) (*extrinsic.Payload, error)

Replaces "github.com/centrifuge/go-substrate-rpc-client/v4/extrinsic".createPayload

func NewCall

func NewCall(m *Metadata, call string, args ...interface{}) (types.Call, error)

Replaces "github.com/centrifuge/go-substrate-rpc-client/v4/types".NewCall

Types

type CallMeta

type CallMeta struct {
	Name         string `json:"name"`
	SectionIndex uint8  `json:"section"`
	MethodIndex  uint8  `json:"method"`
}

type Metadata

type Metadata struct {
	Calls            []*CallMeta                      `json:"calls"`
	SignedExtensions []extensions.SignedExtensionName `json:"signed_extensions"`
}

func ParseMeta

func ParseMeta(meta *types.Metadata) (Metadata, error)

We explicitly define which substrate operations we support so that we can trim down the massive metadata description for all possible substrate transactions that's needed as tx-input.

func (*Metadata) FindCallIndex

func (m *Metadata) FindCallIndex(name string) (types.CallIndex, error)

type TxInput

type TxInput struct {
	xc.TxInputEnvelope
	Meta          Metadata             `json:"meta,omitempty"`
	GenesisHash   types.Hash           `json:"genesis_hash,omitempty"`
	CurHash       types.Hash           `json:"current_hash,omitempty"`
	Rv            types.RuntimeVersion `json:"runtime_version,omitempty"`
	CurrentHeight uint64               `json:"current_height,omitempty"`
	Tip           uint64               `json:"tip,omitempty"`
	Nonce         uint64               `json:"account_nonce,omitempty"`
}

TxInput for Substrate

func NewTxInput

func NewTxInput() *TxInput

NewTxInput returns a new Substrate TxInput

func (*TxInput) GetDriver

func (input *TxInput) GetDriver() xc.Driver

func (*TxInput) GetVariant

func (input *TxInput) GetVariant() xc.TxVariantInputType

func (*TxInput) IndependentOf

func (input *TxInput) IndependentOf(other xc.TxInput) (independent bool)

func (*TxInput) SafeFromDoubleSend

func (input *TxInput) SafeFromDoubleSend(others ...xc.TxInput) (safe bool)

func (*TxInput) SetGasFeePriority

func (input *TxInput) SetGasFeePriority(other xc.GasFeePriority) error

func (*TxInput) Staking

func (input *TxInput) Staking()

func (*TxInput) Unstaking

func (input *TxInput) Unstaking()

func (*TxInput) Withdrawing

func (input *TxInput) Withdrawing()

Jump to

Keyboard shortcuts

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