@clawcard/cli 3.0.15 → 3.0.18
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 +23 -5
package/package.json
CHANGED
package/src/commands/agent.js
CHANGED
|
@@ -534,11 +534,24 @@ export async function agentWalletSendCmd(options) {
|
|
|
534
534
|
|
|
535
535
|
if (result.success) {
|
|
536
536
|
console.log();
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
console.log(
|
|
537
|
+
if (result.protocol === "x402" || result.protocol === "mpp") {
|
|
538
|
+
console.log(` ${chalk.green("Paid!")} ${result.amountUsdc || "?"} USDC via ${result.protocol}`);
|
|
539
|
+
console.log(` URL: ${chalk.dim(result.url)}`);
|
|
540
|
+
console.log(` TX: ${chalk.dim(result.txHash)}`);
|
|
541
|
+
console.log();
|
|
542
|
+
if (result.data) {
|
|
543
|
+
console.log(` ${orange("Response:")}`);
|
|
544
|
+
try {
|
|
545
|
+
const parsed = JSON.parse(result.data);
|
|
546
|
+
console.log(JSON.stringify(parsed, null, 2));
|
|
547
|
+
} catch {
|
|
548
|
+
console.log(result.data.slice(0, 2000));
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
} else {
|
|
552
|
+
console.log(` ${chalk.green("Sent!")} ${result.amountUsdc} USDC → ${result.to}`);
|
|
553
|
+
console.log(` TX: ${chalk.dim(result.txHash)}`);
|
|
554
|
+
console.log(` Protocol: ${result.protocol}`);
|
|
542
555
|
}
|
|
543
556
|
console.log();
|
|
544
557
|
} else {
|
|
@@ -568,8 +581,13 @@ export async function agentWalletTransactionsCmd(options) {
|
|
|
568
581
|
const dir = t.type === "receive" ? chalk.green("←") : t.type === "send" ? chalk.blue("→") : chalk.yellow("⟳");
|
|
569
582
|
const date = new Date(t.createdAt).toLocaleString();
|
|
570
583
|
console.log(` ${dir} ${t.amountUsdc} USDC ${chalk.dim(t.counterparty || "")} ${chalk.dim(t.protocol)} ${chalk.dim(date)}`);
|
|
584
|
+
if (t.txHash) {
|
|
585
|
+
console.log(` ${chalk.dim("https://basescan.org/tx/" + t.txHash)}`);
|
|
586
|
+
}
|
|
571
587
|
}
|
|
572
588
|
console.log();
|
|
589
|
+
console.log(chalk.dim(` View full ledger: https://clawcard.sh/dashboard`));
|
|
590
|
+
console.log();
|
|
573
591
|
} catch (err) {
|
|
574
592
|
if (options.json) return output({ error: err.message }, true);
|
|
575
593
|
console.log(` Error: ${err.message}`);
|