> ## Documentation Index
> Fetch the complete documentation index at: https://injectivelabs-docs-ai-sdk.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Token Factory

token factoryモジュール関連のデータをチェーンからクエリするためのコードスニペット例。

## gRPCを使用する

### *creator* が作成したすべてのdenomを取得する

```ts lines highlight={1} theme={null}
import { getNetworkEndpoints, Network } from "@injectivelabs/networks";
import { ChainGrpcTokenFactoryApi } from "@injectivelabs/sdk-ts/client/chain";

const endpoints = getNetworkEndpoints(Network.Testnet);
const chainGrpcTokenFactoryApi = new ChainGrpcTokenFactoryApi(endpoints.grpc);

const creator = "inj...";
const denoms = await chainGrpcTokenFactoryApi.fetchDenomsFromCreator(creator);

console.log(denoms);
```

### denom authority metadataを取得する（トークンのadminを取得するなど）

```ts theme={null}
import { getNetworkEndpoints, Network } from "@injectivelabs/networks";
import { ChainGrpcTokenFactoryApi } from "@injectivelabs/sdk-ts/client/chain";

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);
```
