Files
js/packages/thirdweb/scripts/generate/abis/pack/IPack.json
T
kien-ngo 90b5495efb [SDK] Add Pack extensions (#4579)
## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces new functionalities and enhancements for the `Pack` contract in the `thirdweb` project, including event definitions, deployment options, and methods for managing packs and rewards.

### Detailed summary
- Added `initialize` function to `Pack.json`.
- Exported new types and functions in `deploy-pack.ts`.
- Defined new events and functions in `IPackVRFDirect.json`.
- Created tests for deploying `Pack` contracts.
- Updated changelog with Pack extensions.
- Implemented various methods for managing packs, including `openPack`, `addPackContents`, and `claimRewards`.

> The following files were skipped due to too many changes: `packages/thirdweb/src/extensions/pack/createNewPack.test.ts`, `packages/thirdweb/src/extensions/prebuilts/__generated__/Pack/write/initialize.ts`, `packages/thirdweb/src/extensions/pack/__generated__/IPack/write/createPack.ts`, `packages/thirdweb/src/extensions/pack/createNewPack.ts`

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-09-28 12:46:54 +00:00

13 lines
1.6 KiB
JSON

[
"event PackCreated(uint256 indexed packId, address recipient, uint256 totalPacksCreated)",
"event PackOpened(uint256 indexed packId, address indexed opener, uint256 numOfPacksOpened, (address assetContract, uint8 tokenType, uint256 tokenId, uint256 totalAmount)[] rewardUnitsDistributed)",
"event PackUpdated(uint256 indexed packId, address recipient, uint256 totalPacksCreated)",
"function createPack((address assetContract, uint8 tokenType, uint256 tokenId, uint256 totalAmount)[] contents, uint256[] numOfRewardUnits, string packUri, uint128 openStartTimestamp, uint128 amountDistributedPerOpen, address recipient) payable returns (uint256 packId, uint256 packTotalSupply)",
"function openPack(uint256 packId, uint256 amountToOpen) returns ((address assetContract, uint8 tokenType, uint256 tokenId, uint256 totalAmount)[])",
"function addPackContents(uint256 _packId, (address assetContract, uint8 tokenType, uint256 tokenId, uint256 totalAmount)[] _contents, uint256[] _numOfRewardUnits, address _recipient) payable returns (uint256 packTotalSupply, uint256 newSupplyAdded)",
"function getPackContents(uint256 _packId) view returns ((address assetContract, uint8 tokenType, uint256 tokenId, uint256 totalAmount)[] contents, uint256[] perUnitAmounts)",
"function getTokenCountOfBundle(uint256 _bundleId) view returns (uint256)",
"function getTokenOfBundle(uint256 _bundleId, uint256 index) view returns ((address assetContract, uint8 tokenType, uint256 tokenId, uint256 totalAmount))",
"function getUriOfBundle(uint256 _bundleId) view returns (string)",
"function canUpdatePack(uint256 _key) view returns (bool)"
]