@onekeyfe/hd-shared 0.1.37 → 0.1.40

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.
@@ -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;
@@ -67,6 +70,7 @@ export declare const HardwareErrorCode: {
67
70
  readonly BridgeNotInstalled: 808;
68
71
  readonly PollingTimeout: 809;
69
72
  readonly PollingStop: 810;
73
+ readonly BlindSignDisabled: 811;
70
74
  };
71
75
  export declare const HardwareErrorCodeMessage: HardwareErrorCodeMessageMapping;
72
76
  export declare const TypedError: (hardwareError: ErrorCodeUnion | string, message?: string | undefined, params?: any) => HardwareError;
@@ -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,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAE5C,aAAK,+BAA+B,GAAG;KAAG,CAAC,IAAI,OAAO,CAAC,OAAO,iBAAiB,CAAC,GAAG,MAAM;CAAE,CAAC;AAE5F,aAAK,cAAc,GAAG,OAAO,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAOxD,qBAAa,aAAc,SAAQ,KAAK;IACtC,SAAS,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,+BAwF7B,CAAC;AAEX,eAAO,MAAM,UAAU,kBACN,cAAc,GAAG,MAAM,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;
@@ -76,6 +79,7 @@ declare const HardwareErrorCode: {
76
79
  readonly BridgeNotInstalled: 808;
77
80
  readonly PollingTimeout: 809;
78
81
  readonly PollingStop: 810;
82
+ readonly BlindSignDisabled: 811;
79
83
  };
80
84
  declare const HardwareErrorCodeMessage: HardwareErrorCodeMessageMapping;
81
85
  declare const TypedError: (hardwareError: ErrorCodeUnion | string, message?: string | undefined, params?: any) => HardwareError;
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,
@@ -136,6 +139,7 @@ const HardwareErrorCode = {
136
139
  BridgeNotInstalled: 808,
137
140
  PollingTimeout: 809,
138
141
  PollingStop: 810,
142
+ BlindSignDisabled: 811,
139
143
  };
140
144
  const HardwareErrorCodeMessage = {
141
145
  [HardwareErrorCode.UnknownError]: 'Unknown error occurred. Check message property.',
@@ -150,6 +154,9 @@ const HardwareErrorCodeMessage = {
150
154
  [HardwareErrorCode.DeviceUnexpectedBootloaderMode]: 'Device should be in bootloader mode',
151
155
  [HardwareErrorCode.DeviceCheckDeviceIdError]: 'Device Id in the features is not same.',
152
156
  [HardwareErrorCode.DeviceNotSupportPassphrase]: 'Device not support passphrase',
157
+ [HardwareErrorCode.DeviceCheckPassphraseStateError]: 'Device passphrase state error',
158
+ [HardwareErrorCode.DeviceNotOpenedPassphrase]: 'Device not opened passphrase',
159
+ [HardwareErrorCode.DeviceOpenedPassphrase]: 'Device opened passphrase',
153
160
  [HardwareErrorCode.NotInitialized]: 'Not initialized',
154
161
  [HardwareErrorCode.IFrameNotInitialized]: 'IFrame not initialized',
155
162
  [HardwareErrorCode.IFrameAleradyInitialized]: 'IFrame alerady initialized',
@@ -190,6 +197,7 @@ const HardwareErrorCodeMessage = {
190
197
  [HardwareErrorCode.BridgeNotInstalled]: 'Bridge not installed',
191
198
  [HardwareErrorCode.PollingTimeout]: 'Polling timeout',
192
199
  [HardwareErrorCode.PollingStop]: 'Polling stop',
200
+ [HardwareErrorCode.BlindSignDisabled]: 'Please confirm the BlindSign enabled',
193
201
  };
194
202
  const TypedError = (hardwareError, message, params) => {
195
203
  if (typeof hardwareError === 'string') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-shared",
3
- "version": "0.1.37",
3
+ "version": "0.1.40",
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": "c7aaa0d4af5ade4c9e07229f142ed85ee14db096"
28
+ "gitHead": "70962d6f531e16695ad953c9a6c700876a94e20d"
29
29
  }
@@ -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
  */
@@ -262,6 +278,11 @@ export const HardwareErrorCode = {
262
278
  * ensure connect stop polling
263
279
  */
264
280
  PollingStop: 810,
281
+
282
+ /**
283
+ * Device does not open blid sign
284
+ */
285
+ BlindSignDisabled: 811,
265
286
  } as const;
266
287
 
267
288
  export const HardwareErrorCodeMessage: HardwareErrorCodeMessageMapping = {
@@ -281,6 +302,9 @@ export const HardwareErrorCodeMessage: HardwareErrorCodeMessageMapping = {
281
302
  [HardwareErrorCode.DeviceUnexpectedBootloaderMode]: 'Device should be in bootloader mode',
282
303
  [HardwareErrorCode.DeviceCheckDeviceIdError]: 'Device Id in the features is not same.',
283
304
  [HardwareErrorCode.DeviceNotSupportPassphrase]: 'Device not support passphrase',
305
+ [HardwareErrorCode.DeviceCheckPassphraseStateError]: 'Device passphrase state error',
306
+ [HardwareErrorCode.DeviceNotOpenedPassphrase]: 'Device not opened passphrase',
307
+ [HardwareErrorCode.DeviceOpenedPassphrase]: 'Device opened passphrase',
284
308
 
285
309
  /**
286
310
  * Node Errors
@@ -348,6 +372,7 @@ export const HardwareErrorCodeMessage: HardwareErrorCodeMessageMapping = {
348
372
  [HardwareErrorCode.BridgeNotInstalled]: 'Bridge not installed',
349
373
  [HardwareErrorCode.PollingTimeout]: 'Polling timeout',
350
374
  [HardwareErrorCode.PollingStop]: 'Polling stop',
375
+ [HardwareErrorCode.BlindSignDisabled]: 'Please confirm the BlindSign enabled',
351
376
  } as const;
352
377
 
353
378
  export const TypedError = (