import { type Address, type Chain } from 'viem'; import type { IntentOpElement } from '../orchestrator/types'; import type { RhinestoneConfig } from '../types'; import type { BatchPermit2Result, MultiChainPermit2Config, MultiChainPermit2Result, TokenPermissions } from './types'; declare function getTypedData(element: IntentOpElement, nonce: bigint, expires: bigint): { readonly domain: { readonly name: "Permit2"; readonly chainId: number; readonly verifyingContract: "0x000000000022D473030F116dDEE9F6B43aC78BA3"; }; readonly types: { readonly TokenPermissions: readonly [{ readonly name: "token"; readonly type: "address"; }, { readonly name: "amount"; readonly type: "uint256"; }]; readonly Token: readonly [{ readonly name: "token"; readonly type: "address"; }, { readonly name: "amount"; readonly type: "uint256"; }]; readonly Target: readonly [{ readonly name: "recipient"; readonly type: "address"; }, { readonly name: "tokenOut"; readonly type: "Token[]"; }, { readonly name: "targetChain"; readonly type: "uint256"; }, { readonly name: "fillExpiry"; readonly type: "uint256"; }]; readonly Ops: readonly [{ readonly name: "to"; readonly type: "address"; }, { readonly name: "value"; readonly type: "uint256"; }, { readonly name: "data"; readonly type: "bytes"; }]; readonly Op: readonly [{ readonly name: "vt"; readonly type: "bytes32"; }, { readonly name: "ops"; readonly type: "Ops[]"; }]; readonly Mandate: readonly [{ readonly name: "target"; readonly type: "Target"; }, { readonly name: "minGas"; readonly type: "uint128"; }, { readonly name: "originOps"; readonly type: "Op"; }, { readonly name: "destOps"; readonly type: "Op"; }, { readonly name: "q"; readonly type: "bytes32"; }]; readonly PermitBatchWitnessTransferFrom: readonly [{ readonly name: "permitted"; readonly type: "TokenPermissions[]"; }, { readonly name: "spender"; readonly type: "address"; }, { readonly name: "nonce"; readonly type: "uint256"; }, { readonly name: "deadline"; readonly type: "uint256"; }, { readonly name: "mandate"; readonly type: "Mandate"; }]; }; readonly primaryType: "PermitBatchWitnessTransferFrom"; readonly message: { readonly permitted: TokenPermissions[]; readonly spender: `0x${string}`; readonly nonce: bigint; readonly deadline: bigint; readonly mandate: { readonly target: { readonly recipient: `0x${string}`; readonly tokenOut: { token: `0x${string}`; amount: bigint; }[]; readonly targetChain: bigint; readonly fillExpiry: bigint; }; readonly minGas: bigint; readonly originOps: import("../orchestrator/types").Op; readonly destOps: import("../orchestrator/types").Op; readonly q: `0x${string}`; }; }; }; declare function checkERC20AllowanceDirect(owner: Address, spender: Address, tokenAddress: Address, publicClient: any): Promise; declare function checkERC20Allowance(tokenAddress: Address, chain: Chain, config: RhinestoneConfig): Promise; /** * Get the Permit2 contract address * @returns The Permit2 contract address */ declare function getPermit2Address(): Address; /** * Signs permit2 calls across multiple chains using batch approach. * Collects all signatures first, then returns them all at once. * * This approach is efficient for backend signers but may be memory-intensive * for frontend applications with many chains. * * @param configs - Array of permit2 signing configurations for different chains * @returns Promise - All signatures collected */ declare function signPermit2Batch(configs: MultiChainPermit2Config[]): Promise; /** * Signs permit2 calls across multiple chains sequentially. * Signs one by one, useful for frontend applications to avoid memory issues. * * This approach is more memory-efficient for frontend applications but slower * due to sequential processing. * * @param configs - Array of permit2 signing configurations for different chains * @param onProgress - Optional callback for progress updates * @returns Promise - All signatures collected */ declare function signPermit2Sequential(configs: MultiChainPermit2Config[], onProgress?: (completed: number, total: number, current: MultiChainPermit2Result) => void): Promise; export { getTypedData, checkERC20Allowance, checkERC20AllowanceDirect, getPermit2Address, signPermit2Batch, signPermit2Sequential, type MultiChainPermit2Config, type MultiChainPermit2Result, type BatchPermit2Result, }; //# sourceMappingURL=permit2.d.ts.map