Skip to content

fix: use sendCalls for smart wallets without traditional wallet client#271

Open
gravenp wants to merge 1 commit intomainfrom
fix/base-account-transactions
Open

fix: use sendCalls for smart wallets without traditional wallet client#271
gravenp wants to merge 1 commit intomainfrom
fix/base-account-transactions

Conversation

@gravenp
Copy link
Copy Markdown
Member

@gravenp gravenp commented Apr 4, 2026

Summary

  • Base Account (Coinbase Smart Wallet) transactions were failing with "Wallet not connected" because useWalletClient() returns undefined for EIP-5792 wallets and useCapabilities() returns empty capabilities due to a gap in @base-org/account@2.4.0
  • Falls back to sendCallsSyncAsync (EIP-5792 wallet_sendCalls) whenever walletClient is absent, fixing both single and batched transactions for smart wallets

Test plan

  • Connect with Base Account on a flow guild page
  • Open a stream (2 transactions: wrap + flow) and verify the batch submits via the Coinbase popup
  • Verify traditional wallets (MetaMask, WalletConnect) still work with sequential execution

🤖 Generated with Claude Code

…lient

Base Account (Coinbase Smart Wallet) uses EIP-5792 wallet_sendCalls
instead of eth_sendTransaction, so useWalletClient() returns undefined.
The @base-org/account SDK also doesn't properly populate
wallet_getCapabilities, causing isBatchSupported to be false. This
resulted in a "Wallet not connected" error on transaction submission.

Fall back to sendCallsSyncAsync whenever walletClient is absent, since
EIP-5792 wallets support wallet_sendCalls for both single and batched
transactions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gravenp gravenp requested a review from tnrdd April 4, 2026 01:25
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
platform Ready Ready Preview, Comment Apr 4, 2026 1:27am

Request Review

Copy link
Copy Markdown

@gaston-review gaston-review bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved

Score: ███████░░░ 7/10


Small, targeted fix for smart wallets that lack a traditional walletClient (e.g. account-abstraction wallets). The core logic is sound: when there's no walletClient, route through sendCallsSyncAsync instead of trying to call walletClient.sendTransaction, which would fail.

Two things worth noting:

  1. isBatchSupported is now semantically overloaded — it's true when there's no wallet client, not just when atomic batching is supported. This works in practice for all current consumers but will confuse future readers.

  2. The removal of the calls.length > 1 guard is an unrelated behavioral change: even EOA wallets with batch support now use sendCalls for single transactions. Probably fine, but it wasn't called out in the PR description.


📌 2 inline comments


🔍 Reviewed by Gaston · Model: claude-opus-4-6


const isBatchSupported = !!capabilities?.[chainId]?.atomicBatch?.supported;
const isBatchSupported =
!!capabilities?.[chainId]?.atomicBatch?.supported || !walletClient;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semantic concern: isBatchSupported now means "batch is supported OR there's no wallet client." This variable is exported and consumed by ~10 UI components to decide whether to show sequential-transaction warnings (!isBatchSupported && calls.length > 1). It happens to work correctly — smart wallets without a walletClient won't show the warning — but the name no longer describes what it computes. Consider renaming to useSendCalls or splitting into two flags to keep intent clear.

let receipts: TransactionReceipt[];

if (isBatchSupported && calls.length > 1) {
if (isBatchSupported || !walletClient) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The calls.length > 1 guard was removed. Previously, EOA wallets with batch support still used sendTransaction for single calls; now they go through sendCallsSyncAsync for everything. This is a behavioral change beyond the stated fix. Likely harmless (sendCalls with one call should work fine), but worth confirming this was intentional and not an accidental side effect.

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