coinbase / coinbase/onchainkit

Feature Request: add a unified `TransactionFlow` component (simulate → sponsor → send → track) for a complete onchain UX

Open
#2,561 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1k
Forks
520
Avg merge
32m
Merged PRs (30d)
2

Description

### Describe the solution you'd like

OnchainKit provides powerful building blocks (provider config, transaction-related components, sponsorship via paymaster, token data, etc.), but developers still have to stitch together a full “transaction lifecycle” experience themselves: simulation, gas/sponsorship decisioning, submission, error recovery, and status tracking.

This issue proposes a first-class, composable feature: a `TransactionFlow` component + hooks that orchestrate the entire lifecycle in a consistent way, while remaining framework-friendly and customizable.

### Describe alternatives you've considered.

## Proposed Feature
### 1) `` React component
A composable component that renders a default UI (or accepts render props) to guide users through:
1. **Prepare**: validate input + wallet state, ensure correct chain
2. **Simulate**: estimate gas / validate call data, surface revert reasons
3. **Sponsor (optional)**: if paymaster configured, request sponsorship eligibility & quote
4. **Send**: submit the tx (sponsored or standard)
5. **Track**: confirm status, show receipt + explorer links, allow retry on failure

### 2) `useTransactionFlow()` hook
Expose a state machine API for fully custom UIs:
- `state`: `idle | preparing | simulating | sponsoring | awaiting_signature | submitting | pending | success | error`
- actions: `prepare()`, `simulate()`, `requestSponsorship()`, `submit()`, `reset()`
- outputs: `simulation`, `feeQuote`, `txHash`, `receipt`, `error`

### 3) Integration with `OnchainKitProvider` config
- Uses provider config (wallet/appearance) automatically.
- If paymaster config is present, can attempt sponsorship.
- If API key is required for certain services, the feature should surface a clear “missing configuration” error early.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.