Skip to main content

PackImpl.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<{
supply: BigNumber;
metadata: {
[x: string]: import("@thirdweb-dev/storage").Json;
name?: string | number | undefined;
description?: string | null | undefined;
image?: string | null | undefined;
external_url?: string | null | undefined;
animation_url?: string | null | undefined;
id: BigNumber;
uri: string;
};
}>;
}>;

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<{ supply: BigNumber; metadata: { [x: string]: import("@thirdweb-dev/storage").Json; name?: string | number | undefined; description?: string | null | undefined; image?: string | null | undefined; external_url?: string | null | undefined; animation_url?: string | null | undefined; id: BigNumber; uri: string; }; }>; }>

Remarks

See