@vincentai/cli 0.1.3 → 0.1.4
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.
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { parseArgs, getRequired, hasFlag, showHelp } from '../../lib/args.js';
|
|
2
|
+
import { resolveApiKey } from '../../lib/keystore.js';
|
|
3
|
+
import { vincentPost } from '../../lib/client.js';
|
|
4
|
+
export async function run(argv) {
|
|
5
|
+
const { flags } = parseArgs(argv);
|
|
6
|
+
if (hasFlag(flags, 'help')) {
|
|
7
|
+
showHelp('polymarket withdraw', [
|
|
8
|
+
{ name: 'key-id', description: 'API key ID' },
|
|
9
|
+
{ name: 'to', description: 'Recipient Ethereum address (0x...)', required: true },
|
|
10
|
+
{ name: 'amount', description: 'Amount in USDC (e.g. "100")', required: true },
|
|
11
|
+
]);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const apiKey = resolveApiKey(flags, 'POLYMARKET_WALLET');
|
|
15
|
+
const body = {
|
|
16
|
+
to: getRequired(flags, 'to'),
|
|
17
|
+
amount: getRequired(flags, 'amount'),
|
|
18
|
+
};
|
|
19
|
+
const res = await vincentPost('/api/skills/polymarket/withdraw', apiKey, body);
|
|
20
|
+
console.log(JSON.stringify(res, null, 2));
|
|
21
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,7 @@ const COMMANDS = {
|
|
|
32
32
|
'cancel-order': () => import('./commands/polymarket/cancel-order.js'),
|
|
33
33
|
'cancel-all': () => import('./commands/polymarket/cancel-all.js'),
|
|
34
34
|
redeem: () => import('./commands/polymarket/redeem.js'),
|
|
35
|
+
withdraw: () => import('./commands/polymarket/withdraw.js'),
|
|
35
36
|
},
|
|
36
37
|
twitter: {
|
|
37
38
|
search: () => import('./commands/twitter/search.js'),
|