@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.d.mts
CHANGED
|
@@ -541,8 +541,8 @@ declare class LedgerConnectorBase implements IConnector {
|
|
|
541
541
|
protected _emit<K extends ConnectorEventType>(event: K, data: ConnectorEventMap[K]): void;
|
|
542
542
|
/**
|
|
543
543
|
* Return a per-call ctx with the chain's Ledger app name pre-bound to
|
|
544
|
-
*
|
|
545
|
-
* Falls through unchanged for unknown methods.
|
|
544
|
+
* wrapError, so chain handlers don't need to repeat `{ defaultAppName: 'X' }`
|
|
545
|
+
* at every catch site. Falls through unchanged for unknown methods.
|
|
546
546
|
*/
|
|
547
547
|
private _ctxForMethod;
|
|
548
548
|
private _wrapError;
|
package/dist/index.d.ts
CHANGED
|
@@ -541,8 +541,8 @@ declare class LedgerConnectorBase implements IConnector {
|
|
|
541
541
|
protected _emit<K extends ConnectorEventType>(event: K, data: ConnectorEventMap[K]): void;
|
|
542
542
|
/**
|
|
543
543
|
* Return a per-call ctx with the chain's Ledger app name pre-bound to
|
|
544
|
-
*
|
|
545
|
-
* Falls through unchanged for unknown methods.
|
|
544
|
+
* wrapError, so chain handlers don't need to repeat `{ defaultAppName: 'X' }`
|
|
545
|
+
* at every catch site. Falls through unchanged for unknown methods.
|
|
546
546
|
*/
|
|
547
547
|
private _ctxForMethod;
|
|
548
548
|
private _wrapError;
|
package/dist/index.js
CHANGED
|
@@ -4968,14 +4968,6 @@ var METHOD_PREFIX_TO_APP_NAME = {
|
|
|
4968
4968
|
tron: "Tron",
|
|
4969
4969
|
zcash: "Zcash"
|
|
4970
4970
|
};
|
|
4971
|
-
function withOpenAppName(event, data, appName) {
|
|
4972
|
-
if (event !== "ui-event") return data;
|
|
4973
|
-
const uiEvent = data;
|
|
4974
|
-
if (uiEvent.type !== import_hwk_adapter_core13.EConnectorInteraction.ConfirmOpenApp || uiEvent.payload.appName) {
|
|
4975
|
-
return data;
|
|
4976
|
-
}
|
|
4977
|
-
return { ...uiEvent, payload: { ...uiEvent.payload, appName } };
|
|
4978
|
-
}
|
|
4979
4971
|
var HARDWARE_ERROR_CODE_VALUES = new Set(
|
|
4980
4972
|
Object.values(import_hwk_adapter_core13.HardwareErrorCode).filter((value) => typeof value === "number")
|
|
4981
4973
|
);
|
|
@@ -5784,8 +5776,8 @@ var LedgerConnectorBase = class {
|
|
|
5784
5776
|
// ---------------------------------------------------------------------------
|
|
5785
5777
|
/**
|
|
5786
5778
|
* Return a per-call ctx with the chain's Ledger app name pre-bound to
|
|
5787
|
-
*
|
|
5788
|
-
* Falls through unchanged for unknown methods.
|
|
5779
|
+
* wrapError, so chain handlers don't need to repeat `{ defaultAppName: 'X' }`
|
|
5780
|
+
* at every catch site. Falls through unchanged for unknown methods.
|
|
5789
5781
|
*/
|
|
5790
5782
|
_ctxForMethod(method) {
|
|
5791
5783
|
const prefix = /^(evm|btc|sol|tron|zcash)/.exec(method)?.[1];
|
|
@@ -5793,8 +5785,7 @@ var LedgerConnectorBase = class {
|
|
|
5793
5785
|
if (!defaultAppName) return this._ctx;
|
|
5794
5786
|
return {
|
|
5795
5787
|
...this._ctx,
|
|
5796
|
-
wrapError: (err, opts) => this._wrapError(err, { defaultAppName, ...opts })
|
|
5797
|
-
emit: (event, data) => this._ctx.emit(event, withOpenAppName(event, data, defaultAppName))
|
|
5788
|
+
wrapError: (err, opts) => this._wrapError(err, { defaultAppName, ...opts })
|
|
5798
5789
|
};
|
|
5799
5790
|
}
|
|
5800
5791
|
_wrapError(err, opts) {
|