@dynamic-labs/sdk-react-core 0.16.10 → 0.16.11
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 +7 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +5 -5
- package/src/lib/utils/functions/isProgrammableNetworkSwitchSupported/isProgrammableNetworkSwitchSupported.cjs +16 -1
- package/src/lib/utils/functions/isProgrammableNetworkSwitchSupported/isProgrammableNetworkSwitchSupported.d.ts +6 -0
- package/src/lib/utils/functions/isProgrammableNetworkSwitchSupported/isProgrammableNetworkSwitchSupported.js +16 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +1 -2
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
|
|
2
|
+
### [0.16.11](https://github.com/dynamic-labs/DynamicAuth/compare/v0.16.10...v0.16.11) (2023-05-03)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* Wallet Connect menu on mobile ([#2019](https://github.com/dynamic-labs/DynamicAuth/issues/2019)) ([88e0ab9](https://github.com/dynamic-labs/DynamicAuth/commit/88e0ab9488e365046bab8d98038c1e3acc9d8503))
|
|
8
|
+
|
|
2
9
|
### [0.16.10](https://github.com/dynamic-labs/DynamicAuth/compare/v0.16.9...v0.16.10) (2023-04-28)
|
|
3
10
|
|
|
4
11
|
|
package/package.cjs
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = "0.16.
|
|
5
|
+
var version = "0.16.11";
|
|
6
6
|
var dependencies = {
|
|
7
7
|
"react-focus-lock": "^2.9.2",
|
|
8
8
|
"@dynamic-labs/sdk-api": "0.0.174",
|
|
9
9
|
"@dynamic-labs/iconic": "^0.1.19",
|
|
10
|
-
"@dynamic-labs/wallet-book": "^0.0.
|
|
10
|
+
"@dynamic-labs/wallet-book": "^0.0.14",
|
|
11
11
|
"@hcaptcha/react-hcaptcha": "~1.4.4",
|
|
12
12
|
"country-list": "^2.3.0",
|
|
13
13
|
yup: "^0.32.11",
|
package/package.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var version = "0.16.
|
|
1
|
+
var version = "0.16.11";
|
|
2
2
|
var dependencies = {
|
|
3
3
|
"react-focus-lock": "^2.9.2",
|
|
4
4
|
"@dynamic-labs/sdk-api": "0.0.174",
|
|
5
5
|
"@dynamic-labs/iconic": "^0.1.19",
|
|
6
|
-
"@dynamic-labs/wallet-book": "^0.0.
|
|
6
|
+
"@dynamic-labs/wallet-book": "^0.0.14",
|
|
7
7
|
"@hcaptcha/react-hcaptcha": "~1.4.4",
|
|
8
8
|
"country-list": "^2.3.0",
|
|
9
9
|
yup: "^0.32.11",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.11",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
"react-focus-lock": "^2.9.2",
|
|
11
11
|
"@dynamic-labs/sdk-api": "0.0.174",
|
|
12
12
|
"@dynamic-labs/iconic": "^0.1.19",
|
|
13
|
-
"@dynamic-labs/wallet-book": "^0.0.
|
|
13
|
+
"@dynamic-labs/wallet-book": "^0.0.14",
|
|
14
14
|
"@hcaptcha/react-hcaptcha": "~1.4.4",
|
|
15
15
|
"country-list": "^2.3.0",
|
|
16
16
|
"yup": "^0.32.11",
|
|
17
17
|
"formik": "^2.2.9",
|
|
18
18
|
"qrcode": "1.5.1",
|
|
19
19
|
"ethers": "^5.7.2",
|
|
20
|
-
"@dynamic-labs/logger": "0.16.
|
|
21
|
-
"@dynamic-labs/multi-wallet": "0.16.
|
|
22
|
-
"@dynamic-labs/wallet-connector-core": "0.16.
|
|
20
|
+
"@dynamic-labs/logger": "0.16.11",
|
|
21
|
+
"@dynamic-labs/multi-wallet": "0.16.11",
|
|
22
|
+
"@dynamic-labs/wallet-connector-core": "0.16.11"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"semver": "^7.3.8"
|
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Determines whether the programmable network switch feature is supported.
|
|
7
|
+
*
|
|
8
|
+
* @param {WalletConnector} walletConnector - The wallet connector instance.
|
|
9
|
+
* @returns {boolean} Whether the programmable network switch feature is supported.
|
|
10
|
+
*/
|
|
11
|
+
const isProgrammableNetworkSwitchSupported = (walletConnector) => {
|
|
12
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
13
|
+
// Get the dev_isProgrammableNetworkSwitchSupported parameter from the URL.
|
|
14
|
+
const devIsProgrammableNetworkSwitchSupported = urlParams.get('dev_isProgrammableNetworkSwitchSupported');
|
|
15
|
+
if (devIsProgrammableNetworkSwitchSupported) {
|
|
16
|
+
return devIsProgrammableNetworkSwitchSupported === 'true';
|
|
17
|
+
}
|
|
18
|
+
// Otherwise, fall back to the original logic and return whether switchNetworkOnlyFromWallet is not true.
|
|
19
|
+
return walletConnector.switchNetworkOnlyFromWallet !== true;
|
|
20
|
+
};
|
|
6
21
|
|
|
7
22
|
exports.isProgrammableNetworkSwitchSupported = isProgrammableNetworkSwitchSupported;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
2
|
+
/**
|
|
3
|
+
* Determines whether the programmable network switch feature is supported.
|
|
4
|
+
*
|
|
5
|
+
* @param {WalletConnector} walletConnector - The wallet connector instance.
|
|
6
|
+
* @returns {boolean} Whether the programmable network switch feature is supported.
|
|
7
|
+
*/
|
|
2
8
|
export declare const isProgrammableNetworkSwitchSupported: (walletConnector: WalletConnector) => boolean;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Determines whether the programmable network switch feature is supported.
|
|
3
|
+
*
|
|
4
|
+
* @param {WalletConnector} walletConnector - The wallet connector instance.
|
|
5
|
+
* @returns {boolean} Whether the programmable network switch feature is supported.
|
|
6
|
+
*/
|
|
7
|
+
const isProgrammableNetworkSwitchSupported = (walletConnector) => {
|
|
8
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
9
|
+
// Get the dev_isProgrammableNetworkSwitchSupported parameter from the URL.
|
|
10
|
+
const devIsProgrammableNetworkSwitchSupported = urlParams.get('dev_isProgrammableNetworkSwitchSupported');
|
|
11
|
+
if (devIsProgrammableNetworkSwitchSupported) {
|
|
12
|
+
return devIsProgrammableNetworkSwitchSupported === 'true';
|
|
13
|
+
}
|
|
14
|
+
// Otherwise, fall back to the original logic and return whether switchNetworkOnlyFromWallet is not true.
|
|
15
|
+
return walletConnector.switchNetworkOnlyFromWallet !== true;
|
|
16
|
+
};
|
|
2
17
|
|
|
3
18
|
export { isProgrammableNetworkSwitchSupported };
|
|
@@ -139,8 +139,7 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, p
|
|
|
139
139
|
verifyOnly &&
|
|
140
140
|
!_isSupportedNetwork &&
|
|
141
141
|
!isKycRequired) {
|
|
142
|
-
|
|
143
|
-
if (_isProgrammableNetworkSwitchSupported) {
|
|
142
|
+
if (isProgrammableNetworkSwitchSupported.isProgrammableNetworkSwitchSupported(walletConnector)) {
|
|
144
143
|
return setView('network-not-supported');
|
|
145
144
|
}
|
|
146
145
|
return setView('network-not-supported-manual');
|
|
@@ -135,8 +135,7 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, p
|
|
|
135
135
|
verifyOnly &&
|
|
136
136
|
!_isSupportedNetwork &&
|
|
137
137
|
!isKycRequired) {
|
|
138
|
-
|
|
139
|
-
if (_isProgrammableNetworkSwitchSupported) {
|
|
138
|
+
if (isProgrammableNetworkSwitchSupported(walletConnector)) {
|
|
140
139
|
return setView('network-not-supported');
|
|
141
140
|
}
|
|
142
141
|
return setView('network-not-supported-manual');
|