Class representing a QiTransaction.

Implements

Extends

  • AbstractTransaction<string>

Implements

  • QiTransactionLike

Constructors

new QiTransaction()

new QiTransaction(): QiTransaction

Creates a new Transaction with default values.

Returns

QiTransaction

Overrides

AbstractTransaction<string>.constructor

Source

transaction/qi-transaction.ts:156

Accessors

chainId

get chainId(): bigint

The chain ID this transaction is valid on.

Returns

bigint

Source

transaction/abstract-transaction.ts:267


destZone

get destZone(): undefined | Zone

Get the zone of the recipient address.

Returns

undefined | Zone

The destination zone.

Source

transaction/qi-transaction.ts:148


digest

get digest(): string

The pre-image hash of this transaction.

This is the digest that a Signer must sign to authorize this transaction.

Returns

string

Source

transaction/abstract-transaction.ts:302


hash

get hash(): null | string

Get the permuted hash of the transaction as specified by QIP-0010.

Throws

If the transaction has no inputs or outputs, or if cross-zone & cross-ledger transactions are not supported.

See

QIP0010

Returns

null | string

The transaction hash.

Source

transaction/qi-transaction.ts:94


isExternal

get isExternal(): boolean

Check if the transaction is external.

Returns

boolean

True if the transaction is external.

Source

transaction/abstract-transaction.ts:404


originZone

get originZone(): undefined | Zone

Get the zone of the sender address.

Returns

undefined | Zone

The origin zone.

Source

transaction/qi-transaction.ts:136


serialized

get serialized(): string

The serialized transaction.

This throws if the transaction is unsigned. For the pre-image, use unsignedSerialized .

Returns

string

Source

transaction/abstract-transaction.ts:328


signature

get signature(): S

If signed, the signature for this transaction.

Returns

S

Source

transaction/abstract-transaction.ts:277


txInputs

get txInputs(): TxInput[]

Get transaction inputs.

set txInputs(value): void

Set transaction inputs.

Throws

If the value is not an array.

Parameters

ParameterTypeDescription
valuenull | TxInput[]The transaction inputs.

Returns

TxInput[]

The transaction inputs.

Source

transaction/qi-transaction.ts:47


txOutputs

get txOutputs(): TxOutput[]

Get transaction outputs.

set txOutputs(value): void

Set transaction outputs.

Throws

If the value is not an array.

Parameters

ParameterTypeDescription
valuenull | TxOutput[]The transaction outputs.

Returns

TxOutput[]

The transaction outputs.

Source

transaction/qi-transaction.ts:69


type

get type(): null | number

The transaction type.

If null, the type will be automatically inferred based on explicit properties.

Returns

null | number

Source

transaction/abstract-transaction.ts:227


typeName

get typeName(): null | string

The name of the transaction type.

Returns

null | string

Source

transaction/abstract-transaction.ts:251


unsignedSerialized

get unsignedSerialized(): string

The transaction pre-image.

The hash of this is the digest which needs to be signed to authorize this transaction.

Returns

string

Source

transaction/abstract-transaction.ts:343

Methods

clone()

clone(): QiTransaction

Create a copy of this transaction.

Returns

QiTransaction

The cloned transaction.

Overrides

AbstractTransaction.clone

Source

transaction/qi-transaction.ts:187


inferType()

inferType(): number

Return the most “likely” type; currently the highest supported transaction type.

Returns

number

The inferred transaction type.

Inherited from

AbstractTransaction.inferType

Source

transaction/abstract-transaction.ts:352


inferTypes()

inferTypes(): number[]

Validates the explicit properties and returns a list of compatible transaction types.

Returns

number[]

The compatible transaction types.

Overrides

AbstractTransaction.inferTypes

Source

transaction/qi-transaction.ts:167


isSigned()

isSigned(): this is AbstractTransaction<string> & Object

Returns true if signed.

This provides a Type Guard that properties requiring a signed transaction are non-null.

Returns

this is AbstractTransaction<string> & Object

Indicates if the transaction is signed.

Inherited from

AbstractTransaction.isSigned

Source

transaction/abstract-transaction.ts:313


toJSON()

toJSON(): TransactionLike

Return a JSON-friendly object.

Returns

TransactionLike

The JSON-friendly object.

Overrides

AbstractTransaction.toJSON

Source

transaction/qi-transaction.ts:196


toProtobuf()

toProtobuf(includeSignature?): ProtoTransaction

Return a protobuf-friendly JSON object.

Parameters

ParameterTypeDefault valueDescription
includeSignature?booleantrueWhether to include the signature. Default is true

Returns

ProtoTransaction

The protobuf-friendly JSON object.

Overrides

AbstractTransaction.toProtobuf

Source

transaction/qi-transaction.ts:220


from()

static from(tx): QiTransaction

Create a Transaction from a serialized transaction or a Transaction-like object.

Parameters

ParameterTypeDescription
txstring | QiTransactionLikeThe transaction to decode.

Returns

QiTransaction

The decoded transaction.

Throws

If the transaction is unsigned and defines a hash.

Source

transaction/qi-transaction.ts:255


fromProto()

static fromProto(protoTx): QiTransaction

Create a Transaction from a ProtoTransaction object.

Parameters

ParameterTypeDescription
protoTxProtoTransactionThe transaction to decode.

Returns

QiTransaction

The decoded transaction.

Source

transaction/qi-transaction.ts:291