OpenZeppelin / OpenZeppelin/ui-builder

Enhance wallet gating to be adapter-led and chain-agnostic

Open
#167 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement stellar
Dominant language
TypeScript
Stars
48
Forks
23
Avg merge
3h 1m
Merged PRs (30d)
10

Description

Enhance wallet gating to be adapter-led and chain-agnostic

Summary

Currently, the Builder UI blocks transaction execution if no wallet is connected, regardless of execution method. This is correct for EOA flows, but unnecessarily strict for relayer flows:

  • EVM relayer: does not require a connected wallet.
  • Stellar relayer: requires a wallet only when feeBump is enabled (inner tx signing); otherwise not required.

Problem

Two places enforce a hard wallet requirement:

  • packages/renderer/src/components/transaction/TransactionExecuteButton.tsx disables the button when !isWalletConnected.
  • packages/renderer/src/components/TransactionForm.tsx aborts submission when !isWalletConnected.

This breaks the principle of keeping chain-specific behavior within adapters and prevents valid relayer flows without a wallet.

Proposal

Introduce adapter-led runtime capability: let adapters indicate when a connected wallet is required for the current ExecutionConfig.

  • Add optional contract adapter method:

    • requiresConnectedWallet(executionConfig: ExecutionConfig): boolean
      • Default: true for safety when not implemented.
      • EVM adapter: returns executionConfig.method === "eoa".
      • Stellar adapter: returns executionConfig.method === "eoa" || (executionConfig.method === "relayer" && !!transactionOptions?.feeBump).
  • Update renderer gating:

    • TransactionForm submission guard uses adapter.requiresConnectedWallet(executionConfig).
    • TransactionExecuteButton disabled state uses the same boolean, passed down as a prop.
  • Keep existing relayer API key validation unchanged.

Acceptance Criteria

  • Executing via EVM relayer without wallet is allowed (with valid API key).
  • Executing via Stellar relayer without wallet is allowed when feeBump is false; blocked when feeBump is true.
  • Executing via EOA remains blocked without wallet.
  • No chain-specific logic lives in the renderer; decisions come from adapters.
  • Types package updated to include the optional method and lint rule @no-extra-adapter-methods.cjs kept in sync.

Notes

  • This preserves the chain-agnostic and adapter-led architecture.
  • Backward compatible: adapters not implementing the method default to current behavior (require wallet).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with packages/renderer/src/components/transaction/TransactionExecuteButton.tsx and packages/renderer/src/components/TransactionForm.tsx, then trace the adapter contract and the types package. Check how EVM and Stellar adapters expose execution configuration and how @no-extra-adapter-methods.cjs validates methods. Done means relayer and EOA wallet behavior matches the acceptance criteria without chain-specific logic in the renderer.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.