@dynamic-labs/sdk-react-core 4.40.2 → 4.41.1
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 +20 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +12 -12
- package/src/lib/store/utils/settingsUtils/settingsUtils.cjs +1 -1
- package/src/lib/store/utils/settingsUtils/settingsUtils.d.ts +1 -1
- package/src/lib/store/utils/settingsUtils/settingsUtils.js +1 -1
- package/src/lib/utils/functions/openOnrampPopup.cjs +8 -0
- package/src/lib/utils/functions/openOnrampPopup.js +8 -0
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +9 -3
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +9 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.41.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.41.0...v4.41.1) (2025-10-30)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* aptos login with petra keyless accounts ([#9795](https://github.com/dynamic-labs/dynamic-auth/issues/9795)) ([99dc34b](https://github.com/dynamic-labs/dynamic-auth/commit/99dc34b95d1ec23d168c9e092e2d735b1d50a71d))
|
|
8
|
+
* backpack aptos login due to invalid public key ([#9806](https://github.com/dynamic-labs/dynamic-auth/issues/9806)) ([ec8b761](https://github.com/dynamic-labs/dynamic-auth/commit/ec8b76181acff7906fd92c77c2fca42ce52010ae))
|
|
9
|
+
|
|
10
|
+
## [4.41.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.40.2...v4.41.0) (2025-10-29)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **react-native:** add MFA recovery methods ([#9788](https://github.com/dynamic-labs/dynamic-auth/issues/9788)) ([664e0d5](https://github.com/dynamic-labs/dynamic-auth/commit/664e0d5878530abc9e645c8801a87f3109cfd8f9))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* crypto.com link opening on mobile ([#9779](https://github.com/dynamic-labs/dynamic-auth/issues/9779)) ([3439ac9](https://github.com/dynamic-labs/dynamic-auth/commit/3439ac9e2610360c6204f6195433ae3e05e26c30))
|
|
21
|
+
|
|
2
22
|
### [4.40.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.40.1...v4.40.2) (2025-10-28)
|
|
3
23
|
|
|
4
24
|
|
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.41.1",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@dynamic-labs/sdk-api-core": "0.0.813",
|
|
6
6
|
"@dynamic-labs-sdk/client": "0.1.0-alpha.23",
|
|
@@ -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.41.1",
|
|
19
|
+
"@dynamic-labs/iconic": "4.41.1",
|
|
20
|
+
"@dynamic-labs/locale": "4.41.1",
|
|
21
|
+
"@dynamic-labs/logger": "4.41.1",
|
|
22
|
+
"@dynamic-labs/multi-wallet": "4.41.1",
|
|
23
|
+
"@dynamic-labs/rpc-providers": "4.41.1",
|
|
24
|
+
"@dynamic-labs/store": "4.41.1",
|
|
25
|
+
"@dynamic-labs/types": "4.41.1",
|
|
26
|
+
"@dynamic-labs/utils": "4.41.1",
|
|
27
|
+
"@dynamic-labs/wallet-book": "4.41.1",
|
|
28
|
+
"@dynamic-labs/wallet-connector-core": "4.41.1",
|
|
29
29
|
"eventemitter3": "5.0.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
@@ -36,6 +36,6 @@ const useDynamicSettingsValue = (projectSettingName, dynamicSettingName) => {
|
|
|
36
36
|
const dynamicSettings = dynamicContextProps.useDynamicSettings();
|
|
37
37
|
return ((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general[projectSettingName]) !== null && _a !== void 0 ? _a : dynamicSettings[dynamicSettingName]);
|
|
38
38
|
};
|
|
39
|
-
const useAppName = () => useDynamicSettingsValue('
|
|
39
|
+
const useAppName = () => useDynamicSettingsValue('displayName', 'appName');
|
|
40
40
|
|
|
41
41
|
exports.useAppName = useAppName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useAppName: () => string |
|
|
1
|
+
export declare const useAppName: () => string | undefined;
|
|
@@ -32,6 +32,6 @@ const useDynamicSettingsValue = (projectSettingName, dynamicSettingName) => {
|
|
|
32
32
|
const dynamicSettings = useDynamicSettings();
|
|
33
33
|
return ((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general[projectSettingName]) !== null && _a !== void 0 ? _a : dynamicSettings[dynamicSettingName]);
|
|
34
34
|
};
|
|
35
|
-
const useAppName = () => useDynamicSettingsValue('
|
|
35
|
+
const useAppName = () => useDynamicSettingsValue('displayName', 'appName');
|
|
36
36
|
|
|
37
37
|
export { useAppName };
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../../../_virtual/_tslib.cjs');
|
|
7
7
|
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
8
|
+
var utils = require('@dynamic-labs/utils');
|
|
8
9
|
var openPopup = require('./openPopup/openPopup.cjs');
|
|
9
10
|
|
|
10
11
|
const ONRAMP_POPUP_CONFIG = {
|
|
@@ -26,6 +27,13 @@ const openOnrampPopup = (url_1, wallet_1, setShowOnramp_1, ...args_1) => _tslib.
|
|
|
26
27
|
if (!url) {
|
|
27
28
|
throw new Error('Cannot open onramp popup: Empty URL');
|
|
28
29
|
}
|
|
30
|
+
// On mobile devices, fall back to direct navigation for crypto.com
|
|
31
|
+
// since mobile browsers often block popups
|
|
32
|
+
if (utils.isMobile() && provider === sdkApiCore.OnrampProviders.CryptoDotCom) {
|
|
33
|
+
window.open(url, '_blank', 'noopener,noreferrer');
|
|
34
|
+
setShowOnramp(false);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
29
37
|
// Open the popup - errors will propagate to the caller
|
|
30
38
|
yield openPopup.openPopup(url, ONRAMP_POPUP_CONFIG.width, ONRAMP_POPUP_CONFIG.height, () => {
|
|
31
39
|
// When the popup is closed (by user or programmatically), update the UI
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
3
3
|
import { OnrampProviders } from '@dynamic-labs/sdk-api-core';
|
|
4
|
+
import { isMobile } from '@dynamic-labs/utils';
|
|
4
5
|
import { openPopup } from './openPopup/openPopup.js';
|
|
5
6
|
|
|
6
7
|
const ONRAMP_POPUP_CONFIG = {
|
|
@@ -22,6 +23,13 @@ const openOnrampPopup = (url_1, wallet_1, setShowOnramp_1, ...args_1) => __await
|
|
|
22
23
|
if (!url) {
|
|
23
24
|
throw new Error('Cannot open onramp popup: Empty URL');
|
|
24
25
|
}
|
|
26
|
+
// On mobile devices, fall back to direct navigation for crypto.com
|
|
27
|
+
// since mobile browsers often block popups
|
|
28
|
+
if (isMobile() && provider === OnrampProviders.CryptoDotCom) {
|
|
29
|
+
window.open(url, '_blank', 'noopener,noreferrer');
|
|
30
|
+
setShowOnramp(false);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
25
33
|
// Open the popup - errors will propagate to the caller
|
|
26
34
|
yield openPopup(url, ONRAMP_POPUP_CONFIG.width, ONRAMP_POPUP_CONFIG.height, () => {
|
|
27
35
|
// When the popup is closed (by user or programmatically), update the UI
|
|
@@ -342,6 +342,7 @@ const useDynamicWaas = () => {
|
|
|
342
342
|
yield walletConnector.importPrivateKey({
|
|
343
343
|
chainName,
|
|
344
344
|
privateKey,
|
|
345
|
+
publicAddressCheck: wallet.address,
|
|
345
346
|
});
|
|
346
347
|
isUpgrading.current = false;
|
|
347
348
|
}
|
|
@@ -355,9 +356,14 @@ const useDynamicWaas = () => {
|
|
|
355
356
|
yield refresh();
|
|
356
357
|
}
|
|
357
358
|
isUpgrading.current = false;
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
359
|
+
if (error instanceof utils.DynamicError) {
|
|
360
|
+
throw error;
|
|
361
|
+
}
|
|
362
|
+
const errorMessage = (error === null || error === void 0 ? void 0 : error.message) || '';
|
|
363
|
+
if (errorMessage.includes('Public address mismatch')) {
|
|
364
|
+
throw new utils.DynamicError('Public address mismatch. Ensure the private key is copied correctly.');
|
|
365
|
+
}
|
|
366
|
+
throw new utils.DynamicError('Upgrade failed, please try again.');
|
|
361
367
|
}
|
|
362
368
|
}), [environmentId, getWalletConnector, primaryWallet, refresh]);
|
|
363
369
|
const delegateKeyShares = React.useCallback((wallets) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -338,6 +338,7 @@ const useDynamicWaas = () => {
|
|
|
338
338
|
yield walletConnector.importPrivateKey({
|
|
339
339
|
chainName,
|
|
340
340
|
privateKey,
|
|
341
|
+
publicAddressCheck: wallet.address,
|
|
341
342
|
});
|
|
342
343
|
isUpgrading.current = false;
|
|
343
344
|
}
|
|
@@ -351,9 +352,14 @@ const useDynamicWaas = () => {
|
|
|
351
352
|
yield refresh();
|
|
352
353
|
}
|
|
353
354
|
isUpgrading.current = false;
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
355
|
+
if (error instanceof DynamicError) {
|
|
356
|
+
throw error;
|
|
357
|
+
}
|
|
358
|
+
const errorMessage = (error === null || error === void 0 ? void 0 : error.message) || '';
|
|
359
|
+
if (errorMessage.includes('Public address mismatch')) {
|
|
360
|
+
throw new DynamicError('Public address mismatch. Ensure the private key is copied correctly.');
|
|
361
|
+
}
|
|
362
|
+
throw new DynamicError('Upgrade failed, please try again.');
|
|
357
363
|
}
|
|
358
364
|
}), [environmentId, getWalletConnector, primaryWallet, refresh]);
|
|
359
365
|
const delegateKeyShares = useCallback((wallets) => __awaiter(void 0, void 0, void 0, function* () {
|