@grvt/client 1.4.5 → 1.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/TDG/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { type AxiosRequestConfig } from 'axios';
2
- import { 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 IApiQueryTradingPerformanceRequest, type IApiQueryTradingPerformanceResponse, type IApiQueryTradingPerformanceTrendRequest, type IApiQueryTradingPerformanceTrendResponse, type IApiSetInitialLeverageRequest, type IApiSetInitialLeverageResponse, type IApiSocializedLossStatusResponse, type IApiSubAccountHistoryRequest, type IApiSubAccountHistoryResponse, type IApiSubAccountSummaryRequest, type IApiSubAccountSummaryResponse, type IApiTimedAssetExposureRequest, type IApiTimedAssetExposureResponse, type IApiTransferHistoryRequest, type IApiTransferHistoryResponse, type IApiTransferRequest, type IApiTransferResponse, type IApiWithdrawalHistoryRequest, type IApiWithdrawalHistoryResponse, type IApiWithdrawalRequest, type IConfig } from '../interfaces';
2
+ import { 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 IApiQueryTradingPerformanceRequest, type IApiQueryTradingPerformanceResponse, type IApiQueryTradingPerformanceTrendRequest, type IApiQueryTradingPerformanceTrendResponse, type IApiReplaceOrdersRequest, type IApiReplaceOrdersResponse, type IApiSetInitialLeverageRequest, type IApiSetInitialLeverageResponse, type IApiSocializedLossStatusResponse, type IApiSubAccountHistoryRequest, type IApiSubAccountHistoryResponse, type IApiSubAccountSummaryRequest, type IApiSubAccountSummaryResponse, type IApiTimedAssetExposureRequest, type IApiTimedAssetExposureResponse, type IApiTransferHistoryRequest, type IApiTransferHistoryResponse, type IApiTransferRequest, type IApiTransferResponse, 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;
@@ -16,7 +16,6 @@ export declare class TDG {
16
16
  */
17
17
  depositHistory(payload: IApiDepositHistoryRequest, config?: AxiosRequestConfig): Promise<IApiDepositHistoryResponse>;
18
18
  /**
19
- * TODO: missing response interface
20
19
  * @see https://api-docs.grvt.io/trading_api/#transfer
21
20
  */
22
21
  transfer(payload: IApiTransferRequest, config?: AxiosRequestConfig): Promise<IApiTransferResponse>;
@@ -25,7 +24,6 @@ export declare class TDG {
25
24
  */
26
25
  transferHistory(payload: IApiTransferHistoryRequest, config?: AxiosRequestConfig): Promise<IApiTransferHistoryResponse>;
27
26
  /**
28
- * TODO: missing response interface
29
27
  * @see https://api-docs.grvt.io/trading_api/#withdrawal
30
28
  */
31
29
  withdrawal(payload: IApiWithdrawalRequest, config?: AxiosRequestConfig): Promise<{
@@ -70,11 +68,6 @@ export declare class TDG {
70
68
  * @see https://api-docs.grvt.io/trading_api/#cancel-all-orders
71
69
  */
72
70
  cancelAllOrders(payload: IApiCancelAllOrdersRequest, config?: AxiosRequestConfig): Promise<IApiCancelAllOrdersResponse>;
73
- /**
74
- * TODO: missing interfaces
75
- * @see https://api-docs.grvt.io/trading_api/#cancel-all-session-orders
76
- */
77
- cancelAllSessionOrders(): void;
78
71
  /**
79
72
  * @see https://api-docs.grvt.io/trading_api/#get-order
80
73
  */
@@ -84,6 +77,10 @@ export declare class TDG {
84
77
  */
85
78
  openOrders(payload: IApiOpenOrdersRequest, config?: AxiosRequestConfig): Promise<IApiOpenOrdersResponse>;
86
79
  orderGroup(payload: IApiGetOrderGroupRequest, config?: AxiosRequestConfig): Promise<IApiGetOrderGroupResponse>;
80
+ /**
81
+ * Replace position's TP/SL orders
82
+ */
83
+ replaceOrders(payload: IApiReplaceOrdersRequest, config?: AxiosRequestConfig): Promise<IApiReplaceOrdersResponse>;
87
84
  /**
88
85
  * @see https://api-docs.grvt.io/trading_api/#order-history
89
86
  */
package/TDG/index.js CHANGED
@@ -32,7 +32,6 @@ class TDG {
32
32
  }).catch(utils_1.Utils.coverApiError);
33
33
  }
34
34
  /**
35
- * TODO: missing response interface
36
35
  * @see https://api-docs.grvt.io/trading_api/#transfer
37
36
  */
38
37
  transfer(payload, config) {
@@ -49,7 +48,6 @@ class TDG {
49
48
  }).catch(utils_1.Utils.coverApiError);
50
49
  }
51
50
  /**
52
- * TODO: missing response interface
53
51
  * @see https://api-docs.grvt.io/trading_api/#withdrawal
54
52
  */
55
53
  withdrawal(payload, config) {
@@ -148,13 +146,6 @@ class TDG {
148
146
  return utils_1.Utils.schemaMap(response.data, interfaces_1.API_CANCEL_ALL_ORDERS_RESPONSE_MAP.LITE_TO_FULL);
149
147
  }).catch(utils_1.Utils.coverApiError);
150
148
  }
151
- /**
152
- * TODO: missing interfaces
153
- * @see https://api-docs.grvt.io/trading_api/#cancel-all-session-orders
154
- */
155
- cancelAllSessionOrders() {
156
- throw new Error('This has been marked as a POST-LAUNCH feature, see https://api-docs.grvt.io/trading_api/#cancel-all-session-orders');
157
- }
158
149
  /**
159
150
  * @see https://api-docs.grvt.io/trading_api/#get-order
160
151
  */
@@ -176,6 +167,14 @@ class TDG {
176
167
  return utils_1.Utils.schemaMap(response.data, interfaces_1.API_GET_ORDER_GROUP_RESPONSE_MAP.LITE_TO_FULL);
177
168
  }).catch(utils_1.Utils.coverApiError);
178
169
  }
