@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.
@@ -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 { ChartingOptions } from "../../types";
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?: ChartingOptions): Promise<PerformanceResponse[]>;
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, aggregationMethod } = options;
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
@@ -205,6 +205,7 @@ export interface Bank {
205
205
  liabilityMaintWeight: number;
206
206
  totalLiabilityShares: number;
207
207
  liabilityShareValue: number;
208
+ protocolOriginationFee: number;
208
209
  price: number;
209
210
  depositLimit: BN;
210
211
  depositLimitUi: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carrot-protocol/boost-http-client",
3
- "version": "0.4.1-feat-user-pnl-aggregate-dev-454dcda",
3
+ "version": "0.4.1",
4
4
  "description": "HTTP client for Carrot Boost",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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 { ChartingOptions } from "../../types";
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: ChartingOptions = {},
15
+ options: DateRangeOptions = {},
16
16
  ): Promise<PerformanceResponse[]> {
17
- const { fromTime, toTime, aggregationMethod } = options;
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
@@ -233,6 +233,7 @@ export interface Bank {
233
233
  liabilityMaintWeight: number;
234
234
  totalLiabilityShares: number;
235
235
  liabilityShareValue: number;
236
+ protocolOriginationFee: number;
236
237
  price: number;
237
238
  depositLimit: BN;
238
239
  depositLimitUi: number;