@t2000/cli 0.17.23 → 0.17.24

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 (137) hide show
  1. package/dist/commands/address.d.ts +3 -0
  2. package/dist/commands/address.d.ts.map +1 -0
  3. package/dist/commands/address.js +26 -0
  4. package/dist/commands/address.js.map +1 -0
  5. package/dist/commands/balance.d.ts +3 -0
  6. package/dist/commands/balance.d.ts.map +1 -0
  7. package/dist/commands/balance.js +134 -0
  8. package/dist/commands/balance.js.map +1 -0
  9. package/dist/commands/borrow.d.ts +3 -0
  10. package/dist/commands/borrow.d.ts.map +1 -0
  11. package/dist/commands/borrow.js +40 -0
  12. package/dist/commands/borrow.js.map +1 -0
  13. package/dist/commands/claimRewards.d.ts +3 -0
  14. package/dist/commands/claimRewards.d.ts.map +1 -0
  15. package/dist/commands/claimRewards.js +49 -0
  16. package/dist/commands/claimRewards.js.map +1 -0
  17. package/dist/commands/config.d.ts +3 -0
  18. package/dist/commands/config.d.ts.map +1 -0
  19. package/dist/commands/config.js +139 -0
  20. package/dist/commands/config.js.map +1 -0
  21. package/dist/commands/contacts.d.ts +3 -0
  22. package/dist/commands/contacts.d.ts.map +1 -0
  23. package/dist/commands/contacts.js +83 -0
  24. package/dist/commands/contacts.js.map +1 -0
  25. package/dist/commands/deposit.d.ts +3 -0
  26. package/dist/commands/deposit.d.ts.map +1 -0
  27. package/dist/commands/deposit.js +27 -0
  28. package/dist/commands/deposit.js.map +1 -0
  29. package/dist/commands/earn.d.ts +3 -0
  30. package/dist/commands/earn.d.ts.map +1 -0
  31. package/dist/commands/earn.js +186 -0
  32. package/dist/commands/earn.js.map +1 -0
  33. package/dist/commands/earnings.d.ts +3 -0
  34. package/dist/commands/earnings.d.ts.map +1 -0
  35. package/dist/commands/earnings.js +38 -0
  36. package/dist/commands/earnings.js.map +1 -0
  37. package/dist/commands/exchange.d.ts +3 -0
  38. package/dist/commands/exchange.d.ts.map +1 -0
  39. package/dist/commands/exchange.js +45 -0
  40. package/dist/commands/exchange.js.map +1 -0
  41. package/dist/commands/exportKey.d.ts +3 -0
  42. package/dist/commands/exportKey.d.ts.map +1 -0
  43. package/dist/commands/exportKey.js +81 -0
  44. package/dist/commands/exportKey.js.map +1 -0
  45. package/dist/commands/fundStatus.d.ts +3 -0
  46. package/dist/commands/fundStatus.d.ts.map +1 -0
  47. package/dist/commands/fundStatus.js +50 -0
  48. package/dist/commands/fundStatus.js.map +1 -0
  49. package/dist/commands/health.d.ts +3 -0
  50. package/dist/commands/health.d.ts.map +1 -0
  51. package/dist/commands/health.js +44 -0
  52. package/dist/commands/health.js.map +1 -0
  53. package/dist/commands/history.d.ts +3 -0
  54. package/dist/commands/history.d.ts.map +1 -0
  55. package/dist/commands/history.js +37 -0
  56. package/dist/commands/history.js.map +1 -0
  57. package/dist/commands/importKey.d.ts +3 -0
  58. package/dist/commands/importKey.d.ts.map +1 -0
  59. package/dist/commands/importKey.js +39 -0
  60. package/dist/commands/importKey.js.map +1 -0
  61. package/dist/commands/init.d.ts +3 -0
  62. package/dist/commands/init.d.ts.map +1 -0
  63. package/dist/commands/init.js +56 -0
  64. package/dist/commands/init.js.map +1 -0
  65. package/dist/commands/invest.d.ts +3 -0
  66. package/dist/commands/invest.d.ts.map +1 -0
  67. package/dist/commands/invest.js +635 -0
  68. package/dist/commands/invest.js.map +1 -0
  69. package/dist/commands/lock.d.ts +3 -0
  70. package/dist/commands/lock.d.ts.map +1 -0
  71. package/dist/commands/lock.js +66 -0
  72. package/dist/commands/lock.js.map +1 -0
  73. package/dist/commands/mcp.d.ts +3 -0
  74. package/dist/commands/mcp.d.ts.map +1 -0
  75. package/dist/commands/mcp.js +141 -0
  76. package/dist/commands/mcp.js.map +1 -0
  77. package/dist/commands/pay.d.ts +3 -0
  78. package/dist/commands/pay.d.ts.map +1 -0
  79. package/dist/commands/pay.js +96 -0
  80. package/dist/commands/pay.js.map +1 -0
  81. package/dist/commands/portfolio.d.ts +3 -0
  82. package/dist/commands/portfolio.d.ts.map +1 -0
  83. package/dist/commands/portfolio.js +104 -0
  84. package/dist/commands/portfolio.js.map +1 -0
  85. package/dist/commands/positions.d.ts +3 -0
  86. package/dist/commands/positions.d.ts.map +1 -0
  87. package/dist/commands/positions.js +73 -0
  88. package/dist/commands/positions.js.map +1 -0
  89. package/dist/commands/rates.d.ts +3 -0
  90. package/dist/commands/rates.d.ts.map +1 -0
  91. package/dist/commands/rates.js +64 -0
  92. package/dist/commands/rates.js.map +1 -0
  93. package/dist/commands/rebalance.d.ts +3 -0
  94. package/dist/commands/rebalance.d.ts.map +1 -0
  95. package/dist/commands/rebalance.js +109 -0
  96. package/dist/commands/rebalance.js.map +1 -0
  97. package/dist/commands/repay.d.ts +3 -0
  98. package/dist/commands/repay.d.ts.map +1 -0
  99. package/dist/commands/repay.js +35 -0
  100. package/dist/commands/repay.js.map +1 -0
  101. package/dist/commands/save.d.ts +3 -0
  102. package/dist/commands/save.d.ts.map +1 -0
  103. package/dist/commands/save.js +57 -0
  104. package/dist/commands/save.js.map +1 -0
  105. package/dist/commands/send.d.ts +3 -0
  106. package/dist/commands/send.d.ts.map +1 -0
  107. package/dist/commands/send.js +52 -0
  108. package/dist/commands/send.js.map +1 -0
  109. package/dist/commands/sentinel.d.ts +3 -0
  110. package/dist/commands/sentinel.d.ts.map +1 -0
  111. package/dist/commands/sentinel.js +142 -0
  112. package/dist/commands/sentinel.js.map +1 -0
  113. package/dist/commands/serve.d.ts +3 -0
  114. package/dist/commands/serve.d.ts.map +1 -0
  115. package/dist/commands/serve.js +341 -0
  116. package/dist/commands/serve.js.map +1 -0
  117. package/dist/commands/withdraw.d.ts +3 -0
  118. package/dist/commands/withdraw.d.ts.map +1 -0
  119. package/dist/commands/withdraw.js +34 -0
  120. package/dist/commands/withdraw.js.map +1 -0
  121. package/dist/index.d.ts +2 -0
  122. package/dist/index.d.ts.map +1 -0
  123. package/dist/index.js +2 -2708
  124. package/dist/index.js.map +1 -1
  125. package/dist/output.d.ts +16 -0
  126. package/dist/output.d.ts.map +1 -0
  127. package/dist/output.js +85 -0
  128. package/dist/output.js.map +1 -0
  129. package/dist/program.d.ts +3 -0
  130. package/dist/program.d.ts.map +1 -0
  131. package/dist/program.js +80 -0
  132. package/dist/program.js.map +1 -0
  133. package/dist/prompts.d.ts +16 -0
  134. package/dist/prompts.d.ts.map +1 -0
  135. package/dist/prompts.js +69 -0
  136. package/dist/prompts.js.map +1 -0
  137. package/package.json +4 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rates.d.ts","sourceRoot":"","sources":["../../src/commands/rates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASzC,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,QA8D7C"}
