Protected
cacheCaches fetched results indefinitely
Protected
customCalled whenever the cache, or custom tokens changes
Adds custom tokens to the token manager
tokens to add
Parses a token into a hLP wrapped native token if it is a native token
the token to check
an object with the properties isNative and hlpAddress. If the token is native, isNative is true and hlpAddress is the address of a hlp compatible wrapped native token. If the token is a hLP token, isNative is false and hlpAddress is the address of the hLP token.
if the token is neither native, nor a hLP supported token, nor the handle liquidity token
if the token is native, and no hLP compatible wrapped native token exists
in favour of parseNativeToWrapped
Gets the handle liquidity pool token (symbol hLP) for a network
the network on which to find the token
the handle liquidity pool token if it exists, otherwise undefined
Finds the hLP compatible wrapped native token for a network
the network from which to get the token
the wrapped native token if one exists, otherwise undefined
address of the token to get
the network to get the token from
Optional
find: ((t) => boolean)optional function to find the token with specific criteria
Optional
the first occurence of the token with the given address, or undefined if not found
symbol of the token to get
the network to get the token from
the first occurence of the token with the given symbol, or undefined if not found
Returns an array of tokens with the given addresses. Order is not guaranteed. If a token cannot be found with the given address, it will be omitted from the array. If multiple tokens are found with the same address and network, they will all be included.
an array of objects with address as the address of the token, and network as the network of the token
an array of tokens with the given addresses.
this is not optimised for large addresses arrays
Returns an array of tokens with the given symbol. Order is not guaranteed. If a token cannot be found with the given address, it will be omitted from the array. If multiple tokens are found with the same address and network, they will all be included.
an array of objects with address as the address of the token, and network as the network of the token
an array of tokens with the given symbol.
this is not optimised for large symbol arrays
Protected
getChecks if the token is a stable hLP token
the address of the token to check
the network on which to check the token
whether there exists a stable hLP token with the given address
Checks if the token is a stable hLP token
the symbol of the token to check
the network on which to check the token
whether there exists a stable hLP token with the given symbol
Checks if a token is a supported hLP token by its address
the address of the token to check
the network on which to check the token
wheteher the token is a hlpToken
Checks if a token is a supported hLP token by its symbol
the symbol of the token to check
the network on which to check the token
wheteher the token is a hlpToken
Parses a token into a wrapped native token if it is native
the token to parse
an object with the properties isInputNative and parsedToken. If the token passed into the function is native, isInputNative will be set to true, and parsedToken will be the native wrapped token for the network. If the token passed in is not native, isInputNative will be set to false and parsedToken will be the token passed into the function
Sets custom tokens as a list of tokens
tokens to set
Sets a cache key to a token list
the key in the cache for which to set the tokenList
the tokenList to set
address of the token to get
the network to get the token from
Optional
find: ((t) => boolean)optional function to find the token with specific criteria
Optional
the first occurence of the token with the given address, or undefined if not found
symbol of the token to get
the network to get the token from
the first occurence of the token with the given symbol, or undefined if not found
Tries to get the wrapped native token for a network
the network from which to get the token
the wrapped native token if one exists, otherwise undefined
Static
fromCreates an instance of HandleTokenList from a TokenList instance.
the tokenList from which to construct the HandleTokenList
an instance of HandleTokenList with the cache of the tokenList
Static
Protected
removeGenerated using TypeDoc
TokenManager that comes with native, wrapped native, and handle tokens by default. Handle supported token extensions:
Note
the Handle Liquidity Pool token (symbol hLP) has isHlpToken set to false, as it is not technically in the liquidity pool. Instead, it has isLiquidityToken set to true