@grvt/client 1.6.12 → 1.6.14
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/TDG/index.d.ts +13 -1
- package/TDG/index.js +63 -0
- package/interfaces/codegen/data.interface.d.ts +9 -0
- package/interfaces/codegen/schema-maps/api_find_account_multiplier_request.js +6 -2
- package/interfaces/codegen/schema-maps/api_find_account_multiplier_response.js +8 -2
- package/interfaces/codegen/schema-maps/api_position.js +10 -2
- package/package.json +1 -1
package/TDG/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AxiosRequestConfig } from 'axios';
|
|
2
|
-
import type { IAckResponse, IApiAggregatedAccountSummaryResponse, IApiCancelAllOrdersRequest, IApiCancelAllOrdersResponse, IApiCancelOrderRequest, IApiCancelOrderResponse, IApiCreateBulkOrdersRequest, IApiCreateBulkOrdersResponse, IApiCreateOrderRequest, IApiCreateOrderResponse, IApiCrossExchVaultAttestEquityRequest, IApiCrossExchVaultGetInvestorAllocationStatsResponse, IApiCrossExchVaultInvestCancelRequest, IApiCrossExchVaultLockRequest, IApiCrossExchVaultPreInternalTransferCheckRequest, IApiCrossExchVaultPreInternalTransferCheckResponse, IApiCrossExchVaultPreWithdrawCheckRequest, IApiCrossExchVaultPreWithdrawCheckResponse, IApiCrossExchVaultTriggerRedemptionRequest, IApiCrossExchVaultUnlockRequest, IApiCrossExchVaultViewInvestmentQueueRequest, IApiCrossExchVaultViewInvestmentQueueResponse, IApiCrossExchVaultViewPendingInvestmentRequest, IApiCrossExchVaultViewPendingInvestmentResponse, IApiDedustPositionRequest, IApiDedustPositionResponse, IApiDepositHistoryRequest, IApiDepositHistoryResponse, IApiFillHistoryRequest, IApiFillHistoryResponse, IApiFundingAccountSummaryResponse, IApiFundingPaymentHistoryRequest, IApiFundingPaymentHistoryResponse, IApiGetAllInitialLeverageRequest, IApiGetAllInitialLeverageResponse, IApiGetMarginTiersResponse, IApiGetOrderGroupRequest, IApiGetOrderGroupResponse, IApiGetOrderRequest, IApiGetOrderResponse, IApiGetPriceProtectionBandsResponse, IApiOpenOrdersRequest, IApiOpenOrdersResponse, IApiOrderHistoryRequest, IApiOrderHistoryResponse, IApiPositionsRequest, IApiPositionsResponse, IApiPreDepositCheckRequest, IApiPreDepositCheckResponse, IApiPreOrderCheckRequest, IApiPreOrderCheckResponse, IApiQueryAccountPerformanceTrendRequest, IApiQueryAccountPerformanceTrendResponse, IApiQueryAccountTodayPerformanceResponse, IApiQueryListFundingAccountSummaryRequest, IApiQueryListFundingAccountSummaryResponse, IApiQueryListSubAccountSummaryRequest, IApiQueryListSubAccountSummaryResponse, IApiQueryTradingAccountRiskMetricRequest, IApiQueryTradingAccountRiskMetricResponse, IApiQueryTradingPerformanceRequest, IApiQueryTradingPerformanceResponse, IApiQueryTradingPerformanceSummaryRequest, IApiQueryTradingPerformanceSummaryResponse, IApiQueryTradingPerformanceTrendRequest, IApiQueryTradingPerformanceTrendResponse, IApiQueryVaultInvestorHistoryRequest, IApiQueryVaultInvestorHistoryResponse, IApiQueryVaultInvestorHistoryStatsRequest, IApiQueryVaultInvestorHistoryStatsResponse, IApiQueryVaultManagerInvestorHistoryRequest, IApiQueryVaultManagerInvestorHistoryResponse, IApiReplaceOrdersRequest, IApiReplaceOrdersResponse, IApiSetInitialLeverageRequest, IApiSetInitialLeverageResponse, IApiSocializedLossStatusResponse, IApiSubAccountHistoryRequest, IApiSubAccountHistoryResponse, IApiSubAccountSummaryRequest, IApiSubAccountSummaryResponse, IApiTimedAssetExposureRequest, IApiTimedAssetExposureResponse, IApiTransferHistoryRequest, IApiTransferHistoryResponse, IApiTransferRequest, IApiTransferResponse, IApiVaultBurnTokensRequest, IApiVaultInvestorSummaryRequest, IApiVaultInvestorSummaryResponse, IApiVaultInvestRequest, IApiVaultRedeemCancelRequest, IApiVaultRedeemRequest, IApiVaultViewRedemptionQueueRequest, IApiVaultViewRedemptionQueueResponse, IApiWithdrawalHistoryRequest, IApiWithdrawalHistoryResponse, IApiWithdrawalRequest, IConfig } from '../interfaces';
|
|
2
|
+
import type { IAckResponse, IApiAddIsolatedPositionMarginRequest, IApiAddIsolatedPositionMarginResponse, IApiAggregatedAccountSummaryResponse, IApiAuthorizeBuilderRequest, IApiBuilderFillHistoryRequest, IApiBuilderFillHistoryResponse, IApiCancelAllOrdersRequest, IApiCancelAllOrdersResponse, IApiCancelOrderRequest, IApiCancelOrderResponse, IApiCreateBulkOrdersRequest, IApiCreateBulkOrdersResponse, IApiCreateOrderRequest, IApiCreateOrderResponse, IApiCrossExchVaultAttestEquityRequest, IApiCrossExchVaultGetInvestorAllocationStatsResponse, IApiCrossExchVaultInvestCancelRequest, IApiCrossExchVaultLockRequest, IApiCrossExchVaultPreInternalTransferCheckRequest, IApiCrossExchVaultPreInternalTransferCheckResponse, IApiCrossExchVaultPreWithdrawCheckRequest, IApiCrossExchVaultPreWithdrawCheckResponse, IApiCrossExchVaultTriggerRedemptionRequest, IApiCrossExchVaultUnlockRequest, IApiCrossExchVaultViewInvestmentQueueRequest, IApiCrossExchVaultViewInvestmentQueueResponse, IApiCrossExchVaultViewPendingInvestmentRequest, IApiCrossExchVaultViewPendingInvestmentResponse, IApiDedustPositionRequest, IApiDedustPositionResponse, IApiDepositHistoryRequest, IApiDepositHistoryResponse, IApiFillHistoryRequest, IApiFillHistoryResponse, IApiFundingAccountSummaryResponse, IApiFundingPaymentHistoryRequest, IApiFundingPaymentHistoryResponse, IApiGetAllInitialLeverageRequest, IApiGetAllInitialLeverageResponse, IApiGetAuthorizedBuildersResponse, IApiGetIsolatedPositionMarginLimitsRequest, IApiGetIsolatedPositionMarginLimitsResponse, IApiGetMarginTiersResponse, IApiGetOrderGroupRequest, IApiGetOrderGroupResponse, IApiGetOrderRequest, IApiGetOrderResponse, IApiGetPriceProtectionBandsResponse, IApiOpenOrdersRequest, IApiOpenOrdersResponse, IApiOrderHistoryRequest, IApiOrderHistoryResponse, IApiPositionsRequest, IApiPositionsResponse, IApiPreDepositCheckRequest, IApiPreDepositCheckResponse, IApiPreOrderCheckRequest, IApiPreOrderCheckResponse, IApiQueryAccountDailyPerformanceRequest, IApiQueryAccountDailyPerformanceResponse, IApiQueryAccountPerformanceResponse, IApiQueryAccountPerformanceTrendRequest, IApiQueryAccountPerformanceTrendResponse, IApiQueryAccountTodayPerformanceResponse, IApiQueryListFundingAccountSummaryRequest, IApiQueryListFundingAccountSummaryResponse, IApiQueryListSubAccountSummaryRequest, IApiQueryListSubAccountSummaryResponse, IApiQuerySubAccountDailyPerformanceRequest, IApiQuerySubAccountDailyPerformanceResponse, IApiQueryTradingAccountRiskMetricRequest, IApiQueryTradingAccountRiskMetricResponse, IApiQueryTradingPerformanceRequest, IApiQueryTradingPerformanceResponse, IApiQueryTradingPerformanceSummaryRequest, IApiQueryTradingPerformanceSummaryResponse, IApiQueryTradingPerformanceTrendRequest, IApiQueryTradingPerformanceTrendResponse, IApiQueryVaultInvestorHistoryRequest, IApiQueryVaultInvestorHistoryResponse, IApiQueryVaultInvestorHistoryStatsRequest, IApiQueryVaultInvestorHistoryStatsResponse, IApiQueryVaultManagerInvestorHistoryRequest, IApiQueryVaultManagerInvestorHistoryResponse, IApiReplaceOrdersRequest, IApiReplaceOrdersResponse, IApiSetInitialLeverageRequest, IApiSetInitialLeverageResponse, IApiSetSubAccountPositionMarginConfigRequest, IApiSetSubAccountPositionMarginConfigResponse, IApiSocializedLossStatusResponse, IApiSubAccountHistoryRequest, IApiSubAccountHistoryResponse, IApiSubAccountSummaryRequest, IApiSubAccountSummaryResponse, IApiTimedAssetExposureRequest, IApiTimedAssetExposureResponse, IApiTransferHistoryRequest, IApiTransferHistoryResponse, IApiTransferRequest, IApiTransferResponse, IApiVaultBurnTokensRequest, IApiVaultInvestorSummaryRequest, IApiVaultInvestorSummaryResponse, IApiVaultInvestRequest, IApiVaultRedeemCancelRequest, IApiVaultRedeemRequest, IApiVaultViewRedemptionQueueRequest, IApiVaultViewRedemptionQueueResponse, IApiWithdrawalHistoryRequest, IApiWithdrawalHistoryResponse, IApiWithdrawalRequest, IConfig } from '../interfaces';
|
|
3
3
|
export declare class TDG {
|
|
4
4
|
private readonly _axios;
|
|
5
5
|
private readonly _fullUrl;
|
|
@@ -37,6 +37,15 @@ export declare class TDG {
|
|
|
37
37
|
* @see https://api-docs.grvt.io/trading_api/#positions
|
|
38
38
|
*/
|
|
39
39
|
positions(payload: IApiPositionsRequest, config?: AxiosRequestConfig): Promise<IApiPositionsResponse>;
|
|
40
|
+
setPositionConfig(payload: IApiSetSubAccountPositionMarginConfigRequest, config?: AxiosRequestConfig): Promise<IApiSetSubAccountPositionMarginConfigResponse>;
|
|
41
|
+
addPositionMargin(payload: IApiAddIsolatedPositionMarginRequest, config?: AxiosRequestConfig): Promise<IApiAddIsolatedPositionMarginResponse>;
|
|
42
|
+
getPositionMarginLimits(payload: IApiGetIsolatedPositionMarginLimitsRequest, config?: AxiosRequestConfig): Promise<IApiGetIsolatedPositionMarginLimitsResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* APIs for Builder
|
|
45
|
+
*/
|
|
46
|
+
authorizeBuilder(payload: IApiAuthorizeBuilderRequest, config?: AxiosRequestConfig): Promise<IAckResponse>;
|
|
47
|
+
getAuthorizedBuilders(config?: AxiosRequestConfig): Promise<IApiGetAuthorizedBuildersResponse>;
|
|
48
|
+
builderFillHistory(payload: IApiBuilderFillHistoryRequest, config?: AxiosRequestConfig): Promise<IApiBuilderFillHistoryResponse>;
|
|
40
49
|
/**
|
|
41
50
|
* @see https://api-docs.grvt.io/trading_api/#sub-account-summary
|
|
42
51
|
*/
|
|
@@ -148,4 +157,7 @@ export declare class TDG {
|
|
|
148
157
|
tradingPerformanceSummary(payload: IApiQueryTradingPerformanceSummaryRequest, config?: AxiosRequestConfig): Promise<IApiQueryTradingPerformanceSummaryResponse>;
|
|
149
158
|
subAccountRiskMetric(payload: IApiQueryTradingAccountRiskMetricRequest, config?: AxiosRequestConfig): Promise<IApiQueryTradingAccountRiskMetricResponse>;
|
|
150
159
|
vaultInvestorHistoryStats(payload: IApiQueryVaultInvestorHistoryStatsRequest, config?: AxiosRequestConfig): Promise<IApiQueryVaultInvestorHistoryStatsResponse>;
|
|
160
|
+
accountPerformance(config?: AxiosRequestConfig): Promise<IApiQueryAccountPerformanceResponse>;
|
|
161
|
+
accountDailyPerformance(payload: IApiQueryAccountDailyPerformanceRequest, config?: AxiosRequestConfig): Promise<IApiQueryAccountDailyPerformanceResponse>;
|
|
162
|
+
subAccountDailyPerformance(payload: IApiQuerySubAccountDailyPerformanceRequest, config?: AxiosRequestConfig): Promise<IApiQuerySubAccountDailyPerformanceResponse>;
|
|
151
163
|
}
|
package/TDG/index.js
CHANGED
|
@@ -3,7 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TDG = void 0;
|
|
4
4
|
const interfaces_1 = require("../interfaces");
|
|
5
5
|
const ack_response_1 = require("../interfaces/codegen/schema-maps/ack_response");
|
|
6
|
+
const api_add_isolated_position_margin_request_1 = require("../interfaces/codegen/schema-maps/api_add_isolated_position_margin_request");
|
|
7
|
+
const api_add_isolated_position_margin_response_1 = require("../interfaces/codegen/schema-maps/api_add_isolated_position_margin_response");
|
|
6
8
|
const api_aggregated_account_summary_response_1 = require("../interfaces/codegen/schema-maps/api_aggregated_account_summary_response");
|
|
9
|
+
const api_authorize_builder_request_1 = require("../interfaces/codegen/schema-maps/api_authorize_builder_request");
|
|
10
|
+
const api_builder_fill_history_request_1 = require("../interfaces/codegen/schema-maps/api_builder_fill_history_request");
|
|
11
|
+
const api_builder_fill_history_response_1 = require("../interfaces/codegen/schema-maps/api_builder_fill_history_response");
|
|
7
12
|
const api_cancel_all_orders_request_1 = require("../interfaces/codegen/schema-maps/api_cancel_all_orders_request");
|
|
8
13
|
const api_cancel_all_orders_response_1 = require("../interfaces/codegen/schema-maps/api_cancel_all_orders_response");
|
|
9
14
|
const api_cancel_order_request_1 = require("../interfaces/codegen/schema-maps/api_cancel_order_request");
|
|
@@ -37,6 +42,9 @@ const api_funding_payment_history_request_1 = require("../interfaces/codegen/sch
|
|
|
37
42
|
const api_funding_payment_history_response_1 = require("../interfaces/codegen/schema-maps/api_funding_payment_history_response");
|
|
38
43
|
const api_get_all_initial_leverage_request_1 = require("../interfaces/codegen/schema-maps/api_get_all_initial_leverage_request");
|
|
39
44
|
const api_get_all_initial_leverage_response_1 = require("../interfaces/codegen/schema-maps/api_get_all_initial_leverage_response");
|
|
45
|
+
const api_get_authorized_builders_response_1 = require("../interfaces/codegen/schema-maps/api_get_authorized_builders_response");
|
|
46
|
+
const api_get_isolated_position_margin_limits_request_1 = require("../interfaces/codegen/schema-maps/api_get_isolated_position_margin_limits_request");
|
|
47
|
+
const api_get_isolated_position_margin_limits_response_1 = require("../interfaces/codegen/schema-maps/api_get_isolated_position_margin_limits_response");
|
|
40
48
|
const api_get_margin_tiers_response_1 = require("../interfaces/codegen/schema-maps/api_get_margin_tiers_response");
|
|
41
49
|
const api_get_order_group_request_1 = require("../interfaces/codegen/schema-maps/api_get_order_group_request");
|
|
42
50
|
const api_get_order_group_response_1 = require("../interfaces/codegen/schema-maps/api_get_order_group_response");
|
|
@@ -53,6 +61,9 @@ const api_pre_deposit_check_request_1 = require("../interfaces/codegen/schema-ma
|
|
|
53
61
|
const api_pre_deposit_check_response_1 = require("../interfaces/codegen/schema-maps/api_pre_deposit_check_response");
|
|
54
62
|
const api_pre_order_check_request_1 = require("../interfaces/codegen/schema-maps/api_pre_order_check_request");
|
|
55
63
|
const api_pre_order_check_response_1 = require("../interfaces/codegen/schema-maps/api_pre_order_check_response");
|
|
64
|
+
const api_query_account_daily_performance_request_1 = require("../interfaces/codegen/schema-maps/api_query_account_daily_performance_request");
|
|
65
|
+
const api_query_account_daily_performance_response_1 = require("../interfaces/codegen/schema-maps/api_query_account_daily_performance_response");
|
|
66
|
+
const api_query_account_performance_response_1 = require("../interfaces/codegen/schema-maps/api_query_account_performance_response");
|
|
56
67
|
const api_query_account_performance_trend_request_1 = require("../interfaces/codegen/schema-maps/api_query_account_performance_trend_request");
|
|
57
68
|
const api_query_account_performance_trend_response_1 = require("../interfaces/codegen/schema-maps/api_query_account_performance_trend_response");
|
|
58
69
|
const api_query_account_today_performance_response_1 = require("../interfaces/codegen/schema-maps/api_query_account_today_performance_response");
|
|
@@ -60,6 +71,8 @@ const api_query_list_funding_account_summary_request_1 = require("../interfaces/
|
|
|
60
71
|
const api_query_list_funding_account_summary_response_1 = require("../interfaces/codegen/schema-maps/api_query_list_funding_account_summary_response");
|
|
61
72
|
const api_query_list_sub_account_summary_request_1 = require("../interfaces/codegen/schema-maps/api_query_list_sub_account_summary_request");
|
|
62
73
|
const api_query_list_sub_account_summary_response_1 = require("../interfaces/codegen/schema-maps/api_query_list_sub_account_summary_response");
|
|
74
|
+
const api_query_sub_account_daily_performance_request_1 = require("../interfaces/codegen/schema-maps/api_query_sub_account_daily_performance_request");
|
|
75
|
+
const api_query_sub_account_daily_performance_response_1 = require("../interfaces/codegen/schema-maps/api_query_sub_account_daily_performance_response");
|
|
63
76
|
const api_query_trading_account_risk_metric_request_1 = require("../interfaces/codegen/schema-maps/api_query_trading_account_risk_metric_request");
|
|
64
77
|
const api_query_trading_account_risk_metric_response_1 = require("../interfaces/codegen/schema-maps/api_query_trading_account_risk_metric_response");
|
|
65
78
|
const api_query_trading_performance_request_1 = require("../interfaces/codegen/schema-maps/api_query_trading_performance_request");
|
|
@@ -78,6 +91,8 @@ const api_replace_orders_request_1 = require("../interfaces/codegen/schema-maps/
|
|
|
78
91
|
const api_replace_orders_response_1 = require("../interfaces/codegen/schema-maps/api_replace_orders_response");
|
|
79
92
|
const api_set_initial_leverage_request_1 = require("../interfaces/codegen/schema-maps/api_set_initial_leverage_request");
|
|
80
93
|
const api_set_initial_leverage_response_1 = require("../interfaces/codegen/schema-maps/api_set_initial_leverage_response");
|
|
94
|
+
const api_set_sub_account_position_margin_config_request_1 = require("../interfaces/codegen/schema-maps/api_set_sub_account_position_margin_config_request");
|
|
95
|
+
const api_set_sub_account_position_margin_config_response_1 = require("../interfaces/codegen/schema-maps/api_set_sub_account_position_margin_config_response");
|
|
81
96
|
const api_socialized_loss_status_response_1 = require("../interfaces/codegen/schema-maps/api_socialized_loss_status_response");
|
|
82
97
|
const api_sub_account_history_request_1 = require("../interfaces/codegen/schema-maps/api_sub_account_history_request");
|
|
83
98
|
const api_sub_account_history_response_1 = require("../interfaces/codegen/schema-maps/api_sub_account_history_response");
|
|
@@ -175,6 +190,39 @@ class TDG {
|
|
|
175
190
|
return utils_1.Utils.schemaMap(response.data, api_positions_response_1.API_POSITIONS_RESPONSE_MAP.LITE_TO_FULL);
|
|
176
191
|
}).catch(utils_1.Utils.coverApiError);
|
|
177
192
|
}
|
|
193
|
+
setPositionConfig(payload, config) {
|
|
194
|
+
return this._axios.post(this._liteUrl + '/set_position_config', utils_1.Utils.schemaMap(payload, api_set_sub_account_position_margin_config_request_1.API_SET_SUB_ACCOUNT_POSITION_MARGIN_CONFIG_REQUEST_MAP.FULL_TO_LITE, true), config).then((response) => {
|
|
195
|
+
return utils_1.Utils.schemaMap(response.data, api_set_sub_account_position_margin_config_response_1.API_SET_SUB_ACCOUNT_POSITION_MARGIN_CONFIG_RESPONSE_MAP.LITE_TO_FULL);
|
|
196
|
+
}).catch(utils_1.Utils.coverApiError);
|
|
197
|
+
}
|
|
198
|
+
addPositionMargin(payload, config) {
|
|
199
|
+
return this._axios.post(this._liteUrl + '/add_position_margin', utils_1.Utils.schemaMap(payload, api_add_isolated_position_margin_request_1.API_ADD_ISOLATED_POSITION_MARGIN_REQUEST_MAP.FULL_TO_LITE, true), config).then((response) => {
|
|
200
|
+
return utils_1.Utils.schemaMap(response.data, api_add_isolated_position_margin_response_1.API_ADD_ISOLATED_POSITION_MARGIN_RESPONSE_MAP.LITE_TO_FULL);
|
|
201
|
+
}).catch(utils_1.Utils.coverApiError);
|
|
202
|
+
}
|
|
203
|
+
getPositionMarginLimits(payload, config) {
|
|
204
|
+
return this._axios.post(this._liteUrl + '/get_position_margin_limits', utils_1.Utils.schemaMap(payload, api_get_isolated_position_margin_limits_request_1.API_GET_ISOLATED_POSITION_MARGIN_LIMITS_REQUEST_MAP.FULL_TO_LITE, true), config).then((response) => {
|
|
205
|
+
return utils_1.Utils.schemaMap(response.data, api_get_isolated_position_margin_limits_response_1.API_GET_ISOLATED_POSITION_MARGIN_LIMITS_RESPONSE_MAP.LITE_TO_FULL);
|
|
206
|
+
}).catch(utils_1.Utils.coverApiError);
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* APIs for Builder
|
|
210
|
+
*/
|
|
211
|
+
authorizeBuilder(payload, config) {
|
|
212
|
+
return this._axios.post(this._liteUrl + '/authorize_builder', utils_1.Utils.schemaMap(payload, api_authorize_builder_request_1.API_AUTHORIZE_BUILDER_REQUEST_MAP.FULL_TO_LITE, true), config).then((response) => {
|
|
213
|
+
return utils_1.Utils.schemaMap(response.data, ack_response_1.ACK_RESPONSE_MAP.LITE_TO_FULL);
|
|
214
|
+
}).catch(utils_1.Utils.coverApiError);
|
|
215
|
+
}
|
|
216
|
+
getAuthorizedBuilders(config) {
|
|
217
|
+
return this._axios.post(this._liteUrl + '/get_authorized_builders', null, config).then((response) => {
|
|
218
|
+
return utils_1.Utils.schemaMap(response.data, api_get_authorized_builders_response_1.API_GET_AUTHORIZED_BUILDERS_RESPONSE_MAP.LITE_TO_FULL);
|
|
219
|
+
}).catch(utils_1.Utils.coverApiError);
|
|
220
|
+
}
|
|
221
|
+
builderFillHistory(payload, config) {
|
|
222
|
+
return this._axios.post(this._liteUrl + '/builder_fill_history', utils_1.Utils.schemaMap(payload, api_builder_fill_history_request_1.API_BUILDER_FILL_HISTORY_REQUEST_MAP.FULL_TO_LITE, true), config).then((response) => {
|
|
223
|
+
return utils_1.Utils.schemaMap(response.data, api_builder_fill_history_response_1.API_BUILDER_FILL_HISTORY_RESPONSE_MAP.LITE_TO_FULL);
|
|
224
|
+
}).catch(utils_1.Utils.coverApiError);
|
|
225
|
+
}
|
|
178
226
|
/**
|
|
179
227
|
* @see https://api-docs.grvt.io/trading_api/#sub-account-summary
|
|
180
228
|
*/
|
|
@@ -486,5 +534,20 @@ class TDG {
|
|
|
486
534
|
return utils_1.Utils.schemaMap(response.data, api_query_vault_investor_history_stats_response_1.API_QUERY_VAULT_INVESTOR_HISTORY_STATS_RESPONSE_MAP.LITE_TO_FULL);
|
|
487
535
|
}).catch(utils_1.Utils.coverApiError);
|
|
488
536
|
}
|
|
537
|
+
accountPerformance(config) {
|
|
538
|
+
return this._axios.post(this._liteUrl + '/account_performance', null, config).then((response) => {
|
|
539
|
+
return utils_1.Utils.schemaMap(response.data, api_query_account_performance_response_1.API_QUERY_ACCOUNT_PERFORMANCE_RESPONSE_MAP.LITE_TO_FULL);
|
|
540
|
+
}).catch(utils_1.Utils.coverApiError);
|
|
541
|
+
}
|
|
542
|
+
accountDailyPerformance(payload, config) {
|
|
543
|
+
return this._axios.post(this._liteUrl + '/account_daily_performance', utils_1.Utils.schemaMap(payload, api_query_account_daily_performance_request_1.API_QUERY_ACCOUNT_DAILY_PERFORMANCE_REQUEST_MAP.FULL_TO_LITE, true), config).then((response) => {
|
|
544
|
+
return utils_1.Utils.schemaMap(response.data, api_query_account_daily_performance_response_1.API_QUERY_ACCOUNT_DAILY_PERFORMANCE_RESPONSE_MAP.LITE_TO_FULL);
|
|
545
|
+
}).catch(utils_1.Utils.coverApiError);
|
|
546
|
+
}
|
|
547
|
+
subAccountDailyPerformance(payload, config) {
|
|
548
|
+
return this._axios.post(this._liteUrl + '/sub_account_daily_performance', utils_1.Utils.schemaMap(payload, api_query_sub_account_daily_performance_request_1.API_QUERY_SUB_ACCOUNT_DAILY_PERFORMANCE_REQUEST_MAP.FULL_TO_LITE, true), config).then((response) => {
|
|
549
|
+
return utils_1.Utils.schemaMap(response.data, api_query_sub_account_daily_performance_response_1.API_QUERY_SUB_ACCOUNT_DAILY_PERFORMANCE_RESPONSE_MAP.LITE_TO_FULL);
|
|
550
|
+
}).catch(utils_1.Utils.coverApiError);
|
|
551
|
+
}
|
|
489
552
|
}
|
|
490
553
|
exports.TDG = TDG;
|
|
@@ -409,9 +409,14 @@ export interface IApiFindAccountMultiplierRequest {
|
|
|
409
409
|
metric?: EMetricType;
|
|
410
410
|
epoch?: number;
|
|
411
411
|
status?: EAccountMultiplierStatus;
|
|
412
|
+
page?: number;
|
|
413
|
+
limit?: number;
|
|
412
414
|
}
|
|
413
415
|
export interface IApiFindAccountMultiplierResponse {
|
|
414
416
|
result?: IRewardAccountMultiplier[];
|
|
417
|
+
page?: number;
|
|
418
|
+
limit?: number;
|
|
419
|
+
total?: number;
|
|
415
420
|
}
|
|
416
421
|
export interface IApiFindConflictAccountMultiplierResponse {
|
|
417
422
|
result?: IRewardAccountMultiplier[];
|
|
@@ -1986,6 +1991,10 @@ export interface IPositions {
|
|
|
1986
1991
|
leverage?: string;
|
|
1987
1992
|
cumulative_fee?: string;
|
|
1988
1993
|
cumulative_realized_funding_payment?: string;
|
|
1994
|
+
margin_type?: EPositionMarginType;
|
|
1995
|
+
isolated_balance?: string;
|
|
1996
|
+
isolated_im?: string;
|
|
1997
|
+
isolated_mm?: string;
|
|
1989
1998
|
}
|
|
1990
1999
|
export interface IPreMinRedemptions {
|
|
1991
2000
|
requests?: IVaultRedemptionRequest[];
|
|
@@ -9,7 +9,9 @@ exports.API_FIND_ACCOUNT_MULTIPLIER_REQUEST_MAP = Object.freeze({
|
|
|
9
9
|
account_type: 'at',
|
|
10
10
|
metric: 'm',
|
|
11
11
|
epoch: 'e',
|
|
12
|
-
status: 's'
|
|
12
|
+
status: 's',
|
|
13
|
+
page: 'p',
|
|
14
|
+
limit: 'l'
|
|
13
15
|
},
|
|
14
16
|
LITE_TO_FULL: {
|
|
15
17
|
oc: 'off_chain_account_id',
|
|
@@ -17,6 +19,8 @@ exports.API_FIND_ACCOUNT_MULTIPLIER_REQUEST_MAP = Object.freeze({
|
|
|
17
19
|
at: 'account_type',
|
|
18
20
|
m: 'metric',
|
|
19
21
|
e: 'epoch',
|
|
20
|
-
s: 'status'
|
|
22
|
+
s: 'status',
|
|
23
|
+
p: 'page',
|
|
24
|
+
l: 'limit'
|
|
21
25
|
}
|
|
22
26
|
});
|
|
@@ -5,9 +5,15 @@ const reward_account_multiplier_1 = require("./reward_account_multiplier");
|
|
|
5
5
|
// Schema map for the 'API_FIND_ACCOUNT_MULTIPLIER_RESPONSE' struct.
|
|
6
6
|
exports.API_FIND_ACCOUNT_MULTIPLIER_RESPONSE_MAP = Object.freeze({
|
|
7
7
|
FULL_TO_LITE: {
|
|
8
|
-
result: ['r', [reward_account_multiplier_1.REWARD_ACCOUNT_MULTIPLIER_MAP.FULL_TO_LITE]]
|
|
8
|
+
result: ['r', [reward_account_multiplier_1.REWARD_ACCOUNT_MULTIPLIER_MAP.FULL_TO_LITE]],
|
|
9
|
+
page: 'p',
|
|
10
|
+
limit: 'l',
|
|
11
|
+
total: 't'
|
|
9
12
|
},
|
|
10
13
|
LITE_TO_FULL: {
|
|
11
|
-
r: ['result', [reward_account_multiplier_1.REWARD_ACCOUNT_MULTIPLIER_MAP.LITE_TO_FULL]]
|
|
14
|
+
r: ['result', [reward_account_multiplier_1.REWARD_ACCOUNT_MULTIPLIER_MAP.LITE_TO_FULL]],
|
|
15
|
+
p: 'page',
|
|
16
|
+
l: 'limit',
|
|
17
|
+
t: 'total'
|
|
12
18
|
}
|
|
13
19
|
});
|
|
@@ -20,7 +20,11 @@ exports.POSITIONS_MAP = Object.freeze({
|
|
|
20
20
|
est_liquidation_price: 'el',
|
|
21
21
|
leverage: 'l',
|
|
22
22
|
cumulative_fee: 'cf',
|
|
23
|
-
cumulative_realized_funding_payment: 'cr'
|
|
23
|
+
cumulative_realized_funding_payment: 'cr',
|
|
24
|
+
margin_type: 'mt',
|
|
25
|
+
isolated_balance: 'ib',
|
|
26
|
+
isolated_im: 'ii',
|
|
27
|
+
isolated_mm: 'im'
|
|
24
28
|
},
|
|
25
29
|
LITE_TO_FULL: {
|
|
26
30
|
et: 'event_time',
|
|
@@ -39,6 +43,10 @@ exports.POSITIONS_MAP = Object.freeze({
|
|
|
39
43
|
el: 'est_liquidation_price',
|
|
40
44
|
l: 'leverage',
|
|
41
45
|
cf: 'cumulative_fee',
|
|
42
|
-
cr: 'cumulative_realized_funding_payment'
|
|
46
|
+
cr: 'cumulative_realized_funding_payment',
|
|
47
|
+
mt: 'margin_type',
|
|
48
|
+
ib: 'isolated_balance',
|
|
49
|
+
ii: 'isolated_im',
|
|
50
|
+
im: 'isolated_mm'
|
|
43
51
|
}
|
|
44
52
|
});
|