@clawcard/cli 3.0.1 → 3.0.2
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/package.json +1 -1
- package/src/commands/setup.js +26 -1
package/package.json
CHANGED
package/src/commands/setup.js
CHANGED
|
@@ -126,7 +126,32 @@ export async function setupCommand() {
|
|
|
126
126
|
const envPath = writeApiKey(apiKey);
|
|
127
127
|
p.log.info(`API key saved to ${chalk.dim(envPath)}`);
|
|
128
128
|
|
|
129
|
-
// Step 6:
|
|
129
|
+
// Step 6: Create wallet (if doesn't exist)
|
|
130
|
+
const s3 = p.spinner();
|
|
131
|
+
s3.start("Setting up crypto wallet...");
|
|
132
|
+
|
|
133
|
+
try {
|
|
134
|
+
const { getWallet, createWallet } = await import("../agent-api.js");
|
|
135
|
+
let walletAddress = null;
|
|
136
|
+
try {
|
|
137
|
+
const existing = await getWallet(selectedKey.id);
|
|
138
|
+
walletAddress = existing.address;
|
|
139
|
+
s3.stop(`Wallet ready: ${chalk.dim(walletAddress)}`);
|
|
140
|
+
} catch {
|
|
141
|
+
// No wallet — create one
|
|
142
|
+
try {
|
|
143
|
+
const created = await createWallet(selectedKey.id);
|
|
144
|
+
walletAddress = created.address;
|
|
145
|
+
s3.stop(`Wallet created: ${orange(walletAddress)}`);
|
|
146
|
+
} catch (err) {
|
|
147
|
+
s3.stop("Wallet setup skipped (can create later with: clawcard agent wallet)");
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
} catch {
|
|
151
|
+
s3.stop("Wallet setup skipped");
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Step 7: Summary
|
|
130
155
|
p.log.success("Your agent is ready to use ClawCard!");
|
|
131
156
|
p.log.info(
|
|
132
157
|
[
|