How to burn an existing Non-Fungible Token?

  • burn

This function is used to burn (destroys) an existing NFT token.

import { L1XProvider, NFTTokenBurnArg } from "@l1x/l1x-wallet-sdk";

let l1xProvider = new L1XProvider({
  clusterType: "mainnet",
  endpoint: "https://v2-mainnet-rpc.l1x.foundation"
});

let params: NFTTokenBurnArg = {
  private_key: "YOUR_PRIVATE_KEY",
  attrib: {
    contract_address: "4669899603735f7b06645c73fb73376b4a5c6f43",
    token_id: "1",
  },
  fee_limit: 1,
};

l1xProvider.tokens.NFT.burn(params)
  .then((response) => console.log(response)) // log response
  .catch((err) => console.error(err)); // log error

Parameters:

The attribute for burning the token.

{
  private_key: "YOUR_PRIVATE_KEY",
  attrib: {
    contract_address: "4669899603735f7b06645c73fb73376b4a5c6f43",
    token_id: "1",
  },
  fee_limit: 1,
}

Returns:

The response of the burn operation.

{
    "hash": "dc224ba854d5fbd3371f6d509b9a0b5451fff78a70ad3a209b5c273f8da0abfb"
}

Last updated