@onekeyfe/hd-core 0.0.7 → 0.0.8

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AASlC,OAAO,EACL,WAAW,EAYZ,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,UAAU,CAAC;AAE7D,OAAO,eAAe,MAAM,2BAA2B,CAAC;AAWxD,eAAO,MAAM,OAAO,YAAmB,WAAW,iBAgIjD,CAAC;AAoHF,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,YAAY;IACtC,aAAa,CAAC,OAAO,EAAE,WAAW;IA2BxC,OAAO;CAGR;AAED,eAAO,MAAM,QAAQ,YAGpB,CAAC;AAEF,eAAO,MAAM,aAAa,uBAGzB,CAAC;AAMF,eAAO,MAAM,IAAI,aAAoB,eAAe,aAAa,GAAG,8BAgBnE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AASlC,OAAO,EACL,WAAW,EAYZ,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,UAAU,CAAC;AAE7D,OAAO,eAAe,MAAM,2BAA2B,CAAC;AAWxD,eAAO,MAAM,OAAO,YAAmB,WAAW,iBAgIjD,CAAC;AA8HF,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,YAAY;IACtC,aAAa,CAAC,OAAO,EAAE,WAAW;IA2BxC,OAAO;CAGR;AAED,eAAO,MAAM,QAAQ,YAGpB,CAAC;AAEF,eAAO,MAAM,aAAa,uBAGzB,CAAC;AAMF,eAAO,MAAM,IAAI,aAAoB,eAAe,aAAa,GAAG,8BAgBnE,CAAC"}
@@ -19,7 +19,7 @@ export declare type UiRequestDeviceAction = {
19
19
  type: typeof UI_REQUEST.REQUEST_PIN;
20
20
  payload: {
21
21
  device: Device;
22
- type?: PROTO.PinMatrixRequestType;
22
+ type?: PROTO.PinMatrixRequestType | 'ButtonRequest_PinEntry';
23
23
  };
24
24
  };
25
25
  export interface UiRequestButton {
@@ -1 +1 @@
1
- {"version":3,"file":"ui-request.d.ts","sourceRoot":"","sources":["../../src/events/ui-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,QAAQ,aAAa,CAAC;AAEnC,eAAO,MAAM,UAAU;;;;;;;CASb,CAAC;AAEX,MAAM,WAAW,uBAAuB;IACtC,IAAI,EACA,OAAO,UAAU,CAAC,eAAe,GACjC,OAAO,UAAU,CAAC,oBAAoB,GACtC,OAAO,UAAU,CAAC,mBAAmB,CAAC;IAC1C,OAAO,CAAC,EAAE,OAAO,SAAS,CAAC;CAC5B;AAED,oBAAY,qBAAqB,GAAG;IAClC,IAAI,EAAE,OAAO,UAAU,CAAC,WAAW,CAAC;IACpC,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC;KACnC,CAAC;CACH,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,UAAU,CAAC,cAAc,CAAC;IACvC,OAAO,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;CACzC;AAED,oBAAY,OAAO,GAAG,uBAAuB,GAAG,qBAAqB,GAAG,eAAe,CAAC;AAExF,oBAAY,cAAc,GAAG,OAAO,GAAG;IAAE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C,OAAO,QAAQ,EAAE,OAAO,CAK5D,CAAC"}
package/dist/index.d.ts CHANGED
@@ -654,7 +654,7 @@ declare type UiRequestDeviceAction = {
654
654
  type: typeof UI_REQUEST.REQUEST_PIN;
655
655
  payload: {
656
656
  device: Device$1;
657
- type?: Messages.PinMatrixRequestType;
657
+ type?: Messages.PinMatrixRequestType | 'ButtonRequest_PinEntry';
658
658
  };
659
659
  };
660
660
  interface UiRequestButton {
package/dist/index.js CHANGED
@@ -12514,7 +12514,15 @@ const onDevicePinHandler = (...[device, type, callback]) => __awaiter(void 0, vo
12514
12514
  });
12515
12515
  const onDeviceButtonHandler = (...[device, request]) => {
12516
12516
  postMessage(createDeviceMessage(DEVICE.BUTTON, Object.assign(Object.assign({}, request), { device: device.toMessageObject() })));
12517
- postMessage(createUiMessage(UI_REQUEST$1.REQUEST_BUTTON, { device: device.toMessageObject() }));
12517
+ if (request.code === 'ButtonRequest_PinEntry') {
12518
+ postMessage(createUiMessage(UI_REQUEST$1.REQUEST_PIN, {
12519
+ device: device.toMessageObject(),
12520
+ type: 'ButtonRequest_PinEntry',
12521
+ }));
12522
+ }
12523
+ else {
12524
+ postMessage(createUiMessage(UI_REQUEST$1.REQUEST_BUTTON, { device: device.toMessageObject() }));
12525
+ }
12518
12526
  };
12519
12527
  const postMessage = (message) => {
12520
12528
  _core.emit(CORE_EVENT, message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-core",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "> TODO: description",
5
5
  "author": "OneKey",
6
6
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
@@ -25,7 +25,7 @@
25
25
  "url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
26
26
  },
27
27
  "dependencies": {
28
- "@onekeyfe/hd-transport": "^0.0.7",
28
+ "@onekeyfe/hd-transport": "^0.0.8",
29
29
  "axios": "^0.27.2",
30
30
  "bignumber.js": "^9.0.2",
31
31
  "parse-uri": "^1.0.7",
@@ -35,5 +35,5 @@
35
35
  "@types/parse-uri": "^1.0.0",
36
36
  "@types/semver": "^7.3.9"
37
37
  },
38
- "gitHead": "7be7677368fcb50f411891f009367424ea77df33"
38
+ "gitHead": "edfa30382fdf36182bc389c8ff1dd1a689096592"
39
39
  }
package/src/core/index.ts CHANGED
@@ -251,7 +251,17 @@ const onDevicePinHandler = async (...[device, type, callback]: DeviceEvents['pin
251
251
 
252
252
  const onDeviceButtonHandler = (...[device, request]: [...DeviceEvents['button']]) => {
253
253
  postMessage(createDeviceMessage(DEVICE.BUTTON, { ...request, device: device.toMessageObject() }));
254
- postMessage(createUiMessage(UI_REQUEST.REQUEST_BUTTON, { device: device.toMessageObject() }));
254
+
255
+ if (request.code === 'ButtonRequest_PinEntry') {
256
+ postMessage(
257
+ createUiMessage(UI_REQUEST.REQUEST_PIN, {
258
+ device: device.toMessageObject() as KnownDevice,
259
+ type: 'ButtonRequest_PinEntry',
260
+ })
261
+ );
262
+ } else {
263
+ postMessage(createUiMessage(UI_REQUEST.REQUEST_BUTTON, { device: device.toMessageObject() }));
264
+ }
255
265
  };
256
266
 
257
267
  /**
@@ -28,7 +28,7 @@ export type UiRequestDeviceAction = {
28
28
  type: typeof UI_REQUEST.REQUEST_PIN;
29
29
  payload: {
30
30
  device: Device;
31
- type?: PROTO.PinMatrixRequestType;
31
+ type?: PROTO.PinMatrixRequestType | 'ButtonRequest_PinEntry';
32
32
  };
33
33
  };
34
34