@hypurrquant/defi-cli 0.2.2 → 0.2.3

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/main.js CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  // src/cli.ts
4
4
  import { Command } from "commander";
5
+ import { createRequire } from "module";
5
6
 
6
7
  // src/executor.ts
7
8
  import { createPublicClient as createPublicClient2, createWalletClient, http as http2 } from "viem";
@@ -8223,6 +8224,8 @@ function registerFarm(parent, getOpts, makeExecutor2) {
8223
8224
  }
8224
8225
 
8225
8226
  // src/cli.ts
8227
+ var _require = createRequire(import.meta.url);
8228
+ var _pkg = _require("../package.json");
8226
8229
  var BANNER = `
8227
8230
  \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557
8228
8231
  \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2551 \u2588\u2588\u2551
@@ -8236,7 +8239,7 @@ var BANNER = `
8236
8239
  Scan exploits, swap tokens, bridge assets, track whales,
8237
8240
  compare yields \u2014 all from your terminal.
8238
8241
  `;
8239
- var program = new Command().name("defi").description("DeFi CLI \u2014 Multi-chain DeFi toolkit").version("0.1.0").addHelpText("before", BANNER).option("--json", "Output as JSON").option("--ndjson", "Output as newline-delimited JSON").option("--fields <fields>", "Select specific output fields (comma-separated)").option("--chain <chain>", "Target chain", "hyperevm").option("--dry-run", "Dry-run mode (default, no broadcast)", true).option("--broadcast", "Actually broadcast the transaction");
8242
+ var program = new Command().name("defi").description("DeFi CLI \u2014 Multi-chain DeFi toolkit").version(_pkg.version).addHelpText("before", BANNER).option("--json", "Output as JSON").option("--ndjson", "Output as newline-delimited JSON").option("--fields <fields>", "Select specific output fields (comma-separated)").option("--chain <chain>", "Target chain", "hyperevm").option("--dry-run", "Dry-run mode (default, no broadcast)", true).option("--broadcast", "Actually broadcast the transaction");
8240
8243
  function getOutputMode() {
8241
8244
  const opts = program.opts();
8242
8245
  return parseOutputMode(opts);
@@ -8367,7 +8370,10 @@ async function showLandingPage(isJson) {
8367
8370
  }, null, 2));
8368
8371
  return;
8369
8372
  }
8370
- const version = "0.2.0";
8373
+ const { createRequire: createRequire2 } = await import("module");
8374
+ const _require2 = createRequire2(import.meta.url);
8375
+ const pkg = _require2("../package.json");
8376
+ const version = pkg.version;
8371
8377
  if (!wallet) {
8372
8378
  console.log("");
8373
8379
  console.log(pc2.bold(pc2.cyan(" DeFi CLI v" + version)));
@@ -8478,7 +8484,8 @@ async function main() {
8478
8484
  const hasSubcommand = rawArgs.some((a) => !a.startsWith("-") && knownSubcommands.has(a));
8479
8485
  const isJson = rawArgs.includes("--json") || rawArgs.includes("--ndjson");
8480
8486
  const isHelp = rawArgs.includes("--help") || rawArgs.includes("-h");
8481
- if (!isHelp && (rawArgs.length === 0 || !hasSubcommand)) {
8487
+ const isVersion = rawArgs.includes("--version") || rawArgs.includes("-V");
8488
+ if (!isHelp && !isVersion && (rawArgs.length === 0 || !hasSubcommand)) {
8482
8489
  await showLandingPage(isJson);
8483
8490
  return;
8484
8491
  }