SPL tokens
Create mints, token accounts and transfers with the SPL Token CLI.
Set up#
Install the SPL Token CLI (cargo install spl-token-cli) and create a test-only keypair. Fund its address from the faucet(opens in a new tab) — fees are paid in KYV. Every command below passes Kyvro's RPC explicitly with --url.
export KYVRO_RPC=https://rpc-testnet.kyvro.si
solana-keygen new --outfile ~/.config/solana/kyvro-test.json
solana address --keypair ~/.config/solana/kyvro-test.json # fund this address from the faucet| Program | Address | Version |
|---|---|---|
| SPL Token | TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA | 3.5.0 |
| SPL Token-2022 | TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb | 8.0.0 |
| Associated Token Account | ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL | 1.1.1 |
These are the same addresses as on Solana, preloaded at genesis and immutable. Token-2022 commands select that program explicitly (see spl-token --help); the default is SPL Token.
Create a mint#
spl-token create-token --url $KYVRO_RPC
# Creating token <MINT>
spl-token supply <MINT> --url $KYVRO_RPC # 0 to startThe mint defines the token: decimals, mint authority and freeze authority. Keep the mint address — it is the token's only stable identifier. For reference, the faucet's tKUSD mint is FPwMXWSGLm8ZBi5YDJroGMZjXqnYQgCmGCzVqs3YcgXe.
Token accounts#
Tokens live in Associated Token Accounts (ATAs), one per owner per mint — see how ATAs work. Create yours before minting:
spl-token create-account <MINT> --url $KYVRO_RPC
spl-token accounts --url $KYVRO_RPCMint and transfer#
spl-token mint <MINT> 1000 --url $KYVRO_RPC
spl-token transfer <MINT> 10 <RECIPIENT_ADDRESS> --url $KYVRO_RPC
spl-token balance <MINT> --url $KYVRO_RPCInspect on the explorer#
Paste the mint into the explorer(opens in a new tab): the token page shows decimals, supply, mint and freeze authorities, and the largest holders. Try it with tKUSD at the tKUSD page(opens in a new tab).
Something wrong or missing on this page? Send developer feedback.