import type { Hex } from 'viem'; import { ProviderInterface } from '../../../core/provider/interface.js'; import type { PayerInfoResponses } from '../types.js'; /** * Type for wallet_sendCalls request parameters */ type WalletSendCallsRequestParams = { version: string; chainId: number; calls: Array<{ to: Hex; data: Hex; value: Hex; }>; capabilities: Record; }; /** * Type for payment execution result */ export interface PaymentExecutionResult { transactionHash: Hex; payerInfoResponses?: PayerInfoResponses; } /** * Resets the ephemeral initialization state. * @internal This is only intended for testing purposes. */ export declare function _resetEphemeralInitialization(): void; /** * Creates an ephemeral provider configured for payments. * * Uses EphemeralBaseAccountProvider which: * - Maintains isolated state (doesn't pollute global store) * - Only supports payment-related methods (wallet_sendCalls, wallet_sign) * - Cleans up without affecting other SDK instances * * @param params.chainId - The chain ID to use * @param params.walletUrl - Optional wallet URL to use * @param params.telemetry - Whether to enable telemetry (defaults to true) * @param params.dataSuffix - Optional attribution data suffix * @returns The configured ephemeral provider */ type CreateEphemeralSDKParams = { chainId: number; walletUrl?: string; telemetry?: boolean; dataSuffix?: Hex; }; export declare function createEphemeralSDK({ chainId, walletUrl, telemetry, dataSuffix, }: CreateEphemeralSDKParams): { getProvider: () => ProviderInterface; }; /** * Executes a payment using the provider * @param provider - The provider instance * @param requestParams - The wallet_sendCalls request parameters * @returns The payment execution result with transaction hash and optional info responses */ export declare function executePaymentWithProvider(provider: ProviderInterface, requestParams: WalletSendCallsRequestParams): Promise; /** * Executes a payment using the SDK (legacy compatibility wrapper) * @param sdk - The SDK instance * @param requestParams - The wallet_sendCalls request parameters * @returns The payment execution result with transaction hash and optional info responses * @deprecated Use executePaymentWithProvider instead */ export declare function executePayment(sdk: { getProvider: () => ProviderInterface; }, requestParams: WalletSendCallsRequestParams): Promise; /** * Manages the complete payment flow with SDK lifecycle and request queuing. * * Features: * - Uses ephemeral provider with isolated state * - Queues concurrent requests to prevent race conditions * - Properly cleans up resources after each payment * * @param requestParams - The wallet_sendCalls request parameters * @param testnet - Whether to use testnet * @param walletUrl - Optional wallet URL to use * @param telemetry - Whether to enable telemetry (defaults to true) * @param dataSuffix - Optional attribution data suffix * @returns The payment execution result */ export declare function executePaymentWithSDK(requestParams: WalletSendCallsRequestParams, testnet: boolean, walletUrl?: string, telemetry?: boolean, dataSuffix?: Hex): Promise; export {}; //# sourceMappingURL=sdkManager.d.ts.map