---
id: HS0005
title: "Token mint supply and authorities"
url: https://carbium.sh/library/howsolana/token-mint-supply-and-authorities
collection: How to use Solana
category: SPL tokens
revision: 1
updated: 2026-11-22
author: Carbium
code: MIT (LICENSE in the zip); text: all rights reserved, Carbium Corporation
---

# Token mint supply and authorities

One TypeScript file takes a mint address, makes a single getAccountInfo read, and prints the token's supply, decimals, mint authority, freeze authority and owning program. It only reads: no keypair, no signature, no transaction.

## What a mint account holds

Every SPL token starts as a mint, one small on-chain account that defines the token. Balances sit in separate token accounts. The mint holds the facts every holder shares: how many units exist, how many decimals they carry, and who is still allowed to change that. Reading it answers the first questions anyone asks about an unfamiliar token.

A classic mint stores five fields: the supply as a raw integer, the decimals, an initialized flag, an optional mint authority and an optional freeze authority. It stores no name, symbol or logo. Those sit in a separate metadata account, or in an extension on a Token-2022 mint, and the file does not print them.

One `getAccountInfo` call with `jsonParsed` encoding returns the whole mint. The node decodes the bytes into named fields, so the file needs no byte-layout code and no extra package. The two authorities matter most:

- Mint authority: the one address that can create new units. When it is null, the supply can only fall, through burns, and the field cannot be set again.
- Freeze authority: the address that can freeze any token account of this mint, which stops its owner from moving the balance. Null means nobody can.

## The code

Install `@solana/kit` at 8.6.0 and export `CARBIUM_KEY`. Node 24 strips the TypeScript types by itself, so `node main.ts` is the whole run command. The mint is an optional first argument and defaults to USDC.

`main.ts` (run: `node main.ts [mint-address]`)

```ts
// HS0005 · Token mint supply and authorities
// https://carbium.sh/library/howsolana/token-mint-supply-and-authorities
// Copyright (c) Carbium Corporation. MIT License (LICENSE). Keep this notice.
// SPDX-License-Identifier: MIT

import { setTimeout as pause } from "node:timers/promises";
import {
  address,
  createDefaultRpcTransport,
  createSolanaRpcFromTransport,
  isSolanaError,
  SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR,
} from "@solana/kit";

const apiKey = process.env.CARBIUM_KEY;
if (!apiKey) {
  console.error("CARBIUM_KEY is missing: export your Carbium key and run again.");
  process.exit(1);
}
const rpc = createSolanaRpcFromTransport(
  createDefaultRpcTransport({
    url: process.env.CARBIUM_RPC_URL ?? "https://services.carbium.sh",
    headers: { "x-api-key": apiKey },
  }),
);

const DEFAULT_MINT = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
const target = address(process.argv[2] ?? DEFAULT_MINT);

type MintFields = {
  decimals: number;
  supply: string;
  isInitialized: boolean;
  mintAuthority: string | null;
  freezeAuthority: string | null;
  extensions?: { extension: string }[];
};
type ParsedData = { program: string; parsed?: { type: string; info: MintFields } };

// Place the decimal point inside the text so no digit passes through a float.
function withPoint(raw: string, decimals: number): string {
  const padded = raw.padStart(decimals + 1, "0");
  if (decimals === 0) return padded;
  return padded.slice(0, -decimals) + "." + padded.slice(-decimals);
}

// Run a call; on one HTTP 429 sleep for the hinted seconds and run it again.
async function retryOn429<T>(run: () => Promise<T>): Promise<T> {
  try {
    return await run();
  } catch (err) {
    if (!isSolanaError(err, SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR) || err.context.statusCode !== 429) throw err;
    const wait = Number(err.context.headers.get("retry-after")) || 1;
    console.error(`rate limited, retrying in ${wait}s`);
    await pause(wait * 1000);
    return run();
  }
}

const { value } = await retryOn429(() =>
  rpc.getAccountInfo(target, { encoding: "jsonParsed", commitment: "finalized" }).send(),
);
if (!value) {
  console.error(`No account at ${target}.`);
  process.exit(1);
}
const data = value.data as unknown as ParsedData;
if (data.parsed?.type !== "mint") {
  console.error(`${target} is not a token mint (owner ${value.owner}).`);
  process.exit(1);
}
const m = data.parsed.info;
const rows: [string, string][] = [
  ["mint", target],
  ["program", `${value.owner} (${data.program})`],
  ["supply", `${withPoint(m.supply, m.decimals)} (raw ${m.supply}, decimals ${m.decimals})`],
  ["mint authority", m.mintAuthority ?? "none, supply cannot grow"],
  ["freeze authority", m.freezeAuthority ?? "none, nobody can freeze accounts"],
];
if (m.extensions?.length) rows.push(["extensions", m.extensions.map((x) => x.extension).join(", ")]);
for (const [label, text] of rows) console.log(`${label.padEnd(17)}${text}`);
```

The read passes `commitment: "finalized"`. `@solana/kit` 8.6.0 fills in `confirmed` when a call leaves commitment out, so the file names the level it wants. Authorities change rarely, and you may act on the answer.

The `withPoint` function moves the decimal point inside the supply text, so no digit passes through a float. The cast on `value.data` is there because the node can answer with raw bytes when it cannot parse an account, and the check on `type` catches that case along with wallets and token accounts.

## Reading the answer

The program that owns the account comes separately from the parsed fields, as `owner`.

