@onekeyfe/hwk-trezor-core 1.2.8-alpha.13 → 1.2.8-alpha.131

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/index.mjs CHANGED
@@ -11261,7 +11261,8 @@ async function receive(receiver, protocol) {
11261
11261
  } catch (e) {
11262
11262
  console.warn("Protocol decode failed", {
11263
11263
  error: e.message,
11264
- payload: readResult.payload.toString("hex")
11264
+ payloadLength: readResult.payload.length,
11265
+ payloadHead: readResult.payload.subarray(0, 2).toString("hex")
11265
11266
  });
11266
11267
  return error({ code: PROTOCOL_MALFORMED, message: e.message });
11267
11268
  }
@@ -12124,6 +12125,11 @@ var TrezorDeviceSession = class {
12124
12125
  requestData = {};
12125
12126
  continue;
12126
12127
  }
12128
+ if ((response.type === "PinMatrixRequest" || response.type === "PassphraseRequest") && this.connectionType === "ble" && this.protocol === "v1") {
12129
+ this.core = void 0;
12130
+ this.currentFeatures = void 0;
12131
+ throw thpPairingRefused("Trezor Bluetooth requires the encrypted THP protocol");
12132
+ }
12127
12133
  if (response.type === "PinMatrixRequest") {
12128
12134
  const pin = await this.handlePinMatrixRequest(
12129
12135
  response.message
@@ -12244,7 +12250,7 @@ var TrezorDeviceSession = class {
12244
12250
  const response = await this.core.call("Initialize", {});
12245
12251
  this.currentFeatures = expectMessage(response, "Features").message;
12246
12252
  this.thpAppSessionActive = false;
12247
- if (passphraseMode === "empty" && this.currentFeatures?.passphrase_protection == null) {
12253
+ if (passphraseMode === "empty") {
12248
12254
  expectMessage(
12249
12255
  await this.call("GetAddress", {
12250
12256
  address_n: [2147483692, 2147483649, 2147483648, 0, 0],