Bulk Insert (minting)
This feature is used to issue more than 2 NFTs.
Contents
Name | Description |
---|---|
This feature generates the mint transaction message. | |
This feature estimates the gas fee required for lining up transaction messages. | |
This feature executes multiple transactions at once. | |
Parameters required to call API. |
1. NftTxClient.msgMint
This function generates mint transactions as messages. Once the gas fee for generating a message is calculated, the transaction is created by the function that executes messages. * For a more detailed guide on calculating the gas fee and executing messages, please refer to functions 2 and 3.
Parameters
Name | Type | Example |
---|---|---|
data | MsgMint | { owner: address, tokenURI: "https://firmachain.org/nft/metadata/bcf5cdajs-ff12...-d2han89nnha1" } |
Return value
2. getGasEstimationFromEncodeObject
This function estimates the gas fee required when generating transactions of the message list created by function 1. When using Bulk Insert, there is a high chance where the gas fee could exceed the default gas fee(0.02fct). Therefore, prior to the execution of the transaction, the gas fee must be estimated properly.
Parameters
Name | Type | Example |
---|---|---|
wallet | Object (FirmaWalletService) | You can check how to use your wallet in the "firma-js of the Github repository". |
msgList | Array(NftTxClient.msgMint) | [ data1, data2, data3 ] |
Return value
Example Run Image
3. signAndBroadcast
This function lists the messages generated from function 1 and then generates the message list as transactions.
Parameters
Name | Type | Example |
---|---|---|
wallet | Object (FirmaWalletService) | You can check how to use your wallet in the "firma-js of the Github repository". |
msgList | msgList (EncodeObject[]) | 1 "Return value" Array value. |
txMisc (Not required) | Object (TxMisc) | {fee:200000,gas:163821,memo:"custom message"} |
Return value
4. Parameter Description
Name | Description |
---|---|
wallet | Unique wallet parameter created from the user’s Mnemonic. This parameter can be called by using the Wallet.fromMnemonic function from the FirmaSDK module. |
data | For this parameter, please enter your FirmaChain wallet address. |
msgList | This parameter contains the list of messages that is used to execute transactions. |
txMisc | This object contains the gas fee that is deducted when a transaction is called upon. * The default gas fee is set at 0.02fct. |
Last updated