@dynamic-labs/utils 1.0.0-alpha.6 → 1.0.0-alpha.7

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 CHANGED
@@ -1,4 +1,24 @@
1
1
 
2
+ ## [1.0.0-alpha.7](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.0-alpha.6...v1.0.0-alpha.7) (2023-12-05)
3
+
4
+
5
+ ### Features
6
+
7
+ * add support for Turnkey HD wallets and backwards compatiblity for private key wallets ([#4011](https://github.com/dynamic-labs/DynamicAuth/issues/4011)) ([75c5258](https://github.com/dynamic-labs/DynamicAuth/commit/75c5258da494d5d4dfa8b96655303dd9645f2269))
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * add close button to wallets list ([#4036](https://github.com/dynamic-labs/DynamicAuth/issues/4036)) ([a2b988b](https://github.com/dynamic-labs/DynamicAuth/commit/a2b988bdfc662af6f85d37a79ed6666c483aa447))
13
+ * add support for embedded wallets in connect-only ([#4041](https://github.com/dynamic-labs/DynamicAuth/issues/4041)) ([ceea635](https://github.com/dynamic-labs/DynamicAuth/commit/ceea635b69e2a0c2636b47fbd30639d69dba7a1c))
14
+ * embedded wallet invalid stored chain breaking network picker ([#4050](https://github.com/dynamic-labs/DynamicAuth/issues/4050)) ([2e2384b](https://github.com/dynamic-labs/DynamicAuth/commit/2e2384ba37407d9164cce47e23f5d5f469f7e062))
15
+ * handle insufficient funds from AA provider ([#4027](https://github.com/dynamic-labs/DynamicAuth/issues/4027)) ([6b9cc88](https://github.com/dynamic-labs/DynamicAuth/commit/6b9cc886f4f2590094bd50aba195c07a5532dfa4))
16
+ * prevent double logout caused by wagmi sync ([#4048](https://github.com/dynamic-labs/DynamicAuth/issues/4048)) ([c66c81c](https://github.com/dynamic-labs/DynamicAuth/commit/c66c81c80839aa9ce1cfae76f4afce12e34f3513))
17
+ * properly detect network switch for secondary wallets ([#4038](https://github.com/dynamic-labs/DynamicAuth/issues/4038)) ([f87174d](https://github.com/dynamic-labs/DynamicAuth/commit/f87174de0892dd057401eaf3c0bc68d974add0fc))
18
+ * **use-wallets-connected-state:** update state on wallet id change ([#4045](https://github.com/dynamic-labs/DynamicAuth/issues/4045)) ([ca3a835](https://github.com/dynamic-labs/DynamicAuth/commit/ca3a8359eae386bffa758ed646ac14af8360a7f8))
19
+ * user should be able to see the full passkey name on management view ([#4043](https://github.com/dynamic-labs/DynamicAuth/issues/4043)) ([7bc1b70](https://github.com/dynamic-labs/DynamicAuth/commit/7bc1b7043cbc9f0e21df78a57efc3e6938a99db2))
20
+ * users should be able to easily find passkey recovery ([#4058](https://github.com/dynamic-labs/DynamicAuth/issues/4058)) ([0202ae9](https://github.com/dynamic-labs/DynamicAuth/commit/0202ae98c96544dec5ac357dc77000996e32ad33))
21
+
2
22
  ## [1.0.0-alpha.6](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.0-alpha.5...v1.0.0-alpha.6) (2023-11-29)
3
23
 
4
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/utils",
3
- "version": "1.0.0-alpha.6",
3
+ "version": "1.0.0-alpha.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -29,7 +29,7 @@
29
29
  "viem": "^1.5.3"
30
30
  },
31
31
  "dependencies": {
32
- "@dynamic-labs/logger": "1.0.0-alpha.6",
33
- "@dynamic-labs/types": "1.0.0-alpha.6"
32
+ "@dynamic-labs/logger": "1.0.0-alpha.7",
33
+ "@dynamic-labs/types": "1.0.0-alpha.7"
34
34
  }
35
35
  }
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var DynamicError = require('./DynamicError.cjs');
6
+
7
+ class InsufficientFundsError extends DynamicError.DynamicError {
8
+ constructor() {
9
+ super(InsufficientFundsError.message);
10
+ }
11
+ static isInstance(err) {
12
+ var _a;
13
+ const error = ((_a = err === null || err === void 0 ? void 0 : err.walk) === null || _a === void 0 ? void 0 : _a.call(err)) || err;
14
+ return error instanceof InsufficientFundsError;
15
+ }
16
+ static isErrorMessage(err) {
17
+ var _a;
18
+ const errorWithMessage = err;
19
+ return (((_a = errorWithMessage === null || errorWithMessage === void 0 ? void 0 : errorWithMessage.message) === null || _a === void 0 ? void 0 : _a.includes("AA21 didn't pay prefund")) || false);
20
+ }
21
+ }
22
+ InsufficientFundsError.message = 'Insufficient funds.';
23
+
24
+ exports.InsufficientFundsError = InsufficientFundsError;
@@ -0,0 +1,9 @@
1
+ import { DynamicError } from './DynamicError';
2
+ export declare class InsufficientFundsError extends DynamicError {
3
+ constructor();
4
+ static message: string;
5
+ static isInstance(err: {
6
+ walk?: () => unknown;
7
+ } | unknown): err is InsufficientFundsError;
8
+ static isErrorMessage(err: unknown): boolean;
9
+ }
@@ -0,0 +1,20 @@
1
+ import { DynamicError } from './DynamicError.js';
2
+
3
+ class InsufficientFundsError extends DynamicError {
4
+ constructor() {
5
+ super(InsufficientFundsError.message);
6
+ }
7
+ static isInstance(err) {
8
+ var _a;
9
+ const error = ((_a = err === null || err === void 0 ? void 0 : err.walk) === null || _a === void 0 ? void 0 : _a.call(err)) || err;
10
+ return error instanceof InsufficientFundsError;
11
+ }
12
+ static isErrorMessage(err) {
13
+ var _a;
14
+ const errorWithMessage = err;
15
+ return (((_a = errorWithMessage === null || errorWithMessage === void 0 ? void 0 : errorWithMessage.message) === null || _a === void 0 ? void 0 : _a.includes("AA21 didn't pay prefund")) || false);
16
+ }
17
+ }
18
+ InsufficientFundsError.message = 'Insufficient funds.';
19
+
20
+ export { InsufficientFundsError };
@@ -6,13 +6,19 @@ var DynamicError = require('./DynamicError.cjs');
6
6
 
7
7
  class TransactionGasCannotBeSponsoredError extends DynamicError.DynamicError {
8
8
  constructor() {
9
- super('Transaction gas cannot be sponsored.');
9
+ super(TransactionGasCannotBeSponsoredError.message);
10
10
  }
11
11
  static isInstance(err) {
12
12
  var _a;
13
13
  const error = ((_a = err === null || err === void 0 ? void 0 : err.walk) === null || _a === void 0 ? void 0 : _a.call(err)) || err;
14
14
  return error instanceof TransactionGasCannotBeSponsoredError;
15
15
  }
16
+ static isErrorMessage(err) {
17
+ var _a;
18
+ const errorWithMessage = err;
19
+ return (((_a = errorWithMessage === null || errorWithMessage === void 0 ? void 0 : errorWithMessage.message) === null || _a === void 0 ? void 0 : _a.includes('userOp did not match any gas sponsoring policies')) || false);
20
+ }
16
21
  }
22
+ TransactionGasCannotBeSponsoredError.message = 'Transaction gas cannot be sponsored.';
17
23
 
18
24
  exports.TransactionGasCannotBeSponsoredError = TransactionGasCannotBeSponsoredError;
@@ -1,7 +1,9 @@
1
1
  import { DynamicError } from './DynamicError';
2
2
  export declare class TransactionGasCannotBeSponsoredError extends DynamicError {
3
3
  constructor();
4
+ static message: string;
4
5
  static isInstance(err: {
5
6
  walk?: () => unknown;
6
7
  } | unknown): err is TransactionGasCannotBeSponsoredError;
8
+ static isErrorMessage(err: unknown): boolean;
7
9
  }
@@ -2,13 +2,19 @@ import { DynamicError } from './DynamicError.js';
2
2
 
3
3
  class TransactionGasCannotBeSponsoredError extends DynamicError {
4
4
  constructor() {
5
- super('Transaction gas cannot be sponsored.');
5
+ super(TransactionGasCannotBeSponsoredError.message);
6
6
  }
7
7
  static isInstance(err) {
8
8
  var _a;
9
9
  const error = ((_a = err === null || err === void 0 ? void 0 : err.walk) === null || _a === void 0 ? void 0 : _a.call(err)) || err;
10
10
  return error instanceof TransactionGasCannotBeSponsoredError;
11
11
  }
12
+ static isErrorMessage(err) {
13
+ var _a;
14
+ const errorWithMessage = err;
15
+ return (((_a = errorWithMessage === null || errorWithMessage === void 0 ? void 0 : errorWithMessage.message) === null || _a === void 0 ? void 0 : _a.includes('userOp did not match any gas sponsoring policies')) || false);
16
+ }
12
17
  }
18
+ TransactionGasCannotBeSponsoredError.message = 'Transaction gas cannot be sponsored.';
13
19
 
14
20
  export { TransactionGasCannotBeSponsoredError };
@@ -15,3 +15,4 @@ export * from './GateBlockedError';
15
15
  export * from './UserHasAccountWithEmailError';
16
16
  export * from './SocialAccountAlreadyExistsError';
17
17
  export * from './TransactionGasCannotBeSponsoredError';
18
+ export * from './InsufficientFundsError';
package/src/index.cjs CHANGED
@@ -21,6 +21,7 @@ var GateBlockedError = require('./errors/GateBlockedError.cjs');
21
21
  var UserHasAccountWithEmailError = require('./errors/UserHasAccountWithEmailError.cjs');
22
22
  var SocialAccountAlreadyExistsError = require('./errors/SocialAccountAlreadyExistsError.cjs');
23
23
  var TransactionGasCannotBeSponsoredError = require('./errors/TransactionGasCannotBeSponsoredError.cjs');
24
+ var InsufficientFundsError = require('./errors/InsufficientFundsError.cjs');
24
25
  var CancellablePromise = require('./CancellablePromise/CancellablePromise.cjs');
25
26
  var isFunction = require('./isFunction/isFunction.cjs');
26
27
  var isMobile = require('./isMobile.cjs');
@@ -55,6 +56,7 @@ exports.GateBlockedError = GateBlockedError.GateBlockedError;
55
56
  exports.UserHasAccountWithEmailError = UserHasAccountWithEmailError.UserHasAccountWithEmailError;
56
57
  exports.SocialAccountAlreadyExistsError = SocialAccountAlreadyExistsError.SocialAccountAlreadyExistsError;
57
58
  exports.TransactionGasCannotBeSponsoredError = TransactionGasCannotBeSponsoredError.TransactionGasCannotBeSponsoredError;
59
+ exports.InsufficientFundsError = InsufficientFundsError.InsufficientFundsError;
58
60
  exports.CancellablePromise = CancellablePromise.CancellablePromise;
59
61
  exports.isFunction = isFunction.isFunction;
60
62
  exports.getAndroidVersion = isMobile.getAndroidVersion;
package/src/index.js CHANGED
@@ -17,6 +17,7 @@ export { GateBlockedError } from './errors/GateBlockedError.js';
17
17
  export { UserHasAccountWithEmailError } from './errors/UserHasAccountWithEmailError.js';
18
18
  export { SocialAccountAlreadyExistsError } from './errors/SocialAccountAlreadyExistsError.js';
19
19
  export { TransactionGasCannotBeSponsoredError } from './errors/TransactionGasCannotBeSponsoredError.js';
20
+ export { InsufficientFundsError } from './errors/InsufficientFundsError.js';
20
21
  export { CancellablePromise } from './CancellablePromise/CancellablePromise.js';
21
22
  export { isFunction } from './isFunction/isFunction.js';
22
23
  export { getAndroidVersion, isAndroid, isIOS, isIPad, isIPhone, isIPhone8OrEarlier, isLegacySafari, isMobile, isSamsungBrowser, isWindows } from './isMobile.js';