注意: 此页面尚未翻译成中文。以下内容为英文原版。
Represents a Quai transaction.

Extends

Implements

  • QuaiTransactionLike

Constructors

new QuaiTransaction()

new QuaiTransaction(from?): QuaiTransaction
Creates a new Transaction with default values.

Parameters

ParameterTypeDescription
from?stringThe sender address.

Returns

QuaiTransaction

Overrides

AbstractTransaction<Signature>.constructor

Source

transaction/quai-transaction.ts:273

Accessors

accessList

get accessList(): null | AccessList
The access list. An access list permits discounted (but pre-paid) access to bytecode and state variable access within contract execution.

Returns

null | AccessList

Source

transaction/quai-transaction.ts:257

chainId

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

Returns

bigint

Source

transaction/abstract-transaction.ts:275

data

get data(): string
The transaction data. For init transactions this is the deployment code.

Returns

string

Source

transaction/quai-transaction.ts:230

destZone

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

Returns

undefined | Zone

Source

transaction/quai-transaction.ts:180

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

gasLimit

get gasLimit(): bigint
The gas limit.

Returns

bigint

Source

transaction/quai-transaction.ts:202

gasPrice

get gasPrice(): null | bigint
The maximum total fee per unit of gas to pay. On legacy networks this should be null.

Returns

null | bigint

Source

transaction/quai-transaction.ts:214

hash

get hash(): null | string
The permuted hash of the transaction as specified by QIP-0010.

Throws

If the transaction is not signed.

Returns

null | string

Source

transaction/quai-transaction.ts:135

isExternal

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

Returns

boolean True if the transaction is external.

Source

transaction/abstract-transaction.ts:412

nonce

get nonce(): number
The transaction nonce.

Returns

number

Source

transaction/quai-transaction.ts:190

originZone

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

Returns

undefined | Zone

Source

transaction/quai-transaction.ts:170

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

to

get to(): null | string
The to address for the transaction or null if the transaction is an init transaction.

Returns

null | string

Source

transaction/quai-transaction.ts:120

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

value

get value(): bigint
The amount of ether to send in this transactions.

Returns

bigint

Source

transaction/quai-transaction.ts:242

Methods

clone()

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

Returns

QuaiTransaction The cloned transaction.

Overrides

AbstractTransaction.clone

Source

transaction/quai-transaction.ts:317

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/quai-transaction.ts:290

isSigned()

isSigned(): this is AbstractTransaction<Signature> & Object
Returns true if signed. This provides a Type Guard that properties requiring a signed transaction are non-null.

Returns

this is AbstractTransaction<Signature> & Object Indicates if the transaction is signed.

Inherited from

AbstractTransaction.isSigned

Source

transaction/abstract-transaction.ts:321

toJSON()

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

Returns

QuaiTransactionLike The JSON-friendly object.

Overrides

AbstractTransaction.toJSON

Source

transaction/quai-transaction.ts:326

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/quai-transaction.ts:356

from()

static from(tx): QuaiTransaction
Create a Transaction from a serialized transaction or a Transaction-like object.

Parameters

ParameterTypeDescription
txstring | QuaiTransactionLikeThe transaction to decode.

Returns

QuaiTransaction The decoded transaction.

Source

transaction/quai-transaction.ts:394

fromProto()

static fromProto(protoTx): QuaiTransaction
Create a Transaction from a ProtoTransaction object.

Parameters

ParameterTypeDescription
protoTxProtoTransactionThe transaction to decode.

Returns

QuaiTransaction The decoded transaction.

Source

transaction/quai-transaction.ts:456