@dynamic-labs/utils 4.92.3 → 4.92.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 +17 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +5 -5
- package/src/services/Oauth2Service/createWindowOauth2Service/createWindowOauth2Service.cjs +22 -0
- package/src/services/Oauth2Service/createWindowOauth2Service/createWindowOauth2Service.js +22 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.92.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.92.3...v4.92.4) (2026-07-16)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **bitcoin:** per-network address switching and dust-limit send validation [v4] ([#11970](https://github.com/dynamic-labs/dynamic-auth/issues/11970)) ([76a4a9a](https://github.com/dynamic-labs/dynamic-auth/commit/76a4a9a5025d78798ebd1beffe6c0af59d2d029a)), closes [#11896](https://github.com/dynamic-labs/dynamic-auth/issues/11896) [#11800](https://github.com/dynamic-labs/dynamic-auth/issues/11800)
|
|
8
|
+
* **midnight:** per-network addresses in deposit and wallet info views [v4] ([#11949](https://github.com/dynamic-labs/dynamic-auth/issues/11949)) ([978446a](https://github.com/dynamic-labs/dynamic-auth/commit/978446aca8546eb038ba9ed3be0503d10594ee15))
|
|
9
|
+
* **midnight:** resolve wallet address per selected network [v4] ([#11948](https://github.com/dynamic-labs/dynamic-auth/issues/11948)) ([d6f858c](https://github.com/dynamic-labs/dynamic-auth/commit/d6f858c5e35defda7ed73cf97b3fdbe5ed9d131d))
|
|
10
|
+
* set useMetamaskSdk to true by default ([#11926](https://github.com/dynamic-labs/dynamic-auth/issues/11926)) ([75b5a4a](https://github.com/dynamic-labs/dynamic-auth/commit/75b5a4a0fe8b1a375afce145c0b8bdc3ce761117))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **midnight:** align per-network code with the final main iteration [v4] ([#11971](https://github.com/dynamic-labs/dynamic-auth/issues/11971)) ([3ef3ba8](https://github.com/dynamic-labs/dynamic-auth/commit/3ef3ba8c090dfd9e4286b4e51bf350ea5e6feac7))
|
|
16
|
+
* settle social sign-in when captcha is backed out or oauth popup never responds (v4) ([#11956](https://github.com/dynamic-labs/dynamic-auth/issues/11956)) ([ad49477](https://github.com/dynamic-labs/dynamic-auth/commit/ad49477f2acf61a154bb79cbe26b24f803cdb0e2))
|
|
17
|
+
* validate that private key is not empty before upgrading to WaaS ([#11952](https://github.com/dynamic-labs/dynamic-auth/issues/11952)) ([21dfb83](https://github.com/dynamic-labs/dynamic-auth/commit/21dfb83cb29e42b335bc94a0cdd2062cf14a262a))
|
|
18
|
+
|
|
2
19
|
### [4.92.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.92.2...v4.92.3) (2026-07-10)
|
|
3
20
|
|
|
4
21
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/utils",
|
|
3
|
-
"version": "4.92.
|
|
3
|
+
"version": "4.92.4",
|
|
4
4
|
"description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://www.dynamic.xyz/",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
21
|
+
"@dynamic-labs/sdk-api-core": "0.0.1073",
|
|
22
22
|
"tldts": "6.0.16",
|
|
23
|
-
"@dynamic-labs/assert-package-version": "4.92.
|
|
24
|
-
"@dynamic-labs/logger": "4.92.
|
|
25
|
-
"@dynamic-labs/types": "4.92.
|
|
23
|
+
"@dynamic-labs/assert-package-version": "4.92.4",
|
|
24
|
+
"@dynamic-labs/logger": "4.92.4",
|
|
25
|
+
"@dynamic-labs/types": "4.92.4",
|
|
26
26
|
"buffer": "6.0.3",
|
|
27
27
|
"eventemitter3": "5.0.1"
|
|
28
28
|
},
|
|
@@ -12,6 +12,12 @@ var PlatformService = require('../../PlatformService/PlatformService.cjs');
|
|
|
12
12
|
require('tldts');
|
|
13
13
|
|
|
14
14
|
let authWindowInterval;
|
|
15
|
+
let authWindowTimeout;
|
|
16
|
+
// The backend caches the oauth init state for 5 minutes; past that the
|
|
17
|
+
// redirect can never complete, so if the popup still hasn't posted a result
|
|
18
|
+
// back by then (eg it landed on an error page and just sits there), settle
|
|
19
|
+
// the promise instead of leaving the pending view up forever.
|
|
20
|
+
const OAUTH_COMPLETION_TIMEOUT_MS = 6 * 60 * 1000;
|
|
15
21
|
const createWindowOauth2Service = () => ({
|
|
16
22
|
getOauthCode: ({ apiProvider, provider, redirectUrl, setIsProcessing, state, oauthLoginUrl, initWebAuth, strategy, }) => new Promise((resolve, _reject) => {
|
|
17
23
|
/**
|
|
@@ -46,6 +52,7 @@ const createWindowOauth2Service = () => ({
|
|
|
46
52
|
const typedReject = (params) => _reject(params);
|
|
47
53
|
// Clear any potential pending timeouts and intervals
|
|
48
54
|
clearInterval(authWindowInterval);
|
|
55
|
+
clearTimeout(authWindowTimeout);
|
|
49
56
|
const providersWaitingOauthMessage = {};
|
|
50
57
|
const authWindow = window.open('', '_blank', 'width=500,height=600');
|
|
51
58
|
if (authWindow === null || typeof authWindow === 'undefined') {
|
|
@@ -58,6 +65,7 @@ const createWindowOauth2Service = () => ({
|
|
|
58
65
|
}
|
|
59
66
|
const clearListeners = () => {
|
|
60
67
|
window.removeEventListener('message', handleWindowMessage);
|
|
68
|
+
clearTimeout(authWindowTimeout);
|
|
61
69
|
providersWaitingOauthMessage[provider] = false;
|
|
62
70
|
};
|
|
63
71
|
const handleWindowMessage = (event) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -170,10 +178,24 @@ const createWindowOauth2Service = () => ({
|
|
|
170
178
|
// First we store the state in backend
|
|
171
179
|
initWebAuth().then(() => {
|
|
172
180
|
authWindow === null || authWindow === void 0 ? void 0 : authWindow.location.assign(oauthLoginUrl);
|
|
181
|
+
authWindowTimeout = setTimeout(() => {
|
|
182
|
+
clearInterval(authWindowInterval);
|
|
183
|
+
setIsProcessing(false);
|
|
184
|
+
// already resolved or rejected through another path
|
|
185
|
+
if (!providersWaitingOauthMessage[provider])
|
|
186
|
+
return;
|
|
187
|
+
clearListeners();
|
|
188
|
+
authWindow === null || authWindow === void 0 ? void 0 : authWindow.close();
|
|
189
|
+
typedReject({
|
|
190
|
+
code: types.SocialOAuthErrorCode.SESSION_TIMEOUT,
|
|
191
|
+
message: `Connecting ${provider} account timed out. Please try again.`,
|
|
192
|
+
});
|
|
193
|
+
}, OAUTH_COMPLETION_TIMEOUT_MS);
|
|
173
194
|
authWindowInterval = setInterval(() => {
|
|
174
195
|
if (!(authWindow === null || authWindow === void 0 ? void 0 : authWindow.closed))
|
|
175
196
|
return;
|
|
176
197
|
clearInterval(authWindowInterval);
|
|
198
|
+
clearTimeout(authWindowTimeout);
|
|
177
199
|
setIsProcessing(false);
|
|
178
200
|
// user didn't complete oauth
|
|
179
201
|
if (providersWaitingOauthMessage[provider])
|
|
@@ -8,6 +8,12 @@ import { PlatformService } from '../../PlatformService/PlatformService.js';
|
|
|
8
8
|
import 'tldts';
|
|
9
9
|
|
|
10
10
|
let authWindowInterval;
|
|
11
|
+
let authWindowTimeout;
|
|
12
|
+
// The backend caches the oauth init state for 5 minutes; past that the
|
|
13
|
+
// redirect can never complete, so if the popup still hasn't posted a result
|
|
14
|
+
// back by then (eg it landed on an error page and just sits there), settle
|
|
15
|
+
// the promise instead of leaving the pending view up forever.
|
|
16
|
+
const OAUTH_COMPLETION_TIMEOUT_MS = 6 * 60 * 1000;
|
|
11
17
|
const createWindowOauth2Service = () => ({
|
|
12
18
|
getOauthCode: ({ apiProvider, provider, redirectUrl, setIsProcessing, state, oauthLoginUrl, initWebAuth, strategy, }) => new Promise((resolve, _reject) => {
|
|
13
19
|
/**
|
|
@@ -42,6 +48,7 @@ const createWindowOauth2Service = () => ({
|
|
|
42
48
|
const typedReject = (params) => _reject(params);
|
|
43
49
|
// Clear any potential pending timeouts and intervals
|
|
44
50
|
clearInterval(authWindowInterval);
|
|
51
|
+
clearTimeout(authWindowTimeout);
|
|
45
52
|
const providersWaitingOauthMessage = {};
|
|
46
53
|
const authWindow = window.open('', '_blank', 'width=500,height=600');
|
|
47
54
|
if (authWindow === null || typeof authWindow === 'undefined') {
|
|
@@ -54,6 +61,7 @@ const createWindowOauth2Service = () => ({
|
|
|
54
61
|
}
|
|
55
62
|
const clearListeners = () => {
|
|
56
63
|
window.removeEventListener('message', handleWindowMessage);
|
|
64
|
+
clearTimeout(authWindowTimeout);
|
|
57
65
|
providersWaitingOauthMessage[provider] = false;
|
|
58
66
|
};
|
|
59
67
|
const handleWindowMessage = (event) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -166,10 +174,24 @@ const createWindowOauth2Service = () => ({
|
|
|
166
174
|
// First we store the state in backend
|
|
167
175
|
initWebAuth().then(() => {
|
|
168
176
|
authWindow === null || authWindow === void 0 ? void 0 : authWindow.location.assign(oauthLoginUrl);
|
|
177
|
+
authWindowTimeout = setTimeout(() => {
|
|
178
|
+
clearInterval(authWindowInterval);
|
|
179
|
+
setIsProcessing(false);
|
|
180
|
+
// already resolved or rejected through another path
|
|
181
|
+
if (!providersWaitingOauthMessage[provider])
|
|
182
|
+
return;
|
|
183
|
+
clearListeners();
|
|
184
|
+
authWindow === null || authWindow === void 0 ? void 0 : authWindow.close();
|
|
185
|
+
typedReject({
|
|
186
|
+
code: SocialOAuthErrorCode.SESSION_TIMEOUT,
|
|
187
|
+
message: `Connecting ${provider} account timed out. Please try again.`,
|
|
188
|
+
});
|
|
189
|
+
}, OAUTH_COMPLETION_TIMEOUT_MS);
|
|
169
190
|
authWindowInterval = setInterval(() => {
|
|
170
191
|
if (!(authWindow === null || authWindow === void 0 ? void 0 : authWindow.closed))
|
|
171
192
|
return;
|
|
172
193
|
clearInterval(authWindowInterval);
|
|
194
|
+
clearTimeout(authWindowTimeout);
|
|
173
195
|
setIsProcessing(false);
|
|
174
196
|
// user didn't complete oauth
|
|
175
197
|
if (providersWaitingOauthMessage[provider])
|