MegaYours Docs
  • 🚀MegaYours
    • Extending your on chain data
  • 💾Megadata
    • Solana Integration
  • 🌎Yours Protocol
    • 🤔Getting Started
      • Setting up Your Project
      • Creating Your First Module
      • Creating & Minting Tokens
      • Composable Tokens
      • Making Your Tokens Interoperable
    • 💱Tokens
      • Types
      • Functions
      • Unique Identifier
    • 🧩Modules
      • 🔌Attaching Modules
      • 🌈Relationships
      • 🎭ERC1155
      • 📚Declaration
      • 👾External
    • 📄Metadata
    • 🔗Interoperability
    • 🔄Migration from Originals
      • FT3
      • Interfaces
      • Prototype
  • 👾Import Existing Tokens from any Chain
    • 🛰️Gamma Chain
  • 🔗Links
    • Github: Yours Protocol
Powered by GitBook
On this page
  • Programs
  • SDK

Was this helpful?

  1. Megadata

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
PreviousMegadataNextYours Protocol

Last updated 2 months ago

Was this helpful?

💾