Type for transaction input

Types of the properties can differ WRT ethers.TransactionRequest

interface TransactionRequestInput {
    accessList?: any;
    blockRef?: string;
    blockTag?: string;
    chainId?: string;
    chainTag?: number;
    clauses?: TransactionClause[];
    comment?: string;
    customData?: unknown;
    data?: string;
    delegationUrl?: string;
    dependsOn?: string;
    enableCcipRead?: boolean;
    expiration?: number;
    from?: string;
    gas?: string | number;
    gasLimit?: string;
    gasPayer?: string;
    gasPrice?: string;
    gasPriceCoef?: number;
    maxFeePerGas?: string | number;
    maxPriorityFeePerGas?: string | number;
    nonce?: string | number;
    provedWork?: string;
    reserved?: {
        features?: number;
        unused?: Uint8Array[];
    };
    to?: string;
    type?: number;
    value?: string | number;
}

Properties

accessList?: any

The [[link-eip-2930]] access list. Storage slots included in the access list are //warmed// by preloading them, so their initial cost to fetch is guaranteed, but then each additional access is cheaper.

blockRef?: string

8 bytes prefix of some block's ID

blockTag?: string

When using call or estimateGas, this allows a specific block to be queried. Many backends do not support this and when unsupported errors are silently squelched and "latest" is used.

chainId?: string

The chain ID for the network this transaction is valid on.

chainTag?: number

Last byte of genesis block ID

clauses?: TransactionClause[]

Add clauses to ethers.TransactionRequest

comment?: string

A comment describing the transaction request.

customData?: unknown

A custom object, which can be passed along for network-specific values.

data?: string

The transaction data.

delegationUrl?: string

The delegation URL to use to sponsor the transaction.

dependsOn?: string

The ID of the transaction that this transaction depends on.

enableCcipRead?: boolean

When using call, this enables CCIP-read, which permits the provider to be redirected to web-based content during execution, which is then further validated by the contract.

There are potential security implications allowing CCIP-read, as it could be used to expose the IP address or user activity during the fetch to unexpected parties.

expiration?: number

The expiration time of the transaction. The transaction will expire after the number of blocks specified by this value.

from?: string

The sender of the transaction.

gas?: string | number

Transaction gas.

gasLimit?: string

The maximum amount of gas to allow this transaction to consume.

gasPayer?: string

The address that pays for the gas fee of the transaction simulation. If different from the caller, then a delegated transaction is simulated.

gasPrice?: string

The gas price to use for legacy transactions or transactions on legacy networks.

Most of the time the max*FeePerGas is preferred.

gasPriceCoef?: number

Coefficient used to calculate the gas price for the transaction. Value must be between 0 and 255.

maxFeePerGas?: string | number

The [[link-eip-1559]] maximum total fee to pay per gas. The actual value used is protocol enforced to be the block's base fee.

maxPriorityFeePerGas?: string | number

The [[link-eip-1559]] maximum priority fee to pay per gas.

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.

provedWork?: string

The VeChainThor blockchain allows for transaction-level proof of work (PoW) and converts the proved work into extra gas price that will be used by the system to generate more reward to the block generator, the Authority Masternode, that validates the transaction. In other words, users can utilize their local computational power to make their transactions more likely to be included in a new block.

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

  • Optionalfeatures?: number

    Tx feature bits

  • Optionalunused?: Uint8Array[]

    Unused

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

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

to?: string

The target of the transaction.

type?: number

The transaction type.

value?: string | number

The transaction value (in wei).