thirdweb 5.64.0-nightly-e6e994479fb8386b1740de4170f33446f038f2b1-20241024000332 → 5.64.0
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/erc1155/write/mintAdditionalSupplyTo.js +1 -6
- package/dist/cjs/extensions/erc1155/write/mintAdditionalSupplyTo.js.map +1 -1
- package/dist/cjs/react/native/ui/components/WalletImage.js +3 -1
- package/dist/cjs/react/native/ui/components/WalletImage.js.map +1 -1
- package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js +1 -1
- package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js.map +1 -1
- package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js +1 -1
- package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
- package/dist/cjs/react/web/wallets/in-app/WalletAuth.js +20 -10
- package/dist/cjs/react/web/wallets/in-app/WalletAuth.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +7 -2
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/de.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/de.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/en.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/en.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/es.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/es.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/fr.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/fr.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/ja.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/ja.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/kr.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/kr.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/tl.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/tl.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/vi.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/vi.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/cjs/wallets/ecosystem/get-ecosystem-wallet-auth-options.js +5 -0
- package/dist/cjs/wallets/ecosystem/get-ecosystem-wallet-auth-options.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/getLoginPath.js +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/getLoginPath.js.map +1 -1
- package/dist/cjs/wallets/types.js +1 -0
- package/dist/cjs/wallets/types.js.map +1 -1
- package/dist/esm/exports/pay.js +0 -1
- package/dist/esm/exports/pay.js.map +1 -1
- package/dist/esm/exports/react.js +0 -5
- package/dist/esm/exports/react.js.map +1 -1
- package/dist/esm/exports/react.native.js +0 -2
- package/dist/esm/exports/react.native.js.map +1 -1
- package/dist/esm/exports/thirdweb.js +0 -1
- package/dist/esm/exports/thirdweb.js.map +1 -1
- package/dist/esm/exports/wallets/embedded.js +0 -1
- package/dist/esm/exports/wallets/embedded.js.map +1 -1
- package/dist/esm/exports/wallets/in-app.js +0 -1
- package/dist/esm/exports/wallets/in-app.js.map +1 -1
- package/dist/esm/exports/wallets/in-app.native.js +0 -1
- package/dist/esm/exports/wallets/in-app.native.js.map +1 -1
- package/dist/esm/exports/wallets.js +0 -1
- package/dist/esm/exports/wallets.js.map +1 -1
- package/dist/esm/exports/wallets.native.js +0 -1
- package/dist/esm/exports/wallets.native.js.map +1 -1
- package/dist/esm/extensions/erc1155/write/mintAdditionalSupplyTo.js +1 -6
- package/dist/esm/extensions/erc1155/write/mintAdditionalSupplyTo.js.map +1 -1
- package/dist/esm/react/native/ui/components/WalletImage.js +3 -1
- package/dist/esm/react/native/ui/components/WalletImage.js.map +1 -1
- package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js +1 -1
- package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js.map +1 -1
- package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js +1 -1
- package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
- package/dist/esm/react/web/wallets/in-app/WalletAuth.js +20 -10
- package/dist/esm/react/web/wallets/in-app/WalletAuth.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +7 -2
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/de.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/de.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/en.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/en.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/es.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/es.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/fr.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/fr.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/ja.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/ja.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/kr.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/kr.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/tl.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/tl.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/vi.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/vi.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/esm/wallets/ecosystem/get-ecosystem-wallet-auth-options.js +5 -0
- package/dist/esm/wallets/ecosystem/get-ecosystem-wallet-auth-options.js.map +1 -1
- package/dist/esm/wallets/in-app/core/authentication/getLoginPath.js +1 -1
- package/dist/esm/wallets/in-app/core/authentication/getLoginPath.js.map +1 -1
- package/dist/esm/wallets/types.js +1 -0
- package/dist/esm/wallets/types.js.map +1 -1
- package/dist/types/exports/pay.d.ts +1 -1
- package/dist/types/exports/pay.d.ts.map +1 -1
- package/dist/types/exports/react.d.ts +3 -3
- package/dist/types/exports/react.d.ts.map +1 -1
- package/dist/types/exports/react.native.d.ts +1 -1
- package/dist/types/exports/react.native.d.ts.map +1 -1
- package/dist/types/exports/thirdweb.d.ts +1 -1
- package/dist/types/exports/thirdweb.d.ts.map +1 -1
- package/dist/types/exports/wallets/embedded.d.ts +1 -1
- package/dist/types/exports/wallets/embedded.d.ts.map +1 -1
- package/dist/types/exports/wallets/in-app.d.ts +1 -1
- package/dist/types/exports/wallets/in-app.d.ts.map +1 -1
- package/dist/types/exports/wallets/in-app.native.d.ts +1 -1
- package/dist/types/exports/wallets/in-app.native.d.ts.map +1 -1
- package/dist/types/exports/wallets.d.ts +1 -1
- package/dist/types/exports/wallets.d.ts.map +1 -1
- package/dist/types/exports/wallets.native.d.ts +1 -1
- package/dist/types/exports/wallets.native.d.ts.map +1 -1
- package/dist/types/extensions/erc1155/write/mintAdditionalSupplyTo.d.ts.map +1 -1
- package/dist/types/react/native/ui/components/WalletImage.d.ts.map +1 -1
- package/dist/types/react/web/wallets/ecosystem/EcosystemWalletConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/WalletAuth.d.ts +1 -0
- package/dist/types/react/web/wallets/in-app/WalletAuth.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts +3 -1
- package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/de.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/de.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/en.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/en.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/es.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/es.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/fr.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/fr.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/ja.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/ja.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/kr.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/kr.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/tl.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/tl.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/types.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/types.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/vi.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/vi.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/dist/types/wallets/ecosystem/get-ecosystem-wallet-auth-options.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/getLoginPath.d.ts +2 -2
- package/dist/types/wallets/in-app/core/authentication/getLoginPath.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/types.d.ts +1 -1
- package/dist/types/wallets/in-app/core/authentication/types.d.ts.map +1 -1
- package/dist/types/wallets/types.d.ts +1 -1
- package/dist/types/wallets/types.d.ts.map +1 -1
- package/package.json +19 -19
- package/src/exports/pay.ts +3 -3
- package/src/exports/react.native.ts +3 -3
- package/src/exports/react.ts +5 -5
- package/src/exports/thirdweb.ts +3 -3
- package/src/exports/wallets/embedded.ts +1 -1
- package/src/exports/wallets/in-app.native.ts +1 -1
- package/src/exports/wallets/in-app.ts +1 -1
- package/src/exports/wallets.native.ts +1 -1
- package/src/exports/wallets.ts +1 -1
- package/src/extensions/erc1155/drop1155.test.ts +164 -34
- package/src/extensions/erc1155/drops/read/getActiveClaimCondition.test.ts +0 -90
- package/src/extensions/erc1155/write/mintAdditionalSupplyTo.ts +1 -7
- package/src/extensions/prebuilts/deploy-erc1155.test.ts +5 -5
- package/src/extensions/prebuilts/deploy-pack.test.ts +4 -2
- package/src/react/native/ui/components/WalletImage.tsx +3 -1
- package/src/react/web/wallets/ecosystem/EcosystemWalletConnectUI.tsx +1 -0
- package/src/react/web/wallets/in-app/InAppWalletConnectUI.tsx +1 -0
- package/src/react/web/wallets/in-app/WalletAuth.tsx +20 -10
- package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +19 -2
- package/src/react/web/wallets/shared/locale/de.ts +1 -0
- package/src/react/web/wallets/shared/locale/en.ts +1 -0
- package/src/react/web/wallets/shared/locale/es.ts +1 -0
- package/src/react/web/wallets/shared/locale/fr.ts +1 -0
- package/src/react/web/wallets/shared/locale/ja.ts +1 -0
- package/src/react/web/wallets/shared/locale/kr.ts +1 -0
- package/src/react/web/wallets/shared/locale/tl.ts +1 -0
- package/src/react/web/wallets/shared/locale/types.ts +1 -0
- package/src/react/web/wallets/shared/locale/vi.ts +1 -0
- package/src/version.ts +1 -1
- package/src/wallets/ecosystem/get-ecosystem-wallet-auth-options.ts +6 -0
- package/src/wallets/in-app/core/authentication/getLoginPath.ts +4 -4
- package/src/wallets/in-app/core/authentication/types.ts +1 -1
- package/src/wallets/types.ts +1 -0
- package/src/extensions/erc1155/drops/write/claimTo.test.ts +0 -185
- package/src/extensions/erc1155/drops/write/updateMetadata.test.ts +0 -54
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "thirdweb",
|
3
|
-
"version": "5.64.0
|
3
|
+
"version": "5.64.0",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "git+https://github.com/thirdweb-dev/js.git#main"
|
@@ -210,7 +210,7 @@
|
|
210
210
|
"@radix-ui/react-focus-scope": "1.1.0",
|
211
211
|
"@radix-ui/react-icons": "1.3.0",
|
212
212
|
"@radix-ui/react-tooltip": "1.1.3",
|
213
|
-
"@tanstack/react-query": "5.59.
|
213
|
+
"@tanstack/react-query": "5.59.16",
|
214
214
|
"@walletconnect/ethereum-provider": "2.17.1",
|
215
215
|
"@walletconnect/sign-client": "2.17.1",
|
216
216
|
"abitype": "1.0.6",
|
@@ -218,13 +218,13 @@
|
|
218
218
|
"input-otp": "^1.2.4",
|
219
219
|
"mipd": "0.0.7",
|
220
220
|
"uqr": "0.1.2",
|
221
|
-
"viem": "2.21.
|
221
|
+
"viem": "2.21.34"
|
222
222
|
},
|
223
223
|
"peerDependencies": {
|
224
224
|
"@aws-sdk/client-lambda": "^3",
|
225
225
|
"@aws-sdk/credential-providers": "^3",
|
226
226
|
"@coinbase/wallet-mobile-sdk": "^1",
|
227
|
-
"@mobile-wallet-protocol/client": "0.
|
227
|
+
"@mobile-wallet-protocol/client": "0.1.1",
|
228
228
|
"@react-native-async-storage/async-storage": "^1 || ^2",
|
229
229
|
"ethers": "^5 || ^6",
|
230
230
|
"expo-linking": "^6",
|
@@ -290,22 +290,22 @@
|
|
290
290
|
"node": ">=18"
|
291
291
|
},
|
292
292
|
"devDependencies": {
|
293
|
-
"@aws-sdk/client-kms": "3.
|
294
|
-
"@aws-sdk/client-lambda": "3.
|
295
|
-
"@aws-sdk/credential-providers": "3.
|
296
|
-
"@biomejs/biome": "1.9.
|
293
|
+
"@aws-sdk/client-kms": "3.678.0",
|
294
|
+
"@aws-sdk/client-lambda": "3.678.0",
|
295
|
+
"@aws-sdk/credential-providers": "3.678.0",
|
296
|
+
"@biomejs/biome": "1.9.4",
|
297
297
|
"@chromatic-com/storybook": "2.0.2",
|
298
298
|
"@codspeed/vitest-plugin": "3.1.1",
|
299
299
|
"@coinbase/wallet-mobile-sdk": "1.1.2",
|
300
|
-
"@mobile-wallet-protocol/client": "0.
|
301
|
-
"@react-native-async-storage/async-storage": "
|
300
|
+
"@mobile-wallet-protocol/client": "0.1.1",
|
301
|
+
"@react-native-async-storage/async-storage": "2.0.0",
|
302
302
|
"@size-limit/preset-big-lib": "11.1.6",
|
303
|
-
"@storybook/addon-essentials": "8.3.
|
304
|
-
"@storybook/addon-interactions": "8.3.
|
305
|
-
"@storybook/addon-links": "8.3.
|
306
|
-
"@storybook/addon-onboarding": "8.3.
|
307
|
-
"@storybook/react": "8.3.
|
308
|
-
"@storybook/react-vite": "8.3.
|
303
|
+
"@storybook/addon-essentials": "8.3.6",
|
304
|
+
"@storybook/addon-interactions": "8.3.6",
|
305
|
+
"@storybook/addon-links": "8.3.6",
|
306
|
+
"@storybook/addon-onboarding": "8.3.6",
|
307
|
+
"@storybook/react": "8.3.6",
|
308
|
+
"@storybook/react-vite": "8.3.6",
|
309
309
|
"@storybook/test": "8.3.6",
|
310
310
|
"@testing-library/jest-dom": "^6.4.7",
|
311
311
|
"@testing-library/react": "^16.0.0",
|
@@ -327,7 +327,7 @@
|
|
327
327
|
"msw": "^2.4.12",
|
328
328
|
"prettier": "^3.3.2",
|
329
329
|
"react": "18.3.1",
|
330
|
-
"react-native": "0.
|
330
|
+
"react-native": "0.76.0",
|
331
331
|
"react-native-aes-gcm-crypto": "0.2.2",
|
332
332
|
"react-native-passkey": "3.0.0-beta2",
|
333
333
|
"react-native-quick-crypto": "0.7.5",
|
@@ -335,10 +335,10 @@
|
|
335
335
|
"rimraf": "6.0.1",
|
336
336
|
"sharp": "^0.33.5",
|
337
337
|
"size-limit": "11.1.6",
|
338
|
-
"storybook": "8.3.
|
338
|
+
"storybook": "8.3.6",
|
339
339
|
"typedoc": "0.26.10",
|
340
340
|
"typescript": "5.6.3",
|
341
|
-
"vite": "5.4.
|
341
|
+
"vite": "5.4.10",
|
342
342
|
"vitest": "2.1.3"
|
343
343
|
},
|
344
344
|
"scripts": {
|
package/src/exports/pay.ts
CHANGED
@@ -10,9 +10,9 @@ export {
|
|
10
10
|
type GetBuyWithCryptoTransferParams,
|
11
11
|
} from "../pay/buyWithCrypto/getTransfer.js";
|
12
12
|
|
13
|
-
export {
|
14
|
-
|
15
|
-
|
13
|
+
export type {
|
14
|
+
QuoteApprovalParams,
|
15
|
+
QuoteTokenInfo,
|
16
16
|
} from "../pay/buyWithCrypto/commonTypes.js";
|
17
17
|
|
18
18
|
export {
|
@@ -34,9 +34,9 @@ export { useWaitForReceipt } from "../react/core/hooks/contract/useWaitForReceip
|
|
34
34
|
export { useContractEvents } from "../react/core/hooks/contract/useContractEvents.js";
|
35
35
|
|
36
36
|
// transaction
|
37
|
-
export {
|
38
|
-
|
39
|
-
|
37
|
+
export type {
|
38
|
+
SendTransactionConfig,
|
39
|
+
SendTransactionPayModalConfig,
|
40
40
|
} from "../react/core/hooks/transaction/useSendTransaction.js";
|
41
41
|
export { useSimulateTransaction } from "../react/core/hooks/transaction/useSimulateTransaction.js";
|
42
42
|
export { useSendTransaction } from "../react/native/hooks/transaction/useSendTransaction.js";
|
package/src/exports/react.ts
CHANGED
@@ -6,7 +6,7 @@ export type {
|
|
6
6
|
|
7
7
|
export { ConnectButton } from "../react/web/ui/ConnectWallet/ConnectButton.js";
|
8
8
|
export { ConnectEmbed } from "../react/web/ui/ConnectWallet/Modal/ConnectEmbed.js";
|
9
|
-
export {
|
9
|
+
export type { ConnectEmbedProps } from "../react/core/hooks/connection/ConnectEmbedProps.js";
|
10
10
|
|
11
11
|
export type {
|
12
12
|
ConnectButtonProps,
|
@@ -70,9 +70,9 @@ export { useWaitForReceipt } from "../react/core/hooks/contract/useWaitForReceip
|
|
70
70
|
export { useContractEvents } from "../react/core/hooks/contract/useContractEvents.js";
|
71
71
|
|
72
72
|
// transaction
|
73
|
-
export {
|
74
|
-
|
75
|
-
|
73
|
+
export type {
|
74
|
+
SendTransactionConfig,
|
75
|
+
SendTransactionPayModalConfig,
|
76
76
|
} from "../react/core/hooks/transaction/useSendTransaction.js";
|
77
77
|
export { useSimulateTransaction } from "../react/core/hooks/transaction/useSimulateTransaction.js";
|
78
78
|
export { useSendTransaction } from "../react/web/hooks/transaction/useSendTransaction.js";
|
@@ -123,7 +123,7 @@ export { AutoConnect } from "../react/web/ui/AutoConnect/AutoConnect.js";
|
|
123
123
|
export type { AutoConnectProps } from "../react/core/hooks/connection/types.js";
|
124
124
|
|
125
125
|
// auth
|
126
|
-
export {
|
126
|
+
export type { SiweAuthOptions } from "../react/core/hooks/auth/useSiweAuth.js";
|
127
127
|
|
128
128
|
export {
|
129
129
|
PayEmbed,
|
package/src/exports/thirdweb.ts
CHANGED
@@ -180,9 +180,9 @@ export {
|
|
180
180
|
type GetBuyWithCryptoQuoteParams,
|
181
181
|
} from "../pay/buyWithCrypto/getQuote.js";
|
182
182
|
|
183
|
-
export {
|
184
|
-
|
185
|
-
|
183
|
+
export type {
|
184
|
+
QuoteApprovalParams,
|
185
|
+
QuoteTokenInfo,
|
186
186
|
} from "../pay/buyWithCrypto/commonTypes.js";
|
187
187
|
|
188
188
|
export {
|
@@ -12,4 +12,4 @@ export {
|
|
12
12
|
getUserEmail,
|
13
13
|
} from "../../wallets/in-app/web/lib/auth/index.js";
|
14
14
|
|
15
|
-
export {
|
15
|
+
export type { GetAuthenticatedUserParams } from "../../wallets/in-app/core/authentication/types.js";
|
@@ -11,7 +11,7 @@ export {
|
|
11
11
|
linkProfile,
|
12
12
|
} from "../../wallets/in-app/native/auth/index.js";
|
13
13
|
|
14
|
-
export {
|
14
|
+
export type { GetAuthenticatedUserParams } from "../../wallets/in-app/core/authentication/types.js";
|
15
15
|
export type {
|
16
16
|
InAppWalletCreationOptions,
|
17
17
|
InAppWalletAuth,
|
@@ -11,7 +11,7 @@ export {
|
|
11
11
|
linkProfile,
|
12
12
|
} from "../../wallets/in-app/web/lib/auth/index.js";
|
13
13
|
|
14
|
-
export {
|
14
|
+
export type { GetAuthenticatedUserParams } from "../../wallets/in-app/core/authentication/types.js";
|
15
15
|
export type {
|
16
16
|
InAppWalletCreationOptions,
|
17
17
|
InAppWalletAuth,
|
@@ -116,7 +116,7 @@ export type {
|
|
116
116
|
|
117
117
|
export { getAllWalletsList } from "../wallets/getAllWalletsList.js";
|
118
118
|
export { getWalletInfo } from "../wallets/__generated__/getWalletInfo.js";
|
119
|
-
export {
|
119
|
+
export type { WalletInfo } from "../wallets/wallet-info.js";
|
120
120
|
|
121
121
|
export { createWalletAdapter } from "../adapters/wallet-adapter.js";
|
122
122
|
export type { AdapterWalletOptions } from "../adapters/wallet-adapter.js";
|
package/src/exports/wallets.ts
CHANGED
@@ -125,7 +125,7 @@ export type {
|
|
125
125
|
|
126
126
|
export { getAllWalletsList } from "../wallets/getAllWalletsList.js";
|
127
127
|
export { getWalletInfo } from "../wallets/__generated__/getWalletInfo.js";
|
128
|
-
export {
|
128
|
+
export type { WalletInfo } from "../wallets/wallet-info.js";
|
129
129
|
|
130
130
|
export { createWalletAdapter } from "../adapters/wallet-adapter.js";
|
131
131
|
export type { AdapterWalletOptions } from "../adapters/wallet-adapter.js";
|
@@ -5,22 +5,28 @@ import { VITALIK_WALLET } from "../../../test/src/addresses.js";
|
|
5
5
|
import { ANVIL_CHAIN } from "../../../test/src/chains.js";
|
6
6
|
import { TEST_CLIENT } from "../../../test/src/test-clients.js";
|
7
7
|
import {
|
8
|
-
TEST_ACCOUNT_A,
|
9
8
|
TEST_ACCOUNT_B,
|
9
|
+
TEST_ACCOUNT_C,
|
10
10
|
TEST_ACCOUNT_D,
|
11
11
|
} from "../../../test/src/test-wallets.js";
|
12
|
+
import { NATIVE_TOKEN_ADDRESS } from "../../constants/addresses.js";
|
12
13
|
import { resolveContractAbi } from "../../contract/actions/resolve-abi.js";
|
13
14
|
import { type ThirdwebContract, getContract } from "../../contract/contract.js";
|
14
15
|
import { sendAndConfirmTransaction } from "../../transaction/actions/send-and-confirm-transaction.js";
|
15
16
|
import { resolvePromisedValue } from "../../utils/promise/resolve-promised-value.js";
|
16
17
|
import { toEther } from "../../utils/units.js";
|
18
|
+
import { generateMerkleTreeInfoERC1155 } from "../airdrop/write/merkleInfoERC1155.js";
|
19
|
+
import { deployERC20Contract } from "../prebuilts/deploy-erc20.js";
|
17
20
|
import { deployERC1155Contract } from "../prebuilts/deploy-erc1155.js";
|
18
21
|
import { balanceOf } from "./__generated__/IERC1155/read/balanceOf.js";
|
22
|
+
import { totalSupply } from "./__generated__/IERC1155/read/totalSupply.js";
|
19
23
|
import { nextTokenIdToMint } from "./__generated__/IERC1155Enumerable/read/nextTokenIdToMint.js";
|
24
|
+
import { getActiveClaimCondition } from "./drops/read/getActiveClaimCondition.js";
|
20
25
|
import { getClaimConditions } from "./drops/read/getClaimConditions.js";
|
21
26
|
import { claimTo } from "./drops/write/claimTo.js";
|
22
27
|
import { resetClaimEligibility } from "./drops/write/resetClaimEligibility.js";
|
23
28
|
import { setClaimConditions } from "./drops/write/setClaimConditions.js";
|
29
|
+
import { updateMetadata } from "./drops/write/updateMetadata.js";
|
24
30
|
import { getNFT } from "./read/getNFT.js";
|
25
31
|
import { isGetNFTsSupported } from "./read/getNFTs.js";
|
26
32
|
import { lazyMint } from "./write/lazyMint.js";
|
@@ -35,7 +41,7 @@ describe.runIf(process.env.TW_SECRET_KEY)(
|
|
35
41
|
|
36
42
|
beforeAll(async () => {
|
37
43
|
const contractAddress = await deployERC1155Contract({
|
38
|
-
account:
|
44
|
+
account: TEST_ACCOUNT_C,
|
39
45
|
chain: ANVIL_CHAIN,
|
40
46
|
client: TEST_CLIENT,
|
41
47
|
params: {
|
@@ -67,7 +73,7 @@ describe.runIf(process.env.TW_SECRET_KEY)(
|
|
67
73
|
});
|
68
74
|
await sendAndConfirmTransaction({
|
69
75
|
transaction: mintTx,
|
70
|
-
account:
|
76
|
+
account: TEST_ACCOUNT_C,
|
71
77
|
});
|
72
78
|
|
73
79
|
await expect(nextTokenIdToMint({ contract })).resolves.toBe(6n);
|
@@ -87,9 +93,23 @@ describe.runIf(process.env.TW_SECRET_KEY)(
|
|
87
93
|
`);
|
88
94
|
});
|
89
95
|
|
96
|
+
it("should update metadata", async () => {
|
97
|
+
const updateTx = updateMetadata({
|
98
|
+
contract,
|
99
|
+
targetTokenId: 0n,
|
100
|
+
newMetadata: { name: "Test NFT 1" },
|
101
|
+
});
|
102
|
+
await sendAndConfirmTransaction({
|
103
|
+
transaction: updateTx,
|
104
|
+
account: TEST_ACCOUNT_C,
|
105
|
+
});
|
106
|
+
const token0 = await getNFT({ contract, tokenId: 0n });
|
107
|
+
expect(token0.metadata.name).toBe("Test NFT 1");
|
108
|
+
});
|
109
|
+
|
90
110
|
it("should allow to claim tokens", async () => {
|
91
111
|
await expect(
|
92
|
-
balanceOf({ contract, owner:
|
112
|
+
balanceOf({ contract, owner: TEST_ACCOUNT_C.address, tokenId: 0n }),
|
93
113
|
).resolves.toBe(0n);
|
94
114
|
await sendAndConfirmTransaction({
|
95
115
|
transaction: setClaimConditions({
|
@@ -97,26 +117,26 @@ describe.runIf(process.env.TW_SECRET_KEY)(
|
|
97
117
|
phases: [{}],
|
98
118
|
tokenId: 0n,
|
99
119
|
}),
|
100
|
-
account:
|
120
|
+
account: TEST_ACCOUNT_C,
|
101
121
|
});
|
102
122
|
const claimTx = claimTo({
|
103
123
|
contract,
|
104
|
-
to:
|
124
|
+
to: TEST_ACCOUNT_C.address,
|
105
125
|
tokenId: 0n,
|
106
126
|
quantity: 1n,
|
107
127
|
});
|
108
128
|
await sendAndConfirmTransaction({
|
109
129
|
transaction: claimTx,
|
110
|
-
account:
|
130
|
+
account: TEST_ACCOUNT_C,
|
111
131
|
});
|
112
132
|
await expect(
|
113
|
-
balanceOf({ contract, owner:
|
133
|
+
balanceOf({ contract, owner: TEST_ACCOUNT_C.address, tokenId: 0n }),
|
114
134
|
).resolves.toBe(1n);
|
115
135
|
});
|
116
136
|
|
117
137
|
it("should allow to claim tokens with price", async () => {
|
118
138
|
await expect(
|
119
|
-
balanceOf({ contract, owner:
|
139
|
+
balanceOf({ contract, owner: TEST_ACCOUNT_C.address, tokenId: 0n }),
|
120
140
|
).resolves.toBe(1n);
|
121
141
|
await sendAndConfirmTransaction({
|
122
142
|
transaction: setClaimConditions({
|
@@ -128,11 +148,11 @@ describe.runIf(process.env.TW_SECRET_KEY)(
|
|
128
148
|
],
|
129
149
|
tokenId: 0n,
|
130
150
|
}),
|
131
|
-
account:
|
151
|
+
account: TEST_ACCOUNT_C,
|
132
152
|
});
|
133
153
|
const claimTx = claimTo({
|
134
154
|
contract,
|
135
|
-
to:
|
155
|
+
to: TEST_ACCOUNT_C.address,
|
136
156
|
tokenId: 0n,
|
137
157
|
quantity: 1n,
|
138
158
|
});
|
@@ -143,10 +163,10 @@ describe.runIf(process.env.TW_SECRET_KEY)(
|
|
143
163
|
expect(toEther(value)).toBe("0.001");
|
144
164
|
await sendAndConfirmTransaction({
|
145
165
|
transaction: claimTx,
|
146
|
-
account:
|
166
|
+
account: TEST_ACCOUNT_C,
|
147
167
|
});
|
148
168
|
await expect(
|
149
|
-
balanceOf({ contract, owner:
|
169
|
+
balanceOf({ contract, owner: TEST_ACCOUNT_C.address, tokenId: 0n }),
|
150
170
|
).resolves.toBe(2n);
|
151
171
|
});
|
152
172
|
|
@@ -159,7 +179,7 @@ describe.runIf(process.env.TW_SECRET_KEY)(
|
|
159
179
|
phases: [
|
160
180
|
{
|
161
181
|
overrideList: [
|
162
|
-
{ address:
|
182
|
+
{ address: TEST_ACCOUNT_C.address, maxClaimable: "100" },
|
163
183
|
{ address: VITALIK_WALLET, maxClaimable: "100" },
|
164
184
|
],
|
165
185
|
maxClaimablePerWallet: 0n,
|
@@ -167,7 +187,7 @@ describe.runIf(process.env.TW_SECRET_KEY)(
|
|
167
187
|
],
|
168
188
|
tokenId,
|
169
189
|
}),
|
170
|
-
account:
|
190
|
+
account: TEST_ACCOUNT_C,
|
171
191
|
});
|
172
192
|
|
173
193
|
await expect(
|
@@ -175,10 +195,10 @@ describe.runIf(process.env.TW_SECRET_KEY)(
|
|
175
195
|
).resolves.toBe(0n);
|
176
196
|
|
177
197
|
await sendAndConfirmTransaction({
|
178
|
-
account:
|
198
|
+
account: TEST_ACCOUNT_C,
|
179
199
|
transaction: claimTo({
|
180
200
|
contract,
|
181
|
-
from:
|
201
|
+
from: TEST_ACCOUNT_C.address,
|
182
202
|
to: TEST_ACCOUNT_B.address,
|
183
203
|
tokenId,
|
184
204
|
quantity: 1n,
|
@@ -215,7 +235,7 @@ describe.runIf(process.env.TW_SECRET_KEY)(
|
|
215
235
|
phases: [
|
216
236
|
{
|
217
237
|
overrideList: [
|
218
|
-
{ address:
|
238
|
+
{ address: TEST_ACCOUNT_C.address, maxClaimable: "1" },
|
219
239
|
{ address: VITALIK_WALLET, maxClaimable: "3" },
|
220
240
|
],
|
221
241
|
maxClaimablePerWallet: 0n,
|
@@ -223,19 +243,19 @@ describe.runIf(process.env.TW_SECRET_KEY)(
|
|
223
243
|
],
|
224
244
|
tokenId,
|
225
245
|
}),
|
226
|
-
account:
|
246
|
+
account: TEST_ACCOUNT_C,
|
227
247
|
});
|
228
248
|
|
229
249
|
await expect(
|
230
|
-
balanceOf({ contract, owner:
|
250
|
+
balanceOf({ contract, owner: TEST_ACCOUNT_C.address, tokenId }),
|
231
251
|
).resolves.toBe(0n);
|
232
252
|
|
233
253
|
await expect(
|
234
254
|
sendAndConfirmTransaction({
|
235
|
-
account:
|
255
|
+
account: TEST_ACCOUNT_C,
|
236
256
|
transaction: claimTo({
|
237
257
|
contract,
|
238
|
-
to:
|
258
|
+
to: TEST_ACCOUNT_C.address,
|
239
259
|
tokenId,
|
240
260
|
quantity: 2n,
|
241
261
|
}),
|
@@ -248,17 +268,17 @@ describe.runIf(process.env.TW_SECRET_KEY)(
|
|
248
268
|
`);
|
249
269
|
|
250
270
|
await sendAndConfirmTransaction({
|
251
|
-
account:
|
271
|
+
account: TEST_ACCOUNT_C,
|
252
272
|
transaction: claimTo({
|
253
273
|
contract,
|
254
|
-
to:
|
274
|
+
to: TEST_ACCOUNT_C.address,
|
255
275
|
tokenId,
|
256
276
|
quantity: 1n,
|
257
277
|
}),
|
258
278
|
});
|
259
279
|
|
260
280
|
await expect(
|
261
|
-
balanceOf({ contract, owner:
|
281
|
+
balanceOf({ contract, owner: TEST_ACCOUNT_C.address, tokenId }),
|
262
282
|
).resolves.toBe(1n);
|
263
283
|
});
|
264
284
|
});
|
@@ -272,7 +292,7 @@ describe.runIf(process.env.TW_SECRET_KEY)(
|
|
272
292
|
{
|
273
293
|
overrideList: [
|
274
294
|
{
|
275
|
-
address:
|
295
|
+
address: TEST_ACCOUNT_C.address,
|
276
296
|
maxClaimable: "10",
|
277
297
|
price: "0",
|
278
298
|
},
|
@@ -283,25 +303,25 @@ describe.runIf(process.env.TW_SECRET_KEY)(
|
|
283
303
|
],
|
284
304
|
tokenId,
|
285
305
|
}),
|
286
|
-
account:
|
306
|
+
account: TEST_ACCOUNT_C,
|
287
307
|
});
|
288
308
|
|
289
309
|
await expect(
|
290
|
-
balanceOf({ contract, owner:
|
310
|
+
balanceOf({ contract, owner: TEST_ACCOUNT_C.address, tokenId }),
|
291
311
|
).resolves.toBe(0n);
|
292
312
|
|
293
313
|
await sendAndConfirmTransaction({
|
294
|
-
account:
|
314
|
+
account: TEST_ACCOUNT_C,
|
295
315
|
transaction: claimTo({
|
296
316
|
contract,
|
297
|
-
to:
|
317
|
+
to: TEST_ACCOUNT_C.address,
|
298
318
|
tokenId,
|
299
319
|
quantity: 1n,
|
300
320
|
}),
|
301
321
|
});
|
302
322
|
|
303
323
|
await expect(
|
304
|
-
balanceOf({ contract, owner:
|
324
|
+
balanceOf({ contract, owner: TEST_ACCOUNT_C.address, tokenId }),
|
305
325
|
).resolves.toBe(1n);
|
306
326
|
});
|
307
327
|
|
@@ -321,7 +341,7 @@ describe.runIf(process.env.TW_SECRET_KEY)(
|
|
321
341
|
},
|
322
342
|
],
|
323
343
|
}),
|
324
|
-
account:
|
344
|
+
account: TEST_ACCOUNT_C,
|
325
345
|
});
|
326
346
|
|
327
347
|
const phases = await getClaimConditions({ contract, tokenId: 5n });
|
@@ -342,7 +362,7 @@ describe.runIf(process.env.TW_SECRET_KEY)(
|
|
342
362
|
},
|
343
363
|
],
|
344
364
|
}),
|
345
|
-
account:
|
365
|
+
account: TEST_ACCOUNT_C,
|
346
366
|
});
|
347
367
|
// claim one token
|
348
368
|
await sendAndConfirmTransaction({
|
@@ -384,7 +404,7 @@ describe.runIf(process.env.TW_SECRET_KEY)(
|
|
384
404
|
tokenId: 6n,
|
385
405
|
contract,
|
386
406
|
}),
|
387
|
-
account:
|
407
|
+
account: TEST_ACCOUNT_C,
|
388
408
|
});
|
389
409
|
// attempt to claim another token (this should succeed)
|
390
410
|
await sendAndConfirmTransaction({
|
@@ -409,5 +429,115 @@ describe.runIf(process.env.TW_SECRET_KEY)(
|
|
409
429
|
.map((f) => toFunctionSelector(f));
|
410
430
|
expect(isGetNFTsSupported(selectors)).toBe(true);
|
411
431
|
});
|
432
|
+
|
433
|
+
/**
|
434
|
+
* This is to document the behavior where one can claim without paying if the claiming address
|
435
|
+
* is the same as the PrimaryRecipientAddress, because of this Solidity code:
|
436
|
+
* ```solidity
|
437
|
+
* // CurrencyTransferLib.sol
|
438
|
+
* function safeTransferERC20(address _currency, address _from, address _to, uint256 _amount) internal {
|
439
|
+
* if (_from == _to) {
|
440
|
+
* return;
|
441
|
+
* }
|
442
|
+
* ...
|
443
|
+
* }
|
444
|
+
* ```
|
445
|
+
*/
|
446
|
+
it("address that is the same with PrimaryFeeRecipient can claim without paying ERC20", async () => {
|
447
|
+
const tokenAddress = await deployERC20Contract({
|
448
|
+
client: TEST_CLIENT,
|
449
|
+
chain: ANVIL_CHAIN,
|
450
|
+
account: TEST_ACCOUNT_C,
|
451
|
+
type: "TokenERC20",
|
452
|
+
params: {
|
453
|
+
name: "token20",
|
454
|
+
contractURI: TEST_CONTRACT_URI,
|
455
|
+
},
|
456
|
+
});
|
457
|
+
const tokenId = 5n;
|
458
|
+
const setClaimTx = setClaimConditions({
|
459
|
+
contract,
|
460
|
+
tokenId,
|
461
|
+
phases: [
|
462
|
+
{
|
463
|
+
maxClaimableSupply: 100n,
|
464
|
+
maxClaimablePerWallet: 100n,
|
465
|
+
currencyAddress: tokenAddress,
|
466
|
+
price: 1000,
|
467
|
+
startTime: new Date(),
|
468
|
+
},
|
469
|
+
],
|
470
|
+
});
|
471
|
+
await sendAndConfirmTransaction({
|
472
|
+
transaction: setClaimTx,
|
473
|
+
account: TEST_ACCOUNT_C,
|
474
|
+
});
|
475
|
+
|
476
|
+
const transaction = claimTo({
|
477
|
+
contract,
|
478
|
+
tokenId,
|
479
|
+
quantity: 50n,
|
480
|
+
to: TEST_ACCOUNT_C.address,
|
481
|
+
});
|
482
|
+
await sendAndConfirmTransaction({
|
483
|
+
transaction,
|
484
|
+
account: TEST_ACCOUNT_C,
|
485
|
+
});
|
486
|
+
const supplyCount = await totalSupply({ contract, id: tokenId });
|
487
|
+
expect(supplyCount).toBe(50n);
|
488
|
+
});
|
489
|
+
|
490
|
+
it("getActiveClaimCondition should work", async () => {
|
491
|
+
// Create a public allowlist claim phase
|
492
|
+
const snapshot = [
|
493
|
+
{
|
494
|
+
recipient: TEST_ACCOUNT_B.address,
|
495
|
+
tokenId: 4,
|
496
|
+
amount: 5,
|
497
|
+
},
|
498
|
+
{
|
499
|
+
recipient: TEST_ACCOUNT_D.address,
|
500
|
+
tokenId: 4,
|
501
|
+
amount: 5,
|
502
|
+
},
|
503
|
+
];
|
504
|
+
|
505
|
+
const { merkleRoot } = await generateMerkleTreeInfoERC1155({
|
506
|
+
contract,
|
507
|
+
tokenAddress: NATIVE_TOKEN_ADDRESS,
|
508
|
+
snapshot,
|
509
|
+
});
|
510
|
+
|
511
|
+
const startTime = new Date();
|
512
|
+
const setCC = setClaimConditions({
|
513
|
+
contract,
|
514
|
+
tokenId: 4n,
|
515
|
+
phases: [
|
516
|
+
{
|
517
|
+
maxClaimableSupply: 100n,
|
518
|
+
maxClaimablePerWallet: 5n,
|
519
|
+
currencyAddress: NATIVE_TOKEN_ADDRESS,
|
520
|
+
price: 0.006,
|
521
|
+
startTime,
|
522
|
+
merkleRootHash: merkleRoot,
|
523
|
+
},
|
524
|
+
],
|
525
|
+
});
|
526
|
+
|
527
|
+
await sendAndConfirmTransaction({
|
528
|
+
transaction: setCC,
|
529
|
+
account: TEST_ACCOUNT_C,
|
530
|
+
});
|
531
|
+
|
532
|
+
const activeCC = await getActiveClaimCondition({ contract, tokenId: 4n });
|
533
|
+
expect(activeCC.currency.toLowerCase()).toBe(
|
534
|
+
NATIVE_TOKEN_ADDRESS.toLowerCase(),
|
535
|
+
);
|
536
|
+
expect(activeCC.merkleRoot).toBe(
|
537
|
+
"0x5baa4423af7125448ad7ca6913cdee7dd952a8d10a44f4fad4c50eea65c5c92d",
|
538
|
+
);
|
539
|
+
expect(activeCC.pricePerToken).toBe(6000000000000000n);
|
540
|
+
expect(activeCC.quantityLimitPerWallet).toBe(5n);
|
541
|
+
});
|
412
542
|
},
|
413
543
|
);
|