Class: ExternalTransactionEnvelope
The envelope for an external transaction (a transaction sent by a user, a dApp, etc.)
ExternalTransactionEnvelope
Constructors
new ExternalTransactionEnvelope()
new ExternalTransactionEnvelope(param0): ExternalTransactionEnvelope
Creates an instance of ExternalTransactionEnvelope.
Parameters
Parameter | Type | Description |
---|---|---|
| The object representing the external transaction. |
Returns
Defined
@nilfoundation/niljs/src/encoding/externalTransaction.ts:86
Properties
authData
authData: Uint8Array;
The auth data attached to the transaction.
Defined
@nilfoundation/niljs/src/encoding/externalTransaction.ts:54
chainId
chainId: number;
The chain ID.
Defined
@nilfoundation/niljs/src/encoding/externalTransaction.ts:36
data
data: Uint8Array;
The transaction data.
Defined
@nilfoundation/niljs/src/encoding/externalTransaction.ts:48
feeCredit
feeCredit: bigint;
The amount of tokens the user is willing to pay for the transaction.
Defined
@nilfoundation/niljs/src/encoding/externalTransaction.ts:60
isDeploy
isDeploy: boolean;
The flag that determines whether the external transaction is a deployment transaction.
Defined
@nilfoundation/niljs/src/encoding/externalTransaction.ts:24
maxFeePerGas
maxFeePerGas: bigint;
The max fee per gas the user is willing to spend for the transaction.
Defined
@nilfoundation/niljs/src/encoding/externalTransaction.ts:72
maxPriorityFeePerGas
maxPriorityFeePerGas: bigint;
The max tip the user is willing to pay for the transaction.
Defined
@nilfoundation/niljs/src/encoding/externalTransaction.ts:66
seqno
seqno: number;
The transaction sequence number.
Defined
@nilfoundation/niljs/src/encoding/externalTransaction.ts:42
to
to: Uint8Array;
The destination address of the transaction.
Defined
@nilfoundation/niljs/src/encoding/externalTransaction.ts:30
Methods
encode()
encode(): Uint8Array
Encodes the external transaction into a Uint8Array.
Returns
Uint8Array
The encoded external transaction.
Defined
@nilfoundation/niljs/src/encoding/externalTransaction.ts:114
encodeWithSignature()
encodeWithSignature(signer): Promise<object>
Encodes the external transaction with its signature.
Parameters
Parameter | Type | Description |
---|---|---|
| The transaction signer. |
Returns
Promise
<object
>
The object containing the encoded transaction and its hash.
hash
hash: Uint8Array;
raw
raw: Uint8Array;
Async
Defined
@nilfoundation/niljs/src/encoding/externalTransaction.ts:170
hash()
hash(): Uint8Array
Provides the hash tree root of the external transaction.
Returns
Uint8Array
The hash tree root of the external transaction.
Defined
@nilfoundation/niljs/src/encoding/externalTransaction.ts:133
hexAddress()
hexAddress(): 0x${string}
Returns the hex address of the given bytes.
Returns
0x${string}
The hex address.
Defined
@nilfoundation/niljs/src/encoding/externalTransaction.ts:220
send()
send(client): Promise<0x${string}>
Sends the external transaction.
Parameters
Parameter | Type | Description |
---|---|---|
| The client sending the transaction. |
Returns
Promise
<0x${string}
>
The hash of the external transaction.
Defined
@nilfoundation/niljs/src/encoding/externalTransaction.ts:230
sign()
sign(signer): Promise<Uint8Array>
Signs the external transaction.
Parameters
Parameter | Type | Description |
---|---|---|
| The transaction signer. |
Returns
Promise
<Uint8Array
>
The transaction signature.
Async
Defined
@nilfoundation/niljs/src/encoding/externalTransaction.ts:199
signingHash()
signingHash(): Uint8Array
Provides the signing hash of the external transaction.
Returns
Uint8Array
The signing hash of the external transaction.
Defined
@nilfoundation/niljs/src/encoding/externalTransaction.ts:145
updateAuthdata()
updateAuthdata(signer): Promise<Uint8Array>
Updates the authentication data in the external transaction and returns the result.
Parameters
Parameter | Type | Description |
---|---|---|
| The auth data signer. |
Returns
Promise
<Uint8Array
>
The signed auth data.
Async
Defined
@nilfoundation/niljs/src/encoding/externalTransaction.ts:210