Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ledgerhq/errors

Package Overview
Dependencies
Maintainers
7
Versions
232
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ledgerhq/errors - npm Package Compare versions

Comparing version 6.17.0 to 6.18.0-next.0

12

CHANGELOG.md
# @ledgerhq/errors
## 6.18.0-next.0
### Minor Changes
- [#7124](https://github.com/LedgerHQ/ledger-live/pull/7124) [`e78f3b7`](https://github.com/LedgerHQ/ledger-live/commit/e78f3b75296c7a063f6cddbeae44c36d236055f3) Thanks [@jiyuzhuang](https://github.com/jiyuzhuang)! - Implement App data backup relative commands
### Patch Changes
- [#7286](https://github.com/LedgerHQ/ledger-live/pull/7286) [`f979216`](https://github.com/LedgerHQ/ledger-live/commit/f9792160293fc8215c6d099f02e1b136c6655f9b) Thanks [@CremaFR](https://github.com/CremaFR)! - fix: tron max value computation
- [#7202](https://github.com/LedgerHQ/ledger-live/pull/7202) [`c1d2bb0`](https://github.com/LedgerHQ/ledger-live/commit/c1d2bb0866723c10d6e2899d40ddd9b9801189f4) Thanks [@CremaFR](https://github.com/CremaFR)! - feat transform NotEnoughBalance into specific error for swap to have different error messages
## 6.17.0

@@ -4,0 +16,0 @@

36

lib-es/index.d.ts

@@ -159,2 +159,5 @@ import { serializeError, deserializeError, createCustomErrorClass, addCustomErrorDeserializer, LedgerErrorConstructor } from "./helpers";

}>;
export declare const NotEnoughBalanceSwap: LedgerErrorConstructor<{
[key: string]: unknown;
}>;
export declare const NotEnoughBalanceToDelegate: LedgerErrorConstructor<{

@@ -181,2 +184,8 @@ [key: string]: unknown;

}>;
export declare const TronEmptyAccount: LedgerErrorConstructor<{
[key: string]: unknown;
}>;
export declare const MaybeKeepTronAccountAlive: LedgerErrorConstructor<{
[key: string]: unknown;
}>;
export declare const NotSupportedLegacyAddress: LedgerErrorConstructor<{

@@ -332,8 +341,9 @@ [key: string]: unknown;

}>;
export declare const LedgerAPI4xx: LedgerErrorConstructor<{
[key: string]: unknown;
}>;
export declare const LedgerAPI5xx: LedgerErrorConstructor<{
[key: string]: unknown;
}>;
type NetworkType = {
status: number;
url: string | undefined;
method: string;
};
export declare const LedgerAPI4xx: LedgerErrorConstructor<NetworkType>;
export declare const LedgerAPI5xx: LedgerErrorConstructor<NetworkType>;
export declare const FirmwareOrAppUpdateRequired: LedgerErrorConstructor<{

@@ -408,3 +418,3 @@ [key: string]: unknown;

CONTRADICTION_SECRET_CODE_STATUS: number;
CUSTOM_IMAGE_BOOTLOADER: number;
DEVICE_IN_RECOVERY_MODE: number;
CUSTOM_IMAGE_EMPTY: number;

@@ -439,2 +449,14 @@ FILE_ALREADY_EXISTS: number;

NOT_ENOUGH_SPACE: number;
APP_NOT_FOUND_OR_INVALID_CONTEXT: number;
INVALID_APP_NAME_LENGTH: number;
GEN_AES_KEY_FAILED: number;
INTERNAL_CRYPTO_OPERATION_FAILED: number;
INTERNAL_COMPUTE_AES_CMAC_FAILED: number;
ENCRYPT_APP_STORAGE_FAILED: number;
INVALID_BACKUP_STATE: number;
PIN_NOT_SET: number;
INVALID_BACKUP_LENGTH: number;
INVALID_RESTORE_STATE: number;
INVALID_CHUNK_LENGTH: number;
INVALID_BACKUP_HEADER: number;
};

@@ -441,0 +463,0 @@ export declare function getAltStatusMessage(code: number): string | undefined | null;

@@ -55,2 +55,3 @@ import { serializeError, deserializeError, createCustomErrorClass, addCustomErrorDeserializer, } from "./helpers";

export const NotEnoughBalance = createCustomErrorClass("NotEnoughBalance");
export const NotEnoughBalanceSwap = createCustomErrorClass("NotEnoughBalanceSwap");
export const NotEnoughBalanceToDelegate = createCustomErrorClass("NotEnoughBalanceToDelegate");

@@ -64,2 +65,4 @@ export const NotEnoughBalanceInParentAccount = createCustomErrorClass("NotEnoughBalanceInParentAccount");

export const NotEnoughGasSwap = createCustomErrorClass("NotEnoughGasSwap");
export const TronEmptyAccount = createCustomErrorClass("TronEmptyAccount");
export const MaybeKeepTronAccountAlive = createCustomErrorClass("MaybeKeepTronAccountAlive");
export const NotSupportedLegacyAddress = createCustomErrorClass("NotSupportedLegacyAddress");

@@ -182,3 +185,3 @@ export const GasLessThanEstimate = createCustomErrorClass("GasLessThanEstimate");

CONTRADICTION_SECRET_CODE_STATUS: 0x9808,
CUSTOM_IMAGE_BOOTLOADER: 0x662f,
DEVICE_IN_RECOVERY_MODE: 0x662f,
CUSTOM_IMAGE_EMPTY: 0x662e,

@@ -213,2 +216,14 @@ FILE_ALREADY_EXISTS: 0x6a89,

NOT_ENOUGH_SPACE: 0x5102,
APP_NOT_FOUND_OR_INVALID_CONTEXT: 0x5123,
INVALID_APP_NAME_LENGTH: 0x670a,
GEN_AES_KEY_FAILED: 0x5419,
INTERNAL_CRYPTO_OPERATION_FAILED: 0x541a,
INTERNAL_COMPUTE_AES_CMAC_FAILED: 0x541b,
ENCRYPT_APP_STORAGE_FAILED: 0x541c,
INVALID_BACKUP_STATE: 0x6642,
PIN_NOT_SET: 0x5502,
INVALID_BACKUP_LENGTH: 0x6733,
INVALID_RESTORE_STATE: 0x6643,
INVALID_CHUNK_LENGTH: 0x6734,
INVALID_BACKUP_HEADER: 0x684a,
};

@@ -215,0 +230,0 @@ export function getAltStatusMessage(code) {

@@ -159,2 +159,5 @@ import { serializeError, deserializeError, createCustomErrorClass, addCustomErrorDeserializer, LedgerErrorConstructor } from "./helpers";

}>;
export declare const NotEnoughBalanceSwap: LedgerErrorConstructor<{
[key: string]: unknown;
}>;
export declare const NotEnoughBalanceToDelegate: LedgerErrorConstructor<{

@@ -181,2 +184,8 @@ [key: string]: unknown;

}>;
export declare const TronEmptyAccount: LedgerErrorConstructor<{
[key: string]: unknown;
}>;
export declare const MaybeKeepTronAccountAlive: LedgerErrorConstructor<{
[key: string]: unknown;
}>;
export declare const NotSupportedLegacyAddress: LedgerErrorConstructor<{

@@ -332,8 +341,9 @@ [key: string]: unknown;

}>;
export declare const LedgerAPI4xx: LedgerErrorConstructor<{
[key: string]: unknown;
}>;
export declare const LedgerAPI5xx: LedgerErrorConstructor<{
[key: string]: unknown;
}>;
type NetworkType = {
status: number;
url: string | undefined;
method: string;
};
export declare const LedgerAPI4xx: LedgerErrorConstructor<NetworkType>;
export declare const LedgerAPI5xx: LedgerErrorConstructor<NetworkType>;
export declare const FirmwareOrAppUpdateRequired: LedgerErrorConstructor<{

@@ -408,3 +418,3 @@ [key: string]: unknown;

CONTRADICTION_SECRET_CODE_STATUS: number;
CUSTOM_IMAGE_BOOTLOADER: number;
DEVICE_IN_RECOVERY_MODE: number;
CUSTOM_IMAGE_EMPTY: number;

@@ -439,2 +449,14 @@ FILE_ALREADY_EXISTS: number;

NOT_ENOUGH_SPACE: number;
APP_NOT_FOUND_OR_INVALID_CONTEXT: number;
INVALID_APP_NAME_LENGTH: number;
GEN_AES_KEY_FAILED: number;
INTERNAL_CRYPTO_OPERATION_FAILED: number;
INTERNAL_COMPUTE_AES_CMAC_FAILED: number;
ENCRYPT_APP_STORAGE_FAILED: number;
INVALID_BACKUP_STATE: number;
PIN_NOT_SET: number;
INVALID_BACKUP_LENGTH: number;
INVALID_RESTORE_STATE: number;
INVALID_CHUNK_LENGTH: number;
INVALID_BACKUP_HEADER: number;
};

@@ -441,0 +463,0 @@ export declare function getAltStatusMessage(code: number): string | undefined | null;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ManagerFirmwareNotEnoughSpaceError = exports.ManagerDeviceLockedError = exports.ManagerAppDepUninstallRequired = exports.ManagerAppDepInstallRequired = exports.ManagerAppRelyOnBTCError = exports.ManagerAppAlreadyInstalledError = exports.LedgerAPINotAvailable = exports.LedgerAPIErrorWithMessage = exports.LedgerAPIError = exports.UnknownMCU = exports.LatestMCUInstalledError = exports.InvalidAddressBecauseDestinationIsAlsoSource = exports.InvalidNonce = exports.InvalidAddress = exports.InvalidXRPTag = exports.HardResetFail = exports.FirmwareNotRecognized = exports.FeeEstimationFailed = exports.EthAppPleaseEnableContractData = exports.EnpointConfigError = exports.DeviceOnboardingStatePollingError = exports.DeviceExtractOnboardingStateError = exports.DisconnectedDeviceDuringOperation = exports.DisconnectedDevice = exports.UnresponsiveDeviceError = exports.DeviceNeedsRestart = exports.DeviceSocketNoBulkStatus = exports.DeviceSocketFail = exports.DeviceNameInvalid = exports.DeviceHalted = exports.DeviceInOSUExpected = exports.DeviceOnDashboardUnexpected = exports.DeviceOnDashboardExpected = exports.DeviceNotGenuineError = exports.DeviceGenuineSocketEarlyClose = exports.DeviceAppVerifyNotSupported = exports.CurrencyNotSupported = exports.ClaimRewardsFeesWarning = exports.CashAddrNotSupported = exports.CantOpenDevice = exports.BtcUnmatchedApp = exports.BluetoothRequired = exports.AmountRequired = exports.AccountAwaitingSendPendingOperations = exports.AccountNotSupported = exports.AccountNameRequiredError = exports.addCustomErrorDeserializer = exports.createCustomErrorClass = exports.deserializeError = exports.serializeError = void 0;
exports.WrongDeviceForAccountPayout = exports.WrongDeviceForAccount = exports.WebsocketConnectionFailed = exports.WebsocketConnectionError = exports.DeviceShouldStayInApp = exports.TransportExchangeTimeoutError = exports.TransactionHasBeenValidatedError = exports.TransportWebUSBGestureRequired = exports.TransportRaceCondition = exports.TransportInterfaceNotAvailable = exports.TransportOpenUserCancelled = exports.ExpertModeRequired = exports.UserRefusedOnDevice = exports.UserRefusedAllowManager = exports.UserRefusedFirmwareUpdate = exports.UserRefusedAddress = exports.UserRefusedDeviceNameChange = exports.UpdateYourApp = exports.UpdateIncorrectSig = exports.UpdateIncorrectHash = exports.UpdateFetchFileFail = exports.UnavailableTezosOriginatedAccountSend = exports.UnavailableTezosOriginatedAccountReceive = exports.RecipientRequired = exports.MCUNotGenuineToDashboard = exports.UnexpectedBootloader = exports.TimeoutTagged = exports.RecommendUndelegation = exports.RecommendSubAccountsToEmpty = exports.PasswordIncorrectError = exports.PasswordsDontMatchError = exports.MaxFeeTooLow = exports.PriorityFeeHigherThanMaxFee = exports.PriorityFeeTooHigh = exports.PriorityFeeTooLow = exports.GasLessThanEstimate = exports.NotSupportedLegacyAddress = exports.NotEnoughGasSwap = exports.NotEnoughGas = exports.NoAccessToCamera = exports.NotEnoughBalanceBecauseDestinationNotCreated = exports.NotEnoughSpendableBalance = exports.NotEnoughBalanceInParentAccount = exports.NotEnoughBalanceToDelegate = exports.NotEnoughBalance = exports.NoAddressesFound = exports.NetworkError = exports.NetworkDown = exports.ManagerUninstallBTCDep = exports.ManagerNotEnoughSpaceError = void 0;
exports.LockedDeviceError = exports.TransportStatusError = exports.getAltStatusMessage = exports.StatusCodes = exports.TransportError = exports.HwTransportError = exports.HwTransportErrorType = exports.DisabledTransactionBroadcastError = exports.SequenceNumberError = exports.DBNotReset = exports.DBWrongPassword = exports.NoDBPathGiven = exports.LanguageNotFound = exports.DustLimit = exports.OpReturnDataSizeLimit = exports.ReplacementTransactionUnderpriced = exports.FirmwareOrAppUpdateRequired = exports.LedgerAPI5xx = exports.LedgerAPI4xx = exports.GenuineCheckFailed = exports.PeerRemovedPairing = exports.PairingFailed = exports.SyncError = exports.PendingOperation = exports.FeeTooHigh = exports.FeeRequired = exports.FeeNotLoadedSwap = exports.FeeNotLoaded = exports.CantScanQRCode = exports.ETHAddressNonEIP = exports.WrongAppForCurrency = exports.WrongDeviceForAccountRefund = void 0;
exports.WebsocketConnectionError = exports.DeviceShouldStayInApp = exports.TransportExchangeTimeoutError = exports.TransactionHasBeenValidatedError = exports.TransportWebUSBGestureRequired = exports.TransportRaceCondition = exports.TransportInterfaceNotAvailable = exports.TransportOpenUserCancelled = exports.ExpertModeRequired = exports.UserRefusedOnDevice = exports.UserRefusedAllowManager = exports.UserRefusedFirmwareUpdate = exports.UserRefusedAddress = exports.UserRefusedDeviceNameChange = exports.UpdateYourApp = exports.UpdateIncorrectSig = exports.UpdateIncorrectHash = exports.UpdateFetchFileFail = exports.UnavailableTezosOriginatedAccountSend = exports.UnavailableTezosOriginatedAccountReceive = exports.RecipientRequired = exports.MCUNotGenuineToDashboard = exports.UnexpectedBootloader = exports.TimeoutTagged = exports.RecommendUndelegation = exports.RecommendSubAccountsToEmpty = exports.PasswordIncorrectError = exports.PasswordsDontMatchError = exports.MaxFeeTooLow = exports.PriorityFeeHigherThanMaxFee = exports.PriorityFeeTooHigh = exports.PriorityFeeTooLow = exports.GasLessThanEstimate = exports.NotSupportedLegacyAddress = exports.MaybeKeepTronAccountAlive = exports.TronEmptyAccount = exports.NotEnoughGasSwap = exports.NotEnoughGas = exports.NoAccessToCamera = exports.NotEnoughBalanceBecauseDestinationNotCreated = exports.NotEnoughSpendableBalance = exports.NotEnoughBalanceInParentAccount = exports.NotEnoughBalanceToDelegate = exports.NotEnoughBalanceSwap = exports.NotEnoughBalance = exports.NoAddressesFound = exports.NetworkError = exports.NetworkDown = exports.ManagerUninstallBTCDep = exports.ManagerNotEnoughSpaceError = void 0;
exports.LockedDeviceError = exports.TransportStatusError = exports.getAltStatusMessage = exports.StatusCodes = exports.TransportError = exports.HwTransportError = exports.HwTransportErrorType = exports.DisabledTransactionBroadcastError = exports.SequenceNumberError = exports.DBNotReset = exports.DBWrongPassword = exports.NoDBPathGiven = exports.LanguageNotFound = exports.DustLimit = exports.OpReturnDataSizeLimit = exports.ReplacementTransactionUnderpriced = exports.FirmwareOrAppUpdateRequired = exports.LedgerAPI5xx = exports.LedgerAPI4xx = exports.GenuineCheckFailed = exports.PeerRemovedPairing = exports.PairingFailed = exports.SyncError = exports.PendingOperation = exports.FeeTooHigh = exports.FeeRequired = exports.FeeNotLoadedSwap = exports.FeeNotLoaded = exports.CantScanQRCode = exports.ETHAddressNonEIP = exports.WrongAppForCurrency = exports.WrongDeviceForAccountRefund = exports.WrongDeviceForAccountPayout = exports.WrongDeviceForAccount = exports.WebsocketConnectionFailed = void 0;
const helpers_1 = require("./helpers");

@@ -63,2 +63,3 @@ Object.defineProperty(exports, "serializeError", { enumerable: true, get: function () { return helpers_1.serializeError; } });

exports.NotEnoughBalance = (0, helpers_1.createCustomErrorClass)("NotEnoughBalance");
exports.NotEnoughBalanceSwap = (0, helpers_1.createCustomErrorClass)("NotEnoughBalanceSwap");
exports.NotEnoughBalanceToDelegate = (0, helpers_1.createCustomErrorClass)("NotEnoughBalanceToDelegate");

@@ -72,2 +73,4 @@ exports.NotEnoughBalanceInParentAccount = (0, helpers_1.createCustomErrorClass)("NotEnoughBalanceInParentAccount");

exports.NotEnoughGasSwap = (0, helpers_1.createCustomErrorClass)("NotEnoughGasSwap");
exports.TronEmptyAccount = (0, helpers_1.createCustomErrorClass)("TronEmptyAccount");
exports.MaybeKeepTronAccountAlive = (0, helpers_1.createCustomErrorClass)("MaybeKeepTronAccountAlive");
exports.NotSupportedLegacyAddress = (0, helpers_1.createCustomErrorClass)("NotSupportedLegacyAddress");

@@ -192,3 +195,3 @@ exports.GasLessThanEstimate = (0, helpers_1.createCustomErrorClass)("GasLessThanEstimate");

CONTRADICTION_SECRET_CODE_STATUS: 0x9808,
CUSTOM_IMAGE_BOOTLOADER: 0x662f,
DEVICE_IN_RECOVERY_MODE: 0x662f,
CUSTOM_IMAGE_EMPTY: 0x662e,

@@ -223,2 +226,14 @@ FILE_ALREADY_EXISTS: 0x6a89,

NOT_ENOUGH_SPACE: 0x5102,
APP_NOT_FOUND_OR_INVALID_CONTEXT: 0x5123,
INVALID_APP_NAME_LENGTH: 0x670a,
GEN_AES_KEY_FAILED: 0x5419,
INTERNAL_CRYPTO_OPERATION_FAILED: 0x541a,
INTERNAL_COMPUTE_AES_CMAC_FAILED: 0x541b,
ENCRYPT_APP_STORAGE_FAILED: 0x541c,
INVALID_BACKUP_STATE: 0x6642,
PIN_NOT_SET: 0x5502,
INVALID_BACKUP_LENGTH: 0x6733,
INVALID_RESTORE_STATE: 0x6643,
INVALID_CHUNK_LENGTH: 0x6734,
INVALID_BACKUP_HEADER: 0x684a,
};

