@clawcard/cli 3.0.16 → 3.0.21
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/agent.js +16 -0
- package/src/index.js +2 -0
package/package.json
CHANGED
package/src/commands/agent.js
CHANGED
|
@@ -421,6 +421,8 @@ export async function agentWalletCmd(options) {
|
|
|
421
421
|
console.log(` ETH: ${chalk.dim((wallet.balanceEth || "0.000000") + " ETH (gas)")}`);
|
|
422
422
|
console.log(` Status: ${wallet.status}`);
|
|
423
423
|
console.log();
|
|
424
|
+
console.log(chalk.dim(` Docs: https://clawcard.sh/docs#wallet`));
|
|
425
|
+
console.log();
|
|
424
426
|
return;
|
|
425
427
|
} catch (err) {
|
|
426
428
|
// No wallet — prompt to create
|
|
@@ -524,6 +526,15 @@ export async function agentWalletSendCmd(options) {
|
|
|
524
526
|
} else if (options.url) {
|
|
525
527
|
data.url = options.url;
|
|
526
528
|
if (options.protocol) data.protocol = options.protocol;
|
|
529
|
+
if (options.method) data.method = options.method;
|
|
530
|
+
if (options.body) {
|
|
531
|
+
try {
|
|
532
|
+
data.body = JSON.parse(options.body);
|
|
533
|
+
} catch {
|
|
534
|
+
console.log(" Error: --body must be valid JSON");
|
|
535
|
+
return;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
527
538
|
}
|
|
528
539
|
|
|
529
540
|
if (options.memo) data.memo = options.memo;
|
|
@@ -581,8 +592,13 @@ export async function agentWalletTransactionsCmd(options) {
|
|
|
581
592
|
const dir = t.type === "receive" ? chalk.green("←") : t.type === "send" ? chalk.blue("→") : chalk.yellow("⟳");
|
|
582
593
|
const date = new Date(t.createdAt).toLocaleString();
|
|
583
594
|
console.log(` ${dir} ${t.amountUsdc} USDC ${chalk.dim(t.counterparty || "")} ${chalk.dim(t.protocol)} ${chalk.dim(date)}`);
|
|
595
|
+
if (t.txHash) {
|
|
596
|
+
console.log(` ${chalk.dim("https://basescan.org/tx/" + t.txHash)}`);
|
|
597
|
+
}
|
|
584
598
|
}
|
|
585
599
|
console.log();
|
|
600
|
+
console.log(chalk.dim(` View full ledger: https://clawcard.sh/dashboard`));
|
|
601
|
+
console.log();
|
|
586
602
|
} catch (err) {
|
|
587
603
|
if (options.json) return output({ error: err.message }, true);
|
|
588
604
|
console.log(` Error: ${err.message}`);
|
package/src/index.js
CHANGED
|
@@ -231,6 +231,8 @@ agentWallet
|
|
|
231
231
|
.option("--amount <usdc>", "Amount in USDC (e.g., 5.00)")
|
|
232
232
|
.option("--url <url>", "URL to pay for access (x402 or MPP)")
|
|
233
233
|
.option("--protocol <protocol>", "Payment protocol: x402 (default) or mpp")
|
|
234
|
+
.option("--method <method>", "HTTP method for URL payments: GET (default) or POST")
|
|
235
|
+
.option("--body <json>", "JSON body for POST requests")
|
|
234
236
|
.option("--memo <memo>", "Optional memo")
|
|
235
237
|
.option("--json", "Output as JSON")
|
|
236
238
|
.action(async (options) => {
|