@quantish/agent 0.1.37 → 0.1.38

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.
Files changed (2) hide show
  1. package/dist/index.js +64 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -662,9 +662,40 @@ async function runSetup() {
662
662
  let skipTrading = false;
663
663
  if (quantishKey) {
664
664
  console.log(chalk.dim(`Current trading key: ${quantishKey.slice(0, 12)}...`));
665
- const action = await prompt("Keep current key (Enter), enter new key (n), or disable trading (d): ");
665
+ const action = await prompt("Keep (Enter), new key (n), create wallet (c), or disable (d): ");
666
666
  if (action.toLowerCase() === "n") {
667
667
  quantishKey = await prompt("Enter your Quantish Trading API key: ", true);
668
+ } else if (action.toLowerCase() === "c") {
669
+ console.log(chalk.dim("\nCreating a new wallet on Quantish Signing Server..."));
670
+ const externalId = await prompt("Enter a unique identifier (e.g., email or username): ");
671
+ if (!externalId) {
672
+ console.log(chalk.red("Identifier is required to create an account."));
673
+ console.log(chalk.dim("Keeping current key.\n"));
674
+ } else {
675
+ try {
676
+ const mcpClient = createMCPClient(config.getTradingMcpUrl(), "");
677
+ const result = await mcpClient.callTool("request_api_key", { externalId });
678
+ if (result.success && typeof result.data === "object" && result.data !== null) {
679
+ const data = result.data;
680
+ quantishKey = data.apiKey;
681
+ console.log(chalk.green("\n\u2713 New wallet created!"));
682
+ console.log(chalk.dim(` EOA Address: ${data.eoaAddress}`));
683
+ console.log(chalk.dim(" (Your Safe wallet will deploy on first trade)\n"));
684
+ if (data.apiSecret) {
685
+ console.log(chalk.yellow("\u26A0\uFE0F Save your API secret (shown only once):"));
686
+ console.log(chalk.bold.yellow(` ${String(data.apiSecret)}`));
687
+ console.log();
688
+ }
689
+ } else {
690
+ console.log(chalk.red("Failed to create wallet: " + (result.error || "Unknown error")));
691
+ console.log(chalk.dim("Keeping current key.\n"));
692
+ }
693
+ } catch (error2) {
694
+ console.log(chalk.red("Failed to connect to Quantish Trading Server."));
695
+ console.log(chalk.dim(String(error2)));
696
+ console.log(chalk.dim("Keeping current key.\n"));
697
+ }
698
+ }
668
699
  } else if (action.toLowerCase() === "d") {
669
700
  quantishKey = void 0;
670
701
  skipTrading = true;
@@ -728,9 +759,39 @@ async function runSetup() {
728
759
  let skipKalshi = false;
729
760
  if (kalshiKey) {
730
761
  console.log(chalk.dim(`Current Kalshi key: ${kalshiKey.slice(0, 12)}...`));
731
- const action = await prompt("Keep current key (Enter), enter new key (n), or disable Kalshi (d): ");
762
+ const action = await prompt("Keep (Enter), new key (n), create wallet (c), or disable (d): ");
732
763
  if (action.toLowerCase() === "n") {
733
764
  kalshiKey = await prompt("Enter your Kalshi API key: ", true);
765
+ } else if (action.toLowerCase() === "c") {
766
+ console.log(chalk.dim("\nCreating a new Solana wallet on Kalshi MCP..."));
767
+ const externalId = await prompt("Enter a unique identifier (e.g., email or username): ");
768
+ if (!externalId) {
769
+ console.log(chalk.red("Identifier is required to create an account."));
770
+ console.log(chalk.dim("Keeping current key.\n"));
771
+ } else {
772
+ try {
773
+ const kalshiClient = createMCPClient(KALSHI_MCP_URL, "", "kalshi");
774
+ const result = await kalshiClient.callTool("kalshi_signup", { externalId });
775
+ if (result.success && typeof result.data === "object" && result.data !== null) {
776
+ const data = result.data;
777
+ kalshiKey = data.apiKey;
778
+ console.log(chalk.green("\n\u2713 New Kalshi wallet created!"));
779
+ console.log(chalk.dim(` Solana Address: ${data.walletAddress}`));
780
+ if (data.apiSecret) {
781
+ console.log(chalk.yellow("\n\u26A0\uFE0F Save your API secret (shown only once):"));
782
+ console.log(chalk.bold.yellow(` ${String(data.apiSecret)}`));
783
+ console.log();
784
+ }
785
+ } else {
786
+ console.log(chalk.red("Failed to create wallet: " + (result.error || "Unknown error")));
787
+ console.log(chalk.dim("Keeping current key.\n"));
788
+ }
789
+ } catch (error2) {
790
+ console.log(chalk.red("Failed to connect to Kalshi MCP."));
791
+ console.log(chalk.dim(String(error2)));
792
+ console.log(chalk.dim("Keeping current key.\n"));
793
+ }
794
+ }
734
795
  } else if (action.toLowerCase() === "d") {
735
796
  kalshiKey = void 0;
736
797
  skipKalshi = true;
@@ -5427,7 +5488,7 @@ Stopped ${count} background process${count > 1 ? "es" : ""}.`);
5427
5488
  }
5428
5489
 
5429
5490
  // src/index.ts
5430
- var VERSION = "0.1.37";
5491
+ var VERSION = "0.1.38";
5431
5492
  function cleanup() {
5432
5493
  if (processManager.hasRunning()) {
5433
5494
  const count = processManager.runningCount();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantish/agent",
3
- "version": "0.1.37",
3
+ "version": "0.1.38",
4
4
  "description": "AI-powered agent for trading on Polymarket and Kalshi",
5
5
  "type": "module",
6
6
  "bin": {