@dynamic-labs/sdk-react-core 3.0.0-alpha.63 → 3.0.0-alpha.65

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/package.cjs +1 -1
  3. package/package.js +1 -1
  4. package/package.json +11 -11
  5. package/src/lib/components/NetworkPicker/NetworkPicker.cjs +4 -1
  6. package/src/lib/components/NetworkPicker/NetworkPicker.js +4 -1
  7. package/src/lib/config/ApiEndpoint.cjs +6 -20
  8. package/src/lib/config/ApiEndpoint.d.ts +1 -2
  9. package/src/lib/config/ApiEndpoint.js +6 -20
  10. package/src/lib/store/state/networkConfigurations/networkConfigurations.cjs +2 -1
  11. package/src/lib/store/state/networkConfigurations/networkConfigurations.js +2 -1
  12. package/src/lib/styles/index.shadow.cjs +1 -1
  13. package/src/lib/styles/index.shadow.js +1 -1
  14. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +14 -1
  15. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +2 -0
  16. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +15 -2
  17. package/src/lib/utils/hooks/useFetchNonce/useFetchNonce.cjs +1 -0
  18. package/src/lib/utils/hooks/useFetchNonce/useFetchNonce.js +1 -0
  19. package/src/lib/utils/hooks/usePromise/usePromise.cjs +34 -60
  20. package/src/lib/utils/hooks/usePromise/usePromise.d.ts +3 -10
  21. package/src/lib/utils/hooks/usePromise/usePromise.js +35 -61
  22. package/src/lib/utils/hooks/usePromise/usePromise.types.d.ts +24 -7
  23. package/src/lib/utils/hooks/usePromise/utils/resolveFetcher/resolveFetcher.cjs +1 -0
  24. package/src/lib/utils/hooks/usePromise/utils/resolveFetcher/resolveFetcher.d.ts +1 -1
  25. package/src/lib/utils/hooks/usePromise/utils/resolveFetcher/resolveFetcher.js +1 -0
  26. package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +0 -1
  27. package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +0 -1
  28. package/src/lib/views/MfaVerificationView/MfaVerificationView.cjs +1 -0
  29. package/src/lib/views/MfaVerificationView/MfaVerificationView.js +1 -0
  30. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +1 -0
  31. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +1 -0
  32. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +1 -1
  33. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +1 -1
  34. package/src/lib/utils/hooks/usePromise/utils/createReducer/createReducer.cjs +0 -19
  35. package/src/lib/utils/hooks/usePromise/utils/createReducer/createReducer.js +0 -15
package/CHANGELOG.md CHANGED
@@ -1,4 +1,18 @@
1
1
 
