fuego-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/README.md +109 -0
- package/dist/commands/address.d.ts +2 -0
- package/dist/commands/address.d.ts.map +1 -0
- package/dist/commands/address.js +20 -0
- package/dist/commands/address.js.map +1 -0
- package/dist/commands/create.d.ts +8 -0
- package/dist/commands/create.d.ts.map +1 -0
- package/dist/commands/create.js +57 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/install.d.ts +6 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +58 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/ascii.d.ts +29 -0
- package/dist/lib/ascii.d.ts.map +1 -0
- package/dist/lib/ascii.js +78 -0
- package/dist/lib/ascii.js.map +1 -0
- package/dist/lib/config.d.ts +23 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +49 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/wallet.d.ts +44 -0
- package/dist/lib/wallet.d.ts.map +1 -0
- package/dist/lib/wallet.js +118 -0
- package/dist/lib/wallet.js.map +1 -0
- package/fuego-cli-0.1.0.tgz +0 -0
- package/package.json +57 -0
- package/src/commands/address.ts +25 -0
- package/src/commands/create.ts +81 -0
- package/src/commands/install.ts +82 -0
- package/src/index.ts +53 -0
- package/src/lib/ascii.ts +94 -0
- package/src/lib/config.ts +74 -0
- package/src/lib/wallet.ts +189 -0
- package/tsconfig.json +20 -0
package/README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# 🔥 @fuego/cli
|
|
2
|
+
|
|
3
|
+
Command-line interface for Fuego - the sovereign Solana wallet for AI agents.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @fuego/cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# See the fire banner and help
|
|
17
|
+
fuego --help
|
|
18
|
+
|
|
19
|
+
# Create a new Fuego wallet
|
|
20
|
+
fuego create --name my-wallet
|
|
21
|
+
|
|
22
|
+
# Install the main Fuego project
|
|
23
|
+
fuego install
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Commands
|
|
27
|
+
|
|
28
|
+
### `fuego create [options]`
|
|
29
|
+
|
|
30
|
+
Create a new Fuego wallet with style.
|
|
31
|
+
|
|
32
|
+
**Options:**
|
|
33
|
+
- `-f, --force` - Overwrite existing wallet
|
|
34
|
+
- `-n, --name <name>` - Name your wallet (default: "default")
|
|
35
|
+
- `-d, --directory <path>` - Custom config directory
|
|
36
|
+
|
|
37
|
+
**Example:**
|
|
38
|
+
```bash
|
|
39
|
+
fuego create --name prod-wallet
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Creates:
|
|
43
|
+
```
|
|
44
|
+
~/.fuego/
|
|
45
|
+
├── wallet.json # Private key (minimal, 600 permissions)
|
|
46
|
+
├── wallet-config.json # Wallet metadata (name, publicKey, createdAt)
|
|
47
|
+
└── config.json # CLI settings (RPC URL, network)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### `fuego install [options]`
|
|
51
|
+
|
|
52
|
+
Install the main Fuego project.
|
|
53
|
+
|
|
54
|
+
**Options:**
|
|
55
|
+
- `-p, --path <path>` - Installation path
|
|
56
|
+
|
|
57
|
+
**Smart defaults:**
|
|
58
|
+
- If `~/.openclaw/workspace` exists → installs there (agent machine)
|
|
59
|
+
- Otherwise → installs to `./fuego` (like create-react-app)
|
|
60
|
+
|
|
61
|
+
**Example:**
|
|
62
|
+
```bash
|
|
63
|
+
# Auto-detect best location
|
|
64
|
+
fuego install
|
|
65
|
+
|
|
66
|
+
# Custom path
|
|
67
|
+
fuego install --path ~/projects/my-fuego
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Features
|
|
71
|
+
|
|
72
|
+
- 🔥 **Fire-themed UI** — ASCII art, gradient colors, boxed messages
|
|
73
|
+
- 🤖 **Agent-aware** — Auto-detects OpenClaw workspace
|
|
74
|
+
- 🛡️ **Sovereign** — Your keys, your control
|
|
75
|
+
- 📦 **Zero-conf** — Sensible defaults, works out of the box
|
|
76
|
+
|
|
77
|
+
## Development
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Clone and setup
|
|
81
|
+
git clone https://github.com/willmcdeezy/fuego-cli.git
|
|
82
|
+
cd fuego-cli
|
|
83
|
+
npm install
|
|
84
|
+
|
|
85
|
+
# Build (uses npx tsc)
|
|
86
|
+
npm run build
|
|
87
|
+
|
|
88
|
+
# Test locally
|
|
89
|
+
npm start -- --help
|
|
90
|
+
npm start create --name test
|
|
91
|
+
|
|
92
|
+
# Link for global testing
|
|
93
|
+
npm link
|
|
94
|
+
fuego --help
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Security
|
|
98
|
+
|
|
99
|
+
- Private keys stored with `0o600` permissions (owner read/write only)
|
|
100
|
+
- Wallet data separated from configuration
|
|
101
|
+
- Local-first — no cloud services, no hosted wallets
|
|
102
|
+
|
|
103
|
+
## License
|
|
104
|
+
|
|
105
|
+
MIT
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
Built with 🔥 for the agent economy.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/commands/address.ts"],"names":[],"mappings":"AAIA,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAoBpD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { loadWalletConfig } from '../lib/config.js';
|
|
3
|
+
import { showInfo, formatPublicKey, flameDivider } from '../lib/ascii.js';
|
|
4
|
+
export async function addressCommand() {
|
|
5
|
+
console.log(); // spacer
|
|
6
|
+
const config = loadWalletConfig();
|
|
7
|
+
if (!config) {
|
|
8
|
+
console.log(chalk.red('❌ No wallet found. Run "fuego create" first.'));
|
|
9
|
+
process.exit(1);
|
|
10
|
+
}
|
|
11
|
+
showInfo('📍 Your Fuego Address', [
|
|
12
|
+
`Name: ${chalk.cyan(config.name || 'default')}`,
|
|
13
|
+
`Public Key: ${formatPublicKey(config.publicKey)}`
|
|
14
|
+
]);
|
|
15
|
+
// Also show plain for easy copying
|
|
16
|
+
console.log(chalk.gray('\nPlain text (for copying):'));
|
|
17
|
+
console.log(chalk.white(config.publicKey));
|
|
18
|
+
flameDivider();
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=address.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src/commands/address.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE1E,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,SAAS;IAExB,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;IAElC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC,CAAC;QACvE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,QAAQ,CAAC,uBAAuB,EAAE;QAChC,SAAS,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,SAAS,CAAC,EAAE;QAC/C,eAAe,eAAe,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;KACnD,CAAC,CAAC;IAEH,mCAAmC;IACnC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC,CAAC;IACvD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;IAE3C,YAAY,EAAE,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAOA,UAAU,aAAa;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAmEzE"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import ora from 'ora';
|
|
3
|
+
import { FuegoWallet } from '../lib/wallet.js';
|
|
4
|
+
import { getWalletPath, getConfigPath } from '../lib/config.js';
|
|
5
|
+
import { showSuccess, showWarning, showInfo, formatPublicKey, flameDivider } from '../lib/ascii.js';
|
|
6
|
+
import fs from 'fs-extra';
|
|
7
|
+
export async function createCommand(options) {
|
|
8
|
+
console.log(); // spacer
|
|
9
|
+
const spinner = ora({
|
|
10
|
+
text: 'Checking for existing wallet...',
|
|
11
|
+
color: 'yellow'
|
|
12
|
+
}).start();
|
|
13
|
+
try {
|
|
14
|
+
const walletPath = options.directory
|
|
15
|
+
? `${options.directory}/wallet.json`
|
|
16
|
+
: getWalletPath();
|
|
17
|
+
const wallet = new FuegoWallet(walletPath);
|
|
18
|
+
if (wallet.exists() && !options.force) {
|
|
19
|
+
spinner.stop();
|
|
20
|
+
showWarning('Wallet already exists.\n\nUse --force to overwrite.\n⚠️ Warning: Overwriting will destroy your current wallet!');
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
spinner.text = 'Generating new Solana keypair...';
|
|
24
|
+
spinner.color = 'red';
|
|
25
|
+
const { publicKey, mnemonic } = await wallet.create(options.name);
|
|
26
|
+
// Create config.json with defaults
|
|
27
|
+
const configPath = options.directory
|
|
28
|
+
? `${options.directory}/config.json`
|
|
29
|
+
: getConfigPath();
|
|
30
|
+
if (!fs.existsSync(configPath)) {
|
|
31
|
+
fs.writeJsonSync(configPath, {
|
|
32
|
+
network: 'mainnet',
|
|
33
|
+
rpcUrl: 'https://api.mainnet-beta.solana.com',
|
|
34
|
+
version: '0.1.0'
|
|
35
|
+
}, { spaces: 2 });
|
|
36
|
+
}
|
|
37
|
+
spinner.stop();
|
|
38
|
+
// Success display
|
|
39
|
+
showSuccess('🔥 Wallet Created Successfully!', `Name: ${chalk.cyan(options.name || 'default')}\nPublic Key: ${formatPublicKey(publicKey)}`);
|
|
40
|
+
if (mnemonic) {
|
|
41
|
+
showWarning('IMPORTANT: Save this recovery phrase!\n' +
|
|
42
|
+
chalk.white(mnemonic) +
|
|
43
|
+
'\n\n' + chalk.red('Never share this phrase with anyone!'));
|
|
44
|
+
}
|
|
45
|
+
// File locations
|
|
46
|
+
showInfo('📁 Wallet Files', [
|
|
47
|
+
'Keypair: ~/.fuego/wallet.json',
|
|
48
|
+
'Config: ~/.fuego/wallet-config.json'
|
|
49
|
+
]);
|
|
50
|
+
flameDivider();
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
spinner.fail(chalk.red(`Failed to create wallet: ${error.message}`));
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAA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+
import ora from 'ora';
|
|
3
|
+
import { execSync } from 'child_process';
|
|
4
|
+
import fs from 'fs-extra';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import os from 'os';
|
|
7
|
+
import { showSuccess, showWarning, showInfo, flameDivider } from '../lib/ascii.js';
|
|
8
|
+
export async function installCommand(options) {
|
|
9
|
+
console.log(); // spacer
|
|
10
|
+
// Determine default path: use openclaw workspace if it exists, otherwise current directory
|
|
11
|
+
const openclawWorkspace = path.join(os.homedir(), '.openclaw', 'workspace');
|
|
12
|
+
const hasOpenclaw = fs.existsSync(openclawWorkspace);
|
|
13
|
+
const defaultPath = hasOpenclaw
|
|
14
|
+
? path.join(openclawWorkspace, 'fuego')
|
|
15
|
+
: path.join(process.cwd(), 'fuego');
|
|
16
|
+
const installPath = options.path || defaultPath;
|
|
17
|
+
const spinner = ora({
|
|
18
|
+
text: 'Checking installation path...',
|
|
19
|
+
color: 'yellow'
|
|
20
|
+
}).start();
|
|
21
|
+
try {
|
|
22
|
+
// Check if already exists
|
|
23
|
+
if (fs.existsSync(installPath)) {
|
|
24
|
+
spinner.stop();
|
|
25
|
+
showWarning(`Fuego already installed at:\n${chalk.cyan(installPath)}\n\nUse --path to install elsewhere, or delete the existing installation.`);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
spinner.text = 'Creating directory...';
|
|
29
|
+
spinner.color = 'cyan';
|
|
30
|
+
await fs.ensureDir(path.dirname(installPath));
|
|
31
|
+
spinner.text = 'Cloning Fuego repository...';
|
|
32
|
+
spinner.color = 'red';
|
|
33
|
+
// Clone the main Fuego repo
|
|
34
|
+
const repoUrl = 'https://github.com/willmcdeezy/fuego.git';
|
|
35
|
+
execSync(`git clone ${repoUrl} "${installPath}"`, { stdio: 'pipe' });
|
|
36
|
+
spinner.stop();
|
|
37
|
+
// Show contextual next steps
|
|
38
|
+
const relativePath = path.relative(process.cwd(), installPath);
|
|
39
|
+
const cdPath = relativePath.startsWith('..') ? installPath : relativePath;
|
|
40
|
+
const safeCdPath = cdPath.includes(' ') ? `"${cdPath}"` : cdPath;
|
|
41
|
+
showSuccess('🔥 Fuego Installed Successfully!', `Location: ${chalk.cyan(installPath)}`);
|
|
42
|
+
showInfo('🚀 Next Steps', [
|
|
43
|
+
`cd ${safeCdPath}`,
|
|
44
|
+
'npm install',
|
|
45
|
+
'npm run start'
|
|
46
|
+
]);
|
|
47
|
+
flameDivider();
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
spinner.fail(chalk.red(`Installation failed: ${error.message}`));
|
|
51
|
+
// Cleanup on failure
|
|
52
|
+
if (fs.existsSync(installPath)) {
|
|
53
|
+
fs.removeSync(installPath);
|
|
54
|
+
}
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAMnF,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAAuB;IAC1D,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,SAAS;IAExB,2FAA2F;IAC3F,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;IAC5E,MAAM,WAAW,GAAG,EAAE,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;I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AAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC;QAC1E,MAAM,UAAU,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;QAEjE,WAAW,CACT,kCAAkC,EAClC,aAAa,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CACvC,CAAC;QAEF,QAAQ,CAAC,eAAe,EAAE;YACxB,MAAM,UAAU,EAAE;YAClB,aAAa;YACb,eAAe;SAChB,CAAC,CAAC;QAEH,YAAY,EAAE,CAAC;IAEjB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,wBAAwB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QAEjE,qBAAqB;QACrB,IAAI,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;YAC/B,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC7B,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import { createCommand } from './commands/create.js';
|
|
5
|
+
import { installCommand } from './commands/install.js';
|
|
6
|
+
import { addressCommand } from './commands/address.js';
|
|
7
|
+
import { showBanner } from './lib/ascii.js';
|
|
8
|
+
async function main() {
|
|
9
|
+
// Show banner for help and when no args provided
|
|
10
|
+
const args = process.argv.slice(2);
|
|
11
|
+
if (args.length === 0 || args.includes('--help') || args.includes('-h')) {
|
|
12
|
+
showBanner();
|
|
13
|
+
}
|
|
14
|
+
const program = new Command();
|
|
15
|
+
program
|
|
16
|
+
.name('fuego')
|
|
17
|
+
.description('🔥 Fuego CLI - Sovereign Solana wallet for AI agents')
|
|
18
|
+
.version('0.1.0')
|
|
19
|
+
.configureOutput({
|
|
20
|
+
outputError: (str, write) => write(chalk.red(str))
|
|
21
|
+
});
|
|
22
|
+
program
|
|
23
|
+
.command('create')
|
|
24
|
+
.description('Create a new Fuego wallet')
|
|
25
|
+
.option('-f, --force', 'Overwrite existing wallet')
|
|
26
|
+
.option('-d, --directory <path>', 'Custom config directory')
|
|
27
|
+
.option('-n, --name <name>', 'Wallet name', 'default')
|
|
28
|
+
.action(createCommand);
|
|
29
|
+
program
|
|
30
|
+
.command('install')
|
|
31
|
+
.description('Install the main Fuego project (for agents)')
|
|
32
|
+
.option('-p, --path <path>', 'Installation path (default: ~/.openclaw/workspace/fuego if exists, else ./fuego)')
|
|
33
|
+
.action(installCommand);
|
|
34
|
+
program
|
|
35
|
+
.command('address')
|
|
36
|
+
.alias('addr')
|
|
37
|
+
.description('Show your wallet address')
|
|
38
|
+
.action(addressCommand);
|
|
39
|
+
await program.parseAsync(process.argv);
|
|
40
|
+
}
|
|
41
|
+
main().catch((error) => {
|
|
42
|
+
console.error(chalk.red(`\n❌ Error: ${error.message}`));
|
|
43
|
+
process.exit(1);
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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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AE1B,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"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Display the Fuego ASCII banner
|
|
3
|
+
*/
|
|
4
|
+
export declare function showBanner(): void;
|
|
5
|
+
/**
|
|
6
|
+
* Display a success message in a box
|
|
7
|
+
*/
|
|
8
|
+
export declare function showSuccess(title: string, message: string): void;
|
|
9
|
+
/**
|
|
10
|
+
* Display an error message in a box
|
|
11
|
+
*/
|
|
12
|
+
export declare function showError(message: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* Display a warning message in a box
|
|
15
|
+
*/
|
|
16
|
+
export declare function showWarning(message: string): void;
|
|
17
|
+
/**
|
|
18
|
+
* Display info in a subtle box
|
|
19
|
+
*/
|
|
20
|
+
export declare function showInfo(title: string, lines: string[]): void;
|
|
21
|
+
/**
|
|
22
|
+
* Format a public key with fire styling
|
|
23
|
+
*/
|
|
24
|
+
export declare function formatPublicKey(key: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Show a flame divider
|
|
27
|
+
*/
|
|
28
|
+
export declare function flameDivider(): void;
|
|
29
|
+
//# sourceMappingURL=ascii.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ascii.d.ts","sourceRoot":"","sources":["../../src/lib/ascii.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,wBAAgB,UAAU,IAAI,IAAI,CASjC;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAWhE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAS/C;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CASjD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAU7D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAEnC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import figlet from 'figlet';
|
|
2
|
+
import gradient from 'gradient-string';
|
|
3
|
+
import boxen from 'boxen';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
// Fire gradient for Fuego branding
|
|
6
|
+
const fireGradient = gradient(['#ff6b35', '#f7931e', '#ffd23f']);
|
|
7
|
+
/**
|
|
8
|
+
* Display the Fuego ASCII banner
|
|
9
|
+
*/
|
|
10
|
+
export function showBanner() {
|
|
11
|
+
const banner = figlet.textSync('FUEGO', {
|
|
12
|
+
font: 'Big',
|
|
13
|
+
horizontalLayout: 'default',
|
|
14
|
+
verticalLayout: 'default'
|
|
15
|
+
});
|
|
16
|
+
console.log(fireGradient.multiline(banner));
|
|
17
|
+
console.log(chalk.gray(' Sovereign Solana wallet for AI agents\n'));
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Display a success message in a box
|
|
21
|
+
*/
|
|
22
|
+
export function showSuccess(title, message) {
|
|
23
|
+
const content = `${chalk.bold.green(title)}\n\n${message}`;
|
|
24
|
+
console.log(boxen(content, {
|
|
25
|
+
padding: 1,
|
|
26
|
+
margin: { top: 1, bottom: 1 },
|
|
27
|
+
borderStyle: 'round',
|
|
28
|
+
borderColor: 'green',
|
|
29
|
+
backgroundColor: '#0a0a0a'
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Display an error message in a box
|
|
34
|
+
*/
|
|
35
|
+
export function showError(message) {
|
|
36
|
+
console.log(boxen(chalk.red(message), {
|
|
37
|
+
padding: 1,
|
|
38
|
+
margin: { top: 1, bottom: 1 },
|
|
39
|
+
borderStyle: 'bold',
|
|
40
|
+
borderColor: 'red'
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Display a warning message in a box
|
|
45
|
+
*/
|
|
46
|
+
export function showWarning(message) {
|
|
47
|
+
console.log(boxen(chalk.yellow(message), {
|
|
48
|
+
padding: 1,
|
|
49
|
+
margin: { top: 0, bottom: 1 },
|
|
50
|
+
borderStyle: 'round',
|
|
51
|
+
borderColor: 'yellow'
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Display info in a subtle box
|
|
56
|
+
*/
|
|
57
|
+
export function showInfo(title, lines) {
|
|
58
|
+
const content = chalk.bold.cyan(title) + '\n\n' + lines.map(l => chalk.white(l)).join('\n');
|
|
59
|
+
console.log(boxen(content, {
|
|
60
|
+
padding: 1,
|
|
61
|
+
margin: { top: 0, bottom: 1 },
|
|
62
|
+
borderStyle: 'single',
|
|
63
|
+
borderColor: 'cyan'
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Format a public key with fire styling
|
|
68
|
+
*/
|
|
69
|
+
export function formatPublicKey(key) {
|
|
70
|
+
return fireGradient(key);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Show a flame divider
|
|
74
|
+
*/
|
|
75
|
+
export function flameDivider() {
|
|
76
|
+
console.log(fireGradient('━'.repeat(50)));
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=ascii.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ascii.js","sourceRoot":"","sources":["../../src/lib/ascii.ts"],"names":[],"m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+
interface Config {
|
|
2
|
+
rpcUrl?: string;
|
|
3
|
+
network?: 'mainnet' | 'devnet' | 'testnet';
|
|
4
|
+
defaultToken?: string;
|
|
5
|
+
[key: string]: string | undefined;
|
|
6
|
+
}
|
|
7
|
+
interface WalletConfig {
|
|
8
|
+
publicKey: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
version: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function getWalletPath(): string;
|
|
15
|
+
export declare function getWalletConfigPath(): string;
|
|
16
|
+
export declare function getConfigPath(): string;
|
|
17
|
+
export declare function loadWalletConfig(): WalletConfig | null;
|
|
18
|
+
export declare function saveWalletConfig(config: WalletConfig): void;
|
|
19
|
+
export declare function getConfig(key: string): string | undefined;
|
|
20
|
+
export declare function setConfig(key: string, value: string): void;
|
|
21
|
+
export declare function listConfig(): Config;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AASA,UAAU,MAAM;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACnC;AAED,UAAU,YAAY;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,wBAAgB,gBAAgB,IAAI,YAAY,GAAG,IAAI,CAKtD;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAG3D;AAcD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGzD;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAI1D;AAED,wBAAgB,UAAU,IAAI,MAAM,CAEnC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
const CONFIG_DIR = path.join(os.homedir(), '.fuego');
|
|
5
|
+
const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
|
|
6
|
+
const WALLET_FILE = path.join(CONFIG_DIR, 'wallet.json');
|
|
7
|
+
const WALLET_CONFIG_FILE = path.join(CONFIG_DIR, 'wallet-config.json');
|
|
8
|
+
export function getWalletPath() {
|
|
9
|
+
return WALLET_FILE;
|
|
10
|
+
}
|
|
11
|
+
export function getWalletConfigPath() {
|
|
12
|
+
return WALLET_CONFIG_FILE;
|
|
13
|
+
}
|
|
14
|
+
export function getConfigPath() {
|
|
15
|
+
return CONFIG_FILE;
|
|
16
|
+
}
|
|
17
|
+
export function loadWalletConfig() {
|
|
18
|
+
if (!fs.existsSync(WALLET_CONFIG_FILE)) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
return fs.readJsonSync(WALLET_CONFIG_FILE);
|
|
22
|
+
}
|
|
23
|
+
export function saveWalletConfig(config) {
|
|
24
|
+
fs.ensureDirSync(CONFIG_DIR);
|
|
25
|
+
fs.writeJsonSync(WALLET_CONFIG_FILE, config, { spaces: 2 });
|
|
26
|
+
}
|
|
27
|
+
function loadConfig() {
|
|
28
|
+
if (!fs.existsSync(CONFIG_FILE)) {
|
|
29
|
+
return {};
|
|
30
|
+
}
|
|
31
|
+
return fs.readJsonSync(CONFIG_FILE);
|
|
32
|
+
}
|
|
33
|
+
function saveConfig(config) {
|
|
34
|
+
fs.ensureDirSync(CONFIG_DIR);
|
|
35
|
+
fs.writeJsonSync(CONFIG_FILE, config, { spaces: 2 });
|
|
36
|
+
}
|
|
37
|
+
export function getConfig(key) {
|
|
38
|
+
const config = loadConfig();
|
|
39
|
+
return config[key];
|
|
40
|
+
}
|
|
41
|
+
export function setConfig(key, value) {
|
|
42
|
+
const config = loadConfig();
|
|
43
|
+
config[key] = value;
|
|
44
|
+
saveConfig(config);
|
|
45
|
+
}
|
|
46
|
+
export function listConfig() {
|
|
47
|
+
return loadConfig();
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,CAAC;AACrD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AACzD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AACzD,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,oBAAoB,CAAC,CAAC;AAiBvE,MAAM,UAAU,aAAa;IAC3B,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,gBAAgB;I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;
|
|
4
|
+
tokens: Array<{
|
|
5
|
+
mint: string;
|
|
6
|
+
symbol: string;
|
|
7
|
+
amount: string;
|
|
8
|
+
decimals: number;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
export interface SendResult {
|
|
12
|
+
signature: string;
|
|
13
|
+
confirmation: string;
|
|
14
|
+
}
|
|
15
|
+
export interface TransactionRecord {
|
|
16
|
+
signature: string;
|
|
17
|
+
type: 'incoming' | 'outgoing';
|
|
18
|
+
amount: string;
|
|
19
|
+
token: string;
|
|
20
|
+
timestamp: number;
|
|
21
|
+
counterparty?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare class FuegoWallet {
|
|
24
|
+
private walletPath;
|
|
25
|
+
private keypair?;
|
|
26
|
+
constructor(walletPath?: string);
|
|
27
|
+
exists(): boolean;
|
|
28
|
+
create(name?: string): Promise<{
|
|
29
|
+
publicKey: string;
|
|
30
|
+
mnemonic?: string;
|
|
31
|
+
}>;
|
|
32
|
+
load(): Keypair;
|
|
33
|
+
getPublicKey(): string;
|
|
34
|
+
getBalance(): Promise<WalletBalance>;
|
|
35
|
+
send(params: {
|
|
36
|
+
to: string;
|
|
37
|
+
amount: number;
|
|
38
|
+
token: string;
|
|
39
|
+
network?: string;
|
|
40
|
+
}): Promise<SendResult>;
|
|
41
|
+
getHistory(limit: number): Promise<TransactionRecord[]>;
|
|
42
|
+
private getConnection;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=wallet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/lib/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAMR,MAAM,iBAAiB,CAAC;AAKzB,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,KAAK,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,E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