Skip to content

Refactor: Server-Valid Order Types & Status Enums #48

@f3rno

Description

@f3rno

Issue type

  • bug
  • missing functionality
  • performance
  • feature request

Brief description

The Order model comes with 2 object keys, types and statuses built here: https://github.com/bitfinexcom/bfx-api-node-models/blob/master/lib/order.js#L728

Spaces are converted to underscores as convenience for the keys, but the original value is also saved as a key, and both copies point to the value. i.e. we have this:

Order.type.EXCHANGE_LIMIT = 'EXCHANGE LIMIT'
Order.type['EXCHANGE LIMIT'] = 'EXCHANGE LIMIT'

This needs to be refactored to only provide valid types (no underscores); it was done like this for ease of use but the duplicate keys make iteration difficult/filtering necessary in some places. Also becomes confusing seeing underscores in some places and spaces in others.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions