@carrot-protocol/boost-http-client 0.4.1-feat-user-pnl-aggregate-dev-454dcda → 0.4.1
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/dist/charting/wallet/index.d.ts +2 -2
- package/dist/charting/wallet/index.js +1 -2
- package/dist/index.js +1 -0
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/charting/wallet/index.ts +3 -4
- package/src/index.ts +1 -0
- package/src/types.ts +1 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { web3 } from "@coral-xyz/anchor";
|
|
2
2
|
import { PerformanceResponse } from "./types";
|
|
3
3
|
import { ApiClient } from "../../api";
|
|
4
|
-
import {
|
|
4
|
+
import { DateRangeOptions } from "../../types";
|
|
5
5
|
export declare class WalletChartingExtension extends ApiClient {
|
|
6
6
|
private readonly address;
|
|
7
7
|
constructor(baseUrl: string, address: web3.PublicKey);
|
|
8
|
-
getPerformance(options?:
|
|
8
|
+
getPerformance(options?: DateRangeOptions): Promise<PerformanceResponse[]>;
|
|
9
9
|
}
|
|
@@ -8,13 +8,12 @@ class WalletChartingExtension extends api_1.ApiClient {
|
|
|
8
8
|
this.address = address;
|
|
9
9
|
}
|
|
10
10
|
async getPerformance(options = {}) {
|
|
11
|
-
const { fromTime, toTime
|
|
11
|
+
const { fromTime, toTime } = options;
|
|
12
12
|
const body = await this.handleApiCall(() => this.http.get(`/user/pnls`, {
|
|
13
13
|
params: {
|
|
14
14
|
authority: this.address.toString(),
|
|
15
15
|
fromTime: fromTime?.toISOString(),
|
|
16
16
|
toTime: toTime?.toISOString(),
|
|
17
|
-
aggregationMethod,
|
|
18
17
|
},
|
|
19
18
|
}));
|
|
20
19
|
const response = JSON.parse(body).map((performance) => ({
|
package/dist/index.js
CHANGED
|
@@ -479,6 +479,7 @@ function parseBank(bankJson) {
|
|
|
479
479
|
liabilityMaintWeight: Number(bankJson.liabilityMaintWeight),
|
|
480
480
|
totalLiabilityShares: Number(bankJson.totalLiabilityShares),
|
|
481
481
|
liabilityShareValue: Number(bankJson.liabilityShareValue),
|
|
482
|
+
protocolOriginationFee: Number(bankJson.protocolOriginationFee),
|
|
482
483
|
price: Number(bankJson.price),
|
|
483
484
|
depositLimit: new anchor_1.BN(bankJson.depositLimit, "hex"),
|
|
484
485
|
depositLimitUi: Number(bankJson.depositLimitUi),
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { web3 } from "@coral-xyz/anchor";
|
|
2
2
|
import { PerformanceResponse } from "./types";
|
|
3
3
|
import { ApiClient } from "../../api";
|
|
4
|
-
import {
|
|
4
|
+
import { DateRangeOptions } from "../../types";
|
|
5
5
|
|
|
6
6
|
export class WalletChartingExtension extends ApiClient {
|
|
7
7
|
private readonly address: web3.PublicKey;
|
|
@@ -12,16 +12,15 @@ export class WalletChartingExtension extends ApiClient {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
public async getPerformance(
|
|
15
|
-
options:
|
|
15
|
+
options: DateRangeOptions = {},
|
|
16
16
|
): Promise<PerformanceResponse[]> {
|
|
17
|
-
const { fromTime, toTime
|
|
17
|
+
const { fromTime, toTime } = options;
|
|
18
18
|
const body = await this.handleApiCall(() =>
|
|
19
19
|
this.http.get(`/user/pnls`, {
|
|
20
20
|
params: {
|
|
21
21
|
authority: this.address.toString(),
|
|
22
22
|
fromTime: fromTime?.toISOString(),
|
|
23
23
|
toTime: toTime?.toISOString(),
|
|
24
|
-
aggregationMethod,
|
|
25
24
|
},
|
|
26
25
|
}),
|
|
27
26
|
);
|
package/src/index.ts
CHANGED
|
@@ -674,6 +674,7 @@ function parseBank(bankJson: any): Bank {
|
|
|
674
674
|
liabilityMaintWeight: Number(bankJson.liabilityMaintWeight),
|
|
675
675
|
totalLiabilityShares: Number(bankJson.totalLiabilityShares),
|
|
676
676
|
liabilityShareValue: Number(bankJson.liabilityShareValue),
|
|
677
|
+
protocolOriginationFee: Number(bankJson.protocolOriginationFee),
|
|
677
678
|
price: Number(bankJson.price),
|
|
678
679
|
depositLimit: new BN(bankJson.depositLimit, "hex"),
|
|
679
680
|
depositLimitUi: Number(bankJson.depositLimitUi),
|
package/src/types.ts
CHANGED