import type { Address as SolanaAddress, ReadonlyUint8Array } from "@solana/kit"; import type { Chain, Hex, Transport } from "viem"; import type { PrepareUserOperationParameters, SmartAccount } from "viem/account-abstraction"; import type { BaseIntentClient, CombinedIntentRpcSchema } from "../client/intentClient.js"; import type { INTENT_VERSION_TYPE } from "../types/intent.js"; import type { GetIntentReturnType } from "./getIntent.js"; type PrepareUserOperationParametersWithOptionalCalls = Omit, "calls"> & { calls?: calls; }; export type PrepareUserIntentParameters = PrepareUserOperationParametersWithOptionalCalls & { inputTokens?: Array<{ address: Hex; amount?: bigint; chainId: number; }>; outputTokens?: Array<{ address: Hex | SolanaAddress; amount: bigint; chainId: number; }>; /** * Prepared and encoded transactions for solana * Built using : `getCompiledTransactionMessageEncoder().encode(compiledTransactionMessage)` */ solTransaction?: ReadonlyUint8Array; gasToken?: "SPONSORED" | "NATIVE"; chainId?: number; }; export type PrepareUserIntentResult = GetIntentReturnType; /** * Prepares a user intent for execution by converting it to a cross-chain order. * * @param client - Client to use * @param parameters - {@link PrepareUserIntentParameters} * @returns The prepared intent. {@link PrepareUserIntentResult} * * @example * import { createIntentClient, http } from '@zerodev/intent' * import { mainnet } from 'viem/chains' * * const client = createIntentClient({ * chain: mainnet, * transport: http(), * }) * * // Using callData * const intent1 = await client.prepareUserIntent({ * callData: '0x...', * inputTokens: [{ * address: '0x...', * amount: 1000000n, * chainId: 1n * }], * outputTokens: [{ * address: '0x...', * amount: 900000n, * chainId: 10n * }] * }) * * // Using calls * const intent2 = await client.prepareUserIntent({ * calls: [{ * to: '0x...', * value: 1000000n, * data: '0x...' * }], * inputTokens: [{ * address: '0x...', * amount: 1000000n, * chainId: 1n * }], * outputTokens: [{ * address: '0x...', * amount: 900000n, * chainId: 10n * }] * }) */ export declare function prepareUserIntent(client: BaseIntentClient, parameters: PrepareUserIntentParameters, version: INTENT_VERSION_TYPE): Promise; export {}; //# sourceMappingURL=prepareUserIntent.d.ts.map