Example code snippets to query the chain for token factory module related data.
Fetch all denoms created by creator
import { ChainGrpcTokenFactoryApi } from '@injectivelabs/sdk-ts'
import { getNetworkEndpoints, Network } from '@injectivelabs/networks'
const endpoints = getNetworkEndpoints(Network.Testnet)
const chainGrpcTokenFactoryApi = new ChainGrpcTokenFactoryApi(endpoints.grpc)
const creator = 'inj...'
const denoms = await chainGrpcTokenFactoryApi.fetchDenomsFromCreator(creator)
console.log(denoms)
import { ChainGrpcTokenFactoryApi } from '@injectivelabs/sdk-ts'
import { getNetworkEndpoints, Network } from '@injectivelabs/networks'
const endpoints = getNetworkEndpoints(Network.Testnet)
const chainGrpcTokenFactoryApi = new ChainGrpcTokenFactoryApi(endpoints.grpc)
const creator = 'inj...'
const subdenom = 'NINJA'
const metadata = await chainGrpcTokenFactoryApi.fetchDenomAuthorityMetadata(
creator,
subdenom,
)
console.log(metadata)