@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 +36 -17
- package/dist/{chunk-LRR663PB.js → chunk-27PRUUR7.js} +1 -1
- package/dist/{chunk-ZX6OYPKV.js → chunk-A27W633R.js} +1 -1
- package/dist/{chunk-C7R33HEF.js → chunk-D5JID4WC.js} +1 -1
- package/dist/{chunk-WMGNTYBF.js → chunk-XSQE6QAD.js} +8 -1
- package/dist/{daemon-RZA4HEUI.js → daemon-XWJQH7IB.js} +2 -2
- package/dist/{position-ANCFIWD6.js → position-WDLPRIE7.js} +2 -2
- package/dist/server/index.js +4 -4
- package/dist/{session-ZIAXZNTD.js → session-52D3R73Y.js} +4 -4
- package/package.json +1 -1
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
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
592
|
+
const { startChatSession } = await import("./session-52D3R73Y.js");
|
|
574
593
|
await startChatSession(cfg);
|
|
575
594
|
} else {
|
|
576
595
|
await startServer();
|
|
@@ -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
|
-
|
|
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-
|
|
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-
|
|
17
|
+
} from "./chunk-XSQE6QAD.js";
|
|
18
18
|
import "./chunk-P6VFMSPM.js";
|
|
19
19
|
import "./chunk-PDX44BCA.js";
|
|
20
20
|
|
package/dist/server/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
getSettings,
|
|
4
4
|
stakeEth,
|
|
5
5
|
updateSettings
|
|
6
|
-
} from "../chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
36
|
+
} from "./chunk-XSQE6QAD.js";
|
|
37
37
|
import "./chunk-P6VFMSPM.js";
|
|
38
38
|
import {
|
|
39
39
|
loadBounds,
|
package/package.json
CHANGED