fix(wallet): direct-key + Arbitrum One mainnet payments#44
Merged
Nic-dorman merged 1 commit intomainfrom Apr 22, 2026
Merged
Conversation
Selecting "Arbitrum One (mainnet)" when importing a private key routed wagmi through the Anvil devnet branch with a null RPC URL, causing viem to reject every payment call with "No URL was provided to the Transport". Root cause: initDevnetWallet() only had Sepolia / Anvil branches, and getActiveChainId() hard-coded Anvil for the devnetActive && !isSepolia case. No code path actually implemented the mainnet direct-key flow. Replace the boolean devnetIsSepolia with devnetChainId (number | null) so the three modes — Anvil, Sepolia, Arbitrum One — are explicit. Route the mainnet case through a new arbitrum branch in initDevnetWallet() and hide the "DEVNET" sidebar badge when the direct-key target is mainnet. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
8 tasks
Nic-dorman
added a commit
that referenced
this pull request
Apr 22, 2026
Before the PR #44 rework, this comment was accurate — the dialog called getUploadQuote directly. After the rework, the dialog uses estimateFileCost and getUploadQuote is only reached via startRealUpload once the user has committed. Update the comment to match. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Nic-dorman
added a commit
that referenced
this pull request
Apr 22, 2026
…#47) * feat(upload): use ant-core estimate_upload_cost for pre-upload quotes Both the Estimate Cost top-bar button and the Upload dialog's pre-quote used to call start_upload (file_prepare_upload), which encrypts the whole file to a spill and parks a PreparedUpload in pending_uploads for 30 minutes. Every dialog open or estimate click paid that full cost even if the user cancelled, leaving hundreds of encrypted chunks in memory until the GC loop expired them. Switch both paths to the new estimate_upload_cost API (ant-core #44): samples a single network quote for a representative chunk and extrapolates total cost. No encryption-to-spill, no parked upload, no wallet required. Estimates now run in parallel too — each is independent, so multi-file dialog latency drops to the slowest sample. Confirm click still runs the real start_upload via startRealUpload, so the actual encryption + quote collection happens only when the user commits. Drop the preQuote handoff plumbing and the pendingQuotes map; startRealUpload's fresh-quote branch already does the right thing. Rename the 'quoting' status label to "Preparing upload..." since the heavy work now happens post-confirm. Drop utils/payment.ts::estimatePaymentGasCost — PR #44's gas heuristic replaces it. Its leftover GAS_* constants and getGasPrice import go with it. Bump ant-core pin f88c95d -> b0c501a (PR #44 merge). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(files): clarify getUploadQuote is internal to startRealUpload Before the PR #44 rework, this comment was accurate — the dialog called getUploadQuote directly. After the rework, the dialog uses estimateFileCost and getUploadQuote is only reached via startRealUpload once the user has committed. Update the comment to match. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
No URL was provided to the Transporterror. The code path fell into the Anvil branch with a null RPC URL.initDevnetWallet()and updatedgetActiveChainId()so the three direct-key modes (Anvil / Sepolia / Arbitrum One) are now explicit.devnetIsSepoliaboolean withdevnetChainId: number | nullacross 9 files. The sidebar "DEVNET" badge now hides for the mainnet direct-key case.Reporter workaround until this merges
Use WalletConnect for Arbitrum One. Only the Sepolia direct-key path was working before this PR.
Test plan
vitest— 21/21 pass (added coverage for mainnet direct-key + null fallback)nuxi typecheck— clean (pre-existing codegen-asset noise unchanged)Known follow-ups (out of scope)
arb1.arbitrum.io/rpcis rate-limited; no UI to override for mainnet direct-key. If users hit limits on large merkle uploads, add an RPC URL input next to the network dropdown.disconnectDirectWallet()doesn't cleardevnetActive/devnetChainId; pre-existing leak, worth a separate follow-up so a stale state can't strand the next session.🤖 Generated with Claude Code