import { Balance, ChainWalletConfig, UserTokenBalance, TokenInfo, EVMNFT, NFT, NFTCollection } from '../types'; import BigNumber from 'bignumber.js'; import type { TransactionReceipt as EthersTransactionReceipt } from 'ethers'; import type { Chain, TransactionReceipt as ViemTransactionReceipt } from 'viem'; import { PublicClient, WalletClient, Hex } from 'viem'; export interface TransactionParams { to: string; value?: string | bigint; data?: string; gasLimit?: string | bigint; gasPrice?: string | bigint; maxFeePerGas?: string | bigint; maxPriorityFeePerGas?: string | bigint; nonce?: number; } interface TransactionResult { hash: string; receipt: EthersTransactionReceipt | null; viemReceipt?: ViemTransactionReceipt; success: boolean; gasUsed?: bigint; effectiveGasPrice?: bigint; blockNumber?: number; confirmations: number; } export interface SwapParams { tokenIn: string; tokenOut: string; amountIn: string; slippageTolerance?: number; recipient?: string; deadline?: number; feeAmount?: string; feeReceiver?: string; isInBps?: boolean; chargeFeeBy?: 'currency_in' | 'currency_out'; } export interface KyberRoute { tokenIn: string; amountIn: string; tokenOut: string; amountOut: string; gas: string; gasPrice: string; gasUsd: number; amountOutUsd: string; receivedUsd: string; swaps: Array<{ pool: string; tokenIn: string; tokenOut: string; swapAmount: string; amountOut: string; limitReturnAmount: string; maxPrice: string; exchange: string; poolLength: number; poolType: string; }>; tokens: { [address: string]: { address: string; symbol: string; name: string; decimals: number; price: number; }; }; } export interface KyberSwapResponse { code: number; message: string; data: { routeSummary: KyberRoute; routerAddress: string; }; } export interface KyberBuildResponse { code: number; message: string; data: { amountIn: string; amountInUsd: string; amountOut: string; amountOutUsd: string; gas: string; gasUsd: string; outputChange: { amount: string; percent: number; level: number; }; data: string; routerAddress: string; }; } export declare const DESERIALIZED_SUPPORTED_CHAINS: { [key: string]: string; }; export declare const ERC20_ABI: readonly [{ readonly name: "balanceOf"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly [{ readonly name: "owner"; readonly type: "address"; }]; readonly outputs: readonly [{ readonly type: "uint256"; }]; }, { readonly name: "decimals"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly type: "uint8"; }]; }, { readonly name: "symbol"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly type: "string"; }]; }, { readonly name: "name"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly type: "string"; }]; }, { readonly name: "transfer"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "to"; readonly type: "address"; }, { readonly name: "amount"; readonly type: "uint256"; }]; readonly outputs: readonly [{ readonly type: "bool"; }]; }, { readonly name: "approve"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "spender"; readonly type: "address"; }, { readonly name: "amount"; readonly type: "uint256"; }]; readonly outputs: readonly [{ readonly type: "bool"; }]; }, { readonly name: "allowance"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly [{ readonly name: "owner"; readonly type: "address"; }, { readonly name: "spender"; readonly type: "address"; }]; readonly outputs: readonly [{ readonly type: "uint256"; }]; }]; export declare const fromChainToViemChain: (config: ChainWalletConfig) => Chain; export declare const createPublicClientFromChainConfig: (chain: ChainWalletConfig) => PublicClient; export declare function viemReceiptToEthersReceipt(receipt: ViemTransactionReceipt): EthersTransactionReceipt; export declare const getNativeBalance: (address: Hex, client: PublicClient) => Promise; export declare const getTokenInfo: (tokenAddress: Hex, client: PublicClient) => Promise; export declare const getTokenBalance: (tokenAddress: Hex, walletAddress: Hex, client: PublicClient) => Promise; export declare const signAndSend: (walletClient: WalletClient, publicClient: PublicClient, params: { to: Hex; data?: Hex; value?: bigint; gas?: bigint; nonce?: number; maxFeePerGas?: bigint; maxPriorityFeePerGas?: bigint; }, confirmations?: number) => Promise<{ hash: Hex; success: boolean; }>; export declare const signSendAndConfirm: (walletClient: WalletClient, publicClient: PublicClient, params: { to: Hex; data?: Hex; value?: bigint; gas?: bigint; nonce?: number; maxFeePerGas?: bigint; maxPriorityFeePerGas?: bigint; }, confirmations?: number) => Promise; export declare const sendNativeToken: (walletClient: WalletClient, publicClient: PublicClient, to: Hex, amount: string | bigint, confirmations?: number) => Promise<{ hash: Hex; success: boolean; }>; export declare const sendERC20Token: (walletClient: WalletClient, publicClient: PublicClient, tokenAddress: Hex, to: Hex, amount: bigint, confirmations?: number) => Promise<{ hash: Hex; success: boolean; }>; export declare const getGasPrices: (client: PublicClient) => Promise<{ gasPrice: undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; }>; export declare const estimateGas: (client: PublicClient, params: { to: Hex; data?: Hex; value?: bigint; }) => Promise; export declare const checkAllowance: (client: PublicClient, tokenAddress: Hex, owner: Hex, spender: Hex) => Promise<{ allowance: bigint; formatted: string; decimals: number; }>; export declare const isAllowanceSufficient: (publicClient: PublicClient, tokenAddress: `0x${string}`, owner: `0x${string}`, spender: `0x${string}`, requiredAmount: string | bigint) => Promise; export declare const approveToken: (walletClient: WalletClient, publicClient: PublicClient, tokenAddress: Hex, spender: Hex, amount: bigint, confirmations?: number) => Promise; export declare const approveTokenUnlimited: (walletClient: WalletClient, publicClient: PublicClient, tokenAddress: `0x${string}`, spender: `0x${string}`, gas?: bigint, confirmations?: number) => Promise; export declare const checkAndApprove: (walletClient: WalletClient, publicClient: PublicClient, tokenAddress: `0x${string}`, spender: `0x${string}`, requiredAmount: bigint, approvalAmount?: bigint, gas?: bigint, confirmations?: number) => Promise<{ approvalNeeded: boolean; currentAllowance: bigint; approvalResult?: TransactionResult; }>; export declare const resetAllowance: (walletClient: WalletClient, publicClient: PublicClient, tokenAddress: `0x${string}`, spender: `0x${string}`, gas?: bigint, confirmations?: number) => Promise; export declare const safeApprove: (walletClient: WalletClient, publicClient: PublicClient, tokenAddress: `0x${string}`, spender: `0x${string}`, amount: bigint, gas?: bigint, confirmations?: number) => Promise<{ resetResult: TransactionResult; approveResult: TransactionResult; }>; export declare const discoverTokens: (wallet: string, chain: ChainWalletConfig) => Promise[]>; export declare function calcGasTotal(gasLimit?: string, gasPrice?: string): string; export declare function toPrecisionWithoutTrailingZeros(n: number, precision: number): string; export declare function calcTokenAmount(value: number | string | BigNumber, decimals?: number): BigNumber; export declare const transformEVMNFTToUnified: (nft: EVMNFT) => NFT; export declare const discoverNFTs: (wallet: string, chain: ChainWalletConfig) => Promise; export declare const discoverAllNFTs: (wallet: string, chain: ChainWalletConfig) => Promise; export declare const getNFTCollection: (wallet: string, collectionAddress: string, chain: ChainWalletConfig) => Promise; export {};