Skip to content

thirdweb@5.60.0

Compare
Choose a tag to compare
@jnsdls jnsdls released this 01 Oct 00:42
· 2224 commits to main since this release
97c0900

Minor Changes

  • #4579 90b5495 Thanks @kien-ngo! - Add Pack extensions

    Deploy Pack

    import { deployPackContract } from "thirdweb/extensions/deploy";
    
    const packAddress = await deployPackContract({
      account,
      client,
      chain,
      params: {
        name: "Pack contract name",
        symbol: "PACK1155",
      },
    });

    Create a Pack

    import { createPack } from "thirdweb/extensions/pack";
    
    const transaction = createPack({
      contract: packContract,
      client,
      recipient: "0x...",
      tokenOwner: "0x...",
      packMetadata: {
        name: "Pack #1",
        image: "image-of-pack-1",
      },
      openStartTimestamp: new Date(),
      erc20Rewards: [
        {
          contractAddress: "0x...",
          quantityPerReward: 1,
          totalRewards: 1,
        },
      ],
      erc721Rewards: [
        {
          contractAddress: "0x...",
          tokenId: 0n,
        },
      ],
      erc1155Rewards: [
        {
          contractAddress: "0x...",
          tokenId: 0n,
          quantityPerReward: 1,
          totalRewards: 1,
        },
      ],
    });

Patch Changes