Tokens
Tokens Class
The tokens
class is designed to manage token data and operations related to vaults and wallets.
Properties
tokens.vault
: Provides access to vault token data.raw
: An object containing raw token data and a map of token data for vaults.list
: A signal holding an array of raw token data in the vault.map
: A signal holding a map of raw token data in the vault, indexed by token address.
formatted
: An object containing formatted token data and a map of token data for vaults.list
: A signal holding an array of formatted token data in the vault.map
: A signal holding a map of formatted token data in the vault, indexed by token address.
tokens.wallet
: Provides access to wallet token data.raw
: An object containing raw token data and a map of token data for wallets.list
: A signal holding an array of raw token data in the wallet.map
: A signal holding a map of raw token data in the wallet, indexed by token address.
formatted
: An object containing formatted token data and a map of token data for wallets.list
: A signal holding an array of formatted token data in the wallet.map
: A signal holding a map of formatted token data in the wallet, indexed by token address.
Methods
unwatchTokens()
: Removes all listeners from the token service, and clears all token data in the vaults and wallets.watchTokens({ wallet, vault })
: Watches token data for the given wallet and vault addresses, updating token data in the vaults and wallets when a token transfer occurs.wallet
: String, the wallet address.vault
: String, the vault address.
Example Usage
Import the tokens class:
Watch token data for a specific wallet and vault:
Access raw and formatted token data:
Stop watching token data:
This documentation provides a basic overview of the tokens
class's properties and methods, as well as example usage to help you understand how to use the class in your application.
Last updated