@onekeyfe/hd-shared 0.1.35 → 0.1.38
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/dist/HardwareError.d.ts +4 -0
- package/dist/HardwareError.d.ts.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +8 -0
- package/package.json +2 -2
- package/src/HardwareError.ts +21 -0
package/dist/HardwareError.d.ts
CHANGED
|
@@ -27,6 +27,9 @@ export declare const HardwareErrorCode: {
|
|
|
27
27
|
readonly DeviceInterruptedFromUser: 109;
|
|
28
28
|
readonly DeviceCheckDeviceIdError: 110;
|
|
29
29
|
readonly DeviceNotSupportPassphrase: 111;
|
|
30
|
+
readonly DeviceCheckPassphraseStateError: 112;
|
|
31
|
+
readonly DeviceNotOpenedPassphrase: 113;
|
|
32
|
+
readonly DeviceOpenedPassphrase: 114;
|
|
30
33
|
readonly NotInitialized: 200;
|
|
31
34
|
readonly IFrameNotInitialized: 300;
|
|
32
35
|
readonly IFrameAleradyInitialized: 301;
|
|
@@ -55,6 +58,7 @@ export declare const HardwareErrorCode: {
|
|
|
55
58
|
readonly BleMonitorError: 708;
|
|
56
59
|
readonly BleCharacteristicNotifyError: 709;
|
|
57
60
|
readonly BleWriteCharacteristicError: 710;
|
|
61
|
+
readonly BleAlreadyConnected: 711;
|
|
58
62
|
readonly RuntimeError: 800;
|
|
59
63
|
readonly PinInvalid: 801;
|
|
60
64
|
readonly PinCancelled: 802;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HardwareError.d.ts","sourceRoot":"","sources":["../src/HardwareError.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,OAAO,CAAC,OAAO,iBAAiB,CAAC,CAAC;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,GAAG,CAAC;CACd;AAED,aAAK,OAAO,CAAC,CAAC,SAAS,MAAM,IAAI,CAA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AAM,yCAE7B,GAAG,kBAMb,CAAC;AAEF,eAAO,MAAM,cAAc,YAAa,GAAG,QAY1C,CAAC;AAEF,eAAO,MAAM,oBAAoB,YAAa,MAAM,KAAG,aAOtD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -36,6 +36,9 @@ declare const HardwareErrorCode: {
|
|
|
36
36
|
readonly DeviceInterruptedFromUser: 109;
|
|
37
37
|
readonly DeviceCheckDeviceIdError: 110;
|
|
38
38
|
readonly DeviceNotSupportPassphrase: 111;
|
|
39
|
+
readonly DeviceCheckPassphraseStateError: 112;
|
|
40
|
+
readonly DeviceNotOpenedPassphrase: 113;
|
|
41
|
+
readonly DeviceOpenedPassphrase: 114;
|
|
39
42
|
readonly NotInitialized: 200;
|
|
40
43
|
readonly IFrameNotInitialized: 300;
|
|
41
44
|
readonly IFrameAleradyInitialized: 301;
|
|
@@ -64,6 +67,7 @@ declare const HardwareErrorCode: {
|
|
|
64
67
|
readonly BleMonitorError: 708;
|
|
65
68
|
readonly BleCharacteristicNotifyError: 709;
|
|
66
69
|
readonly BleWriteCharacteristicError: 710;
|
|
70
|
+
readonly BleAlreadyConnected: 711;
|
|
67
71
|
readonly RuntimeError: 800;
|
|
68
72
|
readonly PinInvalid: 801;
|
|
69
73
|
readonly PinCancelled: 802;
|
package/dist/index.js
CHANGED
|
@@ -96,6 +96,9 @@ const HardwareErrorCode = {
|
|
|
96
96
|
DeviceInterruptedFromUser: 109,
|
|
97
97
|
DeviceCheckDeviceIdError: 110,
|
|
98
98
|
DeviceNotSupportPassphrase: 111,
|
|
99
|
+
DeviceCheckPassphraseStateError: 112,
|
|
100
|
+
DeviceNotOpenedPassphrase: 113,
|
|
101
|
+
DeviceOpenedPassphrase: 114,
|
|
99
102
|
NotInitialized: 200,
|
|
100
103
|
IFrameNotInitialized: 300,
|
|
101
104
|
IFrameAleradyInitialized: 301,
|
|
@@ -124,6 +127,7 @@ const HardwareErrorCode = {
|
|
|
124
127
|
BleMonitorError: 708,
|
|
125
128
|
BleCharacteristicNotifyError: 709,
|
|
126
129
|
BleWriteCharacteristicError: 710,
|
|
130
|
+
BleAlreadyConnected: 711,
|
|
127
131
|
RuntimeError: 800,
|
|
128
132
|
PinInvalid: 801,
|
|
129
133
|
PinCancelled: 802,
|
|
@@ -149,6 +153,9 @@ const HardwareErrorCodeMessage = {
|
|
|
149
153
|
[HardwareErrorCode.DeviceUnexpectedBootloaderMode]: 'Device should be in bootloader mode',
|
|
150
154
|
[HardwareErrorCode.DeviceCheckDeviceIdError]: 'Device Id in the features is not same.',
|
|
151
155
|
[HardwareErrorCode.DeviceNotSupportPassphrase]: 'Device not support passphrase',
|
|
156
|
+
[HardwareErrorCode.DeviceCheckPassphraseStateError]: 'Device passphrase state error',
|
|
157
|
+
[HardwareErrorCode.DeviceNotOpenedPassphrase]: 'Device not opened passphrase',
|
|
158
|
+
[HardwareErrorCode.DeviceOpenedPassphrase]: 'Device opened passphrase',
|
|
152
159
|
[HardwareErrorCode.NotInitialized]: 'Not initialized',
|
|
153
160
|
[HardwareErrorCode.IFrameNotInitialized]: 'IFrame not initialized',
|
|
154
161
|
[HardwareErrorCode.IFrameAleradyInitialized]: 'IFrame alerady initialized',
|
|
@@ -177,6 +184,7 @@ const HardwareErrorCodeMessage = {
|
|
|
177
184
|
[HardwareErrorCode.BleMonitorError]: 'Monitor Error: characteristic not found',
|
|
178
185
|
[HardwareErrorCode.BleCharacteristicNotifyError]: 'Characteristic Notify Error',
|
|
179
186
|
[HardwareErrorCode.BleWriteCharacteristicError]: 'Write Characteristic Error',
|
|
187
|
+
[HardwareErrorCode.BleAlreadyConnected]: 'Already connected to device',
|
|
180
188
|
[HardwareErrorCode.RuntimeError]: 'Runtime error',
|
|
181
189
|
[HardwareErrorCode.PinInvalid]: 'Pin invalid',
|
|
182
190
|
[HardwareErrorCode.PinCancelled]: 'Pin cancelled',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-shared",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.38",
|
|
4
4
|
"description": "Hardware SDK's shared tool library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Hardware-SDK",
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"lint": "eslint .",
|
|
26
26
|
"lint:fix": "eslint . --fix"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "5828c78b10fca8604e158ef425a8c7314ece2bbf"
|
|
29
29
|
}
|
package/src/HardwareError.ts
CHANGED
|
@@ -102,9 +102,25 @@ export const HardwareErrorCode = {
|
|
|
102
102
|
|
|
103
103
|
/**
|
|
104
104
|
* Do not support passphrase
|
|
105
|
+
* @params: { require: string }
|
|
105
106
|
*/
|
|
106
107
|
DeviceNotSupportPassphrase: 111,
|
|
107
108
|
|
|
109
|
+
/*
|
|
110
|
+
* Device passphrase state error
|
|
111
|
+
*/
|
|
112
|
+
DeviceCheckPassphraseStateError: 112,
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* use passphrase, but passphrase is not opened
|
|
116
|
+
*/
|
|
117
|
+
DeviceNotOpenedPassphrase: 113,
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* not use passphrase, but passphrase is opened
|
|
121
|
+
*/
|
|
122
|
+
DeviceOpenedPassphrase: 114,
|
|
123
|
+
|
|
108
124
|
/**
|
|
109
125
|
* Not initialized
|
|
110
126
|
*/
|
|
@@ -206,6 +222,7 @@ export const HardwareErrorCode = {
|
|
|
206
222
|
BleMonitorError: 708,
|
|
207
223
|
BleCharacteristicNotifyError: 709,
|
|
208
224
|
BleWriteCharacteristicError: 710,
|
|
225
|
+
BleAlreadyConnected: 711,
|
|
209
226
|
|
|
210
227
|
/**
|
|
211
228
|
* Hardware runtiome errors
|
|
@@ -280,6 +297,9 @@ export const HardwareErrorCodeMessage: HardwareErrorCodeMessageMapping = {
|
|
|
280
297
|
[HardwareErrorCode.DeviceUnexpectedBootloaderMode]: 'Device should be in bootloader mode',
|
|
281
298
|
[HardwareErrorCode.DeviceCheckDeviceIdError]: 'Device Id in the features is not same.',
|
|
282
299
|
[HardwareErrorCode.DeviceNotSupportPassphrase]: 'Device not support passphrase',
|
|
300
|
+
[HardwareErrorCode.DeviceCheckPassphraseStateError]: 'Device passphrase state error',
|
|
301
|
+
[HardwareErrorCode.DeviceNotOpenedPassphrase]: 'Device not opened passphrase',
|
|
302
|
+
[HardwareErrorCode.DeviceOpenedPassphrase]: 'Device opened passphrase',
|
|
283
303
|
|
|
284
304
|
/**
|
|
285
305
|
* Node Errors
|
|
@@ -331,6 +351,7 @@ export const HardwareErrorCodeMessage: HardwareErrorCodeMessageMapping = {
|
|
|
331
351
|
[HardwareErrorCode.BleMonitorError]: 'Monitor Error: characteristic not found',
|
|
332
352
|
[HardwareErrorCode.BleCharacteristicNotifyError]: 'Characteristic Notify Error',
|
|
333
353
|
[HardwareErrorCode.BleWriteCharacteristicError]: 'Write Characteristic Error',
|
|
354
|
+
[HardwareErrorCode.BleAlreadyConnected]: 'Already connected to device',
|
|
334
355
|
|
|
335
356
|
/**
|
|
336
357
|
* Runtime Error
|