Token
The thru token command provides comprehensive token management functionality, including minting, transfers, account management, and administrative operations.
Prerequisites
Section titled “Prerequisites”- CLI setup with configured keys and RPC endpoint
Command Overview
Section titled “Command Overview”Initialize Mint
Section titled “Initialize Mint”Create a new mint account on the blockchain and initialize it as a token mint with specified properties.
thru token initialize-mint $creator $ticker $seed [OPTIONS]creator · string · required
Creator address used for mint account derivation, formatted as a 46-char ta…[address] or 64-char hex key. Effectively, this must be the feepayer.
ticker · string · required
Token symbol, maximum 8 characters (e.g., “USDC”, “ETH”)
seed · string · required
32-byte hex string for deterministic mint address derivation.
To convert a readable string into a zero-padded 32-byte seed, run thru program seed-to-hex $seed.
string
Optional mint authority address. If omitted, the creator is used as mint authority.
string
Optional hex-encoded state proof for mint account creation. If not provided, the state proof is automatically generated.
string
Address that can freeze/unfreeze token accounts (optional)
integer
Number of decimal places for token precision (0-18)
string
Account to pay transaction fees
Example:
thru token initialize-mint \ ta...[creator] \ GOLD \ 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefthru token initialize-mint \ ta...[creator] \ SILVER \ 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \ --freeze-authority ta...[freeze_authority] \ --decimals 6thru token initialize-mint \ ta...[creator] \ BRONZE \ 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \ --state-proof a1b2c3d4e5f6789... \ --fee-payer treasuryInitialize Account
Section titled “Initialize Account”Create a new token account on the blockchain that can hold tokens from a specific mint.
thru token initialize-account $mint $owner $seed [OPTIONS]mint · string · required
The mint address for which to create an account
owner · string · required
Address that will own and control this token account
seed · string · required
32-byte hex string for deterministic account address derivation. This seed is hashed with the owner and mint to create the final token account address.
string
Optional hex-encoded state proof for token account creation. If not provided, the state proof is automatically generated.
string
Account to pay transaction fees
Example:
thru token initialize-account \ ta...[mint] \ ta...[owner] \ fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210thru token initialize-account \ ta...[mint] \ ta...[owner] \ fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 \ --fee-payer treasurythru token initialize-account \ ta...[mint] \ ta...[owner] \ fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 \ --state-proof f9e8d7c6b5a4321... \ --fee-payer treasuryTransfer
Section titled “Transfer”Transfer tokens between two token accounts. Both accounts must be associated with the same mint, and neither account can be frozen. The fee payer must be the owner of the source token account to authorize the transfer.
thru token transfer $from $to $amount [OPTIONS]from · string · required
Source token account address
to · string · required
Destination token account address
amount · integer · required
Amount to transfer (in smallest token units)
string
Account to pay transaction fees (must be the owner of the source token account)
Example:
thru token transfer \ ta...[from_token_account] \ ta...[to_token_account] \ 1000000thru token transfer \ ta...[from_token_account] \ ta...[to_token_account] \ 500000 \ --fee-payer aliceMint To
Section titled “Mint To”Mint new tokens directly to a token account. The destination account must be associated with the specified mint and cannot be frozen. Only the designated mint authority can perform this operation.
thru token mint-to $mint $to $authority $amount [OPTIONS]mint · string · required
The mint address from which to create new tokens
to · string · required
Destination token account to receive the minted tokens
authority · string · required
Mint authority address (must match the mint’s authority)
amount · integer · required
Amount to mint (in smallest token units)
string
Account to pay transaction fees
Example:
thru token mint-to \ ta...[mint] \ ta...[destination_token_account] \ alice \ 5000000000thru token mint-to \ ta...[mint] \ ta...[destination_token_account] \ treasury \ 1000000000000 \ --fee-payer treasuryPermanently destroy tokens from an account. The account must be associated with the specified mint and cannot be frozen. Only the account owner can perform this operation.
thru token burn $account $mint $authority $amount [OPTIONS]account · string · required
Token account containing tokens to burn
mint · string · required
The mint address of the tokens being burned
authority · string · required
Account owner address (must be the owner of the token account being burned)
amount · integer · required
Amount to burn (in smallest token units)
string
Account to pay transaction fees
Example:
thru token burn \ ta...[token_account] \ ta...[mint] \ alice \ 1000000thru token burn \ ta...[token_account] \ ta...[mint] \ burn_authority \ 5000000 \ --fee-payer treasuryClose Account
Section titled “Close Account”Close a token account and transfer any remaining balance. The account must have a zero balance before closing. Only the account owner can perform this operation.
thru token close-account $account $destination $authority [OPTIONS]account · string · required
Token account to close
destination · string · required
Account to receive any remaining token balance
authority · string · required
Account owner address (must be the owner of the token account being closed)
string
Account to pay transaction fees
Example:
thru token close-account \ ta...[token_account] \ ta...[destination_account] \ alicethru token close-account \ ta...[token_account] \ ta...[destination_account] \ alice \ --fee-payer treasuryFreeze Account
Section titled “Freeze Account”Freeze a token account to prevent transfers. The account must be associated with the specified mint. Only the mint’s freeze authority can perform this operation, and the mint must have freeze authority enabled.
thru token freeze-account $account $mint $authority [OPTIONS]account · string · required
Token account to freeze
mint · string · required
The mint address associated with the account
authority · string · required
Freeze authority address (must match the mint’s freeze authority)
string
Account to pay transaction fees
Example:
thru token freeze-account \ ta...[token_account] \ ta...[mint] \ freeze_authorityThaw Account
Section titled “Thaw Account”Unfreeze a previously frozen token account. The account must be associated with the specified mint. Only the mint’s freeze authority can perform this operation, and the mint must have freeze authority enabled.
thru token thaw-account $account $mint $authority [OPTIONS]account · string · required
Token account to unfreeze
mint · string · required
The mint address associated with the account
authority · string · required
Freeze authority address (must match the mint’s freeze authority)
string
Account to pay transaction fees
Example:
thru token thaw-account \ ta...[token_account] \ ta...[mint] \ freeze_authorityDerive Mint Account Address
Section titled “Derive Mint Account Address”Calculate the deterministic mint account address that would be created for a given creator and seed combination. Use this to predict the mint address before calling initialize-mint.
thru token derive-mint-account $creator $seedcreator · string · required
Creator address
seed · string · required
Seed for derivation (32 bytes hex, 64 hex characters)
Example:
thru token derive-mint-account \ ta...[creator] \ 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefthru --json token derive-mint-account \ ta...[creator] \ 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefDerive Token Account Address
Section titled “Derive Token Account Address”Calculate the deterministic token account address that would be created for a given mint, owner, and seed combination. Use this to predict token account addresses before calling initialize-account.
thru token derive-token-account $mint $owner [OPTIONS]mint · string · required
Mint account address
owner · string · required
Account owner address
string
Seed for derivation (32 bytes hex, optional - defaults to all zeros)
Example:
thru token derive-token-account \ ta...[mint] \ ta...[owner]thru token derive-token-account \ ta...[mint] \ ta...[owner] \ --seed fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210thru --json token derive-token-account \ ta...[mint] \ ta...[owner] \ --seed fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210Common Usage Patterns
Section titled “Common Usage Patterns”Initialize a Token Mint
Section titled “Initialize a Token Mint”-
(Optional) Verify the mint address
You can optionally verify the mint account address that will be created:
Terminal window thru token derive-mint-account \ta...[creator] \0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefWhere:
- First argument: creator address
- Second argument: seed for mint derivation (save this securely!)
-
Initialize the mint
Create the mint account - the address and state proof are automatically derived:
Terminal window thru token initialize-mint \ta...[creator] \MYTOKEN \0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \--freeze-authority ta...[freeze_authority] \--decimals 6Where:
- First argument: creator address
- Second argument: token symbol/ticker
- Third argument: seed for deterministic address derivation
Initialize a Token Account
Section titled “Initialize a Token Account”Creating a token account is now simplified with automatic address and state proof derivation:
-
(Optional) Verify the token account address
You can optionally verify the token account address that will be created:
Terminal window thru token derive-token-account \ta...[mint] \ta...[owner] \--seed fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210Where:
- First argument: mint address (from the mint initialization)
- Second argument: account owner address
--seed: unique seed for this token account (save this!)
-
Initialize the token account
Create the token account - the address and state proof are automatically derived:
Terminal window thru token initialize-account \ta...[mint] \ta...[owner] \fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210Where:
- First argument: mint address
- Second argument: account owner address
- Third argument: seed for deterministic address derivation