Retrieve all the NFT editions associated with a specific master NFT . This is an efficient way to get all the printable editions for a master edition NFT.
How to get all the NFT editions for a specific master edition
Copy const url = `https://mainnet.helius-rpc.com/?api-key=<API-KEY>`;
const getNftEditions = async () => {
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
method: "getNftEditions",
id: "helius-test",
params: {
mint: "Ey2Qb8kLctbchQsMnhZs5DjY32To2QtPuXNwWvk4NosL"
page: 1,
limit: 2
},
}),
});
const data = await response.json();
if (!data.result) {
console.error("No result in the response", data);
return;
}
console.log(JSON.stringify(data.result, null, 2));
};
getNftEditions();
Copy {
"jsonrpc": "2.0",
"result": {
"total": 2,
"limit": 2,
"page": 1,
"master_edition_address": "8SHfqzJYABeGfiG1apwiEYt6TvfGQiL1pdwEjvTKsyiZ",
"supply": 66,
"max_supply": 69,
"editions": [
{
"mint": "GJvFDcBWf6aDncd1TBzx2ou1rgLFYaMBdbYLBa9oTAEw",
"edition_address": "AoxgzXKEsJmUyF5pBb3djn9cJFA26zh2SQHvd9EYijZV",
"edition": 1
},
{
"mint": "9yQecKKYSHxez7fFjJkUvkz42TLmkoXzhyZxEf2pw8pz",
"edition_address": "giWoA4jqHFkodPJgtbRYRcYtiXbsVytnxnEao3QT2gg",
"edition": 2
}
]
},
"id": "0"
}