@carrot-protocol/boost-http-client 0.2.15-group-refactor1-dev-72c1344 → 0.2.15-group-refactor1-dev-04167fd

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.js CHANGED
@@ -107,6 +107,7 @@ class Client {
107
107
  async getUser(groups, user, getClendAccountSummary) {
108
108
  const body = await handleApiCall(() => this.http.get(`/user?user=${user.toString()}&groups=${groups.map((g) => g.toString()).join(",")}&getClendAccountSummary=${getClendAccountSummary}`));
109
109
  const jsonRawResponse = JSON.parse(body);
110
+ console.log(JSON.stringify(jsonRawResponse, null, 2));
110
111
  // parse balances
111
112
  const walletBalances = [];
112
113
  for (const b of jsonRawResponse.wallet.balances) {
@@ -269,11 +270,11 @@ class Client {
269
270
  const body = await handleApiCall(() => this.http.get(`/group?group=${groupAddress.toString()}`));
270
271
  const marketJson = JSON.parse(body);
271
272
  const group = {
272
- group: new anchor_1.web3.PublicKey(marketJson.group),
273
- groupName: marketJson.groupName,
273
+ group: new anchor_1.web3.PublicKey(marketJson.group.group),
274
+ groupName: marketJson.group.groupName,
274
275
  banks: [],
275
276
  };
276
- for (const bankJson of marketJson.banks) {
277
+ for (const bankJson of marketJson.group.banks) {
277
278
  const bank = parseBank(bankJson);
278
279
  group.banks.push(bank);
279
280
  }
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-72c1344",
3
+ "version": "0.2.15-group-refactor1-dev-04167fd",
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
@@ -119,6 +119,7 @@ export class Client {
119
119
  );
120
120
 
121
121
  const jsonRawResponse: any = JSON.parse(body);
122
+ console.log(JSON.stringify(jsonRawResponse, null, 2));
122
123
 
123
124
  // parse balances
124
125
  const walletBalances: UserBalance[] = [];
@@ -310,11 +311,11 @@ export class Client {
310
311
 
311
312
  const marketJson: any = JSON.parse(body);
312
313
  const group: GroupAndBanks = {
313
- group: new web3.PublicKey(marketJson.group),
314
- groupName: marketJson.groupName,
314
+ group: new web3.PublicKey(marketJson.group.group),
315
+ groupName: marketJson.group.groupName,
315
316
  banks: [],
316
317
  };
317
- for (const bankJson of marketJson.banks) {
318
+ for (const bankJson of marketJson.group.banks) {
318
319
  const bank = parseBank(bankJson);
319
320
  group.banks.push(bank);
320
321
  }