Documentation ¶
Index ¶
- Constants
- type Extrinsic
- func (e *Extrinsic) Decode(decoder scale.Decoder) error
- func (e Extrinsic) Encode(encoder scale.Encoder) error
- func (e Extrinsic) IsSigned() bool
- func (e Extrinsic) MarshalJSON() ([]byte, error)
- func (e *Extrinsic) Sign(signer signature.KeyringPair, o SignatureOptions) error
- func (e Extrinsic) Type() uint8
- func (e *Extrinsic) UnmarshalJSON(bz []byte) error
- type ExtrinsicEra
- type ExtrinsicPayloadV3
- type ExtrinsicPayloadV4
- type ExtrinsicSignatureV4
- type MortalEra
- type SignatureOptions
Constants ¶
const ( ExtrinsicBitSigned = 0x80 ExtrinsicBitUnsigned = 0 ExtrinsicUnmaskVersion = 0x7f ExtrinsicDefaultVersion = 1 ExtrinsicVersionUnknown = 0 // v0 is unknown ExtrinsicVersion1 = 1 ExtrinsicVersion2 = 2 ExtrinsicVersion3 = 3 ExtrinsicVersion4 = 4 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Extrinsic ¶
type Extrinsic struct { // Version is the encoded version flag (which encodes the raw transaction version and signing information in one byte) Version byte // Signature is the ExtrinsicSignatureV4, it's presence depends on the Version flag Signature ExtrinsicSignatureV4 // Method is the call this extrinsic wraps Method types.Call }
Extrinsic is a piece of Args bundled into a block that expresses something from the "external" (i.e. off-chain) world. There are, broadly speaking, two types of extrinsic: transactions (which tend to be signed) and inherents (which don't).
func NewExtrinsic ¶
NewExtrinsic creates a new Extrinsic from the provided Call
func (Extrinsic) MarshalJSON ¶
MarshalJSON returns a JSON encoded byte array of Extrinsic
func (*Extrinsic) Sign ¶
func (e *Extrinsic) Sign(signer signature.KeyringPair, o SignatureOptions) error
Sign adds a signature to the extrinsic
func (Extrinsic) Type ¶
Type returns the raw transaction version (not flagged with signing information)
func (*Extrinsic) UnmarshalJSON ¶
UnmarshalJSON fills Extrinsic with the JSON encoded byte array given by bz
type ExtrinsicEra ¶
type ExtrinsicEra struct { IsImmortalEra bool // AsImmortalEra ImmortalEra IsMortalEra bool AsMortalEra MortalEra }
ExtrinsicEra indicates either a mortal or immortal extrinsic
type ExtrinsicPayloadV3 ¶
type ExtrinsicPayloadV3 struct { Method types.BytesBare Era ExtrinsicEra // extra via system::CheckEra Nonce types.UCompact // extra via system::CheckNonce (Compact<Index> where Index is u32) Tip types.UCompact // extra via balances::TakeFees (Compact<Balance> where Balance is u128) AppID types.UCompact SpecVersion types.U32 // additional via system::CheckVersion TransactionVersion types.U32 GenesisHash types.Hash // additional via system::CheckGenesis BlockHash types.Hash // additional via system::CheckEra }
func (*ExtrinsicPayloadV3) Decode ¶
func (e *ExtrinsicPayloadV3) Decode(decoder scale.Decoder) error
Decode does nothing and always returns an error. ExtrinsicPayloadV3 is only used for encoding, not for decoding
func (ExtrinsicPayloadV3) Encode ¶
func (e ExtrinsicPayloadV3) Encode(encoder scale.Encoder) error
Encode implements encoding for ExtrinsicPayloadV3, which just unwraps the bytes of ExtrinsicPayloadV3 without adding a compact length prefix
func (ExtrinsicPayloadV3) Sign ¶
func (e ExtrinsicPayloadV3) Sign(signer signature.KeyringPair) (types.Signature, error)
Sign the extrinsic payload with the given derivation path
type ExtrinsicPayloadV4 ¶
type ExtrinsicPayloadV4 struct { ExtrinsicPayloadV3 TransactionVersion types.U32 AppID types.UCompact }
func (*ExtrinsicPayloadV4) Decode ¶
func (e *ExtrinsicPayloadV4) Decode(decoder scale.Decoder) error
Decode does nothing and always returns an error. ExtrinsicPayloadV4 is only used for encoding, not for decoding
func (ExtrinsicPayloadV4) Sign ¶
func (e ExtrinsicPayloadV4) Sign(signer signature.KeyringPair) (types.Signature, error)
Sign the extrinsic payload with the given derivation path
type ExtrinsicSignatureV4 ¶
type ExtrinsicSignatureV4 struct { Signer types.MultiAddress Signature types.MultiSignature Era ExtrinsicEra // extra via system::CheckEra Nonce types.UCompact // extra via system::CheckNonce (Compact<Index> where Index is u32)) Tip types.UCompact // extra via balances::TakeFees (Compact<Balance> where Balance is u128)) AppID types.UCompact // Avail specific AppID }
type MortalEra ¶
MortalEra for an extrinsic, indicating period and phase
func NewMortalEra ¶
func NewMortalEra(currentBlock types.BlockNumber, blockHashCount types.U64) MortalEra