@dydxprotocol/v4-client-js 3.0.5 → 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/CHANGELOG.md +2 -2
- package/build/cjs/src/clients/constants.js +2 -2
- package/build/cjs/src/clients/modules/account.js +31 -1
- package/build/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/build/esm/src/clients/constants.d.ts.map +1 -1
- package/build/esm/src/clients/constants.js +2 -2
- package/build/esm/src/clients/modules/account.d.ts +2 -0
- package/build/esm/src/clients/modules/account.d.ts.map +1 -1
- package/build/esm/src/clients/modules/account.js +31 -1
- package/build/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/clients/constants.ts +1 -1
- package/src/clients/modules/account.ts +48 -0
package/package.json
CHANGED
package/src/clients/constants.ts
CHANGED
|
@@ -230,7 +230,7 @@ export const MAX_MEMO_CHARACTERS: number = 256;
|
|
|
230
230
|
|
|
231
231
|
export const SHORT_BLOCK_WINDOW: number = 20;
|
|
232
232
|
|
|
233
|
-
export const SHORT_BLOCK_FORWARD: number =
|
|
233
|
+
export const SHORT_BLOCK_FORWARD: number = 15;
|
|
234
234
|
|
|
235
235
|
// Querying
|
|
236
236
|
export const PAGE_REQUEST: PageRequest = {
|
|
@@ -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(
|