OpenZeppelin / OpenZeppelin/ui-builder
Enhance wallet gating to be adapter-led and chain-agnostic
Nobody has claimed this yet.
- 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.tsxdisables the button when!isWalletConnected.packages/renderer/src/components/TransactionForm.tsxaborts 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:
truefor safety when not implemented. - EVM adapter: returns
executionConfig.method === "eoa". - Stellar adapter: returns
executionConfig.method === "eoa" || (executionConfig.method === "relayer" && !!transactionOptions?.feeBump).
- Default:
-
Update renderer gating:
TransactionFormsubmission guard usesadapter.requiresConnectedWallet(executionConfig).TransactionExecuteButtondisabled 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
feeBumpis false; blocked whenfeeBumpis 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.cjskept 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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