Skip to content
docs

@anywalletkit/tx-preview-evm

npm

What an EVM transaction will do, before it is signed. It also handles an approve → call sequence. The output feeds a review screen:

Terminal window
npm install @anywalletkit/tx-preview-evm
# or: pnpm add @anywalletkit/tx-preview-evm · yarn add @anywalletkit/tx-preview-evm

On npm: @anywalletkit/tx-preview-evm, published from the release workflow with provenance.

  • decoded calls — the recipient, the contract, the method;
  • approvals and transfers: approve, increaseAllowance / increaseApproval, setApprovalForAll, EIP-2612 permit calls, Permit2 approve and permit (single and batch); a permit whose arguments can’t be read is the approval-unparsed warning;
  • simulated balance changes at a pinned block (eth_simulateV1 with transfer tracing, eth_call as the fallback);
  • a verdict made of named checks: unlimited approval, unknown spender, value out, simulation failed…
import { previewEvmTx } from '@anywalletkit/tx-preview-evm'

Pure functions over an injected rpc(method, params). The only dependency is viem.

Docs: Transaction preview

Apache-2.0