@carrot-protocol/boost-http-client 0.2.14 → 0.2.15-group-refactor1-dev-04f0b0e
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 +6 -6
- package/dist/index.js +7 -7
- package/dist/types.d.ts +0 -3
- package/package.json +1 -1
- package/src/index.ts +7 -11
- package/src/types.ts +0 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnchorProvider, web3 } from "@coral-xyz/anchor";
|
|
2
|
-
import { GetBankResponse, GetUserResponse, GetGroupResponse, GetUserRequest
|
|
2
|
+
import { GetBankResponse, GetUserResponse, GetGroupResponse, GetUserRequest } from "./types";
|
|
3
3
|
export * from "./types";
|
|
4
4
|
export * from "./utils";
|
|
5
5
|
export * as Common from "@carrot-protocol/clend-common";
|
|
@@ -30,16 +30,16 @@ export declare class Client {
|
|
|
30
30
|
getUser(request: GetUserRequest): Promise<GetUserResponse>;
|
|
31
31
|
/**
|
|
32
32
|
* Get market details
|
|
33
|
-
* @
|
|
33
|
+
* @param groupAddress group public key
|
|
34
|
+
* @returns Group Details, which is really just all the bank data for that group
|
|
34
35
|
*/
|
|
35
|
-
getGroup(
|
|
36
|
+
getGroup(groupAddress: web3.PublicKey): Promise<GetGroupResponse>;
|
|
36
37
|
/**
|
|
37
38
|
* Get bank details
|
|
38
|
-
* @param
|
|
39
|
-
* @param addrType "mint" or "bank"
|
|
39
|
+
* @param bankAddress bank public key
|
|
40
40
|
* @returns Bank details
|
|
41
41
|
*/
|
|
42
|
-
getBank(
|
|
42
|
+
getBank(bankAddress: web3.PublicKey): Promise<GetBankResponse>;
|
|
43
43
|
/**
|
|
44
44
|
* Deposit collateral and create a leveraged position
|
|
45
45
|
* @param request Deposit leverage request parameters
|
package/dist/index.js
CHANGED
|
@@ -223,10 +223,11 @@ class Client {
|
|
|
223
223
|
}
|
|
224
224
|
/**
|
|
225
225
|
* Get market details
|
|
226
|
-
* @
|
|
226
|
+
* @param groupAddress group public key
|
|
227
|
+
* @returns Group Details, which is really just all the bank data for that group
|
|
227
228
|
*/
|
|
228
|
-
async getGroup(
|
|
229
|
-
const body = await handleApiCall(() => this.http.get(`/group?group=${
|
|
229
|
+
async getGroup(groupAddress) {
|
|
230
|
+
const body = await handleApiCall(() => this.http.get(`/group?group=${groupAddress.toString()}`));
|
|
230
231
|
const marketJson = JSON.parse(body);
|
|
231
232
|
const banks = [];
|
|
232
233
|
for (const bankJson of marketJson.banks) {
|
|
@@ -240,12 +241,11 @@ class Client {
|
|
|
240
241
|
}
|
|
241
242
|
/**
|
|
242
243
|
* Get bank details
|
|
243
|
-
* @param
|
|
244
|
-
* @param addrType "mint" or "bank"
|
|
244
|
+
* @param bankAddress bank public key
|
|
245
245
|
* @returns Bank details
|
|
246
246
|
*/
|
|
247
|
-
async getBank(
|
|
248
|
-
const body = await handleApiCall(() => this.http.get(`/bank
|
|
247
|
+
async getBank(bankAddress) {
|
|
248
|
+
const body = await handleApiCall(() => this.http.get(`/bank?bank=${bankAddress.toString()}`));
|
|
249
249
|
const bankJson = JSON.parse(body);
|
|
250
250
|
const bank = parseBank(bankJson.bank);
|
|
251
251
|
const response = {
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
GetUserRequest,
|
|
20
20
|
ClendAccountTxSummary,
|
|
21
21
|
UserRequest,
|
|
22
|
-
GetGroupRequest,
|
|
23
22
|
} from "./types";
|
|
24
23
|
import encode from "bs58";
|
|
25
24
|
|
|
@@ -249,11 +248,12 @@ export class Client {
|
|
|
249
248
|
|
|
250
249
|
/**
|
|
251
250
|
* Get market details
|
|
252
|
-
* @
|
|
251
|
+
* @param groupAddress group public key
|
|
252
|
+
* @returns Group Details, which is really just all the bank data for that group
|
|
253
253
|
*/
|
|
254
|
-
async getGroup(
|
|
254
|
+
async getGroup(groupAddress: web3.PublicKey): Promise<GetGroupResponse> {
|
|
255
255
|
const body = await handleApiCall(() =>
|
|
256
|
-
this.http.get(`/group?group=${
|
|
256
|
+
this.http.get(`/group?group=${groupAddress.toString()}`),
|
|
257
257
|
);
|
|
258
258
|
|
|
259
259
|
const marketJson: any = JSON.parse(body);
|
|
@@ -272,16 +272,12 @@ export class Client {
|
|
|
272
272
|
|
|
273
273
|
/**
|
|
274
274
|
* Get bank details
|
|
275
|
-
* @param
|
|
276
|
-
* @param addrType "mint" or "bank"
|
|
275
|
+
* @param bankAddress bank public key
|
|
277
276
|
* @returns Bank details
|
|
278
277
|
*/
|
|
279
|
-
async getBank(
|
|
280
|
-
addr: web3.PublicKey,
|
|
281
|
-
addrType: "mint" | "bank",
|
|
282
|
-
): Promise<GetBankResponse> {
|
|
278
|
+
async getBank(bankAddress: web3.PublicKey): Promise<GetBankResponse> {
|
|
283
279
|
const body = await handleApiCall(() =>
|
|
284
|
-
this.http.get(`/bank
|
|
280
|
+
this.http.get(`/bank?bank=${bankAddress.toString()}`),
|
|
285
281
|
);
|
|
286
282
|
|
|
287
283
|
const bankJson: any = JSON.parse(body);
|