@dynamic-labs/sdk-react-core 0.18.2 → 0.18.4
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 +11 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +8 -8
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.cjs +7 -6
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.js +7 -6
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +3 -2
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +3 -2
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +3 -2
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
|
|
2
|
+
### [0.18.4](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.2...v0.18.4) (2023-08-17)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* always init magic connectors when enabled ([#3018](https://github.com/dynamic-labs/DynamicAuth/issues/3018)) ([e6bb091](https://github.com/dynamic-labs/DynamicAuth/commit/e6bb091d2b5b58242ecd9268496a69e92f840773)), closes [#3014](https://github.com/dynamic-labs/DynamicAuth/issues/3014)
|
|
8
|
+
* guard against null or undefined provider value when logging in w… ([#3027](https://github.com/dynamic-labs/DynamicAuth/issues/3027)) ([7354d5f](https://github.com/dynamic-labs/DynamicAuth/commit/7354d5f1a68603143ddd10d0b2ddb5283ec29ff1)), closes [#3021](https://github.com/dynamic-labs/DynamicAuth/issues/3021)
|
|
9
|
+
* issue where walletconnectors are instantiated without walletbook ([#3020](https://github.com/dynamic-labs/DynamicAuth/issues/3020)) ([#3032](https://github.com/dynamic-labs/DynamicAuth/issues/3032)) ([4452165](https://github.com/dynamic-labs/DynamicAuth/commit/4452165962856ba3ef0dc7aa6b41101fb8c48ad7))
|
|
10
|
+
* only use the production api environment of magicLink ([#3023](https://github.com/dynamic-labs/DynamicAuth/issues/3023)) ([767a1a5](https://github.com/dynamic-labs/DynamicAuth/commit/767a1a59074e992c446632a399f1b45bb0b759a0))
|
|
11
|
+
* switching network in connected state should update wallets to connect list ([#3029](https://github.com/dynamic-labs/DynamicAuth/issues/3029)) ([f07c993](https://github.com/dynamic-labs/DynamicAuth/commit/f07c993792824ce1b1390e38c2bcdb27b5d6ab73))
|
|
12
|
+
|
|
2
13
|
### [0.18.2](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.1...v0.18.2) (2023-08-15)
|
|
3
14
|
|
|
4
15
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"formik": "2.2.9",
|
|
17
17
|
"qrcode": "1.5.1",
|
|
18
18
|
"ethers": "5.7.2",
|
|
19
|
-
"@dynamic-labs/logger": "0.18.
|
|
20
|
-
"@dynamic-labs/multi-wallet": "0.18.
|
|
21
|
-
"@dynamic-labs/rpc-providers": "0.18.
|
|
22
|
-
"@dynamic-labs/types": "0.18.
|
|
23
|
-
"@dynamic-labs/utils": "0.18.
|
|
24
|
-
"@dynamic-labs/wallet-book": "0.18.
|
|
25
|
-
"@dynamic-labs/wallet-connector-core": "0.18.
|
|
19
|
+
"@dynamic-labs/logger": "0.18.4",
|
|
20
|
+
"@dynamic-labs/multi-wallet": "0.18.4",
|
|
21
|
+
"@dynamic-labs/rpc-providers": "0.18.4",
|
|
22
|
+
"@dynamic-labs/types": "0.18.4",
|
|
23
|
+
"@dynamic-labs/utils": "0.18.4",
|
|
24
|
+
"@dynamic-labs/wallet-book": "0.18.4",
|
|
25
|
+
"@dynamic-labs/wallet-connector-core": "0.18.4",
|
|
26
26
|
"eventemitter3": "5.0.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
@@ -22,7 +22,7 @@ var isProgrammableNetworkSwitchSupported = require('../../functions/isProgrammab
|
|
|
22
22
|
|
|
23
23
|
const useConnectedWalletsNetworkValidation = () => {
|
|
24
24
|
const { connectedWallets, selectedWalletConnector, setSelectedWalletConnector, setShowAuthFlow, showAuthFlow, walletsToConnectByChain, isBridgeFlow, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
25
|
-
const {
|
|
25
|
+
const { setView } = ViewContext.useViewContext();
|
|
26
26
|
React.useEffect(() => {
|
|
27
27
|
if (!isBridgeFlow) {
|
|
28
28
|
return;
|
|
@@ -53,16 +53,17 @@ const useConnectedWalletsNetworkValidation = () => {
|
|
|
53
53
|
}
|
|
54
54
|
setView(networkNotSupportedView);
|
|
55
55
|
}
|
|
56
|
+
// we need it to remove 'showAuthFlow' property. we don't want to react to it,
|
|
57
|
+
// because closing modal on network switch causes it to re-open
|
|
58
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
56
59
|
}, [
|
|
57
|
-
isBridgeFlow,
|
|
58
60
|
connectedWallets,
|
|
59
|
-
|
|
61
|
+
isBridgeFlow,
|
|
60
62
|
selectedWalletConnector,
|
|
61
|
-
walletsToConnectByChain,
|
|
62
|
-
showAuthFlow,
|
|
63
|
-
setView,
|
|
64
63
|
setSelectedWalletConnector,
|
|
65
64
|
setShowAuthFlow,
|
|
65
|
+
setView,
|
|
66
|
+
walletsToConnectByChain,
|
|
66
67
|
]);
|
|
67
68
|
};
|
|
68
69
|
|
|
@@ -18,7 +18,7 @@ import { isProgrammableNetworkSwitchSupported } from '../../functions/isProgramm
|
|
|
18
18
|
|
|
19
19
|
const useConnectedWalletsNetworkValidation = () => {
|
|
20
20
|
const { connectedWallets, selectedWalletConnector, setSelectedWalletConnector, setShowAuthFlow, showAuthFlow, walletsToConnectByChain, isBridgeFlow, } = useInternalDynamicContext();
|
|
21
|
-
const {
|
|
21
|
+
const { setView } = useViewContext();
|
|
22
22
|
useEffect(() => {
|
|
23
23
|
if (!isBridgeFlow) {
|
|
24
24
|
return;
|
|
@@ -49,16 +49,17 @@ const useConnectedWalletsNetworkValidation = () => {
|
|
|
49
49
|
}
|
|
50
50
|
setView(networkNotSupportedView);
|
|
51
51
|
}
|
|
52
|
+
// we need it to remove 'showAuthFlow' property. we don't want to react to it,
|
|
53
|
+
// because closing modal on network switch causes it to re-open
|
|
54
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
52
55
|
}, [
|
|
53
|
-
isBridgeFlow,
|
|
54
56
|
connectedWallets,
|
|
55
|
-
|
|
57
|
+
isBridgeFlow,
|
|
56
58
|
selectedWalletConnector,
|
|
57
|
-
walletsToConnectByChain,
|
|
58
|
-
showAuthFlow,
|
|
59
|
-
setView,
|
|
60
59
|
setSelectedWalletConnector,
|
|
61
60
|
setShowAuthFlow,
|
|
61
|
+
setView,
|
|
62
|
+
walletsToConnectByChain,
|
|
62
63
|
]);
|
|
63
64
|
};
|
|
64
65
|
|
|
@@ -53,12 +53,13 @@ var SelectNetworkButton = require('../../components/SelectNetworkButton/SelectNe
|
|
|
53
53
|
var useApplyWalletConnectorNetwork = require('../../utils/hooks/useApplyWalletConnectorNetwork/useApplyWalletConnectorNetwork.cjs');
|
|
54
54
|
|
|
55
55
|
const NetworkNotSupported = () => {
|
|
56
|
-
const { network, onboardingImageUrl, selectedWalletConnector: walletConnector, connectedWallets, primaryWallet, isFullyConnected, setShowAuthFlow, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
56
|
+
const { network, onboardingImageUrl, selectedWalletConnector: walletConnector, connectedWallets, primaryWallet, isFullyConnected, setShowAuthFlow, walletsToConnectByChain, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
57
57
|
// Refresh selectedWalletConnector network when primaryWallet or connectedWallets updates
|
|
58
58
|
const { data: walletConnectorNetwork } = usePromise.usePromise(() => walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getNetwork(), { deps: [primaryWallet, walletConnector, connectedWallets] });
|
|
59
59
|
const finishConnectAndSign = useConnectAndSign.useConnectAndSign({
|
|
60
60
|
shouldCallCallback: false,
|
|
61
|
-
shouldUpdateWallets: !isFullyConnected
|
|
61
|
+
shouldUpdateWallets: !isFullyConnected ||
|
|
62
|
+
(isFullyConnected && Boolean(walletsToConnectByChain === null || walletsToConnectByChain === void 0 ? void 0 : walletsToConnectByChain.length)),
|
|
62
63
|
});
|
|
63
64
|
const [isNetworkPickerOpen, setIsNetworkPickerOpen] = React.useState(false);
|
|
64
65
|
// Finishes auth flow when wallet switches to proper network
|
|
@@ -49,12 +49,13 @@ import { SelectNetworkButton } from '../../components/SelectNetworkButton/Select
|
|
|
49
49
|
import { useApplyWalletConnectorNetwork } from '../../utils/hooks/useApplyWalletConnectorNetwork/useApplyWalletConnectorNetwork.js';
|
|
50
50
|
|
|
51
51
|
const NetworkNotSupported = () => {
|
|
52
|
-
const { network, onboardingImageUrl, selectedWalletConnector: walletConnector, connectedWallets, primaryWallet, isFullyConnected, setShowAuthFlow, } = useInternalDynamicContext();
|
|
52
|
+
const { network, onboardingImageUrl, selectedWalletConnector: walletConnector, connectedWallets, primaryWallet, isFullyConnected, setShowAuthFlow, walletsToConnectByChain, } = useInternalDynamicContext();
|
|
53
53
|
// Refresh selectedWalletConnector network when primaryWallet or connectedWallets updates
|
|
54
54
|
const { data: walletConnectorNetwork } = usePromise(() => walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getNetwork(), { deps: [primaryWallet, walletConnector, connectedWallets] });
|
|
55
55
|
const finishConnectAndSign = useConnectAndSign({
|
|
56
56
|
shouldCallCallback: false,
|
|
57
|
-
shouldUpdateWallets: !isFullyConnected
|
|
57
|
+
shouldUpdateWallets: !isFullyConnected ||
|
|
58
|
+
(isFullyConnected && Boolean(walletsToConnectByChain === null || walletsToConnectByChain === void 0 ? void 0 : walletsToConnectByChain.length)),
|
|
58
59
|
});
|
|
59
60
|
const [isNetworkPickerOpen, setIsNetworkPickerOpen] = useState(false);
|
|
60
61
|
// Finishes auth flow when wallet switches to proper network
|
|
@@ -54,14 +54,15 @@ var useApplyWalletConnectorNetwork = require('../../utils/hooks/useApplyWalletCo
|
|
|
54
54
|
// as the wallet does not support programmatic network change.
|
|
55
55
|
const NetworkNotSupportedSwitchManual = () => {
|
|
56
56
|
var _a, _b;
|
|
57
|
-
const { user, selectedWalletConnector: walletConnector, connectedWallets, isFullyConnected, setShowAuthFlow, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
57
|
+
const { user, selectedWalletConnector: walletConnector, connectedWallets, isFullyConnected, setShowAuthFlow, walletsToConnectByChain, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
58
58
|
// Refresh selectedWalletConnector network when primaryWallet or connectedWallets updates
|
|
59
59
|
const { data: walletConnectorNetwork } = usePromise.usePromise(() => walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getNetwork(), {
|
|
60
60
|
deps: [walletConnector, connectedWallets],
|
|
61
61
|
});
|
|
62
62
|
const finishConnectAndSign = useConnectAndSign.useConnectAndSign({
|
|
63
63
|
shouldCallCallback: false,
|
|
64
|
-
shouldUpdateWallets: !isFullyConnected
|
|
64
|
+
shouldUpdateWallets: !isFullyConnected ||
|
|
65
|
+
(isFullyConnected && Boolean(walletsToConnectByChain === null || walletsToConnectByChain === void 0 ? void 0 : walletsToConnectByChain.length)),
|
|
65
66
|
});
|
|
66
67
|
// Finishes auth flow when wallet switches to proper network
|
|
67
68
|
React.useEffect(() => {
|
|
@@ -50,14 +50,15 @@ import { useApplyWalletConnectorNetwork } from '../../utils/hooks/useApplyWallet
|
|
|
50
50
|
// as the wallet does not support programmatic network change.
|
|
51
51
|
const NetworkNotSupportedSwitchManual = () => {
|
|
52
52
|
var _a, _b;
|
|
53
|
-
const { user, selectedWalletConnector: walletConnector, connectedWallets, isFullyConnected, setShowAuthFlow, } = useInternalDynamicContext();
|
|
53
|
+
const { user, selectedWalletConnector: walletConnector, connectedWallets, isFullyConnected, setShowAuthFlow, walletsToConnectByChain, } = useInternalDynamicContext();
|
|
54
54
|
// Refresh selectedWalletConnector network when primaryWallet or connectedWallets updates
|
|
55
55
|
const { data: walletConnectorNetwork } = usePromise(() => walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getNetwork(), {
|
|
56
56
|
deps: [walletConnector, connectedWallets],
|
|
57
57
|
});
|
|
58
58
|
const finishConnectAndSign = useConnectAndSign({
|
|
59
59
|
shouldCallCallback: false,
|
|
60
|
-
shouldUpdateWallets: !isFullyConnected
|
|
60
|
+
shouldUpdateWallets: !isFullyConnected ||
|
|
61
|
+
(isFullyConnected && Boolean(walletsToConnectByChain === null || walletsToConnectByChain === void 0 ? void 0 : walletsToConnectByChain.length)),
|
|
61
62
|
});
|
|
62
63
|
// Finishes auth flow when wallet switches to proper network
|
|
63
64
|
useEffect(() => {
|