@grvt/client 1.4.16 → 1.4.18

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 (36) hide show
  1. package/README.md +62 -62
  2. package/TDG/index.d.ts +3 -1
  3. package/TDG/index.js +10 -0
  4. package/interfaces/codegen/data.interface.d.ts +57 -0
  5. package/interfaces/codegen/data.interface.js +8 -1
  6. package/interfaces/codegen/enum-int.d.ts +2 -1
  7. package/interfaces/codegen/enum-int.js +5 -1
  8. package/interfaces/codegen/schema-maps/api_query_list_vault_sub_account_summary_request.d.ts +2 -0
  9. package/interfaces/codegen/schema-maps/api_query_list_vault_sub_account_summary_request.js +14 -0
  10. package/interfaces/codegen/schema-maps/api_query_list_vault_sub_account_summary_response.d.ts +2 -0
  11. package/interfaces/codegen/schema-maps/api_query_list_vault_sub_account_summary_response.js +13 -0
  12. package/interfaces/codegen/schema-maps/api_query_vault_investor_history_request.d.ts +2 -0
  13. package/interfaces/codegen/schema-maps/api_query_vault_investor_history_request.js +12 -0
  14. package/interfaces/codegen/schema-maps/api_query_vault_investor_history_response.d.ts +2 -0
  15. package/interfaces/codegen/schema-maps/api_query_vault_investor_history_response.js +13 -0
  16. package/interfaces/codegen/schema-maps/api_query_vault_performance_response.js +6 -2
  17. package/interfaces/codegen/schema-maps/api_validate_vault_account_request.d.ts +2 -0
  18. package/interfaces/codegen/schema-maps/api_validate_vault_account_request.js +12 -0
  19. package/interfaces/codegen/schema-maps/api_validate_vault_account_response.d.ts +2 -0
  20. package/interfaces/codegen/schema-maps/api_validate_vault_account_response.js +12 -0
  21. package/interfaces/codegen/schema-maps/api_vault_detail_response.js +8 -2
  22. package/interfaces/codegen/schema-maps/api_vault_sub_account_summary.d.ts +2 -0
  23. package/interfaces/codegen/schema-maps/api_vault_sub_account_summary.js +16 -0
  24. package/interfaces/codegen/schema-maps/index.d.ts +11 -0
  25. package/interfaces/codegen/schema-maps/index.js +11 -0
  26. package/interfaces/codegen/schema-maps/main_account_leaderboard_entry.d.ts +2 -0
  27. package/interfaces/codegen/schema-maps/main_account_leaderboard_entry.js +22 -0
  28. package/interfaces/codegen/schema-maps/query_main_account_leaderboard_request.d.ts +2 -0
  29. package/interfaces/codegen/schema-maps/query_main_account_leaderboard_request.js +20 -0
  30. package/interfaces/codegen/schema-maps/query_main_account_leaderboard_response.d.ts +2 -0
  31. package/interfaces/codegen/schema-maps/query_main_account_leaderboard_response.js +15 -0
  32. package/interfaces/codegen/schema-maps/query_vault_investor_history_request.d.ts +2 -0
  33. package/interfaces/codegen/schema-maps/query_vault_investor_history_request.js +14 -0
  34. package/interfaces/codegen/schema-maps/vault_redeem_results.js +4 -2
  35. package/package.json +50 -50
  36. package/ws/ws.js +3 -6
