mint(contract, sender, receiver, uri, hash, currency, creator)

Feature

Mint a new NFT to receiver. Notes: Sender must be the owner of the contract or a white-listed account. The creator address must be deployed on the Mitum network.

Parameters

string contract address, string sender, string receiver, string uri, string hash, string currencyID, string creator,

Return Value

object mint operation

  • uri: The path where the NFT file is physically stored, or where the metadata is stored.

  • hash: The hash value of the NFT file.

  • creator: The address of a creator or copyright holder of the NFT.

example

const contractAddress = "0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca";
const sender = "0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca";
const receiver = "0x07469989b2562afF5E5C3B116CD3AA5Ef814e5a1fca";
const uri = "www.abcd_efgh.com";
const hash = "381yXYxtWCavzPxeUXRewT412gbLt2hx7VanKazkBrsnyfPPBdXfoG52Yb2wkF8vC3KJyoWgETpsN6k97mQ8tUXr1CmTedcj";
const currencyID = "MCC";
const creator = "0x78f707a5CB15924b5edf7E45cD8df06b577984F7fca";

const mintOperation = mitum.nft.mint(contractAddress, sender, receiver, uri, hash, currencyID, creator);
console.log(mintOperation);

// output
Operation {
  id: 'mitum',
  fact: MintFact {
    hint: Hint { s: 'mitum-nft-mint-operation-fact' },
    token: Token { s: '2024-05-20 08:23:41.18 +0000 UTC' },
    _hash: <Buffer f7 b3 b2 fc 67 1f 8b 4e 32 2c 20 f2 1c 39 81 be fe b6 83 0c f1 b3 eb 72 33 db 2f 8e 2a 28 d8 c6>,
    sender: Address {
      s: '0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca',
      type: 'mitum'
    },
    items: [ [MintItem] ]
  },
  hint: Hint { s: 'mitum-nft-mint-operation' },
  _factSigns: [],
  _hash: <Buffer >
}

Last updated