thirdweb 5.72.0-nightly-f64e0253d7de6fdb6f56ab49315cc4cdcdd75b20-20241127000345 → 5.72.0-nightly-e87eb2ff35eea1b94ab7bdae3585d819879ec53c-20241128000350

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/events/TokensMinted.js +32 -0
  2. package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/events/TokensMinted.js.map +1 -0
  3. package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/events/TokensMintedWithSignature.js +33 -0
  4. package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/events/TokensMintedWithSignature.js.map +1 -0
  5. package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/read/nextTokenIdToMint.js +70 -0
  6. package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/read/nextTokenIdToMint.js.map +1 -0
  7. package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/read/supportsInterface.js +114 -0
  8. package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/read/supportsInterface.js.map +1 -0
  9. package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/read/tokenURI.js +114 -0
  10. package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/read/tokenURI.js.map +1 -0
  11. package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/read/totalMinted.js +70 -0
  12. package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/read/totalMinted.js.map +1 -0
  13. package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/write/cancel.js +117 -0
  14. package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/write/cancel.js.map +1 -0
  15. package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/write/initialize.js +202 -0
  16. package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/write/initialize.js.map +1 -0
  17. package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/write/mintTo.js +129 -0
  18. package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/write/mintTo.js.map +1 -0
  19. package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/write/mintWithSignature.js +171 -0
  20. package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/write/mintWithSignature.js.map +1 -0
  21. package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/write/revoke.js +117 -0
  22. package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/write/revoke.js.map +1 -0
  23. package/dist/cjs/extensions/erc721/__generated__/Multiwrap/events/TokensUnwrapped.js +33 -0
  24. package/dist/cjs/extensions/erc721/__generated__/Multiwrap/events/TokensUnwrapped.js.map +1 -0
  25. package/dist/cjs/extensions/erc721/__generated__/Multiwrap/events/TokensWrapped.js +33 -0
  26. package/dist/cjs/extensions/erc721/__generated__/Multiwrap/events/TokensWrapped.js.map +1 -0
  27. package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/contractType.js +70 -0
  28. package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/contractType.js.map +1 -0
  29. package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/contractVersion.js +70 -0
  30. package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/contractVersion.js.map +1 -0
  31. package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/getWrappedContents.js +133 -0
  32. package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/getWrappedContents.js.map +1 -0
  33. package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/nextTokenIdToMint.js +70 -0
  34. package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/nextTokenIdToMint.js.map +1 -0
  35. package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/supportsInterface.js +114 -0
  36. package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/supportsInterface.js.map +1 -0
  37. package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/tokenURI.js +114 -0
  38. package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/tokenURI.js.map +1 -0
  39. package/dist/cjs/extensions/erc721/__generated__/Multiwrap/write/initialize.js +175 -0
  40. package/dist/cjs/extensions/erc721/__generated__/Multiwrap/write/initialize.js.map +1 -0
  41. package/dist/cjs/extensions/erc721/__generated__/Multiwrap/write/unwrap.js +124 -0
  42. package/dist/cjs/extensions/erc721/__generated__/Multiwrap/write/unwrap.js.map +1 -0
  43. package/dist/cjs/extensions/erc721/__generated__/Multiwrap/write/wrap.js +162 -0
  44. package/dist/cjs/extensions/erc721/__generated__/Multiwrap/write/wrap.js.map +1 -0
  45. package/dist/cjs/extensions/prebuilts/deploy-erc721.js +21 -6
  46. package/dist/cjs/extensions/prebuilts/deploy-erc721.js.map +1 -1
  47. package/dist/cjs/version.js +1 -1
  48. package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/events/TokensMinted.js +29 -0
  49. package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/events/TokensMinted.js.map +1 -0
  50. package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/events/TokensMintedWithSignature.js +30 -0
  51. package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/events/TokensMintedWithSignature.js.map +1 -0
  52. package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/read/nextTokenIdToMint.js +64 -0
  53. package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/read/nextTokenIdToMint.js.map +1 -0
  54. package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/read/supportsInterface.js +106 -0
  55. package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/read/supportsInterface.js.map +1 -0
  56. package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/read/tokenURI.js +106 -0
  57. package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/read/tokenURI.js.map +1 -0
  58. package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/read/totalMinted.js +64 -0
  59. package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/read/totalMinted.js.map +1 -0
  60. package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/write/cancel.js +110 -0
  61. package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/write/cancel.js.map +1 -0
  62. package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/write/initialize.js +195 -0
  63. package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/write/initialize.js.map +1 -0
  64. package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/write/mintTo.js +122 -0
  65. package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/write/mintTo.js.map +1 -0
  66. package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/write/mintWithSignature.js +164 -0
  67. package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/write/mintWithSignature.js.map +1 -0
  68. package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/write/revoke.js +110 -0
  69. package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/write/revoke.js.map +1 -0
  70. package/dist/esm/extensions/erc721/__generated__/Multiwrap/events/TokensUnwrapped.js +30 -0
  71. package/dist/esm/extensions/erc721/__generated__/Multiwrap/events/TokensUnwrapped.js.map +1 -0
  72. package/dist/esm/extensions/erc721/__generated__/Multiwrap/events/TokensWrapped.js +30 -0
  73. package/dist/esm/extensions/erc721/__generated__/Multiwrap/events/TokensWrapped.js.map +1 -0
  74. package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/contractType.js +64 -0
  75. package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/contractType.js.map +1 -0
  76. package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/contractVersion.js +64 -0
  77. package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/contractVersion.js.map +1 -0
  78. package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/getWrappedContents.js +125 -0
  79. package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/getWrappedContents.js.map +1 -0
  80. package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/nextTokenIdToMint.js +64 -0
  81. package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/nextTokenIdToMint.js.map +1 -0
  82. package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/supportsInterface.js +106 -0
  83. package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/supportsInterface.js.map +1 -0
  84. package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/tokenURI.js +106 -0
  85. package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/tokenURI.js.map +1 -0
  86. package/dist/esm/extensions/erc721/__generated__/Multiwrap/write/initialize.js +168 -0
  87. package/dist/esm/extensions/erc721/__generated__/Multiwrap/write/initialize.js.map +1 -0
  88. package/dist/esm/extensions/erc721/__generated__/Multiwrap/write/unwrap.js +117 -0
  89. package/dist/esm/extensions/erc721/__generated__/Multiwrap/write/unwrap.js.map +1 -0
  90. package/dist/esm/extensions/erc721/__generated__/Multiwrap/write/wrap.js +155 -0
  91. package/dist/esm/extensions/erc721/__generated__/Multiwrap/write/wrap.js.map +1 -0
  92. package/dist/esm/extensions/prebuilts/deploy-erc721.js +15 -0
  93. package/dist/esm/extensions/prebuilts/deploy-erc721.js.map +1 -1
  94. package/dist/esm/version.js +1 -1
  95. package/dist/types/extensions/erc721/__generated__/LoyaltyCard/events/TokensMinted.d.ts +54 -0
  96. package/dist/types/extensions/erc721/__generated__/LoyaltyCard/events/TokensMinted.d.ts.map +1 -0
  97. package/dist/types/extensions/erc721/__generated__/LoyaltyCard/events/TokensMintedWithSignature.d.ts +95 -0
  98. package/dist/types/extensions/erc721/__generated__/LoyaltyCard/events/TokensMintedWithSignature.d.ts.map +1 -0
  99. package/dist/types/extensions/erc721/__generated__/LoyaltyCard/read/nextTokenIdToMint.d.ts +44 -0
  100. package/dist/types/extensions/erc721/__generated__/LoyaltyCard/read/nextTokenIdToMint.d.ts.map +1 -0
  101. package/dist/types/extensions/erc721/__generated__/LoyaltyCard/read/supportsInterface.d.ts +83 -0
  102. package/dist/types/extensions/erc721/__generated__/LoyaltyCard/read/supportsInterface.d.ts.map +1 -0
  103. package/dist/types/extensions/erc721/__generated__/LoyaltyCard/read/tokenURI.d.ts +83 -0
  104. package/dist/types/extensions/erc721/__generated__/LoyaltyCard/read/tokenURI.d.ts.map +1 -0
  105. package/dist/types/extensions/erc721/__generated__/LoyaltyCard/read/totalMinted.d.ts +44 -0
  106. package/dist/types/extensions/erc721/__generated__/LoyaltyCard/read/totalMinted.d.ts.map +1 -0
  107. package/dist/types/extensions/erc721/__generated__/LoyaltyCard/write/cancel.d.ts +79 -0
  108. package/dist/types/extensions/erc721/__generated__/LoyaltyCard/write/cancel.d.ts.map +1 -0
  109. package/dist/types/extensions/erc721/__generated__/LoyaltyCard/write/initialize.d.ts +142 -0
  110. package/dist/types/extensions/erc721/__generated__/LoyaltyCard/write/initialize.d.ts.map +1 -0
  111. package/dist/types/extensions/erc721/__generated__/LoyaltyCard/write/mintTo.d.ts +86 -0
  112. package/dist/types/extensions/erc721/__generated__/LoyaltyCard/write/mintTo.d.ts.map +1 -0
  113. package/dist/types/extensions/erc721/__generated__/LoyaltyCard/write/mintWithSignature.d.ts +128 -0
  114. package/dist/types/extensions/erc721/__generated__/LoyaltyCard/write/mintWithSignature.d.ts.map +1 -0
  115. package/dist/types/extensions/erc721/__generated__/LoyaltyCard/write/revoke.d.ts +79 -0
  116. package/dist/types/extensions/erc721/__generated__/LoyaltyCard/write/revoke.d.ts.map +1 -0
  117. package/dist/types/extensions/erc721/__generated__/Multiwrap/events/TokensUnwrapped.d.ts +61 -0
  118. package/dist/types/extensions/erc721/__generated__/Multiwrap/events/TokensUnwrapped.d.ts.map +1 -0
  119. package/dist/types/extensions/erc721/__generated__/Multiwrap/events/TokensWrapped.d.ts +77 -0
  120. package/dist/types/extensions/erc721/__generated__/Multiwrap/events/TokensWrapped.d.ts.map +1 -0
  121. package/dist/types/extensions/erc721/__generated__/Multiwrap/read/contractType.d.ts +44 -0
  122. package/dist/types/extensions/erc721/__generated__/Multiwrap/read/contractType.d.ts.map +1 -0
  123. package/dist/types/extensions/erc721/__generated__/Multiwrap/read/contractVersion.d.ts +44 -0
  124. package/dist/types/extensions/erc721/__generated__/Multiwrap/read/contractVersion.d.ts.map +1 -0
  125. package/dist/types/extensions/erc721/__generated__/Multiwrap/read/getWrappedContents.d.ts +93 -0
  126. package/dist/types/extensions/erc721/__generated__/Multiwrap/read/getWrappedContents.d.ts.map +1 -0
  127. package/dist/types/extensions/erc721/__generated__/Multiwrap/read/nextTokenIdToMint.d.ts +44 -0
  128. package/dist/types/extensions/erc721/__generated__/Multiwrap/read/nextTokenIdToMint.d.ts.map +1 -0
  129. package/dist/types/extensions/erc721/__generated__/Multiwrap/read/supportsInterface.d.ts +83 -0
  130. package/dist/types/extensions/erc721/__generated__/Multiwrap/read/supportsInterface.d.ts.map +1 -0
  131. package/dist/types/extensions/erc721/__generated__/Multiwrap/read/tokenURI.d.ts +83 -0
  132. package/dist/types/extensions/erc721/__generated__/Multiwrap/read/tokenURI.d.ts.map +1 -0
  133. package/dist/types/extensions/erc721/__generated__/Multiwrap/write/initialize.d.ts +121 -0
  134. package/dist/types/extensions/erc721/__generated__/Multiwrap/write/initialize.d.ts.map +1 -0
  135. package/dist/types/extensions/erc721/__generated__/Multiwrap/write/unwrap.d.ts +86 -0
  136. package/dist/types/extensions/erc721/__generated__/Multiwrap/write/unwrap.d.ts.map +1 -0
  137. package/dist/types/extensions/erc721/__generated__/Multiwrap/write/wrap.d.ts +111 -0
  138. package/dist/types/extensions/erc721/__generated__/Multiwrap/write/wrap.d.ts.map +1 -0
  139. package/dist/types/extensions/prebuilts/deploy-erc721.d.ts +1 -1
  140. package/dist/types/extensions/prebuilts/deploy-erc721.d.ts.map +1 -1
  141. package/dist/types/version.d.ts +1 -1
  142. package/package.json +1 -1
  143. package/src/extensions/erc721/__generated__/LoyaltyCard/events/TokensMinted.ts +47 -0
  144. package/src/extensions/erc721/__generated__/LoyaltyCard/events/TokensMintedWithSignature.ts +55 -0
  145. package/src/extensions/erc721/__generated__/LoyaltyCard/read/nextTokenIdToMint.ts +70 -0
  146. package/src/extensions/erc721/__generated__/LoyaltyCard/read/supportsInterface.ts +130 -0
  147. package/src/extensions/erc721/__generated__/LoyaltyCard/read/tokenURI.ts +123 -0
  148. package/src/extensions/erc721/__generated__/LoyaltyCard/read/totalMinted.ts +70 -0
  149. package/src/extensions/erc721/__generated__/LoyaltyCard/write/cancel.ts +135 -0
  150. package/src/extensions/erc721/__generated__/LoyaltyCard/write/initialize.ts +255 -0
  151. package/src/extensions/erc721/__generated__/LoyaltyCard/write/mintTo.ts +148 -0
  152. package/src/extensions/erc721/__generated__/LoyaltyCard/write/mintWithSignature.ts +209 -0
  153. package/src/extensions/erc721/__generated__/LoyaltyCard/write/revoke.ts +135 -0
  154. package/src/extensions/erc721/__generated__/Multiwrap/events/TokensUnwrapped.ts +55 -0
  155. package/src/extensions/erc721/__generated__/Multiwrap/events/TokensWrapped.ts +53 -0
  156. package/src/extensions/erc721/__generated__/Multiwrap/read/contractType.ts +70 -0
  157. package/src/extensions/erc721/__generated__/Multiwrap/read/contractVersion.ts +70 -0
  158. package/src/extensions/erc721/__generated__/Multiwrap/read/getWrappedContents.ts +146 -0
  159. package/src/extensions/erc721/__generated__/Multiwrap/read/nextTokenIdToMint.ts +70 -0
  160. package/src/extensions/erc721/__generated__/Multiwrap/read/supportsInterface.ts +130 -0
  161. package/src/extensions/erc721/__generated__/Multiwrap/read/tokenURI.ts +123 -0
  162. package/src/extensions/erc721/__generated__/Multiwrap/write/initialize.ts +216 -0
  163. package/src/extensions/erc721/__generated__/Multiwrap/write/unwrap.ts +146 -0
  164. package/src/extensions/erc721/__generated__/Multiwrap/write/wrap.ts +197 -0
  165. package/src/extensions/prebuilts/deploy-erc721.test.ts +70 -2
  166. package/src/extensions/prebuilts/deploy-erc721.ts +17 -1
  167. package/src/version.ts +1 -1
