@carrot-protocol/boost-http-client 0.2.0-mrgn-fork1-dev-37e1e0b → 0.2.0-mrgn-fork1-dev-958b4f8

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
@@ -28,10 +28,11 @@ export declare class Client {
28
28
  getUser(user?: web3.PublicKey): Promise<GetUserResponse>;
29
29
  /**
30
30
  * Get bank details
31
- * @param mint token mint of the bank public key
31
+ * @param addr token mint or bank public key
32
+ * @param addrType "mint" or "bank"
32
33
  * @returns Bank details
33
34
  */
34
- getBank(mint: web3.PublicKey): Promise<GetBankResponse>;
35
+ getBank(addr: web3.PublicKey, addrType: "mint" | "bank"): Promise<GetBankResponse>;
35
36
  /**
36
37
  * Deposit collateral and create a leveraged position
37
38
  * @param request Deposit leverage request parameters
package/dist/index.js CHANGED
@@ -112,11 +112,12 @@ class Client {
112
112
  }
113
113
  /**
114
114
  * Get bank details
115
- * @param mint token mint of the bank public key
115
+ * @param addr token mint or bank public key
116
+ * @param addrType "mint" or "bank"
116
117
  * @returns Bank details
117
118
  */
118
- async getBank(mint) {
119
- const body = await handleApiCall(() => this.http.get(`/bank?mint=${mint.toString()}`));
119
+ async getBank(addr, addrType) {
120
+ const body = await handleApiCall(() => this.http.get(`/bank?${addrType}=${addr.toString()}`));
120
121
  const response = JSON.parse(body);
121
122
  return response;
122
123
  }
package/dist/types.d.ts CHANGED
@@ -64,11 +64,5 @@ export interface GetUserResponse {
64
64
  clendAccount: any | undefined;
65
65
  }
66
66
  export interface GetBankResponse {
67
- totalBorrowTVL: number;
68
- totalSupplyTVL: number;
69
- supplyApy: number;
70
- borrowApy: number;
71
- supplyAmount: number;
72
- borrowAmount: number;
73
- price: number;
67
+ data: any;
74
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carrot-protocol/boost-http-client",
3
- "version": "0.2.0-mrgn-fork1-dev-37e1e0b",
3
+ "version": "0.2.0-mrgn-fork1-dev-958b4f8",
4
4
  "description": "HTTP client for Carrot Boost API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -104,12 +104,16 @@ export class Client {
104
104
 
105
105
  /**
106
106
  * Get bank details
107
- * @param mint token mint of the bank public key
107
+ * @param addr token mint or bank public key
108
+ * @param addrType "mint" or "bank"
108
109
  * @returns Bank details
109
110
  */
110
- async getBank(mint: web3.PublicKey): Promise<GetBankResponse> {
111
+ async getBank(
112
+ addr: web3.PublicKey,
113
+ addrType: "mint" | "bank",
114
+ ): Promise<GetBankResponse> {
111
115
  const body = await handleApiCall(() =>
112
- this.http.get(`/bank?mint=${mint.toString()}`),
116
+ this.http.get(`/bank?${addrType}=${addr.toString()}`),
113
117
  );
114
118
 
115
119
  const response: GetBankResponse = JSON.parse(body);
package/src/types.ts CHANGED
@@ -77,11 +77,5 @@ export interface GetUserResponse {
77
77
  }
78
78
 
79
79
  export interface GetBankResponse {
80
- totalBorrowTVL: number;
81
- totalSupplyTVL: number;
82
- supplyApy: number;
83
- borrowApy: number;
84
- supplyAmount: number;
85
- borrowAmount: number;
86
- price: number;
80
+ data: any;
87
81
  }