coinbase / coinbase/onchainkit

Bug: Failed transactions don’t return consistent structured errors

Open
#2,572 3 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 bug and the steps to reproduce it

When an on-chain transaction fails (e.g., user rejects the transaction, insufficient funds, or a revert occurs), OnchainKit does not always return a consistent, structured error object to the caller. In some cases, the error is only logged to the console or returned in a non-descriptive form that lacks clear error codes or context, making programmatic handling and UI feedback difficult.
Steps to reproduce:
1. Integrate OnchainKit in a project with a transaction submission flow.
2. Connect a wallet using the provided wallet components.
3. Trigger a transaction that is expected to fail (e.g., send with insufficient balance or cause a revert).
4. Inspect the error seen in the app code (e.g., via `try/catch` or error handler).
5. Notice that the error is generic or lacks structured details.

### What's the expected behavior?

OnchainKit should consistently return structured, descriptive errors for all transaction failure cases. Errors should include meaningful fields such as error type, failure reason, and relevant context so that applications can handle them programmatically and provide appropriate feedback to users.

### What version of the libraries are you using?

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the transaction submission flow and provided wallet components described in the reproduction steps, then trace how failures reach the app's try/catch or error handler. Compare rejection, insufficient-funds, and revert failures, and verify that each returns descriptive structured details suitable for programmatic handling and UI feedback.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.