⚠️ multiMint(contract, sender, receivers, uri, hash, currency, creator)
Feature
Mint multiple NFTs at once. 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 | string[] contract address, // If given a string, it is automatically converted to an array filled with the same values.
string sender,
string[] receivers, // Address to which each nft will be sent
string[] uri,
string[] hash,
string currencyID,
string creator,
Return Value
objectmint operation with multiple item
uri: The array of path where the NFT file is physically stored, or where the metadata is stored.
hash: The array of hash value of the NFT file.
creator: The address of a creator or copyright holder of the NFT.
example1. mint 2 nfts on one CA(0x41…) and sent each nfts to account(0xB8…) and account(0x07…)
const contractAddress = "0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca";
const sender = "0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca";
const recievers = ["0xB8dE7113DE470Ab89304A954939126FA97a812dcfca", "0x07469989b2562afF5E5C3B116CD3AA5Ef814e5a1fca"]
const uri = "www.abcd_efgh.com";
const hash = "381yXYxtWCavzPxeUXRewT412gbLt2hx7VanKazkBrsnyfPPBdXfoG52Yb2wkF8vC3KJyoWgETpsN6k97mQ8tUXr1CmTedcj";
const currencyID = "MCC";
const creator = "0x78f707a5CB15924b5edf7E45cD8df06b577984F7fca";
const mintOperation = mitum.nft.multiMint(contractAddress, sender, recievers, [uri, uri], [hash, hash], currencyID, creator);
console.log(mintOperation);
// output
Operation {
id: 'mitum',
fact: MintFact {
hint: Hint { s: 'mitum-nft-mint-operation-fact' },
token: Token { s: '2024-07-31 04:27:04.814 +0000 UTC' },
_hash: <Buffer ca 18 74 55 7f e0 9b 7c 01 b2 4f be 8b 90 7e 3e c0 34 e5 bd 6d 64 17 28 75 c7 94 f3 6d 0b 4a 0c>,
sender: Address {
s: '0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca',
type: 'mitum'
},
items: [ [MintItem], [MintItem] ]
},
hint: Hint { s: 'mitum-nft-mint-operation' },
_factSigns: [],
_hash: <Buffer >
}example2. mint 1 nft on the each CAs (0x41…, 0x2F…) sent each nfts to account(0xB8…) and account(0x07…)
Last updated