Readonly premiaThe Premia SDK instance.
Protected streamThe current index of quote streams. Used to cancel stale streams.
Fetches the current spot price of a given token in USD.
This function retrieves the spot price for a given token from the underlying data source. If the token's USD price is not available, an error is thrown.
An error if the USD price for the token is not found.
The address of the token for which to fetch the spot price.
A promise that resolves to the spot price of the token in USD.
Fetches information of a given token from voidnode, coingecko, or token contract.
Will throw an error if the token information cannot be fetched from either the voidnode server, coingecko, or token contract.
The address of the token for which to fetch the detailed information.
Optional provider: ProviderThe custom provider to use for this call.
A promise that resolves to an object containing the token's name, symbol, decimals, whether it's native or wrapped native, price in ETH and USD, address, and chain ID.
Fetches extended information of a given token from the voidnode server.
The address of the token for which to fetch the extended information.
A promise that resolves to an object containing the extended information of the token.
Retrieves the information for a list of tokens given their details.
This function fetches information for multiple tokens specified by an array of token information objects. If voidnode querying is not skipped and fails, the function resorts to fetching token details directly.
Will throw an error if the voidnode server fails to load.
An array of token information objects for which to fetch the token data.
Optional provider: ProviderThe custom provider to use for this call.
A promise that resolves to an array containing the information of the specified tokens.
Retrieves the extended information for a list of tokens given their details.
This function fetches extended information for multiple tokens specified by an array of token information objects.
An array of token information objects for which to fetch the token data.
A promise that resolves to an array containing the extended information of the specified tokens.
Fetches minimal information of a given token including its symbol and decimals.
The address of the token for which to fetch the minimal information.
Optional provider: ProviderThe custom provider to use for this call.
A promise that resolves to an object containing the token's address, symbol, and decimals.
Fetches information for multiple tokens given their addresses.
This function retrieves information for multiple tokens specified by an array of addresses. It uses caching with an hourly time to live to prevent frequent calls to the voidnode server. If voidnode call fails, it switches to skip the voidnode server and fetches the tokens' information directly.
An array of token addresses for which to fetch the information.
Optional provider: ProviderThe custom provider to use for this call.
A promise that resolves to an array containing the information of the tokens.
Retrieves extended information of multiple tokens given their addresses.
An array of token addresses for which to fetch the extended information.
A promise that resolves to an array containing the extended information of the specified tokens.
Generated using TypeDoc
Represents a class for handling Token operations related to the voidnode server.