@ledgerhq/errors 6.10.0 → 6.10.1-monorepo.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 -0
- package/CHANGELOG.md +7 -0
- package/jest.config.ts +6 -0
- package/package.json +7 -4
- package/src/index.ts +8 -12
- package/LICENSE +0 -202
- package/lib/helpers.d.ts +0 -14
- package/lib/helpers.d.ts.map +0 -1
- package/lib/helpers.js +0 -141
- package/lib/helpers.js.map +0 -1
- package/lib/index.d.ts +0 -335
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -191
- package/lib/index.js.map +0 -1
- package/lib-es/helpers.d.ts +0 -14
- package/lib-es/helpers.d.ts.map +0 -1
- package/lib-es/helpers.js +0 -134
- package/lib-es/helpers.js.map +0 -1
- package/lib-es/index.d.ts +0 -335
- package/lib-es/index.d.ts.map +0 -1
- package/lib-es/index.js +0 -180
- package/lib-es/index.js.map +0 -1
package/lib-es/helpers.js
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-continue */
|
|
2
|
-
/* eslint-disable no-unused-vars */
|
|
3
|
-
/* eslint-disable no-param-reassign */
|
|
4
|
-
/* eslint-disable no-prototype-builtins */
|
|
5
|
-
var __values = (this && this.__values) || function(o) {
|
|
6
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
7
|
-
if (m) return m.call(o);
|
|
8
|
-
if (o && typeof o.length === "number") return {
|
|
9
|
-
next: function () {
|
|
10
|
-
if (o && i >= o.length) o = void 0;
|
|
11
|
-
return { value: o && o[i++], done: !o };
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
15
|
-
};
|
|
16
|
-
var errorClasses = {};
|
|
17
|
-
var deserializers = {};
|
|
18
|
-
export var addCustomErrorDeserializer = function (name, deserializer) {
|
|
19
|
-
deserializers[name] = deserializer;
|
|
20
|
-
};
|
|
21
|
-
export var createCustomErrorClass = function (name) {
|
|
22
|
-
var C = function CustomError(message, fields) {
|
|
23
|
-
Object.assign(this, fields);
|
|
24
|
-
this.name = name;
|
|
25
|
-
this.message = message || name;
|
|
26
|
-
this.stack = new Error().stack;
|
|
27
|
-
};
|
|
28
|
-
C.prototype = new Error();
|
|
29
|
-
errorClasses[name] = C;
|
|
30
|
-
return C;
|
|
31
|
-
};
|
|
32
|
-
// inspired from https://github.com/programble/errio/blob/master/index.js
|
|
33
|
-
export var deserializeError = function (object) {
|
|
34
|
-
if (typeof object === "object" && object) {
|
|
35
|
-
try {
|
|
36
|
-
// $FlowFixMe FIXME HACK
|
|
37
|
-
var msg = JSON.parse(object.message);
|
|
38
|
-
if (msg.message && msg.name) {
|
|
39
|
-
object = msg;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
catch (e) {
|
|
43
|
-
// nothing
|
|
44
|
-
}
|
|
45
|
-
var error = void 0;
|
|
46
|
-
if (typeof object.name === "string") {
|
|
47
|
-
var name_1 = object.name;
|
|
48
|
-
var des = deserializers[name_1];
|
|
49
|
-
if (des) {
|
|
50
|
-
error = des(object);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
var constructor = name_1 === "Error" ? Error : errorClasses[name_1];
|
|
54
|
-
if (!constructor) {
|
|
55
|
-
console.warn("deserializing an unknown class '" + name_1 + "'");
|
|
56
|
-
constructor = createCustomErrorClass(name_1);
|
|
57
|
-
}
|
|
58
|
-
error = Object.create(constructor.prototype);
|
|
59
|
-
try {
|
|
60
|
-
for (var prop in object) {
|
|
61
|
-
if (object.hasOwnProperty(prop)) {
|
|
62
|
-
error[prop] = object[prop];
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
catch (e) {
|
|
67
|
-
// sometimes setting a property can fail (e.g. .name)
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
error = new Error(object.message);
|
|
73
|
-
}
|
|
74
|
-
if (!error.stack && Error.captureStackTrace) {
|
|
75
|
-
Error.captureStackTrace(error, deserializeError);
|
|
76
|
-
}
|
|
77
|
-
return error;
|
|
78
|
-
}
|
|
79
|
-
return new Error(String(object));
|
|
80
|
-
};
|
|
81
|
-
// inspired from https://github.com/sindresorhus/serialize-error/blob/master/index.js
|
|
82
|
-
export var serializeError = function (value) {
|
|
83
|
-
if (!value)
|
|
84
|
-
return value;
|
|
85
|
-
if (typeof value === "object") {
|
|
86
|
-
return destroyCircular(value, []);
|
|
87
|
-
}
|
|
88
|
-
if (typeof value === "function") {
|
|
89
|
-
return "[Function: " + (value.name || "anonymous") + "]";
|
|
90
|
-
}
|
|
91
|
-
return value;
|
|
92
|
-
};
|
|
93
|
-
// https://www.npmjs.com/package/destroy-circular
|
|
94
|
-
function destroyCircular(from, seen) {
|
|
95
|
-
var e_1, _a;
|
|
96
|
-
var to = {};
|
|
97
|
-
seen.push(from);
|
|
98
|
-
try {
|
|
99
|
-
for (var _b = __values(Object.keys(from)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
100
|
-
var key = _c.value;
|
|
101
|
-
var value = from[key];
|
|
102
|
-
if (typeof value === "function") {
|
|
103
|
-
continue;
|
|
104
|
-
}
|
|
105
|
-
if (!value || typeof value !== "object") {
|
|
106
|
-
to[key] = value;
|
|
107
|
-
continue;
|
|
108
|
-
}
|
|
109
|
-
if (seen.indexOf(from[key]) === -1) {
|
|
110
|
-
to[key] = destroyCircular(from[key], seen.slice(0));
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
113
|
-
to[key] = "[Circular]";
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
117
|
-
finally {
|
|
118
|
-
try {
|
|
119
|
-
if (_c && !_c.done && (_a = _b["return"])) _a.call(_b);
|
|
120
|
-
}
|
|
121
|
-
finally { if (e_1) throw e_1.error; }
|
|
122
|
-
}
|
|
123
|
-
if (typeof from.name === "string") {
|
|
124
|
-
to.name = from.name;
|
|
125
|
-
}
|
|
126
|
-
if (typeof from.message === "string") {
|
|
127
|
-
to.message = from.message;
|
|
128
|
-
}
|
|
129
|
-
if (typeof from.stack === "string") {
|
|
130
|
-
to.stack = from.stack;
|
|
131
|
-
}
|
|
132
|
-
return to;
|
|
133
|
-
}
|
|
134
|
-
//# sourceMappingURL=helpers.js.map
|
package/lib-es/helpers.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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;AAEzB,MAAM,CAAC,IAAM,0BAA0B,GAAG,UACxC,IAAY,EACZ,YAA+B;IAE/B,aAAa,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC;AACrC,CAAC,CAAC;AAOF,MAAM,CAAC,IAAM,sBAAsB,GAAG,UAAC,IAAY;IACjD,IAAM,CAAC,GAAoB,SAAS,WAAW,CAAC,OAAO,EAAE,MAAM;QAC7D,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,IAAI,CAAC;QAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC,KAAK,CAAC;IACjC,CAAC,CAAC;IACF,CAAC,CAAC,SAAS,GAAG,IAAI,KAAK,EAAE,CAAC;IAC1B,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvB,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AAEF,yEAAyE;AACzE,MAAM,CAAC,IAAM,gBAAgB,GAAG,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AAC,EAAE;gBAClC,EAAE,CAAC,GAAG,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;gBACpD,SAAS;aACV;YACD,EAAE,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC;SACxB;;;;;;;;;IACD,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE;QACjC,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;KACrB;IACD,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,EAAE;QACpC,EAAE,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;KAC3B;IACD,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE;QAClC,EAAE,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;KACvB;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
package/lib-es/index.d.ts
DELETED
|
@@ -1,335 +0,0 @@
|
|
|
1
|
-
import { serializeError, deserializeError, createCustomErrorClass, addCustomErrorDeserializer } from "./helpers";
|
|
2
|
-
export { serializeError, deserializeError, createCustomErrorClass, addCustomErrorDeserializer, };
|
|
3
|
-
export declare const AccountNameRequiredError: (message?: string | undefined, fields?: {
|
|
4
|
-
[key: string]: any;
|
|
5
|
-
} | undefined) => void;
|
|
6
|
-
export declare const AccountNotSupported: (message?: string | undefined, fields?: {
|
|
7
|
-
[key: string]: any;
|
|
8
|
-
} | undefined) => void;
|
|
9
|
-
export declare const AmountRequired: (message?: string | undefined, fields?: {
|
|
10
|
-
[key: string]: any;
|
|
11
|
-
} | undefined) => void;
|
|
12
|
-
export declare const BluetoothRequired: (message?: string | undefined, fields?: {
|
|
13
|
-
[key: string]: any;
|
|
14
|
-
} | undefined) => void;
|
|
15
|
-
export declare const BtcUnmatchedApp: (message?: string | undefined, fields?: {
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
} | undefined) => void;
|
|
18
|
-
export declare const CantOpenDevice: (message?: string | undefined, fields?: {
|
|
19
|
-
[key: string]: any;
|
|
20
|
-
} | undefined) => void;
|
|
21
|
-
export declare const CashAddrNotSupported: (message?: string | undefined, fields?: {
|
|
22
|
-
[key: string]: any;
|
|
23
|
-
} | undefined) => void;
|
|
24
|
-
export declare const CurrencyNotSupported: (message?: string | undefined, fields?: {
|
|
25
|
-
[key: string]: any;
|
|
26
|
-
} | undefined) => void;
|
|
27
|
-
export declare const DeviceAppVerifyNotSupported: (message?: string | undefined, fields?: {
|
|
28
|
-
[key: string]: any;
|
|
29
|
-
} | undefined) => void;
|
|
30
|
-
export declare const DeviceGenuineSocketEarlyClose: (message?: string | undefined, fields?: {
|
|
31
|
-
[key: string]: any;
|
|
32
|
-
} | undefined) => void;
|
|
33
|
-
export declare const DeviceNotGenuineError: (message?: string | undefined, fields?: {
|
|
34
|
-
[key: string]: any;
|
|
35
|
-
} | undefined) => void;
|
|
36
|
-
export declare const DeviceOnDashboardExpected: (message?: string | undefined, fields?: {
|
|
37
|
-
[key: string]: any;
|
|
38
|
-
} | undefined) => void;
|
|
39
|
-
export declare const DeviceOnDashboardUnexpected: (message?: string | undefined, fields?: {
|
|
40
|
-
[key: string]: any;
|
|
41
|
-
} | undefined) => void;
|
|
42
|
-
export declare const DeviceInOSUExpected: (message?: string | undefined, fields?: {
|
|
43
|
-
[key: string]: any;
|
|
44
|
-
} | undefined) => void;
|
|
45
|
-
export declare const DeviceHalted: (message?: string | undefined, fields?: {
|
|
46
|
-
[key: string]: any;
|
|
47
|
-
} | undefined) => void;
|
|
48
|
-
export declare const DeviceNameInvalid: (message?: string | undefined, fields?: {
|
|
49
|
-
[key: string]: any;
|
|
50
|
-
} | undefined) => void;
|
|
51
|
-
export declare const DeviceSocketFail: (message?: string | undefined, fields?: {
|
|
52
|
-
[key: string]: any;
|
|
53
|
-
} | undefined) => void;
|
|
54
|
-
export declare const DeviceSocketNoBulkStatus: (message?: string | undefined, fields?: {
|
|
55
|
-
[key: string]: any;
|
|
56
|
-
} | undefined) => void;
|
|
57
|
-
export declare const DisconnectedDevice: (message?: string | undefined, fields?: {
|
|
58
|
-
[key: string]: any;
|
|
59
|
-
} | undefined) => void;
|
|
60
|
-
export declare const DisconnectedDeviceDuringOperation: (message?: string | undefined, fields?: {
|
|
61
|
-
[key: string]: any;
|
|
62
|
-
} | undefined) => void;
|
|
63
|
-
export declare const EnpointConfigError: (message?: string | undefined, fields?: {
|
|
64
|
-
[key: string]: any;
|
|
65
|
-
} | undefined) => void;
|
|
66
|
-
export declare const EthAppPleaseEnableContractData: (message?: string | undefined, fields?: {
|
|
67
|
-
[key: string]: any;
|
|
68
|
-
} | undefined) => void;
|
|
69
|
-
export declare const FeeEstimationFailed: (message?: string | undefined, fields?: {
|
|
70
|
-
[key: string]: any;
|
|
71
|
-
} | undefined) => void;
|
|
72
|
-
export declare const FirmwareNotRecognized: (message?: string | undefined, fields?: {
|
|
73
|
-
[key: string]: any;
|
|
74
|
-
} | undefined) => void;
|
|
75
|
-
export declare const HardResetFail: (message?: string | undefined, fields?: {
|
|
76
|
-
[key: string]: any;
|
|
77
|
-
} | undefined) => void;
|
|
78
|
-
export declare const InvalidXRPTag: (message?: string | undefined, fields?: {
|
|
79
|
-
[key: string]: any;
|
|
80
|
-
} | undefined) => void;
|
|
81
|
-
export declare const InvalidAddress: (message?: string | undefined, fields?: {
|
|
82
|
-
[key: string]: any;
|
|
83
|
-
} | undefined) => void;
|
|
84
|
-
export declare const InvalidAddressBecauseDestinationIsAlsoSource: (message?: string | undefined, fields?: {
|
|
85
|
-
[key: string]: any;
|
|
86
|
-
} | undefined) => void;
|
|
87
|
-
export declare const LatestMCUInstalledError: (message?: string | undefined, fields?: {
|
|
88
|
-
[key: string]: any;
|
|
89
|
-
} | undefined) => void;
|
|
90
|
-
export declare const UnknownMCU: (message?: string | undefined, fields?: {
|
|
91
|
-
[key: string]: any;
|
|
92
|
-
} | undefined) => void;
|
|
93
|
-
export declare const LedgerAPIError: (message?: string | undefined, fields?: {
|
|
94
|
-
[key: string]: any;
|
|
95
|
-
} | undefined) => void;
|
|
96
|
-
export declare const LedgerAPIErrorWithMessage: (message?: string | undefined, fields?: {
|
|
97
|
-
[key: string]: any;
|
|
98
|
-
} | undefined) => void;
|
|
99
|
-
export declare const LedgerAPINotAvailable: (message?: string | undefined, fields?: {
|
|
100
|
-
[key: string]: any;
|
|
101
|
-
} | undefined) => void;
|
|
102
|
-
export declare const ManagerAppAlreadyInstalledError: (message?: string | undefined, fields?: {
|
|
103
|
-
[key: string]: any;
|
|
104
|
-
} | undefined) => void;
|
|
105
|
-
export declare const ManagerAppRelyOnBTCError: (message?: string | undefined, fields?: {
|
|
106
|
-
[key: string]: any;
|
|
107
|
-
} | undefined) => void;
|
|
108
|
-
export declare const ManagerAppDepInstallRequired: (message?: string | undefined, fields?: {
|
|
109
|
-
[key: string]: any;
|
|
110
|
-
} | undefined) => void;
|
|
111
|
-
export declare const ManagerAppDepUninstallRequired: (message?: string | undefined, fields?: {
|
|
112
|
-
[key: string]: any;
|
|
113
|
-
} | undefined) => void;
|
|
114
|
-
export declare const ManagerDeviceLockedError: (message?: string | undefined, fields?: {
|
|
115
|
-
[key: string]: any;
|
|
116
|
-
} | undefined) => void;
|
|
117
|
-
export declare const ManagerFirmwareNotEnoughSpaceError: (message?: string | undefined, fields?: {
|
|
118
|
-
[key: string]: any;
|
|
119
|
-
} | undefined) => void;
|
|
120
|
-
export declare const ManagerNotEnoughSpaceError: (message?: string | undefined, fields?: {
|
|
121
|
-
[key: string]: any;
|
|
122
|
-
} | undefined) => void;
|
|
123
|
-
export declare const ManagerUninstallBTCDep: (message?: string | undefined, fields?: {
|
|
124
|
-
[key: string]: any;
|
|
125
|
-
} | undefined) => void;
|
|
126
|
-
export declare const NetworkDown: (message?: string | undefined, fields?: {
|
|
127
|
-
[key: string]: any;
|
|
128
|
-
} | undefined) => void;
|
|
129
|
-
export declare const NoAddressesFound: (message?: string | undefined, fields?: {
|
|
130
|
-
[key: string]: any;
|
|
131
|
-
} | undefined) => void;
|
|
132
|
-
export declare const NotEnoughBalance: (message?: string | undefined, fields?: {
|
|
133
|
-
[key: string]: any;
|
|
134
|
-
} | undefined) => void;
|
|
135
|
-
export declare const NotEnoughBalanceToDelegate: (message?: string | undefined, fields?: {
|
|
136
|
-
[key: string]: any;
|
|
137
|
-
} | undefined) => void;
|
|
138
|
-
export declare const NotEnoughBalanceInParentAccount: (message?: string | undefined, fields?: {
|
|
139
|
-
[key: string]: any;
|
|
140
|
-
} | undefined) => void;
|
|
141
|
-
export declare const NotEnoughSpendableBalance: (message?: string | undefined, fields?: {
|
|
142
|
-
[key: string]: any;
|
|
143
|
-
} | undefined) => void;
|
|
144
|
-
export declare const NotEnoughBalanceBecauseDestinationNotCreated: (message?: string | undefined, fields?: {
|
|
145
|
-
[key: string]: any;
|
|
146
|
-
} | undefined) => void;
|
|
147
|
-
export declare const NoAccessToCamera: (message?: string | undefined, fields?: {
|
|
148
|
-
[key: string]: any;
|
|
149
|
-
} | undefined) => void;
|
|
150
|
-
export declare const NotEnoughGas: (message?: string | undefined, fields?: {
|
|
151
|
-
[key: string]: any;
|
|
152
|
-
} | undefined) => void;
|
|
153
|
-
export declare const NotSupportedLegacyAddress: (message?: string | undefined, fields?: {
|
|
154
|
-
[key: string]: any;
|
|
155
|
-
} | undefined) => void;
|
|
156
|
-
export declare const GasLessThanEstimate: (message?: string | undefined, fields?: {
|
|
157
|
-
[key: string]: any;
|
|
158
|
-
} | undefined) => void;
|
|
159
|
-
export declare const PasswordsDontMatchError: (message?: string | undefined, fields?: {
|
|
160
|
-
[key: string]: any;
|
|
161
|
-
} | undefined) => void;
|
|
162
|
-
export declare const PasswordIncorrectError: (message?: string | undefined, fields?: {
|
|
163
|
-
[key: string]: any;
|
|
164
|
-
} | undefined) => void;
|
|
165
|
-
export declare const RecommendSubAccountsToEmpty: (message?: string | undefined, fields?: {
|
|
166
|
-
[key: string]: any;
|
|
167
|
-
} | undefined) => void;
|
|
168
|
-
export declare const RecommendUndelegation: (message?: string | undefined, fields?: {
|
|
169
|
-
[key: string]: any;
|
|
170
|
-
} | undefined) => void;
|
|
171
|
-
export declare const TimeoutTagged: (message?: string | undefined, fields?: {
|
|
172
|
-
[key: string]: any;
|
|
173
|
-
} | undefined) => void;
|
|
174
|
-
export declare const UnexpectedBootloader: (message?: string | undefined, fields?: {
|
|
175
|
-
[key: string]: any;
|
|
176
|
-
} | undefined) => void;
|
|
177
|
-
export declare const MCUNotGenuineToDashboard: (message?: string | undefined, fields?: {
|
|
178
|
-
[key: string]: any;
|
|
179
|
-
} | undefined) => void;
|
|
180
|
-
export declare const RecipientRequired: (message?: string | undefined, fields?: {
|
|
181
|
-
[key: string]: any;
|
|
182
|
-
} | undefined) => void;
|
|
183
|
-
export declare const UnavailableTezosOriginatedAccountReceive: (message?: string | undefined, fields?: {
|
|
184
|
-
[key: string]: any;
|
|
185
|
-
} | undefined) => void;
|
|
186
|
-
export declare const UnavailableTezosOriginatedAccountSend: (message?: string | undefined, fields?: {
|
|
187
|
-
[key: string]: any;
|
|
188
|
-
} | undefined) => void;
|
|
189
|
-
export declare const UpdateFetchFileFail: (message?: string | undefined, fields?: {
|
|
190
|
-
[key: string]: any;
|
|
191
|
-
} | undefined) => void;
|
|
192
|
-
export declare const UpdateIncorrectHash: (message?: string | undefined, fields?: {
|
|
193
|
-
[key: string]: any;
|
|
194
|
-
} | undefined) => void;
|
|
195
|
-
export declare const UpdateIncorrectSig: (message?: string | undefined, fields?: {
|
|
196
|
-
[key: string]: any;
|
|
197
|
-
} | undefined) => void;
|
|
198
|
-
export declare const UpdateYourApp: (message?: string | undefined, fields?: {
|
|
199
|
-
[key: string]: any;
|
|
200
|
-
} | undefined) => void;
|
|
201
|
-
export declare const UserRefusedDeviceNameChange: (message?: string | undefined, fields?: {
|
|
202
|
-
[key: string]: any;
|
|
203
|
-
} | undefined) => void;
|
|
204
|
-
export declare const UserRefusedAddress: (message?: string | undefined, fields?: {
|
|
205
|
-
[key: string]: any;
|
|
206
|
-
} | undefined) => void;
|
|
207
|
-
export declare const UserRefusedFirmwareUpdate: (message?: string | undefined, fields?: {
|
|
208
|
-
[key: string]: any;
|
|
209
|
-
} | undefined) => void;
|
|
210
|
-
export declare const UserRefusedAllowManager: (message?: string | undefined, fields?: {
|
|
211
|
-
[key: string]: any;
|
|
212
|
-
} | undefined) => void;
|
|
213
|
-
export declare const UserRefusedOnDevice: (message?: string | undefined, fields?: {
|
|
214
|
-
[key: string]: any;
|
|
215
|
-
} | undefined) => void;
|
|
216
|
-
export declare const TransportOpenUserCancelled: (message?: string | undefined, fields?: {
|
|
217
|
-
[key: string]: any;
|
|
218
|
-
} | undefined) => void;
|
|
219
|
-
export declare const TransportInterfaceNotAvailable: (message?: string | undefined, fields?: {
|
|
220
|
-
[key: string]: any;
|
|
221
|
-
} | undefined) => void;
|
|
222
|
-
export declare const TransportRaceCondition: (message?: string | undefined, fields?: {
|
|
223
|
-
[key: string]: any;
|
|
224
|
-
} | undefined) => void;
|
|
225
|
-
export declare const TransportWebUSBGestureRequired: (message?: string | undefined, fields?: {
|
|
226
|
-
[key: string]: any;
|
|
227
|
-
} | undefined) => void;
|
|
228
|
-
export declare const DeviceShouldStayInApp: (message?: string | undefined, fields?: {
|
|
229
|
-
[key: string]: any;
|
|
230
|
-
} | undefined) => void;
|
|
231
|
-
export declare const WebsocketConnectionError: (message?: string | undefined, fields?: {
|
|
232
|
-
[key: string]: any;
|
|
233
|
-
} | undefined) => void;
|
|
234
|
-
export declare const WebsocketConnectionFailed: (message?: string | undefined, fields?: {
|
|
235
|
-
[key: string]: any;
|
|
236
|
-
} | undefined) => void;
|
|
237
|
-
export declare const WrongDeviceForAccount: (message?: string | undefined, fields?: {
|
|
238
|
-
[key: string]: any;
|
|
239
|
-
} | undefined) => void;
|
|
240
|
-
export declare const WrongAppForCurrency: (message?: string | undefined, fields?: {
|
|
241
|
-
[key: string]: any;
|
|
242
|
-
} | undefined) => void;
|
|
243
|
-
export declare const ETHAddressNonEIP: (message?: string | undefined, fields?: {
|
|
244
|
-
[key: string]: any;
|
|
245
|
-
} | undefined) => void;
|
|
246
|
-
export declare const CantScanQRCode: (message?: string | undefined, fields?: {
|
|
247
|
-
[key: string]: any;
|
|
248
|
-
} | undefined) => void;
|
|
249
|
-
export declare const FeeNotLoaded: (message?: string | undefined, fields?: {
|
|
250
|
-
[key: string]: any;
|
|
251
|
-
} | undefined) => void;
|
|
252
|
-
export declare const FeeRequired: (message?: string | undefined, fields?: {
|
|
253
|
-
[key: string]: any;
|
|
254
|
-
} | undefined) => void;
|
|
255
|
-
export declare const FeeTooHigh: (message?: string | undefined, fields?: {
|
|
256
|
-
[key: string]: any;
|
|
257
|
-
} | undefined) => void;
|
|
258
|
-
export declare const SyncError: (message?: string | undefined, fields?: {
|
|
259
|
-
[key: string]: any;
|
|
260
|
-
} | undefined) => void;
|
|
261
|
-
export declare const PairingFailed: (message?: string | undefined, fields?: {
|
|
262
|
-
[key: string]: any;
|
|
263
|
-
} | undefined) => void;
|
|
264
|
-
export declare const GenuineCheckFailed: (message?: string | undefined, fields?: {
|
|
265
|
-
[key: string]: any;
|
|
266
|
-
} | undefined) => void;
|
|
267
|
-
export declare const LedgerAPI4xx: (message?: string | undefined, fields?: {
|
|
268
|
-
[key: string]: any;
|
|
269
|
-
} | undefined) => void;
|
|
270
|
-
export declare const LedgerAPI5xx: (message?: string | undefined, fields?: {
|
|
271
|
-
[key: string]: any;
|
|
272
|
-
} | undefined) => void;
|
|
273
|
-
export declare const FirmwareOrAppUpdateRequired: (message?: string | undefined, fields?: {
|
|
274
|
-
[key: string]: any;
|
|
275
|
-
} | undefined) => void;
|
|
276
|
-
export declare const NoDBPathGiven: (message?: string | undefined, fields?: {
|
|
277
|
-
[key: string]: any;
|
|
278
|
-
} | undefined) => void;
|
|
279
|
-
export declare const DBWrongPassword: (message?: string | undefined, fields?: {
|
|
280
|
-
[key: string]: any;
|
|
281
|
-
} | undefined) => void;
|
|
282
|
-
export declare const DBNotReset: (message?: string | undefined, fields?: {
|
|
283
|
-
[key: string]: any;
|
|
284
|
-
} | undefined) => void;
|
|
285
|
-
/**
|
|
286
|
-
* TransportError is used for any generic transport errors.
|
|
287
|
-
* e.g. Error thrown when data received by exchanges are incorrect or if exchanged failed to communicate with the device for various reason.
|
|
288
|
-
*/
|
|
289
|
-
export declare function TransportError(message: string, id: string): void;
|
|
290
|
-
export declare namespace TransportError {
|
|
291
|
-
var prototype: Error;
|
|
292
|
-
}
|
|
293
|
-
export declare const StatusCodes: {
|
|
294
|
-
PIN_REMAINING_ATTEMPTS: number;
|
|
295
|
-
INCORRECT_LENGTH: number;
|
|
296
|
-
MISSING_CRITICAL_PARAMETER: number;
|
|
297
|
-
COMMAND_INCOMPATIBLE_FILE_STRUCTURE: number;
|
|
298
|
-
SECURITY_STATUS_NOT_SATISFIED: number;
|
|
299
|
-
CONDITIONS_OF_USE_NOT_SATISFIED: number;
|
|
300
|
-
INCORRECT_DATA: number;
|
|
301
|
-
NOT_ENOUGH_MEMORY_SPACE: number;
|
|
302
|
-
REFERENCED_DATA_NOT_FOUND: number;
|
|
303
|
-
FILE_ALREADY_EXISTS: number;
|
|
304
|
-
INCORRECT_P1_P2: number;
|
|
305
|
-
INS_NOT_SUPPORTED: number;
|
|
306
|
-
CLA_NOT_SUPPORTED: number;
|
|
307
|
-
TECHNICAL_PROBLEM: number;
|
|
308
|
-
OK: number;
|
|
309
|
-
MEMORY_PROBLEM: number;
|
|
310
|
-
NO_EF_SELECTED: number;
|
|
311
|
-
INVALID_OFFSET: number;
|
|
312
|
-
FILE_NOT_FOUND: number;
|
|
313
|
-
INCONSISTENT_FILE: number;
|
|
314
|
-
ALGORITHM_NOT_SUPPORTED: number;
|
|
315
|
-
INVALID_KCV: number;
|
|
316
|
-
CODE_NOT_INITIALIZED: number;
|
|
317
|
-
ACCESS_CONDITION_NOT_FULFILLED: number;
|
|
318
|
-
CONTRADICTION_SECRET_CODE_STATUS: number;
|
|
319
|
-
CONTRADICTION_INVALIDATION: number;
|
|
320
|
-
CODE_BLOCKED: number;
|
|
321
|
-
MAX_VALUE_REACHED: number;
|
|
322
|
-
GP_AUTH_FAILED: number;
|
|
323
|
-
LICENSING: number;
|
|
324
|
-
HALTED: number;
|
|
325
|
-
};
|
|
326
|
-
export declare function getAltStatusMessage(code: number): string | undefined | null;
|
|
327
|
-
/**
|
|
328
|
-
* Error thrown when a device returned a non success status.
|
|
329
|
-
* the error.statusCode is one of the `StatusCodes` exported by this library.
|
|
330
|
-
*/
|
|
331
|
-
export declare function TransportStatusError(statusCode: number): void;
|
|
332
|
-
export declare namespace TransportStatusError {
|
|
333
|
-
var prototype: Error;
|
|
334
|
-
}
|
|
335
|
-
//# sourceMappingURL=index.d.ts.map
|
package/lib-es/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,0BAA0B,EAC3B,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,0BAA0B,GAC3B,CAAC;AAEF,eAAO,MAAM,wBAAwB;;sBAEpC,CAAC;AACF,eAAO,MAAM,mBAAmB;;sBAE/B,CAAC;AACF,eAAO,MAAM,cAAc;;sBAA2C,CAAC;AACvE,eAAO,MAAM,iBAAiB;;sBAA8C,CAAC;AAC7E,eAAO,MAAM,eAAe;;sBAA4C,CAAC;AACzE,eAAO,MAAM,cAAc;;sBAA2C,CAAC;AACvE,eAAO,MAAM,oBAAoB;;sBAEhC,CAAC;AACF,eAAO,MAAM,oBAAoB;;sBAEhC,CAAC;AACF,eAAO,MAAM,2BAA2B;;sBAEvC,CAAC;AACF,eAAO,MAAM,6BAA6B;;sBAEzC,CAAC;AACF,eAAO,MAAM,qBAAqB;;sBAA6C,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H,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAW7D;yBAXe,oBAAoB"}
|
package/lib-es/index.js
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import { serializeError, deserializeError, createCustomErrorClass, addCustomErrorDeserializer, } from "./helpers";
|
|
2
|
-
export { serializeError, deserializeError, createCustomErrorClass, addCustomErrorDeserializer, };
|
|
3
|
-
export var AccountNameRequiredError = createCustomErrorClass("AccountNameRequired");
|
|
4
|
-
export var AccountNotSupported = createCustomErrorClass("AccountNotSupported");
|
|
5
|
-
export var AmountRequired = createCustomErrorClass("AmountRequired");
|
|
6
|
-
export var BluetoothRequired = createCustomErrorClass("BluetoothRequired");
|
|
7
|
-
export var BtcUnmatchedApp = createCustomErrorClass("BtcUnmatchedApp");
|
|
8
|
-
export var CantOpenDevice = createCustomErrorClass("CantOpenDevice");
|
|
9
|
-
export var CashAddrNotSupported = createCustomErrorClass("CashAddrNotSupported");
|
|
10
|
-
export var CurrencyNotSupported = createCustomErrorClass("CurrencyNotSupported");
|
|
11
|
-
export var DeviceAppVerifyNotSupported = createCustomErrorClass("DeviceAppVerifyNotSupported");
|
|
12
|
-
export var DeviceGenuineSocketEarlyClose = createCustomErrorClass("DeviceGenuineSocketEarlyClose");
|
|
13
|
-
export var DeviceNotGenuineError = createCustomErrorClass("DeviceNotGenuine");
|
|
14
|
-
export var DeviceOnDashboardExpected = createCustomErrorClass("DeviceOnDashboardExpected");
|
|
15
|
-
export var DeviceOnDashboardUnexpected = createCustomErrorClass("DeviceOnDashboardUnexpected");
|
|
16
|
-
export var DeviceInOSUExpected = createCustomErrorClass("DeviceInOSUExpected");
|
|
17
|
-
export var DeviceHalted = createCustomErrorClass("DeviceHalted");
|
|
18
|
-
export var DeviceNameInvalid = createCustomErrorClass("DeviceNameInvalid");
|
|
19
|
-
export var DeviceSocketFail = createCustomErrorClass("DeviceSocketFail");
|
|
20
|
-
export var DeviceSocketNoBulkStatus = createCustomErrorClass("DeviceSocketNoBulkStatus");
|
|
21
|
-
export var DisconnectedDevice = createCustomErrorClass("DisconnectedDevice");
|
|
22
|
-
export var DisconnectedDeviceDuringOperation = createCustomErrorClass("DisconnectedDeviceDuringOperation");
|
|
23
|
-
export var EnpointConfigError = createCustomErrorClass("EnpointConfig");
|
|
24
|
-
export var EthAppPleaseEnableContractData = createCustomErrorClass("EthAppPleaseEnableContractData");
|
|
25
|
-
export var FeeEstimationFailed = createCustomErrorClass("FeeEstimationFailed");
|
|
26
|
-
export var FirmwareNotRecognized = createCustomErrorClass("FirmwareNotRecognized");
|
|
27
|
-
export var HardResetFail = createCustomErrorClass("HardResetFail");
|
|
28
|
-
export var InvalidXRPTag = createCustomErrorClass("InvalidXRPTag");
|
|
29
|
-
export var InvalidAddress = createCustomErrorClass("InvalidAddress");
|
|
30
|
-
export var InvalidAddressBecauseDestinationIsAlsoSource = createCustomErrorClass("InvalidAddressBecauseDestinationIsAlsoSource");
|
|
31
|
-
export var LatestMCUInstalledError = createCustomErrorClass("LatestMCUInstalledError");
|
|
32
|
-
export var UnknownMCU = createCustomErrorClass("UnknownMCU");
|
|
33
|
-
export var LedgerAPIError = createCustomErrorClass("LedgerAPIError");
|
|
34
|
-
export var LedgerAPIErrorWithMessage = createCustomErrorClass("LedgerAPIErrorWithMessage");
|
|
35
|
-
export var LedgerAPINotAvailable = createCustomErrorClass("LedgerAPINotAvailable");
|
|
36
|
-
export var ManagerAppAlreadyInstalledError = createCustomErrorClass("ManagerAppAlreadyInstalled");
|
|
37
|
-
export var ManagerAppRelyOnBTCError = createCustomErrorClass("ManagerAppRelyOnBTC");
|
|
38
|
-
export var ManagerAppDepInstallRequired = createCustomErrorClass("ManagerAppDepInstallRequired");
|
|
39
|
-
export var ManagerAppDepUninstallRequired = createCustomErrorClass("ManagerAppDepUninstallRequired");
|
|
40
|
-
export var ManagerDeviceLockedError = createCustomErrorClass("ManagerDeviceLocked");
|
|
41
|
-
export var ManagerFirmwareNotEnoughSpaceError = createCustomErrorClass("ManagerFirmwareNotEnoughSpace");
|
|
42
|
-
export var ManagerNotEnoughSpaceError = createCustomErrorClass("ManagerNotEnoughSpace");
|
|
43
|
-
export var ManagerUninstallBTCDep = createCustomErrorClass("ManagerUninstallBTCDep");
|
|
44
|
-
export var NetworkDown = createCustomErrorClass("NetworkDown");
|
|
45
|
-
export var NoAddressesFound = createCustomErrorClass("NoAddressesFound");
|
|
46
|
-
export var NotEnoughBalance = createCustomErrorClass("NotEnoughBalance");
|
|
47
|
-
export var NotEnoughBalanceToDelegate = createCustomErrorClass("NotEnoughBalanceToDelegate");
|
|
48
|
-
export var NotEnoughBalanceInParentAccount = createCustomErrorClass("NotEnoughBalanceInParentAccount");
|
|
49
|
-
export var NotEnoughSpendableBalance = createCustomErrorClass("NotEnoughSpendableBalance");
|
|
50
|
-
export var NotEnoughBalanceBecauseDestinationNotCreated = createCustomErrorClass("NotEnoughBalanceBecauseDestinationNotCreated");
|
|
51
|
-
export var NoAccessToCamera = createCustomErrorClass("NoAccessToCamera");
|
|
52
|
-
export var NotEnoughGas = createCustomErrorClass("NotEnoughGas");
|
|
53
|
-
export var NotSupportedLegacyAddress = createCustomErrorClass("NotSupportedLegacyAddress");
|
|
54
|
-
export var GasLessThanEstimate = createCustomErrorClass("GasLessThanEstimate");
|
|
55
|
-
export var PasswordsDontMatchError = createCustomErrorClass("PasswordsDontMatch");
|
|
56
|
-
export var PasswordIncorrectError = createCustomErrorClass("PasswordIncorrect");
|
|
57
|
-
export var RecommendSubAccountsToEmpty = createCustomErrorClass("RecommendSubAccountsToEmpty");
|
|
58
|
-
export var RecommendUndelegation = createCustomErrorClass("RecommendUndelegation");
|
|
59
|
-
export var TimeoutTagged = createCustomErrorClass("TimeoutTagged");
|
|
60
|
-
export var UnexpectedBootloader = createCustomErrorClass("UnexpectedBootloader");
|
|
61
|
-
export var MCUNotGenuineToDashboard = createCustomErrorClass("MCUNotGenuineToDashboard");
|
|
62
|
-
export var RecipientRequired = createCustomErrorClass("RecipientRequired");
|
|
63
|
-
export var UnavailableTezosOriginatedAccountReceive = createCustomErrorClass("UnavailableTezosOriginatedAccountReceive");
|
|
64
|
-
export var UnavailableTezosOriginatedAccountSend = createCustomErrorClass("UnavailableTezosOriginatedAccountSend");
|
|
65
|
-
export var UpdateFetchFileFail = createCustomErrorClass("UpdateFetchFileFail");
|
|
66
|
-
export var UpdateIncorrectHash = createCustomErrorClass("UpdateIncorrectHash");
|
|
67
|
-
export var UpdateIncorrectSig = createCustomErrorClass("UpdateIncorrectSig");
|
|
68
|
-
export var UpdateYourApp = createCustomErrorClass("UpdateYourApp");
|
|
69
|
-
export var UserRefusedDeviceNameChange = createCustomErrorClass("UserRefusedDeviceNameChange");
|
|
70
|
-
export var UserRefusedAddress = createCustomErrorClass("UserRefusedAddress");
|
|
71
|
-
export var UserRefusedFirmwareUpdate = createCustomErrorClass("UserRefusedFirmwareUpdate");
|
|
72
|
-
export var UserRefusedAllowManager = createCustomErrorClass("UserRefusedAllowManager");
|
|
73
|
-
export var UserRefusedOnDevice = createCustomErrorClass("UserRefusedOnDevice"); // TODO rename because it's just for transaction refusal
|
|
74
|
-
export var TransportOpenUserCancelled = createCustomErrorClass("TransportOpenUserCancelled");
|
|
75
|
-
export var TransportInterfaceNotAvailable = createCustomErrorClass("TransportInterfaceNotAvailable");
|
|
76
|
-
export var TransportRaceCondition = createCustomErrorClass("TransportRaceCondition");
|
|
77
|
-
export var TransportWebUSBGestureRequired = createCustomErrorClass("TransportWebUSBGestureRequired");
|
|
78
|
-
export var DeviceShouldStayInApp = createCustomErrorClass("DeviceShouldStayInApp");
|
|
79
|
-
export var WebsocketConnectionError = createCustomErrorClass("WebsocketConnectionError");
|
|
80
|
-
export var WebsocketConnectionFailed = createCustomErrorClass("WebsocketConnectionFailed");
|
|
81
|
-
export var WrongDeviceForAccount = createCustomErrorClass("WrongDeviceForAccount");
|
|
82
|
-
export var WrongAppForCurrency = createCustomErrorClass("WrongAppForCurrency");
|
|
83
|
-
export var ETHAddressNonEIP = createCustomErrorClass("ETHAddressNonEIP");
|
|
84
|
-
export var CantScanQRCode = createCustomErrorClass("CantScanQRCode");
|
|
85
|
-
export var FeeNotLoaded = createCustomErrorClass("FeeNotLoaded");
|
|
86
|
-
export var FeeRequired = createCustomErrorClass("FeeRequired");
|
|
87
|
-
export var FeeTooHigh = createCustomErrorClass("FeeTooHigh");
|
|
88
|
-
export var SyncError = createCustomErrorClass("SyncError");
|
|
89
|
-
export var PairingFailed = createCustomErrorClass("PairingFailed");
|
|
90
|
-
export var GenuineCheckFailed = createCustomErrorClass("GenuineCheckFailed");
|
|
91
|
-
export var LedgerAPI4xx = createCustomErrorClass("LedgerAPI4xx");
|
|
92
|
-
export var LedgerAPI5xx = createCustomErrorClass("LedgerAPI5xx");
|
|
93
|
-
export var FirmwareOrAppUpdateRequired = createCustomErrorClass("FirmwareOrAppUpdateRequired");
|
|
94
|
-
// db stuff, no need to translate
|
|
95
|
-
export var NoDBPathGiven = createCustomErrorClass("NoDBPathGiven");
|
|
96
|
-
export var DBWrongPassword = createCustomErrorClass("DBWrongPassword");
|
|
97
|
-
export var DBNotReset = createCustomErrorClass("DBNotReset");
|
|
98
|
-
/**
|
|
99
|
-
* TransportError is used for any generic transport errors.
|
|
100
|
-
* e.g. Error thrown when data received by exchanges are incorrect or if exchanged failed to communicate with the device for various reason.
|
|
101
|
-
*/
|
|
102
|
-
export function TransportError(message, id) {
|
|
103
|
-
this.name = "TransportError";
|
|
104
|
-
this.message = message;
|
|
105
|
-
this.stack = new Error().stack;
|
|
106
|
-
this.id = id;
|
|
107
|
-
}
|
|
108
|
-
TransportError.prototype = new Error();
|
|
109
|
-
addCustomErrorDeserializer("TransportError", function (e) { return new TransportError(e.message, e.id); });
|
|
110
|
-
export var StatusCodes = {
|
|
111
|
-
PIN_REMAINING_ATTEMPTS: 0x63c0,
|
|
112
|
-
INCORRECT_LENGTH: 0x6700,
|
|
113
|
-
MISSING_CRITICAL_PARAMETER: 0x6800,
|
|
114
|
-
COMMAND_INCOMPATIBLE_FILE_STRUCTURE: 0x6981,
|
|
115
|
-
SECURITY_STATUS_NOT_SATISFIED: 0x6982,
|
|
116
|
-
CONDITIONS_OF_USE_NOT_SATISFIED: 0x6985,
|
|
117
|
-
INCORRECT_DATA: 0x6a80,
|
|
118
|
-
NOT_ENOUGH_MEMORY_SPACE: 0x6a84,
|
|
119
|
-
REFERENCED_DATA_NOT_FOUND: 0x6a88,
|
|
120
|
-
FILE_ALREADY_EXISTS: 0x6a89,
|
|
121
|
-
INCORRECT_P1_P2: 0x6b00,
|
|
122
|
-
INS_NOT_SUPPORTED: 0x6d00,
|
|
123
|
-
CLA_NOT_SUPPORTED: 0x6e00,
|
|
124
|
-
TECHNICAL_PROBLEM: 0x6f00,
|
|
125
|
-
OK: 0x9000,
|
|
126
|
-
MEMORY_PROBLEM: 0x9240,
|
|
127
|
-
NO_EF_SELECTED: 0x9400,
|
|
128
|
-
INVALID_OFFSET: 0x9402,
|
|
129
|
-
FILE_NOT_FOUND: 0x9404,
|
|
130
|
-
INCONSISTENT_FILE: 0x9408,
|
|
131
|
-
ALGORITHM_NOT_SUPPORTED: 0x9484,
|
|
132
|
-
INVALID_KCV: 0x9485,
|
|
133
|
-
CODE_NOT_INITIALIZED: 0x9802,
|
|
134
|
-
ACCESS_CONDITION_NOT_FULFILLED: 0x9804,
|
|
135
|
-
CONTRADICTION_SECRET_CODE_STATUS: 0x9808,
|
|
136
|
-
CONTRADICTION_INVALIDATION: 0x9810,
|
|
137
|
-
CODE_BLOCKED: 0x9840,
|
|
138
|
-
MAX_VALUE_REACHED: 0x9850,
|
|
139
|
-
GP_AUTH_FAILED: 0x6300,
|
|
140
|
-
LICENSING: 0x6f42,
|
|
141
|
-
HALTED: 0x6faa
|
|
142
|
-
};
|
|
143
|
-
export function getAltStatusMessage(code) {
|
|
144
|
-
switch (code) {
|
|
145
|
-
// improve text of most common errors
|
|
146
|
-
case 0x6700:
|
|
147
|
-
return "Incorrect length";
|
|
148
|
-
case 0x6800:
|
|
149
|
-
return "Missing critical parameter";
|
|
150
|
-
case 0x6982:
|
|
151
|
-
return "Security not satisfied (dongle locked or have invalid access rights)";
|
|
152
|
-
case 0x6985:
|
|
153
|
-
return "Condition of use not satisfied (denied by the user?)";
|
|
154
|
-
case 0x6a80:
|
|
155
|
-
return "Invalid data received";
|
|
156
|
-
case 0x6b00:
|
|
157
|
-
return "Invalid parameter received";
|
|
158
|
-
}
|
|
159
|
-
if (0x6f00 <= code && code <= 0x6fff) {
|
|
160
|
-
return "Internal error, please report";
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Error thrown when a device returned a non success status.
|
|
165
|
-
* the error.statusCode is one of the `StatusCodes` exported by this library.
|
|
166
|
-
*/
|
|
167
|
-
export function TransportStatusError(statusCode) {
|
|
168
|
-
this.name = "TransportStatusError";
|
|
169
|
-
var statusText = Object.keys(StatusCodes).find(function (k) { return StatusCodes[k] === statusCode; }) ||
|
|
170
|
-
"UNKNOWN_ERROR";
|
|
171
|
-
var smsg = getAltStatusMessage(statusCode) || statusText;
|
|
172
|
-
var statusCodeStr = statusCode.toString(16);
|
|
173
|
-
this.message = "Ledger device: " + smsg + " (0x" + statusCodeStr + ")";
|
|
174
|
-
this.stack = new Error().stack;
|
|
175
|
-
this.statusCode = statusCode;
|
|
176
|
-
this.statusText = statusText;
|
|
177
|
-
}
|
|
178
|
-
TransportStatusError.prototype = new Error();
|
|
179
|
-
addCustomErrorDeserializer("TransportStatusError", function (e) { return new TransportStatusError(e.statusCode); });
|
|
180
|
-
//# sourceMappingURL=index.js.map
|