@carrot-protocol/boost-http-client 0.2.15-group-refactor1-dev-a038045 → 0.2.15-group-refactor1-dev-69572ae

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AnchorProvider, web3 } from "@coral-xyz/anchor";
2
- import { GetBankResponse, GetGroupResponse, GetGroupsResponse } from "./types";
2
+ import { GetBankResponse, GetUserResponse, GetGroupResponse, GetGroupsResponse } from "./types";
3
3
  export * from "./types";
4
4
  export * from "./utils";
5
5
  export * as Common from "@carrot-protocol/clend-common";
@@ -22,7 +22,7 @@ export declare class Client {
22
22
  * @returns Index details
23
23
  */
24
24
  index(): Promise<any>;
25
- getUser(user: web3.PublicKey, groups: web3.PublicKey[], getClendAccountSummary: boolean): Promise<any>;
25
+ getUser(user: web3.PublicKey, groups: web3.PublicKey[], getClendAccountSummary: boolean): Promise<GetUserResponse>;
26
26
  /**
27
27
  * Get all groups
28
28
  * @param includeBankData Whether to include bank data in the response, if not strictly necessary keep false
@@ -52,17 +52,17 @@ export declare class Client {
52
52
  * @param request Adjust leverage request parameters
53
53
  * @returns Adjust leverage operation result
54
54
  */
55
- adjustLeverage(clendGroup: web3.PublicKey, clendAccount: web3.PublicKey, assetTokenMint: web3.PublicKey, liabilityTokenMint: web3.PublicKey, leverage: number, slippageBps: number): Promise<any>;
55
+ adjustLeverage(clendGroup: web3.PublicKey, clendAccount: web3.PublicKey, assetTokenMint: web3.PublicKey, liabilityTokenMint: web3.PublicKey, leverage: number, slippageBps: number): Promise<string>;
56
56
  /**
57
57
  * Withdraw from or close a leveraged position
58
58
  * @param request Withdraw leverage request parameters
59
59
  * @returns Withdraw leverage operation result
60
60
  */
61
- withdrawLeverage(clendGroup: web3.PublicKey, clendAccount: web3.PublicKey, outputTokenMint: web3.PublicKey, assetTokenMint: web3.PublicKey, liabilityTokenMint: web3.PublicKey, uiAmount: number, slippageBps: number, withdrawAll: boolean): Promise<any>;
61
+ withdrawLeverage(clendGroup: web3.PublicKey, clendAccount: web3.PublicKey, outputTokenMint: web3.PublicKey, assetTokenMint: web3.PublicKey, liabilityTokenMint: web3.PublicKey, uiAmount: number, slippageBps: number, withdrawAll: boolean): Promise<string>;
62
62
  /**
63
63
  * Withdraw emissions from a bank
64
64
  * @param banks Banks to withdraw emissions, if empty, will withdraw from all banks
65
65
  * @returns Withdraw emissions operation result
66
66
  */
67
- withdrawEmissions(banks: web3.PublicKey[]): Promise<any>;
67
+ withdrawEmissions(): Promise<string>;
68
68
  }
package/dist/index.js CHANGED
@@ -359,10 +359,9 @@ class Client {
359
359
  * @param banks Banks to withdraw emissions, if empty, will withdraw from all banks
360
360
  * @returns Withdraw emissions operation result
361
361
  */
362
- async withdrawEmissions(banks) {
362
+ async withdrawEmissions() {
363
363
  const req = {
364
364
  owner: this.address(),
365
- banks,
366
365
  };
367
366
  const body = await handleApiCall(() => this.http.post("emissions/withdraw", JSON.stringify(req)));
368
367
  const withdrawEmissionsResponse = JSON.parse(body);
package/dist/types.d.ts CHANGED
@@ -69,7 +69,6 @@ export interface WithdrawLeverageResponse {
69
69
  */
70
70
  export interface WithdrawEmissionsRequest {
71
71
  owner: web3.PublicKey;
72
- banks: web3.PublicKey[];
73
72
  }
74
73
  /**
75
74
  * Response for withdraw emissions operation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carrot-protocol/boost-http-client",
3
- "version": "0.2.15-group-refactor1-dev-a038045",
3
+ "version": "0.2.15-group-refactor1-dev-69572ae",
4
4
  "description": "HTTP client for Carrot Boost",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -110,7 +110,7 @@ export class Client {
110
110
  user: web3.PublicKey,
111
111
  groups: web3.PublicKey[],
112
112
  getClendAccountSummary: boolean,
113
- ): Promise<any> {
113
+ ): Promise<GetUserResponse> {
114
114
  // Make the API call to fetch the raw user data as a string.
115
115
  const body = await handleApiCall(() =>
116
116
  this.http.get(
@@ -408,7 +408,7 @@ export class Client {
408
408
  liabilityTokenMint: web3.PublicKey,
409
409
  leverage: number,
410
410
  slippageBps: number,
411
- ): Promise<any> {
411
+ ): Promise<string> {
412
412
  const req: AdjustLeverageRequest = {
413
413
  owner: this.address(),
414
414
  clendGroup,
@@ -446,7 +446,7 @@ export class Client {
446
446
  uiAmount: number,
447
447
  slippageBps: number,
448
448
  withdrawAll: boolean,
449
- ): Promise<any> {
449
+ ): Promise<string> {
450
450
  const req: WithdrawLeverageRequest = {
451
451
  owner: this.address(),
452
452
  clendGroup,
@@ -477,11 +477,11 @@ export class Client {
477
477
  * @param banks Banks to withdraw emissions, if empty, will withdraw from all banks
478
478
  * @returns Withdraw emissions operation result
479
479
  */
480
- async withdrawEmissions(banks: web3.PublicKey[]): Promise<any> {
480
+ async withdrawEmissions(): Promise<string> {
481
481
  const req: WithdrawEmissionsRequest = {
482
482
  owner: this.address(),
483
- banks,
484
483
  };
484
+
485
485
  const body = await handleApiCall(() =>
486
486
  this.http.post("emissions/withdraw", JSON.stringify(req)),
487
487
  );
package/src/types.ts CHANGED
@@ -78,7 +78,6 @@ export interface WithdrawLeverageResponse {
78
78
  */
79
79
  export interface WithdrawEmissionsRequest {
80
80
  owner: web3.PublicKey;
81
- banks: web3.PublicKey[];
82
81
  }
83
82
 
84
83
  /**