-
Notifications
You must be signed in to change notification settings - Fork 94
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
Add v2 endpoints #89
Conversation
There was a problem hiding this 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
lib/models/order.rb
Outdated
# placeholder | ||
# placeholder | ||
# placeholder | ||
:notify => 24, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
# ],
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
lib/rest/v2/funding.rb
Outdated
end | ||
|
||
### | ||
# Close a funding loan/credit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Func doc header incorrect
lib/rest/v2/orders.rb
Outdated
# @return [Array] Raw notification | ||
### | ||
def update_order (changes) | ||
id = changes[:id] || changes['id'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused var
lib/rest/v2/positions.rb
Outdated
elsif position.kind_of?(Hash) | ||
id = position[:id] || position['id'] | ||
else | ||
raise Exception, 'tried to cancel position with invalid ID' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cancel
-> claim
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm 👍
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:
Fixes:
Fix fields for Order model, originally it was attempting to get some fields (like hidden) using the wrong index.
PR status:
Documentation updated- no documentation for rest yet