Skip to content

Usage ​

This is a detailed explanation of the features provided by the NFT module.

Contents ​

NameDescription
1. mintIssue NFT.
2. transferTransfer the ownership right of the issued NFT.
3. burnBurn the issued NFT.
4. Parameter DescriptionParameters required to call API.

1. mint ​

Issue NFT and record the result on the chain network.

Parameters ​

NameTypeExample
walletObject (FirmaWalletService)You can check how to use your wallet in the "firma-js of the Github repository".
tokenURIString"https://firmachain.org/nft/metadata/bcf5cdajs-ff12...-d2han89nnha1"
txMisc
(Not required)
Object (TxMisc){fee:200000,gas:163821,memo:"custom message"}

Return value ​

bash
{
  code: 0,
  height: 1175104,
  rawLog: '[{
            "events": [{
              "type": "message",
              "attributes": [
                {"key":"action","value":"Mint"},
                {"key":"Owner","value":"firma1trqyle9m2nvyafc2n25frkpwed2504y6avgfzr"},
                {"key":"nftID","value":"76"}
              ]
            }]
          }]',
  transactionHash: '2F257E674FB3EA...DE83D18D963F320',
  gasUsed: 71996,
  gasWanted: 200000
}

2. transfer ​

Transfer the ownership right of the issued NFT and record the result of the transfer on the chain network.

Parameters ​

NameTypeExample
walletObject (FirmaWalletService)You can check how to use your wallet in the "firma-js of the Github repository".
toAddressString"firma1nssuz67am2uwc2hjgvphg0fmj3k9l6cx65ux9u"
nftIDString"16"
txMisc
(Not required)
Object (TxMisc){fee:200000,gas:163821,memo:"custom message"}

Return value ​

bash
{
  code: 0,
  height: 1175663,
  rawLog: '[{
            "events": [{
              "type":"message",
              "attributes":[{
                "key":"action",
                "value":"Transfer"
              }]
            }]
          }]',
  transactionHash: 'A862717FEDB9212...D71833B10BCC756',
  gasUsed: 77461,
  gasWanted: 200000
}

3. burn ​

Following are the features offered in order to search the issued NFTs.

Parameters ​

NameTypeExample
walletObject (FirmaWalletService)You can check how to use your wallet in the "firma-js of the Github repository".
nftIDString"16"
txMisc
(Not required)
Object (TxMisc){fee:200000,gas:163821,memo:"custom message"}

Return value ​

bash
{
  code: 0,
  height: 1175693,
  rawLog: '[{
            "events": [{
              "type":"message",
              "attributes": [{"key":"action","value":"Burn"}]
            }]
          }]',
  transactionHash: '6174F2D9D8C7D37...811BCCE8A15CD5C',
  gasUsed: 63177,
  gasWanted: 200000
}

4. Parameter Description ​

NameDescription
walletUnique wallet parameter created from the user’s Mnemonic.
This parameter can be called by using the Wallet.fromMnemonic function from the FirmaSDK module.
toAddressFor this parameter, please enter your FirmaChain wallet address.
nftIDFor this parameter, Unique ID of the issued NFT.
txMiscThis object contains the gas fee that is deducted when a transaction is called upon.
* The default gas fee is set at 0.02fct.
tokenURIMetadata address describing the NFT.