/** * RelayAdapt Cross-Contract Call Helpers * * Builds relay() transactions for private DeFi operations. * RelayAdapt atomically: unshield → execute calls → shield output. * * On-chain observer sees: "RelayAdapt called a DEX" — zero link to user. */ import type { RailgunTransactionStruct } from './transaction-formatter'; export declare const RELAY_ADAPT_ADDRESS = "0xB0BC6d50098519c2a030661338F82a8792b85404"; export interface ActionData { random: Uint8Array; requireSuccess: boolean; minGasLimit: bigint; calls: Array<{ to: string; data: string; value: bigint; }>; } /** * Generate shield requests for output tokens using RelayAdaptHelper from the engine. * * Each shield request tells RelayAdapt to shield a token back into the privacy pool * for the given Railgun address (0zk...). */ export declare function buildRelayShieldRequests(railgunAddress: string, shieldTokens: Array<{ tokenAddress: string; recipientAddress?: string; }>): Promise<{ shieldRequests: any[]; shieldCallData: string; }>; /** * Compute adaptParams — hash of nullifiers + transaction count + action data. * * This is verified by the contract to ensure the transaction wasn't modified by MITM. * Must be computed BEFORE the ZK proof since it goes into boundParamsHash. */ export declare function computeAdaptParams(nullifiers: string[], actionData: ActionData): string; /** * Build the relay() calldata for RelayAdapt. * * Takes the formatted transaction struct (same as transact()) and wraps it * in relay() with the action data. */ export declare function buildRelayCalldata(transactionStruct: RailgunTransactionStruct, actionData: ActionData): { to: string; data: string; }; /** * Build the full ordered calls array for a cross-contract operation. * * Appends the shield() call at the end so output tokens are shielded * back into the privacy pool after the DeFi operation completes. */ export declare function buildOrderedCalls(userCalls: Array<{ to: string; data: string; value?: string; }>, shieldCallData: string, inputTokenAddress: string, shieldTokens: Array<{ tokenAddress: string; }>): Array<{ to: string; data: string; value: bigint; }>;