@dydxprotocol/v4-client-js 3.0.6 → 3.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dydxprotocol/v4-client-js",
3
- "version": "3.0.6",
3
+ "version": "3.0.7",
4
4
  "description": "General client library for the new dYdX system (v4 decentralized)",
5
5
  "main": "build/cjs/src/index.js",
6
6
  "module": "build/esm/src/index.js",
@@ -289,6 +289,54 @@ export default class AccountClient extends RestClient {
289
289
  });
290
290
  }
291
291
 
292
+ async getSubaccountHistoricalPNLsV2(
293
+ address: string,
294
+ subaccountNumber: number,
295
+ // false or undefined = hourly
296
+ daily?: boolean,
297
+ createdBeforeOrAtHeight?: number | null,
298
+ createdBeforeOrAt?: string | null,
299
+ createdOnOrAfterHeight?: number | null,
300
+ createdOnOrAfter?: string | null,
301
+ limit?: number | null,
302
+ page?: number | null,
303
+ ): Promise<Data> {
304
+ const uri = '/v4/pnl';
305
+ return this.get(uri, {
306
+ address,
307
+ subaccountNumber,
308
+ createdBeforeOrAtHeight,
309
+ createdBeforeOrAt,
310
+ createdOnOrAfterHeight,
311
+ createdOnOrAfter,
312
+ limit,
313
+ page,
314
+ daily,
315
+ });
316
+ }
317
+
318
+ async getParentSubaccountNumberHistoricalPNLsV2(
319
+ address: string,
320
+ parentSubaccountNumber: number,
321
+ // false or undefined = hourly
322
+ daily?: boolean,
323
+ createdBeforeOrAtHeight?: number | null,
324
+ createdBeforeOrAt?: string | null,
325
+ createdOnOrAfterHeight?: number | null,
326
+ createdOnOrAfter?: string | null,
327
+ ): Promise<Data> {
328
+ const uri = '/v4/pnl/parentSubaccountNumber';
329
+ return this.get(uri, {
330
+ address,
331
+ parentSubaccountNumber,
332
+ createdBeforeOrAtHeight,
333
+ createdBeforeOrAt,
334
+ createdOnOrAfterHeight,
335
+ createdOnOrAfter,
336
+ daily,
337
+ });
338
+ }
339
+
292
340
  // ------ Rewards ------ //
293
341
 
294
342
  async getHistoricalTradingRewardsAggregations(