@onekeyfe/hd-core 1.0.34-alpha.1 → 1.0.35

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.
Files changed (58) hide show
  1. package/dist/api/GetPassphraseState.d.ts +1 -1
  2. package/dist/api/GetPassphraseState.d.ts.map +1 -1
  3. package/dist/api/allnetwork/AllNetworkGetAddress.d.ts +1 -3
  4. package/dist/api/allnetwork/AllNetworkGetAddress.d.ts.map +1 -1
  5. package/dist/api/btc/BTCGetPublicKey.d.ts.map +1 -1
  6. package/dist/api/btc/helpers/xpubUtils.d.ts +1 -0
  7. package/dist/api/btc/helpers/xpubUtils.d.ts.map +1 -1
  8. package/dist/api/helpers/hexUtils.d.ts +1 -0
  9. package/dist/api/helpers/hexUtils.d.ts.map +1 -1
  10. package/dist/api/index.d.ts +0 -1
  11. package/dist/api/index.d.ts.map +1 -1
  12. package/dist/core/index.d.ts.map +1 -1
  13. package/dist/device/Device.d.ts +3 -9
  14. package/dist/device/Device.d.ts.map +1 -1
  15. package/dist/device/DeviceCommands.d.ts +5 -7
  16. package/dist/device/DeviceCommands.d.ts.map +1 -1
  17. package/dist/events/device.d.ts +0 -3
  18. package/dist/events/device.d.ts.map +1 -1
  19. package/dist/events/ui-request.d.ts +1 -2
  20. package/dist/events/ui-request.d.ts.map +1 -1
  21. package/dist/events/ui-response.d.ts +0 -1
  22. package/dist/events/ui-response.d.ts.map +1 -1
  23. package/dist/index.d.ts +10 -26
  24. package/dist/index.js +97 -219
  25. package/dist/inject.d.ts.map +1 -1
  26. package/dist/types/api/firmwareUpdate.d.ts +1 -1
  27. package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
  28. package/dist/types/api/index.d.ts +0 -2
  29. package/dist/types/api/index.d.ts.map +1 -1
  30. package/dist/utils/deviceFeaturesUtils.d.ts +2 -16
  31. package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
  32. package/dist/utils/patch.d.ts +1 -1
  33. package/dist/utils/patch.d.ts.map +1 -1
  34. package/package.json +4 -4
  35. package/src/api/GetPassphraseState.ts +3 -19
  36. package/src/api/allnetwork/AllNetworkGetAddress.ts +20 -18
  37. package/src/api/btc/BTCGetPublicKey.ts +10 -1
  38. package/src/api/btc/helpers/xpubUtils.ts +37 -10
  39. package/src/api/evm/EVMSignTypedData.ts +2 -2
  40. package/src/api/helpers/hexUtils.ts +29 -0
  41. package/src/api/index.ts +0 -1
  42. package/src/core/index.ts +7 -12
  43. package/src/data/messages/messages.json +2 -57
  44. package/src/device/Device.ts +7 -75
  45. package/src/device/DeviceCommands.ts +4 -15
  46. package/src/events/device.ts +0 -4
  47. package/src/events/ui-request.ts +1 -2
  48. package/src/events/ui-response.ts +0 -1
  49. package/src/inject.ts +0 -2
  50. package/src/types/api/firmwareUpdate.ts +1 -1
  51. package/src/types/api/index.ts +0 -2
  52. package/src/utils/deviceFeaturesUtils.ts +7 -71
  53. package/dist/api/device/DeviceUnlock.d.ts +0 -7
  54. package/dist/api/device/DeviceUnlock.d.ts.map +0 -1
  55. package/dist/types/api/deviceUnlock.d.ts +0 -4
  56. package/dist/types/api/deviceUnlock.d.ts.map +0 -1
  57. package/src/api/device/DeviceUnlock.ts +0 -26
  58. package/src/types/api/deviceUnlock.ts +0 -4
package/dist/index.js CHANGED
@@ -73,7 +73,6 @@ const createCoreApi = (call) => ({
73
73
  getPassphraseState: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'getPassphraseState' })),
74
74
  deviceCancel: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'deviceCancel' })),
75
75
  deviceLock: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'deviceLock' })),
76
- deviceUnlock: (connectId, params) => call(Object.assign(Object.assign({}, params), { useEmptyPassphrase: true, connectId, method: 'deviceUnlock' })),
77
76
  getNextU2FCounter: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'getNextU2FCounter' })),
78
77
  setU2FCounter: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'setU2FCounter' })),
79
78
  allNetworkGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'allNetworkGetAddress' })),
@@ -4330,8 +4329,7 @@ var nested$1 = {
4330
4329
  ButtonRequest_Success: 17,
4331
4330
  ButtonRequest_Warning: 18,
4332
4331
  ButtonRequest_PassphraseEntry: 19,
4333
- ButtonRequest_PinEntry: 20,
4334
- ButtonRequest_AttachPin: 8000
4332
+ ButtonRequest_PinEntry: 20
4335
4333
  }
4336
4334
  }
4337
4335
  }
@@ -4382,10 +4380,6 @@ var nested$1 = {
4382
4380
  options: {
4383
4381
  deprecated: true
4384
4382
  }
4385
- },
4386
- exists_attach_pin_user: {
4387
- type: "bool",
4388
- id: 8000
4389
4383
  }
4390
4384
  }
4391
4385
  },
@@ -4405,10 +4399,6 @@ var nested$1 = {
4405
4399
  on_device: {
4406
4400
  type: "bool",
4407
4401
  id: 3
4408
- },
4409
- on_device_attach_pin: {
4410
- type: "bool",
4411
- id: 8000
4412
4402
  }
4413
4403
  }
