Skip to content

feat(wallet): Solana onramp + Solana as the default chain - #131

Merged
VickyXAI merged 2 commits into
mainfrom
feat/solana-onramp-default
Aug 26, 2026
Merged

feat(wallet): Solana onramp + Solana as the default chain#131
VickyXAI merged 2 commits into
mainfrom
feat/solana-onramp-default

Conversation

@VickyXAI

Copy link
Copy Markdown
Contributor

Summary

Counterpart to blockrun-sol#198: the Solana gateway can now mint Coinbase Onramp session links, so Franklin unlocks card funding on Solana and flips the default chain to Solana.

Onramp on both chains

  • src/onramp/client.ts — drops the Base-only guard; targets API_URLS[activeChain] and passes network: chain. postWithPayment already signs the $0 x402 authentication with the active chain's wallet on both chains. A 404 from a gateway that hasn't shipped the route yet (gateway deploys are manual) surfaces as "Onramp is not available on the gateway yet" instead of a bare status.
  • src/panel/server.tsPOST /api/wallet/onramp drops the chain gate and reuses currentWalletAddress() (chain-aware).
  • src/panel/html.ts — the Buy-USDC button stays visible on Solana; hint no longer says "Base only".

Solana as default

  • src/config.tsloadChain() with no explicit choice resolves to solana, with one migration exception: a Base wallet (.session) with no Solana wallet means the user funded before the flip — they stay on base so USDC is never silently stranded on an inactive chain. Pure read (the help/version no-mutation invariants hold); RUNCODE_CHAIN and the saved payment-chain file still win.
  • src/commands/setup.tsfranklin setup now defaults to Solana; franklin setup base opts into Base.

Tests

New test/local.mjs case pins the default-resolution matrix: fresh install → solana; lone legacy Base wallet → base; both wallets → solana; explicit saved choice always wins. Full suite: 648/648 pass, build clean.

Sequencing

Safe to merge before the gateway ships blockrun-sol#198 — until then the panel button on Solana shows the clear not-available-yet message rather than an error.

1bcMax added 2 commits August 25, 2026 14:31
Onramp was Base-only in three places (client guard, panel route gate,
panel UI hide). The Solana gateway now mints Coinbase Onramp session
links too (blockrun-sol#198), so all three gates are removed and the
client targets the active chain's gateway — postWithPayment already
signs the $0 x402 auth with the right wallet on both chains. A 404
from a gateway that hasn't shipped the route yet is named clearly
instead of surfacing as a bare status.

Default chain flips to Solana:
- loadChain() with no saved choice now resolves to solana, with one
  exception — a Base wallet with no Solana wallet (a user funded
  before the flip) stays on base, so their USDC is never silently
  stranded on an inactive chain. Pure read, no side-effect writes.
- franklin setup with no argument now creates a Solana wallet
  (franklin setup base opts into Base).
- RUNCODE_CHAIN and the saved payment-chain file still win over the
  heuristic, unchanged.
Found in headless e2e: after minting a Base Coinbase link (popup-blocked
fallback shown), switching to Solana left the stale Base link on screen —
clicking it would fund the wrong chain's wallet. The chain switcher now
clears the onramp status line before switching.
@VickyXAI
VickyXAI merged commit 970a111 into main Aug 26, 2026
3 checks passed
@VickyXAI
VickyXAI deleted the feat/solana-onramp-default branch August 26, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant