@t2000/cli 0.16.30 → 0.17.0
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/README.md +3 -3
- package/dist/{dist-5OPQU5C7.js → dist-S4OOC4XZ.js} +344 -4
- package/dist/dist-S4OOC4XZ.js.map +1 -0
- package/dist/index.js +6 -7
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/dist/dist-5OPQU5C7.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -676,9 +676,8 @@ function registerHealth(program2) {
|
|
|
676
676
|
|
|
677
677
|
// src/commands/rates.ts
|
|
678
678
|
import pc5 from "picocolors";
|
|
679
|
-
import { T2000 as T200014, SUPPORTED_ASSETS } from "@t2000/sdk";
|
|
680
|
-
var
|
|
681
|
-
var INVEST_ASSETS = ["SUI", "ETH", "BTC"];
|
|
679
|
+
import { T2000 as T200014, SUPPORTED_ASSETS, INVESTMENT_ASSETS, STABLE_ASSETS } from "@t2000/sdk";
|
|
680
|
+
var INVEST_ASSETS = Object.keys(INVESTMENT_ASSETS);
|
|
682
681
|
function registerRates(program2) {
|
|
683
682
|
program2.command("rates").description("Show current APY rates across protocols and stablecoins").option("--key <path>", "Key file path").action(async (opts) => {
|
|
684
683
|
try {
|
|
@@ -1874,7 +1873,7 @@ function registerMcp(program2) {
|
|
|
1874
1873
|
mcp.command("start", { isDefault: true }).description("Start MCP server (stdio transport)").option("--key <path>", "Key file path").action(async (opts) => {
|
|
1875
1874
|
let mod;
|
|
1876
1875
|
try {
|
|
1877
|
-
mod = await import("./dist-
|
|
1876
|
+
mod = await import("./dist-S4OOC4XZ.js");
|
|
1878
1877
|
} catch {
|
|
1879
1878
|
console.error(
|
|
1880
1879
|
"MCP server not installed. Run:\n npm install -g @t2000/mcp"
|
|
@@ -2027,7 +2026,7 @@ function registerContacts(program2) {
|
|
|
2027
2026
|
|
|
2028
2027
|
// src/commands/invest.ts
|
|
2029
2028
|
import pc13 from "picocolors";
|
|
2030
|
-
import { T2000 as T200024, formatUsd as formatUsd15, formatAssetAmount } from "@t2000/sdk";
|
|
2029
|
+
import { T2000 as T200024, formatUsd as formatUsd15, formatAssetAmount, INVESTMENT_ASSETS as INVESTMENT_ASSETS2 } from "@t2000/sdk";
|
|
2031
2030
|
function registerInvest(program2) {
|
|
2032
2031
|
const investCmd = program2.command("invest").description("Buy or sell investment assets");
|
|
2033
2032
|
investCmd.command("buy <amount> <asset>").description("Invest USD amount in an asset").option("--key <path>", "Key file path").option("--slippage <pct>", "Max slippage percent", "3").action(async (amount, asset, opts) => {
|
|
@@ -2310,7 +2309,7 @@ function registerInvest(program2) {
|
|
|
2310
2309
|
handleError(error);
|
|
2311
2310
|
}
|
|
2312
2311
|
});
|
|
2313
|
-
strategyCmd.command("create <name>").description("Create a custom strategy").requiredOption("--alloc <pairs...>", "Allocations e.g. SUI:
|
|
2312
|
+
strategyCmd.command("create <name>").description("Create a custom strategy").requiredOption("--alloc <pairs...>", "Allocations e.g. SUI:40 BTC:20 ETH:20 GOLD:20").option("--description <desc>", "Strategy description").action(async (name, opts) => {
|
|
2314
2313
|
try {
|
|
2315
2314
|
const allocations = {};
|
|
2316
2315
|
for (const pair of opts.alloc) {
|
|
@@ -2377,7 +2376,7 @@ function registerInvest(program2) {
|
|
|
2377
2376
|
const agent = await T200024.create({ pin, keyPath: opts.key });
|
|
2378
2377
|
const allStrategies = agent.strategies.getAll();
|
|
2379
2378
|
const isStrategy = target ? target.toLowerCase() in allStrategies : false;
|
|
2380
|
-
const isAsset = target ?
|
|
2379
|
+
const isAsset = target ? target.toUpperCase() in INVESTMENT_ASSETS2 : false;
|
|
2381
2380
|
if (target && !isStrategy && !isAsset) {
|
|
2382
2381
|
console.error(pc13.red(` \u2717 '${target}' is not a valid strategy or asset`));
|
|
2383
2382
|
process.exitCode = 1;
|