@dynamic-labs/utils 0.0.0-exp20240808.0

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 (238) hide show
  1. package/CHANGELOG.md +3746 -0
  2. package/LICENSE +21 -0
  3. package/README.md +0 -0
  4. package/_virtual/_tslib.cjs +51 -0
  5. package/_virtual/_tslib.js +45 -0
  6. package/package.json +37 -0
  7. package/src/CancellablePromise/CancellablePromise.cjs +136 -0
  8. package/src/CancellablePromise/CancellablePromise.d.ts +54 -0
  9. package/src/CancellablePromise/CancellablePromise.js +132 -0
  10. package/src/CancellablePromise/index.d.ts +1 -0
  11. package/src/DeferredPromise/DeferredPromise.cjs +22 -0
  12. package/src/DeferredPromise/DeferredPromise.d.ts +13 -0
  13. package/src/DeferredPromise/DeferredPromise.js +18 -0
  14. package/src/DeferredPromise/index.d.ts +1 -0
  15. package/src/bufferPolyfill.cjs +15 -0
  16. package/src/bufferPolyfill.d.ts +1 -0
  17. package/src/bufferPolyfill.js +13 -0
  18. package/src/bufferToBase64.cjs +15 -0
  19. package/src/bufferToBase64.d.ts +2 -0
  20. package/src/bufferToBase64.js +11 -0
  21. package/src/ceil/ceil.cjs +11 -0
  22. package/src/ceil/ceil.d.ts +1 -0
  23. package/src/ceil/ceil.js +7 -0
  24. package/src/ceil/index.d.ts +1 -0
  25. package/src/eip6963/eip6963Provider.cjs +40 -0
  26. package/src/eip6963/eip6963Provider.d.ts +34 -0
  27. package/src/eip6963/eip6963Provider.js +35 -0
  28. package/src/eip6963/index.d.ts +1 -0
  29. package/src/errors/AccessBlockedError.cjs +11 -0
  30. package/src/errors/AccessBlockedError.d.ts +3 -0
  31. package/src/errors/AccessBlockedError.js +7 -0
  32. package/src/errors/AccountExistsError.cjs +16 -0
  33. package/src/errors/AccountExistsError.d.ts +14 -0
  34. package/src/errors/AccountExistsError.js +12 -0
  35. package/src/errors/ChainalysisError.cjs +15 -0
  36. package/src/errors/ChainalysisError.d.ts +5 -0
  37. package/src/errors/ChainalysisError.js +11 -0
  38. package/src/errors/CookieInvalidError.cjs +14 -0
  39. package/src/errors/CookieInvalidError.d.ts +4 -0
  40. package/src/errors/CookieInvalidError.js +10 -0
  41. package/src/errors/CustomError.cjs +24 -0
  42. package/src/errors/CustomError.d.ts +11 -0
  43. package/src/errors/CustomError.js +20 -0
  44. package/src/errors/CustomFieldNotUniqueError.cjs +14 -0
  45. package/src/errors/CustomFieldNotUniqueError.d.ts +4 -0
  46. package/src/errors/CustomFieldNotUniqueError.js +10 -0
  47. package/src/errors/DynamicError.cjs +11 -0
  48. package/src/errors/DynamicError.d.ts +3 -0
  49. package/src/errors/DynamicError.js +7 -0
  50. package/src/errors/EmailAlreadyExistsError.cjs +14 -0
  51. package/src/errors/EmailAlreadyExistsError.d.ts +4 -0
  52. package/src/errors/EmailAlreadyExistsError.js +10 -0
  53. package/src/errors/EmailProviderError.cjs +14 -0
  54. package/src/errors/EmailProviderError.d.ts +4 -0
  55. package/src/errors/EmailProviderError.js +10 -0
  56. package/src/errors/EmailVerificationError.cjs +14 -0
  57. package/src/errors/EmailVerificationError.d.ts +4 -0
  58. package/src/errors/EmailVerificationError.js +10 -0
  59. package/src/errors/EmbeddedWalletException.cjs +14 -0
  60. package/src/errors/EmbeddedWalletException.d.ts +4 -0
  61. package/src/errors/EmbeddedWalletException.js +10 -0
  62. package/src/errors/ExternalAuthError.cjs +14 -0
  63. package/src/errors/ExternalAuthError.d.ts +4 -0
  64. package/src/errors/ExternalAuthError.js +10 -0
  65. package/src/errors/GateBlockedError.cjs +15 -0
  66. package/src/errors/GateBlockedError.d.ts +5 -0
  67. package/src/errors/GateBlockedError.js +11 -0
  68. package/src/errors/InsufficientFundsError.cjs +25 -0
  69. package/src/errors/InsufficientFundsError.d.ts +9 -0
  70. package/src/errors/InsufficientFundsError.js +21 -0
  71. package/src/errors/InvalidPhoneNumberError.cjs +14 -0
  72. package/src/errors/InvalidPhoneNumberError.d.ts +4 -0
  73. package/src/errors/InvalidPhoneNumberError.js +10 -0
  74. package/src/errors/MergeAccountsConfirmationError.cjs +16 -0
  75. package/src/errors/MergeAccountsConfirmationError.d.ts +12 -0
  76. package/src/errors/MergeAccountsConfirmationError.js +12 -0
  77. package/src/errors/MfaInvalidOtpError.cjs +14 -0
  78. package/src/errors/MfaInvalidOtpError.d.ts +4 -0
  79. package/src/errors/MfaInvalidOtpError.js +10 -0
  80. package/src/errors/MissingEnvironmentIdError.cjs +14 -0
  81. package/src/errors/MissingEnvironmentIdError.d.ts +4 -0
  82. package/src/errors/MissingEnvironmentIdError.js +10 -0
  83. package/src/errors/MissingPublicAddressError.cjs +14 -0
  84. package/src/errors/MissingPublicAddressError.d.ts +4 -0
  85. package/src/errors/MissingPublicAddressError.js +10 -0
  86. package/src/errors/NoAccessError.cjs +19 -0
  87. package/src/errors/NoAccessError.d.ts +15 -0
  88. package/src/errors/NoAccessError.js +15 -0
  89. package/src/errors/NotSupportedError.cjs +11 -0
  90. package/src/errors/NotSupportedError.d.ts +3 -0
  91. package/src/errors/NotSupportedError.js +7 -0
  92. package/src/errors/PasskeyError.d.ts +8 -0
  93. package/src/errors/SmsVerificationError.cjs +11 -0
  94. package/src/errors/SmsVerificationError.d.ts +3 -0
  95. package/src/errors/SmsVerificationError.js +7 -0
  96. package/src/errors/SocialAccountAlreadyExistsError.cjs +14 -0
  97. package/src/errors/SocialAccountAlreadyExistsError.d.ts +4 -0
  98. package/src/errors/SocialAccountAlreadyExistsError.js +10 -0
  99. package/src/errors/TooManyEmailVerificationsError.cjs +14 -0
  100. package/src/errors/TooManyEmailVerificationsError.d.ts +4 -0
  101. package/src/errors/TooManyEmailVerificationsError.js +10 -0
  102. package/src/errors/TransactionGasCannotBeSponsoredError.cjs +25 -0
  103. package/src/errors/TransactionGasCannotBeSponsoredError.d.ts +9 -0
  104. package/src/errors/TransactionGasCannotBeSponsoredError.js +21 -0
  105. package/src/errors/UserHasAccountWithEmailError.cjs +15 -0
  106. package/src/errors/UserHasAccountWithEmailError.d.ts +5 -0
  107. package/src/errors/UserHasAccountWithEmailError.js +11 -0
  108. package/src/errors/UserRejectedTransactionError.cjs +14 -0
  109. package/src/errors/UserRejectedTransactionError.d.ts +4 -0
  110. package/src/errors/UserRejectedTransactionError.js +10 -0
  111. package/src/errors/UsernameAlreadyExistsError.cjs +14 -0
  112. package/src/errors/UsernameAlreadyExistsError.d.ts +4 -0
  113. package/src/errors/UsernameAlreadyExistsError.js +10 -0
  114. package/src/errors/VerificationDataCollectionError.cjs +15 -0
  115. package/src/errors/VerificationDataCollectionError.d.ts +5 -0
  116. package/src/errors/VerificationDataCollectionError.js +11 -0
  117. package/src/errors/WalletAddressMismatchError.cjs +17 -0
  118. package/src/errors/WalletAddressMismatchError.d.ts +11 -0
  119. package/src/errors/WalletAddressMismatchError.js +13 -0
  120. package/src/errors/WalletNotDeployedError.cjs +14 -0
  121. package/src/errors/WalletNotDeployedError.d.ts +4 -0
  122. package/src/errors/WalletNotDeployedError.js +10 -0
  123. package/src/errors/WalletUsedError.cjs +14 -0
  124. package/src/errors/WalletUsedError.d.ts +4 -0
  125. package/src/errors/WalletUsedError.js +10 -0
  126. package/src/errors/index.d.ts +33 -0
  127. package/src/formatNumberText/formatNumberText.cjs +20 -0
  128. package/src/formatNumberText/formatNumberText.d.ts +5 -0
  129. package/src/formatNumberText/formatNumberText.js +16 -0
  130. package/src/formatNumberText/index.d.ts +1 -0
  131. package/src/get/get.cjs +24 -0
  132. package/src/get/get.d.ts +7 -0
  133. package/src/get/get.js +20 -0
  134. package/src/get/index.d.ts +1 -0
  135. package/src/getProvidersFromWindow.cjs +39 -0
  136. package/src/getProvidersFromWindow.d.ts +7 -0
  137. package/src/getProvidersFromWindow.js +35 -0
  138. package/src/getTLD/getTLD.cjs +12 -0
  139. package/src/getTLD/getTLD.d.ts +1 -0
  140. package/src/getTLD/getTLD.js +8 -0
  141. package/src/getTLD/index.d.ts +1 -0
  142. package/src/handleMobileWalletRedirect/handleMobileWalletRedirect.cjs +20 -0
  143. package/src/handleMobileWalletRedirect/handleMobileWalletRedirect.d.ts +4 -0
  144. package/src/handleMobileWalletRedirect/handleMobileWalletRedirect.js +16 -0
  145. package/src/handleMobileWalletRedirect/index.d.ts +1 -0
  146. package/src/hexToString/hexToString.cjs +32 -0
  147. package/src/hexToString/hexToString.d.ts +12 -0
  148. package/src/hexToString/hexToString.js +28 -0
  149. package/src/hexToString/index.d.ts +1 -0
  150. package/src/index.cjs +151 -0
  151. package/src/index.d.ts +32 -0
  152. package/src/index.js +66 -0
  153. package/src/isFunction/index.d.ts +1 -0
  154. package/src/isFunction/isFunction.cjs +9 -0
  155. package/src/isFunction/isFunction.d.ts +1 -0
  156. package/src/isFunction/isFunction.js +5 -0
  157. package/src/isHex/index.d.ts +1 -0
  158. package/src/isHex/isHex.cjs +20 -0
  159. package/src/isHex/isHex.d.ts +6 -0
  160. package/src/isHex/isHex.js +16 -0
  161. package/src/isLedgerAddressViaVerifiedCredentials.cjs +13 -0
  162. package/src/isLedgerAddressViaVerifiedCredentials.d.ts +2 -0
  163. package/src/isLedgerAddressViaVerifiedCredentials.js +9 -0
  164. package/src/isMobile.cjs +146 -0
  165. package/src/isMobile.d.ts +18 -0
  166. package/src/isMobile.js +133 -0
  167. package/src/last.cjs +22 -0
  168. package/src/last.d.ts +15 -0
  169. package/src/last.js +18 -0
  170. package/src/localStorageAsync.cjs +38 -0
  171. package/src/localStorageAsync.d.ts +3 -0
  172. package/src/localStorageAsync.js +32 -0
  173. package/src/logger/index.d.ts +1 -0
  174. package/src/logger/logger.cjs +10 -0
  175. package/src/logger/logger.d.ts +2 -0
  176. package/src/logger/logger.js +6 -0
  177. package/src/nativeMobileOauthStateParam.cjs +13 -0
  178. package/src/nativeMobileOauthStateParam.d.ts +14 -0
  179. package/src/nativeMobileOauthStateParam.js +9 -0
  180. package/src/parseChainId.cjs +8 -0
  181. package/src/parseChainId.d.ts +1 -0
  182. package/src/parseChainId.js +4 -0
  183. package/src/parseEvmNetworks.cjs +17 -0
  184. package/src/parseEvmNetworks.d.ts +2 -0
  185. package/src/parseEvmNetworks.js +13 -0
  186. package/src/pipe/index.d.ts +1 -0
  187. package/src/pipe/pipe.cjs +40 -0
  188. package/src/pipe/pipe.d.ts +27 -0
  189. package/src/pipe/pipe.js +36 -0
  190. package/src/retryableFn.cjs +73 -0
  191. package/src/retryableFn.d.ts +19 -0
  192. package/src/retryableFn.js +68 -0
  193. package/src/runSafe/index.d.ts +1 -0
  194. package/src/runSafe/runSafe.cjs +25 -0
  195. package/src/runSafe/runSafe.d.ts +8 -0
  196. package/src/runSafe/runSafe.js +21 -0
  197. package/src/services/FetchService/FetchService.cjs +29 -0
  198. package/src/services/FetchService/FetchService.d.ts +10 -0
  199. package/src/services/FetchService/FetchService.js +25 -0
  200. package/src/services/FetchService/index.d.ts +2 -0
  201. package/src/services/FetchService/types.d.ts +3 -0
  202. package/src/services/Oauth2Service/Oauth2Service.cjs +38 -0
  203. package/src/services/Oauth2Service/Oauth2Service.d.ts +34 -0
  204. package/src/services/Oauth2Service/Oauth2Service.js +34 -0
  205. package/src/services/Oauth2Service/createWindowOauth2Service/createWindowOauth2Service.cjs +192 -0
  206. package/src/services/Oauth2Service/createWindowOauth2Service/createWindowOauth2Service.d.ts +2 -0
  207. package/src/services/Oauth2Service/createWindowOauth2Service/createWindowOauth2Service.js +188 -0
  208. package/src/services/Oauth2Service/createWindowOauth2Service/index.d.ts +1 -0
  209. package/src/services/Oauth2Service/index.d.ts +2 -0
  210. package/src/services/PlatformService/PlatformService.cjs +40 -0
  211. package/src/services/PlatformService/PlatformService.d.ts +11 -0
  212. package/src/services/PlatformService/PlatformService.js +36 -0
  213. package/src/services/PlatformService/createBrowserPlatformService/createBrowserPlatformService.cjs +30 -0
  214. package/src/services/PlatformService/createBrowserPlatformService/createBrowserPlatformService.d.ts +2 -0
  215. package/src/services/PlatformService/createBrowserPlatformService/createBrowserPlatformService.js +26 -0
  216. package/src/services/PlatformService/createBrowserPlatformService/index.d.ts +1 -0
  217. package/src/services/PlatformService/index.d.ts +3 -0
  218. package/src/services/PlatformService/types.d.ts +25 -0
  219. package/src/sleep/index.d.ts +1 -0
  220. package/src/sleep/sleep.cjs +13 -0
  221. package/src/sleep/sleep.d.ts +11 -0
  222. package/src/sleep/sleep.js +9 -0
  223. package/src/template/index.d.ts +1 -0
  224. package/src/template/template.cjs +25 -0
  225. package/src/template/template.d.ts +18 -0
  226. package/src/template/template.js +21 -0
  227. package/src/trimEnd/index.d.ts +1 -0
  228. package/src/trimEnd/trimEnd.cjs +14 -0
  229. package/src/trimEnd/trimEnd.d.ts +1 -0
  230. package/src/trimEnd/trimEnd.js +10 -0
  231. package/src/uniq/index.d.ts +1 -0
  232. package/src/uniq/uniq.cjs +33 -0
  233. package/src/uniq/uniq.d.ts +17 -0
  234. package/src/uniq/uniq.js +29 -0
  235. package/src/wrapMethodWithCallback/index.d.ts +1 -0
  236. package/src/wrapMethodWithCallback/wrapMethodWithCallback.cjs +47 -0
  237. package/src/wrapMethodWithCallback/wrapMethodWithCallback.d.ts +36 -0
  238. package/src/wrapMethodWithCallback/wrapMethodWithCallback.js +43 -0