170
+ /**
171
+ * Replace position's TP/SL orders
172
+ */
173
+ replaceOrders(payload, config) {
174
+ return this._axios.post(this._liteUrl + '/replace_orders', utils_1.Utils.schemaMap(payload, interfaces_1.API_REPLACE_ORDERS_REQUEST_MAP.FULL_TO_LITE, true), config).then((response) => {
175
+ return utils_1.Utils.schemaMap(response.data, interfaces_1.API_REPLACE_ORDERS_RESPONSE_MAP.LITE_TO_FULL);
176
+ }).catch(utils_1.Utils.coverApiError);
177
+ }
179
178
  /**
180
179
  * @see https://api-docs.grvt.io/trading_api/#order-history
181
180
  */
@@ -142,7 +142,9 @@ export declare enum EOrderRejectReason {
142
142
  EXCEED_MAX_SIGNATURE_EXPIRATION = "EXCEED_MAX_SIGNATURE_EXPIRATION",
143
143
  MARKET_ORDER_WITH_LIMIT_PRICE = "MARKET_ORDER_WITH_LIMIT_PRICE",
144
144
  CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED = "CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED",
145
- OCO_COUNTER_PART_TRIGGERED = "OCO_COUNTER_PART_TRIGGERED"
145
+ OCO_COUNTER_PART_TRIGGERED = "OCO_COUNTER_PART_TRIGGERED",
146
+ REDUCE_ONLY_LIMIT = "REDUCE_ONLY_LIMIT",
147
+ CLIENT_REPLACE = "CLIENT_REPLACE"
146
148
  }
