import type { MiniKit as MiniKitType } from "@worldcoin/minikit-js"; import { Logger } from "@atxp/common"; import { WorldchainAccount } from "./worldchainAccount.js"; /** * Loads and initializes a Worldchain account with MiniKit integration * * This function creates a Worldchain account that can interact with the World Chain network * using MiniKit for transaction signing and wallet operations. It sets up a custom provider * that handles various Ethereum JSON-RPC methods through MiniKit's interface. * * @param walletAddress - The wallet address to use for the account * @param logger - Optional logger instance for debugging and monitoring * @param customRpcUrl - Optional custom RPC URL for Worldchain. If not provided, uses the public RPC endpoint * @param chainId - Optional chain ID (defaults to 480 for mainnet, can be 4801 for sepolia) * @param miniKit - The MiniKit instance to use for transactions and signing * @returns Promise that resolves to an initialized WorldchainAccount instance * * @example * ```typescript * // Using public RPC endpoint (mainnet) * const account = await createMiniKitWorldchainAccount({ * walletAddress: "0x1234...", * logger: new ConsoleLogger(), * miniKit: MiniKit * }); * * // Using sepolia testnet * const account = await createMiniKitWorldchainAccount({ * walletAddress: "0x1234...", * logger: new ConsoleLogger(), * chainId: 4801, * miniKit: MiniKit * }); * ``` * * @remarks * The function creates a custom provider that supports: * - `eth_accounts`: Returns the wallet address * - `eth_chainId`: Returns Worldchain chain ID (configurable) * - `eth_requestAccounts`: Returns the wallet address * - `eth_sendTransaction`: Handles USDC transfers and other transactions via MiniKit * - `personal_sign`: Signs messages using MiniKit * * The account is configured with: * - 10 USDC allowance * - 30-day period for permissions * - Worldchain RPC endpoint (public or custom) * - Regular wallet mode (no ephemeral wallet) * * @throws {Error} When MiniKit operations fail or unsupported transaction types are encountered */ export declare const createMiniKitWorldchainAccount: ({ walletAddress, logger: loggerParam, customRpcUrl, chainId, miniKit }: { walletAddress: string; logger?: Logger; customRpcUrl?: string; chainId?: number; miniKit: typeof MiniKitType; }) => Promise; /** * Resolves a MiniKit transaction ID to the actual blockchain transaction hash * using the World API */ export declare function resolveTransactionHash(transactionId: string, logger: Logger): Promise<{ transactionHash: string; status: string; } | null>; /** * Waits for a MiniKit transaction to be confirmed and returns the transaction hash * Polls the World API until the transaction is confirmed or times out */ export declare function waitForTransactionConfirmation(transactionId: string, logger: Logger, timeoutMs?: number, // 2 minutes pollIntervalMs?: number): Promise<{ transactionHash: string; status: string; } | null>; //# sourceMappingURL=minikit.d.ts.map