UNPKG

@reservoir0x/relay-kit-hooks

Version:

Relay is the Fastest and Cheapest Way to Bridge and Transact Across Chains.

426 lines 17.7 kB
import { RelayClient, type AdaptedWallet, type Execute, type paths, type ProgressData } from '@reservoir0x/relay-sdk'; import { useQuery, type DefaultError, type QueryKey } from '@tanstack/react-query'; import type { WalletClient } from 'viem'; import type { AxiosRequestConfig } from 'axios'; type QuoteBody = paths['/quote']['post']['requestBody']['content']['application/json']; export type QuoteResponse = paths['/quote']['post']['responses']['200']['content']['application/json']; type QueryType = typeof useQuery<QuoteResponse, DefaultError, QuoteResponse, QueryKey>; type QueryOptions = Parameters<QueryType>['0']; export declare const queryQuote: (baseApiUrl?: string, options?: QuoteBody, config?: AxiosRequestConfig) => Promise<QuoteResponse>; export type onProgress = (data: ProgressData) => void; export default function (client?: RelayClient, wallet?: WalletClient | AdaptedWallet, options?: QuoteBody, onRequest?: (options?: QuoteBody, config?: AxiosRequestConfig) => void, onResponse?: (data: QuoteResponse, options?: QuoteBody) => void, queryOptions?: Partial<QueryOptions>, onError?: (e: any) => void, config?: AxiosRequestConfig): Omit<import("@tanstack/react-query").UseQueryResult<{ steps?: { id: "deposit" | "approve" | "authorize" | "authorize1" | "authorize2" | "swap" | "send"; action: string; description: string; kind: string; requestId?: string | undefined; depositAddress?: string | undefined; items: { status?: string | undefined; data?: unknown; check?: { endpoint?: string | undefined; method?: string | undefined; } | undefined; }[]; }[] | undefined; fees?: { gas?: { currency?: { chainId?: number | undefined; address?: string | undefined; symbol?: string | undefined; name?: string | undefined; decimals?: number | undefined; metadata?: { logoURI?: string | undefined; verified?: boolean | undefined; isNative?: boolean | undefined; } | undefined; } | undefined; amount?: string | undefined; amountFormatted?: string | undefined; amountUsd?: string | undefined; minimumAmount?: string | undefined; } | undefined; relayer?: { currency?: { chainId?: number | undefined; address?: string | undefined; symbol?: string | undefined; name?: string | undefined; decimals?: number | undefined; metadata?: { logoURI?: string | undefined; verified?: boolean | undefined; isNative?: boolean | undefined; } | undefined; } | undefined; amount?: string | undefined; amountFormatted?: string | undefined; amountUsd?: string | undefined; minimumAmount?: string | undefined; } | undefined; relayerGas?: { currency?: { chainId?: number | undefined; address?: string | undefined; symbol?: string | undefined; name?: string | undefined; decimals?: number | undefined; metadata?: { logoURI?: string | undefined; verified?: boolean | undefined; isNative?: boolean | undefined; } | undefined; } | undefined; amount?: string | undefined; amountFormatted?: string | undefined; amountUsd?: string | undefined; minimumAmount?: string | undefined; } | undefined; relayerService?: { currency?: { chainId?: number | undefined; address?: string | undefined; symbol?: string | undefined; name?: string | undefined; decimals?: number | undefined; metadata?: { logoURI?: string | undefined; verified?: boolean | undefined; isNative?: boolean | undefined; } | undefined; } | undefined; amount?: string | undefined; amountFormatted?: string | undefined; amountUsd?: string | undefined; minimumAmount?: string | undefined; } | undefined; app?: { currency?: { chainId?: number | undefined; address?: string | undefined; symbol?: string | undefined; name?: string | undefined; decimals?: number | undefined; metadata?: { logoURI?: string | undefined; verified?: boolean | undefined; isNative?: boolean | undefined; } | undefined; } | undefined; amount?: string | undefined; amountFormatted?: string | undefined; amountUsd?: string | undefined; minimumAmount?: string | undefined; } | undefined; } | undefined; details?: { operation?: string | undefined; sender?: string | undefined; recipient?: string | undefined; currencyIn?: { currency?: { chainId?: number | undefined; address?: string | undefined; symbol?: string | undefined; name?: string | undefined; decimals?: number | undefined; metadata?: { logoURI?: string | undefined; verified?: boolean | undefined; isNative?: boolean | undefined; } | undefined; } | undefined; amount?: string | undefined; amountFormatted?: string | undefined; amountUsd?: string | undefined; minimumAmount?: string | undefined; } | undefined; currencyOut?: { currency?: { chainId?: number | undefined; address?: string | undefined; symbol?: string | undefined; name?: string | undefined; decimals?: number | undefined; metadata?: { logoURI?: string | undefined; verified?: boolean | undefined; isNative?: boolean | undefined; } | undefined; } | undefined; amount?: string | undefined; amountFormatted?: string | undefined; amountUsd?: string | undefined; minimumAmount?: string | undefined; } | undefined; currencyGasTopup?: { currency?: { chainId?: number | undefined; address?: string | undefined; symbol?: string | undefined; name?: string | undefined; decimals?: number | undefined; metadata?: { logoURI?: string | undefined; verified?: boolean | undefined; isNative?: boolean | undefined; } | undefined; } | undefined; amount?: string | undefined; amountFormatted?: string | undefined; amountUsd?: string | undefined; minimumAmount?: string | undefined; } | undefined; totalImpact?: { usd?: string | undefined; percent?: string | undefined; } | undefined; swapImpact?: { usd?: string | undefined; percent?: string | undefined; } | undefined; rate?: string | undefined; slippageTolerance?: { origin?: { usd?: string | undefined; value?: string | undefined; percent?: string | undefined; } | undefined; destination?: { usd?: string | undefined; value?: string | undefined; percent?: string | undefined; } | undefined; } | undefined; timeEstimate?: number | undefined; userBalance?: string | undefined; fallbackType?: string | undefined; } | undefined; protocol?: { v2?: { orderId?: string | undefined; paymentDetails?: { chainId?: string | undefined; depository?: string | undefined; currency?: string | undefined; amount?: string | undefined; } | undefined; } | undefined; } | undefined; }, Error>, "data"> & { data?: { steps?: { id: "deposit" | "approve" | "authorize" | "authorize1" | "authorize2" | "swap" | "send"; action: string; description: string; kind: string; requestId?: string | undefined; depositAddress?: string | undefined; items: { status?: string | undefined; data?: unknown; check?: { endpoint?: string | undefined; method?: string | undefined; } | undefined; }[]; }[] | undefined; fees?: { gas?: { currency?: { chainId?: number | undefined; address?: string | undefined; symbol?: string | undefined; name?: string | undefined; decimals?: number | undefined; metadata?: { logoURI?: string | undefined; verified?: boolean | undefined; isNative?: boolean | undefined; } | undefined; } | undefined; amount?: string | undefined; amountFormatted?: string | undefined; amountUsd?: string | undefined; minimumAmount?: string | undefined; } | undefined; relayer?: { currency?: { chainId?: number | undefined; address?: string | undefined; symbol?: string | undefined; name?: string | undefined; decimals?: number | undefined; metadata?: { logoURI?: string | undefined; verified?: boolean | undefined; isNative?: boolean | undefined; } | undefined; } | undefined; amount?: string | undefined; amountFormatted?: string | undefined; amountUsd?: string | undefined; minimumAmount?: string | undefined; } | undefined; relayerGas?: { currency?: { chainId?: number | undefined; address?: string | undefined; symbol?: string | undefined; name?: string | undefined; decimals?: number | undefined; metadata?: { logoURI?: string | undefined; verified?: boolean | undefined; isNative?: boolean | undefined; } | undefined; } | undefined; amount?: string | undefined; amountFormatted?: string | undefined; amountUsd?: string | undefined; minimumAmount?: string | undefined; } | undefined; relayerService?: { currency?: { chainId?: number | undefined; address?: string | undefined; symbol?: string | undefined; name?: string | undefined; decimals?: number | undefined; metadata?: { logoURI?: string | undefined; verified?: boolean | undefined; isNative?: boolean | undefined; } | undefined; } | undefined; amount?: string | undefined; amountFormatted?: string | undefined; amountUsd?: string | undefined; minimumAmount?: string | undefined; } | undefined; app?: { currency?: { chainId?: number | undefined; address?: string | undefined; symbol?: string | undefined; name?: string | undefined; decimals?: number | undefined; metadata?: { logoURI?: string | undefined; verified?: boolean | undefined; isNative?: boolean | undefined; } | undefined; } | undefined; amount?: string | undefined; amountFormatted?: string | undefined; amountUsd?: string | undefined; minimumAmount?: string | undefined; } | undefined; } | undefined; details?: { operation?: string | undefined; sender?: string | undefined; recipient?: string | undefined; currencyIn?: { currency?: { chainId?: number | undefined; address?: string | undefined; symbol?: string | undefined; name?: string | undefined; decimals?: number | undefined; metadata?: { logoURI?: string | undefined; verified?: boolean | undefined; isNative?: boolean | undefined; } | undefined; } | undefined; amount?: string | undefined; amountFormatted?: string | undefined; amountUsd?: string | undefined; minimumAmount?: string | undefined; } | undefined; currencyOut?: { currency?: { chainId?: number | undefined; address?: string | undefined; symbol?: string | undefined; name?: string | undefined; decimals?: number | undefined; metadata?: { logoURI?: string | undefined; verified?: boolean | undefined; isNative?: boolean | undefined; } | undefined; } | undefined; amount?: string | undefined; amountFormatted?: string | undefined; amountUsd?: string | undefined; minimumAmount?: string | undefined; } | undefined; currencyGasTopup?: { currency?: { chainId?: number | undefined; address?: string | undefined; symbol?: string | undefined; name?: string | undefined; decimals?: number | undefined; metadata?: { logoURI?: string | undefined; verified?: boolean | undefined; isNative?: boolean | undefined; } | undefined; } | undefined; amount?: string | undefined; amountFormatted?: string | undefined; amountUsd?: string | undefined; minimumAmount?: string | undefined; } | undefined; totalImpact?: { usd?: string | undefined; percent?: string | undefined; } | undefined; swapImpact?: { usd?: string | undefined; percent?: string | undefined; } | undefined; rate?: string | undefined; slippageTolerance?: { origin?: { usd?: string | undefined; value?: string | undefined; percent?: string | undefined; } | undefined; destination?: { usd?: string | undefined; value?: string | undefined; percent?: string | undefined; } | undefined; } | undefined; timeEstimate?: number | undefined; userBalance?: string | undefined; fallbackType?: string | undefined; } | undefined; protocol?: { v2?: { orderId?: string | undefined; paymentDetails?: { chainId?: string | undefined; depository?: string | undefined; currency?: string | undefined; amount?: string | undefined; } | undefined; } | undefined; } | undefined; } | undefined; queryKey: readonly unknown[]; executeQuote: (onProgress: onProgress) => Promise<{ data: Execute; abortController?: AbortController; }> | undefined; }; export {}; //# sourceMappingURL=useQuote.d.ts.map