thirdweb 5.53.0-nightly-9d84aff26615b6a553ac002e7f51a0ed5172eb5d-20240909000344 → 5.53.1-nightly-865c5e3b16af70c3660f30ba8cffc5d6e360a389-20240911000352
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/chains/chain-definitions/assetchain-testnet.js +25 -0
- package/dist/cjs/chains/chain-definitions/assetchain-testnet.js.map +1 -0
- package/dist/cjs/contract/deployment/utils/bootstrap.js +1 -1
- package/dist/cjs/contract/deployment/utils/bootstrap.js.map +1 -1
- package/dist/cjs/exports/contract.js +4 -1
- package/dist/cjs/exports/contract.js.map +1 -1
- package/dist/cjs/exports/deploys.js +2 -1
- package/dist/cjs/exports/deploys.js.map +1 -1
- package/dist/cjs/exports/extensions/erc721.js +4 -2
- package/dist/cjs/exports/extensions/erc721.js.map +1 -1
- package/dist/cjs/exports/react.native.js +4 -1
- package/dist/cjs/exports/react.native.js.map +1 -1
- package/dist/cjs/extensions/erc721/lazyMinting/read/getBatchesToReveal.js +14 -16
- package/dist/cjs/extensions/erc721/lazyMinting/read/getBatchesToReveal.js.map +1 -1
- package/dist/cjs/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.js +19 -0
- package/dist/cjs/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.js.map +1 -1
- package/dist/cjs/extensions/erc721/lazyMinting/write/reveal.js +3 -20
- package/dist/cjs/extensions/erc721/lazyMinting/write/reveal.js.map +1 -1
- package/dist/cjs/extensions/prebuilts/deploy-published.js +30 -14
- package/dist/cjs/extensions/prebuilts/deploy-published.js.map +1 -1
- package/dist/cjs/react/core/hooks/others/useProfiles.js +1 -1
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js +4 -2
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/core/utils/walletIcon.js +5 -1
- package/dist/cjs/react/core/utils/walletIcon.js.map +1 -1
- package/dist/cjs/react/native/ui/components/WalletImage.js +2 -0
- package/dist/cjs/react/native/ui/components/WalletImage.js.map +1 -1
- package/dist/cjs/react/native/ui/connect/InAppWalletUI.js +1 -0
- package/dist/cjs/react/native/ui/connect/InAppWalletUI.js.map +1 -1
- package/dist/cjs/react/native/ui/icons/svgs.js +2 -1
- package/dist/cjs/react/native/ui/icons/svgs.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +1 -0
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/oauthSignIn.js +1 -0
- package/dist/cjs/react/web/wallets/shared/oauthSignIn.js.map +1 -1
- package/dist/cjs/social/profiles.js.map +1 -1
- package/dist/cjs/utils/any-evm/compute-published-contract-address.js +0 -4
- package/dist/cjs/utils/any-evm/compute-published-contract-address.js.map +1 -1
- package/dist/cjs/utils/any-evm/compute-published-contract-deploy-info.js +2 -3
- package/dist/cjs/utils/any-evm/compute-published-contract-deploy-info.js.map +1 -1
- package/dist/cjs/utils/any-evm/deploy-metadata.js +0 -19
- package/dist/cjs/utils/any-evm/deploy-metadata.js.map +1 -1
- package/dist/cjs/utils/bytecode/resolveImplementation.js +17 -10
- package/dist/cjs/utils/bytecode/resolveImplementation.js.map +1 -1
- package/dist/cjs/utils/domains.js +1 -1
- package/dist/cjs/utils/domains.js.map +1 -1
- package/dist/cjs/utils/ipfs.js +2 -0
- package/dist/cjs/utils/ipfs.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wallets/coinbase/coinbaseMobileSDK.js +52 -24
- package/dist/cjs/wallets/coinbase/coinbaseMobileSDK.js.map +1 -1
- package/dist/cjs/wallets/coinbase/coinbaseWebSDK.js.map +1 -1
- package/dist/cjs/wallets/coinbase/utils.js +1 -1
- package/dist/cjs/wallets/coinbase/utils.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/types.js +1 -0
- package/dist/cjs/wallets/in-app/core/authentication/types.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/native-connector.js +2 -0
- package/dist/cjs/wallets/in-app/native/native-connector.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/in-app.js +2 -0
- package/dist/cjs/wallets/in-app/web/in-app.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/web-connector.js +2 -0
- package/dist/cjs/wallets/in-app/web/lib/web-connector.js.map +1 -1
- package/dist/cjs/wallets/types.js +1 -0
- package/dist/cjs/wallets/types.js.map +1 -1
- package/dist/esm/chains/chain-definitions/assetchain-testnet.js +22 -0
- package/dist/esm/chains/chain-definitions/assetchain-testnet.js.map +1 -0
- package/dist/esm/contract/deployment/utils/bootstrap.js +1 -1
- package/dist/esm/contract/deployment/utils/bootstrap.js.map +1 -1
- package/dist/esm/exports/contract.js +2 -0
- package/dist/esm/exports/contract.js.map +1 -1
- package/dist/esm/exports/deploys.js +1 -1
- package/dist/esm/exports/deploys.js.map +1 -1
- package/dist/esm/exports/extensions/erc721.js +3 -3
- package/dist/esm/exports/extensions/erc721.js.map +1 -1
- package/dist/esm/exports/react.native.js +2 -0
- package/dist/esm/exports/react.native.js.map +1 -1
- package/dist/esm/exports/social.js +0 -1
- package/dist/esm/exports/social.js.map +1 -1
- package/dist/esm/extensions/erc721/lazyMinting/read/getBatchesToReveal.js +13 -15
- package/dist/esm/extensions/erc721/lazyMinting/read/getBatchesToReveal.js.map +1 -1
- package/dist/esm/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.js +21 -3
- package/dist/esm/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.js.map +1 -1
- package/dist/esm/extensions/erc721/lazyMinting/write/reveal.js +1 -20
- package/dist/esm/extensions/erc721/lazyMinting/write/reveal.js.map +1 -1
- package/dist/esm/extensions/prebuilts/deploy-published.js +29 -14
- package/dist/esm/extensions/prebuilts/deploy-published.js.map +1 -1
- package/dist/esm/react/core/hooks/others/useProfiles.js +1 -1
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js +4 -2
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/core/utils/walletIcon.js +4 -0
- package/dist/esm/react/core/utils/walletIcon.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/native/ui/connect/InAppWalletUI.js +2 -1
- package/dist/esm/react/native/ui/connect/InAppWalletUI.js.map +1 -1
- package/dist/esm/react/native/ui/icons/svgs.js +1 -0
- package/dist/esm/react/native/ui/icons/svgs.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +1 -0
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/oauthSignIn.js +1 -0
- package/dist/esm/react/web/wallets/shared/oauthSignIn.js.map +1 -1
- package/dist/esm/social/profiles.js.map +1 -1
- package/dist/esm/utils/any-evm/compute-published-contract-address.js +0 -4
- package/dist/esm/utils/any-evm/compute-published-contract-address.js.map +1 -1
- package/dist/esm/utils/any-evm/compute-published-contract-deploy-info.js +2 -3
- package/dist/esm/utils/any-evm/compute-published-contract-deploy-info.js.map +1 -1
- package/dist/esm/utils/any-evm/deploy-metadata.js +0 -19
- package/dist/esm/utils/any-evm/deploy-metadata.js.map +1 -1
- package/dist/esm/utils/bytecode/resolveImplementation.js +17 -10
- package/dist/esm/utils/bytecode/resolveImplementation.js.map +1 -1
- package/dist/esm/utils/domains.js +1 -1
- package/dist/esm/utils/domains.js.map +1 -1
- package/dist/esm/utils/ipfs.js +2 -0
- package/dist/esm/utils/ipfs.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/wallets/coinbase/coinbaseMobileSDK.js +50 -22
- package/dist/esm/wallets/coinbase/coinbaseMobileSDK.js.map +1 -1
- package/dist/esm/wallets/coinbase/coinbaseWebSDK.js.map +1 -1
- package/dist/esm/wallets/coinbase/utils.js +1 -1
- package/dist/esm/wallets/coinbase/utils.js.map +1 -1
- package/dist/esm/wallets/in-app/core/authentication/types.js +1 -0
- package/dist/esm/wallets/in-app/core/authentication/types.js.map +1 -1
- package/dist/esm/wallets/in-app/native/native-connector.js +2 -0
- package/dist/esm/wallets/in-app/native/native-connector.js.map +1 -1
- package/dist/esm/wallets/in-app/web/in-app.js +2 -0
- package/dist/esm/wallets/in-app/web/in-app.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/web-connector.js +2 -0
- package/dist/esm/wallets/in-app/web/lib/web-connector.js.map +1 -1
- package/dist/esm/wallets/types.js +1 -0
- package/dist/esm/wallets/types.js.map +1 -1
- package/dist/types/chains/chain-definitions/assetchain-testnet.d.ts +7 -0
- package/dist/types/chains/chain-definitions/assetchain-testnet.d.ts.map +1 -0
- package/dist/types/contract/actions/compiler-metadata.d.ts +2 -2
- package/dist/types/contract/actions/compiler-metadata.d.ts.map +1 -1
- package/dist/types/contract/actions/get-compiler-metadata.d.ts +1 -1
- package/dist/types/contract/actions/get-compiler-metadata.d.ts.map +1 -1
- package/dist/types/contract/verification/source-files.d.ts +2 -2
- package/dist/types/contract/verification/source-files.d.ts.map +1 -1
- package/dist/types/exports/contract.d.ts +1 -0
- package/dist/types/exports/contract.d.ts.map +1 -1
- package/dist/types/exports/deploys.d.ts +1 -1
- package/dist/types/exports/deploys.d.ts.map +1 -1
- package/dist/types/exports/extensions/erc721.d.ts +3 -3
- package/dist/types/exports/extensions/erc721.d.ts.map +1 -1
- package/dist/types/exports/react.d.ts +1 -0
- package/dist/types/exports/react.d.ts.map +1 -1
- package/dist/types/exports/react.native.d.ts +2 -0
- package/dist/types/exports/react.native.d.ts.map +1 -1
- package/dist/types/exports/social.d.ts +1 -1
- package/dist/types/exports/social.d.ts.map +1 -1
- package/dist/types/extensions/erc721/lazyMinting/read/getBatchesToReveal.d.ts +1 -1
- package/dist/types/extensions/erc721/lazyMinting/read/getBatchesToReveal.d.ts.map +1 -1
- package/dist/types/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.d.ts +12 -0
- package/dist/types/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.d.ts.map +1 -1
- package/dist/types/extensions/erc721/lazyMinting/write/reveal.d.ts +1 -0
- package/dist/types/extensions/erc721/lazyMinting/write/reveal.d.ts.map +1 -1
- package/dist/types/extensions/prebuilts/deploy-published.d.ts +16 -0
- package/dist/types/extensions/prebuilts/deploy-published.d.ts.map +1 -1
- package/dist/types/react/core/hooks/others/useProfiles.d.ts +1 -1
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/core/social/useSocialProfiles.d.ts +1 -1
- package/dist/types/react/core/social/useSocialProfiles.d.ts.map +1 -1
- package/dist/types/react/core/utils/storage.d.ts +1 -1
- package/dist/types/react/core/utils/storage.d.ts.map +1 -1
- package/dist/types/react/core/utils/wallet.d.ts +1 -1
- package/dist/types/react/core/utils/walletIcon.d.ts +3 -1
- package/dist/types/react/core/utils/walletIcon.d.ts.map +1 -1
- package/dist/types/react/native/ui/components/WalletImage.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/InAppWalletUI.d.ts.map +1 -1
- package/dist/types/react/native/ui/icons/svgs.d.ts +1 -0
- package/dist/types/react/native/ui/icons/svgs.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/oauthSignIn.d.ts.map +1 -1
- package/dist/types/social/profiles.d.ts +2 -2
- package/dist/types/social/profiles.d.ts.map +1 -1
- package/dist/types/social/types.d.ts +2 -2
- package/dist/types/social/types.d.ts.map +1 -1
- package/dist/types/utils/any-evm/compute-published-contract-address.d.ts +0 -4
- package/dist/types/utils/any-evm/compute-published-contract-address.d.ts.map +1 -1
- package/dist/types/utils/any-evm/compute-published-contract-deploy-info.d.ts.map +1 -1
- package/dist/types/utils/any-evm/deploy-metadata.d.ts +3 -6
- package/dist/types/utils/any-evm/deploy-metadata.d.ts.map +1 -1
- package/dist/types/utils/ipfs.d.ts +1 -1
- package/dist/types/utils/ipfs.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/wallets/coinbase/coinbaseMobileSDK.d.ts +2 -3
- package/dist/types/wallets/coinbase/coinbaseMobileSDK.d.ts.map +1 -1
- package/dist/types/wallets/coinbase/coinbaseWebSDK.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/types.d.ts +1 -0
- package/dist/types/wallets/in-app/core/authentication/types.d.ts.map +1 -1
- package/dist/types/wallets/in-app/native/native-connector.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/in-app.d.ts +2 -0
- package/dist/types/wallets/in-app/web/in-app.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/web-connector.d.ts.map +1 -1
- package/dist/types/wallets/types.d.ts +2 -2
- package/dist/types/wallets/types.d.ts.map +1 -1
- package/package.json +15 -2
- package/src/chains/chain-definitions/assetchain-testnet.ts +22 -0
- package/src/contract/actions/compiler-metadata.ts +2 -2
- package/src/contract/deployment/publisher.test.ts +2 -2
- package/src/contract/deployment/utils/bootstrap.ts +1 -1
- package/src/contract/verification/source-files.ts +2 -2
- package/src/event/actions/get-events.test.ts +13 -0
- package/src/exports/contract.ts +6 -0
- package/src/exports/deploys.ts +2 -0
- package/src/exports/extensions/erc721.ts +3 -1
- package/src/exports/react.native.ts +9 -0
- package/src/exports/react.ts +6 -0
- package/src/exports/social.ts +6 -1
- package/src/extensions/erc721/lazyMinting/read/getBatchesToReveal.ts +15 -15
- package/src/extensions/erc721/lazyMinting/write/createAndReveal.test.ts +84 -0
- package/src/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.ts +33 -3
- package/src/extensions/erc721/lazyMinting/write/reveal.test.ts +1 -45
- package/src/extensions/erc721/lazyMinting/write/reveal.ts +2 -23
- package/src/extensions/modules/ClaimableERC1155/claimableERC1155.test.ts +1 -1
- package/src/extensions/modules/ClaimableERC20/claimableERC20.test.ts +1 -1
- package/src/extensions/modules/ClaimableERC721/claimableERC721.test.ts +1 -1
- package/src/extensions/modules/OpenEditionMetadataERC721/openEditionERC721.test.ts +1 -1
- package/src/extensions/prebuilts/deploy-modular-core.test.ts +1 -1
- package/src/extensions/prebuilts/deploy-published.ts +61 -22
- package/src/react/core/hooks/others/useProfiles.ts +1 -1
- package/src/react/core/hooks/transaction/useSendTransaction.ts +4 -2
- package/src/react/core/utils/walletIcon.ts +5 -0
- package/src/react/native/ui/components/WalletImage.tsx +3 -0
- package/src/react/native/ui/connect/InAppWalletUI.tsx +2 -0
- package/src/react/native/ui/icons/svgs.ts +2 -0
- package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +1 -0
- package/src/react/web/wallets/shared/oauthSignIn.ts +1 -0
- package/src/social/profiles.ts +3 -3
- package/src/social/types.ts +2 -2
- package/src/utils/any-evm/compute-published-contract-address.ts +0 -4
- package/src/utils/any-evm/compute-published-contract-deploy-info.ts +2 -3
- package/src/utils/any-evm/deploy-metadata.ts +9 -34
- package/src/utils/bytecode/resolveImplementation.test.ts +9 -0
- package/src/utils/bytecode/resolveImplementation.ts +21 -13
- package/src/utils/domains.ts +1 -1
- package/src/utils/ipfs.ts +3 -1
- package/src/version.ts +1 -1
- package/src/wallets/coinbase/coinbaseMobileSDK.ts +66 -35
- package/src/wallets/coinbase/coinbaseWebSDK.ts +0 -1
- package/src/wallets/coinbase/utils.ts +1 -1
- package/src/wallets/in-app/core/authentication/types.ts +1 -0
- package/src/wallets/in-app/native/native-connector.ts +2 -0
- package/src/wallets/in-app/web/in-app.ts +2 -0
- package/src/wallets/in-app/web/lib/web-connector.ts +2 -0
- package/src/wallets/types.ts +1 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "thirdweb",
|
3
|
-
"version": "5.53.
|
3
|
+
"version": "5.53.1-nightly-865c5e3b16af70c3660f30ba8cffc5d6e360a389-20240911000352",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "git+https://github.com/thirdweb-dev/js.git#main"
|
@@ -118,6 +118,11 @@
|
|
118
118
|
"import": "./dist/esm/exports/modules.js",
|
119
119
|
"default": "./dist/cjs/exports/modules.js"
|
120
120
|
},
|
121
|
+
"./social": {
|
122
|
+
"types": "./dist/types/exports/social.d.ts",
|
123
|
+
"import": "./dist/esm/exports/social.js",
|
124
|
+
"default": "./dist/cjs/exports/social.js"
|
125
|
+
},
|
121
126
|
"./package.json": "./package.json"
|
122
127
|
},
|
123
128
|
"typesVersions": {
|
@@ -172,6 +177,9 @@
|
|
172
177
|
],
|
173
178
|
"modules": [
|
174
179
|
"./dist/types/exports/modules.d.ts"
|
180
|
+
],
|
181
|
+
"social": [
|
182
|
+
"./dist/types/exports/social.d.ts"
|
175
183
|
]
|
176
184
|
}
|
177
185
|
},
|
@@ -203,7 +211,7 @@
|
|
203
211
|
"@radix-ui/react-icons": "1.3.0",
|
204
212
|
"@radix-ui/react-tooltip": "1.1.2",
|
205
213
|
"@tanstack/react-query": "5.54.1",
|
206
|
-
"@walletconnect/ethereum-provider": "2.
|
214
|
+
"@walletconnect/ethereum-provider": "2.16.1",
|
207
215
|
"@walletconnect/sign-client": "^2.13.3",
|
208
216
|
"abitype": "1.0.5",
|
209
217
|
"fast-text-encoding": "^1.0.6",
|
@@ -218,6 +226,7 @@
|
|
218
226
|
"@aws-sdk/client-lambda": "^3",
|
219
227
|
"@aws-sdk/credential-providers": "^3",
|
220
228
|
"@coinbase/wallet-mobile-sdk": "^1",
|
229
|
+
"@mobile-wallet-protocol/client": "^0.0.2",
|
221
230
|
"@react-native-async-storage/async-storage": "^1",
|
222
231
|
"@react-native-clipboard/clipboard": "*",
|
223
232
|
"amazon-cognito-identity-js": "^6",
|
@@ -283,6 +292,9 @@
|
|
283
292
|
},
|
284
293
|
"@coinbase/wallet-mobile-sdk": {
|
285
294
|
"optional": true
|
295
|
+
},
|
296
|
+
"@mobile-wallet-protocol/client": {
|
297
|
+
"optional": true
|
286
298
|
}
|
287
299
|
},
|
288
300
|
"engines": {
|
@@ -294,6 +306,7 @@
|
|
294
306
|
"@chromatic-com/storybook": "^1.5.0",
|
295
307
|
"@codspeed/vitest-plugin": "3.1.1",
|
296
308
|
"@coinbase/wallet-mobile-sdk": "1.0.13",
|
309
|
+
"@mobile-wallet-protocol/client": "0.0.2",
|
297
310
|
"@react-native-async-storage/async-storage": "^1.23.1",
|
298
311
|
"@react-native-clipboard/clipboard": "1.14.1",
|
299
312
|
"@storybook/addon-essentials": "^8.2.9",
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { defineChain } from "../utils.js";
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @chain
|
5
|
+
*/
|
6
|
+
export const assetChainTestnet = /* @__PURE__ */ defineChain({
|
7
|
+
id: 42421,
|
8
|
+
name: "AssetChain Testnet",
|
9
|
+
nativeCurrency: {
|
10
|
+
name: "Real World Asset",
|
11
|
+
symbol: "RWA",
|
12
|
+
decimals: 18,
|
13
|
+
},
|
14
|
+
blockExplorers: [
|
15
|
+
{
|
16
|
+
name: "Asset Chain Testnet Explorer",
|
17
|
+
url: "https://scan-testnet.assetchain.org",
|
18
|
+
apiUrl: "https://scan-testnet.assetchain.org/api",
|
19
|
+
},
|
20
|
+
],
|
21
|
+
testnet: true,
|
22
|
+
});
|
@@ -3,7 +3,7 @@ import type { Abi } from "abitype";
|
|
3
3
|
/**
|
4
4
|
* @contract
|
5
5
|
*/
|
6
|
-
export type
|
6
|
+
export type CompilerMetadata = {
|
7
7
|
name: string;
|
8
8
|
abi: Abi;
|
9
9
|
// biome-ignore lint/suspicious/noExplicitAny: TODO: fix later by updating this type to match the specs here: https://docs.soliditylang.org/en/latest/metadata.html
|
@@ -27,7 +27,7 @@ export type PublishedMetadata = {
|
|
27
27
|
* @internal
|
28
28
|
*/
|
29
29
|
// biome-ignore lint/suspicious/noExplicitAny: TODO: fix later
|
30
|
-
export function formatCompilerMetadata(metadata: any):
|
30
|
+
export function formatCompilerMetadata(metadata: any): CompilerMetadata {
|
31
31
|
const compilationTarget = metadata.settings.compilationTarget;
|
32
32
|
const targets = Object.keys(compilationTarget);
|
33
33
|
const name = compilationTarget[targets[0] as keyof typeof compilationTarget];
|
@@ -15,7 +15,7 @@ describe.runIf(process.env.TW_SECRET_KEY)("fetchPublishedContract", () => {
|
|
15
15
|
client: TEST_CLIENT,
|
16
16
|
});
|
17
17
|
|
18
|
-
expect(result
|
18
|
+
expect(result?.version).toEqual("1.0.2");
|
19
19
|
});
|
20
20
|
|
21
21
|
it("fetches a specific version when specified", async () => {
|
@@ -26,7 +26,7 @@ describe.runIf(process.env.TW_SECRET_KEY)("fetchPublishedContract", () => {
|
|
26
26
|
version: "1.0.1",
|
27
27
|
});
|
28
28
|
|
29
|
-
expect(result
|
29
|
+
expect(result?.version).toEqual("1.0.1");
|
30
30
|
});
|
31
31
|
|
32
32
|
it("throws an error when an invalid version is specified", async () => {
|
@@ -46,7 +46,7 @@ export async function getOrDeployInfraForPublishedContract(
|
|
46
46
|
client,
|
47
47
|
account,
|
48
48
|
});
|
49
|
-
const
|
49
|
+
const compilerMetadata = await fetchPublishedContractMetadata({
|
50
50
|
client,
|
51
51
|
contractId: `${contractId}_ZkSync`, // different contract id for zkSync
|
52
52
|
publisher,
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import type { ThirdwebClient } from "../../client/client.js";
|
2
2
|
import { download } from "../../storage/download.js";
|
3
|
-
import type {
|
3
|
+
import type { CompilerMetadata } from "../actions/compiler-metadata.js";
|
4
4
|
|
5
5
|
type FetchSourceFilesFromMetadataOptions = {
|
6
6
|
client: ThirdwebClient;
|
7
|
-
publishedMetadata:
|
7
|
+
publishedMetadata: CompilerMetadata;
|
8
8
|
};
|
9
9
|
|
10
10
|
type ContractSource = {
|
@@ -129,4 +129,17 @@ describe.runIf(process.env.TW_SECRET_KEY)("getEvents", () => {
|
|
129
129
|
});
|
130
130
|
expect(events.length).toBe(38);
|
131
131
|
});
|
132
|
+
|
133
|
+
it("should get individual events with filters", async () => {
|
134
|
+
const events = await getContractEvents({
|
135
|
+
contract: DOODLES_CONTRACT,
|
136
|
+
fromBlock: FORK_BLOCK_NUMBER - 1000n,
|
137
|
+
events: [
|
138
|
+
transferEvent({
|
139
|
+
from: "0xB81965DdFdDA3923f292a47A1be83ba3A36B5133",
|
140
|
+
}),
|
141
|
+
],
|
142
|
+
});
|
143
|
+
expect(events.length).toBe(2);
|
144
|
+
});
|
132
145
|
});
|
package/src/exports/contract.ts
CHANGED
@@ -28,6 +28,12 @@ export {
|
|
28
28
|
fetchDeployBytecodeFromPublishedContractMetadata,
|
29
29
|
} from "../contract/deployment/publisher.js";
|
30
30
|
|
31
|
+
// contract metadata
|
32
|
+
export {
|
33
|
+
fetchDeployMetadata,
|
34
|
+
type FetchDeployMetadataResult,
|
35
|
+
} from "../utils/any-evm/deploy-metadata.js";
|
36
|
+
|
31
37
|
// deployment - TODO: these end up looking more like extensions -> should they be?
|
32
38
|
export {
|
33
39
|
prepareDirectDeployTransaction,
|
package/src/exports/deploys.ts
CHANGED
@@ -22,6 +22,8 @@ export {
|
|
22
22
|
export {
|
23
23
|
deployPublishedContract,
|
24
24
|
type DeployPublishedContractOptions,
|
25
|
+
deployContractfromDeployMetadata,
|
26
|
+
type DeployContractfromDeployMetadataOptions,
|
25
27
|
} from "../extensions/prebuilts/deploy-published.js";
|
26
28
|
|
27
29
|
export { prepareDirectDeployTransaction } from "../contract/deployment/deploy-with-abi.js";
|
@@ -191,15 +191,17 @@ export {
|
|
191
191
|
export {
|
192
192
|
type CreateDelayedRevealBatchParams,
|
193
193
|
createDelayedRevealBatch,
|
194
|
+
isCreateDelayedRevealBatchSupported,
|
194
195
|
} from "../../extensions/erc721/lazyMinting/write/createDelayedRevealBatch.js";
|
195
196
|
export {
|
196
197
|
type RevealParams,
|
197
198
|
reveal,
|
199
|
+
isRevealSupported,
|
198
200
|
} from "../../extensions/erc721/lazyMinting/write/reveal.js";
|
199
201
|
export {
|
200
202
|
type BatchToReveal,
|
201
203
|
getBatchesToReveal,
|
202
|
-
|
204
|
+
isGetBatchesToRevealSupported,
|
203
205
|
} from "../../extensions/erc721/lazyMinting/read/getBatchesToReveal.js";
|
204
206
|
export {
|
205
207
|
updateMetadata,
|
@@ -101,3 +101,12 @@ export { ConnectEmbed } from "../react/native/ui/connect/ConnectModal.js";
|
|
101
101
|
export { useWalletInfo, useWalletImage } from "../react/core/utils/wallet.js";
|
102
102
|
|
103
103
|
export { useConnectionManager } from "../react/core/providers/connection-manager.js";
|
104
|
+
|
105
|
+
// Social
|
106
|
+
export { useSocialProfiles } from "../react/core/social/useSocialProfiles.js";
|
107
|
+
export type {
|
108
|
+
SocialProfile,
|
109
|
+
EnsProfile,
|
110
|
+
FarcasterProfile,
|
111
|
+
LensProfile,
|
112
|
+
} from "../social/types.js";
|
package/src/exports/react.ts
CHANGED
@@ -187,3 +187,9 @@ export { useSiweAuth } from "../react/core/hooks/auth/useSiweAuth.js";
|
|
187
187
|
|
188
188
|
// Social
|
189
189
|
export { useSocialProfiles } from "../react/core/social/useSocialProfiles.js";
|
190
|
+
export type {
|
191
|
+
SocialProfile,
|
192
|
+
EnsProfile,
|
193
|
+
FarcasterProfile,
|
194
|
+
LensProfile,
|
195
|
+
} from "../social/types.js";
|
package/src/exports/social.ts
CHANGED
@@ -49,23 +49,23 @@ export async function getBatchesToReveal(
|
|
49
49
|
const countRangeArray = Array.from(Array(Number(count)).keys());
|
50
50
|
const uriIndices = await Promise.all(
|
51
51
|
countRangeArray.map(async (batchId) => {
|
52
|
-
|
53
|
-
|
52
|
+
const promiseAll = await Promise.allSettled([
|
53
|
+
GetBatchIdAtIndex.getBatchIdAtIndex({
|
54
54
|
contract: options.contract,
|
55
55
|
index: BigInt(batchId),
|
56
|
-
})
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
}
|
56
|
+
}),
|
57
|
+
BaseURIIndicies.baseURIIndices({
|
58
|
+
contract: options.contract,
|
59
|
+
index: BigInt(batchId),
|
60
|
+
}),
|
61
|
+
]);
|
62
|
+
const result = promiseAll.find((result) => result.status === "fulfilled");
|
63
|
+
if (!result) {
|
64
|
+
throw new Error(
|
65
|
+
"Contract does not have `getBatchIdAtIndex` or `baseURIIndices`, which are required for `getBatchesToReveal`",
|
66
|
+
);
|
68
67
|
}
|
68
|
+
return result.value;
|
69
69
|
}),
|
70
70
|
);
|
71
71
|
|
@@ -131,7 +131,7 @@ export async function getBatchesToReveal(
|
|
131
131
|
* const supported = isGetBatchesToRevealSupported(["0x..."]);
|
132
132
|
* ```
|
133
133
|
*/
|
134
|
-
export function
|
134
|
+
export function isGetBatchesToRevealSupported(availableSelectors: string[]) {
|
135
135
|
return [
|
136
136
|
GetBaseURICount.isGetBaseURICountSupported(availableSelectors),
|
137
137
|
GetBatchIdAtIndex.isGetBatchIdAtIndexSupported(availableSelectors),
|
@@ -0,0 +1,84 @@
|
|
1
|
+
import { beforeAll, describe, it } from "vitest";
|
2
|
+
import { expect } from "vitest";
|
3
|
+
import { ANVIL_CHAIN } from "../../../../../test/src/chains.js";
|
4
|
+
import { TEST_CLIENT } from "../../../../../test/src/test-clients.js";
|
5
|
+
import { TEST_ACCOUNT_A } from "../../../../../test/src/test-wallets.js";
|
6
|
+
import {
|
7
|
+
type ThirdwebContract,
|
8
|
+
getContract,
|
9
|
+
} from "../../../../contract/contract.js";
|
10
|
+
import { sendAndConfirmTransaction } from "../../../../transaction/actions/send-and-confirm-transaction.js";
|
11
|
+
import { deployERC721Contract } from "../../../prebuilts/deploy-erc721.js";
|
12
|
+
import { getNFT } from "../../read/getNFT.js";
|
13
|
+
import { createDelayedRevealBatch } from "./createDelayedRevealBatch.js";
|
14
|
+
import { reveal } from "./reveal.js";
|
15
|
+
|
16
|
+
const placeholderNFT = {
|
17
|
+
name: "Hidden NFT",
|
18
|
+
description: "Will be revealed next week!",
|
19
|
+
};
|
20
|
+
|
21
|
+
const realNFTs = [
|
22
|
+
{
|
23
|
+
name: "Common NFT #1",
|
24
|
+
description: "Common NFT, one of many.",
|
25
|
+
},
|
26
|
+
{
|
27
|
+
name: "Super Rare NFT #2",
|
28
|
+
description: "You got a Super Rare NFT!",
|
29
|
+
},
|
30
|
+
];
|
31
|
+
|
32
|
+
describe("createAndReveal", () => {
|
33
|
+
let contract: ThirdwebContract;
|
34
|
+
beforeAll(async () => {
|
35
|
+
const address = await deployERC721Contract({
|
36
|
+
client: TEST_CLIENT,
|
37
|
+
chain: ANVIL_CHAIN,
|
38
|
+
account: TEST_ACCOUNT_A,
|
39
|
+
type: "DropERC721",
|
40
|
+
params: {
|
41
|
+
name: "Test NFT",
|
42
|
+
description: "Test NFT Description",
|
43
|
+
contractURI: "",
|
44
|
+
},
|
45
|
+
});
|
46
|
+
contract = getContract({
|
47
|
+
chain: ANVIL_CHAIN,
|
48
|
+
address,
|
49
|
+
client: TEST_CLIENT,
|
50
|
+
});
|
51
|
+
});
|
52
|
+
|
53
|
+
it("should create and reveal a batch", async () => {
|
54
|
+
const tx = createDelayedRevealBatch({
|
55
|
+
contract,
|
56
|
+
metadata: realNFTs,
|
57
|
+
password: "password",
|
58
|
+
placeholderMetadata: placeholderNFT,
|
59
|
+
});
|
60
|
+
await sendAndConfirmTransaction({
|
61
|
+
transaction: tx,
|
62
|
+
account: TEST_ACCOUNT_A,
|
63
|
+
});
|
64
|
+
const nft = await getNFT({
|
65
|
+
contract,
|
66
|
+
tokenId: 0n,
|
67
|
+
});
|
68
|
+
expect(nft.metadata.name).toBe(placeholderNFT.name);
|
69
|
+
const revealTx = reveal({
|
70
|
+
contract,
|
71
|
+
batchId: 0n,
|
72
|
+
password: "password",
|
73
|
+
});
|
74
|
+
await sendAndConfirmTransaction({
|
75
|
+
transaction: revealTx,
|
76
|
+
account: TEST_ACCOUNT_A,
|
77
|
+
});
|
78
|
+
const nftAfterReveal = await getNFT({
|
79
|
+
contract,
|
80
|
+
tokenId: 0n,
|
81
|
+
});
|
82
|
+
expect(nftAfterReveal.metadata.name).toBe(realNFTs[0]?.name);
|
83
|
+
});
|
84
|
+
});
|
@@ -6,9 +6,18 @@ import { toHex } from "../../../../utils/encoding/hex.js";
|
|
6
6
|
import { keccak256 } from "../../../../utils/hashing/keccak256.js";
|
7
7
|
import { getBaseUriFromBatch } from "../../../../utils/ipfs.js";
|
8
8
|
import type { NFTInput } from "../../../../utils/nft/parseNft.js";
|
9
|
-
import {
|
10
|
-
|
11
|
-
|
9
|
+
import {
|
10
|
+
getBaseURICount,
|
11
|
+
isGetBaseURICountSupported,
|
12
|
+
} from "../../__generated__/IBatchMintMetadata/read/getBaseURICount.js";
|
13
|
+
import {
|
14
|
+
encryptDecrypt,
|
15
|
+
isEncryptDecryptSupported,
|
16
|
+
} from "../../__generated__/IDelayedReveal/read/encryptDecrypt.js";
|
17
|
+
import {
|
18
|
+
lazyMint as generatedLazyMint,
|
19
|
+
isLazyMintSupported,
|
20
|
+
} from "../../__generated__/ILazyMint/write/lazyMint.js";
|
12
21
|
import { hashDelayedRevealPassword } from "../helpers/hashDelayedRevealBatch.js";
|
13
22
|
|
14
23
|
/**
|
@@ -123,3 +132,24 @@ export function createDelayedRevealBatch(
|
|
123
132
|
},
|
124
133
|
});
|
125
134
|
}
|
135
|
+
|
136
|
+
/**
|
137
|
+
* Checks if the `createDelayedRevealBatch` method is supported by the given contract.
|
138
|
+
* @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.
|
139
|
+
* @returns A boolean indicating if the `createDelayedRevealBatch` method is supported.
|
140
|
+
* @extension ERC721
|
141
|
+
* @example
|
142
|
+
* ```ts
|
143
|
+
* import { isCreateDelayedRevealBatchSupported } from "thirdweb/extensions/erc721";
|
144
|
+
* const supported = isCreateDelayedRevealBatchSupported(["0x..."]);
|
145
|
+
* ```
|
146
|
+
*/
|
147
|
+
export function isCreateDelayedRevealBatchSupported(
|
148
|
+
availableSelectors: string[],
|
149
|
+
) {
|
150
|
+
return [
|
151
|
+
isGetBaseURICountSupported(availableSelectors),
|
152
|
+
isEncryptDecryptSupported(availableSelectors),
|
153
|
+
isLazyMintSupported(availableSelectors),
|
154
|
+
].every(Boolean);
|
155
|
+
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { beforeAll, describe, expect, it
|
1
|
+
import { beforeAll, describe, expect, it } from "vitest";
|
2
2
|
import { ANVIL_CHAIN } from "../../../../../test/src/chains.js";
|
3
3
|
import { TEST_CLIENT } from "../../../../../test/src/test-clients.js";
|
4
4
|
import {
|
@@ -7,14 +7,6 @@ import {
|
|
7
7
|
} from "../../../../contract/contract.js";
|
8
8
|
import { reveal } from "./reveal.js";
|
9
9
|
|
10
|
-
const mocks = vi.hoisted(() => ({
|
11
|
-
simulateTransaction: vi.fn(),
|
12
|
-
}));
|
13
|
-
|
14
|
-
vi.mock("../../../../transaction/actions/simulate.js", () => ({
|
15
|
-
simulateTransaction: mocks.simulateTransaction,
|
16
|
-
}));
|
17
|
-
|
18
10
|
describe("reveal", () => {
|
19
11
|
let contract: ThirdwebContract;
|
20
12
|
beforeAll(() => {
|
@@ -34,40 +26,4 @@ describe("reveal", () => {
|
|
34
26
|
|
35
27
|
expect(() => reveal(options)).toThrowError("Password is required");
|
36
28
|
});
|
37
|
-
|
38
|
-
it("should successfully prepare a reveal transaction", async () => {
|
39
|
-
const options = {
|
40
|
-
contract,
|
41
|
-
batchId: 1n,
|
42
|
-
password: "securepassword",
|
43
|
-
};
|
44
|
-
|
45
|
-
mocks.simulateTransaction.mockResolvedValue(
|
46
|
-
"ipfs://correctly_decrypted_uri/",
|
47
|
-
);
|
48
|
-
|
49
|
-
const tx = reveal(options);
|
50
|
-
if (typeof tx.data === "function") {
|
51
|
-
await tx.data();
|
52
|
-
}
|
53
|
-
|
54
|
-
expect(mocks.simulateTransaction).toHaveBeenCalled();
|
55
|
-
});
|
56
|
-
|
57
|
-
it("should throw an error if the decrypted URI is invalid", async () => {
|
58
|
-
const options = {
|
59
|
-
contract,
|
60
|
-
batchId: 1n,
|
61
|
-
password: "securepassword",
|
62
|
-
};
|
63
|
-
|
64
|
-
mocks.simulateTransaction.mockResolvedValue("invalid_uri");
|
65
|
-
|
66
|
-
const tx = reveal(options);
|
67
|
-
if (typeof tx.data === "function") {
|
68
|
-
expect(tx.data()).rejects.toThrow("Invalid reveal password");
|
69
|
-
} else {
|
70
|
-
throw new Error("Something went wrong");
|
71
|
-
}
|
72
|
-
});
|
73
29
|
});
|
@@ -1,8 +1,9 @@
|
|
1
|
-
import { simulateTransaction } from "../../../../transaction/actions/simulate.js";
|
2
1
|
import type { BaseTransactionOptions } from "../../../../transaction/types.js";
|
3
2
|
import { reveal as generatedReveal } from "../../__generated__/IDelayedReveal/write/reveal.js";
|
4
3
|
import { hashDelayedRevealPassword } from "../helpers/hashDelayedRevealBatch.js";
|
5
4
|
|
5
|
+
export { isRevealSupported } from "../../__generated__/IDelayedReveal/write/reveal.js";
|
6
|
+
|
6
7
|
/**
|
7
8
|
* @extension ERC721
|
8
9
|
*/
|
@@ -44,28 +45,6 @@ export function reveal(options: BaseTransactionOptions<RevealParams>) {
|
|
44
45
|
options.password,
|
45
46
|
options.contract,
|
46
47
|
);
|
47
|
-
|
48
|
-
const transaction = generatedReveal({
|
49
|
-
contract: options.contract,
|
50
|
-
asyncParams: async () => ({
|
51
|
-
identifier: options.batchId,
|
52
|
-
key,
|
53
|
-
}),
|
54
|
-
});
|
55
|
-
|
56
|
-
let decryptedUri: string;
|
57
|
-
try {
|
58
|
-
decryptedUri = await simulateTransaction({
|
59
|
-
transaction,
|
60
|
-
});
|
61
|
-
} catch (error) {
|
62
|
-
throw new Error("Reveal failed", { cause: error });
|
63
|
-
}
|
64
|
-
|
65
|
-
if (!decryptedUri.includes("://") || decryptedUri.slice(-1) !== "/") {
|
66
|
-
throw new Error("Invalid reveal password");
|
67
|
-
}
|
68
|
-
|
69
48
|
return {
|
70
49
|
identifier: options.batchId,
|
71
50
|
key,
|
@@ -19,7 +19,7 @@ import * as BatchMetadataERC1155 from "../BatchMetadataERC1155/index.js";
|
|
19
19
|
import { getInstalledModules } from "../__generated__/IModularCore/read/getInstalledModules.js";
|
20
20
|
import * as ClaimableERC1155 from "./index.js";
|
21
21
|
|
22
|
-
describe("ModularClaimableERC1155", () => {
|
22
|
+
describe.runIf(process.env.TW_SECRET_KEY)("ModularClaimableERC1155", () => {
|
23
23
|
let contract: ThirdwebContract;
|
24
24
|
beforeAll(async () => {
|
25
25
|
const address = await deployModularContract({
|
@@ -16,7 +16,7 @@ import { deployModularContract } from "../../prebuilts/deploy-modular.js";
|
|
16
16
|
import { getInstalledModules } from "../__generated__/IModularCore/read/getInstalledModules.js";
|
17
17
|
import * as ClaimableERC20 from "./index.js";
|
18
18
|
|
19
|
-
describe("ModularDropERC20", () => {
|
19
|
+
describe.runIf(process.env.TW_SECRET_KEY)("ModularDropERC20", () => {
|
20
20
|
let contract: ThirdwebContract;
|
21
21
|
beforeAll(async () => {
|
22
22
|
const address = await deployModularContract({
|
@@ -17,7 +17,7 @@ import * as BatchMetadataERC721 from "../BatchMetadataERC721/index.js";
|
|
17
17
|
import { getInstalledModules } from "../__generated__/IModularCore/read/getInstalledModules.js";
|
18
18
|
import * as ClaimableERC721 from "./index.js";
|
19
19
|
|
20
|
-
describe("ModularClaimableERC721", () => {
|
20
|
+
describe.runIf(process.env.TW_SECRET_KEY)("ModularClaimableERC721", () => {
|
21
21
|
let contract: ThirdwebContract;
|
22
22
|
beforeAll(async () => {
|
23
23
|
const address = await deployModularContract({
|
@@ -19,7 +19,7 @@ import * as ClaimableERC721 from "../ClaimableERC721/index.js";
|
|
19
19
|
import { getInstalledModules } from "../__generated__/IModularCore/read/getInstalledModules.js";
|
20
20
|
import * as OpenEditionMetadataERC721 from "./index.js";
|
21
21
|
|
22
|
-
describe("ModularOpenEditionERC721", () => {
|
22
|
+
describe.runIf(process.env.TW_SECRET_KEY)("ModularOpenEditionERC721", () => {
|
23
23
|
let contract: ThirdwebContract;
|
24
24
|
beforeAll(async () => {
|
25
25
|
const address = await deployModularContract({
|
@@ -13,7 +13,7 @@ import { uninstallPublishedModule } from "../modules/common/uninstallPublishedMo
|
|
13
13
|
import { deployModularContract } from "./deploy-modular.js";
|
14
14
|
import { deployPublishedContract } from "./deploy-published.js";
|
15
15
|
|
16
|
-
describe(
|
16
|
+
describe.runIf(process.env.TW_SECRET_KEY)(
|
17
17
|
"deployModularCore",
|
18
18
|
{
|
19
19
|
timeout: 120000,
|