βοΈFungible Token Extension
The most versatile API for working with tokens on Solana.
Background
Initially, the DAS API only supported ownership queries against Metaplex NFTs and cNFTs. Helius has extended the DAS API to support all tokens, including plain SPL tokens (without metadata) and Token22 (plus their extensions).
Users can query for the token balances of any account, across all tokens (SPL, Token22, NFTs, compressed NFTs). We've also included token prices in USD.
A Solana token is defined by its mint account. For example, the mint account for USDC is EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v. When you buy $40 of USDC, a token account is created that holds 40 USDC tokens. This can extend to hundreds (and even more) of token accounts for different tokens.
Want to learn more about Token22? Check out the Helius blog post!
How does it work?
The Helius extension for fungible tokens resolves around ownership indexing. The following queries provide a unified view of an account's assets. GetAsset, GetAssetsByOwner, and SearchAssets support fungible tokens.
This extension adds an extra field called tokenType
. This field allows you to query against all assets the account owns, including fungible and Token22 tokens.
The options for tokenType
include:
fungible
: Returns all fungible tokens.nonFungible
: Returns all NFTs (compressed and regular NFTs).regularNFT
: Returns only the regular NFTs.compressedNFT
: Returns only the compressed NFTs.all
: Returns all the tokens.
Example:
You'll now see fungible tokens like JitoSOL in the response (trimmed for brevity). It will include the total account balance, the token's program address, the associated token address, the total supply in circulation, and the price information.
Token22 Support
We support Token22 tokens and parse their extensions. The response will include the mint_extensions
field if it is a Token22 program. Here is an example for BERN:
Backwards Compatibility
For backwards compatibility, the behaviour is identical to the original DAS, meaning only NFTs and compressed NFTs are returned.
Last updated