feat: wire wallet_sendCalls approval flow end-to-end#2236
Closed
janek26 wants to merge 1 commit intographite-base/2236from
Closed
feat: wire wallet_sendCalls approval flow end-to-end#2236janek26 wants to merge 1 commit intographite-base/2236from
janek26 wants to merge 1 commit intographite-base/2236from
Conversation
Contributor
Author
This was referenced Mar 16, 2026
0a7e588 to
02a197b
Compare
105269e to
b357450
Compare
02a197b to
a5af766
Compare
b357450 to
f4d3ec4
Compare
9a187e5 to
11cfb16
Compare
f4d3ec4 to
0362aa5
Compare
b142359 to
edf1043
Compare
1b7bafe to
7648d8d
Compare
7648d8d to
d437e46
Compare
edf1043 to
96572f9
Compare
d437e46 to
b03d66d
Compare
c0f1c2b to
7e52d17
Compare
68f2cad to
7adfc78
Compare
7e52d17 to
921140f
Compare
7adfc78 to
1160ca8
Compare
921140f to
5c7007f
Compare
a19d7b4 to
09da1dc
Compare
8307322 to
6a782f5
Compare
09da1dc to
4f93fd5
Compare
6a782f5 to
801b74e
Compare
4f93fd5 to
0aad4b6
Compare
801b74e to
a1a841f
Compare
0aad4b6 to
aed41df
Compare
aed41df to
ecd42f0
Compare
717ec49 to
fa47824
Compare
ecd42f0 to
b576351
Compare
fa47824 to
eb4f795
Compare
c0da740 to
a79d96d
Compare
eb4f795 to
61971a1
Compare
DanielSinclair
approved these changes
Mar 20, 2026
| }} | ||
| chainId={activeSession?.chainId || ChainId.mainnet} | ||
| address={activeSession?.address} | ||
| transactionRequest={request?.params?.[0] as TransactionRequest} |
Collaborator
There was a problem hiding this comment.
This is a SendCallsParams; was getTransactionRequestFromRequest missed here?
- [P1] Estimate wallet_sendCalls fees from the batch, not params[0] — /Users/daniel/Documents/GitHub/
browser-extension/src/entries/popup/pages/messages/SendTransaction/index.tsx:301-303
When this page is opened for wallet_sendCalls, request.params[0] is a SendCallsParams object, not a
TransactionRequest. Passing it straight into TransactionFee means useEstimateGasLimit sees no to/
data/value fields and falls back to the default transfer estimate, so every batch approval shows a
misleading fee; for cross-chain batches it also reads gas data from activeSession?.chainId instead of
the requested batch chain. Because executeSendCallsBatch later reuses
selectedGas.transactionGasParams, this can also break execution when the batch targets a different
network than the current session.
- [P2] Use the batch chain when rendering and gating sendCalls approvals — /Users/daniel/Documents/
GitHub/browser-extension/src/entries/popup/pages/messages/SendTransaction/
SendTransactionsInfo.tsx:751-753
Routing wallet_sendCalls through TransactionInfo here still leaves the approval sheet tied to
activeSession.chainId: TransactionInfo simulates the request on the session chain, and the same file
uses useHasEnoughGas(activeSession) to decide whether to block approval for insufficient gas. Since
the provider accepts an explicit sendParams.chainId that can differ from the connected network,
cross-chain batches will show the wrong network/simulation and can be incorrectly blocked or allowed
based on another chain's native balance.
61971a1 to
ddacaad
Compare
a79d96d to
205c521
Compare
ddacaad to
77f88d3
Compare
205c521 to
c6a9063
Compare
9ed0fb5 to
c6402cf
Compare
fix: accept readonly calls array in sendCalls contract schema `SendCallsParams.calls` is now `readonly` (from viem's `WalletSendCallsParameters`). Add `.readonly()` to the Zod schema so the contract accepts readonly arrays without requiring a spread copy at the call site.
c6a9063 to
3fa9cc0
Compare
DanielSinclair
pushed a commit
that referenced
this pull request
Mar 20, 2026
…ound execution (#2254) This PR aims to replace these 3 from the stack #2236 #2237 #2238 All of them had one common issue pointed out by Daniel in the review, I tried to generalise the sendTransaction interface into working with transaction request arrays, and transform normal sendTransaction requests into a transaction request array of length one. This resulted in multiple issues: 1. transaction requests through sendTransaction and sendCalls with calls length of one would simulate the same 2. If not delegated yet, the delegation would not be simulated, and results would not be verified 3. Serial gas estimation does not represent actual gas costs 1. `est(call1)+est(call2)+est(call3) !== est(call1+call2+call3)` This PR aims to use what's in place instead of forcing everything into a new array format. Instead we're reusing the existing format of having a single transaction request. That"s possible by wrapping calls with `prepareBatchedTransaction` from the delegation sdk. <!-- start pr-codex --> --- ## PR-Codex overview This PR introduces support for the `wallet_sendCalls` method, enhancing batch transaction capabilities. It includes new schemas, hooks, and UI components for better handling of batch requests and transactions, improving error handling and user feedback. ### Detailed summary - Added support for `wallet_sendCalls` in `ApproveAppRequest.tsx`. - Introduced `executeSendCallsBatch` handler and contract. - Created schemas for batch call parameters and execution. - Updated gas estimation logic to accommodate batch transactions. - Enhanced UI components to display batch transaction details and simulation results. - Improved error handling and user notifications for batch requests. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
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.

Wire wallet_sendCalls approval flow end-to-end
After this PR, a dapp can call
wallet_sendCallsand the user sees the existing SendTransaction approval screen with batch-aware UI. Approving executes the batch via delegation, stores the batch record, and returns the batch ID to the dapp.What's included
executeSendCallsBatchprocedure callable from the popup viapopupClient.wallet.executeSendCallsBatch.setBatchandgetBatchByKeywired intohandleProviderRequestwith boundary validation. The provider can now store and retrieve batch records.wallet_sendCallsis added as a case inApproveAppRequest, reusing theSendTransactionscreen.onAcceptRequest– Detects batch requests viaisWalletSendCallsRequest, calls the oRPC handler, and returns the batch ID on success.batch_request_title,batch_call_label,batch_of_calls,batch_fee_note,batch_request_chain_unknown.Design choices & review focus
TransactionFeecomponent still receives a single transaction request at this point. Proper multi-call gas estimation is added in a later PR. This is good enough as a first pass since the delegation SDK handles gas internally.txRequestcast removed – The unsaferequest?.params?.[0] as TransactionRequestcast is replaced withgetTransactionRequestFromRequest(request)which handles both request types safely.PR-Codex overview
This PR introduces support for batch processing of wallet send calls in the application. It adds new schemas, handlers, and UI components to accommodate the functionality, enhancing the transaction approval process.
Detailed summary
wallet_sendCallsinApproveAppRequest.tsx.executeSendCallsBatchHandlerandexecuteSendCallsBatchContract.executeSendCallsBatch.ts.handleProviderRequestto manage batch requests.SendTransactionandSendTransactionInfoto handle batch requests and display appropriate UI elements.