@funkit/connect
Version:
Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.
26 lines (25 loc) • 945 B
TypeScript
import { type Erc20AssetInfo } from '@funkit/api-base';
import type { Address } from 'viem';
interface UseAssetAddressPriceParams {
chainId: string | undefined;
assetTokenAddress: Address | undefined;
refetchInterval?: number;
/** defaults to 1 hence price returned is unit price */
amount?: number;
}
type AssetPriceResult = {
error: Error | null;
isLoading: boolean;
/** unit price if custom amount is not provided */
price: number | undefined;
};
export declare function useAssetAddressPrice({ chainId, assetTokenAddress, amount, refetchInterval, }: UseAssetAddressPriceParams): AssetPriceResult;
type AssetSymbolPriceParams = {
chainId: string | undefined;
symbol: string | undefined;
refetchInterval?: number;
};
export declare const useAssetSymbolPrice: ({ chainId, symbol, refetchInterval, }: AssetSymbolPriceParams) => AssetPriceResult & {
asset?: Erc20AssetInfo | null;
};
export {};