Skip to content

refactor(wallet): route browser-wallet writes through the SDK - #388

Merged
MuncleUscles merged 2 commits into
v0.40-devfrom
feat/cli-route-browser-writes-through-sdk
Jul 10, 2026
Merged

refactor(wallet): route browser-wallet writes through the SDK#388
MuncleUscles merged 2 commits into
v0.40-devfrom
feat/cli-route-browser-writes-through-sdk

Conversation

@MuncleUscles

@MuncleUscles MuncleUscles commented Jul 9, 2026

Copy link
Copy Markdown
Member

Collapses the staking/vesting browser-wallet write lanes onto the same genlayer-js client calls as the keystore lane (enabled by the provider-aware executeWrite in genlayer-js#200), and deletes the hand-rolled txBuilders.ts + stakingTx.ts. Per-tx bridge labels preserved via session.setNextLabel; preflight/bridge UX intact; keystore lane + account send untouched.

Verified locally: 770 unit tests + the Playwright browser e2e (bridge→provider→SDK sign+mine) green.

Do not merge before genlayer-js#200.

Depends-On: genlayerlabs/genlayer-js#200
Depends-On: genlayerlabs/genlayer-consensus#1179

…xBuilders

Collapse the staking/vesting browser-wallet write lanes onto the same
genlayer-js client calls as the keystore lane, now that the SDK's
executeWrite handles an Address-only (provider) account by routing
eth_sendTransaction through the injected EIP-1193 provider.

Each browser branch builds a provider-bound client
(getBrowserStakingClient / getBrowserVestingClient / the wizard's
getWizardVestingBrowserClient) and calls client.<method>(...) exactly
like the keystore lane, replacing the per-command buildTx(...) +
session.sendTransaction(rawTx) reimplementation. The hand-rolled
calldata layer (txBuilders.ts + the stakingTx.ts shim) is deleted;
validatorJoin's SDK path already decodes the ValidatorJoin event and
returns validatorWallet for both lanes.

Per-tx bridge labels are preserved via session.setNextLabel(label)
before each SDK call (consumed by the EIP-1193 shim for the next
eth_sendTransaction). The SDK now preflight-simulates and throws before
eth_sendTransaction, so the command's failSpinner + session.close()
(no-op for a shared daemon) surfaces reverts cleanly and keeps the
bridge usable; no doubled preflight.
@MuncleUscles

Copy link
Copy Markdown
Member Author

/run-e2e tooling v0.6 dev-env

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4a5130f5-9bce-41bb-a58a-ee1c691d841f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cli-route-browser-writes-through-sdk

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@MuncleUscles

Copy link
Copy Markdown
Member Author

/run-e2e tooling v0.6 dev-env

@MuncleUscles
MuncleUscles merged commit e35a57d into v0.40-dev Jul 10, 2026
9 of 10 checks passed
@MuncleUscles
MuncleUscles deleted the feat/cli-route-browser-writes-through-sdk branch July 10, 2026 08:19
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