clawmoney 0.15.40 → 0.15.41
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/dist/commands/wallet.js +8 -3
- package/package.json +1 -1
package/dist/commands/wallet.js
CHANGED
|
@@ -168,14 +168,19 @@ export async function walletBalanceCommand() {
|
|
|
168
168
|
console.log(` ${chalk.yellow('unavailable')} ${chalk.dim('(' + (onchainError ?? 'unknown') + ')')}`);
|
|
169
169
|
}
|
|
170
170
|
console.log('');
|
|
171
|
-
console.log(chalk.bold(' Relay
|
|
171
|
+
console.log(chalk.bold(' Pending payout (Relay)'));
|
|
172
172
|
if (relayRows && relayRows.length > 0) {
|
|
173
|
+
// "Earned lifetime" is vanity — the only thing that matters for
|
|
174
|
+
// the wallet view is: how much is already in the on-chain wallet
|
|
175
|
+
// (shown above as USDC), and how much is still owed to the user
|
|
176
|
+
// (pending = earned - withdrawn). Those two numbers together
|
|
177
|
+
// tell the full story; showing "earned" separately would double-
|
|
178
|
+
// count the wallet USDC that came from relay payouts.
|
|
173
179
|
const earned = relayRows.reduce((s, p) => s + (p.total_earned_usd ?? 0), 0);
|
|
174
180
|
const withdrawn = relayRows.reduce((s, p) => s + (p.total_withdrawn_usd ?? 0), 0);
|
|
175
181
|
const pending = Math.max(0, earned - withdrawn);
|
|
176
182
|
const requests = relayRows.reduce((s, p) => s + (p.total_requests ?? 0), 0);
|
|
177
|
-
console.log(` ${chalk.dim('
|
|
178
|
-
console.log(` ${chalk.dim('Pending payout:').padEnd(22)} ${chalk.green('$' + pending.toFixed(2))}`);
|
|
183
|
+
console.log(` ${chalk.dim('Amount:').padEnd(22)} ${chalk.green('$' + pending.toFixed(2))}`);
|
|
179
184
|
console.log(chalk.dim(` (${relayRows.length} provider${relayRows.length === 1 ? "" : "s"} · ${requests} request${requests === 1 ? "" : "s"} served)`));
|
|
180
185
|
}
|
|
181
186
|
else if (relayRows && relayRows.length === 0) {
|