Optionalcode: numberOptionaltype: ErrorTypeValueOptionaldetails: Record<string, unknown>OptionalretryAfter: numberReadonlycodeMachine-readable error code from the API error body, if present.
ReadonlydetailsExtra top-level fields from the API error response body, excluding
error itself. For example, a selection_too_large refusal from POST /v1/acquisitions (422) carries maximum and submitted alongside
error. undefined when the body carried no other top-level fields,
which is the common case.
ReadonlyretrySeconds to wait before retrying, from the response's Retry-After header.
undefined when the response carried no usable header. Present on rate-limit
(429) and busy (503) refusals, so a caller can back off without guessing.
ReadonlystatusHTTP status code returned by the API (e.g. 400, 401, 404, 422).
ReadonlytypeMachine-readable reason from the API error body's error.type, if present.
See ErrorType for the documented values and how to branch on them —
the API may emit other values it hasn't documented yet, which still land
here as a plain string rather than being dropped.
Static ReadonlybrandClass-identity brand used for cross-bundle instanceof (see [Symbol.hasInstance]). Hardcoded per class — never derived
from constructor.name or this.name, either of which a minifier can
rewrite, silently breaking the brand match.
Static[hasMakes err instanceof LedewireError (and every subclass below) true even
when err was constructed by a different bundled copy of this module.
Each published package (@ledewire/node, @ledewire/browser,
@ledewire/x402-client) bundles its own copy of @ledewire/core via
tsup, so the classes are distinct objects with unrelated prototypes —
the plain prototype-chain check instanceof normally does would fail.
Falls back to the brand list every instance carries under a
Symbol.for('@ledewire/error-brands') key (collected from the brand
static along the constructing class's prototype chain): true when the
ordinary check passes, OR the instance's brand list includes this
class's own brand.
Base error class for all LedeWire SDK errors. All errors thrown by the SDK are instances of this class, making it safe to use
err instanceof LedewireErroras a type guard.instanceofworks even whenerrwas constructed by a different bundled copy of this class — e.g. an error thrown by@ledewire/x402-clientchecked with theSpendCapReachedErrorbundled into@ledewire/node. See [Symbol.hasInstance].Example