@dynamic-labs/utils 0.19.0-alpha.2 → 0.19.0-alpha.21

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.
Files changed (103) hide show
  1. package/CHANGELOG.md +293 -0
  2. package/package.json +7 -4
  3. package/src/CancellablePromise/CancellablePromise.cjs +128 -26
  4. package/src/CancellablePromise/CancellablePromise.d.ts +54 -9
  5. package/src/CancellablePromise/CancellablePromise.js +128 -26
  6. package/src/CancellablePromise/index.d.ts +1 -1
  7. package/src/bigIntToHex/bigIntToHex.cjs +15 -0
  8. package/src/bigIntToHex/bigIntToHex.d.ts +1 -0
  9. package/src/bigIntToHex/bigIntToHex.js +11 -0
  10. package/src/bigIntToHex/index.d.ts +1 -0
  11. package/src/bufferToBase64.cjs +5 -5
  12. package/src/bufferToBase64.d.ts +1 -1
  13. package/src/bufferToBase64.js +5 -5
  14. package/src/errors/AccountExistsError.cjs +6 -6
  15. package/src/errors/AccountExistsError.d.ts +13 -13
  16. package/src/errors/AccountExistsError.js +6 -6
  17. package/src/errors/ChainalysisError.cjs +5 -5
  18. package/src/errors/ChainalysisError.d.ts +5 -5
  19. package/src/errors/ChainalysisError.js +5 -5
  20. package/src/errors/CustomError.cjs +16 -16
  21. package/src/errors/CustomError.d.ts +11 -11
  22. package/src/errors/CustomError.js +16 -16
  23. package/src/errors/DynamicError.cjs +1 -1
  24. package/src/errors/DynamicError.d.ts +3 -3
  25. package/src/errors/DynamicError.js +1 -1
  26. package/src/errors/EmailAlreadyExistsError.cjs +4 -4
  27. package/src/errors/EmailAlreadyExistsError.d.ts +4 -4
  28. package/src/errors/EmailAlreadyExistsError.js +4 -4
  29. package/src/errors/EmailProviderError.cjs +4 -4
  30. package/src/errors/EmailProviderError.d.ts +4 -4
  31. package/src/errors/EmailProviderError.js +4 -4
  32. package/src/errors/EmailVerificationError.cjs +4 -4
  33. package/src/errors/EmailVerificationError.d.ts +4 -4
  34. package/src/errors/EmailVerificationError.js +4 -4
  35. package/src/errors/GateBlockedError.cjs +5 -5
  36. package/src/errors/GateBlockedError.d.ts +5 -5
  37. package/src/errors/GateBlockedError.js +5 -5
  38. package/src/errors/MissingEnvironmentIdError.cjs +4 -4
  39. package/src/errors/MissingEnvironmentIdError.d.ts +4 -4
  40. package/src/errors/MissingEnvironmentIdError.js +4 -4
  41. package/src/errors/NoAccessError.cjs +6 -6
  42. package/src/errors/NoAccessError.d.ts +9 -9
  43. package/src/errors/NoAccessError.js +6 -6
  44. package/src/errors/NotSupportedError.cjs +1 -1
  45. package/src/errors/NotSupportedError.d.ts +3 -3
  46. package/src/errors/NotSupportedError.js +1 -1
  47. package/src/errors/SocialAccountAlreadyExistsError.cjs +13 -0
  48. package/src/errors/SocialAccountAlreadyExistsError.d.ts +4 -0
  49. package/src/errors/SocialAccountAlreadyExistsError.js +9 -0
  50. package/src/errors/UserHasAccountWithEmailError.cjs +5 -5
  51. package/src/errors/UserHasAccountWithEmailError.d.ts +5 -5
  52. package/src/errors/UserHasAccountWithEmailError.js +5 -5
  53. package/src/errors/UsernameAlreadyExistsError.cjs +4 -4
  54. package/src/errors/UsernameAlreadyExistsError.d.ts +4 -4
  55. package/src/errors/UsernameAlreadyExistsError.js +4 -4
  56. package/src/errors/WalletNotDeployedError.cjs +4 -4
  57. package/src/errors/WalletNotDeployedError.d.ts +4 -4
  58. package/src/errors/WalletNotDeployedError.js +4 -4
  59. package/src/errors/WalletUsedError.cjs +4 -4
  60. package/src/errors/WalletUsedError.d.ts +4 -4
  61. package/src/errors/WalletUsedError.js +4 -4
  62. package/src/errors/index.d.ts +16 -15
  63. package/src/getOrMapViemChain.cjs +77 -0
  64. package/src/getOrMapViemChain.d.ts +11 -0
  65. package/src/getOrMapViemChain.js +51 -0
  66. package/src/getProvidersFromWindow.cjs +38 -0
  67. package/src/getProvidersFromWindow.d.ts +7 -0
  68. package/src/getProvidersFromWindow.js +34 -0
  69. package/src/index.cjs +22 -0
  70. package/src/index.d.ts +15 -8
  71. package/src/index.js +9 -1
  72. package/src/isBigInt/index.d.ts +1 -0
  73. package/src/isBigInt/isBigInt.cjs +7 -0
  74. package/src/isBigInt/isBigInt.d.ts +1 -0
  75. package/src/isBigInt/isBigInt.js +3 -0
  76. package/src/isFunction/index.d.ts +1 -1
  77. package/src/isFunction/isFunction.cjs +1 -1
  78. package/src/isFunction/isFunction.d.ts +1 -1
  79. package/src/isFunction/isFunction.js +1 -1
  80. package/src/isMobile.cjs +122 -56
  81. package/src/isMobile.d.ts +18 -15
  82. package/src/isMobile.js +120 -57
  83. package/src/last.cjs +21 -0
  84. package/src/last.d.ts +15 -0
  85. package/src/last.js +17 -0
  86. package/src/localStorageAsync.cjs +17 -17
  87. package/src/localStorageAsync.d.ts +3 -3
  88. package/src/localStorageAsync.js +17 -17
  89. package/src/logger/index.d.ts +1 -0
  90. package/src/logger/logger.cjs +9 -0
  91. package/src/logger/logger.d.ts +2 -0
  92. package/src/logger/logger.js +5 -0
  93. package/src/parseChainId.d.ts +1 -1
  94. package/src/parseEvmNetworks.cjs +6 -6
  95. package/src/parseEvmNetworks.d.ts +2 -2
  96. package/src/parseEvmNetworks.js +6 -6
  97. package/src/retryableFn.cjs +53 -0
  98. package/src/retryableFn.d.ts +14 -0
  99. package/src/retryableFn.js +48 -0
  100. package/src/sleep/index.d.ts +1 -0
  101. package/src/sleep/sleep.cjs +12 -0
  102. package/src/sleep/sleep.d.ts +11 -0
  103. package/src/sleep/sleep.js +8 -0
