Skip to content

API ReferenceTransactions, wallets, and signaturesType Alias

AnvilTransactionRequest

type AnvilTransactionRequest = Pick<
TransactionRequestBase<bigint, number, string>,
'to' | 'data' | 'value' | 'gas' | 'from'
> &
object;

Minimal unsigned transaction payload produced by the SDK’s build*Transaction helpers and consumed by sendTransaction.

A Pick over viem’s TransactionRequestBase fields, narrowed to what the SDK actually populates, so to/data/value/gas/from track viem’s field names and types (Address/Hex, not bare string; gas, not gasLimit) instead of drifting into an ethers-v5-shaped payload. from is informational only — sendTransaction always sends from the connected wallet account. Deliberately narrower than viem’s full request type (which also carries blob and access-list fields the SDK never populates) so it can be re-wrapped for multisigs or governance proposals.

Type Declaration

chainId?

optional chainId?: bigint;

The chain this transaction was built for.

to and data are only meaningful together with a network: the same address holds different code on different chains, and a payload built against one deployment is arbitrary calldata sent to another. Every transaction the SDK builds carries the chain its address was resolved on, and sendTransaction refuses to submit one whose wallet is somewhere else.

Optional because a transaction can also be hand-built or round-tripped through a multisig or proposal wrapper. Such a transaction is submitted unchecked against this field — a configured profile is still checked against the wallet — so prefer carrying it through any wrapper that re-creates the payload.

This is an SDK-owned field, not viem vocabulary: viem’s chain carries a whole chain definition object, not just the numeric id the SDK needs to stamp and later check.