package/README.md CHANGED
@@ -1,62 +1,62 @@
1
- # GRVT
2
-
3
- Node.js & JavaScript client for GRVT REST APIs & WebSockets
4
-
5
- ## Installing
6
-
7
- Using npm:
8
-
9
- ```bash
10
- npm install @grvt/client
11
- ```
12
-
13
- Using yarn:
14
-
15
- ```bash
16
- yarn add @grvt/client
17
- ```
18
-
19
- Using pnpm:
20
-
21
- ```bash
22
- pnpm add @grvt/client
23
- ```
24
-
25
- Once the package is installed, you can import the library using `import` or `require` approach:
26
-
27
- ```js
28
- import GRVT from '@grvt/client'
29
- ```
30
-
31
- You can also use the default export, since the named export is just a re-export from the GRVT factory:
32
-
33
- ```js
34
- import GRVT from '@grvt/client'
35
- console.log(
36
- new GRVT.MDG({
37
- host: 'https://market-data.dev.gravitymarkets.io',
38
- version: 'v1'
39
- })
40
- )
41
- ```
42
-
43
- If you use `require` for importing:
44
-
45
- ```js
46
- const GRVT = require('@grvt/client')
47
- console.log(
48
- new GRVT.MDG({
49
- host: 'https://market-data.dev.gravitymarkets.io',
50
- version: 'v1'
51
- })
52
- )
53
- ```
54
-
55
- ## To use WebSocket (available only in browsers/platforms that support WebSocket)
56
-
57
- [Browsers supported](https://caniuse.com/websockets)
58
-
59
- ```js
60
- import { EStreamEndpoints, WS } from '@grvt/client/ws'
61
- console.log(new WS('wss://market-data.dev.gravitymarkets.io/ws'))
62
- ```
1
+ # GRVT
2
+
3
+ Node.js & JavaScript client for GRVT REST APIs & WebSockets
4
+
5
+ ## Installing
6
+
7
+ Using npm:
8
+
9
+ ```bash
10
+ npm install @grvt/client
11
+ ```
12
+
13
+ Using yarn:
14
+
15
+ ```bash
16
+ yarn add @grvt/client
17
+ ```
18
+
19
+ Using pnpm:
20
+
21
+ ```bash
22
+ pnpm add @grvt/client
23
+ ```
24
+
25
+ Once the package is installed, you can import the library using `import` or `require` approach:
26
+
27
+ ```js
28
+ import GRVT from '@grvt/client'
29
+ ```
30
+
31
+ You can also use the default export, since the named export is just a re-export from the GRVT factory:
32
+
33
+ ```js
34
+ import GRVT from '@grvt/client'
35
+ console.log(
36
+ new GRVT.MDG({
37
+ host: 'https://market-data.dev.gravitymarkets.io',
38
+ version: 'v1'
39
+ })
40
+ )
41
+ ```
42
+
43
+ If you use `require` for importing:
44
+
45
+ ```js
46
+ const GRVT = require('@grvt/client')
47
+ console.log(
48
+ new GRVT.MDG({
49
+ host: 'https://market-data.dev.gravitymarkets.io',
50
+ version: 'v1'
51
+ })
52
+ )
53
+ ```
54
+
55
+ ## To use WebSocket (available only in browsers/platforms that support WebSocket)
56
+
57
+ [Browsers supported](https://caniuse.com/websockets)
58
+
59
+ ```js
60
+ import { EStreamEndpoints, WS } from '@grvt/client/ws'
61
+ console.log(new WS('wss://market-data.dev.gravitymarkets.io/ws'))
62
+ ```
package/TDG/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { type AxiosRequestConfig } from 'axios';
2
- import { type IAckResponse, type IApiAggregatedAccountSummaryResponse, type IApiCancelAllOrdersRequest, type IApiCancelAllOrdersResponse, type IApiCancelOrderRequest, type IApiCancelOrderResponse, type IApiCreateBulkOrdersRequest, type IApiCreateBulkOrdersResponse, type IApiCreateOrderRequest, type IApiCreateOrderResponse, type IApiDedustPositionRequest, type IApiDedustPositionResponse, type IApiDepositHistoryRequest, type IApiDepositHistoryResponse, type IApiFillHistoryRequest, type IApiFillHistoryResponse, type IApiFundingAccountSummaryResponse, type IApiFundingPaymentHistoryRequest, type IApiFundingPaymentHistoryResponse, type IApiGetAllInitialLeverageRequest, type IApiGetAllInitialLeverageResponse, type IApiGetMarginTiersResponse, type IApiGetOrderGroupRequest, type IApiGetOrderGroupResponse, type IApiGetOrderRequest, type IApiGetOrderResponse, type IApiOpenOrdersRequest, type IApiOpenOrdersResponse, type IApiOrderHistoryRequest, type IApiOrderHistoryResponse, type IApiPositionsRequest, type IApiPositionsResponse, type IApiPreDepositCheckRequest, type IApiPreDepositCheckResponse, type IApiPreOrderCheckRequest, type IApiPreOrderCheckResponse, type IApiQueryListFundingAccountSummaryRequest, type IApiQueryListFundingAccountSummaryResponse, type IApiQueryListSubAccountSummaryRequest, type IApiQueryListSubAccountSummaryResponse, type IApiQuerySnapVaultPositionRequest, type IApiQuerySnapVaultPositionResponse, type IApiQueryTradingPerformanceRequest, type IApiQueryTradingPerformanceResponse, type IApiQueryTradingPerformanceTrendRequest, type IApiQueryTradingPerformanceTrendResponse, type IApiQueryVaultPerformanceRequest, type IApiQueryVaultPerformanceResponse, type IApiQueryVaultPerformanceTrendRequest, type IApiQueryVaultPerformanceTrendResponse, type IApiQueryVaultRiskMetricRequest, type IApiQueryVaultRiskMetricResponse, type IApiQueryVaultSummaryHistoryRequest, type IApiQueryVaultSummaryHistoryResponse, type IApiReplaceOrdersRequest, type IApiReplaceOrdersResponse, type IApiSetInitialLeverageRequest, type IApiSetInitialLeverageResponse, type IApiSocializedLossStatusResponse, type IApiSubAccountHistoryRequest, type IApiSubAccountHistoryResponse, type IApiSubAccountSummaryRequest, type IApiSubAccountSummaryResponse, type IApiTimedAssetExposureRequest, type IApiTimedAssetExposureResponse, type IApiTimedVaultAssetExposureRequest, type IApiTransferHistoryRequest, type IApiTransferHistoryResponse, type IApiTransferRequest, type IApiTransferResponse, type IApiVaultBurnTokensRequest, type IApiVaultDetailRequest, type IApiVaultDetailResponse, type IApiVaultInvestorSummaryRequest, type IApiVaultInvestorSummaryResponse, type IApiVaultInvestRequest, type IApiVaultRedeemCancelRequest, type IApiVaultRedeemRequest, type IApiVaultViewRedemptionQueueRequest, type IApiVaultViewRedemptionQueueResponse, type IApiWithdrawalHistoryRequest, type IApiWithdrawalHistoryResponse, type IApiWithdrawalRequest, type IConfig } from '../interfaces';
2
+ import { type IAckResponse, type IApiAggregatedAccountSummaryResponse, type IApiCancelAllOrdersRequest, type IApiCancelAllOrdersResponse, type IApiCancelOrderRequest, type IApiCancelOrderResponse, type IApiCreateBulkOrdersRequest, type IApiCreateBulkOrdersResponse, type IApiCreateOrderRequest, type IApiCreateOrderResponse, type IApiDedustPositionRequest, type IApiDedustPositionResponse, type IApiDepositHistoryRequest, type IApiDepositHistoryResponse, type IApiFillHistoryRequest, type IApiFillHistoryResponse, type IApiFundingAccountSummaryResponse, type IApiFundingPaymentHistoryRequest, type IApiFundingPaymentHistoryResponse, type IApiGetAllInitialLeverageRequest, type IApiGetAllInitialLeverageResponse, type IApiGetMarginTiersResponse, type IApiGetOrderGroupRequest, type IApiGetOrderGroupResponse, type IApiGetOrderRequest, type IApiGetOrderResponse, type IApiOpenOrdersRequest, type IApiOpenOrdersResponse, type IApiOrderHistoryRequest, type IApiOrderHistoryResponse, type IApiPositionsRequest, type IApiPositionsResponse, type IApiPreDepositCheckRequest, type IApiPreDepositCheckResponse, type IApiPreOrderCheckRequest, type IApiPreOrderCheckResponse, type IApiQueryListFundingAccountSummaryRequest, type IApiQueryListFundingAccountSummaryResponse, type IApiQueryListSubAccountSummaryRequest, type IApiQueryListSubAccountSummaryResponse, type IApiQueryListVaultSubAccountSummaryRequest, type IApiQueryListVaultSubAccountSummaryResponse, type IApiQuerySnapVaultPositionRequest, type IApiQuerySnapVaultPositionResponse, type IApiQueryTradingPerformanceRequest, type IApiQueryTradingPerformanceResponse, type IApiQueryTradingPerformanceTrendRequest, type IApiQueryTradingPerformanceTrendResponse, type IApiQueryVaultInvestorHistoryRequest, type IApiQueryVaultInvestorHistoryResponse, type IApiQueryVaultPerformanceRequest, type IApiQueryVaultPerformanceResponse, type IApiQueryVaultPerformanceTrendRequest, type IApiQueryVaultPerformanceTrendResponse, type IApiQueryVaultRiskMetricRequest, type IApiQueryVaultRiskMetricResponse, type IApiQueryVaultSummaryHistoryRequest, type IApiQueryVaultSummaryHistoryResponse, type IApiReplaceOrdersRequest, type IApiReplaceOrdersResponse, type IApiSetInitialLeverageRequest, type IApiSetInitialLeverageResponse, type IApiSocializedLossStatusResponse, type IApiSubAccountHistoryRequest, type IApiSubAccountHistoryResponse, type IApiSubAccountSummaryRequest, type IApiSubAccountSummaryResponse, type IApiTimedAssetExposureRequest, type IApiTimedAssetExposureResponse, type IApiTimedVaultAssetExposureRequest, type IApiTransferHistoryRequest, type IApiTransferHistoryResponse, type IApiTransferRequest, type IApiTransferResponse, type IApiVaultBurnTokensRequest, type IApiVaultDetailRequest, type IApiVaultDetailResponse, type IApiVaultInvestorSummaryRequest, type IApiVaultInvestorSummaryResponse, type IApiVaultInvestRequest, type IApiVaultRedeemCancelRequest, type IApiVaultRedeemRequest, type IApiVaultViewRedemptionQueueRequest, type IApiVaultViewRedemptionQueueResponse, type IApiWithdrawalHistoryRequest, type IApiWithdrawalHistoryResponse, type IApiWithdrawalRequest, type IConfig } from '../interfaces';
3
3
  export declare class TDG {
4
4
  private readonly _axios;
5
5
  private readonly _fullUrl;
@@ -123,6 +123,8 @@ export declare class TDG {
123
123
  vaultPerformanceTrend(payload: IApiQueryVaultPerformanceTrendRequest, config?: AxiosRequestConfig): Promise<IApiQueryVaultPerformanceTrendResponse>;
124
124
  vaultRiskMetric(payload: IApiQueryVaultRiskMetricRequest, config?: AxiosRequestConfig): Promise<IApiQueryVaultRiskMetricResponse>;
125
125
  vaultSummaryHistory(payload: IApiQueryVaultSummaryHistoryRequest, config?: AxiosRequestConfig): Promise<IApiQueryVaultSummaryHistoryResponse>;
126
+ vaultSubAccountSummaryHistory(payload: IApiQueryListVaultSubAccountSummaryRequest, config?: AxiosRequestConfig): Promise<IApiQueryListVaultSubAccountSummaryResponse>;
127
+ vaultInvestorHistory(payload: IApiQueryVaultInvestorHistoryRequest, config?: AxiosRequestConfig): Promise<IApiQueryVaultInvestorHistoryResponse>;
126
128
  vaultAssetExposure(payload: IApiTimedVaultAssetExposureRequest, config?: AxiosRequestConfig): Promise<IApiTimedAssetExposureResponse>;
127
129
  snapVaultPosition(payload: IApiQuerySnapVaultPositionRequest, config?: AxiosRequestConfig): Promise<IApiQuerySnapVaultPositionResponse>;
128
130
  vaultDetail(payload: IApiVaultDetailRequest, config?: AxiosRequestConfig): Promise<IApiVaultDetailResponse>;
package/TDG/index.js CHANGED
@@ -301,6 +301,16 @@ class TDG {
301
301
  return utils_1.Utils.schemaMap(response.data, interfaces_1.API_QUERY_VAULT_SUMMARY_HISTORY_RESPONSE_MAP.LITE_TO_FULL);
302
302
  }).catch(utils_1.Utils.coverApiError);
303
303
  }
304
+ vaultSubAccountSummaryHistory(payload, config) {
305
+ return this._axios.post(this._liteUrl + '/vault_sub_account_summary_history', utils_1.Utils.schemaMap(payload, interfaces_1.API_QUERY_LIST_VAULT_SUB_ACCOUNT_SUMMARY_REQUEST_MAP.FULL_TO_LITE, true), config).then((response) => {
306
+ return utils_1.Utils.schemaMap(response.data, interfaces_1.API_QUERY_LIST_VAULT_SUB_ACCOUNT_SUMMARY_RESPONSE_MAP.LITE_TO_FULL);
307
+ }).catch(utils_1.Utils.coverApiError);
308
+ }
309
+ vaultInvestorHistory(payload, config) {
310
+ return this._axios.post(this._liteUrl + '/vault_investor_history', utils_1.Utils.schemaMap(payload, interfaces_1.API_QUERY_VAULT_INVESTOR_HISTORY_REQUEST_MAP.FULL_TO_LITE, true), config).then((response) => {
311
+ return utils_1.Utils.schemaMap(response.data, interfaces_1.API_QUERY_VAULT_INVESTOR_HISTORY_RESPONSE_MAP.LITE_TO_FULL);
312
+ }).catch(utils_1.Utils.coverApiError);
313
+ }
304
314
  vaultAssetExposure(payload, config) {
305
315
  return this._axios.post(this._liteUrl + '/vault_asset_exposure', utils_1.Utils.schemaMap(payload, interfaces_1.API_TIMED_VAULT_ASSET_EXPOSURE_REQUEST_MAP.FULL_TO_LITE, true), config).then((response) => {
306
316
  return utils_1.Utils.schemaMap(response.data, interfaces_1.API_TIMED_ASSET_EXPOSURE_RESPONSE_MAP.LITE_TO_FULL);
@@ -157,6 +157,10 @@ export declare enum EOrderStatus {
157
157
  REJECTED = "REJECTED",
158
158
  CANCELLED = "CANCELLED"
159
159
  }
160
+ export declare enum EQueryMainAccountLeaderboardOrderBy {
161
+ PNL = "PNL",
162
+ TRADING_VOLUME = "TRADING_VOLUME"
163
+ }
160
164
  export declare enum ERewardEpochStatus {
161
165
  PAST = "PAST",
162
166
  CURRENT = "CURRENT",
@@ -622,6 +626,13 @@ export interface IApiQueryListSubAccountSummaryResponse {
622
626
  result?: ISnapSubAccountSummary[];
623
627
  next?: string;
624
628
  }
629
+ export interface IApiQueryListVaultSubAccountSummaryRequest {
630
+ vault_id?: string;
631
+ time_interval?: ETimeInterval;
632
+ }
633
+ export interface IApiQueryListVaultSubAccountSummaryResponse {
634
+ result?: IApiVaultSubAccountSummary[];
635
+ }
625
636
  export interface IApiQuerySnapVaultPositionRequest {
626
637
  vault_id?: string;
627
638
  }
@@ -645,12 +656,20 @@ export interface IApiQueryTradingPerformanceTrendResponse {
645
656
  result?: IApiTradingPerformanceTrend[];
646
657
  next?: string;
647
658
  }
659
+ export interface IApiQueryVaultInvestorHistoryRequest {
660
+ vault_id?: string;
661
+ }
662
+ export interface IApiQueryVaultInvestorHistoryResponse {
663
+ result?: IVaultInvestorHistory[];
664
+ }
648
665
  export interface IApiQueryVaultPerformanceRequest {
649
666
  vault_id?: string;
650
667
  }
651
668
  export interface IApiQueryVaultPerformanceResponse {
652
669
  trading_volume?: string;
653
670
  apr?: number;
671
+ realized_pnl?: string;
672
+ pnl?: string;
654
673
  }
655
674
  export interface IApiQueryVaultPerformanceTrendRequest {
656
675
  vault_id?: string;
@@ -841,6 +860,12 @@ export interface IApiUserCategoryAffinityScoreRequest {
841
860
  export interface IApiUserCategoryAffinityScoreResponse {
842
861
  result?: IUserCategoryAffinityScore[];
843
862
  }
863
+ export interface IApiValidateVaultAccountRequest {
864
+ vault_i_ds?: string[];
865
+ }
866
+ export interface IApiValidateVaultAccountResponse {
867
+ result?: boolean;
868
+ }
844
869
  export interface IApiVaultBurnTokensRequest {
845
870
  main_account_id?: string;
846
871
  vault_id?: string;
@@ -855,6 +880,9 @@ export interface IApiVaultDetailResponse {
855
880
  share_price?: string;
856
881
  total_equity?: string;
857
882
  valuation_cap?: string;
883
+ unrealized_pnl?: string;
884
+ initial_margin?: string;
885
+ maintenance_margin?: string;
858
886
  }
859
887
  export interface IApiVaultInvestRequest {
860
888
  main_account_id?: string;
@@ -886,6 +914,11 @@ export interface IApiVaultRedeemRequest {
886
914
  num_tokens?: string;
887
915
  signature?: ISignature;
888
916
  }
917
+ export interface IApiVaultSubAccountSummary {
918
+ event_time?: string;
919
+ start_interval?: string;
920
+ total_equity?: string;
921
+ }
889
922
  export interface IApiVaultSummary {
890
923
  event_time?: string;
891
924
  start_interval?: string;
@@ -1178,6 +1211,14 @@ export interface ILpInfoEntry {
1178
1211
  export interface IMainAccIDRequest {
1179
1212
  main_account_id?: string;
1180
1213
  }
1214
+ export interface IMainAccountLeaderboardEntry {
1215
+ main_account_id?: string;
1216
+ total_fee?: string;
1217
+ total_trade_volume?: string;
1218
+ num_traded?: string;
1219
+ positive_fee?: string;
1220
+ realized_pnl?: string;
1221
+ }
1181
1222
  export interface IMarginTierResponse {
1182
1223
  lower_bound?: string;
1183
1224
  rate?: string;
@@ -1326,6 +1367,17 @@ export interface IQueryLatestSubAccountSummaryRequest {
1326
1367
  export interface IQueryLatestSubAccountSummaryResponse {
1327
1368
  result?: ISnapSubAccountSummary;
1328
1369
  }
1370
+ export interface IQueryMainAccountLeaderboardRequest {
1371
+ limit?: number;
1372
+ start_time?: string;
1373
+ end_time?: string;
1374
+ order_by?: EQueryMainAccountLeaderboardOrderBy;
1375
+ cursor?: string;
1376
+ }
1377
+ export interface IQueryMainAccountLeaderboardResponse {
1378
+ result?: IMainAccountLeaderboardEntry[];
1379
+ cursor?: string;
1380
+ }
1329
1381
  export interface IQueryTradingPerformanceTrendRequest {
1330
1382
  sub_account_i_ds?: string[];
1331
1383
  time_interval?: ETimeInterval;
@@ -1334,6 +1386,10 @@ export interface IQueryTradingPerformanceTrendResponse {
1334
1386
  result?: ITradingPerformancePoint[];
1335
1387
  next?: string;
1336
1388
  }
1389
+ export interface IQueryVaultInvestorHistoryRequest {
1390
+ main_account_id?: string;
1391
+ vault_id?: string;
1392
+ }
1337
1393
  export interface IQueryVaultSummaryHistoryRequest {
1338
1394
  vault_id?: string;
1339
1395
  start_time?: string;
@@ -1596,6 +1652,7 @@ export interface IVaultRedeemResults {
1596
1652
  num_tokens?: string;
1597
1653
  avg_entry_price?: string;
1598
1654
  fees_charged?: string;
1655
+ realized_pnl?: string;
1599
1656
  }
1600
1657
  export interface IVaultRedemption {
1601
1658
  num_lp_tokens?: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EVenue = exports.EVaultType = exports.ETriggerType = exports.ETriggerBy = exports.ETransferType = exports.ETimeInterval = exports.ETimeInForce = exports.ESubAccountTradeInterval = exports.ESource = exports.ERewardProgramType = exports.ERewardEpochStatus = exports.EOrderStatus = exports.EOrderRejectReason = exports.EMarginType = exports.EKind = exports.EInstrumentSettlementPeriod = exports.EEpochBadgeType = exports.ECurrency = exports.ECandlestickType = exports.ECandlestickInterval = exports.ECancelStatus = exports.EBrokerTag = exports.EBridgeType = void 0;
3
+ exports.EVenue = exports.EVaultType = exports.ETriggerType = exports.ETriggerBy = exports.ETransferType = exports.ETimeInterval = exports.ETimeInForce = exports.ESubAccountTradeInterval = exports.ESource = exports.ERewardProgramType = exports.ERewardEpochStatus = exports.EQueryMainAccountLeaderboardOrderBy = exports.EOrderStatus = exports.EOrderRejectReason = exports.EMarginType = exports.EKind = exports.EInstrumentSettlementPeriod = exports.EEpochBadgeType = exports.ECurrency = exports.ECandlestickType = exports.ECandlestickInterval = exports.ECancelStatus = exports.EBrokerTag = exports.EBridgeType = void 0;
4
4
  var EBridgeType;
5
5
  (function (EBridgeType) {
6
6
  // XY Bridge type
@@ -309,6 +309,13 @@ var EOrderStatus;
309
309
  // Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.
310
310
  EOrderStatus["CANCELLED"] = "CANCELLED";
311
311
  })(EOrderStatus || (exports.EOrderStatus = EOrderStatus = {}));
312
+ var EQueryMainAccountLeaderboardOrderBy;
313
+ (function (EQueryMainAccountLeaderboardOrderBy) {
314
+ // Sort by realized PnL
315
+ EQueryMainAccountLeaderboardOrderBy["PNL"] = "PNL";
316
+ // Sort by trading volume
317
+ EQueryMainAccountLeaderboardOrderBy["TRADING_VOLUME"] = "TRADING_VOLUME";
318
+ })(EQueryMainAccountLeaderboardOrderBy || (exports.EQueryMainAccountLeaderboardOrderBy = EQueryMainAccountLeaderboardOrderBy = {}));
312
319
  var ERewardEpochStatus;
313
320
  (function (ERewardEpochStatus) {
314
321
  // Past
@@ -1,4 +1,4 @@
1
- import { EBridgeType, EBrokerTag, ECancelStatus, ECandlestickInterval, ECandlestickType, ECurrency, EEpochBadgeType, EInstrumentSettlementPeriod, EKind, EMarginType, EOrderRejectReason, EOrderStatus, ERewardEpochStatus, ERewardProgramType, ESource, ESubAccountTradeInterval, ETimeInForce, ETimeInterval, ETransferType, ETriggerBy, ETriggerType, EVaultType, EVenue } from './data.interface';
1
+ import { EBridgeType, EBrokerTag, ECancelStatus, ECandlestickInterval, ECandlestickType, ECurrency, EEpochBadgeType, EInstrumentSettlementPeriod, EKind, EMarginType, EOrderRejectReason, EOrderStatus, EQueryMainAccountLeaderboardOrderBy, ERewardEpochStatus, ERewardProgramType, ESource, ESubAccountTradeInterval, ETimeInForce, ETimeInterval, ETransferType, ETriggerBy, ETriggerType, EVaultType, EVenue } from './data.interface';
2
2
  export declare const EBridgeTypeInt: Record<EBridgeType, number>;
3
3
  export declare const EBrokerTagInt: Record<EBrokerTag, number>;
4
4
  export declare const ECancelStatusInt: Record<ECancelStatus, number>;
@@ -11,6 +11,7 @@ export declare const EKindInt: Record<EKind, number>;
11
11
  export declare const EMarginTypeInt: Record<EMarginType, number>;
12
12
  export declare const EOrderRejectReasonInt: Record<EOrderRejectReason, number>;
13
13
  export declare const EOrderStatusInt: Record<EOrderStatus, number>;
14
+ export declare const EQueryMainAccountLeaderboardOrderByInt: Record<EQueryMainAccountLeaderboardOrderBy, number>;
14
15
  export declare const ERewardEpochStatusInt: Record<ERewardEpochStatus, number>;
15
16
  export declare const ERewardProgramTypeInt: Record<ERewardProgramType, number>;
16
17
  export declare const ESourceInt: Record<ESource, number>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EVenueInt = exports.EVaultTypeInt = exports.ETriggerTypeInt = exports.ETriggerByInt = exports.ETransferTypeInt = exports.ETimeIntervalInt = exports.ETimeInForceInt = exports.ESubAccountTradeIntervalInt = exports.ESourceInt = exports.ERewardProgramTypeInt = exports.ERewardEpochStatusInt = exports.EOrderStatusInt = exports.EOrderRejectReasonInt = exports.EMarginTypeInt = exports.EKindInt = exports.EInstrumentSettlementPeriodInt = exports.EEpochBadgeTypeInt = exports.ECurrencyInt = exports.ECandlestickTypeInt = exports.ECandlestickIntervalInt = exports.ECancelStatusInt = exports.EBrokerTagInt = exports.EBridgeTypeInt = void 0;
3
+ exports.EVenueInt = exports.EVaultTypeInt = exports.ETriggerTypeInt = exports.ETriggerByInt = exports.ETransferTypeInt = exports.ETimeIntervalInt = exports.ETimeInForceInt = exports.ESubAccountTradeIntervalInt = exports.ESourceInt = exports.ERewardProgramTypeInt = exports.ERewardEpochStatusInt = exports.EQueryMainAccountLeaderboardOrderByInt = exports.EOrderStatusInt = exports.EOrderRejectReasonInt = exports.EMarginTypeInt = exports.EKindInt = exports.EInstrumentSettlementPeriodInt = exports.EEpochBadgeTypeInt = exports.ECurrencyInt = exports.ECandlestickTypeInt = exports.ECandlestickIntervalInt = exports.ECancelStatusInt = exports.EBrokerTagInt = exports.EBridgeTypeInt = void 0;
4
4
  const data_interface_1 = require("./data.interface");
5
5
  exports.EBridgeTypeInt = Object.freeze({
6
6
  [data_interface_1.EBridgeType.XY]: 1,
@@ -161,6 +161,10 @@ exports.EOrderStatusInt = Object.freeze({
161
161
  [data_interface_1.EOrderStatus.REJECTED]: 4,
162
162
  [data_interface_1.EOrderStatus.CANCELLED]: 5
163
163
  });
164
+ exports.EQueryMainAccountLeaderboardOrderByInt = Object.freeze({
165
+ [data_interface_1.EQueryMainAccountLeaderboardOrderBy.PNL]: 1,
166
+ [data_interface_1.EQueryMainAccountLeaderboardOrderBy.TRADING_VOLUME]: 2
167
+ });
164
168
  exports.ERewardEpochStatusInt = Object.freeze({
165
169
  [data_interface_1.ERewardEpochStatus.PAST]: 1,
166
170
  [data_interface_1.ERewardEpochStatus.CURRENT]: 2,
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const API_QUERY_LIST_VAULT_SUB_ACCOUNT_SUMMARY_REQUEST_MAP: SchemaPairMap;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.API_QUERY_LIST_VAULT_SUB_ACCOUNT_SUMMARY_REQUEST_MAP = void 0;
4
+ // Schema map for the 'API_QUERY_LIST_VAULT_SUB_ACCOUNT_SUMMARY_REQUEST' struct.
5
+ exports.API_QUERY_LIST_VAULT_SUB_ACCOUNT_SUMMARY_REQUEST_MAP = Object.freeze({
6
+ FULL_TO_LITE: {
7
+ vault_id: 'vi',
8
+ time_interval: 'ti'
9
+ },
10
+ LITE_TO_FULL: {
11
+ vi: 'vault_id',
12
+ ti: 'time_interval'
13
+ }
14
+ });
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const API_QUERY_LIST_VAULT_SUB_ACCOUNT_SUMMARY_RESPONSE_MAP: SchemaPairMap;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.API_QUERY_LIST_VAULT_SUB_ACCOUNT_SUMMARY_RESPONSE_MAP = void 0;
4
+ const api_vault_sub_account_summary_1 = require("./api_vault_sub_account_summary");
5
+ // Schema map for the 'API_QUERY_LIST_VAULT_SUB_ACCOUNT_SUMMARY_RESPONSE' struct.
6
+ exports.API_QUERY_LIST_VAULT_SUB_ACCOUNT_SUMMARY_RESPONSE_MAP = Object.freeze({
7
+ FULL_TO_LITE: {
8
+ result: ['r', [api_vault_sub_account_summary_1.API_VAULT_SUB_ACCOUNT_SUMMARY_MAP.FULL_TO_LITE]]
9
+ },
10
+ LITE_TO_FULL: {
11
+ r: ['result', [api_vault_sub_account_summary_1.API_VAULT_SUB_ACCOUNT_SUMMARY_MAP.LITE_TO_FULL]]
12
+ }
13
+ });
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const API_QUERY_VAULT_INVESTOR_HISTORY_REQUEST_MAP: SchemaPairMap;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.API_QUERY_VAULT_INVESTOR_HISTORY_REQUEST_MAP = void 0;
4
+ // Schema map for the 'API_QUERY_VAULT_INVESTOR_HISTORY_REQUEST' struct.
5
+ exports.API_QUERY_VAULT_INVESTOR_HISTORY_REQUEST_MAP = Object.freeze({
6
+ FULL_TO_LITE: {
7
+ vault_id: 'vi'
8
+ },
9
+ LITE_TO_FULL: {
10
+ vi: 'vault_id'
11
+ }
12
+ });
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const API_QUERY_VAULT_INVESTOR_HISTORY_RESPONSE_MAP: SchemaPairMap;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.API_QUERY_VAULT_INVESTOR_HISTORY_RESPONSE_MAP = void 0;
4
+ const vault_investor_history_1 = require("./vault_investor_history");
5
+ // Schema map for the 'API_QUERY_VAULT_INVESTOR_HISTORY_RESPONSE' struct.
6
+ exports.API_QUERY_VAULT_INVESTOR_HISTORY_RESPONSE_MAP = Object.freeze({
7
+ FULL_TO_LITE: {
8
+ result: ['r', [vault_investor_history_1.VAULT_INVESTOR_HISTORY_MAP.FULL_TO_LITE]]
9
+ },
10
+ LITE_TO_FULL: {
11
+ r: ['result', [vault_investor_history_1.VAULT_INVESTOR_HISTORY_MAP.LITE_TO_FULL]]
12
+ }
13
+ });
@@ -5,10 +5,14 @@ exports.API_QUERY_VAULT_PERFORMANCE_RESPONSE_MAP = void 0;
5
5
  exports.API_QUERY_VAULT_PERFORMANCE_RESPONSE_MAP = Object.freeze({
6
6
  FULL_TO_LITE: {
7
7
  trading_volume: 'tv',
8
- apr: 'a'
8
+ apr: 'a',
9
+ realized_pnl: 'rp',
10
+ pnl: 'p'
9
11
  },
10
12
  LITE_TO_FULL: {
11
13
  tv: 'trading_volume',
12
- a: 'apr'
14
+ a: 'apr',
15
+ rp: 'realized_pnl',
16
+ p: 'pnl'
13
17
  }
14
18
  });
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const API_VALIDATE_VAULT_ACCOUNT_REQUEST_MAP: SchemaPairMap;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.API_VALIDATE_VAULT_ACCOUNT_REQUEST_MAP = void 0;
4
+ // Schema map for the 'API_VALIDATE_VAULT_ACCOUNT_REQUEST' struct.
5
+ exports.API_VALIDATE_VAULT_ACCOUNT_REQUEST_MAP = Object.freeze({
6
+ FULL_TO_LITE: {
7
+ vault_i_ds: 'vi'
8
+ },
9
+ LITE_TO_FULL: {
10
+ vi: 'vault_i_ds'
11
+ }
12
+ });
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const API_VALIDATE_VAULT_ACCOUNT_RESPONSE_MAP: SchemaPairMap;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.API_VALIDATE_VAULT_ACCOUNT_RESPONSE_MAP = void 0;
4
+ // Schema map for the 'API_VALIDATE_VAULT_ACCOUNT_RESPONSE' struct.
5
+ exports.API_VALIDATE_VAULT_ACCOUNT_RESPONSE_MAP = Object.freeze({
6
+ FULL_TO_LITE: {
7
+ result: 'r'
8
+ },
9
+ LITE_TO_FULL: {
10
+ r: 'result'
11
+ }
12
+ });
@@ -6,11 +6,17 @@ exports.API_VAULT_DETAIL_RESPONSE_MAP = Object.freeze({
6
6
  FULL_TO_LITE: {
7
7
  share_price: 'sp',
8
8
  total_equity: 'te',
9
- valuation_cap: 'vc'
9
+ valuation_cap: 'vc',
10
+ unrealized_pnl: 'up',
11
+ initial_margin: 'im',
12
+ maintenance_margin: 'mm'
10
13
  },
11
14
  LITE_TO_FULL: {
12
15
  sp: 'share_price',
13
16
  te: 'total_equity',
14
- vc: 'valuation_cap'
17
+ vc: 'valuation_cap',
18
+ up: 'unrealized_pnl',
19
+ im: 'initial_margin',
20
+ mm: 'maintenance_margin'
15
21
  }
16
22
  });
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const API_VAULT_SUB_ACCOUNT_SUMMARY_MAP: SchemaPairMap;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.API_VAULT_SUB_ACCOUNT_SUMMARY_MAP = void 0;
4
+ // Schema map for the 'API_VAULT_SUB_ACCOUNT_SUMMARY' struct.
5
+ exports.API_VAULT_SUB_ACCOUNT_SUMMARY_MAP = Object.freeze({
6
+ FULL_TO_LITE: {
7
+ event_time: 'et',
8
+ start_interval: 'si',
9
+ total_equity: 'te'
10
+ },
11
+ LITE_TO_FULL: {
12
+ et: 'event_time',
13
+ si: 'start_interval',
14
+ te: 'total_equity'
15
+ }
16
+ });
@@ -94,12 +94,16 @@ export * from './api_query_list_funding_account_summary_request';
94
94
  export * from './api_query_list_funding_account_summary_response';
95
95
  export * from './api_query_list_sub_account_summary_request';
96
96
  export * from './api_query_list_sub_account_summary_response';
97
+ export * from './api_query_list_vault_sub_account_summary_request';
98
+ export * from './api_query_list_vault_sub_account_summary_response';
97
99
  export * from './api_query_snap_vault_position_request';
98
100
  export * from './api_query_snap_vault_position_response';
99
101
  export * from './api_query_trading_performance_request';
100
102
  export * from './api_query_trading_performance_response';
101
103
  export * from './api_query_trading_performance_trend_request';
102
104
  export * from './api_query_trading_performance_trend_response';
105
+ export * from './api_query_vault_investor_history_request';
106
+ export * from './api_query_vault_investor_history_response';
103
107
  export * from './api_query_vault_performance_request';
104
108
  export * from './api_query_vault_performance_response';
105
109
  export * from './api_query_vault_performance_trend_request';
@@ -142,6 +146,8 @@ export * from './api_transfer_request';
142
146
  export * from './api_transfer_response';
143
147
  export * from './api_user_category_affinity_score_request';
144
148
  export * from './api_user_category_affinity_score_response';
149
+ export * from './api_validate_vault_account_request';
150
+ export * from './api_validate_vault_account_response';
145
151
  export * from './api_vault_burn_tokens_request';
146
152
  export * from './api_vault_detail_request';
147
153
  export * from './api_vault_detail_response';
@@ -151,6 +157,7 @@ export * from './api_vault_investor_summary_response';
151
157
  export * from './api_vault_performance_trend';
152
158
  export * from './api_vault_redeem_cancel_request';
153
159
  export * from './api_vault_redeem_request';
160
+ export * from './api_vault_sub_account_summary';
154
161
  export * from './api_vault_summary';
155
162
  export * from './api_vault_view_redemption_queue_request';
156
163
  export * from './api_vault_view_redemption_queue_response';
@@ -190,6 +197,7 @@ export * from './lp_point';
190
197
  export * from './lp_snapshot';
191
198
  export * from './lp_info_entry';
192
199
  export * from './main_acc_id_request';
200
+ export * from './main_account_leaderboard_entry';
193
201
  export * from './margin_tier_response';
194
202
  export * from './mini_ticker';
195
203
  export * from './order';
@@ -214,8 +222,11 @@ export * from './query_get_list_epoch_request';
214
222
  export * from './query_get_list_epoch_response';
215
223
  export * from './query_latest_sub_account_summary_request';
216
224
  export * from './query_latest_sub_account_summary_response';
225
+ export * from './query_main_account_leaderboard_request';
226
+ export * from './query_main_account_leaderboard_response';
217
227
  export * from './query_trading_performance_trend_request';
218
228
  export * from './query_trading_performance_trend_response';
229
+ export * from './query_vault_investor_history_request';
219
230
  export * from './query_vault_summary_history_request';
220
231
  export * from './query_vault_summary_history_response';
221
232
  export * from './reward_epoch_info';
@@ -110,12 +110,16 @@ __exportStar(require("./api_query_list_funding_account_summary_request"), export
110
110
  __exportStar(require("./api_query_list_funding_account_summary_response"), exports);
111
111
  __exportStar(require("./api_query_list_sub_account_summary_request"), exports);
112
112
  __exportStar(require("./api_query_list_sub_account_summary_response"), exports);
113
+ __exportStar(require("./api_query_list_vault_sub_account_summary_request"), exports);
114
+ __exportStar(require("./api_query_list_vault_sub_account_summary_response"), exports);
113
115
  __exportStar(require("./api_query_snap_vault_position_request"), exports);
114
116
  __exportStar(require("./api_query_snap_vault_position_response"), exports);
115
117
  __exportStar(require("./api_query_trading_performance_request"), exports);
116
118
  __exportStar(require("./api_query_trading_performance_response"), exports);
117
119
  __exportStar(require("./api_query_trading_performance_trend_request"), exports);
118
120
  __exportStar(require("./api_query_trading_performance_trend_response"), exports);
121
+ __exportStar(require("./api_query_vault_investor_history_request"), exports);
122
+ __exportStar(require("./api_query_vault_investor_history_response"), exports);
119
123
  __exportStar(require("./api_query_vault_performance_request"), exports);
120
124
  __exportStar(require("./api_query_vault_performance_response"), exports);
121
125
  __exportStar(require("./api_query_vault_performance_trend_request"), exports);
@@ -158,6 +162,8 @@ __exportStar(require("./api_transfer_request"), exports);
158
162
  __exportStar(require("./api_transfer_response"), exports);
159
163
  __exportStar(require("./api_user_category_affinity_score_request"), exports);
160
164
  __exportStar(require("./api_user_category_affinity_score_response"), exports);
165
+ __exportStar(require("./api_validate_vault_account_request"), exports);
166
+ __exportStar(require("./api_validate_vault_account_response"), exports);
161
167
  __exportStar(require("./api_vault_burn_tokens_request"), exports);
162
168
  __exportStar(require("./api_vault_detail_request"), exports);
163
169
  __exportStar(require("./api_vault_detail_response"), exports);
@@ -167,6 +173,7 @@ __exportStar(require("./api_vault_investor_summary_response"), exports);
167
173
  __exportStar(require("./api_vault_performance_trend"), exports);
168
174
  __exportStar(require("./api_vault_redeem_cancel_request"), exports);
169
175
  __exportStar(require("./api_vault_redeem_request"), exports);
176
+ __exportStar(require("./api_vault_sub_account_summary"), exports);
170
177
  __exportStar(require("./api_vault_summary"), exports);
171
178
  __exportStar(require("./api_vault_view_redemption_queue_request"), exports);
172
179
  __exportStar(require("./api_vault_view_redemption_queue_response"), exports);
@@ -206,6 +213,7 @@ __exportStar(require("./lp_point"), exports);
206
213
  __exportStar(require("./lp_snapshot"), exports);
207
214
  __exportStar(require("./lp_info_entry"), exports);
208
215
  __exportStar(require("./main_acc_id_request"), exports);
216
+ __exportStar(require("./main_account_leaderboard_entry"), exports);
209
217
  __exportStar(require("./margin_tier_response"), exports);
210
218
  __exportStar(require("./mini_ticker"), exports);
211
219
  __exportStar(require("./order"), exports);
@@ -230,8 +238,11 @@ __exportStar(require("./query_get_list_epoch_request"), exports);
230
238
  __exportStar(require("./query_get_list_epoch_response"), exports);
231
239
  __exportStar(require("./query_latest_sub_account_summary_request"), exports);
232
240
  __exportStar(require("./query_latest_sub_account_summary_response"), exports);
241
+ __exportStar(require("./query_main_account_leaderboard_request"), exports);
242
+ __exportStar(require("./query_main_account_leaderboard_response"), exports);
233
243
  __exportStar(require("./query_trading_performance_trend_request"), exports);
234
244
  __exportStar(require("./query_trading_performance_trend_response"), exports);
245
+ __exportStar(require("./query_vault_investor_history_request"), exports);
235
246
  __exportStar(require("./query_vault_summary_history_request"), exports);
236
247
  __exportStar(require("./query_vault_summary_history_response"), exports);
237
248
  __exportStar(require("./reward_epoch_info"), exports);
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const MAIN_ACCOUNT_LEADERBOARD_ENTRY_MAP: SchemaPairMap;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAIN_ACCOUNT_LEADERBOARD_ENTRY_MAP = void 0;
4
+ // Schema map for the 'MAIN_ACCOUNT_LEADERBOARD_ENTRY' struct.
5
+ exports.MAIN_ACCOUNT_LEADERBOARD_ENTRY_MAP = Object.freeze({
6
+ FULL_TO_LITE: {
7
+ main_account_id: 'ma',
8
+ total_fee: 'tf',
9
+ total_trade_volume: 'tt',
10
+ num_traded: 'nt',
11
+ positive_fee: 'pf',
12
+ realized_pnl: 'rp'
13
+ },
14
+ LITE_TO_FULL: {
15
+ ma: 'main_account_id',
16
+ tf: 'total_fee',
17
+ tt: 'total_trade_volume',
18
+ nt: 'num_traded',
19
+ pf: 'positive_fee',
20
+ rp: 'realized_pnl'
21
+ }
22
+ });
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const QUERY_MAIN_ACCOUNT_LEADERBOARD_REQUEST_MAP: SchemaPairMap;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QUERY_MAIN_ACCOUNT_LEADERBOARD_REQUEST_MAP = void 0;
4
+ // Schema map for the 'QUERY_MAIN_ACCOUNT_LEADERBOARD_REQUEST' struct.
5
+ exports.QUERY_MAIN_ACCOUNT_LEADERBOARD_REQUEST_MAP = Object.freeze({
6
+ FULL_TO_LITE: {
7
+ limit: 'l',
8
+ start_time: 'st',
9
+ end_time: 'et',
10
+ order_by: 'ob',
11
+ cursor: 'c'
12
+ },
13
+ LITE_TO_FULL: {
14
+ l: 'limit',
15
+ st: 'start_time',
16
+ et: 'end_time',
17
+ ob: 'order_by',
18
+ c: 'cursor'
19
+ }
20
+ });
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const QUERY_MAIN_ACCOUNT_LEADERBOARD_RESPONSE_MAP: SchemaPairMap;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QUERY_MAIN_ACCOUNT_LEADERBOARD_RESPONSE_MAP = void 0;
4
+ const main_account_leaderboard_entry_1 = require("./main_account_leaderboard_entry");
5
+ // Schema map for the 'QUERY_MAIN_ACCOUNT_LEADERBOARD_RESPONSE' struct.
6
+ exports.QUERY_MAIN_ACCOUNT_LEADERBOARD_RESPONSE_MAP = Object.freeze({
7
+ FULL_TO_LITE: {
8
+ result: ['r', [main_account_leaderboard_entry_1.MAIN_ACCOUNT_LEADERBOARD_ENTRY_MAP.FULL_TO_LITE]],
9
+ cursor: 'c'
10
+ },
11
+ LITE_TO_FULL: {
12
+ r: ['result', [main_account_leaderboard_entry_1.MAIN_ACCOUNT_LEADERBOARD_ENTRY_MAP.LITE_TO_FULL]],
13
+ c: 'cursor'
14
+ }
15
+ });
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const QUERY_VAULT_INVESTOR_HISTORY_REQUEST_MAP: SchemaPairMap;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QUERY_VAULT_INVESTOR_HISTORY_REQUEST_MAP = void 0;
4
+ // Schema map for the 'QUERY_VAULT_INVESTOR_HISTORY_REQUEST' struct.
5
+ exports.QUERY_VAULT_INVESTOR_HISTORY_REQUEST_MAP = Object.freeze({
6
+ FULL_TO_LITE: {
7
+ main_account_id: 'ma',
8
+ vault_id: 'vi'
9
+ },
10
+ LITE_TO_FULL: {
11
+ ma: 'main_account_id',
12
+ vi: 'vault_id'
13
+ }
14
+ });
@@ -10,7 +10,8 @@ exports.VAULT_REDEEM_RESULTS_MAP = Object.freeze({
10
10
  currency: 'c',
11
11
  num_tokens: 'nt',
12
12
  avg_entry_price: 'ae',
13
- fees_charged: 'fc'
13
+ fees_charged: 'fc',
14
+ realized_pnl: 'rp'
14
15
  },
15
16
  LITE_TO_FULL: {
16
17
  ti: 'token_index_price',
@@ -19,6 +20,7 @@ exports.VAULT_REDEEM_RESULTS_MAP = Object.freeze({
19
20
  c: 'currency',
20
21
  nt: 'num_tokens',
21
22
  ae: 'avg_entry_price',
22
- fc: 'fees_charged'
23
+ fc: 'fees_charged',
24
+ rp: 'realized_pnl'
23
25
  }
24
26
  });
package/package.json CHANGED
@@ -1,50 +1,50 @@
1
- {
2
- "name": "@grvt/client",
3
- "version": "1.4.16",
4
- "description": "Node.js & JavaScript client for GRVT REST APIs & WebSockets",
5
- "repository": {
6
- "type": "git",
7
- "url": "git+https://github.com/gravity-technologies/grvt-js-client.git"
8
- },
9
- "keywords": [
10
- "GRVT"
11
- ],
12
- "bugs": {
13
- "url": "https://github.com/gravity-technologies/grvt-js-client/issues"
14
- },
15
- "homepage": "https://github.com/gravity-technologies/grvt-js-client#readme",
16
- "author": "danh@grvt.io",
17
- "license": "UNLICENSED",
18
- "engines": {
19
- "node": ">=20"
20
- },
21
- "main": "index.js",
22
- "types": "index.d.ts",
23
- "scripts": {
24
- "start": "tsc --watch",
25
- "prebuild": "rimraf dist",
26
- "build": "tsc",
27
- "postbuild": "cp package.json dist/ && cp README.md dist/ && cp LICENSE dist/",
28
- "prerelease": "npm run build",
29
- "release": "cd dist/ && npm publish --access public",
30
- "link-local": "cp package.json dist/ && cd dist/ && npm link && cd ..",
31
- "lint": "npx eslint \"src/**/*.{js,ts}\"",
32
- "lint-fix": "npx eslint \"src/**/*.{js,ts}\" --fix",
33
- "test": "nodemon dist/index.js"
34
- },
35
- "dependencies": {
36
- "axios": "^1.8.2"
37
- },
38
- "devDependencies": {
39
- "@typescript-eslint/eslint-plugin": "^6.10.0",
40
- "eslint": "^8.56.0",
41
- "eslint-config-standard-with-typescript": "^39.1.1",
42
- "eslint-plugin-import": "^2.29.0",
43
- "eslint-plugin-import-newlines": "^1.3.4",
44
- "eslint-plugin-n": "^16.3.0",
45
- "eslint-plugin-promise": "^6.1.1",
46
- "nodemon": "^3.0.2",
47
- "rimraf": "^5.0.5",
48
- "typescript": "^5.2.2"
49
- }
50
- }
1
+ {
2
+ "name": "@grvt/client",
3
+ "version": "1.4.18",
4
+ "description": "Node.js & JavaScript client for GRVT REST APIs & WebSockets",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/gravity-technologies/grvt-js-client.git"
8
+ },
9
+ "keywords": [
10
+ "GRVT"
11
+ ],
12
+ "bugs": {
13
+ "url": "https://github.com/gravity-technologies/grvt-js-client/issues"
14
+ },
15
+ "homepage": "https://github.com/gravity-technologies/grvt-js-client#readme",
16
+ "author": "danh@grvt.io",
17
+ "license": "UNLICENSED",
18
+ "engines": {
19
+ "node": ">=20"
20
+ },
21
+ "main": "index.js",
22
+ "types": "index.d.ts",
23
+ "scripts": {
24
+ "start": "tsc --watch",
25
+ "prebuild": "rimraf dist",
26
+ "build": "tsc",
27
+ "postbuild": "cp package.json dist/ && cp README.md dist/ && cp LICENSE dist/",
28
+ "prerelease": "npm run build",
29
+ "release": "cd dist/ && npm publish --access public",
30
+ "link-local": "cp package.json dist/ && cd dist/ && npm link && cd ..",
31
+ "lint": "npx eslint \"src/**/*.{js,ts}\"",
32
+ "lint-fix": "npx eslint \"src/**/*.{js,ts}\" --fix",
33
+ "test": "nodemon dist/index.js"
34
+ },
35
+ "dependencies": {
36
+ "axios": "^1.8.2"
37
+ },
38
+ "devDependencies": {
39
+ "@typescript-eslint/eslint-plugin": "^6.10.0",
40
+ "eslint": "^8.56.0",
41
+ "eslint-config-standard-with-typescript": "^39.1.1",
42
+ "eslint-plugin-import": "^2.29.0",
43
+ "eslint-plugin-import-newlines": "^1.3.4",
44
+ "eslint-plugin-n": "^16.3.0",
45
+ "eslint-plugin-promise": "^6.1.1",
46
+ "nodemon": "^3.0.2",
47
+ "rimraf": "^5.0.5",
48
+ "typescript": "^5.2.2"
49
+ }
50
+ }
package/ws/ws.js CHANGED
@@ -217,11 +217,11 @@ class WS {
217
217
  const depositDestinationAccountId = omitZeroStr(result.to_account_id);
218
218
  const transferSourceKey = [
219
219
  omitZeroStr(result.from_account_id),
220
- omitZeroStr(result.from_sub_account_id) ? result.from_sub_account_id : 0
220
+ omitZeroStr(result.from_sub_account_id)
221
221
  ].filter(Boolean).join('-');
222
222
  const transferDestinationKey = [
223
223
  omitZeroStr(result.to_account_id),
224
- omitZeroStr(result.to_sub_account_id) ? result.to_sub_account_id : 0
224
+ omitZeroStr(result.to_sub_account_id)
225
225
  ].filter(Boolean).join('-');
226
226
  const withdrawalFromAccountId = omitZeroStr(result.from_account_id);
227
227
  switch (stream) {
@@ -408,10 +408,7 @@ class WS {
408
408
  return params.main_account_id;
409
409
  };
410
410
  const transferFeed = (params) => {
411
- if (params.sub_account_id) {
412
- return [params.main_account_id, params.sub_account_id].join('-');
413
- }
414
- return params.main_account_id;
411
+ return [params.main_account_id, params.sub_account_id].filter(Boolean).join('-');
415
412
  };
416
413
  const withdrawalFeed = (params) => {
417
414
  return params.main_account_id;