@dynamic-labs/sdk-react-core 4.8.3 → 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.
- package/CHANGELOG.md +13 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +11 -11
- package/src/lib/components/ShadowDOM/utils.cjs +1 -0
- package/src/lib/components/ShadowDOM/utils.js +1 -0
- package/src/lib/context/PhantomRedirectContext/PhantomRedirectContext.cjs +1 -1
- package/src/lib/context/PhantomRedirectContext/PhantomRedirectContext.js +2 -2
- package/src/lib/context/PhantomRedirectContext/useResponseHandlers.cjs +0 -4
- package/src/lib/context/PhantomRedirectContext/useResponseHandlers.js +0 -4
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +2 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +2 -0
- package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.cjs +1 -0
- package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.js +1 -0
- package/src/lib/shared/utils/functions/getInitialUrl/getInitialUrl.cjs +1 -0
- package/src/lib/shared/utils/functions/getInitialUrl/getInitialUrl.js +1 -0
- package/src/lib/utils/functions/generateMessages/index.cjs +3 -2
- package/src/lib/utils/functions/generateMessages/index.js +4 -3
- package/src/lib/utils/functions/getAppOrigin/getAppOrigin.cjs +1 -0
- package/src/lib/utils/functions/getAppOrigin/getAppOrigin.js +1 -0
- package/src/lib/utils/functions/isProgrammableNetworkSwitchSupported/isProgrammableNetworkSwitchSupported.cjs +1 -0
- package/src/lib/utils/functions/isProgrammableNetworkSwitchSupported/isProgrammableNetworkSwitchSupported.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
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
|
+
|
|
2
15
|
### [4.8.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.8.2...v4.8.3) (2025-03-04)
|
|
3
16
|
|
|
4
17
|
|
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.8.
|
|
3
|
+
"version": "4.8.4",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@dynamic-labs/sdk-api-core": "0.0.638",
|
|
6
6
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
@@ -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.
|
|
18
|
-
"@dynamic-labs/iconic": "4.8.
|
|
19
|
-
"@dynamic-labs/logger": "4.8.
|
|
20
|
-
"@dynamic-labs/multi-wallet": "4.8.
|
|
21
|
-
"@dynamic-labs/rpc-providers": "4.8.
|
|
22
|
-
"@dynamic-labs/store": "4.8.
|
|
23
|
-
"@dynamic-labs/types": "4.8.
|
|
24
|
-
"@dynamic-labs/utils": "4.8.
|
|
25
|
-
"@dynamic-labs/wallet-book": "4.8.
|
|
26
|
-
"@dynamic-labs/wallet-connector-core": "4.8.
|
|
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": {
|
|
@@ -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)) {
|
|
@@ -103,7 +103,7 @@ const PhantomRedirectContextProvider = ({ children, }) => {
|
|
|
103
103
|
if (!phantomRedirectConnector || !utils.isMobile() || !sdkHasLoaded) {
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
const params =
|
|
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 =
|
|
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');
|
|
@@ -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:
|
|
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:
|
|
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:
|
|
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:
|
|
38
|
+
uri: currentUrl.origin + currentUrl.pathname,
|
|
38
39
|
});
|
|
39
40
|
const signedMessage = yield walletConnector.proveOwnership(parsedAddress, messageToSign);
|
|
40
41
|
if (!signedMessage) {
|
|
@@ -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');
|