import type { CaipAssetType, CaipChainId, Hex } from "@metamask/utils"; import type { QuoteResponseV1, FetchFunction, GenericQuoteRequest, BridgeAsset, TokenFeature, QuoteStreamCompleteData, BatchSellTradesRequest, BatchSellTradesResponse, FeatureId } from "../types.cjs"; export declare const getClientHeaders: ({ clientId, clientVersion, jwt, }: { clientId: string; clientVersion?: string | undefined; jwt?: string | undefined; }) => { 'Client-Version'?: string | undefined; Authorization?: string | undefined; 'X-Client-Id': string; }; /** * Returns a list of enabled (unblocked) tokens * * @deprecated Use the popular and search bridge-api endpoints instead * * @param chainId - The chain ID to fetch tokens for * @param clientId - The client ID for metrics * @param jwt - The JWT token for authentication * @param fetchFn - The fetch function to use * @param bridgeApiBaseUrl - The base URL for the bridge API * @param clientVersion - The client version for metrics (optional) * @returns A list of enabled (unblocked) tokens */ export declare function fetchBridgeTokens(chainId: Hex | CaipChainId, clientId: string, jwt: string | undefined, fetchFn: FetchFunction, bridgeApiBaseUrl: string, clientVersion?: string): Promise>; /** * Fetches quotes from the bridge-api's getQuote endpoint * * @param request - The quote request * @param signal - The abort signal * @param clientId - The client ID for metrics * @param jwt - The JWT token for authentication * @param fetchFn - The fetch function to use * @param bridgeApiBaseUrl - The base URL for the bridge API * @param featureId - The feature ID to append to each quote * @param clientVersion - The client version for metrics (optional) * @returns A list of bridge tx quotes */ export declare function fetchBridgeQuotes(request: GenericQuoteRequest, signal: AbortSignal | null, clientId: string, jwt: string | undefined, fetchFn: FetchFunction, bridgeApiBaseUrl: string, featureId: FeatureId | null, clientVersion?: string): Promise<{ quotes: QuoteResponseV1[]; validationFailures: string[]; }>; declare const fetchAssetPricesForCurrency: (request: { currency: string; assetIds: Set; clientId: string; clientVersion?: string; fetchFn: FetchFunction; signal?: AbortSignal; }) => Promise>; /** * Fetches the asset prices from the price API for multiple currencies * * @param request - The request object * @returns The asset prices by assetId */ export declare const fetchAssetPrices: (request: { currencies: Set; } & Omit[0], 'currency'>) => Promise>; /** * Fetches quotes from the bridge-api * * @param fetchFn - The fetch function to use * @param quoteRequests - An array of GenericQuoteRequest objects * @param signal - The abort signal * @param featureId - The {@link FeatureId} for the experience that's requesting the quotes * @param clientId - The client ID for metrics * @param jwt - The JWT token for authentication * @param bridgeApiBaseUrl - The base URL for the bridge API * @param serverEventHandlers - The server event handlers * @param serverEventHandlers.onQuoteValidationFailure - The function to handle quote validation failures * @param serverEventHandlers.onValidQuoteReceived - The function to handle valid quotes * @param serverEventHandlers.onTokenWarning - The function to handle token warning events * @param serverEventHandlers.onComplete - The function to handle the complete event emitted when the stream finishes * @param serverEventHandlers.onClose - The function to run when the stream is closed and there are no thrown errors * @param clientVersion - The client version for metrics (optional) * @returns A list of bridge tx quote promises */ export declare function fetchBridgeQuoteStream(fetchFn: FetchFunction, quoteRequests: GenericQuoteRequest[], signal: AbortSignal | undefined, featureId: FeatureId, clientId: string, jwt: string | undefined, bridgeApiBaseUrl: string, serverEventHandlers: { onClose: () => void | Promise; onQuoteValidationFailure: (validationFailures: string[]) => void; onValidQuoteReceived: (quotes: QuoteResponseV1) => Promise; onTokenWarning: (warning: TokenFeature) => void; onComplete: (data: QuoteStreamCompleteData) => void; }, clientVersion?: string): Promise; export declare const formatBatchSellTradesRequest: (quotes: (QuoteResponseV1 | null)[], stxEnabled: boolean) => BatchSellTradesRequest; /** * Fetches quotes from the bridge-api's getQuote endpoint * * @param quotes - The quotes to fetch the gasless transaction data and fees for. May contain null values if a quote is not available for a swap * @param stxEnabled - Flag to estimate gas cost more precisely for the batch sell feature. * @param signal - The abort signal * @param clientId - The client ID for metrics * @param jwt - The JWT token for authentication * @param fetchFn - The fetch function to use * @param bridgeApiBaseUrl - The base URL for the bridge API * @param clientVersion - The client version for metrics (optional) * @returns The batch sell trades and the total network fee */ export declare function fetchBatchSellTrades(quotes: (QuoteResponseV1 | null)[], stxEnabled: boolean, signal: AbortSignal | null, clientId: string, jwt: string | undefined, fetchFn: FetchFunction, bridgeApiBaseUrl: string, clientVersion?: string): Promise; export {}; //# sourceMappingURL=fetch.d.cts.map