Skip to content

Commit b6b80bf

Browse files
committed
feat(sdk): adds multiwrap and loyaltycard extensions
1 parent b9f85f8 commit b6b80bf

26 files changed

+2758
-1
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
"thirdweb": minor
3+
---
4+
5+
Adds Multiwrap and LoyaltyCard support to ERC721 deployment.
6+
7+
```ts
8+
import { deployERC721Contract } from "thirdweb/deploys";
9+
const multiwrapContractAddress = await deployERC721Contract({
10+
chain: "your-chain-id", // replace with your chain ID
11+
client: yourThirdwebClient, // replace with your Thirdweb client instance
12+
account: yourAccount, // replace with your account details
13+
type: "Multiwrap",
14+
params: {
15+
name: "MyMultiwrapNFT",
16+
symbol: "MWNFT",
17+
description: "A multiwrap NFT contract",
18+
image: "path/to/image.png", // replace with your image path
19+
defaultAdmin: "0xYourAdminAddress", // replace with your admin address
20+
royaltyRecipient: "0xYourRoyaltyRecipient", // replace with your royalty recipient address
21+
royaltyBps: 500n, // 5% royalty
22+
trustedForwarders: ["0xTrustedForwarderAddress"], // replace with your trusted forwarder addresses
23+
},
24+
});
25+
26+
const loyaltyCardContractAddress = await deployERC721Contract({
27+
chain: "your-chain-id", // replace with your chain ID
28+
client: yourThirdwebClient, // replace with your Thirdweb client instance
29+
account: yourAccount, // replace with your account details
30+
type: "LoyaltyCard",
31+
params: {
32+
name: "MyLoyaltyCard",
33+
symbol: "LOYAL",
34+
description: "A loyalty card NFT contract",
35+
image: "path/to/image.png", // replace with your image path
36+
defaultAdmin: "0xYourAdminAddress", // replace with your admin address
37+
royaltyRecipient: "0xYourRoyaltyRecipient", // replace with your royalty recipient address
38+
royaltyBps: 500n, // 5% royalty
39+
trustedForwarders: ["0xTrustedForwarderAddress"], // replace with your trusted forwarder addresses
40+
saleRecipient: "0xYourSaleRecipient", // replace with your sale recipient address
41+
platformFeeBps: 200n, // 2% platform fee
42+
platformFeeRecipient: "0xYourPlatformFeeRecipient", // replace with your platform fee recipient address
43+
},
44+
});
45+
46+
```
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[
2+
"constructor()",
3+
"function cancel(uint256 tokenId)",
4+
"function initialize(address _defaultAdmin, string _name, string _symbol, string _contractURI, address[] _trustedForwarders, address _saleRecipient, address _royaltyRecipient, uint128 _royaltyBps, uint128 _platformFeeBps, address _platformFeeRecipient)",
5+
"function mintTo(address _to, string _uri) returns (uint256 tokenIdMinted)",
6+
"function mintWithSignature((address to, address royaltyRecipient, uint256 royaltyBps, address primarySaleRecipient, uint256 quantity, uint256 pricePerToken, address currency, uint128 validityStartTimestamp, uint128 validityEndTimestamp, string uri) _req, bytes _signature) payable returns (address signer)",
7+
"function nextTokenIdToMint() view returns (uint256)",
8+
"function revoke(uint256 tokenId)",
9+
"function supportsInterface(bytes4 interfaceId) view returns (bool)",
10+
"function tokenURI(uint256 _tokenId) view returns (string)",
11+
"function totalMinted() view returns (uint256)",
12+
"event TokensMinted(address indexed mintedTo, uint256 indexed tokenIdMinted, string uri)",
13+
"event TokensMintedWithSignature(address indexed signer, address indexed mintedTo, uint256 indexed tokenIdMinted, (address to, address royaltyRecipient, uint256 royaltyBps, address primarySaleRecipient, uint256 quantity, uint256 pricePerToken, address currency, uint128 validityStartTimestamp, uint128 validityEndTimestamp, string uri) mintRequest)"
14+
]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[
2+
"constructor(address _nativeTokenWrapper)",
3+
"event TokensWrapped(address indexed wrapper, address indexed recipientOfWrappedToken, uint256 indexed tokenIdOfWrappedToken, (address assetContract, uint8 tokenType, uint256 tokenId, uint256 amount)[] wrappedContents)",
4+
"event TokensUnwrapped(address indexed unwrapper, address indexed recipientOfWrappedContents, uint256 indexed tokenIdOfWrappedToken)",
5+
"function contractType() pure returns (bytes32)",
6+
"function contractVersion() pure returns (uint8)",
7+
"function getWrappedContents(uint256 _tokenId) view returns ((address assetContract, uint8 tokenType, uint256 tokenId, uint256 amount)[] contents)",
8+
"function initialize(address _defaultAdmin, string _name, string _symbol, string _contractURI, address[] _trustedForwarders, address _royaltyRecipient, uint256 _royaltyBps)",
9+
"function nextTokenIdToMint() view returns (uint256)",
10+
"function supportsInterface(bytes4 interfaceId) view returns (bool)",
11+
"function tokenURI(uint256 _tokenId) view returns (string)",
12+
"function unwrap(uint256 _tokenId, address _recipient)",
13+
"function wrap((address assetContract, uint8 tokenType, uint256 tokenId, uint256 amount)[] _tokensToWrap, string _uriForWrappedToken, address _recipient) payable returns (uint256 tokenId)",
14+
"receive() external payable"
15+
]

packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/events/TokensMinted.ts

Lines changed: 47 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/events/TokensMintedWithSignature.ts

Lines changed: 55 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/read/nextTokenIdToMint.ts

Lines changed: 70 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/read/supportsInterface.ts

Lines changed: 130 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)