@ledgerhq/errors 6.10.1 → 6.10.2-next.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +6 -0
- package/README.md +2 -2
- package/lib/helpers.d.ts +11 -5
- package/lib/helpers.d.ts.map +1 -1
- package/lib/helpers.js +6 -4
- package/lib/helpers.js.map +1 -1
- package/lib/index.d.ts +298 -100
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +34 -10
- package/lib/index.js.map +1 -1
- package/lib/index.test.js +8 -2
- package/lib/index.test.js.map +1 -1
- package/lib-es/helpers.d.ts +11 -5
- package/lib-es/helpers.d.ts.map +1 -1
- package/lib-es/helpers.js +6 -4
- package/lib-es/helpers.js.map +1 -1
- package/lib-es/index.d.ts +298 -100
- package/lib-es/index.d.ts.map +1 -1
- package/lib-es/index.js +32 -7
- package/lib-es/index.js.map +1 -1
- package/lib-es/index.test.js +9 -3
- package/lib-es/index.test.js.map +1 -1
- package/package.json +1 -1
- package/src/helpers.ts +24 -14
- package/src/index.test.ts +11 -3
- package/src/index.ts +18 -9
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@ledgerhq/errors:build: cache hit, replaying output
|
|
1
|
+
@ledgerhq/errors:build: cache hit, replaying output ffa508c617b3e11f
|
|
2
2
|
@ledgerhq/errors:build:
|
|
3
3
|
@ledgerhq/errors:build: > @ledgerhq/errors@6.10.1 build /home/runner/work/ledger-live/ledger-live/libs/ledgerjs/packages/errors
|
|
4
4
|
@ledgerhq/errors:build: > tsc && tsc -m ES6 --outDir lib-es
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @ledgerhq/errors
|
|
2
2
|
|
|
3
|
+
## 6.10.2-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1179](https://github.com/LedgerHQ/ledger-live/pull/1179) [`ae5e33e15`](https://github.com/LedgerHQ/ledger-live/commit/ae5e33e15e8a107d0ba8a3688a63eda2c0d43ce7) Thanks [@gre](https://github.com/gre)! - Improve TypeScript of @ledgerhq/errors and fixes 2 bugs in swap and stellar on their error handling
|
|
8
|
+
|
|
3
9
|
## 6.10.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -17,6 +17,8 @@ Hodl all possible errors of Ledger (live, ledgerjs) so we can deal with them in
|
|
|
17
17
|
|
|
18
18
|
### TransportError
|
|
19
19
|
|
|
20
|
+
**Extends Error**
|
|
21
|
+
|
|
20
22
|
TransportError is used for any generic transport errors.
|
|
21
23
|
e.g. Error thrown when data received by exchanges are incorrect or if exchanged failed to communicate with the device for various reason.
|
|
22
24
|
|
|
@@ -25,8 +27,6 @@ e.g. Error thrown when data received by exchanges are incorrect or if exchanged
|
|
|
25
27
|
* `message` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
26
28
|
* `id` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
27
29
|
|
|
28
|
-
Returns **void**
|
|
29
|
-
|
|
30
30
|
### TransportStatusError
|
|
31
31
|
|
|
32
32
|
Error thrown when a device returned a non success status.
|
package/lib/helpers.d.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
export declare const addCustomErrorDeserializer: (name: string, deserializer: (obj: any) => any) => void;
|
|
2
|
-
export
|
|
3
|
-
[key: string]:
|
|
4
|
-
}
|
|
5
|
-
|
|
2
|
+
export interface LedgerErrorConstructor<F extends {
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
}> extends ErrorConstructor {
|
|
5
|
+
new (message?: string, fields?: F, options?: any): Error;
|
|
6
|
+
(message?: string, fields?: F, options?: any): Error;
|
|
7
|
+
readonly prototype: Error;
|
|
8
|
+
}
|
|
9
|
+
export declare const createCustomErrorClass: <F extends {
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
}, T extends LedgerErrorConstructor<F>>(name: string) => T;
|
|
6
12
|
export declare const deserializeError: (object: any) => Error;
|
|
7
|
-
export declare const serializeError: (value:
|
|
13
|
+
export declare const serializeError: (value: undefined | To | string | (() => unknown)) => undefined | To | string;
|
|
8
14
|
interface To {
|
|
9
15
|
name?: string;
|
|
10
16
|
message?: string;
|
package/lib/helpers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,0BAA0B,SAC/B,MAAM,sBACQ,GAAG,KAAK,GAAG,KAC9B,IAEF,CAAC;AAEF,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,0BAA0B,SAC/B,MAAM,sBACQ,GAAG,KAAK,GAAG,KAC9B,IAEF,CAAC;AAEF,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAC1E,SAAQ,gBAAgB;IACxB,KAAK,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC;IACzD,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC;IACrD,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC;CAC3B;AAED,eAAO,MAAM,sBAAsB;;8CAI3B,MAAM,MAiCb,CAAC;AAOF,eAAO,MAAM,gBAAgB,WAAY,GAAG,KAAG,KA+C9C,CAAC;AAGF,eAAO,MAAM,cAAc,UAClB,SAAS,GAAG,EAAE,GAAG,MAAM,GAAG,CAAC,MAAM,OAAO,CAAC,KAC/C,SAAS,GAAG,EAAE,GAAG,MASnB,CAAC;AAEF,UAAU,EAAE;IACV,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
package/lib/helpers.js
CHANGED
|
@@ -48,8 +48,12 @@ var createCustomErrorClass = function (name) {
|
|
|
48
48
|
// Set the prototype explicitly. See https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
49
49
|
Object.setPrototypeOf(_this, CustomErrorClass.prototype);
|
|
50
50
|
_this.name = name;
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
if (fields) {
|
|
52
|
+
for (var k in fields) {
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
54
|
+
// @ts-ignore
|
|
55
|
+
_this[k] = fields[k];
|
|
56
|
+
}
|
|
53
57
|
}
|
|
54
58
|
if (isObject(options) && "cause" in options && !("cause" in _this)) {
|
|
55
59
|
// .cause was specified but the superconstructor
|
|
@@ -65,8 +69,6 @@ var createCustomErrorClass = function (name) {
|
|
|
65
69
|
return CustomErrorClass;
|
|
66
70
|
}(Error));
|
|
67
71
|
errorClasses[name] = CustomErrorClass;
|
|
68
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
69
|
-
// @ts-ignore
|
|
70
72
|
return CustomErrorClass;
|
|
71
73
|
};
|
|
72
74
|
exports.createCustomErrorClass = createCustomErrorClass;
|
package/lib/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";AAAA,gCAAgC;AAChC,mCAAmC;AACnC,sCAAsC;AACtC,0CAA0C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE1C,IAAM,YAAY,GAAG,EAAE,CAAC;AACxB,IAAM,aAAa,GAAG,EAAE,CAAC;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
-
import { serializeError, deserializeError, createCustomErrorClass, addCustomErrorDeserializer } from "./helpers";
|
|
1
|
+
import { serializeError, deserializeError, createCustomErrorClass, addCustomErrorDeserializer, LedgerErrorConstructor } from "./helpers";
|
|
2
2
|
export { serializeError, deserializeError, createCustomErrorClass, addCustomErrorDeserializer, };
|
|
3
|
-
export declare const AccountNameRequiredError:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export declare const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export declare const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export declare const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export declare const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export declare const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export declare const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
export declare const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export declare const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
export declare const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export declare const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
export declare const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
export declare const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
export declare const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
export declare const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
export declare const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
export declare const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
export declare const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
export declare const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
export declare const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
export declare const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
export declare const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
export declare const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
export declare const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
export declare const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
export declare const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
export declare const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
export declare const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
export declare const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
export declare const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
export declare const
|
|
97
|
-
|
|
98
|
-
|
|
3
|
+
export declare const AccountNameRequiredError: LedgerErrorConstructor<{
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const AccountNotSupported: LedgerErrorConstructor<{
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const AmountRequired: LedgerErrorConstructor<{
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const BluetoothRequired: LedgerErrorConstructor<{
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const BtcUnmatchedApp: LedgerErrorConstructor<{
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const CantOpenDevice: LedgerErrorConstructor<{
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}>;
|
|
21
|
+
export declare const CashAddrNotSupported: LedgerErrorConstructor<{
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const CurrencyNotSupported: LedgerErrorConstructor<{
|
|
25
|
+
currencyName: string;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const DeviceAppVerifyNotSupported: LedgerErrorConstructor<{
|
|
28
|
+
[key: string]: unknown;
|
|
29
|
+
}>;
|
|
30
|
+
export declare const DeviceGenuineSocketEarlyClose: LedgerErrorConstructor<{
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
}>;
|
|
33
|
+
export declare const DeviceNotGenuineError: LedgerErrorConstructor<{
|
|
34
|
+
[key: string]: unknown;
|
|
35
|
+
}>;
|
|
36
|
+
export declare const DeviceOnDashboardExpected: LedgerErrorConstructor<{
|
|
37
|
+
[key: string]: unknown;
|
|
38
|
+
}>;
|
|
39
|
+
export declare const DeviceOnDashboardUnexpected: LedgerErrorConstructor<{
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
}>;
|
|
42
|
+
export declare const DeviceInOSUExpected: LedgerErrorConstructor<{
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
}>;
|
|
45
|
+
export declare const DeviceHalted: LedgerErrorConstructor<{
|
|
46
|
+
[key: string]: unknown;
|
|
47
|
+
}>;
|
|
48
|
+
export declare const DeviceNameInvalid: LedgerErrorConstructor<{
|
|
49
|
+
[key: string]: unknown;
|
|
50
|
+
}>;
|
|
51
|
+
export declare const DeviceSocketFail: LedgerErrorConstructor<{
|
|
52
|
+
[key: string]: unknown;
|
|
53
|
+
}>;
|
|
54
|
+
export declare const DeviceSocketNoBulkStatus: LedgerErrorConstructor<{
|
|
55
|
+
[key: string]: unknown;
|
|
56
|
+
}>;
|
|
57
|
+
export declare const DisconnectedDevice: LedgerErrorConstructor<{
|
|
58
|
+
[key: string]: unknown;
|
|
59
|
+
}>;
|
|
60
|
+
export declare const DisconnectedDeviceDuringOperation: LedgerErrorConstructor<{
|
|
61
|
+
[key: string]: unknown;
|
|
62
|
+
}>;
|
|
63
|
+
export declare const DeviceExtractOnboardingStateError: LedgerErrorConstructor<{
|
|
64
|
+
[key: string]: unknown;
|
|
65
|
+
}>;
|
|
66
|
+
export declare const DeviceOnboardingStatePollingError: LedgerErrorConstructor<{
|
|
67
|
+
[key: string]: unknown;
|
|
68
|
+
}>;
|
|
69
|
+
export declare const EnpointConfigError: LedgerErrorConstructor<{
|
|
70
|
+
[key: string]: unknown;
|
|
71
|
+
}>;
|
|
72
|
+
export declare const EthAppPleaseEnableContractData: LedgerErrorConstructor<{
|
|
73
|
+
[key: string]: unknown;
|
|
74
|
+
}>;
|
|
75
|
+
export declare const FeeEstimationFailed: LedgerErrorConstructor<{
|
|
76
|
+
[key: string]: unknown;
|
|
77
|
+
}>;
|
|
78
|
+
export declare const FirmwareNotRecognized: LedgerErrorConstructor<{
|
|
79
|
+
[key: string]: unknown;
|
|
80
|
+
}>;
|
|
81
|
+
export declare const HardResetFail: LedgerErrorConstructor<{
|
|
82
|
+
[key: string]: unknown;
|
|
83
|
+
}>;
|
|
84
|
+
export declare const InvalidXRPTag: LedgerErrorConstructor<{
|
|
85
|
+
[key: string]: unknown;
|
|
86
|
+
}>;
|
|
87
|
+
export declare const InvalidAddress: LedgerErrorConstructor<{
|
|
88
|
+
[key: string]: unknown;
|
|
89
|
+
}>;
|
|
90
|
+
export declare const InvalidAddressBecauseDestinationIsAlsoSource: LedgerErrorConstructor<{
|
|
91
|
+
[key: string]: unknown;
|
|
92
|
+
}>;
|
|
93
|
+
export declare const LatestMCUInstalledError: LedgerErrorConstructor<{
|
|
94
|
+
[key: string]: unknown;
|
|
95
|
+
}>;
|
|
96
|
+
export declare const UnknownMCU: LedgerErrorConstructor<{
|
|
97
|
+
[key: string]: unknown;
|
|
98
|
+
}>;
|
|
99
|
+
export declare const LedgerAPIError: LedgerErrorConstructor<{
|
|
100
|
+
[key: string]: unknown;
|
|
101
|
+
}>;
|
|
102
|
+
export declare const LedgerAPIErrorWithMessage: LedgerErrorConstructor<{
|
|
103
|
+
[key: string]: unknown;
|
|
104
|
+
}>;
|
|
105
|
+
export declare const LedgerAPINotAvailable: LedgerErrorConstructor<{
|
|
106
|
+
[key: string]: unknown;
|
|
107
|
+
}>;
|
|
108
|
+
export declare const ManagerAppAlreadyInstalledError: LedgerErrorConstructor<{
|
|
109
|
+
[key: string]: unknown;
|
|
110
|
+
}>;
|
|
111
|
+
export declare const ManagerAppRelyOnBTCError: LedgerErrorConstructor<{
|
|
112
|
+
[key: string]: unknown;
|
|
113
|
+
}>;
|
|
114
|
+
export declare const ManagerAppDepInstallRequired: LedgerErrorConstructor<{
|
|
115
|
+
[key: string]: unknown;
|
|
116
|
+
}>;
|
|
117
|
+
export declare const ManagerAppDepUninstallRequired: LedgerErrorConstructor<{
|
|
118
|
+
[key: string]: unknown;
|
|
119
|
+
}>;
|
|
120
|
+
export declare const ManagerDeviceLockedError: LedgerErrorConstructor<{
|
|
121
|
+
[key: string]: unknown;
|
|
122
|
+
}>;
|
|
123
|
+
export declare const ManagerFirmwareNotEnoughSpaceError: LedgerErrorConstructor<{
|
|
124
|
+
[key: string]: unknown;
|
|
125
|
+
}>;
|
|
126
|
+
export declare const ManagerNotEnoughSpaceError: LedgerErrorConstructor<{
|
|
127
|
+
[key: string]: unknown;
|
|
128
|
+
}>;
|
|
129
|
+
export declare const ManagerUninstallBTCDep: LedgerErrorConstructor<{
|
|
130
|
+
[key: string]: unknown;
|
|
131
|
+
}>;
|
|
132
|
+
export declare const NetworkDown: LedgerErrorConstructor<{
|
|
133
|
+
[key: string]: unknown;
|
|
134
|
+
}>;
|
|
135
|
+
export declare const NetworkError: LedgerErrorConstructor<{
|
|
136
|
+
[key: string]: unknown;
|
|
137
|
+
}>;
|
|
138
|
+
export declare const NoAddressesFound: LedgerErrorConstructor<{
|
|
139
|
+
[key: string]: unknown;
|
|
140
|
+
}>;
|
|
141
|
+
export declare const NotEnoughBalance: LedgerErrorConstructor<{
|
|
142
|
+
[key: string]: unknown;
|
|
143
|
+
}>;
|
|
144
|
+
export declare const NotEnoughBalanceToDelegate: LedgerErrorConstructor<{
|
|
145
|
+
[key: string]: unknown;
|
|
146
|
+
}>;
|
|
147
|
+
export declare const NotEnoughBalanceInParentAccount: LedgerErrorConstructor<{
|
|
148
|
+
[key: string]: unknown;
|
|
149
|
+
}>;
|
|
150
|
+
export declare const NotEnoughSpendableBalance: LedgerErrorConstructor<{
|
|
151
|
+
[key: string]: unknown;
|
|
152
|
+
}>;
|
|
153
|
+
export declare const NotEnoughBalanceBecauseDestinationNotCreated: LedgerErrorConstructor<{
|
|
154
|
+
[key: string]: unknown;
|
|
155
|
+
}>;
|
|
156
|
+
export declare const NoAccessToCamera: LedgerErrorConstructor<{
|
|
157
|
+
[key: string]: unknown;
|
|
158
|
+
}>;
|
|
159
|
+
export declare const NotEnoughGas: LedgerErrorConstructor<{
|
|
160
|
+
[key: string]: unknown;
|
|
161
|
+
}>;
|
|
162
|
+
export declare const NotSupportedLegacyAddress: LedgerErrorConstructor<{
|
|
163
|
+
[key: string]: unknown;
|
|
164
|
+
}>;
|
|
165
|
+
export declare const GasLessThanEstimate: LedgerErrorConstructor<{
|
|
166
|
+
[key: string]: unknown;
|
|
167
|
+
}>;
|
|
168
|
+
export declare const PasswordsDontMatchError: LedgerErrorConstructor<{
|
|
169
|
+
[key: string]: unknown;
|
|
170
|
+
}>;
|
|
171
|
+
export declare const PasswordIncorrectError: LedgerErrorConstructor<{
|
|
172
|
+
[key: string]: unknown;
|
|
173
|
+
}>;
|
|
174
|
+
export declare const RecommendSubAccountsToEmpty: LedgerErrorConstructor<{
|
|
175
|
+
[key: string]: unknown;
|
|
176
|
+
}>;
|
|
177
|
+
export declare const RecommendUndelegation: LedgerErrorConstructor<{
|
|
178
|
+
[key: string]: unknown;
|
|
179
|
+
}>;
|
|
180
|
+
export declare const TimeoutTagged: LedgerErrorConstructor<{
|
|
181
|
+
[key: string]: unknown;
|
|
182
|
+
}>;
|
|
183
|
+
export declare const UnexpectedBootloader: LedgerErrorConstructor<{
|
|
184
|
+
[key: string]: unknown;
|
|
185
|
+
}>;
|
|
186
|
+
export declare const MCUNotGenuineToDashboard: LedgerErrorConstructor<{
|
|
187
|
+
[key: string]: unknown;
|
|
188
|
+
}>;
|
|
189
|
+
export declare const RecipientRequired: LedgerErrorConstructor<{
|
|
190
|
+
[key: string]: unknown;
|
|
191
|
+
}>;
|
|
192
|
+
export declare const UnavailableTezosOriginatedAccountReceive: LedgerErrorConstructor<{
|
|
193
|
+
[key: string]: unknown;
|
|
194
|
+
}>;
|
|
195
|
+
export declare const UnavailableTezosOriginatedAccountSend: LedgerErrorConstructor<{
|
|
196
|
+
[key: string]: unknown;
|
|
197
|
+
}>;
|
|
198
|
+
export declare const UpdateFetchFileFail: LedgerErrorConstructor<{
|
|
199
|
+
[key: string]: unknown;
|
|
200
|
+
}>;
|
|
201
|
+
export declare const UpdateIncorrectHash: LedgerErrorConstructor<{
|
|
202
|
+
[key: string]: unknown;
|
|
203
|
+
}>;
|
|
204
|
+
export declare const UpdateIncorrectSig: LedgerErrorConstructor<{
|
|
205
|
+
[key: string]: unknown;
|
|
206
|
+
}>;
|
|
207
|
+
export declare const UpdateYourApp: LedgerErrorConstructor<{
|
|
208
|
+
[key: string]: unknown;
|
|
209
|
+
}>;
|
|
210
|
+
export declare const UserRefusedDeviceNameChange: LedgerErrorConstructor<{
|
|
211
|
+
[key: string]: unknown;
|
|
212
|
+
}>;
|
|
213
|
+
export declare const UserRefusedAddress: LedgerErrorConstructor<{
|
|
214
|
+
[key: string]: unknown;
|
|
215
|
+
}>;
|
|
216
|
+
export declare const UserRefusedFirmwareUpdate: LedgerErrorConstructor<{
|
|
217
|
+
[key: string]: unknown;
|
|
218
|
+
}>;
|
|
219
|
+
export declare const UserRefusedAllowManager: LedgerErrorConstructor<{
|
|
220
|
+
[key: string]: unknown;
|
|
221
|
+
}>;
|
|
222
|
+
export declare const UserRefusedOnDevice: LedgerErrorConstructor<{
|
|
223
|
+
[key: string]: unknown;
|
|
224
|
+
}>;
|
|
225
|
+
export declare const TransportOpenUserCancelled: LedgerErrorConstructor<{
|
|
226
|
+
[key: string]: unknown;
|
|
227
|
+
}>;
|
|
228
|
+
export declare const TransportInterfaceNotAvailable: LedgerErrorConstructor<{
|
|
229
|
+
[key: string]: unknown;
|
|
230
|
+
}>;
|
|
231
|
+
export declare const TransportRaceCondition: LedgerErrorConstructor<{
|
|
232
|
+
[key: string]: unknown;
|
|
233
|
+
}>;
|
|
234
|
+
export declare const TransportWebUSBGestureRequired: LedgerErrorConstructor<{
|
|
235
|
+
[key: string]: unknown;
|
|
236
|
+
}>;
|
|
237
|
+
export declare const DeviceShouldStayInApp: LedgerErrorConstructor<{
|
|
238
|
+
[key: string]: unknown;
|
|
239
|
+
}>;
|
|
240
|
+
export declare const WebsocketConnectionError: LedgerErrorConstructor<{
|
|
241
|
+
[key: string]: unknown;
|
|
242
|
+
}>;
|
|
243
|
+
export declare const WebsocketConnectionFailed: LedgerErrorConstructor<{
|
|
244
|
+
[key: string]: unknown;
|
|
245
|
+
}>;
|
|
246
|
+
export declare const WrongDeviceForAccount: LedgerErrorConstructor<{
|
|
247
|
+
[key: string]: unknown;
|
|
248
|
+
}>;
|
|
249
|
+
export declare const WrongAppForCurrency: LedgerErrorConstructor<{
|
|
250
|
+
[key: string]: unknown;
|
|
251
|
+
}>;
|
|
252
|
+
export declare const ETHAddressNonEIP: LedgerErrorConstructor<{
|
|
253
|
+
[key: string]: unknown;
|
|
254
|
+
}>;
|
|
255
|
+
export declare const CantScanQRCode: LedgerErrorConstructor<{
|
|
256
|
+
[key: string]: unknown;
|
|
257
|
+
}>;
|
|
258
|
+
export declare const FeeNotLoaded: LedgerErrorConstructor<{
|
|
259
|
+
[key: string]: unknown;
|
|
260
|
+
}>;
|
|
261
|
+
export declare const FeeRequired: LedgerErrorConstructor<{
|
|
262
|
+
[key: string]: unknown;
|
|
263
|
+
}>;
|
|
264
|
+
export declare const FeeTooHigh: LedgerErrorConstructor<{
|
|
265
|
+
[key: string]: unknown;
|
|
266
|
+
}>;
|
|
267
|
+
export declare const SyncError: LedgerErrorConstructor<{
|
|
268
|
+
[key: string]: unknown;
|
|
269
|
+
}>;
|
|
270
|
+
export declare const PairingFailed: LedgerErrorConstructor<{
|
|
271
|
+
[key: string]: unknown;
|
|
272
|
+
}>;
|
|
273
|
+
export declare const GenuineCheckFailed: LedgerErrorConstructor<{
|
|
274
|
+
[key: string]: unknown;
|
|
275
|
+
}>;
|
|
276
|
+
export declare const LedgerAPI4xx: LedgerErrorConstructor<{
|
|
277
|
+
[key: string]: unknown;
|
|
278
|
+
}>;
|
|
279
|
+
export declare const LedgerAPI5xx: LedgerErrorConstructor<{
|
|
280
|
+
[key: string]: unknown;
|
|
281
|
+
}>;
|
|
282
|
+
export declare const FirmwareOrAppUpdateRequired: LedgerErrorConstructor<{
|
|
283
|
+
[key: string]: unknown;
|
|
284
|
+
}>;
|
|
285
|
+
export declare const LanguageNotFound: LedgerErrorConstructor<{
|
|
286
|
+
[key: string]: unknown;
|
|
287
|
+
}>;
|
|
288
|
+
export declare const NoDBPathGiven: LedgerErrorConstructor<{
|
|
289
|
+
[key: string]: unknown;
|
|
290
|
+
}>;
|
|
291
|
+
export declare const DBWrongPassword: LedgerErrorConstructor<{
|
|
292
|
+
[key: string]: unknown;
|
|
293
|
+
}>;
|
|
294
|
+
export declare const DBNotReset: LedgerErrorConstructor<{
|
|
295
|
+
[key: string]: unknown;
|
|
296
|
+
}>;
|
|
99
297
|
/**
|
|
100
298
|
* TransportError is used for any generic transport errors.
|
|
101
299
|
* e.g. Error thrown when data received by exchanges are incorrect or if exchanged failed to communicate with the device for various reason.
|
|
102
300
|
*/
|
|
103
|
-
export declare
|
|
104
|
-
|
|
105
|
-
|
|
301
|
+
export declare class TransportError extends Error {
|
|
302
|
+
id: string;
|
|
303
|
+
constructor(message: string, id: string);
|
|
106
304
|
}
|
|
107
305
|
export declare const StatusCodes: {
|
|
108
306
|
PIN_REMAINING_ATTEMPTS: number;
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,0BAA0B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,0BAA0B,EAC1B,sBAAsB,EACvB,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AM,kBAAkB;;EAA+C,CAAC;AAC/E,eAAO,MAAM,YAAY;;EAAyC,CAAC;AACnE,eAAO,MAAM,YAAY;;EAAyC,CAAC;AACnE,eAAO,MAAM,2BAA2B;;EAEvC,CAAC;AAEF,eAAO,MAAM,gBAAgB;;EAA6C,CAAC;AAG3E,eAAO,MAAM,aAAa;;EAA0C,CAAC;AACrE,eAAO,MAAM,eAAe;;EAA4C,CAAC;AACzE,eAAO,MAAM,UAAU;;EAAuC,CAAC;AAE/D;;;GAGG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,EAAE,EAAE,MAAM,CAAC;gBACC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM;CAQxC;AAOD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCvB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAmB3E;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAW7D;yBAXe,oBAAoB"}
|
package/lib/index.js
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
2
17
|
exports.__esModule = true;
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.TransportStatusError = exports.getAltStatusMessage = exports.StatusCodes = exports.TransportError = void 0;
|
|
18
|
+
exports.NoAddressesFound = exports.NetworkError = exports.NetworkDown = exports.ManagerUninstallBTCDep = exports.ManagerNotEnoughSpaceError = 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.InvalidAddress = exports.InvalidXRPTag = exports.HardResetFail = exports.FirmwareNotRecognized = exports.FeeEstimationFailed = exports.EthAppPleaseEnableContractData = exports.EnpointConfigError = exports.DeviceOnboardingStatePollingError = exports.DeviceExtractOnboardingStateError = exports.DisconnectedDeviceDuringOperation = exports.DisconnectedDevice = exports.DeviceSocketNoBulkStatus = exports.DeviceSocketFail = exports.DeviceNameInvalid = exports.DeviceHalted = exports.DeviceInOSUExpected = exports.DeviceOnDashboardUnexpected = exports.DeviceOnDashboardExpected = exports.DeviceNotGenuineError = exports.DeviceGenuineSocketEarlyClose = exports.DeviceAppVerifyNotSupported = exports.CurrencyNotSupported = exports.CashAddrNotSupported = exports.CantOpenDevice = exports.BtcUnmatchedApp = exports.BluetoothRequired = exports.AmountRequired = exports.AccountNotSupported = exports.AccountNameRequiredError = exports.addCustomErrorDeserializer = exports.createCustomErrorClass = exports.deserializeError = exports.serializeError = void 0;
|
|
19
|
+
exports.NoDBPathGiven = exports.LanguageNotFound = exports.FirmwareOrAppUpdateRequired = exports.LedgerAPI5xx = exports.LedgerAPI4xx = exports.GenuineCheckFailed = exports.PairingFailed = exports.SyncError = exports.FeeTooHigh = exports.FeeRequired = exports.FeeNotLoaded = exports.CantScanQRCode = exports.ETHAddressNonEIP = exports.WrongAppForCurrency = exports.WrongDeviceForAccount = exports.WebsocketConnectionFailed = exports.WebsocketConnectionError = exports.DeviceShouldStayInApp = exports.TransportWebUSBGestureRequired = exports.TransportRaceCondition = exports.TransportInterfaceNotAvailable = exports.TransportOpenUserCancelled = 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.GasLessThanEstimate = exports.NotSupportedLegacyAddress = exports.NotEnoughGas = exports.NoAccessToCamera = exports.NotEnoughBalanceBecauseDestinationNotCreated = exports.NotEnoughSpendableBalance = exports.NotEnoughBalanceInParentAccount = exports.NotEnoughBalanceToDelegate = exports.NotEnoughBalance = void 0;
|
|
20
|
+
exports.TransportStatusError = exports.getAltStatusMessage = exports.StatusCodes = exports.TransportError = exports.DBNotReset = exports.DBWrongPassword = void 0;
|
|
6
21
|
var helpers_1 = require("./helpers");
|
|
7
22
|
exports.serializeError = helpers_1.serializeError;
|
|
8
23
|
exports.deserializeError = helpers_1.deserializeError;
|
|
@@ -52,6 +67,7 @@ exports.ManagerFirmwareNotEnoughSpaceError = (0, helpers_1.createCustomErrorClas
|
|
|
52
67
|
exports.ManagerNotEnoughSpaceError = (0, helpers_1.createCustomErrorClass)("ManagerNotEnoughSpace");
|
|
53
68
|
exports.ManagerUninstallBTCDep = (0, helpers_1.createCustomErrorClass)("ManagerUninstallBTCDep");
|
|
54
69
|
exports.NetworkDown = (0, helpers_1.createCustomErrorClass)("NetworkDown");
|
|
70
|
+
exports.NetworkError = (0, helpers_1.createCustomErrorClass)("NetworkError");
|
|
55
71
|
exports.NoAddressesFound = (0, helpers_1.createCustomErrorClass)("NoAddressesFound");
|
|
56
72
|
exports.NotEnoughBalance = (0, helpers_1.createCustomErrorClass)("NotEnoughBalance");
|
|
57
73
|
exports.NotEnoughBalanceToDelegate = (0, helpers_1.createCustomErrorClass)("NotEnoughBalanceToDelegate");
|
|
@@ -101,6 +117,7 @@ exports.GenuineCheckFailed = (0, helpers_1.createCustomErrorClass)("GenuineCheck
|
|
|
101
117
|
exports.LedgerAPI4xx = (0, helpers_1.createCustomErrorClass)("LedgerAPI4xx");
|
|
102
118
|
exports.LedgerAPI5xx = (0, helpers_1.createCustomErrorClass)("LedgerAPI5xx");
|
|
103
119
|
exports.FirmwareOrAppUpdateRequired = (0, helpers_1.createCustomErrorClass)("FirmwareOrAppUpdateRequired");
|
|
120
|
+
exports.LanguageNotFound = (0, helpers_1.createCustomErrorClass)("LanguageNotFound");
|
|
104
121
|
// db stuff, no need to translate
|
|
105
122
|
exports.NoDBPathGiven = (0, helpers_1.createCustomErrorClass)("NoDBPathGiven");
|
|
106
123
|
exports.DBWrongPassword = (0, helpers_1.createCustomErrorClass)("DBWrongPassword");
|
|
@@ -109,14 +126,21 @@ exports.DBNotReset = (0, helpers_1.createCustomErrorClass)("DBNotReset");
|
|
|
109
126
|
* TransportError is used for any generic transport errors.
|
|
110
127
|
* e.g. Error thrown when data received by exchanges are incorrect or if exchanged failed to communicate with the device for various reason.
|
|
111
128
|
*/
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
129
|
+
var TransportError = /** @class */ (function (_super) {
|
|
130
|
+
__extends(TransportError, _super);
|
|
131
|
+
function TransportError(message, id) {
|
|
132
|
+
var _this = this;
|
|
133
|
+
var name = "TransportError";
|
|
134
|
+
_this = _super.call(this, message || name) || this;
|
|
135
|
+
_this.name = name;
|
|
136
|
+
_this.message = message;
|
|
137
|
+
_this.stack = new Error().stack;
|
|
138
|
+
_this.id = id;
|
|
139
|
+
return _this;
|
|
140
|
+
}
|
|
141
|
+
return TransportError;
|
|
142
|
+
}(Error));
|
|
118
143
|
exports.TransportError = TransportError;
|
|
119
|
-
TransportError.prototype = new Error();
|
|
120
144
|
(0, helpers_1.addCustomErrorDeserializer)("TransportError", function (e) { return new TransportError(e.message, e.id); });
|
|
121
145
|
exports.StatusCodes = {
|
|
122
146
|
PIN_REMAINING_ATTEMPTS: 0x63c0,
|