@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.
- package/CHANGELOG.md +3746 -0
- package/LICENSE +21 -0
- package/README.md +0 -0
- package/_virtual/_tslib.cjs +51 -0
- package/_virtual/_tslib.js +45 -0
- package/package.json +37 -0
- package/src/CancellablePromise/CancellablePromise.cjs +136 -0
- package/src/CancellablePromise/CancellablePromise.d.ts +54 -0
- package/src/CancellablePromise/CancellablePromise.js +132 -0
- package/src/CancellablePromise/index.d.ts +1 -0
- package/src/DeferredPromise/DeferredPromise.cjs +22 -0
- package/src/DeferredPromise/DeferredPromise.d.ts +13 -0
- package/src/DeferredPromise/DeferredPromise.js +18 -0
- package/src/DeferredPromise/index.d.ts +1 -0
- package/src/bufferPolyfill.cjs +15 -0
- package/src/bufferPolyfill.d.ts +1 -0
- package/src/bufferPolyfill.js +13 -0
- package/src/bufferToBase64.cjs +15 -0
- package/src/bufferToBase64.d.ts +2 -0
- package/src/bufferToBase64.js +11 -0
- package/src/ceil/ceil.cjs +11 -0
- package/src/ceil/ceil.d.ts +1 -0
- package/src/ceil/ceil.js +7 -0
- package/src/ceil/index.d.ts +1 -0
- package/src/eip6963/eip6963Provider.cjs +40 -0
- package/src/eip6963/eip6963Provider.d.ts +34 -0
- package/src/eip6963/eip6963Provider.js +35 -0
- package/src/eip6963/index.d.ts +1 -0
- package/src/errors/AccessBlockedError.cjs +11 -0
- package/src/errors/AccessBlockedError.d.ts +3 -0
- package/src/errors/AccessBlockedError.js +7 -0
- package/src/errors/AccountExistsError.cjs +16 -0
- package/src/errors/AccountExistsError.d.ts +14 -0
- package/src/errors/AccountExistsError.js +12 -0
- package/src/errors/ChainalysisError.cjs +15 -0
- package/src/errors/ChainalysisError.d.ts +5 -0
- package/src/errors/ChainalysisError.js +11 -0
- package/src/errors/CookieInvalidError.cjs +14 -0
- package/src/errors/CookieInvalidError.d.ts +4 -0
- package/src/errors/CookieInvalidError.js +10 -0
- package/src/errors/CustomError.cjs +24 -0
- package/src/errors/CustomError.d.ts +11 -0
- package/src/errors/CustomError.js +20 -0
- package/src/errors/CustomFieldNotUniqueError.cjs +14 -0
- package/src/errors/CustomFieldNotUniqueError.d.ts +4 -0
- package/src/errors/CustomFieldNotUniqueError.js +10 -0
- package/src/errors/DynamicError.cjs +11 -0
- package/src/errors/DynamicError.d.ts +3 -0
- package/src/errors/DynamicError.js +7 -0
- package/src/errors/EmailAlreadyExistsError.cjs +14 -0
- package/src/errors/EmailAlreadyExistsError.d.ts +4 -0
- package/src/errors/EmailAlreadyExistsError.js +10 -0
- package/src/errors/EmailProviderError.cjs +14 -0
- package/src/errors/EmailProviderError.d.ts +4 -0
- package/src/errors/EmailProviderError.js +10 -0
- package/src/errors/EmailVerificationError.cjs +14 -0
- package/src/errors/EmailVerificationError.d.ts +4 -0
- package/src/errors/EmailVerificationError.js +10 -0
- package/src/errors/EmbeddedWalletException.cjs +14 -0
- package/src/errors/EmbeddedWalletException.d.ts +4 -0
- package/src/errors/EmbeddedWalletException.js +10 -0
- package/src/errors/ExternalAuthError.cjs +14 -0
- package/src/errors/ExternalAuthError.d.ts +4 -0
- package/src/errors/ExternalAuthError.js +10 -0
- package/src/errors/GateBlockedError.cjs +15 -0
- package/src/errors/GateBlockedError.d.ts +5 -0
- package/src/errors/GateBlockedError.js +11 -0
- package/src/errors/InsufficientFundsError.cjs +25 -0
- package/src/errors/InsufficientFundsError.d.ts +9 -0
- package/src/errors/InsufficientFundsError.js +21 -0
- package/src/errors/InvalidPhoneNumberError.cjs +14 -0
- package/src/errors/InvalidPhoneNumberError.d.ts +4 -0
- package/src/errors/InvalidPhoneNumberError.js +10 -0
- package/src/errors/MergeAccountsConfirmationError.cjs +16 -0
- package/src/errors/MergeAccountsConfirmationError.d.ts +12 -0
- package/src/errors/MergeAccountsConfirmationError.js +12 -0
- package/src/errors/MfaInvalidOtpError.cjs +14 -0
- package/src/errors/MfaInvalidOtpError.d.ts +4 -0
- package/src/errors/MfaInvalidOtpError.js +10 -0
- package/src/errors/MissingEnvironmentIdError.cjs +14 -0
- package/src/errors/MissingEnvironmentIdError.d.ts +4 -0
- package/src/errors/MissingEnvironmentIdError.js +10 -0
- package/src/errors/MissingPublicAddressError.cjs +14 -0
- package/src/errors/MissingPublicAddressError.d.ts +4 -0
- package/src/errors/MissingPublicAddressError.js +10 -0
- package/src/errors/NoAccessError.cjs +19 -0
- package/src/errors/NoAccessError.d.ts +15 -0
- package/src/errors/NoAccessError.js +15 -0
- package/src/errors/NotSupportedError.cjs +11 -0
- package/src/errors/NotSupportedError.d.ts +3 -0
- package/src/errors/NotSupportedError.js +7 -0
- package/src/errors/PasskeyError.d.ts +8 -0
- package/src/errors/SmsVerificationError.cjs +11 -0
- package/src/errors/SmsVerificationError.d.ts +3 -0
- package/src/errors/SmsVerificationError.js +7 -0
- package/src/errors/SocialAccountAlreadyExistsError.cjs +14 -0
- package/src/errors/SocialAccountAlreadyExistsError.d.ts +4 -0
- package/src/errors/SocialAccountAlreadyExistsError.js +10 -0
- package/src/errors/TooManyEmailVerificationsError.cjs +14 -0
- package/src/errors/TooManyEmailVerificationsError.d.ts +4 -0
- package/src/errors/TooManyEmailVerificationsError.js +10 -0
- package/src/errors/TransactionGasCannotBeSponsoredError.cjs +25 -0
- package/src/errors/TransactionGasCannotBeSponsoredError.d.ts +9 -0
- package/src/errors/TransactionGasCannotBeSponsoredError.js +21 -0
- package/src/errors/UserHasAccountWithEmailError.cjs +15 -0
- package/src/errors/UserHasAccountWithEmailError.d.ts +5 -0
- package/src/errors/UserHasAccountWithEmailError.js +11 -0
- package/src/errors/UserRejectedTransactionError.cjs +14 -0
- package/src/errors/UserRejectedTransactionError.d.ts +4 -0
- package/src/errors/UserRejectedTransactionError.js +10 -0
- package/src/errors/UsernameAlreadyExistsError.cjs +14 -0
- package/src/errors/UsernameAlreadyExistsError.d.ts +4 -0
- package/src/errors/UsernameAlreadyExistsError.js +10 -0
- package/src/errors/VerificationDataCollectionError.cjs +15 -0
- package/src/errors/VerificationDataCollectionError.d.ts +5 -0
- package/src/errors/VerificationDataCollectionError.js +11 -0
- package/src/errors/WalletAddressMismatchError.cjs +17 -0
- package/src/errors/WalletAddressMismatchError.d.ts +11 -0
- package/src/errors/WalletAddressMismatchError.js +13 -0
- package/src/errors/WalletNotDeployedError.cjs +14 -0
- package/src/errors/WalletNotDeployedError.d.ts +4 -0
- package/src/errors/WalletNotDeployedError.js +10 -0
- package/src/errors/WalletUsedError.cjs +14 -0
- package/src/errors/WalletUsedError.d.ts +4 -0
- package/src/errors/WalletUsedError.js +10 -0
- package/src/errors/index.d.ts +33 -0
- package/src/formatNumberText/formatNumberText.cjs +20 -0
- package/src/formatNumberText/formatNumberText.d.ts +5 -0
- package/src/formatNumberText/formatNumberText.js +16 -0
- package/src/formatNumberText/index.d.ts +1 -0
- package/src/get/get.cjs +24 -0
- package/src/get/get.d.ts +7 -0
- package/src/get/get.js +20 -0
- package/src/get/index.d.ts +1 -0
- package/src/getProvidersFromWindow.cjs +39 -0
- package/src/getProvidersFromWindow.d.ts +7 -0
- package/src/getProvidersFromWindow.js +35 -0
- package/src/getTLD/getTLD.cjs +12 -0
- package/src/getTLD/getTLD.d.ts +1 -0
- package/src/getTLD/getTLD.js +8 -0
- package/src/getTLD/index.d.ts +1 -0
- package/src/handleMobileWalletRedirect/handleMobileWalletRedirect.cjs +20 -0
- package/src/handleMobileWalletRedirect/handleMobileWalletRedirect.d.ts +4 -0
- package/src/handleMobileWalletRedirect/handleMobileWalletRedirect.js +16 -0
- package/src/handleMobileWalletRedirect/index.d.ts +1 -0
- package/src/hexToString/hexToString.cjs +32 -0
- package/src/hexToString/hexToString.d.ts +12 -0
- package/src/hexToString/hexToString.js +28 -0
- package/src/hexToString/index.d.ts +1 -0
- package/src/index.cjs +151 -0
- package/src/index.d.ts +32 -0
- package/src/index.js +66 -0
- package/src/isFunction/index.d.ts +1 -0
- package/src/isFunction/isFunction.cjs +9 -0
- package/src/isFunction/isFunction.d.ts +1 -0
- package/src/isFunction/isFunction.js +5 -0
- package/src/isHex/index.d.ts +1 -0
- package/src/isHex/isHex.cjs +20 -0
- package/src/isHex/isHex.d.ts +6 -0
- package/src/isHex/isHex.js +16 -0
- package/src/isLedgerAddressViaVerifiedCredentials.cjs +13 -0
- package/src/isLedgerAddressViaVerifiedCredentials.d.ts +2 -0
- package/src/isLedgerAddressViaVerifiedCredentials.js +9 -0
- package/src/isMobile.cjs +146 -0
- package/src/isMobile.d.ts +18 -0
- package/src/isMobile.js +133 -0
- package/src/last.cjs +22 -0
- package/src/last.d.ts +15 -0
- package/src/last.js +18 -0
- package/src/localStorageAsync.cjs +38 -0
- package/src/localStorageAsync.d.ts +3 -0
- package/src/localStorageAsync.js +32 -0
- package/src/logger/index.d.ts +1 -0
- package/src/logger/logger.cjs +10 -0
- package/src/logger/logger.d.ts +2 -0
- package/src/logger/logger.js +6 -0
- package/src/nativeMobileOauthStateParam.cjs +13 -0
- package/src/nativeMobileOauthStateParam.d.ts +14 -0
- package/src/nativeMobileOauthStateParam.js +9 -0
- package/src/parseChainId.cjs +8 -0
- package/src/parseChainId.d.ts +1 -0
- package/src/parseChainId.js +4 -0
- package/src/parseEvmNetworks.cjs +17 -0
- package/src/parseEvmNetworks.d.ts +2 -0
- package/src/parseEvmNetworks.js +13 -0
- package/src/pipe/index.d.ts +1 -0
- package/src/pipe/pipe.cjs +40 -0
- package/src/pipe/pipe.d.ts +27 -0
- package/src/pipe/pipe.js +36 -0
- package/src/retryableFn.cjs +73 -0
- package/src/retryableFn.d.ts +19 -0
- package/src/retryableFn.js +68 -0
- package/src/runSafe/index.d.ts +1 -0
- package/src/runSafe/runSafe.cjs +25 -0
- package/src/runSafe/runSafe.d.ts +8 -0
- package/src/runSafe/runSafe.js +21 -0
- package/src/services/FetchService/FetchService.cjs +29 -0
- package/src/services/FetchService/FetchService.d.ts +10 -0
- package/src/services/FetchService/FetchService.js +25 -0
- package/src/services/FetchService/index.d.ts +2 -0
- package/src/services/FetchService/types.d.ts +3 -0
- package/src/services/Oauth2Service/Oauth2Service.cjs +38 -0
- package/src/services/Oauth2Service/Oauth2Service.d.ts +34 -0
- package/src/services/Oauth2Service/Oauth2Service.js +34 -0
- package/src/services/Oauth2Service/createWindowOauth2Service/createWindowOauth2Service.cjs +192 -0
- package/src/services/Oauth2Service/createWindowOauth2Service/createWindowOauth2Service.d.ts +2 -0
- package/src/services/Oauth2Service/createWindowOauth2Service/createWindowOauth2Service.js +188 -0
- package/src/services/Oauth2Service/createWindowOauth2Service/index.d.ts +1 -0
- package/src/services/Oauth2Service/index.d.ts +2 -0
- package/src/services/PlatformService/PlatformService.cjs +40 -0
- package/src/services/PlatformService/PlatformService.d.ts +11 -0
- package/src/services/PlatformService/PlatformService.js +36 -0
- package/src/services/PlatformService/createBrowserPlatformService/createBrowserPlatformService.cjs +30 -0
- package/src/services/PlatformService/createBrowserPlatformService/createBrowserPlatformService.d.ts +2 -0
- package/src/services/PlatformService/createBrowserPlatformService/createBrowserPlatformService.js +26 -0
- package/src/services/PlatformService/createBrowserPlatformService/index.d.ts +1 -0
- package/src/services/PlatformService/index.d.ts +3 -0
- package/src/services/PlatformService/types.d.ts +25 -0
- package/src/sleep/index.d.ts +1 -0
- package/src/sleep/sleep.cjs +13 -0
- package/src/sleep/sleep.d.ts +11 -0
- package/src/sleep/sleep.js +9 -0
- package/src/template/index.d.ts +1 -0
- package/src/template/template.cjs +25 -0
- package/src/template/template.d.ts +18 -0
- package/src/template/template.js +21 -0
- package/src/trimEnd/index.d.ts +1 -0
- package/src/trimEnd/trimEnd.cjs +14 -0
- package/src/trimEnd/trimEnd.d.ts +1 -0
- package/src/trimEnd/trimEnd.js +10 -0
- package/src/uniq/index.d.ts +1 -0
- package/src/uniq/uniq.cjs +33 -0
- package/src/uniq/uniq.d.ts +17 -0
- package/src/uniq/uniq.js +29 -0
- package/src/wrapMethodWithCallback/index.d.ts +1 -0
- package/src/wrapMethodWithCallback/wrapMethodWithCallback.cjs +47 -0
- package/src/wrapMethodWithCallback/wrapMethodWithCallback.d.ts +36 -0
- 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,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,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,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,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,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,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,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,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,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,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,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;
|