Skip to content

Enums

Every enum is a StrEnum, so a member can be passed anywhere a plain string is accepted and compares equal to its wire value. Raw strings from the API are kept as-is when they are not a known member, so an unfamiliar value never raises.

enums

String constants for bitFlyer API parameters and response fields.

Every member is a enum.StrEnum, so it can be passed anywhere a plain str is accepted and compares equal to its literal value::

client.send_child_order(ProductCode.FX_BTC_JPY, ChildOrderType.MARKET, Side.BUY, 0.01)
client.get_health().status == HealthStatus.NORMAL

These are convenience constants, not validators. Request parameters and model fields are typed str on purpose: bitFlyer adds and removes products and introduces new state values without warning, and a closed enum would reject valid values. Prefer the constants for the values you know, pass a string for anything newer than this release.

ProductCode

Bases: StrEnum

Market identifiers, as returned by GET /v1/getmarkets.

MarketType

Bases: StrEnum

The market_type field of a Market.

Side

Bases: StrEnum

Order and execution direction.

ChildOrderType

Bases: StrEnum

Order type for send_child_order.

TimeInForce

Bases: StrEnum

Execution condition for an order.

GTC class-attribute instance-attribute

GTC = 'GTC'

Good 'Til Canceled.

IOC class-attribute instance-attribute

IOC = 'IOC'

Immediate Or Cancel.

FOK class-attribute instance-attribute

FOK = 'FOK'

Fill Or Kill.

OrderMethod

Bases: StrEnum

Order method for send_parent_order.

ConditionType

Bases: StrEnum

Trigger condition for a parent order parameter.

ChildOrderState

Bases: StrEnum

Lifecycle state of a child order.

Note that ACTIVE, COMPLETED, CANCELED, EXPIRED and REJECTED are also accepted as the child_order_state filter of get_child_orders.

ParentOrderState

Bases: StrEnum

Lifecycle state of a parent order.

ChildOrderEventType

Bases: StrEnum

event_type of a ChildOrderEvent.

ORDER class-attribute instance-attribute

ORDER = 'ORDER'

The order was accepted and is now on the book.

ORDER_FAILED class-attribute instance-attribute

ORDER_FAILED = 'ORDER_FAILED'

The order was rejected; read reason.

EXECUTION class-attribute instance-attribute

EXECUTION = 'EXECUTION'

A fill, whole or partial; read outstanding_size for the remainder.

ParentOrderEventType

Bases: StrEnum

event_type of a ParentOrderEvent.

TRIGGER class-attribute instance-attribute

TRIGGER = 'TRIGGER'

A condition fired and placed a child order.

HealthStatus

Bases: StrEnum

Exchange health, as returned by GET /v1/gethealth.

MarketState

Bases: StrEnum

Trading session state of a market.

Shared by the state field of both Ticker and BoardState.