@dynamic-labs/sdk-react-core 4.8.2 → 4.8.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.
Files changed (57) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.cjs +2 -2
  3. package/package.js +2 -2
  4. package/package.json +12 -12
  5. package/src/index.cjs +2 -0
  6. package/src/index.d.ts +1 -1
  7. package/src/index.js +1 -0
  8. package/src/lib/components/ShadowDOM/utils.cjs +1 -0
  9. package/src/lib/components/ShadowDOM/utils.js +1 -0
  10. package/src/lib/components/SyncAuthFlow/SyncAuthFlow.cjs +2 -0
  11. package/src/lib/components/SyncAuthFlow/SyncAuthFlow.js +2 -0
  12. package/src/lib/context/PhantomRedirectContext/PhantomRedirectContext.cjs +1 -1
  13. package/src/lib/context/PhantomRedirectContext/PhantomRedirectContext.js +2 -2
  14. package/src/lib/context/PhantomRedirectContext/useResponseHandlers.cjs +0 -4
  15. package/src/lib/context/PhantomRedirectContext/useResponseHandlers.js +0 -4
  16. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +2 -0
  17. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +2 -0
  18. package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.cjs +1 -0
  19. package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.js +1 -0
  20. package/src/lib/locale/en/translation.cjs +2 -1
  21. package/src/lib/locale/en/translation.d.ts +2 -1
  22. package/src/lib/locale/en/translation.js +2 -1
  23. package/src/lib/shared/utils/functions/getInitialUrl/getInitialUrl.cjs +1 -0
  24. package/src/lib/shared/utils/functions/getInitialUrl/getInitialUrl.js +1 -0
  25. package/src/lib/store/state/dynamicContextProps/dynamicContextProps.cjs +2 -0
  26. package/src/lib/store/state/dynamicContextProps/dynamicContextProps.d.ts +2 -0
  27. package/src/lib/store/state/dynamicContextProps/dynamicContextProps.js +2 -1
  28. package/src/lib/utils/functions/coinbaseOnramp/formatCoinbaseOnrampUrl.cjs +2 -2
  29. package/src/lib/utils/functions/coinbaseOnramp/formatCoinbaseOnrampUrl.js +2 -2
  30. package/src/lib/utils/functions/generateMessages/index.cjs +3 -2
  31. package/src/lib/utils/functions/generateMessages/index.js +4 -3
  32. package/src/lib/utils/functions/getAppOrigin/getAppOrigin.cjs +1 -0
  33. package/src/lib/utils/functions/getAppOrigin/getAppOrigin.js +1 -0
  34. package/src/lib/utils/functions/isProgrammableNetworkSwitchSupported/isProgrammableNetworkSwitchSupported.cjs +1 -0
  35. package/src/lib/utils/functions/isProgrammableNetworkSwitchSupported/isProgrammableNetworkSwitchSupported.js +1 -0
  36. package/src/lib/utils/hooks/index.d.ts +2 -0
  37. package/src/lib/utils/hooks/useDynamicWaas/constants.cjs +10 -0
  38. package/src/lib/utils/hooks/useDynamicWaas/constants.d.ts +2 -0
  39. package/src/lib/utils/hooks/useDynamicWaas/constants.js +5 -0
  40. package/src/lib/utils/hooks/useDynamicWaas/index.d.ts +1 -0
  41. package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +220 -0
  42. package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.d.ts +21 -0
  43. package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +215 -0
  44. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +9 -5
  45. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +10 -6
  46. package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.cjs +14 -1
  47. package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.js +15 -2
  48. package/src/lib/utils/hooks/useSyncDynamicWaas/index.d.ts +1 -0
  49. package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.cjs +145 -0
  50. package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.d.ts +1 -0
  51. package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.js +141 -0
  52. package/src/lib/views/UserDeleteAccountView/UserDeleteAccountView.cjs +6 -3
  53. package/src/lib/views/UserDeleteAccountView/UserDeleteAccountView.js +6 -3
  54. package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.cjs +1 -1
  55. package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.js +1 -1
  56. package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.cjs +1 -1
  57. package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.js +1 -1
package/CHANGELOG.md CHANGED
@@ -1,4 +1,20 @@
1
1
 
2
+ ### [4.8.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.8.3...v4.8.4) (2025-03-05)
3
+
4
+
5
+ ### Features
6
+
7
+ * add iframe deeplink support for iOS Safari ([#8168](https://github.com/dynamic-labs/dynamic-auth/issues/8168)) ([cc4a6b9](https://github.com/dynamic-labs/dynamic-auth/commit/cc4a6b94b8e1b36b303ea5bf86734ba2e73bcef9))
8
+ * add binance bitcoin wallet support ([#8089](ttps://github.com/dynamic-labs/dynamic-auth/issues/8089)) ([c8a3a41](https://github.com/dynamic-labs/dynamic-auth/commit/c8a3a418e4f431b3442e5bc7332530b777e223c8))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * mobile wallet iframe redirects ([#8213](https://github.com/dynamic-labs/dynamic-auth/issues/8213)) ([96ea428](https://github.com/dynamic-labs/dynamic-auth/commit/96ea428375232e57379faef6e2a61dd818325777))
14
+
15
+ ### [4.8.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.8.2...v4.8.3) (2025-03-04)
16
+
17
+
2
18
  ### [4.8.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.8.1...v4.8.2) (2025-03-01)
3
19
 
4
20
 
package/package.cjs CHANGED
@@ -3,9 +3,9 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.8.2";
6
+ var version = "4.8.4";
7
7
  var dependencies = {
8
- "@dynamic-labs/sdk-api-core": "0.0.633",
8
+ "@dynamic-labs/sdk-api-core": "0.0.638",
9
9
  "@hcaptcha/react-hcaptcha": "1.4.4",
10
10
  "@thumbmarkjs/thumbmarkjs": "0.16.0",
11
11
  "country-list": "2.3.0",
package/package.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use client'
2
- var version = "4.8.2";
2
+ var version = "4.8.4";
3
3
  var dependencies = {
4
- "@dynamic-labs/sdk-api-core": "0.0.633",
4
+ "@dynamic-labs/sdk-api-core": "0.0.638",
5
5
  "@hcaptcha/react-hcaptcha": "1.4.4",
6
6
  "@thumbmarkjs/thumbmarkjs": "0.16.0",
7
7
  "country-list": "2.3.0",
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "4.8.2",
3
+ "version": "4.8.4",
4
4
  "dependencies": {
5
- "@dynamic-labs/sdk-api-core": "0.0.633",
5
+ "@dynamic-labs/sdk-api-core": "0.0.638",
6
6
  "@hcaptcha/react-hcaptcha": "1.4.4",
7
7
  "@thumbmarkjs/thumbmarkjs": "0.16.0",
8
8
  "country-list": "2.3.0",
@@ -14,16 +14,16 @@
14
14
  "yup": "0.32.11",
15
15
  "react-international-phone": "4.2.5",
16
16
  "bs58": "5.0.0",
17
- "@dynamic-labs/assert-package-version": "4.8.2",
18
- "@dynamic-labs/iconic": "4.8.2",
19
- "@dynamic-labs/logger": "4.8.2",
20
- "@dynamic-labs/multi-wallet": "4.8.2",
21
- "@dynamic-labs/rpc-providers": "4.8.2",
22
- "@dynamic-labs/store": "4.8.2",
23
- "@dynamic-labs/types": "4.8.2",
24
- "@dynamic-labs/utils": "4.8.2",
25
- "@dynamic-labs/wallet-book": "4.8.2",
26
- "@dynamic-labs/wallet-connector-core": "4.8.2",
17
+ "@dynamic-labs/assert-package-version": "4.8.4",
18
+ "@dynamic-labs/iconic": "4.8.4",
19
+ "@dynamic-labs/logger": "4.8.4",
20
+ "@dynamic-labs/multi-wallet": "4.8.4",
21
+ "@dynamic-labs/rpc-providers": "4.8.4",
22
+ "@dynamic-labs/store": "4.8.4",
23
+ "@dynamic-labs/types": "4.8.4",
24
+ "@dynamic-labs/utils": "4.8.4",
25
+ "@dynamic-labs/wallet-book": "4.8.4",
26
+ "@dynamic-labs/wallet-connector-core": "4.8.4",
27
27
  "eventemitter3": "5.0.1"
28
28
  },
29
29
  "devDependencies": {
package/src/index.cjs CHANGED
@@ -142,6 +142,7 @@ var WalletList = require('./lib/views/WalletList/WalletList.cjs');
142
142
  var FarcasterConnectView = require('./lib/views/FarcasterConnectView/FarcasterConnectView.cjs');
143
143
  var NetworkNotSupportedSwitchManual = require('./lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs');
144
144
  var viewToComponentMap = require('./lib/views/viewToComponentMap.cjs');
145
+ var useDynamicWaas = require('./lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs');
145
146
  var useDynamicModals = require('./lib/utils/hooks/useDynamicModals/useDynamicModals.cjs');
146
147
  var useMfa = require('./lib/utils/hooks/useMfa/useMfa.cjs');
147
148
  var useTokenBalances = require('./lib/utils/hooks/useTokenBalances/useTokenBalances.cjs');
@@ -268,6 +269,7 @@ exports.WalletList = WalletList.WalletList;
268
269
  exports.FarcasterConnectView = FarcasterConnectView.FarcasterConnectView;
269
270
  exports.NetworkNotSupportedSwitchManual = NetworkNotSupportedSwitchManual.NetworkNotSupportedSwitchManual;
270
271
  exports.viewToComponentMap = viewToComponentMap.viewToComponentMap;
272
+ exports.useDynamicWaas = useDynamicWaas.useDynamicWaas;
271
273
  exports.useDynamicModals = useDynamicModals.useDynamicModals;
272
274
  exports.useMfa = useMfa.useMfa;
273
275
  exports.useTokenBalances = useTokenBalances.useTokenBalances;
package/src/index.d.ts CHANGED
@@ -114,7 +114,7 @@ export { FilterAndSortWallets, FilterBridgeChainsName, FilterChain, FilterWallet
114
114
  export {
115
115
  /** @deprecated */
116
116
  DynamicWidgetContextProvider, } from './lib/widgets/DynamicWidget/context';
117
- export { useWalletItemActions, useAuthenticateConnectedUser, useSocialAccounts, useEmbeddedWallet, useEmbeddedWalletAuthenticator, usePasskeyRecovery, useEmbeddedReveal, useIsLoggedIn, useDynamicModals, useMfa, useTokenBalances, useSwitchWallet, useRpcProviders, useRefreshUser, useWalletOptions, useSmartWallets, EmbeddedWalletVersion, useTelegramLogin, useUpgradeEmbeddedWallet, useEVMTransactionSimulation, useSVMTransactionSimulation, useDeleteUserAccount, } from './lib/utils/hooks';
117
+ export { useWalletItemActions, useAuthenticateConnectedUser, useSocialAccounts, useEmbeddedWallet, useEmbeddedWalletAuthenticator, usePasskeyRecovery, useEmbeddedReveal, useIsLoggedIn, useDynamicModals, useMfa, useTokenBalances, useSwitchWallet, useRpcProviders, useRefreshUser, useWalletOptions, useSmartWallets, EmbeddedWalletVersion, useTelegramLogin, useUpgradeEmbeddedWallet, useEVMTransactionSimulation, useSVMTransactionSimulation, useDeleteUserAccount, useDynamicWaas, } from './lib/utils/hooks';
118
118
  export {
119
119
  /** @deprecated use useOnramp instead */
120
120
  useFunding, } from './lib/utils/hooks/useFunding';
package/src/index.js CHANGED
@@ -138,6 +138,7 @@ export { WalletList } from './lib/views/WalletList/WalletList.js';
138
138
  export { FarcasterConnectView } from './lib/views/FarcasterConnectView/FarcasterConnectView.js';
139
139
  export { NetworkNotSupportedSwitchManual } from './lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js';
140
140
  export { viewToComponentMap } from './lib/views/viewToComponentMap.js';
141
+ export { useDynamicWaas } from './lib/utils/hooks/useDynamicWaas/useDynamicWaas.js';
141
142
  export { useDynamicModals } from './lib/utils/hooks/useDynamicModals/useDynamicModals.js';
142
143
  export { useMfa } from './lib/utils/hooks/useMfa/useMfa.js';
143
144
  export { useTokenBalances } from './lib/utils/hooks/useTokenBalances/useTokenBalances.js';
@@ -21,6 +21,7 @@ const isShadowDOMFlagEnabled = () => {
21
21
  if (isSSR.isSSR())
22
22
  return false;
23
23
  const flag = 'shadowDOM.enabled';
24
+ // TODO: use PlatformService
24
25
  const searchParams = new URLSearchParams(window.location.search);
25
26
  // by default, enable the widget
26
27
  if (!searchParams.has(flag)) {
@@ -17,6 +17,7 @@ const isShadowDOMFlagEnabled = () => {
17
17
  if (isSSR())
18
18
  return false;
19
19
  const flag = 'shadowDOM.enabled';
20
+ // TODO: use PlatformService
20
21
  const searchParams = new URLSearchParams(window.location.search);
21
22
  // by default, enable the widget
22
23
  if (!searchParams.has(flag)) {
@@ -95,9 +95,11 @@ var useSyncEmbeddedWalletFlow = require('../../utils/hooks/useSyncEmbeddedWallet
95
95
  var useSyncOnboardingFlow = require('../../utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.cjs');
96
96
  var useSyncMfaFlow = require('../../utils/hooks/useSyncMfaFlow/useSyncMfaFlow.cjs');
97
97
  require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
98
+ var useSyncDynamicWaas = require('../../utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.cjs');
98
99
 
99
100
  const SyncAuthFlow = () => {
100
101
  useSyncOnboardingFlow.useSyncOnboardingFlow();
102
+ useSyncDynamicWaas.useSyncDynamicWaas();
101
103
  useSyncEmbeddedWalletFlow.useSyncEmbeddedWalletFlow();
102
104
  useSyncMfaFlow.useSyncMfaFlow();
103
105
  return null;
@@ -91,9 +91,11 @@ import { useSyncEmbeddedWalletFlow } from '../../utils/hooks/useSyncEmbeddedWall
91
91
  import { useSyncOnboardingFlow } from '../../utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.js';
92
92
  import { useSyncMfaFlow } from '../../utils/hooks/useSyncMfaFlow/useSyncMfaFlow.js';
93
93
  import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
94
+ import { useSyncDynamicWaas } from '../../utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.js';
94
95
 
95
96
  const SyncAuthFlow = () => {
96
97
  useSyncOnboardingFlow();
98
+ useSyncDynamicWaas();
97
99
  useSyncEmbeddedWalletFlow();
98
100
  useSyncMfaFlow();
99
101
  return null;
@@ -103,7 +103,7 @@ const PhantomRedirectContextProvider = ({ children, }) => {
103
103
  if (!phantomRedirectConnector || !utils.isMobile() || !sdkHasLoaded) {
104
104
  return;
105
105
  }
106
- const params = new URLSearchParams(window.location.search);
106
+ const params = utils.PlatformService.getUrl().searchParams;
107
107
  if (params.has('errorCode')) {
108
108
  handleErrorResponse(params);
109
109
  return;
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import { createContext, useEffect } from 'react';
4
- import { isMobile } from '@dynamic-labs/utils';
4
+ import { isMobile, PlatformService } from '@dynamic-labs/utils';
5
5
  import '../DynamicContext/DynamicContext.js';
6
6
  import '@dynamic-labs/sdk-api-core';
7
7
  import '../../shared/logger.js';
@@ -99,7 +99,7 @@ const PhantomRedirectContextProvider = ({ children, }) => {
99
99
  if (!phantomRedirectConnector || !isMobile() || !sdkHasLoaded) {
100
100
  return;
101
101
  }
102
- const params = new URLSearchParams(window.location.search);
102
+ const params = PlatformService.getUrl().searchParams;
103
103
  if (params.has('errorCode')) {
104
104
  handleErrorResponse(params);
105
105
  return;
@@ -247,10 +247,6 @@ const useResponseHandlers = () => {
247
247
  if (!errorCode)
248
248
  return;
249
249
  setErrorMessage(errorCode);
250
- params.delete('errorCode');
251
- params.delete('errorMessage');
252
- // eslint-disable-next-line no-restricted-globals
253
- history.replaceState(null, '', `${window.location.origin}${window.location.pathname}?${params.toString()}`);
254
250
  const method = phantomRedirectConnector.consumeMethod();
255
251
  switch (method) {
256
252
  case 'signAndSendTransaction':
@@ -243,10 +243,6 @@ const useResponseHandlers = () => {
243
243
  if (!errorCode)
244
244
  return;
245
245
  setErrorMessage(errorCode);
246
- params.delete('errorCode');
247
- params.delete('errorMessage');
248
- // eslint-disable-next-line no-restricted-globals
249
- history.replaceState(null, '', `${window.location.origin}${window.location.pathname}?${params.toString()}`);
250
246
  const method = phantomRedirectConnector.consumeMethod();
251
247
  switch (method) {
252
248
  case 'signAndSendTransaction':
@@ -148,6 +148,7 @@ const SocialRedirectContextProvider = ({ children, }) => {
148
148
  React.useEffect(() => {
149
149
  var _a, _b;
150
150
  if (!projectSettings || !socialWalletConnector || !sdkHasLoaded) {
151
+ // TODO: use PlatformService
151
152
  const params = new URLSearchParams(window.location.search);
152
153
  if (params.has('magic_oauth_request_id')) {
153
154
  clearStackAndPush('social-redirect-view');
@@ -155,6 +156,7 @@ const SocialRedirectContextProvider = ({ children, }) => {
155
156
  }
156
157
  return;
157
158
  }
159
+ // TODO: use PlatformService
158
160
  const params = new URLSearchParams(window.location.search);
159
161
  if (params.has('error') && params.has('provider')) {
160
162
  const errorDescription = params.get('error_description');
@@ -144,6 +144,7 @@ const SocialRedirectContextProvider = ({ children, }) => {
144
144
  useEffect(() => {
145
145
  var _a, _b;
146
146
  if (!projectSettings || !socialWalletConnector || !sdkHasLoaded) {
147
+ // TODO: use PlatformService
147
148
  const params = new URLSearchParams(window.location.search);
148
149
  if (params.has('magic_oauth_request_id')) {
149
150
  clearStackAndPush('social-redirect-view');
@@ -151,6 +152,7 @@ const SocialRedirectContextProvider = ({ children, }) => {
151
152
  }
152
153
  return;
153
154
  }
155
+ // TODO: use PlatformService
154
156
  const params = new URLSearchParams(window.location.search);
155
157
  if (params.has('error') && params.has('provider')) {
156
158
  const errorDescription = params.get('error_description');
@@ -128,6 +128,7 @@ const useRedirectSocialHandler = ({ setSocialProvider, }) => {
128
128
  // Do not run on server side
129
129
  if (isSSR.isSSR())
130
130
  return;
131
+ // TODO: use PlatformService
131
132
  const url = new URL(redirectUrl !== null && redirectUrl !== void 0 ? redirectUrl : window.location.href);
132
133
  const dynamicOauthState = url.searchParams.get('dynamicOauthState');
133
134
  const dynamicOauthCode = url.searchParams.get('dynamicOauthCode');
@@ -124,6 +124,7 @@ const useRedirectSocialHandler = ({ setSocialProvider, }) => {
124
124
  // Do not run on server side
125
125
  if (isSSR())
126
126
  return;
127
+ // TODO: use PlatformService
127
128
  const url = new URL(redirectUrl !== null && redirectUrl !== void 0 ? redirectUrl : window.location.href);
128
129
  const dynamicOauthState = url.searchParams.get('dynamicOauthState');
129
130
  const dynamicOauthCode = url.searchParams.get('dynamicOauthCode');
@@ -995,7 +995,8 @@ const translation = {
995
995
  delete_account: {
996
996
  title: 'Delete My Account',
997
997
  description: 'Deleting your account will permanently remove all data, including wallet details and linked smart contract wallets. This action cannot be undone.',
998
- backup_confirmation: "I confirm I've backed up my wallet key. If I return, a new wallet will be created.",
998
+ backup_confirmation_embedded: "I confirm I've backed up my wallet keys. If I proceed, a new wallet will be created. Any wallets or assets not backed up will be lost permanently.",
999
+ backup_confirmation_no_embedded: 'I confirm that all of my information will be deleted. If I return, a new user profile will be created. These changes cannot be undone.',
999
1000
  type_delete: 'Enter DELETE in the box below to confirm this action.',
1000
1001
  cancel: 'Cancel',
1001
1002
  confirm: 'Delete Account',
@@ -991,7 +991,8 @@ export declare const translation: {
991
991
  delete_account: {
992
992
  title: string;
993
993
  description: string;
994
- backup_confirmation: string;
994
+ backup_confirmation_embedded: string;
995
+ backup_confirmation_no_embedded: string;
995
996
  type_delete: string;
996
997
  cancel: string;
997
998
  confirm: string;
@@ -991,7 +991,8 @@ const translation = {
991
991
  delete_account: {
992
992
  title: 'Delete My Account',
993
993
  description: 'Deleting your account will permanently remove all data, including wallet details and linked smart contract wallets. This action cannot be undone.',
994
- backup_confirmation: "I confirm I've backed up my wallet key. If I return, a new wallet will be created.",
994
+ backup_confirmation_embedded: "I confirm I've backed up my wallet keys. If I proceed, a new wallet will be created. Any wallets or assets not backed up will be lost permanently.",
995
+ backup_confirmation_no_embedded: 'I confirm that all of my information will be deleted. If I return, a new user profile will be created. These changes cannot be undone.',
995
996
  type_delete: 'Enter DELETE in the box below to confirm this action.',
996
997
  cancel: 'Cancel',
997
998
  confirm: 'Delete Account',
@@ -8,6 +8,7 @@ var isSSR = require('../isSSR/isSSR.cjs');
8
8
  let initialUrl;
9
9
  (() => {
10
10
  if (!isSSR.isSSR()) {
11
+ // TODO: use PlatformService
11
12
  initialUrl = new URL(window.location.href);
12
13
  }
13
14
  })();
@@ -4,6 +4,7 @@ import { isSSR } from '../isSSR/isSSR.js';
4
4
  let initialUrl;
5
5
  (() => {
6
6
  if (!isSSR()) {
7
+ // TODO: use PlatformService
7
8
  initialUrl = new URL(window.location.href);
8
9
  }
9
10
  })();
@@ -20,6 +20,7 @@ const setEnvironmentId = (environmentId) => {
20
20
  const props = getDynamicContextProps();
21
21
  setDynamicContextProps(Object.assign(Object.assign({}, props), { settings: Object.assign(Object.assign({}, props.settings), { environmentId }) }));
22
22
  };
23
+ const useApiBaseUrl = () => useDynamicSettings().apiBaseUrl;
23
24
  const applyDefaultSettings = (settings) => {
24
25
  const newSettings = Object.assign({}, settings);
25
26
  Object.keys(defaultDynamicSettings.defaultDynamicSettings).forEach((key) => {
@@ -72,6 +73,7 @@ exports.getDynamicSettings = getDynamicSettings;
72
73
  exports.getEnvironmentId = getEnvironmentId;
73
74
  exports.setDynamicContextProps = setDynamicContextProps;
74
75
  exports.setEnvironmentId = setEnvironmentId;
76
+ exports.useApiBaseUrl = useApiBaseUrl;
75
77
  exports.useDynamicContextProps = useDynamicContextProps;
76
78
  exports.useDynamicSettings = useDynamicSettings;
77
79
  exports.useEnvironmentId = useEnvironmentId;
@@ -7,6 +7,8 @@ export declare const useDynamicSettings: () => SettingsWithDefaults;
7
7
  export declare const getEnvironmentId: () => string;
8
8
  export declare const useEnvironmentId: () => string;
9
9
  export declare const setEnvironmentId: (environmentId: string) => void;
10
+ export declare const getApiBaseUrl: () => string | undefined;
11
+ export declare const useApiBaseUrl: () => string | undefined;
10
12
  export declare const isBridgeFlow: () => boolean;
11
13
  export declare const applyDefaultSettings: (settings: DynamicContextProps['settings']) => SettingsWithDefaults;
12
14
  export declare const useSyncDynamicContextProps: ({ settings, emitErrors, enableInstrumentation, locale, theme, }: DynamicContextProps) => void;
@@ -16,6 +16,7 @@ const setEnvironmentId = (environmentId) => {
16
16
  const props = getDynamicContextProps();
17
17
  setDynamicContextProps(Object.assign(Object.assign({}, props), { settings: Object.assign(Object.assign({}, props.settings), { environmentId }) }));
18
18
  };
19
+ const useApiBaseUrl = () => useDynamicSettings().apiBaseUrl;
19
20
  const applyDefaultSettings = (settings) => {
20
21
  const newSettings = Object.assign({}, settings);
21
22
  Object.keys(defaultDynamicSettings).forEach((key) => {
@@ -62,4 +63,4 @@ const useSyncDynamicContextProps = ({ settings, emitErrors, enableInstrumentatio
62
63
  ]);
63
64
  };
64
65
 
65
- export { applyDefaultSettings, getDynamicContextProps, getDynamicSettings, getEnvironmentId, setDynamicContextProps, setEnvironmentId, useDynamicContextProps, useDynamicSettings, useEnvironmentId, useSyncDynamicContextProps };
66
+ export { applyDefaultSettings, getDynamicContextProps, getDynamicSettings, getEnvironmentId, setDynamicContextProps, setEnvironmentId, useApiBaseUrl, useDynamicContextProps, useDynamicSettings, useEnvironmentId, useSyncDynamicContextProps };
@@ -11,8 +11,8 @@ const formatCoinbaseOnrampUrl = (url, wallet) => {
11
11
  }
12
12
  const filteredNetworks = networks.filter((network) => !network.isTestnet);
13
13
  const onlyKeys = filteredNetworks
14
- .map((network) => network.key)
15
- .filter((key) => Boolean(key));
14
+ .filter((network) => Boolean(network.key)) // filter out networks without keys
15
+ .map((network) => network.key);
16
16
  const addressesObj = {
17
17
  [wallet.address]: onlyKeys,
18
18
  };
@@ -7,8 +7,8 @@ const formatCoinbaseOnrampUrl = (url, wallet) => {
7
7
  }
8
8
  const filteredNetworks = networks.filter((network) => !network.isTestnet);
9
9
  const onlyKeys = filteredNetworks
10
- .map((network) => network.key)
11
- .filter((key) => Boolean(key));
10
+ .filter((network) => Boolean(network.key)) // filter out networks without keys
11
+ .map((network) => network.key);
12
12
  const addressesObj = {
13
13
  [wallet.address]: onlyKeys,
14
14
  };
@@ -24,10 +24,11 @@ const generateMessages = (publicWalletAddress, walletConnector, nonce, projectEn
24
24
  }
25
25
  }
26
26
  const parsedAddress = walletConnector.parseAddress(publicWalletAddress);
27
+ const currentUrl = utils.PlatformService.getUrl();
27
28
  const messageToSign = multiWallet.generateMessageToSign({
28
29
  blockchain: walletConnector.connectedChain,
29
30
  chainId: chainId,
30
- domain: window.location.host,
31
+ domain: currentUrl.host,
31
32
  nonce,
32
33
  // The SIWE parser library used to validate signed messages for EVM/Ethereum
33
34
  // checks that an address is in EIP55 format, so make sure we do that here.
@@ -38,7 +39,7 @@ const generateMessages = (publicWalletAddress, walletConnector, nonce, projectEn
38
39
  statement: displaySiweStatement
39
40
  ? siweStatement.replace(/(\r\n|\n|\r)/gm, ' ').trim()
40
41
  : undefined,
41
- uri: window.location.origin + window.location.pathname,
42
+ uri: currentUrl.origin + currentUrl.pathname,
42
43
  });
43
44
  const signedMessage = yield walletConnector.proveOwnership(parsedAddress, messageToSign);
44
45
  if (!signedMessage) {
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import { __awaiter } from '../../../../../_virtual/_tslib.js';
3
3
  import { generateMessageToSign } from '@dynamic-labs/multi-wallet';
4
- import { DynamicError } from '@dynamic-labs/utils';
4
+ import { DynamicError, PlatformService } from '@dynamic-labs/utils';
5
5
 
6
6
  const generateMessages = (publicWalletAddress, walletConnector, nonce, projectEnvironmentId, displaySiweStatement, siweStatement) => __awaiter(void 0, void 0, void 0, function* () {
7
7
  if (publicWalletAddress === undefined) {
@@ -20,10 +20,11 @@ const generateMessages = (publicWalletAddress, walletConnector, nonce, projectEn
20
20
  }
21
21
  }
22
22
  const parsedAddress = walletConnector.parseAddress(publicWalletAddress);
23
+ const currentUrl = PlatformService.getUrl();
23
24
  const messageToSign = generateMessageToSign({
24
25
  blockchain: walletConnector.connectedChain,
25
26
  chainId: chainId,
26
- domain: window.location.host,
27
+ domain: currentUrl.host,
27
28
  nonce,
28
29
  // The SIWE parser library used to validate signed messages for EVM/Ethereum
29
30
  // checks that an address is in EIP55 format, so make sure we do that here.
@@ -34,7 +35,7 @@ const generateMessages = (publicWalletAddress, walletConnector, nonce, projectEn
34
35
  statement: displaySiweStatement
35
36
  ? siweStatement.replace(/(\r\n|\n|\r)/gm, ' ').trim()
36
37
  : undefined,
37
- uri: window.location.origin + window.location.pathname,
38
+ uri: currentUrl.origin + currentUrl.pathname,
38
39
  });
39
40
  const signedMessage = yield walletConnector.proveOwnership(parsedAddress, messageToSign);
40
41
  if (!signedMessage) {
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  const getAppOrigin = () => {
7
7
  if (typeof window !== 'undefined') {
8
+ // TODO: use PlatformService
8
9
  return window.location.origin;
9
10
  }
10
11
  return undefined;
@@ -1,6 +1,7 @@
1
1
  'use client'
2
2
  const getAppOrigin = () => {
3
3
  if (typeof window !== 'undefined') {
4
+ // TODO: use PlatformService
4
5
  return window.location.origin;
5
6
  }
6
7
  return undefined;
@@ -10,6 +10,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
10
10
  * @returns {boolean} Whether the programmable network switch feature is supported.
11
11
  */
12
12
  const isProgrammableNetworkSwitchSupported = (walletConnector) => {
13
+ // TODO: use PlatformService
13
14
  const urlParams = new URLSearchParams(window.location.search);
14
15
  // Get the dev_isProgrammableNetworkSwitchSupported parameter from the URL.
15
16
  const devIsProgrammableNetworkSwitchSupported = urlParams.get('dev_isProgrammableNetworkSwitchSupported');
@@ -6,6 +6,7 @@
6
6
  * @returns {boolean} Whether the programmable network switch feature is supported.
7
7
  */
8
8
  const isProgrammableNetworkSwitchSupported = (walletConnector) => {
9
+ // TODO: use PlatformService
9
10
  const urlParams = new URLSearchParams(window.location.search);
10
11
  // Get the dev_isProgrammableNetworkSwitchSupported parameter from the URL.
11
12
  const devIsProgrammableNetworkSwitchSupported = urlParams.get('dev_isProgrammableNetworkSwitchSupported');
@@ -74,3 +74,5 @@ export * from './useEmbeddedWallet';
74
74
  export { useUpgradeEmbeddedWallet } from './useUpgradeEmbeddedWallet';
75
75
  export { useAggregateWalletEvents } from './useAggregateWalletEvents';
76
76
  export { useDeleteUserAccount } from './useDeleteUserAccount';
77
+ export { useDynamicWaas } from './useDynamicWaas';
78
+ export { useSyncDynamicWaas } from './useSyncDynamicWaas';
@@ -0,0 +1,10 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ const NO_ENABLED_CHAINS_ERROR = 'No enabled embedded wallet chains';
7
+ const DYNAMIC_WAAS_CONNECTOR_NOT_FOUND_ERROR = 'Dynamic Waas connector not found';
8
+
9
+ exports.DYNAMIC_WAAS_CONNECTOR_NOT_FOUND_ERROR = DYNAMIC_WAAS_CONNECTOR_NOT_FOUND_ERROR;
10
+ exports.NO_ENABLED_CHAINS_ERROR = NO_ENABLED_CHAINS_ERROR;
@@ -0,0 +1,2 @@
1
+ export declare const NO_ENABLED_CHAINS_ERROR = "No enabled embedded wallet chains";
2
+ export declare const DYNAMIC_WAAS_CONNECTOR_NOT_FOUND_ERROR = "Dynamic Waas connector not found";
@@ -0,0 +1,5 @@
1
+ 'use client'
2
+ const NO_ENABLED_CHAINS_ERROR = 'No enabled embedded wallet chains';
3
+ const DYNAMIC_WAAS_CONNECTOR_NOT_FOUND_ERROR = 'Dynamic Waas connector not found';
4
+
5
+ export { DYNAMIC_WAAS_CONNECTOR_NOT_FOUND_ERROR, NO_ENABLED_CHAINS_ERROR };
@@ -0,0 +1 @@
1
+ export * from './useDynamicWaas';