@@ -0,0 +1,121 @@
1
+ import type { AbiParameterToPrimitiveType } from "abitype";
2
+ import type { BaseTransactionOptions, WithOverrides } from "../../../../../transaction/types.js";
3
+ /**
4
+ * Represents the parameters for the "initialize" function.
5
+ */
6
+ export type InitializeParams = WithOverrides<{
7
+ defaultAdmin: AbiParameterToPrimitiveType<{
8
+ type: "address";
9
+ name: "_defaultAdmin";
10
+ }>;
11
+ name: AbiParameterToPrimitiveType<{
12
+ type: "string";
13
+ name: "_name";
14
+ }>;
15
+ symbol: AbiParameterToPrimitiveType<{
16
+ type: "string";
17
+ name: "_symbol";
18
+ }>;
19
+ contractURI: AbiParameterToPrimitiveType<{
20
+ type: "string";
21
+ name: "_contractURI";
22
+ }>;
23
+ trustedForwarders: AbiParameterToPrimitiveType<{
24
+ type: "address[]";
25
+ name: "_trustedForwarders";
26
+ }>;
27
+ royaltyRecipient: AbiParameterToPrimitiveType<{
28
+ type: "address";
29
+ name: "_royaltyRecipient";
30
+ }>;
31
+ royaltyBps: AbiParameterToPrimitiveType<{
32
+ type: "uint256";
33
+ name: "_royaltyBps";
34
+ }>;
35
+ }>;
36
+ export declare const FN_SELECTOR: "0x754b8fe7";
37
+ /**
38
+ * Checks if the `initialize` method is supported by the given contract.
39
+ * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
40
+ * @returns A boolean indicating if the `initialize` method is supported.
41
+ * @extension ERC721
42
+ * @example
43
+ * ```ts
44
+ * import { isInitializeSupported } from "thirdweb/extensions/erc721";
45
+ *
46
+ * const supported = isInitializeSupported(["0x..."]);
47
+ * ```
48
+ */
49
+ export declare function isInitializeSupported(availableSelectors: string[]): boolean;
50
+ /**
51
+ * Encodes the parameters for the "initialize" function.
52
+ * @param options - The options for the initialize function.
53
+ * @returns The encoded ABI parameters.
54
+ * @extension ERC721
55
+ * @example
56
+ * ```ts
57
+ * import { encodeInitializeParams } from "thirdweb/extensions/erc721";
58
+ * const result = encodeInitializeParams({
59
+ * defaultAdmin: ...,
60
+ * name: ...,
61
+ * symbol: ...,
62
+ * contractURI: ...,
63
+ * trustedForwarders: ...,
64
+ * royaltyRecipient: ...,
65
+ * royaltyBps: ...,
66
+ * });
67
+ * ```
68
+ */
69
+ export declare function encodeInitializeParams(options: InitializeParams): `0x${string}`;
70
+ /**
71
+ * Encodes the "initialize" function into a Hex string with its parameters.
72
+ * @param options - The options for the initialize function.
73
+ * @returns The encoded hexadecimal string.
74
+ * @extension ERC721
75
+ * @example
76
+ * ```ts
77
+ * import { encodeInitialize } from "thirdweb/extensions/erc721";
78
+ * const result = encodeInitialize({
79
+ * defaultAdmin: ...,
80
+ * name: ...,
81
+ * symbol: ...,
82
+ * contractURI: ...,
83
+ * trustedForwarders: ...,
84
+ * royaltyRecipient: ...,
85
+ * royaltyBps: ...,
86
+ * });
87
+ * ```
88
+ */
89
+ export declare function encodeInitialize(options: InitializeParams): `${typeof FN_SELECTOR}${string}`;
90
+ /**
91
+ * Prepares a transaction to call the "initialize" function on the contract.
92
+ * @param options - The options for the "initialize" function.
93
+ * @returns A prepared transaction object.
94
+ * @extension ERC721
95
+ * @example
96
+ * ```ts
97
+ * import { sendTransaction } from "thirdweb";
98
+ * import { initialize } from "thirdweb/extensions/erc721";
99
+ *
100
+ * const transaction = initialize({
101
+ * contract,
102
+ * defaultAdmin: ...,
103
+ * name: ...,
104
+ * symbol: ...,
105
+ * contractURI: ...,
106
+ * trustedForwarders: ...,
107
+ * royaltyRecipient: ...,
108
+ * royaltyBps: ...,
109
+ * overrides: {
110
+ * ...
111
+ * }
112
+ * });
113
+ *
114
+ * // Send the transaction
115
+ * await sendTransaction({ transaction, account });
116
+ * ```
117
+ */
118
+ export declare function initialize(options: BaseTransactionOptions<InitializeParams | {
119
+ asyncParams: () => Promise<InitializeParams>;
120
+ }>): import("../../../../../transaction/prepare-transaction.js").PreparedTransaction<any, import("abitype").AbiFunction, import("../../../../../transaction/prepare-transaction.js").PrepareTransactionOptions>;
121
+ //# sourceMappingURL=initialize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../../../../../src/extensions/erc721/__generated__/Multiwrap/write/initialize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,KAAK,EACV,sBAAsB,EACtB,aAAa,EACd,MAAM,qCAAqC,CAAC;AAM7C;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC;IAC3C,YAAY,EAAE,2BAA2B,CAAC;QACxC,IAAI,EAAE,SAAS,CAAC;QAChB,IAAI,EAAE,eAAe,CAAC;KACvB,CAAC,CAAC;IACH,IAAI,EAAE,2BAA2B,CAAC;QAAE,IAAI,EAAE,QAAQ,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACrE,MAAM,EAAE,2BAA2B,CAAC;QAAE,IAAI,EAAE,QAAQ,CAAC;QAAC,IAAI,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IACzE,WAAW,EAAE,2BAA2B,CAAC;QACvC,IAAI,EAAE,QAAQ,CAAC;QACf,IAAI,EAAE,cAAc,CAAC;KACtB,CAAC,CAAC;IACH,iBAAiB,EAAE,2BAA2B,CAAC;QAC7C,IAAI,EAAE,WAAW,CAAC;QAClB,IAAI,EAAE,oBAAoB,CAAC;KAC5B,CAAC,CAAC;IACH,gBAAgB,EAAE,2BAA2B,CAAC;QAC5C,IAAI,EAAE,SAAS,CAAC;QAChB,IAAI,EAAE,mBAAmB,CAAC;KAC3B,CAAC,CAAC;IACH,UAAU,EAAE,2BAA2B,CAAC;QACtC,IAAI,EAAE,SAAS,CAAC;QAChB,IAAI,EAAE,aAAa,CAAC;KACrB,CAAC,CAAC;CACJ,CAAC,CAAC;AAEH,eAAO,MAAM,WAAW,EAAG,YAAqB,CAAC;AAiCjD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,kBAAkB,EAAE,MAAM,EAAE,WAKjE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,gBAAgB,iBAU/D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAMhD,GAAG,OAAO,WAAW,GAAG,MAAM,EAAE,CACzC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,sBAAsB,CAC3B,gBAAgB,GAChB;IACE,WAAW,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAC9C,CACJ,8MAgCF"}
@@ -0,0 +1,86 @@
1
+ import type { AbiParameterToPrimitiveType } from "abitype";
2
+ import type { BaseTransactionOptions, WithOverrides } from "../../../../../transaction/types.js";
3
+ /**
4
+ * Represents the parameters for the "unwrap" function.
5
+ */
6
+ export type UnwrapParams = WithOverrides<{
7
+ tokenId: AbiParameterToPrimitiveType<{
8
+ type: "uint256";
9
+ name: "_tokenId";
10
+ }>;
11
+ recipient: AbiParameterToPrimitiveType<{
12
+ type: "address";
13
+ name: "_recipient";
14
+ }>;
15
+ }>;
16
+ export declare const FN_SELECTOR: "0x7647691d";
17
+ /**
18
+ * Checks if the `unwrap` method is supported by the given contract.
19
+ * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
20
+ * @returns A boolean indicating if the `unwrap` method is supported.
21
+ * @extension ERC721
22
+ * @example
23
+ * ```ts
24
+ * import { isUnwrapSupported } from "thirdweb/extensions/erc721";
25
+ *
26
+ * const supported = isUnwrapSupported(["0x..."]);
27
+ * ```
28
+ */
29
+ export declare function isUnwrapSupported(availableSelectors: string[]): boolean;
30
+ /**
31
+ * Encodes the parameters for the "unwrap" function.
32
+ * @param options - The options for the unwrap function.
33
+ * @returns The encoded ABI parameters.
34
+ * @extension ERC721
35
+ * @example
36
+ * ```ts
37
+ * import { encodeUnwrapParams } from "thirdweb/extensions/erc721";
38
+ * const result = encodeUnwrapParams({
39
+ * tokenId: ...,
40
+ * recipient: ...,
41
+ * });
42
+ * ```
43
+ */
44
+ export declare function encodeUnwrapParams(options: UnwrapParams): `0x${string}`;
45
+ /**
46
+ * Encodes the "unwrap" function into a Hex string with its parameters.
47
+ * @param options - The options for the unwrap function.
48
+ * @returns The encoded hexadecimal string.
49
+ * @extension ERC721
50
+ * @example
51
+ * ```ts
52
+ * import { encodeUnwrap } from "thirdweb/extensions/erc721";
53
+ * const result = encodeUnwrap({
54
+ * tokenId: ...,
55
+ * recipient: ...,
56
+ * });
57
+ * ```
58
+ */
59
+ export declare function encodeUnwrap(options: UnwrapParams): `${typeof FN_SELECTOR}${string}`;
60
+ /**
61
+ * Prepares a transaction to call the "unwrap" function on the contract.
62
+ * @param options - The options for the "unwrap" function.
63
+ * @returns A prepared transaction object.
64
+ * @extension ERC721
65
+ * @example
66
+ * ```ts
67
+ * import { sendTransaction } from "thirdweb";
68
+ * import { unwrap } from "thirdweb/extensions/erc721";
69
+ *
70
+ * const transaction = unwrap({
71
+ * contract,
72
+ * tokenId: ...,
73
+ * recipient: ...,
74
+ * overrides: {
75
+ * ...
76
+ * }
77
+ * });
78
+ *
79
+ * // Send the transaction
80
+ * await sendTransaction({ transaction, account });
81
+ * ```
82
+ */
83
+ export declare function unwrap(options: BaseTransactionOptions<UnwrapParams | {
84
+ asyncParams: () => Promise<UnwrapParams>;
85
+ }>): import("../../../../../transaction/prepare-transaction.js").PreparedTransaction<any, import("abitype").AbiFunction, import("../../../../../transaction/prepare-transaction.js").PrepareTransactionOptions>;
86
+ //# sourceMappingURL=unwrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unwrap.d.ts","sourceRoot":"","sources":["../../../../../../../src/extensions/erc721/__generated__/Multiwrap/write/unwrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,KAAK,EACV,sBAAsB,EACtB,aAAa,EACd,MAAM,qCAAqC,CAAC;AAM7C;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,aAAa,CAAC;IACvC,OAAO,EAAE,2BAA2B,CAAC;QAAE,IAAI,EAAE,SAAS,CAAC;QAAC,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;IAC5E,SAAS,EAAE,2BAA2B,CAAC;QACrC,IAAI,EAAE,SAAS,CAAC;QAChB,IAAI,EAAE,YAAY,CAAC;KACpB,CAAC,CAAC;CACJ,CAAC,CAAC;AAEH,eAAO,MAAM,WAAW,EAAG,YAAqB,CAAC;AAajD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,kBAAkB,EAAE,MAAM,EAAE,WAK7D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,iBAEvD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,YAAY,GAIL,GAAG,OAAO,WAAW,GAAG,MAAM,EAAE,CAC5E;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,MAAM,CACpB,OAAO,EAAE,sBAAsB,CAC3B,YAAY,GACZ;IACE,WAAW,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;CAC1C,CACJ,8MAwBF"}
@@ -0,0 +1,111 @@
1
+ import type { AbiParameterToPrimitiveType } from "abitype";
2
+ import type { BaseTransactionOptions, WithOverrides } from "../../../../../transaction/types.js";
3
+ /**
4
+ * Represents the parameters for the "wrap" function.
5
+ */
6
+ export type WrapParams = WithOverrides<{
7
+ tokensToWrap: AbiParameterToPrimitiveType<{
8
+ type: "tuple[]";
9
+ name: "_tokensToWrap";
10
+ components: [
11
+ {
12
+ type: "address";
13
+ name: "assetContract";
14
+ },
15
+ {
16
+ type: "uint8";
17
+ name: "tokenType";
18
+ },
19
+ {
20
+ type: "uint256";
21
+ name: "tokenId";
22
+ },
23
+ {
24
+ type: "uint256";
25
+ name: "amount";
26
+ }
27
+ ];
28
+ }>;
29
+ uriForWrappedToken: AbiParameterToPrimitiveType<{
30
+ type: "string";
31
+ name: "_uriForWrappedToken";
32
+ }>;
33
+ recipient: AbiParameterToPrimitiveType<{
34
+ type: "address";
35
+ name: "_recipient";
36
+ }>;
37
+ }>;
38
+ export declare const FN_SELECTOR: "0x29e471dd";
39
+ /**
40
+ * Checks if the `wrap` method is supported by the given contract.
41
+ * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
42
+ * @returns A boolean indicating if the `wrap` method is supported.
43
+ * @extension ERC721
44
+ * @example
45
+ * ```ts
46
+ * import { isWrapSupported } from "thirdweb/extensions/erc721";
47
+ *
48
+ * const supported = isWrapSupported(["0x..."]);
49
+ * ```
50
+ */
51
+ export declare function isWrapSupported(availableSelectors: string[]): boolean;
52
+ /**
53
+ * Encodes the parameters for the "wrap" function.
54
+ * @param options - The options for the wrap function.
55
+ * @returns The encoded ABI parameters.
56
+ * @extension ERC721
57
+ * @example
58
+ * ```ts
59
+ * import { encodeWrapParams } from "thirdweb/extensions/erc721";
60
+ * const result = encodeWrapParams({
61
+ * tokensToWrap: ...,
62
+ * uriForWrappedToken: ...,
63
+ * recipient: ...,
64
+ * });
65
+ * ```
66
+ */
67
+ export declare function encodeWrapParams(options: WrapParams): `0x${string}`;
68
+ /**
69
+ * Encodes the "wrap" function into a Hex string with its parameters.
70
+ * @param options - The options for the wrap function.
71
+ * @returns The encoded hexadecimal string.
72
+ * @extension ERC721
73
+ * @example
74
+ * ```ts
75
+ * import { encodeWrap } from "thirdweb/extensions/erc721";
76
+ * const result = encodeWrap({
77
+ * tokensToWrap: ...,
78
+ * uriForWrappedToken: ...,
79
+ * recipient: ...,
80
+ * });
81
+ * ```
82
+ */
83
+ export declare function encodeWrap(options: WrapParams): `${typeof FN_SELECTOR}${string}`;
84
+ /**
85
+ * Prepares a transaction to call the "wrap" function on the contract.
86
+ * @param options - The options for the "wrap" function.
87
+ * @returns A prepared transaction object.
88
+ * @extension ERC721
89
+ * @example
90
+ * ```ts
91
+ * import { sendTransaction } from "thirdweb";
92
+ * import { wrap } from "thirdweb/extensions/erc721";
93
+ *
94
+ * const transaction = wrap({
95
+ * contract,
96
+ * tokensToWrap: ...,
97
+ * uriForWrappedToken: ...,
98
+ * recipient: ...,
99
+ * overrides: {
100
+ * ...
101
+ * }
102
+ * });
103
+ *
104
+ * // Send the transaction
105
+ * await sendTransaction({ transaction, account });
106
+ * ```
107
+ */
108
+ export declare function wrap(options: BaseTransactionOptions<WrapParams | {
109
+ asyncParams: () => Promise<WrapParams>;
110
+ }>): import("../../../../../transaction/prepare-transaction.js").PreparedTransaction<any, import("abitype").AbiFunction, import("../../../../../transaction/prepare-transaction.js").PrepareTransactionOptions>;
111
+ //# sourceMappingURL=wrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrap.d.ts","sourceRoot":"","sources":["../../../../../../../src/extensions/erc721/__generated__/Multiwrap/write/wrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,KAAK,EACV,sBAAsB,EACtB,aAAa,EACd,MAAM,qCAAqC,CAAC;AAM7C;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC;IACrC,YAAY,EAAE,2BAA2B,CAAC;QACxC,IAAI,EAAE,SAAS,CAAC;QAChB,IAAI,EAAE,eAAe,CAAC;QACtB,UAAU,EAAE;YACV;gBAAE,IAAI,EAAE,SAAS,CAAC;gBAAC,IAAI,EAAE,eAAe,CAAA;aAAE;YAC1C;gBAAE,IAAI,EAAE,OAAO,CAAC;gBAAC,IAAI,EAAE,WAAW,CAAA;aAAE;YACpC;gBAAE,IAAI,EAAE,SAAS,CAAC;gBAAC,IAAI,EAAE,SAAS,CAAA;aAAE;YACpC;gBAAE,IAAI,EAAE,SAAS,CAAC;gBAAC,IAAI,EAAE,QAAQ,CAAA;aAAE;SACpC,CAAC;KACH,CAAC,CAAC;IACH,kBAAkB,EAAE,2BAA2B,CAAC;QAC9C,IAAI,EAAE,QAAQ,CAAC;QACf,IAAI,EAAE,qBAAqB,CAAC;KAC7B,CAAC,CAAC;IACH,SAAS,EAAE,2BAA2B,CAAC;QACrC,IAAI,EAAE,SAAS,CAAC;QAChB,IAAI,EAAE,YAAY,CAAC;KACpB,CAAC,CAAC;CACJ,CAAC,CAAC;AAEH,eAAO,MAAM,WAAW,EAAG,YAAqB,CAAC;AAwCjD;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,kBAAkB,EAAE,MAAM,EAAE,WAK3D;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,UAAU,iBAMnD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,UAAU,GAIH,GAAG,OAAO,WAAW,GAAG,MAAM,EAAE,CAC1E;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,IAAI,CAClB,OAAO,EAAE,sBAAsB,CAC3B,UAAU,GACV;IACE,WAAW,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;CACxC,CACJ,8MA4BF"}
@@ -4,7 +4,7 @@ import type { ClientAndChainAndAccount } from "../../utils/types.js";
4
4
  /**
5
5
  * @extension DEPLOY
6
6
  */
