@moly-mcp/lido 1.1.2 → 1.1.4

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/bin.js CHANGED
@@ -151,27 +151,46 @@ async function runWizard() {
151
151
  if (keySource === "ows") {
152
152
  let owsSdk = null;
153
153
  let wallets = [];
154
- try {
155
- const { createRequire } = await import("module");
156
- const _req = createRequire(import.meta.url);
157
- owsSdk = _req("@open-wallet-standard/core");
158
- wallets = owsSdk.listWallets();
159
- } catch {
154
+ const { createRequire } = await import("module");
155
+ const { homedir } = await import("os");
156
+ const { join } = await import("path");
157
+ const owsDir = join(homedir(), ".moly");
158
+ const searchPaths = [
159
+ () => createRequire(import.meta.url)("@open-wallet-standard/core"),
160
+ () => createRequire(join(owsDir, "package.json"))("@open-wallet-standard/core"),
161
+ () => createRequire(join(homedir(), ".nvm", "versions", "node", process.version, "lib", "node_modules", "package.json"))("@open-wallet-standard/core")
162
+ ];
163
+ for (const loader of searchPaths) {
164
+ try {
165
+ owsSdk = loader();
166
+ break;
167
+ } catch {
168
+ }
169
+ }
170
+ if (!owsSdk) {
160
171
  const s = spinner();
161
172
  s.start("Installing @open-wallet-standard/core...");
162
173
  try {
163
174
  const { execSync } = await import("child_process");
164
- execSync("npm install -g @open-wallet-standard/core", { stdio: "pipe" });
175
+ const { mkdirSync, existsSync, writeFileSync } = await import("fs");
176
+ if (!existsSync(owsDir)) mkdirSync(owsDir, { recursive: true });
177
+ if (!existsSync(join(owsDir, "package.json"))) {
178
+ writeFileSync(join(owsDir, "package.json"), '{"name":"moly-deps","private":true}');
179
+ }
180
+ execSync("npm install @open-wallet-standard/core", { stdio: "pipe", cwd: owsDir });
165
181
  s.stop("OWS SDK installed.");
166
- const { createRequire: cr } = await import("module");
167
- const _r = cr(import.meta.url);
168
- owsSdk = _r("@open-wallet-standard/core");
169
- wallets = owsSdk.listWallets();
182
+ owsSdk = createRequire(join(owsDir, "package.json"))("@open-wallet-standard/core");
170
183
  } catch (installErr) {
171
184
  s.stop("Auto-install failed: " + installErr.message);
172
185
  note("Could not install OWS SDK automatically.\nFalling back to raw key storage.", "OWS not available");
173
186
  }
174
187
  }
188
+ if (owsSdk) {
189
+ try {
190
+ wallets = owsSdk.listWallets();
191
+ } catch {
192
+ }
193
+ }
175
194
  if (owsSdk && wallets.length > 0) {
176
195
  const walletName = check(
177
196
  await select({
@@ -293,7 +312,7 @@ async function main() {
293
312
  case "setup": {
294
313
  const { cfg, terminalMode } = await runWizard();
295
314
  if (terminalMode) {
296
- const { startChatSession } = await import("./session-ZIAXZNTD.js");
315
+ const { startChatSession } = await import("./session-52D3R73Y.js");
297
316
  await startChatSession(cfg);
298
317
  } else {
299
318
  await startServer();
@@ -373,7 +392,7 @@ async function main() {
373
392
  console.log("No config. Run: moly setup");
374
393
  process.exit(1);
375
394
  }
376
- const { runDaemon } = await import("./daemon-RZA4HEUI.js");
395
+ const { runDaemon } = await import("./daemon-XWJQH7IB.js");
377
396
  await runDaemon();
378
397
  break;
379
398
  }
@@ -531,7 +550,7 @@ async function main() {
531
550
  console.log("No config. Run: moly setup");
532
551
  process.exit(1);
533
552
  }
534
- const { getTotalPosition } = await import("./position-ANCFIWD6.js");
553
+ const { getTotalPosition } = await import("./position-WDLPRIE7.js");
535
554
  const address = args[1];
536
555
  const pos = await getTotalPosition(address);
537
556
  console.log(JSON.stringify(pos, null, 2));
@@ -542,14 +561,14 @@ async function main() {
542
561
  if (!configExists()) {
543
562
  const { cfg, terminalMode } = await runWizard();
544
563
  if (terminalMode) {
545
- const { startChatSession } = await import("./session-ZIAXZNTD.js");
564
+ const { startChatSession } = await import("./session-52D3R73Y.js");
546
565
  await startChatSession(cfg);
547
566
  } else {
548
567
  await startServer();
549
568
  }
550
569
  } else {
551
570
  const cfg = loadConfig();
552
- const { startChatSession } = await import("./session-ZIAXZNTD.js");
571
+ const { startChatSession } = await import("./session-52D3R73Y.js");
553
572
  await startChatSession(cfg);
554
573
  }
555
574
  break;
@@ -570,7 +589,7 @@ async function main() {
570
589
  if (!configExists()) {
571
590
  const { cfg, terminalMode } = await runWizard();
572
591
  if (terminalMode) {
573
- const { startChatSession } = await import("./session-ZIAXZNTD.js");
592
+ const { startChatSession } = await import("./session-52D3R73Y.js");
574
593
  await startChatSession(cfg);
575
594
  } else {
576
595
  await startServer();
@@ -4,7 +4,7 @@ import {
4
4
  getBalance,
5
5
  getConversionRate,
6
6
  getRuntime
7
- } from "./chunk-WMGNTYBF.js";
7
+ } from "./chunk-XSQE6QAD.js";
8
8
 
9
9
  // src/tools/bridge.ts
10
10
  import { formatEther, parseEther, parseAbi } from "viem";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  applySettingsUpdate,
4
4
  getRuntime
5
- } from "./chunk-WMGNTYBF.js";
5
+ } from "./chunk-XSQE6QAD.js";
6
6
  import {
7
7
  loadConfig,
8
8
  redactedConfig
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  getRuntime
4
- } from "./chunk-WMGNTYBF.js";
4
+ } from "./chunk-XSQE6QAD.js";
5
5
 
6
6
  // src/tools/unstake.ts
7
7
  import { parseEther, formatEther } from "viem";
@@ -10,6 +10,8 @@ import { mainnet, base, arbitrum } from "viem/chains";
10
10
  import { privateKeyToAccount } from "viem/accounts";
11
11
  import { LidoSDK } from "@lidofinance/lido-ethereum-sdk";
12
12
  import { createRequire } from "module";
13
+ import { join } from "path";
14
+ import { homedir } from "os";
13
15
 
14
16
  // src/config/types.ts
15
17
  var L2_CHAINS = {
@@ -77,7 +79,12 @@ function buildRuntime() {
77
79
  try {
78
80
  owsSdk = _require("@open-wallet-standard/core");
79
81
  } catch {
80
- throw new Error("OWS SDK not installed. Run: npm install @open-wallet-standard/core");
82
+ try {
83
+ const molyRequire = createRequire(join(homedir(), ".moly", "package.json"));
84
+ owsSdk = molyRequire("@open-wallet-standard/core");
85
+ } catch {
86
+ throw new Error("OWS SDK not installed. Run: moly setup and select OWS Wallet");
87
+ }
81
88
  }
82
89
  const exported = owsSdk.exportWallet(config.ows.walletName, config.ows.passphrase);
83
90
  const keyHex = exported.secp256k1 ?? exported;
@@ -3,7 +3,7 @@ import {
3
3
  getProposals,
4
4
  getWithdrawalRequests,
5
5
  getWithdrawalStatus
6
- } from "./chunk-C7R33HEF.js";
6
+ } from "./chunk-D5JID4WC.js";
7
7
  import {
8
8
  loadAlerts,
9
9
  loadChannelConfig,
@@ -14,7 +14,7 @@ import {
14
14
  getConversionRate,
15
15
  getRewards,
16
16
  getRuntime
17
- } from "./chunk-WMGNTYBF.js";
17
+ } from "./chunk-XSQE6QAD.js";
18
18
  import "./chunk-P6VFMSPM.js";
19
19
  import "./chunk-PDX44BCA.js";
20
20
 
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  getTotalPosition
4
- } from "./chunk-LRR663PB.js";
5
- import "./chunk-WMGNTYBF.js";
4
+ } from "./chunk-27PRUUR7.js";
5
+ import "./chunk-XSQE6QAD.js";
6
6
  import "./chunk-P6VFMSPM.js";
7
7
  import "./chunk-PDX44BCA.js";
8
8
  export {
@@ -3,7 +3,7 @@ import {
3
3
  getSettings,
4
4
  stakeEth,
5
5
  updateSettings
6
- } from "../chunk-ZX6OYPKV.js";
6
+ } from "../chunk-A27W633R.js";
7
7
  import {
8
8
  castVote,
9
9
  claimWithdrawals,
@@ -12,7 +12,7 @@ import {
12
12
  getWithdrawalRequests,
13
13
  getWithdrawalStatus,
14
14
  requestWithdrawal
15
- } from "../chunk-C7R33HEF.js";
15
+ } from "../chunk-D5JID4WC.js";
16
16
  import {
17
17
  configureAlertChannels,
18
18
  listAlerts,
@@ -26,14 +26,14 @@ import {
26
26
  getBridgeStatus,
27
27
  getL2Balance,
28
28
  getTotalPosition
29
- } from "../chunk-LRR663PB.js";
29
+ } from "../chunk-27PRUUR7.js";
30
30
  import {
31
31
  getBalance,
32
32
  getConversionRate,
33
33
  getRewards,
34
34
  unwrapWsteth,
35
35
  wrapSteth
36
- } from "../chunk-WMGNTYBF.js";
36
+ } from "../chunk-XSQE6QAD.js";
37
37
  import {
38
38
  loadConfig
39
39
  } from "../chunk-P6VFMSPM.js";
@@ -3,7 +3,7 @@ import {
3
3
  getSettings,
4
4
  stakeEth,
5
5
  updateSettings
6
- } from "./chunk-ZX6OYPKV.js";
6
+ } from "./chunk-A27W633R.js";
7
7
  import {
8
8
  castVote,
9
9
  claimWithdrawals,
@@ -12,7 +12,7 @@ import {
12
12
  getWithdrawalRequests,
13
13
  getWithdrawalStatus,
14
14
  requestWithdrawal
15
- } from "./chunk-C7R33HEF.js";
15
+ } from "./chunk-D5JID4WC.js";
16
16
  import {
17
17
  configureAlertChannels,
18
18
  listAlerts,
@@ -26,14 +26,14 @@ import {
26
26
  getBridgeStatus,
27
27
  getL2Balance,
28
28
  getTotalPosition
29
- } from "./chunk-LRR663PB.js";
29
+ } from "./chunk-27PRUUR7.js";
30
30
  import {
31
31
  getBalance,
32
32
  getConversionRate,
33
33
  getRewards,
34
34
  unwrapWsteth,
35
35
  wrapSteth
36
- } from "./chunk-WMGNTYBF.js";
36
+ } from "./chunk-XSQE6QAD.js";
37
37
  import "./chunk-P6VFMSPM.js";
38
38
  import {
39
39
  loadBounds,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moly-mcp/lido",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Lido MCP Server — stake, unstake, wrap, govern. Works with Claude Desktop, Cursor, Windsurf, and any MCP client.",
5
5
  "license": "MIT",
6
6
  "type": "module",