@dynamic-labs/sdk-react-core 4.51.2 → 4.52.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 +9 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +12 -12
- package/src/lib/context/DynamicContext/DynamicContext.cjs +13 -12
- package/src/lib/context/DynamicContext/DynamicContext.js +13 -12
- package/src/lib/context/DynamicContext/types/SettingsOverrides.d.ts +10 -0
- package/src/lib/shared/utils/functions/chain/getChainIcon.cjs +1 -0
- package/src/lib/shared/utils/functions/chain/getChainIcon.js +2 -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/useGetTransactionHistory/useGetTransactionHistory.d.ts +29 -0
- 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/views/TransactionConfirmationView/TransactionConfirmationView.cjs +8 -1
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.52.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.51.2...v4.52.0) (2025-12-22)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add dynamic waas ton connector ([#9981](https://github.com/dynamic-labs/dynamic-auth/issues/9981)) ([95f2ecf](https://github.com/dynamic-labs/dynamic-auth/commit/95f2ecf253550ec8badad588a904599321a5846d))
|
|
8
|
+
* add getTransactionHistory to react-native ([#10132](https://github.com/dynamic-labs/dynamic-auth/issues/10132)) ([bed6ce1](https://github.com/dynamic-labs/dynamic-auth/commit/bed6ce13b5e12f80121eebf6421355ae2b87968d))
|
|
9
|
+
* add useGetTransactionHistory hook ([#10131](https://github.com/dynamic-labs/dynamic-auth/issues/10131)) ([431e7e1](https://github.com/dynamic-labs/dynamic-auth/commit/431e7e1a70cd0556c14f55c2827bb419f38a59c9))
|
|
10
|
+
|
|
2
11
|
### [4.51.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.51.1...v4.51.2) (2025-12-19)
|
|
3
12
|
|
|
4
13
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.52.0",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@dynamic-labs/sdk-api-core": "0.0.843",
|
|
6
6
|
"@dynamic-labs-sdk/client": "0.1.2",
|
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
"yup": "0.32.11",
|
|
16
16
|
"react-international-phone": "4.5.0",
|
|
17
17
|
"bs58": "5.0.0",
|
|
18
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
19
|
-
"@dynamic-labs/iconic": "4.
|
|
20
|
-
"@dynamic-labs/locale": "4.
|
|
21
|
-
"@dynamic-labs/logger": "4.
|
|
22
|
-
"@dynamic-labs/multi-wallet": "4.
|
|
23
|
-
"@dynamic-labs/rpc-providers": "4.
|
|
24
|
-
"@dynamic-labs/store": "4.
|
|
25
|
-
"@dynamic-labs/types": "4.
|
|
26
|
-
"@dynamic-labs/utils": "4.
|
|
27
|
-
"@dynamic-labs/wallet-book": "4.
|
|
28
|
-
"@dynamic-labs/wallet-connector-core": "4.
|
|
18
|
+
"@dynamic-labs/assert-package-version": "4.52.0",
|
|
19
|
+
"@dynamic-labs/iconic": "4.52.0",
|
|
20
|
+
"@dynamic-labs/locale": "4.52.0",
|
|
21
|
+
"@dynamic-labs/logger": "4.52.0",
|
|
22
|
+
"@dynamic-labs/multi-wallet": "4.52.0",
|
|
23
|
+
"@dynamic-labs/rpc-providers": "4.52.0",
|
|
24
|
+
"@dynamic-labs/store": "4.52.0",
|
|
25
|
+
"@dynamic-labs/types": "4.52.0",
|
|
26
|
+
"@dynamic-labs/utils": "4.52.0",
|
|
27
|
+
"@dynamic-labs/wallet-book": "4.52.0",
|
|
28
|
+
"@dynamic-labs/wallet-connector-core": "4.52.0",
|
|
29
29
|
"eventemitter3": "5.0.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
@@ -175,7 +175,7 @@ const PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID = '2762a57b-faa4-41ce-9f16-abff9300e2c9
|
|
|
175
175
|
const DynamicContext = React.createContext(undefined);
|
|
176
176
|
/** The context provider itself we only use internally */
|
|
177
177
|
const InnerDynamicContextProvider = (props) => {
|
|
178
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
178
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
179
179
|
const { children, theme, settings: settings$1, locale: locale$1, enableInstrumentation = false, } = props;
|
|
180
180
|
const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, defaultPhoneInputIso2, coinbaseWalletPreference, detectNewWalletsForLinking = defaultDynamicSettings.defaultDynamicSettings.detectNewWalletsForLinking, enableConnectOnlyFallback = defaultDynamicSettings.defaultDynamicSettings.enableConnectOnlyFallback, deepLinkPreference: deepLinkPreferenceProp = defaultDynamicSettings.defaultDynamicSettings.deepLinkPreference, bridgeChains, 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;
|
|
181
181
|
let { appLogoUrl = defaultDynamicSettings.defaultDynamicSettings.appLogoUrl, appName = defaultDynamicSettings.defaultDynamicSettings.appName, } = settings$1;
|
|
@@ -243,7 +243,8 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
243
243
|
evmNetworksOverrides: (_d = settings$1.overrides) === null || _d === void 0 ? void 0 : _d.evmNetworks,
|
|
244
244
|
projectSettings,
|
|
245
245
|
solanaNetworksOverrides: (_e = settings$1.overrides) === null || _e === void 0 ? void 0 : _e.solNetworks,
|
|
246
|
-
|
|
246
|
+
tonNetworksOverrides: (_f = settings$1.overrides) === null || _f === void 0 ? void 0 : _f.tonNetworks,
|
|
247
|
+
tronNetworksOverrides: (_g = settings$1.overrides) === null || _g === void 0 ? void 0 : _g.tronNetworks,
|
|
247
248
|
});
|
|
248
249
|
useSendDynamicProps.useSendDynamicProps({ environmentId, settings: settings$1 });
|
|
249
250
|
// Console warning for end user safety
|
|
@@ -253,16 +254,16 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
253
254
|
});
|
|
254
255
|
const multiWallet = useMultiWallet.useMultiWallet({
|
|
255
256
|
isBridgeFlow,
|
|
256
|
-
multiWalletOverride: (
|
|
257
|
-
multiWalletSettings: (
|
|
257
|
+
multiWalletOverride: (_h = settings$1.overrides) === null || _h === void 0 ? void 0 : _h.multiWallet,
|
|
258
|
+
multiWalletSettings: (_j = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _j === void 0 ? void 0 : _j.multiWallet,
|
|
258
259
|
});
|
|
259
260
|
const multiAsset = useMultiAsset.useMultiAsset({
|
|
260
|
-
multiAssetOverride: (
|
|
261
|
-
multiAssetSettings: (
|
|
261
|
+
multiAssetOverride: (_k = settings$1.overrides) === null || _k === void 0 ? void 0 : _k.multiAsset,
|
|
262
|
+
multiAssetSettings: (_l = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _l === void 0 ? void 0 : _l.enableMultiAsset,
|
|
262
263
|
});
|
|
263
264
|
const showFiat = useShowFiat.useShowFiat({
|
|
264
|
-
showFiatOverride: (
|
|
265
|
-
showFiatSettings: (
|
|
265
|
+
showFiatOverride: (_m = settings$1.overrides) === null || _m === void 0 ? void 0 : _m.showFiat,
|
|
266
|
+
showFiatSettings: (_o = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _o === void 0 ? void 0 : _o.showFiat,
|
|
266
267
|
});
|
|
267
268
|
// Used inside useVerifyOnAwaitingSignature. Is legacy and should be removed asap
|
|
268
269
|
const [legacyIsVerifying, setLegacyIsVerifying] = React.useState(false);
|
|
@@ -337,7 +338,7 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
337
338
|
canHaveMultipleWalletsConnected: multiWallet || isBridgeFlow,
|
|
338
339
|
connectedWallets,
|
|
339
340
|
primaryWalletId: primaryWalletId$1,
|
|
340
|
-
separateSmartWalletAndSigner: (
|
|
341
|
+
separateSmartWalletAndSigner: (_q = (_p = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _p === void 0 ? void 0 : _p.accountAbstraction) === null || _q === void 0 ? void 0 : _q.separateSmartWalletAndSigner,
|
|
341
342
|
setMultiWalletWidgetState,
|
|
342
343
|
user: user || userWithMissingInfo,
|
|
343
344
|
walletConnectorOptions,
|
|
@@ -441,8 +442,8 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
441
442
|
const { walletsForChainsMap } = useFetchWalletsForChainsMap.useFetchWalletsForChainsMap(newToWeb3WalletChainMap);
|
|
442
443
|
const { setCallback } = useCustomerCallbacks.useCustomerCallbacks({
|
|
443
444
|
callbacks: {
|
|
444
|
-
onAuthSuccess: (
|
|
445
|
-
onUserProfileUpdate: (
|
|
445
|
+
onAuthSuccess: (_r = settings$1.events) === null || _r === void 0 ? void 0 : _r.onAuthSuccess,
|
|
446
|
+
onUserProfileUpdate: (_s = settings$1.events) === null || _s === void 0 ? void 0 : _s.onUserProfileUpdate,
|
|
446
447
|
},
|
|
447
448
|
handleLogOut,
|
|
448
449
|
isAuthenticated,
|
|
@@ -730,7 +731,7 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
730
731
|
isBridgeFlow,
|
|
731
732
|
isMultiWalletEnabled: multiWallet,
|
|
732
733
|
});
|
|
733
|
-
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, { customerTheme: parseTheme.parseTheme(theme, ((
|
|
734
|
+
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, { customerTheme: parseTheme.parseTheme(theme, ((_t = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _t === void 0 ? void 0 : _t.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 })] }) }) }) }) }) }) }) }) }) }) }) }) }) }) })] }) }) }) }) }) }));
|
|
734
735
|
};
|
|
735
736
|
/** The context provider you need to have access too all of Dynamic's hooks */
|
|
736
737
|
const DynamicContextProvider = (props) => {
|
|
@@ -171,7 +171,7 @@ const PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID = '2762a57b-faa4-41ce-9f16-abff9300e2c9
|
|
|
171
171
|
const DynamicContext = createContext(undefined);
|
|
172
172
|
/** The context provider itself we only use internally */
|
|
173
173
|
const InnerDynamicContextProvider = (props) => {
|
|
174
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
174
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
175
175
|
const { children, theme, settings, locale, enableInstrumentation = false, } = props;
|
|
176
176
|
const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, defaultPhoneInputIso2, coinbaseWalletPreference, detectNewWalletsForLinking = defaultDynamicSettings.detectNewWalletsForLinking, enableConnectOnlyFallback = defaultDynamicSettings.enableConnectOnlyFallback, deepLinkPreference: deepLinkPreferenceProp = defaultDynamicSettings.deepLinkPreference, bridgeChains, 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;
|
|
177
177
|
let { appLogoUrl = defaultDynamicSettings.appLogoUrl, appName = defaultDynamicSettings.appName, } = settings;
|
|
@@ -239,7 +239,8 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
239
239
|
evmNetworksOverrides: (_d = settings.overrides) === null || _d === void 0 ? void 0 : _d.evmNetworks,
|
|
240
240
|
projectSettings,
|
|
241
241
|
solanaNetworksOverrides: (_e = settings.overrides) === null || _e === void 0 ? void 0 : _e.solNetworks,
|
|
242
|
-
|
|
242
|
+
tonNetworksOverrides: (_f = settings.overrides) === null || _f === void 0 ? void 0 : _f.tonNetworks,
|
|
243
|
+
tronNetworksOverrides: (_g = settings.overrides) === null || _g === void 0 ? void 0 : _g.tronNetworks,
|
|
243
244
|
});
|
|
244
245
|
useSendDynamicProps({ environmentId, settings });
|
|
245
246
|
// Console warning for end user safety
|
|
@@ -249,16 +250,16 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
249
250
|
});
|
|
250
251
|
const multiWallet = useMultiWallet({
|
|
251
252
|
isBridgeFlow,
|
|
252
|
-
multiWalletOverride: (
|
|
253
|
-
multiWalletSettings: (
|
|
253
|
+
multiWalletOverride: (_h = settings.overrides) === null || _h === void 0 ? void 0 : _h.multiWallet,
|
|
254
|
+
multiWalletSettings: (_j = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _j === void 0 ? void 0 : _j.multiWallet,
|
|
254
255
|
});
|
|
255
256
|
const multiAsset = useMultiAsset({
|
|
256
|
-
multiAssetOverride: (
|
|
257
|
-
multiAssetSettings: (
|
|
257
|
+
multiAssetOverride: (_k = settings.overrides) === null || _k === void 0 ? void 0 : _k.multiAsset,
|
|
258
|
+
multiAssetSettings: (_l = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _l === void 0 ? void 0 : _l.enableMultiAsset,
|
|
258
259
|
});
|
|
259
260
|
const showFiat = useShowFiat({
|
|
260
|
-
showFiatOverride: (
|
|
261
|
-
showFiatSettings: (
|
|
261
|
+
showFiatOverride: (_m = settings.overrides) === null || _m === void 0 ? void 0 : _m.showFiat,
|
|
262
|
+
showFiatSettings: (_o = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _o === void 0 ? void 0 : _o.showFiat,
|
|
262
263
|
});
|
|
263
264
|
// Used inside useVerifyOnAwaitingSignature. Is legacy and should be removed asap
|
|
264
265
|
const [legacyIsVerifying, setLegacyIsVerifying] = useState(false);
|
|
@@ -333,7 +334,7 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
333
334
|
canHaveMultipleWalletsConnected: multiWallet || isBridgeFlow,
|
|
334
335
|
connectedWallets,
|
|
335
336
|
primaryWalletId,
|
|
336
|
-
separateSmartWalletAndSigner: (
|
|
337
|
+
separateSmartWalletAndSigner: (_q = (_p = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _p === void 0 ? void 0 : _p.accountAbstraction) === null || _q === void 0 ? void 0 : _q.separateSmartWalletAndSigner,
|
|
337
338
|
setMultiWalletWidgetState,
|
|
338
339
|
user: user || userWithMissingInfo,
|
|
339
340
|
walletConnectorOptions,
|
|
@@ -437,8 +438,8 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
437
438
|
const { walletsForChainsMap } = useFetchWalletsForChainsMap(newToWeb3WalletChainMap);
|
|
438
439
|
const { setCallback } = useCustomerCallbacks({
|
|
439
440
|
callbacks: {
|
|
440
|
-
onAuthSuccess: (
|
|
441
|
-
onUserProfileUpdate: (
|
|
441
|
+
onAuthSuccess: (_r = settings.events) === null || _r === void 0 ? void 0 : _r.onAuthSuccess,
|
|
442
|
+
onUserProfileUpdate: (_s = settings.events) === null || _s === void 0 ? void 0 : _s.onUserProfileUpdate,
|
|
442
443
|
},
|
|
443
444
|
handleLogOut,
|
|
444
445
|
isAuthenticated,
|
|
@@ -726,7 +727,7 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
726
727
|
isBridgeFlow,
|
|
727
728
|
isMultiWalletEnabled: multiWallet,
|
|
728
729
|
});
|
|
729
|
-
return (jsx(I18nextProvider, { i18n: i18nSDKInstance, children: jsx(DynamicContext.Provider, { value: value, children: jsx(WalletBookContextProvider, { walletBook: walletBook, children: jsx(ThemeContextProvider, { customerTheme: parseTheme(theme, ((
|
|
730
|
+
return (jsx(I18nextProvider, { i18n: i18nSDKInstance, children: jsx(DynamicContext.Provider, { value: value, children: jsx(WalletBookContextProvider, { walletBook: walletBook, children: jsx(ThemeContextProvider, { customerTheme: parseTheme(theme, ((_t = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _t === void 0 ? void 0 : _t.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 })] }) }) }) }) }) }) }) }) }) }) }) }) }) }) })] }) }) }) }) }) }));
|
|
730
731
|
};
|
|
731
732
|
/** The context provider you need to have access too all of Dynamic's hooks */
|
|
732
733
|
const DynamicContextProvider = (props) => {
|
|
@@ -103,6 +103,16 @@ export type SettingsOverrides = {
|
|
|
103
103
|
* the SDK can react to this value changing (for ex, toggling a chain off).
|
|
104
104
|
*/
|
|
105
105
|
aptosNetworks?: NetworksOverrides;
|
|
106
|
+
/**
|
|
107
|
+
* Allows overriding which TON networks the SDK has access to.
|
|
108
|
+
* If an array is provided, it is used instead of whatever is obtained from dashboard configs.
|
|
109
|
+
* If a callback is passed, the callback will be called with the values obtained from dashboard, and
|
|
110
|
+
* it must return the network values that will be used.
|
|
111
|
+
*
|
|
112
|
+
* WARNING: this callback must be memoized as it will be used in a dependency array to ensure
|
|
113
|
+
* the SDK can react to this value changing (for ex, toggling a chain off).
|
|
114
|
+
*/
|
|
115
|
+
tonNetworks?: NetworksOverrides;
|
|
106
116
|
/**
|
|
107
117
|
* Allows overriding the multi-wallet feature from the dashboard.
|
|
108
118
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import { AlgorandIcon, AptosIcon, BitcoinIcon, CosmosIcon, EclipseIcon, EthereumIcon, FlowIcon, SolanaIcon, SparkIcon, StarknetIcon, SuiIcon, TronIcon } from '@dynamic-labs/iconic';
|
|
2
|
+
import { AlgorandIcon, AptosIcon, BitcoinIcon, CosmosIcon, EclipseIcon, EthereumIcon, FlowIcon, SolanaIcon, SparkIcon, StarknetIcon, SuiIcon, TonIcon, TronIcon } from '@dynamic-labs/iconic';
|
|
3
3
|
import { getChainInfo } from '@dynamic-labs/wallet-connector-core';
|
|
4
4
|
import 'react';
|
|
5
5
|
import { ReactComponent as SvgError } from '../../../assets/error.js';
|
|
@@ -18,6 +18,7 @@ const chainIconMap = {
|
|
|
18
18
|
spark: SparkIcon,
|
|
19
19
|
starknet: StarknetIcon,
|
|
20
20
|
sui: SuiIcon,
|
|
21
|
+
ton: TonIcon,
|
|
21
22
|
tron: TronIcon,
|
|
22
23
|
};
|
|
23
24
|
const getChainIcon = (chain) => {
|
|
@@ -18,6 +18,7 @@ const ChainEnumToVerifiedCredentialName = {
|
|
|
18
18
|
FLOW: 'flow',
|
|
19
19
|
SOL: 'solana',
|
|
20
20
|
STARK: 'starknet',
|
|
21
|
+
TON: 'ton',
|
|
21
22
|
};
|
|
22
23
|
const VerifiedCredentialNameToChainEnum = {
|
|
23
24
|
algorand: sdkApiCore.ChainEnum.Algo,
|
|
@@ -28,6 +29,7 @@ const VerifiedCredentialNameToChainEnum = {
|
|
|
28
29
|
solana: sdkApiCore.ChainEnum.Sol,
|
|
29
30
|
starknet: sdkApiCore.ChainEnum.Stark,
|
|
30
31
|
sui: sdkApiCore.ChainEnum.Sui,
|
|
32
|
+
ton: sdkApiCore.ChainEnum.Ton,
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
exports.ChainEnumToVerifiedCredentialName = ChainEnumToVerifiedCredentialName;
|
|
@@ -14,6 +14,7 @@ const ChainEnumToVerifiedCredentialName = {
|
|
|
14
14
|
FLOW: 'flow',
|
|
15
15
|
SOL: 'solana',
|
|
16
16
|
STARK: 'starknet',
|
|
17
|
+
TON: 'ton',
|
|
17
18
|
};
|
|
18
19
|
const VerifiedCredentialNameToChainEnum = {
|
|
19
20
|
algorand: ChainEnum.Algo,
|
|
@@ -24,6 +25,7 @@ const VerifiedCredentialNameToChainEnum = {
|
|
|
24
25
|
solana: ChainEnum.Sol,
|
|
25
26
|
starknet: ChainEnum.Stark,
|
|
26
27
|
sui: ChainEnum.Sui,
|
|
28
|
+
ton: ChainEnum.Ton,
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
export { ChainEnumToVerifiedCredentialName, DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, VerifiedCredentialNameToChainEnum };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { GetTransactionHistoryParams, GetTransactionHistoryResponse } from '@dynamic-labs-sdk/client';
|
|
2
|
+
/**
|
|
3
|
+
* Get transaction history
|
|
4
|
+
*
|
|
5
|
+
* @returns Function to get transaction history for the current user
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* const App = () => {
|
|
10
|
+
* const getTransactionHistory = useGetTransactionHistory();
|
|
11
|
+
* const [transactionHistory, setTransactionHistory] = useState<GetTransactionHistoryResponse>();
|
|
12
|
+
*
|
|
13
|
+
* return (
|
|
14
|
+
* <button
|
|
15
|
+
* onClick={async () => {
|
|
16
|
+
* const transactionHistory = await getTransactionHistory({
|
|
17
|
+
* address: 'wallet-address',
|
|
18
|
+
* networkId: 101,
|
|
19
|
+
* chain: ChainEnum.Sol,
|
|
20
|
+
* });
|
|
21
|
+
* setTransactionHistory(transactionHistory);
|
|
22
|
+
* }}
|
|
23
|
+
* >
|
|
24
|
+
* Get transaction history
|
|
25
|
+
* </button>
|
|
26
|
+
* );
|
|
27
|
+
* };
|
|
28
|
+
*/
|
|
29
|
+
export declare const useGetTransactionHistory: () => ((props: GetTransactionHistoryParams) => Promise<GetTransactionHistoryResponse>);
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var React = require('react');
|
|
7
7
|
|
|
8
|
-
const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNetworkOverrides, evmNetworksOverrides, solanaNetworksOverrides, tronNetworksOverrides, aptosNetworksOverrides, }) => React.useMemo(() => {
|
|
9
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
8
|
+
const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNetworkOverrides, evmNetworksOverrides, solanaNetworksOverrides, tronNetworksOverrides, aptosNetworksOverrides, tonNetworksOverrides, }) => React.useMemo(() => {
|
|
9
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
10
10
|
const networks = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.networks;
|
|
11
11
|
if (!networks)
|
|
12
12
|
return {};
|
|
@@ -18,6 +18,7 @@ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNe
|
|
|
18
18
|
const sui = networks.find((configurations) => configurations.chainName === 'sui');
|
|
19
19
|
const tron = networks.find((configurations) => configurations.chainName === 'tron');
|
|
20
20
|
const aptos = networks.find((configurations) => configurations.chainName === 'aptos');
|
|
21
|
+
const ton = networks.find((configurations) => configurations.chainName === 'ton');
|
|
21
22
|
let cosmosNetworks = (_a = cosmos === null || cosmos === void 0 ? void 0 : cosmos.networks) === null || _a === void 0 ? void 0 : _a.map((net) => createNetwork(net, Number.parseInt));
|
|
22
23
|
cosmosNetworks = overrideNetworks(cosmosNetworkOverrides, cosmosNetworks);
|
|
23
24
|
let evmNetworks = (_b = evm === null || evm === void 0 ? void 0 : evm.networks) === null || _b === void 0 ? void 0 : _b.map((net) => createNetwork(net, Number.parseInt));
|
|
@@ -39,6 +40,8 @@ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNe
|
|
|
39
40
|
tronNetworks = overrideNetworks(tronNetworksOverrides, tronNetworks);
|
|
40
41
|
let aptosNetworks = (_h = aptos === null || aptos === void 0 ? void 0 : aptos.networks) === null || _h === void 0 ? void 0 : _h.map((net) => createNetwork(net));
|
|
41
42
|
aptosNetworks = overrideNetworks(aptosNetworksOverrides, aptosNetworks);
|
|
43
|
+
let tonNetworks = (_j = ton === null || ton === void 0 ? void 0 : ton.networks) === null || _j === void 0 ? void 0 : _j.map((net) => createNetwork(net));
|
|
44
|
+
tonNetworks = overrideNetworks(tonNetworksOverrides, tonNetworks);
|
|
42
45
|
const networkConfigurations = {
|
|
43
46
|
aptos: aptosNetworks,
|
|
44
47
|
cosmos: cosmosNetworks,
|
|
@@ -47,6 +50,7 @@ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNe
|
|
|
47
50
|
solana: solanaNetworks,
|
|
48
51
|
starknet: starknetNetworks,
|
|
49
52
|
sui: suiNetworks,
|
|
53
|
+
ton: tonNetworks,
|
|
50
54
|
tron: tronNetworks,
|
|
51
55
|
};
|
|
52
56
|
return networkConfigurations;
|
|
@@ -57,6 +61,7 @@ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNe
|
|
|
57
61
|
solanaNetworksOverrides,
|
|
58
62
|
tronNetworksOverrides,
|
|
59
63
|
aptosNetworksOverrides,
|
|
64
|
+
tonNetworksOverrides,
|
|
60
65
|
]);
|
|
61
66
|
const createNetwork = (network, parser = (input) => input) => {
|
|
62
67
|
const result = {
|
|
@@ -7,6 +7,7 @@ type UseNetworkConfigurationsFromProjectSettingsProps = {
|
|
|
7
7
|
solanaNetworksOverrides?: NetworksOverrides;
|
|
8
8
|
tronNetworksOverrides?: NetworksOverrides;
|
|
9
9
|
aptosNetworksOverrides?: NetworksOverrides;
|
|
10
|
+
tonNetworksOverrides?: NetworksOverrides;
|
|
10
11
|
};
|
|
11
|
-
export declare const useNetworkConfigurationsFromProjectSettings: ({ projectSettings, cosmosNetworkOverrides, evmNetworksOverrides, solanaNetworksOverrides, tronNetworksOverrides, aptosNetworksOverrides, }: UseNetworkConfigurationsFromProjectSettingsProps) => {};
|
|
12
|
+
export declare const useNetworkConfigurationsFromProjectSettings: ({ projectSettings, cosmosNetworkOverrides, evmNetworksOverrides, solanaNetworksOverrides, tronNetworksOverrides, aptosNetworksOverrides, tonNetworksOverrides, }: UseNetworkConfigurationsFromProjectSettingsProps) => {};
|
|
12
13
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
|
|
4
|
-
const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNetworkOverrides, evmNetworksOverrides, solanaNetworksOverrides, tronNetworksOverrides, aptosNetworksOverrides, }) => useMemo(() => {
|
|
5
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4
|
+
const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNetworkOverrides, evmNetworksOverrides, solanaNetworksOverrides, tronNetworksOverrides, aptosNetworksOverrides, tonNetworksOverrides, }) => useMemo(() => {
|
|
5
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
6
6
|
const networks = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.networks;
|
|
7
7
|
if (!networks)
|
|
8
8
|
return {};
|
|
@@ -14,6 +14,7 @@ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNe
|
|
|
14
14
|
const sui = networks.find((configurations) => configurations.chainName === 'sui');
|
|
15
15
|
const tron = networks.find((configurations) => configurations.chainName === 'tron');
|
|
16
16
|
const aptos = networks.find((configurations) => configurations.chainName === 'aptos');
|
|
17
|
+
const ton = networks.find((configurations) => configurations.chainName === 'ton');
|
|
17
18
|
let cosmosNetworks = (_a = cosmos === null || cosmos === void 0 ? void 0 : cosmos.networks) === null || _a === void 0 ? void 0 : _a.map((net) => createNetwork(net, Number.parseInt));
|
|
18
19
|
cosmosNetworks = overrideNetworks(cosmosNetworkOverrides, cosmosNetworks);
|
|
19
20
|
let evmNetworks = (_b = evm === null || evm === void 0 ? void 0 : evm.networks) === null || _b === void 0 ? void 0 : _b.map((net) => createNetwork(net, Number.parseInt));
|
|
@@ -35,6 +36,8 @@ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNe
|
|
|
35
36
|
tronNetworks = overrideNetworks(tronNetworksOverrides, tronNetworks);
|
|
36
37
|
let aptosNetworks = (_h = aptos === null || aptos === void 0 ? void 0 : aptos.networks) === null || _h === void 0 ? void 0 : _h.map((net) => createNetwork(net));
|
|
37
38
|
aptosNetworks = overrideNetworks(aptosNetworksOverrides, aptosNetworks);
|
|
39
|
+
let tonNetworks = (_j = ton === null || ton === void 0 ? void 0 : ton.networks) === null || _j === void 0 ? void 0 : _j.map((net) => createNetwork(net));
|
|
40
|
+
tonNetworks = overrideNetworks(tonNetworksOverrides, tonNetworks);
|
|
38
41
|
const networkConfigurations = {
|
|
39
42
|
aptos: aptosNetworks,
|
|
40
43
|
cosmos: cosmosNetworks,
|
|
@@ -43,6 +46,7 @@ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNe
|
|
|
43
46
|
solana: solanaNetworks,
|
|
44
47
|
starknet: starknetNetworks,
|
|
45
48
|
sui: suiNetworks,
|
|
49
|
+
ton: tonNetworks,
|
|
46
50
|
tron: tronNetworks,
|
|
47
51
|
};
|
|
48
52
|
return networkConfigurations;
|
|
@@ -53,6 +57,7 @@ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNe
|
|
|
53
57
|
solanaNetworksOverrides,
|
|
54
58
|
tronNetworksOverrides,
|
|
55
59
|
aptosNetworksOverrides,
|
|
60
|
+
tonNetworksOverrides,
|
|
56
61
|
]);
|
|
57
62
|
const createNetwork = (network, parser = (input) => input) => {
|
|
58
63
|
const result = {
|
|
@@ -159,7 +159,10 @@ const TransactionConfirmationView = ({ transaction, onError, onSuccess, mutation
|
|
|
159
159
|
isFetchingSimulationRef.current = false;
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
|
-
if (!primaryWallet ||
|
|
162
|
+
if (!primaryWallet ||
|
|
163
|
+
(!chainId &&
|
|
164
|
+
(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.chain) !== 'SOL' &&
|
|
165
|
+
(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.chain) !== 'TON')) {
|
|
163
166
|
logger.logger.error('[TransactionConfirmationView] Simulation failed:', {
|
|
164
167
|
chain: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.chain,
|
|
165
168
|
chainId,
|
|
@@ -228,6 +231,10 @@ const TransactionConfirmationView = ({ transaction, onError, onSuccess, mutation
|
|
|
228
231
|
value: ((_f = transaction.value) === null || _f === void 0 ? void 0 : _f.toString()) || '0',
|
|
229
232
|
});
|
|
230
233
|
}
|
|
234
|
+
else if ((walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.connectedChain) === 'TON') {
|
|
235
|
+
setSimulationState({ status: SimulationStatus.SKIPPED });
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
231
238
|
}
|
|
232
239
|
if (!result && ((_g = primaryWallet.connector) === null || _g === void 0 ? void 0 : _g.key) !== 'zerodev') {
|
|
233
240
|
logger.logger.warn('[TransactionConfirmationView] Simulation failed: No result');
|
|
@@ -151,7 +151,10 @@ const TransactionConfirmationView = ({ transaction, onError, onSuccess, mutation
|
|
|
151
151
|
isFetchingSimulationRef.current = false;
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
|
-
if (!primaryWallet ||
|
|
154
|
+
if (!primaryWallet ||
|
|
155
|
+
(!chainId &&
|
|
156
|
+
(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.chain) !== 'SOL' &&
|
|
157
|
+
(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.chain) !== 'TON')) {
|
|
155
158
|
logger.error('[TransactionConfirmationView] Simulation failed:', {
|
|
156
159
|
chain: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.chain,
|
|
157
160
|
chainId,
|
|
@@ -220,6 +223,10 @@ const TransactionConfirmationView = ({ transaction, onError, onSuccess, mutation
|
|
|
220
223
|
value: ((_f = transaction.value) === null || _f === void 0 ? void 0 : _f.toString()) || '0',
|
|
221
224
|
});
|
|
222
225
|
}
|
|
226
|
+
else if ((walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.connectedChain) === 'TON') {
|
|
227
|
+
setSimulationState({ status: SimulationStatus.SKIPPED });
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
223
230
|
}
|
|
224
231
|
if (!result && ((_g = primaryWallet.connector) === null || _g === void 0 ? void 0 : _g.key) !== 'zerodev') {
|
|
225
232
|
logger.warn('[TransactionConfirmationView] Simulation failed: No result');
|