ERC1155Burnable
Functionality available for contracts that implement the
IERC1155Enumerable
and
IBurnableERC1155
interfaces.
Allows you to burn NFTs (transfer them to a null address) to take them out of circulation.
burn
Burn the specified NFTs from the connected wallet.
// The token ID to burn NFTs of
const tokenId = 0;
// The amount of the NFT you want to burn
const amount = 2;
const txResult = await contract.erc1155.burn(tokenId, amount);
Configuration
burnFrom
The same as burn
, but allows you to specify the wallet to burn NFTs from.
// The address of the wallet to burn NFTS from
const account = "0x...";
// The token ID to burn NFTs of
const tokenId = 0;
// The amount of this NFT you want to burn
const amount = 2;
const txResult = await contract.erc1155.burnFrom(account, tokenId, amount);
Configuration
burnBatch
Burn multiple different NFTs in the same transaction from the connected wallet.
// The token IDs to burn NFTs of
const tokenIds = [0, 1];
// The amounts of each NFT you want to burn
const amounts = [2, 2];
const result = await contract.erc1155.burnBatch(tokenIds, amounts);
Configuration
burnBatchFrom
Burn the batch NFTs from the specified wallet
// The address of the wallet to burn NFTS from
const address = "0x...";
// The token IDs to burn NFTs of
const tokenIds = [0, 1];
// The amounts of each NFT you want to burn
const amounts = [2, 2];
const result = await contract.erc1155.burnBatchFrom(address, tokenIds, amounts);