@dynamic-labs/utils 4.0.0-alpha.0 → 4.0.0-alpha.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 +16 -0
- package/package.json +4 -4
- package/src/cloneObjectWithOverrides/cloneObjectWithOverrides.cjs +10 -1
- package/src/cloneObjectWithOverrides/cloneObjectWithOverrides.js +10 -1
- package/src/errors/InvalidEmbeddedWalletSessionKeyError.cjs +14 -0
- package/src/errors/InvalidEmbeddedWalletSessionKeyError.d.ts +4 -0
- package/src/errors/InvalidEmbeddedWalletSessionKeyError.js +10 -0
- package/src/errors/RequestChannelNotHandledError.cjs +11 -0
- package/src/errors/RequestChannelNotHandledError.d.ts +3 -0
- package/src/errors/RequestChannelNotHandledError.js +7 -0
- package/src/errors/index.d.ts +2 -0
- package/src/index.cjs +4 -0
- package/src/index.js +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.0.0-alpha.1](https://github.com/dynamic-labs/DynamicAuth/compare/v4.0.0-alpha.0...v4.0.0-alpha.1) (2024-09-17)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* blockaid website scanning for global connectivity ([#6874](https://github.com/dynamic-labs/DynamicAuth/issues/6874)) ([f8cbabd](https://github.com/dynamic-labs/DynamicAuth/commit/f8cbabd92fd4b5b096f47ff8e24c572ad7720dd8))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* deeplinking on ethereum and bitcoin sats connector ([#6917](https://github.com/dynamic-labs/DynamicAuth/issues/6917)) ([3896c3a](https://github.com/dynamic-labs/DynamicAuth/commit/3896c3a97819459da74dc5b4771796d7991c1f07))
|
|
13
|
+
* emit walletAdded event when createEmbeddedWalletAccount called ([#6922](https://github.com/dynamic-labs/DynamicAuth/issues/6922)) ([2a8bdd6](https://github.com/dynamic-labs/DynamicAuth/commit/2a8bdd68c50efd946c6f9b398dfae2b3585db34f))
|
|
14
|
+
* interface for sendBitcoin on unisat ([37a1bc2](https://github.com/dynamic-labs/DynamicAuth/commit/37a1bc216f43eef817c40e23b9161327f9d29c59))
|
|
15
|
+
* remove ballet crypto and duplicate keplr entry ([#6906](https://github.com/dynamic-labs/DynamicAuth/issues/6906)) ([14aeeea](https://github.com/dynamic-labs/DynamicAuth/commit/14aeeeaa8d906344f4aeddf9e73527df346b9ea0))
|
|
16
|
+
* solana and cosmos signers not working properly ([#6898](https://github.com/dynamic-labs/DynamicAuth/issues/6898)) ([6f07981](https://github.com/dynamic-labs/DynamicAuth/commit/6f079811c0d7e45b97d2dae72f4141268ab4fe0c))
|
|
17
|
+
|
|
2
18
|
## [4.0.0-alpha.0](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0...v4.0.0-alpha.0) (2024-09-13)
|
|
3
19
|
|
|
4
20
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/utils",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"./package.json": "./package.json"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
29
|
+
"@dynamic-labs/sdk-api-core": "0.0.530",
|
|
30
30
|
"tldts": "6.0.16",
|
|
31
|
-
"@dynamic-labs/logger": "4.0.0-alpha.
|
|
32
|
-
"@dynamic-labs/types": "4.0.0-alpha.
|
|
31
|
+
"@dynamic-labs/logger": "4.0.0-alpha.1",
|
|
32
|
+
"@dynamic-labs/types": "4.0.0-alpha.1",
|
|
33
33
|
"buffer": "6.0.3",
|
|
34
34
|
"eventemitter3": "5.0.1",
|
|
35
35
|
"stream": "0.0.2"
|
|
@@ -18,7 +18,7 @@ const cloneObjectWithOverrides = (original, overrides = {}) => {
|
|
|
18
18
|
// Get the property descriptors from the original object
|
|
19
19
|
const descriptors = Object.getOwnPropertyDescriptors(original);
|
|
20
20
|
// Create a new object using the same prototype as the original
|
|
21
|
-
const clone = Object.create(Object.getPrototypeOf(original)
|
|
21
|
+
const clone = Object.create(Object.getPrototypeOf(original));
|
|
22
22
|
// // Loop through the overrides to redefine any read-only methods
|
|
23
23
|
for (const [key, value] of Object.entries(overrides)) {
|
|
24
24
|
// Redefine the method even if it was read-only on the original object
|
|
@@ -31,6 +31,15 @@ const cloneObjectWithOverrides = (original, overrides = {}) => {
|
|
|
31
31
|
writable: true, // Preserve enumerability
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
+
const overridesKeys = Object.keys(overrides);
|
|
35
|
+
// add properties from original object if they're not in overrides
|
|
36
|
+
// if we add all of them, read-only props/methods might not get properly overwritten
|
|
37
|
+
for (const [key, descriptor] of Object.entries(descriptors)) {
|
|
38
|
+
// if has not been overwritten, add original
|
|
39
|
+
if (!overridesKeys.includes(key)) {
|
|
40
|
+
Object.defineProperty(clone, key, descriptor);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
34
43
|
return clone;
|
|
35
44
|
};
|
|
36
45
|
|
|
@@ -14,7 +14,7 @@ const cloneObjectWithOverrides = (original, overrides = {}) => {
|
|
|
14
14
|
// Get the property descriptors from the original object
|
|
15
15
|
const descriptors = Object.getOwnPropertyDescriptors(original);
|
|
16
16
|
// Create a new object using the same prototype as the original
|
|
17
|
-
const clone = Object.create(Object.getPrototypeOf(original)
|
|
17
|
+
const clone = Object.create(Object.getPrototypeOf(original));
|
|
18
18
|
// // Loop through the overrides to redefine any read-only methods
|
|
19
19
|
for (const [key, value] of Object.entries(overrides)) {
|
|
20
20
|
// Redefine the method even if it was read-only on the original object
|
|
@@ -27,6 +27,15 @@ const cloneObjectWithOverrides = (original, overrides = {}) => {
|
|
|
27
27
|
writable: true, // Preserve enumerability
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
+
const overridesKeys = Object.keys(overrides);
|
|
31
|
+
// add properties from original object if they're not in overrides
|
|
32
|
+
// if we add all of them, read-only props/methods might not get properly overwritten
|
|
33
|
+
for (const [key, descriptor] of Object.entries(descriptors)) {
|
|
34
|
+
// if has not been overwritten, add original
|
|
35
|
+
if (!overridesKeys.includes(key)) {
|
|
36
|
+
Object.defineProperty(clone, key, descriptor);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
30
39
|
return clone;
|
|
31
40
|
};
|
|
32
41
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var DynamicError = require('./DynamicError.cjs');
|
|
7
|
+
|
|
8
|
+
class InvalidEmbeddedWalletSessionKeyError extends DynamicError.DynamicError {
|
|
9
|
+
constructor(error) {
|
|
10
|
+
super(error !== null && error !== void 0 ? error : 'Invalid embedded wallet session key.');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
exports.InvalidEmbeddedWalletSessionKeyError = InvalidEmbeddedWalletSessionKeyError;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { DynamicError } from './DynamicError.js';
|
|
3
|
+
|
|
4
|
+
class InvalidEmbeddedWalletSessionKeyError extends DynamicError {
|
|
5
|
+
constructor(error) {
|
|
6
|
+
super(error !== null && error !== void 0 ? error : 'Invalid embedded wallet session key.');
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { InvalidEmbeddedWalletSessionKeyError };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var DynamicError = require('./DynamicError.cjs');
|
|
7
|
+
|
|
8
|
+
class RequestChannelNotHandledError extends DynamicError.DynamicError {
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
exports.RequestChannelNotHandledError = RequestChannelNotHandledError;
|
package/src/errors/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export * from './InvalidPhoneNumberError';
|
|
|
27
27
|
export * from './MergeAccountsConfirmationError';
|
|
28
28
|
export * from './CustomFieldNotUniqueError';
|
|
29
29
|
export * from './CookieInvalidError';
|
|
30
|
+
export * from './RequestChannelNotHandledError';
|
|
30
31
|
export * from './AccessBlockedError';
|
|
31
32
|
export * from './EmbeddedWalletException';
|
|
32
33
|
export * from './MfaInvalidOtpError';
|
|
@@ -34,3 +35,4 @@ export * from './MfaRateLimitedError';
|
|
|
34
35
|
export * from './ExternalAuthError';
|
|
35
36
|
export * from './WalletAddressMismatchError';
|
|
36
37
|
export * from './UserRejectedRequestError';
|
|
38
|
+
export * from './InvalidEmbeddedWalletSessionKeyError';
|
package/src/index.cjs
CHANGED
|
@@ -33,6 +33,7 @@ var InvalidPhoneNumberError = require('./errors/InvalidPhoneNumberError.cjs');
|
|
|
33
33
|
var MergeAccountsConfirmationError = require('./errors/MergeAccountsConfirmationError.cjs');
|
|
34
34
|
var CustomFieldNotUniqueError = require('./errors/CustomFieldNotUniqueError.cjs');
|
|
35
35
|
var CookieInvalidError = require('./errors/CookieInvalidError.cjs');
|
|
36
|
+
var RequestChannelNotHandledError = require('./errors/RequestChannelNotHandledError.cjs');
|
|
36
37
|
var AccessBlockedError = require('./errors/AccessBlockedError.cjs');
|
|
37
38
|
var EmbeddedWalletException = require('./errors/EmbeddedWalletException.cjs');
|
|
38
39
|
var MfaInvalidOtpError = require('./errors/MfaInvalidOtpError.cjs');
|
|
@@ -40,6 +41,7 @@ var MfaRateLimitedError = require('./errors/MfaRateLimitedError.cjs');
|
|
|
40
41
|
var ExternalAuthError = require('./errors/ExternalAuthError.cjs');
|
|
41
42
|
var WalletAddressMismatchError = require('./errors/WalletAddressMismatchError.cjs');
|
|
42
43
|
var UserRejectedRequestError = require('./errors/UserRejectedRequestError.cjs');
|
|
44
|
+
var InvalidEmbeddedWalletSessionKeyError = require('./errors/InvalidEmbeddedWalletSessionKeyError.cjs');
|
|
43
45
|
var CancellablePromise = require('./CancellablePromise/CancellablePromise.cjs');
|
|
44
46
|
var isFunction = require('./isFunction/isFunction.cjs');
|
|
45
47
|
var isMobile = require('./isMobile.cjs');
|
|
@@ -107,6 +109,7 @@ exports.InvalidPhoneNumberError = InvalidPhoneNumberError.InvalidPhoneNumberErro
|
|
|
107
109
|
exports.MergeAccountsConfirmationError = MergeAccountsConfirmationError.MergeAccountsConfirmationError;
|
|
108
110
|
exports.CustomFieldNotUniqueError = CustomFieldNotUniqueError.CustomFieldNotUniqueError;
|
|
109
111
|
exports.CookieInvalidError = CookieInvalidError.CookieInvalidError;
|
|
112
|
+
exports.RequestChannelNotHandledError = RequestChannelNotHandledError.RequestChannelNotHandledError;
|
|
110
113
|
exports.AccessBlockedError = AccessBlockedError.AccessBlockedError;
|
|
111
114
|
exports.EmbeddedWalletException = EmbeddedWalletException.EmbeddedWalletException;
|
|
112
115
|
exports.MfaInvalidOtpError = MfaInvalidOtpError.MfaInvalidOtpError;
|
|
@@ -114,6 +117,7 @@ exports.MfaRateLimitedError = MfaRateLimitedError.MfaRateLimitedError;
|
|
|
114
117
|
exports.ExternalAuthError = ExternalAuthError.ExternalAuthError;
|
|
115
118
|
exports.WalletAddressMismatchError = WalletAddressMismatchError.WalletAddressMismatchError;
|
|
116
119
|
exports.UserRejectedRequestError = UserRejectedRequestError.UserRejectedRequestError;
|
|
120
|
+
exports.InvalidEmbeddedWalletSessionKeyError = InvalidEmbeddedWalletSessionKeyError.InvalidEmbeddedWalletSessionKeyError;
|
|
117
121
|
exports.CancellablePromise = CancellablePromise.CancellablePromise;
|
|
118
122
|
exports.isFunction = isFunction.isFunction;
|
|
119
123
|
exports.getAndroidVersion = isMobile.getAndroidVersion;
|
package/src/index.js
CHANGED
|
@@ -29,6 +29,7 @@ export { InvalidPhoneNumberError } from './errors/InvalidPhoneNumberError.js';
|
|
|
29
29
|
export { MergeAccountsConfirmationError } from './errors/MergeAccountsConfirmationError.js';
|
|
30
30
|
export { CustomFieldNotUniqueError } from './errors/CustomFieldNotUniqueError.js';
|
|
31
31
|
export { CookieInvalidError } from './errors/CookieInvalidError.js';
|
|
32
|
+
export { RequestChannelNotHandledError } from './errors/RequestChannelNotHandledError.js';
|
|
32
33
|
export { AccessBlockedError } from './errors/AccessBlockedError.js';
|
|
33
34
|
export { EmbeddedWalletException } from './errors/EmbeddedWalletException.js';
|
|
34
35
|
export { MfaInvalidOtpError } from './errors/MfaInvalidOtpError.js';
|
|
@@ -36,6 +37,7 @@ export { MfaRateLimitedError } from './errors/MfaRateLimitedError.js';
|
|
|
36
37
|
export { ExternalAuthError } from './errors/ExternalAuthError.js';
|
|
37
38
|
export { WalletAddressMismatchError } from './errors/WalletAddressMismatchError.js';
|
|
38
39
|
export { UserRejectedRequestError } from './errors/UserRejectedRequestError.js';
|
|
40
|
+
export { InvalidEmbeddedWalletSessionKeyError } from './errors/InvalidEmbeddedWalletSessionKeyError.js';
|
|
39
41
|
export { CancellablePromise } from './CancellablePromise/CancellablePromise.js';
|
|
40
42
|
export { isFunction } from './isFunction/isFunction.js';
|
|
41
43
|
export { getAndroidVersion, isAndroid, isIOS, isIPad, isIPhone, isIPhone8OrEarlier, isLegacySafari, isMobile, isSafariBrowser, isSamsungBrowser, isWindows } from './isMobile.js';
|