Solana Integration

Programs

Network
Program ID

devnet

yteDZqmquhCJwDKumf35uPqcknDn87xgcDLqdxjAigq

SDK

A TypeScript SDK that integrates easily with Metaplex is available.

yarn add @megayours/megadata

The SDK is currently experimental and configured to use our program on Solana devnet. You can easily mint and update metadata by following the examples below.

Minting

import { createNft } from '@metaplex-foundation/mpl-token-metadata';
import { percentAmount } from '@metaplex-foundation/umi'
import { createMegadata } from '@megayours/megadata/solana';

const megadataUri = await createMegadata({
  umi,
  mint,
  megadata: {
    "pfps": {
      "Hair": "Brown Textured Crop",
      "Length (CM)": "174"
    },
    "equippables": {
      "Hat": "Blue Cap",
      "Shirt": "Black T-Shirt",
      "Pants": "Shorts",
      "Shoes": "Brown Moccasins"
    }
  }
});

await createNft(umi, {
  mint,
  name: 'My NFT',
  uri: megadataUri,
  sellerFeeBasisPoints: percentAmount(5.5),
}).sendAndConfirm(umi);

Updating

import { updateMegadata } from '@megayours/megadata/solana';

await updateMegadata({
  umi,
  mint,
  megadata: {
    "equippables": {
      "Hat": "Red Cap"
    }
  }
})

Token URI

The SDK will prepare and return a token URI which is unique for your token and serves as a gateway to the Megadata blockchain.

https://router1.testnet.megayours.com/solana/4NjERDbp6GVPtoSjNmjjVNtEVscv67WGCPiVkFN9XW2i

Last updated

Was this helpful?