Skip to content

Instantly share code, notes, and snippets.

@arivictor
Created August 25, 2022 08:19
Show Gist options
  • Select an option

  • Save arivictor/f155b63e156729121ab9484765918d0e to your computer and use it in GitHub Desktop.

Select an option

Save arivictor/f155b63e156729121ab9484765918d0e to your computer and use it in GitHub Desktop.
// "@metaplex-foundation/js": "^0.15.0",
import {Metaplex} from "@metaplex-foundation/js";
import {Connection, PublicKey} from "@solana/web3.js";
const RPC_URL = 'https://...';
const MASTER_EDITION_ADDRESS = 'DdK...NFHaH';
const RESULT_OUTPUT_PATH = './hashlist.json';
(async () => {
const connection = new Connection(RPC_URL);
const metaplex = new Metaplex(connection);
const result: any = await metaplex.nfts().findByMint({
mintAddress: new PublicKey('<EDITION PUBLIC KEY (Token Address)>')
}).run()
if (result.model !== "sft") {
console.log('parent edition', result.edition.parent.toString())
console.log(result.edition.number.toString())
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment