@dynamic-labs/sdk-react-core 4.66.0 → 4.67.0
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 +19 -0
- package/package.cjs +3 -3
- package/package.js +3 -3
- package/package.json +14 -14
- package/src/index.d.ts +1 -1
- package/src/lib/client/extension/functions/hasElevatedAccessToken/hasElevatedAccessToken.cjs +18 -0
- package/src/lib/client/extension/functions/hasElevatedAccessToken/hasElevatedAccessToken.d.ts +1 -0
- package/src/lib/client/extension/functions/hasElevatedAccessToken/hasElevatedAccessToken.js +14 -0
- package/src/lib/client/extension/functions/hasElevatedAccessToken/index.d.ts +1 -0
- package/src/lib/client/extension/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +20 -19
- package/src/lib/context/DynamicContext/DynamicContext.js +20 -19
- package/src/lib/context/DynamicContext/types/SettingsOverrides.d.ts +10 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/constants/values.cjs +2 -0
- package/src/lib/utils/constants/values.js +2 -0
- package/src/lib/utils/functions/compareChains/compareChains.cjs +1 -0
- package/src/lib/utils/functions/compareChains/compareChains.js +1 -0
- package/src/lib/utils/hooks/index.d.ts +1 -1
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +2 -1
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.d.ts +2 -1
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +2 -1
- package/src/lib/utils/hooks/useNetworkConfigurationsFromProjectSettings/useNetworkConfigurationsFromProjectSettings.cjs +7 -2
- package/src/lib/utils/hooks/useNetworkConfigurationsFromProjectSettings/useNetworkConfigurationsFromProjectSettings.d.ts +2 -1
- package/src/lib/utils/hooks/useNetworkConfigurationsFromProjectSettings/useNetworkConfigurationsFromProjectSettings.js +7 -2
- package/src/lib/utils/hooks/useStepUpAuthentication/index.d.ts +1 -1
- package/src/lib/utils/hooks/useStepUpAuthentication/useStepUpAuthentication.cjs +102 -23
- package/src/lib/utils/hooks/useStepUpAuthentication/useStepUpAuthentication.d.ts +35 -15
- package/src/lib/utils/hooks/useStepUpAuthentication/useStepUpAuthentication.js +103 -24
- package/src/lib/utils/hooks/useWalletConnectorNetwork/useWalletConnectorNetwork.cjs +3 -2
- package/src/lib/utils/hooks/useWalletConnectorNetwork/useWalletConnectorNetwork.js +3 -2
- package/src/lib/views/CollectUserDataView/UserDataFields/UserPhoneField/UserPhoneField.cjs +10 -6
- package/src/lib/views/CollectUserDataView/UserDataFields/UserPhoneField/UserPhoneField.js +11 -7
- package/src/lib/views/SendBalanceView/SendBalanceView.cjs +1 -0
- package/src/lib/views/SendBalanceView/SendBalanceView.js +1 -0
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +21 -1
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +21 -1
- package/src/lib/views/WalletList/data.cjs +1 -0
- package/src/lib/views/WalletList/data.d.ts +1 -1
- package/src/lib/views/WalletList/data.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.67.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.66.0...v4.67.0) (2026-03-09)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add MFA methods to useStepUpAuthentication hook ([#10581](https://github.com/dynamic-labs/dynamic-auth/issues/10581)) ([7903290](https://github.com/dynamic-labs/dynamic-auth/commit/79032906d548ba2d4bcdf69cd9e6eb820064e408)), closes [dynamic-labs/dynamic-js-sdk#1061](https://github.com/dynamic-labs/dynamic-js-sdk/issues/1061) [dynamic-labs/dynamic-js-sdk#1062](https://github.com/dynamic-labs/dynamic-js-sdk/issues/1062)
|
|
8
|
+
* **demo:** add Passkey MFA and TOTP MFA step-up auth demos ([#10582](https://github.com/dynamic-labs/dynamic-auth/issues/10582)) ([92b9e28](https://github.com/dynamic-labs/dynamic-auth/commit/92b9e28e62084031a8bca11216aab39198948e82)), closes [#10581](https://github.com/dynamic-labs/dynamic-auth/issues/10581)
|
|
9
|
+
* **demo:** add Step-up Auth section ([#10483](https://github.com/dynamic-labs/dynamic-auth/issues/10483)) ([4bfff9a](https://github.com/dynamic-labs/dynamic-auth/commit/4bfff9a0fe475b4d8dbb6b8c4fccebb6550aa06f))
|
|
10
|
+
* **react-native:** add minifiedToken support to authModule ([#10595](https://github.com/dynamic-labs/dynamic-auth/issues/10595)) ([6b6e067](https://github.com/dynamic-labs/dynamic-auth/commit/6b6e067e62b97f573a31140967f3a07064e9f3fd))
|
|
11
|
+
* **stellar:** add account activation handling for unfunded recipients ([#10578](https://github.com/dynamic-labs/dynamic-auth/issues/10578)) ([ea5ef7b](https://github.com/dynamic-labs/dynamic-auth/commit/ea5ef7bfce7cf984ff091ea7d6321814dc3eea81))
|
|
12
|
+
* update demo CTA buttons - 'Book a call' and 'Get a free account' ([#10589](https://github.com/dynamic-labs/dynamic-auth/issues/10589)) ([e7d967c](https://github.com/dynamic-labs/dynamic-auth/commit/e7d967c59c5ad616348d9a51ea4bd314ec1ddd9f))
|
|
13
|
+
* **waas:** add password support to upgradeToDynamicWaas ([#10606](https://github.com/dynamic-labs/dynamic-auth/issues/10606)) ([d998a3e](https://github.com/dynamic-labs/dynamic-auth/commit/d998a3e955110f419dc40c4aeaddd93834957eb7))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* add overflow-y auto to backup codes view to prevent Complete button cutoff ([#10513](https://github.com/dynamic-labs/dynamic-auth/issues/10513)) ([5dfa94e](https://github.com/dynamic-labs/dynamic-auth/commit/5dfa94eaa232535f2e8c6905370dd8d8546485e3))
|
|
19
|
+
* prevent infinite re-render loop in UserPhoneField due to rapid t… ([#10475](https://github.com/dynamic-labs/dynamic-auth/issues/10475)) ([0d79b07](https://github.com/dynamic-labs/dynamic-auth/commit/0d79b0782606c9fa926ed4697a17381211ad2f4a))
|
|
20
|
+
|
|
2
21
|
## [4.66.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.65.0...v4.66.0) (2026-03-02)
|
|
3
22
|
|
|
4
23
|
|
package/package.cjs
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var version = "4.
|
|
6
|
+
var version = "4.67.0";
|
|
7
7
|
var dependencies = {
|
|
8
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
9
|
-
"@dynamic-labs-sdk/client": "0.
|
|
8
|
+
"@dynamic-labs/sdk-api-core": "0.0.881",
|
|
9
|
+
"@dynamic-labs-sdk/client": "0.14.0",
|
|
10
10
|
"@dynamic-labs-wallet/browser-wallet-client": "0.0.289",
|
|
11
11
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
12
12
|
"@thumbmarkjs/thumbmarkjs": "0.16.0",
|
package/package.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
var version = "4.
|
|
2
|
+
var version = "4.67.0";
|
|
3
3
|
var dependencies = {
|
|
4
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
5
|
-
"@dynamic-labs-sdk/client": "0.
|
|
4
|
+
"@dynamic-labs/sdk-api-core": "0.0.881",
|
|
5
|
+
"@dynamic-labs-sdk/client": "0.14.0",
|
|
6
6
|
"@dynamic-labs-wallet/browser-wallet-client": "0.0.289",
|
|
7
7
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
8
8
|
"@thumbmarkjs/thumbmarkjs": "0.16.0",
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.67.0",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
6
|
-
"@dynamic-labs-sdk/client": "0.
|
|
5
|
+
"@dynamic-labs/sdk-api-core": "0.0.881",
|
|
6
|
+
"@dynamic-labs-sdk/client": "0.14.0",
|
|
7
7
|
"@dynamic-labs-wallet/browser-wallet-client": "0.0.289",
|
|
8
8
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
9
9
|
"@thumbmarkjs/thumbmarkjs": "0.16.0",
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
"yup": "0.32.11",
|
|
17
17
|
"react-international-phone": "4.5.0",
|
|
18
18
|
"bs58": "5.0.0",
|
|
19
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
20
|
-
"@dynamic-labs/iconic": "4.
|
|
21
|
-
"@dynamic-labs/locale": "4.
|
|
22
|
-
"@dynamic-labs/logger": "4.
|
|
23
|
-
"@dynamic-labs/multi-wallet": "4.
|
|
24
|
-
"@dynamic-labs/rpc-providers": "4.
|
|
25
|
-
"@dynamic-labs/store": "4.
|
|
26
|
-
"@dynamic-labs/types": "4.
|
|
27
|
-
"@dynamic-labs/utils": "4.
|
|
28
|
-
"@dynamic-labs/wallet-book": "4.
|
|
29
|
-
"@dynamic-labs/wallet-connector-core": "4.
|
|
19
|
+
"@dynamic-labs/assert-package-version": "4.67.0",
|
|
20
|
+
"@dynamic-labs/iconic": "4.67.0",
|
|
21
|
+
"@dynamic-labs/locale": "4.67.0",
|
|
22
|
+
"@dynamic-labs/logger": "4.67.0",
|
|
23
|
+
"@dynamic-labs/multi-wallet": "4.67.0",
|
|
24
|
+
"@dynamic-labs/rpc-providers": "4.67.0",
|
|
25
|
+
"@dynamic-labs/store": "4.67.0",
|
|
26
|
+
"@dynamic-labs/types": "4.67.0",
|
|
27
|
+
"@dynamic-labs/utils": "4.67.0",
|
|
28
|
+
"@dynamic-labs/wallet-book": "4.67.0",
|
|
29
|
+
"@dynamic-labs/wallet-connector-core": "4.67.0",
|
|
30
30
|
"eventemitter3": "5.0.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
package/src/index.d.ts
CHANGED
|
@@ -124,7 +124,7 @@ export {
|
|
|
124
124
|
/** @deprecated */
|
|
125
125
|
DynamicWidgetContextProvider, } from './lib/widgets/DynamicWidget/context';
|
|
126
126
|
export { useWalletItemActions, useAuthenticateConnectedUser, useSocialAccounts, useEmbeddedWallet, useEmbeddedWalletAuthenticator, usePasskeyRecovery, useEmbeddedReveal, useIsLoggedIn, useDynamicModals, useMfa, useTokenBalances, useMultichainTokenBalances, useSwitchWallet, useRpcProviders, useRefreshUser, useRefreshAuth, useWalletOptions, useSmartWallets, useSignEip7702Authorization, EmbeddedWalletVersion, useTelegramLogin, useUpgradeEmbeddedWallet, useEVMTransactionSimulation, useSVMTransactionSimulation, useDeleteUserAccount, useDynamicWaas, useGetPasskeys, useDeletePasskey, useRegisterPasskey, useAuthenticatePasskeyMFA, useGetUserMfaMethods, usePromptMfaAuth, useUpgradeToDynamicWaasFlow, useGetMfaToken, useGetWalletPassword, useWalletPassword, useIsMfaRequiredForAction, useWalletDelegation, useWalletBackup, useBackupWallets, isWalletBackedUp, CloudBackupProvider, useExchangeAccounts, useStepUpAuthentication, } from './lib/utils/hooks';
|
|
127
|
-
export type { StepUpAuthenticationState, UseStepUpAuthenticationParams, UseStepUpAuthenticationReturn, VerifyOtpParams, VerifyWalletParams, } from './lib/utils/hooks';
|
|
127
|
+
export type { IsStepUpRequiredParams, StepUpAuthenticationState, UseStepUpAuthenticationParams, UseStepUpAuthenticationReturn, VerifyOtpParams, VerifyPasskeyMfaParams, VerifyTotpMfaParams, VerifyWalletParams, } from './lib/utils/hooks';
|
|
128
128
|
export {
|
|
129
129
|
/** @deprecated use useOnramp instead */
|
|
130
130
|
useFunding, } from './lib/utils/hooks/useFunding';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var client = require('@dynamic-labs-sdk/client');
|
|
7
|
+
var core = require('@dynamic-labs-sdk/client/core');
|
|
8
|
+
|
|
9
|
+
const EXPIRATION_BUFFER_MS = 5000;
|
|
10
|
+
const hasElevatedAccessToken = (scope) => {
|
|
11
|
+
const { elevatedAccessTokens = [] } = core.getCore(client.getDefaultClient()).state.get();
|
|
12
|
+
// Add a buffer to the expiration date to account for delay between token check and its usage
|
|
13
|
+
const threshold = new Date(Date.now() + EXPIRATION_BUFFER_MS);
|
|
14
|
+
return elevatedAccessTokens.some((token) => token.scopes.includes(scope) &&
|
|
15
|
+
(!token.expiresAt || token.expiresAt > threshold));
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
exports.hasElevatedAccessToken = hasElevatedAccessToken;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const hasElevatedAccessToken: (scope: string) => boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { getDefaultClient } from '@dynamic-labs-sdk/client';
|
|
3
|
+
import { getCore } from '@dynamic-labs-sdk/client/core';
|
|
4
|
+
|
|
5
|
+
const EXPIRATION_BUFFER_MS = 5000;
|
|
6
|
+
const hasElevatedAccessToken = (scope) => {
|
|
7
|
+
const { elevatedAccessTokens = [] } = getCore(getDefaultClient()).state.get();
|
|
8
|
+
// Add a buffer to the expiration date to account for delay between token check and its usage
|
|
9
|
+
const threshold = new Date(Date.now() + EXPIRATION_BUFFER_MS);
|
|
10
|
+
return elevatedAccessTokens.some((token) => token.scopes.includes(scope) &&
|
|
11
|
+
(!token.expiresAt || token.expiresAt > threshold));
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { hasElevatedAccessToken };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { hasElevatedAccessToken } from './hasElevatedAccessToken';
|
|
@@ -14,5 +14,6 @@ export { isCookieEnabled } from './functions/isCookieEnabled';
|
|
|
14
14
|
export { getMinAuthToken } from './functions/getMinAuthToken';
|
|
15
15
|
export { getAuthToken } from './functions/getAuthToken';
|
|
16
16
|
export { getExpiresAt } from './functions/getExpiresAt';
|
|
17
|
+
export { hasElevatedAccessToken } from './functions/hasElevatedAccessToken';
|
|
17
18
|
export { useInitStatus } from './initStatus/useInitStatus';
|
|
18
19
|
export { setUnverifiedWalletAccounts } from './unverifiedWalletAccounts/setUnverifiedWalletAccounts';
|
|
@@ -180,7 +180,7 @@ const PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID = '2762a57b-faa4-41ce-9f16-abff9300e2c9
|
|
|
180
180
|
const DynamicContext = React.createContext(undefined);
|
|
181
181
|
/** The context provider itself we only use internally */
|
|
182
182
|
const InnerDynamicContextProvider = (props) => {
|
|
183
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
183
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
184
184
|
const { children, theme, settings: settings$1, locale: locale$1, enableInstrumentation = false, } = props;
|
|
185
185
|
const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, defaultPhoneInputIso2, coinbaseWalletPreference, detectNewWalletsForLinking = defaultDynamicSettings.defaultDynamicSettings.detectNewWalletsForLinking, enableConnectOnlyFallback = defaultDynamicSettings.defaultDynamicSettings.enableConnectOnlyFallback, deepLinkPreference: deepLinkPreferenceProp = defaultDynamicSettings.defaultDynamicSettings.deepLinkPreference, bridgeChains, cspNonce, cssOverrides, defaultNumberOfWalletsToShow = values.DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = defaultDynamicSettings.defaultDynamicSettings.initialAuthenticationMode, debugError = defaultDynamicSettings.defaultDynamicSettings.debugError, displaySiweStatement = defaultDynamicSettings.defaultDynamicSettings.displaySiweStatement, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = defaultDynamicSettings.defaultDynamicSettings.enableVisitTrackingOnConnectOnly, environmentId, walletsFilter, logLevel = defaultDynamicSettings.defaultDynamicSettings.logLevel, mobileExperience, notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, customPrivacyPolicy, privacyPolicyUrl, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, siweStatement, shadowDOMEnabled = defaultDynamicSettings.defaultDynamicSettings.shadowDOMEnabled, walletConnectors: walletConnectorsProp, socialProvidersFilter, showLockedWalletView = defaultDynamicSettings.defaultDynamicSettings.showLockedWalletView, walletConnectPreferredChains, walletConnectorExtensions, recommendedWallets, handlers, suppressEndUserConsoleWarning, transactionConfirmation: transactionConfirmationSettings, useMetamaskSdk = defaultDynamicSettings.defaultDynamicSettings.useMetamaskSdk, } = settings$1;
|
|
186
186
|
let { appLogoUrl = defaultDynamicSettings.defaultDynamicSettings.appLogoUrl, appName = defaultDynamicSettings.defaultDynamicSettings.appName, } = settings$1;
|
|
@@ -243,15 +243,16 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
243
243
|
const projectSettings = useProjectSettings.useProjectSettings();
|
|
244
244
|
const refetchProjectSettings = useRefetchProjectSettings.useRefetchProjectSettings();
|
|
245
245
|
const serverNetworkConfigurations = useNetworkConfigurationsFromProjectSettings.useNetworkConfigurationsFromProjectSettings({
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
246
|
+
aleoNetworksOverrides: (_b = settings$1.overrides) === null || _b === void 0 ? void 0 : _b.aleoNetworks,
|
|
247
|
+
aptosNetworksOverrides: (_c = settings$1.overrides) === null || _c === void 0 ? void 0 : _c.aptosNetworks,
|
|
248
|
+
bitcoinNetworksOverrides: (_d = settings$1.overrides) === null || _d === void 0 ? void 0 : _d.bitcoinNetworks,
|
|
249
|
+
cosmosNetworkOverrides: (_e = settings$1.overrides) === null || _e === void 0 ? void 0 : _e.cosmosNetworks,
|
|
250
|
+
evmNetworksOverrides: (_f = settings$1.overrides) === null || _f === void 0 ? void 0 : _f.evmNetworks,
|
|
250
251
|
projectSettings,
|
|
251
|
-
solanaNetworksOverrides: (
|
|
252
|
-
stellarNetworksOverrides: (
|
|
253
|
-
tonNetworksOverrides: (
|
|
254
|
-
tronNetworksOverrides: (
|
|
252
|
+
solanaNetworksOverrides: (_g = settings$1.overrides) === null || _g === void 0 ? void 0 : _g.solNetworks,
|
|
253
|
+
stellarNetworksOverrides: (_h = settings$1.overrides) === null || _h === void 0 ? void 0 : _h.stellarNetworks,
|
|
254
|
+
tonNetworksOverrides: (_j = settings$1.overrides) === null || _j === void 0 ? void 0 : _j.tonNetworks,
|
|
255
|
+
tronNetworksOverrides: (_k = settings$1.overrides) === null || _k === void 0 ? void 0 : _k.tronNetworks,
|
|
255
256
|
});
|
|
256
257
|
useSendDynamicProps.useSendDynamicProps({ environmentId, settings: settings$1 });
|
|
257
258
|
// Console warning for end user safety
|
|
@@ -261,16 +262,16 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
261
262
|
});
|
|
262
263
|
const multiWallet = useMultiWallet.useMultiWallet({
|
|
263
264
|
isBridgeFlow,
|
|
264
|
-
multiWalletOverride: (
|
|
265
|
-
multiWalletSettings: (
|
|
265
|
+
multiWalletOverride: (_l = settings$1.overrides) === null || _l === void 0 ? void 0 : _l.multiWallet,
|
|
266
|
+
multiWalletSettings: (_m = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _m === void 0 ? void 0 : _m.multiWallet,
|
|
266
267
|
});
|
|
267
268
|
const multiAsset = useMultiAsset.useMultiAsset({
|
|
268
|
-
multiAssetOverride: (
|
|
269
|
-
multiAssetSettings: (
|
|
269
|
+
multiAssetOverride: (_o = settings$1.overrides) === null || _o === void 0 ? void 0 : _o.multiAsset,
|
|
270
|
+
multiAssetSettings: (_p = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _p === void 0 ? void 0 : _p.enableMultiAsset,
|
|
270
271
|
});
|
|
271
272
|
const showFiat = useShowFiat.useShowFiat({
|
|
272
|
-
showFiatOverride: (
|
|
273
|
-
showFiatSettings: (
|
|
273
|
+
showFiatOverride: (_q = settings$1.overrides) === null || _q === void 0 ? void 0 : _q.showFiat,
|
|
274
|
+
showFiatSettings: (_r = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _r === void 0 ? void 0 : _r.showFiat,
|
|
274
275
|
});
|
|
275
276
|
// Used inside useVerifyOnAwaitingSignature. Is legacy and should be removed asap
|
|
276
277
|
const [legacyIsVerifying, setLegacyIsVerifying] = React.useState(false);
|
|
@@ -345,7 +346,7 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
345
346
|
canHaveMultipleWalletsConnected: multiWallet || isBridgeFlow,
|
|
346
347
|
connectedWallets,
|
|
347
348
|
primaryWalletId: primaryWalletId$1,
|
|
348
|
-
separateSmartWalletAndSigner: (
|
|
349
|
+
separateSmartWalletAndSigner: (_t = (_s = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _s === void 0 ? void 0 : _s.accountAbstraction) === null || _t === void 0 ? void 0 : _t.separateSmartWalletAndSigner,
|
|
349
350
|
setMultiWalletWidgetState,
|
|
350
351
|
user: user || userWithMissingInfo,
|
|
351
352
|
walletConnectorOptions,
|
|
@@ -451,8 +452,8 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
451
452
|
const { walletsForChainsMap } = useFetchWalletsForChainsMap.useFetchWalletsForChainsMap(newToWeb3WalletChainMap);
|
|
452
453
|
const { setCallback } = useCustomerCallbacks.useCustomerCallbacks({
|
|
453
454
|
callbacks: {
|
|
454
|
-
onAuthSuccess: (
|
|
455
|
-
onUserProfileUpdate: (
|
|
455
|
+
onAuthSuccess: (_u = settings$1.events) === null || _u === void 0 ? void 0 : _u.onAuthSuccess,
|
|
456
|
+
onUserProfileUpdate: (_v = settings$1.events) === null || _v === void 0 ? void 0 : _v.onUserProfileUpdate,
|
|
456
457
|
},
|
|
457
458
|
handleLogOut,
|
|
458
459
|
isAuthenticated,
|
|
@@ -742,7 +743,7 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
742
743
|
isBridgeFlow,
|
|
743
744
|
isMultiWalletEnabled: multiWallet,
|
|
744
745
|
});
|
|
745
|
-
return (jsxRuntime.jsx(reactI18next.I18nextProvider, { i18n: i18nSDKInstance, children: jsxRuntime.jsx(DynamicContext.Provider, { value: value, children: jsxRuntime.jsx(walletBook.WalletBookContextProvider, { walletBook: walletBook$1, children: jsxRuntime.jsx(ThemeContext.ThemeContextProvider, { cspNonce: cspNonce, customerTheme: parseTheme.parseTheme(theme, ((
|
|
746
|
+
return (jsxRuntime.jsx(reactI18next.I18nextProvider, { i18n: i18nSDKInstance, children: jsxRuntime.jsx(DynamicContext.Provider, { value: value, children: jsxRuntime.jsx(walletBook.WalletBookContextProvider, { walletBook: walletBook$1, children: jsxRuntime.jsx(ThemeContext.ThemeContextProvider, { cspNonce: cspNonce, customerTheme: parseTheme.parseTheme(theme, ((_w = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _w === void 0 ? void 0 : _w.modal) || undefined), designSettings: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design, children: jsxRuntime.jsx(LoadingContext.LoadingContextProvider, { children: jsxRuntime.jsxs(ViewContext.ViewContextProvider, { initialViewType: initialViewType, children: [networkValidationMode === 'always' && jsxRuntime.jsx(UseNetworkValidation.UseNetworkValidation, {}), jsxRuntime.jsx(CaptchaContext.CaptchaContextProvider, { children: jsxRuntime.jsx(AccountExistsContext.AccountExistsContextProvider, { children: jsxRuntime.jsx(WalletContext.WalletContextProvider, { children: jsxRuntime.jsx(VerificationContext.VerificationProvider, { children: jsxRuntime.jsx(PasskeyContext.PasskeyContextProvider, { children: jsxRuntime.jsx(DynamicWidgetContext.DynamicWidgetContextProvider, { children: jsxRuntime.jsx(DynamicBridgeWidgetContext.DynamicBridgeWidgetContextProvider, { children: jsxRuntime.jsx(OnrampContext.OnrampContextProvider, { children: jsxRuntime.jsx(AccessDeniedContext.AccessDeniedContextProvider, { children: jsxRuntime.jsx(SendBalanceContext.SendBalanceContextProvider, { children: jsxRuntime.jsx(WalletGroupContext.WalletGroupContextProvider, { children: jsxRuntime.jsx(UserFieldEditorContext.UserFieldEditorContextProvider, { children: jsxRuntime.jsx(ConnectWithOtpProvider.ConnectWithOtpProvider, { children: jsxRuntime.jsx(PhantomRedirectContext.PhantomRedirectContextProvider, { children: jsxRuntime.jsxs(SocialRedirectContext.SocialRedirectContextProvider, { children: [jsxRuntime.jsx(app.DynamicAuthFlow, {}), jsxRuntime.jsx(OnrampWidget.OnrampWidget, {}), jsxRuntime.jsx(SyncAuthFlow.SyncAuthFlow, {}), jsxRuntime.jsx(WalletConnectorEvents.WalletConnectorEvents, { connectorProps: connectorProps }), confirmationModal, jsxRuntime.jsx(ErrorBoundaryExclude.ErrorBoundaryExclude, { children: children })] }) }) }) }) }) }) }) }) }) }) }) }) }) }) })] }) }) }) }) }) }));
|
|
746
747
|
};
|
|
747
748
|
/** The context provider you need to have access too all of Dynamic's hooks */
|
|
748
749
|
const DynamicContextProvider = (props) => {
|
|
@@ -176,7 +176,7 @@ const PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID = '2762a57b-faa4-41ce-9f16-abff9300e2c9
|
|
|
176
176
|
const DynamicContext = createContext(undefined);
|
|
177
177
|
/** The context provider itself we only use internally */
|
|
178
178
|
const InnerDynamicContextProvider = (props) => {
|
|
179
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
179
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
180
180
|
const { children, theme, settings, locale, enableInstrumentation = false, } = props;
|
|
181
181
|
const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, defaultPhoneInputIso2, coinbaseWalletPreference, detectNewWalletsForLinking = defaultDynamicSettings.detectNewWalletsForLinking, enableConnectOnlyFallback = defaultDynamicSettings.enableConnectOnlyFallback, deepLinkPreference: deepLinkPreferenceProp = defaultDynamicSettings.deepLinkPreference, bridgeChains, cspNonce, cssOverrides, defaultNumberOfWalletsToShow = DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = defaultDynamicSettings.initialAuthenticationMode, debugError = defaultDynamicSettings.debugError, displaySiweStatement = defaultDynamicSettings.displaySiweStatement, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = defaultDynamicSettings.enableVisitTrackingOnConnectOnly, environmentId, walletsFilter, logLevel = defaultDynamicSettings.logLevel, mobileExperience, notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, customPrivacyPolicy, privacyPolicyUrl, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, siweStatement, shadowDOMEnabled = defaultDynamicSettings.shadowDOMEnabled, walletConnectors: walletConnectorsProp, socialProvidersFilter, showLockedWalletView = defaultDynamicSettings.showLockedWalletView, walletConnectPreferredChains, walletConnectorExtensions, recommendedWallets, handlers, suppressEndUserConsoleWarning, transactionConfirmation: transactionConfirmationSettings, useMetamaskSdk = defaultDynamicSettings.useMetamaskSdk, } = settings;
|
|
182
182
|
let { appLogoUrl = defaultDynamicSettings.appLogoUrl, appName = defaultDynamicSettings.appName, } = settings;
|
|
@@ -239,15 +239,16 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
239
239
|
const projectSettings = useProjectSettings();
|
|
240
240
|
const refetchProjectSettings = useRefetchProjectSettings();
|
|
241
241
|
const serverNetworkConfigurations = useNetworkConfigurationsFromProjectSettings({
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
242
|
+
aleoNetworksOverrides: (_b = settings.overrides) === null || _b === void 0 ? void 0 : _b.aleoNetworks,
|
|
243
|
+
aptosNetworksOverrides: (_c = settings.overrides) === null || _c === void 0 ? void 0 : _c.aptosNetworks,
|
|
244
|
+
bitcoinNetworksOverrides: (_d = settings.overrides) === null || _d === void 0 ? void 0 : _d.bitcoinNetworks,
|
|
245
|
+
cosmosNetworkOverrides: (_e = settings.overrides) === null || _e === void 0 ? void 0 : _e.cosmosNetworks,
|
|
246
|
+
evmNetworksOverrides: (_f = settings.overrides) === null || _f === void 0 ? void 0 : _f.evmNetworks,
|
|
246
247
|
projectSettings,
|
|
247
|
-
solanaNetworksOverrides: (
|
|
248
|
-
stellarNetworksOverrides: (
|
|
249
|
-
tonNetworksOverrides: (
|
|
250
|
-
tronNetworksOverrides: (
|
|
248
|
+
solanaNetworksOverrides: (_g = settings.overrides) === null || _g === void 0 ? void 0 : _g.solNetworks,
|
|
249
|
+
stellarNetworksOverrides: (_h = settings.overrides) === null || _h === void 0 ? void 0 : _h.stellarNetworks,
|
|
250
|
+
tonNetworksOverrides: (_j = settings.overrides) === null || _j === void 0 ? void 0 : _j.tonNetworks,
|
|
251
|
+
tronNetworksOverrides: (_k = settings.overrides) === null || _k === void 0 ? void 0 : _k.tronNetworks,
|
|
251
252
|
});
|
|
252
253
|
useSendDynamicProps({ environmentId, settings });
|
|
253
254
|
// Console warning for end user safety
|
|
@@ -257,16 +258,16 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
257
258
|
});
|
|
258
259
|
const multiWallet = useMultiWallet({
|
|
259
260
|
isBridgeFlow,
|
|
260
|
-
multiWalletOverride: (
|
|
261
|
-
multiWalletSettings: (
|
|
261
|
+
multiWalletOverride: (_l = settings.overrides) === null || _l === void 0 ? void 0 : _l.multiWallet,
|
|
262
|
+
multiWalletSettings: (_m = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _m === void 0 ? void 0 : _m.multiWallet,
|
|
262
263
|
});
|
|
263
264
|
const multiAsset = useMultiAsset({
|
|
264
|
-
multiAssetOverride: (
|
|
265
|
-
multiAssetSettings: (
|
|
265
|
+
multiAssetOverride: (_o = settings.overrides) === null || _o === void 0 ? void 0 : _o.multiAsset,
|
|
266
|
+
multiAssetSettings: (_p = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _p === void 0 ? void 0 : _p.enableMultiAsset,
|
|
266
267
|
});
|
|
267
268
|
const showFiat = useShowFiat({
|
|
268
|
-
showFiatOverride: (
|
|
269
|
-
showFiatSettings: (
|
|
269
|
+
showFiatOverride: (_q = settings.overrides) === null || _q === void 0 ? void 0 : _q.showFiat,
|
|
270
|
+
showFiatSettings: (_r = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _r === void 0 ? void 0 : _r.showFiat,
|
|
270
271
|
});
|
|
271
272
|
// Used inside useVerifyOnAwaitingSignature. Is legacy and should be removed asap
|
|
272
273
|
const [legacyIsVerifying, setLegacyIsVerifying] = useState(false);
|
|
@@ -341,7 +342,7 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
341
342
|
canHaveMultipleWalletsConnected: multiWallet || isBridgeFlow,
|
|
342
343
|
connectedWallets,
|
|
343
344
|
primaryWalletId,
|
|
344
|
-
separateSmartWalletAndSigner: (
|
|
345
|
+
separateSmartWalletAndSigner: (_t = (_s = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _s === void 0 ? void 0 : _s.accountAbstraction) === null || _t === void 0 ? void 0 : _t.separateSmartWalletAndSigner,
|
|
345
346
|
setMultiWalletWidgetState,
|
|
346
347
|
user: user || userWithMissingInfo,
|
|
347
348
|
walletConnectorOptions,
|
|
@@ -447,8 +448,8 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
447
448
|
const { walletsForChainsMap } = useFetchWalletsForChainsMap(newToWeb3WalletChainMap);
|
|
448
449
|
const { setCallback } = useCustomerCallbacks({
|
|
449
450
|
callbacks: {
|
|
450
|
-
onAuthSuccess: (
|
|
451
|
-
onUserProfileUpdate: (
|
|
451
|
+
onAuthSuccess: (_u = settings.events) === null || _u === void 0 ? void 0 : _u.onAuthSuccess,
|
|
452
|
+
onUserProfileUpdate: (_v = settings.events) === null || _v === void 0 ? void 0 : _v.onUserProfileUpdate,
|
|
452
453
|
},
|
|
453
454
|
handleLogOut,
|
|
454
455
|
isAuthenticated,
|
|
@@ -738,7 +739,7 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
738
739
|
isBridgeFlow,
|
|
739
740
|
isMultiWalletEnabled: multiWallet,
|
|
740
741
|
});
|
|
741
|
-
return (jsx(I18nextProvider, { i18n: i18nSDKInstance, children: jsx(DynamicContext.Provider, { value: value, children: jsx(WalletBookContextProvider, { walletBook: walletBook, children: jsx(ThemeContextProvider, { cspNonce: cspNonce, customerTheme: parseTheme(theme, ((
|
|
742
|
+
return (jsx(I18nextProvider, { i18n: i18nSDKInstance, children: jsx(DynamicContext.Provider, { value: value, children: jsx(WalletBookContextProvider, { walletBook: walletBook, children: jsx(ThemeContextProvider, { cspNonce: cspNonce, customerTheme: parseTheme(theme, ((_w = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _w === void 0 ? void 0 : _w.modal) || undefined), designSettings: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design, children: jsx(LoadingContextProvider, { children: jsxs(ViewContextProvider, { initialViewType: initialViewType, children: [networkValidationMode === 'always' && jsx(UseNetworkValidation, {}), jsx(CaptchaContextProvider, { children: jsx(AccountExistsContextProvider, { children: jsx(WalletContextProvider, { children: jsx(VerificationProvider, { children: jsx(PasskeyContextProvider, { children: jsx(DynamicWidgetContextProvider, { children: jsx(DynamicBridgeWidgetContextProvider, { children: jsx(OnrampContextProvider, { children: jsx(AccessDeniedContextProvider, { children: jsx(SendBalanceContextProvider, { children: jsx(WalletGroupContextProvider, { children: jsx(UserFieldEditorContextProvider, { children: jsx(ConnectWithOtpProvider, { children: jsx(PhantomRedirectContextProvider, { children: jsxs(SocialRedirectContextProvider, { children: [jsx(DynamicAuthFlow, {}), jsx(OnrampWidget, {}), jsx(SyncAuthFlow, {}), jsx(WalletConnectorEvents, { connectorProps: connectorProps }), confirmationModal, jsx(ErrorBoundaryExclude, { children: children })] }) }) }) }) }) }) }) }) }) }) }) }) }) }) })] }) }) }) }) }) }));
|
|
742
743
|
};
|
|
743
744
|
/** The context provider you need to have access too all of Dynamic's hooks */
|
|
744
745
|
const DynamicContextProvider = (props) => {
|
|
@@ -123,6 +123,16 @@ export type SettingsOverrides = {
|
|
|
123
123
|
* the SDK can react to this value changing (for ex, toggling a chain off).
|
|
124
124
|
*/
|
|
125
125
|
stellarNetworks?: NetworksOverrides;
|
|
126
|
+
/**
|
|
127
|
+
* Allows overriding which aleo networks the SDK has access to.
|
|
128
|
+
* If an array is provided, it is used instead of whatever is obtained from dashboard configs.
|
|
129
|
+
* If a callback is passed, the callback will be called with the values obtained from dashboard, and
|
|
130
|
+
* it must return the network values that will be used.
|
|
131
|
+
*
|
|
132
|
+
* WARNING: this callback must be memoized as it will be used in a dependency array to ensure
|
|
133
|
+
* the SDK can react to this value changing (for ex, toggling a chain off).
|
|
134
|
+
*/
|
|
135
|
+
aleoNetworks?: NetworksOverrides;
|
|
126
136
|
/**
|
|
127
137
|
* Allows overriding which bitcoin networks the SDK has access to.
|
|
128
138
|
* If an array is provided, it is used instead of whatever is obtained from dashboard configs.
|