QiTransaction
Class representing a QiTransaction.
Implements
Extends
AbstractTransaction
<string
>
Implements
QiTransactionLike
Constructors
new QiTransaction()
Creates a new Transaction with default values.
Returns
Overrides
AbstractTransaction<string>.constructor
Source
transaction/qi-transaction.ts:158
Accessors
chainId
The chain ID this transaction is valid on.
Returns
bigint
Source
transaction/abstract-transaction.ts:280
destZone
Get the zone of the recipient address.
Returns
undefined
| Zone
The destination zone.
Source
transaction/qi-transaction.ts:150
digest
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:315
hash
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
Returns
null
| string
The transaction hash.
Source
transaction/qi-transaction.ts:94
isExternal
Check if the transaction is external.
Returns
boolean
True if the transaction is external.
Source
transaction/abstract-transaction.ts:417
originZone
Get the zone of the sender address.
Returns
undefined
| Zone
The origin zone.
Source
transaction/qi-transaction.ts:138
serialized
The serialized transaction.
This throws if the transaction is unsigned. For the pre-image, use unsignedSerialized .
Returns
string
Source
transaction/abstract-transaction.ts:341
signature
If signed, the signature for this transaction.
Returns
S
Source
transaction/abstract-transaction.ts:290
txInputs
Get transaction inputs.
Set transaction inputs.
Throws
If the value is not an array.
Parameters
Parameter | Type | Description |
---|---|---|
value | null | TxInput [] | The transaction inputs. |
Returns
TxInput
[]
The transaction inputs.
Source
transaction/qi-transaction.ts:47
txOutputs
Get transaction outputs.
Set transaction outputs.
Throws
If the value is not an array.
Parameters
Parameter | Type | Description |
---|---|---|
value | null | TxOutput [] | The transaction outputs. |
Returns
TxOutput
[]
The transaction outputs.
Source
transaction/qi-transaction.ts:69
type
The transaction type.
If null, the type will be automatically inferred based on explicit properties.
Returns
null
| number
Source
transaction/abstract-transaction.ts:240
typeName
The name of the transaction type.
Returns
null
| string
Source
transaction/abstract-transaction.ts:264
unsignedSerialized
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:356
Methods
clone()
Create a copy of this transaction.
Returns
The cloned transaction.
Overrides
AbstractTransaction.clone
Source
transaction/qi-transaction.ts:189
inferType()
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:365
inferTypes()
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:169
isSigned()
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:326
toJSON()
Return a JSON-friendly object.
Returns
The JSON-friendly object.
Overrides
AbstractTransaction.toJSON
Source
transaction/qi-transaction.ts:198
toProtobuf()
Return a protobuf-friendly JSON object.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
includeSignature ? | boolean | true | Whether to include the signature. Default is true |
Returns
ProtoTransaction
The protobuf-friendly JSON object.
Overrides
AbstractTransaction.toProtobuf
Source
transaction/qi-transaction.ts:222
from()
Create a Transaction from a serialized transaction or a Transaction-like object.
Parameters
Parameter | Type | Description |
---|---|---|
tx | string | QiTransactionLike | The transaction to decode. |
Returns
The decoded transaction.
Throws
If the transaction is unsigned and defines a hash.
Source
transaction/qi-transaction.ts:257
fromProto()
Create a Transaction from a ProtoTransaction object.
Parameters
Parameter | Type | Description |
---|---|---|
protoTx | ProtoTransaction | The transaction to decode. |
Returns
The decoded transaction.
Source
Was this page helpful?