@dynamic-labs/utils 4.91.2 → 4.91.4
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 +20 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +4 -4
- package/src/errors/AccessBlockedError.cjs +3 -0
- package/src/errors/AccessBlockedError.d.ts +1 -0
- package/src/errors/AccessBlockedError.js +3 -0
- package/src/errors/AccountExistsError.cjs +2 -2
- package/src/errors/AccountExistsError.d.ts +1 -1
- package/src/errors/AccountExistsError.js +2 -2
- package/src/errors/ChainalysisError.cjs +2 -2
- package/src/errors/ChainalysisError.d.ts +1 -1
- package/src/errors/ChainalysisError.js +2 -2
- package/src/errors/CookieInvalidError.cjs +1 -1
- package/src/errors/CookieInvalidError.js +1 -1
- package/src/errors/CustomError.cjs +4 -2
- package/src/errors/CustomError.d.ts +7 -4
- package/src/errors/CustomError.js +4 -2
- package/src/errors/EmailAlreadyExistsError.cjs +2 -2
- package/src/errors/EmailAlreadyExistsError.d.ts +1 -1
- package/src/errors/EmailAlreadyExistsError.js +2 -2
- package/src/errors/EmbeddedWalletException.cjs +2 -2
- package/src/errors/EmbeddedWalletException.d.ts +1 -1
- package/src/errors/EmbeddedWalletException.js +2 -2
- package/src/errors/GateBlockedError.cjs +1 -1
- package/src/errors/GateBlockedError.js +1 -1
- package/src/errors/GetAddressCancelledError.cjs +1 -1
- package/src/errors/GetAddressCancelledError.js +1 -1
- package/src/errors/InsufficientFundsError.cjs +1 -1
- package/src/errors/InsufficientFundsError.js +1 -1
- package/src/errors/InvalidEmbeddedWalletSessionKeyError.cjs +1 -1
- package/src/errors/InvalidEmbeddedWalletSessionKeyError.js +1 -1
- package/src/errors/InvalidPhoneNumberError.cjs +2 -2
- package/src/errors/InvalidPhoneNumberError.d.ts +1 -1
- package/src/errors/InvalidPhoneNumberError.js +2 -2
- package/src/errors/InvalidPrimaryWalletOrConnectorError.cjs +1 -1
- package/src/errors/InvalidPrimaryWalletOrConnectorError.js +1 -1
- package/src/errors/MetaMaskError.cjs +2 -2
- package/src/errors/MetaMaskError.d.ts +1 -1
- package/src/errors/MetaMaskError.js +2 -2
- package/src/errors/MissingEnvironmentIdError.cjs +1 -1
- package/src/errors/MissingEnvironmentIdError.js +1 -1
- package/src/errors/NoAccessError.cjs +2 -2
- package/src/errors/NoAccessError.d.ts +2 -1
- package/src/errors/NoAccessError.js +2 -2
- package/src/errors/NotSupportedError.cjs +3 -0
- package/src/errors/NotSupportedError.d.ts +1 -0
- package/src/errors/NotSupportedError.js +3 -0
- package/src/errors/RequestChannelNotHandledError.cjs +3 -0
- package/src/errors/RequestChannelNotHandledError.d.ts +1 -0
- package/src/errors/RequestChannelNotHandledError.js +3 -0
- package/src/errors/ResponseError.cjs +7 -1
- package/src/errors/ResponseError.js +7 -1
- package/src/errors/SandboxMaximumThresholdReachedError.cjs +1 -1
- package/src/errors/SandboxMaximumThresholdReachedError.js +1 -1
- package/src/errors/SdkErrorCode.cjs +24 -0
- package/src/errors/SdkErrorCode.d.ts +18 -0
- package/src/errors/SdkErrorCode.js +22 -0
- package/src/errors/SmsVerificationError.cjs +3 -0
- package/src/errors/SmsVerificationError.d.ts +1 -0
- package/src/errors/SmsVerificationError.js +3 -0
- package/src/errors/SocialAccountAlreadyExistsError.cjs +2 -2
- package/src/errors/SocialAccountAlreadyExistsError.d.ts +1 -1
- package/src/errors/SocialAccountAlreadyExistsError.js +2 -2
- package/src/errors/TooManyEmailVerificationsError.cjs +2 -2
- package/src/errors/TooManyEmailVerificationsError.d.ts +1 -1
- package/src/errors/TooManyEmailVerificationsError.js +2 -2
- package/src/errors/TransactionConfirmationTimeoutError.cjs +1 -1
- package/src/errors/TransactionConfirmationTimeoutError.js +1 -1
- package/src/errors/TransactionFailedError.cjs +1 -1
- package/src/errors/TransactionFailedError.js +1 -1
- package/src/errors/TransactionGasCannotBeSponsoredError.cjs +1 -1
- package/src/errors/TransactionGasCannotBeSponsoredError.js +1 -1
- package/src/errors/UserHasAccountWithEmailError.cjs +2 -2
- package/src/errors/UserHasAccountWithEmailError.d.ts +1 -1
- package/src/errors/UserHasAccountWithEmailError.js +2 -2
- package/src/errors/UserRejectedTransactionError.cjs +1 -1
- package/src/errors/UserRejectedTransactionError.js +1 -1
- package/src/errors/UsernameAlreadyExistsError.cjs +2 -2
- package/src/errors/UsernameAlreadyExistsError.d.ts +1 -1
- package/src/errors/UsernameAlreadyExistsError.js +2 -2
- package/src/errors/VerificationDataCollectionError.cjs +1 -1
- package/src/errors/VerificationDataCollectionError.js +1 -1
- package/src/errors/errorCodes.cjs +4 -1
- package/src/errors/errorCodes.d.ts +2 -1
- package/src/errors/errorCodes.js +4 -1
- package/src/errors/index.d.ts +2 -1
- package/src/index.cjs +8 -3
- package/src/index.js +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.91.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.91.3...v4.91.4) (2026-07-01)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* conditionally use /op/ route for AA transactions based on block explorer support ([#11628](https://github.com/dynamic-labs/dynamic-auth/issues/11628)) ([95822dc](https://github.com/dynamic-labs/dynamic-auth/commit/95822dc0edbcd739afe870f0b3881555fdb17eb6))
|
|
8
|
+
* require error codes in all SDK error classes ([#11761](https://github.com/dynamic-labs/dynamic-auth/issues/11761)) ([5744811](https://github.com/dynamic-labs/dynamic-auth/commit/5744811efdd1e415aaf51eec5b3300b323ec1347))
|
|
9
|
+
|
|
10
|
+
### [4.91.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.91.2...v4.91.3) (2026-06-30)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **bitcoin:** detect late-registering wallet-standard wallets (DYNT-1210) ([#11747](https://github.com/dynamic-labs/dynamic-auth/issues/11747)) ([17809f6](https://github.com/dynamic-labs/dynamic-auth/commit/17809f6e811fe101367cc31a2d899a8d0b0d107e))
|
|
16
|
+
* fetch onramp providers lazily instead of eagerly on mount ([#11767](https://github.com/dynamic-labs/dynamic-auth/issues/11767)) ([3ee6708](https://github.com/dynamic-labs/dynamic-auth/commit/3ee67087142ae1942f865e0ab37b7108700b3327))
|
|
17
|
+
* **iframe-setup:** sync parent URL to iframe on pushState/replaceState ([#11751](https://github.com/dynamic-labs/dynamic-auth/issues/11751)) ([c8be3af](https://github.com/dynamic-labs/dynamic-auth/commit/c8be3afc301f77b349f23398bed940ce40f93b73))
|
|
18
|
+
* **nonce:** fetch nonce on demand when missing before wallet verification ([#11753](https://github.com/dynamic-labs/dynamic-auth/issues/11753)) ([4f01a21](https://github.com/dynamic-labs/dynamic-auth/commit/4f01a21b6081c852f32868c8a5e04d70aaf280a2)), closes [#1](https://github.com/dynamic-labs/dynamic-auth/issues/1)
|
|
19
|
+
* **react-native-extension:** arm loading timer before setUrl to cover pre-onLoadStart gap ([#11764](https://github.com/dynamic-labs/dynamic-auth/issues/11764)) ([31f2015](https://github.com/dynamic-labs/dynamic-auth/commit/31f20151a4b59279f9c133b723e50de771b06436))
|
|
20
|
+
* **webview-controller:** unwrap ZeroDev smart wallet for native gasless ([#11758](https://github.com/dynamic-labs/dynamic-auth/issues/11758)) ([989714e](https://github.com/dynamic-labs/dynamic-auth/commit/989714e414556868c8e0c54401aac1ed7354331b))
|
|
21
|
+
|
|
2
22
|
### [4.91.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.91.1...v4.91.2) (2026-06-26)
|
|
3
23
|
|
|
4
24
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/utils",
|
|
3
|
-
"version": "4.91.
|
|
3
|
+
"version": "4.91.4",
|
|
4
4
|
"description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@dynamic-labs/sdk-api-core": "0.0.1046",
|
|
22
22
|
"tldts": "6.0.16",
|
|
23
|
-
"@dynamic-labs/assert-package-version": "4.91.
|
|
24
|
-
"@dynamic-labs/logger": "4.91.
|
|
25
|
-
"@dynamic-labs/types": "4.91.
|
|
23
|
+
"@dynamic-labs/assert-package-version": "4.91.4",
|
|
24
|
+
"@dynamic-labs/logger": "4.91.4",
|
|
25
|
+
"@dynamic-labs/types": "4.91.4",
|
|
26
26
|
"buffer": "6.0.3",
|
|
27
27
|
"eventemitter3": "5.0.1"
|
|
28
28
|
},
|
|
@@ -6,6 +6,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var DynamicError = require('./DynamicError.cjs');
|
|
7
7
|
|
|
8
8
|
class AccessBlockedError extends DynamicError.DynamicError {
|
|
9
|
+
constructor(message = 'Access blocked', code = 'access_blocked') {
|
|
10
|
+
super(message, code);
|
|
11
|
+
}
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
exports.AccessBlockedError = AccessBlockedError;
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var DynamicError = require('./DynamicError.cjs');
|
|
7
7
|
|
|
8
8
|
class AccountExistsError extends DynamicError.DynamicError {
|
|
9
|
-
constructor(errorMessage, errorPayload) {
|
|
10
|
-
super(errorMessage);
|
|
9
|
+
constructor(errorMessage, errorPayload, code = 'account_exists') {
|
|
10
|
+
super(errorMessage, code);
|
|
11
11
|
this.errorMessage = errorMessage;
|
|
12
12
|
this.errorPayload = errorPayload;
|
|
13
13
|
}
|
|
@@ -9,6 +9,6 @@ type AccountExistsPayload = {
|
|
|
9
9
|
export declare class AccountExistsError extends DynamicError {
|
|
10
10
|
errorMessage: string;
|
|
11
11
|
errorPayload: AccountExistsPayload;
|
|
12
|
-
constructor(errorMessage: string, errorPayload: AccountExistsPayload);
|
|
12
|
+
constructor(errorMessage: string, errorPayload: AccountExistsPayload, code?: string);
|
|
13
13
|
}
|
|
14
14
|
export {};
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { DynamicError } from './DynamicError.js';
|
|
3
3
|
|
|
4
4
|
class AccountExistsError extends DynamicError {
|
|
5
|
-
constructor(errorMessage, errorPayload) {
|
|
6
|
-
super(errorMessage);
|
|
5
|
+
constructor(errorMessage, errorPayload, code = 'account_exists') {
|
|
6
|
+
super(errorMessage, code);
|
|
7
7
|
this.errorMessage = errorMessage;
|
|
8
8
|
this.errorPayload = errorPayload;
|
|
9
9
|
}
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var DynamicError = require('./DynamicError.cjs');
|
|
7
7
|
|
|
8
8
|
class ChainalysisError extends DynamicError.DynamicError {
|
|
9
|
-
constructor(walletPublicKey) {
|
|
10
|
-
super('This address is not approved for access');
|
|
9
|
+
constructor(walletPublicKey, code = 'chainalysis_blocked') {
|
|
10
|
+
super('This address is not approved for access', code);
|
|
11
11
|
this.walletPublicKey = walletPublicKey;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { DynamicError } from './DynamicError.js';
|
|
3
3
|
|
|
4
4
|
class ChainalysisError extends DynamicError {
|
|
5
|
-
constructor(walletPublicKey) {
|
|
6
|
-
super('This address is not approved for access');
|
|
5
|
+
constructor(walletPublicKey, code = 'chainalysis_blocked') {
|
|
6
|
+
super('This address is not approved for access', code);
|
|
7
7
|
this.walletPublicKey = walletPublicKey;
|
|
8
8
|
}
|
|
9
9
|
}
|
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Extend this class to allow usage of instanceof
|
|
7
|
+
* Extend this class to allow usage of instanceof.
|
|
8
|
+
*
|
|
9
|
+
* Every error must carry a machine-readable `code` so callers can branch on
|
|
10
|
+
* it without parsing human-readable messages.
|
|
8
11
|
*/
|
|
9
12
|
class CustomError extends Error {
|
|
10
13
|
constructor(message, code) {
|
|
11
14
|
super(message);
|
|
12
|
-
this.code = undefined;
|
|
13
15
|
this.code = code;
|
|
14
16
|
Object.setPrototypeOf(this, this.constructor.prototype);
|
|
15
17
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { ErrorCode } from './ErrorCode';
|
|
2
2
|
/**
|
|
3
|
-
* Extend this class to allow usage of instanceof
|
|
3
|
+
* Extend this class to allow usage of instanceof.
|
|
4
|
+
*
|
|
5
|
+
* Every error must carry a machine-readable `code` so callers can branch on
|
|
6
|
+
* it without parsing human-readable messages.
|
|
4
7
|
*/
|
|
5
8
|
export declare class CustomError extends Error {
|
|
6
|
-
code: ErrorCode | string
|
|
7
|
-
constructor(message
|
|
9
|
+
code: ErrorCode | string;
|
|
10
|
+
constructor(message: string, code: ErrorCode | string);
|
|
8
11
|
toJSON(): {
|
|
9
|
-
code: string | ErrorCode
|
|
12
|
+
code: string | ErrorCode;
|
|
10
13
|
error: string;
|
|
11
14
|
};
|
|
12
15
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
/**
|
|
3
|
-
* Extend this class to allow usage of instanceof
|
|
3
|
+
* Extend this class to allow usage of instanceof.
|
|
4
|
+
*
|
|
5
|
+
* Every error must carry a machine-readable `code` so callers can branch on
|
|
6
|
+
* it without parsing human-readable messages.
|
|
4
7
|
*/
|
|
5
8
|
class CustomError extends Error {
|
|
6
9
|
constructor(message, code) {
|
|
7
10
|
super(message);
|
|
8
|
-
this.code = undefined;
|
|
9
11
|
this.code = code;
|
|
10
12
|
Object.setPrototypeOf(this, this.constructor.prototype);
|
|
11
13
|
}
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var DynamicError = require('./DynamicError.cjs');
|
|
7
7
|
|
|
8
8
|
class EmailAlreadyExistsError extends DynamicError.DynamicError {
|
|
9
|
-
constructor() {
|
|
10
|
-
super(
|
|
9
|
+
constructor(message = 'Email already exists', code = 'email_already_exists') {
|
|
10
|
+
super(message, code);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { DynamicError } from './DynamicError.js';
|
|
3
3
|
|
|
4
4
|
class EmailAlreadyExistsError extends DynamicError {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(
|
|
5
|
+
constructor(message = 'Email already exists', code = 'email_already_exists') {
|
|
6
|
+
super(message, code);
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var DynamicError = require('./DynamicError.cjs');
|
|
7
7
|
|
|
8
8
|
class EmbeddedWalletException extends DynamicError.DynamicError {
|
|
9
|
-
constructor(message) {
|
|
10
|
-
super(message);
|
|
9
|
+
constructor(message, code = 'embedded_wallet_error') {
|
|
10
|
+
super(message, code);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -7,7 +7,7 @@ var DynamicError = require('./DynamicError.cjs');
|
|
|
7
7
|
|
|
8
8
|
class GateBlockedError extends DynamicError.DynamicError {
|
|
9
9
|
constructor(walletPublicKey) {
|
|
10
|
-
super('This address is blocked by the gate');
|
|
10
|
+
super('This address is blocked by the gate', 'gate_blocked');
|
|
11
11
|
this.walletPublicKey = walletPublicKey;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -3,7 +3,7 @@ import { DynamicError } from './DynamicError.js';
|
|
|
3
3
|
|
|
4
4
|
class GateBlockedError extends DynamicError {
|
|
5
5
|
constructor(walletPublicKey) {
|
|
6
|
-
super('This address is blocked by the gate');
|
|
6
|
+
super('This address is blocked by the gate', 'gate_blocked');
|
|
7
7
|
this.walletPublicKey = walletPublicKey;
|
|
8
8
|
}
|
|
9
9
|
}
|
|
@@ -15,7 +15,7 @@ var CustomError = require('./CustomError.cjs');
|
|
|
15
15
|
*/
|
|
16
16
|
class GetAddressCancelledError extends CustomError.CustomError {
|
|
17
17
|
constructor() {
|
|
18
|
-
super('Get address call was cancelled');
|
|
18
|
+
super('Get address call was cancelled', 'get_address_cancelled');
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -7,7 +7,7 @@ var DynamicError = require('./DynamicError.cjs');
|
|
|
7
7
|
|
|
8
8
|
class InsufficientFundsError extends DynamicError.DynamicError {
|
|
9
9
|
constructor() {
|
|
10
|
-
super(InsufficientFundsError.message);
|
|
10
|
+
super(InsufficientFundsError.message, 'insufficient_funds');
|
|
11
11
|
}
|
|
12
12
|
static isInstance(err) {
|
|
13
13
|
var _a;
|
|
@@ -3,7 +3,7 @@ import { DynamicError } from './DynamicError.js';
|
|
|
3
3
|
|
|
4
4
|
class InsufficientFundsError extends DynamicError {
|
|
5
5
|
constructor() {
|
|
6
|
-
super(InsufficientFundsError.message);
|
|
6
|
+
super(InsufficientFundsError.message, 'insufficient_funds');
|
|
7
7
|
}
|
|
8
8
|
static isInstance(err) {
|
|
9
9
|
var _a;
|
|
@@ -7,7 +7,7 @@ var DynamicError = require('./DynamicError.cjs');
|
|
|
7
7
|
|
|
8
8
|
class InvalidEmbeddedWalletSessionKeyError extends DynamicError.DynamicError {
|
|
9
9
|
constructor(error) {
|
|
10
|
-
super(error !== null && error !== void 0 ? error : 'Invalid embedded wallet session key.');
|
|
10
|
+
super(error !== null && error !== void 0 ? error : 'Invalid embedded wallet session key.', 'invalid_embedded_wallet_session_key');
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -3,7 +3,7 @@ import { DynamicError } from './DynamicError.js';
|
|
|
3
3
|
|
|
4
4
|
class InvalidEmbeddedWalletSessionKeyError extends DynamicError {
|
|
5
5
|
constructor(error) {
|
|
6
|
-
super(error !== null && error !== void 0 ? error : 'Invalid embedded wallet session key.');
|
|
6
|
+
super(error !== null && error !== void 0 ? error : 'Invalid embedded wallet session key.', 'invalid_embedded_wallet_session_key');
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var DynamicError = require('./DynamicError.cjs');
|
|
7
7
|
|
|
8
8
|
class InvalidPhoneNumberError extends DynamicError.DynamicError {
|
|
9
|
-
constructor(error) {
|
|
10
|
-
super(error !== null && error !== void 0 ? error : 'Invalid phone number.');
|
|
9
|
+
constructor(error, code = 'invalid_phone') {
|
|
10
|
+
super(error !== null && error !== void 0 ? error : 'Invalid phone number.', code);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { DynamicError } from './DynamicError.js';
|
|
3
3
|
|
|
4
4
|
class InvalidPhoneNumberError extends DynamicError {
|
|
5
|
-
constructor(error) {
|
|
6
|
-
super(error !== null && error !== void 0 ? error : 'Invalid phone number.');
|
|
5
|
+
constructor(error, code = 'invalid_phone') {
|
|
6
|
+
super(error !== null && error !== void 0 ? error : 'Invalid phone number.', code);
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var DynamicError = require('./DynamicError.cjs');
|
|
7
7
|
|
|
8
8
|
class InvalidPrimaryWalletOrConnectorError extends DynamicError.DynamicError {
|
|
9
|
-
constructor(code) {
|
|
9
|
+
constructor(code = 'invalid_primary_wallet_or_connector') {
|
|
10
10
|
super('Primary wallet is not properly set or the wallet connector is missing from DynamicContextProvider settings.', code);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { DynamicError } from './DynamicError.js';
|
|
3
3
|
|
|
4
4
|
class InvalidPrimaryWalletOrConnectorError extends DynamicError {
|
|
5
|
-
constructor(code) {
|
|
5
|
+
constructor(code = 'invalid_primary_wallet_or_connector') {
|
|
6
6
|
super('Primary wallet is not properly set or the wallet connector is missing from DynamicContextProvider settings.', code);
|
|
7
7
|
}
|
|
8
8
|
}
|
|
@@ -21,11 +21,11 @@ class MetaMaskError extends CustomError.CustomError {
|
|
|
21
21
|
* @returns A new [MetaMaskError]
|
|
22
22
|
*/
|
|
23
23
|
static fromError(error) {
|
|
24
|
-
var _a, _b;
|
|
24
|
+
var _a, _b, _c;
|
|
25
25
|
if (error instanceof Object) {
|
|
26
26
|
const errorObject = error;
|
|
27
27
|
const dynamicErrorCode = (_b = metaMaskErrorMap[(_a = errorObject.code) !== null && _a !== void 0 ? _a : '']) !== null && _b !== void 0 ? _b : ErrorCode.ErrorCode.DEFAULT;
|
|
28
|
-
return new MetaMaskError(errorObject.message, dynamicErrorCode);
|
|
28
|
+
return new MetaMaskError((_c = errorObject.message) !== null && _c !== void 0 ? _c : 'MetaMask error', dynamicErrorCode);
|
|
29
29
|
}
|
|
30
30
|
return new MetaMaskError(String(error), ErrorCode.ErrorCode.DEFAULT);
|
|
31
31
|
}
|
|
@@ -3,7 +3,7 @@ import { ErrorCode } from './ErrorCode';
|
|
|
3
3
|
/** Mapping of metamask error codes to dynamic [ErrorCode]s */
|
|
4
4
|
export declare const metaMaskErrorMap: Record<string, ErrorCode>;
|
|
5
5
|
export declare class MetaMaskError extends CustomError {
|
|
6
|
-
constructor(message
|
|
6
|
+
constructor(message: string, code: ErrorCode);
|
|
7
7
|
/**
|
|
8
8
|
* Creates a [MetaMaskError] from an unknown error (thrown by MetaMask)
|
|
9
9
|
*
|
|
@@ -17,11 +17,11 @@ class MetaMaskError extends CustomError {
|
|
|
17
17
|
* @returns A new [MetaMaskError]
|
|
18
18
|
*/
|
|
19
19
|
static fromError(error) {
|
|
20
|
-
var _a, _b;
|
|
20
|
+
var _a, _b, _c;
|
|
21
21
|
if (error instanceof Object) {
|
|
22
22
|
const errorObject = error;
|
|
23
23
|
const dynamicErrorCode = (_b = metaMaskErrorMap[(_a = errorObject.code) !== null && _a !== void 0 ? _a : '']) !== null && _b !== void 0 ? _b : ErrorCode.DEFAULT;
|
|
24
|
-
return new MetaMaskError(errorObject.message, dynamicErrorCode);
|
|
24
|
+
return new MetaMaskError((_c = errorObject.message) !== null && _c !== void 0 ? _c : 'MetaMask error', dynamicErrorCode);
|
|
25
25
|
}
|
|
26
26
|
return new MetaMaskError(String(error), ErrorCode.DEFAULT);
|
|
27
27
|
}
|
|
@@ -7,7 +7,7 @@ var DynamicError = require('./DynamicError.cjs');
|
|
|
7
7
|
|
|
8
8
|
class MissingEnvironmentIdError extends DynamicError.DynamicError {
|
|
9
9
|
constructor() {
|
|
10
|
-
super('You are missing the environmentId field in yours DynamicContextProvider settings prop');
|
|
10
|
+
super('You are missing the environmentId field in yours DynamicContextProvider settings prop', 'missing_environment_id');
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -3,7 +3,7 @@ import { DynamicError } from './DynamicError.js';
|
|
|
3
3
|
|
|
4
4
|
class MissingEnvironmentIdError extends DynamicError {
|
|
5
5
|
constructor() {
|
|
6
|
-
super('You are missing the environmentId field in yours DynamicContextProvider settings prop');
|
|
6
|
+
super('You are missing the environmentId field in yours DynamicContextProvider settings prop', 'missing_environment_id');
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var DynamicError = require('./DynamicError.cjs');
|
|
7
7
|
|
|
8
8
|
class NoAccessError extends DynamicError.DynamicError {
|
|
9
|
-
constructor({ walletPublicKey, email, phoneNumber, socialProvider, socialUsername, }) {
|
|
10
|
-
super('User does not have access');
|
|
9
|
+
constructor({ walletPublicKey, email, phoneNumber, socialProvider, socialUsername, code = 'no_access', }) {
|
|
10
|
+
super('User does not have access', code);
|
|
11
11
|
this.email = email;
|
|
12
12
|
this.walletPublicKey = walletPublicKey;
|
|
13
13
|
this.phoneNumber = phoneNumber;
|
|
@@ -5,11 +5,12 @@ export declare class NoAccessError extends DynamicError {
|
|
|
5
5
|
phoneNumber?: string;
|
|
6
6
|
socialProvider?: string;
|
|
7
7
|
socialUsername?: string;
|
|
8
|
-
constructor({ walletPublicKey, email, phoneNumber, socialProvider, socialUsername, }: {
|
|
8
|
+
constructor({ walletPublicKey, email, phoneNumber, socialProvider, socialUsername, code, }: {
|
|
9
9
|
email?: string;
|
|
10
10
|
walletPublicKey?: string;
|
|
11
11
|
phoneNumber?: string;
|
|
12
12
|
socialProvider?: string;
|
|
13
13
|
socialUsername?: string;
|
|
14
|
+
code?: string;
|
|
14
15
|
});
|
|
15
16
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { DynamicError } from './DynamicError.js';
|
|
3
3
|
|
|
4
4
|
class NoAccessError extends DynamicError {
|
|
5
|
-
constructor({ walletPublicKey, email, phoneNumber, socialProvider, socialUsername, }) {
|
|
6
|
-
super('User does not have access');
|
|
5
|
+
constructor({ walletPublicKey, email, phoneNumber, socialProvider, socialUsername, code = 'no_access', }) {
|
|
6
|
+
super('User does not have access', code);
|
|
7
7
|
this.email = email;
|
|
8
8
|
this.walletPublicKey = walletPublicKey;
|
|
9
9
|
this.phoneNumber = phoneNumber;
|
|
@@ -6,6 +6,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var DynamicError = require('./DynamicError.cjs');
|
|
7
7
|
|
|
8
8
|
class NotSupportedError extends DynamicError.DynamicError {
|
|
9
|
+
constructor(message = 'Not supported', code = 'not_supported') {
|
|
10
|
+
super(message, code);
|
|
11
|
+
}
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
exports.NotSupportedError = NotSupportedError;
|
|
@@ -6,6 +6,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var DynamicError = require('./DynamicError.cjs');
|
|
7
7
|
|
|
8
8
|
class RequestChannelNotHandledError extends DynamicError.DynamicError {
|
|
9
|
+
constructor(message = 'Request channel not handled', code = 'request_channel_not_handled') {
|
|
10
|
+
super(message, code);
|
|
11
|
+
}
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
exports.RequestChannelNotHandledError = RequestChannelNotHandledError;
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
import { DynamicError } from './DynamicError.js';
|
|
3
3
|
|
|
4
4
|
class RequestChannelNotHandledError extends DynamicError {
|
|
5
|
+
constructor(message = 'Request channel not handled', code = 'request_channel_not_handled') {
|
|
6
|
+
super(message, code);
|
|
7
|
+
}
|
|
5
8
|
}
|
|
6
9
|
|
|
7
10
|
export { RequestChannelNotHandledError };
|
|
@@ -18,7 +18,13 @@ class ResponseError extends CustomError.CustomError {
|
|
|
18
18
|
|
|
19
19
|
Json data:${jsonData ? '\n' + JSON.stringify(jsonData, null, 2) : ' No data'}
|
|
20
20
|
`.trim();
|
|
21
|
-
|
|
21
|
+
const jsonCode = jsonData &&
|
|
22
|
+
typeof jsonData === 'object' &&
|
|
23
|
+
'code' in jsonData &&
|
|
24
|
+
typeof jsonData['code'] === 'string'
|
|
25
|
+
? jsonData['code']
|
|
26
|
+
: undefined;
|
|
27
|
+
super(messageError, jsonCode !== null && jsonCode !== void 0 ? jsonCode : `http_${cause.status}`);
|
|
22
28
|
this.jsonData = jsonData;
|
|
23
29
|
this.response = cause;
|
|
24
30
|
this.cause = cause;
|
|
@@ -14,7 +14,13 @@ class ResponseError extends CustomError {
|
|
|
14
14
|
|
|
15
15
|
Json data:${jsonData ? '\n' + JSON.stringify(jsonData, null, 2) : ' No data'}
|
|
16
16
|
`.trim();
|
|
17
|
-
|
|
17
|
+
const jsonCode = jsonData &&
|
|
18
|
+
typeof jsonData === 'object' &&
|
|
19
|
+
'code' in jsonData &&
|
|
20
|
+
typeof jsonData['code'] === 'string'
|
|
21
|
+
? jsonData['code']
|
|
22
|
+
: undefined;
|
|
23
|
+
super(messageError, jsonCode !== null && jsonCode !== void 0 ? jsonCode : `http_${cause.status}`);
|
|
18
24
|
this.jsonData = jsonData;
|
|
19
25
|
this.response = cause;
|
|
20
26
|
this.cause = cause;
|
|
@@ -7,7 +7,7 @@ var DynamicError = require('./DynamicError.cjs');
|
|
|
7
7
|
|
|
8
8
|
class SandboxMaximumThresholdReachedError extends DynamicError.DynamicError {
|
|
9
9
|
constructor(errorMessage) {
|
|
10
|
-
super(errorMessage);
|
|
10
|
+
super(errorMessage, 'sandbox_maximum_threshold_reached');
|
|
11
11
|
this.errorMessage = errorMessage;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -3,7 +3,7 @@ import { DynamicError } from './DynamicError.js';
|
|
|
3
3
|
|
|
4
4
|
class SandboxMaximumThresholdReachedError extends DynamicError {
|
|
5
5
|
constructor(errorMessage) {
|
|
6
|
-
super(errorMessage);
|
|
6
|
+
super(errorMessage, 'sandbox_maximum_threshold_reached');
|
|
7
7
|
this.errorMessage = errorMessage;
|
|
8
8
|
}
|
|
9
9
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* String error codes actively used by the SDK for control flow,
|
|
8
|
+
* type annotations, and error-message mapping.
|
|
9
|
+
*
|
|
10
|
+
* Only codes that the SDK checks or propagates belong here.
|
|
11
|
+
* API-only response codes that are caught and re-thrown as specific
|
|
12
|
+
* Error sub-classes should stay as plain string literals.
|
|
13
|
+
*/
|
|
14
|
+
exports.SdkErrorCode = void 0;
|
|
15
|
+
(function (SdkErrorCode) {
|
|
16
|
+
SdkErrorCode["CONNECTION_REJECTED"] = "connection_rejected";
|
|
17
|
+
SdkErrorCode["INVALID_EMAIL_VERIFICATION"] = "invalid_email_verification";
|
|
18
|
+
SdkErrorCode["MISSING_NONCE"] = "missing-nonce";
|
|
19
|
+
SdkErrorCode["TOO_MANY_EMAIL_VERIFICATION_ATTEMPTS"] = "too_many_email_verification_attempts";
|
|
20
|
+
SdkErrorCode["UNKNOWN_ERROR"] = "unknown_error";
|
|
21
|
+
SdkErrorCode["USER_CANCELLED"] = "user-cancelled";
|
|
22
|
+
SdkErrorCode["USER_CANCELLED_OAUTH"] = "user_cancelled";
|
|
23
|
+
SdkErrorCode["WALLET_NOT_DEPLOYED"] = "wallet_not_deployed";
|
|
24
|
+
})(exports.SdkErrorCode || (exports.SdkErrorCode = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* String error codes actively used by the SDK for control flow,
|
|
3
|
+
* type annotations, and error-message mapping.
|
|
4
|
+
*
|
|
5
|
+
* Only codes that the SDK checks or propagates belong here.
|
|
6
|
+
* API-only response codes that are caught and re-thrown as specific
|
|
7
|
+
* Error sub-classes should stay as plain string literals.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum SdkErrorCode {
|
|
10
|
+
CONNECTION_REJECTED = "connection_rejected",
|
|
11
|
+
INVALID_EMAIL_VERIFICATION = "invalid_email_verification",
|
|
12
|
+
MISSING_NONCE = "missing-nonce",
|
|
13
|
+
TOO_MANY_EMAIL_VERIFICATION_ATTEMPTS = "too_many_email_verification_attempts",
|
|
14
|
+
UNKNOWN_ERROR = "unknown_error",
|
|
15
|
+
USER_CANCELLED = "user-cancelled",
|
|
16
|
+
USER_CANCELLED_OAUTH = "user_cancelled",
|
|
17
|
+
WALLET_NOT_DEPLOYED = "wallet_not_deployed"
|
|
18
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
/**
|
|
3
|
+
* String error codes actively used by the SDK for control flow,
|
|
4
|
+
* type annotations, and error-message mapping.
|
|
5
|
+
*
|
|
6
|
+
* Only codes that the SDK checks or propagates belong here.
|
|
7
|
+
* API-only response codes that are caught and re-thrown as specific
|
|
8
|
+
* Error sub-classes should stay as plain string literals.
|
|
9
|
+
*/
|
|
10
|
+
var SdkErrorCode;
|
|
11
|
+
(function (SdkErrorCode) {
|
|
12
|
+
SdkErrorCode["CONNECTION_REJECTED"] = "connection_rejected";
|
|
13
|
+
SdkErrorCode["INVALID_EMAIL_VERIFICATION"] = "invalid_email_verification";
|
|
14
|
+
SdkErrorCode["MISSING_NONCE"] = "missing-nonce";
|
|
15
|
+
SdkErrorCode["TOO_MANY_EMAIL_VERIFICATION_ATTEMPTS"] = "too_many_email_verification_attempts";
|
|
16
|
+
SdkErrorCode["UNKNOWN_ERROR"] = "unknown_error";
|
|
17
|
+
SdkErrorCode["USER_CANCELLED"] = "user-cancelled";
|
|
18
|
+
SdkErrorCode["USER_CANCELLED_OAUTH"] = "user_cancelled";
|
|
19
|
+
SdkErrorCode["WALLET_NOT_DEPLOYED"] = "wallet_not_deployed";
|
|
20
|
+
})(SdkErrorCode || (SdkErrorCode = {}));
|
|
21
|
+
|
|
22
|
+
export { SdkErrorCode };
|
|
@@ -6,6 +6,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var DynamicError = require('./DynamicError.cjs');
|
|
7
7
|
|
|
8
8
|
class SmsVerificationError extends DynamicError.DynamicError {
|
|
9
|
+
constructor(message, code) {
|
|
10
|
+
super(message, code);
|
|
11
|
+
}
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
exports.SmsVerificationError = SmsVerificationError;
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var DynamicError = require('./DynamicError.cjs');
|
|
7
7
|
|
|
8
8
|
class SocialAccountAlreadyExistsError extends DynamicError.DynamicError {
|
|
9
|
-
constructor() {
|
|
10
|
-
super(
|
|
9
|
+
constructor(message = 'Social account already exists', code = 'social_account_already_exists') {
|
|
10
|
+
super(message, code);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { DynamicError } from './DynamicError.js';
|
|
3
3
|
|
|
4
4
|
class SocialAccountAlreadyExistsError extends DynamicError {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(
|
|
5
|
+
constructor(message = 'Social account already exists', code = 'social_account_already_exists') {
|
|
6
|
+
super(message, code);
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var DynamicError = require('./DynamicError.cjs');
|
|
7
7
|
|
|
8
8
|
class TooManyEmailVerificationsError extends DynamicError.DynamicError {
|
|
9
|
-
constructor() {
|
|
10
|
-
super(
|
|
9
|
+
constructor(message = 'Too many email verification attempts.', code = 'too_many_verification_attempts') {
|
|
10
|
+
super(message, code);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { DynamicError } from './DynamicError.js';
|
|
3
3
|
|
|
4
4
|
class TooManyEmailVerificationsError extends DynamicError {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(
|
|
5
|
+
constructor(message = 'Too many email verification attempts.', code = 'too_many_verification_attempts') {
|
|
6
|
+
super(message, code);
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -7,7 +7,7 @@ var DynamicError = require('./DynamicError.cjs');
|
|
|
7
7
|
|
|
8
8
|
class TransactionConfirmationTimeoutError extends DynamicError.DynamicError {
|
|
9
9
|
constructor(transactionSignature) {
|
|
10
|
-
super(`Transaction confirmation timed out. Signature: ${transactionSignature}
|
|
10
|
+
super(`Transaction confirmation timed out. Signature: ${transactionSignature}`, 'transaction_confirmation_timeout');
|
|
11
11
|
this.transactionSignature = transactionSignature;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -3,7 +3,7 @@ import { DynamicError } from './DynamicError.js';
|
|
|
3
3
|
|
|
4
4
|
class TransactionConfirmationTimeoutError extends DynamicError {
|
|
5
5
|
constructor(transactionSignature) {
|
|
6
|
-
super(`Transaction confirmation timed out. Signature: ${transactionSignature}
|
|
6
|
+
super(`Transaction confirmation timed out. Signature: ${transactionSignature}`, 'transaction_confirmation_timeout');
|
|
7
7
|
this.transactionSignature = transactionSignature;
|
|
8
8
|
}
|
|
9
9
|
}
|
|
@@ -7,7 +7,7 @@ var DynamicError = require('./DynamicError.cjs');
|
|
|
7
7
|
|
|
8
8
|
class TransactionFailedError extends DynamicError.DynamicError {
|
|
9
9
|
constructor(chainError) {
|
|
10
|
-
super(`Transaction failed: ${JSON.stringify(chainError)}
|
|
10
|
+
super(`Transaction failed: ${JSON.stringify(chainError)}`, 'transaction_failed');
|
|
11
11
|
this.chainError = chainError;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -3,7 +3,7 @@ import { DynamicError } from './DynamicError.js';
|
|
|
3
3
|
|
|
4
4
|
class TransactionFailedError extends DynamicError {
|
|
5
5
|
constructor(chainError) {
|
|
6
|
-
super(`Transaction failed: ${JSON.stringify(chainError)}
|
|
6
|
+
super(`Transaction failed: ${JSON.stringify(chainError)}`, 'transaction_failed');
|
|
7
7
|
this.chainError = chainError;
|
|
8
8
|
}
|
|
9
9
|
}
|
|
@@ -7,7 +7,7 @@ var DynamicError = require('./DynamicError.cjs');
|
|
|
7
7
|
|
|
8
8
|
class TransactionGasCannotBeSponsoredError extends DynamicError.DynamicError {
|
|
9
9
|
constructor() {
|
|
10
|
-
super(TransactionGasCannotBeSponsoredError.message);
|
|
10
|
+
super(TransactionGasCannotBeSponsoredError.message, 'transaction_gas_cannot_be_sponsored');
|
|
11
11
|
}
|
|
12
12
|
static isInstance(err) {
|
|
13
13
|
var _a;
|
|
@@ -3,7 +3,7 @@ import { DynamicError } from './DynamicError.js';
|
|
|
3
3
|
|
|
4
4
|
class TransactionGasCannotBeSponsoredError extends DynamicError {
|
|
5
5
|
constructor() {
|
|
6
|
-
super(TransactionGasCannotBeSponsoredError.message);
|
|
6
|
+
super(TransactionGasCannotBeSponsoredError.message, 'transaction_gas_cannot_be_sponsored');
|
|
7
7
|
}
|
|
8
8
|
static isInstance(err) {
|
|
9
9
|
var _a;
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var DynamicError = require('./DynamicError.cjs');
|
|
7
7
|
|
|
8
8
|
class UserHasAccountWithEmailError extends DynamicError.DynamicError {
|
|
9
|
-
constructor(error) {
|
|
10
|
-
super(error);
|
|
9
|
+
constructor(error, code = 'user_has_account_with_email') {
|
|
10
|
+
super(error, code);
|
|
11
11
|
this.error = error;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { DynamicError } from './DynamicError.js';
|
|
3
3
|
|
|
4
4
|
class UserHasAccountWithEmailError extends DynamicError {
|
|
5
|
-
constructor(error) {
|
|
6
|
-
super(error);
|
|
5
|
+
constructor(error, code = 'user_has_account_with_email') {
|
|
6
|
+
super(error, code);
|
|
7
7
|
this.error = error;
|
|
8
8
|
}
|
|
9
9
|
}
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var DynamicError = require('./DynamicError.cjs');
|
|
7
7
|
|
|
8
8
|
class UsernameAlreadyExistsError extends DynamicError.DynamicError {
|
|
9
|
-
constructor() {
|
|
10
|
-
super(
|
|
9
|
+
constructor(message = 'Username already exists', code = 'username_already_exists') {
|
|
10
|
+
super(message, code);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { DynamicError } from './DynamicError.js';
|
|
3
3
|
|
|
4
4
|
class UsernameAlreadyExistsError extends DynamicError {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(
|
|
5
|
+
constructor(message = 'Username already exists', code = 'username_already_exists') {
|
|
6
|
+
super(message, code);
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -8,7 +8,7 @@ var DynamicError = require('./DynamicError.cjs');
|
|
|
8
8
|
/** Used when trying to get necessary data for verification OTPs */
|
|
9
9
|
class VerificationDataCollectionError extends DynamicError.DynamicError {
|
|
10
10
|
constructor(message) {
|
|
11
|
-
super('Failed to get verification data: ' + message);
|
|
11
|
+
super('Failed to get verification data: ' + message, 'verification_data_collection_error');
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -4,7 +4,7 @@ import { DynamicError } from './DynamicError.js';
|
|
|
4
4
|
/** Used when trying to get necessary data for verification OTPs */
|
|
5
5
|
class VerificationDataCollectionError extends DynamicError {
|
|
6
6
|
constructor(message) {
|
|
7
|
-
super('Failed to get verification data: ' + message);
|
|
7
|
+
super('Failed to get verification data: ' + message, 'verification_data_collection_error');
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
+
var SdkErrorCode = require('./SdkErrorCode.cjs');
|
|
7
|
+
|
|
6
8
|
const RATE_LIMIT_ERROR_CODE = 'rate_limit_error';
|
|
7
|
-
|
|
9
|
+
/** @deprecated Use SdkErrorCode.UNKNOWN_ERROR instead */
|
|
10
|
+
const UNKNOWN_ERROR_CODE = SdkErrorCode.SdkErrorCode.UNKNOWN_ERROR;
|
|
8
11
|
|
|
9
12
|
exports.RATE_LIMIT_ERROR_CODE = RATE_LIMIT_ERROR_CODE;
|
|
10
13
|
exports.UNKNOWN_ERROR_CODE = UNKNOWN_ERROR_CODE;
|
package/src/errors/errorCodes.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
'use client'
|
|
2
|
+
import { SdkErrorCode } from './SdkErrorCode.js';
|
|
3
|
+
|
|
2
4
|
const RATE_LIMIT_ERROR_CODE = 'rate_limit_error';
|
|
3
|
-
|
|
5
|
+
/** @deprecated Use SdkErrorCode.UNKNOWN_ERROR instead */
|
|
6
|
+
const UNKNOWN_ERROR_CODE = SdkErrorCode.UNKNOWN_ERROR;
|
|
4
7
|
|
|
5
8
|
export { RATE_LIMIT_ERROR_CODE, UNKNOWN_ERROR_CODE };
|
package/src/errors/index.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ export * from './EmailAlreadyExistsError';
|
|
|
10
10
|
export * from './EmailProviderError';
|
|
11
11
|
export * from './EmailVerificationError';
|
|
12
12
|
export * from './EmbeddedWalletException';
|
|
13
|
-
export * from './errorCodes';
|
|
14
13
|
export * from './EmbeddedWalletExistsError';
|
|
15
14
|
export * from './ErrorCode';
|
|
16
15
|
export * from './ExternalAuthError';
|
|
@@ -31,6 +30,8 @@ export * from './RateLimitError';
|
|
|
31
30
|
export * from './RequestChannelNotHandledError';
|
|
32
31
|
export * from './ResponseError';
|
|
33
32
|
export * from './SandboxMaximumThresholdReachedError';
|
|
33
|
+
export * from './SdkErrorCode';
|
|
34
|
+
export * from './errorCodes';
|
|
34
35
|
export * from './SeiNotEnabledInKeplrWalletError';
|
|
35
36
|
export * from './SmsVerificationError';
|
|
36
37
|
export * from './SocialAccountAlreadyExistsError';
|
package/src/index.cjs
CHANGED
|
@@ -22,7 +22,6 @@ var EmailAlreadyExistsError = require('./errors/EmailAlreadyExistsError.cjs');
|
|
|
22
22
|
var EmailProviderError = require('./errors/EmailProviderError.cjs');
|
|
23
23
|
var EmailVerificationError = require('./errors/EmailVerificationError.cjs');
|
|
24
24
|
var EmbeddedWalletException = require('./errors/EmbeddedWalletException.cjs');
|
|
25
|
-
var errorCodes = require('./errors/errorCodes.cjs');
|
|
26
25
|
var EmbeddedWalletExistsError = require('./errors/EmbeddedWalletExistsError.cjs');
|
|
27
26
|
var ErrorCode = require('./errors/ErrorCode.cjs');
|
|
28
27
|
var ExternalAuthError = require('./errors/ExternalAuthError.cjs');
|
|
@@ -42,6 +41,8 @@ var RateLimitError = require('./errors/RateLimitError.cjs');
|
|
|
42
41
|
var RequestChannelNotHandledError = require('./errors/RequestChannelNotHandledError.cjs');
|
|
43
42
|
var ResponseError = require('./errors/ResponseError.cjs');
|
|
44
43
|
var SandboxMaximumThresholdReachedError = require('./errors/SandboxMaximumThresholdReachedError.cjs');
|
|
44
|
+
var SdkErrorCode = require('./errors/SdkErrorCode.cjs');
|
|
45
|
+
var errorCodes = require('./errors/errorCodes.cjs');
|
|
45
46
|
var SeiNotEnabledInKeplrWalletError = require('./errors/SeiNotEnabledInKeplrWalletError.cjs');
|
|
46
47
|
var SmsVerificationError = require('./errors/SmsVerificationError.cjs');
|
|
47
48
|
var SocialAccountAlreadyExistsError = require('./errors/SocialAccountAlreadyExistsError.cjs');
|
|
@@ -140,8 +141,6 @@ exports.EmailAlreadyExistsError = EmailAlreadyExistsError.EmailAlreadyExistsErro
|
|
|
140
141
|
exports.EmailProviderError = EmailProviderError.EmailProviderError;
|
|
141
142
|
exports.EmailVerificationError = EmailVerificationError.EmailVerificationError;
|
|
142
143
|
exports.EmbeddedWalletException = EmbeddedWalletException.EmbeddedWalletException;
|
|
143
|
-
exports.RATE_LIMIT_ERROR_CODE = errorCodes.RATE_LIMIT_ERROR_CODE;
|
|
144
|
-
exports.UNKNOWN_ERROR_CODE = errorCodes.UNKNOWN_ERROR_CODE;
|
|
145
144
|
exports.EmbeddedWalletExistsError = EmbeddedWalletExistsError.EmbeddedWalletExistsError;
|
|
146
145
|
Object.defineProperty(exports, 'ErrorCode', {
|
|
147
146
|
enumerable: true,
|
|
@@ -165,6 +164,12 @@ exports.RateLimitError = RateLimitError.RateLimitError;
|
|
|
165
164
|
exports.RequestChannelNotHandledError = RequestChannelNotHandledError.RequestChannelNotHandledError;
|
|
166
165
|
exports.ResponseError = ResponseError.ResponseError;
|
|
167
166
|
exports.SandboxMaximumThresholdReachedError = SandboxMaximumThresholdReachedError.SandboxMaximumThresholdReachedError;
|
|
167
|
+
Object.defineProperty(exports, 'SdkErrorCode', {
|
|
168
|
+
enumerable: true,
|
|
169
|
+
get: function () { return SdkErrorCode.SdkErrorCode; }
|
|
170
|
+
});
|
|
171
|
+
exports.RATE_LIMIT_ERROR_CODE = errorCodes.RATE_LIMIT_ERROR_CODE;
|
|
172
|
+
exports.UNKNOWN_ERROR_CODE = errorCodes.UNKNOWN_ERROR_CODE;
|
|
168
173
|
exports.SeiNotEnabledInKeplrWalletError = SeiNotEnabledInKeplrWalletError.SeiNotEnabledInKeplrWalletError;
|
|
169
174
|
exports.SmsVerificationError = SmsVerificationError.SmsVerificationError;
|
|
170
175
|
exports.SocialAccountAlreadyExistsError = SocialAccountAlreadyExistsError.SocialAccountAlreadyExistsError;
|
package/src/index.js
CHANGED
|
@@ -18,7 +18,6 @@ export { EmailAlreadyExistsError } from './errors/EmailAlreadyExistsError.js';
|
|
|
18
18
|
export { EmailProviderError } from './errors/EmailProviderError.js';
|
|
19
19
|
export { EmailVerificationError } from './errors/EmailVerificationError.js';
|
|
20
20
|
export { EmbeddedWalletException } from './errors/EmbeddedWalletException.js';
|
|
21
|
-
export { RATE_LIMIT_ERROR_CODE, UNKNOWN_ERROR_CODE } from './errors/errorCodes.js';
|
|
22
21
|
export { EmbeddedWalletExistsError } from './errors/EmbeddedWalletExistsError.js';
|
|
23
22
|
export { ErrorCode } from './errors/ErrorCode.js';
|
|
24
23
|
export { ExternalAuthError } from './errors/ExternalAuthError.js';
|
|
@@ -38,6 +37,8 @@ export { RateLimitError } from './errors/RateLimitError.js';
|
|
|
38
37
|
export { RequestChannelNotHandledError } from './errors/RequestChannelNotHandledError.js';
|
|
39
38
|
export { ResponseError } from './errors/ResponseError.js';
|
|
40
39
|
export { SandboxMaximumThresholdReachedError } from './errors/SandboxMaximumThresholdReachedError.js';
|
|
40
|
+
export { SdkErrorCode } from './errors/SdkErrorCode.js';
|
|
41
|
+
export { RATE_LIMIT_ERROR_CODE, UNKNOWN_ERROR_CODE } from './errors/errorCodes.js';
|
|
41
42
|
export { SeiNotEnabledInKeplrWalletError } from './errors/SeiNotEnabledInKeplrWalletError.js';
|
|
42
43
|
export { SmsVerificationError } from './errors/SmsVerificationError.js';
|
|
43
44
|
export { SocialAccountAlreadyExistsError } from './errors/SocialAccountAlreadyExistsError.js';
|