omnitrade-mcp 0.9.2 → 0.9.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/cli.js CHANGED
@@ -13,7 +13,7 @@ import { homedir } from "os";
13
13
  import { join } from "path";
14
14
  import * as readline from "readline";
15
15
  import { spawn } from "child_process";
16
- var VERSION = "0.9.2";
16
+ var VERSION = "0.9.3";
17
17
  var CONFIG_PATH = join(homedir(), ".omnitrade", "config.json");
18
18
  var c = {
19
19
  reset: "\x1B[0m",
@@ -29,30 +29,21 @@ var c = {
29
29
  orange: "\x1B[38;5;208m",
30
30
  red: "\x1B[38;5;196m"
31
31
  };
32
- var W = 58;
33
- function center(text, width) {
34
- const visibleLength = text.replace(/\x1b\[[0-9;]*m/g, "").length;
35
- const totalPadding = width - visibleLength;
36
- const leftPad = Math.floor(totalPadding / 2);
37
- const rightPad = totalPadding - leftPad;
38
- return " ".repeat(Math.max(0, leftPad)) + text + " ".repeat(Math.max(0, rightPad));
39
- }
40
32
  function printBanner() {
41
- const line = "-".repeat(W);
42
33
  console.log(`
43
- ${c.cyan}+${line}+${c.reset}
44
- ${c.cyan}|${c.reset}${" ".repeat(W)}${c.cyan}|${c.reset}
45
- ${c.cyan}|${c.reset}${center(`${c.cyan}o${c.gray}--${c.purple}o${c.reset}`, W)}${c.cyan}|${c.reset}
46
- ${c.cyan}|${c.reset}${" ".repeat(W)}${c.cyan}|${c.reset}
47
- ${c.cyan}|${c.reset}${center(`${c.white}${c.bold}O M N I T R A D E${c.reset}`, W)}${c.cyan}|${c.reset}
48
- ${c.cyan}|${c.reset}${center(`${c.gray}v${VERSION}${c.reset}`, W)}${c.cyan}|${c.reset}
49
- ${c.cyan}|${c.reset}${" ".repeat(W)}${c.cyan}|${c.reset}
50
- ${c.cyan}|${c.reset}${center(`${c.dim}Talk to your crypto with Claude${c.reset}`, W)}${c.cyan}|${c.reset}
51
- ${c.cyan}|${c.reset}${center(`${c.dim}107 exchanges \u2022 Natural language \u2022 Local & secure${c.reset}`, W)}${c.cyan}|${c.reset}
52
- ${c.cyan}|${c.reset}${" ".repeat(W)}${c.cyan}|${c.reset}
53
- ${c.cyan}|${c.reset}${center(`${c.cyan}Connectry${c.reset}`, W)}${c.cyan}|${c.reset}
54
- ${c.cyan}|${c.reset}${" ".repeat(W)}${c.cyan}|${c.reset}
55
- ${c.cyan}+${line}+${c.reset}
34
+ \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
35
+ \u2551 \u2551
36
+ \u2551 ${c.purple}\u2588\u2588\u2588\u2588\u2588\u2588\u2557 ${c.reset}\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2551
37
+ \u2551 ${c.purple}\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557${c.reset}\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2551
38
+ \u2551 ${c.purple}\u2588\u2588\u2551 \u2588\u2588\u2551${c.reset}\u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2557 \u2551
39
+ \u2551 ${c.purple}\u2588\u2588\u2551 \u2588\u2588\u2551${c.reset}\u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2551
40
+ \u2551 ${c.purple}\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D${c.reset}\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2551
41
+ \u2551 ${c.purple}\u255A\u2550\u2550\u2550\u2550\u2550\u255D ${c.reset}\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u2551
42
+ \u2551 \u2551
43
+ \u2551 v${VERSION} \u2022 One AI. 107 Exchanges. Natural language trading. \u2551
44
+ \u2551 by Connectry Labs \u2022 https://connectry.io \u2551
45
+ \u2551 \u2551
46
+ \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
56
47
  `);
57
48
  }
58
49
  function printCompactLogo() {
@@ -869,7 +860,7 @@ async function watchPrices(symbols) {
869
860
  exchange = new ExchangeClass({ enableRateLimit: true });
870
861
  const prevPrices = /* @__PURE__ */ new Map();
871
862
  const POLL_INTERVAL = 5e3;
872
- const W2 = 56;
863
+ const W = 56;
873
864
  const pad = (s, n) => {
874
865
  const visible = s.replace(/\x1b\[[0-9;]*m/g, "").length;
875
866
  return s + " ".repeat(Math.max(0, n - visible));
@@ -882,21 +873,21 @@ async function watchPrices(symbols) {
882
873
  };
883
874
  const render = (prices) => {
884
875
  const now = (/* @__PURE__ */ new Date()).toLocaleTimeString();
885
- const line = "\u2500".repeat(W2);
886
- const hline = "\u2550".repeat(W2);
876
+ const line = "\u2500".repeat(W);
877
+ const hline = "\u2550".repeat(W);
887
878
  process.stdout.write("\x1B[2J\x1B[H");
888
879
  console.log(` ${c.cyan}\u2554${hline}\u2557${c.reset}`);
889
- console.log(` ${c.cyan}\u2551${c.reset}${pad(` ${c.white}${c.bold}OmniTrade Watch${c.reset} ${c.dim}\u2022 ${exchangeName} \u2022 ${now}${c.reset}`, W2)}${c.cyan}\u2551${c.reset}`);
880
+ console.log(` ${c.cyan}\u2551${c.reset}${pad(` ${c.white}${c.bold}OmniTrade Watch${c.reset} ${c.dim}\u2022 ${exchangeName} \u2022 ${now}${c.reset}`, W)}${c.cyan}\u2551${c.reset}`);
890
881
  console.log(` ${c.cyan}\u2560${hline}\u2563${c.reset}`);
891
882
  if (prices.size === 0) {
892
- console.log(` ${c.cyan}\u2551${c.reset} ${c.yellow}Loading prices...${c.reset}${" ".repeat(W2 - 19)}${c.cyan}\u2551${c.reset}`);
883
+ console.log(` ${c.cyan}\u2551${c.reset} ${c.yellow}Loading prices...${c.reset}${" ".repeat(W - 19)}${c.cyan}\u2551${c.reset}`);
893
884
  } else {
894
885
  for (const [symbol, data] of prices.entries()) {
895
886
  if (data.error) {
896
887
  const errLabel = "\u26A0 INVALID".padStart(12);
897
888
  const errDetail = "symbol not found on exchange";
898
889
  const rowVisible2 = ` ${symbol.padEnd(12)} ${errLabel} \xD7 ${errDetail} `;
899
- const padding2 = " ".repeat(Math.max(0, W2 - rowVisible2.length + 2));
890
+ const padding2 = " ".repeat(Math.max(0, W - rowVisible2.length + 2));
900
891
  console.log(
901
892
  ` ${c.cyan}\u2551${c.reset} ${c.red}${symbol.padEnd(12)}${c.reset} ${c.red}${errLabel}${c.reset} ${c.red}\xD7 ${errDetail}${c.reset}${padding2}${c.cyan}\u2551${c.reset}`
902
893
  );
@@ -909,14 +900,14 @@ async function watchPrices(symbols) {
909
900
  const priceFormatted = formatPrice(data.last).padStart(12);
910
901
  const changeFormatted = data.change !== 0 ? `${isUp ? "+" : ""}${data.change.toFixed(data.last >= 100 ? 2 : 6)} (${isUp ? "+" : ""}${data.changePct.toFixed(2)}%)` : "no change";
911
902
  const rowVisible = ` ${symbol.padEnd(12)} ${priceFormatted} _ ${changeFormatted} `;
912
- const padding = " ".repeat(Math.max(0, W2 - rowVisible.length + 2));
903
+ const padding = " ".repeat(Math.max(0, W - rowVisible.length + 2));
913
904
  console.log(
914
905
  ` ${c.cyan}\u2551${c.reset} ${c.white}${symbol.padEnd(12)}${c.reset} ${priceColor}${priceFormatted}${c.reset} ${arrow} ${priceColor}${changeFormatted}${c.reset}${padding}${c.cyan}\u2551${c.reset}`
915
906
  );
916
907
  }
917
908
  }
918
909
  console.log(` ${c.cyan}\u2560${hline}\u2563${c.reset}`);
919
- console.log(` ${c.cyan}\u2551${c.reset} ${c.dim}Ctrl+C to stop \u2022 Updates every ${POLL_INTERVAL / 1e3}s${c.reset}${" ".repeat(W2 - 38)}${c.cyan}\u2551${c.reset}`);
910
+ console.log(` ${c.cyan}\u2551${c.reset} ${c.dim}Ctrl+C to stop \u2022 Updates every ${POLL_INTERVAL / 1e3}s${c.reset}${" ".repeat(W - 38)}${c.cyan}\u2551${c.reset}`);
920
911
  console.log(` ${c.cyan}\u255A${hline}\u255D${c.reset}`);
921
912
  };
922
913
  render(/* @__PURE__ */ new Map());
package/dist/index.js CHANGED
@@ -3015,7 +3015,7 @@ function registerConditionalOrderTools(server, exchangeManager, config) {
3015
3015
  }
3016
3016
 
3017
3017
  // src/index.ts
3018
- var VERSION = "0.9.2";
3018
+ var VERSION = "0.9.3";
3019
3019
  function showBanner() {
3020
3020
  const purple = "\x1B[35m";
3021
3021
  const reset = "\x1B[0m";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnitrade-mcp",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "description": "Multi-exchange AI trading via MCP. 107 exchanges. One AI.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",