ERC1155 - Burn NFTs
You can utilize these features of the SDK if your contract implements the ERC1155Burnable interface.
Burn NFTs
Burn a specified quantity of an NFT.
- React
- Javascript
- Python
- Go
- Unity
const Component = () => {
const { contract } = useContract("{{contract_address}}");
const {
mutate: burnNFT,
isLoading,
error,
} = useBurnNFT(contract);
if (error) {
console.error("failed to burn NFT", error);
}
return (
<button
disabled={isLoading}
onClick={() => burnNFT({ tokenId: 0, amount: 1 })}
>
Burn!
</button>
);
};
This snippet is for v3 of the SDK. Learn how to upgrade.
View in React SDK Documentation// The token ID to burn NFTs of
const tokenId = 0;
// The amount of the NFT you want to burn
const amount = 2;
const result = await contract.erc1155.burn(tokenId, amount);
This snippet is for v3 of the SDK. Learn how to upgrade.
View in Javascript SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Python SDK documentation for more information.
Reach out on Discord for further assistance!
View Python SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Go SDK documentation for more information.
Reach out on Discord for further assistance!
View Go SDK Documentation// The token ID to burn NFTs of
var tokenId = "0";
// The amount of the NFT you want to burn
var amount = 2;
var result = await contract.ERC1155.Burn(tokenId, amount);
Burn A Batch Of NFTs
Burn a specified quantity of multiple NFTs at once.
- React
- Javascript
- Python
- Go
- Unity
// 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);
This snippet is for v3 of the SDK. Learn how to upgrade.
View in React SDK Documentation// 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);
This snippet is for v3 of the SDK. Learn how to upgrade.
View in Javascript SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Python SDK documentation for more information.
Reach out on Discord for further assistance!
View Python SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Go SDK documentation for more information.
Reach out on Discord for further assistance!
View Go SDK Documentation// Batch burning in Unity is coming soon. Reach out to us in Discord if you need this feature!
Burn NFTs From Another Wallet
Burn a specified quantity of an NFT from another wallet.
- React
- Javascript
- Python
- Go
- Unity
// 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 result = await contract.erc1155.burnFrom(account, tokenId, amount);
This snippet is for v3 of the SDK. Learn how to upgrade.
View in React SDK Documentation// 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 result = await contract.erc1155.burnFrom(account, tokenId, amount);
This snippet is for v3 of the SDK. Learn how to upgrade.
View in Javascript SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Python SDK documentation for more information.
Reach out on Discord for further assistance!
View Python SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Go SDK documentation for more information.
Reach out on Discord for further assistance!
View Go SDK Documentation// BurnFrom in Unity is coming soon. Reach out to us in Discord if you need this feature!
Burn a batch of NFTs
Burn a specified quantity of multiple NFTs at once from another wallet.
- React
- Javascript
- Python
- Go
- Unity
// The address of the wallet to burn NFTS from
const account = "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(account, tokenIds, amounts);
This snippet is for v3 of the SDK. Learn how to upgrade.
View in React SDK Documentation// The address of the wallet to burn NFTS from
const account = "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(account, tokenIds, amounts);
This snippet is for v3 of the SDK. Learn how to upgrade.
View in Javascript SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Python SDK documentation for more information.
Reach out on Discord for further assistance!
View Python SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Go SDK documentation for more information.
Reach out on Discord for further assistance!
View Go SDK Documentation// Batch burning in Unity is coming soon. Reach out to us in Discord if you need this feature!