Skip to content

Commit 8bcb31c

Browse files
committed
revert: roll back PR review fixes per maintainer call
- TonSignData: drop strictCheckDeviceSupport (set to false) and remove getVersionRange(). Firmware version that ships TonSignData isn't decided yet; gating now would lock out every connected device. Re-enable both once the touch/classic1s min versions are known. - LedgerConnectorBase.call: restore JSON.stringify(params) in debugLog. Log bus only feeds the host's local defaultLogger pipeline (no third-party telemetry forwarding), so full params are acceptable for now and useful for in-the-wild debugging.
1 parent 4fc7c7a commit 8bcb31c

2 files changed

Lines changed: 5 additions & 42 deletions

File tree

packages/core/src/api/ton/TonSignData.ts

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import type { TonSignDataParams } from '../../types/api/tonSignData';
99

1010
export default class TonSignData extends BaseMethod<HardwareTonSignData> {
1111
init() {
12-
this.strictCheckDeviceSupport = true;
12+
// Keep strict-check off until the firmware release that ships TonSignData
13+
// is decided — we don't yet know the min versions for touch/classic1s.
14+
// Flip back to true and add getVersionRange() once those numbers land.
15+
this.strictCheckDeviceSupport = false;
1316
this.checkDeviceId = true;
1417
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
1518

@@ -47,22 +50,6 @@ export default class TonSignData extends BaseMethod<HardwareTonSignData> {
4750
};
4851
}
4952

50-
// Required because strictCheckDeviceSupport=true above. Without an entry
51-
// here, BaseMethod returns an empty range and the core treats every
52-
// device as unsupported, blocking the call before run() ever fires.
53-
// Aligned with TonSignMessage's getFixInitStateErrorVersionRange() — bump
54-
// when the firmware release that ships TonSignData lands.
55-
getVersionRange() {
56-
return {
57-
model_touch: {
58-
min: '4.13.0',
59-
},
60-
model_classic1s: {
61-
min: '3.12.0',
62-
},
63-
};
64-
}
65-
6653
async run() {
6754
const res = await this.device.commands.typedCall('TonSignData', 'TonSignedData', {
6855
...this.params,

packages/hwk-ledger-adapter/src/connector/LedgerConnectorBase.ts

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -88,30 +88,6 @@ const METHOD_PREFIX_TO_APP_NAME: Record<string, string> = {
8888
tron: 'Tron',
8989
};
9090

91-
/**
92-
* Render call params as non-sensitive metadata for the SDK log bus. Raw
93-
* payloads (serializedTx / psbt / rawTxHex / messageHex / typed data) MUST
94-
* NOT enter the log stream — hosts may forward it to telemetry / persistent
95-
* stores. We surface only path, length-of-payload, and a few harmless flags.
96-
*/
97-
function summarizeCallParams(_method: string, params: unknown): string {
98-
if (!params || typeof params !== 'object') return '';
99-
const p = params as Record<string, unknown>;
100-
const safe: Record<string, unknown> = {};
101-
if (typeof p.path === 'string') safe.path = p.path;
102-
if (typeof p.showOnDevice === 'boolean') safe.showOnDevice = p.showOnDevice;
103-
if (typeof p.checkOnDevice === 'boolean') safe.checkOnDevice = p.checkOnDevice;
104-
for (const key of ['serializedTx', 'rawTxHex', 'messageHex', 'message', 'psbt', 'data']) {
105-
const v = p[key];
106-
if (typeof v === 'string') safe[`${key}.len`] = v.length;
107-
else if (v !== undefined) safe[`${key}.type`] = typeof v;
108-
}
109-
if (Array.isArray(p.tokenSignatures)) {
110-
safe.tokenSignaturesCount = p.tokenSignatures.length;
111-
}
112-
return JSON.stringify(safe);
113-
}
114-
11591
// ---------------------------------------------------------------------------
11692
// Default signer kit importer (webpack/rspack — uses "exports" field)
11793
// ---------------------------------------------------------------------------
@@ -405,7 +381,7 @@ export class LedgerConnectorBase implements IConnector {
405381
// ---------------------------------------------------------------------------
406382

407383
async call(sessionId: string, method: string, params: unknown): Promise<unknown> {
408-
debugLog('[DMK] call:', method, summarizeCallParams(method, params));
384+
debugLog('[DMK] call:', method, JSON.stringify(params));
409385
// Bind the chain's Ledger app name to ctx.wrapError once per dispatch so
410386
// chain handlers can call `ctx.wrapError(err)` with no per-site appName.
411387
const ctx = this._ctxForMethod(method);

0 commit comments

Comments
 (0)