Thrown when a transaction cannot proceed because the account lacks enough
native currency to cover its total cost (gas * fee + value) on the
destination chain. Mirrors viem's InsufficientFundsError and the Salt
API's INSUFFICIENT_FUNDS code — the shortfall may be the gas, the
transfer value, or both.
The transaction is paid for by the account itself (its
SaltAccount.publicKey), not by the signer — the signer only
coordinates signing off-chain. To check funding ahead of time, read the
account's balance directly with the same viem PublicClient passed to
submitTx.
Subclasses SaltCeremonyError, so existing
err instanceof SaltCeremonyError handlers keep catching it; use
err instanceof InsufficientFunds to handle this case specifically.
Example: Handling insufficient funds and checking balance ahead of time
// Optional pre-check: the account pays, on the destination chain constbalance = awaitpublicClient.getBalance({ address:account.publicKey }); if (balance < parseEther('0.11')) { // value + gas headroom console.warn('Account may not afford this tx:', formatEther(balance)); }
Thrown when a transaction cannot proceed because the account lacks enough native currency to cover its total cost (
gas * fee + value) on the destination chain. Mirrors viem'sInsufficientFundsErrorand the Salt API'sINSUFFICIENT_FUNDScode — the shortfall may be the gas, the transfer value, or both.The transaction is paid for by the account itself (its SaltAccount.publicKey), not by the signer — the signer only coordinates signing off-chain. To check funding ahead of time, read the account's balance directly with the same viem
PublicClientpassed tosubmitTx.Subclasses SaltCeremonyError, so existing
err instanceof SaltCeremonyErrorhandlers keep catching it; useerr instanceof InsufficientFundsto handle this case specifically.Example: Handling insufficient funds and checking balance ahead of time