@bytezhang/ledger-adapter 0.0.14 → 0.0.15

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 CHANGED
@@ -363,6 +363,7 @@ var _LedgerAdapter = class _LedgerAdapter {
363
363
  // EVM methods
364
364
  // ---------------------------------------------------------------------------
365
365
  async evmGetAddress(connectId, _deviceId, params) {
366
+ console.log("[LedgerAdapter] evmGetAddress called:", { connectId, _deviceId, path: params.path, showOnDevice: params.showOnDevice, chainId: params.chainId });
366
367
  await this._ensureDevicePermission(connectId, _deviceId);
367
368
  if (!await this._verifyDeviceFingerprint(connectId, _deviceId, "evm")) {
368
369
  return (0, import_hardware_wallet_core2.failure)(import_hardware_wallet_core2.HardwareErrorCode.DeviceMismatch, "Wrong device connected");
@@ -1114,8 +1115,10 @@ var SignerEth = class {
1114
1115
  this._sdk = _sdk;
1115
1116
  }
1116
1117
  async getAddress(derivationPath, options) {
1118
+ const checkOnDevice = options?.checkOnDevice ?? false;
1119
+ console.log("[SignerEth] getAddress \u2192 DMK:", { derivationPath, checkOnDevice });
1117
1120
  const action = this._sdk.getAddress(derivationPath, {
1118
- checkOnDevice: options?.checkOnDevice ?? false
1121
+ checkOnDevice
1119
1122
  });
1120
1123
  return deviceActionToPromise(action, this.onInteraction);
1121
1124
  }
@@ -1366,6 +1369,7 @@ var LedgerConnectorBase = class {
1366
1369
  // IConnector -- Method dispatch
1367
1370
  // ---------------------------------------------------------------------------
1368
1371
  async call(sessionId, method, params) {
1372
+ console.log("[LedgerConnector] call:", method, JSON.stringify(params));
1369
1373
  switch (method) {
1370
1374
  case "evmGetAddress":
1371
1375
  return this._evmGetAddress(sessionId, params);
@@ -1423,9 +1427,11 @@ var LedgerConnectorBase = class {
1423
1427
  async _evmGetAddress(sessionId, params) {
1424
1428
  const signer = await this._getEthSigner(sessionId);
1425
1429
  const path = normalizePath(params.path);
1430
+ const checkOnDevice = params.showOnDevice ?? false;
1431
+ console.log("[LedgerConnector] _evmGetAddress \u2192 signer.getAddress:", { path, checkOnDevice });
1426
1432
  try {
1427
1433
  const result = await signer.getAddress(path, {
1428
- checkOnDevice: params.showOnDevice ?? false
1434
+ checkOnDevice
1429
1435
  });
1430
1436
  return { address: result.address, publicKey: result.publicKey };
1431
1437
  } catch (err) {