fuego-cli 1.1.0 → 1.2.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 +53 -15
- package/dist/commands/contacts.d.ts +9 -0
- package/dist/commands/contacts.d.ts.map +1 -0
- package/dist/commands/contacts.js +111 -0
- package/dist/commands/contacts.js.map +1 -0
- package/dist/commands/fund.d.ts +2 -0
- package/dist/commands/fund.d.ts.map +1 -0
- package/dist/commands/fund.js +47 -0
- package/dist/commands/fund.js.map +1 -0
- package/dist/commands/rpc.d.ts +7 -0
- package/dist/commands/rpc.d.ts.map +1 -0
- package/dist/commands/rpc.js +41 -0
- package/dist/commands/rpc.js.map +1 -0
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +4 -2
- package/dist/commands/update.js.map +1 -1
- package/dist/index.js +26 -20
- package/dist/index.js.map +1 -1
- package/fuego-cli-1.2.0.tgz +0 -0
- package/package.json +4 -2
- package/src/commands/{addbook.ts → contacts.ts} +11 -11
- package/src/commands/fund.ts +58 -0
- package/src/commands/{addrpc.ts → rpc.ts} +4 -4
- package/src/commands/update.ts +4 -2
- package/src/index.ts +27 -20
package/README.md
CHANGED
|
@@ -70,8 +70,9 @@ fuego dashboard
|
|
|
70
70
|
| `fuego create` | Create a new Solana wallet |
|
|
71
71
|
| `fuego address` | Show your wallet address |
|
|
72
72
|
| `fuego balance` | Check SOL, USDC, USDT balances |
|
|
73
|
-
| `fuego
|
|
74
|
-
| `fuego
|
|
73
|
+
| `fuego rpc` | Show or configure your Solana RPC endpoint |
|
|
74
|
+
| `fuego contacts` | Manage your contacts |
|
|
75
|
+
| `fuego fund` | Show funding options: MoonPay link + QR code |
|
|
75
76
|
| `fuego send` | Send SOL, USDC, or USDT to an address or contact |
|
|
76
77
|
|
|
77
78
|
### Project Management
|
|
@@ -191,19 +192,19 @@ fuego update --fuego
|
|
|
191
192
|
|
|
192
193
|
---
|
|
193
194
|
|
|
194
|
-
### `fuego
|
|
195
|
+
### `fuego rpc [options]`
|
|
195
196
|
|
|
196
|
-
|
|
197
|
+
Show or configure your Solana RPC endpoint for faster or more reliable connections.
|
|
197
198
|
|
|
198
199
|
```bash
|
|
199
200
|
# Show current RPC configuration
|
|
200
|
-
fuego
|
|
201
|
+
fuego rpc
|
|
201
202
|
|
|
202
203
|
# Set a custom RPC endpoint
|
|
203
|
-
fuego
|
|
204
|
+
fuego rpc --url https://helius.xyz/... --network mainnet
|
|
204
205
|
|
|
205
206
|
# Use public mainnet
|
|
206
|
-
fuego
|
|
207
|
+
fuego rpc --url https://api.mainnet-beta.solana.com
|
|
207
208
|
```
|
|
208
209
|
|
|
209
210
|
**Options:**
|
|
@@ -212,22 +213,22 @@ fuego addrpc --url https://api.mainnet-beta.solana.com
|
|
|
212
213
|
|
|
213
214
|
---
|
|
214
215
|
|
|
215
|
-
### `fuego
|
|
216
|
+
### `fuego contacts <subcommand>`
|
|
216
217
|
|
|
217
|
-
Manage your
|
|
218
|
+
Manage your contacts for quick access to frequently used addresses.
|
|
218
219
|
|
|
219
220
|
```bash
|
|
220
221
|
# Add a contact
|
|
221
|
-
fuego
|
|
222
|
+
fuego contacts add melanie GvCoHGGBR97Yphzc6SrRycZyS31oUYBM8m9hLRtJT7r5 --label "Melanie's wallet"
|
|
222
223
|
|
|
223
224
|
# List all contacts
|
|
224
|
-
fuego
|
|
225
|
+
fuego contacts list
|
|
225
226
|
|
|
226
227
|
# Show specific contact
|
|
227
|
-
fuego
|
|
228
|
+
fuego contacts show melanie
|
|
228
229
|
|
|
229
230
|
# Remove contact (with confirmation)
|
|
230
|
-
fuego
|
|
231
|
+
fuego contacts remove melanie --yes
|
|
231
232
|
```
|
|
232
233
|
|
|
233
234
|
**Storage:** `~/.fuego/contacts/address-book.json`
|
|
@@ -240,6 +241,43 @@ fuego addbook remove melanie --yes
|
|
|
240
241
|
|
|
241
242
|
---
|
|
242
243
|
|
|
244
|
+
### `fuego fund`
|
|
245
|
+
|
|
246
|
+
Show funding options for your wallet: MoonPay onramp link + QR codes for easy scanning.
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
fuego fund
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
**Output:**
|
|
253
|
+
- Your wallet address (plain text for copying)
|
|
254
|
+
- QR code of your address (scan to receive SOL from another wallet)
|
|
255
|
+
- MoonPay onramp URL (buy SOL with card/bank, pre-filled with your address)
|
|
256
|
+
- QR code for MoonPay link (scan to open on mobile)
|
|
257
|
+
|
|
258
|
+
**Example:**
|
|
259
|
+
```
|
|
260
|
+
💰 Fund Your Wallet
|
|
261
|
+
Address: DmFyLRiJtc4Bz75hjAqPaEJpDfRe4GEnRLPwc3EgeUZF
|
|
262
|
+
|
|
263
|
+
📱 Scan to receive SOL:
|
|
264
|
+
|
|
265
|
+
[QR CODE]
|
|
266
|
+
|
|
267
|
+
🔗 MoonPay Onramp
|
|
268
|
+
Buy SOL with card/bank and send directly to your wallet:
|
|
269
|
+
|
|
270
|
+
https://buy.moonpay.com/?currencyCode=SOL&walletAddress=DmFyLRiJtc4Bz75hjAqPaEJpDfRe4GEnRLPwc3EgeUZF
|
|
271
|
+
|
|
272
|
+
Or scan this QR code to fund:
|
|
273
|
+
|
|
274
|
+
[QR CODE]
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
**Note:** MoonPay requires KYC and is available in supported regions. The QR code for your address works with any Solana wallet (Phantom, Solflare, etc.).
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
243
281
|
### `fuego send <recipient> <amount>`
|
|
244
282
|
|
|
245
283
|
Send SOL, USDC, or USDT to a Solana address or address book contact.
|
|
@@ -248,7 +286,7 @@ Send SOL, USDC, or USDT to a Solana address or address book contact.
|
|
|
248
286
|
# Send SOL to an address
|
|
249
287
|
fuego send GvCoHGGBR97Yphzc6SrRycZyS31oUYBM8m9hLRtJT7r5 0.5 --token SOL
|
|
250
288
|
|
|
251
|
-
# Send USDC to
|
|
289
|
+
# Send USDC to a contact
|
|
252
290
|
fuego send melanie 10 --token USDC
|
|
253
291
|
|
|
254
292
|
# Send and confirm immediately
|
|
@@ -261,7 +299,7 @@ fuego send melanie 5 --token USDT --yes
|
|
|
261
299
|
|
|
262
300
|
**Recipient can be:**
|
|
263
301
|
- A full Solana address (e.g., `GvCoHGGBR97Yphzc6SrRycZyS31oUYBM8m9hLRtJT7r5`)
|
|
264
|
-
-
|
|
302
|
+
- A contact name (e.g., `melanie`)
|
|
265
303
|
|
|
266
304
|
**Safety:** By default, `fuego send` shows a transaction preview and requires `--yes` to confirm. This prevents accidental sends.
|
|
267
305
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function contactsAddCommand(name: string, address: string, options: {
|
|
2
|
+
label?: string;
|
|
3
|
+
}): Promise<void>;
|
|
4
|
+
export declare function contactsListCommand(): Promise<void>;
|
|
5
|
+
export declare function contactsShowCommand(name: string): Promise<void>;
|
|
6
|
+
export declare function contactsRemoveCommand(name: string, options: {
|
|
7
|
+
yes?: boolean;
|
|
8
|
+
}): Promise<void>;
|
|
9
|
+
//# sourceMappingURL=contacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contacts.d.ts","sourceRoot":"","sources":["../../src/commands/contacts.ts"],"names":[],"mappings":"AAqCA,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAqClH;AAGD,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAqBzD;AAGD,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBrE;AAGD,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BnG"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import fs from 'fs-extra';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import os from 'os';
|
|
5
|
+
import { showSuccess, showInfo, showWarning, flameDivider } from '../lib/ascii.js';
|
|
6
|
+
const CONTACTS_DIR = path.join(os.homedir(), '.fuego', 'contacts');
|
|
7
|
+
const ADDRESS_BOOK_FILE = path.join(CONTACTS_DIR, 'address-book.json');
|
|
8
|
+
function loadAddressBook() {
|
|
9
|
+
if (!fs.existsSync(ADDRESS_BOOK_FILE)) {
|
|
10
|
+
return {};
|
|
11
|
+
}
|
|
12
|
+
return fs.readJsonSync(ADDRESS_BOOK_FILE);
|
|
13
|
+
}
|
|
14
|
+
function saveAddressBook(book) {
|
|
15
|
+
fs.ensureDirSync(CONTACTS_DIR);
|
|
16
|
+
fs.writeJsonSync(ADDRESS_BOOK_FILE, book, { spaces: 2 });
|
|
17
|
+
}
|
|
18
|
+
function isValidSolanaAddress(address) {
|
|
19
|
+
// Basic Solana address validation (32-44 chars, base58)
|
|
20
|
+
return /^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(address);
|
|
21
|
+
}
|
|
22
|
+
// Add a contact
|
|
23
|
+
export async function contactsAddCommand(name, address, options) {
|
|
24
|
+
console.log();
|
|
25
|
+
if (!name || !address) {
|
|
26
|
+
console.log(chalk.red('❌ Usage: fuego contacts add <name> <address> [--label "description"]'));
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
// Validate address
|
|
30
|
+
if (!isValidSolanaAddress(address)) {
|
|
31
|
+
console.log(chalk.red('❌ Invalid Solana address format.'));
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
const book = loadAddressBook();
|
|
35
|
+
// Check if name already exists
|
|
36
|
+
if (book[name]) {
|
|
37
|
+
showWarning(`Contact "${name}" already exists.\n\nUse a different name or remove the existing contact first.`);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
// Add contact
|
|
41
|
+
book[name] = {
|
|
42
|
+
address,
|
|
43
|
+
label: options.label,
|
|
44
|
+
addedAt: new Date().toISOString()
|
|
45
|
+
};
|
|
46
|
+
saveAddressBook(book);
|
|
47
|
+
showSuccess('✅ Contact Added', `Name: ${chalk.cyan(name)}\nAddress: ${chalk.cyan(address.slice(0, 8))}...${chalk.cyan(address.slice(-8))}${options.label ? '\nLabel: ' + chalk.cyan(options.label) : ''}`);
|
|
48
|
+
flameDivider();
|
|
49
|
+
}
|
|
50
|
+
// List all contacts
|
|
51
|
+
export async function contactsListCommand() {
|
|
52
|
+
console.log();
|
|
53
|
+
const book = loadAddressBook();
|
|
54
|
+
const contacts = Object.entries(book);
|
|
55
|
+
if (contacts.length === 0) {
|
|
56
|
+
showInfo('📒 Contacts', ['No contacts yet.', '', chalk.yellow('Add one: fuego contacts add <name> <address>')]);
|
|
57
|
+
flameDivider();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const lines = [`${contacts.length} contact${contacts.length === 1 ? '' : 's'}\n`];
|
|
61
|
+
for (const [name, entry] of contacts) {
|
|
62
|
+
const shortAddr = `${entry.address.slice(0, 6)}...${entry.address.slice(-6)}`;
|
|
63
|
+
lines.push(`${chalk.cyan(name)}: ${chalk.white(shortAddr)}${entry.label ? chalk.gray(` (${entry.label})`) : ''}`);
|
|
64
|
+
}
|
|
65
|
+
showInfo('📒 Contacts', lines);
|
|
66
|
+
flameDivider();
|
|
67
|
+
}
|
|
68
|
+
// Show a specific contact
|
|
69
|
+
export async function contactsShowCommand(name) {
|
|
70
|
+
console.log();
|
|
71
|
+
if (!name) {
|
|
72
|
+
console.log(chalk.red('❌ Usage: fuego contacts show <name>'));
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
|
75
|
+
const book = loadAddressBook();
|
|
76
|
+
const entry = book[name];
|
|
77
|
+
if (!entry) {
|
|
78
|
+
console.log(chalk.red(`❌ Contact "${name}" not found.`));
|
|
79
|
+
console.log(chalk.gray('\nUse "fuego contacts list" to see all contacts.'));
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
showInfo(`📇 ${name}`, [
|
|
83
|
+
`Address: ${chalk.white(entry.address)}`,
|
|
84
|
+
entry.label ? `Label: ${chalk.cyan(entry.label)}` : '',
|
|
85
|
+
`Added: ${chalk.gray(new Date(entry.addedAt).toLocaleDateString())}`
|
|
86
|
+
].filter(Boolean));
|
|
87
|
+
flameDivider();
|
|
88
|
+
}
|
|
89
|
+
// Remove a contact
|
|
90
|
+
export async function contactsRemoveCommand(name, options) {
|
|
91
|
+
console.log();
|
|
92
|
+
if (!name) {
|
|
93
|
+
console.log(chalk.red('❌ Usage: fuego contacts remove <name> [--yes]'));
|
|
94
|
+
process.exit(1);
|
|
95
|
+
}
|
|
96
|
+
const book = loadAddressBook();
|
|
97
|
+
if (!book[name]) {
|
|
98
|
+
console.log(chalk.red(`❌ Contact "${name}" not found.`));
|
|
99
|
+
process.exit(1);
|
|
100
|
+
}
|
|
101
|
+
// Confirm unless --yes flag
|
|
102
|
+
if (!options.yes) {
|
|
103
|
+
showWarning(`About to remove "${name}" (${book[name].address.slice(0, 8)}...${book[name].address.slice(-8)})\n\nUse --yes to confirm, or omit to review.`);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
delete book[name];
|
|
107
|
+
saveAddressBook(book);
|
|
108
|
+
showSuccess('✅ Contact Removed', `Removed "${chalk.cyan(name)}" from contacts.`);
|
|
109
|
+
flameDivider();
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=contacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contacts.js","sourceRoot":"","sources":["../../src/commands/contacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;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,4BAA4B;IAC5B,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;QACjB,WAAW,CAAC,oBAAoB,IAAI,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,+CAA+C,CAAC,CAAC;QAC3J,OAAO;IACT,CAAC;IAED,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC;IAClB,eAAe,CAAC,IAAI,CAAC,CAAC;IAEtB,WAAW,CAAC,mBAAmB,EAAE,YAAY,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACjF,YAAY,EAAE,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fund.d.ts","sourceRoot":"","sources":["../../src/commands/fund.ts"],"names":[],"mappings":"AAMA,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAmDjD"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import qrcode from 'qrcode-terminal';
|
|
3
|
+
import boxen from 'boxen';
|
|
4
|
+
import { loadWalletConfig } from '../lib/config.js';
|
|
5
|
+
import { showInfo, flameDivider } from '../lib/ascii.js';
|
|
6
|
+
export async function fundCommand() {
|
|
7
|
+
console.log(); // spacer
|
|
8
|
+
const config = loadWalletConfig();
|
|
9
|
+
if (!config) {
|
|
10
|
+
console.log(chalk.red('❌ No wallet found. Run "fuego create" first.'));
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
const address = config.publicKey;
|
|
14
|
+
// MoonPay URL for funding SOL to this wallet
|
|
15
|
+
const moonpayUrl = `https://buy.moonpay.com/?currencyCode=SOL&walletAddress=${address}`;
|
|
16
|
+
// Generate QR code first, then display everything in a box
|
|
17
|
+
qrcode.generate(address, { small: true }, (qrcodeOutput) => {
|
|
18
|
+
// Indent the QR code
|
|
19
|
+
const indentedQr = qrcodeOutput.split('\n').map(line => ' ' + line).join('\n');
|
|
20
|
+
// Build the fund box content
|
|
21
|
+
const fundContent = [
|
|
22
|
+
chalk.bold.cyan('💰 Fund Your Wallet'),
|
|
23
|
+
'',
|
|
24
|
+
chalk.white('Address:'),
|
|
25
|
+
chalk.cyan(address),
|
|
26
|
+
'',
|
|
27
|
+
chalk.yellow('📱 Scan to send funds to your address:'),
|
|
28
|
+
'',
|
|
29
|
+
indentedQr
|
|
30
|
+
].join('\n');
|
|
31
|
+
// Display the fund box
|
|
32
|
+
console.log(boxen(fundContent, {
|
|
33
|
+
padding: 1,
|
|
34
|
+
margin: { top: 0, bottom: 1 },
|
|
35
|
+
borderStyle: 'round',
|
|
36
|
+
borderColor: 'green'
|
|
37
|
+
}));
|
|
38
|
+
// Show MoonPay box
|
|
39
|
+
showInfo('🔗 MoonPay Onramp', [
|
|
40
|
+
'Buy SOL with card/bank and send directly to your wallet:',
|
|
41
|
+
'',
|
|
42
|
+
chalk.cyan(moonpayUrl)
|
|
43
|
+
]);
|
|
44
|
+
flameDivider();
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=fund.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fund.js","sourceRoot":"","sources":["../../src/commands/fund.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEzD,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,SAAS;IAExB,MAAM,MAAM,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EAAE;YACF,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC;SACvB,CAAC,CAAC;QAEH,YAAY,EAAE,CAAC;IACjB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../../src/commands/rpc.ts"],"names":[],"mappings":"AAIA,UAAU,UAAU;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA+CnE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { setConfig, getConfig } from '../lib/config.js';
|
|
3
|
+
import { showSuccess, showInfo, flameDivider } from '../lib/ascii.js';
|
|
4
|
+
export async function rpcCommand(options) {
|
|
5
|
+
console.log(); // spacer
|
|
6
|
+
// If no URL provided, show current config and help
|
|
7
|
+
if (!options.url) {
|
|
8
|
+
const currentRpc = getConfig('rpcUrl');
|
|
9
|
+
const currentNetwork = getConfig('network');
|
|
10
|
+
showInfo('⚙️ Current RPC Configuration', [
|
|
11
|
+
`RPC URL: ${currentRpc ? chalk.cyan(currentRpc) : chalk.gray('Not set')}`,
|
|
12
|
+
`Network: ${currentNetwork ? chalk.cyan(currentNetwork) : chalk.gray('mainnet')}`,
|
|
13
|
+
'',
|
|
14
|
+
`${chalk.yellow('Usage:')} fuego rpc --url https://api.mainnet-beta.solana.com`,
|
|
15
|
+
`${chalk.yellow('Or:')} fuego rpc --url https://helius.xyz/... --network mainnet`
|
|
16
|
+
]);
|
|
17
|
+
flameDivider();
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
// Validate URL
|
|
21
|
+
try {
|
|
22
|
+
new URL(options.url);
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
console.log(chalk.red('❌ Invalid URL. Please provide a valid RPC endpoint.'));
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
// Set the RPC URL
|
|
29
|
+
setConfig('rpcUrl', options.url);
|
|
30
|
+
// Set network if provided, default to mainnet
|
|
31
|
+
const network = options.network || 'mainnet';
|
|
32
|
+
setConfig('network', network);
|
|
33
|
+
showSuccess('✅ RPC Configuration Updated', `URL: ${chalk.cyan(options.url)}\nNetwork: ${chalk.cyan(network)}`);
|
|
34
|
+
showInfo('💡 Tips', [
|
|
35
|
+
'Premium RPCs (Helius, QuickNode) offer better performance',
|
|
36
|
+
'Free public RPCs may have rate limits',
|
|
37
|
+
'Your wallet address remains the same across networks'
|
|
38
|
+
]);
|
|
39
|
+
flameDivider();
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=rpc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc.js","sourceRoot":"","sources":["../../src/commands/rpc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAc,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAOtE,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAAmB;IAClD,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,SAAS;IAExB,mDAAmD;IACnD,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;QACjB,MAAM,UAAU,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;QACvC,MAAM,cAAc,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;QAE5C,QAAQ,CAAC,+BAA+B,EAAE;YACxC,YAAY,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;YACzE,YAA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C;CACjB;AAED,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAeA,UAAU,aAAa;IACrB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAqGzE"}
|
package/dist/commands/update.js
CHANGED
|
@@ -28,8 +28,10 @@ export async function updateCommand(options) {
|
|
|
28
28
|
spinner.text = 'Updating fuego-cli...';
|
|
29
29
|
execSync('npm install -g fuego-cli@latest', { stdio: 'pipe' });
|
|
30
30
|
spinner.stop();
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
// Get the NEW version after update
|
|
32
|
+
const newCliVersion = getFuegoCliVersion();
|
|
33
|
+
setFuegoCliVersion(newCliVersion);
|
|
34
|
+
showSuccess('✅ fuego-cli updated!', `Version: ${chalk.cyan(newCliVersion)}`);
|
|
33
35
|
cliUpdated = true;
|
|
34
36
|
}
|
|
35
37
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE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
|
|
|
8
8
|
import { serveCommand } from './commands/serve.js';
|
|
9
9
|
import { dashboardCommand } from './commands/dashboard.js';
|
|
10
10
|
import { updateCommand } from './commands/update.js';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { rpcCommand } from './commands/rpc.js';
|
|
12
|
+
import { contactsAddCommand, contactsListCommand, contactsShowCommand, contactsRemoveCommand } from './commands/contacts.js';
|
|
13
13
|
import { sendCommand } from './commands/send.js';
|
|
14
|
+
import { fundCommand } from './commands/fund.js';
|
|
14
15
|
import { showBanner } from './lib/ascii.js';
|
|
16
|
+
import { getFuegoCliVersion } from './lib/config.js';
|
|
15
17
|
async function main() {
|
|
16
18
|
// Show banner for help and when no args provided
|
|
17
19
|
const args = process.argv.slice(2);
|
|
@@ -22,7 +24,7 @@ async function main() {
|
|
|
22
24
|
program
|
|
23
25
|
.name('fuego')
|
|
24
26
|
.description('🔥 Fuego CLI - Sovereign Solana wallet for AI agents')
|
|
25
|
-
.version(
|
|
27
|
+
.version(getFuegoCliVersion())
|
|
26
28
|
.configureOutput({
|
|
27
29
|
outputError: (str, write) => write(chalk.red(str))
|
|
28
30
|
});
|
|
@@ -64,32 +66,36 @@ async function main() {
|
|
|
64
66
|
.option('--fuego', 'Update only the fuego project')
|
|
65
67
|
.action(updateCommand);
|
|
66
68
|
program
|
|
67
|
-
.command('
|
|
68
|
-
.description('
|
|
69
|
+
.command('rpc')
|
|
70
|
+
.description('Show or configure your Solana RPC endpoint')
|
|
69
71
|
.option('-u, --url <url>', 'RPC endpoint URL (e.g., https://api.mainnet-beta.solana.com)')
|
|
70
72
|
.option('-n, --network <network>', 'Network type (mainnet, devnet, testnet)', 'mainnet')
|
|
71
|
-
.action(
|
|
72
|
-
const
|
|
73
|
-
.command('
|
|
74
|
-
.description('Manage your
|
|
75
|
-
|
|
73
|
+
.action(rpcCommand);
|
|
74
|
+
const contacts = program
|
|
75
|
+
.command('contacts')
|
|
76
|
+
.description('Manage your contacts (stored in ~/.fuego/contacts/address-book.json)');
|
|
77
|
+
contacts
|
|
76
78
|
.command('add <name> <address>')
|
|
77
|
-
.description('Add a contact
|
|
79
|
+
.description('Add a contact')
|
|
78
80
|
.option('-l, --label <label>', 'Optional description/label for this contact')
|
|
79
|
-
.action(
|
|
80
|
-
|
|
81
|
+
.action(contactsAddCommand);
|
|
82
|
+
contacts
|
|
81
83
|
.command('list')
|
|
82
|
-
.description('List all contacts
|
|
83
|
-
.action(
|
|
84
|
-
|
|
84
|
+
.description('List all contacts')
|
|
85
|
+
.action(contactsListCommand);
|
|
86
|
+
contacts
|
|
85
87
|
.command('show <name>')
|
|
86
88
|
.description('Show details for a specific contact')
|
|
87
|
-
.action(
|
|
88
|
-
|
|
89
|
+
.action(contactsShowCommand);
|
|
90
|
+
contacts
|
|
89
91
|
.command('remove <name>')
|
|
90
|
-
.description('Remove a contact
|
|
92
|
+
.description('Remove a contact')
|
|
91
93
|
.option('-y, --yes', 'Skip confirmation prompt')
|
|
92
|
-
.action(
|
|
94
|
+
.action(contactsRemoveCommand);
|
|
95
|
+
program
|
|
96
|
+
.command('fund')
|
|
97
|
+
.description('Show funding options: MoonPay link + QR code for your wallet')
|
|
98
|
+
.action(fundCommand);
|
|
93
99
|
program
|
|
94
100
|
.command('send <recipient> <amount>')
|
|
95
101
|
.description('Send SOL, USDC, or USDT to an address or contact')
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAA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SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,8DAA8D,CAAC;SAC3E,MAAM,CAAC,WAAW,CAAC,CAAC;IAEvB,OAAO;SACJ,OAAO,CAAC,2BAA2B,CAAC;SACpC,WAAW,CAAC,kDAAkD,CAAC;SAC/D,cAAc,CAAC,qBAAqB,EAAE,iCAAiC,CAAC;SACxE,MAAM,CAAC,WAAW,EAAE,wCAAwC,CAAC;SAC7D,MAAM,CAAC,WAAW,CAAC,CAAC;IAEvB,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fuego-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Command-line interface for Fuego - the sovereign Solana wallet for AI agents",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -43,11 +43,13 @@
|
|
|
43
43
|
"fs-extra": "^11.3.0",
|
|
44
44
|
"gradient-string": "^3.0.0",
|
|
45
45
|
"inquirer": "^12.4.2",
|
|
46
|
-
"ora": "^8.2.0"
|
|
46
|
+
"ora": "^8.2.0",
|
|
47
|
+
"qrcode-terminal": "^0.12.0"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
50
|
"@types/fs-extra": "^11.0.4",
|
|
50
51
|
"@types/node": "^22.13.5",
|
|
52
|
+
"@types/qrcode-terminal": "^0.12.2",
|
|
51
53
|
"@typescript-eslint/eslint-plugin": "^8.25.0",
|
|
52
54
|
"@typescript-eslint/parser": "^8.25.0",
|
|
53
55
|
"eslint": "^10.0.1",
|
|
@@ -35,11 +35,11 @@ function isValidSolanaAddress(address: string): boolean {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
// Add a contact
|
|
38
|
-
export async function
|
|
38
|
+
export async function contactsAddCommand(name: string, address: string, options: { label?: string }): Promise<void> {
|
|
39
39
|
console.log();
|
|
40
40
|
|
|
41
41
|
if (!name || !address) {
|
|
42
|
-
console.log(chalk.red('❌ Usage: fuego
|
|
42
|
+
console.log(chalk.red('❌ Usage: fuego contacts add <name> <address> [--label "description"]'));
|
|
43
43
|
process.exit(1);
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -75,14 +75,14 @@ export async function addBookAddCommand(name: string, address: string, options:
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
// List all contacts
|
|
78
|
-
export async function
|
|
78
|
+
export async function contactsListCommand(): Promise<void> {
|
|
79
79
|
console.log();
|
|
80
80
|
|
|
81
81
|
const book = loadAddressBook();
|
|
82
82
|
const contacts = Object.entries(book);
|
|
83
83
|
|
|
84
84
|
if (contacts.length === 0) {
|
|
85
|
-
showInfo('📒
|
|
85
|
+
showInfo('📒 Contacts', ['No contacts yet.', '', chalk.yellow('Add one: fuego contacts add <name> <address>')]);
|
|
86
86
|
flameDivider();
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
@@ -94,16 +94,16 @@ export async function addBookListCommand(): Promise<void> {
|
|
|
94
94
|
lines.push(`${chalk.cyan(name)}: ${chalk.white(shortAddr)}${entry.label ? chalk.gray(` (${entry.label})`) : ''}`);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
showInfo('📒
|
|
97
|
+
showInfo('📒 Contacts', lines);
|
|
98
98
|
flameDivider();
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
// Show a specific contact
|
|
102
|
-
export async function
|
|
102
|
+
export async function contactsShowCommand(name: string): Promise<void> {
|
|
103
103
|
console.log();
|
|
104
104
|
|
|
105
105
|
if (!name) {
|
|
106
|
-
console.log(chalk.red('❌ Usage: fuego
|
|
106
|
+
console.log(chalk.red('❌ Usage: fuego contacts show <name>'));
|
|
107
107
|
process.exit(1);
|
|
108
108
|
}
|
|
109
109
|
|
|
@@ -112,7 +112,7 @@ export async function addBookShowCommand(name: string): Promise<void> {
|
|
|
112
112
|
|
|
113
113
|
if (!entry) {
|
|
114
114
|
console.log(chalk.red(`❌ Contact "${name}" not found.`));
|
|
115
|
-
console.log(chalk.gray('\nUse "fuego
|
|
115
|
+
console.log(chalk.gray('\nUse "fuego contacts list" to see all contacts.'));
|
|
116
116
|
process.exit(1);
|
|
117
117
|
}
|
|
118
118
|
|
|
@@ -126,11 +126,11 @@ export async function addBookShowCommand(name: string): Promise<void> {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
// Remove a contact
|
|
129
|
-
export async function
|
|
129
|
+
export async function contactsRemoveCommand(name: string, options: { yes?: boolean }): Promise<void> {
|
|
130
130
|
console.log();
|
|
131
131
|
|
|
132
132
|
if (!name) {
|
|
133
|
-
console.log(chalk.red('❌ Usage: fuego
|
|
133
|
+
console.log(chalk.red('❌ Usage: fuego contacts remove <name> [--yes]'));
|
|
134
134
|
process.exit(1);
|
|
135
135
|
}
|
|
136
136
|
|
|
@@ -150,6 +150,6 @@ export async function addBookRemoveCommand(name: string, options: { yes?: boolea
|
|
|
150
150
|
delete book[name];
|
|
151
151
|
saveAddressBook(book);
|
|
152
152
|
|
|
153
|
-
showSuccess('✅ Contact Removed', `Removed "${chalk.cyan(name)}" from
|
|
153
|
+
showSuccess('✅ Contact Removed', `Removed "${chalk.cyan(name)}" from contacts.`);
|
|
154
154
|
flameDivider();
|
|
155
155
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import qrcode from 'qrcode-terminal';
|
|
3
|
+
import boxen from 'boxen';
|
|
4
|
+
import { loadWalletConfig } from '../lib/config.js';
|
|
5
|
+
import { showInfo, flameDivider } from '../lib/ascii.js';
|
|
6
|
+
|
|
7
|
+
export async function fundCommand(): Promise<void> {
|
|
8
|
+
console.log(); // spacer
|
|
9
|
+
|
|
10
|
+
const config = loadWalletConfig();
|
|
11
|
+
|
|
12
|
+
if (!config) {
|
|
13
|
+
console.log(chalk.red('❌ No wallet found. Run "fuego create" first.'));
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const address = config.publicKey;
|
|
18
|
+
|
|
19
|
+
// MoonPay URL for funding SOL to this wallet
|
|
20
|
+
const moonpayUrl = `https://buy.moonpay.com/?currencyCode=SOL&walletAddress=${address}`;
|
|
21
|
+
|
|
22
|
+
// Generate QR code first, then display everything in a box
|
|
23
|
+
qrcode.generate(address, { small: true }, (qrcodeOutput: string) => {
|
|
24
|
+
// Indent the QR code
|
|
25
|
+
const indentedQr = qrcodeOutput.split('\n').map(line => ' ' + line).join('\n');
|
|
26
|
+
|
|
27
|
+
// Build the fund box content
|
|
28
|
+
const fundContent = [
|
|
29
|
+
chalk.bold.cyan('💰 Fund Your Wallet'),
|
|
30
|
+
'',
|
|
31
|
+
chalk.white('Address:'),
|
|
32
|
+
chalk.cyan(address),
|
|
33
|
+
'',
|
|
34
|
+
chalk.yellow('📱 Scan to send funds to your address:'),
|
|
35
|
+
'',
|
|
36
|
+
indentedQr
|
|
37
|
+
].join('\n');
|
|
38
|
+
|
|
39
|
+
// Display the fund box
|
|
40
|
+
console.log(
|
|
41
|
+
boxen(fundContent, {
|
|
42
|
+
padding: 1,
|
|
43
|
+
margin: { top: 0, bottom: 1 },
|
|
44
|
+
borderStyle: 'round',
|
|
45
|
+
borderColor: 'green'
|
|
46
|
+
})
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
// Show MoonPay box
|
|
50
|
+
showInfo('🔗 MoonPay Onramp', [
|
|
51
|
+
'Buy SOL with card/bank and send directly to your wallet:',
|
|
52
|
+
'',
|
|
53
|
+
chalk.cyan(moonpayUrl)
|
|
54
|
+
]);
|
|
55
|
+
|
|
56
|
+
flameDivider();
|
|
57
|
+
});
|
|
58
|
+
}
|
|
@@ -2,12 +2,12 @@ import chalk from 'chalk';
|
|
|
2
2
|
import { setConfig, getConfig, listConfig } from '../lib/config.js';
|
|
3
3
|
import { showSuccess, showInfo, flameDivider } from '../lib/ascii.js';
|
|
4
4
|
|
|
5
|
-
interface
|
|
5
|
+
interface RpcOptions {
|
|
6
6
|
url?: string;
|
|
7
7
|
network?: string;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export async function
|
|
10
|
+
export async function rpcCommand(options: RpcOptions): Promise<void> {
|
|
11
11
|
console.log(); // spacer
|
|
12
12
|
|
|
13
13
|
// If no URL provided, show current config and help
|
|
@@ -19,8 +19,8 @@ export async function addRpcCommand(options: AddRpcOptions): Promise<void> {
|
|
|
19
19
|
`RPC URL: ${currentRpc ? chalk.cyan(currentRpc) : chalk.gray('Not set')}`,
|
|
20
20
|
`Network: ${currentNetwork ? chalk.cyan(currentNetwork) : chalk.gray('mainnet')}`,
|
|
21
21
|
'',
|
|
22
|
-
`${chalk.yellow('Usage:')} fuego
|
|
23
|
-
`${chalk.yellow('Or:')} fuego
|
|
22
|
+
`${chalk.yellow('Usage:')} fuego rpc --url https://api.mainnet-beta.solana.com`,
|
|
23
|
+
`${chalk.yellow('Or:')} fuego rpc --url https://helius.xyz/... --network mainnet`
|
|
24
24
|
]);
|
|
25
25
|
|
|
26
26
|
flameDivider();
|
package/src/commands/update.ts
CHANGED
|
@@ -48,8 +48,10 @@ export async function updateCommand(options: UpdateOptions): Promise<void> {
|
|
|
48
48
|
execSync('npm install -g fuego-cli@latest', { stdio: 'pipe' });
|
|
49
49
|
spinner.stop();
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
// Get the NEW version after update
|
|
52
|
+
const newCliVersion = getFuegoCliVersion();
|
|
53
|
+
setFuegoCliVersion(newCliVersion);
|
|
54
|
+
showSuccess('✅ fuego-cli updated!', `Version: ${chalk.cyan(newCliVersion)}`);
|
|
53
55
|
cliUpdated = true;
|
|
54
56
|
} catch (error: any) {
|
|
55
57
|
spinner.stop();
|
package/src/index.ts
CHANGED
|
@@ -9,10 +9,12 @@ import { balanceCommand } from './commands/balance.js';
|
|
|
9
9
|
import { serveCommand } from './commands/serve.js';
|
|
10
10
|
import { dashboardCommand } from './commands/dashboard.js';
|
|
11
11
|
import { updateCommand } from './commands/update.js';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { rpcCommand } from './commands/rpc.js';
|
|
13
|
+
import { contactsAddCommand, contactsListCommand, contactsShowCommand, contactsRemoveCommand } from './commands/contacts.js';
|
|
14
14
|
import { sendCommand } from './commands/send.js';
|
|
15
|
+
import { fundCommand } from './commands/fund.js';
|
|
15
16
|
import { showBanner } from './lib/ascii.js';
|
|
17
|
+
import { getFuegoCliVersion } from './lib/config.js';
|
|
16
18
|
|
|
17
19
|
async function main() {
|
|
18
20
|
// Show banner for help and when no args provided
|
|
@@ -26,7 +28,7 @@ async function main() {
|
|
|
26
28
|
program
|
|
27
29
|
.name('fuego')
|
|
28
30
|
.description('🔥 Fuego CLI - Sovereign Solana wallet for AI agents')
|
|
29
|
-
.version(
|
|
31
|
+
.version(getFuegoCliVersion())
|
|
30
32
|
.configureOutput({
|
|
31
33
|
outputError: (str, write) => write(chalk.red(str))
|
|
32
34
|
});
|
|
@@ -76,37 +78,42 @@ async function main() {
|
|
|
76
78
|
.action(updateCommand);
|
|
77
79
|
|
|
78
80
|
program
|
|
79
|
-
.command('
|
|
80
|
-
.description('
|
|
81
|
+
.command('rpc')
|
|
82
|
+
.description('Show or configure your Solana RPC endpoint')
|
|
81
83
|
.option('-u, --url <url>', 'RPC endpoint URL (e.g., https://api.mainnet-beta.solana.com)')
|
|
82
84
|
.option('-n, --network <network>', 'Network type (mainnet, devnet, testnet)', 'mainnet')
|
|
83
|
-
.action(
|
|
85
|
+
.action(rpcCommand);
|
|
84
86
|
|
|
85
|
-
const
|
|
86
|
-
.command('
|
|
87
|
-
.description('Manage your
|
|
87
|
+
const contacts = program
|
|
88
|
+
.command('contacts')
|
|
89
|
+
.description('Manage your contacts (stored in ~/.fuego/contacts/address-book.json)');
|
|
88
90
|
|
|
89
|
-
|
|
91
|
+
contacts
|
|
90
92
|
.command('add <name> <address>')
|
|
91
|
-
.description('Add a contact
|
|
93
|
+
.description('Add a contact')
|
|
92
94
|
.option('-l, --label <label>', 'Optional description/label for this contact')
|
|
93
|
-
.action(
|
|
95
|
+
.action(contactsAddCommand);
|
|
94
96
|
|
|
95
|
-
|
|
97
|
+
contacts
|
|
96
98
|
.command('list')
|
|
97
|
-
.description('List all contacts
|
|
98
|
-
.action(
|
|
99
|
+
.description('List all contacts')
|
|
100
|
+
.action(contactsListCommand);
|
|
99
101
|
|
|
100
|
-
|
|
102
|
+
contacts
|
|
101
103
|
.command('show <name>')
|
|
102
104
|
.description('Show details for a specific contact')
|
|
103
|
-
.action(
|
|
105
|
+
.action(contactsShowCommand);
|
|
104
106
|
|
|
105
|
-
|
|
107
|
+
contacts
|
|
106
108
|
.command('remove <name>')
|
|
107
|
-
.description('Remove a contact
|
|
109
|
+
.description('Remove a contact')
|
|
108
110
|
.option('-y, --yes', 'Skip confirmation prompt')
|
|
109
|
-
.action(
|
|
111
|
+
.action(contactsRemoveCommand);
|
|
112
|
+
|
|
113
|
+
program
|
|
114
|
+
.command('fund')
|
|
115
|
+
.description('Show funding options: MoonPay link + QR code for your wallet')
|
|
116
|
+
.action(fundCommand);
|
|
110
117
|
|
|
111
118
|
program
|
|
112
119
|
.command('send <recipient> <amount>')
|