terafab-cli 1.1.6 → 1.1.7

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/package.json +1 -1
  2. package/terafab.js +20 -27
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "terafab-cli",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "Official CLI for Terafabpay - Swap & Monero Bridge",
5
5
  "main": "terafab.js",
6
6
  "bin": {
package/terafab.js CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env node
2
-
3
2
  const { Command } = require('commander');
4
3
  const { ethers } = require('ethers');
5
4
  const fs = require('fs');
@@ -19,19 +18,26 @@ function getVaultKey() {
19
18
  return null;
20
19
  }
21
20
 
22
- program
23
- .name('terafab')
24
- .description('Terafabpay CLI - Swap & Bridge Tools')
25
- .version('1.1.5');
21
+ program.name('terafab').version('1.1.6');
22
+
23
+ program.command('status')
24
+ .description('Check network health')
25
+ .action(async () => {
26
+ try {
27
+ const res = await fetch(`${API_BASE}/v1/watcher`);
28
+ const d = await res.json();
29
+ const advice = d.advice || 'Market signals are being analyzed...';
30
+ console.log(`\nStatus: ${d.healthy ? '🟢 Operational' : 'šŸ”“ Issues'}`);
31
+ console.log(`Advice: ${advice}`);
32
+ } catch (e) { console.error('āŒ Server offline.'); }
33
+ });
26
34
 
27
- // --- BRIDGE OHNE TX ---
28
35
  program.command('bridge')
29
- .description('Start a no-KYC swap to Monero (No TX required)')
36
+ .description('Start a no-KYC swap to Monero')
30
37
  .option('-f, --from <chain>', 'sol, eth, btc', 'sol')
31
- .option('-a, --amount <n>', 'Amount to send', '0.1')
32
- .requiredOption('-to, --address <addr>', 'Your XMR receiving address')
38
+ .option('-a, --amount <n>', 'Amount', '0.1')
39
+ .requiredOption('-to, --address <addr>', 'XMR address')
33
40
  .action(async (o) => {
34
- console.log(`ā³ Initializing bridge: ${o.amount} ${o.from.toUpperCase()} -> XMR...`);
35
41
  try {
36
42
  const res = await fetch(`${API_BASE}/v1/xmr/create`, {
37
43
  method: 'POST',
@@ -41,25 +47,13 @@ program.command('bridge')
41
47
  const d = await res.json();
42
48
  if (d.error) console.log(`\nāŒ Error: ${d.error}`);
43
49
  else {
44
- console.log(`\nāœ… BRIDGE ORDER CREATED`);
45
- console.log(`--------------------------------------`);
46
- console.log(`SEND EXACTLY: ${o.amount} ${o.from.toUpperCase()}`);
47
- console.log(`TO ADDRESS: ${d.payinAddress}`);
48
- console.log(`--------------------------------------`);
49
- console.log(`ESTIMATED: ~${d.estimatedXmr} XMR`);
50
- console.log(`ORDER ID: ${d.orderId}`);
51
- console.log(`TRACKING: ${d.trackUrl}`);
50
+ console.log(`\nāœ… BRIDGE ORDER CREATED\n----------------------`);
51
+ console.log(`SEND: ${o.amount} ${o.from.toUpperCase()} TO: ${d.payinAddress}`);
52
+ console.log(`ESTIMATED: ~${d.estimatedXmr} XMR`);
52
53
  }
53
- } catch (e) { console.error('āŒ Server connection failed.'); }
54
+ } catch (e) { console.error('āŒ Connection failed.'); }
54
55
  });
55
56
 
56
- // --- PUBLIC TOOLS ---
57
- program.command('status').action(async () => {
58
- const res = await fetch(`${API_BASE}/v1/watcher`);
59
- const d = await res.json();
60
- console.log(`Status: ${d.healthy ? '🟢' : 'šŸ”“'} | Advice: ${d.advice}`);
61
- });
62
-
63
57
  program.command('xmr:quote').option('-f, --from <c>', 'sol').option('-a, --amount <n>', '0.1').action(async (o) => {
64
58
  const res = await fetch(`${API_BASE}/v1/xmr/quote?from=${o.from}&amount=${o.amount}`);
65
59
  const d = await res.json();
@@ -71,7 +65,6 @@ program.command('wallet:create').action(() => {
71
65
  console.log(`āœ… Address: ${w.address}\nšŸ”‘ Key: ${w.privateKey}`);
72
66
  });
73
67
 
74
- // --- AI & TRAINING (Auth required) ---
75
68
  program.command('auth').argument('<key>').action((key) => {
76
69
  fs.writeFileSync(VAULT_PATH, JSON.stringify({ k: key }), { mode: 0o600 });
77
70
  console.log('āœ… Key vaulted.');