name: Extrinsic
description: Representation of an Extrinsic in the system. It contains the actual call, (optional) signature and encodes with an actual length prefix
https://github.com/paritytech/wiki/blob/master/Extrinsic.md#the-extrinsic-format-for-node.
Can be:
- signed, to create a transaction
- left as is, to create an inherent
Type parameters
S : ConstructorDef
T : object
V : object
E : object
Hierarchy
↳ Struct
↳ Extrinsic
Implements
Constructors
constructor
⊕ new Extrinsic(value?: ExtrinsicValue | AnyU8a | Method): Extrinsic
Overrides Struct.constructor
Defined in Extrinsic.ts:36
Parameters:
| Name | Type | ||
|---|---|---|---|
Optional value |
ExtrinsicValue |
AnyU8a | Method |
Returns: Extrinsic
Accessors
Type
getType(): E
Defined in codec/Struct.ts:142
description: Returns the Type description to sthe structure
Returns: E
args
getargs(): Array<Codec>
Defined in Extrinsic.ts:76
description: The arguments passed to for the call, exposes args so it is compatible with Method
Returns: Array<Codec>
callIndex
getcallIndex(): Uint8Array
Defined in Extrinsic.ts:83
description: The actual [sectionIndex, methodIndex] as used in the Method
Returns: Uint8Array
data
getdata(): Uint8Array
Defined in Extrinsic.ts:90
description: The actual data for the Method
Returns: Uint8Array
encodedLength
getencodedLength(): number
Overrides Struct.encodedLength
Defined in Extrinsic.ts:97
description: The length of the value when encoded as a Uint8Array
Returns: number
hash
gethash(): Hash
Defined in Extrinsic.ts:106
description: Convernience function, encodes the extrinsic and returns the actual hash
Returns: Hash
isSigned
getisSigned(): boolean
Defined in Extrinsic.ts:115
description: true id the extrinsic is signed
Returns: boolean
length
getlength(): number
Defined in Extrinsic.ts:122
description: The length of the encoded value
Returns: number
meta
getmeta(): FunctionMetadata
Defined in Extrinsic.ts:129
description: The FunctionMetadata that describes the extrinsic
Returns: FunctionMetadata
method
getmethod(): Method
Defined in Extrinsic.ts:136
description: The Method this extrinsic wraps
Returns: Method
signature
getsignature(): ExtrinsicSignature
Defined in Extrinsic.ts:143
description: The ExtrinsicSignature
Returns: ExtrinsicSignature
Methods
addSignature
▸ addSignature(signer: Address | Uint8Array, signature: Uint8Array, nonce: AnyNumber, era?: Uint8Array): Extrinsic
Defined in Extrinsic.ts:150
description: Add an ExtrinsicSignature to the extrinsic (already generated)
Parameters:
| Name | Type | |
|---|---|---|
| signer | Address | Uint8Array |
| signature | Uint8Array |
|
| nonce | AnyNumber | |
Optional era |
Uint8Array |
Returns: Extrinsic
get
▸ get(name: keyof S): Codec | undefined
Overrides Map.get
Defined in codec/Struct.ts:159
description: Returns a specific names entry in the structure
Parameters:
| Name | Type | Description |
|---|---|---|
| name | keyof S |
The name of the entry to retrieve |
Returns: Codec | undefined
getAtIndex
▸ getAtIndex(index: number): Codec
Inherited from Struct.getAtIndex
Defined in codec/Struct.ts:166
description: Returns the values of a member at a specific index (Rather use get(name) for performance)
Parameters:
| Name | Type |
|---|---|
| index | number |
Returns: Codec
sign
▸ sign(signerPair: KeyringPair, nonce: AnyNumber, blockHash: AnyU8a, era?: Uint8Array): Extrinsic
Defined in Extrinsic.ts:159
description: Sign the extrinsic with a specific keypair
Parameters:
| Name | Type |
|---|---|
| signerPair | KeyringPair |
| nonce | AnyNumber |
| blockHash | AnyU8a |
Optional era |
Uint8Array |
Returns: Extrinsic
toArray
▸ toArray(): Array<Codec>
Defined in codec/Struct.ts:173
description: Converts the Object to an standard JavaScript Array
Returns: Array<Codec>
toHex
▸ toHex(): string
Defined in Extrinsic.ts:168
description: Returns a hex string representation of the value
Returns: string
toJSON
▸ toJSON(): any
Implementation of Codec.toJSON
Defined in Extrinsic.ts:175
description: Converts the Object to JSON, typically used for RPC transfers
Returns: any
toString
▸ toString(): string
Implementation of Codec.toString
Inherited from Struct.toString
Defined in codec/Struct.ts:201
description: Returns the string representation of the value
Returns: string
toU8a
▸ toU8a(isBare?: undefined | false | true): Uint8Array
Defined in Extrinsic.ts:183
description: Encodes the value as a Uint8Array as per the parity-codec specifications
Parameters:
| Name | Type | Description | ||
|---|---|---|---|---|
Optional isBare |
undefined |
false |
true |
true when the value has none of the type-specific prefixes (internal) |
Returns: Uint8Array
<Static> decodeExtrinsic
▸ decodeExtrinsic(value: ExtrinsicValue | AnyU8a | Method): ExtrinsicValue | Array<number> | Uint8Array
Defined in Extrinsic.ts:44
Parameters:
| Name | Type | ||
|---|---|---|---|
| value | ExtrinsicValue |
AnyU8a | Method |
Returns: ExtrinsicValue | Array<number> | Uint8Array
<Static> with
▸ with<S>(Types: S): Constructor<Struct<S>>
Defined in codec/Struct.ts:122
Type parameters:
S : ConstructorDef
Parameters:
| Name | Type |
|---|---|
| Types | S |
Returns: Constructor<Struct<S>>