@carrot-protocol/boost-http-client 0.2.0-mrgn-fork1-dev-e3a1df6 → 0.2.0-mrgn-fork1-dev-37e1e0b

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
@@ -1,5 +1,5 @@
1
1
  import { AnchorProvider, web3 } from "@coral-xyz/anchor";
2
- import { DepositLeverageRequest, GetBankResponse, GetUserResponse, ModifyLeverageRequest, WithdrawLeverageRequest } from "./types";
2
+ import { DepositLeverageRequest, GetBankResponse, GetUserResponse, AdjustLeverageRequest, WithdrawLeverageRequest } from "./types";
3
3
  export * from "./types";
4
4
  /**
5
5
  * HTTP Client for Carrot Boost API
@@ -39,11 +39,11 @@ export declare class Client {
39
39
  */
40
40
  depositLeverage(params: DepositLeverageRequest): Promise<string>;
41
41
  /**
42
- * Modify the leverage of an existing position
43
- * @param request Modify leverage request parameters
44
- * @returns Modify leverage operation result
42
+ * Adjust the leverage of an existing position
43
+ * @param request Adjust leverage request parameters
44
+ * @returns Adjust leverage operation result
45
45
  */
46
- modifyLeverage(params: ModifyLeverageRequest): Promise<any>;
46
+ adjustLeverage(params: AdjustLeverageRequest): Promise<any>;
47
47
  /**
48
48
  * Withdraw from or close a leveraged position
49
49
  * @param request Withdraw leverage request parameters
package/dist/index.js CHANGED
@@ -132,14 +132,14 @@ class Client {
132
132
  return txSig;
133
133
  }
134
134
  /**
135
- * Modify the leverage of an existing position
136
- * @param request Modify leverage request parameters
137
- * @returns Modify leverage operation result
135
+ * Adjust the leverage of an existing position
136
+ * @param request Adjust leverage request parameters
137
+ * @returns Adjust leverage operation result
138
138
  */
139
- async modifyLeverage(params) {
140
- const body = await handleApiCall(() => this.http.post("leverage/modify", JSON.stringify(params)));
141
- const modifyLeverageResponse = JSON.parse(body);
142
- const txSig = await this.send(modifyLeverageResponse.unsignedBase64Tx);
139
+ async adjustLeverage(params) {
140
+ const body = await handleApiCall(() => this.http.post("leverage/adjust", JSON.stringify(params)));
141
+ const adjustLeverageResponse = JSON.parse(body);
142
+ const txSig = await this.send(adjustLeverageResponse.unsignedBase64Tx);
143
143
  return txSig;
144
144
  }
145
145
  /**
package/dist/types.d.ts CHANGED
@@ -25,17 +25,17 @@ export interface DepositLeverageResponse {
25
25
  unsignedBase64Tx: string;
26
26
  }
27
27
  /**
28
- * Request to modify the leverage of an existing position
28
+ * Request to adjust the leverage of an existing position
29
29
  */
30
- export interface ModifyLeverageRequest {
30
+ export interface AdjustLeverageRequest {
31
31
  owner: web3.PublicKey;
32
32
  leverage: number;
33
- slippagePct: number;
33
+ slippageBps: number;
34
34
  }
35
35
  /**
36
- * Response for modify leverage operation
36
+ * Response for adjust leverage operation
37
37
  */
38
- export interface ModifyLeverageResponse {
38
+ export interface AdjustLeverageResponse {
39
39
  unsignedBase64Tx: string;
40
40
  }
41
41
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carrot-protocol/boost-http-client",
3
- "version": "0.2.0-mrgn-fork1-dev-e3a1df6",
3
+ "version": "0.2.0-mrgn-fork1-dev-37e1e0b",
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
@@ -5,8 +5,8 @@ import {
5
5
  DepositLeverageResponse,
6
6
  GetBankResponse,
7
7
  GetUserResponse,
8
- ModifyLeverageRequest,
9
- ModifyLeverageResponse,
8
+ AdjustLeverageRequest,
9
+ AdjustLeverageResponse,
10
10
  SendRequest,
11
11
  WithdrawLeverageRequest,
12
12
  WithdrawLeverageResponse,
@@ -135,18 +135,18 @@ export class Client {
135
135
  }
136
136
 
137
137
  /**
138
- * Modify the leverage of an existing position
139
- * @param request Modify leverage request parameters
140
- * @returns Modify leverage operation result
138
+ * Adjust the leverage of an existing position
139
+ * @param request Adjust leverage request parameters
140
+ * @returns Adjust leverage operation result
141
141
  */
142
- async modifyLeverage(params: ModifyLeverageRequest): Promise<any> {
142
+ async adjustLeverage(params: AdjustLeverageRequest): Promise<any> {
143
143
  const body = await handleApiCall(() =>
144
- this.http.post("leverage/modify", JSON.stringify(params)),
144
+ this.http.post("leverage/adjust", JSON.stringify(params)),
145
145
  );
146
146
 
147
- const modifyLeverageResponse: ModifyLeverageResponse = JSON.parse(body);
147
+ const adjustLeverageResponse: AdjustLeverageResponse = JSON.parse(body);
148
148
 
149
- const txSig = await this.send(modifyLeverageResponse.unsignedBase64Tx);
149
+ const txSig = await this.send(adjustLeverageResponse.unsignedBase64Tx);
150
150
 
151
151
  return txSig;
152
152
  }
package/src/types.ts CHANGED
@@ -33,18 +33,18 @@ export interface DepositLeverageResponse {
33
33
  }
34
34
 
35
35
  /**
36
- * Request to modify the leverage of an existing position
36
+ * Request to adjust the leverage of an existing position
37
37
  */
38
- export interface ModifyLeverageRequest {
38
+ export interface AdjustLeverageRequest {
39
39
  owner: web3.PublicKey;
40
40
  leverage: number;
41
- slippagePct: number;
41
+ slippageBps: number;
42
42
  }
43
43
 
44
44
  /**
45
- * Response for modify leverage operation
45
+ * Response for adjust leverage operation
46
46
  */
47
- export interface ModifyLeverageResponse {
47
+ export interface AdjustLeverageResponse {
48
48
  unsignedBase64Tx: string;
49
49
  }
50
50