feat(wallet): Solana onramp + Solana as the default chain - #131
Merged
Conversation
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.
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.
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; targetsAPI_URLS[activeChain]and passesnetwork: chain.postWithPaymentalready 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.ts—POST /api/wallet/onrampdrops the chain gate and reusescurrentWalletAddress()(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.ts—loadChain()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 onbaseso USDC is never silently stranded on an inactive chain. Pure read (the help/version no-mutation invariants hold);RUNCODE_CHAINand the savedpayment-chainfile still win.src/commands/setup.ts—franklin setupnow defaults to Solana;franklin setup baseopts into Base.Tests
New
test/local.mjscase 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.