4414
4404
  },
@@ -7376,10 +7366,6 @@ var nested$1 = {
7376
7366
  derive_cardano: {
7377
7367
  type: "bool",
7378
7368
  id: 3
7379
- },
7380
- passphrase_state: {
7381
- type: "string",
7382
- id: 8000
7383
7369
  }
7384
7370
  }
7385
7371
  },
@@ -7760,14 +7746,6 @@ var nested$1 = {
7760
7746
  onekey_se04_state: {
7761
7747
  type: "OneKeySEState",
7762
7748
  id: 624
7763
- },
7764
- attach_to_pin_user: {
7765
- type: "bool",
7766
- id: 625
7767
- },
7768
- unlocked_attach_pin: {
7769
- type: "bool",
7770
- id: 626
7771
7749
  }
7772
7750
  },
7773
7751
  nested: {
@@ -8890,38 +8868,6 @@ var nested$1 = {
8890
8868
  }
8891
8869
  }
8892
8870
  },
8893
- GetPassphraseState: {
8894
- fields: {
8895
- passphrase_state: {
8896
- type: "string",
8897
- id: 1
8898
- },
8899
- _only_main_pin: {
8900
- type: "bool",
8901
- id: 2
8902
- },
8903
- allow_create_attach_pin: {
8904
- type: "bool",
8905
- id: 3
8906
- }
8907
- }
8908
- },
8909
- PassphraseState: {
8910
- fields: {
8911
- passphrase_state: {
8912
- type: "string",
8913
- id: 1
8914
- },
8915
- session_id: {
8916
- type: "bytes",
8917
- id: 2
8918
- },
8919
- unlocked_attach_pin: {
8920
- type: "bool",
8921
- id: 3
8922
- }
8923
- }
8924
- },
8925
8871
  MoneroTransactionSourceEntry: {
8926
8872
  fields: {
8927
8873
  outputs: {
@@ -13546,9 +13492,7 @@ var nested$1 = {
13546
13492
  MessageType_ListResDir: 10023,
13547
13493
  MessageType_FileInfoList: 10024,
13548
13494
  MessageType_OnekeyGetFeatures: 10025,
13549
- MessageType_OnekeyFeatures: 10026,
13550
- MessageType_GetPassphraseState: 10028,
13551
- MessageType_PassphraseState: 10029
13495
+ MessageType_OnekeyFeatures: 10026
13552
13496
  }
13553
13497
  },
13554
13498
  google: {
@@ -25011,42 +24955,21 @@ const supportNewPassphrase = (features) => {
25011
24955
  const currentVersion = getDeviceFirmwareVersion(features).join('.');
25012
24956
  return { support: semver__default["default"].gte(currentVersion, '2.4.0'), require: '2.4.0' };
25013
24957
  };
25014
- const getPassphraseStateWithRefreshDeviceInfo = (device, options) => __awaiter(void 0, void 0, void 0, function* () {
24958
+ const getPassphraseStateWithRefreshDeviceInfo = (device) => __awaiter(void 0, void 0, void 0, function* () {
25015
24959
  const { features, commands } = device;
25016
24960
  const locked = (features === null || features === void 0 ? void 0 : features.unlocked) === false;
25017
- const { passphraseState, newSession, unlockedAttachPin } = yield getPassphraseState(features, commands, Object.assign({}, options));
25018
- if (newSession && passphraseState && (features === null || features === void 0 ? void 0 : features.device_id)) {
25019
- console.log('=====>>>>>> run updateInternalState newSession:', newSession);
25020
- device.updateInternalState(passphraseState, features.device_id, newSession);
25021
- }
24961
+ const passphraseState = yield getPassphraseState(features, commands);
25022
24962
  const isModeT = getDeviceType(features) === hdShared.EDeviceType.Touch || getDeviceType(features) === hdShared.EDeviceType.Pro;
25023
24963
  const needRefreshWithPassphrase = passphraseState && (features === null || features === void 0 ? void 0 : features.passphrase_protection) !== true;
25024
24964
  const needRefreshWithLocked = isModeT && locked;
25025
24965
  if (needRefreshWithLocked || needRefreshWithPassphrase) {
25026
24966
  yield device.getFeatures();
25027
24967
  }
25028
- return { passphraseState, newSession, unlockedAttachPin };
24968
+ return passphraseState;
25029
24969
  });
25030
- const getPassphraseState = (features, commands, options) => __awaiter(void 0, void 0, void 0, function* () {
24970
+ const getPassphraseState = (features, commands) => __awaiter(void 0, void 0, void 0, function* () {
25031
24971
  if (!features)
25032
- return { passphraseState: undefined, newSession: undefined, unlockedAttachPin: undefined };
25033
- const firmwareVersion = getDeviceFirmwareVersion(features);
25034
- const deviceType = getDeviceType(features);
25035
- if (deviceType === hdShared.EDeviceType.Pro && semver__default["default"].gte(firmwareVersion.join('.'), '4.14.0')) {
25036
- console.log('=====>>>>>> getPassphraseState begin: ', options === null || options === void 0 ? void 0 : options.onlyMainPin, options === null || options === void 0 ? void 0 : options.expectPassphraseState);
25037
- const { message, type } = yield commands.typedCall('GetPassphraseState', 'PassphraseState', {
25038
- passphrase_state: (options === null || options === void 0 ? void 0 : options.onlyMainPin) ? undefined : options === null || options === void 0 ? void 0 : options.expectPassphraseState,
25039
- });
25040
- console.log('=====>>>>>> getPassphraseState end: result ', message);
25041
- if (type === 'CallMethodError') {
25042
- throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Get the passphrase state error');
25043
- }
25044
- return {
25045
- passphraseState: message.passphrase_state,
25046
- newSession: message.session_id,
25047
- unlockedAttachPin: message.unlocked_attach_pin,
25048
- };
25049
- }
24972
+ return false;
25050
24973
  const { message, type } = yield commands.typedCall('GetAddress', 'Address', {
25051
24974
  address_n: [toHardened(44), toHardened(1), toHardened(0), 0, 0],
25052
24975
  coin_name: 'Testnet',
@@ -25056,11 +24979,7 @@ const getPassphraseState = (features, commands, options) => __awaiter(void 0, vo
25056
24979
  if (type === 'CallMethodError') {
25057
24980
  throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Get the passphrase state error');
25058
24981
  }
25059
- return {
25060
- passphraseState: message.address,
25061
- newSession: undefined,
25062
- unlockedAttachPin: undefined,
25063
- };
24982
+ return message.address;
25064
24983
  });
25065
24984
  const supportBatchPublicKey = (features, options) => {
25066
24985
  if (!features)
@@ -26436,14 +26355,8 @@ class DeviceCommands {
26436
26355
  }, error => Promise.reject(error));
26437
26356
  }
26438
26357
  if (res.type === 'PassphraseRequest') {
26439
- const existsAttachPinUser = res.message.exists_attach_pin_user;
26440
- return this._promptPassphrase({
26441
- existsAttachPinUser,
26442
- }).then(response => {
26443
- const { passphrase, passphraseOnDevice, attachPinOnDevice } = response;
26444
- if (attachPinOnDevice && existsAttachPinUser) {
26445
- return this._commonCall('PassphraseAck', { on_device_attach_pin: true });
26446
- }
26358
+ return this._promptPassphrase().then(response => {
26359
+ const { passphrase, passphraseOnDevice } = response;
26447
26360
  return !passphraseOnDevice
26448
26361
  ? this._commonCall('PassphraseAck', { passphrase })
26449
26362
  : this._commonCall('PassphraseAck', { on_device: true });
@@ -26487,7 +26400,7 @@ class DeviceCommands {
26487
26400
  }
26488
26401
  });
26489
26402
  }
26490
- _promptPassphrase(options) {
26403
+ _promptPassphrase() {
26491
26404
  return new Promise((resolve, reject) => {
26492
26405
  const cancelAndReject = (_error) => cancelDeviceInPrompt(this.device, false)
26493
26406
  .then(onCancel => {
@@ -26505,7 +26418,7 @@ class DeviceCommands {
26505
26418
  });
26506
26419
  if (this.device.listenerCount(DEVICE.PASSPHRASE) > 0) {
26507
26420
  this.device.setCancelableAction(cancelAndReject);
26508
- this.device.emit(DEVICE.PASSPHRASE, this.device, options, (response, error) => {
26421
+ this.device.emit(DEVICE.PASSPHRASE, this.device, (response, error) => {
26509
26422
  this.device.clearCancelableAction();
26510
26423
  if (error) {
26511
26424
  cancelAndReject();
@@ -26701,17 +26614,6 @@ class Device extends events.exports {
26701
26614
  }
26702
26615
  Log$a.debug('tryFixInternalState session cache: ', deviceSessionCache);
26703
26616
  }
26704
- updateInternalState(state, deviceId, sessionId = null) {
26705
- Log$a.debug('updateInternalState session param: ', `device_id: ${deviceId}`, `passphraseState: ${state}`, `sessionId: ${sessionId}`);
26706
- if (sessionId) {
26707
- deviceSessionCache[this.generateStateKey(deviceId, state)] = sessionId;
26708
- const oldKey = `${deviceId}`;
26709
- if (deviceSessionCache[oldKey]) {
26710
- delete deviceSessionCache[oldKey];
26711
- }
26712
- }
26713
- Log$a.debug('updateInternalState session cache: ', deviceSessionCache);
26714
- }
26715
26617
  setInternalState(state, initSession) {
26716
26618
  var _a, _b;
26717
26619
  Log$a.debug('setInternalState session param: ', `state: ${state}`, `initSession: ${initSession}`, `device_id: ${(_a = this.features) === null || _a === void 0 ? void 0 : _a.device_id}`, `passphraseState: ${this.passphraseState}`);
@@ -26743,6 +26645,7 @@ class Device extends events.exports {
26743
26645
  }
26744
26646
  initialize(options) {
26745
26647
  return __awaiter(this, void 0, void 0, function* () {
26648
+ Log$a.debug('initialize param:', options);
26746
26649
  this.passphraseState = options === null || options === void 0 ? void 0 : options.passphraseState;
26747
26650
  if (options === null || options === void 0 ? void 0 : options.initSession) {
26748
26651
  this.clearInternalState(options === null || options === void 0 ? void 0 : options.deviceId);
@@ -26755,12 +26658,7 @@ class Device extends events.exports {
26755
26658
  if (options === null || options === void 0 ? void 0 : options.deriveCardano) {
26756
26659
  payload.derive_cardano = true;
26757
26660
  }
26758
- payload.passphrase_state = options === null || options === void 0 ? void 0 : options.passphraseState;
26759
- console.log('=====>>>>>> initialize device begin: ', payload, {
26760
- deviceId: options === null || options === void 0 ? void 0 : options.deviceId,
26761
- passphraseState: options === null || options === void 0 ? void 0 : options.passphraseState,
26762
- initSession: options === null || options === void 0 ? void 0 : options.initSession,
26763
- });
26661
+ Log$a.debug('initialize payload:', payload);
26764
26662
  try {
26765
26663
  const { message } = yield Promise.race([
26766
26664
  this.commands.typedCall('Initialize', 'Features', payload),
@@ -26770,7 +26668,6 @@ class Device extends events.exports {
26770
26668
  }, 25 * 1000);
26771
26669
  }),
26772
26670
  ]);
26773
- console.log('=====>>>>>> initialize device end: ', message);
26774
26671
  this._updateFeatures(message, options === null || options === void 0 ? void 0 : options.initSession);
26775
26672
  yield TransportManager.reconfigure(this.features);
26776
26673
  }
@@ -27022,38 +26919,12 @@ class Device extends events.exports {
27022
26919
  }
27023
26920
  return false;
27024
26921
  }
27025
- lockDevice() {
27026
- return __awaiter(this, void 0, void 0, function* () {
27027
- const res = yield this.commands.typedCall('LockDevice', 'Success', {});
27028
- return res.message;
27029
- });
27030
- }
27031
- checkPassphraseStateSafety(passphraseState, useEmptyPassphraseState) {
26922
+ checkPassphraseStateSafety(passphraseState) {
27032
26923
  return __awaiter(this, void 0, void 0, function* () {
27033
26924
  if (!this.features)
27034
26925
  return false;
27035
- const { passphraseState: newPassphraseState, unlockedAttachPin } = yield getPassphraseStateWithRefreshDeviceInfo(this, {
27036
- expectPassphraseState: passphraseState,
27037
- onlyMainPin: useEmptyPassphraseState,
27038
- });
27039
- const mainWalletUseAttachPin = unlockedAttachPin && useEmptyPassphraseState;
27040
- const useErrorAttachPin = unlockedAttachPin && passphraseState && passphraseState !== newPassphraseState;
27041
- console.log('=====>>>>>> checkPassphraseStateSafety passphraseState: ', {
27042
- passphraseState,
27043
- newPassphraseState,
27044
- unlockedAttachPin,
27045
- useEmptyPassphraseState,
27046
- });
27047
- if (mainWalletUseAttachPin || useErrorAttachPin) {
27048
- try {
27049
- yield this.lockDevice();
27050
- }
27051
- catch (error) {
27052
- }
27053
- this.clearInternalState();
27054
- return Promise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DeviceCheckUnlockTypeError));
27055
- }
27056
- if (passphraseState && passphraseState !== newPassphraseState) {
26926
+ const newState = yield getPassphraseStateWithRefreshDeviceInfo(this);
26927
+ if (passphraseState && passphraseState !== newState) {
27057
26928
  this.clearInternalState();
27058
26929
  return false;
27059
26930
  }
@@ -27320,17 +27191,11 @@ class GetPassphraseState extends BaseMethod {
27320
27191
  return __awaiter(this, void 0, void 0, function* () {
27321
27192
  if (!this.device.features)
27322
27193
  return Promise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DeviceInitializeFailed));
27323
- const { passphraseState, newSession } = yield getPassphraseStateWithRefreshDeviceInfo(this.device);
27324
- console.log('=====>>>>>> GetPassphraseState run passphraseState: ', passphraseState);
27325
- console.log('=====>>>>>> GetPassphraseState run newSession: ', newSession);
27326
- console.log('=====>>>>>> GetPassphraseState run features: ', this.device.features.passphrase_protection);
27194
+ const passphraseState = yield getPassphraseStateWithRefreshDeviceInfo(this.device);
27327
27195
  const { features } = this.device;
27328
27196
  if (features && features.passphrase_protection === true) {
27329
- if (!newSession) {
27330
- console.log('=====>>>>>> GetPassphraseState run tryFixInternalState', newSession);
27331
- if (passphraseState && features.device_id) {
27332
- this.device.tryFixInternalState(passphraseState, features.device_id, features.session_id);
27333
- }
27197
+ if (passphraseState && features.device_id) {
27198
+ this.device.tryFixInternalState(passphraseState, features.device_id, features.session_id);
27334
27199
  }
27335
27200
  return Promise.resolve(passphraseState);
27336
27201
  }
@@ -27649,6 +27514,27 @@ function hexToBytes(hex) {
27649
27514
  }
27650
27515
  return array;
27651
27516
  }
27517
+ function parseChainId(chainId) {
27518
+ if (!chainId) {
27519
+ return 0;
27520
+ }
27521
+ if (typeof chainId === 'string') {
27522
+ if (chainId.trim() === '') {
27523
+ return 0;
27524
+ }
27525
+ if (chainId.match(/^[0-9]+$/)) {
27526
+ return new BigNumber__default["default"](chainId, 10).toNumber();
27527
+ }
27528
+ if (chainId.startsWith('0x') || chainId.match(/^[0-9a-fA-F]+$/)) {
27529
+ return new BigNumber__default["default"](chainId, 16).toNumber();
27530
+ }
27531
+ throw new Error(`Invalid chainId ${chainId}`);
27532
+ }
27533
+ if (typeof chainId === 'number') {
27534
+ return new BigNumber__default["default"](chainId).toNumber();
27535
+ }
27536
+ throw new Error(`Invalid chainId ${chainId}`);
27537
+ }
27652
27538
 
27653
27539
  const invalidParameter = (message) => hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodInvalidParameter, message);
27654
27540
  const invalidResponse = (message) => hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodError, message);
@@ -28581,27 +28467,6 @@ class DeviceLock extends BaseMethod {
28581
28467
  }
28582
28468
  }
28583
28469
 
28584
- class DeviceUnlock extends BaseMethod {
28585
- init() {
28586
- this.useDevicePassphraseState = false;
28587
- }
28588
- run() {
28589
- return __awaiter(this, void 0, void 0, function* () {
28590
- const { type } = yield this.device.commands.typedCall('GetAddress', 'Address', {
28591
- address_n: [toHardened(44), toHardened(1), toHardened(0), 0, 0],
28592
- coin_name: 'Testnet',
28593
- script_type: 'SPENDADDRESS',
28594
- show_display: false,
28595
- });
28596
- if (type === 'CallMethodError') {
28597
- throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Get the passphrase state error');
28598
- }
28599
- const res = yield this.device.commands.typedCall('GetFeatures', 'Features');
28600
- return Promise.resolve(res.message);
28601
- });
28602
- }
28603
- }
28604
-
28605
28470
  class DeviceCancel extends BaseMethod {
28606
28471
  init() {
28607
28472
  this.useDevicePassphraseState = false;
@@ -29972,7 +29837,7 @@ class AllNetworkGetAddress extends BaseMethod {
29972
29837
  ]);
29973
29838
  });
29974
29839
  }
29975
- generateMethodName({ network, payload, originalIndex, }) {
29840
+ generateMethodName({ network, payload, }) {
29976
29841
  var _a, _b;
29977
29842
  const { name: networkName, coin } = networkAliases[network] || {
29978
29843
  name: network,
@@ -29986,7 +29851,6 @@ class AllNetworkGetAddress extends BaseMethod {
29986
29851
  methodName: config.methodName,
29987
29852
  params: Object.assign(Object.assign({}, ((_b = (_a = config === null || config === void 0 ? void 0 : config.getParams) === null || _a === void 0 ? void 0 : _a.call(config, payload, coin, config.methodName)) !== null && _b !== void 0 ? _b : payload)), { originPayload: payload }),
29988
29853
  _originRequestParams: payload,
29989
- _originalIndex: originalIndex,
29990
29854
  };
29991
29855
  }
29992
29856
  callMethod(methodName, params) {
@@ -30034,11 +29898,10 @@ class AllNetworkGetAddress extends BaseMethod {
30034
29898
  const responses = [];
30035
29899
  const resultMap = {};
30036
29900
  const { bundle } = this.payload;
30037
- const methodGroups = bundle
30038
- .map((param, index) => this.generateMethodName({
29901
+ const methodReduceParams = bundle
29902
+ .map(param => this.generateMethodName({
30039
29903
  network: param.network,
30040
29904
  payload: param,
30041
- originalIndex: index,
30042
29905
  }))
30043
29906
  .reduce((acc, cur) => {
30044
29907
  if (!acc[cur.methodName]) {
@@ -30047,25 +29910,28 @@ class AllNetworkGetAddress extends BaseMethod {
30047
29910
  acc[cur.methodName].push(cur);
30048
29911
  return acc;
30049
29912
  }, {});
30050
- let i = 0;
30051
- for (const [methodName, params] of Object.entries(methodGroups)) {
30052
- const methodParams = {
30053
- bundle: params.map(param => (Object.assign({}, param.params))),
29913
+ const methodParamsArray = Object.values(methodReduceParams);
29914
+ const generateResponseKey = (payload) => `${payload.path}-${payload.network}-${payload.chainName}-${payload.prefix}`;
29915
+ for (let i = 0; i < methodParamsArray.length; i++) {
29916
+ const methodParams = methodParamsArray[i];
29917
+ const { methodName } = methodParams[0];
29918
+ const params = {
29919
+ bundle: methodParams.map(param => (Object.assign({}, param.params))),
30054
29920
  };
30055
- const response = yield this.callMethod(methodName, methodParams);
30056
- for (let i = 0; i < params.length; i++) {
30057
- const { _originRequestParams, _originalIndex } = params[i];
30058
- const responseKey = `${_originalIndex}`;
29921
+ const response = yield this.callMethod(methodName, params);
29922
+ for (let i = 0; i < methodParams.length; i++) {
29923
+ const { _originRequestParams } = methodParams[i];
29924
+ const responseKey = generateResponseKey(_originRequestParams);
30059
29925
  resultMap[responseKey] = Object.assign(Object.assign({}, _originRequestParams), response[i]);
30060
29926
  }
30061
29927
  if (((_b = (_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle) === null || _b === void 0 ? void 0 : _b.length) > 1) {
30062
29928
  const progress = Math.round(((i + 1) / this.payload.bundle.length) * 100);
30063
29929
  this.postMessage(createUiMessage(UI_REQUEST.DEVICE_PROGRESS, { progress }));
30064
29930
  }
30065
- i++;
30066
29931
  }
30067
- for (let i = 0; i < bundle.length; i++) {
30068
- responses.push(resultMap[i]);
29932
+ for (const param of bundle) {
29933
+ const responseKey = generateResponseKey(param);
29934
+ responses.push(resultMap[responseKey]);
30069
29935
  }
30070
29936
  return Promise.resolve(responses);
30071
29937
  });
@@ -30537,22 +30403,29 @@ function getVersionBytes(coinName, scriptType) {
30537
30403
  return VERSION_BYTES.XPUB;
30538
30404
  }
30539
30405
  }
30540
- else if (coinName.toLowerCase() === 'testnet') {
30541
- return 0x043587cf;
30542
- }
30543
- else if (coinName.toLowerCase() === 'regtest') {
30544
- return 0x043587cf;
30545
- }
30546
30406
  else if (coinName.toLowerCase() === 'litecoin') {
30547
- return 0x019da462;
30407
+ switch (scriptType) {
30408
+ case 'SPENDADDRESS':
30409
+ case 'SPENDMULTISIG':
30410
+ return 0x019da462;
30411
+ case 'SPENDP2SHWITNESS':
30412
+ return 0x01b26ef6;
30413
+ case 'SPENDWITNESS':
30414
+ return 0x04b24746;
30415
+ default:
30416
+ return undefined;
30417
+ }
30548
30418
  }
30549
30419
  else if (coinName.toLowerCase() === 'dogecoin') {
30550
- return 0x02facafd;
30551
- }
30552
- else if (coinName.toLowerCase() === 'dash') {
30553
- return 0x02fe52cc;
30420
+ if (scriptType === 'SPENDADDRESS') {
30421
+ return 0x02facafd;
30422
+ }
30423
+ if (scriptType === 'SPENDMULTISIG') {
30424
+ return 0x0488b21e;
30425
+ }
30426
+ return undefined;
30554
30427
  }
30555
- return VERSION_BYTES.XPUB;
30428
+ return undefined;
30556
30429
  }
30557
30430
  function base58Check(data) {
30558
30431
  const checksum = sha256.sha256(sha256.sha256(new Uint8Array(data))).slice(0, 4);
@@ -30578,6 +30451,9 @@ function base58Check(data) {
30578
30451
  }
30579
30452
  function generateExtendedPublicKey(coinName, depth, fingerprint, childNum, chainCode, publicKey, scriptType) {
30580
30453
  const versionBytes = getVersionBytes(coinName, scriptType);
30454
+ if (!versionBytes) {
30455
+ throw new Error(`Invalid coinName, not support generate xpub for scriptType: ${scriptType}`);
30456
+ }
30581
30457
  const buffer = Buffer.alloc(78);
30582
30458
  buffer.writeUInt32BE(versionBytes, 0);
30583
30459
  buffer.writeUInt8(depth, 4);
@@ -30644,6 +30520,12 @@ class BTCGetPublicKey extends BaseMethod {
30644
30520
  if (existsShowDisplay || !this.hasBundle) {
30645
30521
  throw new Error('Goto getPublickey');
30646
30522
  }
30523
+ for (const param of this.params) {
30524
+ const versionBytes = getVersionBytes(param.coin_name, param.script_type);
30525
+ if (!versionBytes) {
30526
+ throw new Error(`Invalid coinName, not support generate xpub for scriptType: ${param.script_type}`);
30527
+ }
30528
+ }
30647
30529
  const res = yield batchGetPublickeys(this.device, this.params, 'secp256k1', 0, {
30648
30530
  includeNode: true,
30649
30531
  ignoreCoinType: true,
@@ -32069,7 +31951,6 @@ class EVMSignTypedData extends BaseMethod {
32069
31951
  }
32070
31952
  }
32071
31953
  handleSignTypedData({ typedCall, signData, response, supportTrezor, }) {
32072
- var _a;
32073
31954
  return __awaiter(this, void 0, void 0, function* () {
32074
31955
  const { types, primaryType, domain, message, } = signData;
32075
31956
  while (response.type === 'EthereumTypedDataStructRequest' ||
@@ -32161,7 +32042,7 @@ class EVMSignTypedData extends BaseMethod {
32161
32042
  gasToken: data.message.gasToken,
32162
32043
  refundReceiver: data.message.refundReceiver,
32163
32044
  nonce: formatAnyHex(new BigNumber__default["default"](data.message.nonce).toString(16)),
32164
- chain_id: new BigNumber__default["default"]((_a = data.domain.chainId) !== null && _a !== void 0 ? _a : '0x', 16).toNumber(),
32045
+ chain_id: parseChainId(data.domain.chainId),
32165
32046
  verifyingContract: data.domain.verifyingContract,
32166
32047
  };
32167
32048
  response = yield typedCall('EthereumGnosisSafeTxAck', ['EthereumTypedDataSignature', 'EthereumTypedDataSignatureOneKey'], param);
@@ -37982,7 +37863,6 @@ var ApiMethods = /*#__PURE__*/Object.freeze({
37982
37863
  deviceFullyUploadResource: DeviceFullyUploadResource,
37983
37864
  deviceUpdateBootloader: DeviceUpdateBootloader,
37984
37865
  deviceLock: DeviceLock,
37985
- deviceUnlock: DeviceUnlock,
37986
37866
  deviceCancel: DeviceCancel,
37987
37867
  setU2FCounter: SetU2FCounter,
37988
37868
  getNextU2FCounter: GetNextU2FCounter,
@@ -38434,7 +38314,7 @@ const onCallDevice = (context, message, method) => __awaiter(void 0, void 0, voi
38434
38314
  try {
38435
38315
  yield waitForPendingPromise(getPrePendingCallPromise, setPrePendingCallPromise);
38436
38316
  const inner = () => __awaiter(void 0, void 0, void 0, function* () {
38437
- var _c, _d, _e, _f;
38317
+ var _c, _d, _e;
38438
38318
  const versionRange = getMethodVersionRange(device.features, type => method.getVersionRange()[type]);
38439
38319
  if (device.features) {
38440
38320
  yield DataManager.checkAndReloadData();
@@ -38491,7 +38371,7 @@ const onCallDevice = (context, message, method) => __awaiter(void 0, void 0, voi
38491
38371
  require: support.require,
38492
38372
  }));
38493
38373
  }
38494
- const passphraseStateSafety = yield device.checkPassphraseStateSafety((_c = method.payload) === null || _c === void 0 ? void 0 : _c.passphraseState, (_d = method.payload) === null || _d === void 0 ? void 0 : _d.useEmptyPassphrase);
38374
+ const passphraseStateSafety = yield device.checkPassphraseStateSafety((_c = method.payload) === null || _c === void 0 ? void 0 : _c.passphraseState);
38495
38375
  checkPassphraseEnableState(method, device.features);
38496
38376
  if (!passphraseStateSafety) {
38497
38377
  DevicePool.clearDeviceCache(method.payload.connectId);
@@ -38507,7 +38387,7 @@ const onCallDevice = (context, message, method) => __awaiter(void 0, void 0, voi
38507
38387
  : hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'open safety check failed.');
38508
38388
  throw error;
38509
38389
  }
38510
- (_f = (_e = method.device) === null || _e === void 0 ? void 0 : _e.commands) === null || _f === void 0 ? void 0 : _f.checkDisposed();
38390
+ (_e = (_d = method.device) === null || _d === void 0 ? void 0 : _d.commands) === null || _e === void 0 ? void 0 : _e.checkDisposed();
38511
38391
  try {
38512
38392
  const response = yield method.run();
38513
38393
  Log.debug('Call API - Inner Method Run: ');
@@ -38867,11 +38747,11 @@ const onDevicePinHandler = (...[device, type, callback]) => __awaiter(void 0, vo
38867
38747
  });
38868
38748
  const onDeviceButtonHandler = (...[device, request]) => {
38869
38749
  postMessage(createDeviceMessage(DEVICE.BUTTON, Object.assign(Object.assign({}, request), { device: device.toMessageObject() })));
38870
- if (request.code === 'ButtonRequest_PinEntry' || request.code === 'ButtonRequest_AttachPin') {
38871
- Log.log('request Confirm Input PIN or Attach PIN');
38750
+ if (request.code === 'ButtonRequest_PinEntry') {
38751
+ Log.log('request Confirm Input PIN');
38872
38752
  postMessage(createUiMessage(UI_REQUEST.REQUEST_PIN, {
38873
38753
  device: device.toMessageObject(),
38874
- type: request.code,
38754
+ type: 'ButtonRequest_PinEntry',
38875
38755
  }));
38876
38756
  }
38877
38757
  else {
@@ -38882,24 +38762,22 @@ const onDeviceButtonHandler = (...[device, request]) => {
38882
38762
  const onDeviceFeaturesHandler = (...[_, features]) => {
38883
38763
  postMessage(createDeviceMessage(DEVICE.FEATURES, Object.assign({}, features)));
38884
38764
  };
38885
- const onDevicePassphraseHandler = (...[device, requestPayload, callback]) => __awaiter(void 0, void 0, void 0, function* () {
38765
+ const onDevicePassphraseHandler = (...[device, callback]) => __awaiter(void 0, void 0, void 0, function* () {
38886
38766
  Log.debug('onDevicePassphraseHandler');
38887
38767
  const uiPromise = createUiPromise(UI_RESPONSE.RECEIVE_PASSPHRASE, device);
38888
38768
  postMessage(createUiMessage(UI_REQUEST.REQUEST_PASSPHRASE, {
38889
38769
  device: device.toMessageObject(),
38890
38770
  passphraseState: device.passphraseState,
38891
- existsAttachPinUser: requestPayload.existsAttachPinUser,
38892
38771
  }));
38893
38772
  const uiResp = yield uiPromise.promise;
38894
- const { value, passphraseOnDevice, save, attachPinOnDevice } = uiResp.payload;
38773
+ const { value, passphraseOnDevice, save } = uiResp.payload;
38895
38774
  callback({
38896
38775
  passphrase: value.normalize('NFKD'),
38897
38776
  passphraseOnDevice,
38898
- attachPinOnDevice,
38899
38777
  cache: save,
38900
38778
  });
38901
38779
  });
38902
- const onEmptyPassphraseHandler = (...[_, , callback]) => {
38780
+ const onEmptyPassphraseHandler = (...[_, callback]) => {
38903
38781
  Log.debug('onEmptyPassphraseHandler');
38904
38782
  callback({ passphrase: '' });
38905
38783
  };
@@ -39008,7 +38886,7 @@ const init = (settings, Transport, plugin) => __awaiter(void 0, void 0, void 0,
39008
38886
  yield DataManager.load(settings);
39009
38887
  initTransport(Transport, plugin);
39010
38888
  }
39011
- catch (_g) {
38889
+ catch (_f) {
39012
38890
  Log.error('DataManager.load error');
39013
38891
  }
39014
38892
  enableLog(DataManager.getSettings('debug'));
@@ -1 +1 @@
1
- {"version":3,"file":"inject.d.ts","sourceRoot":"","sources":["../src/inject.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,YAAY,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC1C,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAClC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1B,eAAe,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC7C;AAED,eAAO,MAAM,MAAM,gGAShB,SAAS,KAAG,OAiCd,CAAC;AAEF,eAAO,MAAM,aAAa,SAClB,OAAO,CAAC,MAAM,CAAC,KACpB,KACD,OAAO,EACL,IAAI,GACJ,KAAK,GACL,MAAM,GACN,oBAAoB,GACpB,MAAM,GACN,MAAM,GACN,SAAS,GACT,YAAY,GACZ,QAAQ,GACR,gBAAgB,GAChB,iBAAiB,CA2RnB,CAAC"}
1
+ {"version":3,"file":"inject.d.ts","sourceRoot":"","sources":["../src/inject.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,YAAY,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC1C,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAClC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1B,eAAe,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC7C;AAED,eAAO,MAAM,MAAM,gGAShB,SAAS,KAAG,OAiCd,CAAC;AAEF,eAAO,MAAM,aAAa,SAClB,OAAO,CAAC,MAAM,CAAC,KACpB,KACD,OAAO,EACL,IAAI,GACJ,KAAK,GACL,MAAM,GACN,oBAAoB,GACpB,MAAM,GACN,MAAM,GACN,SAAS,GACT,YAAY,GACZ,QAAQ,GACR,gBAAgB,GAChB,iBAAiB,CAyRnB,CAAC"}
@@ -18,7 +18,7 @@ export declare function firmwareUpdate(connectId: string | undefined, params: Pa
18
18
  export declare function firmwareUpdate(connectId: string | undefined, params: Params<FirmwareUpdateBinaryParams> & {
19
19
  rebootOnSuccess?: boolean;
20
20
  }): Response<PROTO.Success>;
21
- type IPlatform = 'native' | 'desktop' | 'ext' | 'web' | 'webEmbed';
21
+ type IPlatform = 'native' | 'desktop' | 'ext' | 'web' | 'web-embed';
22
22
  type Platform = {
23
23
  platform: IPlatform;
24
24
  };
@@ -1 +1 @@
1
- {"version":3,"file":"firmwareUpdate.d.ts","sourceRoot":"","sources":["../../../src/types/api/firmwareUpdate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAElD,KAAK,WAAW,GAAG,UAAU,GAAG,KAAK,CAAC;AAEtC,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,WAAW,CAAC;IACpB,UAAU,EAAE,WAAW,CAAC;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,WAAW,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,MAAM,EAAE,MAAM,CAAC,oBAAoB,CAAC,GAAG;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GACnE,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC3B,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,MAAM,EAAE,MAAM,CAAC,0BAA0B,CAAC,GAAG;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GACzE,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAE3B,KAAK,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,UAAU,CAAC;AACnE,KAAK,QAAQ,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,CAAC;AAExC,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,MAAM,EAAE,MAAM,CAAC,oBAAoB,GAAG,QAAQ,CAAC,GAC9C,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC3B,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,MAAM,EAAE,MAAM,CAAC,0BAA0B,GAAG,QAAQ,CAAC,GACpD,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAE3B,MAAM,WAAW,sBAAsB;IACrC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,CAAC,EAAE,WAAW,CAAC;IAExB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,WAAW,CAAC;IAE7B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,gBAAgB,CAAC,EAAE,WAAW,CAAC;IAE/B,cAAc,CAAC,EAAE,WAAW,CAAC;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,MAAM,EAAE,MAAM,CAAC,sBAAsB,CAAC,GACrC,QAAQ,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC,CAAC"}
1
+ {"version":3,"file":"firmwareUpdate.d.ts","sourceRoot":"","sources":["../../../src/types/api/firmwareUpdate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAElD,KAAK,WAAW,GAAG,UAAU,GAAG,KAAK,CAAC;AAEtC,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,WAAW,CAAC;IACpB,UAAU,EAAE,WAAW,CAAC;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,WAAW,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,MAAM,EAAE,MAAM,CAAC,oBAAoB,CAAC,GAAG;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GACnE,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC3B,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,MAAM,EAAE,MAAM,CAAC,0BAA0B,CAAC,GAAG;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GACzE,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAE3B,KAAK,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,WAAW,CAAC;AACpE,KAAK,QAAQ,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,CAAC;AAExC,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,MAAM,EAAE,MAAM,CAAC,oBAAoB,GAAG,QAAQ,CAAC,GAC9C,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC3B,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,MAAM,EAAE,MAAM,CAAC,0BAA0B,GAAG,QAAQ,CAAC,GACpD,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAE3B,MAAM,WAAW,sBAAsB;IACrC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,CAAC,EAAE,WAAW,CAAC;IAExB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,WAAW,CAAC;IAE7B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,gBAAgB,CAAC,EAAE,WAAW,CAAC;IAE/B,cAAc,CAAC,EAAE,WAAW,CAAC;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,MAAM,EAAE,MAAM,CAAC,sBAAsB,CAAC,GACrC,QAAQ,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC,CAAC"}
@@ -31,7 +31,6 @@ import { deviceSupportFeatures } from './deviceSupportFeatures';
31
31
  import { deviceFullyUploadResource } from './deviceFullyUploadResource';
32
32
  import { deviceUpdateBootloader } from './deviceUpdateBootloader';
33
33
  import { deviceLock } from './deviceLock';
34
- import { deviceUnlock } from './deviceUnlock';
35
34
  import { deviceCancel } from './deviceCancel';
36
35
  import { getNextU2FCounter } from './getNextU2FCounter';
37
36
  import { setU2FCounter } from './setU2FCounter';
@@ -167,7 +166,6 @@ export type CoreApi = {
167
166
  deviceFullyUploadResource: typeof deviceFullyUploadResource;
168
167
  deviceUpdateBootloader: typeof deviceUpdateBootloader;
169
168
  deviceLock: typeof deviceLock;
170
- deviceUnlock: typeof deviceUnlock;
171
169
  deviceCancel: typeof deviceCancel;
172
170
  getNextU2FCounter: typeof getNextU2FCounter;
173
171
  setU2FCounter: typeof setU2FCounter;