7
- export type ERC721ContractType = "DropERC721" | "TokenERC721" | "OpenEditionERC721";
7
+ export type ERC721ContractType = "DropERC721" | "TokenERC721" | "OpenEditionERC721" | "LoyaltyCard";
8
8
  /**
9
9
  * @extension DEPLOY
10
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"deploy-erc721.d.ts","sourceRoot":"","sources":["../../../../src/extensions/prebuilts/deploy-erc721.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAKrE;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,YAAY,GACZ,aAAa,GACb,mBAAmB,CAAC;AAExB;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAChD,wBAAwB,GAAG;IACzB,IAAI,EAAE,kBAAkB,CAAC;IACzB,MAAM,EAAE,oBAAoB,CAAC;CAC9B,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,2BAA2B,mBA2BrC"}
1
+ {"version":3,"file":"deploy-erc721.d.ts","sourceRoot":"","sources":["../../../../src/extensions/prebuilts/deploy-erc721.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAMrE;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,YAAY,GACZ,aAAa,GACb,mBAAmB,GACnB,aAAa,CAAC;AAElB;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAChD,wBAAwB,GAAG;IACzB,IAAI,EAAE,kBAAkB,CAAC;IACzB,MAAM,EAAE,oBAAoB,CAAC;CAC9B,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,2BAA2B,mBA2BrC"}
@@ -1,2 +1,2 @@
1
- export declare const version = "5.72.0-nightly-f64e0253d7de6fdb6f56ab49315cc4cdcdd75b20-20241127000345";
1
+ export declare const version = "5.72.0-nightly-e87eb2ff35eea1b94ab7bdae3585d819879ec53c-20241128000350";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thirdweb",
3
- "version": "5.72.0-nightly-f64e0253d7de6fdb6f56ab49315cc4cdcdd75b20-20241127000345",
3
+ "version": "5.72.0-nightly-e87eb2ff35eea1b94ab7bdae3585d819879ec53c-20241128000350",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/thirdweb-dev/js.git#main"
@@ -0,0 +1,47 @@
1
+ import { prepareEvent } from "../../../../../event/prepare-event.js";
2
+ import type { AbiParameterToPrimitiveType } from "abitype";
3
+
4
+ /**
5
+ * Represents the filters for the "TokensMinted" event.
6
+ */
7
+ export type TokensMintedEventFilters = Partial<{
8
+ mintedTo: AbiParameterToPrimitiveType<{
9
+ type: "address";
10
+ name: "mintedTo";
11
+ indexed: true;
12
+ }>;
13
+ tokenIdMinted: AbiParameterToPrimitiveType<{
14
+ type: "uint256";
15
+ name: "tokenIdMinted";
16
+ indexed: true;
17
+ }>;
18
+ }>;
19
+
20
+ /**
21
+ * Creates an event object for the TokensMinted event.
22
+ * @param filters - Optional filters to apply to the event.
23
+ * @returns The prepared event object.
24
+ * @extension ERC721
25
+ * @example
26
+ * ```ts
27
+ * import { getContractEvents } from "thirdweb";
28
+ * import { tokensMintedEvent } from "thirdweb/extensions/erc721";
29
+ *
30
+ * const events = await getContractEvents({
31
+ * contract,
32
+ * events: [
33
+ * tokensMintedEvent({
34
+ * mintedTo: ...,
35
+ * tokenIdMinted: ...,
36
+ * })
37
+ * ],
38
+ * });
39
+ * ```
40
+ */
41
+ export function tokensMintedEvent(filters: TokensMintedEventFilters = {}) {
42
+ return prepareEvent({
43
+ signature:
44
+ "event TokensMinted(address indexed mintedTo, uint256 indexed tokenIdMinted, string uri)",
45
+ filters,
46
+ });
47
+ }
@@ -0,0 +1,55 @@
1
+ import { prepareEvent } from "../../../../../event/prepare-event.js";
2
+ import type { AbiParameterToPrimitiveType } from "abitype";
3
+
4
+ /**
5
+ * Represents the filters for the "TokensMintedWithSignature" event.
6
+ */
7
+ export type TokensMintedWithSignatureEventFilters = Partial<{
8
+ signer: AbiParameterToPrimitiveType<{
9
+ type: "address";
10
+ name: "signer";
11
+ indexed: true;
12
+ }>;
13
+ mintedTo: AbiParameterToPrimitiveType<{
14
+ type: "address";
15
+ name: "mintedTo";
16
+ indexed: true;
17
+ }>;
18
+ tokenIdMinted: AbiParameterToPrimitiveType<{
19
+ type: "uint256";
20
+ name: "tokenIdMinted";
21
+ indexed: true;
22
+ }>;
23
+ }>;
24
+
25
+ /**
26
+ * Creates an event object for the TokensMintedWithSignature event.
27
+ * @param filters - Optional filters to apply to the event.
28
+ * @returns The prepared event object.
29
+ * @extension ERC721
30
+ * @example
31
+ * ```ts
32
+ * import { getContractEvents } from "thirdweb";
33
+ * import { tokensMintedWithSignatureEvent } from "thirdweb/extensions/erc721";
34
+ *
35
+ * const events = await getContractEvents({
36
+ * contract,
37
+ * events: [
38
+ * tokensMintedWithSignatureEvent({
39
+ * signer: ...,
40
+ * mintedTo: ...,
41
+ * tokenIdMinted: ...,
42
+ * })
43
+ * ],
44
+ * });
45
+ * ```
46
+ */
47
+ export function tokensMintedWithSignatureEvent(
48
+ filters: TokensMintedWithSignatureEventFilters = {},
49
+ ) {
50
+ return prepareEvent({
51
+ signature:
52
+ "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)",
53
+ filters,
54
+ });
55
+ }
@@ -0,0 +1,70 @@
1
+ import { readContract } from "../../../../../transaction/read-contract.js";
2
+ import type { BaseTransactionOptions } from "../../../../../transaction/types.js";
3
+
4
+ import { decodeAbiParameters } from "viem";
5
+ import type { Hex } from "../../../../../utils/encoding/hex.js";
6
+ import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js";
7
+
8
+ export const FN_SELECTOR = "0x3b1475a7" as const;
9
+ const FN_INPUTS = [] as const;
10
+ const FN_OUTPUTS = [
11
+ {
12
+ type: "uint256",
13
+ },
14
+ ] as const;
15
+
16
+ /**
17
+ * Checks if the `nextTokenIdToMint` method is supported by the given contract.
18
+ * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
19
+ * @returns A boolean indicating if the `nextTokenIdToMint` method is supported.
20
+ * @extension ERC721
21
+ * @example
22
+ * ```ts
23
+ * import { isNextTokenIdToMintSupported } from "thirdweb/extensions/erc721";
24
+ * const supported = isNextTokenIdToMintSupported(["0x..."]);
25
+ * ```
26
+ */
27
+ export function isNextTokenIdToMintSupported(availableSelectors: string[]) {
28
+ return detectMethod({
29
+ availableSelectors,
30
+ method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
31
+ });
32
+ }
33
+
34
+ /**
35
+ * Decodes the result of the nextTokenIdToMint function call.
36
+ * @param result - The hexadecimal result to decode.
37
+ * @returns The decoded result as per the FN_OUTPUTS definition.
38
+ * @extension ERC721
39
+ * @example
40
+ * ```ts
41
+ * import { decodeNextTokenIdToMintResult } from "thirdweb/extensions/erc721";
42
+ * const result = decodeNextTokenIdToMintResultResult("...");
43
+ * ```
44
+ */
45
+ export function decodeNextTokenIdToMintResult(result: Hex) {
46
+ return decodeAbiParameters(FN_OUTPUTS, result)[0];
47
+ }
48
+
49
+ /**
50
+ * Calls the "nextTokenIdToMint" function on the contract.
51
+ * @param options - The options for the nextTokenIdToMint function.
52
+ * @returns The parsed result of the function call.
53
+ * @extension ERC721
54
+ * @example
55
+ * ```ts
56
+ * import { nextTokenIdToMint } from "thirdweb/extensions/erc721";
57
+ *
58
+ * const result = await nextTokenIdToMint({
59
+ * contract,
60
+ * });
61
+ *
62
+ * ```
63
+ */
64
+ export async function nextTokenIdToMint(options: BaseTransactionOptions) {
65
+ return readContract({
66
+ contract: options.contract,
67
+ method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
68
+ params: [],
69
+ });
70
+ }
@@ -0,0 +1,130 @@
1
+ import type { AbiParameterToPrimitiveType } from "abitype";
2
+ import { readContract } from "../../../../../transaction/read-contract.js";
3
+ import type { BaseTransactionOptions } from "../../../../../transaction/types.js";
4
+ import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js";
5
+ import { decodeAbiParameters } from "viem";
6
+ import type { Hex } from "../../../../../utils/encoding/hex.js";
7
+ import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js";
8
+
9
+ /**
10
+ * Represents the parameters for the "supportsInterface" function.
11
+ */
12
+ export type SupportsInterfaceParams = {
13
+ interfaceId: AbiParameterToPrimitiveType<{
14
+ type: "bytes4";
15
+ name: "interfaceId";
16
+ }>;
17
+ };
18
+
19
+ export const FN_SELECTOR = "0x01ffc9a7" as const;
20
+ const FN_INPUTS = [
21
+ {
22
+ type: "bytes4",
23
+ name: "interfaceId",
24
+ },
25
+ ] as const;
26
+ const FN_OUTPUTS = [
27
+ {
28
+ type: "bool",
29
+ },
30
+ ] as const;
31
+
32
+ /**
33
+ * Checks if the `supportsInterface` method is supported by the given contract.
34
+ * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
35
+ * @returns A boolean indicating if the `supportsInterface` method is supported.
36
+ * @extension ERC721
37
+ * @example
38
+ * ```ts
39
+ * import { isSupportsInterfaceSupported } from "thirdweb/extensions/erc721";
40
+ * const supported = isSupportsInterfaceSupported(["0x..."]);
41
+ * ```
42
+ */
43
+ export function isSupportsInterfaceSupported(availableSelectors: string[]) {
44
+ return detectMethod({
45
+ availableSelectors,
46
+ method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
47
+ });
48
+ }
49
+
50
+ /**
51
+ * Encodes the parameters for the "supportsInterface" function.
52
+ * @param options - The options for the supportsInterface function.
53
+ * @returns The encoded ABI parameters.
54
+ * @extension ERC721
55
+ * @example
56
+ * ```ts
57
+ * import { encodeSupportsInterfaceParams } from "thirdweb/extensions/erc721";
58
+ * const result = encodeSupportsInterfaceParams({
59
+ * interfaceId: ...,
60
+ * });
61
+ * ```
62
+ */
63
+ export function encodeSupportsInterfaceParams(
64
+ options: SupportsInterfaceParams,
65
+ ) {
66
+ return encodeAbiParameters(FN_INPUTS, [options.interfaceId]);
67
+ }
68
+
69
+ /**
70
+ * Encodes the "supportsInterface" function into a Hex string with its parameters.
71
+ * @param options - The options for the supportsInterface function.
72
+ * @returns The encoded hexadecimal string.
73
+ * @extension ERC721
74
+ * @example
75
+ * ```ts
76
+ * import { encodeSupportsInterface } from "thirdweb/extensions/erc721";
77
+ * const result = encodeSupportsInterface({
78
+ * interfaceId: ...,
79
+ * });
80
+ * ```
81
+ */
82
+ export function encodeSupportsInterface(options: SupportsInterfaceParams) {
83
+ // we do a "manual" concat here to avoid the overhead of the "concatHex" function
84
+ // we can do this because we know the specific formats of the values
85
+ return (FN_SELECTOR +
86
+ encodeSupportsInterfaceParams(options).slice(
87
+ 2,
88
+ )) as `${typeof FN_SELECTOR}${string}`;
89
+ }
90
+
91
+ /**
92
+ * Decodes the result of the supportsInterface function call.
93
+ * @param result - The hexadecimal result to decode.
94
+ * @returns The decoded result as per the FN_OUTPUTS definition.
95
+ * @extension ERC721
96
+ * @example
97
+ * ```ts
98
+ * import { decodeSupportsInterfaceResult } from "thirdweb/extensions/erc721";
99
+ * const result = decodeSupportsInterfaceResultResult("...");
100
+ * ```
101
+ */
102
+ export function decodeSupportsInterfaceResult(result: Hex) {
103
+ return decodeAbiParameters(FN_OUTPUTS, result)[0];
104
+ }
105
+
106
+ /**
107
+ * Calls the "supportsInterface" function on the contract.
108
+ * @param options - The options for the supportsInterface function.
109
+ * @returns The parsed result of the function call.
110
+ * @extension ERC721
111
+ * @example
112
+ * ```ts
113
+ * import { supportsInterface } from "thirdweb/extensions/erc721";
114
+ *
115
+ * const result = await supportsInterface({
116
+ * contract,
117
+ * interfaceId: ...,
118
+ * });
119
+ *
120
+ * ```
121
+ */
122
+ export async function supportsInterface(
123
+ options: BaseTransactionOptions<SupportsInterfaceParams>,
124
+ ) {
125
+ return readContract({
126
+ contract: options.contract,
127
+ method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
128
+ params: [options.interfaceId],
129
+ });
130
+ }