Mint Provider
📘 Mint info Provider
API
children
ReactNode
The wrapped children.
undefined
For example
Context
Provider
mints
Record<string, MintData>
A mapping from a mint address to the corresponding mint data.
getMint
async (mintAddress: string): Promise<MintData>
Fetch mint data from live nodes or local cache by a mint address.
getDecimals
async (mintAddress: string): Promise<number>
Find decimals for the mint.
tokenProvider
TokenProvider
The mint metadata provider (i.e. logo uri, coingecko or coinmarketcap ticket). See the TokenProvider section for details.
MintData
mint_authority_option
0 | 1
Whether the mint_authority property is available.
mint_authority
string
The authority address that can mint more token.
supply
bigint
Total supply.
decimals
number
Decimals.
is_initialized
boolean
Whether the mint is initialized.
freeze_authority_option
bigint
Whether the freeze_authority property is available.
freeze_authority
string
The authority address that can freeze accounts corresponding to the mint.
Hook & HOC
For example
Wrap the parent by MintProvider before accessing the context.
TokenProvider
In this document, we will use token and mint interchangeably. However, the meaning of both is the same.
Actually, tokenProvider is an instance from TokenProvider class. By the instance, you can find token metadata by its symbol or name for example. That way is more intuitive than using mint addresses.
TokenProvider API
find
async (keyword: string, limit?: 10): Promise<TokenInfo[]>
Semantic search tokens. The function can search mutiple tokens.
findByAddress
async (addr: string): Promise<TokenInfo | undefined>
Find a token by its address.
all
async (): Promise<TokenInfo[]>
Get all tokens.
You can learn more data types in the original repo: https://github.com/solana-labs/token-list.
TokenInfo
Example: all
Example: findByAddress
Example: find
Last updated