@grvt/client 1.6.28 → 1.6.30

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.
Files changed (67) hide show
  1. package/MDG/index.d.ts +2 -1
  2. package/MDG/index.js +6 -0
  3. package/TDG/index.d.ts +3 -1
  4. package/TDG/index.js +14 -0
  5. package/interfaces/codegen/data.interface.d.ts +131 -0
  6. package/interfaces/codegen/enums/account-multiplier-metadata-type.d.ts +2 -1
  7. package/interfaces/codegen/enums/account-multiplier-metadata-type.js +4 -1
  8. package/interfaces/codegen/enums/cluster-config-type.d.ts +4 -1
  9. package/interfaces/codegen/enums/cluster-config-type.js +10 -1
  10. package/interfaces/codegen/enums/kind.d.ts +2 -1
  11. package/interfaces/codegen/enums/kind.js +4 -1
  12. package/interfaces/codegen/enums/order-reject-reason.d.ts +7 -1
  13. package/interfaces/codegen/enums/order-reject-reason.js +19 -1
  14. package/interfaces/codegen/enums/position-close-status.d.ts +7 -0
  15. package/interfaces/codegen/enums/position-close-status.js +20 -0
  16. package/interfaces/codegen/hex-string-map.js +1 -0
  17. package/interfaces/codegen/schema-maps/account_multiplier_metric_point.d.ts +2 -0
  18. package/interfaces/codegen/schema-maps/account_multiplier_metric_point.js +14 -0
  19. package/interfaces/codegen/schema-maps/account_multiplier_override_entry.d.ts +2 -0
  20. package/interfaces/codegen/schema-maps/account_multiplier_override_entry.js +27 -0
  21. package/interfaces/codegen/schema-maps/account_with_overridden_multiplier_info.d.ts +2 -0
  22. package/interfaces/codegen/schema-maps/account_with_overridden_multiplier_info.js +22 -0
  23. package/interfaces/codegen/schema-maps/api_create_account_multiplier_request.js +4 -2
  24. package/interfaces/codegen/schema-maps/api_dedust_spot_balances_request.d.ts +2 -0
  25. package/interfaces/codegen/schema-maps/api_dedust_spot_balances_request.js +13 -0
  26. package/interfaces/codegen/schema-maps/api_dedust_spot_balances_response.d.ts +2 -0
  27. package/interfaces/codegen/schema-maps/api_dedust_spot_balances_response.js +13 -0
  28. package/interfaces/codegen/schema-maps/api_get_default_account_multiplier_values_response.d.ts +2 -0
  29. package/interfaces/codegen/schema-maps/api_get_default_account_multiplier_values_response.js +13 -0
  30. package/interfaces/codegen/schema-maps/api_get_funding_account_position_summary_request.d.ts +2 -0
  31. package/interfaces/codegen/schema-maps/api_get_funding_account_position_summary_request.js +14 -0
  32. package/interfaces/codegen/schema-maps/api_get_funding_account_position_summary_response.d.ts +2 -0
  33. package/interfaces/codegen/schema-maps/api_get_funding_account_position_summary_response.js +13 -0
  34. package/interfaces/codegen/schema-maps/api_get_sub_account_position_summary_request.d.ts +2 -0
  35. package/interfaces/codegen/schema-maps/api_get_sub_account_position_summary_request.js +14 -0
  36. package/interfaces/codegen/schema-maps/api_get_sub_account_position_summary_response.d.ts +2 -0
  37. package/interfaces/codegen/schema-maps/api_get_sub_account_position_summary_response.js +13 -0
  38. package/interfaces/codegen/schema-maps/api_get_supported_assets_response.d.ts +2 -0
  39. package/interfaces/codegen/schema-maps/api_get_supported_assets_response.js +18 -0
  40. package/interfaces/codegen/schema-maps/api_list_account_multiplier_with_override_response.d.ts +2 -0
  41. package/interfaces/codegen/schema-maps/api_list_account_multiplier_with_override_response.js +13 -0
  42. package/interfaces/codegen/schema-maps/api_lock_account_multiplier_request.d.ts +2 -0
  43. package/interfaces/codegen/schema-maps/api_lock_account_multiplier_request.js +14 -0
  44. package/interfaces/codegen/schema-maps/api_position_history.d.ts +2 -0
  45. package/interfaces/codegen/schema-maps/api_position_history.js +52 -0
  46. package/interfaces/codegen/schema-maps/api_position_history_request.d.ts +2 -0
  47. package/interfaces/codegen/schema-maps/api_position_history_request.js +34 -0
  48. package/interfaces/codegen/schema-maps/api_position_history_response.d.ts +2 -0
  49. package/interfaces/codegen/schema-maps/api_position_history_response.js +15 -0
  50. package/interfaces/codegen/schema-maps/api_query_list_sub_account_summary_request.js +4 -2
  51. package/interfaces/codegen/schema-maps/api_snap_aggregated_account_summary.js +4 -2
  52. package/interfaces/codegen/schema-maps/api_unlock_account_multiplier_request.d.ts +2 -0
  53. package/interfaces/codegen/schema-maps/api_unlock_account_multiplier_request.js +12 -0
  54. package/interfaces/codegen/schema-maps/api_update_account_multiplier_lock_flags_request.d.ts +2 -0
  55. package/interfaces/codegen/schema-maps/api_update_account_multiplier_lock_flags_request.js +14 -0
  56. package/interfaces/codegen/schema-maps/client_tier.js +6 -2
  57. package/interfaces/codegen/schema-maps/flat_private_trade.js +4 -2
  58. package/interfaces/codegen/schema-maps/funding_account_position_summary_result.d.ts +2 -0
  59. package/interfaces/codegen/schema-maps/funding_account_position_summary_result.js +16 -0
  60. package/interfaces/codegen/schema-maps/futures_wallet_assets.d.ts +2 -0
  61. package/interfaces/codegen/schema-maps/futures_wallet_assets.js +15 -0
  62. package/interfaces/codegen/schema-maps/order.js +4 -2
  63. package/interfaces/codegen/schema-maps/sub_account_position_summary_result.d.ts +2 -0
  64. package/interfaces/codegen/schema-maps/sub_account_position_summary_result.js +16 -0
  65. package/interfaces/codegen/schema-maps/supported_asset.d.ts +2 -0
  66. package/interfaces/codegen/schema-maps/supported_asset.js +16 -0
  67. package/package.json +1 -1