147
149
  export declare enum EOrderStatus {
148
150
  PENDING = "PENDING",
@@ -161,6 +163,12 @@ export declare enum ERewardProgramType {
161
163
  TRADER = "TRADER",
162
164
  LP = "LP"
163
165
  }
166
+ export declare enum ESource {
167
+ WEB = "WEB",
168
+ MOBILE = "MOBILE",
169
+ API = "API",
170
+ LIQUIDATOR = "LIQUIDATOR"
171
+ }
164
172
  export declare enum ESubAccountTradeInterval {
165
173
  SAT_1_MO = "SAT_1_MO",
166
174
  SAT_1_D = "SAT_1_D",
@@ -171,7 +179,8 @@ export declare enum ETimeInForce {
171
179
  GOOD_TILL_TIME = "GOOD_TILL_TIME",
172
180
  ALL_OR_NONE = "ALL_OR_NONE",
173
181
  IMMEDIATE_OR_CANCEL = "IMMEDIATE_OR_CANCEL",
174
- FILL_OR_KILL = "FILL_OR_KILL"
182
+ FILL_OR_KILL = "FILL_OR_KILL",
183
+ RETAIL_PRICE_IMPROVEMENT = "RETAIL_PRICE_IMPROVEMENT"
175
184
  }
176
185
  export declare enum ETimeInterval {
177
186
  INTERVAL_1_D = "INTERVAL_1_D",
@@ -623,6 +632,15 @@ export interface IApiQueryTradingPerformanceTrendResponse {
623
632
  result?: IApiTradingPerformanceTrend[];
624
633
  next?: string;
625
634
  }
635
+ export interface IApiReplaceOrdersRequest {
636
+ sub_account_id?: string;
637
+ client_order_i_ds?: string[];
638
+ order_i_ds?: string[];
639
+ new_orders?: IOrder[];
640
+ }
641
+ export interface IApiReplaceOrdersResponse {
642
+ result?: IOrder[];
643
+ }
626
644
  export interface IApiResolveEpochEcosystemMetricResponse {
627
645
  epoch_name?: string;
628
646
  point?: number;
@@ -943,6 +961,8 @@ export interface IFill {
943
961
  trade_index?: number;
944
962
  signer?: string;
945
963
  broker?: EBrokerTag;
964
+ is_rpi?: boolean;
965
+ source?: ESource;
946
966
  }
947
967
  export interface IFlatReferral {
948
968
  account_id?: string;
@@ -1078,6 +1098,7 @@ export interface IOrderMetadata {
1078
1098
  create_time?: string;
1079
1099
  trigger?: ITriggerOrderMetadata;
1080
1100
  broker?: EBrokerTag;
1101
+ source?: ESource;
1081
1102
  }
1082
1103
  export interface IOrderState {
1083
1104
  status?: EOrderStatus;
@@ -1260,6 +1281,7 @@ export interface ISubAccountTradeAggregation {
1260
1281
  export interface ITPSLOrderMetadata {
1261
1282
  trigger_by?: ETriggerBy;
1262
1283
  trigger_price?: string;
1284
+ close_position?: boolean;
1263
1285
  }
1264
1286
  export interface ITicker {
1265
1287
  event_time?: string;
@@ -1305,6 +1327,7 @@ export interface ITrade {
1305
1327
  venue?: EVenue;
1306
1328
  is_liquidation?: boolean;
1307
1329
  trade_index?: number;
1330
+ is_rpi?: boolean;
1308
1331
  }
1309
1332
  export interface ITraderLeaderboardUser {
1310
1333
  account_id?: 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.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.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
@@ -283,6 +283,10 @@ var EOrderRejectReason;
283
283
  EOrderRejectReason["CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED"] = "CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED";
284
284
  // the OCO counter part order was triggered
285
285
  EOrderRejectReason["OCO_COUNTER_PART_TRIGGERED"] = "OCO_COUNTER_PART_TRIGGERED";
286
+ // the remaining order size was cancelled because it exceeded current position size
287
+ EOrderRejectReason["REDUCE_ONLY_LIMIT"] = "REDUCE_ONLY_LIMIT";
288
+ // the order was replaced by a client replace request
289
+ EOrderRejectReason["CLIENT_REPLACE"] = "CLIENT_REPLACE";
286
290
  })(EOrderRejectReason || (exports.EOrderRejectReason = EOrderRejectReason = {}));
287
291
  var EOrderStatus;
288
292
  (function (EOrderStatus) {
@@ -312,6 +316,19 @@ var ERewardProgramType;
312
316
  ERewardProgramType["TRADER"] = "TRADER";
313
317
  ERewardProgramType["LP"] = "LP";
314
318
  })(ERewardProgramType || (exports.ERewardProgramType = ERewardProgramType = {}));
319
+ // Defines the source of the order or trade, such as a UI, API, or a bot.
320
+ // This is used to track the source of the order, and is not signed by the client
321
+ var ESource;
322
+ (function (ESource) {
323
+ // The order/trade was created by a web client
324
+ ESource["WEB"] = "WEB";
325
+ // The order/trade was created by a mobile client
326
+ ESource["MOBILE"] = "MOBILE";
327
+ // The order/trade was created by an API client
328
+ ESource["API"] = "API";
329
+ // The order/trade was created by the liquidator service
330
+ ESource["LIQUIDATOR"] = "LIQUIDATOR";
331
+ })(ESource || (exports.ESource = ESource = {}));
315
332
  var ESubAccountTradeInterval;
316
333
  (function (ESubAccountTradeInterval) {
317
334
  // 1 month
@@ -338,6 +355,8 @@ var ETimeInForce;
338
355
  ETimeInForce["IMMEDIATE_OR_CANCEL"] = "IMMEDIATE_OR_CANCEL";
339
356
  // FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it
340
357
  ETimeInForce["FILL_OR_KILL"] = "FILL_OR_KILL";
358
+ // RPI - A GTT + PostOnly maker order, that can only be taken by non-algorithmic UI users.
359
+ ETimeInForce["RETAIL_PRICE_IMPROVEMENT"] = "RETAIL_PRICE_IMPROVEMENT";
341
360
  })(ETimeInForce || (exports.ETimeInForce = ETimeInForce = {}));
342
361
  // Time interval can be used as a filter in metric/portfolio management APIs
343
362
  var ETimeInterval;
@@ -1,4 +1,4 @@
1
- import { EBridgeType, EBrokerTag, ECancelStatus, ECandlestickInterval, ECandlestickType, ECurrency, EEpochBadgeType, EInstrumentSettlementPeriod, EKind, EMarginType, EOrderRejectReason, EOrderStatus, ERewardEpochStatus, ERewardProgramType, 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, 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>;
@@ -13,6 +13,7 @@ export declare const EOrderRejectReasonInt: Record<EOrderRejectReason, number>;
13
13
  export declare const EOrderStatusInt: Record<EOrderStatus, number>;
14
14
  export declare const ERewardEpochStatusInt: Record<ERewardEpochStatus, number>;
15
15
  export declare const ERewardProgramTypeInt: Record<ERewardProgramType, number>;
16
+ export declare const ESourceInt: Record<ESource, number>;
16
17
  export declare const ESubAccountTradeIntervalInt: Record<ESubAccountTradeInterval, number>;
17
18
  export declare const ETimeInForceInt: Record<ETimeInForce, number>;
18
19
  export declare const ETimeIntervalInt: Record<ETimeInterval, 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.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.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,
@@ -146,7 +146,9 @@ exports.EOrderRejectReasonInt = Object.freeze({
146
146
  [data_interface_1.EOrderRejectReason.EXCEED_MAX_SIGNATURE_EXPIRATION]: 27,
147
147
  [data_interface_1.EOrderRejectReason.MARKET_ORDER_WITH_LIMIT_PRICE]: 28,
148
148
  [data_interface_1.EOrderRejectReason.CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED]: 29,
149
- [data_interface_1.EOrderRejectReason.OCO_COUNTER_PART_TRIGGERED]: 30
149
+ [data_interface_1.EOrderRejectReason.OCO_COUNTER_PART_TRIGGERED]: 30,
150
+ [data_interface_1.EOrderRejectReason.REDUCE_ONLY_LIMIT]: 31,
151
+ [data_interface_1.EOrderRejectReason.CLIENT_REPLACE]: 32
150
152
  });
151
153
  exports.EOrderStatusInt = Object.freeze({
152
154
  [data_interface_1.EOrderStatus.PENDING]: 1,
@@ -165,6 +167,12 @@ exports.ERewardProgramTypeInt = Object.freeze({
165
167
  [data_interface_1.ERewardProgramType.TRADER]: 2,
166
168
  [data_interface_1.ERewardProgramType.LP]: 3
167
169
  });
170
+ exports.ESourceInt = Object.freeze({
171
+ [data_interface_1.ESource.WEB]: 1,
172
+ [data_interface_1.ESource.MOBILE]: 2,
173
+ [data_interface_1.ESource.API]: 3,
174
+ [data_interface_1.ESource.LIQUIDATOR]: 4
175
+ });
168
176
  exports.ESubAccountTradeIntervalInt = Object.freeze({
169
177
  [data_interface_1.ESubAccountTradeInterval.SAT_1_MO]: 1,
170
178
  [data_interface_1.ESubAccountTradeInterval.SAT_1_D]: 2,
@@ -175,7 +183,8 @@ exports.ETimeInForceInt = Object.freeze({
175
183
  [data_interface_1.ETimeInForce.GOOD_TILL_TIME]: 1,
176
184
  [data_interface_1.ETimeInForce.ALL_OR_NONE]: 2,
177
185
  [data_interface_1.ETimeInForce.IMMEDIATE_OR_CANCEL]: 3,
178
- [data_interface_1.ETimeInForce.FILL_OR_KILL]: 4
186
+ [data_interface_1.ETimeInForce.FILL_OR_KILL]: 4,
187
+ [data_interface_1.ETimeInForce.RETAIL_PRICE_IMPROVEMENT]: 5
179
188
  });
180
189
  exports.ETimeIntervalInt = Object.freeze({
181
190
  [data_interface_1.ETimeInterval.INTERVAL_1_D]: 1,
@@ -15,6 +15,7 @@ exports.HexStringMap = [
15
15
  'liquidity_score',
16
16
  'main_account_id',
17
17
  'maker_trading_volume',
18
+ 'order_i_ds',
18
19
  'order_id',
19
20
  'r',
20
21
  'referrer_main_account_id',
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.API_ORDERBOOK_LEVELS_RESPONSE_MAP = void 0;
4
- const snap_orderbook_levels_1 = require("./snap_orderbook_levels");
4
+ const api_orderbook_levels_1 = require("./api_orderbook_levels");
5
5
  // Schema map for the 'API_ORDERBOOK_LEVELS_RESPONSE' struct.
6
6
  exports.API_ORDERBOOK_LEVELS_RESPONSE_MAP = Object.freeze({
7
7
  FULL_TO_LITE: {
8
- result: ['r', snap_orderbook_levels_1.ORDERBOOK_LEVELS_MAP.FULL_TO_LITE]
8
+ result: ['r', api_orderbook_levels_1.ORDERBOOK_LEVELS_MAP.FULL_TO_LITE]
9
9
  },
10
10
  LITE_TO_FULL: {
11
- r: ['result', snap_orderbook_levels_1.ORDERBOOK_LEVELS_MAP.LITE_TO_FULL]
11
+ r: ['result', api_orderbook_levels_1.ORDERBOOK_LEVELS_MAP.LITE_TO_FULL]
12
12
  }
13
13
  });
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const API_REPLACE_ORDERS_REQUEST_MAP: SchemaPairMap;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.API_REPLACE_ORDERS_REQUEST_MAP = void 0;
4
+ const order_1 = require("./order");
5
+ // Schema map for the 'API_REPLACE_ORDERS_REQUEST' struct.
6
+ exports.API_REPLACE_ORDERS_REQUEST_MAP = Object.freeze({
7
+ FULL_TO_LITE: {
8
+ sub_account_id: 'sa',
9
+ client_order_i_ds: 'co',
10
+ order_i_ds: 'oi',
11
+ new_orders: ['no', [order_1.ORDER_MAP.FULL_TO_LITE]]
12
+ },
13
+ LITE_TO_FULL: {
14
+ sa: 'sub_account_id',
15
+ co: 'client_order_i_ds',
16
+ oi: 'order_i_ds',
17
+ no: ['new_orders', [order_1.ORDER_MAP.LITE_TO_FULL]]
18
+ }
19
+ });
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const API_REPLACE_ORDERS_RESPONSE_MAP: SchemaPairMap;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.API_REPLACE_ORDERS_RESPONSE_MAP = void 0;
4
+ const order_1 = require("./order");
5
+ // Schema map for the 'API_REPLACE_ORDERS_RESPONSE' struct.
6
+ exports.API_REPLACE_ORDERS_RESPONSE_MAP = Object.freeze({
7
+ FULL_TO_LITE: {
8
+ result: ['r', [order_1.ORDER_MAP.FULL_TO_LITE]]
9
+ },
10
+ LITE_TO_FULL: {
11
+ r: ['result', [order_1.ORDER_MAP.LITE_TO_FULL]]
12
+ }
13
+ });
@@ -25,7 +25,9 @@ exports.FILL_MAP = Object.freeze({
25
25
  client_order_id: 'co',
26
26
  trade_index: 'ti1',
27
27
  signer: 's1',
28
- broker: 'b'
28
+ broker: 'b',
29
+ is_rpi: 'ir1',
30
+ source: 's2'
29
31
  },
30
32
  LITE_TO_FULL: {
31
33
  et: 'event_time',
@@ -49,6 +51,8 @@ exports.FILL_MAP = Object.freeze({
49
51
  co: 'client_order_id',
50
52
  ti1: 'trade_index',
51
53
  s1: 'signer',
52
- b: 'broker'
54
+ b: 'broker',
55
+ ir1: 'is_rpi',
56
+ s2: 'source'
53
57
  }
54
58
  });
@@ -16,7 +16,8 @@ exports.TRADE_MAP = Object.freeze({
16
16
  trade_id: 'ti',
17
17
  venue: 'v',
18
18
  is_liquidation: 'il',
19
- trade_index: 'ti1'
19
+ trade_index: 'ti1',
20
+ is_rpi: 'ir1'
20
21
  },
21
22
  LITE_TO_FULL: {
22
23
  et: 'event_time',
@@ -31,6 +32,7 @@ exports.TRADE_MAP = Object.freeze({
31
32
  ti: 'trade_id',
32
33
  v: 'venue',
33
34
  il: 'is_liquidation',
34
- ti1: 'trade_index'
35
+ ti1: 'trade_index',
36
+ ir1: 'is_rpi'
35
37
  }
36
38
  });
@@ -98,6 +98,8 @@ export * from './api_query_trading_performance_request';
98
98
  export * from './api_query_trading_performance_response';
99
99
  export * from './api_query_trading_performance_trend_request';
100
100
  export * from './api_query_trading_performance_trend_response';
101
+ export * from './api_replace_orders_request';
102
+ export * from './api_replace_orders_response';
101
103
  export * from './api_resolve_epoch_ecosystem_metric_response';
102
104
  export * from './api_set_initial_leverage_request';
103
105
  export * from './api_set_initial_leverage_response';
@@ -170,7 +172,7 @@ export * from './order_metadata';
170
172
  export * from './order_state';
171
173
  export * from './order_state_feed';
172
174
  export * from './orderbook_level';
173
- export * from './snap_orderbook_levels';
175
+ export * from './api_orderbook_levels';
174
176
  export * from './position_summary';
175
177
  export * from './api_position';
176
178
  export * from './pre_order_check_result';
@@ -114,6 +114,8 @@ __exportStar(require("./api_query_trading_performance_request"), exports);
114
114
  __exportStar(require("./api_query_trading_performance_response"), exports);
115
115
  __exportStar(require("./api_query_trading_performance_trend_request"), exports);
116
116
  __exportStar(require("./api_query_trading_performance_trend_response"), exports);
117
+ __exportStar(require("./api_replace_orders_request"), exports);
118
+ __exportStar(require("./api_replace_orders_response"), exports);
117
119
  __exportStar(require("./api_resolve_epoch_ecosystem_metric_response"), exports);
118
120
  __exportStar(require("./api_set_initial_leverage_request"), exports);
119
121
  __exportStar(require("./api_set_initial_leverage_response"), exports);
@@ -186,7 +188,7 @@ __exportStar(require("./order_metadata"), exports);
186
188
  __exportStar(require("./order_state"), exports);
187
189
  __exportStar(require("./order_state_feed"), exports);
188
190
  __exportStar(require("./orderbook_level"), exports);
189
- __exportStar(require("./snap_orderbook_levels"), exports);
191
+ __exportStar(require("./api_orderbook_levels"), exports);
190
192
  __exportStar(require("./position_summary"), exports);
191
193
  __exportStar(require("./api_position"), exports);
192
194
  __exportStar(require("./pre_order_check_result"), exports);
@@ -8,12 +8,14 @@ exports.ORDER_METADATA_MAP = Object.freeze({
8
8
  client_order_id: 'co',
9
9
  create_time: 'ct',
10
10
  trigger: ['t', trigger_order_metadata_1.TRIGGER_ORDER_METADATA_MAP.FULL_TO_LITE],
11
- broker: 'b'
11
+ broker: 'b',
12
+ source: 's'
12
13
  },
13
14
  LITE_TO_FULL: {
14
15
  co: 'client_order_id',
15
16
  ct: 'create_time',
16
17
  t: ['trigger', trigger_order_metadata_1.TRIGGER_ORDER_METADATA_MAP.LITE_TO_FULL],
17
- b: 'broker'
18
+ b: 'broker',
19
+ s: 'source'
18
20
  }
19
21
  });
@@ -5,10 +5,12 @@ exports.TPSL_ORDER_METADATA_MAP = void 0;
5
5
  exports.TPSL_ORDER_METADATA_MAP = Object.freeze({
6
6
  FULL_TO_LITE: {
7
7
  trigger_by: 'tb',
8
- trigger_price: 'tp'
8
+ trigger_price: 'tp',
9
+ close_position: 'cp'
9
10
  },
10
11
  LITE_TO_FULL: {
11
12
  tb: 'trigger_by',
12
- tp: 'trigger_price'
13
+ tp: 'trigger_price',
14
+ cp: 'close_position'
13
15
  }
14
16
  });
@@ -1,21 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WS_ORDERBOOK_LEVELS_FEED_DATA_V_1_MAP = void 0;
4
- const snap_orderbook_levels_1 = require("./snap_orderbook_levels");
4
+ const api_orderbook_levels_1 = require("./api_orderbook_levels");
5
5
  // Schema map for the 'WS_ORDERBOOK_LEVELS_FEED_DATA_V_1' struct.
6
6
  exports.WS_ORDERBOOK_LEVELS_FEED_DATA_V_1_MAP = Object.freeze({
7
7
  FULL_TO_LITE: {
8
8
  stream: 's',
9
9
  selector: 's1',
10
10
  sequence_number: 'sn',
11
- feed: ['f', snap_orderbook_levels_1.ORDERBOOK_LEVELS_MAP.FULL_TO_LITE],
11
+ feed: ['f', api_orderbook_levels_1.ORDERBOOK_LEVELS_MAP.FULL_TO_LITE],
12
12
  prev_sequence_number: 'ps'
13
13
  },
14
14
  LITE_TO_FULL: {
15
15
  s: 'stream',
16
16
  s1: 'selector',
17
17
  sn: 'sequence_number',
18
- f: ['feed', snap_orderbook_levels_1.ORDERBOOK_LEVELS_MAP.LITE_TO_FULL],
18
+ f: ['feed', api_orderbook_levels_1.ORDERBOOK_LEVELS_MAP.LITE_TO_FULL],
19
19
  ps: 'prev_sequence_number'
20
20
  }
21
21
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grvt/client",
3
- "version": "1.4.5",
3
+ "version": "1.4.6",
4
4
  "description": "Node.js & JavaScript client for GRVT REST APIs & WebSockets",
5
5
  "repository": {
6
6
  "type": "git",