@onekeyfe/hwk-trezor-adapter 1.2.2-alpha.9 → 1.2.2
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.js +14 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -996,6 +996,9 @@ var _TrezorAdapter = class _TrezorAdapter {
|
|
|
996
996
|
if (failure2.code === "Failure_DataError" && failure2.message === "Forbidden key path") {
|
|
997
997
|
return HardwareErrorCode.DevicePathForbidden;
|
|
998
998
|
}
|
|
999
|
+
if (failure2.code === "Failure_DataError" && typeof failure2.message === "string" && failure2.message.includes("PASSPHRASE_ALWAYS_ON_DEVICE")) {
|
|
1000
|
+
return HardwareErrorCode.PassphraseAlwaysOnDevice;
|
|
1001
|
+
}
|
|
999
1002
|
if (failure2.code === "Failure_FirmwareError") {
|
|
1000
1003
|
return HardwareErrorCode.MethodNotSupported;
|
|
1001
1004
|
}
|
|
@@ -1245,7 +1248,8 @@ var _TrezorAdapter = class _TrezorAdapter {
|
|
|
1245
1248
|
shouldAbortBundle: (response, { index }) => {
|
|
1246
1249
|
const isSessionLevelFailure = topLevelFailureIndexes.has(index);
|
|
1247
1250
|
const isWholeChainForbidden = isSingleNetworkBundle && response.payload?.code === HardwareErrorCode.DevicePathForbidden;
|
|
1248
|
-
|
|
1251
|
+
const isPassphrasePolicyFailure = response.payload?.code === HardwareErrorCode.PassphraseAlwaysOnDevice;
|
|
1252
|
+
return isSessionLevelFailure || isWholeChainForbidden || isPassphrasePolicyFailure;
|
|
1249
1253
|
}
|
|
1250
1254
|
});
|
|
1251
1255
|
}
|