The Error Envelope
Non-2xx responses always return this object:error is a human-readable message, code is the stable machine-readable identifier to branch on, and details carries field-level messages on validation failures and is null otherwise.
API Error Codes
claims.statuses avoids the problem entirely: campaigns without a published root report claimable: 0n instead of erroring.
The same applies to referrals.proof: it 404s until the campaign has finalized and its referral root is published, which is the normal state for every live campaign.
Referral Bind Codes
POST /v1/referrals/bind (tbi.referrals.bind and submitBind) has its own rejection codes. The SDK raises them as TbiApiError, so branch on error.code.
Re-submitting the exact same bind is not an error: it resolves with
created: false. None of these codes should block a deposit. See Add Referrals for a worked handler.
The error-code set grows additively. Two more bind codes exist that the SDK never triggers:
REFERRER_NOT_FOUND (404) when a raw REST bind sends a referrerUsername no account has claimed, and INVALID_SESSION (401) for Rabbithole’s own session-authenticated binds. Treat any code you do not recognise as a generic error.SDK Error Classes
All SDK errors extendTbiError and carry a code.
Branch on the class, not the message:
Wallet write failures are not wrapped. A user rejecting the transaction, an out-of-gas error, or a contract revert propagates straight from your wallet client, so you can surface the wallet’s own message. See Contracts for the revert selectors.
What Retries Automatically
The SDK retries network errors, HTTP 429, and HTTP 5xx with exponential backoff ofbaseDelayMs * 2^(attempt - 1), defaulting to 3 total attempts and a 200 ms base. Other 4xx responses and aborted requests are never retried, because retrying them cannot succeed.
AbortSignal on any read method to cancel in-flight requests. A cancelled request is never retried:
Contract Reverts
Once a claim transaction is submitted, failures come from the TBI Manager contract rather than the API.Revert Selectors
InvalidProof, NothingToClaim, ClaimExpired, the referral claim errors, and the cause of each.Keep Exploring
Data Conventions
Wire formats, pagination, caching, and rate limits.
Claim Rewards
The claim flow end to end, including simulating before you sign.