import { HISTORY_CODES } from '../codes';

export type ShortHistoryCode =
  | HISTORY_CODES.BATCH_SUCCESS
  | HISTORY_CODES.C1_ORDER_CREATED
  | HISTORY_CODES.C1_ORDER_DEACTIVATED
  | HISTORY_CODES.C1_ORDER_CLOSED
  | HISTORY_CODES.C1_ORDER_UPDATED
  | HISTORY_CODES.C1_ORDER_EXPIRED
  | HISTORY_CODES.C1_ORDER_USED
  | HISTORY_CODES.C1_ORDER_COMPLETED
  | HISTORY_CODES.C2_ORDER_CREATED
  | HISTORY_CODES.C2_ORDER_CLOSED
  | HISTORY_CODES.C2_ORDER_NOT_ACTIVE
  | HISTORY_CODES.C2_ORDER_USED
  | HISTORY_CODES.C2_ORDER_UPDATED
  | HISTORY_CODES.C2_ORDER_EXPIRED
  | HISTORY_CODES.C2_ORDER_DISABLED
  | HISTORY_CODES.C2_FITTING_ORDER_NOT_FOUND
  | HISTORY_CODES.C2_REQUEST_CREATED
  | HISTORY_CODES.C2_REQUEST_FALLBACK_CALL
  | HISTORY_CODES.C2_REQUEST_NOT_ACTIVE
  | HISTORY_CODES.C2_REQUEST_EXECUTED
  | HISTORY_CODES.C2_REQUEST_EXPIRED;

export type ErrorHistoryCode =
  | HISTORY_CODES.ERROR
  | HISTORY_CODES.BAD_REQUEST
  | HISTORY_CODES.FORBIDDEN
  | HISTORY_CODES.NOT_FOUND
  | HISTORY_CODES.CONFLICT
  | HISTORY_CODES.CONTRACT_ERROR
  | HISTORY_CODES.NOT_IMPLEMENTED
  | HISTORY_CODES.TIMEOUT
  | HISTORY_CODES.BATCH_ERROR
  | HISTORY_CODES.C1_ORDER_NOT_CREATED
  | HISTORY_CODES.C1_ORDER_NOT_CLOSED
  | HISTORY_CODES.C1_ORDER_NOT_ACTIVE
  | HISTORY_CODES.C1_L1_TX_HANDLING_ERROR
  | HISTORY_CODES.C1_BAD_L1_TX
  | HISTORY_CODES.C2_ORDER_NOT_CREATED
  | HISTORY_CODES.C2_ORDER_NOT_CLOSED
  | HISTORY_CODES.C2_ORDER_NOT_ACTIVE
  | HISTORY_CODES.C2_REQUEST_NOT_CREATED
  | HISTORY_CODES.C2_FITTING_ORDER_NOT_FOUND
  | HISTORY_CODES.C2_BTC_NONCE_NOT_AVAILABLE
  | HISTORY_CODES.C2_L1_TX_HANDLING_ERROR
  | HISTORY_CODES.C2_BAD_L1_TX
  | HISTORY_CODES.C2_L1_EVENT_ERROR
  | HISTORY_CODES.C2_REQUEST_NOT_ACTIVE
  | HISTORY_CODES.C2_REQUEST_EXPIRED
  | HISTORY_CODES.C2_COLLATERAL_DEPOSIT_FAILED
  | HISTORY_CODES.C2_COLLATERAL_WITHDRAW_FAILED;

export type CollateralHistoryCode =
  | HISTORY_CODES.C2_COLLATERAL_DEPOSIT
  | HISTORY_CODES.C2_COLLATERAL_WITHDRAW
  | HISTORY_CODES.C2_COLLATERAL_DEPOSIT_FAILED
  | HISTORY_CODES.C2_COLLATERAL_WITHDRAW_FAILED
  | HISTORY_CODES.C2_COLLATERAL_LOCKED
  | HISTORY_CODES.C2_COLLATERAL_UNLOCKED;

export type L1TxHistoryCode =
  | HISTORY_CODES.C1_BAD_L1_TX
  | HISTORY_CODES.C1_L1_TX_HANDLED
  | HISTORY_CODES.C1_L1_TX_HANDLING_ERROR
  | HISTORY_CODES.C2_BAD_L1_TX
  | HISTORY_CODES.C2_L1_TX_HANDLED
  | HISTORY_CODES.C2_L1_TX_HANDLING_ERROR
  | HISTORY_CODES.C1_L1_TRANSFER_TX_HANDLED
  | HISTORY_CODES.C1_L1_TAKE_TX_HANDLED;

export type UntypedHistoryCode = Exclude<HISTORY_CODES, CollateralHistoryCode | ShortHistoryCode | L1TxHistoryCode>;
