import { ethers } from "ethers"; import { LongShortPairEthers } from "@uma/contracts-node"; import { AssetConfigLSP, AssetConfigEMP, IPairData, SynthsAssetsConfig, ISynthsData } from "../types/assets.t"; /** * @notice Helper function to prepare the lsp state multicall. * @param contract The lsp contract instance. * @returns A promise with the lsp state. */ export declare function prepareLSPStateCall(contract: LongShortPairEthers): Promise<[ethers.BigNumber, string, string, string, string, string, ethers.BigNumber, string]>; /** * @notice Helper function to get the decimals of a erc20 token. * @param address Address of the erc20 contract. * @param ethersProvider Ethers provider instance. * @returns The erc20 token decimals. */ export declare function getTokenDecimals(address: string, ethersProvider: ethers.providers.Provider): Promise; /** * @notice Helper function to get the current DEX token price. * @param poolLocation Location string of the DEX pool (e.g. "uni"). * @param poolAddress Address of the DEX pool. * @param tokenAddress Address of the token. * @param blockNumber Blocn number at which you want to get the price. * @param network? Chain id to decide which subgraph endpoint to use, defaults to mainnet. * @returns The DEX token price in WEI. */ export declare function getDexTokenPriceAtBlock(poolLocation: string, poolAddress: string, collateralSymbol: string, blockNumber: number, network?: string): Promise<{ value: number; tokenid: string; tokenId?: undefined; } | { value: number; tokenId: string; tokenid?: undefined; }>; /** * @notice Helper function to get relevant synth market data. * @param synthId The synth identifier. * @param networkId The network / chain id of the synth deployment. * @param network? Chain id to decide which subgraph endpoint to use, defaults to mainnet. * @param polyscanApiKey? Api key for polyscan. * @param userConfig? A user assets userConfig. * @returns An object with the synth market data. */ export declare function getSynthData(poolLocation: string, poolAddress: string, collateralSymbol: string, network?: string, polyscanApiKey?: string, userConfig?: SynthsAssetsConfig): Promise; /** * @notice Helper function to get the data for the most recent synths. * @dev Can be used on the front-end to display the most recent synths. * @param networkId The network / chain id of the synth deployment. * @param userConfig? A user assets userConfig. * @param polyscanApiKey? Api key for polyscan. * @returns The most recent synth market data. */ export declare function getRecentSynthData(networkId: number, userConfig?: SynthsAssetsConfig, polyscanApiKey?: string): Promise; /** * @notice Helper function to get the total liquidity and volume of all synths in the last 24h. * @param networks Array of networks that the user wants to query. * @param userConfig? A user assets userConfig. * @param polyscanApiKey? Api key for polyscan. * @returns The total synths market data. */ export declare function getTotalMarketData(networks: Array, userConfig?: SynthsAssetsConfig, polyscanApiKey?: string): Promise<{ totalLiquidity: number; total24hVolume: number; totalTVL: undefined; totalSynthCount: number; }>; /** * @notice Helper function to get data from `assets.json` according to the synth id. * @param synthId The synth identifier. * @param networkId The network / chain id of the synth deployment. * @param userConfig? A user assets userConfig. * @returns The synth info from the `assets.json`. */ export declare function getInfoByIdentifier(synthId: string, network: number, userConfig?: SynthsAssetsConfig): AssetConfigEMP | AssetConfigLSP | undefined; /** * @notice Helper function to get the rewards by pool address. * @dev Should be removed after api accepts a pool address instead of an id. * @param poolAddress The DEX pool address. * @param userConfig? A user assets userConfig. * @returns The rewards for the given pool. */ export declare function getYamRewardsByPoolAddress(poolAddress: string, userConfig?: SynthsAssetsConfig): Promise; /** * @notice Helper function to get pool data. * @dev Since the subgraph only indexes data if something has changed we fill the data manually. * @param poolAddress The pool address you want to get the data from. * @param tokenAddress The token of which you want to get the price. * @param poolLocation The pool location to help choose the right subgraph endpoint. * @param network? Chain id to decide which subgraph endpoint to use, defaults to mainnet. * @returns An array of token market data. */ export declare function getPoolChartData(poolLocation: string, poolAddress: string, tokenAddress: string, network?: string): Promise; /** * @notice Helper function to round a number to a certain number of decimals. * @param number The number to round. * @param decimals The number of decimals to round to. * @returns The rounded number. */ export declare function roundNumber(number: number, decimals: number): number; /** * @notice Calculates the change between 2 numbers in percentage. * @param oldNumber The initial value. * @param newNumber The value that changed. */ export declare function getPercentageChange(oldNumber: number, newNumber: number): number; /** * @notice Converts a given timestamp into a block number. * @param timestamp The timestamp that should be converted. * @param polyscanApiKey? Api key for polyscan. * @returns A block number. */ export declare function timestampToBlock(timestamp: number, network?: string, polyscanApiKey?: string): Promise;