/** TODO: this file breaks many rules of hooks - are these actually used? */ import { Token, TokenWithBalance } from "./token"; /** shape of individual entity in the /tokens/info endpoint */ export interface ApiTokenDetails { id: number; address: string; pricingId: number; } export interface ApiTokenDataResponse { tokens: ApiTokenDetails[]; } /** shape of individual entity in the /tokens/prices endpoint */ export interface ApiPriceDetails { pricingId: number; ethValue: string; ccyValue: string; ethDayChange: string; ccyDayChange: string; } export interface ApiPriceDataResponse { prices: ApiPriceDetails[]; } export interface ILookupTokenPriceDetails { /** the token to query */ token: Token; /** reponse from `/tokens/prices` endpoint */ pricesData: ApiPriceDataResponse; /** reponse from `/tokens/info` endpoint */ tokenData: ApiTokenDataResponse; } export declare const fetchPriceAndTokenDataFromApi: (apiBaseUrl?: string, apiHeaders?: Record) => { pricesData: any; tokenData: any; }; /** * Given `token`, find the token in the `tokenData` and then the price details in `priceData` */ export declare const lookupTokenPriceDetails: ({ token, pricesData, tokenData, }: ILookupTokenPriceDetails) => ApiPriceDetails | null | undefined; /** * Returns a string of token balance with symbol if available e.g. */ export declare const prettifyTokenBalance: (token: TokenWithBalance, withSymbol?: boolean) => string | null;