Last active
June 26, 2022 19:41
-
-
Save dvcrn/a1b0ff0a0b4b3ab02aff44bc84ac4522 to your computer and use it in GitHub Desktop.
Revisions
-
dvcrn revised this gist
Nov 20, 2021 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,9 +12,9 @@ const tokenAddress = "CxkKDaBvtHqg8aHBVY8E4YYBsCfJkJVsTAEdTo5k4SEw"; const metadataPDA = await metaplex.programs.metadata.Metadata.getPDA( tokenAddress ); const mintAccInfo = await connection.getAccountInfo(metadataPDA); // fetch account info const metadata = metaplex.programs.metadata.Metadata.from( new metaplex.Account(tokenAddress, mintAccInfo) ); console.log(metadata); -
dvcrn created this gist
Nov 20, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ import * as metaplex from "@metaplex/js"; import * as web3 from "@solana/web3.js"; const connection = new web3.Connection( web3.clusterApiUrl("mainnet-beta"), "confirmed" ); const tokenAddress = "CxkKDaBvtHqg8aHBVY8E4YYBsCfJkJVsTAEdTo5k4SEw"; (async () => { const metadataPDA = await metaplex.programs.metadata.Metadata.getPDA( tokenAddress ); const mintaAccInfo = await connection.getAccountInfo(metadataPDA); const metadata = metaplex.programs.metadata.Metadata.from( new metaplex.Account(token.mint, mintaAccInfo) ); console.log(metadata); })();