with-metaplex
Helpers for doing stuff with metaplex on solana
Installation
npm i @gootools/with-metaplex
Add peer dependencies (if required)
npm i @solana/web3.js borsh bs58
Usage
import { clusterApiUrl, Connection } from "@solana/web3.js";
import { withMetaplex } from "@gootools/with-metaplex";
// uncomment below if using node and you need to polyfill fetch
// import "cross-fetch/polyfill";
const { getMetadataForMint } = withMetaplex(
new Connection(clusterApiUrl("mainnet-beta"))
);
getMetadataForMint("9gqFyarEBGDsK2pEw7WBUwmZSbxgyVrH7QQXCYiM1Ekm").then(
console.log
);
TODO
- tests!
- types!
- complete decodeMetadata
- fetch polyfill?