@akashicpay/sdk
Version:
SDK to interact with the Akashic ecosystem
39 lines • 2.37 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AkashicError = exports.AkashicErrorDetail = exports.AkashicErrorCode = void 0;
var AkashicErrorCode;
(function (AkashicErrorCode) {
AkashicErrorCode["TestNetOtkOnboardingFailed"] = "OTK_ONBOARDING_FAILED";
AkashicErrorCode["IncorrectPrivateKeyFormat"] = "INVALID_PRIVATE_KEY_FORMAT";
AkashicErrorCode["UnknownError"] = "UNKNOWN_ERROR";
AkashicErrorCode["KeyCreationFailure"] = "WALLET_CREATION_FAILURE";
AkashicErrorCode["UnHealthyKey"] = "UNHEALTHY_WALLET";
AkashicErrorCode["AccessDenied"] = "ACCESS_DENIED";
AkashicErrorCode["L2AddressNotFound"] = "L2ADDRESS_NOT_FOUND";
AkashicErrorCode["IsNotBp"] = "NOT_SIGNED_UP";
AkashicErrorCode["SavingsExceeded"] = "FUNDS_EXCEEDED";
AkashicErrorCode["AssignmentFailed"] = "ASSIGNMENT_FAILED";
AkashicErrorCode["NetworkEnvironmentMismatch"] = "NETWORK_ENVIRONMENT_MISMATCH";
})(AkashicErrorCode || (exports.AkashicErrorCode = AkashicErrorCode = {}));
exports.AkashicErrorDetail = {
[AkashicErrorCode.TestNetOtkOnboardingFailed]: 'Failed to setup test-otk. Please try again',
[AkashicErrorCode.IncorrectPrivateKeyFormat]: 'Private Key is not in correct format',
[AkashicErrorCode.UnknownError]: 'Akashic failed with an unknown error. Please try again later',
[AkashicErrorCode.KeyCreationFailure]: 'Failed to generate new wallet. Try again.',
[AkashicErrorCode.UnHealthyKey]: 'New wallet was not created safely, please re-create',
[AkashicErrorCode.AccessDenied]: 'Unauthorized attempt to access production Akashic Link secrets',
[AkashicErrorCode.L2AddressNotFound]: 'L2 Address not found',
[AkashicErrorCode.IsNotBp]: 'Please sign up on AkashicPay.com first',
[AkashicErrorCode.SavingsExceeded]: 'Transaction amount exceeds total savings',
[AkashicErrorCode.AssignmentFailed]: 'Failed to assign wallet. Please try again',
[AkashicErrorCode.NetworkEnvironmentMismatch]: 'The L1-network does not match the SDK-environment',
};
class AkashicError extends Error {
constructor(message, details) {
super(message);
this.name = this.constructor.name;
this.details = details !== null && details !== void 0 ? details : exports.AkashicErrorDetail[message];
}
}
exports.AkashicError = AkashicError;
//# sourceMappingURL=error.js.map