@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 +5 -5
- package/dist/index.js +1 -2
- package/dist/types.d.ts +0 -1
- package/package.json +1 -1
- package/src/index.ts +5 -5
- package/src/types.ts +0 -1
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<
|
|
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<
|
|
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<
|
|
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(
|
|
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(
|
|
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
package/package.json
CHANGED
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<
|
|
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<
|
|
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<
|
|
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(
|
|
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
|
);
|