| Field | Type | Meaning |
|---|---|---|
| supply | string | The raw total as an integer, in the token's smallest unit. |
| decimals | number | Digits after the decimal point. USDC uses 6. |
| isInitialized | boolean | True for a usable mint. |
| mintAuthority | string or null | Address allowed to create new units, or null. |
| freezeAuthority | string or null | Address allowed to freeze token accounts of this mint, or null. |
| extensions | array | Token-2022 only: one entry per extension, such as `transferFeeConfig` or `permanentDelegate`. |

A `supply` of `1234567` with `decimals` of 6 reads as `1.234567`. A u64 can hold 18,446,744,073,709,551,615, far above the 2^53 that a JavaScript number keeps exact, so the node sends `supply` as text. Keep it as a string or a `BigInt` in your own code too, and format it with the mint's own decimals at the end.

> A null authority says only that nobody holds that power. It says nothing about who holds most of the supply.

The supply is a snapshot. A live mint authority can raise it a moment later, and any holder can burn units, so two reads at different times can differ.

## Classic and Token-2022 mints

Token-2022 is a second token program with its own program id, `TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb`. The classic program is `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA`. The `owner` of the mint account says which one created it, and the file prints it next to the parsed program name. The same call and the same fields work for both.

A Token-2022 mint may carry extensions, and some change what holding the token means. `transferFeeConfig` takes a fee on every transfer. `permanentDelegate` names an address that can move or burn any holder's tokens. `transferHook` runs another program on each transfer. The file prints extension names so you know when to look closer. It does not print their settings.

> A Token-2022 mint with a `permanentDelegate` can still list both authorities as null. Check the extension list before you read the authorities as a clean bill.

## On Carbium

Requests go to the URL in `CARBIUM_RPC_URL`, with `https://services.carbium.sh` as the fallback. The file builds one `rpc` client up front and sends every call through it.

An account read such as `getAccountInfo` costs 10 cells, and so do `getMultipleAccounts` and `getTokenAccountBalance`. The [account-read allowance](https://carbium.sh/docs#rpc) is 0.5 requests per second on Free, 15 on Dev, 50 on Business and 400 on Pro, so a Free key reads one mint every two seconds.

For a list of mints, hand the addresses to `getMultipleAccounts` with `jsonParsed` encoding: up to 300 pubkeys per call on Pro and 100 on Free, Dev and Business, where the 1,024-cell burst caps a call. Each pubkey costs 10 cells, and you get one parsed mint or `null` back per address. A JSON-RPC batch of up to 100 calls also works. `@solana/kit` has no batch method, so that route is a raw `fetch` POST with a JSON array body.

## Where it ends

This reads the mint and nothing about its holders. Who holds the supply, and how concentrated it is, needs a ranking of holders. `getTokenLargestAccounts` does that on a full node and is not served on Carbium. It answers `-32601`, method not found, and a retry changes nothing.

Authorities are addresses, and the file prints them as given. A mint authority can be a wallet, a multisig or a program. One `getAccountInfo` on that address shows which, through its `owner`, and the file does not take that step.

There is no name, symbol or logo here. Those come from the token's metadata, which the file does not print.

## When it goes wrong

| What goes wrong | What to do |
|---|---|
| `No account at <mint>.` and exit code 1. | The node returned a null value: the address has a typo, was never created or has been closed. Check the string against an explorer. |
| `<address> is not a token mint`. | You passed a wallet or a token account. A token account parses as type `account`. Use the mint address, which the token account's parsed info lists as `mint`. |
| An error thrown before any request leaves, naming the address. | `address()` rejects a string that is not a base58 public key of 32 to 44 characters. Copy the address again without spaces or a trailing character. |
| HTTP 429 with a retry-after hint. | The file has already waited and retried once, so a 429 that reaches you means the loop is too fast. Space the calls out, or pick a plan with a higher [account-read allowance](https://carbium.sh/docs#rpc). |
| Error -32601 method not found from `getTokenLargestAccounts`. | Carbium does not serve that method, so it will keep answering -32601. Do not retry it. Read the mint with this file and find holders from an index you own. |
| A supply that is off by a power of ten. | You divided by the wrong decimals, or you went through a float. Use the `decimals` of this mint and keep `supply` as text or a `BigInt` until the last step. |

## Questions

### Do I need a private key to read a token's info?

No. The call takes the mint address and returns its state. The Carbium key only identifies your account to the RPC.

### Why finalized and not confirmed?

The file reads authorities, and an answer you act on should be settled. Finalized is also the level the node itself uses when a call names none.

### Does a null mint authority fix the supply forever?

For minting, yes: the authority cannot be set again, so no new units appear. Holders can still burn units, and a Token-2022 mint can carry extensions that change transfers, so read the extension list too.

### Where do I get the token's name and symbol?

Not from this file's output. They sit in the token's metadata account, or in a metadata extension on a Token-2022 mint. Both are account reads at the same 10 cells.

### How do I check many mints at once?

Pass them to `getMultipleAccounts` with `jsonParsed` encoding, up to 100 pubkeys per call below Pro and 300 on Pro. It charges 10 cells per pubkey, so a 100-pubkey call costs 1,000 cells, or 1,001 with a body over 4 KiB.

## Related

- [SPL token balance](https://carbium.sh/library/howsolana/spl-token-balance) (How to use Solana, HS0001)
- [Read-only model tools](https://carbium.sh/library/si/read-only-model-tools) (AI and blockchain, SI0001)
- [carbium.sh/docs#rpc](https://carbium.sh/docs#rpc)
- [carbium.sh/docs#auth](https://carbium.sh/docs#auth)
- [carbium.sh/docs#endpoints](https://carbium.sh/docs#endpoints)
- [carbium.sh/docs#errors](https://carbium.sh/docs#errors)
- [carbium.sh/docs#limits](https://carbium.sh/docs#limits)
