@carrot-protocol/boost-http-client 0.1.6-app-api-dev-963030f → 0.1.7-bug-fix-api-integration-dev-4e0eb09

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
@@ -25,7 +25,7 @@ export declare class Client {
25
25
  * @param user wallet public key
26
26
  * @returns User details
27
27
  */
28
- getUser(user: web3.PublicKey): Promise<GetUserResponse>;
28
+ getUser(user?: web3.PublicKey): Promise<GetUserResponse>;
29
29
  /**
30
30
  * Get market details for the carrot boost market
31
31
  * @returns Market details
package/dist/index.js CHANGED
@@ -101,6 +101,10 @@ class Client {
101
101
  * @returns User details
102
102
  */
103
103
  async getUser(user) {
104
+ // use loaded wallet if not provided
105
+ if (!user) {
106
+ user = this.address();
107
+ }
104
108
  const body = await handleApiCall(() => this.http.get(`/user?user=${user.toString()}`));
105
109
  const response = JSON.parse(body);
106
110
  return response;
package/dist/types.d.ts CHANGED
@@ -73,7 +73,7 @@ export interface GetUserResponse {
73
73
  jlpBalanceUi: number;
74
74
  solBalance: BN;
75
75
  solBalanceUi: number;
76
- obligation: any | null;
76
+ obligationCreated: boolean;
77
77
  }
78
78
  export interface GetMarketResponse {
79
79
  totalBorrowTVL: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carrot-protocol/boost-http-client",
3
- "version": "0.1.6-app-api-dev-963030f",
3
+ "version": "0.1.7-bug-fix-api-integration-dev-4e0eb09",
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
@@ -90,7 +90,12 @@ export class Client {
90
90
  * @param user wallet public key
91
91
  * @returns User details
92
92
  */
93
- async getUser(user: web3.PublicKey): Promise<GetUserResponse> {
93
+ async getUser(user?: web3.PublicKey): Promise<GetUserResponse> {
94
+ // use loaded wallet if not provided
95
+ if (!user) {
96
+ user = this.address();
97
+ }
98
+
94
99
  const body = await handleApiCall(() =>
95
100
  this.http.get(`/user?user=${user.toString()}`),
96
101
  );
package/src/types.ts CHANGED
@@ -84,7 +84,7 @@ export interface GetUserResponse {
84
84
  jlpBalanceUi: number;
85
85
  solBalance: BN;
86
86
  solBalanceUi: number;
87
- obligation: any | null;
87
+ obligationCreated: boolean;
88
88
  }
89
89
 
90
90
  export interface GetMarketResponse {