@carrot-protocol/boost-http-client 0.4.0-stub-position-endpoints-dev-2ccd3c3 → 0.4.0-stub-position-endpoints-dev-be5af0a
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 -3
- package/dist/index.js +13 -15
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
- package/src/index.ts +24 -19
- package/src/types.ts +1 -1
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";
|
|
@@ -78,6 +78,9 @@ export declare class Client extends ApiClient {
|
|
|
78
78
|
* Withdraw emissions from a bank
|
|
79
79
|
* @returns Withdraw emissions operation result
|
|
80
80
|
*/
|
|
81
|
-
withdrawEmissions(): Promise<string>;
|
|
82
|
-
|
|
81
|
+
withdrawEmissions(clendAccount: web3.PublicKey): Promise<string>;
|
|
82
|
+
getPerformanceChartingExtension(clendAccount: web3.PublicKey): Promise<PositionChartingExtension>;
|
|
83
|
+
getGroupChartingExtension(group: web3.PublicKey): Promise<GroupChartingExtension>;
|
|
84
|
+
getWalletChartingExtension(address?: web3.PublicKey): Promise<WalletChartingExtension>;
|
|
85
|
+
getBankChartingExtension(bank: web3.PublicKey): Promise<BankChartingExtension>;
|
|
83
86
|
}
|
package/dist/index.js
CHANGED
|
@@ -419,28 +419,26 @@ class Client extends api_1.ApiClient {
|
|
|
419
419
|
* Withdraw emissions from a bank
|
|
420
420
|
* @returns Withdraw emissions operation result
|
|
421
421
|
*/
|
|
422
|
-
async withdrawEmissions() {
|
|
422
|
+
async withdrawEmissions(clendAccount) {
|
|
423
423
|
const req = {
|
|
424
|
-
|
|
424
|
+
clendAccount,
|
|
425
425
|
};
|
|
426
426
|
const body = await this.handleApiCall(() => this.http.post("emissions/withdraw", JSON.stringify(req)));
|
|
427
427
|
const withdrawEmissionsResponse = JSON.parse(body);
|
|
428
428
|
const txSig = await this.send(withdrawEmissionsResponse.unsignedBase64Tx, withdrawEmissionsResponse.userRequestId);
|
|
429
429
|
return txSig;
|
|
430
430
|
}
|
|
431
|
-
async
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
throw new Error(`Unknown extension: ${extension}`);
|
|
443
|
-
}
|
|
431
|
+
async getPerformanceChartingExtension(clendAccount) {
|
|
432
|
+
return new position_1.PositionChartingExtension(this.baseUrl, clendAccount);
|
|
433
|
+
}
|
|
434
|
+
async getGroupChartingExtension(group) {
|
|
435
|
+
return new group_1.GroupChartingExtension(this.baseUrl, group);
|
|
436
|
+
}
|
|
437
|
+
async getWalletChartingExtension(address) {
|
|
438
|
+
return new wallet_1.WalletChartingExtension(this.baseUrl, address ?? this.address());
|
|
439
|
+
}
|
|
440
|
+
async getBankChartingExtension(bank) {
|
|
441
|
+
return new bank_1.BankChartingExtension(this.baseUrl, bank);
|
|
444
442
|
}
|
|
445
443
|
}
|
|
446
444
|
exports.Client = Client;
|
package/dist/types.d.ts
CHANGED
|
@@ -95,7 +95,7 @@ export interface WithdrawLeverageResponse {
|
|
|
95
95
|
* Request to withdraw emissions from a bank
|
|
96
96
|
*/
|
|
97
97
|
export interface WithdrawEmissionsRequest {
|
|
98
|
-
|
|
98
|
+
clendAccount: web3.PublicKey;
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
101
|
* Response for withdraw emissions operation
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carrot-protocol/boost-http-client",
|
|
3
|
-
"version": "0.4.0-stub-position-endpoints-dev-
|
|
3
|
+
"version": "0.4.0-stub-position-endpoints-dev-be5af0a",
|
|
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
|
@@ -586,9 +586,9 @@ export class Client extends ApiClient {
|
|
|
586
586
|
* Withdraw emissions from a bank
|
|
587
587
|
* @returns Withdraw emissions operation result
|
|
588
588
|
*/
|
|
589
|
-
async withdrawEmissions(): Promise<string> {
|
|
589
|
+
async withdrawEmissions(clendAccount: web3.PublicKey): Promise<string> {
|
|
590
590
|
const req: WithdrawEmissionsRequest = {
|
|
591
|
-
|
|
591
|
+
clendAccount,
|
|
592
592
|
};
|
|
593
593
|
|
|
594
594
|
const body = await this.handleApiCall(() =>
|
|
@@ -606,23 +606,28 @@ export class Client extends ApiClient {
|
|
|
606
606
|
return txSig;
|
|
607
607
|
}
|
|
608
608
|
|
|
609
|
-
public async
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
609
|
+
public async getPerformanceChartingExtension(
|
|
610
|
+
clendAccount: web3.PublicKey,
|
|
611
|
+
): Promise<PositionChartingExtension> {
|
|
612
|
+
return new PositionChartingExtension(this.baseUrl, clendAccount);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
public async getGroupChartingExtension(
|
|
616
|
+
group: web3.PublicKey,
|
|
617
|
+
): Promise<GroupChartingExtension> {
|
|
618
|
+
return new GroupChartingExtension(this.baseUrl, group);
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
public async getWalletChartingExtension(
|
|
622
|
+
address?: web3.PublicKey,
|
|
623
|
+
): Promise<WalletChartingExtension> {
|
|
624
|
+
return new WalletChartingExtension(this.baseUrl, address ?? this.address());
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
public async getBankChartingExtension(
|
|
628
|
+
bank: web3.PublicKey,
|
|
629
|
+
): Promise<BankChartingExtension> {
|
|
630
|
+
return new BankChartingExtension(this.baseUrl, bank);
|
|
626
631
|
}
|
|
627
632
|
}
|
|
628
633
|
|
package/src/types.ts
CHANGED