Skip to content
markpaper

src/errors/index.ts

v0.3.0 · 1.4 KB

Download file
// Public API of the errors module: parsing /exchange responses and classifying failures.

export {
  classifyExchangeError,
  errorKindInfo,
  PERMANENT_REJECT_HOLD_MS,
  RATE_LIMIT_PAUSE_MS,
  type ErrorDisposition,
  type ErrorKindInfo,
  type ExchangeErrorKind,
} from './classify.js';

export {
  isCancelConfirmed,
  parseActionResponse,
  parseCancelResponse,
  parseCancelStatus,
  parseCancelStatuses,
  parseOrderResponse,
  parseOrderStatus,
  parseOrderStatuses,
  parseTwapResponse,
  placedOids,
  type AcceptedWithoutOid,
  type ActionResult,
  type CancelStatusResult,
  type ExchangeResponseParse,
  type InvalidStatusReason,
  type OrderStatusParseOptions,
  type OrderStatusResult,
  type TwapStatusResult,
} from './statuses.js';

export {
  causeChain,
  exchangeErrorBody,
  extractPartialBatch,
  findApiRequestError,
  findInCauseChain,
  invokeAsync,
  isUserRejectedSignature,
  isValidationError,
  isWalletError,
  type ApiRequestErrorLike,
  type ExchangeErrorBody,
  type PartialBatch,
} from './sdk.js';

export {
  classifyTransportFailure,
  describeTransportFailure,
  httpStatusOf,
  isRateLimitFailure,
  isTransientFailure,
  type TransportFailureInfo,
  type TransportFailureReason,
  type TransportOutcome,
} from './transport.js';

export {
  interpretExchangeError,
  recommendRetry,
  type ExchangeFailure,
  type RetryAdvice,
} from './interpret.js';
All files