铸造NFT
Mint NFT to MCS Opensea Collection
require('dotenv').config()
const { mcsSDK } = require('js-mcs-sdk')
// set up js-mcs-sdk
const mcs = new mcsSDK({
privateKey: process.env.PRIVATE_KEY,
rpcUrl: process.env.RPC_URL,
})
async function main() {
// ENTER PARAMETERS
const SOURCE_FILE_UPLOAD_ID = 0
const IPFS_URL = ''
const NFT_NAME = ''
const NFT_DESCRIPTION = '' // optional
const nft = {
name: NFT_NAME, // the name of your NFT
image: IPFS_URL, // asset URI, images will render on Opensea
external_url: IPFS_URL, // Opensea will provide a link to view the source
description: NFT_DESCRIPTION, // description of your NFT
attributes: [], // NFT attributes displayed on Opensea
}
const mintTx = await mcs.mintAsset(SOURCE_FILE_UPLOAD_ID, nft)
console.log(mintTx)
}
main()Parameters
Return
Last updated