@onekeyfe/hwk-ledger-adapter 1.2.8-alpha.114 → 1.2.8-alpha.115
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.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -4961,14 +4961,6 @@ var METHOD_PREFIX_TO_APP_NAME = {
|
|
|
4961
4961
|
tron: "Tron",
|
|
4962
4962
|
zcash: "Zcash"
|
|
4963
4963
|
};
|
|
4964
|
-
function withOpenAppName(event, data, appName) {
|
|
4965
|
-
if (event !== "ui-event") return data;
|
|
4966
|
-
const uiEvent = data;
|
|
4967
|
-
if (uiEvent.type !== EConnectorInteraction3.ConfirmOpenApp || uiEvent.payload.appName) {
|
|
4968
|
-
return data;
|
|
4969
|
-
}
|
|
4970
|
-
return { ...uiEvent, payload: { ...uiEvent.payload, appName } };
|
|
4971
|
-
}
|
|
4972
4964
|
var HARDWARE_ERROR_CODE_VALUES = new Set(
|
|
4973
4965
|
Object.values(HardwareErrorCode7).filter((value) => typeof value === "number")
|
|
4974
4966
|
);
|
|
@@ -5777,8 +5769,8 @@ var LedgerConnectorBase = class {
|
|
|
5777
5769
|
// ---------------------------------------------------------------------------
|
|
5778
5770
|
/**
|
|
5779
5771
|
* Return a per-call ctx with the chain's Ledger app name pre-bound to
|
|
5780
|
-
*
|
|
5781
|
-
* Falls through unchanged for unknown methods.
|
|
5772
|
+
* wrapError, so chain handlers don't need to repeat `{ defaultAppName: 'X' }`
|
|
5773
|
+
* at every catch site. Falls through unchanged for unknown methods.
|
|
5782
5774
|
*/
|
|
5783
5775
|
_ctxForMethod(method) {
|
|
5784
5776
|
const prefix = /^(evm|btc|sol|tron|zcash)/.exec(method)?.[1];
|
|
@@ -5786,8 +5778,7 @@ var LedgerConnectorBase = class {
|
|
|
5786
5778
|
if (!defaultAppName) return this._ctx;
|
|
5787
5779
|
return {
|
|
5788
5780
|
...this._ctx,
|
|
5789
|
-
wrapError: (err, opts) => this._wrapError(err, { defaultAppName, ...opts })
|
|
5790
|
-
emit: (event, data) => this._ctx.emit(event, withOpenAppName(event, data, defaultAppName))
|
|
5781
|
+
wrapError: (err, opts) => this._wrapError(err, { defaultAppName, ...opts })
|
|
5791
5782
|
};
|
|
5792
5783
|
}
|
|
5793
5784
|
_wrapError(err, opts) {
|