feat(setup): show live Base USDC balance + OKX-specific fund walkthrough#9
Closed
KillerQueen-Z wants to merge 3 commits into
Closed
feat(setup): show live Base USDC balance + OKX-specific fund walkthrough#9KillerQueen-Z wants to merge 3 commits into
KillerQueen-Z wants to merge 3 commits into
Conversation
After eden's "show what chain to fund + how much" request. The PR #8 wallet-ready box hinted at funding but had no live balance check and no concrete OKX-side steps. Users still asked "do I actually need to fund?" and "where on OKX do I send from?". Changes: - Query Base-chain USDC balance via the existing BalanceMonitor right after OKX login completes (or right after detecting an existing session in the already-signed-in branch). Network/RPC failure is non-fatal — we render "could not query Base RPC" instead of aborting setup. - Add a balance row to the wallet-ready summary box, severity-tagged: empty (< $0.0001) → yellow ⚠ "fund to unlock paid models" low ($0.0001..$1) → yellow ⚠ "recommend $5+" ok (≥ $1) → green ✓ "ready for paid models" - Only render the funding walkthrough when balance is missing/empty/low. Already-funded users see a tight 6-line box; users that need money see the OKX-specific 3-step guide: Fund via OKX (Base network, USDC): 1. Open the OKX app → Wallet 2. Send USDC on Base to the address above 3. ~$5 covers thousands of paid requests Naming OKX explicitly + naming Base explicitly avoids users bridging to a wrong network (the recurring support footgun). - Lazy-import BalanceMonitor so the CLI doesn't pull viem until setup actually needs to query a balance.
fead5b0 to
c31a46d
Compare
- onchainos-adapter: `payment x402-pay` → `payment pay`. onchainos v3.3+
renamed the subcommand; OKX-wallet paid-model calls returned HTTP 500
("unrecognized subcommand 'x402-pay'") otherwise.
- cli: auto-switch the persisted payment chain to Base for OKX (EVM-only)
wallets, unless the user pinned a chain via XCLAWROUTER_PAYMENT_CHAIN.
- cli: force blocking stdout in non-TTY contexts so the Agentic Wallet status
block and funding hints flush under systemd / Docker / PM2 / pipes.
- cli: framed "Send USDC on Base" funding guidance for OKX wallets at $0 balance.
- extract the three startup behaviours into src/cli-startup.ts with unit tests.
- correct xai/grok-4-0709 pricing $0.20/$1.50 → $3.00/$15.00 (and move it from the Budget table to Premium, matching its real ~$0.0090/request). - standardize the free-model prefix nvidia/ → free/ (canonical catalog id) and the free-tier count to 10 across the README. - document 8 catalog models that were missing from the price tables (gpt-5.4-nano/mini, gemini-3.1-flash-lite, grok-4(.1)-fast-non-reasoning, grok-4.20-reasoning/non-reasoning/multi-agent), with features matched to the catalog flags. - unify the advertised model count to "60+" across README, CLI, CLAUDE.md and openclaw.plugin.json (64 real models; /v1/models lists more by design because it includes aliases).
Collaborator
Author
|
Superseded by #10 (rebuilt on current main / v0.12.190). Closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
PR #8 added a static `Fund / send USDC on Base` line in the wallet-ready box. Eden's follow-up: the user still didn't know whether they actually had to fund or where on OKX to send it from — they asked both questions after seeing the box.
What
When `xclawrouter setup` finishes (either freshly logged in OR already-signed-in path), query the OKX wallet's Base-chain USDC balance via the existing `BalanceMonitor`, then render a severity-tagged balance row + a concrete OKX-side funding walkthrough only when the user actually needs to fund.
Live demo output (empty wallet path):
```
┌──────────────────────────────────────────────────────────────────┐
│ ✓ Wallet ready │
│ │
│ EVM address │
│ 0xe34c9d531953a1c51164ecd943b5a6cb81d910f0 │
│ │
│ Email andy@blockrun.ai │
│ Signing OKX TEE (no local private key) │
│ │
│ Balance $0.00 USDC on Base ⚠ empty — fund to unlock paid models │
│ │
│ Fund via OKX (Base network, USDC): │
│ 1. Open the OKX app → Wallet │
│ 2. Send USDC on Base to the address above │
│ 3. ~$5 covers thousands of paid requests │
└──────────────────────────────────────────────────────────────────┘
```
When the wallet is funded (≥ $1), the line collapses to green `✓ ready for paid models` and the funding walkthrough is hidden — re-running `setup` on a healthy install stays tight.
Severity buckets
Resilience
Network or RPC failure is non-fatal — the box prints `(could not query Base RPC — check your network)` and the funding walkthrough still appears as a fallback.
`BalanceMonitor` is dynamic-imported so the CLI doesn't pull viem (heavy) until setup is actually run.
Test plan