thirdweb 5.61.6 → 5.62.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/exports/extensions/erc1155.js +3 -1
- package/dist/cjs/exports/extensions/erc1155.js.map +1 -1
- package/dist/cjs/extensions/erc1155/write/mintToBatch.js +79 -0
- package/dist/cjs/extensions/erc1155/write/mintToBatch.js.map +1 -0
- package/dist/cjs/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.js +15 -4
- package/dist/cjs/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.js.map +1 -1
- package/dist/cjs/react/native/ui/components/WalletImage.js +3 -2
- package/dist/cjs/react/native/ui/components/WalletImage.js.map +1 -1
- package/dist/cjs/react/native/ui/connect/ConnectModal.js +6 -6
- package/dist/cjs/react/native/ui/connect/ConnectModal.js.map +1 -1
- package/dist/cjs/react/native/ui/connect/ConnectedButton.js +2 -2
- package/dist/cjs/react/native/ui/connect/ConnectedButton.js.map +1 -1
- package/dist/cjs/react/native/ui/connect/ConnectedModal.js +3 -3
- package/dist/cjs/react/native/ui/connect/ConnectedModal.js.map +1 -1
- package/dist/cjs/react/native/ui/connect/ReceiveScreen.js +2 -2
- package/dist/cjs/react/native/ui/connect/ReceiveScreen.js.map +1 -1
- package/dist/cjs/react/web/wallets/in-app/WalletAuth.js +8 -0
- package/dist/cjs/react/web/wallets/in-app/WalletAuth.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/OTPLoginUI.js +11 -16
- package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/PassKeyLogin.js +7 -0
- package/dist/cjs/react/web/wallets/shared/PassKeyLogin.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/SocialLogin.js +9 -12
- package/dist/cjs/react/web/wallets/shared/SocialLogin.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wallets/in-app/{web/lib → core}/actions/generate-wallet.enclave.js +2 -2
- package/dist/cjs/wallets/in-app/core/actions/generate-wallet.enclave.js.map +1 -0
- package/dist/cjs/wallets/in-app/{web/lib → core}/actions/get-enclave-user-status.js +2 -2
- package/dist/cjs/wallets/in-app/core/actions/get-enclave-user-status.js.map +1 -0
- package/dist/cjs/wallets/in-app/{web/lib → core}/actions/sign-message.enclave.js +6 -5
- package/dist/cjs/wallets/in-app/core/actions/sign-message.enclave.js.map +1 -0
- package/dist/cjs/wallets/in-app/{web/lib → core}/actions/sign-transaction.enclave.js +6 -5
- package/dist/cjs/wallets/in-app/core/actions/sign-transaction.enclave.js.map +1 -0
- package/dist/cjs/wallets/in-app/{web/lib → core}/actions/sign-typed-data.enclave.js +6 -5
- package/dist/cjs/wallets/in-app/core/actions/sign-typed-data.enclave.js.map +1 -0
- package/dist/cjs/wallets/in-app/core/authentication/client-scoped-storage.js +9 -2
- package/dist/cjs/wallets/in-app/core/authentication/client-scoped-storage.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/guest.js +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/guest.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/wallet/enclave-wallet.js +4 -8
- package/dist/cjs/wallets/in-app/core/wallet/enclave-wallet.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/auth/passkeys.js +1 -1
- package/dist/cjs/wallets/in-app/native/auth/passkeys.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/helpers/api/fetchers.js +14 -0
- package/dist/cjs/wallets/in-app/native/helpers/api/fetchers.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/helpers/auth/middleware.js +3 -2
- package/dist/cjs/wallets/in-app/native/helpers/auth/middleware.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/helpers/constants.js +2 -1
- package/dist/cjs/wallets/in-app/native/helpers/constants.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/helpers/wallet/migration.js +133 -0
- package/dist/cjs/wallets/in-app/native/helpers/wallet/migration.js.map +1 -0
- package/dist/cjs/wallets/in-app/native/helpers/wallet/retrieval.js +2 -0
- package/dist/cjs/wallets/in-app/native/helpers/wallet/retrieval.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/native-connector.js +50 -28
- package/dist/cjs/wallets/in-app/native/native-connector.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/auth/iframe-auth.js +2 -2
- package/dist/cjs/wallets/in-app/web/lib/auth/iframe-auth.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/auth/passkeys.js +1 -1
- package/dist/cjs/wallets/in-app/web/lib/auth/passkeys.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/web-connector.js +13 -13
- package/dist/cjs/wallets/in-app/web/lib/web-connector.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/utils/iFrameCommunication/InAppWalletIframeCommunicator.js +1 -1
- package/dist/cjs/wallets/in-app/web/utils/iFrameCommunication/InAppWalletIframeCommunicator.js.map +1 -1
- package/dist/esm/exports/extensions/erc1155.js +1 -0
- package/dist/esm/exports/extensions/erc1155.js.map +1 -1
- package/dist/esm/extensions/erc1155/write/mintToBatch.js +76 -0
- package/dist/esm/extensions/erc1155/write/mintToBatch.js.map +1 -0
- package/dist/esm/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.js +15 -4
- package/dist/esm/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.js.map +1 -1
- package/dist/esm/react/native/ui/components/WalletImage.js +3 -2
- package/dist/esm/react/native/ui/components/WalletImage.js.map +1 -1
- package/dist/esm/react/native/ui/connect/ConnectModal.js +6 -6
- package/dist/esm/react/native/ui/connect/ConnectModal.js.map +1 -1
- package/dist/esm/react/native/ui/connect/ConnectedButton.js +2 -2
- package/dist/esm/react/native/ui/connect/ConnectedButton.js.map +1 -1
- package/dist/esm/react/native/ui/connect/ConnectedModal.js +3 -3
- package/dist/esm/react/native/ui/connect/ConnectedModal.js.map +1 -1
- package/dist/esm/react/native/ui/connect/ReceiveScreen.js +2 -2
- package/dist/esm/react/native/ui/connect/ReceiveScreen.js.map +1 -1
- package/dist/esm/react/web/wallets/in-app/WalletAuth.js +8 -0
- package/dist/esm/react/web/wallets/in-app/WalletAuth.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/OTPLoginUI.js +12 -17
- package/dist/esm/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/PassKeyLogin.js +7 -0
- package/dist/esm/react/web/wallets/shared/PassKeyLogin.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/SocialLogin.js +9 -12
- package/dist/esm/react/web/wallets/shared/SocialLogin.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/wallets/in-app/{web/lib → core}/actions/generate-wallet.enclave.js +2 -2
- package/dist/esm/wallets/in-app/core/actions/generate-wallet.enclave.js.map +1 -0
- package/dist/esm/wallets/in-app/{web/lib → core}/actions/get-enclave-user-status.js +2 -2
- package/dist/esm/wallets/in-app/core/actions/get-enclave-user-status.js.map +1 -0
- package/dist/esm/wallets/in-app/{web/lib → core}/actions/sign-message.enclave.js +6 -5
- package/dist/esm/wallets/in-app/core/actions/sign-message.enclave.js.map +1 -0
- package/dist/esm/wallets/in-app/{web/lib → core}/actions/sign-transaction.enclave.js +6 -5
- package/dist/esm/wallets/in-app/core/actions/sign-transaction.enclave.js.map +1 -0
- package/dist/esm/wallets/in-app/{web/lib → core}/actions/sign-typed-data.enclave.js +6 -5
- package/dist/esm/wallets/in-app/core/actions/sign-typed-data.enclave.js.map +1 -0
- package/dist/esm/wallets/in-app/core/authentication/client-scoped-storage.js +9 -2
- package/dist/esm/wallets/in-app/core/authentication/client-scoped-storage.js.map +1 -1
- package/dist/esm/wallets/in-app/core/authentication/guest.js +1 -1
- package/dist/esm/wallets/in-app/core/authentication/guest.js.map +1 -1
- package/dist/esm/wallets/in-app/core/wallet/enclave-wallet.js +4 -8
- package/dist/esm/wallets/in-app/core/wallet/enclave-wallet.js.map +1 -1
- package/dist/esm/wallets/in-app/native/auth/passkeys.js +1 -1
- package/dist/esm/wallets/in-app/native/auth/passkeys.js.map +1 -1
- package/dist/esm/wallets/in-app/native/helpers/api/fetchers.js +14 -0
- package/dist/esm/wallets/in-app/native/helpers/api/fetchers.js.map +1 -1
- package/dist/esm/wallets/in-app/native/helpers/auth/middleware.js +3 -2
- package/dist/esm/wallets/in-app/native/helpers/auth/middleware.js.map +1 -1
- package/dist/esm/wallets/in-app/native/helpers/constants.js +1 -0
- package/dist/esm/wallets/in-app/native/helpers/constants.js.map +1 -1
- package/dist/esm/wallets/in-app/native/helpers/wallet/migration.js +130 -0
- package/dist/esm/wallets/in-app/native/helpers/wallet/migration.js.map +1 -0
- package/dist/esm/wallets/in-app/native/helpers/wallet/retrieval.js +2 -2
- package/dist/esm/wallets/in-app/native/helpers/wallet/retrieval.js.map +1 -1
- package/dist/esm/wallets/in-app/native/native-connector.js +50 -28
- package/dist/esm/wallets/in-app/native/native-connector.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/auth/iframe-auth.js +2 -2
- package/dist/esm/wallets/in-app/web/lib/auth/iframe-auth.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/auth/passkeys.js +1 -1
- package/dist/esm/wallets/in-app/web/lib/auth/passkeys.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/web-connector.js +13 -13
- package/dist/esm/wallets/in-app/web/lib/web-connector.js.map +1 -1
- package/dist/esm/wallets/in-app/web/utils/iFrameCommunication/InAppWalletIframeCommunicator.js +1 -1
- package/dist/esm/wallets/in-app/web/utils/iFrameCommunication/InAppWalletIframeCommunicator.js.map +1 -1
- package/dist/types/exports/extensions/erc1155.d.ts +1 -0
- package/dist/types/exports/extensions/erc1155.d.ts.map +1 -1
- package/dist/types/extensions/erc1155/write/mintToBatch.d.ts +72 -0
- package/dist/types/extensions/erc1155/write/mintToBatch.d.ts.map +1 -0
- package/dist/types/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.d.ts.map +1 -1
- package/dist/types/react/native/ui/components/WalletImage.d.ts +2 -0
- package/dist/types/react/native/ui/components/WalletImage.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/ConnectModal.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/ConnectedButton.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/ConnectedModal.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/ReceiveScreen.d.ts +2 -0
- package/dist/types/react/native/ui/connect/ReceiveScreen.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/WalletAuth.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/OTPLoginUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/SocialLogin.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/wallets/in-app/core/actions/generate-wallet.enclave.d.ts +13 -0
- package/dist/types/wallets/in-app/core/actions/generate-wallet.enclave.d.ts.map +1 -0
- package/dist/types/wallets/in-app/core/actions/get-enclave-user-status.d.ts +14 -0
- package/dist/types/wallets/in-app/core/actions/get-enclave-user-status.d.ts.map +1 -0
- package/dist/types/wallets/in-app/core/actions/sign-message.enclave.d.ts +17 -0
- package/dist/types/wallets/in-app/core/actions/sign-message.enclave.d.ts.map +1 -0
- package/dist/types/wallets/in-app/core/actions/sign-transaction.enclave.d.ts +9 -0
- package/dist/types/wallets/in-app/core/actions/sign-transaction.enclave.d.ts.map +1 -0
- package/dist/types/wallets/in-app/{web/lib → core}/actions/sign-typed-data.enclave.d.ts +3 -5
- package/dist/types/wallets/in-app/core/actions/sign-typed-data.enclave.d.ts.map +1 -0
- package/dist/types/wallets/in-app/core/authentication/client-scoped-storage.d.ts +4 -3
- package/dist/types/wallets/in-app/core/authentication/client-scoped-storage.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/wallet/enclave-wallet.d.ts +6 -7
- package/dist/types/wallets/in-app/core/wallet/enclave-wallet.d.ts.map +1 -1
- package/dist/types/wallets/in-app/native/helpers/api/fetchers.d.ts.map +1 -1
- package/dist/types/wallets/in-app/native/helpers/constants.d.ts +1 -0
- package/dist/types/wallets/in-app/native/helpers/constants.d.ts.map +1 -1
- package/dist/types/wallets/in-app/native/helpers/wallet/migration.d.ts +17 -0
- package/dist/types/wallets/in-app/native/helpers/wallet/migration.d.ts.map +1 -0
- package/dist/types/wallets/in-app/native/helpers/wallet/retrieval.d.ts +27 -0
- package/dist/types/wallets/in-app/native/helpers/wallet/retrieval.d.ts.map +1 -1
- package/dist/types/wallets/in-app/native/native-connector.d.ts +2 -2
- package/dist/types/wallets/in-app/native/native-connector.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/auth/iframe-auth.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/web-connector.d.ts +1 -1
- package/dist/types/wallets/in-app/web/lib/web-connector.d.ts.map +1 -1
- package/package.json +32 -28
- package/src/exports/extensions/erc1155.ts +5 -0
- package/src/extensions/erc1155/read/getNFTs.test.ts +44 -0
- package/src/extensions/erc1155/write/lazyMint.test.ts +35 -0
- package/src/extensions/erc1155/write/mintAdditionalSupplyTo.test.ts +38 -0
- package/src/extensions/erc1155/write/mintTo.test.ts +43 -0
- package/src/extensions/erc1155/write/mintToBatch.test.ts +74 -0
- package/src/extensions/erc1155/write/mintToBatch.ts +117 -0
- package/src/extensions/erc20/read/isERC20.test.ts +1 -1
- package/src/extensions/erc20/write/transferBatch.test.ts +1 -1
- package/src/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.test.ts +75 -80
- package/src/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.ts +18 -4
- package/src/react/native/ui/components/WalletImage.tsx +5 -2
- package/src/react/native/ui/connect/ConnectModal.tsx +19 -2
- package/src/react/native/ui/connect/ConnectedButton.tsx +8 -2
- package/src/react/native/ui/connect/ConnectedModal.tsx +9 -2
- package/src/react/native/ui/connect/ReceiveScreen.tsx +5 -2
- package/src/react/web/wallets/in-app/WalletAuth.tsx +8 -0
- package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +1 -0
- package/src/react/web/wallets/shared/OTPLoginUI.tsx +12 -18
- package/src/react/web/wallets/shared/PassKeyLogin.tsx +7 -0
- package/src/react/web/wallets/shared/SocialLogin.tsx +9 -12
- package/src/version.ts +1 -1
- package/src/wallets/in-app/{web/lib → core}/actions/generate-wallet.enclave.ts +6 -8
- package/src/wallets/in-app/{web/lib → core}/actions/get-enclave-user-status.ts +5 -5
- package/src/wallets/in-app/{web/lib → core}/actions/sign-message.enclave.ts +7 -9
- package/src/wallets/in-app/{web/lib → core}/actions/sign-transaction.enclave.ts +8 -10
- package/src/wallets/in-app/{web/lib → core}/actions/sign-typed-data.enclave.ts +7 -9
- package/src/wallets/in-app/core/authentication/client-scoped-storage.ts +6 -4
- package/src/wallets/in-app/core/authentication/guest.ts +1 -1
- package/src/wallets/in-app/core/wallet/enclave-wallet.ts +11 -17
- package/src/wallets/in-app/native/auth/passkeys.ts +1 -1
- package/src/wallets/in-app/native/helpers/api/fetchers.ts +14 -0
- package/src/wallets/in-app/native/helpers/auth/middleware.ts +3 -2
- package/src/wallets/in-app/native/helpers/constants.ts +2 -0
- package/src/wallets/in-app/native/helpers/wallet/migration.ts +185 -0
- package/src/wallets/in-app/native/helpers/wallet/retrieval.ts +2 -2
- package/src/wallets/in-app/native/native-connector.ts +62 -28
- package/src/wallets/in-app/web/lib/auth/iframe-auth.ts +2 -2
- package/src/wallets/in-app/web/lib/auth/passkeys.ts +1 -1
- package/src/wallets/in-app/web/lib/web-connector.ts +13 -13
- package/src/wallets/in-app/web/utils/iFrameCommunication/InAppWalletIframeCommunicator.ts +1 -1
- package/dist/cjs/wallets/in-app/web/lib/actions/generate-wallet.enclave.js.map +0 -1
- package/dist/cjs/wallets/in-app/web/lib/actions/get-enclave-user-status.js.map +0 -1
- package/dist/cjs/wallets/in-app/web/lib/actions/sign-message.enclave.js.map +0 -1
- package/dist/cjs/wallets/in-app/web/lib/actions/sign-transaction.enclave.js.map +0 -1
- package/dist/cjs/wallets/in-app/web/lib/actions/sign-typed-data.enclave.js.map +0 -1
- package/dist/esm/wallets/in-app/web/lib/actions/generate-wallet.enclave.js.map +0 -1
- package/dist/esm/wallets/in-app/web/lib/actions/get-enclave-user-status.js.map +0 -1
- package/dist/esm/wallets/in-app/web/lib/actions/sign-message.enclave.js.map +0 -1
- package/dist/esm/wallets/in-app/web/lib/actions/sign-transaction.enclave.js.map +0 -1
- package/dist/esm/wallets/in-app/web/lib/actions/sign-typed-data.enclave.js.map +0 -1
- package/dist/types/wallets/in-app/web/lib/actions/generate-wallet.enclave.d.ts +0 -15
- package/dist/types/wallets/in-app/web/lib/actions/generate-wallet.enclave.d.ts.map +0 -1
- package/dist/types/wallets/in-app/web/lib/actions/get-enclave-user-status.d.ts +0 -14
- package/dist/types/wallets/in-app/web/lib/actions/get-enclave-user-status.d.ts.map +0 -1
- package/dist/types/wallets/in-app/web/lib/actions/sign-message.enclave.d.ts +0 -19
- package/dist/types/wallets/in-app/web/lib/actions/sign-message.enclave.d.ts.map +0 -1
- package/dist/types/wallets/in-app/web/lib/actions/sign-transaction.enclave.d.ts +0 -11
- package/dist/types/wallets/in-app/web/lib/actions/sign-transaction.enclave.d.ts.map +0 -1
- package/dist/types/wallets/in-app/web/lib/actions/sign-typed-data.enclave.d.ts.map +0 -1
@@ -1,97 +1,92 @@
|
|
1
|
-
import {
|
1
|
+
import { describe, expect, it } from "vitest";
|
2
|
+
import { TEST_CONTRACT_URI } from "~test/ipfs-uris.js";
|
3
|
+
import { TEST_ACCOUNT_D } from "~test/test-wallets.js";
|
2
4
|
import { ANVIL_CHAIN } from "../../../../../test/src/chains.js";
|
3
5
|
import { TEST_CLIENT } from "../../../../../test/src/test-clients.js";
|
4
|
-
import {
|
5
|
-
|
6
|
-
|
7
|
-
} from "
|
8
|
-
import type { Hex } from "../../../../utils/encoding/hex.js";
|
6
|
+
import { getContract } from "../../../../contract/contract.js";
|
7
|
+
import { deployERC721Contract } from "../../../../extensions/prebuilts/deploy-erc721.js";
|
8
|
+
import { sendAndConfirmTransaction } from "../../../../transaction/actions/send-and-confirm-transaction.js";
|
9
|
+
import { getNFT } from "../../read/getNFT.js";
|
9
10
|
import { createDelayedRevealBatch } from "./createDelayedRevealBatch.js";
|
11
|
+
import { reveal } from "./reveal.js";
|
10
12
|
|
11
|
-
const
|
12
|
-
getBaseUriFromBatch: vi.fn(),
|
13
|
-
getBaseURICount: vi.fn(),
|
14
|
-
encryptDecrypt: vi.fn(),
|
15
|
-
lazyMint: vi.fn(),
|
16
|
-
upload: vi.fn(),
|
17
|
-
}));
|
18
|
-
|
19
|
-
vi.mock("../../../../utils/ipfs.js", () => ({
|
20
|
-
getBaseUriFromBatch: mocks.getBaseUriFromBatch,
|
21
|
-
}));
|
22
|
-
|
23
|
-
vi.mock(
|
24
|
-
"../../__generated__/IBatchMintMetadata/read/getBaseURICount.js",
|
25
|
-
() => ({
|
26
|
-
getBaseURICount: mocks.getBaseURICount,
|
27
|
-
}),
|
28
|
-
);
|
29
|
-
|
30
|
-
vi.mock("../../__generated__/IDelayedReveal/read/encryptDecrypt.js", () => ({
|
31
|
-
encryptDecrypt: mocks.encryptDecrypt,
|
32
|
-
}));
|
33
|
-
|
34
|
-
vi.mock("../../../../storage/upload.js", () => ({
|
35
|
-
upload: mocks.upload,
|
36
|
-
}));
|
37
|
-
|
38
|
-
const placeholderNFT = {
|
13
|
+
const placeholderMetadata = {
|
39
14
|
name: "Hidden NFT",
|
40
15
|
description: "Will be revealed next week!",
|
41
16
|
};
|
17
|
+
const account = TEST_ACCOUNT_D;
|
18
|
+
const chain = ANVIL_CHAIN;
|
19
|
+
const client = TEST_CLIENT;
|
20
|
+
const password = "1234";
|
42
21
|
|
43
|
-
|
44
|
-
{
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
22
|
+
describe.runIf(process.env.TW_SECRET_KEY)("createDelayedRevealedBatch", () => {
|
23
|
+
it("should create delayed-reveal batches properly", async () => {
|
24
|
+
const contract = getContract({
|
25
|
+
address: await deployERC721Contract({
|
26
|
+
account,
|
27
|
+
chain,
|
28
|
+
client,
|
29
|
+
type: "DropERC721",
|
30
|
+
params: {
|
31
|
+
name: "nftdrop",
|
32
|
+
contractURI: TEST_CONTRACT_URI,
|
33
|
+
},
|
34
|
+
}),
|
35
|
+
chain,
|
36
|
+
client,
|
37
|
+
});
|
53
38
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
39
|
+
// Create batch #0
|
40
|
+
await sendAndConfirmTransaction({
|
41
|
+
account,
|
42
|
+
transaction: createDelayedRevealBatch({
|
43
|
+
contract,
|
44
|
+
placeholderMetadata,
|
45
|
+
password: "1234",
|
46
|
+
metadata: [{ name: "token 0" }, { name: "token 1" }],
|
47
|
+
}),
|
62
48
|
});
|
63
|
-
});
|
64
49
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
"0x8967ae24bd1c6439791bc1c8ca3b3499537283b71af366693792a707eb99e80bc0058c90c1f92f18ec716e4760fdf9279241d442b5b5",
|
76
|
-
);
|
50
|
+
// Create batch #1
|
51
|
+
await sendAndConfirmTransaction({
|
52
|
+
account,
|
53
|
+
transaction: createDelayedRevealBatch({
|
54
|
+
contract,
|
55
|
+
placeholderMetadata,
|
56
|
+
password,
|
57
|
+
metadata: [{ name: "token 2" }, { name: "token 3" }],
|
58
|
+
}),
|
59
|
+
});
|
77
60
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
61
|
+
// Reveal batch #0
|
62
|
+
await sendAndConfirmTransaction({
|
63
|
+
account,
|
64
|
+
transaction: reveal({ contract, batchId: 0n, password }),
|
65
|
+
});
|
66
|
+
// Reveal batch #1
|
67
|
+
await sendAndConfirmTransaction({
|
68
|
+
account,
|
69
|
+
transaction: reveal({ contract, batchId: 1n, password }),
|
83
70
|
});
|
84
71
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
72
|
+
/**
|
73
|
+
* The token URIs of batch 0 should end with "/0" and "/1"
|
74
|
+
* while the token URIs of batch 1 should end with "/2" and "/3"
|
75
|
+
*/
|
76
|
+
const [token0, token1, token2, token3] = await Promise.all([
|
77
|
+
getNFT({ contract, tokenId: 0n }),
|
78
|
+
getNFT({ contract, tokenId: 1n }),
|
79
|
+
getNFT({ contract, tokenId: 2n }),
|
80
|
+
getNFT({ contract, tokenId: 3n }),
|
81
|
+
]);
|
91
82
|
|
92
|
-
expect(
|
93
|
-
|
94
|
-
);
|
95
|
-
expect(
|
83
|
+
expect(token0.tokenURI.endsWith("/0")).toBe(true);
|
84
|
+
expect(token0.metadata.name).toBe("token 0");
|
85
|
+
expect(token1.tokenURI.endsWith("/1")).toBe(true);
|
86
|
+
expect(token1.metadata.name).toBe("token 1");
|
87
|
+
expect(token2.tokenURI.endsWith("/2")).toBe(true);
|
88
|
+
expect(token2.metadata.name).toBe("token 2");
|
89
|
+
expect(token3.tokenURI.endsWith("/3")).toBe(true);
|
90
|
+
expect(token3.metadata.name).toBe("token 3");
|
96
91
|
});
|
97
92
|
});
|
@@ -14,6 +14,7 @@ import {
|
|
14
14
|
encryptDecrypt,
|
15
15
|
isEncryptDecryptSupported,
|
16
16
|
} from "../../__generated__/IDelayedReveal/read/encryptDecrypt.js";
|
17
|
+
import { nextTokenIdToMint } from "../../__generated__/IERC721Enumerable/read/nextTokenIdToMint.js";
|
17
18
|
import {
|
18
19
|
lazyMint as generatedLazyMint,
|
19
20
|
isLazyMintSupported,
|
@@ -80,16 +81,29 @@ export function createDelayedRevealBatch(
|
|
80
81
|
return generatedLazyMint({
|
81
82
|
contract: options.contract,
|
82
83
|
asyncParams: async () => {
|
83
|
-
const placeholderUris = await
|
84
|
-
|
85
|
-
|
86
|
-
|
84
|
+
const [placeholderUris, startFileNumber] = await Promise.all([
|
85
|
+
upload({
|
86
|
+
client: options.contract.client,
|
87
|
+
files: Array(options.metadata.length).fill(
|
88
|
+
options.placeholderMetadata,
|
89
|
+
),
|
90
|
+
}),
|
91
|
+
nextTokenIdToMint({
|
92
|
+
contract: options.contract,
|
93
|
+
}),
|
94
|
+
]);
|
87
95
|
const placeholderUri = getBaseUriFromBatch(placeholderUris);
|
88
96
|
|
89
97
|
const uris = await upload({
|
90
98
|
client: options.contract.client,
|
91
99
|
files: options.metadata,
|
100
|
+
// IMPORTANT: File number has to be calculated properly otherwise the whole batch will break
|
101
|
+
// e.g: If you are uploading a second batch, the file name should never start from `0`
|
102
|
+
rewriteFileNames: {
|
103
|
+
fileStartNumber: Number(startFileNumber),
|
104
|
+
},
|
92
105
|
});
|
106
|
+
|
93
107
|
const baseUri = getBaseUriFromBatch(uris);
|
94
108
|
const baseUriId = await getBaseURICount({
|
95
109
|
contract: options.contract,
|
@@ -1,4 +1,6 @@
|
|
1
1
|
import { useQuery } from "@tanstack/react-query";
|
2
|
+
import type { ThirdwebClient } from "../../../../client/client.js";
|
3
|
+
import { resolveScheme } from "../../../../utils/ipfs.js";
|
2
4
|
import { nativeLocalStorage } from "../../../../utils/storage/nativeStorage.js";
|
3
5
|
import { getWalletInfo } from "../../../../wallets/__generated__/getWalletInfo.js";
|
4
6
|
import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
|
@@ -25,10 +27,11 @@ import { RNImage } from "./RNImage.js";
|
|
25
27
|
export const WalletImage = (props: {
|
26
28
|
theme: Theme;
|
27
29
|
wallet: Wallet;
|
30
|
+
client: ThirdwebClient;
|
28
31
|
size: number;
|
29
32
|
avatar?: string | null;
|
30
33
|
}) => {
|
31
|
-
const { wallet, avatar, size } = props;
|
34
|
+
const { wallet, avatar, size, client } = props;
|
32
35
|
|
33
36
|
const { data: imageData } = useQuery({
|
34
37
|
queryKey: ["wallet-image", wallet.id, wallet.getAccount()?.address],
|
@@ -55,7 +58,7 @@ export const WalletImage = (props: {
|
|
55
58
|
try {
|
56
59
|
const externalWalletImage = await getWalletInfo(activeEOAId, true);
|
57
60
|
if (externalWalletImage) {
|
58
|
-
return externalWalletImage;
|
61
|
+
return resolveScheme({ client, uri: externalWalletImage });
|
59
62
|
}
|
60
63
|
} catch {}
|
61
64
|
|
@@ -2,6 +2,7 @@ import { useCallback, useState } from "react";
|
|
2
2
|
import { Platform, StyleSheet, View } from "react-native";
|
3
3
|
import { SvgXml } from "react-native-svg";
|
4
4
|
import type { Chain } from "../../../../chains/types.js";
|
5
|
+
import type { ThirdwebClient } from "../../../../client/client.js";
|
5
6
|
import type { MultiStepAuthProviderType } from "../../../../wallets/in-app/core/authentication/types.js";
|
6
7
|
import type { InAppWalletAuth } from "../../../../wallets/in-app/core/wallet/types.js";
|
7
8
|
import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
|
@@ -269,6 +270,7 @@ export function ConnectModal(
|
|
269
270
|
<WalletLoadingView
|
270
271
|
theme={theme}
|
271
272
|
wallet={modalState.wallet}
|
273
|
+
client={client}
|
272
274
|
authProvider={modalState.authMethod}
|
273
275
|
/>
|
274
276
|
{containerType === "modal" ? (
|
@@ -328,6 +330,7 @@ export function ConnectModal(
|
|
328
330
|
)}
|
329
331
|
<SignInView
|
330
332
|
theme={theme}
|
333
|
+
client={client}
|
331
334
|
siweAuth={siweAuth}
|
332
335
|
onSignIn={() => props.onClose?.()}
|
333
336
|
onError={(error) => setModalState({ screen: "error", error })}
|
@@ -462,10 +465,12 @@ export function ConnectModal(
|
|
462
465
|
function WalletLoadingView({
|
463
466
|
theme,
|
464
467
|
wallet,
|
468
|
+
client,
|
465
469
|
authProvider,
|
466
470
|
}: {
|
467
471
|
theme: Theme;
|
468
472
|
wallet: Wallet;
|
473
|
+
client: ThirdwebClient;
|
469
474
|
authProvider?: InAppWalletAuth;
|
470
475
|
}) {
|
471
476
|
const walletInfo = useWalletInfo(wallet.id);
|
@@ -500,7 +505,12 @@ function WalletLoadingView({
|
|
500
505
|
/>
|
501
506
|
</View>
|
502
507
|
) : (
|
503
|
-
<WalletImage
|
508
|
+
<WalletImage
|
509
|
+
theme={theme}
|
510
|
+
size={90}
|
511
|
+
wallet={wallet}
|
512
|
+
client={client}
|
513
|
+
/>
|
504
514
|
)}
|
505
515
|
</WalletLoadingThumbnail>
|
506
516
|
<Spacer size="xl" />
|
@@ -522,12 +532,14 @@ function WalletLoadingView({
|
|
522
532
|
function SignInView({
|
523
533
|
theme,
|
524
534
|
siweAuth,
|
535
|
+
client,
|
525
536
|
onSignIn,
|
526
537
|
onError,
|
527
538
|
onDisconnect,
|
528
539
|
}: {
|
529
540
|
theme: Theme;
|
530
541
|
siweAuth: ReturnType<typeof useSiweAuth>;
|
542
|
+
client: ThirdwebClient;
|
531
543
|
onSignIn: () => void;
|
532
544
|
onError: (error: string) => void;
|
533
545
|
onDisconnect: () => void;
|
@@ -552,7 +564,12 @@ function SignInView({
|
|
552
564
|
imageSize={100}
|
553
565
|
animate={isSigningIn}
|
554
566
|
>
|
555
|
-
<WalletImage
|
567
|
+
<WalletImage
|
568
|
+
theme={theme}
|
569
|
+
size={90}
|
570
|
+
wallet={wallet}
|
571
|
+
client={client}
|
572
|
+
/>
|
556
573
|
</WalletLoadingThumbnail>
|
557
574
|
<Spacer size="xl" />
|
558
575
|
<ThemedText theme={theme} type="subtitle">
|
@@ -20,7 +20,7 @@ export function ConnectedButton(
|
|
20
20
|
},
|
21
21
|
) {
|
22
22
|
const theme = parseTheme(props.theme);
|
23
|
-
const { account, wallet } = props;
|
23
|
+
const { account, wallet, client } = props;
|
24
24
|
const walletChain = useActiveWalletChain();
|
25
25
|
const { pfp, name, balanceQuery } = useConnectedWalletDetails(
|
26
26
|
props.client,
|
@@ -40,7 +40,13 @@ export function ConnectedButton(
|
|
40
40
|
}}
|
41
41
|
>
|
42
42
|
<View style={styles.row}>
|
43
|
-
<WalletImage
|
43
|
+
<WalletImage
|
44
|
+
theme={theme}
|
45
|
+
size={40}
|
46
|
+
wallet={wallet}
|
47
|
+
avatar={pfp}
|
48
|
+
client={client}
|
49
|
+
/>
|
44
50
|
<View style={styles.col}>
|
45
51
|
<ThemedText
|
46
52
|
theme={theme}
|
@@ -85,6 +85,7 @@ export function ConnectedModal(props: ConnectedModalProps) {
|
|
85
85
|
<ReceiveScreen
|
86
86
|
account={props.account}
|
87
87
|
wallet={props.wallet}
|
88
|
+
client={props.client}
|
88
89
|
theme={theme}
|
89
90
|
containerType={props.containerType}
|
90
91
|
onBack={() => setModalState({ screen: "account" })}
|
@@ -161,7 +162,7 @@ export function ConnectedModal(props: ConnectedModalProps) {
|
|
161
162
|
}
|
162
163
|
|
163
164
|
const AccountHeader = (props: ConnectedModalProps) => {
|
164
|
-
const { account, wallet, theme } = props;
|
165
|
+
const { account, wallet, theme, client } = props;
|
165
166
|
const walletChain = useActiveWalletChain();
|
166
167
|
const { pfp, name, balanceQuery } = useConnectedWalletDetails(
|
167
168
|
props.client,
|
@@ -171,7 +172,13 @@ const AccountHeader = (props: ConnectedModalProps) => {
|
|
171
172
|
);
|
172
173
|
return (
|
173
174
|
<View style={styles.accountHeaderContainer}>
|
174
|
-
<WalletImage
|
175
|
+
<WalletImage
|
176
|
+
theme={theme}
|
177
|
+
size={70}
|
178
|
+
wallet={wallet}
|
179
|
+
avatar={pfp}
|
180
|
+
client={client}
|
181
|
+
/>
|
175
182
|
<SmartAccountBadge client={props.client} theme={theme} />
|
176
183
|
<Spacer size="smd" />
|
177
184
|
<Address account={account} theme={theme} addressOrENS={name} />
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { StyleSheet, View } from "react-native";
|
2
|
+
import type { ThirdwebClient } from "../../../../client/client.js";
|
2
3
|
import { shortenAddress } from "../../../../utils/address.js";
|
3
4
|
import type { Account, Wallet } from "../../../../wallets/interfaces/wallet.js";
|
4
5
|
import type { Theme } from "../../../core/design-system/index.js";
|
@@ -16,10 +17,12 @@ type ReceiveScreenProps = {
|
|
16
17
|
onClose?: () => void;
|
17
18
|
onBack?: () => void;
|
18
19
|
containerType: ContainerType;
|
20
|
+
client: ThirdwebClient;
|
19
21
|
};
|
20
22
|
|
21
23
|
export const ReceiveScreen = (props: ReceiveScreenProps) => {
|
22
|
-
const { wallet, account, theme, onClose, onBack, containerType } =
|
24
|
+
const { wallet, account, theme, onClose, onBack, containerType, client } =
|
25
|
+
props;
|
23
26
|
|
24
27
|
return (
|
25
28
|
<>
|
@@ -32,7 +35,7 @@ export const ReceiveScreen = (props: ReceiveScreenProps) => {
|
|
32
35
|
/>
|
33
36
|
<View style={styles.container}>
|
34
37
|
{/* TODO (rn) QR code scanning */}
|
35
|
-
<WalletImage theme={theme} wallet={wallet} size={80} />
|
38
|
+
<WalletImage theme={theme} wallet={wallet} size={80} client={client} />
|
36
39
|
<Spacer size="lg" />
|
37
40
|
<View
|
38
41
|
style={[
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { Suspense, useRef, useState } from "react";
|
2
2
|
import { defineChain } from "../../../../chains/utils.js";
|
3
3
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
4
|
+
import { isEcosystemWallet } from "../../../../wallets/ecosystem/is-ecosystem-wallet.js";
|
4
5
|
import { linkProfile } from "../../../../wallets/in-app/web/lib/auth/index.js";
|
5
6
|
import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
|
6
7
|
import type { EcosystemWalletId } from "../../../../wallets/wallet-types.js";
|
@@ -43,6 +44,12 @@ export function WalletAuth(props: {
|
|
43
44
|
);
|
44
45
|
const [error, setError] = useState<string | undefined>();
|
45
46
|
const [showAll, setShowAll] = useState<boolean>(false);
|
47
|
+
const ecosystem = isEcosystemWallet(wallet)
|
48
|
+
? {
|
49
|
+
id: wallet.id,
|
50
|
+
partnerId: wallet.getConfig()?.partnerId,
|
51
|
+
}
|
52
|
+
: undefined;
|
46
53
|
|
47
54
|
const back = () => {
|
48
55
|
setStatus("selecting");
|
@@ -59,6 +66,7 @@ export function WalletAuth(props: {
|
|
59
66
|
strategy: "wallet",
|
60
67
|
wallet: walletToLink,
|
61
68
|
chain: wallet.getChain() || defineChain(1),
|
69
|
+
ecosystem,
|
62
70
|
}).catch((e) => {
|
63
71
|
setError(e.message);
|
64
72
|
throw e;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
"use client";
|
2
|
-
import { useCallback, useEffect,
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
3
3
|
import type { Chain } from "../../../../chains/types.js";
|
4
4
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
5
5
|
import { webLocalStorage } from "../../../../utils/storage/webStorage.js";
|
@@ -9,7 +9,6 @@ import {
|
|
9
9
|
preAuthenticate,
|
10
10
|
} from "../../../../wallets/in-app/web/lib/auth/index.js";
|
11
11
|
import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
|
12
|
-
import type { EcosystemWalletId } from "../../../../wallets/wallet-types.js";
|
13
12
|
import { useCustomTheme } from "../../../core/design-system/CustomThemeProvider.js";
|
14
13
|
import { fontSize } from "../../../core/design-system/index.js";
|
15
14
|
import { setLastAuthProvider } from "../../../core/utils/storage.js";
|
@@ -54,7 +53,12 @@ export function OTPLoginUI(props: {
|
|
54
53
|
const [verifyStatus, setVerifyStatus] = useState<VerificationStatus>("idle");
|
55
54
|
const [error, setError] = useState<string | undefined>();
|
56
55
|
const [accountStatus, setAccountStatus] = useState<AccountStatus>("sending");
|
57
|
-
const
|
56
|
+
const ecosystem = isEcosystemWallet(wallet)
|
57
|
+
? {
|
58
|
+
id: wallet.id,
|
59
|
+
partnerId: wallet.getConfig()?.partnerId,
|
60
|
+
}
|
61
|
+
: undefined;
|
58
62
|
|
59
63
|
const [screen] = useState<ScreenToShow>("base");
|
60
64
|
|
@@ -66,13 +70,7 @@ export function OTPLoginUI(props: {
|
|
66
70
|
try {
|
67
71
|
if ("email" in userInfo) {
|
68
72
|
await preAuthenticate({
|
69
|
-
ecosystem
|
70
|
-
? {
|
71
|
-
id: wallet.id as EcosystemWalletId,
|
72
|
-
partnerId: (wallet as Wallet<EcosystemWalletId>).getConfig()
|
73
|
-
?.partnerId,
|
74
|
-
}
|
75
|
-
: undefined,
|
73
|
+
ecosystem,
|
76
74
|
email: userInfo.email,
|
77
75
|
strategy: "email",
|
78
76
|
client: props.client,
|
@@ -80,13 +78,7 @@ export function OTPLoginUI(props: {
|
|
80
78
|
setAccountStatus("sent");
|
81
79
|
} else if ("phone" in userInfo) {
|
82
80
|
await preAuthenticate({
|
83
|
-
ecosystem
|
84
|
-
? {
|
85
|
-
id: wallet.id as EcosystemWalletId,
|
86
|
-
partnerId: (wallet as Wallet<EcosystemWalletId>).getConfig()
|
87
|
-
?.partnerId,
|
88
|
-
}
|
89
|
-
: undefined,
|
81
|
+
ecosystem,
|
90
82
|
phoneNumber: userInfo.phone,
|
91
83
|
strategy: "phone",
|
92
84
|
client: props.client,
|
@@ -100,7 +92,7 @@ export function OTPLoginUI(props: {
|
|
100
92
|
setVerifyStatus("idle");
|
101
93
|
setAccountStatus("error");
|
102
94
|
}
|
103
|
-
}, [props.client, userInfo,
|
95
|
+
}, [props.client, userInfo, ecosystem]);
|
104
96
|
|
105
97
|
async function connect(otp: string) {
|
106
98
|
if ("email" in userInfo) {
|
@@ -133,6 +125,7 @@ export function OTPLoginUI(props: {
|
|
133
125
|
strategy: "email",
|
134
126
|
email: userInfo.email,
|
135
127
|
verificationCode: otp,
|
128
|
+
ecosystem,
|
136
129
|
});
|
137
130
|
} else if ("phone" in userInfo) {
|
138
131
|
await linkProfile({
|
@@ -140,6 +133,7 @@ export function OTPLoginUI(props: {
|
|
140
133
|
strategy: "phone",
|
141
134
|
phoneNumber: userInfo.phone,
|
142
135
|
verificationCode: otp,
|
136
|
+
ecosystem,
|
143
137
|
});
|
144
138
|
}
|
145
139
|
}
|
@@ -211,6 +211,12 @@ function SignupScreen(props: {
|
|
211
211
|
const { wallet, done, client, chain } = props;
|
212
212
|
const [error, setError] = useState<string | undefined>();
|
213
213
|
const [status, setStatus] = useState<"loading" | "error">("loading");
|
214
|
+
const ecosystem = isEcosystemWallet(wallet)
|
215
|
+
? {
|
216
|
+
id: wallet.id,
|
217
|
+
partnerId: wallet.getConfig()?.partnerId,
|
218
|
+
}
|
219
|
+
: undefined;
|
214
220
|
|
215
221
|
async function signup() {
|
216
222
|
setStatus("loading");
|
@@ -220,6 +226,7 @@ function SignupScreen(props: {
|
|
220
226
|
client,
|
221
227
|
strategy: "passkey",
|
222
228
|
type: "sign-up",
|
229
|
+
ecosystem,
|
223
230
|
});
|
224
231
|
} else {
|
225
232
|
await wallet.connect({
|
@@ -39,6 +39,12 @@ export function SocialLogin(props: {
|
|
39
39
|
const ewLocale = props.locale;
|
40
40
|
const locale = ewLocale.socialLoginScreen;
|
41
41
|
const themeObj = useCustomTheme();
|
42
|
+
const ecosystem = isEcosystemWallet(props.wallet)
|
43
|
+
? {
|
44
|
+
id: props.wallet.id,
|
45
|
+
partnerId: props.wallet.getConfig()?.partnerId,
|
46
|
+
}
|
47
|
+
: undefined;
|
42
48
|
|
43
49
|
const [authError, setAuthError] = useState<string | undefined>(undefined);
|
44
50
|
const { done, wallet } = props;
|
@@ -62,12 +68,7 @@ export function SocialLogin(props: {
|
|
62
68
|
return loginWithOauthRedirect({
|
63
69
|
authOption: props.socialAuth,
|
64
70
|
client: props.client,
|
65
|
-
ecosystem
|
66
|
-
? {
|
67
|
-
id: wallet.id,
|
68
|
-
partnerId: wallet.getConfig()?.partnerId,
|
69
|
-
}
|
70
|
-
: undefined,
|
71
|
+
ecosystem,
|
71
72
|
redirectUrl: walletConfig?.auth?.redirectUrl,
|
72
73
|
mode: walletConfig?.auth?.mode,
|
73
74
|
});
|
@@ -78,12 +79,7 @@ export function SocialLogin(props: {
|
|
78
79
|
authOption: props.socialAuth,
|
79
80
|
themeObj,
|
80
81
|
client: props.client,
|
81
|
-
ecosystem
|
82
|
-
? {
|
83
|
-
id: wallet.id,
|
84
|
-
partnerId: wallet.getConfig()?.partnerId,
|
85
|
-
}
|
86
|
-
: undefined,
|
82
|
+
ecosystem,
|
87
83
|
});
|
88
84
|
|
89
85
|
if (!socialWindow) {
|
@@ -99,6 +95,7 @@ export function SocialLogin(props: {
|
|
99
95
|
closeOpenedWindow: (openedWindow) => {
|
100
96
|
openedWindow.close();
|
101
97
|
},
|
98
|
+
ecosystem,
|
102
99
|
}).catch((e) => {
|
103
100
|
setAuthError(e.message);
|
104
101
|
throw e;
|
package/src/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = "5.
|
1
|
+
export const version = "5.62.0";
|
@@ -1,7 +1,8 @@
|
|
1
|
-
import type { ThirdwebClient } from "
|
2
|
-
import { getThirdwebBaseUrl } from "
|
3
|
-
import { getClientFetch } from "
|
4
|
-
import type {
|
1
|
+
import type { ThirdwebClient } from "../../../../client/client.js";
|
2
|
+
import { getThirdwebBaseUrl } from "../../../../utils/domains.js";
|
3
|
+
import { getClientFetch } from "../../../../utils/fetch.js";
|
4
|
+
import type { UserWallet } from "../wallet/enclave-wallet.js";
|
5
|
+
import type { Ecosystem } from "../wallet/types.js";
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Generate a new enclave wallet using an auth token
|
@@ -34,10 +35,7 @@ export async function generateWallet({
|
|
34
35
|
}
|
35
36
|
|
36
37
|
const { wallet } = (await response.json()) as {
|
37
|
-
wallet:
|
38
|
-
address: string;
|
39
|
-
type: "enclave";
|
40
|
-
};
|
38
|
+
wallet: UserWallet;
|
41
39
|
};
|
42
40
|
|
43
41
|
return wallet;
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import type { ThirdwebClient } from "
|
2
|
-
import { getThirdwebBaseUrl } from "
|
3
|
-
import { getClientFetch } from "
|
4
|
-
import type { UserStatus } from "
|
5
|
-
import type { Ecosystem } from "
|
1
|
+
import type { ThirdwebClient } from "../../../../client/client.js";
|
2
|
+
import { getThirdwebBaseUrl } from "../../../../utils/domains.js";
|
3
|
+
import { getClientFetch } from "../../../../utils/fetch.js";
|
4
|
+
import type { UserStatus } from "../wallet/enclave-wallet.js";
|
5
|
+
import type { Ecosystem } from "../wallet/types.js";
|
6
6
|
|
7
7
|
/**
|
8
8
|
* Gets the user's status from the backend.
|