Token Metadata IDL
metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1sMetaplex Token Metadata is the standard program for attaching rich metadata (name, symbol, URI, creators, royalties) to SPL tokens and NFTs on Solana. The foundation of all Solana NFT standards.
Instructions
Account Types
Integration Examples
Use the Token Metadata 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 Token Metadata IDL
import idl from "./token metadata.json";
const PROGRAM_ID = new PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s");
// 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.token_Metadata
.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": "1.14.0",
"name": "token_metadata",
"instructions": [
{
"name": "CreateMetadataAccount",
"accounts": [
{
"name": "metadata",
"isMut": true,
"isSigner": false,
"docs": [
"Metadata key (pda of ['metadata', program id, mint id])"
]
},
{
"name": "mint",
"isMut": false,
"isSigner": false,
"docs": [
"Mint of token asset"
]
},
{
"name": "mintAuthority",
"isMut": false,
"isSigner": true,
"docs": [
"Mint authority"
]
...Frequently Asked Questions
What is the Token Metadata IDL?
The Token Metadata IDL (Interface Definition Language) is a JSON schema that defines the on-chain program interface for the Token Metadata smart contract on Solana. It describes all available instructions, account structures, events, and custom types that developers need to interact with the Token Metadata program. This IDL contains 56 instructions, 14 account types, 0 events, and 51 type definitions.
How do I use the Token Metadata 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 Token Metadata program address on Solana?
The Token Metadata program is deployed at address metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s on Solana mainnet. You can verify this on any Solana block explorer.
What version of the Token Metadata IDL is this?
This is version 1.14.0 of the Token Metadata 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.