@ledgerhq/coin-stellar
Version:
Ledger Stellar Coin integration
29 lines • 1.14 kB
TypeScript
/** Horizon RFC 7807 problem+json body (subset used by coin-stellar). */
export type HorizonErrorBody = {
type?: string;
title?: string;
status?: number;
detail?: string;
extras?: {
envelope_xdr?: string;
result_xdr?: string;
result_codes?: {
transaction?: string;
operations?: string[];
};
invalid_field?: string;
reason?: string;
};
};
export declare function isHorizonErrorBody(data: unknown): data is HorizonErrorBody;
/**
* Horizon failures are usually {@link BadResponseError} with `response` = problem+json body.
* Axios rejects first; the SDK forwards it unchanged, so the body lives on `error.response.data`.
*/
export declare function getHorizonErrorBody(error: unknown): HorizonErrorBody | null;
/**
* Best-effort human-readable summary for logs (`errorExtras.documentationSummary`).
* Prefers operation result codes, then transaction codes, then Horizon `detail` / `extras.reason`.
*/
export declare function documentationSummaryFromHorizonBody(body: HorizonErrorBody): string;
//# sourceMappingURL=horizonErrorBody.d.ts.map