/** * One-time ERC-20 `approve(Permit2, amount)` helper for the `upto` scheme. * * The Permit2 contract must be allowed to pull the payer's USDC before any * `PermitWitnessTransferFrom` signature is settle-able on-chain. Each payer * needs to do this exactly once per (token, chain). * * `ethers` is imported lazily so that browsers / serverless functions that * only sign (and never broadcast) don't pull it into their bundle. Install * `ethers@^6` to use this helper. */ /** Approval result. `skipped: true` means the allowance was already sufficient. */ export interface ApprovePermit2Result { skipped: boolean; txHash?: string; allowanceBefore: string; allowanceAfter: string; } export interface ApprovePermit2Options { /** HTTP(S) RPC endpoint for the target EVM chain. */ rpcUrl: string; /** Hex private key (with or without `0x` prefix). */ privateKey: string; /** ERC-20 token contract (USDC on Base is `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`). */ tokenAddress: string; /** Allowance to set. Defaults to `2**256 - 1` (the Uniswap/x402 convention). */ amount?: bigint; /** Override Permit2 address (defaults to the canonical CREATE2 deployment). */ permit2Address?: string; } /** * Submit a one-time `ERC20.approve(Permit2, amount)` transaction. * * Idempotent: if the existing allowance already meets or exceeds `amount`, * no transaction is broadcast and `skipped: true` is returned. */ export declare function approvePermit2(opts: ApprovePermit2Options): Promise;