import { type Address, type PublicClient, type StateMapping, type StateOverride } from "viem"; import { type SlotHints } from "./slotHints.js"; /** * Compute Permit2 allowance storage slots for the given approvals. * * Permit2 uses: mapping(owner => mapping(token => mapping(spender => PackedAllowance))) * Storage slot 1 is the base slot for the allowance mapping. */ export declare function computePermit2StateDiff(account: Address, approvals: [Address, Address][]): StateMapping; export type GetApprovalOverridesOptions = { /** * Caller-supplied on-chain allowances keyed by `${asset}:${spender}`. * When the supplied allowance is `maxUint256` the approval override for * that pair is skipped entirely (no override, no RPC). */ walletAllowances?: Record<`${Address}:${Address}`, bigint>; /** * Caller-supplied slot hints. When `allowanceSlotIndex` is present for an * asset, the storage slot is computed cryptographically and no probing * RPC fires. */ slotHints?: SlotHints; }; /** * Generate state overrides for ERC20 approvals and Permit2 allowances. * * Resolution order, per asset: * 1. Permit2 storage slots are always derivable cryptographically — no RPC. * 2. Apply caller-supplied `walletAllowances[asset:spender]` — if `maxUint256`, * skip emitting an override entirely. * 3. Use caller-supplied `slotHints[asset].allowanceSlotIndex` → * cryptographic slot, no RPC. * 4. Use cached probed slot index (`fetchErc20SlotHints` cache) → same. * 5. Probe once via `eth_createAccessList`; this handles proxy / namespaced token * layouts without burning many failed state-override reads first. * 6. Fall back to sequential `fetchErc20SlotHints` probing when access-list * discovery is unavailable. */ export declare function getApprovalOverrides(client: PublicClient, account: Address, approvals: [Address, Address][], permit2Address: Address, options?: GetApprovalOverridesOptions): Promise; //# sourceMappingURL=approvalOverrides.d.ts.map