import { Provider as BaseProvider } from '../../index.js'; import type { Address, ControlFlowOptions, Merge, NativeUnits } from '../../../types.js'; import type { CircleDeveloperControlledWalletsClient, CreateWalletSetInput, CreateWalletsInput, GetWalletInput, ListWalletsInput, GetTransactionInput, Blockchain, EstimateTransferFeeInput as _EstimateTransferFeeInput, CreateTransferTransactionInput as _CreateTransferTransactionInput, GetWalletTokenBalanceInput as _GetWalletTokenBalanceInput, NotificationSignaturePublicKeyData as NotificationSignature, Balance, DeriveWalletInput, GetWalletsWithBalancesInput, WalletsWithBalancesDataWalletsInner as WalletWithBalances, SignTypedDataInput as _SignTypedDataInput, SignTransactionInput as _SignTransactionInput, WalletSet, Wallet, Transaction, EstimateTransactionFeeData as EstimateTransactionFee, SignatureResponseData as SignedTypedData, SignTransactionResponseData as SignedTransaction, CreateContractExecutionTransactionInput as _CreateContractExecutionTransactionInput, EstimateContractExecutionFeeInput as _EstimateContractExecutionFeeInput, RequestTestnetTokensInput } from '@circle-fin/developer-controlled-wallets'; import type { CircleSmartContractPlatformClient, ImportContractInput as _ImportContractInput } from '@circle-fin/smart-contract-platform'; import type { Hash, Hex, RpcTransactionRequest, ExactPartial, TransactionRequest, Transport } from 'viem'; export { http } from './http.js'; export type { CreateWalletsInput, CreateWalletSetInput, GetTransactionInput, GetWalletInput, ListWalletsInput, Balance, Transaction, Wallet, WalletSet, EstimateTransactionFee, DeriveWalletInput, GetWalletsWithBalancesInput, WalletWithBalances, SignedTypedData, SignedTransaction, NotificationSignature, RequestTestnetTokensInput, }; export type ListTransactionsInput = { walletId?: string; blockchain?: Blockchain; pageToken?: string; pageSize?: number; }; export type GetWalletTokenBalanceInput = Omit<_GetWalletTokenBalanceInput, 'id'> & Partial> & { blockchain?: Blockchain; address?: string; tokenAddress?: string | string[] | null; }; export type EstimateTransferFeeInput = Omit<_EstimateTransferFeeInput, 'amount'> & Partial> & { amounts?: NativeUnits[]; }; export type CreateTransactionInput = Omit<_CreateTransferTransactionInput, 'walletId' | 'amount'> & Partial> & { amounts?: NativeUnits[]; sourceAddress?: string; waitForTransactionHash?: boolean; } & ControlFlowOptions; export type GetNotificationSignatureInput = { kid: string; }; export type SignTypedDataInput = Omit<_SignTypedDataInput, 'walletId'> & Partial> & { blockchain?: Blockchain; address?: string; }; export type SignTransactionInput = Omit<_SignTransactionInput, 'walletId'> & Partial> & { blockchain?: Blockchain; address?: string; }; export type CreateContractExecutionTransactionInput = Merge, { walletId?: string; sourceAddress?: string; blockchain?: Blockchain; callData?: `0x${string}`; waitForTransactionHash?: boolean; } & ControlFlowOptions>; export type EstimateContractExecutionFeeInput = Merge<_EstimateContractExecutionFeeInput, { abiFunctionSignature?: string; abiParameters?: any[]; callData?: `0x${string}`; }>; export type ImportContractInput = _ImportContractInput & { sourceAddress?: string; blockchain?: Blockchain; }; export type WalletSwitchEthereumChainInput = { chainId: Hex; }; export type EIP1474Methods = [ { Method: 'circle_createWalletSet'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'circle_createWallets'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'circle_getWallet'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'circle_listWallets'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'circle_estimateTransferFee'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'circle_createTransaction'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'circle_getTransaction'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'circle_listTransactions'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'circle_getWalletTokenBalance'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'circle_getNotificationSignature'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'circle_deriveWallet'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'circle_getWalletsWithBalances'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'circle_signTypedData'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'circle_signTransaction'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'circle_estimateContractExecutionFee'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'circle_createContractExecutionTransaction'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'circle_importContract'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'circle_requestTestnetTokens'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'eth_chainId'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'eth_getBalance'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'eth_signTypedData_v4'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'eth_sendTransaction'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'eth_call'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'eth_estimateGas'; Parameters: Parameters; ReturnType: Awaited>; }, { Method: 'eth_signTransaction'; Parameters: Parameters; ReturnType: Awaited>; } ]; export declare const SENTINEL_FEES = -1n; export declare class Provider extends BaseProvider { protected readonly devc: CircleDeveloperControlledWalletsClient; protected readonly scp: CircleSmartContractPlatformClient; protected readonly pollingInterval: number; private readonly fallback?; protected readonly chainId: number; /** * The polling timeout for the transaction. * If not provided, there is no timeout. */ protected timeout?: number; constructor({ apiKey, entitySecret, baseUrl, chainId, timeout, pollingInterval, fallbackTransport, }: { apiKey: string; entitySecret: string; baseUrl?: string; chainId: number; timeout?: number; pollingInterval?: number; fallbackTransport?: Transport | null; }); get defaultSignal(): AbortSignal | undefined; protected eth_chainId(): Hex; protected eth_getBalance(address: Address, blockTag?: string): Promise; protected eth_call(params: ExactPartial, blockIdentifier?: string): Promise; protected eth_sendTransaction(params: RpcTransactionRequest): Promise; /** * Parses fee parameters from RpcTransactionRequest and converts to Circle API format. * @param params - The RPC transaction request containing fee parameters * @returns Promise resolving to the fee configuration for Circle API */ private parseFeeParams; protected eth_estimateGas(params: RpcTransactionRequest, _blockIdentifier?: string): Promise; private waitForTransactionWithHash; protected circle_createWalletSet(params: CreateWalletSetInput): Promise; protected circle_createWallets(params: CreateWalletsInput): Promise<[Wallet, ...Wallet[]]>; protected circle_getWallet(params: GetWalletInput): Promise; protected circle_listWallets(params: ListWalletsInput): Promise; protected circle_getWalletTokenBalance(params: GetWalletTokenBalanceInput): Promise; protected circle_estimateTransferFee(params: EstimateTransferFeeInput): Promise<{ high: { gasLimit: `${number}` | "" | undefined; maxFee: `${number}` | "" | undefined; priorityFee: `${number}` | "" | undefined; gasPrice?: string; baseFee?: string; networkFee?: string; networkFeeRaw?: string; l1Fee?: string; } | undefined; medium: { gasLimit: `${number}` | "" | undefined; maxFee: `${number}` | "" | undefined; priorityFee: `${number}` | "" | undefined; gasPrice?: string; baseFee?: string; networkFee?: string; networkFeeRaw?: string; l1Fee?: string; } | undefined; low: { gasLimit: `${number}` | "" | undefined; maxFee: `${number}` | "" | undefined; priorityFee: `${number}` | "" | undefined; gasPrice?: string; baseFee?: string; networkFee?: string; networkFeeRaw?: string; l1Fee?: string; } | undefined; callGasLimit?: string; verificationGasLimit?: string; preVerificationGas?: string; }>; protected circle_createTransaction(params: CreateTransactionInput): Promise; protected circle_getTransaction(params: GetTransactionInput): Promise; protected circle_getNotificationSignature(params: GetNotificationSignatureInput): Promise; protected circle_deriveWallet(params: DeriveWalletInput): Promise; protected circle_getWalletsWithBalances(params: GetWalletsWithBalancesInput): Promise; protected circle_signTypedData(params: SignTypedDataInput): Promise; protected eth_signTypedData_v4(address: Address, message: string): Promise; protected circle_signTransaction(params: SignTransactionInput): Promise; /** * Sign a transaction using the Circle Signing API * @see https://learn.circle.com/w3s/signing-apis * @param params - The transaction request * @returns The signed transaction */ protected eth_signTransaction(params: RpcTransactionRequest & { chainId?: Hex; }): Promise; protected circle_estimateContractExecutionFee(params: EstimateContractExecutionFeeInput): Promise<{ high: { gasLimit: `${number}` | "" | undefined; maxFee: `${number}` | "" | undefined; priorityFee: `${number}` | "" | undefined; gasPrice?: string; baseFee?: string; networkFee?: string; networkFeeRaw?: string; l1Fee?: string; } | undefined; medium: { gasLimit: `${number}` | "" | undefined; maxFee: `${number}` | "" | undefined; priorityFee: `${number}` | "" | undefined; gasPrice?: string; baseFee?: string; networkFee?: string; networkFeeRaw?: string; l1Fee?: string; } | undefined; low: { gasLimit: `${number}` | "" | undefined; maxFee: `${number}` | "" | undefined; priorityFee: `${number}` | "" | undefined; gasPrice?: string; baseFee?: string; networkFee?: string; networkFeeRaw?: string; l1Fee?: string; } | undefined; callGasLimit?: string; verificationGasLimit?: string; preVerificationGas?: string; }>; protected circle_createContractExecutionTransaction(params: CreateContractExecutionTransactionInput): Promise; protected circle_importContract(params: ImportContractInput): Promise; protected circle_listTransactions(params: ListTransactionsInput): Promise; protected circle_requestTestnetTokens(params: RequestTestnetTokensInput): Promise; request({ method, params }: { method: string; params?: unknown[]; }): Promise; }