Skip to main content

RebelfiError Class

All API errors are thrown as RebelfiError instances with structured information:

Properties

Checking Error Type

Use the .is() method to check for specific errors:

Error Codes

Validation Errors (4xx)

Business Logic Errors (4xx)

Proof of Control Errors

Returned by wallets.register({ proof }) and wallets.verify(). See Request Ownership Challenge. If the signature or the wallet’s balances can’t be checked with the chain right now, the API answers 503 (error.code is INTERNAL_ERROR). Nothing was written and the challenge stays usable: retry with the same proof.

Client Account Errors

For organizations that open client accounts.

Resource Errors (404)

Simulation Errors (4xx)

Authentication Errors (401/403)

See Authentication for allowlists and expiry.

Rate Limiting (429)

Network Errors

Error Details by Code

Many errors include a details object with structured context. Here are the fields returned for each error code:

Transaction Failure Codes

When a transaction fails, check the failureCode for details:

Error Handling Patterns

Comprehensive Handler

Retry with Backoff

Signing Deadline Handling

An operation must be signed and submitted before its expiresAt, five minutes after planning (on EVM, the supply after an approve gets a fresh five minutes once the approve is submitted). Planning never returns OPERATION_EXPIRED; getUnsignedTransactions() and submitSigned() do, once the deadline has passed. Plan again then: the expired plan holds no transaction, so the new plan expires it in place. If a submitSigned() failed with resubmitSameTransaction: true, or you reported a hash with submitHash(), the operation stays live after its deadline until RebelFi sees whether that transaction landed. Poll operations.get() until it leaves AWAITING_SIGNATURE before planning again; a plan meanwhile fails with OPERATION_IN_PROGRESS. If it becomes SUBMITTED or CONFIRMED, the transaction landed and there is nothing to plan again.
An EXPIRED (or CANCELLED) operation can still become CONFIRMED: if a transaction you signed for it reaches the chain after the deadline, RebelFi records it and alerts your organization. If you broadcast it yourself, report it with submitHash(), which is never refused for the deadline.

Next Steps

TypeScript Reference

Complete type definitions

API Reference

REST API documentation