@dynamic-labs/utils 2.0.0-alpha.21 → 2.0.0-alpha.23

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,67 @@
1
1
 
2
+ ## [2.0.0-alpha.23](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.22...v2.0.0-alpha.23) (2024-04-01)
3
+
4
+
5
+ ### ⚠ BREAKING CHANGES
6
+
7
+ * implement proper solana embedded wallet signer (#5092)
8
+ * prevent adding temporary wallet connection to userWallets (#5104)
9
+
10
+ ### Bug Fixes
11
+
12
+ * Multiple WC bug fixes ([#5142](https://github.com/dynamic-labs/DynamicAuth/issues/5142)) ([92236e6](https://github.com/dynamic-labs/DynamicAuth/commit/92236e6d74c28516403f6df79c539406ece3d6d0)) ([#5132](https://github.com/dynamic-labs/DynamicAuth/issues/5132)) ([99f564a](https://github.com/dynamic-labs/DynamicAuth/commit/99f564a39e35e28af0be2a03617f12aa19cbeb7f))
13
+
14
+ * Better handling of empty callback queue([#5147](https://github.com/dynamic-labs/DynamicAuth/issues/5147)) ([e2d6bf2](https://github.com/dynamic-labs/DynamicAuth/commit/e2d6bf2444ca01199796ead4136f34b81b6c9b61))
15
+
16
+ * multiple improvements to the wallet list ([#5112](https://github.com/dynamic-labs/DynamicAuth/issues/5112)) ([00eec5f](https://github.com/dynamic-labs/DynamicAuth/commit/00eec5fde70548c3d771260f3d86e5365e73878d))
17
+
18
+ * Improved scroll experience on ios ([#5152](https://github.com/dynamic-labs/DynamicAuth/issues/5152)) ([341704f](https://github.com/dynamic-labs/DynamicAuth/commit/341704f99cb6e06f253309f3a8afb1684bb8ae2a))
19
+
20
+ * better handling of multiwallet state([#5146](https://github.com/dynamic-labs/DynamicAuth/issues/5146)) ([403267b](https://github.com/dynamic-labs/DynamicAuth/commit/403267b3c268d648aba155e0b6fea31d7fdc1b56))
21
+
22
+ * show correct OTP error message ([#5135](https://github.com/dynamic-labs/DynamicAuth/issues/5135)) ([e7494ce](https://github.com/dynamic-labs/DynamicAuth/commit/e7494cee4a1b5132af91058cbcb2dae0b7eac44b))
23
+
24
+ * implement proper solana embedded wallet signer ([#5092](https://github.com/dynamic-labs/DynamicAuth/issues/5092)) ([7749b97](https://github.com/dynamic-labs/DynamicAuth/commit/7749b97db49fb9af8ae0668172f478e1f0c29665))
25
+
26
+ * prevent adding temporary wallet connection to userWallets ([#5104](https://github.com/dynamic-labs/DynamicAuth/issues/5104)) ([3c02b78](https://github.com/dynamic-labs/DynamicAuth/commit/3c02b781c997c63ff11a7f1c255b92d10962327f))
27
+
28
+
29
+ ## [2.0.0-alpha.22](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.21...v2.0.0-alpha.22) (2024-03-27)
30
+
31
+
32
+ ### ⚠ BREAKING CHANGES
33
+
34
+ * remove isFullyConnected (#5066)
35
+ * remove and deprecated exported methods (#5065)
36
+ * remove emailOnly provider
37
+
38
+ ### Features
39
+
40
+ * add method property to track which phantom connector function was called ([#5044](https://github.com/dynamic-labs/DynamicAuth/issues/5044)) ([f820cd4](https://github.com/dynamic-labs/DynamicAuth/commit/f820cd4c7e047fd5181115b4d388e54df682e5c8))
41
+ * add signAndSendTransaction to phantom redirect connector ([#5054](https://github.com/dynamic-labs/DynamicAuth/issues/5054)) ([694a300](https://github.com/dynamic-labs/DynamicAuth/commit/694a3003c8765098878a5c95174be5eba4509fc2))
42
+ * implement remaining signer methods on phantom redirect connector ([#5060](https://github.com/dynamic-labs/DynamicAuth/issues/5060)) ([29db446](https://github.com/dynamic-labs/DynamicAuth/commit/29db4464de6eea11c92a8080fed1eb3e7588b2b8))
43
+
44
+
45
+ ### Bug Fixes
46
+
47
+ * add recommended wallet tags to the WalletSimpleSignIn component ([#5041](https://github.com/dynamic-labs/DynamicAuth/issues/5041)) ([aefde4d](https://github.com/dynamic-labs/DynamicAuth/commit/aefde4d927427c131dce4402eb3c705527c64e8f))
48
+ * display invalid phone number error ([#5103](https://github.com/dynamic-labs/DynamicAuth/issues/5103)) ([842c0ba](https://github.com/dynamic-labs/DynamicAuth/commit/842c0ba3cfe1120c166f12410efbc346d8e30ed0))
49
+ * ensure the user field modals uses the base widget context ([#5105](https://github.com/dynamic-labs/DynamicAuth/issues/5105)) ([aa2a545](https://github.com/dynamic-labs/DynamicAuth/commit/aa2a545bdbf6f38f4131ccdde61142389dbf5480))
50
+ * force aspect ratio for social icon pfps ([#5072](https://github.com/dynamic-labs/DynamicAuth/issues/5072)) ([6f611a7](https://github.com/dynamic-labs/DynamicAuth/commit/6f611a7cbe41d66796449b28af919bc93a7bae42))
51
+ * handle too many email verifications error ([#5051](https://github.com/dynamic-labs/DynamicAuth/issues/5051)) ([7af96df](https://github.com/dynamic-labs/DynamicAuth/commit/7af96dfb85cdc68577fdb8cc880e2fd09bcff5af))
52
+ * hardcode zerion provider and update walletbook to prevent showing up as metamask when not installed ([#5071](https://github.com/dynamic-labs/DynamicAuth/issues/5071)) ([3ab6c37](https://github.com/dynamic-labs/DynamicAuth/commit/3ab6c3772efe2c2e3259ca7a9dbb92e924314029))
53
+ * issue where ethereum is tree shaken ([#5028](https://github.com/dynamic-labs/DynamicAuth/issues/5028)) ([fda542d](https://github.com/dynamic-labs/DynamicAuth/commit/fda542db2b65a437004fe809a0ea9f90fde47b13))
54
+ * not clearing the loading when creating an embedded wallet ([323086f](https://github.com/dynamic-labs/DynamicAuth/commit/323086f673fb8a2108b8262181511987d0bc1d09))
55
+ * solflare double connection on page refresh ([#5083](https://github.com/dynamic-labs/DynamicAuth/issues/5083)) ([ef76005](https://github.com/dynamic-labs/DynamicAuth/commit/ef7600564b646cf45396287a0d6b6f1420473b04))
56
+ * swap out findProvider for getSigner on solflare ([#5057](https://github.com/dynamic-labs/DynamicAuth/issues/5057)) ([b78827f](https://github.com/dynamic-labs/DynamicAuth/commit/b78827f8fd87a594114908d890f58b8771123383))
57
+ * validate user session whenever user is connected/authenticated ([#5082](https://github.com/dynamic-labs/DynamicAuth/issues/5082)) ([432faa0](https://github.com/dynamic-labs/DynamicAuth/commit/432faa0a69b43cb7324a252a2450db3cbd3b4b12))
58
+ * walletconnect improvements and fixes ([#5085](https://github.com/dynamic-labs/DynamicAuth/issues/5085)) ([bb42566](https://github.com/dynamic-labs/DynamicAuth/commit/bb425666aef5071b7827ef0aa167a328493f1ae7))
59
+
60
+
61
+ * remove and deprecated exported methods ([#5065](https://github.com/dynamic-labs/DynamicAuth/issues/5065)) ([63af7ea](https://github.com/dynamic-labs/DynamicAuth/commit/63af7ea691b2112032de332f2b3558ac6260a38d))
62
+ * remove emailOnly provider ([60a30bc](https://github.com/dynamic-labs/DynamicAuth/commit/60a30bc2f242de19d9c6167279fc44b7f9395ac8))
63
+ * remove isFullyConnected ([#5066](https://github.com/dynamic-labs/DynamicAuth/issues/5066)) ([0a662d9](https://github.com/dynamic-labs/DynamicAuth/commit/0a662d9eda19045f13c21ad1b5238ca11594fde5))
64
+
2
65
  ## [2.0.0-alpha.21](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.20...v2.0.0-alpha.21) (2024-03-20)
3
66
 
4
67
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/utils",
3
- "version": "2.0.0-alpha.21",
3
+ "version": "2.0.0-alpha.23",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -27,8 +27,8 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "tldts": "6.0.16",
30
- "@dynamic-labs/logger": "2.0.0-alpha.21",
31
- "@dynamic-labs/types": "2.0.0-alpha.21"
30
+ "@dynamic-labs/logger": "2.0.0-alpha.23",
31
+ "@dynamic-labs/types": "2.0.0-alpha.23"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "viem": "^2.7.6"
@@ -4,6 +4,7 @@ type AccountExistsPayload = {
4
4
  embeddedSocialSigninProvider: string;
5
5
  embeddedWalletName: string;
6
6
  loginProvider: string;
7
+ phoneNumber?: string;
7
8
  };
8
9
  export declare class AccountExistsError extends DynamicError {
9
10
  errorMessage: string;
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var DynamicError = require('./DynamicError.cjs');
6
+
7
+ class InvalidPhoneNumberError extends DynamicError.DynamicError {
8
+ constructor() {
9
+ super('Invalid phone number.');
10
+ }
11
+ }
12
+
13
+ exports.InvalidPhoneNumberError = InvalidPhoneNumberError;
@@ -0,0 +1,4 @@
1
+ import { DynamicError } from './DynamicError';
2
+ export declare class InvalidPhoneNumberError extends DynamicError {
3
+ constructor();
4
+ }
@@ -0,0 +1,9 @@
1
+ import { DynamicError } from './DynamicError.js';
2
+
3
+ class InvalidPhoneNumberError extends DynamicError {
4
+ constructor() {
5
+ super('Invalid phone number.');
6
+ }
7
+ }
8
+
9
+ export { InvalidPhoneNumberError };
@@ -5,10 +5,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var DynamicError = require('./DynamicError.cjs');
6
6
 
7
7
  class NoAccessError extends DynamicError.DynamicError {
8
- constructor({ walletPublicKey, email, }) {
8
+ constructor({ walletPublicKey, email, phoneNumber, }) {
9
9
  super('User does not have access');
10
10
  this.email = email;
11
11
  this.walletPublicKey = walletPublicKey;
12
+ this.phoneNumber = phoneNumber;
12
13
  }
13
14
  }
14
15
 
@@ -2,8 +2,10 @@ import { DynamicError } from './DynamicError';
2
2
  export declare class NoAccessError extends DynamicError {
3
3
  walletPublicKey?: string;
4
4
  email?: string;
5
- constructor({ walletPublicKey, email, }: {
5
+ phoneNumber?: string;
6
+ constructor({ walletPublicKey, email, phoneNumber, }: {
6
7
  email?: string;
7
8
  walletPublicKey?: string;
9
+ phoneNumber?: string;
8
10
  });
9
11
  }
@@ -1,10 +1,11 @@
1
1
  import { DynamicError } from './DynamicError.js';
2
2
 
3
3
  class NoAccessError extends DynamicError {
4
- constructor({ walletPublicKey, email, }) {
4
+ constructor({ walletPublicKey, email, phoneNumber, }) {
5
5
  super('User does not have access');
6
6
  this.email = email;
7
7
  this.walletPublicKey = walletPublicKey;
8
+ this.phoneNumber = phoneNumber;
8
9
  }
9
10
  }
10
11
 
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var DynamicError = require('./DynamicError.cjs');
6
+
7
+ class TooManyEmailVerificationsError extends DynamicError.DynamicError {
8
+ constructor() {
9
+ super('Too many email verification attempts.');
10
+ }
11
+ }
12
+
13
+ exports.TooManyEmailVerificationsError = TooManyEmailVerificationsError;
@@ -0,0 +1,4 @@
1
+ import { DynamicError } from './DynamicError';
2
+ export declare class TooManyEmailVerificationsError extends DynamicError {
3
+ constructor();
4
+ }
@@ -0,0 +1,9 @@
1
+ import { DynamicError } from './DynamicError.js';
2
+
3
+ class TooManyEmailVerificationsError extends DynamicError {
4
+ constructor() {
5
+ super('Too many email verification attempts.');
6
+ }
7
+ }
8
+
9
+ export { TooManyEmailVerificationsError };
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var DynamicError = require('./DynamicError.cjs');
6
+ require('./InsufficientFundsError.cjs');
7
+ require('./TransactionGasCannotBeSponsoredError.cjs');
8
+
9
+ /** Used when trying to get necessary data for verification OTPs */
10
+ class VerificationDataCollectionError extends DynamicError.DynamicError {
11
+ constructor(message) {
12
+ super('Failed to get verification data: ' + message);
13
+ }
14
+ }
15
+
16
+ exports.VerificationDataCollectionError = VerificationDataCollectionError;
@@ -0,0 +1,5 @@
1
+ import { DynamicError } from '.';
2
+ /** Used when trying to get necessary data for verification OTPs */
3
+ export declare class VerificationDataCollectionError extends DynamicError {
4
+ constructor(message: string);
5
+ }
@@ -0,0 +1,12 @@
1
+ import { DynamicError } from './DynamicError.js';
2
+ import './InsufficientFundsError.js';
3
+ import './TransactionGasCannotBeSponsoredError.js';
4
+
5
+ /** Used when trying to get necessary data for verification OTPs */
6
+ class VerificationDataCollectionError extends DynamicError {
7
+ constructor(message) {
8
+ super('Failed to get verification data: ' + message);
9
+ }
10
+ }
11
+
12
+ export { VerificationDataCollectionError };
@@ -20,3 +20,6 @@ export * from './UsernameAlreadyExistsError';
20
20
  export * from './WalletNotDeployedError';
21
21
  export * from './WalletUsedError';
22
22
  export * from './UserRejectedTransactionError';
23
+ export * from './TooManyEmailVerificationsError';
24
+ export * from './VerificationDataCollectionError';
25
+ export * from './InvalidPhoneNumberError';
package/src/index.cjs CHANGED
@@ -25,6 +25,9 @@ var UsernameAlreadyExistsError = require('./errors/UsernameAlreadyExistsError.cj
25
25
  var WalletNotDeployedError = require('./errors/WalletNotDeployedError.cjs');
26
26
  var WalletUsedError = require('./errors/WalletUsedError.cjs');
27
27
  var UserRejectedTransactionError = require('./errors/UserRejectedTransactionError.cjs');
28
+ var TooManyEmailVerificationsError = require('./errors/TooManyEmailVerificationsError.cjs');
29
+ var VerificationDataCollectionError = require('./errors/VerificationDataCollectionError.cjs');
30
+ var InvalidPhoneNumberError = require('./errors/InvalidPhoneNumberError.cjs');
28
31
  var CancellablePromise = require('./CancellablePromise/CancellablePromise.cjs');
29
32
  var isFunction = require('./isFunction/isFunction.cjs');
30
33
  var isMobile = require('./isMobile.cjs');
@@ -70,6 +73,9 @@ exports.UsernameAlreadyExistsError = UsernameAlreadyExistsError.UsernameAlreadyE
70
73
  exports.WalletNotDeployedError = WalletNotDeployedError.WalletNotDeployedError;
71
74
  exports.WalletUsedError = WalletUsedError.WalletUsedError;
72
75
  exports.UserRejectedTransactionError = UserRejectedTransactionError.UserRejectedTransactionError;
76
+ exports.TooManyEmailVerificationsError = TooManyEmailVerificationsError.TooManyEmailVerificationsError;
77
+ exports.VerificationDataCollectionError = VerificationDataCollectionError.VerificationDataCollectionError;
78
+ exports.InvalidPhoneNumberError = InvalidPhoneNumberError.InvalidPhoneNumberError;
73
79
  exports.CancellablePromise = CancellablePromise.CancellablePromise;
74
80
  exports.isFunction = isFunction.isFunction;
75
81
  exports.getAndroidVersion = isMobile.getAndroidVersion;
package/src/index.js CHANGED
@@ -21,6 +21,9 @@ export { UsernameAlreadyExistsError } from './errors/UsernameAlreadyExistsError.
21
21
  export { WalletNotDeployedError } from './errors/WalletNotDeployedError.js';
22
22
  export { WalletUsedError } from './errors/WalletUsedError.js';
23
23
  export { UserRejectedTransactionError } from './errors/UserRejectedTransactionError.js';
24
+ export { TooManyEmailVerificationsError } from './errors/TooManyEmailVerificationsError.js';
25
+ export { VerificationDataCollectionError } from './errors/VerificationDataCollectionError.js';
26
+ export { InvalidPhoneNumberError } from './errors/InvalidPhoneNumberError.js';
24
27
  export { CancellablePromise } from './CancellablePromise/CancellablePromise.js';
25
28
  export { isFunction } from './isFunction/isFunction.js';
26
29
  export { getAndroidVersion, isAndroid, isIOS, isIPad, isIPhone, isIPhone8OrEarlier, isLegacySafari, isMobile, isSamsungBrowser, isWindows } from './isMobile.js';