Skip to content

Commit

Permalink
Adding createdBeforeOrAt param to getTrades API (#184)
Browse files Browse the repository at this point in the history
Adds the `createdBeforeOrAt` param to the JS client's GetTrades
function.
  • Loading branch information
dmu1313 authored Jul 1, 2024
1 parent 1f8ad15 commit 5ae6549
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions v4-client-js/__native__/__ios__/v4-native-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -206700,10 +206700,11 @@ class MarketsClient extends rest_1.default {
const uri = `/v4/orderbooks/perpetualMarket/${market}`;
return this.get(uri);
}
async getPerpetualMarketTrades(market, startingBeforeOrAtHeight, limit, page) {
async getPerpetualMarketTrades(market, startingBeforeOrAtHeight, startingBeforeOrAt, limit, page) {
const uri = `/v4/trades/perpetualMarket/${market}`;
return this.get(uri, {
createdBeforeOrAtHeight: startingBeforeOrAtHeight,
createdBeforeOrAt: startingBeforeOrAt,
limit,
page,
});
Expand Down Expand Up @@ -206733,7 +206734,7 @@ class MarketsClient extends rest_1.default {
}
}
exports["default"] = MarketsClient;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFya2V0cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jbGllbnRzL21vZHVsZXMvbWFya2V0cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLDRDQUEwQztBQUUxQyxrREFBZ0M7QUFFaEM7O0dBRUc7QUFDSCxNQUFxQixhQUFjLFNBQVEsY0FBVTtJQUNuRCxLQUFLLENBQUMsbUJBQW1CLENBQUMsTUFBZTtRQUN2QyxNQUFNLEdBQUcsR0FBRyxzQkFBc0IsQ0FBQztRQUNuQyxPQUFPLElBQUksQ0FBQyxHQUFHLENBQUMsR0FBRyxFQUFFLEVBQUUsTUFBTSxFQUFFLE1BQU0sRUFBRSxDQUFDLENBQUM7SUFDM0MsQ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ixDQUFDLENBQUM7SUFDTCxDQUFDO0NBQ0Y7QUEvREQsZ0NBK0RDIn0=

/***/ }),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ describe('IndexerClient', () => {
const response = await client.markets.getPerpetualMarketTrades(
MARKET_BTC_USD,
undefined,
undefined,
1,
1,
);
Expand Down
4 changes: 2 additions & 2 deletions v4-client-js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion v4-client-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dydxprotocol/v4-client-js",
"version": "1.1.24",
"version": "1.1.25",
"description": "General client library for the new dYdX system (v4 decentralized)",
"main": "build/src/index.js",
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions v4-client-js/src/clients/modules/markets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ export default class MarketsClient extends RestClient {
async getPerpetualMarketTrades(
market: string,
startingBeforeOrAtHeight?: number | null,
startingBeforeOrAt?: string | null,
limit?: number | null,
page?: number | null,
): Promise<Data> {
const uri = `/v4/trades/perpetualMarket/${market}`;
return this.get(uri, {
createdBeforeOrAtHeight: startingBeforeOrAtHeight,
createdBeforeOrAt: startingBeforeOrAt,
limit,
page,
});
Expand Down

0 comments on commit 5ae6549

Please sign in to comment.