Polkadot JS APIGlobals"extrinsic/Extrinsic"Extrinsic

# Class: Extrinsic

name GenericExtrinsic

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

# Hierarchy

  • ExtrinsicBase

    Extrinsic

# Implements

# Index

# Constructors

# Properties

# Accessors

# Methods

# Constructors

# constructor

+ new Extrinsic(registry: Registry, value: Extrinsic | ExtrinsicValue | AnyU8a | Call | undefined, __namedParameters: object): Extrinsic

Overrides void

Defined in packages/types/src/extrinsic/Extrinsic.ts:174

Parameters:

registry: Registry

value: Extrinsic | ExtrinsicValue | AnyU8a | Call | undefined

Default value __namedParameters: object= {}

Name Type
version undefined | number

Returns: Extrinsic

# Properties

# Readonly registry

registry: Registry

Implementation of IExtrinsic.registry

Inherited from Base.registry

Defined in packages/types/src/codec/Base.ts:17

# Accessors

# args

get args(): Codec[]

Inherited from Extrinsic.args

Defined in packages/types/src/extrinsic/Extrinsic.ts:45

description The arguments passed to for the call, exposes args so it is compatible with Call

Returns: Codec[]


# argsDef

get argsDef(): ArgsDef

Inherited from Extrinsic.argsDef

Defined in packages/types/src/extrinsic/Extrinsic.ts:52

description The argument definitions, compatible with Call

Returns: ArgsDef


# callIndex

get callIndex(): Uint8Array

Inherited from Extrinsic.callIndex

Defined in packages/types/src/extrinsic/Extrinsic.ts:59

description The actual [sectionIndex, methodIndex] as used in the Call

Returns: Uint8Array


# data

get data(): Uint8Array

Inherited from Extrinsic.data

Defined in packages/types/src/extrinsic/Extrinsic.ts:66

description The actual data for the Call

Returns: Uint8Array


# encodedLength

get encodedLength(): number

Inherited from Extrinsic.encodedLength

Overrides Base.encodedLength

Defined in packages/types/src/extrinsic/Extrinsic.ts:80

description The length of the value when encoded as a Uint8Array

Returns: number


# era

get era(): ExtrinsicEra

Inherited from Extrinsic.era

Defined in packages/types/src/extrinsic/Extrinsic.ts:73

description The era for this extrinsic

Returns: ExtrinsicEra


# hasOrigin

get hasOrigin(): boolean

Inherited from Extrinsic.hasOrigin

Defined in packages/types/src/extrinsic/Extrinsic.ts:87

description true is method has Origin argument (compatibility with [Call])

Returns: boolean


# hash

get hash(): H256

Inherited from Base.hash

Defined in packages/types/src/codec/Base.ts:36

description returns a hash of the contents

Returns: H256


# isEmpty

get isEmpty(): boolean

Inherited from Base.isEmpty

Defined in packages/types/src/codec/Base.ts:43

description Checks if the value is an empty value

Returns: boolean


# isSigned

get isSigned(): boolean

Inherited from Extrinsic.isSigned

Defined in packages/types/src/extrinsic/Extrinsic.ts:94

description true id the extrinsic is signed

Returns: boolean


# length

get length(): number

Inherited from Extrinsic.length

Defined in packages/types/src/extrinsic/Extrinsic.ts:101

description The length of the actual data, excluding prefix

Returns: number


# meta

get meta(): FunctionMetadataLatest

Inherited from Extrinsic.meta

Defined in packages/types/src/extrinsic/Extrinsic.ts:108

description The FunctionMetadataLatest that describes the extrinsic

Returns: FunctionMetadataLatest


# method

get method(): Call

Inherited from Extrinsic.method

Defined in packages/types/src/extrinsic/Extrinsic.ts:115

description The Call this extrinsic wraps

Returns: Call


# nonce

get nonce(): Compact‹Index›

Inherited from Extrinsic.nonce

Defined in packages/types/src/extrinsic/Extrinsic.ts:122

description The nonce for this extrinsic

Returns: Compact‹Index›


# signature

get signature(): EcdsaSignature | Ed25519Signature | Sr25519Signature

Inherited from Extrinsic.signature

