@dynamic-labs/sdk-react-core 0.19.0-alpha.16 → 0.19.0-alpha.18
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/CHANGELOG.md +19 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +9 -9
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.cjs +4 -3
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.js +4 -3
- package/src/lib/context/DynamicContext/DynamicContext.cjs +2 -2
- package/src/lib/context/DynamicContext/DynamicContext.js +2 -2
- package/src/lib/context/DynamicContext/handleDisconnectWallet/handleDisconnectWallet.cjs +13 -0
- package/src/lib/context/DynamicContext/handleDisconnectWallet/handleDisconnectWallet.d.ts +1 -1
- package/src/lib/context/DynamicContext/handleDisconnectWallet/handleDisconnectWallet.js +13 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +31 -7
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +31 -7
- package/src/lib/utils/functions/index.d.ts +1 -1
- package/src/lib/utils/functions/isTurnkeyEnabled/index.d.ts +1 -0
- package/src/lib/utils/functions/isTurnkeyEnabled/isTurnkeyEnabled.cjs +10 -0
- package/src/lib/utils/functions/isTurnkeyEnabled/isTurnkeyEnabled.d.ts +2 -0
- package/src/lib/utils/functions/isTurnkeyEnabled/isTurnkeyEnabled.js +6 -0
- package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.cjs +6 -2
- package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.js +6 -2
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +43 -25
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +3 -2
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +43 -25
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +13 -5
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +13 -5
- package/src/lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.cjs +2 -4
- package/src/lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.js +2 -4
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.cjs +2 -2
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.js +2 -2
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +1 -1
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +1 -1
- package/src/lib/views/EmailVerification/EmailVerification.cjs +9 -3
- package/src/lib/views/EmailVerification/EmailVerification.js +9 -3
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.cjs +2 -3
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.js +2 -3
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSimpleSignIn/WalletSimpleSignIn.cjs +1 -4
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSimpleSignIn/WalletSimpleSignIn.js +1 -4
- package/src/lib/views/LoginView/useLoginView.cjs +11 -3
- package/src/lib/views/LoginView/useLoginView.js +11 -3
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +1 -1
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +1 -1
- package/src/lib/views/WalletGroupView/WalletGroupView.cjs +1 -1
- package/src/lib/views/WalletGroupView/WalletGroupView.js +1 -1
- package/src/lib/views/WalletList/WalletList.cjs +1 -1
- package/src/lib/views/WalletList/WalletList.js +1 -1
- package/src/lib/utils/functions/isPasskeyEmbeddedWalletEnabled/index.d.ts +0 -1
- package/src/lib/utils/functions/isPasskeyEmbeddedWalletEnabled/isPasskeyEmbeddedWalletEnabled.cjs +0 -7
- package/src/lib/utils/functions/isPasskeyEmbeddedWalletEnabled/isPasskeyEmbeddedWalletEnabled.d.ts +0 -2
- package/src/lib/utils/functions/isPasskeyEmbeddedWalletEnabled/isPasskeyEmbeddedWalletEnabled.js +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
|
|
2
|
+
## [0.19.0-alpha.18](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.17...v0.19.0-alpha.18) (2023-10-20)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* allow overriding contracts on Wagmi Chains ([#3106](https://github.com/dynamic-labs/DynamicAuth/issues/3106)) ([1a809f3](https://github.com/dynamic-labs/DynamicAuth/commit/1a809f3c2880b6581b58fb277188eac3a39da89a))
|
|
8
|
+
* await createEmbeddedWallet in useSocialAuth ([#3636](https://github.com/dynamic-labs/DynamicAuth/issues/3636)) ([6d5a6a6](https://github.com/dynamic-labs/DynamicAuth/commit/6d5a6a68c9adb79914fee4d4d17a47a3c79eec6d))
|
|
9
|
+
* disconnect wallet if not able to query address ([#3304](https://github.com/dynamic-labs/DynamicAuth/issues/3304)) ([d6fe979](https://github.com/dynamic-labs/DynamicAuth/commit/d6fe97931e35d9d38cf8525b44fc78326780b9a7))
|
|
10
|
+
* don't show user profile when reconnecting a primary social wallet ([#3614](https://github.com/dynamic-labs/DynamicAuth/issues/3614)) ([802243d](https://github.com/dynamic-labs/DynamicAuth/commit/802243d37963ca95d04373989e97d66e1753d8be))
|
|
11
|
+
* dynamic widget showing connect when in connect-only and signing with email/social ([#3632](https://github.com/dynamic-labs/DynamicAuth/issues/3632)) ([850a229](https://github.com/dynamic-labs/DynamicAuth/commit/850a229a72669b0e16154feafaec9618c820a036))
|
|
12
|
+
|
|
13
|
+
## [0.19.0-alpha.17](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.16...v0.19.0-alpha.17) (2023-10-19)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* memoize createEmbeddedWallet so sync passkey is not called multiple times ([#3612](https://github.com/dynamic-labs/DynamicAuth/issues/3612)) ([11d53e9](https://github.com/dynamic-labs/DynamicAuth/commit/11d53e9bf3e7c4ceb4be7dede96e6facd07a6767))
|
|
19
|
+
* revert any changes of the form of the wallet connector key ([#3608](https://github.com/dynamic-labs/DynamicAuth/issues/3608)) ([f0e2a89](https://github.com/dynamic-labs/DynamicAuth/commit/f0e2a8988047e7533cbfc52eee06d6752c5aa9c4))
|
|
20
|
+
|
|
2
21
|
## [0.19.0-alpha.16](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.15...v0.19.0-alpha.16) (2023-10-17)
|
|
3
22
|
|
|
4
23
|
|
package/package.cjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = "0.19.0-alpha.
|
|
5
|
+
var version = "0.19.0-alpha.18";
|
|
6
6
|
var dependencies = {
|
|
7
7
|
"@dynamic-labs/iconic": "0.1.34",
|
|
8
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
8
|
+
"@dynamic-labs/sdk-api": "0.0.291",
|
|
9
9
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
10
10
|
"country-list": "2.3.0",
|
|
11
11
|
formik: "2.2.9",
|
package/package.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var version = "0.19.0-alpha.
|
|
1
|
+
var version = "0.19.0-alpha.18";
|
|
2
2
|
var dependencies = {
|
|
3
3
|
"@dynamic-labs/iconic": "0.1.34",
|
|
4
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
4
|
+
"@dynamic-labs/sdk-api": "0.0.291",
|
|
5
5
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
6
6
|
"country-list": "2.3.0",
|
|
7
7
|
formik: "2.2.9",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "0.19.0-alpha.
|
|
3
|
+
"version": "0.19.0-alpha.18",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@dynamic-labs/iconic": "0.1.34",
|
|
11
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
11
|
+
"@dynamic-labs/sdk-api": "0.0.291",
|
|
12
12
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
13
13
|
"country-list": "2.3.0",
|
|
14
14
|
"formik": "2.2.9",
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
"react-focus-lock": "2.9.2",
|
|
18
18
|
"react-i18next": "^13.2.0",
|
|
19
19
|
"yup": "0.32.11",
|
|
20
|
-
"@dynamic-labs/logger": "0.19.0-alpha.
|
|
21
|
-
"@dynamic-labs/multi-wallet": "0.19.0-alpha.
|
|
22
|
-
"@dynamic-labs/rpc-providers": "0.19.0-alpha.
|
|
23
|
-
"@dynamic-labs/types": "0.19.0-alpha.
|
|
24
|
-
"@dynamic-labs/utils": "0.19.0-alpha.
|
|
25
|
-
"@dynamic-labs/wallet-book": "0.19.0-alpha.
|
|
26
|
-
"@dynamic-labs/wallet-connector-core": "0.19.0-alpha.
|
|
20
|
+
"@dynamic-labs/logger": "0.19.0-alpha.18",
|
|
21
|
+
"@dynamic-labs/multi-wallet": "0.19.0-alpha.18",
|
|
22
|
+
"@dynamic-labs/rpc-providers": "0.19.0-alpha.18",
|
|
23
|
+
"@dynamic-labs/types": "0.19.0-alpha.18",
|
|
24
|
+
"@dynamic-labs/utils": "0.19.0-alpha.18",
|
|
25
|
+
"@dynamic-labs/wallet-book": "0.19.0-alpha.18",
|
|
26
|
+
"@dynamic-labs/wallet-connector-core": "0.19.0-alpha.18",
|
|
27
27
|
"eventemitter3": "5.0.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
@@ -22,7 +22,7 @@ require('../../config/ApiEndpoint.cjs');
|
|
|
22
22
|
require('@dynamic-labs/multi-wallet');
|
|
23
23
|
require('@dynamic-labs/rpc-providers');
|
|
24
24
|
require('../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.cjs');
|
|
25
|
-
var
|
|
25
|
+
var isTurnkeyEnabled = require('../../utils/functions/isTurnkeyEnabled/isTurnkeyEnabled.cjs');
|
|
26
26
|
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
27
27
|
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
28
28
|
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
@@ -65,6 +65,7 @@ const SyncPasskeyFlow = () => {
|
|
|
65
65
|
const lastUsedWallet = localStorage.LocalStorage.getFromLS(localStorage$1.LAST_USED_WALLET);
|
|
66
66
|
const { createEmbeddedWallet } = useEmbeddedWallet.useEmbeddedWallet();
|
|
67
67
|
React.useEffect(() => {
|
|
68
|
+
var _a;
|
|
68
69
|
const createWallet = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
69
70
|
try {
|
|
70
71
|
yield createEmbeddedWallet();
|
|
@@ -76,7 +77,8 @@ const SyncPasskeyFlow = () => {
|
|
|
76
77
|
if (!user ||
|
|
77
78
|
isProjectSettingsLoading ||
|
|
78
79
|
!projectSettings ||
|
|
79
|
-
!
|
|
80
|
+
!isTurnkeyEnabled.isTurnkeyEnabled(projectSettings) ||
|
|
81
|
+
!((_a = projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.automaticEmbeddedWalletCreation) ||
|
|
80
82
|
lastUsedWallet !== undefined //untill embedded wallet is generated it's undefined
|
|
81
83
|
) {
|
|
82
84
|
return;
|
|
@@ -88,7 +90,6 @@ const SyncPasskeyFlow = () => {
|
|
|
88
90
|
lastUsedWallet,
|
|
89
91
|
authMode,
|
|
90
92
|
user,
|
|
91
|
-
isPasskeyEmbeddedWalletEnabled.isPasskeyEmbeddedWalletEnabled,
|
|
92
93
|
createEmbeddedWallet,
|
|
93
94
|
]);
|
|
94
95
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
@@ -18,7 +18,7 @@ import '../../config/ApiEndpoint.js';
|
|
|
18
18
|
import '@dynamic-labs/multi-wallet';
|
|
19
19
|
import '@dynamic-labs/rpc-providers';
|
|
20
20
|
import '../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.js';
|
|
21
|
-
import {
|
|
21
|
+
import { isTurnkeyEnabled } from '../../utils/functions/isTurnkeyEnabled/isTurnkeyEnabled.js';
|
|
22
22
|
import '../../context/ErrorContext/ErrorContext.js';
|
|
23
23
|
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
24
24
|
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
@@ -61,6 +61,7 @@ const SyncPasskeyFlow = () => {
|
|
|
61
61
|
const lastUsedWallet = LocalStorage.getFromLS(LAST_USED_WALLET);
|
|
62
62
|
const { createEmbeddedWallet } = useEmbeddedWallet();
|
|
63
63
|
useEffect(() => {
|
|
64
|
+
var _a;
|
|
64
65
|
const createWallet = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
65
66
|
try {
|
|
66
67
|
yield createEmbeddedWallet();
|
|
@@ -72,7 +73,8 @@ const SyncPasskeyFlow = () => {
|
|
|
72
73
|
if (!user ||
|
|
73
74
|
isProjectSettingsLoading ||
|
|
74
75
|
!projectSettings ||
|
|
75
|
-
!
|
|
76
|
+
!isTurnkeyEnabled(projectSettings) ||
|
|
77
|
+
!((_a = projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.automaticEmbeddedWalletCreation) ||
|
|
76
78
|
lastUsedWallet !== undefined //untill embedded wallet is generated it's undefined
|
|
77
79
|
) {
|
|
78
80
|
return;
|
|
@@ -84,7 +86,6 @@ const SyncPasskeyFlow = () => {
|
|
|
84
86
|
lastUsedWallet,
|
|
85
87
|
authMode,
|
|
86
88
|
user,
|
|
87
|
-
isPasskeyEmbeddedWalletEnabled,
|
|
88
89
|
createEmbeddedWallet,
|
|
89
90
|
]);
|
|
90
91
|
return jsx(Fragment, {});
|
|
@@ -202,8 +202,9 @@ const DynamicContextProvider = ({ children, theme, settings, locale: locale$1, }
|
|
|
202
202
|
clearPrimaryWalletId,
|
|
203
203
|
enableVisitTrackingOnConnectOnly,
|
|
204
204
|
environmentId,
|
|
205
|
+
isBridgeFlow,
|
|
205
206
|
onBeforeConnectSuccessConfirmation: eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onBeforeConnectSuccessConfirmation,
|
|
206
|
-
onUnlink: (
|
|
207
|
+
onUnlink: (connectedWalletsInfo, wallet) => handleDisconnectWallet.handleDisconnectWallet({
|
|
207
208
|
connectedWalletsInfo,
|
|
208
209
|
eventsCallbacks,
|
|
209
210
|
setWalletsToConnectByChain,
|
|
@@ -398,7 +399,6 @@ const DynamicContextProvider = ({ children, theme, settings, locale: locale$1, }
|
|
|
398
399
|
onConnectSuccess: eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onConnectSuccess,
|
|
399
400
|
onEmailVerificationFailure,
|
|
400
401
|
onEmailVerificationSuccess,
|
|
401
|
-
onEmbeddedWalletCreated: eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onEmbeddedWalletCreated,
|
|
402
402
|
onLinkSuccess: eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onLinkSuccess,
|
|
403
403
|
onUserProfileUpdate: eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onUserProfileUpdate,
|
|
404
404
|
},
|
|
@@ -198,8 +198,9 @@ const DynamicContextProvider = ({ children, theme, settings, locale, }) => {
|
|
|
198
198
|
clearPrimaryWalletId,
|
|
199
199
|
enableVisitTrackingOnConnectOnly,
|
|
200
200
|
environmentId,
|
|
201
|
+
isBridgeFlow,
|
|
201
202
|
onBeforeConnectSuccessConfirmation: eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onBeforeConnectSuccessConfirmation,
|
|
202
|
-
onUnlink: (
|
|
203
|
+
onUnlink: (connectedWalletsInfo, wallet) => handleDisconnectWallet({
|
|
203
204
|
connectedWalletsInfo,
|
|
204
205
|
eventsCallbacks,
|
|
205
206
|
setWalletsToConnectByChain,
|
|
@@ -394,7 +395,6 @@ const DynamicContextProvider = ({ children, theme, settings, locale, }) => {
|
|
|
394
395
|
onConnectSuccess: eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onConnectSuccess,
|
|
395
396
|
onEmailVerificationFailure,
|
|
396
397
|
onEmailVerificationSuccess,
|
|
397
|
-
onEmbeddedWalletCreated: eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onEmbeddedWalletCreated,
|
|
398
398
|
onLinkSuccess: eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onLinkSuccess,
|
|
399
399
|
onUserProfileUpdate: eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onUserProfileUpdate,
|
|
400
400
|
},
|
|
@@ -21,6 +21,19 @@ const handleDisconnectWallet = ({ wallet, connectedWalletsInfo, walletsByChain,
|
|
|
21
21
|
var _a;
|
|
22
22
|
const missingChains = getMissingChains.getMissingChains(walletsByChain, connectedWalletsInfo);
|
|
23
23
|
setWalletsToConnectByChain(missingChains);
|
|
24
|
+
// there might not be a wallet to disconnect because
|
|
25
|
+
// the connectedWallets state may never have been initialized.
|
|
26
|
+
// this is because we asyncronously init the connectedWallets,
|
|
27
|
+
// and as part of the async init we fetch the address and network.
|
|
28
|
+
// if either of these fails, we consider the wallet disconnected,
|
|
29
|
+
// and call this function.
|
|
30
|
+
//
|
|
31
|
+
// ideally, we would syncronously populate connectedWallets
|
|
32
|
+
// based off the connectedWalletsInfo, and then async update it
|
|
33
|
+
// with the network and address from the wallet
|
|
34
|
+
if (!wallet) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
24
37
|
try {
|
|
25
38
|
(_a = eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onDisconnect) === null || _a === void 0 ? void 0 : _a.call(eventsCallbacks, {
|
|
26
39
|
walletConnector: wallet.connector,
|
|
@@ -3,7 +3,7 @@ import { DynamicEventsCallbacks, Wallet } from '../../../shared';
|
|
|
3
3
|
import { ConnectedWalletConnectorType } from '../../../utils/hooks/useConnectWallet/useConnectWallet';
|
|
4
4
|
import { ChainsToConnect } from '../types';
|
|
5
5
|
type HandleDisconnectWalletArgs = {
|
|
6
|
-
wallet
|
|
6
|
+
wallet?: Wallet;
|
|
7
7
|
connectedWalletsInfo: ConnectedWalletConnectorType[];
|
|
8
8
|
walletsByChain: ChainsToConnect[] | undefined;
|
|
9
9
|
setWalletsToConnectByChain: Dispatch<SetStateAction<ChainsToConnect[] | undefined>>;
|
|
@@ -17,6 +17,19 @@ const handleDisconnectWallet = ({ wallet, connectedWalletsInfo, walletsByChain,
|
|
|
17
17
|
var _a;
|
|
18
18
|
const missingChains = getMissingChains(walletsByChain, connectedWalletsInfo);
|
|
19
19
|
setWalletsToConnectByChain(missingChains);
|
|
20
|
+
// there might not be a wallet to disconnect because
|
|
21
|
+
// the connectedWallets state may never have been initialized.
|
|
22
|
+
// this is because we asyncronously init the connectedWallets,
|
|
23
|
+
// and as part of the async init we fetch the address and network.
|
|
24
|
+
// if either of these fails, we consider the wallet disconnected,
|
|
25
|
+
// and call this function.
|
|
26
|
+
//
|
|
27
|
+
// ideally, we would syncronously populate connectedWallets
|
|
28
|
+
// based off the connectedWalletsInfo, and then async update it
|
|
29
|
+
// with the network and address from the wallet
|
|
30
|
+
if (!wallet) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
20
33
|
try {
|
|
21
34
|
(_a = eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onDisconnect) === null || _a === void 0 ? void 0 : _a.call(eventsCallbacks, {
|
|
22
35
|
walletConnector: wallet.connector,
|
|
@@ -62,7 +62,7 @@ require('../UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
|
62
62
|
const SocialRedirectContext = React.createContext(undefined);
|
|
63
63
|
const SocialRedirectContextProvider = ({ children, }) => {
|
|
64
64
|
var _a, _b, _c, _d;
|
|
65
|
-
const { setShowAuthFlow, wallets, setSelectedWalletConnector, walletUiUtils, consumeNonce, displaySiweStatement, environmentId, projectSettings, setIsSingleWalletAccount, setShowDynamicUserProfile, isAuthenticated, setPrimaryWalletId, secondaryWallets, sdkHasLoaded, authToken, connectWallet, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
65
|
+
const { setShowAuthFlow, wallets, setSelectedWalletConnector, walletUiUtils, consumeNonce, displaySiweStatement, environmentId, projectSettings, setIsSingleWalletAccount, setShowDynamicUserProfile, isAuthenticated, setPrimaryWalletId, secondaryWallets, sdkHasLoaded, authToken, connectWallet, primaryWallet, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
66
66
|
const { setErrorMessage } = ErrorContext.useErrorContext();
|
|
67
67
|
const { setView } = ViewContext.useViewContext();
|
|
68
68
|
const verifyWallet = useVerifyWallet.useVerifyWallet({
|
|
@@ -82,7 +82,10 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
82
82
|
.find(walletConnectorCore.isSocialWalletConnector);
|
|
83
83
|
const [redirectStatus, setRedirectStatus] = React.useState('idle');
|
|
84
84
|
const [socialProvider, setSocialProvider] = React.useState();
|
|
85
|
-
const
|
|
85
|
+
const userWallets = primaryWallet
|
|
86
|
+
? [primaryWallet, ...secondaryWallets]
|
|
87
|
+
: secondaryWallets;
|
|
88
|
+
const wallet = userWallets.find((wallet) => wallet.connector.key === (socialWalletConnector === null || socialWalletConnector === void 0 ? void 0 : socialWalletConnector.key));
|
|
86
89
|
const socialAccount = React.useMemo(() => (wallet ? getReferencedAccount.getReferencedAccount(authToken, wallet.id) : undefined), [authToken, wallet]);
|
|
87
90
|
const handleError = React.useCallback((message) => {
|
|
88
91
|
logger.logger.error(message);
|
|
@@ -143,12 +146,32 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
143
146
|
if (!socialAccount) {
|
|
144
147
|
throw new Error('Social account not found');
|
|
145
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* consider google: a user may have multiple google accounts.
|
|
151
|
+
* we need to make sure they connected with the same google account
|
|
152
|
+
* that they originally used to authenticate
|
|
153
|
+
*
|
|
154
|
+
* there are two known scenarios that we enter this branch:
|
|
155
|
+
* 1. the user is reconnected a social wallet:
|
|
156
|
+
* a. the user signed in with social
|
|
157
|
+
* b. the user then linked another wallet (for ex: metamask)
|
|
158
|
+
* c. the user signed out
|
|
159
|
+
* d. the user signed in with metamask
|
|
160
|
+
* e. the user selects their social wallet as their primary wallet
|
|
161
|
+
* f. we need to reconnect the social wallet and put the user in the social oauth redirect flow
|
|
162
|
+
*
|
|
163
|
+
* 2. for an unknown reason, the magic search params get put back into the url and this component rerenders,
|
|
164
|
+
* causing us to think the user is reconnecting.
|
|
165
|
+
* see: https://dynamiclabsgroup.slack.com/archives/C0473MNEP0T/p1697503460754999
|
|
166
|
+
*/
|
|
146
167
|
if (socialAccount.oauthAccountId === session.oauthId) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
168
|
+
if ((wallet === null || wallet === void 0 ? void 0 : wallet.id) !== (primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.id)) {
|
|
169
|
+
// justification: socialAccount is defined if and only if wallet is also defined
|
|
170
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
171
|
+
setPrimaryWalletId(wallet.id);
|
|
172
|
+
setShowAuthFlow(false);
|
|
173
|
+
setShowDynamicUserProfile(true);
|
|
174
|
+
}
|
|
152
175
|
}
|
|
153
176
|
else {
|
|
154
177
|
yield socialWalletConnector.endSession();
|
|
@@ -200,6 +223,7 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
200
223
|
wallet,
|
|
201
224
|
handleError,
|
|
202
225
|
connectWallet,
|
|
226
|
+
primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.id,
|
|
203
227
|
]);
|
|
204
228
|
return (jsxRuntime.jsx(SocialRedirectContext.Provider, { value: {
|
|
205
229
|
enabledSocialProviders,
|
|
@@ -58,7 +58,7 @@ import '../UserFieldEditorContext/UserFieldEditorContext.js';
|
|
|
58
58
|
const SocialRedirectContext = createContext(undefined);
|
|
59
59
|
const SocialRedirectContextProvider = ({ children, }) => {
|
|
60
60
|
var _a, _b, _c, _d;
|
|
61
|
-
const { setShowAuthFlow, wallets, setSelectedWalletConnector, walletUiUtils, consumeNonce, displaySiweStatement, environmentId, projectSettings, setIsSingleWalletAccount, setShowDynamicUserProfile, isAuthenticated, setPrimaryWalletId, secondaryWallets, sdkHasLoaded, authToken, connectWallet, } = useInternalDynamicContext();
|
|
61
|
+
const { setShowAuthFlow, wallets, setSelectedWalletConnector, walletUiUtils, consumeNonce, displaySiweStatement, environmentId, projectSettings, setIsSingleWalletAccount, setShowDynamicUserProfile, isAuthenticated, setPrimaryWalletId, secondaryWallets, sdkHasLoaded, authToken, connectWallet, primaryWallet, } = useInternalDynamicContext();
|
|
62
62
|
const { setErrorMessage } = useErrorContext();
|
|
63
63
|
const { setView } = useViewContext();
|
|
64
64
|
const verifyWallet = useVerifyWallet({
|
|
@@ -78,7 +78,10 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
78
78
|
.find(isSocialWalletConnector);
|
|
79
79
|
const [redirectStatus, setRedirectStatus] = useState('idle');
|
|
80
80
|
const [socialProvider, setSocialProvider] = useState();
|
|
81
|
-
const
|
|
81
|
+
const userWallets = primaryWallet
|
|
82
|
+
? [primaryWallet, ...secondaryWallets]
|
|
83
|
+
: secondaryWallets;
|
|
84
|
+
const wallet = userWallets.find((wallet) => wallet.connector.key === (socialWalletConnector === null || socialWalletConnector === void 0 ? void 0 : socialWalletConnector.key));
|
|
82
85
|
const socialAccount = useMemo(() => (wallet ? getReferencedAccount(authToken, wallet.id) : undefined), [authToken, wallet]);
|
|
83
86
|
const handleError = useCallback((message) => {
|
|
84
87
|
logger.error(message);
|
|
@@ -139,12 +142,32 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
139
142
|
if (!socialAccount) {
|
|
140
143
|
throw new Error('Social account not found');
|
|
141
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* consider google: a user may have multiple google accounts.
|
|
147
|
+
* we need to make sure they connected with the same google account
|
|
148
|
+
* that they originally used to authenticate
|
|
149
|
+
*
|
|
150
|
+
* there are two known scenarios that we enter this branch:
|
|
151
|
+
* 1. the user is reconnected a social wallet:
|
|
152
|
+
* a. the user signed in with social
|
|
153
|
+
* b. the user then linked another wallet (for ex: metamask)
|
|
154
|
+
* c. the user signed out
|
|
155
|
+
* d. the user signed in with metamask
|
|
156
|
+
* e. the user selects their social wallet as their primary wallet
|
|
157
|
+
* f. we need to reconnect the social wallet and put the user in the social oauth redirect flow
|
|
158
|
+
*
|
|
159
|
+
* 2. for an unknown reason, the magic search params get put back into the url and this component rerenders,
|
|
160
|
+
* causing us to think the user is reconnecting.
|
|
161
|
+
* see: https://dynamiclabsgroup.slack.com/archives/C0473MNEP0T/p1697503460754999
|
|
162
|
+
*/
|
|
142
163
|
if (socialAccount.oauthAccountId === session.oauthId) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
164
|
+
if ((wallet === null || wallet === void 0 ? void 0 : wallet.id) !== (primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.id)) {
|
|
165
|
+
// justification: socialAccount is defined if and only if wallet is also defined
|
|
166
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
167
|
+
setPrimaryWalletId(wallet.id);
|
|
168
|
+
setShowAuthFlow(false);
|
|
169
|
+
setShowDynamicUserProfile(true);
|
|
170
|
+
}
|
|
148
171
|
}
|
|
149
172
|
else {
|
|
150
173
|
yield socialWalletConnector.endSession();
|
|
@@ -196,6 +219,7 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
196
219
|
wallet,
|
|
197
220
|
handleError,
|
|
198
221
|
connectWallet,
|
|
222
|
+
primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.id,
|
|
199
223
|
]);
|
|
200
224
|
return (jsx(SocialRedirectContext.Provider, { value: {
|
|
201
225
|
enabledSocialProviders,
|
|
@@ -35,7 +35,7 @@ export * from './getActiveOauthCredential';
|
|
|
35
35
|
export * from './getSocialSignInProviderForProviderEnum';
|
|
36
36
|
export * from './getSocialSignInProviderFromString';
|
|
37
37
|
export * from './getOauthLoginUrl';
|
|
38
|
-
export * from './
|
|
38
|
+
export * from './isTurnkeyEnabled';
|
|
39
39
|
export * from './isEmbeddedWalletPresent';
|
|
40
40
|
export * from './findEmbeddedWalletFromVerifiedCredentials';
|
|
41
41
|
export * from './findTurnkeyWallet';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isTurnkeyEnabled } from './isTurnkeyEnabled';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var sdkApi = require('@dynamic-labs/sdk-api');
|
|
6
|
+
var isProviderEnabled = require('../isProviderEnabled/isProviderEnabled.cjs');
|
|
7
|
+
|
|
8
|
+
const isTurnkeyEnabled = (projectSettings) => { var _a; return isProviderEnabled.isProviderEnabled((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _a !== void 0 ? _a : [], sdkApi.ProviderEnum.Turnkey); };
|
|
9
|
+
|
|
10
|
+
exports.isTurnkeyEnabled = isTurnkeyEnabled;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ProviderEnum } from '@dynamic-labs/sdk-api';
|
|
2
|
+
import { isProviderEnabled } from '../isProviderEnabled/isProviderEnabled.js';
|
|
3
|
+
|
|
4
|
+
const isTurnkeyEnabled = (projectSettings) => { var _a; return isProviderEnabled((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _a !== void 0 ? _a : [], ProviderEnum.Turnkey); };
|
|
5
|
+
|
|
6
|
+
export { isTurnkeyEnabled };
|
package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.cjs
CHANGED
|
@@ -26,8 +26,12 @@ const groupWalletOptions = (walletBook$1, walletOptionList) => {
|
|
|
26
26
|
return (_a = output[existingGroupIndex].groupedWallets) === null || _a === void 0 ? void 0 : _a.push(currentWalletOption);
|
|
27
27
|
}
|
|
28
28
|
// Validate if there is any other wallet with the same group
|
|
29
|
-
const isThereWalletOptionWithSameGroup = walletOptionList.some((walletOption) =>
|
|
30
|
-
|
|
29
|
+
const isThereWalletOptionWithSameGroup = walletOptionList.some((walletOption) => {
|
|
30
|
+
var _a;
|
|
31
|
+
return currentWalletOption.group === walletOption.group &&
|
|
32
|
+
(((_a = walletOption.injectedConfig) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
33
|
+
currentWalletOption.key !== walletOption.key);
|
|
34
|
+
});
|
|
31
35
|
// Avoid group creation if there only one wallet in group
|
|
32
36
|
if (!isThereWalletOptionWithSameGroup) {
|
|
33
37
|
return output.push(currentWalletOption);
|
package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.js
CHANGED
|
@@ -22,8 +22,12 @@ const groupWalletOptions = (walletBook, walletOptionList) => {
|
|
|
22
22
|
return (_a = output[existingGroupIndex].groupedWallets) === null || _a === void 0 ? void 0 : _a.push(currentWalletOption);
|
|
23
23
|
}
|
|
24
24
|
// Validate if there is any other wallet with the same group
|
|
25
|
-
const isThereWalletOptionWithSameGroup = walletOptionList.some((walletOption) =>
|
|
26
|
-
|
|
25
|
+
const isThereWalletOptionWithSameGroup = walletOptionList.some((walletOption) => {
|
|
26
|
+
var _a;
|
|
27
|
+
return currentWalletOption.group === walletOption.group &&
|
|
28
|
+
(((_a = walletOption.injectedConfig) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
29
|
+
currentWalletOption.key !== walletOption.key);
|
|
30
|
+
});
|
|
27
31
|
// Avoid group creation if there only one wallet in group
|
|
28
32
|
if (!isThereWalletOptionWithSameGroup) {
|
|
29
33
|
return output.push(currentWalletOption);
|
|
@@ -23,9 +23,35 @@ var api = require('../../../data/api.cjs');
|
|
|
23
23
|
require('@dynamic-labs/multi-wallet');
|
|
24
24
|
var shouldManuallyReconnectOnRefresh = require('../../functions/shouldManuallyReconnectOnRefresh/shouldManuallyReconnectOnRefresh.cjs');
|
|
25
25
|
|
|
26
|
-
const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingOnConnectOnly, environmentId, primaryWalletId, setPrimaryWalletId, wallets, onUnlink, onBeforeConnectSuccessConfirmation, setShowAuthFlow, }) => {
|
|
26
|
+
const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingOnConnectOnly, environmentId, primaryWalletId, setPrimaryWalletId, wallets, onUnlink, onBeforeConnectSuccessConfirmation, setShowAuthFlow, isBridgeFlow, }) => {
|
|
27
27
|
const [connectedWalletsInfo, setConnectedWalletsInfo, removeConnectedWalletsInfo,] = useLocalStorage.useLocalStorage(localStorage.CONNECTED_WALLETS_INFO, []);
|
|
28
28
|
const [connectedWallets, setConnectedWallets] = React.useState([]);
|
|
29
|
+
const unlinkConnectedWallet = React.useCallback((walletId) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
30
|
+
const walletToDisconnect = connectedWallets.find((wallet) => wallet.id === walletId);
|
|
31
|
+
yield (walletToDisconnect === null || walletToDisconnect === void 0 ? void 0 : walletToDisconnect.connector.endSession());
|
|
32
|
+
const updatedConnectedWalletsInfo = connectedWalletsInfo.filter((wallet) => wallet.id !== walletId);
|
|
33
|
+
setConnectedWalletsInfo(updatedConnectedWalletsInfo);
|
|
34
|
+
onUnlink(updatedConnectedWalletsInfo, walletToDisconnect);
|
|
35
|
+
if (walletId !== primaryWalletId) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const hasConnectedWallet = updatedConnectedWalletsInfo.length > 0;
|
|
39
|
+
if (isBridgeFlow || !hasConnectedWallet) {
|
|
40
|
+
clearPrimaryWalletId();
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
setPrimaryWalletId(updatedConnectedWalletsInfo[0].id);
|
|
44
|
+
}
|
|
45
|
+
}), [
|
|
46
|
+
clearPrimaryWalletId,
|
|
47
|
+
connectedWallets,
|
|
48
|
+
connectedWalletsInfo,
|
|
49
|
+
isBridgeFlow,
|
|
50
|
+
onUnlink,
|
|
51
|
+
primaryWalletId,
|
|
52
|
+
setConnectedWalletsInfo,
|
|
53
|
+
setPrimaryWalletId,
|
|
54
|
+
]);
|
|
29
55
|
// The function to update and define the connectedWallets list.
|
|
30
56
|
// It uses walletConnector to get the current wallet address and network
|
|
31
57
|
// The address and network in the runtime are updated by the event listeners
|
|
@@ -36,14 +62,19 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
36
62
|
if (!walletConnectors.length) {
|
|
37
63
|
return;
|
|
38
64
|
}
|
|
39
|
-
const
|
|
65
|
+
const updatedConnectedWallets = (yield Promise.all(connectedWalletsInfo.map((storedConnectedWalletInfo) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
40
66
|
const walletConnector = walletConnectorCore.getWalletConnectorByKey(walletConnectors, storedConnectedWalletInfo.walletConnectorKey);
|
|
41
67
|
if (!walletConnector) {
|
|
42
68
|
walletConnectorCore.logger.error('Could not find walletConnector: ' +
|
|
43
69
|
storedConnectedWalletInfo.walletConnectorKey);
|
|
44
|
-
|
|
70
|
+
yield unlinkConnectedWallet(storedConnectedWalletInfo.id);
|
|
71
|
+
return null;
|
|
45
72
|
}
|
|
46
73
|
const [walletAddress] = yield walletConnector.getConnectedAccounts();
|
|
74
|
+
if (!walletAddress) {
|
|
75
|
+
yield unlinkConnectedWallet(storedConnectedWalletInfo.id);
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
47
78
|
const walletNetwork = yield walletConnector.getNetwork();
|
|
48
79
|
const walletChain = walletConnector.connectedChain;
|
|
49
80
|
const walletObject = {
|
|
@@ -54,14 +85,15 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
54
85
|
id: storedConnectedWalletInfo.id,
|
|
55
86
|
network: walletNetwork,
|
|
56
87
|
};
|
|
57
|
-
return
|
|
88
|
+
return walletObject;
|
|
58
89
|
})))).filter((wallet) => Boolean(wallet));
|
|
59
|
-
setConnectedWallets(
|
|
60
|
-
}), [connectedWalletsInfo, wallets]);
|
|
90
|
+
setConnectedWallets(updatedConnectedWallets);
|
|
91
|
+
}), [connectedWalletsInfo, unlinkConnectedWallet, wallets]);
|
|
61
92
|
// Generate the connectedWallets list when connectedWalletsInfo (localStorage) or memoized wallet connector updates
|
|
62
93
|
React.useEffect(() => {
|
|
63
94
|
updateConnectedWalletsList();
|
|
64
|
-
|
|
95
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
96
|
+
}, [connectedWalletsInfo, wallets]);
|
|
65
97
|
const getNextIdAvailable = React.useCallback((currentWallets) => {
|
|
66
98
|
const existingIds = currentWallets.map(({ id }) => id);
|
|
67
99
|
const sortedIds = existingIds
|
|
@@ -85,15 +117,14 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
85
117
|
const connectedWallet = connectedWallets[0] || null;
|
|
86
118
|
// Keeps connected wallet data inside localStorage
|
|
87
119
|
const applyConnectedWalletToStore = ({ walletId, walletConnectorKey, walletChain, provider, }) => {
|
|
88
|
-
const
|
|
89
|
-
|
|
120
|
+
const updatedConnectedWalletsInfo = [...connectedWalletsInfo];
|
|
121
|
+
updatedConnectedWalletsInfo.push({
|
|
90
122
|
id: walletId,
|
|
91
123
|
provider,
|
|
92
124
|
walletChain,
|
|
93
125
|
walletConnectorKey,
|
|
94
126
|
});
|
|
95
|
-
setConnectedWalletsInfo(
|
|
96
|
-
return Promise.resolve();
|
|
127
|
+
setConnectedWalletsInfo(updatedConnectedWalletsInfo);
|
|
97
128
|
};
|
|
98
129
|
// Updates connected wallet (network and address) and verifies connected wallet connection
|
|
99
130
|
const refreshConnectedWallet = (walletId, walletConnector) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -171,20 +202,7 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
171
202
|
});
|
|
172
203
|
}
|
|
173
204
|
}
|
|
174
|
-
return
|
|
175
|
-
});
|
|
176
|
-
const unlinkConnectedWallet = (walletId) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
177
|
-
const connectedWalletToUnlink = connectedWallets.find((wallet) => wallet.id === walletId);
|
|
178
|
-
if (!connectedWalletToUnlink) {
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
yield connectedWalletToUnlink.connector.endSession();
|
|
182
|
-
const filteredWallets = connectedWalletsInfo.filter((wallet) => wallet.id !== walletId);
|
|
183
|
-
if (walletId === primaryWalletId) {
|
|
184
|
-
clearPrimaryWalletId();
|
|
185
|
-
}
|
|
186
|
-
setConnectedWalletsInfo(filteredWallets);
|
|
187
|
-
onUnlink(connectedWalletToUnlink, filteredWallets);
|
|
205
|
+
return publicWalletAddress;
|
|
188
206
|
});
|
|
189
207
|
const getConnectedWalletById = React.useCallback((walletId) => connectedWallets.find((wallet) => wallet.id === walletId), [connectedWallets]);
|
|
190
208
|
return {
|
|
@@ -15,9 +15,10 @@ type Props = {
|
|
|
15
15
|
primaryWalletId: string | undefined;
|
|
16
16
|
setPrimaryWalletId: (walletId: string) => void;
|
|
17
17
|
wallets: WalletOption[];
|
|
18
|
-
onUnlink: (
|
|
18
|
+
onUnlink: (connectedWalletsInfo: ConnectedWalletConnectorType[], wallet?: Wallet) => void;
|
|
19
19
|
onBeforeConnectSuccessConfirmation: OnBeforeConnectSuccessConfirmation | undefined;
|
|
20
20
|
setShowAuthFlow: Dispatch<SetStateAction<boolean>>;
|
|
21
|
+
isBridgeFlow: boolean;
|
|
21
22
|
};
|
|
22
23
|
type UseConnectWalletValue = {
|
|
23
24
|
connectWallet: (walletConnector: WalletConnector, fetchPublicAddressOpts?: FetchPublicAddressOpts, shouldCallCallback?: boolean) => Promise<string | undefined>;
|
|
@@ -29,5 +30,5 @@ type UseConnectWalletValue = {
|
|
|
29
30
|
removeConnectedWalletsInfo: () => void;
|
|
30
31
|
unlinkConnectedWallet: (walletId: string) => Promise<void>;
|
|
31
32
|
};
|
|
32
|
-
export declare const useConnectWallet: ({ authMode, clearPrimaryWalletId, enableVisitTrackingOnConnectOnly, environmentId, primaryWalletId, setPrimaryWalletId, wallets, onUnlink, onBeforeConnectSuccessConfirmation, setShowAuthFlow, }: Props) => UseConnectWalletValue;
|
|
33
|
+
export declare const useConnectWallet: ({ authMode, clearPrimaryWalletId, enableVisitTrackingOnConnectOnly, environmentId, primaryWalletId, setPrimaryWalletId, wallets, onUnlink, onBeforeConnectSuccessConfirmation, setShowAuthFlow, isBridgeFlow, }: Props) => UseConnectWalletValue;
|
|
33
34
|
export {};
|