-
Notifications
You must be signed in to change notification settings - Fork 297
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
new trades endpoint #111
new trades endpoint #111
Conversation
src/trades_call_builder.js
Outdated
} | ||
return this; | ||
} | ||
} |
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.
Looks like it doesn't allow to set all the query params (offer_id, cursor, order, limit...).
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.
Adding offer_id
. Paging params come for free from the super class CallBuilder
but adding a test anyway.
src/trades_call_builder.js
Outdated
/** | ||
* Creates a new {@link TradesCallBuilder} pointed to server defined by serverUrl. | ||
* | ||
* Do not create this object directly, use {@link Server#orderbook}. |
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.
{@link Server#trades}
this.url.addQuery("counter_asset_issuer", counter.getIssuer()); | ||
} else { | ||
this.url.addQuery("counter_asset_type", 'native'); | ||
} |
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.
Not in a scope of this PR but I see this code a lot. Would be great to move it to a helper function.
src/trades_call_builder.js
Outdated
* @param offerId | ||
* @returns {TradesCallBuilder} | ||
*/ | ||
forOffer(offerId) { |
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.
Extra space in before function name?
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.
weird. will fix
test/unit/server_test.js
Outdated
|
||
describe("TradesCallBuilder", function() { | ||
it("trades() requests the correct endpoint (no filters)", function (done) { | ||
let response = "trades_no_filters"; |
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.
I've seen your comment about mocked responses in other PR but I think we should make them similar to real ones. For example we should test if functions are correctly created from _links
.
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.
No prob.
@bartekn pushed fixes. The |
remove old
/orderbook/trades
add
/trades
with optional asset filters