Use This When
- you need a fungible-token mint and token account model on Thru
- you need to transfer, mint, burn, freeze, or thaw token balances
- you need to parse mint or token account state from chain data
Quickstart
Fetch the ABI, generate TypeScript builders, then build instruction bytes and send the transaction.How It Works
The program has two main account types:- mint accounts define token-wide metadata and authorities
- token accounts hold balances for a specific owner and mint
- derive the mint or token account address
- create the account with a state proof for the new address
- submit lifecycle or balance-changing instructions against those accounts
- read account state or emitted events to verify the new balances and authorities
Account Model
| Account | What it stores | Notes |
|---|---|---|
TokenMintAccount | decimals, supply, creator, mint_authority, freeze_authority, has_freeze_authority, ticker | The mint defines token-wide configuration and supply. |
TokenAccount | mint, owner, amount, is_frozen | Each token account is tied to one mint and one owner. |
TokenProgramAccount | Size-discriminated envelope over mint and token accounts | The ABI distinguishes mint_account and token_account by expected size. |
Address Derivation
Common client flows derive addresses deterministically:- mint address: from
mintAuthority + seed, then PDA-derived under the Token Program - token account address: from
owner + mint + seed, then PDA-derived under the Token Program
Required Accounts
Token instructions refer to transaction accounts by index:- lifecycle instructions include the mint, token account, authority, and sometimes owner account indices
- creation flows also include a state proof for the new address
- the same mint or authority may appear across multiple instructions in one transaction, so the final account list must stay stable
Events
| Event | What it means |
|---|---|
initialize_mint | A new mint was created and configured. |
initialize_account | A new token account was created for a mint and owner. |
transfer | Tokens moved between two token accounts. |
mint_to | New supply was minted into a destination token account. |
burn | Supply was burned from a token account. |
close_account | A token account was closed and cleaned up. |
freeze_account | A token account was frozen by the freeze authority. |
thaw_account | A previously frozen token account was thawed. |
Instructions
| Instruction | Use it when | Notes |
|---|---|---|
initialize_mint | Create a new fungible token mint | Includes ticker, decimals, authorities, seed, and state proof. |
initialize_account | Create a token account for an owner and mint | Includes the new account seed and state proof. |
transfer | Move tokens between token accounts | The common balance-changing path for user transfers. |
mint_to | Increase supply and credit a token account | Requires the mint authority. |
burn | Decrease supply and remove tokens from an account | Requires the account authority. |
close_account | Close a token account and reclaim its balance | Often used for cleanup once a balance is empty. |
freeze_account | Freeze a token account | Requires the freeze authority on the mint. |
thaw_account | Unfreeze a token account | Also requires the freeze authority. |
Related References
On-Chain Link
- Program explorer: scan.thru.org/address/taAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKqq