Skip to main content
Branch on code, never on message. A code is a wallet.* code from the frame, an API error code forwarded verbatim, or a code this package produced locally.

Example

Properties

string
required
The stable failure code to branch on. See Codes below.
string
Documentation for this code, when the failure carried one.
string
Present when the failure originated at the Endstate API. Quote it in support requests.
Record<string, unknown>
Structured context attached to the failure, when the wallet or API supplied it.

Codes

code comes from three places. Frame wallet.* codes and Endstate API codes pass through verbatim; the package also produces a handful of codes locally:
frame
The session lapsed. Call refreshSession() to establish a fresh one.
frame
A claim() or transfer() could not be gas-sponsored. Nothing was sent, and the customer is never asked to fund the wallet. Retry later.
frame
The wallet could not send an otherwise valid prepared operation. details.cause names the step: in_flight, expired, submit_timeout, zerodev_unconfigured, unsupported_chain, kernel_client_failed, account_mismatch, prepare_failed, provider_send_failed, or reverted. For submit_timeout, provider_send_failed, and reverted the operation may have reached the chain: read the claim or transfer resource before retrying.
api
The prepared operation was already sent, has expired, or is not routed to this wallet. Read the resource; a retry needs a new one.
local
No response within the wait budget. The frame handshake, identity issuance, session establishment, or wallet setup exceeded its timeouts budget, or a claim() or transfer() send exceeded submitMs. A timeout does not cancel the frame request: it may still be preparing the operation, or a send may settle later. Check the claim or transfer resource’s status before retrying.
local
destroy() settled this call. The wallet was torn down while the request was pending.
local
The wallet frame does not speak the bridge protocol version this package sends. Upgrade @endstate-sdk/web. details.supported lists the versions the frame offered.
local
The wallet’s reply could not be used - for example, a session reported without an account address, or a failure that carried no usable code.
Other wallet.* codes and API error codes (for example a rejected credential) pass through unchanged. Always match on the exact string, and treat an unrecognized code as a generic failure rather than assuming a fixed set.