refactor(wallet): route browser-wallet writes through the SDK - #388
Conversation
…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.
|
/run-e2e tooling v0.6 dev-env |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
/run-e2e tooling v0.6 dev-env |
Collapses the staking/vesting browser-wallet write lanes onto the same genlayer-js client calls as the keystore lane (enabled by the provider-aware
executeWritein genlayer-js#200), and deletes the hand-rolledtxBuilders.ts+stakingTx.ts. Per-tx bridge labels preserved viasession.setNextLabel; preflight/bridge UX intact; keystore lane +account senduntouched.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