@carrot-protocol/boost-http-client 0.4.2-fund-input1-dev-efa0bce → 0.4.2
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 +2 -2
- package/dist/index.js +1 -6
- package/dist/types.d.ts +0 -5
- package/package.json +2 -2
- package/src/index.ts +0 -14
- package/src/types.ts +0 -6
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, GetGroupsResponse, GetAccountResponse, GetAccountRequest
|
|
2
|
+
import { GetBankResponse, GetUserResponse, GetGroupResponse, GetUserRequest, GetGroupsResponse, GetAccountResponse, GetAccountRequest } from "./types";
|
|
3
3
|
import { ApiClient } from "./api";
|
|
4
4
|
import { PositionChartingExtension } from "./charting/position";
|
|
5
5
|
import { BankChartingExtension } from "./charting/bank";
|
|
@@ -61,7 +61,7 @@ export declare class Client extends ApiClient {
|
|
|
61
61
|
* @param request Deposit leverage request parameters
|
|
62
62
|
* @returns Deposit leverage operation result
|
|
63
63
|
*/
|
|
64
|
-
depositLeverage(clendGroup: web3.PublicKey, clendAccount: web3.PublicKey | null, inputTokenMint: web3.PublicKey, assetTokenMint: web3.PublicKey, liabilityTokenMint: web3.PublicKey, uiAmount: number, leverage: number, slippageBps: number
|
|
64
|
+
depositLeverage(clendGroup: web3.PublicKey, clendAccount: web3.PublicKey | null, inputTokenMint: web3.PublicKey, assetTokenMint: web3.PublicKey, liabilityTokenMint: web3.PublicKey, uiAmount: number, leverage: number, slippageBps: number): Promise<string>;
|
|
65
65
|
/**
|
|
66
66
|
* Adjust the leverage of an existing position
|
|
67
67
|
* @param request Adjust leverage request parameters
|
package/dist/index.js
CHANGED
|
@@ -356,11 +356,7 @@ class Client extends api_1.ApiClient {
|
|
|
356
356
|
* @param request Deposit leverage request parameters
|
|
357
357
|
* @returns Deposit leverage operation result
|
|
358
358
|
*/
|
|
359
|
-
async depositLeverage(clendGroup, clendAccount, inputTokenMint, assetTokenMint, liabilityTokenMint, uiAmount, leverage, slippageBps
|
|
360
|
-
if (!inputTokenMint.equals(assetTokenMint) &&
|
|
361
|
-
!inputTokenMint.equals(liabilityTokenMint)) {
|
|
362
|
-
throw new Error("Input mint must be the same as the asset or liability mint");
|
|
363
|
-
}
|
|
359
|
+
async depositLeverage(clendGroup, clendAccount, inputTokenMint, assetTokenMint, liabilityTokenMint, uiAmount, leverage, slippageBps) {
|
|
364
360
|
const req = {
|
|
365
361
|
owner: this.address(),
|
|
366
362
|
clendGroup,
|
|
@@ -371,7 +367,6 @@ class Client extends api_1.ApiClient {
|
|
|
371
367
|
depositAmountUi: uiAmount,
|
|
372
368
|
leverage,
|
|
373
369
|
slippageBps,
|
|
374
|
-
fundingInput,
|
|
375
370
|
};
|
|
376
371
|
const body = await this.handleApiCall(() => this.http.post("leverage/deposit", JSON.stringify(req)));
|
|
377
372
|
const depositLeverageResponse = JSON.parse(body);
|
package/dist/types.d.ts
CHANGED
|
@@ -47,11 +47,6 @@ export interface DepositLeverageRequest {
|
|
|
47
47
|
depositAmountUi: number;
|
|
48
48
|
leverage: number;
|
|
49
49
|
slippageBps: number;
|
|
50
|
-
fundingInput?: FundingInput;
|
|
51
|
-
}
|
|
52
|
-
export interface FundingInput {
|
|
53
|
-
mint: web3.PublicKey;
|
|
54
|
-
amountUi: number;
|
|
55
50
|
}
|
|
56
51
|
/**
|
|
57
52
|
* Response for deposit leverage operation
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carrot-protocol/boost-http-client",
|
|
3
|
-
"version": "0.4.2
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "HTTP client for Carrot Boost",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,4 +28,4 @@
|
|
|
28
28
|
"@carrot-protocol/clend-common": "^0.1.0",
|
|
29
29
|
"@coral-xyz/anchor": "^0.29.0"
|
|
30
30
|
}
|
|
31
|
-
}
|
|
31
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -32,9 +32,6 @@ import {
|
|
|
32
32
|
WithdrawResponse,
|
|
33
33
|
GetAccountResponse,
|
|
34
34
|
GetAccountRequest,
|
|
35
|
-
ExtensionKey,
|
|
36
|
-
Extension,
|
|
37
|
-
FundingInput,
|
|
38
35
|
} from "./types";
|
|
39
36
|
import encode from "bs58";
|
|
40
37
|
import { ApiClient } from "./api";
|
|
@@ -478,17 +475,7 @@ export class Client extends ApiClient {
|
|
|
478
475
|
uiAmount: number,
|
|
479
476
|
leverage: number,
|
|
480
477
|
slippageBps: number,
|
|
481
|
-
fundingInput?: FundingInput,
|
|
482
478
|
): Promise<string> {
|
|
483
|
-
if (
|
|
484
|
-
!inputTokenMint.equals(assetTokenMint) &&
|
|
485
|
-
!inputTokenMint.equals(liabilityTokenMint)
|
|
486
|
-
) {
|
|
487
|
-
throw new Error(
|
|
488
|
-
"Input mint must be the same as the asset or liability mint",
|
|
489
|
-
);
|
|
490
|
-
}
|
|
491
|
-
|
|
492
479
|
const req: DepositLeverageRequest = {
|
|
493
480
|
owner: this.address(),
|
|
494
481
|
clendGroup,
|
|
@@ -499,7 +486,6 @@ export class Client extends ApiClient {
|
|
|
499
486
|
depositAmountUi: uiAmount,
|
|
500
487
|
leverage,
|
|
501
488
|
slippageBps,
|
|
502
|
-
fundingInput,
|
|
503
489
|
};
|
|
504
490
|
const body = await this.handleApiCall(() =>
|
|
505
491
|
this.http.post("leverage/deposit", JSON.stringify(req)),
|
package/src/types.ts
CHANGED