SPL Token IDL
TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DASPL Token is the foundational token program on Solana. Manages token minting, transfers, burning, approvals, and account freezing. Used by every SPL token including USDC, wrapped SOL, and thousands more.
Instructions
Account Types
Integration Examples
Use the SPL Token IDL in your application with these code examples for TypeScript, Rust, and Python.
import { Connection, PublicKey } from "@solana/web3.js";
import { Program, AnchorProvider, Idl } from "@coral-xyz/anchor";
// Load the SPL Token IDL
import idl from "./spl token.json";
const PROGRAM_ID = new PublicKey("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
// Set up the provider and program
const connection = new Connection("https://api.mainnet-beta.solana.com");
const provider = new AnchorProvider(connection, wallet, {
commitment: "confirmed",
});
const program = new Program(idl as Idl, provider);
// Fetch and decode an account
const accountData = await program.account.sPL_Token
.fetch(accountPublicKey);
console.log("Account data:", accountData);
// Build and send an instruction
const tx = await program.methods
.initialize(/* ...args */)
.accounts({
/* ...required accounts */
})
.rpc();
console.log("Transaction signature:", tx);IDL JSON Preview
{
"version": "0.0.0",
"name": "token",
"docs": [
"A Token program on the Solana blockchain.",
"This program defines a common implementation for Fungible and Non Fungible tokens."
],
"ref": "https://github.com/solana-labs/solana-program-library/blob/df65094507d214fd30eaa1d3a9d65adced5056d6/token/program/src/instruction.rs",
"instructions": [
{
"name": "InitializeMint",
"docs": [
"Initializes a new mint and optionally deposits all the newly minted",
"tokens in an account.",
"",
"The `InitializeMint` instruction requires no signers and MUST be",
"included within the same Transaction as the system program's",
"`CreateAccount` instruction that creates the account being initialized.",
"Otherwise another party can acquire ownership of the uninitialized",
"account."
],
"accounts": [
{
"name": "mint",
"isMut": true,
"isSigner": false,
"docs": [
"The mint to initialize."
]
},
...Frequently Asked Questions
What is the SPL Token IDL?
The SPL Token IDL (Interface Definition Language) is a JSON schema that defines the on-chain program interface for the SPL Token smart contract on Solana. It describes all available instructions, account structures, events, and custom types that developers need to interact with the SPL Token program. This IDL contains 21 instructions, 2 account types, 0 events, and 3 type definitions.
How do I use the SPL Token IDL in my project?
Download the JSON file and import it in your project. With TypeScript, use the @coral-xyz/anchor package to create a Program instance. In Rust, use anchor-client. For Python, use anchorpy. See the integration examples above for complete code snippets in all three languages.
What is the SPL Token program address on Solana?
The SPL Token program is deployed at address TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA on Solana mainnet. You can verify this on any Solana block explorer.
What version of the SPL Token IDL is this?
This is version 0.0.0 of the SPL Token IDL. IDL versions correspond to specific program deployments and may be updated as the protocol evolves. Always verify compatibility with the on-chain program version before integrating.