/** * Fee Escrow — EIP-712 signing, fee calculation, and nonce fetching * for the on-chain FeeEscrow contract. * * The escrow is completely optional. When feeBps=0, none of this code runs. */ import type { ExchangeVersion, FeeAuthRequest } from './types.js'; /** Return the FeeEscrow contract address for a given exchange version. * V1 = USDC.e collateral; V2 = pUSD collateral. */ export declare function feeEscrowAddressFor(version: ExchangeVersion): string; /** * Calculate fee amount in raw USDC (6 decimals). * * @param price - Order price (e.g. 0.55) * @param size - Order size in tokens (e.g. 100) * @param feeBps - Fee in basis points (e.g. 50 = 0.5%) * @returns Fee amount as bigint in raw USDC units */ export declare function calculateFee(price: number, size: number, feeBps: number): bigint; /** * Generate a random bytes32 escrow order ID. * This is independent of Polymarket's orderId — it's a fee-escrow-specific key. */ export declare function generateEscrowOrderId(): string; /** * Fetch the current nonce for a signer from a FeeEscrow contract via eth_call. * * Pass `feeEscrowAddressFor(exchangeVersion)` for `escrowAddress` when the * caller's exchange version is known — V1 and V2 nonces are tracked * independently on separate contracts. */ export declare function fetchEscrowNonce(rpcUrl: string, signerAddress: string, escrowAddress?: string): Promise; /** * Sign a FeeAuth EIP-712 message using the normalized signer. * * `exchangeVersion` selects the EIP-712 domain and the routing hint for the * cosigner. V1 (default): signs against ("PolyNodeFeeEscrow", "1", V1 contract) * and omits `escrow_contract` so the cosigner uses its V1 operator. V2: signs * against ("PolyNodeFeeEscrowV2", "2", V2 contract) and sets * `escrow_contract` to the V2 address so the cosigner routes to the V2 operator. * * @param clobSigner - The signer object (viem WalletClient, ethers Signer, or RouterSigner) * @param params - FeeAuth parameters * @returns Signed FeeAuthRequest ready for the cosigner */ export declare function signFeeAuth(clobSigner: any, params: { escrowOrderId: string; payer: string; signerAddress: string; feeAmount: bigint; deadline: number; nonce: number; affiliate?: string; affiliateShareBps?: number; exchangeVersion?: ExchangeVersion; }): Promise; //# sourceMappingURL=escrow.d.ts.map