Developer - Redeem a Capsule NFT
Last updated
Last updated
Users have the option to store tokens within a Capsule NFT at the time of mint and embed the Capsule NFT with artwork. The Capsule NFT can be redeemed at any time to retrieve the tokens stored inside. Redemption of a Capsule NFT requires an already minted Capsule NFT, which you can create .
Below are some examples of redeeming a Capsule NFT.
Note: Redemption of the Capsule NFT requires burning of the Capsule NFT in return for acquiring the stored tokens. Thus, methods below are named burnXYZ
.
In order to redeem a Capsule NFT you must:
know the address of the Capsule Collection from which your Capsule NFT resides (this is the same as getting the address of your NFT, which can be found on Etherscan, OpenSea, or Metamask)
know the ID of your Capsule NFT (the NFT ID, is the unique identification number given to your NFT. It can also be found on Etherscan, OpenSea, or Metamask)
More information on the methods below can be found at the page. Depending on the type of Capsule NFT you are redeeming, you will call either:
Methods for redeeming a Capsule NFT are largely the same - the only difference lying in the type of Capsule (method) called.
Note: Burning a Simple Capsule NFT will not return any stored tokens (as none are placed inside), and thus has no special effect unless your application has built logic for such. An example has been shown for clarity.
Some example calls to redeem (burn) any type of Capsule NFT are shown here:
These calls will redeem any Capsule NFT:
From the Capsule Collection at address 0x1a0a69a267b3e72d22dEB970b2Cc6296aC31A80c
Depending on the method above - with the ID 1
, 2
, or 3
While the redemption parameters are the same for each Capsule NFT type, the method call differs for each.
You must use the same redemption method call as was used to mint the Capsule NFT (for example, a Single ERC-721 Capsule must be redeemed using the burnSingleERC721Capsule
method).
Given that only is available to users, burnMultiERC1155Capsule
must be used.