2
+ ## [3.0.0-alpha.65](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.64...v3.0.0-alpha.65) (2024-09-11)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * gracefully handle errors when trying to find solana tx destination ([#6847](https://github.com/dynamic-labs/DynamicAuth/issues/6847)) ([19359ad](https://github.com/dynamic-labs/DynamicAuth/commit/19359ad40b16af0edb822d1fc6643fecdbc89adf))
8
+
9
+ ## [3.0.0-alpha.64](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.63...v3.0.0-alpha.64) (2024-09-10)
10
+
11
+
12
+ ### Features
13
+
14
+ * add solana ledger check for connect-only ([#6833](https://github.com/dynamic-labs/DynamicAuth/issues/6833)) ([4829122](https://github.com/dynamic-labs/DynamicAuth/commit/4829122bbd1e04b9b02f8686df5dd5a6d2ae6c1c))
15
+
2
16
  ## [3.0.0-alpha.63](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.62...v3.0.0-alpha.63) (2024-09-10)
3
17
 
4
18
 
package/package.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "3.0.0-alpha.63";
6
+ var version = "3.0.0-alpha.65";
7
7
  var dependencies = {
8
8
  "@dynamic-labs/sdk-api-core": "0.0.526",
9
9
  "@hcaptcha/react-hcaptcha": "1.4.4",
package/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client'
2
- var version = "3.0.0-alpha.63";
2
+ var version = "3.0.0-alpha.65";
3
3
  var dependencies = {
4
4
  "@dynamic-labs/sdk-api-core": "0.0.526",
5
5
  "@hcaptcha/react-hcaptcha": "1.4.4",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "3.0.0-alpha.63",
3
+ "version": "3.0.0-alpha.65",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -17,16 +17,16 @@
17
17
  "react-i18next": "13.5.0",
18
18
  "yup": "0.32.11",
19
19
  "react-international-phone": "4.2.5",
20
- "@dynamic-labs/iconic": "3.0.0-alpha.63",
21
- "@dynamic-labs/logger": "3.0.0-alpha.63",
22
- "@dynamic-labs/message-transport": "3.0.0-alpha.63",
23
- "@dynamic-labs/multi-wallet": "3.0.0-alpha.63",
24
- "@dynamic-labs/rpc-providers": "3.0.0-alpha.63",
25
- "@dynamic-labs/store": "3.0.0-alpha.63",
26
- "@dynamic-labs/types": "3.0.0-alpha.63",
27
- "@dynamic-labs/utils": "3.0.0-alpha.63",
28
- "@dynamic-labs/wallet-book": "3.0.0-alpha.63",
29
- "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.63",
20
+ "@dynamic-labs/iconic": "3.0.0-alpha.65",
21
+ "@dynamic-labs/logger": "3.0.0-alpha.65",
22
+ "@dynamic-labs/message-transport": "3.0.0-alpha.65",
23
+ "@dynamic-labs/multi-wallet": "3.0.0-alpha.65",
24
+ "@dynamic-labs/rpc-providers": "3.0.0-alpha.65",
25
+ "@dynamic-labs/store": "3.0.0-alpha.65",
26
+ "@dynamic-labs/types": "3.0.0-alpha.65",
27
+ "@dynamic-labs/utils": "3.0.0-alpha.65",
28
+ "@dynamic-labs/wallet-book": "3.0.0-alpha.65",
29
+ "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.65",
30
30
  "eventemitter3": "5.0.1"
31
31
  },
32
32
  "devDependencies": {
@@ -105,7 +105,10 @@ const NetworkPicker = ({ activeClassName = '', buttonClassName = '', checkboxCla
105
105
  const { loadingNetwork } = useInternalDynamicContext.useInternalDynamicContext();
106
106
  const { data: supportedWalletNetworks } = usePromise.usePromise(() => walletConnectorCore.isWalletConnectConnector(connector)
107
107
  ? connector.getSupportedNetworks()
108
- : Promise.resolve(evmNetworks.map(({ networkId }) => `${networkId}`)), { deps: [connector, evmNetworks, isNetworkPickerOpen] });
108
+ : Promise.resolve(evmNetworks.map(({ networkId }) => `${networkId}`)), {
109
+ deps: [connector, evmNetworks, isNetworkPickerOpen],
110
+ initialData: undefined,
111
+ });
109
112
  const shouldAllowOpenDropdown = isNetworkUnsupported.isNetworkUnsupported(currentNetwork, evmNetworks) ||
110
113
  (evmNetworks === null || evmNetworks === void 0 ? void 0 : evmNetworks.length) > 1;
111
114
  // Ref to anchor popper to
@@ -101,7 +101,10 @@ const NetworkPicker = ({ activeClassName = '', buttonClassName = '', checkboxCla
101
101
  const { loadingNetwork } = useInternalDynamicContext();
102
102
  const { data: supportedWalletNetworks } = usePromise(() => isWalletConnectConnector(connector)
103
103
  ? connector.getSupportedNetworks()
104
- : Promise.resolve(evmNetworks.map(({ networkId }) => `${networkId}`)), { deps: [connector, evmNetworks, isNetworkPickerOpen] });
104
+ : Promise.resolve(evmNetworks.map(({ networkId }) => `${networkId}`)), {
105
+ deps: [connector, evmNetworks, isNetworkPickerOpen],
106
+ initialData: undefined,
107
+ });
105
108
  const shouldAllowOpenDropdown = isNetworkUnsupported(currentNetwork, evmNetworks) ||
106
109
  (evmNetworks === null || evmNetworks === void 0 ? void 0 : evmNetworks.length) > 1;
107
110
  // Ref to anchor popper to
@@ -7,35 +7,21 @@ var sdkApiCore = require('@dynamic-labs/sdk-api-core');
7
7
  class ApiEndpoint {
8
8
  }
9
9
  ApiEndpoint.getBaseUrl = () => {
10
- if (!ApiEndpoint.__defined__) {
10
+ if (!ApiEndpoint.__baseUrl__) {
11
11
  throw new Error('ApiEndpoint Base URL has not been initialized');
12
12
  }
13
13
  return ApiEndpoint.__baseUrl__;
14
14
  };
15
15
  ApiEndpoint.setBaseUrl = (baseUrlInput) => {
16
- if (!ApiEndpoint.__defined__) {
17
- if (!baseUrlInput) {
18
- /**
19
- * If the baseUrl is not provided, use the default baseUrl from the sdk-api package
20
- */
21
- ApiEndpoint.__baseUrl__ = new sdkApiCore.Configuration().basePath;
22
- }
23
- else {
24
- ApiEndpoint.__baseUrl__ = baseUrlInput;
25
- }
26
- ApiEndpoint.__defined__ = true;
27
- }
28
- else if (!baseUrlInput && ApiEndpoint.__defined__) {
16
+ if (!baseUrlInput) {
29
17
  /**
30
- * If for some reason (usually in local development), the setBaseUrl is called multiple times with undefined
31
- * And we already have it defined, let's just assume it's a no-op
18
+ * If the baseUrl is not provided, use the default baseUrl from the sdk-api package
32
19
  */
33
- return;
20
+ ApiEndpoint.__baseUrl__ = new sdkApiCore.Configuration().basePath;
34
21
  }
35
- else if (ApiEndpoint.__baseUrl__ !== baseUrlInput) {
36
- throw new Error(`ApiEndpoint baseUrl is already set to ${ApiEndpoint.__baseUrl__}, cannot change it to ${baseUrlInput}`);
22
+ else {
23
+ ApiEndpoint.__baseUrl__ = baseUrlInput;
37
24
  }
38
- Object.freeze(ApiEndpoint);
39
25
  };
40
26
 
41
27
  module.exports = ApiEndpoint;
@@ -1,7 +1,6 @@
1
1
  declare class ApiEndpoint {
2
2
  private static __baseUrl__;
3
- private static __defined__;
4
- static getBaseUrl: () => string | undefined;
3
+ static getBaseUrl: () => string;
5
4
  static setBaseUrl: (baseUrlInput?: string) => void;
6
5
  }
7
6
  export default ApiEndpoint;
@@ -5,35 +5,21 @@ import { Configuration } from '@dynamic-labs/sdk-api-core';
5
5
  class ApiEndpoint {
6
6
  }
7
7
  ApiEndpoint.getBaseUrl = () => {
8
- if (!ApiEndpoint.__defined__) {
8
+ if (!ApiEndpoint.__baseUrl__) {
9
9
  throw new Error('ApiEndpoint Base URL has not been initialized');
10
10
  }
11
11
  return ApiEndpoint.__baseUrl__;
12
12
  };
13
13
  ApiEndpoint.setBaseUrl = (baseUrlInput) => {
14
- if (!ApiEndpoint.__defined__) {
15
- if (!baseUrlInput) {
16
- /**
17
- * If the baseUrl is not provided, use the default baseUrl from the sdk-api package
18
- */
19
- ApiEndpoint.__baseUrl__ = new Configuration().basePath;
20
- }
21
- else {
22
- ApiEndpoint.__baseUrl__ = baseUrlInput;
23
- }
24
- ApiEndpoint.__defined__ = true;
25
- }
26
- else if (!baseUrlInput && ApiEndpoint.__defined__) {
14
+ if (!baseUrlInput) {
27
15
  /**
28
- * If for some reason (usually in local development), the setBaseUrl is called multiple times with undefined
29
- * And we already have it defined, let's just assume it's a no-op
16
+ * If the baseUrl is not provided, use the default baseUrl from the sdk-api package
30
17
  */
31
- return;
18
+ ApiEndpoint.__baseUrl__ = new Configuration().basePath;
32
19
  }
33
- else if (ApiEndpoint.__baseUrl__ !== baseUrlInput) {
34
- throw new Error(`ApiEndpoint baseUrl is already set to ${ApiEndpoint.__baseUrl__}, cannot change it to ${baseUrlInput}`);
20
+ else {
21
+ ApiEndpoint.__baseUrl__ = baseUrlInput;
35
22
  }
36
- Object.freeze(ApiEndpoint);
37
23
  };
38
24
 
39
25
  export { ApiEndpoint as default };
@@ -152,11 +152,12 @@ const useNetworkConfigurations = ({ environmentId, projectSettings, evmNetworksO
152
152
  }), {
153
153
  deps: [environmentId, projectSettings, evmNetworksOverrides],
154
154
  enabled: Boolean(projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.networks),
155
+ initialData: undefined,
155
156
  onResolve: (networkConfigurations) => {
156
157
  const expiry = new Date().getTime() + 60000 * 5;
157
158
  setNetworkConfigurations({
158
159
  expiresAt: expiry,
159
- networkConfigurations,
160
+ networkConfigurations: networkConfigurations,
160
161
  });
161
162
  },
162
163
  });
@@ -148,11 +148,12 @@ const useNetworkConfigurations = ({ environmentId, projectSettings, evmNetworksO
148
148
  }), {
149
149
  deps: [environmentId, projectSettings, evmNetworksOverrides],
150
150
  enabled: Boolean(projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.networks),
151
+ initialData: undefined,
151
152
  onResolve: (networkConfigurations) => {
152
153
  const expiry = new Date().getTime() + 60000 * 5;
153
154
  setNetworkConfigurations({
154
155
  expiresAt: expiry,
155
- networkConfigurations,
156
+ networkConfigurations: networkConfigurations,
156
157
  });
157
158
  },
158
159
  });