Defined in packages/types/src/extrinsic/Extrinsic.ts:129

description The actual EcdsaSignature, Ed25519Signature or Sr25519Signature

Returns: EcdsaSignature | Ed25519Signature | Sr25519Signature


# signer

get signer(): Address

Inherited from Extrinsic.signer

Defined in packages/types/src/extrinsic/Extrinsic.ts:136

description The Address that signed

Returns: Address


# tip

get tip(): Compact‹Balance›

Inherited from Extrinsic.tip

Defined in packages/types/src/extrinsic/Extrinsic.ts:143

description Forwards compat

Returns: Compact‹Balance›


# type

get type(): number

Inherited from Extrinsic.type

Defined in packages/types/src/extrinsic/Extrinsic.ts:150

description Returns the raw transaction version (not flagged with signing information)

Returns: number


# version

get version(): number

Inherited from Extrinsic.version

Defined in packages/types/src/extrinsic/Extrinsic.ts:157

description Returns the encoded version flag

Returns: number

# Methods

# addSignature

addSignature(signer: Address | Uint8Array | string, signature: Uint8Array | string, payload: ExtrinsicPayloadValue | Uint8Array | string): Extrinsic

Implementation of IExtrinsic

Defined in packages/types/src/extrinsic/Extrinsic.ts:223

description Injects an already-generated signature into the extrinsic

Parameters:

Name Type
signer Address | Uint8Array | string
signature Uint8Array | string
payload ExtrinsicPayloadValue | Uint8Array | string

Returns: Extrinsic


# eq

eq(other?: unknown): boolean

Implementation of IExtrinsic

Inherited from Base.eq

Defined in packages/types/src/codec/Base.ts:50

description Compares the value of the input to see if there is a match

Parameters:

Name Type
other? unknown

Returns: boolean


# sign

sign(account: IKeyringPair, options: SignatureOptions): Extrinsic

Implementation of IExtrinsic

Defined in packages/types/src/extrinsic/Extrinsic.ts:232

description Sign the extrinsic with a specific keypair

Parameters:

Name Type
account IKeyringPair
options SignatureOptions

Returns: Extrinsic


# signFake

signFake(signer: Address | Uint8Array | string, options: SignatureOptions): Extrinsic

Implementation of IExtrinsic

Defined in packages/types/src/extrinsic/Extrinsic.ts:241

describe Adds a fake signature to the extrinsic

Parameters:

Name Type
signer Address | Uint8Array | string
options SignatureOptions

Returns: Extrinsic


# toHex

toHex(isBare?: undefined | false | true): string

Implementation of IExtrinsic

Overrides Base.toHex

Defined in packages/types/src/extrinsic/Extrinsic.ts:250

description Returns a hex string representation of the value

Parameters:

Name Type
isBare? undefined | false | true

Returns: string


# toHuman

toHuman(isExpanded?: undefined | false | true): AnyJson

Implementation of IExtrinsic

Overrides Base.toHuman

Defined in packages/types/src/extrinsic/Extrinsic.ts:257

description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information

Parameters:

Name Type
isExpanded? undefined | false | true

Returns: AnyJson


# toJSON

toJSON(): string

Implementation of IExtrinsic

Overrides Base.toJSON

Defined in packages/types/src/extrinsic/Extrinsic.ts:277

description Converts the Object to JSON, typically used for RPC transfers

Returns: string


# toRawType

toRawType(): string

Implementation of IExtrinsic

Overrides Base.toRawType

Defined in packages/types/src/extrinsic/Extrinsic.ts:284

description Returns the base runtime type name for this instance

Returns: string


# toString

toString(): string

Implementation of IExtrinsic

Inherited from Base.toString

Defined in packages/types/src/codec/Base.ts:78

description Returns the string representation of the value

Returns: string


# toU8a

toU8a(isBare?: undefined | false | true): Uint8Array

Overrides Base.toU8a

Defined in packages/types/src/extrinsic/Extrinsic.ts:292

description Encodes the value as a Uint8Array as per the SCALE specifications

Parameters:

Name Type Description
isBare? undefined | false | true true when the value is not length-prefixed

Returns: Uint8Array