mintAsset(sourceFileUploadId, nftObject)
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()
{
status: 'success',
data: {
id: <ID>,
source_file_upload_id: <ID>,
nft_tx_hash: <'0x...'>,
mint_address: '0x1A1e5AC88C493e0608C84c60b7bb5f04D9cF50B3',
token_id: '<ID>',
create_at: <TIME>,
update_at: <TIME>
}
}