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.
- package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/events/TokensMinted.js +32 -0
- package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/events/TokensMinted.js.map +1 -0
- package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/events/TokensMintedWithSignature.js +33 -0
- package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/events/TokensMintedWithSignature.js.map +1 -0
- package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/read/nextTokenIdToMint.js +70 -0
- package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/read/nextTokenIdToMint.js.map +1 -0
- package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/read/supportsInterface.js +114 -0
- package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/read/supportsInterface.js.map +1 -0
- package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/read/tokenURI.js +114 -0
- package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/read/tokenURI.js.map +1 -0
- package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/read/totalMinted.js +70 -0
- package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/read/totalMinted.js.map +1 -0
- package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/write/cancel.js +117 -0
- package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/write/cancel.js.map +1 -0
- package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/write/initialize.js +202 -0
- package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/write/initialize.js.map +1 -0
- package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/write/mintTo.js +129 -0
- package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/write/mintTo.js.map +1 -0
- package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/write/mintWithSignature.js +171 -0
- package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/write/mintWithSignature.js.map +1 -0
- package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/write/revoke.js +117 -0
- package/dist/cjs/extensions/erc721/__generated__/LoyaltyCard/write/revoke.js.map +1 -0
- package/dist/cjs/extensions/erc721/__generated__/Multiwrap/events/TokensUnwrapped.js +33 -0
- package/dist/cjs/extensions/erc721/__generated__/Multiwrap/events/TokensUnwrapped.js.map +1 -0
- package/dist/cjs/extensions/erc721/__generated__/Multiwrap/events/TokensWrapped.js +33 -0
- package/dist/cjs/extensions/erc721/__generated__/Multiwrap/events/TokensWrapped.js.map +1 -0
- package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/contractType.js +70 -0
- package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/contractType.js.map +1 -0
- package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/contractVersion.js +70 -0
- package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/contractVersion.js.map +1 -0
- package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/getWrappedContents.js +133 -0
- package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/getWrappedContents.js.map +1 -0
- package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/nextTokenIdToMint.js +70 -0
- package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/nextTokenIdToMint.js.map +1 -0
- package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/supportsInterface.js +114 -0
- package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/supportsInterface.js.map +1 -0
- package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/tokenURI.js +114 -0
- package/dist/cjs/extensions/erc721/__generated__/Multiwrap/read/tokenURI.js.map +1 -0
- package/dist/cjs/extensions/erc721/__generated__/Multiwrap/write/initialize.js +175 -0
- package/dist/cjs/extensions/erc721/__generated__/Multiwrap/write/initialize.js.map +1 -0
- package/dist/cjs/extensions/erc721/__generated__/Multiwrap/write/unwrap.js +124 -0
- package/dist/cjs/extensions/erc721/__generated__/Multiwrap/write/unwrap.js.map +1 -0
- package/dist/cjs/extensions/erc721/__generated__/Multiwrap/write/wrap.js +162 -0
- package/dist/cjs/extensions/erc721/__generated__/Multiwrap/write/wrap.js.map +1 -0
- package/dist/cjs/extensions/prebuilts/deploy-erc721.js +21 -6
- package/dist/cjs/extensions/prebuilts/deploy-erc721.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/events/TokensMinted.js +29 -0
- package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/events/TokensMinted.js.map +1 -0
- package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/events/TokensMintedWithSignature.js +30 -0
- package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/events/TokensMintedWithSignature.js.map +1 -0
- package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/read/nextTokenIdToMint.js +64 -0
- package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/read/nextTokenIdToMint.js.map +1 -0
- package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/read/supportsInterface.js +106 -0
- package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/read/supportsInterface.js.map +1 -0
- package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/read/tokenURI.js +106 -0
- package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/read/tokenURI.js.map +1 -0
- package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/read/totalMinted.js +64 -0
- package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/read/totalMinted.js.map +1 -0
- package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/write/cancel.js +110 -0
- package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/write/cancel.js.map +1 -0
- package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/write/initialize.js +195 -0
- package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/write/initialize.js.map +1 -0
- package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/write/mintTo.js +122 -0
- package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/write/mintTo.js.map +1 -0
- package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/write/mintWithSignature.js +164 -0
- package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/write/mintWithSignature.js.map +1 -0
- package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/write/revoke.js +110 -0
- package/dist/esm/extensions/erc721/__generated__/LoyaltyCard/write/revoke.js.map +1 -0
- package/dist/esm/extensions/erc721/__generated__/Multiwrap/events/TokensUnwrapped.js +30 -0
- package/dist/esm/extensions/erc721/__generated__/Multiwrap/events/TokensUnwrapped.js.map +1 -0
- package/dist/esm/extensions/erc721/__generated__/Multiwrap/events/TokensWrapped.js +30 -0
- package/dist/esm/extensions/erc721/__generated__/Multiwrap/events/TokensWrapped.js.map +1 -0
- package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/contractType.js +64 -0
- package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/contractType.js.map +1 -0
- package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/contractVersion.js +64 -0
- package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/contractVersion.js.map +1 -0
- package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/getWrappedContents.js +125 -0
- package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/getWrappedContents.js.map +1 -0
- package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/nextTokenIdToMint.js +64 -0
- package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/nextTokenIdToMint.js.map +1 -0
- package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/supportsInterface.js +106 -0
- package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/supportsInterface.js.map +1 -0
- package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/tokenURI.js +106 -0
- package/dist/esm/extensions/erc721/__generated__/Multiwrap/read/tokenURI.js.map +1 -0
- package/dist/esm/extensions/erc721/__generated__/Multiwrap/write/initialize.js +168 -0
- package/dist/esm/extensions/erc721/__generated__/Multiwrap/write/initialize.js.map +1 -0
- package/dist/esm/extensions/erc721/__generated__/Multiwrap/write/unwrap.js +117 -0
- package/dist/esm/extensions/erc721/__generated__/Multiwrap/write/unwrap.js.map +1 -0
- package/dist/esm/extensions/erc721/__generated__/Multiwrap/write/wrap.js +155 -0
- package/dist/esm/extensions/erc721/__generated__/Multiwrap/write/wrap.js.map +1 -0
- package/dist/esm/extensions/prebuilts/deploy-erc721.js +15 -0
- package/dist/esm/extensions/prebuilts/deploy-erc721.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/extensions/erc721/__generated__/LoyaltyCard/events/TokensMinted.d.ts +54 -0
- package/dist/types/extensions/erc721/__generated__/LoyaltyCard/events/TokensMinted.d.ts.map +1 -0
- package/dist/types/extensions/erc721/__generated__/LoyaltyCard/events/TokensMintedWithSignature.d.ts +95 -0
- package/dist/types/extensions/erc721/__generated__/LoyaltyCard/events/TokensMintedWithSignature.d.ts.map +1 -0
- package/dist/types/extensions/erc721/__generated__/LoyaltyCard/read/nextTokenIdToMint.d.ts +44 -0
- package/dist/types/extensions/erc721/__generated__/LoyaltyCard/read/nextTokenIdToMint.d.ts.map +1 -0
- package/dist/types/extensions/erc721/__generated__/LoyaltyCard/read/supportsInterface.d.ts +83 -0
- package/dist/types/extensions/erc721/__generated__/LoyaltyCard/read/supportsInterface.d.ts.map +1 -0
- package/dist/types/extensions/erc721/__generated__/LoyaltyCard/read/tokenURI.d.ts +83 -0
- package/dist/types/extensions/erc721/__generated__/LoyaltyCard/read/tokenURI.d.ts.map +1 -0
- package/dist/types/extensions/erc721/__generated__/LoyaltyCard/read/totalMinted.d.ts +44 -0
- package/dist/types/extensions/erc721/__generated__/LoyaltyCard/read/totalMinted.d.ts.map +1 -0
- package/dist/types/extensions/erc721/__generated__/LoyaltyCard/write/cancel.d.ts +79 -0
- package/dist/types/extensions/erc721/__generated__/LoyaltyCard/write/cancel.d.ts.map +1 -0
- package/dist/types/extensions/erc721/__generated__/LoyaltyCard/write/initialize.d.ts +142 -0
- package/dist/types/extensions/erc721/__generated__/LoyaltyCard/write/initialize.d.ts.map +1 -0
- package/dist/types/extensions/erc721/__generated__/LoyaltyCard/write/mintTo.d.ts +86 -0
- package/dist/types/extensions/erc721/__generated__/LoyaltyCard/write/mintTo.d.ts.map +1 -0
- package/dist/types/extensions/erc721/__generated__/LoyaltyCard/write/mintWithSignature.d.ts +128 -0
- package/dist/types/extensions/erc721/__generated__/LoyaltyCard/write/mintWithSignature.d.ts.map +1 -0
- package/dist/types/extensions/erc721/__generated__/LoyaltyCard/write/revoke.d.ts +79 -0
- package/dist/types/extensions/erc721/__generated__/LoyaltyCard/write/revoke.d.ts.map +1 -0
- package/dist/types/extensions/erc721/__generated__/Multiwrap/events/TokensUnwrapped.d.ts +61 -0
- package/dist/types/extensions/erc721/__generated__/Multiwrap/events/TokensUnwrapped.d.ts.map +1 -0
- package/dist/types/extensions/erc721/__generated__/Multiwrap/events/TokensWrapped.d.ts +77 -0
- package/dist/types/extensions/erc721/__generated__/Multiwrap/events/TokensWrapped.d.ts.map +1 -0
- package/dist/types/extensions/erc721/__generated__/Multiwrap/read/contractType.d.ts +44 -0
- package/dist/types/extensions/erc721/__generated__/Multiwrap/read/contractType.d.ts.map +1 -0
- package/dist/types/extensions/erc721/__generated__/Multiwrap/read/contractVersion.d.ts +44 -0
- package/dist/types/extensions/erc721/__generated__/Multiwrap/read/contractVersion.d.ts.map +1 -0
- package/dist/types/extensions/erc721/__generated__/Multiwrap/read/getWrappedContents.d.ts +93 -0
- package/dist/types/extensions/erc721/__generated__/Multiwrap/read/getWrappedContents.d.ts.map +1 -0
- package/dist/types/extensions/erc721/__generated__/Multiwrap/read/nextTokenIdToMint.d.ts +44 -0
- package/dist/types/extensions/erc721/__generated__/Multiwrap/read/nextTokenIdToMint.d.ts.map +1 -0
- package/dist/types/extensions/erc721/__generated__/Multiwrap/read/supportsInterface.d.ts +83 -0
- package/dist/types/extensions/erc721/__generated__/Multiwrap/read/supportsInterface.d.ts.map +1 -0
- package/dist/types/extensions/erc721/__generated__/Multiwrap/read/tokenURI.d.ts +83 -0
- package/dist/types/extensions/erc721/__generated__/Multiwrap/read/tokenURI.d.ts.map +1 -0
- package/dist/types/extensions/erc721/__generated__/Multiwrap/write/initialize.d.ts +121 -0
- package/dist/types/extensions/erc721/__generated__/Multiwrap/write/initialize.d.ts.map +1 -0
- package/dist/types/extensions/erc721/__generated__/Multiwrap/write/unwrap.d.ts +86 -0
- package/dist/types/extensions/erc721/__generated__/Multiwrap/write/unwrap.d.ts.map +1 -0
- package/dist/types/extensions/erc721/__generated__/Multiwrap/write/wrap.d.ts +111 -0
- package/dist/types/extensions/erc721/__generated__/Multiwrap/write/wrap.d.ts.map +1 -0
- package/dist/types/extensions/prebuilts/deploy-erc721.d.ts +1 -1
- package/dist/types/extensions/prebuilts/deploy-erc721.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/extensions/erc721/__generated__/LoyaltyCard/events/TokensMinted.ts +47 -0
- package/src/extensions/erc721/__generated__/LoyaltyCard/events/TokensMintedWithSignature.ts +55 -0
- package/src/extensions/erc721/__generated__/LoyaltyCard/read/nextTokenIdToMint.ts +70 -0
- package/src/extensions/erc721/__generated__/LoyaltyCard/read/supportsInterface.ts +130 -0
- package/src/extensions/erc721/__generated__/LoyaltyCard/read/tokenURI.ts +123 -0
- package/src/extensions/erc721/__generated__/LoyaltyCard/read/totalMinted.ts +70 -0
- package/src/extensions/erc721/__generated__/LoyaltyCard/write/cancel.ts +135 -0
- package/src/extensions/erc721/__generated__/LoyaltyCard/write/initialize.ts +255 -0
- package/src/extensions/erc721/__generated__/LoyaltyCard/write/mintTo.ts +148 -0
- package/src/extensions/erc721/__generated__/LoyaltyCard/write/mintWithSignature.ts +209 -0
- package/src/extensions/erc721/__generated__/LoyaltyCard/write/revoke.ts +135 -0
- package/src/extensions/erc721/__generated__/Multiwrap/events/TokensUnwrapped.ts +55 -0
- package/src/extensions/erc721/__generated__/Multiwrap/events/TokensWrapped.ts +53 -0
- package/src/extensions/erc721/__generated__/Multiwrap/read/contractType.ts +70 -0
- package/src/extensions/erc721/__generated__/Multiwrap/read/contractVersion.ts +70 -0
- package/src/extensions/erc721/__generated__/Multiwrap/read/getWrappedContents.ts +146 -0
- package/src/extensions/erc721/__generated__/Multiwrap/read/nextTokenIdToMint.ts +70 -0
- package/src/extensions/erc721/__generated__/Multiwrap/read/supportsInterface.ts +130 -0
- package/src/extensions/erc721/__generated__/Multiwrap/read/tokenURI.ts +123 -0
- package/src/extensions/erc721/__generated__/Multiwrap/write/initialize.ts +216 -0
- package/src/extensions/erc721/__generated__/Multiwrap/write/unwrap.ts +146 -0
- package/src/extensions/erc721/__generated__/Multiwrap/write/wrap.ts +197 -0
- package/src/extensions/prebuilts/deploy-erc721.test.ts +70 -2
- package/src/extensions/prebuilts/deploy-erc721.ts +17 -1
- 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;
|
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"}
|
package/dist/types/version.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const version = "5.72.0-nightly-
|
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-
|
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
|
+
}
|