mintForMultiCreators(contract, sender, receiver, uri, hash, currency, creators)
Feature
Mint a new NFT to receiver. (Used for multiple creators.) Notes: Sender must be the owner of the contract or a white-listed account. The creators address must be deployed on the Mitum network.
Parameters
string contract address,
string sender,
string receiver,
string uri,
string hash,
string currencyID,
array creators
Return Value
object mint operation
//[ parameter Creator ’s structure ]
{
account: string,
share: integer,
}account is the address of each creator, and share is the stake or contribution to the NFT to be minted.
The value of a share must not exceed 100, and the total of the shares must not exceed 100.
example
const contractAddress = "0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca";
const sender = "0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca";
const receiver = "0x07469989b2562afF5E5C3B116CD3AA5Ef814e5a1fca";
const uri = "www.abcd_efgh.com";
const hash = "381yXYxtWCavzPxeUXRewT412gbLt2hx7VanKazkBrsnyfPPBdXfoG52Yb2wkF8vC3KJyoWgETpsN6k97mQ8tUXr1CmTedcj";
const currencyID = "MCC";
const creator1 = {
account: "0x78f707a5CB15924b5edf7E45cD8df06b577984F7fca",
share: 33,
};
const creator2 = {
account: "0x07469989b2562afF5E5C3B116CD3AA5Ef814e5a1fca",
share: 66,
};
const mintOperation = mitum.nft.mintForMultiCreators(
contractAddress,
sender,
receiver,
uri,
hash,
currencyID,
[creator1, creator2]
);
console.log(mintOperation);
// output
Operation {
id: 'mitum',
fact: MintFact {
hint: Hint { s: 'mitum-nft-mint-operation-fact' },
token: Token { s: '2024-05-20 08:26:13.097 +0000 UTC' },
_hash: <Buffer e1 08 3c eb 7d 33 1b 55 d6 15 75 2c d6 2d d1 1b da 82 1c 21 51 94 f1 dc 39 3e ec 72 5c b2 9b d0>,
sender: Address {
s: '0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca',
type: 'mitum'
},
items: [ [MintItem] ]
},
hint: Hint { s: 'mitum-nft-mint-operation' },
_factSigns: [],
_hash: <Buffer >
}Previous⚠️ multiMint(contract, sender, receivers, uri, hash, currency, creator)NextgetNFT(contract, nftIdx)
Last updated