import { Provider } from '@ethersproject/providers'; import { Contract } from '@ethersproject/contracts'; import { Signer } from '@wagmi/core'; import { ChainId } from './constants'; import { Token } from './token'; import BigNumber from 'bignumber.js'; /** * Truncate a transaction or address hash */ export declare const truncateHash: (address: string, startLength?: number, endLength?: number) => string; export declare const isValidSolanaTokenMint: (address: string) => string | false; export declare const isAddress: (value: any, chainId: ChainId) => string | false; export declare const getContract: (address: string, ABI: any, signer?: Signer | Provider, chainId?: ChainId) => Contract | null; /** * Get wrapped version of the token. If the token is not unwrapped, return the token itself * @param token The token to wrap * @returns */ export declare const wrappedToken: (token: Token) => Token; /** * Get unwrapped version of the token. If the token is not wrapped, return the token itself * @param token The token to unwrap * @returns */ export declare const unwrappedToken: (token: Token) => Token; /** * Get balance amount from a decimal amount * @example 1234500000000000000 => 1.2345 * @param amount The amount to convert * @param decimals The decimals of the token * @returns */ export declare const getBalanceAmount: (amount: BigNumber, decimals: number) => BigNumber; /** * Get decimal amount from a balance amount * @example 1.2345 => 1234500000000000000 * @param amount The amount to convert * @param decimals The decimals of the token * @returns */ export declare const getDecimalAmount: (amount: BigNumber, decimals: number) => BigNumber; /** * Get formatted amount * @example 11.2345 => 11.234; 0.00123 => 0.00123 * @param amount The amount to convert * @returns */ export declare const getFormattedAmount: (amount: BigNumber, precision?: number, shouldCut?: boolean) => string; /** * Get formatted amount with abbreviation * @returns * @example 1234567 => 1.23M */ export declare const formatNumberWithAbbrev: (num: number, decimals: number, prefix?: string) => string; /** * Get formatted currency amount * @example 1111.2345 => $1,111.23; 0.00123 => $0.00123 * @param amount The amount to convert * @returns */ export declare const getFormattedCurrencyAmount: (amount?: BigNumber) => string; /** * Check if the token address is ETH * @param address address of the token */ export declare const isEth: (address: string, chainId: ChainId) => boolean; /** * Get pretty name * @param name * @example helloWorld -> Hello World */ export declare const getPrettyName: (name: string) => string; /** * Convert leading zeros in a number to subscript numbers * @example 0.00012345 => 0.0₄123 */ export declare const toSubscriptZeros: (number: BigNumber) => string; //# sourceMappingURL=index.d.ts.map