Skip to main content

Pack.addPackContents() method

Add Pack Contents

Example

const packContents = {
// ERC20 rewards to be included in the pack
erc20Rewards: [
{
assetContract: "0x...",
quantityPerReward: 5,
quantity: 100,
totalRewards: 20,
},
],
// ERC721 rewards to be included in the pack
erc721Rewards: [
{
assetContract: "0x...",
tokenId: 0,
},
],
// ERC1155 rewards to be included in the pack
erc1155Rewards: [
{
assetContract: "0x...",
tokenId: 0,
quantityPerReward: 1,
totalRewards: 100,
},
],
};

const tx = await contract.addPackContents(packId, packContents);

Signature:

addPackContents(packId: BigNumberish, packContents: PackRewards): Promise<{
id: BigNumber;
receipt: ethers.providers.TransactionReceipt;
data: () => Promise<NFT>;
}>;

Parameters

ParameterTypeDescription
packIdBigNumberishtoken Id of the pack to add contents to
packContentsPackRewardsthe rewards to include in the pack

Returns:

Promise<{ id: BigNumber; receipt: ethers.providers.TransactionReceipt; data: () => Promise<NFT>; }>

Remarks

See Pack.addPackContents()