@@ -0,0 +1,40 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ const isEip9693Event = (event) => event.type === 'eip6963:announceProvider' &&
7
+ event.detail !== undefined;
8
+ class Eip6963Provider {
9
+ constructor() {
10
+ this.providers = [];
11
+ }
12
+ registerProviders() {
13
+ if (typeof window === 'undefined') {
14
+ return;
15
+ }
16
+ window.addEventListener('eip6963:announceProvider', (event) => {
17
+ if (!isEip9693Event(event)) {
18
+ return;
19
+ }
20
+ this.providers.push(event.detail);
21
+ });
22
+ window.dispatchEvent(new Event('eip6963:requestProvider'));
23
+ }
24
+ }
25
+ class Eip6963ProviderSingleton {
26
+ constructor() {
27
+ this.eip6963Provider = new Eip6963Provider();
28
+ }
29
+ static get() {
30
+ var _a;
31
+ if (!((_a = Eip6963ProviderSingleton.instance) === null || _a === void 0 ? void 0 : _a.eip6963Provider)) {
32
+ Eip6963ProviderSingleton.instance = new Eip6963ProviderSingleton();
33
+ Eip6963ProviderSingleton.instance.eip6963Provider.registerProviders();
34
+ }
35
+ return Eip6963ProviderSingleton.instance.eip6963Provider;
36
+ }
37
+ }
38
+
39
+ exports.Eip6963Provider = Eip6963Provider;
40
+ exports.Eip6963ProviderSingleton = Eip6963ProviderSingleton;
@@ -0,0 +1,34 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { EventEmitter } from 'stream';
4
+ export type IEthereum = {
5
+ [key: string]: any;
6
+ providers?: object[];
7
+ request: <T extends string>(params: {
8
+ method: T;
9
+ } | object) => Promise<T extends 'eth_requestAccounts' ? [string] : object>;
10
+ } & EventEmitter;
11
+ /**
12
+ * Represents the assets needed to display a wallet
13
+ */
14
+ type Eip6963ProviderInfo = {
15
+ uuid: string;
16
+ name: string;
17
+ icon: string;
18
+ rdns: string;
19
+ };
20
+ type Eip6963ProviderDetail = {
21
+ info: Eip6963ProviderInfo;
22
+ provider: IEthereum;
23
+ };
24
+ export declare class Eip6963Provider {
25
+ providers: Eip6963ProviderDetail[];
26
+ registerProviders(): void;
27
+ }
28
+ export declare class Eip6963ProviderSingleton {
29
+ readonly eip6963Provider: Eip6963Provider;
30
+ private constructor();
31
+ private static instance;
32
+ static get(): Eip6963Provider;
33
+ }
34
+ export {};
@@ -0,0 +1,35 @@
1
+ 'use client'
2
+ const isEip9693Event = (event) => event.type === 'eip6963:announceProvider' &&
3
+ event.detail !== undefined;
4
+ class Eip6963Provider {
5
+ constructor() {
6
+ this.providers = [];
7
+ }
8
+ registerProviders() {
9
+ if (typeof window === 'undefined') {
10
+ return;
11
+ }
12
+ window.addEventListener('eip6963:announceProvider', (event) => {
13
+ if (!isEip9693Event(event)) {
14
+ return;
15
+ }
16
+ this.providers.push(event.detail);
17
+ });
18
+ window.dispatchEvent(new Event('eip6963:requestProvider'));
19
+ }
20
+ }
21
+ class Eip6963ProviderSingleton {
22
+ constructor() {
23
+ this.eip6963Provider = new Eip6963Provider();
24
+ }
25
+ static get() {
26
+ var _a;
27
+ if (!((_a = Eip6963ProviderSingleton.instance) === null || _a === void 0 ? void 0 : _a.eip6963Provider)) {
28
+ Eip6963ProviderSingleton.instance = new Eip6963ProviderSingleton();
29
+ Eip6963ProviderSingleton.instance.eip6963Provider.registerProviders();
30
+ }
31
+ return Eip6963ProviderSingleton.instance.eip6963Provider;
32
+ }
33
+ }
34
+
35
+ export { Eip6963Provider, Eip6963ProviderSingleton };
@@ -0,0 +1 @@
1
+ export * from './eip6963Provider';
@@ -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 AccessBlockedError extends DynamicError.DynamicError {
9
+ }
10
+
11
+ exports.AccessBlockedError = AccessBlockedError;
@@ -0,0 +1,3 @@
1
+ import { DynamicError } from './DynamicError';
2
+ export declare class AccessBlockedError extends DynamicError {
3
+ }
@@ -0,0 +1,7 @@
1
+ 'use client'
2
+ import { DynamicError } from './DynamicError.js';
3
+
4
+ class AccessBlockedError extends DynamicError {
5
+ }
6
+
7
+ export { AccessBlockedError };
@@ -0,0 +1,16 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var DynamicError = require('./DynamicError.cjs');
7
+
8
+ class AccountExistsError extends DynamicError.DynamicError {
9
+ constructor(errorMessage, errorPayload) {
10
+ super(errorMessage);
11
+ this.errorMessage = errorMessage;
12
+ this.errorPayload = errorPayload;
13
+ }
14
+ }
15
+
16
+ exports.AccountExistsError = AccountExistsError;
@@ -0,0 +1,14 @@
1
+ import { DynamicError } from './DynamicError';
2
+ type AccountExistsPayload = {
3
+ email: string;
4
+ embeddedSocialSigninProvider: string;
5
+ embeddedWalletName: string;
6
+ loginProvider: string;
7
+ phoneNumber?: string;
8
+ };
9
+ export declare class AccountExistsError extends DynamicError {
10
+ errorMessage: string;
11
+ errorPayload: AccountExistsPayload;
12
+ constructor(errorMessage: string, errorPayload: AccountExistsPayload);
13
+ }
14
+ export {};
@@ -0,0 +1,12 @@
1
+ 'use client'
2
+ import { DynamicError } from './DynamicError.js';
3
+
4
+ class AccountExistsError extends DynamicError {
5
+ constructor(errorMessage, errorPayload) {
6
+ super(errorMessage);
7
+ this.errorMessage = errorMessage;
8
+ this.errorPayload = errorPayload;
9
+ }
10
+ }
11
+
12
+ export { AccountExistsError };
@@ -0,0 +1,15 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var DynamicError = require('./DynamicError.cjs');
7
+
8
+ class ChainalysisError extends DynamicError.DynamicError {
9
+ constructor(walletPublicKey) {
10
+ super('This address is not approved for access');
11
+ this.walletPublicKey = walletPublicKey;
12
+ }
13
+ }
14
+
15
+ exports.ChainalysisError = ChainalysisError;
@@ -0,0 +1,5 @@
1
+ import { DynamicError } from './DynamicError';
2
+ export declare class ChainalysisError extends DynamicError {
3
+ walletPublicKey: string | undefined;
4
+ constructor(walletPublicKey: string);
5
+ }
@@ -0,0 +1,11 @@
1
+ 'use client'
2
+ import { DynamicError } from './DynamicError.js';
3
+
4
+ class ChainalysisError extends DynamicError {
5
+ constructor(walletPublicKey) {
6
+ super('This address is not approved for access');
7
+ this.walletPublicKey = walletPublicKey;
8
+ }
9
+ }
10
+
11
+ export { ChainalysisError };
@@ -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 CookieInvalidError extends DynamicError.DynamicError {
9
+ constructor() {
10
+ super('The cookie is invalid or expired');
11
+ }
12
+ }
13
+
14
+ exports.CookieInvalidError = CookieInvalidError;
@@ -0,0 +1,4 @@
1
+ import { DynamicError } from './DynamicError';
2
+ export declare class CookieInvalidError extends DynamicError {
3
+ constructor();
4
+ }
@@ -0,0 +1,10 @@
1
+ 'use client'
2
+ import { DynamicError } from './DynamicError.js';
3
+
4
+ class CookieInvalidError extends DynamicError {
5
+ constructor() {
6
+ super('The cookie is invalid or expired');
7
+ }
8
+ }
9
+
10
+ export { CookieInvalidError };
@@ -0,0 +1,24 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ /**
7
+ * Extend this class to allow usage of instanceof
8
+ */
9
+ class CustomError extends Error {
10
+ constructor(message, code) {
11
+ super(message);
12
+ this.code = undefined;
13
+ this.code = code;
14
+ Object.setPrototypeOf(this, this.constructor.prototype);
15
+ }
16
+ toJSON() {
17
+ return {
18
+ code: this.code,
19
+ error: this.message,
20
+ };
21
+ }
22
+ }
23
+
24
+ exports.CustomError = CustomError;
@@ -0,0 +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
+ }
@@ -0,0 +1,20 @@
1
+ 'use client'
2
+ /**
3
+ * Extend this class to allow usage of instanceof
4
+ */
5
+ class CustomError extends Error {
6
+ constructor(message, code) {
7
+ super(message);
8
+ this.code = undefined;
9
+ this.code = code;
10
+ Object.setPrototypeOf(this, this.constructor.prototype);
11
+ }
12
+ toJSON() {
13
+ return {
14
+ code: this.code,
15
+ error: this.message,
16
+ };
17
+ }
18
+ }
19
+
20
+ export { CustomError };
@@ -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 CustomFieldNotUniqueError extends DynamicError.DynamicError {
9
+ constructor() {
10
+ super('Custom Field for user must be unique within the environment', 'custom_field_data_not_unique');
11
+ }
12
+ }
13
+
14
+ exports.CustomFieldNotUniqueError = CustomFieldNotUniqueError;
@@ -0,0 +1,4 @@
1
+ import { DynamicError } from './DynamicError';
2
+ export declare class CustomFieldNotUniqueError extends DynamicError {
3
+ constructor();
4
+ }
@@ -0,0 +1,10 @@
1
+ 'use client'
2
+ import { DynamicError } from './DynamicError.js';
3
+
4
+ class CustomFieldNotUniqueError extends DynamicError {
5
+ constructor() {
6
+ super('Custom Field for user must be unique within the environment', 'custom_field_data_not_unique');
7
+ }
8
+ }
9
+
10
+ export { CustomFieldNotUniqueError };
@@ -0,0 +1,11 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var CustomError = require('./CustomError.cjs');
7
+
8
+ class DynamicError extends CustomError.CustomError {
9
+ }
10
+
11
+ exports.DynamicError = DynamicError;
@@ -0,0 +1,3 @@
1
+ import { CustomError } from './CustomError';
2
+ export declare class DynamicError extends CustomError {
3
+ }
@@ -0,0 +1,7 @@
1
+ 'use client'
2
+ import { CustomError } from './CustomError.js';
3
+
4
+ class DynamicError extends CustomError {
5
+ }
6
+
7
+ export { DynamicError };
@@ -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 EmailAlreadyExistsError extends DynamicError.DynamicError {
9
+ constructor() {
10
+ super('Email already exists');
11
+ }
12
+ }
13
+
14
+ exports.EmailAlreadyExistsError = EmailAlreadyExistsError;
@@ -0,0 +1,4 @@
1
+ import { DynamicError } from './DynamicError';
2
+ export declare class EmailAlreadyExistsError extends DynamicError {
3
+ constructor();
4
+ }
@@ -0,0 +1,10 @@
1
+ 'use client'
2
+ import { DynamicError } from './DynamicError.js';
3
+
4
+ class EmailAlreadyExistsError extends DynamicError {
5
+ constructor() {
6
+ super('Email already exists');
7
+ }
8
+ }
9
+
10
+ export { EmailAlreadyExistsError };
@@ -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 EmailProviderError extends DynamicError.DynamicError {
9
+ constructor(code) {
10
+ super('EmailProviderError', code);
11
+ }
12
+ }
13
+
14
+ exports.EmailProviderError = EmailProviderError;
@@ -0,0 +1,4 @@
1
+ import { DynamicError } from './DynamicError';
2
+ export declare class EmailProviderError extends DynamicError {
3
+ constructor(code: string);
4
+ }
@@ -0,0 +1,10 @@
1
+ 'use client'
2
+ import { DynamicError } from './DynamicError.js';
3
+
4
+ class EmailProviderError extends DynamicError {
5
+ constructor(code) {
6
+ super('EmailProviderError', code);
7
+ }
8
+ }
9
+
10
+ export { EmailProviderError };
@@ -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 EmailVerificationError extends DynamicError.DynamicError {
9
+ constructor(code) {
10
+ super('EmailVerificationError', code);
11
+ }
12
+ }
13
+
14
+ exports.EmailVerificationError = EmailVerificationError;
@@ -0,0 +1,4 @@
1
+ import { DynamicError } from './DynamicError';
2
+ export declare class EmailVerificationError extends DynamicError {
3
+ constructor(code: string);
4
+ }
@@ -0,0 +1,10 @@
1
+ 'use client'
2
+ import { DynamicError } from './DynamicError.js';
3
+
4
+ class EmailVerificationError extends DynamicError {
5
+ constructor(code) {
6
+ super('EmailVerificationError', code);
7
+ }
8
+ }
9
+
10
+ export { EmailVerificationError };
@@ -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 EmbeddedWalletException extends DynamicError.DynamicError {
9
+ constructor(message) {
10
+ super(message);
11
+ }
12
+ }
13
+
14
+ exports.EmbeddedWalletException = EmbeddedWalletException;
@@ -0,0 +1,4 @@
1
+ import { DynamicError } from './DynamicError';
2
+ export declare class EmbeddedWalletException extends DynamicError {
3
+ constructor(message: string);
4
+ }
@@ -0,0 +1,10 @@
1
+ 'use client'
2
+ import { DynamicError } from './DynamicError.js';
3
+
4
+ class EmbeddedWalletException extends DynamicError {
5
+ constructor(message) {
6
+ super(message);
7
+ }
8
+ }
9
+
10
+ export { EmbeddedWalletException };
@@ -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 ExternalAuthError extends DynamicError.DynamicError {
9
+ constructor(code) {
10
+ super('ExternalAuthError', code);
11
+ }
12
+ }
13
+
14
+ exports.ExternalAuthError = ExternalAuthError;
@@ -0,0 +1,4 @@
1
+ import { DynamicError } from './DynamicError';
2
+ export declare class ExternalAuthError extends DynamicError {
3
+ constructor(code: string);
4
+ }
@@ -0,0 +1,10 @@
1
+ 'use client'
2
+ import { DynamicError } from './DynamicError.js';
3
+
4
+ class ExternalAuthError extends DynamicError {
5
+ constructor(code) {
6
+ super('ExternalAuthError', code);
7
+ }
8
+ }
9
+
10
+ export { ExternalAuthError };
@@ -0,0 +1,15 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var DynamicError = require('./DynamicError.cjs');
7
+
8
+ class GateBlockedError extends DynamicError.DynamicError {
9
+ constructor(walletPublicKey) {
10
+ super('This address is blocked by the gate');
11
+ this.walletPublicKey = walletPublicKey;
12
+ }
13
+ }
14
+
15
+ exports.GateBlockedError = GateBlockedError;
@@ -0,0 +1,5 @@
1
+ import { DynamicError } from './DynamicError';
2
+ export declare class GateBlockedError extends DynamicError {
3
+ walletPublicKey: string | undefined;
4
+ constructor(walletPublicKey: string);
5
+ }
@@ -0,0 +1,11 @@
1
+ 'use client'
2
+ import { DynamicError } from './DynamicError.js';
3
+
4
+ class GateBlockedError extends DynamicError {
5
+ constructor(walletPublicKey) {
6
+ super('This address is blocked by the gate');
7
+ this.walletPublicKey = walletPublicKey;
8
+ }
9
+ }
10
+
11
+ export { GateBlockedError };
@@ -0,0 +1,25 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var DynamicError = require('./DynamicError.cjs');
7
+
8
+ class InsufficientFundsError extends DynamicError.DynamicError {
9
+ constructor() {
10
+ super(InsufficientFundsError.message);
11
+ }
12
+ static isInstance(err) {
13
+ var _a;
14
+ const error = ((_a = err === null || err === void 0 ? void 0 : err.walk) === null || _a === void 0 ? void 0 : _a.call(err)) || err;
15
+ return error instanceof InsufficientFundsError;
16
+ }
17
+ static isErrorMessage(err) {
18
+ var _a;
19
+ const errorWithMessage = err;
20
+ 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);
21
+ }
22
+ }
23
+ InsufficientFundsError.message = 'Insufficient funds.';
24
+
25
+ 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,21 @@
1
+ 'use client'
2
+ import { DynamicError } from './DynamicError.js';
3
+
4
+ class InsufficientFundsError extends DynamicError {
5
+ constructor() {
6
+ super(InsufficientFundsError.message);
7
+ }
8
+ static isInstance(err) {
9
+ var _a;
10
+ const error = ((_a = err === null || err === void 0 ? void 0 : err.walk) === null || _a === void 0 ? void 0 : _a.call(err)) || err;
11
+ return error instanceof InsufficientFundsError;
12
+ }
13
+ static isErrorMessage(err) {
14
+ var _a;
15
+ const errorWithMessage = err;
16
+ 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);
17
+ }
18
+ }
19
+ InsufficientFundsError.message = 'Insufficient funds.';
20
+
21
+ export { InsufficientFundsError };
@@ -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 InvalidPhoneNumberError extends DynamicError.DynamicError {
9
+ constructor(error) {
10
+ super(error !== null && error !== void 0 ? error : 'Invalid phone number.');
11
+ }
12
+ }
13
+
14
+ exports.InvalidPhoneNumberError = InvalidPhoneNumberError;