Skip to main content

Class: EvmChainSigner

Defined in: evm-client/src/chain-signer.ts:58

EVM implementation of OvercastChainSigner: takes the { to, data, value } an EvmWriter builds and turns it into a mined, status-checked receipt.

What it deliberately does not fill in

The writer leaves gas, nonce and the fee fields unset, and this class keeps them unset. Filling them is sendTransaction's job and it does it against live state — for a local account viem runs prepareTransactionRequest (nonce from the pending count, gas from eth_estimateGas, fees from the base fee), and for a JSON-RPC account the wallet does the same and gets to show the user what it chose. Pre-computing any of it here would only mean a staler number.

account and chain are passed on every send rather than baked into the client, so a caller-supplied EvmConfig.walletClient works as-is instead of having to be re-created with our generics. Passing chain is also what arms viem's pre-send check that the node's chain id matches the one the config describes — the cheap guard against submitting to the wrong network.

A signer is only built when it can sign

Unlike Solana's, this class has no keyless mode: EvmFactory hands one to the app only when the provider can sign, and a read-only app has none at all (app.chain's writes throw MissingSignerError, while its reads and app.chain.txBuilder work unchanged). It needs no keyless mode because it owns nothing else — the connection every other component runs on lives on the EvmProvider.

Extends​

Constructors​

Constructor​

new EvmChainSigner(provider): EvmChainSigner;

Defined in: evm-client/src/chain-signer.ts:80

Parameters​

ParameterTypeDescription
providerEvmProviderthe shared EvmProvider. Must be able to sign — build one from a config carrying an account, a walletClient or a privateKey.

Returns​

EvmChainSigner

Throws​

when the provider is read-only, rather than deferring the failure to the first submit.

Overrides​

OvercastChainSigner<EvmLayer>.constructor

Properties​

account​

readonly account: Account;

Defined in: evm-client/src/chain-signer.ts:60

The account every transaction is sent as, and paid for by.


chain​

readonly chain: Chain;

Defined in: evm-client/src/chain-signer.ts:63

Asserted against the node's chain id before each send.


config​

config: EvmConfig<string>;

Defined in: overcast-core/dist/layer/chain-signer.d.ts:25

Inherited from​

OvercastChainSigner.config

confirmations​

readonly confirmations: number;

Defined in: evm-client/src/chain-signer.ts:66

Blocks waited for before a receipt is returned. See EvmConfig.txConfirmations.


receiptPollInterval​

readonly receiptPollInterval: number;

Defined in: evm-client/src/chain-signer.ts:69

How often the receipt is re-checked. See EvmConfig.receiptPollInterval.

Accessors​

address​

Get Signature​

get address(): Address;

Defined in: evm-client/src/chain-signer.ts:100

The signing account's checksummed address (sender + fee payer).

Returns​

Address

Overrides​

OvercastChainSigner.address

Methods​

submit()​

submit(tx): Promise<{
confirmed: boolean;
description?: string;
evmReceipt: TransactionReceipt;
hash: string;
}>;

Defined in: evm-client/src/chain-signer.ts:118

Send a built transaction and wait for its receipt.

A transaction that was mined but reverted comes back as confirmed: false, not as a throw: it is on chain, so there is a real receipt to hand over, and evmReceipt carries the diagnostic (gas used, and the logs that are conspicuously absent). Check confirmed before treating a write as having happened.

The revert reason of a mined revert is not in the receipt — eth_getTransactionReceipt carries no return data, so recovering it means replaying the call at the mined block (publicClient.call({ ...tx, blockNumber })). Left to the caller, who knows whether that extra round trip is worth it.

Parameters​

ParameterType
txTransactionRequest & object

Returns​

Promise<{ confirmed: boolean; description?: string; evmReceipt: TransactionReceipt; hash: string; }>

Overrides​

OvercastChainSigner.submit

submitAll()​

submitAll(txs): Promise<object[]>;

Defined in: evm-client/src/chain-signer.ts:196

Submit several transactions in order, each fully mined before the next is sent.

Sequential rather than batched, which is the opposite of Solana's sendAll, for two reasons that both come from EVM's per-account nonce. Sending concurrently would race to claim the same nonce, so a batch would have to assign them by hand; and eth_estimateGas runs against latest state, so a transaction that depends on an earlier one in the batch (the usual case here — deposit, then create an offer against the deposited balance) estimates against a world where the earlier one has not happened and reverts on estimation.

The cost is one block of latency per transaction. Anything that needs them in a single block wants a batched submitter (a multicall, or a bundler) supplied through EvmConfig.walletClient, not a faster loop here.

The returned array is 1:1 with txs, each entry carrying its own confirmed, so a revert part-way through does not stop the run — but note that on EVM there is no rollback, and a later transaction that depended on a reverted earlier one will usually fail gas estimation and throw from here, leaving the ones already submitted submitted.

Parameters​

ParameterType
txsTransactionRequest & object[]

Returns​

Promise<object[]>

Overrides​

OvercastChainSigner.submitAll