Skip to content

Conversation

ultraviolet10
Copy link
Contributor

@ultraviolet10 ultraviolet10 commented Mar 14, 2025

Linked Issues

  • closes #XXX
  • closes

Description

Implemented support for the wallet_sendCalls method (EIP-5792) in the wallet iframe. This allows dApps to request transaction execution through a standardized interface.

Key changes:

  • Added a new component WalletSendCalls.tsx to render transaction confirmation UI
  • Implemented validation logic for wallet_sendCalls parameters
  • Added capability validation for supported features (currently only boopPaymaster)
  • Limited implementation to support only single-call batches (no atomicity)
  • Connected the new method to the existing boop transaction system
  • Updated request handlers and UI routes to support the new method
Toggle Checklist

Checklist

Basics

  • B1. I have applied the proper label & proper branch name (e.g. norswap/build-system-caching).
  • B2. This PR is not so big that it should be split & addresses only one concern.
  • B3. The PR targets the lowest branch it can (ideally master).

Reminder: PR review guidelines

Correctness

  • C1. Builds and passes tests.
  • C2. The code is properly parameterized & compatible with different environments (e.g. local,
    testnet, mainnet, standalone wallet, ...).
  • C3. I have manually tested my changes & connected features.

< INDICATE BROWSER, DEMO APP & OTHER ENV DETAILS USED FOR TESTING HERE >

< INDICATE TESTED SCENARIOS (USER INTERFACE INTERACTION, CODE FLOWS) HERE >

  • C4. I have performed a thorough self-review of my code after submitting the PR,
    and have updated the code & comments accordingly.

Architecture & Documentation

  • D1. I made it easy to reason locally about the code, by (1) using proper abstraction boundaries,
    (2) commenting these boundaries correctly, (3) adding inline comments for context when needed.
  • D2. All public-facing APIs & meaningful (non-local) internal APIs are properly documented in code
    comments.
  • D3. If appropriate, the general architecture of the code is documented in a code comment or
    in a Markdown document.
  • D4. An appropriate Changeset has been generated (and committed) for changes that touch npm published packages (currently pacakges/core and packages/react), see here for more info.

@ultraviolet10 ultraviolet10 mentioned this pull request Mar 14, 2025
11 tasks
Copy link
Contributor Author

ultraviolet10 commented Mar 14, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ultraviolet10 ultraviolet10 marked this pull request as ready for review March 14, 2025 15:23
@ultraviolet10 ultraviolet10 force-pushed the aritra/5792_get_capabilities branch from fcdfc53 to 3f44845 Compare March 15, 2025 09:59
@ultraviolet10 ultraviolet10 force-pushed the aritra/5792_wallet_sendCalls branch from 6c14029 to 0fbd8ca Compare March 15, 2025 09:59
Copy link

cloudflare-workers-and-pages bot commented Mar 15, 2025

Deploying happychain with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9ed7446
Status: ✅  Deploy successful!
Preview URL: https://05e4905d.happychain.pages.dev
Branch Preview URL: https://aritra-5792-wallet-sendcalls.happychain.pages.dev

View logs

@ultraviolet10 ultraviolet10 force-pushed the aritra/5792_wallet_sendCalls branch from 0fbd8ca to e08e6e4 Compare March 20, 2025 11:06
@ultraviolet10 ultraviolet10 force-pushed the aritra/5792_get_capabilities branch 2 times, most recently from 11ef2c8 to 7502930 Compare March 24, 2025 12:15
@ultraviolet10 ultraviolet10 force-pushed the aritra/5792_wallet_sendCalls branch from e08e6e4 to e2b48e4 Compare March 24, 2025 12:15
@ultraviolet10 ultraviolet10 added the updating Updating after review label Apr 24, 2025
@ultraviolet10 ultraviolet10 force-pushed the aritra/5792_wallet_sendCalls branch from e2b48e4 to 0cd1436 Compare April 28, 2025 12:05
@ultraviolet10 ultraviolet10 force-pushed the aritra/5792_get_capabilities branch from 7502930 to 06f22f5 Compare April 28, 2025 12:05
@ultraviolet10 ultraviolet10 force-pushed the aritra/5792_wallet_sendCalls branch from 0cd1436 to cf1850c Compare April 28, 2025 12:17
@ultraviolet10 ultraviolet10 changed the base branch from aritra/5792_get_capabilities to graphite-base/526 May 9, 2025 11:03
@ultraviolet10 ultraviolet10 force-pushed the aritra/5792_wallet_sendCalls branch from cf1850c to cb66b67 Compare May 12, 2025 19:19
@ultraviolet10 ultraviolet10 changed the base branch from graphite-base/526 to aritra/5792_get_capabilities May 12, 2025 19:19
@ultraviolet10 ultraviolet10 added reviewing-1 Ready for, or undergoing first-line review and removed updating Updating after review labels May 12, 2025
@ultraviolet10
Copy link
Contributor Author

some code reorg is needed 😅

} from "./common/Layout"
import type { RequestConfirmationProps } from "./props"

export function getFirstParam<T>(params: [T] | undefined): T | undefined {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export function getFirstParam<T>(params: [T] | undefined): T | undefined {
export function getFirstParam<T>(params: [T, ...unknown[]] | undefined): T | undefined {

makes it a tad smarter
image
image

vs currently it fails if 'params' has more than one item
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should probs move this to wallet-common?

@@ -65,6 +72,24 @@ export async function dispatchApprovedRequest(request: PopupMsgs[Msgs.PopupAppro
return addWatchedAsset(user.address, request.payload.params)
}

case "wallet_sendCalls": {
Copy link
Contributor

Choose a reason for hiding this comment

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

does this need to be in injected as well?

bun.lock Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

don't delete this

bun.lockb Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

delete this

"react": "^18.3.1",
"react-dom": "^18.3.1",
"sonner": "^1.7.2",
"vaul": "^1.1.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

i think these changes aren't used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed it, was testing something w/ it :)

@ultraviolet10 ultraviolet10 changed the base branch from aritra/5792_get_capabilities to graphite-base/526 May 22, 2025 12:42
@ultraviolet10 ultraviolet10 changed the title feat: implement wallet_sendCalls request handler feat: implement wallet_sendCalls request handler May 22, 2025
@ultraviolet10 ultraviolet10 force-pushed the aritra/5792_wallet_sendCalls branch from cb66b67 to a8d3bf0 Compare May 22, 2025 13:42
@ultraviolet10 ultraviolet10 changed the base branch from graphite-base/526 to aritra/5792_get_capabilities May 22, 2025 13:42
type WalletSendCallsParams = WalletSendCallsParameters<BoopPaymasterCapability, Hex, Hex | bigint>

// cf.
export function checkedWalletSendCallsParams(params: WalletSendCallsParams | undefined): ValidWalletSendCallsRequest {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

combed through this list to identify all the necessary errors to be thrown for accuracy

Screenshot 2025-05-22 at 7 19 11 PM

@ultraviolet10 ultraviolet10 changed the base branch from aritra/5792_get_capabilities to graphite-base/526 May 29, 2025 07:09
@ultraviolet10 ultraviolet10 force-pushed the aritra/5792_wallet_sendCalls branch from a8d3bf0 to 9ed7446 Compare May 29, 2025 07:34
@ultraviolet10 ultraviolet10 changed the base branch from graphite-base/526 to aritra/5792_get_capabilities May 29, 2025 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-post-testnet reviewing-1 Ready for, or undergoing first-line review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants