suzi-cli 0.1.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/dist/commands/agents.d.ts +3 -0
- package/dist/commands/agents.d.ts.map +1 -0
- package/dist/commands/agents.js +274 -0
- package/dist/commands/agents.js.map +1 -0
- package/dist/commands/deploy.d.ts +3 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +149 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/import.d.ts +3 -0
- package/dist/commands/import.d.ts.map +1 -0
- package/dist/commands/import.js +70 -0
- package/dist/commands/import.js.map +1 -0
- package/dist/commands/list-tools.d.ts +3 -0
- package/dist/commands/list-tools.d.ts.map +1 -0
- package/dist/commands/list-tools.js +163 -0
- package/dist/commands/list-tools.js.map +1 -0
- package/dist/commands/login.d.ts +13 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +311 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/portfolio.d.ts +3 -0
- package/dist/commands/portfolio.d.ts.map +1 -0
- package/dist/commands/portfolio.js +170 -0
- package/dist/commands/portfolio.js.map +1 -0
- package/dist/commands/preferences.d.ts +3 -0
- package/dist/commands/preferences.d.ts.map +1 -0
- package/dist/commands/preferences.js +121 -0
- package/dist/commands/preferences.js.map +1 -0
- package/dist/commands/prompt-suggestions.d.ts +3 -0
- package/dist/commands/prompt-suggestions.d.ts.map +1 -0
- package/dist/commands/prompt-suggestions.js +148 -0
- package/dist/commands/prompt-suggestions.js.map +1 -0
- package/dist/commands/skills.d.ts +3 -0
- package/dist/commands/skills.d.ts.map +1 -0
- package/dist/commands/skills.js +571 -0
- package/dist/commands/skills.js.map +1 -0
- package/dist/commands/subagents.d.ts +3 -0
- package/dist/commands/subagents.d.ts.map +1 -0
- package/dist/commands/subagents.js +194 -0
- package/dist/commands/subagents.js.map +1 -0
- package/dist/commands/transactions.d.ts +3 -0
- package/dist/commands/transactions.d.ts.map +1 -0
- package/dist/commands/transactions.js +153 -0
- package/dist/commands/transactions.js.map +1 -0
- package/dist/commands/wallet.d.ts +3 -0
- package/dist/commands/wallet.d.ts.map +1 -0
- package/dist/commands/wallet.js +183 -0
- package/dist/commands/wallet.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +95 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/api.d.ts +12 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/api.js +82 -0
- package/dist/lib/api.js.map +1 -0
- package/dist/lib/config.d.ts +42 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +85 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/utils/ui.d.ts +26 -0
- package/dist/utils/ui.d.ts.map +1 -0
- package/dist/utils/ui.js +111 -0
- package/dist/utils/ui.js.map +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerSubagentsCommand = registerSubagentsCommand;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const ui_1 = require("../utils/ui");
|
|
11
|
+
const AGENT_MD_TEMPLATE = `# Agent Configuration
|
|
12
|
+
|
|
13
|
+
## Meta
|
|
14
|
+
- **name**: My Agent
|
|
15
|
+
- **version**: 0.1.0
|
|
16
|
+
- **description**: An autonomous agent
|
|
17
|
+
|
|
18
|
+
## Resources
|
|
19
|
+
- wallet: evm
|
|
20
|
+
|
|
21
|
+
## Triggers
|
|
22
|
+
|
|
23
|
+
### manual
|
|
24
|
+
- type: suzi.manual
|
|
25
|
+
- description: Trigger manually from the dashboard
|
|
26
|
+
|
|
27
|
+
## Config
|
|
28
|
+
- capital:
|
|
29
|
+
- type: number
|
|
30
|
+
- default: 1000
|
|
31
|
+
- min: 0
|
|
32
|
+
- description: Starting capital in USDC
|
|
33
|
+
|
|
34
|
+
## Notes
|
|
35
|
+
Add any additional context or instructions for this agent here.
|
|
36
|
+
This file is used by \`suzi subagents\` to manage agent definitions.
|
|
37
|
+
`;
|
|
38
|
+
const AGENT_TS_TEMPLATE = `import { defineAgent, on, resource } from '@suzi/sdk';
|
|
39
|
+
|
|
40
|
+
export default defineAgent({
|
|
41
|
+
meta: {
|
|
42
|
+
name: 'My Agent',
|
|
43
|
+
version: '0.1.0',
|
|
44
|
+
},
|
|
45
|
+
resources: {
|
|
46
|
+
wallet: resource.wallet('evm'),
|
|
47
|
+
},
|
|
48
|
+
triggers: {
|
|
49
|
+
manual: on.suzi.manual(async (ctx, input) => {
|
|
50
|
+
ctx.log('Agent executed manually');
|
|
51
|
+
// Your agent logic here
|
|
52
|
+
}),
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
`;
|
|
56
|
+
function registerSubagentsCommand(program) {
|
|
57
|
+
const subagents = program
|
|
58
|
+
.command('subagents')
|
|
59
|
+
.description('Manage agent definitions via agent.md files');
|
|
60
|
+
// suzi subagents -- list agent.md files in current directory
|
|
61
|
+
subagents
|
|
62
|
+
.action(() => {
|
|
63
|
+
const cwd = process.cwd();
|
|
64
|
+
(0, ui_1.header)('Subagents');
|
|
65
|
+
console.log();
|
|
66
|
+
// Find agent.md and agent files
|
|
67
|
+
const agentMds = findFiles(cwd, 'agent.md');
|
|
68
|
+
const agentTs = findFiles(cwd, 'agent.ts');
|
|
69
|
+
if (agentMds.length === 0 && agentTs.length === 0) {
|
|
70
|
+
(0, ui_1.info)('No agent.md or agent.ts files found in the current directory.');
|
|
71
|
+
(0, ui_1.info)('Run `suzi subagents init` to create a template.');
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (agentMds.length > 0) {
|
|
75
|
+
console.log(chalk_1.default.bold(' Agent Definitions (agent.md):'));
|
|
76
|
+
for (const file of agentMds) {
|
|
77
|
+
const rel = path_1.default.relative(cwd, file);
|
|
78
|
+
console.log(` ${ui_1.colors.muted('•')} ${rel}`);
|
|
79
|
+
}
|
|
80
|
+
console.log();
|
|
81
|
+
}
|
|
82
|
+
if (agentTs.length > 0) {
|
|
83
|
+
console.log(chalk_1.default.bold(' Agent Source Files (agent.ts):'));
|
|
84
|
+
for (const file of agentTs) {
|
|
85
|
+
const rel = path_1.default.relative(cwd, file);
|
|
86
|
+
console.log(` ${ui_1.colors.muted('•')} ${rel}`);
|
|
87
|
+
}
|
|
88
|
+
console.log();
|
|
89
|
+
}
|
|
90
|
+
(0, ui_1.divider)();
|
|
91
|
+
(0, ui_1.info)('Use `suzi deploy <file>` to deploy an agent.');
|
|
92
|
+
});
|
|
93
|
+
// suzi subagents init -- create template agent.md and agent.ts
|
|
94
|
+
subagents
|
|
95
|
+
.command('init')
|
|
96
|
+
.description('Create template agent.md and agent.ts files')
|
|
97
|
+
.option('--dir <directory>', 'Directory to create files in', '.')
|
|
98
|
+
.action((opts) => {
|
|
99
|
+
const dir = path_1.default.resolve(process.cwd(), opts.dir);
|
|
100
|
+
if (!fs_1.default.existsSync(dir)) {
|
|
101
|
+
fs_1.default.mkdirSync(dir, { recursive: true });
|
|
102
|
+
}
|
|
103
|
+
const mdPath = path_1.default.join(dir, 'agent.md');
|
|
104
|
+
const tsPath = path_1.default.join(dir, 'agent.ts');
|
|
105
|
+
if (fs_1.default.existsSync(mdPath)) {
|
|
106
|
+
(0, ui_1.error)(`agent.md already exists at ${mdPath}`);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
fs_1.default.writeFileSync(mdPath, AGENT_MD_TEMPLATE);
|
|
110
|
+
fs_1.default.writeFileSync(tsPath, AGENT_TS_TEMPLATE);
|
|
111
|
+
(0, ui_1.success)(`Created agent.md at ${path_1.default.relative(process.cwd(), mdPath)}`);
|
|
112
|
+
(0, ui_1.success)(`Created agent.ts at ${path_1.default.relative(process.cwd(), tsPath)}`);
|
|
113
|
+
console.log();
|
|
114
|
+
(0, ui_1.info)('Edit these files, then deploy with `suzi deploy agent.ts`.');
|
|
115
|
+
});
|
|
116
|
+
// suzi subagents validate -- validate agent.md
|
|
117
|
+
subagents
|
|
118
|
+
.command('validate [file]')
|
|
119
|
+
.description('Validate an agent.md file')
|
|
120
|
+
.action((file) => {
|
|
121
|
+
const filePath = file
|
|
122
|
+
? path_1.default.resolve(process.cwd(), file)
|
|
123
|
+
: path_1.default.resolve(process.cwd(), 'agent.md');
|
|
124
|
+
if (!fs_1.default.existsSync(filePath)) {
|
|
125
|
+
(0, ui_1.error)(`File not found: ${filePath}`);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
const content = fs_1.default.readFileSync(filePath, 'utf-8');
|
|
129
|
+
(0, ui_1.header)('Validate Agent');
|
|
130
|
+
console.log();
|
|
131
|
+
// Basic validation
|
|
132
|
+
const checks = [];
|
|
133
|
+
checks.push({
|
|
134
|
+
name: 'Has Meta section',
|
|
135
|
+
pass: /## Meta/i.test(content),
|
|
136
|
+
});
|
|
137
|
+
checks.push({
|
|
138
|
+
name: 'Has name defined',
|
|
139
|
+
pass: /name:/i.test(content),
|
|
140
|
+
});
|
|
141
|
+
checks.push({
|
|
142
|
+
name: 'Has version defined',
|
|
143
|
+
pass: /version:/i.test(content),
|
|
144
|
+
});
|
|
145
|
+
checks.push({
|
|
146
|
+
name: 'Has Triggers section',
|
|
147
|
+
pass: /## Triggers/i.test(content),
|
|
148
|
+
});
|
|
149
|
+
checks.push({
|
|
150
|
+
name: 'Has Resources section',
|
|
151
|
+
pass: /## Resources/i.test(content),
|
|
152
|
+
});
|
|
153
|
+
for (const check of checks) {
|
|
154
|
+
if (check.pass) {
|
|
155
|
+
console.log(` ${ui_1.colors.success('✓')} ${check.name}`);
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
console.log(` ${ui_1.colors.error('✕')} ${check.name}`);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
console.log();
|
|
162
|
+
const failed = checks.filter((c) => !c.pass);
|
|
163
|
+
if (failed.length === 0) {
|
|
164
|
+
(0, ui_1.success)('Agent definition looks valid!');
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
(0, ui_1.error)(`${failed.length} issue(s) found.`);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
function findFiles(dir, filename) {
|
|
172
|
+
const results = [];
|
|
173
|
+
const topLevel = path_1.default.join(dir, filename);
|
|
174
|
+
if (fs_1.default.existsSync(topLevel)) {
|
|
175
|
+
results.push(topLevel);
|
|
176
|
+
}
|
|
177
|
+
// Check one level of subdirectories
|
|
178
|
+
try {
|
|
179
|
+
const entries = fs_1.default.readdirSync(dir, { withFileTypes: true });
|
|
180
|
+
for (const entry of entries) {
|
|
181
|
+
if (entry.isDirectory() && !entry.name.startsWith('.') && entry.name !== 'node_modules') {
|
|
182
|
+
const sub = path_1.default.join(dir, entry.name, filename);
|
|
183
|
+
if (fs_1.default.existsSync(sub)) {
|
|
184
|
+
results.push(sub);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
catch {
|
|
190
|
+
// Ignore permission errors
|
|
191
|
+
}
|
|
192
|
+
return results;
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=subagents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subagents.js","sourceRoot":"","sources":["../../src/commands/subagents.ts"],"names":[],"mappings":";;;;;AAuDA,4DA0IC;AAhMD,kDAA0B;AAE1B,4CAAoB;AACpB,gDAAwB;AACxB,oCAAgG;AAGhG,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BzB,CAAC;AAEF,MAAM,iBAAiB,GAAG;;;;;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AiKlE"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerTransactionsCommand = registerTransactionsCommand;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const ora_1 = __importDefault(require("ora"));
|
|
9
|
+
const cli_table3_1 = __importDefault(require("cli-table3"));
|
|
10
|
+
const api_1 = require("../lib/api");
|
|
11
|
+
const ui_1 = require("../utils/ui");
|
|
12
|
+
function registerTransactionsCommand(program) {
|
|
13
|
+
program
|
|
14
|
+
.command('transactions')
|
|
15
|
+
.alias('txns')
|
|
16
|
+
.description('View recent transactions across all agents')
|
|
17
|
+
.option('-n, --limit <n>', 'Number of transactions', '15')
|
|
18
|
+
.option('--type <type>', 'Filter by type (order|cancel|transfer|swap|bridge|liquidity)')
|
|
19
|
+
.option('--protocol <name>', 'Filter by protocol')
|
|
20
|
+
.option('--agent <id>', 'Filter by agent ID')
|
|
21
|
+
.action(async (opts) => {
|
|
22
|
+
if (!(0, ui_1.requireAuth)())
|
|
23
|
+
return;
|
|
24
|
+
const spinner = (0, ora_1.default)('Loading transactions...').start();
|
|
25
|
+
let path;
|
|
26
|
+
if (opts.agent) {
|
|
27
|
+
// Agent-specific transactions
|
|
28
|
+
path = `/api/transactions/agent/${opts.agent}?limit=${opts.limit}`;
|
|
29
|
+
if (opts.type)
|
|
30
|
+
path += `&txType=${opts.type}`;
|
|
31
|
+
if (opts.protocol)
|
|
32
|
+
path += `&protocol=${opts.protocol}`;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
// All transactions via portfolio endpoint
|
|
36
|
+
path = `/api/portfolio/trades?limit=${opts.limit}`;
|
|
37
|
+
if (opts.type)
|
|
38
|
+
path += `&txType=${opts.type}`;
|
|
39
|
+
if (opts.protocol)
|
|
40
|
+
path += `&protocol=${opts.protocol}`;
|
|
41
|
+
}
|
|
42
|
+
const resp = await (0, api_1.get)(path);
|
|
43
|
+
if (!resp.ok) {
|
|
44
|
+
spinner.fail();
|
|
45
|
+
(0, ui_1.error)(`Failed to load transactions: ${resp.data?.error || 'Unknown error'}`);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
spinner.stop();
|
|
49
|
+
const txns = resp.data.transactions || [];
|
|
50
|
+
if (txns.length === 0) {
|
|
51
|
+
(0, ui_1.header)('Transactions');
|
|
52
|
+
console.log();
|
|
53
|
+
(0, ui_1.info)('No transactions found.');
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
(0, ui_1.header)(`Transactions (${txns.length})`);
|
|
57
|
+
console.log();
|
|
58
|
+
const table = new cli_table3_1.default({
|
|
59
|
+
head: [
|
|
60
|
+
chalk_1.default.gray('Time'),
|
|
61
|
+
chalk_1.default.gray('Protocol'),
|
|
62
|
+
chalk_1.default.gray('Action'),
|
|
63
|
+
chalk_1.default.gray('Type'),
|
|
64
|
+
chalk_1.default.gray('Asset'),
|
|
65
|
+
chalk_1.default.gray('Size'),
|
|
66
|
+
chalk_1.default.gray('TX'),
|
|
67
|
+
],
|
|
68
|
+
style: { head: [], border: ['gray'] },
|
|
69
|
+
colWidths: [14, 14, 20, 10, 10, 12, 12],
|
|
70
|
+
});
|
|
71
|
+
for (const tx of txns) {
|
|
72
|
+
const time = new Date(tx.createdAt).toLocaleTimeString();
|
|
73
|
+
const txHash = tx.txHash ? (0, ui_1.truncateAddress)(tx.txHash, 4) : ui_1.colors.muted('—');
|
|
74
|
+
const side = tx.side === 'buy' ? chalk_1.default.green('BUY') : tx.side === 'sell' ? chalk_1.default.red('SELL') : '';
|
|
75
|
+
const sizeStr = tx.size
|
|
76
|
+
? `${side} ${parseFloat(tx.size).toFixed(4)}`
|
|
77
|
+
: tx.amountIn
|
|
78
|
+
? parseFloat(tx.amountIn).toFixed(4)
|
|
79
|
+
: '—';
|
|
80
|
+
table.push([
|
|
81
|
+
ui_1.colors.muted(time),
|
|
82
|
+
tx.protocol || '—',
|
|
83
|
+
tx.actionName || '—',
|
|
84
|
+
tx.txType || '—',
|
|
85
|
+
tx.asset || tx.tokenIn || '—',
|
|
86
|
+
sizeStr,
|
|
87
|
+
txHash,
|
|
88
|
+
]);
|
|
89
|
+
}
|
|
90
|
+
console.log(table.toString());
|
|
91
|
+
if (resp.data.hasNextPage) {
|
|
92
|
+
(0, ui_1.info)(`More transactions available. Increase --limit to see more.`);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
// Transaction confirmation (can be used as post-hook)
|
|
96
|
+
program
|
|
97
|
+
.command('tx-confirm')
|
|
98
|
+
.description('Show transaction confirmation details (post-hook)')
|
|
99
|
+
.argument('<agentId>', 'Agent ID')
|
|
100
|
+
.argument('[executionId]', 'Execution ID')
|
|
101
|
+
.action(async (agentId, executionId) => {
|
|
102
|
+
if (!(0, ui_1.requireAuth)())
|
|
103
|
+
return;
|
|
104
|
+
const spinner = (0, ora_1.default)('Fetching execution details...').start();
|
|
105
|
+
let path = `/api/agent/${agentId}/executions?limit=1`;
|
|
106
|
+
if (executionId) {
|
|
107
|
+
path = `/api/agent/${agentId}/executions?limit=10`;
|
|
108
|
+
}
|
|
109
|
+
const resp = await (0, api_1.get)(path);
|
|
110
|
+
if (!resp.ok) {
|
|
111
|
+
spinner.fail();
|
|
112
|
+
(0, ui_1.error)(`Failed to fetch: ${resp.data?.error || 'Unknown error'}`);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
spinner.stop();
|
|
116
|
+
const executions = resp.data.executions || [];
|
|
117
|
+
if (executions.length === 0) {
|
|
118
|
+
(0, ui_1.info)('No recent executions found.');
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const exec = executionId
|
|
122
|
+
? executions.find((e) => e.id === executionId) || executions[0]
|
|
123
|
+
: executions[0];
|
|
124
|
+
(0, ui_1.header)('Transaction Confirmation');
|
|
125
|
+
console.log();
|
|
126
|
+
console.log(` ${(0, ui_1.statusBadge)(exec.status)} ${chalk_1.default.bold(exec.actionName)}`);
|
|
127
|
+
console.log();
|
|
128
|
+
if (exec.input) {
|
|
129
|
+
const input = typeof exec.input === 'string' ? JSON.parse(exec.input) : exec.input;
|
|
130
|
+
console.log(ui_1.colors.muted(' Input:'));
|
|
131
|
+
for (const [key, val] of Object.entries(input)) {
|
|
132
|
+
if (key === 'walletId' || key === 'walletAddress')
|
|
133
|
+
continue; // Skip sensitive
|
|
134
|
+
console.log(` ${ui_1.colors.muted(key)}: ${chalk_1.default.white(String(val))}`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (exec.output) {
|
|
138
|
+
const output = typeof exec.output === 'string' ? JSON.parse(exec.output) : exec.output;
|
|
139
|
+
console.log();
|
|
140
|
+
console.log(ui_1.colors.muted(' Output:'));
|
|
141
|
+
for (const [key, val] of Object.entries(output)) {
|
|
142
|
+
console.log(` ${ui_1.colors.muted(key)}: ${chalk_1.default.white(String(val))}`);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (exec.error) {
|
|
146
|
+
console.log();
|
|
147
|
+
console.log(` ${ui_1.colors.error('Error:')} ${exec.error}`);
|
|
148
|
+
}
|
|
149
|
+
console.log();
|
|
150
|
+
(0, ui_1.divider)();
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=transactions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../src/commands/transactions.ts"],"names":[],"mappings":";;;;;AAOA,kEAiKC;AAvKD,kDAA0B;AAC1B,8CAAsB;AACtB,4DAA+B;AAC/B,oCAAiC;AACjC,oCAA8G;AAE9G,SAAgB,2BAA2B,CAAC,OAAgB;IAC1D,OAAO;SACJ,OAAO,CAAC,cAAc,CAAC;SACvB,KAAK,CAAC,MAAM,CAAC;S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C,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;gBAChD,OAAO,CAAC,GAAG,CAAC,OAAO,WAAM,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,eAAK,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;YACvE,CAAC;QACH,CAAC;QAED,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,GAAG,EAAE,CAAC;YACd,OAAO,CAAC,GAAG,CAAC,KAAK,WAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QAC3D,CAAC;QAED,OAAO,CAAC,GAAG,EAAE,CAAC;QACd,IAAA,YAAO,GAAE,CAAC;IACZ,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/commands/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsM5D"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerWalletCommand = registerWalletCommand;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const ora_1 = __importDefault(require("ora"));
|
|
9
|
+
const config_1 = require("../lib/config");
|
|
10
|
+
const api_1 = require("../lib/api");
|
|
11
|
+
const ui_1 = require("../utils/ui");
|
|
12
|
+
function registerWalletCommand(program) {
|
|
13
|
+
const wallet = program
|
|
14
|
+
.command('wallet')
|
|
15
|
+
.description('Manage your multichain wallet');
|
|
16
|
+
// suzi wallet -- show wallet overview
|
|
17
|
+
wallet
|
|
18
|
+
.action(async () => {
|
|
19
|
+
if (!(0, ui_1.requireAuth)())
|
|
20
|
+
return;
|
|
21
|
+
const spinner = (0, ora_1.default)('Loading wallet info...').start();
|
|
22
|
+
const account = (0, config_1.getActiveAccount)();
|
|
23
|
+
if (!account) {
|
|
24
|
+
spinner.fail();
|
|
25
|
+
(0, ui_1.error)('No active account. Run `suzi login` first.');
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
spinner.stop();
|
|
29
|
+
(0, ui_1.header)('Wallet');
|
|
30
|
+
console.log();
|
|
31
|
+
// SOL wallet address
|
|
32
|
+
console.log(ui_1.colors.sol.bold(' Solana (SOL)'));
|
|
33
|
+
(0, ui_1.label)(' Address', account.svmWalletAddress || 'Not configured');
|
|
34
|
+
console.log();
|
|
35
|
+
// EVM wallet address
|
|
36
|
+
console.log(ui_1.colors.evm.bold(' Ethereum (EVM)'));
|
|
37
|
+
(0, ui_1.label)(' Address', account.evmWalletAddress || 'Not configured');
|
|
38
|
+
console.log();
|
|
39
|
+
(0, ui_1.divider)();
|
|
40
|
+
(0, ui_1.info)('Use `suzi wallet balance` to check balances.');
|
|
41
|
+
(0, ui_1.info)('Use `suzi wallet fund` to see deposit instructions.');
|
|
42
|
+
});
|
|
43
|
+
// suzi wallet address -- show wallet addresses
|
|
44
|
+
wallet
|
|
45
|
+
.command('address')
|
|
46
|
+
.description('Show wallet addresses')
|
|
47
|
+
.action(() => {
|
|
48
|
+
if (!(0, ui_1.requireAuth)())
|
|
49
|
+
return;
|
|
50
|
+
const account = (0, config_1.getActiveAccount)();
|
|
51
|
+
if (!account) {
|
|
52
|
+
(0, ui_1.error)('No active account.');
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
(0, ui_1.header)('Wallet Addresses');
|
|
56
|
+
console.log();
|
|
57
|
+
if (account.svmWalletAddress) {
|
|
58
|
+
console.log(ui_1.colors.sol.bold(' SOL:'));
|
|
59
|
+
console.log(` ${account.svmWalletAddress}`);
|
|
60
|
+
console.log();
|
|
61
|
+
}
|
|
62
|
+
if (account.evmWalletAddress) {
|
|
63
|
+
console.log(ui_1.colors.evm.bold(' EVM:'));
|
|
64
|
+
console.log(` ${account.evmWalletAddress}`);
|
|
65
|
+
console.log();
|
|
66
|
+
}
|
|
67
|
+
(0, ui_1.info)('Send funds to the addresses above to fund your wallet.');
|
|
68
|
+
});
|
|
69
|
+
// suzi wallet balance -- show balances
|
|
70
|
+
wallet
|
|
71
|
+
.command('balance')
|
|
72
|
+
.description('Show wallet balances')
|
|
73
|
+
.action(async () => {
|
|
74
|
+
if (!(0, ui_1.requireAuth)())
|
|
75
|
+
return;
|
|
76
|
+
const account = (0, config_1.getActiveAccount)();
|
|
77
|
+
if (!account) {
|
|
78
|
+
(0, ui_1.error)('No active account.');
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const spinner = (0, ora_1.default)('Fetching balances...').start();
|
|
82
|
+
// Fetch SOL balance via API actions
|
|
83
|
+
try {
|
|
84
|
+
if (account.svmWalletAddress) {
|
|
85
|
+
const solResp = await (0, api_1.post)('/api/actions/execute', {
|
|
86
|
+
name: 'solana.get_native_balance',
|
|
87
|
+
params: { address: account.svmWalletAddress },
|
|
88
|
+
});
|
|
89
|
+
spinner.stop();
|
|
90
|
+
(0, ui_1.header)('Balances');
|
|
91
|
+
console.log();
|
|
92
|
+
if (solResp.ok && solResp.data?.result) {
|
|
93
|
+
const sol = solResp.data.result;
|
|
94
|
+
console.log(` ${ui_1.colors.sol('SOL')} ${chalk_1.default.bold(sol.balance.toFixed(4))} SOL`);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
console.log(` ${ui_1.colors.sol('SOL')} ${ui_1.colors.muted('Unable to fetch')}`);
|
|
98
|
+
}
|
|
99
|
+
// Fetch USDC balance
|
|
100
|
+
const usdcResp = await (0, api_1.post)('/api/actions/execute', {
|
|
101
|
+
name: 'solana.get_token_balance',
|
|
102
|
+
params: { address: account.svmWalletAddress, token: 'USDC' },
|
|
103
|
+
});
|
|
104
|
+
if (usdcResp.ok && usdcResp.data?.result) {
|
|
105
|
+
const usdc = usdcResp.data.result;
|
|
106
|
+
console.log(` ${chalk_1.default.green('USDC')} ${chalk_1.default.bold(usdc.balance.toFixed(2))} USDC ${ui_1.colors.muted('(SOL)')}`);
|
|
107
|
+
}
|
|
108
|
+
// Fetch GOLD balance
|
|
109
|
+
const goldResp = await (0, api_1.post)('/api/actions/execute', {
|
|
110
|
+
name: 'solana.get_token_balance',
|
|
111
|
+
params: { address: account.svmWalletAddress, token: 'GOLD' },
|
|
112
|
+
});
|
|
113
|
+
if (goldResp.ok && goldResp.data?.result && goldResp.data.result.balance > 0) {
|
|
114
|
+
const gold = goldResp.data.result;
|
|
115
|
+
console.log(` ${chalk_1.default.yellow('GOLD')} ${chalk_1.default.bold(gold.balance.toFixed(2))} GOLD ${ui_1.colors.muted('(SOL)')}`);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
// If no SVM wallet, stop spinner and show header now
|
|
119
|
+
if (!account.svmWalletAddress) {
|
|
120
|
+
spinner.stop();
|
|
121
|
+
(0, ui_1.header)('Balances');
|
|
122
|
+
console.log();
|
|
123
|
+
}
|
|
124
|
+
// Fetch Hyperliquid equity if EVM wallet exists
|
|
125
|
+
if (account.evmWalletAddress) {
|
|
126
|
+
const hlResp = await (0, api_1.get)('/api/portfolio/summary');
|
|
127
|
+
if (hlResp.ok && hlResp.data) {
|
|
128
|
+
const hl = hlResp.data;
|
|
129
|
+
if (hl.totalEquity > 0) {
|
|
130
|
+
console.log();
|
|
131
|
+
console.log(ui_1.colors.evm.bold(' Hyperliquid'));
|
|
132
|
+
console.log(` ${chalk_1.default.bold('$' + hl.totalEquity.toFixed(2))} total equity`);
|
|
133
|
+
if (hl.availableBalance > 0) {
|
|
134
|
+
console.log(` ${ui_1.colors.muted('$' + hl.availableBalance.toFixed(2) + ' available')}`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
catch (err) {
|
|
141
|
+
spinner.stop();
|
|
142
|
+
(0, ui_1.error)(`Failed to fetch balances: ${err.message}`);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
console.log();
|
|
146
|
+
(0, ui_1.divider)();
|
|
147
|
+
});
|
|
148
|
+
// suzi wallet fund -- show deposit instructions
|
|
149
|
+
wallet
|
|
150
|
+
.command('fund')
|
|
151
|
+
.description('Show instructions to add funds')
|
|
152
|
+
.action(() => {
|
|
153
|
+
if (!(0, ui_1.requireAuth)())
|
|
154
|
+
return;
|
|
155
|
+
const account = (0, config_1.getActiveAccount)();
|
|
156
|
+
if (!account) {
|
|
157
|
+
(0, ui_1.error)('No active account.');
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
(0, ui_1.header)('Fund Your Wallet');
|
|
161
|
+
console.log();
|
|
162
|
+
if (account.svmWalletAddress) {
|
|
163
|
+
console.log(ui_1.colors.sol.bold(' Deposit SOL / SPL Tokens'));
|
|
164
|
+
console.log(` Send to this Solana address:`);
|
|
165
|
+
console.log();
|
|
166
|
+
console.log(` ${chalk_1.default.bold(account.svmWalletAddress)}`);
|
|
167
|
+
console.log();
|
|
168
|
+
(0, ui_1.info)(' Supported tokens: SOL, USDC, USDT, GOLD');
|
|
169
|
+
}
|
|
170
|
+
console.log();
|
|
171
|
+
if (account.evmWalletAddress) {
|
|
172
|
+
console.log(ui_1.colors.evm.bold(' Deposit EVM Assets'));
|
|
173
|
+
console.log(` Send to this EVM address:`);
|
|
174
|
+
console.log();
|
|
175
|
+
console.log(` ${chalk_1.default.bold(account.evmWalletAddress)}`);
|
|
176
|
+
console.log();
|
|
177
|
+
(0, ui_1.info)(' Supported: ETH, USDC (Ethereum/Polygon/Arbitrum)');
|
|
178
|
+
}
|
|
179
|
+
console.log();
|
|
180
|
+
(0, ui_1.divider)();
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=wallet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../src/commands/wallet.ts"],"names":[],"mappings":";;;;;AAOA,sDAsMC;AA5MD,kDAA0B;AAC1B,8CAAsB;AACtB,0CAA4D;AAC5D,oCAAuC;AACvC,oCAA4H;AAE5H,SAAgB,qBAAqB,CAAC,OAAgB;IACpD,MAAM,MAAM,GAAG,OAAO;SACnB,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,+BAA+B,CAAC,CAAC;IAEhD,sCAAsC;IACtC,MAAM;SACH,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,IAAI,CAAC,IAAA,gBAAW,GAAE;YAAE,OAAO;QAE3B,MAAM,OAAO,GAAG,IAAA,aAAG,EAAC,wBAAwB,CAAC,CAAC,KAAK,EAAE,CAAC;QACtD,MAAM,OAAO,GAAG,IAAA,yBAAgB,GAAE,CAAC;QAEnC,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,CAAC,IAAI,EAAE,CAAC;YACf,IAAA,UAAK,EAAC,4CAA4C,CAAC,CAAC;YACpD,OAAO;QACT,CAAC;QAED,OAAO,CAAC,IAAI,EAAE,CAAC;QAEf,IAAA,WAAM,EAAC,QAAQ,CAAC,CAAC;QACjB,OAAO,CAAC,GAAG,EAAE,CAAC;QAEd,qBAAqB;QACrB,OAAO,CAAC,GAAG,CAAC,WAAM,CAAC,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAC/C,IAAA,UAAK,EAAC,WAAW,EAAE,OAAO,CAAC,gBAAgB,IAAI,gBAAgB,CAAC,CAAC;QACjE,OAAO,CAAC,GAAG,EAAE,CAAC;QAEd,qBAAqB;QACrB,OAAO,CAAC,GAAG,CAAC,WAAM,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAA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