@grvt/client 1.4.5 → 1.4.7
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 +5 -8
- package/TDG/index.js +8 -9
- package/interfaces/codegen/data.interface.d.ts +45 -2
- package/interfaces/codegen/data.interface.js +20 -1
- package/interfaces/codegen/enum-int.d.ts +2 -1
- package/interfaces/codegen/enum-int.js +12 -3
- package/interfaces/codegen/hex-string-map.js +1 -0
- package/interfaces/codegen/schema-maps/api_orderbook_levels_response.js +3 -3
- package/interfaces/codegen/schema-maps/api_replace_orders_request.d.ts +2 -0
- package/interfaces/codegen/schema-maps/api_replace_orders_request.js +19 -0
- package/interfaces/codegen/schema-maps/api_replace_orders_response.d.ts +2 -0
- package/interfaces/codegen/schema-maps/api_replace_orders_response.js +13 -0
- package/interfaces/codegen/schema-maps/flat_private_trade.js +6 -2
- package/interfaces/codegen/schema-maps/flat_public_trade.js +4 -2
- package/interfaces/codegen/schema-maps/index.d.ts +6 -1
- package/interfaces/codegen/schema-maps/index.js +6 -1
- package/interfaces/codegen/schema-maps/order_metadata.js +4 -2
- package/interfaces/codegen/schema-maps/tpsl_order_metadata.js +4 -2
- package/interfaces/codegen/schema-maps/vault_invest_results.d.ts +2 -0
- package/interfaces/codegen/schema-maps/vault_invest_results.js +18 -0
- package/interfaces/codegen/schema-maps/vault_management_fee_tick_results.d.ts +2 -0
- package/interfaces/codegen/schema-maps/vault_management_fee_tick_results.js +16 -0
- package/interfaces/codegen/schema-maps/vault_redeem_results.d.ts +2 -0
- package/interfaces/codegen/schema-maps/vault_redeem_results.js +24 -0
- package/interfaces/codegen/schema-maps/ws_orderbook_levels_feed_data_v_1.js +3 -3
- package/package.json +1 -1
- package/ws/interfaces.d.ts +13 -1
- package/ws/interfaces.js +12 -0
- package/ws/ws.js +12 -7
- /package/interfaces/codegen/schema-maps/{snap_orderbook_levels.d.ts → api_orderbook_levels.d.ts} +0 -0
- /package/interfaces/codegen/schema-maps/{snap_orderbook_levels.js → api_orderbook_levels.js} +0 -0
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;
|
|
@@ -1367,6 +1390,17 @@ export interface IUserVaultCategoryEventPayLoad {
|
|
|
1367
1390
|
action?: string;
|
|
1368
1391
|
num_bumps?: string;
|
|
1369
1392
|
}
|
|
1393
|
+
export interface IVaultInvestResults {
|
|
1394
|
+
token_index_price?: string;
|
|
1395
|
+
vault_total_equity?: string;
|
|
1396
|
+
vault_share_price?: string;
|
|
1397
|
+
num_lp_tokens?: string;
|
|
1398
|
+
}
|
|
1399
|
+
export interface IVaultManagementFeeTickResults {
|
|
1400
|
+
vault_total_equity?: string;
|
|
1401
|
+
vault_share_price?: string;
|
|
1402
|
+
fees_charged?: string;
|
|
1403
|
+
}
|
|
1370
1404
|
export interface IVaultParams {
|
|
1371
1405
|
management_fee_centi_beeps?: string;
|
|
1372
1406
|
performance_fee_centi_beeps?: string;
|
|
@@ -1378,6 +1412,15 @@ export interface IVaultParams {
|
|
|
1378
1412
|
auto_redemption_barrier_centi_beeps?: string;
|
|
1379
1413
|
reward_sharing_ratio_centi_beeps?: string;
|
|
1380
1414
|
}
|
|
1415
|
+
export interface IVaultRedeemResults {
|
|
1416
|
+
token_index_price?: string;
|
|
1417
|
+
vault_total_equity?: string;
|
|
1418
|
+
vault_share_price?: string;
|
|
1419
|
+
currency?: ECurrency;
|
|
1420
|
+
num_tokens?: string;
|
|
1421
|
+
avg_entry_price?: string;
|
|
1422
|
+
fees_charged?: string;
|
|
1423
|
+
}
|
|
1381
1424
|
export interface IWSCancelFeedDataV1 {
|
|
1382
1425
|
stream?: string;
|
|
1383
1426
|
selector?: 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,
|
|
@@ -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
|
|
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',
|
|
8
|
+
result: ['r', api_orderbook_levels_1.ORDERBOOK_LEVELS_MAP.FULL_TO_LITE]
|
|
9
9
|
},
|
|
10
10
|
LITE_TO_FULL: {
|
|
11
|
-
r: ['result',
|
|
11
|
+
r: ['result', api_orderbook_levels_1.ORDERBOOK_LEVELS_MAP.LITE_TO_FULL]
|
|
12
12
|
}
|
|
13
13
|
});
|
|
@@ -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,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 './
|
|
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';
|
|
@@ -208,7 +210,10 @@ export * from './trigger_order_metadata';
|
|
|
208
210
|
export * from './user_category_affinity_score';
|
|
209
211
|
export * from './user_tracking_event';
|
|
210
212
|
export * from './user_vault_category_event_pay_load';
|
|
213
|
+
export * from './vault_invest_results';
|
|
214
|
+
export * from './vault_management_fee_tick_results';
|
|
211
215
|
export * from './vault_params';
|
|
216
|
+
export * from './vault_redeem_results';
|
|
212
217
|
export * from './ws_cancel_feed_data_v_1';
|
|
213
218
|
export * from './ws_cancel_feed_selector_v_1';
|
|
214
219
|
export * from './ws_candlestick_feed_data_v_1';
|
|
@@ -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("./
|
|
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);
|
|
@@ -224,7 +226,10 @@ __exportStar(require("./trigger_order_metadata"), exports);
|
|
|
224
226
|
__exportStar(require("./user_category_affinity_score"), exports);
|
|
225
227
|
__exportStar(require("./user_tracking_event"), exports);
|
|
226
228
|
__exportStar(require("./user_vault_category_event_pay_load"), exports);
|
|
229
|
+
__exportStar(require("./vault_invest_results"), exports);
|
|
230
|
+
__exportStar(require("./vault_management_fee_tick_results"), exports);
|
|
227
231
|
__exportStar(require("./vault_params"), exports);
|
|
232
|
+
__exportStar(require("./vault_redeem_results"), exports);
|
|
228
233
|
__exportStar(require("./ws_cancel_feed_data_v_1"), exports);
|
|
229
234
|
__exportStar(require("./ws_cancel_feed_selector_v_1"), exports);
|
|
230
235
|
__exportStar(require("./ws_candlestick_feed_data_v_1"), 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
|
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VAULT_INVEST_RESULTS_MAP = void 0;
|
|
4
|
+
// Schema map for the 'VAULT_INVEST_RESULTS' struct.
|
|
5
|
+
exports.VAULT_INVEST_RESULTS_MAP = Object.freeze({
|
|
6
|
+
FULL_TO_LITE: {
|
|
7
|
+
token_index_price: 'ti',
|
|
8
|
+
vault_total_equity: 'vt',
|
|
9
|
+
vault_share_price: 'vs',
|
|
10
|
+
num_lp_tokens: 'nl'
|
|
11
|
+
},
|
|
12
|
+
LITE_TO_FULL: {
|
|
13
|
+
ti: 'token_index_price',
|
|
14
|
+
vt: 'vault_total_equity',
|
|
15
|
+
vs: 'vault_share_price',
|
|
16
|
+
nl: 'num_lp_tokens'
|
|
17
|
+
}
|
|
18
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VAULT_MANAGEMENT_FEE_TICK_RESULTS_MAP = void 0;
|
|
4
|
+
// Schema map for the 'VAULT_MANAGEMENT_FEE_TICK_RESULTS' struct.
|
|
5
|
+
exports.VAULT_MANAGEMENT_FEE_TICK_RESULTS_MAP = Object.freeze({
|
|
6
|
+
FULL_TO_LITE: {
|
|
7
|
+
vault_total_equity: 'vt',
|
|
8
|
+
vault_share_price: 'vs',
|
|
9
|
+
fees_charged: 'fc'
|
|
10
|
+
},
|
|
11
|
+
LITE_TO_FULL: {
|
|
12
|
+
vt: 'vault_total_equity',
|
|
13
|
+
vs: 'vault_share_price',
|
|
14
|
+
fc: 'fees_charged'
|
|
15
|
+
}
|
|
16
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VAULT_REDEEM_RESULTS_MAP = void 0;
|
|
4
|
+
// Schema map for the 'VAULT_REDEEM_RESULTS' struct.
|
|
5
|
+
exports.VAULT_REDEEM_RESULTS_MAP = Object.freeze({
|
|
6
|
+
FULL_TO_LITE: {
|
|
7
|
+
token_index_price: 'ti',
|
|
8
|
+
vault_total_equity: 'vt',
|
|
9
|
+
vault_share_price: 'vs',
|
|
10
|
+
currency: 'c',
|
|
11
|
+
num_tokens: 'nt',
|
|
12
|
+
avg_entry_price: 'ae',
|
|
13
|
+
fees_charged: 'fc'
|
|
14
|
+
},
|
|
15
|
+
LITE_TO_FULL: {
|
|
16
|
+
ti: 'token_index_price',
|
|
17
|
+
vt: 'vault_total_equity',
|
|
18
|
+
vs: 'vault_share_price',
|
|
19
|
+
c: 'currency',
|
|
20
|
+
nt: 'num_tokens',
|
|
21
|
+
ae: 'avg_entry_price',
|
|
22
|
+
fc: 'fees_charged'
|
|
23
|
+
}
|
|
24
|
+
});
|
|
@@ -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
|
|
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',
|
|
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',
|
|
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
package/ws/interfaces.d.ts
CHANGED
|
@@ -3,8 +3,20 @@ export declare enum EStream {
|
|
|
3
3
|
CANDLE = "candle",
|
|
4
4
|
MINI_DELTA = "mini.d",
|
|
5
5
|
MINI_SNAP = "mini.s",
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated
|
|
8
|
+
* @see {@link EStream.RPI_BOOK_DELTA}
|
|
9
|
+
* To be removed in future versions
|
|
10
|
+
*/
|
|
6
11
|
ORDERBOOK_DELTA = "book.d",
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated
|
|
14
|
+
* @see {@link EStream.RPI_BOOK_DELTA}
|
|
15
|
+
* To be removed in future versions
|
|
16
|
+
*/
|
|
7
17
|
ORDERBOOK_SNAP = "book.s",
|
|
18
|
+
RPI_BOOK_DELTA = "rpi.book.d",
|
|
19
|
+
RPI_BOOK_SNAP = "rpi.book.s",
|
|
8
20
|
TICKER_DELTA = "ticker.d",
|
|
9
21
|
TICKER_SNAP = "ticker.s",
|
|
10
22
|
TRADE = "trade",
|
|
@@ -34,7 +46,7 @@ export interface IWSMiniRequest {
|
|
|
34
46
|
onError?: (error: Error) => void;
|
|
35
47
|
}
|
|
36
48
|
export interface IWSBookRequest {
|
|
37
|
-
stream: `${EStream.ORDERBOOK_DELTA}` | `${EStream.ORDERBOOK_SNAP}`;
|
|
49
|
+
stream: `${EStream.ORDERBOOK_DELTA}` | `${EStream.ORDERBOOK_SNAP}` | `${EStream.RPI_BOOK_DELTA}` | `${EStream.RPI_BOOK_SNAP}`;
|
|
38
50
|
params: IWSOrderbookLevelsFeedSelectorV1;
|
|
39
51
|
onData?: TMessageHandler<Required<IWSOrderbookLevelsFeedDataV1>['feed']>;
|
|
40
52
|
onError?: (error: Error) => void;
|
package/ws/interfaces.js
CHANGED
|
@@ -6,8 +6,20 @@ var EStream;
|
|
|
6
6
|
EStream["CANDLE"] = "candle";
|
|
7
7
|
EStream["MINI_DELTA"] = "mini.d";
|
|
8
8
|
EStream["MINI_SNAP"] = "mini.s";
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated
|
|
11
|
+
* @see {@link EStream.RPI_BOOK_DELTA}
|
|
12
|
+
* To be removed in future versions
|
|
13
|
+
*/
|
|
9
14
|
EStream["ORDERBOOK_DELTA"] = "book.d";
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated
|
|
17
|
+
* @see {@link EStream.RPI_BOOK_DELTA}
|
|
18
|
+
* To be removed in future versions
|
|
19
|
+
*/
|
|
10
20
|
EStream["ORDERBOOK_SNAP"] = "book.s";
|
|
21
|
+
EStream["RPI_BOOK_DELTA"] = "rpi.book.d";
|
|
22
|
+
EStream["RPI_BOOK_SNAP"] = "rpi.book.s";
|
|
11
23
|
EStream["TICKER_DELTA"] = "ticker.d";
|
|
12
24
|
EStream["TICKER_SNAP"] = "ticker.s";
|
|
13
25
|
EStream["TRADE"] = "trade";
|
package/ws/ws.js
CHANGED
|
@@ -298,7 +298,7 @@ class WS {
|
|
|
298
298
|
params.type
|
|
299
299
|
].filter(Boolean).join('-')
|
|
300
300
|
].filter(Boolean).join('@');
|
|
301
|
-
const
|
|
301
|
+
const rpiBookDeltaFeed = (params) => {
|
|
302
302
|
var _a;
|
|
303
303
|
return [
|
|
304
304
|
params.instrument,
|
|
@@ -307,7 +307,7 @@ class WS {
|
|
|
307
307
|
].filter(Boolean).join('-')
|
|
308
308
|
].filter(Boolean).join('@');
|
|
309
309
|
};
|
|
310
|
-
const
|
|
310
|
+
const rpiBookFeed = (params) => {
|
|
311
311
|
var _a, _b;
|
|
312
312
|
return [
|
|
313
313
|
params.instrument,
|
|
@@ -423,14 +423,16 @@ class WS {
|
|
|
423
423
|
feed: [candleFeed(params)]
|
|
424
424
|
};
|
|
425
425
|
case interfaces_2.EStream.ORDERBOOK_DELTA:
|
|
426
|
+
case interfaces_2.EStream.RPI_BOOK_DELTA:
|
|
426
427
|
return {
|
|
427
428
|
stream,
|
|
428
|
-
feed: [
|
|
429
|
+
feed: [rpiBookDeltaFeed(params)]
|
|
429
430
|
};
|
|
430
431
|
case interfaces_2.EStream.ORDERBOOK_SNAP:
|
|
432
|
+
case interfaces_2.EStream.RPI_BOOK_SNAP:
|
|
431
433
|
return {
|
|
432
434
|
stream,
|
|
433
|
-
feed: [
|
|
435
|
+
feed: [rpiBookFeed(params)]
|
|
434
436
|
};
|
|
435
437
|
case interfaces_2.EStream.MINI_DELTA:
|
|
436
438
|
case interfaces_2.EStream.MINI_SNAP:
|
|
@@ -499,6 +501,8 @@ class WS {
|
|
|
499
501
|
return utils_1.Utils.schemaMap(message, interfaces_1.WS_CANDLESTICK_FEED_DATA_V_1_MAP.LITE_TO_FULL).feed;
|
|
500
502
|
case interfaces_2.EStream.ORDERBOOK_DELTA:
|
|
501
503
|
case interfaces_2.EStream.ORDERBOOK_SNAP:
|
|
504
|
+
case interfaces_2.EStream.RPI_BOOK_DELTA:
|
|
505
|
+
case interfaces_2.EStream.RPI_BOOK_SNAP:
|
|
502
506
|
return utils_1.Utils.schemaMap(message, interfaces_1.WS_ORDERBOOK_LEVELS_FEED_DATA_V_1_MAP.LITE_TO_FULL).feed;
|
|
503
507
|
case interfaces_2.EStream.MINI_DELTA:
|
|
504
508
|
case interfaces_2.EStream.MINI_SNAP:
|
|
@@ -632,9 +636,10 @@ class WS {
|
|
|
632
636
|
_subscribe(pair, subscribePayload) {
|
|
633
637
|
var _a;
|
|
634
638
|
return __awaiter(this, void 0, void 0, function* () {
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
639
|
+
// Force send subscribe even if already subscribed
|
|
640
|
+
// if (Object.keys(this._pairs[pair] || {}).length) {
|
|
641
|
+
// return
|
|
642
|
+
// }
|
|
638
643
|
yield this.ready();
|
|
639
644
|
let _resolve;
|
|
640
645
|
const onPaired = (e) => {
|
/package/interfaces/codegen/schema-maps/{snap_orderbook_levels.d.ts → api_orderbook_levels.d.ts}
RENAMED
|
File without changes
|
/package/interfaces/codegen/schema-maps/{snap_orderbook_levels.js → api_orderbook_levels.js}
RENAMED
|
File without changes
|