@@ -0,0 +1,64 @@
1
+ import pc from 'picocolors';
2
+ import { T2000, SUPPORTED_ASSETS, INVESTMENT_ASSETS, STABLE_ASSETS } from '@t2000/sdk';
3
+ const INVEST_ASSETS = Object.keys(INVESTMENT_ASSETS);
4
+ import { resolvePin } from '../prompts.js';
5
+ import { printKeyValue, printBlank, printJson, isJsonMode, handleError, printInfo, printLine, printDivider } from '../output.js';
6
+ export function registerRates(program) {
7
+ program
8
+ .command('rates')
9
+ .description('Show current APY rates across protocols and stablecoins')
10
+ .option('--key <path>', 'Key file path')
11
+ .action(async (opts) => {
12
+ try {
13
+ const pin = await resolvePin();
14
+ const agent = await T2000.create({ pin, keyPath: opts.key });
15
+ const allRates = await agent.allRatesAcrossAssets();
16
+ if (isJsonMode()) {
17
+ printJson(allRates);
18
+ return;
19
+ }
20
+ printBlank();
21
+ if (allRates.length > 0) {
22
+ const best = allRates.reduce((a, b) => b.rates.saveApy > a.rates.saveApy ? b : a);
23
+ const bestDisplay = SUPPORTED_ASSETS[best.asset]?.displayName ?? best.asset;
24
+ printLine(pc.bold(pc.green(`Best yield: ${best.rates.saveApy.toFixed(2)}% APY`)) + pc.dim(` (${bestDisplay} on ${best.protocol})`));
25
+ printBlank();
26
+ }
27
+ for (const asset of STABLE_ASSETS) {
28
+ const assetRates = allRates.filter(r => r.asset === asset);
29
+ if (assetRates.length === 0)
30
+ continue;
31
+ const display = SUPPORTED_ASSETS[asset]?.displayName ?? asset;
32
+ printLine(pc.bold(display));
33
+ printDivider();
34
+ for (const entry of assetRates) {
35
+ printKeyValue(entry.protocol, `Save ${entry.rates.saveApy.toFixed(2)}% Borrow ${entry.rates.borrowApy.toFixed(2)}%`);
36
+ }
37
+ printBlank();
38
+ }
39
+ const investRates = allRates.filter(r => INVEST_ASSETS.includes(r.asset));
40
+ if (investRates.length > 0) {
41
+ printLine(pc.bold('Investment Assets'));
42
+ printDivider();
43
+ for (const asset of INVEST_ASSETS) {
44
+ const assetRates = investRates.filter(r => r.asset === asset);
45
+ if (assetRates.length === 0)
46
+ continue;
47
+ const display = SUPPORTED_ASSETS[asset]?.displayName ?? asset;
48
+ for (const entry of assetRates) {
49
+ printKeyValue(`${display} (${entry.protocol})`, `Lend ${entry.rates.saveApy.toFixed(2)}%`);
50
+ }
51
+ }
52
+ printBlank();
53
+ }
54
+ if (allRates.length === 0) {
55
+ printInfo('No protocol rates available');
56
+ printBlank();
57
+ }
58
+ }
59
+ catch (error) {
60
+ handleError(error);
61
+ }
62
+ });
63
+ }
64
+ //# sourceMappingURL=rates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rates.js","sourceRoot":"","sources":["../../src/commands/rates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGvF,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAqB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAA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AI,UAAU,CAAC,MAAM,KAAK,CAAC;wBAAE,SAAS;oBACtC,MAAM,OAAO,GAAG,gBAAgB,CAAC,KAAK,CAAC,EAAE,WAAW,IAAI,KAAK,CAAC;oBAC9D,KAAK,MAAM,KAAK,IAAI,UAAU,EAAE,CAAC;wBAC/B,aAAa,CAAC,GAAG,OAAO,KAAK,KAAK,CAAC,QAAQ,GAAG,EAAE,QAAQ,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;oBAC7F,CAAC;gBACH,CAAC;gBACD,UAAU,EAAE,CAAC;YACf,CAAC;YAED,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC1B,SAAS,CAAC,6BAA6B,CAAC,CAAC;gBACzC,UAAU,EAAE,CAAC;YACf,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,WAAW,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Command } from 'commander';
2
+ export declare function registerRebalance(program: Command): void;
3
+ //# sourceMappingURL=rebalance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rebalance.d.ts","sourceRoot":"","sources":["../../src/commands/rebalance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBzC,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,QAyGjD"}
@@ -0,0 +1,109 @@
1
+ import pc from 'picocolors';
2
+ import { T2000, formatUsd, SUPPORTED_ASSETS } from '@t2000/sdk';
3
+ import { resolvePin } from '../prompts.js';
4
+ import { printSuccess, printKeyValue, printBlank, printJson, isJsonMode, handleError, printInfo, printLine, printDivider, explorerUrl, } from '../output.js';
5
+ export function registerRebalance(program) {
6
+ program
7
+ .command('rebalance')
8
+ .description('Optimize yield — move savings to the best rate across protocols and stablecoins')
9
+ .option('--key <path>', 'Key file path')
10
+ .option('--dry-run', 'Show what would happen without executing')
11
+ .option('--min-diff <pct>', 'Minimum APY difference to trigger (default: 0.5)', '0.5')
12
+ .option('--max-break-even <days>', 'Max break-even days for cross-asset moves (default: 30)', '30')
13
+ .action(async (opts) => {
14
+ try {
15
+ const pin = await resolvePin();
16
+ const agent = await T2000.create({ pin, keyPath: opts.key });
17
+ const minYieldDiff = parseFloat(opts.minDiff ?? '0.5');
18
+ const maxBreakEven = parseInt(opts.maxBreakEven ?? '30', 10);
19
+ const plan = await agent.rebalance({
20
+ dryRun: true,
21
+ minYieldDiff,
22
+ maxBreakEven,
23
+ });
24
+ if (isJsonMode()) {
25
+ if (opts.dryRun) {
26
+ printJson(plan);
27
+ }
28
+ else {
29
+ const result = await agent.rebalance({ dryRun: false, minYieldDiff, maxBreakEven });
30
+ printJson(result);
31
+ }
32
+ return;
33
+ }
34
+ printBlank();
35
+ if (plan.steps.length === 0) {
36
+ const diff = plan.newApy - plan.currentApy;
37
+ if (diff < minYieldDiff) {
38
+ printInfo(`Already optimized — ${plan.currentApy.toFixed(2)}% APY on ${plan.fromProtocol}`);
39
+ printLine(pc.dim(` Best available: ${plan.newApy.toFixed(2)}% (${displayAsset(plan.toAsset)} on ${plan.toProtocol})`));
40
+ printLine(pc.dim(` Difference: ${diff.toFixed(2)}% (below ${minYieldDiff}% threshold)`));
41
+ }
42
+ else if (plan.breakEvenDays > maxBreakEven && plan.estimatedSwapCost > 0) {
43
+ printInfo(`Skipped — break-even of ${plan.breakEvenDays} days exceeds ${maxBreakEven}-day limit`);
44
+ printLine(pc.dim(` ${displayAsset(plan.fromAsset)} on ${plan.fromProtocol} (${plan.currentApy.toFixed(2)}%) → ${displayAsset(plan.toAsset)} on ${plan.toProtocol} (${plan.newApy.toFixed(2)}%)`));
45
+ }
46
+ else {
47
+ printInfo('Already at the best rate. Nothing to rebalance.');
48
+ }
49
+ printBlank();
50
+ return;
51
+ }
52
+ printLine(pc.bold('Rebalance Plan'));
53
+ printDivider();
54
+ printKeyValue('From', `${displayAsset(plan.fromAsset)} on ${plan.fromProtocol} (${plan.currentApy.toFixed(2)}% APY)`);
55
+ printKeyValue('To', `${displayAsset(plan.toAsset)} on ${plan.toProtocol} (${plan.newApy.toFixed(2)}% APY)`);
56
+ printKeyValue('Amount', formatUsd(plan.amount));
57
+ printBlank();
58
+ printLine(pc.bold('Economics'));
59
+ printDivider();
60
+ printKeyValue('APY Gain', `+${(plan.newApy - plan.currentApy).toFixed(2)}%`);
61
+ printKeyValue('Annual Gain', `${formatUsd(plan.annualGain)}/year`);
62
+ if (plan.estimatedSwapCost > 0) {
63
+ printKeyValue('Swap Cost', `~${formatUsd(plan.estimatedSwapCost)}`);
64
+ printKeyValue('Break-even', `${plan.breakEvenDays} days`);
65
+ }
66
+ printBlank();
67
+ if (plan.steps.length > 0) {
68
+ printLine(pc.bold('Steps'));
69
+ printDivider();
70
+ for (let i = 0; i < plan.steps.length; i++) {
71
+ const step = plan.steps[i];
72
+ const num = `${i + 1}.`;
73
+ if (step.action === 'withdraw') {
74
+ printLine(` ${num} Withdraw ${formatUsd(step.amount)} ${displayAsset(step.fromAsset ?? '')} from ${step.protocol}`);
75
+ }
76
+ else if (step.action === 'swap') {
77
+ printLine(` ${num} Swap ${displayAsset(step.fromAsset ?? '')} → ${displayAsset(step.toAsset ?? '')} (~${formatUsd(step.estimatedOutput ?? 0)})`);
78
+ }
79
+ else if (step.action === 'deposit') {
80
+ printLine(` ${num} Deposit ${formatUsd(step.amount)} ${displayAsset(step.toAsset ?? '')} into ${step.protocol}`);
81
+ }
82
+ }
83
+ printBlank();
84
+ }
85
+ if (opts.dryRun) {
86
+ printLine(pc.bold(pc.yellow('DRY RUN — Preview only, no transactions executed')));
87
+ printLine(pc.dim(' Run `t2000 rebalance` to execute.'));
88
+ printBlank();
89
+ return;
90
+ }
91
+ const result = await agent.rebalance({ dryRun: false, minYieldDiff, maxBreakEven });
92
+ if (result.executed) {
93
+ printSuccess(`Rebalanced ${formatUsd(result.amount)} → ${result.newApy.toFixed(2)}% APY`);
94
+ for (const digest of result.txDigests) {
95
+ printKeyValue('Tx', explorerUrl(digest));
96
+ }
97
+ printKeyValue('Gas', `${result.totalGasCost.toFixed(4)} SUI`);
98
+ }
99
+ printBlank();
100
+ }
101
+ catch (error) {
102
+ handleError(error);
103
+ }
104
+ });
105
+ }
106
+ function displayAsset(asset) {
107
+ return SUPPORTED_ASSETS[asset]?.displayName ?? asset;
108
+ }
109
+ //# sourceMappingURL=rebalance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rebalance.js","sourceRoot":"","sources":["../../src/commands/rebalance.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EACL,YAAY,EACZ,aAAa,EACb,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACX,SAAS,EAET,SAAS,EACT,YAAY,EACZ,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,MAAM,UAAU,iBAAiB,CAAC,OAAgB;IAChD,OAAO;SACJ,OAAO,CAAC,WAAW,CAAC;SACpB,WAAW,CAAC,iFAAiF,CAAC;SAC9F,MAAM,CAAC,cAAc,EAAE,eAAe,CAAC;SACvC,MAAM,CAAC,WAAW,EAAE,0CAA0C,CAAC;SAC/D,MAAM,CAAC,kBAAkB,EAAE,kDAAkD,EAAE,KAAK,CAAC;SACrF,MAAM,CAAC,yBAAyB,EAAE,yDAAyD,EAAE,IAAI,CAAC;SAClG,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QACrB,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,MAAM,UAAU,EAAE,CAAC;YAC/B,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC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C,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;gBAC3C,CAAC;gBACD,aAAa,CAAC,KAAK,EAAE,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;YAChE,CAAC;YAED,UAAU,EAAE,CAAC;QACf,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,WAAW,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,gBAAgB,CAAC,KAAsC,CAAC,EAAE,WAAW,IAAI,KAAK,CAAC;AACxF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Command } from 'commander';
2
+ export declare function registerRepay(program: Command): void;
3
+ //# sourceMappingURL=repay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repay.d.ts","sourceRoot":"","sources":["../../src/commands/repay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,QAiC7C"}
@@ -0,0 +1,35 @@
1
+ import { T2000, formatUsd } from '@t2000/sdk';
2
+ import { resolvePin } from '../prompts.js';
3
+ import { printSuccess, printKeyValue, printBlank, printJson, isJsonMode, handleError, explorerUrl } from '../output.js';
4
+ export function registerRepay(program) {
5
+ program
6
+ .command('repay')
7
+ .description('Repay borrowed USDC')
8
+ .argument('<amount>', 'Amount to repay (or "all")')
9
+ .option('--key <path>', 'Key file path')
10
+ .option('--protocol <name>', 'Protocol to use (e.g. navi)')
11
+ .action(async (amountStr, opts) => {
12
+ try {
13
+ const amount = amountStr === 'all' ? 'all' : parseFloat(amountStr);
14
+ if (amount !== 'all' && (isNaN(amount) || amount <= 0)) {
15
+ throw new Error('Amount must be a positive number or "all"');
16
+ }
17
+ const pin = await resolvePin();
18
+ const agent = await T2000.create({ pin, keyPath: opts.key });
19
+ const result = await agent.repay({ amount, protocol: opts.protocol });
20
+ if (isJsonMode()) {
21
+ printJson(result);
22
+ return;
23
+ }
24
+ printBlank();
25
+ printSuccess(`Repaid ${formatUsd(result.amount)} USDC`);
26
+ printKeyValue('Remaining Debt', formatUsd(result.remainingDebt));
27
+ printKeyValue('Tx', explorerUrl(result.tx));
28
+ printBlank();
29
+ }
30
+ catch (error) {
31
+ handleError(error);
32
+ }
33
+ });
34
+ }
35
+ //# sourceMappingURL=repay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repay.js","sourceRoot":"","sources":["../../src/commands/repay.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAExH,MAAM,UAAU,aAAa,CAAC,OAAgB;IAC5C,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,qBAAqB,CAAC;SAClC,QAAQ,CAAC,UAAU,EAAE,4BAA4B,CAAC;SAClD,MAAM,CAAC,cAAc,EAAE,eAAe,CAAC;SACvC,MAAM,CAAC,mBAAmB,EAAE,6BAA6B,CAAC;SAC1D,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE;QAChC,IAAI,CAAC;YACH,MAAM,MAAM,GAAmB,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;YACnF,IAAI,MAAM,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC;gBACvD,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;YAC/D,CAAC;YAED,MAAM,GAAG,GAAG,MAAM,UAAU,EAAE,CAAC;YAC/B,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;YAE7D,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAEtE,IAAI,UAAU,EAAE,EAAE,CAAC;gBACjB,SAAS,CAAC,MAAM,CAAC,CAAC;gBAClB,OAAO;YACT,CAAC;YAED,UAAU,EAAE,CAAC;YACb,YAAY,CAAC,UAAU,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACxD,aAAa,CAAC,gBAAgB,EAAE,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;YACjE,aAAa,CAAC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;YAC5C,UAAU,EAAE,CAAC;QACf,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,WAAW,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Command } from 'commander';
2
+ export declare function registerSave(program: Command): void;
3
+ //# sourceMappingURL=save.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"save.d.ts","sourceRoot":"","sources":["../../src/commands/save.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMzC,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,QA+D5C"}
@@ -0,0 +1,57 @@
1
+ import pc from 'picocolors';
2
+ import { T2000, formatUsd } from '@t2000/sdk';
3
+ import { resolvePin } from '../prompts.js';
4
+ import { printSuccess, printKeyValue, printBlank, printJson, isJsonMode, handleError, explorerUrl } from '../output.js';
5
+ export function registerSave(program) {
6
+ const action = async (amountStr, opts) => {
7
+ try {
8
+ const amount = amountStr === 'all' ? 'all' : parseFloat(amountStr);
9
+ if (amount !== 'all' && (isNaN(amount) || amount <= 0)) {
10
+ throw new Error('Amount must be a positive number or "all"');
11
+ }
12
+ const pin = await resolvePin();
13
+ const agent = await T2000.create({ pin, keyPath: opts.key });
14
+ let gasManagerUsdc = 0;
15
+ agent.on('gasAutoTopUp', (data) => {
16
+ gasManagerUsdc = data.usdcSpent;
17
+ });
18
+ const result = await agent.save({ amount, protocol: opts.protocol });
19
+ if (isJsonMode()) {
20
+ printJson(result);
21
+ return;
22
+ }
23
+ printBlank();
24
+ if (gasManagerUsdc > 0) {
25
+ printSuccess(`Gas manager: ${pc.yellow(formatUsd(gasManagerUsdc))} USDC → SUI`);
26
+ }
27
+ const protocolName = opts.protocol ?? 'best rate';
28
+ printSuccess(`Saved ${pc.yellow(formatUsd(result.amount))} USDC to ${protocolName}`);
29
+ if (result.fee > 0) {
30
+ const feeRate = (result.fee / result.amount * 100).toFixed(1);
31
+ printSuccess(`Protocol fee: ${pc.dim(`${formatUsd(result.fee)} USDC (${feeRate}%)`)}`);
32
+ }
33
+ printSuccess(`Current APY: ${pc.green(`${result.apy.toFixed(2)}%`)}`);
34
+ printSuccess(`Savings balance: ${pc.yellow(formatUsd(result.savingsBalance))} USDC`);
35
+ printKeyValue('Tx', explorerUrl(result.tx));
36
+ printBlank();
37
+ }
38
+ catch (error) {
39
+ handleError(error);
40
+ }
41
+ };
42
+ program
43
+ .command('save')
44
+ .description('Deposit USDC into savings')
45
+ .argument('<amount>', 'Amount to save (or "all")')
46
+ .option('--key <path>', 'Key file path')
47
+ .option('--protocol <name>', 'Protocol to use (e.g. navi, suilend)')
48
+ .action(action);
49
+ program
50
+ .command('supply')
51
+ .description('Deposit USDC into savings (alias for save)')
52
+ .argument('<amount>', 'Amount to save (or "all")')
53
+ .option('--key <path>', 'Key file path')
54
+ .option('--protocol <name>', 'Protocol to use (e.g. navi, suilend)')
55
+ .action(action);
56
+ }
57
+ //# sourceMappingURL=save.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"save.js","sourceRoot":"","sources":["../../src/commands/save.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAExH,MAAM,UAAU,YAAY,CAAC,OAAgB;IAC3C,MAAM,MAAM,GAAG,KAAK,EAAE,SAAiB,EAAE,IAAyC,EAAE,EAAE;QAClF,IAAI,CAAC;YACH,MAAM,MAAM,GAAmB,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;YACnF,IAAI,MAAM,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC;gBACvD,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;YAC/D,CAAC;YAED,MAAM,GAAG,GAAG,MAAM,UAAU,EAAE,CAAC;YAC/B,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;YAE7D,IAAI,cAAc,GAAG,CAAC,CAAC;YACvB,KAAK,CAAC,EAAE,CAAC,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE;gBAChC,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC;YAClC,CAAC,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,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;QACjB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,WAAW,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,2BAA2B,CAAC;SACxC,QAAQ,CAAC,UAAU,EAAE,2BAA2B,CAAC;SACjD,MAAM,CAAC,cAAc,EAAE,eAAe,CAAC;SACvC,MAAM,CAAC,mBAAmB,EAAE,sCAAsC,CAAC;SACnE,MAAM,CAAC,MAAM,CAAC,CAAC;IAElB,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,4CAA4C,CAAC;SACzD,QAAQ,CAAC,UAAU,EAAE,2BAA2B,CAAC;SACjD,MAAM,CAAC,cAAc,EAAE,eAAe,CAAC;SACvC,MAAM,CAAC,mBAAmB,EAAE,sCAAsC,CAAC;SACnE,MAAM,CAAC,MAAM,CAAC,CAAC;AACpB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Command } from 'commander';
2
+ export declare function registerSend(program: Command): void;
3
+ //# sourceMappingURL=send.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../src/commands/send.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmBzC,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,QAqC5C"}
@@ -0,0 +1,52 @@
1
+ import { T2000 } from '@t2000/sdk';
2
+ import { resolvePin } from '../prompts.js';
3
+ import { printSuccess, printKeyValue, printBlank, printJson, isJsonMode, handleError, explorerUrl } from '../output.js';
4
+ import { truncateAddress, formatUsd } from '@t2000/sdk';
5
+ const KNOWN_ASSETS = new Set(['USDC', 'USDT', 'USDE', 'USDSUI', 'SUI']);
6
+ function parseSendArgs(args) {
7
+ const filtered = args.filter(a => a.toLowerCase() !== 'to');
8
+ if (filtered.length >= 3 && KNOWN_ASSETS.has(filtered[1].toUpperCase())) {
9
+ return { amount: parseFloat(filtered[0]), asset: filtered[1].toUpperCase(), recipient: filtered[2] };
10
+ }
11
+ if (filtered.length >= 2) {
12
+ return { amount: parseFloat(filtered[0]), asset: 'USDC', recipient: filtered[filtered.length - 1] };
13
+ }
14
+ throw new Error('Usage: t2000 send <amount> [asset] [to] <address_or_contact>');
15
+ }
16
+ export function registerSend(program) {
17
+ program
18
+ .command('send')
19
+ .argument('<amount>', 'Amount to send')
20
+ .argument('[args...]', 'Asset, "to" keyword, and recipient address or contact name')
21
+ .description('Send USDC (or other asset) to an address or contact name')
22
+ .option('--key <path>', 'Key file path')
23
+ .action(async (amount, args, opts) => {
24
+ try {
25
+ const { amount: parsedAmount, asset, recipient } = parseSendArgs([amount, ...args]);
26
+ const pin = await resolvePin();
27
+ const agent = await T2000.create({ pin, keyPath: opts.key });
28
+ const result = await agent.send({
29
+ to: recipient,
30
+ amount: parsedAmount,
31
+ asset,
32
+ });
33
+ if (isJsonMode()) {
34
+ printJson(result);
35
+ return;
36
+ }
37
+ printBlank();
38
+ const displayTo = result.contactName
39
+ ? `${result.contactName} (${truncateAddress(result.to)})`
40
+ : truncateAddress(result.to);
41
+ printSuccess(`Sent ${formatUsd(result.amount)} ${asset.toUpperCase()} → ${displayTo}`);
42
+ printKeyValue('Gas', `${result.gasCost.toFixed(4)} ${result.gasCostUnit} (${result.gasMethod})`);
43
+ printKeyValue('Balance', formatUsd(result.balance.available) + ' USDC');
44
+ printKeyValue('Tx', explorerUrl(result.tx));
45
+ printBlank();
46
+ }
47
+ catch (error) {
48
+ handleError(error);
49
+ }
50
+ });
51
+ }
52
+ //# sourceMappingURL=send.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send.js","sourceRoot":"","sources":["../../src/commands/send.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,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AAC,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,CAAC;YACxE,aAAa,CAAC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;YAC5C,UAAU,EAAE,CAAC;QACf,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,WAAW,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Command } from 'commander';
2
+ export declare function registerSentinel(program: Command): void;
3
+ //# sourceMappingURL=sentinel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentinel.d.ts","sourceRoot":"","sources":["../../src/commands/sentinel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuBzC,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,QAkJhD"}
@@ -0,0 +1,142 @@
1
+ import { T2000, MIST_PER_SUI } from '@t2000/sdk';
2
+ import { resolvePin } from '../prompts.js';
3
+ import { printSuccess, printError, printKeyValue, printBlank, printJson, isJsonMode, handleError, printHeader, printInfo, printLine, explorerUrl, } from '../output.js';
4
+ import pc from 'picocolors';
5
+ function formatSui(mist) {
6
+ return (Number(mist) / Number(MIST_PER_SUI)).toFixed(2);
7
+ }
8
+ export function registerSentinel(program) {
9
+ const sentinel = program
10
+ .command('sentinel')
11
+ .description('Interact with Sui Sentinel — attack AI agents, earn bounties');
12
+ sentinel
13
+ .command('list')
14
+ .description('List active sentinels with prize pools')
15
+ .action(async () => {
16
+ try {
17
+ const pin = await resolvePin();
18
+ const agent = await T2000.create({ pin });
19
+ const sentinels = await agent.sentinelList();
20
+ if (isJsonMode()) {
21
+ printJson(sentinels.map((s) => ({
22
+ ...s,
23
+ attackFee: s.attackFee.toString(),
24
+ prizePool: s.prizePool.toString(),
25
+ })));
26
+ return;
27
+ }
28
+ if (sentinels.length === 0) {
29
+ printBlank();
30
+ printInfo('No active sentinels found.');
31
+ printBlank();
32
+ return;
33
+ }
34
+ printHeader('Active Sentinels');
35
+ sentinels.forEach((s) => {
36
+ const pool = `${formatSui(s.prizePool)} SUI`.padEnd(12);
37
+ const fee = `${formatSui(s.attackFee)} SUI`.padEnd(12);
38
+ printLine(` ${s.name}`);
39
+ printLine(` ${pc.dim(`Pool: ${pool}Fee: ${fee}Attacks: ${s.totalAttacks}`)}`);
40
+ printLine(` ${pc.dim(s.objectId)}`);
41
+ printBlank();
42
+ });
43
+ printBlank();
44
+ printInfo(`${sentinels.length} active sentinel${sentinels.length === 1 ? '' : 's'}`);
45
+ printBlank();
46
+ }
47
+ catch (error) {
48
+ handleError(error);
49
+ }
50
+ });
51
+ sentinel
52
+ .command('info')
53
+ .description('Show details for a sentinel')
54
+ .argument('<id>', 'Sentinel object ID')
55
+ .action(async (id) => {
56
+ try {
57
+ const pin = await resolvePin();
58
+ const agent = await T2000.create({ pin });
59
+ const s = await agent.sentinelInfo(id);
60
+ if (isJsonMode()) {
61
+ printJson({
62
+ ...s,
63
+ attackFee: s.attackFee.toString(),
64
+ prizePool: s.prizePool.toString(),
65
+ });
66
+ return;
67
+ }
68
+ printHeader(s.name);
69
+ printKeyValue('Object ID', s.objectId);
70
+ printKeyValue('Agent ID', s.id);
71
+ printKeyValue('Model', s.model);
72
+ printKeyValue('State', s.state);
73
+ printKeyValue('Attack Fee', `${formatSui(s.attackFee)} SUI`);
74
+ printKeyValue('Prize Pool', `${formatSui(s.prizePool)} SUI`);
75
+ printKeyValue('Total Attacks', String(s.totalAttacks));
76
+ printKeyValue('Breaches', String(s.successfulBreaches));
77
+ if (s.systemPrompt) {
78
+ printBlank();
79
+ printKeyValue('System Prompt', '');
80
+ printLine(` ${pc.dim(s.systemPrompt.slice(0, 500))}`);
81
+ }
82
+ printBlank();
83
+ }
84
+ catch (error) {
85
+ handleError(error);
86
+ }
87
+ });
88
+ sentinel
89
+ .command('attack')
90
+ .description('Attack a sentinel with a prompt (costs SUI)')
91
+ .argument('<id>', 'Sentinel object ID')
92
+ .argument('[prompt]', 'Attack prompt')
93
+ .option('--fee <sui>', 'Override attack fee in SUI')
94
+ .option('--key <path>', 'Key file path')
95
+ .action(async (id, prompt, opts) => {
96
+ try {
97
+ if (!prompt) {
98
+ throw new Error('Prompt is required. Usage: t2000 sentinel attack <id> "your prompt"');
99
+ }
100
+ const pin = await resolvePin();
101
+ const agent = await T2000.create({ pin, keyPath: opts.key });
102
+ const feeMist = opts.fee
103
+ ? BigInt(Math.round(parseFloat(opts.fee) * Number(MIST_PER_SUI)))
104
+ : undefined;
105
+ if (isJsonMode()) {
106
+ const result = await agent.sentinelAttack(id, prompt, feeMist);
107
+ printJson({
108
+ ...result,
109
+ verdict: {
110
+ ...result.verdict,
111
+ },
112
+ });
113
+ return;
114
+ }
115
+ printBlank();
116
+ printLine(` ${pc.dim('⏳')} Requesting attack...`);
117
+ const result = await agent.sentinelAttack(id, prompt, feeMist);
118
+ printBlank();
119
+ if (result.won) {
120
+ printSuccess(`BREACHED! (score: ${result.verdict.score}/100)`);
121
+ }
122
+ else {
123
+ printError(`DEFENDED (score: ${result.verdict.score}/100)`);
124
+ }
125
+ printBlank();
126
+ printKeyValue('Agent', result.verdict.agentResponse.slice(0, 200));
127
+ printKeyValue('Jury', result.verdict.juryResponse.slice(0, 200));
128
+ if (result.verdict.funResponse) {
129
+ printKeyValue('Fun', result.verdict.funResponse.slice(0, 200));
130
+ }
131
+ printBlank();
132
+ printKeyValue('Fee Paid', `${result.feePaid} SUI`);
133
+ printKeyValue('Request Tx', explorerUrl(result.requestTx));
134
+ printKeyValue('Settle Tx', explorerUrl(result.settleTx));
135
+ printBlank();
136
+ }
137
+ catch (error) {
138
+ handleError(error);
139
+ }
140
+ });
141
+ }
142
+ //# sourceMappingURL=sentinel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentinel.js","sourceRoot":"","sources":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CAAC,CAAC;YAC3D,aAAa,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;YACzD,UAAU,EAAE,CAAC;QACf,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,WAAW,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Command } from 'commander';
2
+ export declare function registerServe(program: Command): void;
3
+ //# sourceMappingURL=serve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4CzC,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,QAsC7C"}