From 835abde3f23fec95a0fc38914b96cf0e8d95a6ac Mon Sep 17 00:00:00 2001 From: Nic-dorman Date: Tue, 21 Apr 2026 21:23:11 +0100 Subject: [PATCH] fix(wallet): direct-key + Arbitrum One mainnet payments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- app.vue | 6 ++- components/AppSidebar.vue | 12 ++++-- composables/useDevnetWallet.ts | 66 +++++++++++++++++++++---------- pages/settings.vue | 5 ++- pages/wallet.vue | 3 +- stores/settings.ts | 18 +++++++-- tests/stores/settings.test.ts | 4 +- tests/utils/wallet-config.test.ts | 18 ++++++++- utils/wallet-config.ts | 10 ++--- 9 files changed, 101 insertions(+), 41 deletions(-) diff --git a/app.vue b/app.vue index f876cbf..e68920e 100644 --- a/app.vue +++ b/app.vue @@ -52,8 +52,10 @@ onMounted(async () => { console.warn('Autonomi client init failed:', e) }) - // Only bypass WalletConnect for local Anvil devnet, not Sepolia - if (!settingsStore.devnetIsSepolia) { + // Only bypass WalletConnect for local Anvil devnet. Sepolia / mainnet + // manifests expect the user to connect their own wallet via WalletConnect. + const { ANVIL_CHAIN_ID } = await import('~/utils/constants') + if (settingsStore.devnetChainId === ANVIL_CHAIN_ID) { const { initDevnetWallet } = await import('~/composables/useDevnetWallet') initDevnetWallet() } diff --git a/components/AppSidebar.vue b/components/AppSidebar.vue index 3748127..816a634 100644 --- a/components/AppSidebar.vue +++ b/components/AppSidebar.vue @@ -10,7 +10,7 @@