⚠️ Internal: This API is not publically exported by the package.

Type for transaction body.

interface TransactionBody {
    blockRef: string;
    chainTag: number;
    clauses: TransactionClause[];
    dependsOn: string;
    expiration: number;
    gas: string | number;
    gasPriceCoef: number;
    nonce: string | number;
    reserved?: {
        features?: number;
        unused?: Uint8Array[];
    };
}

Properties

blockRef: string

8 bytes prefix of some block's ID

chainTag: number

Last byte of genesis block ID

Array of clauses

dependsOn: string

ID of another tx that is depended

expiration: number

Constraint of time bucket

gas: string | number

Max gas provided for execution

gasPriceCoef: number

Coefficient applied to base gas price [0,255]

nonce: string | number

Nonce value for various purposes. Basic is to prevent replay attack by make transaction unique. Every transaction with same chainTag, blockRef, ... must have different nonce.

reserved?: {
    features?: number;
    unused?: Uint8Array[];
}

A reserved field intended for features use.

In standard EVM transactions, this reserved field typically is not present. However, it's been designed to cater to VIP-191, which deals with fee delegation.

If the features within the reserved field is set as 1111...111, it indicates that the transaction has been delegated. The method to check if the transaction is delegated is:

reserved.features & 1 === 1

Type declaration

  • Optional features?: number

    Tx feature bits

  • Optional unused?: Uint8Array[]

    Unused

Example

feature = 111101;
isDelegated = (111101 & 111111) === 111101; // false (not delegated)
feature = 111111;
isDelegated = (111111 & 111111) === 111111; // true (delegated)

Remarks

For more information on the subject, refer to VIP-191.