Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add v2 endpoints #89

Merged
merged 16 commits into from
Oct 22, 2019
Merged

Conversation

JacobPlaster
Copy link
Contributor

@JacobPlaster JacobPlaster commented Oct 17, 2019

Description:

This pull request adds all of the new v2 rest endpoints and adds the capability to specify leverage when creating an order.

Breaking changes:

-None

New features:

  • Adds function rest/v2 submit_order
  • Adds function rest/v2 update_order
  • Adds function rest/v2 cancel_order
  • Adds function rest/v2 submit_funding_offer
  • Adds function rest/v2 cancel_funding_offer
  • Adds function rest/v2 close_funding
  • Adds function rest/v2 submit_funding_auto
  • Adds function rest/v2 transfer
  • Adds function rest/v2 deposit_address
  • Adds function rest/v2 create_deposit_address
  • Adds function rest/v2 withdraw
  • Adds function rest/v2 claim_position
  • Updates order model to allow lev field
  • Updates position model to accept more data fields

Fixes:

Fix fields for Order model, originally it was attempting to get some fields (like hidden) using the wrong index.

PR status:

  • Version bumped
  • Change-log updated
  • Documentation updated - no documentation for rest yet

Copy link
Contributor

@f3rno f3rno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires minor edits, otherwise lgtm

# placeholder
# placeholder
# placeholder
:notify => 24,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem correct, it is at index 23 in the docs & bfx-api-node-models, can you confirm?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according to the docs:

[
  #    ID, 1
  #    GID, 2
  #    CID, 3
  #    SYMBOL, 4
  #    MTS_CREATE, 5 
  #    MTS_UPDATE, 6
  #    AMOUNT, 7
  #    AMOUNT_ORIG, 8 
  #    TYPE, 9
  #    TYPE_PREV, 10
  #    MTS_TIF, 11
  #    _PLACEHOLDER, 12
  #    FLAGS, 13
  #    ORDER_STATUS, 14
  #    _PLACEHOLDER, 15
  #    _PLACEHOLDER, 16
  #    PRICE, 17
  #    PRICE_AVG, 18
  #    PRICE_TRAILING, 19
  #    PRICE_AUX_LIMIT, 20
  #    _PLACEHOLDER, 21
  #    _PLACEHOLDER, 22
  #    _PLACEHOLDER, 23
  #    _PLACEHOLDER, 24
  #    HIDDEN, 25
  #    PLACED_ID, 26
  #    _PLACEHOLDER, 27
  #    _PLACEHOLDER, 28
  #    ROUTING, 29
  #    _PLACEHOLDER, 30
  #    _PLACEHOLDER, 31
  #    META 32
  #  ],

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so by that, hidden (notify) is 24 (I forgot to zero index)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore this - turns out the docs is missing the NOTIFY field in the v2 rest response which confused met. Fixed now

end

###
# Close a funding loan/credit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Func doc header incorrect

# @return [Array] Raw notification
###
def update_order (changes)
id = changes[:id] || changes['id']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused var

elsif position.kind_of?(Hash)
id = position[:id] || position['id']
else
raise Exception, 'tried to cancel position with invalid ID'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cancel -> claim

Copy link
Contributor

@f3rno f3rno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍

@JacobPlaster JacobPlaster merged commit 0e5ad6f into bitfinexcom:master Oct 22, 2019
@JacobPlaster JacobPlaster deleted the add-v2-endpoints branch October 22, 2019 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants