@dynamic-labs/sdk-react-core 0.16.9 → 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 CHANGED
@@ -1,4 +1,18 @@
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
+
9
+ ### [0.16.10](https://github.com/dynamic-labs/DynamicAuth/compare/v0.16.9...v0.16.10) (2023-04-28)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * update setPrimaryWallet return type ([#1986](https://github.com/dynamic-labs/DynamicAuth/issues/1986)) ([bb6a832](https://github.com/dynamic-labs/DynamicAuth/commit/bb6a83270be424650bc4807f29fda5a1f9475df9))
15
+
2
16
  ### [0.16.9](https://github.com/dynamic-labs/DynamicAuth/compare/v0.16.8...v0.16.9) (2023-04-26)
3
17
 
4
18
 
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.9";
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
- "@dynamic-labs/iconic": "^0.1.16",
10
- "@dynamic-labs/wallet-book": "^0.0.11",
9
+ "@dynamic-labs/iconic": "^0.1.19",
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.9";
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
- "@dynamic-labs/iconic": "^0.1.16",
6
- "@dynamic-labs/wallet-book": "^0.0.11",
5
+ "@dynamic-labs/iconic": "^0.1.19",
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.9",
3
+ "version": "0.16.11",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -9,17 +9,17 @@
9
9
  "dependencies": {
10
10
  "react-focus-lock": "^2.9.2",
11
11
  "@dynamic-labs/sdk-api": "0.0.174",
12
- "@dynamic-labs/iconic": "^0.1.16",
13
- "@dynamic-labs/wallet-book": "^0.0.11",
12
+ "@dynamic-labs/iconic": "^0.1.19",
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.9",
21
- "@dynamic-labs/multi-wallet": "0.16.9",
22
- "@dynamic-labs/wallet-connector-core": "0.16.9"
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"
@@ -69,7 +69,7 @@ export interface IDynamicContext {
69
69
  setMultiWalletWidgetState: MultiWalletWidgetStateSetter;
70
70
  setNetwork: Dispatch<SetStateAction<number | undefined>>;
71
71
  setOnboardingOnlyJwt: Dispatch<SetStateAction<string | undefined>>;
72
- setPrimaryWallet: (walletId: string) => void;
72
+ setPrimaryWallet: (walletId: string) => Promise<void>;
73
73
  setPrimaryWalletId: (walletId: string) => void;
74
74
  setQrcodeUri: Dispatch<SetStateAction<string>>;
75
75
  setSelectedWalletConnector: (connector: WalletConnector | null) => void;
@@ -2,6 +2,21 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const isProgrammableNetworkSwitchSupported = (walletConnector) => walletConnector.switchNetworkOnlyFromWallet !== true;
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
- const isProgrammableNetworkSwitchSupported = (walletConnector) => walletConnector.switchNetworkOnlyFromWallet !== true;
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
- const _isProgrammableNetworkSwitchSupported = isProgrammableNetworkSwitchSupported.isProgrammableNetworkSwitchSupported(walletConnector);
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
- const _isProgrammableNetworkSwitchSupported = isProgrammableNetworkSwitchSupported(walletConnector);
139
- if (_isProgrammableNetworkSwitchSupported) {
138
+ if (isProgrammableNetworkSwitchSupported(walletConnector)) {
140
139
  return setView('network-not-supported');
141
140
  }
142
141
  return setView('network-not-supported-manual');