import { Currency } from './types'; export interface KadoAsset { _id: string; name: string; label: string; address: string; decimals: number; symbol: string; primeTrust: { assetId: string; }; } export type KadoAPIChainResponse = { _id: string; origin: string; label: string; associatedAssets: KadoAsset[]; ecosystem?: string; network: string; officialId: string; }; export type RequestQuoteArgs = { transactionType: 'buy' | 'sell'; fiatMethod: 'credit_card' | 'ach'; partner: string; amount: number; asset: string; blockchain: string; currency: string; reverse?: boolean; }; type ResponseQuoteFeeType = { amount: number; currency: string; }; export type ResponseQuote = { asset: string; baseAmount: number; price: { amount: number; price: number; symbol: string; unit: string; }; processingFee: { originalAmount: number; amount: number; promotionModifier: number; currency: string; }; bridgeFee: ResponseQuoteFeeType; networkFee: ResponseQuoteFeeType; smartContractFee: ResponseQuoteFeeType; totalFee: ResponseQuoteFeeType & { originalAmount: number; }; receiveAmountAfterFees: ResponseQuoteFeeType & { originalAmount: number; }; receiveUnitCountAfterFees: ResponseQuoteFeeType; feeType: string; receive: { originalAmount: number; amount: number; unitCount: number; unit: string; symbol: string; }; minValue: { amount: number; unit: string; }; maxValue: { amount: number; unit: string; }; }; export type ConversionRateArgs = { from: string; to: string; }; export declare enum TRANSFER_STATUS { UNINITIATED = "uninitiated", PENDING = "pending", FAILED = "failed", SETTLED = "settled", UNKNOWN = "unknown" } export type OrderStatusResponse = { transferStatus: TRANSFER_STATUS; humanStatusField: string; paymentStatus: string; allPossibleTxHashes: { originalTxHashFromProvider: { txHash: string; txLink: string; }; }; txHash: string; }; export declare const KADO_URLS: { test: { api: string; webView: string; }; prod: { api: string; webView: string; }; }; export declare class KadoAPI { /** * Fetches a list of supported currencies from the Kado API. * @returns A Promise resolving to either an object containing a list of currencies * ({@link Currency}[]) on success, or an error message on failure. */ static getSupportedCurrencies(): Promise<{ success: false; error: string; } | { success: true; currencies: Currency[]; }>; /** * Retrieves the conversion rate between two currencies. * @param args - The arguments for the request, including 'from' and 'to' currency identifiers * ({@link ConversionRateArgs}). * @returns A Promise resolving to an object containing the conversion rate on success, * or an error message on failure. */ static getConversionRate(args: ConversionRateArgs): Promise<{ success: false; error: string; } | { success: true; conversionRate: number; }>; /** * Fetches a list of supported blockchain chains from the Kado API. * @returns A Promise resolving to either an object containing a list of chain responses * ({@link KadoAPIChainResponse}[]) on success, or an error message on failure. */ static getSupportedChains(): Promise<{ success: false; error: string; } | { success: true; chains: KadoAPIChainResponse[]; }>; /** * Requests a quote for a specified transaction. * @param args - The arguments for the quote request, including transaction type, fiat method, partner, amount, asset, and blockchain * ({@link RequestQuoteArgs}). * @returns A Promise resolving to either an object containing the response quote * ({@link ResponseQuote}) on success, or an error message on failure. */ static getQuote(args: RequestQuoteArgs): Promise<{ success: false; error: string; } | { success: true; quote: ResponseQuote; request: RequestQuoteArgs; }>; /** * Retrieves the status of an order based on the order ID. * @param orderId - The unique identifier of the order. * @returns A Promise resolving to either an object containing the order status response * ({@link OrderStatusResponse}) on success, or an error message on failure. */ static getOrderStatus(orderId: string): Promise<{ success: false; error: string; } | { success: true; status: OrderStatusResponse; }>; } export {};