@dynamic-labs/utils 4.5.3 → 4.6.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 +25 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +5 -5
- package/src/assertDefined/assertDefined.cjs +19 -0
- package/src/assertDefined/assertDefined.d.ts +7 -0
- package/src/assertDefined/assertDefined.js +15 -0
- package/src/assertDefined/index.d.ts +1 -0
- package/src/consts/phantomRedirect.cjs +8 -0
- package/src/consts/phantomRedirect.d.ts +11 -0
- package/src/consts/phantomRedirect.js +4 -0
- package/src/index.cjs +4 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,29 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.6.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.6.0...v4.6.1) (2025-02-11)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* do not show undefined subdomains ([#8060](https://github.com/dynamic-labs/dynamic-auth/issues/8060)) ([ec7ca3d](https://github.com/dynamic-labs/dynamic-auth/commit/ec7ca3d1284422f54f3a1275e1983d50912bcc34))
|
|
8
|
+
* ensure project settings is present on is-cookie-enabled ([#8057](https://github.com/dynamic-labs/dynamic-auth/issues/8057)) ([81c6495](https://github.com/dynamic-labs/dynamic-auth/commit/81c64957031633c00c9e5ecaf304269605202abb))
|
|
9
|
+
* prevent user profile widget from automatically opening when linking a new wallet ([#8020](https://github.com/dynamic-labs/dynamic-auth/issues/8020)) ([4f05ac9](https://github.com/dynamic-labs/dynamic-auth/commit/4f05ac9fdc5a2fc415567dff1b33ddffd0478804))
|
|
10
|
+
* project settings loading and cookie setting check ([#8056](https://github.com/dynamic-labs/dynamic-auth/issues/8056)) ([457a298](https://github.com/dynamic-labs/dynamic-auth/commit/457a298ff11387ca858f85fb19d6c421e02fcc88))
|
|
11
|
+
|
|
12
|
+
## [4.6.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.5.3...v4.6.0) (2025-02-10)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* expose method to refetch project settings ([#8048](https://github.com/dynamic-labs/dynamic-auth/issues/8048)) ([10af30c](https://github.com/dynamic-labs/dynamic-auth/commit/10af30cb5caf39b95eaae39ad831466f6f73b98a))
|
|
18
|
+
* add new hook to delete user ([#8013](https://github.com/dynamic-labs/dynamic-auth/issues/8013)) ([c312285](https://github.com/dynamic-labs/dynamic-auth/commit/c312285b4e4663eedf83a4c8c043715ba6c1a9ed))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* add memos and fix state updates to prevent rerenders ([#8024](https://github.com/dynamic-labs/dynamic-auth/issues/8024)) ([89504c0](https://github.com/dynamic-labs/dynamic-auth/commit/89504c0efa29ed846a55d7eb3213a1b9b070368a))
|
|
24
|
+
* back button not working properly in the farcaster connect view ([#8051](https://github.com/dynamic-labs/dynamic-auth/issues/8051)) ([5fe4631](https://github.com/dynamic-labs/dynamic-auth/commit/5fe463105ce43dd7ec31cd90ee6922bd917ed9de))
|
|
25
|
+
* update wallet address when switching networks in cosmos ([#8016](https://github.com/dynamic-labs/dynamic-auth/issues/8016)) ([2925784](https://github.com/dynamic-labs/dynamic-auth/commit/29257846fa99600a67cf010447248451cd17ae60))
|
|
26
|
+
|
|
2
27
|
### [4.5.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.5.2...v4.5.3) (2025-02-09)
|
|
3
28
|
|
|
4
29
|
|
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.
|
|
3
|
+
"version": "4.6.1",
|
|
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.622",
|
|
22
22
|
"tldts": "6.0.16",
|
|
23
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
24
|
-
"@dynamic-labs/logger": "4.
|
|
25
|
-
"@dynamic-labs/types": "4.
|
|
23
|
+
"@dynamic-labs/assert-package-version": "4.6.1",
|
|
24
|
+
"@dynamic-labs/logger": "4.6.1",
|
|
25
|
+
"@dynamic-labs/types": "4.6.1",
|
|
26
26
|
"buffer": "6.0.3",
|
|
27
27
|
"eventemitter3": "5.0.1"
|
|
28
28
|
},
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Type guard assertion function that throws an error if the condition is false.
|
|
8
|
+
* @param value The condition to check
|
|
9
|
+
* @param message The error message to display if assertion fails
|
|
10
|
+
* @throws {Error} If the assertion condition is false
|
|
11
|
+
*/
|
|
12
|
+
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
|
|
13
|
+
function assertDefined(value, message) {
|
|
14
|
+
if (!value) {
|
|
15
|
+
throw new Error(message);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
exports.assertDefined = assertDefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type guard assertion function that throws an error if the condition is false.
|
|
3
|
+
* @param value The condition to check
|
|
4
|
+
* @param message The error message to display if assertion fails
|
|
5
|
+
* @throws {Error} If the assertion condition is false
|
|
6
|
+
*/
|
|
7
|
+
export declare function assertDefined<T>(value: T | null | undefined, message: string): asserts value is T;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
/**
|
|
3
|
+
* Type guard assertion function that throws an error if the condition is false.
|
|
4
|
+
* @param value The condition to check
|
|
5
|
+
* @param message The error message to display if assertion fails
|
|
6
|
+
* @throws {Error} If the assertion condition is false
|
|
7
|
+
*/
|
|
8
|
+
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
|
|
9
|
+
function assertDefined(value, message) {
|
|
10
|
+
if (!value) {
|
|
11
|
+
throw new Error(message);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { assertDefined };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { assertDefined } from './assertDefined';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
const PHANTOM_REDIRECT_CONNECTION_TYPE_KEY = 'phantom-redirect-connection-type';
|
|
7
|
+
|
|
8
|
+
exports.PHANTOM_REDIRECT_CONNECTION_TYPE_KEY = PHANTOM_REDIRECT_CONNECTION_TYPE_KEY;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const PHANTOM_REDIRECT_CONNECTION_TYPE_KEY = "phantom-redirect-connection-type";
|
|
2
|
+
export type PhantomRedirectConnectionType = {
|
|
3
|
+
/**
|
|
4
|
+
* Reason for this connection
|
|
5
|
+
*/
|
|
6
|
+
type: 'default' | 'external-wallet-funding';
|
|
7
|
+
/**
|
|
8
|
+
* Whether connector has already consumed and validated this connection type
|
|
9
|
+
*/
|
|
10
|
+
connectorConsumed: boolean;
|
|
11
|
+
};
|
package/src/index.cjs
CHANGED
|
@@ -78,6 +78,7 @@ var encryptMessage = require('./encryption/encryptMessage/encryptMessage.cjs');
|
|
|
78
78
|
var isEncryptedMessage = require('./encryption/isEncryptedMessage/isEncryptedMessage.cjs');
|
|
79
79
|
var uint8ArrayToBase64 = require('./uint8ArrayToBase64/uint8ArrayToBase64.cjs');
|
|
80
80
|
var formatVersion = require('./formatVersion/formatVersion.cjs');
|
|
81
|
+
var assertDefined = require('./assertDefined/assertDefined.cjs');
|
|
81
82
|
var cloneObjectWithOverrides = require('./cloneObjectWithOverrides/cloneObjectWithOverrides.cjs');
|
|
82
83
|
var get = require('./get/get.cjs');
|
|
83
84
|
var hexToString = require('./hexToString/hexToString.cjs');
|
|
@@ -86,6 +87,7 @@ var isInIframe = require('./isInIframe/isInIframe.cjs');
|
|
|
86
87
|
var promiseWithTimeout = require('./promiseWithTimeout/promiseWithTimeout.cjs');
|
|
87
88
|
var runSafe = require('./runSafe/runSafe.cjs');
|
|
88
89
|
var template = require('./template/template.cjs');
|
|
90
|
+
var phantomRedirect = require('./consts/phantomRedirect.cjs');
|
|
89
91
|
var PlatformService = require('./services/PlatformService/PlatformService.cjs');
|
|
90
92
|
var createBrowserPlatformService = require('./services/PlatformService/createBrowserPlatformService/createBrowserPlatformService.cjs');
|
|
91
93
|
var FetchService = require('./services/FetchService/FetchService.cjs');
|
|
@@ -191,6 +193,7 @@ exports.isEncryptedMessage = isEncryptedMessage.isEncryptedMessage;
|
|
|
191
193
|
exports.uint8ArrayFromBase64 = uint8ArrayToBase64.uint8ArrayFromBase64;
|
|
192
194
|
exports.uint8ArrayToBase64 = uint8ArrayToBase64.uint8ArrayToBase64;
|
|
193
195
|
exports.formatVersion = formatVersion.formatVersion;
|
|
196
|
+
exports.assertDefined = assertDefined.assertDefined;
|
|
194
197
|
exports.cloneObjectWithOverrides = cloneObjectWithOverrides.cloneObjectWithOverrides;
|
|
195
198
|
exports.get = get.get;
|
|
196
199
|
exports.hexToString = hexToString.hexToString;
|
|
@@ -199,6 +202,7 @@ exports.isInIframe = isInIframe.isInIframe;
|
|
|
199
202
|
exports.promiseWithTimeout = promiseWithTimeout.promiseWithTimeout;
|
|
200
203
|
exports.runSafe = runSafe.runSafe;
|
|
201
204
|
exports.template = template.template;
|
|
205
|
+
exports.PHANTOM_REDIRECT_CONNECTION_TYPE_KEY = phantomRedirect.PHANTOM_REDIRECT_CONNECTION_TYPE_KEY;
|
|
202
206
|
exports.PlatformService = PlatformService.PlatformService;
|
|
203
207
|
exports.createBrowserPlatformService = createBrowserPlatformService.createBrowserPlatformService;
|
|
204
208
|
exports.FetchService = FetchService.FetchService;
|
package/src/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export * from './wrapMethodWithCallback';
|
|
|
28
28
|
export * from './encryption';
|
|
29
29
|
export * from './uint8ArrayToBase64';
|
|
30
30
|
export * from './formatVersion';
|
|
31
|
+
export * from './assertDefined';
|
|
31
32
|
export { cloneObjectWithOverrides } from './cloneObjectWithOverrides';
|
|
32
33
|
export { get } from './get';
|
|
33
34
|
export { hexToString } from './hexToString';
|
|
@@ -36,6 +37,7 @@ export { isInIframe } from './isInIframe';
|
|
|
36
37
|
export { promiseWithTimeout } from './promiseWithTimeout';
|
|
37
38
|
export { runSafe } from './runSafe';
|
|
38
39
|
export { template } from './template';
|
|
40
|
+
export { PHANTOM_REDIRECT_CONNECTION_TYPE_KEY, type PhantomRedirectConnectionType, } from './consts/phantomRedirect';
|
|
39
41
|
export { PlatformService, createBrowserPlatformService, type IPlatformService, } from './services/PlatformService';
|
|
40
42
|
export { FetchService } from './services/FetchService';
|
|
41
43
|
export { Oauth2Service, type GetOauthCodeError, type GetOauthCodeProps, type IOauth2Service, createWindowOauth2Service, } from './services/Oauth2Service';
|
package/src/index.js
CHANGED
|
@@ -74,6 +74,7 @@ export { encryptMessage } from './encryption/encryptMessage/encryptMessage.js';
|
|
|
74
74
|
export { isEncryptedMessage } from './encryption/isEncryptedMessage/isEncryptedMessage.js';
|
|
75
75
|
export { uint8ArrayFromBase64, uint8ArrayToBase64 } from './uint8ArrayToBase64/uint8ArrayToBase64.js';
|
|
76
76
|
export { formatVersion } from './formatVersion/formatVersion.js';
|
|
77
|
+
export { assertDefined } from './assertDefined/assertDefined.js';
|
|
77
78
|
export { cloneObjectWithOverrides } from './cloneObjectWithOverrides/cloneObjectWithOverrides.js';
|
|
78
79
|
export { get } from './get/get.js';
|
|
79
80
|
export { hexToString } from './hexToString/hexToString.js';
|
|
@@ -82,6 +83,7 @@ export { isInIframe } from './isInIframe/isInIframe.js';
|
|
|
82
83
|
export { promiseWithTimeout } from './promiseWithTimeout/promiseWithTimeout.js';
|
|
83
84
|
export { runSafe } from './runSafe/runSafe.js';
|
|
84
85
|
export { template } from './template/template.js';
|
|
86
|
+
export { PHANTOM_REDIRECT_CONNECTION_TYPE_KEY } from './consts/phantomRedirect.js';
|
|
85
87
|
export { PlatformService } from './services/PlatformService/PlatformService.js';
|
|
86
88
|
export { createBrowserPlatformService } from './services/PlatformService/createBrowserPlatformService/createBrowserPlatformService.js';
|
|
87
89
|
export { FetchService } from './services/FetchService/FetchService.js';
|