For example, in your pack contract you may have a common pack with ID 0 and a rare pack with ID 1.
To add more tokens to the common pack, you would pass "0" as the packId.
Must be a string.
rewards
An instance of the PackRewards class containing the tokens you want to add to the pack.
Create
Mint a new pack NFT, which can be opened to receive rewards, to the connected wallet.
Each pack NFT is an ERC1155 token, which means it can have more than one quantity.
Provide the metadata for the pack NFT itself, and the rewards that can be opened from the pack.
The quantity of packs created is determined by the total number of rewards available, divided by the number of rewards per pack.
For example, if you had 20 total ERC20 rewards + 60 total ERC1155 rewards + 20 total ERC721 rewards,
and you wanted to create packs with 5 rewards each, the result would be the creation of 20 packs (100 total rewards / 5 rewards per pack = 20 packs).
A string representing the quantity of the NFT owned by the wallet.
string
Get
Get the metadata of an NFT using it’s token ID.
Metadata is fetched from the uri property of the NFT.
If the metadata is hosted on IPFS, the metadata is fetched and made available as an object.
The object’s image property will be a URL that is available through the thirdweb IPFS gateway.
tokenId
The token ID of the NFT to get the metadata for.
Must be a string.
Return Value
Returns an NFT struct containing the following properties:
{
{
stringid;
stringuri;
stringdescription;
stringimage;
stringname;
stringexternal_url;
objectattributes;
}
stringowner;
stringtype;
intsupply;
intquantityOwned; // only for ERC1155
}
Transfer
Transfer an NFT from the connected wallet to another wallet.