package/MDG/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { AxiosRequestConfig } from 'axios';
2
- import type { IApiBatchQueryVaultDetailRequest, IApiBatchQueryVaultDetailResponse, IApiBatchQueryVaultPerformanceRequest, IApiBatchQueryVaultPerformanceResponse, IApiBatchQueryVaultRiskMetricRequest, IApiBatchQueryVaultRiskMetricResponse, IApiCandlestickRequest, IApiCandlestickResponse, IApiFundingHistoryComparisonRequest, IApiFundingHistoryComparisonResponse, IApiFundingRateRequest, IApiFundingRateResponse, IApiGetAllInstrumentsRequest, IApiGetAllInstrumentsResponse, IApiGetFilteredInstrumentsRequest, IApiGetFilteredInstrumentsResponse, IApiGetInstrumentRequest, IApiGetInstrumentResponse, IApiGetMarginRulesRequest, IApiGetMarginRulesResponse, IApiLiveFundingRateComparisonRequest, IApiLiveFundingRateComparisonResponse, IApiMiniTickerRequest, IApiMiniTickerResponse, IApiOrderbookLevelsRequest, IApiOrderbookLevelsResponse, IApiQueryListVaultSubAccountSummaryRequest, IApiQueryListVaultSubAccountSummaryResponse, IApiQuerySnapVaultPositionRequest, IApiQuerySnapVaultPositionResponse, IApiQueryVaultPerformanceTrendRequest, IApiQueryVaultPerformanceTrendResponse, IApiQueryVaultSummaryHistoryRequest, IApiQueryVaultSummaryHistoryResponse, IApiSettlementPriceRequest, IApiSettlementPriceResponse, IApiTickerRequest, IApiTickerResponse, IApiTimedAssetExposureResponse, IApiTimedVaultAssetExposureRequest, IApiTradeHistoryRequest, IApiTradeHistoryResponse, IApiTradeRequest, IApiTradeResponse, IConfig } from '../interfaces';
2
+ import type { IApiGetSupportedAssetsResponse, IApiBatchQueryVaultDetailRequest, IApiBatchQueryVaultDetailResponse, IApiBatchQueryVaultPerformanceRequest, IApiBatchQueryVaultPerformanceResponse, IApiBatchQueryVaultRiskMetricRequest, IApiBatchQueryVaultRiskMetricResponse, IApiCandlestickRequest, IApiCandlestickResponse, IApiFundingHistoryComparisonRequest, IApiFundingHistoryComparisonResponse, IApiFundingRateRequest, IApiFundingRateResponse, IApiGetAllInstrumentsRequest, IApiGetAllInstrumentsResponse, IApiGetFilteredInstrumentsRequest, IApiGetFilteredInstrumentsResponse, IApiGetInstrumentRequest, IApiGetInstrumentResponse, IApiGetMarginRulesRequest, IApiGetMarginRulesResponse, IApiLiveFundingRateComparisonRequest, IApiLiveFundingRateComparisonResponse, IApiMiniTickerRequest, IApiMiniTickerResponse, IApiOrderbookLevelsRequest, IApiOrderbookLevelsResponse, IApiQueryListVaultSubAccountSummaryRequest, IApiQueryListVaultSubAccountSummaryResponse, IApiQuerySnapVaultPositionRequest, IApiQuerySnapVaultPositionResponse, IApiQueryVaultPerformanceTrendRequest, IApiQueryVaultPerformanceTrendResponse, IApiQueryVaultSummaryHistoryRequest, IApiQueryVaultSummaryHistoryResponse, IApiSettlementPriceRequest, IApiSettlementPriceResponse, IApiTickerRequest, IApiTickerResponse, IApiTimedAssetExposureResponse, IApiTimedVaultAssetExposureRequest, IApiTradeHistoryRequest, IApiTradeHistoryResponse, IApiTradeRequest, IApiTradeResponse, IConfig } from '../interfaces';
3
3
  export declare class MDG {
4
4
  private readonly _axios;
5
5
  private readonly _fullUrl;
@@ -18,6 +18,7 @@ export declare class MDG {
18
18
  * @see https://api-docs.grvt.io/market_data_api/#get-all-instruments
19
19
  */
20
20
  allInstruments(payload: IApiGetAllInstrumentsRequest, config?: AxiosRequestConfig): Promise<IApiGetAllInstrumentsResponse>;
21
+ supportedAssets(config?: AxiosRequestConfig): Promise<IApiGetSupportedAssetsResponse>;
21
22
  /**
22
23
  * @see https://api-docs.grvt.io/market_data_api/#mini-ticker
23
24
  */
package/MDG/index.js CHANGED
@@ -46,6 +46,7 @@ const api_trade_history_request_1 = require("../interfaces/codegen/schema-maps/a
46
46
  const api_trade_history_response_1 = require("../interfaces/codegen/schema-maps/api_trade_history_response");
47
47
  const api_trade_request_1 = require("../interfaces/codegen/schema-maps/api_trade_request");
48
48
  const api_trade_response_1 = require("../interfaces/codegen/schema-maps/api_trade_response");
49
+ const api_get_supported_assets_response_1 = require("../interfaces/codegen/schema-maps/api_get_supported_assets_response");
49
50
  const services_1 = require("../services");
50
51
  const utils_1 = require("../utils");
51
52
  class MDG {
@@ -82,6 +83,11 @@ class MDG {
82
83
  return utils_1.Utils.schemaMap(response.data, api_get_all_instruments_response_1.API_GET_ALL_INSTRUMENTS_RESPONSE_MAP.LITE_TO_FULL);
83
84
  }).catch(utils_1.Utils.coverApiError);
84
85
  }
86
+ supportedAssets(config) {
87
+ return this._axios.post(this._liteUrl + '/supported_assets', null, Object.assign(Object.assign({}, config), { withCredentials: false })).then((response) => {
88
+ return utils_1.Utils.schemaMap(response.data, api_get_supported_assets_response_1.API_GET_SUPPORTED_ASSETS_RESPONSE_MAP.LITE_TO_FULL);
89
+ }).catch(utils_1.Utils.coverApiError);
90
+ }
85
91
  /**
86
92
  * @see https://api-docs.grvt.io/market_data_api/#mini-ticker
87
93
  */
package/TDG/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { AxiosRequestConfig } from 'axios';
2
- import type { IAckResponse, IApiAddIsolatedPositionMarginRequest, IApiAddIsolatedPositionMarginResponse, IApiAggregatedAccountSummaryResponse, IApiAuthorizeBuilderRequest, IApiBuilderFillHistoryRequest, IApiBuilderFillHistoryResponse, IApiBulkOrdersRequest, IApiBulkOrdersResponse, 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, IApiQueryAccountPerformanceRequest, IApiQueryAccountPerformanceResponse, IApiQueryAccountPerformanceTrendRequest, IApiQueryAccountPerformanceTrendResponse, IApiQueryAccountTodayPerformanceRequest, IApiQueryAccountTodayPerformanceResponse, IApiQueryListFundingAccountSummaryRequest, IApiQueryListFundingAccountSummaryResponse, IApiQueryListSubAccountSummaryRequest, IApiQueryListSubAccountSummaryResponse, IApiQuerySubAccountDailyPerformanceRequest, IApiQuerySubAccountDailyPerformanceResponse, IApiQuerySubAccountTodayPerformanceRequest, IApiQuerySubAccountTodayPerformanceResponse, IApiQueryTradingAccountRiskMetricRequest, IApiQueryTradingAccountRiskMetricResponse, IApiQueryTradingPerformanceRequest, IApiQueryTradingPerformanceResponse, IApiQueryTradingPerformanceSummaryRequest, IApiQueryTradingPerformanceSummaryResponse, IApiQueryTradingPerformanceTrendRequest, IApiQueryTradingPerformanceTrendResponse, IApiQueryVaultInvestorHistoryRequest, IApiQueryVaultInvestorHistoryResponse, 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';
2
+ import type { IAckResponse, IApiAddIsolatedPositionMarginRequest, IApiAddIsolatedPositionMarginResponse, IApiAggregatedAccountSummaryResponse, IApiAuthorizeBuilderRequest, IApiBuilderFillHistoryRequest, IApiBuilderFillHistoryResponse, IApiBulkOrdersRequest, IApiBulkOrdersResponse, 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, IApiPositionHistoryRequest, IApiPositionHistoryResponse, IApiPositionsRequest, IApiPositionsResponse, IApiPreDepositCheckRequest, IApiPreDepositCheckResponse, IApiPreOrderCheckRequest, IApiPreOrderCheckResponse, IApiQueryAccountDailyPerformanceRequest, IApiQueryAccountDailyPerformanceResponse, IApiQueryAccountPerformanceRequest, IApiQueryAccountPerformanceResponse, IApiQueryAccountPerformanceTrendRequest, IApiQueryAccountPerformanceTrendResponse, IApiQueryAccountTodayPerformanceRequest, IApiQueryAccountTodayPerformanceResponse, IApiQueryListFundingAccountSummaryRequest, IApiQueryListFundingAccountSummaryResponse, IApiQueryListSubAccountSummaryRequest, IApiQueryListSubAccountSummaryResponse, IApiQuerySubAccountDailyPerformanceRequest, IApiQuerySubAccountDailyPerformanceResponse, IApiQuerySubAccountTodayPerformanceRequest, IApiQuerySubAccountTodayPerformanceResponse, IApiQueryTradingAccountRiskMetricRequest, IApiQueryTradingAccountRiskMetricResponse, IApiQueryTradingPerformanceRequest, IApiQueryTradingPerformanceResponse, IApiQueryTradingPerformanceSummaryRequest, IApiQueryTradingPerformanceSummaryResponse, IApiQueryTradingPerformanceTrendRequest, IApiQueryTradingPerformanceTrendResponse, IApiQueryVaultInvestorHistoryRequest, IApiQueryVaultInvestorHistoryResponse, IApiQueryVaultManagerInvestorHistoryRequest, IApiQueryVaultManagerInvestorHistoryResponse, IApiReplaceOrdersRequest, IApiReplaceOrdersResponse, IApiSetInitialLeverageRequest, IApiSetInitialLeverageResponse, IApiSetSubAccountPositionMarginConfigRequest, IApiSetSubAccountPositionMarginConfigResponse, IApiSocializedLossStatusResponse, IApiSpotSubAccountSummaryRequest, IApiSpotSubAccountSummaryResponse, 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;
@@ -40,6 +40,7 @@ export declare class TDG {
40
40
  setPositionConfig(payload: IApiSetSubAccountPositionMarginConfigRequest, config?: AxiosRequestConfig): Promise<IApiSetSubAccountPositionMarginConfigResponse>;
41
41
  addPositionMargin(payload: IApiAddIsolatedPositionMarginRequest, config?: AxiosRequestConfig): Promise<IApiAddIsolatedPositionMarginResponse>;
42
42
  getPositionMarginLimits(payload: IApiGetIsolatedPositionMarginLimitsRequest, config?: AxiosRequestConfig): Promise<IApiGetIsolatedPositionMarginLimitsResponse>;
43
+ positionHistory(payload: IApiPositionHistoryRequest, config?: AxiosRequestConfig): Promise<IApiPositionHistoryResponse>;
43
44
  /**
44
45
  * APIs for Builder
45
46
  */
@@ -112,6 +113,7 @@ export declare class TDG {
112
113
  */
113
114
  fundingAccountSummary(config?: AxiosRequestConfig): Promise<IApiFundingAccountSummaryResponse>;
114
115
  fundingAccountSummaryHistory(payload: IApiQueryListFundingAccountSummaryRequest, config?: AxiosRequestConfig): Promise<IApiQueryListFundingAccountSummaryResponse>;
116
+ spotAccountSummary(payload: IApiSpotSubAccountSummaryRequest, config?: AxiosRequestConfig): Promise<IApiSpotSubAccountSummaryResponse>;
115
117
  /**
116
118
  * @see https://api-docs.grvt.io/trading_api/#aggregated-account-summary
117
119
  */
package/TDG/index.js CHANGED
@@ -57,6 +57,8 @@ const api_open_orders_request_1 = require("../interfaces/codegen/schema-maps/api
57
57
  const api_open_orders_response_1 = require("../interfaces/codegen/schema-maps/api_open_orders_response");
58
58
  const api_order_history_request_1 = require("../interfaces/codegen/schema-maps/api_order_history_request");
59
59
  const api_order_history_response_1 = require("../interfaces/codegen/schema-maps/api_order_history_response");
60
+ const api_position_history_request_1 = require("../interfaces/codegen/schema-maps/api_position_history_request");
61
+ const api_position_history_response_1 = require("../interfaces/codegen/schema-maps/api_position_history_response");
60
62
  const api_positions_request_1 = require("../interfaces/codegen/schema-maps/api_positions_request");
61
63
  const api_positions_response_1 = require("../interfaces/codegen/schema-maps/api_positions_response");
62
64
  const api_pre_deposit_check_request_1 = require("../interfaces/codegen/schema-maps/api_pre_deposit_check_request");
@@ -98,6 +100,8 @@ const api_set_initial_leverage_response_1 = require("../interfaces/codegen/schem
98
100
  const api_set_sub_account_position_margin_config_request_1 = require("../interfaces/codegen/schema-maps/api_set_sub_account_position_margin_config_request");
99
101
  const api_set_sub_account_position_margin_config_response_1 = require("../interfaces/codegen/schema-maps/api_set_sub_account_position_margin_config_response");
100
102
  const api_socialized_loss_status_response_1 = require("../interfaces/codegen/schema-maps/api_socialized_loss_status_response");
103
+ const api_spot_sub_account_summary_request_1 = require("../interfaces/codegen/schema-maps/api_spot_sub_account_summary_request");
104
+ const api_spot_sub_account_summary_response_1 = require("../interfaces/codegen/schema-maps/api_spot_sub_account_summary_response");
101
105
  const api_sub_account_history_request_1 = require("../interfaces/codegen/schema-maps/api_sub_account_history_request");
102
106
  const api_sub_account_history_response_1 = require("../interfaces/codegen/schema-maps/api_sub_account_history_response");
103
107
  const api_sub_account_summary_request_1 = require("../interfaces/codegen/schema-maps/api_sub_account_summary_request");
@@ -209,6 +213,11 @@ class TDG {
209
213
  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);
210
214
  }).catch(utils_1.Utils.coverApiError);
211
215
  }
216
+ positionHistory(payload, config) {
217
+ return this._axios.post(this._liteUrl + '/position_history', utils_1.Utils.schemaMap(payload, api_position_history_request_1.API_POSITION_HISTORY_REQUEST_MAP.FULL_TO_LITE, true), config).then((response) => {
218
+ return utils_1.Utils.schemaMap(response.data, api_position_history_response_1.API_POSITION_HISTORY_RESPONSE_MAP.LITE_TO_FULL);
219
+ }).catch(utils_1.Utils.coverApiError);
220
+ }
212
221
  /**
213
222
  * APIs for Builder
214
223
  */
@@ -385,6 +394,11 @@ class TDG {
385
394
  return utils_1.Utils.schemaMap(response.data, api_query_list_funding_account_summary_response_1.API_QUERY_LIST_FUNDING_ACCOUNT_SUMMARY_RESPONSE_MAP.LITE_TO_FULL);
386
395
  }).catch(utils_1.Utils.coverApiError);
387
396
  }
397
+ spotAccountSummary(payload, config) {
398
+ return this._axios.post(this._liteUrl + '/spot_account_summary', utils_1.Utils.schemaMap(payload, api_spot_sub_account_summary_request_1.API_SPOT_SUB_ACCOUNT_SUMMARY_REQUEST_MAP.FULL_TO_LITE, true), config).then((response) => {
399
+ return utils_1.Utils.schemaMap(response.data, api_spot_sub_account_summary_response_1.API_SPOT_SUB_ACCOUNT_SUMMARY_RESPONSE_MAP.LITE_TO_FULL);
400
+ }).catch(utils_1.Utils.coverApiError);
401
+ }
388
402
  /**
389
403
  * @see https://api-docs.grvt.io/trading_api/#aggregated-account-summary
390
404
  */
@@ -21,6 +21,7 @@ import type { EOrderRejectReason } from './enums/order-reject-reason.ts';
21
21
  import type { EOrderStatus } from './enums/order-status.ts';
22
22
  import type { EPointType } from './enums/point-type.ts';
23
23
  import type { EPortfolioCurrency } from './enums/portfolio-currency.ts';
24
+ import type { EPositionCloseStatus } from './enums/position-close-status.ts';
24
25
  import type { EPositionMarginType } from './enums/position-margin-type.ts';
25
26
  import type { EQueryMainAccountLeaderboardOrderBy } from './enums/query-main-account-leaderboard-order-by.ts';
26
27
  import type { ERewardEpochStatus } from './enums/reward-epoch-status.ts';
@@ -46,6 +47,27 @@ export interface IAPISettlementPrice {
46
47
  settlement_time?: string;
47
48
  settlement_price?: string;
48
49
  }
50
+ export interface IAccountMultiplierMetricPoint {
51
+ metric?: EMetricType;
52
+ point?: string;
53
+ }
54
+ export interface IAccountMultiplierOverrideEntry {
55
+ id?: string;
56
+ metric?: EMetricType;
57
+ multiplier?: number;
58
+ metadata?: IRewardAccountMultiplierMetadata;
59
+ created_by_id?: string;
60
+ effective_epoch_end?: number;
61
+ create_time?: string;
62
+ reserve_multiplier?: number;
63
+ }
64
+ export interface IAccountWithOverriddenMultiplierInfo {
65
+ off_chain_account_id?: string;
66
+ is_locked?: boolean;
67
+ total_point?: string;
68
+ metric_points?: IAccountMultiplierMetricPoint[];
69
+ overrides?: IAccountMultiplierOverrideEntry[];
70
+ }
49
71
  export interface IAck {
50
72
  ack?: boolean;
51
73
  }
@@ -229,6 +251,7 @@ export interface IApiCreateAccountMultiplierRequest {
229
251
  effective_epoch_start?: number;
230
252
  effective_epoch_end?: number;
231
253
  reserve_multiplier?: number;
254
+ note?: string;
232
255
  }
233
256
  export interface IApiCreateAccountMultiplierResponse {
234
257
  id?: string;
@@ -348,6 +371,12 @@ export interface IApiDedustPositionRequest {
348
371
  export interface IApiDedustPositionResponse {
349
372
  result?: IOrder;
350
373
  }
374
+ export interface IApiDedustSpotBalancesRequest {
375
+ order?: IOrder;
376
+ }
377
+ export interface IApiDedustSpotBalancesResponse {
378
+ result?: IOrder;
379
+ }
351
380
  export interface IApiDepositHistoryRequest {
352
381
  currency?: string[];
353
382
  start_time?: string;
@@ -570,6 +599,9 @@ export interface IApiGetCurrencyRequest {
570
599
  export interface IApiGetCurrencyResponse {
571
600
  result?: ICurrencyDetail[];
572
601
  }
602
+ export interface IApiGetDefaultAccountMultiplierValuesResponse {
603
+ result?: IRewardAccountMultiplier[];
604
+ }
573
605
  export interface IApiGetEcosystemLeaderboardRequest {
574
606
  calculate_from?: string;
575
607
  limit?: number;
@@ -611,6 +643,13 @@ export interface IApiGetFilteredInstrumentsRequest {
611
643
  export interface IApiGetFilteredInstrumentsResponse {
612
644
  result?: IInstrumentDisplay[];
613
645
  }
646
+ export interface IApiGetFundingAccountPositionSummaryRequest {
647
+ main_account_i_ds?: string[];
648
+ assets?: string[];
649
+ }
650
+ export interface IApiGetFundingAccountPositionSummaryResponse {
651
+ result?: IFundingAccountPositionSummaryResult[];
652
+ }
614
653
  export interface IApiGetInstrumentRequest {
615
654
  instrument?: string;
616
655
  }
@@ -718,9 +757,21 @@ export interface IApiGetPriceProtectionBandsResponse {
718
757
  export interface IApiGetRewardLeaderboardResponse {
719
758
  result?: IApiRewardLeaderboardItem[];
720
759
  }
760
+ export interface IApiGetSubAccountPositionSummaryRequest {
761
+ sub_account_i_ds?: string[];
762
+ assets?: string[];
763
+ }
764
+ export interface IApiGetSubAccountPositionSummaryResponse {
765
+ result?: ISubAccountPositionSummaryResult[];
766
+ }
721
767
  export interface IApiGetSubAccountsResponse {
722
768
  sub_account_ids?: string[];
723
769
  }
770
+ export interface IApiGetSupportedAssetsResponse {
771
+ funding?: ISupportedAsset[];
772
+ spot?: ISupportedAsset[];
773
+ futures?: IFuturesWalletAssets[];
774
+ }
724
775
  export interface IApiGetTraderStatResponse {
725
776
  total_fee?: string;
726
777
  }
@@ -780,6 +831,9 @@ export interface IApiInternalBatchCreateAccountMultiplierRequest {
780
831
  export interface IApiInternalBatchCreateAccountMultiplierResponse {
781
832
  ids?: string[];
782
833
  }
834
+ export interface IApiListAccountMultiplierWithOverrideResponse {
835
+ result?: IAccountWithOverriddenMultiplierInfo[];
836
+ }
783
837
  export interface IApiListAggregatedAccountSummaryRequest {
784
838
  main_account_ids?: string[];
785
839
  }
@@ -809,6 +863,10 @@ export interface IApiLiveFundingRateComparisonRequest {
809
863
  export interface IApiLiveFundingRateComparisonResponse {
810
864
  entries?: ILiveFundingRateComparisonEntry[];
811
865
  }
866
+ export interface IApiLockAccountMultiplierRequest {
867
+ off_chain_account_id?: string;
868
+ apply_to_direct_referrals?: boolean;
869
+ }
812
870
  export interface IApiMiniTickerRequest {
813
871
  instrument?: string;
814
872
  }
@@ -862,6 +920,47 @@ export interface IApiPointInjectionHistoryRequest {
862
920
  export interface IApiPointInjectionHistoryResponse {
863
921
  result?: IPointDistribution[];
864
922
  }
923
+ export interface IApiPositionHistory {
924
+ sub_account_id?: string;
925
+ instrument?: string;
926
+ open_time?: string;
927
+ status?: EPositionCloseStatus;
928
+ is_long?: boolean;
929
+ margin_type?: EPositionMarginType;
930
+ close_time?: string;
931
+ entry_price?: string;
932
+ exit_price?: string;
933
+ position_close_mark_price?: string;
934
+ realized_pnl?: string;
935
+ cumulative_fee?: string;
936
+ cumulative_realized_funding_payment?: string;
937
+ closed_volume_base?: string;
938
+ closed_volume_quote?: string;
939
+ max_open_interest_base?: string;
940
+ max_open_interest_quote?: string;
941
+ cumulative_initial_margin?: string;
942
+ max_initial_margin?: string;
943
+ leverage?: string;
944
+ unrealized_pnl?: string;
945
+ }
946
+ export interface IApiPositionHistoryRequest {
947
+ sub_account_id?: string;
948
+ start_time?: string;
949
+ end_time?: string;
950
+ kind?: EKind[];
951
+ base?: string[];
952
+ quote?: string[];
953
+ limit?: number;
954
+ cursor?: string;
955
+ status?: EPositionCloseStatus[];
956
+ is_long?: boolean;
957
+ is_short?: boolean;
958
+ margin_type?: EPositionMarginType[];
959
+ }
960
+ export interface IApiPositionHistoryResponse {
961
+ result?: IApiPositionHistory[];
962
+ next?: string;
963
+ }
865
964
  export interface IApiPositionTransferRequest {
866
965
  maker_order?: IOrder;
867
966
  taker_order?: IOrder;
@@ -947,6 +1046,7 @@ export interface IApiQueryListSubAccountSummaryRequest {
947
1046
  sub_account_id?: string;
948
1047
  start_time?: string;
949
1048
  end_time?: string;
1049
+ sub_account_i_ds?: string[];
950
1050
  }
951
1051
  export interface IApiQueryListSubAccountSummaryResponse {
952
1052
  result?: ISnapSubAccountSummary[];
@@ -1161,6 +1261,7 @@ export interface IApiSnapAggregatedAccountSummary {
1161
1261
  event_time?: string;
1162
1262
  start_interval?: string;
1163
1263
  total_equity?: string;
1264
+ total_vault_investments_balance?: string;
1164
1265
  }
1165
1266
  export interface IApiSocializedLossStatusResponse {
1166
1267
  is_active?: boolean;
@@ -1280,6 +1381,13 @@ export interface IApiTransferRequest {
1280
1381
  export interface IApiTransferResponse {
1281
1382
  result?: IApiTransferAck;
1282
1383
  }
1384
+ export interface IApiUnlockAccountMultiplierRequest {
1385
+ off_chain_account_id?: string;
1386
+ }
1387
+ export interface IApiUpdateAccountMultiplierLockFlagsRequest {
1388
+ off_chain_account_id?: string;
1389
+ apply_to_direct_referrals?: boolean;
1390
+ }
1283
1391
  export interface IApiUserCategoryAffinityScoreRequest {
1284
1392
  account_id?: string;
1285
1393
  start_time?: string;
@@ -1547,6 +1655,8 @@ export interface IClientTier {
1547
1655
  futures_maker_fee?: number;
1548
1656
  options_taker_fee?: number;
1549
1657
  options_maker_fee?: number;
1658
+ spot_taker_fee?: number;
1659
+ spot_maker_fee?: number;
1550
1660
  }
1551
1661
  export interface ICrossExchVaultPendingInvestment {
1552
1662
  request_time?: string;
@@ -1743,6 +1853,7 @@ export interface IFill {
1743
1853
  builder?: string;
1744
1854
  builder_fee_rate?: string;
1745
1855
  builder_fee?: string;
1856
+ fee_currency?: string;
1746
1857
  }
1747
1858
  export interface IFlatReferral {
1748
1859
  account_id?: string;
@@ -1757,6 +1868,11 @@ export interface IFlatReferral {
1757
1868
  kyc_type?: string;
1758
1869
  kyc_first_completed_at?: string;
1759
1870
  }
1871
+ export interface IFundingAccountPositionSummaryResult {
1872
+ main_account_id?: string;
1873
+ total_unrealized_pnl?: string;
1874
+ total_realized_pnl?: string;
1875
+ }
1760
1876
  export interface IFundingAccountSummary {
1761
1877
  main_account_id?: string;
1762
1878
  total_equity?: string;
@@ -1782,6 +1898,10 @@ export interface IFundingPayment {
1782
1898
  amount?: string;
1783
1899
  tx_id?: string;
1784
1900
  }
1901
+ export interface IFuturesWalletAssets {
1902
+ mode?: ESubAccountMode;
1903
+ supported_assets?: ISupportedAsset[];
1904
+ }
1785
1905
  export interface IGetClaimableEcosystemBadgeResponse {
1786
1906
  badge?: IEpochBadge;
1787
1907
  is_claimable?: boolean;
@@ -1960,6 +2080,7 @@ export interface IOrder {
1960
2080
  is_derisk?: boolean;
1961
2081
  builder?: string;
1962
2082
  builder_fee?: string;
2083
+ is_spot_dedust?: boolean;
1963
2084
  }
1964
2085
  export interface IOrderLeg {
1965
2086
  instrument?: string;
@@ -2347,6 +2468,11 @@ export interface ISubAccountPerformance {
2347
2468
  net_transfer?: string;
2348
2469
  currency?: number;
2349
2470
  }
2471
+ export interface ISubAccountPositionSummaryResult {
2472
+ sub_account_id?: string;
2473
+ total_unrealized_pnl?: string;
2474
+ total_realized_pnl?: string;
2475
+ }
2350
2476
  export interface ISubAccountTradingPerformance {
2351
2477
  start_interval?: string;
2352
2478
  sub_account_id?: string;
@@ -2360,6 +2486,11 @@ export interface ISubAccountTradingPerformance {
2360
2486
  funding_payment_amount?: string;
2361
2487
  filled_order_count?: string;
2362
2488
  }
2489
+ export interface ISupportedAsset {
2490
+ asset_id?: number;
2491
+ asset_code?: string;
2492
+ balance_decimals?: number;
2493
+ }
2363
2494
  export interface ITPSLOrderMetadata {
2364
2495
  trigger_by?: ETriggerBy;
2365
2496
  trigger_price?: string;
@@ -1,5 +1,6 @@
1
1
  export declare enum EAccountMultiplierMetadataType {
2
2
  AMBASSADOR = "AMBASSADOR",
3
- REFERRED_BY_AMBASSADOR = "REFERRED_BY_AMBASSADOR"
3
+ REFERRED_BY_AMBASSADOR = "REFERRED_BY_AMBASSADOR",
4
+ ADMIN = "ADMIN"
4
5
  }
5
6
  export declare const EAccountMultiplierMetadataTypeInt: Record<EAccountMultiplierMetadataType, number>;
@@ -7,8 +7,11 @@ var EAccountMultiplierMetadataType;
7
7
  EAccountMultiplierMetadataType["AMBASSADOR"] = "AMBASSADOR";
8
8
  // referred by ambassador type
9
9
  EAccountMultiplierMetadataType["REFERRED_BY_AMBASSADOR"] = "REFERRED_BY_AMBASSADOR";
10
+ // admin override with note
11
+ EAccountMultiplierMetadataType["ADMIN"] = "ADMIN";
10
12
  })(EAccountMultiplierMetadataType || (exports.EAccountMultiplierMetadataType = EAccountMultiplierMetadataType = {}));
11
13
  exports.EAccountMultiplierMetadataTypeInt = Object.freeze({
12
14
  [EAccountMultiplierMetadataType.AMBASSADOR]: 1,
13
- [EAccountMultiplierMetadataType.REFERRED_BY_AMBASSADOR]: 2
15
+ [EAccountMultiplierMetadataType.REFERRED_BY_AMBASSADOR]: 2,
16
+ [EAccountMultiplierMetadataType.ADMIN]: 3
14
17
  });
@@ -78,6 +78,9 @@ export declare enum EClusterConfigType {
78
78
  FLAG_CANCEL_ON_DISCONNECT = "FLAG_CANCEL_ON_DISCONNECT",
79
79
  FLAG_SPLIT_TPSL = "FLAG_SPLIT_TPSL",
80
80
  FLAG_SPOT_TRADING = "FLAG_SPOT_TRADING",
81
- FLAG_SNAPSHOT_CURRENCY_STORE_FIRST = "FLAG_SNAPSHOT_CURRENCY_STORE_FIRST"
81
+ FLAG_SNAPSHOT_CURRENCY_STORE_FIRST = "FLAG_SNAPSHOT_CURRENCY_STORE_FIRST",
82
+ FLAG_ENABLE_POSITION_HISTORY = "FLAG_ENABLE_POSITION_HISTORY",
83
+ FLAG_PUBLISH_PRICE_DATA = "FLAG_PUBLISH_PRICE_DATA",
84
+ FLAG_DEVIATION_PENALTY = "FLAG_DEVIATION_PENALTY"
82
85
  }
83
86
  export declare const EClusterConfigTypeInt: Record<EClusterConfigType, number>;
@@ -163,6 +163,12 @@ var EClusterConfigType;
163
163
  EClusterConfigType["FLAG_SPOT_TRADING"] = "FLAG_SPOT_TRADING";
164
164
  // Flag to dump currency store first in snapshot, ensuring gateway rehydrates currency store before other state
165
165
  EClusterConfigType["FLAG_SNAPSHOT_CURRENCY_STORE_FIRST"] = "FLAG_SNAPSHOT_CURRENCY_STORE_FIRST";
166
+ // Gates position history lifecycle accumulation and close publication
167
+ EClusterConfigType["FLAG_ENABLE_POSITION_HISTORY"] = "FLAG_ENABLE_POSITION_HISTORY";
168
+ // Flag to enable price data publishing from marketdata to cluster
169
+ EClusterConfigType["FLAG_PUBLISH_PRICE_DATA"] = "FLAG_PUBLISH_PRICE_DATA";
170
+ // Flag to control deviation penalty logic on trading checks
171
+ EClusterConfigType["FLAG_DEVIATION_PENALTY"] = "FLAG_DEVIATION_PENALTY";
166
172
  })(EClusterConfigType || (exports.EClusterConfigType = EClusterConfigType = {}));
167
173
  exports.EClusterConfigTypeInt = Object.freeze({
168
174
  [EClusterConfigType.CLIENT_TIER]: 1,
@@ -244,5 +250,8 @@ exports.EClusterConfigTypeInt = Object.freeze({
244
250
  [EClusterConfigType.FLAG_CANCEL_ON_DISCONNECT]: 77,
245
251
  [EClusterConfigType.FLAG_SPLIT_TPSL]: 78,
246
252
  [EClusterConfigType.FLAG_SPOT_TRADING]: 79,
247
- [EClusterConfigType.FLAG_SNAPSHOT_CURRENCY_STORE_FIRST]: 80
253
+ [EClusterConfigType.FLAG_SNAPSHOT_CURRENCY_STORE_FIRST]: 80,
254
+ [EClusterConfigType.FLAG_ENABLE_POSITION_HISTORY]: 81,
255
+ [EClusterConfigType.FLAG_PUBLISH_PRICE_DATA]: 82,
256
+ [EClusterConfigType.FLAG_DEVIATION_PENALTY]: 83
248
257
  });
@@ -2,6 +2,7 @@ export declare enum EKind {
2
2
  PERPETUAL = "PERPETUAL",
3
3
  FUTURE = "FUTURE",
4
4
  CALL = "CALL",
5
- PUT = "PUT"
5
+ PUT = "PUT",
6
+ SPOT_SWAP = "SPOT_SWAP"
6
7
  }
7
8
  export declare const EKindInt: Record<EKind, number>;
@@ -12,10 +12,13 @@ var EKind;
12
12
  EKind["CALL"] = "CALL";
13
13
  // the put option asset kind
14
14
  EKind["PUT"] = "PUT";
15
+ // the spot swap asset kind
16
+ EKind["SPOT_SWAP"] = "SPOT_SWAP";
15
17
  })(EKind || (exports.EKind = EKind = {}));
16
18
  exports.EKindInt = Object.freeze({
17
19
  [EKind.PERPETUAL]: 1,
18
20
  [EKind.FUTURE]: 2,
19
21
  [EKind.CALL]: 3,
20
- [EKind.PUT]: 4
22
+ [EKind.PUT]: 4,
23
+ [EKind.SPOT_SWAP]: 8
21
24
  });
@@ -43,6 +43,12 @@ export declare enum EOrderRejectReason {
43
43
  BUILDER_ORDER_BUILDER_NOT_AUTHORIZED = "BUILDER_ORDER_BUILDER_NOT_AUTHORIZED",
44
44
  BUILDER_ORDER_BUILDER_NOT_EXIST = "BUILDER_ORDER_BUILDER_NOT_EXIST",
45
45
  TRADE_PRICE_WORSE_THAN_BANKRUPTCY_PRICE = "TRADE_PRICE_WORSE_THAN_BANKRUPTCY_PRICE",
46
- TOO_MANY_MAKER_ORDERS = "TOO_MANY_MAKER_ORDERS"
46
+ TOO_MANY_MAKER_ORDERS = "TOO_MANY_MAKER_ORDERS",
47
+ REDUCE_ONLY_NOT_SUPPORTED_FOR_SPOT_ORDER = "REDUCE_ONLY_NOT_SUPPORTED_FOR_SPOT_ORDER",
48
+ TPSL_NOT_SUPPORTED_FOR_SPOT_ORDER = "TPSL_NOT_SUPPORTED_FOR_SPOT_ORDER",
49
+ SPOT_ORDER_NOT_SUPPORTED = "SPOT_ORDER_NOT_SUPPORTED",
50
+ INSUFFICIENT_BALANCE = "INSUFFICIENT_BALANCE",
51
+ SPOT_TRADING_BLOCKED_DURING_SOCIALIZED_LOSS = "SPOT_TRADING_BLOCKED_DURING_SOCIALIZED_LOSS",
52
+ BELOW_MARGIN_WITH_PENALTY_DEVIATION = "BELOW_MARGIN_WITH_PENALTY_DEVIATION"
47
53
  }
48
54
  export declare const EOrderRejectReasonInt: Record<EOrderRejectReason, number>;
@@ -93,6 +93,18 @@ var EOrderRejectReason;
93
93
  EOrderRejectReason["TRADE_PRICE_WORSE_THAN_BANKRUPTCY_PRICE"] = "TRADE_PRICE_WORSE_THAN_BANKRUPTCY_PRICE";
94
94
  // the order was cancelled due to matching with too many maker orders
95
95
  EOrderRejectReason["TOO_MANY_MAKER_ORDERS"] = "TOO_MANY_MAKER_ORDERS";
96
+ // reduce-only order is not supported for spot order
97
+ EOrderRejectReason["REDUCE_ONLY_NOT_SUPPORTED_FOR_SPOT_ORDER"] = "REDUCE_ONLY_NOT_SUPPORTED_FOR_SPOT_ORDER";
98
+ // tpsl is not supported for spot order
99
+ EOrderRejectReason["TPSL_NOT_SUPPORTED_FOR_SPOT_ORDER"] = "TPSL_NOT_SUPPORTED_FOR_SPOT_ORDER";
100
+ // spot order is not supported
101
+ EOrderRejectReason["SPOT_ORDER_NOT_SUPPORTED"] = "SPOT_ORDER_NOT_SUPPORTED";
102
+ // the subaccount has insufficient balance
103
+ EOrderRejectReason["INSUFFICIENT_BALANCE"] = "INSUFFICIENT_BALANCE";
104
+ // spot trading is blocked during socialized loss (SLOW)
105
+ EOrderRejectReason["SPOT_TRADING_BLOCKED_DURING_SOCIALIZED_LOSS"] = "SPOT_TRADING_BLOCKED_DURING_SOCIALIZED_LOSS";
106
+ // the order will bring the sub account below initial margin requirement considering wide price deviation
107
+ EOrderRejectReason["BELOW_MARGIN_WITH_PENALTY_DEVIATION"] = "BELOW_MARGIN_WITH_PENALTY_DEVIATION";
96
108
  })(EOrderRejectReason || (exports.EOrderRejectReason = EOrderRejectReason = {}));
97
109
  exports.EOrderRejectReasonInt = Object.freeze({
98
110
  [EOrderRejectReason.UNSPECIFIED]: 0,
@@ -139,5 +151,11 @@ exports.EOrderRejectReasonInt = Object.freeze({
139
151
  [EOrderRejectReason.BUILDER_ORDER_BUILDER_NOT_AUTHORIZED]: 41,
140
152
  [EOrderRejectReason.BUILDER_ORDER_BUILDER_NOT_EXIST]: 42,
141
153
  [EOrderRejectReason.TRADE_PRICE_WORSE_THAN_BANKRUPTCY_PRICE]: 44,
142
- [EOrderRejectReason.TOO_MANY_MAKER_ORDERS]: 45
154
+ [EOrderRejectReason.TOO_MANY_MAKER_ORDERS]: 45,
155
+ [EOrderRejectReason.REDUCE_ONLY_NOT_SUPPORTED_FOR_SPOT_ORDER]: 46,
156
+ [EOrderRejectReason.TPSL_NOT_SUPPORTED_FOR_SPOT_ORDER]: 47,
157
+ [EOrderRejectReason.SPOT_ORDER_NOT_SUPPORTED]: 48,
158
+ [EOrderRejectReason.INSUFFICIENT_BALANCE]: 49,
159
+ [EOrderRejectReason.SPOT_TRADING_BLOCKED_DURING_SOCIALIZED_LOSS]: 50,
160
+ [EOrderRejectReason.BELOW_MARGIN_WITH_PENALTY_DEVIATION]: 51
143
161
  });
@@ -0,0 +1,7 @@
1
+ export declare enum EPositionCloseStatus {
2
+ CLOSED = "CLOSED",
3
+ LIQUIDATED = "LIQUIDATED",
4
+ SETTLED = "SETTLED",
5
+ PARTIALLY_CLOSED = "PARTIALLY_CLOSED"
6
+ }
7
+ export declare const EPositionCloseStatusInt: Record<EPositionCloseStatus, number>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EPositionCloseStatusInt = exports.EPositionCloseStatus = void 0;
4
+ var EPositionCloseStatus;
5
+ (function (EPositionCloseStatus) {
6
+ // Position fully closed via reducing trade or flip
7
+ EPositionCloseStatus["CLOSED"] = "CLOSED";
8
+ // Position closed via liquidation
9
+ EPositionCloseStatus["LIQUIDATED"] = "LIQUIDATED";
10
+ // Position closed via settlement
11
+ EPositionCloseStatus["SETTLED"] = "SETTLED";
12
+ // Position partially closed
13
+ EPositionCloseStatus["PARTIALLY_CLOSED"] = "PARTIALLY_CLOSED";
14
+ })(EPositionCloseStatus || (exports.EPositionCloseStatus = EPositionCloseStatus = {}));
15
+ exports.EPositionCloseStatusInt = Object.freeze({
16
+ [EPositionCloseStatus.CLOSED]: 1,
17
+ [EPositionCloseStatus.LIQUIDATED]: 2,
18
+ [EPositionCloseStatus.SETTLED]: 3,
19
+ [EPositionCloseStatus.PARTIALLY_CLOSED]: 4
20
+ });
@@ -20,6 +20,7 @@ exports.HexStringMap = [
20
20
  'l_2_hash',
21
21
  'liquidity_score',
22
22
  'lp_address',
23
+ 'main_account_i_ds',
23
24
  'main_account_id',
24
25
  'maker_trading_volume',
25
26
  'order_i_ds',
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const ACCOUNT_MULTIPLIER_METRIC_POINT_MAP: SchemaPairMap;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ACCOUNT_MULTIPLIER_METRIC_POINT_MAP = void 0;
4
+ // Schema map for the 'ACCOUNT_MULTIPLIER_METRIC_POINT' struct.
5
+ exports.ACCOUNT_MULTIPLIER_METRIC_POINT_MAP = Object.freeze({
6
+ FULL_TO_LITE: {
7
+ metric: 'm',
8
+ point: 'p'
9
+ },
10
+ LITE_TO_FULL: {
11
+ m: 'metric',
12
+ p: 'point'
13
+ }
14
+ });
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const ACCOUNT_MULTIPLIER_OVERRIDE_ENTRY_MAP: SchemaPairMap;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ACCOUNT_MULTIPLIER_OVERRIDE_ENTRY_MAP = void 0;
4
+ const reward_account_multiplier_metadata_1 = require("./reward_account_multiplier_metadata");
5
+ // Schema map for the 'ACCOUNT_MULTIPLIER_OVERRIDE_ENTRY' struct.
6
+ exports.ACCOUNT_MULTIPLIER_OVERRIDE_ENTRY_MAP = Object.freeze({
7
+ FULL_TO_LITE: {
8
+ id: 'i',
9
+ metric: 'm',
10
+ multiplier: 'm1',
11
+ metadata: ['m2', reward_account_multiplier_metadata_1.REWARD_ACCOUNT_MULTIPLIER_METADATA_MAP.FULL_TO_LITE],
12
+ created_by_id: 'cb',
13
+ effective_epoch_end: 'ee',
14
+ create_time: 'ct',
15
+ reserve_multiplier: 'rm'
16
+ },
17
+ LITE_TO_FULL: {
18
+ i: 'id',
19
+ m: 'metric',
20
+ m1: 'multiplier',
21
+ m2: ['metadata', reward_account_multiplier_metadata_1.REWARD_ACCOUNT_MULTIPLIER_METADATA_MAP.LITE_TO_FULL],
22
+ cb: 'created_by_id',
23
+ ee: 'effective_epoch_end',
24
+ ct: 'create_time',
25
+ rm: 'reserve_multiplier'
26
+ }
27
+ });
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const ACCOUNT_WITH_OVERRIDDEN_MULTIPLIER_INFO_MAP: SchemaPairMap;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ACCOUNT_WITH_OVERRIDDEN_MULTIPLIER_INFO_MAP = void 0;
4
+ const account_multiplier_metric_point_1 = require("./account_multiplier_metric_point");
5
+ const account_multiplier_override_entry_1 = require("./account_multiplier_override_entry");
6
+ // Schema map for the 'ACCOUNT_WITH_OVERRIDDEN_MULTIPLIER_INFO' struct.
7
+ exports.ACCOUNT_WITH_OVERRIDDEN_MULTIPLIER_INFO_MAP = Object.freeze({
8
+ FULL_TO_LITE: {
9
+ off_chain_account_id: 'oc',
10
+ is_locked: 'il',
11
+ total_point: 'tp',
12
+ metric_points: ['mp', [account_multiplier_metric_point_1.ACCOUNT_MULTIPLIER_METRIC_POINT_MAP.FULL_TO_LITE]],
13
+ overrides: ['o', [account_multiplier_override_entry_1.ACCOUNT_MULTIPLIER_OVERRIDE_ENTRY_MAP.FULL_TO_LITE]]
14
+ },
15
+ LITE_TO_FULL: {
16
+ oc: 'off_chain_account_id',
17
+ il: 'is_locked',
18
+ tp: 'total_point',
19
+ mp: ['metric_points', [account_multiplier_metric_point_1.ACCOUNT_MULTIPLIER_METRIC_POINT_MAP.LITE_TO_FULL]],
20
+ o: ['overrides', [account_multiplier_override_entry_1.ACCOUNT_MULTIPLIER_OVERRIDE_ENTRY_MAP.LITE_TO_FULL]]
21
+ }
22
+ });