@@ -1,29 +1,131 @@
1
- class CancellablePromise extends Promise {
2
- constructor(executor) {
3
- super((resolve, reject) => {
4
- executor((val) => {
5
- if (this.isCancelled)
6
- return;
7
- resolve(val);
8
- }, (err) => {
9
- if (this.isCancelled)
10
- return;
11
- reject(err);
12
- });
13
- });
14
- this._controller = new AbortController();
15
- }
16
- get isCancelled() {
17
- return this._controller.signal.aborted;
18
- }
19
- cancel() {
20
- this._controller.abort();
21
- }
22
- static fromPromise(promise) {
23
- return new CancellablePromise((resolve, reject) => {
24
- promise.then(resolve).catch(reject);
25
- });
26
- }
1
+ import { logger } from '../logger/logger.js';
2
+
3
+ /* eslint-disable multiline-comment-style */
4
+ const defaultCancel = () => {
5
+ logger.error("Tried to cancel CancellablePromise without ever assigning it's '_cancel' method");
6
+ };
7
+ /** An extension of Promise that allows you to explicitly cancel a promise with an external reference to it.
8
+ * Cancelling CancellablePromise causes it to reject with reason set to the parameter passed to the cancel method.
9
+ * When CancellablePromise rejects, it provides a boolean to indicate whether it was cancelled, alongside the reason.
10
+ *
11
+ * @example
12
+ * // Cancelling this promise
13
+ * const promise = new CancellablePromise(() => {}).onCancel(console.log)
14
+ * promise.cancel('User cancelled')
15
+ *
16
+ * // Setting up listeners for resolve, cancel and reject
17
+ * // (notice calling catch after onCancel prevents catch from being called by cancellation)
18
+ * new CancellablePromise(() => {})
19
+ * .then(() => console.log('Promise resolved'))
20
+ * .onCancel(() => console.log('Promise was cancelled'))
21
+ * .catch(() => console.log('Promise was rejected but NOT cancelled'))
22
+ *
23
+ * // Telling whether catch was cause of cancel or not
24
+ * new CancellablePromise(() => {})
25
+ * .then(() => console.log('Promise resolved'))
26
+ * .catch(({ reason, wasCancelled }) => console.log('Promise was rejected. Cancelled: ' + wasCancelled))
27
+ */
28
+ class CancellablePromise extends Promise {
29
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
30
+ internalCancel(reason) {
31
+ defaultCancel();
32
+ }
33
+ constructor(executor) {
34
+ let superReject = defaultCancel;
35
+ let superResolve = () => { };
36
+ super((resolve, reject) => {
37
+ superReject = reject;
38
+ superResolve = resolve;
39
+ });
40
+ this.internalIsCancelled = false;
41
+ this.isSettled = false;
42
+ executor((value) => {
43
+ if (!this.isCancelled && !this.isSettled)
44
+ superResolve(value);
45
+ this.isSettled = true;
46
+ }, (reason) => {
47
+ if (!this.isCancelled && !this.isSettled)
48
+ superReject(reason);
49
+ this.isSettled = true;
50
+ });
51
+ this.internalCancel = superReject;
52
+ }
53
+ /** Whether this CancellablePromise was cancelled. */
54
+ get isCancelled() {
55
+ return this.internalIsCancelled;
56
+ }
57
+ /** Cancels the promise. This causes the promise to reject with { wasCancelled: true, reason: reason }
58
+ * where the reason is the provided argument.
59
+ * @returns The cancelled promise.
60
+ */
61
+ cancel(reason) {
62
+ if (this.isSettled)
63
+ return this;
64
+ this.internalIsCancelled = true;
65
+ this.internalCancel(reason);
66
+ this.isSettled = true;
67
+ return this;
68
+ }
69
+ internalOnCancel(listener, options) {
70
+ const newPromise = new CancellablePromise((resolve, reject) => {
71
+ this.internalThen(resolve, ({ wasCancelled, reason }) => {
72
+ if (wasCancelled)
73
+ resolve(listener(reason));
74
+ else
75
+ reject(reason);
76
+ }, { ignoreOnCancel: true });
77
+ });
78
+ /** Tie the new promise's cancel to this promise's cancel */
79
+ if (!(options === null || options === void 0 ? void 0 : options.ignoreOnCancel)) {
80
+ newPromise.internalOnCancel((reason) => {
81
+ this.cancel(reason);
82
+ }, { ignoreOnCancel: true });
83
+ }
84
+ return newPromise;
85
+ }
86
+ /** Allows reacting to this CancellablePromise being cancelled */
87
+ onCancel(listener) {
88
+ return this.internalOnCancel(listener);
89
+ }
90
+ internalThen(onFulfilled, onRejected, options) {
91
+ /** Create a catch handler that is undefined if the received callback is undefined */
92
+ const catchHandler = onRejected
93
+ ? (reason) => onRejected({ reason, wasCancelled: this.isCancelled })
94
+ : onRejected;
95
+ // /** Create the CancellablePromise we will returned, associated to the then promise */
96
+ const newPromise = CancellablePromise.fromPromise(super.then(onFulfilled, catchHandler));
97
+ /** Tie the new promise's cancel to this promise's cancel */
98
+ if (!(options === null || options === void 0 ? void 0 : options.ignoreOnCancel)) {
99
+ newPromise.internalOnCancel((reason) => {
100
+ this.cancel(reason);
101
+ }, { ignoreOnCancel: true });
102
+ }
103
+ return newPromise;
104
+ }
105
+ then(onFulfilled, onRejected) {
106
+ return this.internalThen(onFulfilled, onRejected);
107
+ }
108
+ catch(onRejected) {
109
+ return this.then(undefined, onRejected);
110
+ }
111
+ finally(onFinally) {
112
+ return this.then((value) => {
113
+ onFinally === null || onFinally === void 0 ? void 0 : onFinally();
114
+ return value;
115
+ }, (reason) => {
116
+ onFinally === null || onFinally === void 0 ? void 0 : onFinally();
117
+ throw reason;
118
+ });
119
+ }
120
+ /** Generates a CancellablePromise from a Promise. If a CancellablePromise is passed, it's returned unscathed.
121
+ * WARNING: unless you attach a method to reject the original Promise with the "onCancel" param.
122
+ * cancelling the resulting CancellablePromise does NOT affect the original Promise. */
123
+ static fromPromise(promise) {
124
+ if ('internalIsCancelled' in promise)
125
+ return promise;
126
+ const newPromise = new CancellablePromise((resolve, reject) => promise.then(resolve, reject));
127
+ return newPromise;
128
+ }
27
129
  }
28
130
 
29
131
  export { CancellablePromise };
@@ -1 +1 @@
1
- export { CancellablePromise } from './CancellablePromise';
1
+ export { CancellablePromise } from './CancellablePromise';
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const bigIntToHex = (value) => {
6
+ if (typeof value !== 'bigint') {
7
+ throw new TypeError('Input must be of type BigInt');
8
+ }
9
+ if (value < 0) {
10
+ throw new RangeError('Negative BigInt values are not supported');
11
+ }
12
+ return `0x${value.toString(16)}`;
13
+ };
14
+
15
+ exports.bigIntToHex = bigIntToHex;
@@ -0,0 +1 @@
1
+ export declare const bigIntToHex: (value: bigint) => `0x${string}`;
@@ -0,0 +1,11 @@
1
+ const bigIntToHex = (value) => {
2
+ if (typeof value !== 'bigint') {
3
+ throw new TypeError('Input must be of type BigInt');
4
+ }
5
+ if (value < 0) {
6
+ throw new RangeError('Negative BigInt values are not supported');
7
+ }
8
+ return `0x${value.toString(16)}`;
9
+ };
10
+
11
+ export { bigIntToHex };
@@ -0,0 +1 @@
1
+ export { bigIntToHex } from './bigIntToHex';
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const bufferToBase64 = (buf) => {
6
- const binstr = Array.prototype.map
7
- .call(buf, (ch) => String.fromCharCode(ch))
8
- .join('');
9
- return Buffer.from(binstr, 'binary').toString('base64');
5
+ const bufferToBase64 = (buf) => {
6
+ const binstr = Array.prototype.map
7
+ .call(buf, (ch) => String.fromCharCode(ch))
8
+ .join('');
9
+ return Buffer.from(binstr, 'binary').toString('base64');
10
10
  };
11
11
 
12
12
  exports.bufferToBase64 = bufferToBase64;
@@ -1 +1 @@
1
- export declare const bufferToBase64: (buf: Uint8Array) => string;
1
+ export declare const bufferToBase64: (buf: Uint8Array) => string;
@@ -1,8 +1,8 @@
1
- const bufferToBase64 = (buf) => {
2
- const binstr = Array.prototype.map
3
- .call(buf, (ch) => String.fromCharCode(ch))
4
- .join('');
5
- return Buffer.from(binstr, 'binary').toString('base64');
1
+ const bufferToBase64 = (buf) => {
2
+ const binstr = Array.prototype.map
3
+ .call(buf, (ch) => String.fromCharCode(ch))
4
+ .join('');
5
+ return Buffer.from(binstr, 'binary').toString('base64');
6
6
  };
7
7
 
8
8
  export { bufferToBase64 };
@@ -4,12 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var DynamicError = require('./DynamicError.cjs');
6
6
 
7
- class AccountExistsError extends DynamicError.DynamicError {
8
- constructor(errorMessage, errorPayload) {
9
- super(errorMessage);
10
- this.errorMessage = errorMessage;
11
- this.errorPayload = errorPayload;
12
- }
7
+ class AccountExistsError extends DynamicError.DynamicError {
8
+ constructor(errorMessage, errorPayload) {
9
+ super(errorMessage);
10
+ this.errorMessage = errorMessage;
11
+ this.errorPayload = errorPayload;
12
+ }
13
13
  }
14
14
 
15
15
  exports.AccountExistsError = AccountExistsError;
@@ -1,13 +1,13 @@
1
- import { DynamicError } from './DynamicError';
2
- type AccountExistsPayload = {
3
- email: string;
4
- embeddedSocialSigninProvider: string;
5
- embeddedWalletName: string;
6
- loginProvider: string;
7
- };
8
- export declare class AccountExistsError extends DynamicError {
9
- errorMessage: string;
10
- errorPayload: AccountExistsPayload;
11
- constructor(errorMessage: string, errorPayload: AccountExistsPayload);
12
- }
13
- export {};
1
+ import { DynamicError } from './DynamicError';
2
+ type AccountExistsPayload = {
3
+ email: string;
4
+ embeddedSocialSigninProvider: string;
5
+ embeddedWalletName: string;
6
+ loginProvider: string;
7
+ };
8
+ export declare class AccountExistsError extends DynamicError {
9
+ errorMessage: string;
10
+ errorPayload: AccountExistsPayload;
11
+ constructor(errorMessage: string, errorPayload: AccountExistsPayload);
12
+ }
13
+ export {};
@@ -1,11 +1,11 @@
1
1
  import { DynamicError } from './DynamicError.js';
2
2
 
3
- class AccountExistsError extends DynamicError {
4
- constructor(errorMessage, errorPayload) {
5
- super(errorMessage);
6
- this.errorMessage = errorMessage;
7
- this.errorPayload = errorPayload;
8
- }
3
+ class AccountExistsError extends DynamicError {
4
+ constructor(errorMessage, errorPayload) {
5
+ super(errorMessage);
6
+ this.errorMessage = errorMessage;
7
+ this.errorPayload = errorPayload;
8
+ }
9
9
  }
10
10
 
11
11
  export { AccountExistsError };
@@ -4,11 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var DynamicError = require('./DynamicError.cjs');
6
6
 
7
- class ChainalysisError extends DynamicError.DynamicError {
8
- constructor(walletPublicKey) {
9
- super('This address is not approved for access');
10
- this.walletPublicKey = walletPublicKey;
11
- }
7
+ class ChainalysisError extends DynamicError.DynamicError {
8
+ constructor(walletPublicKey) {
9
+ super('This address is not approved for access');
10
+ this.walletPublicKey = walletPublicKey;
11
+ }
12
12
  }
13
13
 
14
14
  exports.ChainalysisError = ChainalysisError;
@@ -1,5 +1,5 @@
1
- import { DynamicError } from './DynamicError';
2
- export declare class ChainalysisError extends DynamicError {
3
- walletPublicKey: string | undefined;
4
- constructor(walletPublicKey: string);
5
- }
1
+ import { DynamicError } from './DynamicError';
2
+ export declare class ChainalysisError extends DynamicError {
3
+ walletPublicKey: string | undefined;
4
+ constructor(walletPublicKey: string);
5
+ }
@@ -1,10 +1,10 @@
1
1
  import { DynamicError } from './DynamicError.js';
2
2
 
3
- class ChainalysisError extends DynamicError {
4
- constructor(walletPublicKey) {
5
- super('This address is not approved for access');
6
- this.walletPublicKey = walletPublicKey;
7
- }
3
+ class ChainalysisError extends DynamicError {
4
+ constructor(walletPublicKey) {
5
+ super('This address is not approved for access');
6
+ this.walletPublicKey = walletPublicKey;
7
+ }
8
8
  }
9
9
 
10
10
  export { ChainalysisError };
@@ -2,22 +2,22 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- /**
6
- * Extend this class to allow usage of instanceof
7
- */
8
- class CustomError extends Error {
9
- constructor(message, code) {
10
- super(message);
11
- this.code = undefined;
12
- this.code = code;
13
- Object.setPrototypeOf(this, this.constructor.prototype);
14
- }
15
- toJSON() {
16
- return {
17
- code: this.code,
18
- error: this.message,
19
- };
20
- }
5
+ /**
6
+ * Extend this class to allow usage of instanceof
7
+ */
8
+ class CustomError extends Error {
9
+ constructor(message, code) {
10
+ super(message);
11
+ this.code = undefined;
12
+ this.code = code;
13
+ Object.setPrototypeOf(this, this.constructor.prototype);
14
+ }
15
+ toJSON() {
16
+ return {
17
+ code: this.code,
18
+ error: this.message,
19
+ };
20
+ }
21
21
  }
22
22
 
23
23
  exports.CustomError = CustomError;
@@ -1,11 +1,11 @@
1
- /**
2
- * Extend this class to allow usage of instanceof
3
- */
4
- export declare class CustomError extends Error {
5
- code: string | undefined;
6
- constructor(message?: string | undefined, code?: string);
7
- toJSON(): {
8
- code: string | undefined;
9
- error: string;
10
- };
11
- }
1
+ /**
2
+ * Extend this class to allow usage of instanceof
3
+ */
4
+ export declare class CustomError extends Error {
5
+ code: string | undefined;
6
+ constructor(message?: string | undefined, code?: string);
7
+ toJSON(): {
8
+ code: string | undefined;
9
+ error: string;
10
+ };
11
+ }
@@ -1,19 +1,19 @@
1
- /**
2
- * Extend this class to allow usage of instanceof
3
- */
4
- class CustomError extends Error {
5
- constructor(message, code) {
6
- super(message);
7
- this.code = undefined;
8
- this.code = code;
9
- Object.setPrototypeOf(this, this.constructor.prototype);
10
- }
11
- toJSON() {
12
- return {
13
- code: this.code,
14
- error: this.message,
15
- };
16
- }
1
+ /**
2
+ * Extend this class to allow usage of instanceof
3
+ */
4
+ class CustomError extends Error {
5
+ constructor(message, code) {
6
+ super(message);
7
+ this.code = undefined;
8
+ this.code = code;
9
+ Object.setPrototypeOf(this, this.constructor.prototype);
10
+ }
11
+ toJSON() {
12
+ return {
13
+ code: this.code,
14
+ error: this.message,
15
+ };
16
+ }
17
17
  }
18
18
 
19
19
  export { CustomError };
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var CustomError = require('./CustomError.cjs');
6
6
 
7
- class DynamicError extends CustomError.CustomError {
7
+ class DynamicError extends CustomError.CustomError {
8
8
  }
9
9
 
10
10
  exports.DynamicError = DynamicError;
@@ -1,3 +1,3 @@
1
- import { CustomError } from './CustomError';
2
- export declare class DynamicError extends CustomError {
3
- }
1
+ import { CustomError } from './CustomError';
2
+ export declare class DynamicError extends CustomError {
3
+ }
@@ -1,6 +1,6 @@
1
1
  import { CustomError } from './CustomError.js';
2
2
 
3
- class DynamicError extends CustomError {
3
+ class DynamicError extends CustomError {
4
4
  }
5
5
 
6
6
  export { DynamicError };
@@ -4,10 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var DynamicError = require('./DynamicError.cjs');
6
6
 
7
- class EmailAlreadyExistsError extends DynamicError.DynamicError {
8
- constructor() {
9
- super('Email already exists');
10
- }
7
+ class EmailAlreadyExistsError extends DynamicError.DynamicError {
8
+ constructor() {
9
+ super('Email already exists');
10
+ }
11
11
  }
12
12
 
13
13
  exports.EmailAlreadyExistsError = EmailAlreadyExistsError;
@@ -1,4 +1,4 @@
1
- import { DynamicError } from './DynamicError';
2
- export declare class EmailAlreadyExistsError extends DynamicError {
3
- constructor();
4
- }
1
+ import { DynamicError } from './DynamicError';
2
+ export declare class EmailAlreadyExistsError extends DynamicError {
3
+ constructor();
4
+ }
@@ -1,9 +1,9 @@
1
1
  import { DynamicError } from './DynamicError.js';
2
2
 
3
- class EmailAlreadyExistsError extends DynamicError {
4
- constructor() {
5
- super('Email already exists');
6
- }
3
+ class EmailAlreadyExistsError extends DynamicError {
4
+ constructor() {
5
+ super('Email already exists');
6
+ }
7
7
  }
8
8
 
9
9
  export { EmailAlreadyExistsError };
@@ -4,10 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var DynamicError = require('./DynamicError.cjs');
6
6
 
7
- class EmailProviderError extends DynamicError.DynamicError {
8
- constructor(code) {
9
- super('EmailProviderError', code);
10
- }
7
+ class EmailProviderError extends DynamicError.DynamicError {
8
+ constructor(code) {
9
+ super('EmailProviderError', code);
10
+ }
11
11
  }
12
12
 
13
13
  exports.EmailProviderError = EmailProviderError;
@@ -1,4 +1,4 @@
1
- import { DynamicError } from './DynamicError';
2
- export declare class EmailProviderError extends DynamicError {
3
- constructor(code: string);
4
- }
1
+ import { DynamicError } from './DynamicError';
2
+ export declare class EmailProviderError extends DynamicError {
3
+ constructor(code: string);
4
+ }
@@ -1,9 +1,9 @@
1
1
  import { DynamicError } from './DynamicError.js';
2
2
 
3
- class EmailProviderError extends DynamicError {
4
- constructor(code) {
5
- super('EmailProviderError', code);
6
- }
3
+ class EmailProviderError extends DynamicError {
4
+ constructor(code) {
5
+ super('EmailProviderError', code);
6
+ }
7
7
  }
8
8
 
9
9
  export { EmailProviderError };
@@ -4,10 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var DynamicError = require('./DynamicError.cjs');
6
6
 
7
- class EmailVerificationError extends DynamicError.DynamicError {
8
- constructor(code) {
9
- super('EmailVerificationError', code);
10
- }
7
+ class EmailVerificationError extends DynamicError.DynamicError {
8
+ constructor(code) {
9
+ super('EmailVerificationError', code);
10
+ }
11
11
  }
12
12
 
13
13
  exports.EmailVerificationError = EmailVerificationError;
@@ -1,4 +1,4 @@
1
- import { DynamicError } from './DynamicError';
2
- export declare class EmailVerificationError extends DynamicError {
3
- constructor(code: string);
4
- }
1
+ import { DynamicError } from './DynamicError';
2
+ export declare class EmailVerificationError extends DynamicError {
3
+ constructor(code: string);
4
+ }
@@ -1,9 +1,9 @@
1
1
  import { DynamicError } from './DynamicError.js';
2
2
 
3
- class EmailVerificationError extends DynamicError {
4
- constructor(code) {
5
- super('EmailVerificationError', code);
6
- }
3
+ class EmailVerificationError extends DynamicError {
4
+ constructor(code) {
5
+ super('EmailVerificationError', code);
6
+ }
7
7
  }
8
8
 
9
9
  export { EmailVerificationError };
@@ -4,11 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var DynamicError = require('./DynamicError.cjs');
6
6
 
7
- class GateBlockedError extends DynamicError.DynamicError {
8
- constructor(walletPublicKey) {
9
- super('This address is blocked by the gate');
10
- this.walletPublicKey = walletPublicKey;
11
- }
7
+ class GateBlockedError extends DynamicError.DynamicError {
8
+ constructor(walletPublicKey) {
9
+ super('This address is blocked by the gate');
10
+ this.walletPublicKey = walletPublicKey;
11
+ }
12
12
  }
13
13
 
14
14
  exports.GateBlockedError = GateBlockedError;
@@ -1,5 +1,5 @@
1
- import { DynamicError } from './DynamicError';
2
- export declare class GateBlockedError extends DynamicError {
3
- walletPublicKey: string | undefined;
4
- constructor(walletPublicKey: string);
5
- }
1
+ import { DynamicError } from './DynamicError';
2
+ export declare class GateBlockedError extends DynamicError {
3
+ walletPublicKey: string | undefined;
4
+ constructor(walletPublicKey: string);
5
+ }
@@ -1,10 +1,10 @@
1
1
  import { DynamicError } from './DynamicError.js';
2
2
 
3
- class GateBlockedError extends DynamicError {
4
- constructor(walletPublicKey) {
5
- super('This address is blocked by the gate');
6
- this.walletPublicKey = walletPublicKey;
7
- }
3
+ class GateBlockedError extends DynamicError {
4
+ constructor(walletPublicKey) {
5
+ super('This address is blocked by the gate');
6
+ this.walletPublicKey = walletPublicKey;
7
+ }
8
8
  }
9
9
 
10
10
  export { GateBlockedError };