import { type Hex, type DecodedCall } from './abi.js'; import { type UnpackedUserOp } from './userOpHash.js'; import { type StepUpProof, type StepUpCheck } from './stepup.js'; export { ENTRY_POINT_V07 } from './userOpHash.js'; export declare const ENSO_ROUTERS: Record; export interface RoutedUserIntent { schema: 'flows-routed-userop-intent-v1'; /** The semantic DeFi verb (swap | lend | borrow | ...). Bound for audit + UI; the * gate's safety comes from the router/approve/amount bounds, not the verb string. */ verb: string; chainId: number; router: Hex; tokenIn: Hex; tokenOut: Hex; /** Base units — caps both the approve and the route input. */ amountIn: string; /** Base units — the slippage floor from the quote (bound for audit; outcome * enforcement is Phase B simulation). */ minAmountOut: string; smartAccount: Hex; pkpAddress: Hex; /** Where outputs land — MUST be the smart account itself (no third-party drain). */ receiver: Hex; userOpNonce: string; nonce: number; expiresAt: string; } export type RoutedUserIntentProof = { proof: Extract; credentialPublicKey: Hex; webauthn: { rpId: string; allowedOrigins: string[]; }; } | { proof: Extract; credentialAddress: Hex; }; export declare function routedUserIntentHash(intent: RoutedUserIntent): string; export declare function routedUserIntentChallenge(intent: RoutedUserIntent): Uint8Array; export declare function verifyRoutedUserIntentProof(input: { intent: RoutedUserIntent; intentProof: RoutedUserIntentProof; nowMs?: number; }): StepUpCheck; /** * Fail-closed routed-action policy for the inner calls of a smart-account UserOp. * Returns violations (empty = allowed). Requires a user-signed intent; allows at most * ONE approve (to the vetted router, on tokenIn, ≤ amountIn) and EXACTLY ONE call to * the vetted router; native value 0 on every call; refuses anything else (drain vector). */ export declare function validateEnsoRouteCalls(input: { calls: DecodedCall[]; sender: string; chainId: number; intent?: RoutedUserIntent; pkpAddress?: string; }): string[]; export interface GateResult { ok: boolean; userOpHash: Hex; violations: string[]; } /** * The one call a routed-action signer makes. Recomputes the v0.7 userOpHash, binds it * to `messageRaw`, verifies the user-signed intent proof, decodes the Kernel calls, and * validates them. `ok` true ⇒ the action may sign `userOpHash`. */ export declare function gateRoutedUserOp(input: { userOp: UnpackedUserOp; chainId: number; messageRaw?: string; entryPoint?: string; intent: RoutedUserIntent; intentProof?: RoutedUserIntentProof; pkpAddress?: string; }): GateResult;