@@ -225,0 +240,0 @@ function getAltStatusMessage(code) {

2

package.json
{
"name": "@ledgerhq/errors",
"version": "6.17.0",
"version": "6.18.0-next.0",
"description": "Ledger common errors",

@@ -5,0 +5,0 @@ "keywords": [

@@ -84,2 +84,3 @@ import {

export const NotEnoughBalance = createCustomErrorClass("NotEnoughBalance");
export const NotEnoughBalanceSwap = createCustomErrorClass("NotEnoughBalanceSwap");
export const NotEnoughBalanceToDelegate = createCustomErrorClass("NotEnoughBalanceToDelegate");

@@ -97,2 +98,4 @@ export const NotEnoughBalanceInParentAccount = createCustomErrorClass(

export const NotEnoughGasSwap = createCustomErrorClass("NotEnoughGasSwap");
export const TronEmptyAccount = createCustomErrorClass("TronEmptyAccount");
export const MaybeKeepTronAccountAlive = createCustomErrorClass("MaybeKeepTronAccountAlive");
export const NotSupportedLegacyAddress = createCustomErrorClass("NotSupportedLegacyAddress");

@@ -161,4 +164,15 @@ export const GasLessThanEstimate = createCustomErrorClass("GasLessThanEstimate");

export const GenuineCheckFailed = createCustomErrorClass("GenuineCheckFailed");
export const LedgerAPI4xx = createCustomErrorClass("LedgerAPI4xx");
export const LedgerAPI5xx = createCustomErrorClass("LedgerAPI5xx");
type NetworkType = {
status: number;
url: string | undefined;
method: string;
};
export const LedgerAPI4xx = createCustomErrorClass<
NetworkType,
LedgerErrorConstructor<NetworkType>
>("LedgerAPI4xx");
export const LedgerAPI5xx = createCustomErrorClass<
NetworkType,
LedgerErrorConstructor<NetworkType>
>("LedgerAPI5xx");
export const FirmwareOrAppUpdateRequired = createCustomErrorClass("FirmwareOrAppUpdateRequired");

@@ -249,3 +263,3 @@

CONTRADICTION_SECRET_CODE_STATUS: 0x9808,
CUSTOM_IMAGE_BOOTLOADER: 0x662f,
DEVICE_IN_RECOVERY_MODE: 0x662f,
CUSTOM_IMAGE_EMPTY: 0x662e,

@@ -280,2 +294,14 @@ FILE_ALREADY_EXISTS: 0x6a89,

NOT_ENOUGH_SPACE: 0x5102,
APP_NOT_FOUND_OR_INVALID_CONTEXT: 0x5123,
INVALID_APP_NAME_LENGTH: 0x670a,
GEN_AES_KEY_FAILED: 0x5419,
INTERNAL_CRYPTO_OPERATION_FAILED: 0x541a,
INTERNAL_COMPUTE_AES_CMAC_FAILED: 0x541b,
ENCRYPT_APP_STORAGE_FAILED: 0x541c,
INVALID_BACKUP_STATE: 0x6642,
PIN_NOT_SET: 0x5502,
INVALID_BACKUP_LENGTH: 0x6733,
INVALID_RESTORE_STATE: 0x6643,
INVALID_CHUNK_LENGTH: 0x6734,
INVALID_BACKUP_HEADER: 0x684a,
};

@@ -282,0 +308,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc