@botwallet/agent-cli 0.1.0-beta.1 → 0.1.0-beta.3
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 +3 -2
- package/bin/botwallet +44 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,8 +14,9 @@ npm install -g @botwallet/agent-cli
|
|
|
14
14
|
# Register a new wallet (FROST threshold key generation)
|
|
15
15
|
botwallet register --name "My Agent Wallet" --owner human@example.com
|
|
16
16
|
|
|
17
|
-
#
|
|
18
|
-
botwallet
|
|
17
|
+
# Create an invoice and send it
|
|
18
|
+
botwallet paylink create 25.00 --desc "Research report"
|
|
19
|
+
botwallet paylink send <request_id> --to client@example.com --message "Here's your invoice"
|
|
19
20
|
|
|
20
21
|
# Two-step payment flow
|
|
21
22
|
botwallet pay @merchant 10.00 # Step 1: Create intent
|
package/bin/botwallet
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// =============================================================================
|
|
3
|
+
// Botwallet CLI npm bin wrapper
|
|
4
|
+
// =============================================================================
|
|
5
|
+
// This wrapper calls the actual Go binary.
|
|
6
|
+
// =============================================================================
|
|
7
|
+
|
|
8
|
+
const { spawn } = require('child_process');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
|
|
12
|
+
const isWindows = process.platform === 'win32';
|
|
13
|
+
const binaryName = isWindows ? 'botwallet.exe' : 'botwallet';
|
|
14
|
+
const binaryPath = path.join(__dirname, binaryName);
|
|
15
|
+
|
|
16
|
+
// Check if binary exists
|
|
17
|
+
if (!fs.existsSync(binaryPath)) {
|
|
18
|
+
console.error('Error: Botwallet CLI binary not found.');
|
|
19
|
+
console.error('Try reinstalling: npm install -g @botwallet/agent-cli');
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Spawn the binary with all arguments
|
|
24
|
+
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
25
|
+
stdio: 'inherit',
|
|
26
|
+
shell: false
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
child.on('error', (error) => {
|
|
30
|
+
console.error('Failed to run Botwallet CLI:', error.message);
|
|
31
|
+
process.exit(1);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
child.on('exit', (code) => {
|
|
35
|
+
process.exit(code || 0);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|