@dynamic-labs/utils 4.6.0 → 4.6.2
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.d.ts +4 -0
- package/src/index.cjs +2 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,29 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.6.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.6.1...v4.6.2) (2025-02-14)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add funding from linked wallets ([#8067](https://github.com/dynamic-labs/dynamic-auth/issues/8067)) ([1f9dc71](https://github.com/dynamic-labs/dynamic-auth/commit/1f9dc715a04b558a96164c7a143171abac3890b4))
|
|
8
|
+
* add walletConnectedForFunding event ([#8058](https://github.com/dynamic-labs/dynamic-auth/issues/8058)) ([8c5a244](https://github.com/dynamic-labs/dynamic-auth/commit/8c5a24405c5a7ae2e91bbbee6c1eebca9169ec3e))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* back button from MFA backup codes view not working properly ([#8085](https://github.com/dynamic-labs/dynamic-auth/issues/8085)) ([9af0b6f](https://github.com/dynamic-labs/dynamic-auth/commit/9af0b6faada610180ff061a55715d3f0e2a853a0))
|
|
14
|
+
* issue with authenticating a user on connect-only mode ([#8084](https://github.com/dynamic-labs/dynamic-auth/issues/8084)) ([7bf881b](https://github.com/dynamic-labs/dynamic-auth/commit/7bf881b4fab4b8c64993bf4a7936eb8435408a2e))
|
|
15
|
+
* rerendering issue in usetokenbalance ([#8079](https://github.com/dynamic-labs/dynamic-auth/issues/8079)) ([e52b481](https://github.com/dynamic-labs/dynamic-auth/commit/e52b48112c4a3627bb51cc7cf03181bcba66aada))
|
|
16
|
+
|
|
17
|
+
### [4.6.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.6.0...v4.6.1) (2025-02-11)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* 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))
|
|
23
|
+
* 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))
|
|
24
|
+
* 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))
|
|
25
|
+
* 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))
|
|
26
|
+
|
|
2
27
|
## [4.6.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.5.3...v4.6.0) (2025-02-10)
|
|
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.6.
|
|
3
|
+
"version": "4.6.2",
|
|
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.627",
|
|
22
22
|
"tldts": "6.0.16",
|
|
23
|
-
"@dynamic-labs/assert-package-version": "4.6.
|
|
24
|
-
"@dynamic-labs/logger": "4.6.
|
|
25
|
-
"@dynamic-labs/types": "4.6.
|
|
23
|
+
"@dynamic-labs/assert-package-version": "4.6.2",
|
|
24
|
+
"@dynamic-labs/logger": "4.6.2",
|
|
25
|
+
"@dynamic-labs/types": "4.6.2",
|
|
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';
|
|
@@ -8,4 +8,8 @@ export type PhantomRedirectConnectionType = {
|
|
|
8
8
|
* Whether connector has already consumed and validated this connection type
|
|
9
9
|
*/
|
|
10
10
|
connectorConsumed: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Whether this connection was initiated by the widget UI or headless code
|
|
13
|
+
*/
|
|
14
|
+
initiatedByWidget: boolean;
|
|
11
15
|
};
|
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');
|
|
@@ -192,6 +193,7 @@ exports.isEncryptedMessage = isEncryptedMessage.isEncryptedMessage;
|
|
|
192
193
|
exports.uint8ArrayFromBase64 = uint8ArrayToBase64.uint8ArrayFromBase64;
|
|
193
194
|
exports.uint8ArrayToBase64 = uint8ArrayToBase64.uint8ArrayToBase64;
|
|
194
195
|
exports.formatVersion = formatVersion.formatVersion;
|
|
196
|
+
exports.assertDefined = assertDefined.assertDefined;
|
|
195
197
|
exports.cloneObjectWithOverrides = cloneObjectWithOverrides.cloneObjectWithOverrides;
|
|
196
198
|
exports.get = get.get;
|
|
197
199
|
exports.hexToString = hexToString.hexToString;
|
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';
|
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';
|