참고: 이 페이지는 아직 한국어로 번역되지 않았습니다. 아래는 영어 원문입니다.
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:185

Accessors

chainId

get chainId(): bigint
The chain ID this transaction is valid on.

Returns

bigint

Source

transaction/abstract-transaction.ts:275

data

get data(): Uint8Array
Get transaction data.
set data(value): void
Set transaction data.

Parameters

ParameterTypeDescription
valuenull | Uint8ArrayThe transaction data.

Returns

Uint8Array The transaction data.

Source

transaction/qi-transaction.ts:99

destZone

get destZone(): undefined | Zone
Get the zone of the recipient address.

Returns

undefined | Zone The destination zone.

Source

transaction/qi-transaction.ts:177

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:310

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:121

isExternal

get isExternal(): boolean
Check if the transaction is external.

Returns

boolean True if the transaction is external.

Source

transaction/abstract-transaction.ts:412

originZone

get originZone(): undefined | Zone
Get the zone of the sender address.

Returns

undefined | Zone The origin zone.

Source

transaction/qi-transaction.ts:165

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:336

signature

get signature(): S
If signed, the signature for this transaction.

Returns

S

Source

transaction/abstract-transaction.ts:285

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:55

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:77

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:235

typeName

get typeName(): null | string
The name of the transaction type.

Returns

null | string

Source

transaction/abstract-transaction.ts:259

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:351

Methods

clone()

clone(): QiTransaction
Create a copy of this transaction.

Returns

QiTransaction The cloned transaction.

Overrides

AbstractTransaction.clone

Source

transaction/qi-transaction.ts:217

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:360

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:197

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:321

toJSON()

toJSON(): TransactionLike
Return a JSON-friendly object.

Returns

TransactionLike The JSON-friendly object.

Overrides

AbstractTransaction.toJSON

Source

transaction/qi-transaction.ts:226

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:251

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:287

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:326