@nadohq/engine-client 0.1.0-alpha.1 → 0.1.0-alpha.11
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/dist/EngineBaseClient.cjs +8 -7
- package/dist/EngineBaseClient.cjs.map +1 -1
- package/dist/EngineBaseClient.d.cts +1 -2
- package/dist/EngineBaseClient.d.ts +1 -2
- package/dist/EngineBaseClient.js +7 -5
- package/dist/EngineBaseClient.js.map +1 -1
- package/dist/EngineClient.d.cts +1 -2
- package/dist/EngineClient.d.ts +1 -2
- package/dist/EngineExecuteBuilder.cjs +33 -61
- package/dist/EngineExecuteBuilder.cjs.map +1 -1
- package/dist/EngineExecuteBuilder.d.cts +14 -25
- package/dist/EngineExecuteBuilder.d.ts +14 -25
- package/dist/EngineExecuteBuilder.js +25 -53
- package/dist/EngineExecuteBuilder.js.map +1 -1
- package/dist/EngineExecuteClient.cjs +12 -16
- package/dist/EngineExecuteClient.cjs.map +1 -1
- package/dist/EngineExecuteClient.d.cts +5 -6
- package/dist/EngineExecuteClient.d.ts +5 -6
- package/dist/EngineExecuteClient.js +12 -16
- package/dist/EngineExecuteClient.js.map +1 -1
- package/dist/EngineQueryClient.cjs +33 -57
- package/dist/EngineQueryClient.cjs.map +1 -1
- package/dist/EngineQueryClient.d.cts +4 -15
- package/dist/EngineQueryClient.d.ts +4 -15
- package/dist/EngineQueryClient.js +11 -35
- package/dist/EngineQueryClient.js.map +1 -1
- package/dist/EngineWebClient.cjs +0 -2
- package/dist/EngineWebClient.cjs.map +1 -1
- package/dist/EngineWebClient.d.cts +1 -2
- package/dist/EngineWebClient.d.ts +1 -2
- package/dist/EngineWebClient.js +0 -2
- package/dist/EngineWebClient.js.map +1 -1
- package/dist/endpoints.cjs +6 -6
- package/dist/endpoints.cjs.map +1 -1
- package/dist/endpoints.d.cts +1 -1
- package/dist/endpoints.d.ts +1 -1
- package/dist/endpoints.js +6 -6
- package/dist/endpoints.js.map +1 -1
- package/dist/index.d.cts +7 -8
- package/dist/index.d.ts +7 -8
- package/dist/types/EngineServerFailureError.cjs +1 -1
- package/dist/types/EngineServerFailureError.cjs.map +1 -1
- package/dist/types/EngineServerFailureError.d.cts +2 -2
- package/dist/types/EngineServerFailureError.d.ts +2 -2
- package/dist/types/EngineServerFailureError.js +1 -1
- package/dist/types/EngineServerFailureError.js.map +1 -1
- package/dist/types/clientExecuteTypes.cjs.map +1 -1
- package/dist/types/clientExecuteTypes.d.cts +8 -16
- package/dist/types/clientExecuteTypes.d.ts +8 -16
- package/dist/types/clientQueryTypes.cjs.map +1 -1
- package/dist/types/clientQueryTypes.d.cts +15 -25
- package/dist/types/clientQueryTypes.d.ts +15 -25
- package/dist/types/index.d.cts +7 -8
- package/dist/types/index.d.ts +7 -8
- package/dist/types/serverExecuteTypes.cjs.map +1 -1
- package/dist/types/serverExecuteTypes.d.cts +10 -18
- package/dist/types/serverExecuteTypes.d.ts +10 -18
- package/dist/types/serverQueryModelTypes.cjs.map +1 -1
- package/dist/types/serverQueryModelTypes.d.cts +1 -1
- package/dist/types/serverQueryModelTypes.d.ts +1 -1
- package/dist/types/serverQueryTypes.cjs.map +1 -1
- package/dist/types/serverQueryTypes.d.cts +8 -17
- package/dist/types/serverQueryTypes.d.ts +8 -17
- package/dist/types/serverSubscriptionEventTypes.cjs.map +1 -1
- package/dist/types/serverSubscriptionEventTypes.d.cts +83 -24
- package/dist/types/serverSubscriptionEventTypes.d.ts +83 -24
- package/dist/types/serverSubscriptionTypes.cjs.map +1 -1
- package/dist/types/serverSubscriptionTypes.d.cts +21 -4
- package/dist/types/serverSubscriptionTypes.d.ts +21 -4
- package/dist/utils/index.d.cts +1 -2
- package/dist/utils/index.d.ts +1 -2
- package/dist/utils/productEngineTypeMappers.cjs +5 -5
- package/dist/utils/productEngineTypeMappers.cjs.map +1 -1
- package/dist/utils/productEngineTypeMappers.d.cts +1 -1
- package/dist/utils/productEngineTypeMappers.d.ts +1 -1
- package/dist/utils/productEngineTypeMappers.js +1 -1
- package/dist/utils/productEngineTypeMappers.js.map +1 -1
- package/dist/utils/queryDataMappers.cjs +79 -90
- package/dist/utils/queryDataMappers.cjs.map +1 -1
- package/dist/utils/queryDataMappers.d.cts +1 -2
- package/dist/utils/queryDataMappers.d.ts +1 -2
- package/dist/utils/queryDataMappers.js +7 -19
- package/dist/utils/queryDataMappers.js.map +1 -1
- package/package.json +3 -4
- package/src/EngineBaseClient.ts +5 -3
- package/src/EngineExecuteBuilder.ts +30 -70
- package/src/EngineExecuteClient.ts +13 -21
- package/src/EngineQueryClient.ts +14 -42
- package/src/EngineWebClient.ts +0 -2
- package/src/endpoints.ts +4 -5
- package/src/types/EngineServerFailureError.ts +2 -2
- package/src/types/clientExecuteTypes.ts +13 -25
- package/src/types/clientQueryTypes.ts +21 -34
- package/src/types/serverExecuteTypes.ts +13 -24
- package/src/types/serverQueryModelTypes.ts +1 -1
- package/src/types/serverQueryTypes.ts +7 -20
- package/src/types/serverSubscriptionEventTypes.ts +130 -22
- package/src/types/serverSubscriptionTypes.ts +23 -3
- package/src/utils/productEngineTypeMappers.ts +1 -1
- package/src/utils/queryDataMappers.ts +7 -20
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HealthStatus } from '@nadohq/
|
|
1
|
+
import { HealthStatus } from '@nadohq/shared';
|
|
2
2
|
import { EngineServerProductType, EngineServerSpotProduct, EngineServerPerpProduct, EngineServerSpotBalance, EngineServerPerpBalance, EngineServerHealthBreakdown } from './serverQueryModelTypes.cjs';
|
|
3
3
|
|
|
4
4
|
interface EngineServerNoncesParams {
|
|
@@ -67,7 +67,7 @@ interface EngineServerMaxOrderSizeQueryParams {
|
|
|
67
67
|
interface EngineServerLinkedSignerParams {
|
|
68
68
|
subaccount: string;
|
|
69
69
|
}
|
|
70
|
-
interface
|
|
70
|
+
interface EngineServerMaxMintNlpQueryParams {
|
|
71
71
|
sender: string;
|
|
72
72
|
spot_leverage: string | null;
|
|
73
73
|
}
|
|
@@ -83,10 +83,9 @@ interface EngineServerQueryRequestByType {
|
|
|
83
83
|
market_liquidity: EngineServerMarketLiquidityQueryParams;
|
|
84
84
|
market_price: EngineServerMarketPriceQueryParams;
|
|
85
85
|
market_prices: EngineServerMarketPricesQueryParams;
|
|
86
|
-
|
|
86
|
+
max_nlp_mintable: EngineServerMaxMintNlpQueryParams;
|
|
87
87
|
max_order_size: EngineServerMaxOrderSizeQueryParams;
|
|
88
88
|
max_withdrawable: EngineServerMaxWithdrawableQueryParams;
|
|
89
|
-
min_deposit_rates: Record<string, never>;
|
|
90
89
|
nonces: EngineServerNoncesParams;
|
|
91
90
|
order: EngineServerGetOrderQueryParams;
|
|
92
91
|
orders: EngineServerOrdersQueryParams;
|
|
@@ -105,7 +104,6 @@ type EngineServerQueryRequest<TRequestType extends EngineServerQueryRequestType>
|
|
|
105
104
|
interface EngineServerContractsResponse {
|
|
106
105
|
chain_id: string;
|
|
107
106
|
endpoint_addr: string;
|
|
108
|
-
book_addrs: string[];
|
|
109
107
|
}
|
|
110
108
|
type EngineServerStatusResponse = 'started' | 'active' | 'stopping' | 'syncing' | 'live_syncing' | 'failed';
|
|
111
109
|
interface EngineServerNoncesResponse {
|
|
@@ -194,6 +192,7 @@ interface EngineServerFeeRatesResponse {
|
|
|
194
192
|
withdraw_sequencer_fees: string[];
|
|
195
193
|
taker_fee_rates_x18: string[];
|
|
196
194
|
maker_fee_rates_x18: string[];
|
|
195
|
+
fee_tier: number;
|
|
197
196
|
}
|
|
198
197
|
interface EngineServerMarketPrice {
|
|
199
198
|
product_id: number;
|
|
@@ -215,7 +214,7 @@ interface EngineServerOrder {
|
|
|
215
214
|
digest: string;
|
|
216
215
|
placed_at: number;
|
|
217
216
|
order_type: string;
|
|
218
|
-
|
|
217
|
+
appendix: string;
|
|
219
218
|
}
|
|
220
219
|
type EngineServerOrderResponse = EngineServerOrder;
|
|
221
220
|
interface EngineServerValidateOrderResponse {
|
|
@@ -240,17 +239,10 @@ interface EngineServerLinkedSignerResponse {
|
|
|
240
239
|
interface EngineInsuranceResponse {
|
|
241
240
|
insurance: string;
|
|
242
241
|
}
|
|
243
|
-
interface EngineServerMinDepositRate {
|
|
244
|
-
product_id: number;
|
|
245
|
-
min_deposit_rate_x18: string;
|
|
246
|
-
}
|
|
247
|
-
interface EngineServerMinDepositRatesResponse {
|
|
248
|
-
min_deposit_rates: Record<number, EngineServerMinDepositRate>;
|
|
249
|
-
}
|
|
250
242
|
interface EngineServerEdgeAllProductsResponse {
|
|
251
243
|
edge_all_products: Record<number, EngineServerAllProductsResponse>;
|
|
252
244
|
}
|
|
253
|
-
interface
|
|
245
|
+
interface EngineServerMaxMintNlpResponse {
|
|
254
246
|
max_quote_amount: string;
|
|
255
247
|
}
|
|
256
248
|
interface EngineServerQueryResponseByType {
|
|
@@ -265,10 +257,9 @@ interface EngineServerQueryResponseByType {
|
|
|
265
257
|
market_liquidity: EngineServerMarketLiquidityResponse;
|
|
266
258
|
market_price: EngineServerMarketPriceResponse;
|
|
267
259
|
market_prices: EngineServerMarketPricesResponse;
|
|
268
|
-
|
|
260
|
+
max_nlp_mintable: EngineServerMaxMintNlpResponse;
|
|
269
261
|
max_order_size: EngineServerMaxOrderSizeResponse;
|
|
270
262
|
max_withdrawable: EngineServerMaxWithdrawableResponse;
|
|
271
|
-
min_deposit_rates: EngineServerMinDepositRatesResponse;
|
|
272
263
|
nonces: EngineServerNoncesResponse;
|
|
273
264
|
order: EngineServerOrderResponse;
|
|
274
265
|
orders: EngineServerProductOrdersResponse;
|
|
@@ -289,4 +280,4 @@ interface EngineServerQueryFailureResponse {
|
|
|
289
280
|
}
|
|
290
281
|
type EngineServerQueryResponse<TQueryType extends keyof EngineServerQueryResponseByType = EngineServerQueryRequestType> = EngineServerQuerySuccessResponse<TQueryType> | EngineServerQueryFailureResponse;
|
|
291
282
|
|
|
292
|
-
export type { EngineInsuranceResponse, EngineServerAllProductsResponse, EngineServerContractsResponse, EngineServerEdgeAllProductsResponse, EngineServerFeeRatesResponse, EngineServerGetOrderQueryParams, EngineServerHealthGroupsResponse, EngineServerIpBlockResponse, EngineServerIsolatedPosition, EngineServerIsolatedPositionsQueryParams, EngineServerIsolatedPositionsResponse, EngineServerLinkedSignerParams, EngineServerLinkedSignerResponse, EngineServerMarketLiquidityQueryParams, EngineServerMarketLiquidityResponse, EngineServerMarketPrice, EngineServerMarketPriceQueryParams, EngineServerMarketPriceResponse, EngineServerMarketPricesQueryParams, EngineServerMarketPricesResponse,
|
|
283
|
+
export type { EngineInsuranceResponse, EngineServerAllProductsResponse, EngineServerContractsResponse, EngineServerEdgeAllProductsResponse, EngineServerFeeRatesResponse, EngineServerGetOrderQueryParams, EngineServerHealthGroupsResponse, EngineServerIpBlockResponse, EngineServerIsolatedPosition, EngineServerIsolatedPositionsQueryParams, EngineServerIsolatedPositionsResponse, EngineServerLinkedSignerParams, EngineServerLinkedSignerResponse, EngineServerMarketLiquidityQueryParams, EngineServerMarketLiquidityResponse, EngineServerMarketPrice, EngineServerMarketPriceQueryParams, EngineServerMarketPriceResponse, EngineServerMarketPricesQueryParams, EngineServerMarketPricesResponse, EngineServerMaxMintNlpQueryParams, EngineServerMaxMintNlpResponse, EngineServerMaxOrderSizeQueryParams, EngineServerMaxOrderSizeResponse, EngineServerMaxWithdrawableQueryParams, EngineServerMaxWithdrawableResponse, EngineServerNoncesParams, EngineServerNoncesResponse, EngineServerOrder, EngineServerOrderResponse, EngineServerOrdersQueryParams, EngineServerPriceTickLiquidity, EngineServerProductOrdersResponse, EngineServerQueryFailureResponse, EngineServerQueryRequest, EngineServerQueryRequestByType, EngineServerQueryRequestType, EngineServerQueryResponse, EngineServerQueryResponseByType, EngineServerQuerySuccessResponse, EngineServerStatusResponse, EngineServerSubaccountFeeRatesParams, EngineServerSubaccountInfoQueryParams, EngineServerSubaccountInfoResponse, EngineServerSubaccountOrders, EngineServerSubaccountOrdersQueryParams, EngineServerSubaccountOrdersResponse, EngineServerSymbol, EngineServerSymbolsQueryParams, EngineServerSymbolsResponse, EngineServerTimeResponse, EngineServerValidateOrderQueryParams, EngineServerValidateOrderResponse };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HealthStatus } from '@nadohq/
|
|
1
|
+
import { HealthStatus } from '@nadohq/shared';
|
|
2
2
|
import { EngineServerProductType, EngineServerSpotProduct, EngineServerPerpProduct, EngineServerSpotBalance, EngineServerPerpBalance, EngineServerHealthBreakdown } from './serverQueryModelTypes.js';
|
|
3
3
|
|
|
4
4
|
interface EngineServerNoncesParams {
|
|
@@ -67,7 +67,7 @@ interface EngineServerMaxOrderSizeQueryParams {
|
|
|
67
67
|
interface EngineServerLinkedSignerParams {
|
|
68
68
|
subaccount: string;
|
|
69
69
|
}
|
|
70
|
-
interface
|
|
70
|
+
interface EngineServerMaxMintNlpQueryParams {
|
|
71
71
|
sender: string;
|
|
72
72
|
spot_leverage: string | null;
|
|
73
73
|
}
|
|
@@ -83,10 +83,9 @@ interface EngineServerQueryRequestByType {
|
|
|
83
83
|
market_liquidity: EngineServerMarketLiquidityQueryParams;
|
|
84
84
|
market_price: EngineServerMarketPriceQueryParams;
|
|
85
85
|
market_prices: EngineServerMarketPricesQueryParams;
|
|
86
|
-
|
|
86
|
+
max_nlp_mintable: EngineServerMaxMintNlpQueryParams;
|
|
87
87
|
max_order_size: EngineServerMaxOrderSizeQueryParams;
|
|
88
88
|
max_withdrawable: EngineServerMaxWithdrawableQueryParams;
|
|
89
|
-
min_deposit_rates: Record<string, never>;
|
|
90
89
|
nonces: EngineServerNoncesParams;
|
|
91
90
|
order: EngineServerGetOrderQueryParams;
|
|
92
91
|
orders: EngineServerOrdersQueryParams;
|
|
@@ -105,7 +104,6 @@ type EngineServerQueryRequest<TRequestType extends EngineServerQueryRequestType>
|
|
|
105
104
|
interface EngineServerContractsResponse {
|
|
106
105
|
chain_id: string;
|
|
107
106
|
endpoint_addr: string;
|
|
108
|
-
book_addrs: string[];
|
|
109
107
|
}
|
|
110
108
|
type EngineServerStatusResponse = 'started' | 'active' | 'stopping' | 'syncing' | 'live_syncing' | 'failed';
|
|
111
109
|
interface EngineServerNoncesResponse {
|
|
@@ -194,6 +192,7 @@ interface EngineServerFeeRatesResponse {
|
|
|
194
192
|
withdraw_sequencer_fees: string[];
|
|
195
193
|
taker_fee_rates_x18: string[];
|
|
196
194
|
maker_fee_rates_x18: string[];
|
|
195
|
+
fee_tier: number;
|
|
197
196
|
}
|
|
198
197
|
interface EngineServerMarketPrice {
|
|
199
198
|
product_id: number;
|
|
@@ -215,7 +214,7 @@ interface EngineServerOrder {
|
|
|
215
214
|
digest: string;
|
|
216
215
|
placed_at: number;
|
|
217
216
|
order_type: string;
|
|
218
|
-
|
|
217
|
+
appendix: string;
|
|
219
218
|
}
|
|
220
219
|
type EngineServerOrderResponse = EngineServerOrder;
|
|
221
220
|
interface EngineServerValidateOrderResponse {
|
|
@@ -240,17 +239,10 @@ interface EngineServerLinkedSignerResponse {
|
|
|
240
239
|
interface EngineInsuranceResponse {
|
|
241
240
|
insurance: string;
|
|
242
241
|
}
|
|
243
|
-
interface EngineServerMinDepositRate {
|
|
244
|
-
product_id: number;
|
|
245
|
-
min_deposit_rate_x18: string;
|
|
246
|
-
}
|
|
247
|
-
interface EngineServerMinDepositRatesResponse {
|
|
248
|
-
min_deposit_rates: Record<number, EngineServerMinDepositRate>;
|
|
249
|
-
}
|
|
250
242
|
interface EngineServerEdgeAllProductsResponse {
|
|
251
243
|
edge_all_products: Record<number, EngineServerAllProductsResponse>;
|
|
252
244
|
}
|
|
253
|
-
interface
|
|
245
|
+
interface EngineServerMaxMintNlpResponse {
|
|
254
246
|
max_quote_amount: string;
|
|
255
247
|
}
|
|
256
248
|
interface EngineServerQueryResponseByType {
|
|
@@ -265,10 +257,9 @@ interface EngineServerQueryResponseByType {
|
|
|
265
257
|
market_liquidity: EngineServerMarketLiquidityResponse;
|
|
266
258
|
market_price: EngineServerMarketPriceResponse;
|
|
267
259
|
market_prices: EngineServerMarketPricesResponse;
|
|
268
|
-
|
|
260
|
+
max_nlp_mintable: EngineServerMaxMintNlpResponse;
|
|
269
261
|
max_order_size: EngineServerMaxOrderSizeResponse;
|
|
270
262
|
max_withdrawable: EngineServerMaxWithdrawableResponse;
|
|
271
|
-
min_deposit_rates: EngineServerMinDepositRatesResponse;
|
|
272
263
|
nonces: EngineServerNoncesResponse;
|
|
273
264
|
order: EngineServerOrderResponse;
|
|
274
265
|
orders: EngineServerProductOrdersResponse;
|
|
@@ -289,4 +280,4 @@ interface EngineServerQueryFailureResponse {
|
|
|
289
280
|
}
|
|
290
281
|
type EngineServerQueryResponse<TQueryType extends keyof EngineServerQueryResponseByType = EngineServerQueryRequestType> = EngineServerQuerySuccessResponse<TQueryType> | EngineServerQueryFailureResponse;
|
|
291
282
|
|
|
292
|
-
export type { EngineInsuranceResponse, EngineServerAllProductsResponse, EngineServerContractsResponse, EngineServerEdgeAllProductsResponse, EngineServerFeeRatesResponse, EngineServerGetOrderQueryParams, EngineServerHealthGroupsResponse, EngineServerIpBlockResponse, EngineServerIsolatedPosition, EngineServerIsolatedPositionsQueryParams, EngineServerIsolatedPositionsResponse, EngineServerLinkedSignerParams, EngineServerLinkedSignerResponse, EngineServerMarketLiquidityQueryParams, EngineServerMarketLiquidityResponse, EngineServerMarketPrice, EngineServerMarketPriceQueryParams, EngineServerMarketPriceResponse, EngineServerMarketPricesQueryParams, EngineServerMarketPricesResponse,
|
|
283
|
+
export type { EngineInsuranceResponse, EngineServerAllProductsResponse, EngineServerContractsResponse, EngineServerEdgeAllProductsResponse, EngineServerFeeRatesResponse, EngineServerGetOrderQueryParams, EngineServerHealthGroupsResponse, EngineServerIpBlockResponse, EngineServerIsolatedPosition, EngineServerIsolatedPositionsQueryParams, EngineServerIsolatedPositionsResponse, EngineServerLinkedSignerParams, EngineServerLinkedSignerResponse, EngineServerMarketLiquidityQueryParams, EngineServerMarketLiquidityResponse, EngineServerMarketPrice, EngineServerMarketPriceQueryParams, EngineServerMarketPriceResponse, EngineServerMarketPricesQueryParams, EngineServerMarketPricesResponse, EngineServerMaxMintNlpQueryParams, EngineServerMaxMintNlpResponse, EngineServerMaxOrderSizeQueryParams, EngineServerMaxOrderSizeResponse, EngineServerMaxWithdrawableQueryParams, EngineServerMaxWithdrawableResponse, EngineServerNoncesParams, EngineServerNoncesResponse, EngineServerOrder, EngineServerOrderResponse, EngineServerOrdersQueryParams, EngineServerPriceTickLiquidity, EngineServerProductOrdersResponse, EngineServerQueryFailureResponse, EngineServerQueryRequest, EngineServerQueryRequestByType, EngineServerQueryRequestType, EngineServerQueryResponse, EngineServerQueryResponseByType, EngineServerQuerySuccessResponse, EngineServerStatusResponse, EngineServerSubaccountFeeRatesParams, EngineServerSubaccountInfoQueryParams, EngineServerSubaccountInfoResponse, EngineServerSubaccountOrders, EngineServerSubaccountOrdersQueryParams, EngineServerSubaccountOrdersResponse, EngineServerSymbol, EngineServerSymbolsQueryParams, EngineServerSymbolsResponse, EngineServerTimeResponse, EngineServerValidateOrderQueryParams, EngineServerValidateOrderResponse };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/serverSubscriptionEventTypes.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../src/types/serverSubscriptionEventTypes.ts"],"sourcesContent":["import {\n EngineServerOrder,\n EngineServerPriceTickLiquidity,\n} from './serverQueryTypes';\n\n/**\n * Reasons that can trigger position change events.\n */\nexport type PositionChangeReason =\n | 'deposit_collateral'\n | 'match_orders'\n | 'withdraw_collateral'\n | 'transfer_quote'\n | 'settle_pnl'\n | 'mint_nlp'\n | 'burn_nlp'\n | 'liquidate_subaccount';\n\n/**\n * Possible reasons for order updates.\n */\nexport type OrderUpdateReason = 'cancelled' | 'filled' | 'placed';\n\nexport type EngineServerSubscriptionEventType =\n | 'trade'\n | 'best_bid_offer'\n | 'book_depth'\n | 'fill'\n | 'position_change'\n | 'order_update'\n | 'liquidation'\n | 'latest_candlestick'\n | 'funding_payment';\n\nexport interface EngineServerSubscriptionBaseEvent<\n T extends\n EngineServerSubscriptionEventType = EngineServerSubscriptionEventType,\n> {\n type: T;\n product_id: number;\n}\n\n/**\n * Event from subscribing to a `trade` stream.\n */\nexport interface EngineServerSubscriptionTradeEvent\n extends EngineServerSubscriptionBaseEvent<'trade'> {\n timestamp: string;\n price: string;\n taker_qty: string;\n maker_qty: string;\n is_taker_buyer: boolean;\n}\n\n/**\n * Event from subscribing to a `best_bid_offer` stream.\n */\nexport interface EngineServerSubscriptionBestBidOfferEvent\n extends EngineServerSubscriptionBaseEvent<'best_bid_offer'> {\n timestamp: string;\n bid_price: string;\n bid_qty: string;\n ask_price: string;\n ask_qty: string;\n}\n\n/**\n * Event from subscribing to a `book_depth` stream.\n */\nexport interface EngineServerSubscriptionBookDepthEvent\n extends EngineServerSubscriptionBaseEvent<'book_depth'> {\n last_max_timestamp: string;\n min_timestamp: string;\n max_timestamp: string;\n bids: EngineServerPriceTickLiquidity[];\n asks: EngineServerPriceTickLiquidity[];\n}\n\n/**\n * Event from subscribing to a `fill` stream.\n */\nexport interface EngineServerSubscriptionFillEvent\n extends EngineServerSubscriptionBaseEvent<'fill'> {\n // NOTE: `id` is excluded from the response to avoid parsing issues.\n // type of `id` on the backend is `u64` which can overflow until we introduce proper parsing on the SDK.\n timestamp: string;\n subaccount: string;\n order_digest: string;\n filled_qty: string;\n remaining_qty: string;\n original_qty: string;\n price: string;\n is_taker: boolean;\n is_bid: boolean;\n fee: string;\n submission_idx: string;\n appendix: string;\n}\n\n/**\n * Event from subscribing to a `position_change` stream.\n */\nexport interface EngineServerSubscriptionPositionChangeEvent\n extends EngineServerSubscriptionBaseEvent<'position_change'> {\n timestamp: string;\n subaccount: string;\n amount: string;\n /** Zero for everything except perps */\n v_quote_amount: string;\n reason: PositionChangeReason;\n}\n\n/**\n * Event from subscribing to an `order_update` stream.\n */\nexport interface EngineServerSubscriptionOrderUpdateEvent\n extends EngineServerSubscriptionBaseEvent<'order_update'> {\n timestamp: string;\n order: EngineServerOrder;\n reason: OrderUpdateReason;\n}\n\n/**\n * Event from subscribing to a `liquidation` stream.\n */\nexport interface EngineServerSubscriptionLiquidationEvent\n extends EngineServerSubscriptionBaseEvent<'liquidation'> {\n timestamp: string;\n /** Single element for regular liquidations, two elements for spread liquidations [spotId, perpId] */\n product_ids: number[];\n liquidator: string;\n liquidatee: string;\n /** Amount liquidated (positive for long, negative for short) */\n amount: string;\n /** Price at which liquidation occurred */\n price: string;\n}\n\n/**\n * Event from subscribing to a `latest_candlestick` stream.\n */\nexport interface EngineServerSubscriptionLatestCandlestickEvent\n extends EngineServerSubscriptionBaseEvent<'latest_candlestick'> {\n timestamp: string;\n granularity: number;\n open_x18: string;\n high_x18: string;\n low_x18: string;\n close_x18: string;\n volume: string;\n}\n\n/**\n * Event from subscribing to a `funding_payment` stream.\n */\nexport interface EngineServerSubscriptionFundingPaymentEvent\n extends EngineServerSubscriptionBaseEvent<'funding_payment'> {\n timestamp: string;\n /** Funding payment amount (positive = receive, negative = pay) */\n payment_amount: string;\n /** Open interest at time of funding */\n open_interest: string;\n /** Current cumulative funding values */\n cumulative_funding_long_x18: string;\n cumulative_funding_short_x18: string;\n /** Time delta over which the funding payment was calculated */\n dt: string;\n}\n\n/**\n * Union type for all engine server subscription events.\n */\nexport type EngineServerSubscriptionEvent =\n | EngineServerSubscriptionTradeEvent\n | EngineServerSubscriptionBestBidOfferEvent\n | EngineServerSubscriptionBookDepthEvent\n | EngineServerSubscriptionFillEvent\n | EngineServerSubscriptionPositionChangeEvent\n | EngineServerSubscriptionOrderUpdateEvent\n | EngineServerSubscriptionLiquidationEvent\n | EngineServerSubscriptionLatestCandlestickEvent\n | EngineServerSubscriptionFundingPaymentEvent;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import { EngineServerPriceTickLiquidity } from './serverQueryTypes.cjs';
|
|
2
|
-
import '@nadohq/
|
|
1
|
+
import { EngineServerPriceTickLiquidity, EngineServerOrder } from './serverQueryTypes.cjs';
|
|
2
|
+
import '@nadohq/shared';
|
|
3
3
|
import './serverQueryModelTypes.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Reasons that can trigger position change events.
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
type PositionChangeReason = 'deposit_collateral' | 'match_orders' | 'withdraw_collateral' | 'transfer_quote' | 'settle_pnl' | 'mint_nlp' | 'burn_nlp' | 'liquidate_subaccount';
|
|
9
|
+
/**
|
|
10
|
+
* Possible reasons for order updates.
|
|
11
|
+
*/
|
|
12
|
+
type OrderUpdateReason = 'cancelled' | 'filled' | 'placed';
|
|
13
|
+
type EngineServerSubscriptionEventType = 'trade' | 'best_bid_offer' | 'book_depth' | 'fill' | 'position_change' | 'order_update' | 'liquidation' | 'latest_candlestick' | 'funding_payment';
|
|
14
|
+
interface EngineServerSubscriptionBaseEvent<T extends EngineServerSubscriptionEventType = EngineServerSubscriptionEventType> {
|
|
15
|
+
type: T;
|
|
10
16
|
product_id: number;
|
|
11
|
-
digest: string;
|
|
12
|
-
amount: string;
|
|
13
|
-
reason: string;
|
|
14
17
|
}
|
|
15
18
|
/**
|
|
16
19
|
* Event from subscribing to a `trade` stream.
|
|
17
20
|
*/
|
|
18
|
-
interface EngineServerSubscriptionTradeEvent {
|
|
21
|
+
interface EngineServerSubscriptionTradeEvent extends EngineServerSubscriptionBaseEvent<'trade'> {
|
|
19
22
|
timestamp: string;
|
|
20
|
-
product_id: number;
|
|
21
23
|
price: string;
|
|
22
24
|
taker_qty: string;
|
|
23
25
|
maker_qty: string;
|
|
@@ -26,46 +28,103 @@ interface EngineServerSubscriptionTradeEvent {
|
|
|
26
28
|
/**
|
|
27
29
|
* Event from subscribing to a `best_bid_offer` stream.
|
|
28
30
|
*/
|
|
29
|
-
interface EngineServerSubscriptionBestBidOfferEvent {
|
|
31
|
+
interface EngineServerSubscriptionBestBidOfferEvent extends EngineServerSubscriptionBaseEvent<'best_bid_offer'> {
|
|
30
32
|
timestamp: string;
|
|
31
|
-
product_id: number;
|
|
32
33
|
bid_price: string;
|
|
33
34
|
bid_qty: string;
|
|
34
35
|
ask_price: string;
|
|
35
36
|
ask_qty: string;
|
|
36
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Event from subscribing to a `book_depth` stream.
|
|
40
|
+
*/
|
|
41
|
+
interface EngineServerSubscriptionBookDepthEvent extends EngineServerSubscriptionBaseEvent<'book_depth'> {
|
|
42
|
+
last_max_timestamp: string;
|
|
43
|
+
min_timestamp: string;
|
|
44
|
+
max_timestamp: string;
|
|
45
|
+
bids: EngineServerPriceTickLiquidity[];
|
|
46
|
+
asks: EngineServerPriceTickLiquidity[];
|
|
47
|
+
}
|
|
37
48
|
/**
|
|
38
49
|
* Event from subscribing to a `fill` stream.
|
|
39
50
|
*/
|
|
40
|
-
interface EngineServerSubscriptionFillEvent {
|
|
51
|
+
interface EngineServerSubscriptionFillEvent extends EngineServerSubscriptionBaseEvent<'fill'> {
|
|
41
52
|
timestamp: string;
|
|
42
|
-
product_id: number;
|
|
43
53
|
subaccount: string;
|
|
44
54
|
order_digest: string;
|
|
45
55
|
filled_qty: string;
|
|
46
56
|
remaining_qty: string;
|
|
57
|
+
original_qty: string;
|
|
47
58
|
price: string;
|
|
48
59
|
is_taker: boolean;
|
|
60
|
+
is_bid: boolean;
|
|
61
|
+
fee: string;
|
|
62
|
+
submission_idx: string;
|
|
63
|
+
appendix: string;
|
|
49
64
|
}
|
|
50
65
|
/**
|
|
51
66
|
* Event from subscribing to a `position_change` stream.
|
|
52
67
|
*/
|
|
53
|
-
interface EngineServerSubscriptionPositionChangeEvent {
|
|
68
|
+
interface EngineServerSubscriptionPositionChangeEvent extends EngineServerSubscriptionBaseEvent<'position_change'> {
|
|
54
69
|
timestamp: string;
|
|
55
|
-
product_id: number;
|
|
56
70
|
subaccount: string;
|
|
57
71
|
amount: string;
|
|
72
|
+
/** Zero for everything except perps */
|
|
58
73
|
v_quote_amount: string;
|
|
74
|
+
reason: PositionChangeReason;
|
|
59
75
|
}
|
|
60
76
|
/**
|
|
61
|
-
* Event from subscribing to
|
|
77
|
+
* Event from subscribing to an `order_update` stream.
|
|
62
78
|
*/
|
|
63
|
-
interface
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
79
|
+
interface EngineServerSubscriptionOrderUpdateEvent extends EngineServerSubscriptionBaseEvent<'order_update'> {
|
|
80
|
+
timestamp: string;
|
|
81
|
+
order: EngineServerOrder;
|
|
82
|
+
reason: OrderUpdateReason;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Event from subscribing to a `liquidation` stream.
|
|
86
|
+
*/
|
|
87
|
+
interface EngineServerSubscriptionLiquidationEvent extends EngineServerSubscriptionBaseEvent<'liquidation'> {
|
|
88
|
+
timestamp: string;
|
|
89
|
+
/** Single element for regular liquidations, two elements for spread liquidations [spotId, perpId] */
|
|
90
|
+
product_ids: number[];
|
|
91
|
+
liquidator: string;
|
|
92
|
+
liquidatee: string;
|
|
93
|
+
/** Amount liquidated (positive for long, negative for short) */
|
|
94
|
+
amount: string;
|
|
95
|
+
/** Price at which liquidation occurred */
|
|
96
|
+
price: string;
|
|
69
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Event from subscribing to a `latest_candlestick` stream.
|
|
100
|
+
*/
|
|
101
|
+
interface EngineServerSubscriptionLatestCandlestickEvent extends EngineServerSubscriptionBaseEvent<'latest_candlestick'> {
|
|
102
|
+
timestamp: string;
|
|
103
|
+
granularity: number;
|
|
104
|
+
open_x18: string;
|
|
105
|
+
high_x18: string;
|
|
106
|
+
low_x18: string;
|
|
107
|
+
close_x18: string;
|
|
108
|
+
volume: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Event from subscribing to a `funding_payment` stream.
|
|
112
|
+
*/
|
|
113
|
+
interface EngineServerSubscriptionFundingPaymentEvent extends EngineServerSubscriptionBaseEvent<'funding_payment'> {
|
|
114
|
+
timestamp: string;
|
|
115
|
+
/** Funding payment amount (positive = receive, negative = pay) */
|
|
116
|
+
payment_amount: string;
|
|
117
|
+
/** Open interest at time of funding */
|
|
118
|
+
open_interest: string;
|
|
119
|
+
/** Current cumulative funding values */
|
|
120
|
+
cumulative_funding_long_x18: string;
|
|
121
|
+
cumulative_funding_short_x18: string;
|
|
122
|
+
/** Time delta over which the funding payment was calculated */
|
|
123
|
+
dt: string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Union type for all engine server subscription events.
|
|
127
|
+
*/
|
|
128
|
+
type EngineServerSubscriptionEvent = EngineServerSubscriptionTradeEvent | EngineServerSubscriptionBestBidOfferEvent | EngineServerSubscriptionBookDepthEvent | EngineServerSubscriptionFillEvent | EngineServerSubscriptionPositionChangeEvent | EngineServerSubscriptionOrderUpdateEvent | EngineServerSubscriptionLiquidationEvent | EngineServerSubscriptionLatestCandlestickEvent | EngineServerSubscriptionFundingPaymentEvent;
|
|
70
129
|
|
|
71
|
-
export type { EngineServerSubscriptionBestBidOfferEvent, EngineServerSubscriptionBookDepthEvent, EngineServerSubscriptionFillEvent, EngineServerSubscriptionOrderUpdateEvent, EngineServerSubscriptionPositionChangeEvent, EngineServerSubscriptionTradeEvent };
|
|
130
|
+
export type { EngineServerSubscriptionBaseEvent, EngineServerSubscriptionBestBidOfferEvent, EngineServerSubscriptionBookDepthEvent, EngineServerSubscriptionEvent, EngineServerSubscriptionEventType, EngineServerSubscriptionFillEvent, EngineServerSubscriptionFundingPaymentEvent, EngineServerSubscriptionLatestCandlestickEvent, EngineServerSubscriptionLiquidationEvent, EngineServerSubscriptionOrderUpdateEvent, EngineServerSubscriptionPositionChangeEvent, EngineServerSubscriptionTradeEvent, OrderUpdateReason, PositionChangeReason };
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import { EngineServerPriceTickLiquidity } from './serverQueryTypes.js';
|
|
2
|
-
import '@nadohq/
|
|
1
|
+
import { EngineServerPriceTickLiquidity, EngineServerOrder } from './serverQueryTypes.js';
|
|
2
|
+
import '@nadohq/shared';
|
|
3
3
|
import './serverQueryModelTypes.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Reasons that can trigger position change events.
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
type PositionChangeReason = 'deposit_collateral' | 'match_orders' | 'withdraw_collateral' | 'transfer_quote' | 'settle_pnl' | 'mint_nlp' | 'burn_nlp' | 'liquidate_subaccount';
|
|
9
|
+
/**
|
|
10
|
+
* Possible reasons for order updates.
|
|
11
|
+
*/
|
|
12
|
+
type OrderUpdateReason = 'cancelled' | 'filled' | 'placed';
|
|
13
|
+
type EngineServerSubscriptionEventType = 'trade' | 'best_bid_offer' | 'book_depth' | 'fill' | 'position_change' | 'order_update' | 'liquidation' | 'latest_candlestick' | 'funding_payment';
|
|
14
|
+
interface EngineServerSubscriptionBaseEvent<T extends EngineServerSubscriptionEventType = EngineServerSubscriptionEventType> {
|
|
15
|
+
type: T;
|
|
10
16
|
product_id: number;
|
|
11
|
-
digest: string;
|
|
12
|
-
amount: string;
|
|
13
|
-
reason: string;
|
|
14
17
|
}
|
|
15
18
|
/**
|
|
16
19
|
* Event from subscribing to a `trade` stream.
|
|
17
20
|
*/
|
|
18
|
-
interface EngineServerSubscriptionTradeEvent {
|
|
21
|
+
interface EngineServerSubscriptionTradeEvent extends EngineServerSubscriptionBaseEvent<'trade'> {
|
|
19
22
|
timestamp: string;
|
|
20
|
-
product_id: number;
|
|
21
23
|
price: string;
|
|
22
24
|
taker_qty: string;
|
|
23
25
|
maker_qty: string;
|
|
@@ -26,46 +28,103 @@ interface EngineServerSubscriptionTradeEvent {
|
|
|
26
28
|
/**
|
|
27
29
|
* Event from subscribing to a `best_bid_offer` stream.
|
|
28
30
|
*/
|
|
29
|
-
interface EngineServerSubscriptionBestBidOfferEvent {
|
|
31
|
+
interface EngineServerSubscriptionBestBidOfferEvent extends EngineServerSubscriptionBaseEvent<'best_bid_offer'> {
|
|
30
32
|
timestamp: string;
|
|
31
|
-
product_id: number;
|
|
32
33
|
bid_price: string;
|
|
33
34
|
bid_qty: string;
|
|
34
35
|
ask_price: string;
|
|
35
36
|
ask_qty: string;
|
|
36
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Event from subscribing to a `book_depth` stream.
|
|
40
|
+
*/
|
|
41
|
+
interface EngineServerSubscriptionBookDepthEvent extends EngineServerSubscriptionBaseEvent<'book_depth'> {
|
|
42
|
+
last_max_timestamp: string;
|
|
43
|
+
min_timestamp: string;
|
|
44
|
+
max_timestamp: string;
|
|
45
|
+
bids: EngineServerPriceTickLiquidity[];
|
|
46
|
+
asks: EngineServerPriceTickLiquidity[];
|
|
47
|
+
}
|
|
37
48
|
/**
|
|
38
49
|
* Event from subscribing to a `fill` stream.
|
|
39
50
|
*/
|
|
40
|
-
interface EngineServerSubscriptionFillEvent {
|
|
51
|
+
interface EngineServerSubscriptionFillEvent extends EngineServerSubscriptionBaseEvent<'fill'> {
|
|
41
52
|
timestamp: string;
|
|
42
|
-
product_id: number;
|
|
43
53
|
subaccount: string;
|
|
44
54
|
order_digest: string;
|
|
45
55
|
filled_qty: string;
|
|
46
56
|
remaining_qty: string;
|
|
57
|
+
original_qty: string;
|
|
47
58
|
price: string;
|
|
48
59
|
is_taker: boolean;
|
|
60
|
+
is_bid: boolean;
|
|
61
|
+
fee: string;
|
|
62
|
+
submission_idx: string;
|
|
63
|
+
appendix: string;
|
|
49
64
|
}
|
|
50
65
|
/**
|
|
51
66
|
* Event from subscribing to a `position_change` stream.
|
|
52
67
|
*/
|
|
53
|
-
interface EngineServerSubscriptionPositionChangeEvent {
|
|
68
|
+
interface EngineServerSubscriptionPositionChangeEvent extends EngineServerSubscriptionBaseEvent<'position_change'> {
|
|
54
69
|
timestamp: string;
|
|
55
|
-
product_id: number;
|
|
56
70
|
subaccount: string;
|
|
57
71
|
amount: string;
|
|
72
|
+
/** Zero for everything except perps */
|
|
58
73
|
v_quote_amount: string;
|
|
74
|
+
reason: PositionChangeReason;
|
|
59
75
|
}
|
|
60
76
|
/**
|
|
61
|
-
* Event from subscribing to
|
|
77
|
+
* Event from subscribing to an `order_update` stream.
|
|
62
78
|
*/
|
|
63
|
-
interface
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
79
|
+
interface EngineServerSubscriptionOrderUpdateEvent extends EngineServerSubscriptionBaseEvent<'order_update'> {
|
|
80
|
+
timestamp: string;
|
|
81
|
+
order: EngineServerOrder;
|
|
82
|
+
reason: OrderUpdateReason;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Event from subscribing to a `liquidation` stream.
|
|
86
|
+
*/
|
|
87
|
+
interface EngineServerSubscriptionLiquidationEvent extends EngineServerSubscriptionBaseEvent<'liquidation'> {
|
|
88
|
+
timestamp: string;
|
|
89
|
+
/** Single element for regular liquidations, two elements for spread liquidations [spotId, perpId] */
|
|
90
|
+
product_ids: number[];
|
|
91
|
+
liquidator: string;
|
|
92
|
+
liquidatee: string;
|
|
93
|
+
/** Amount liquidated (positive for long, negative for short) */
|
|
94
|
+
amount: string;
|
|
95
|
+
/** Price at which liquidation occurred */
|
|
96
|
+
price: string;
|
|
69
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Event from subscribing to a `latest_candlestick` stream.
|
|
100
|
+
*/
|
|
101
|
+
interface EngineServerSubscriptionLatestCandlestickEvent extends EngineServerSubscriptionBaseEvent<'latest_candlestick'> {
|
|
102
|
+
timestamp: string;
|
|
103
|
+
granularity: number;
|
|
104
|
+
open_x18: string;
|
|
105
|
+
high_x18: string;
|
|
106
|
+
low_x18: string;
|
|
107
|
+
close_x18: string;
|
|
108
|
+
volume: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Event from subscribing to a `funding_payment` stream.
|
|
112
|
+
*/
|
|
113
|
+
interface EngineServerSubscriptionFundingPaymentEvent extends EngineServerSubscriptionBaseEvent<'funding_payment'> {
|
|
114
|
+
timestamp: string;
|
|
115
|
+
/** Funding payment amount (positive = receive, negative = pay) */
|
|
116
|
+
payment_amount: string;
|
|
117
|
+
/** Open interest at time of funding */
|
|
118
|
+
open_interest: string;
|
|
119
|
+
/** Current cumulative funding values */
|
|
120
|
+
cumulative_funding_long_x18: string;
|
|
121
|
+
cumulative_funding_short_x18: string;
|
|
122
|
+
/** Time delta over which the funding payment was calculated */
|
|
123
|
+
dt: string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Union type for all engine server subscription events.
|
|
127
|
+
*/
|
|
128
|
+
type EngineServerSubscriptionEvent = EngineServerSubscriptionTradeEvent | EngineServerSubscriptionBestBidOfferEvent | EngineServerSubscriptionBookDepthEvent | EngineServerSubscriptionFillEvent | EngineServerSubscriptionPositionChangeEvent | EngineServerSubscriptionOrderUpdateEvent | EngineServerSubscriptionLiquidationEvent | EngineServerSubscriptionLatestCandlestickEvent | EngineServerSubscriptionFundingPaymentEvent;
|
|
70
129
|
|
|
71
|
-
export type { EngineServerSubscriptionBestBidOfferEvent, EngineServerSubscriptionBookDepthEvent, EngineServerSubscriptionFillEvent, EngineServerSubscriptionOrderUpdateEvent, EngineServerSubscriptionPositionChangeEvent, EngineServerSubscriptionTradeEvent };
|
|
130
|
+
export type { EngineServerSubscriptionBaseEvent, EngineServerSubscriptionBestBidOfferEvent, EngineServerSubscriptionBookDepthEvent, EngineServerSubscriptionEvent, EngineServerSubscriptionEventType, EngineServerSubscriptionFillEvent, EngineServerSubscriptionFundingPaymentEvent, EngineServerSubscriptionLatestCandlestickEvent, EngineServerSubscriptionLiquidationEvent, EngineServerSubscriptionOrderUpdateEvent, EngineServerSubscriptionPositionChangeEvent, EngineServerSubscriptionTradeEvent, OrderUpdateReason, PositionChangeReason };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/serverSubscriptionTypes.ts"],"sourcesContent":["export interface EngineServerOrderUpdateStreamParams {\n product_id
|
|
1
|
+
{"version":3,"sources":["../../src/types/serverSubscriptionTypes.ts"],"sourcesContent":["export interface EngineServerOrderUpdateStreamParams {\n /** when not provided, subscribes to all products */\n product_id?: number;\n subaccount: string;\n}\n\nexport interface EngineServerTradeStreamParams {\n product_id: number;\n}\n\nexport interface EngineServerBestBidOfferStreamParams {\n product_id: number;\n}\n\nexport interface EngineServerFillStreamParams {\n /** when not provided, subscribes to all products */\n product_id?: number;\n subaccount: string;\n}\n\nexport interface EngineServerPositionChangeStreamParams {\n /** when not provided, subscribes to all products */\n product_id?: number;\n subaccount: string;\n}\n\nexport interface EngineServerBookDepthStreamParams {\n product_id: number;\n}\n\nexport interface EngineServerLatestCandlestickStreamParams {\n product_id: number;\n granularity: number;\n}\n\nexport interface EngineServerLiquidationStreamParams {\n /** when not provided, subscribes to all products */\n product_id?: number;\n}\n\nexport interface EngineServerFundingPaymentStreamParams {\n product_id: number;\n}\n\n/**\n * Available subscription streams\n */\nexport interface EngineServerSubscriptionStreamParamsByType {\n order_update: EngineServerOrderUpdateStreamParams;\n trade: EngineServerTradeStreamParams;\n best_bid_offer: EngineServerBestBidOfferStreamParams;\n fill: EngineServerFillStreamParams;\n position_change: EngineServerPositionChangeStreamParams;\n book_depth: EngineServerBookDepthStreamParams;\n liquidation: EngineServerLiquidationStreamParams;\n latest_candlestick: EngineServerLatestCandlestickStreamParams;\n funding_payment: EngineServerFundingPaymentStreamParams;\n}\n\nexport type EngineServerSubscriptionStreamParamsType =\n keyof EngineServerSubscriptionStreamParamsByType;\n\n/**\n * Describes a stream that can be subscribed to.\n */\nexport type EngineServerSubscriptionStream<\n TStreamType extends EngineServerSubscriptionStreamParamsType,\n> = {\n type: TStreamType;\n} & EngineServerSubscriptionStreamParamsByType[TStreamType];\n\n/**\n * Params to provide to a `subscribe` / `unsubscribe` action.\n */\nexport interface EngineServerSubscriptionParams {\n stream: EngineServerSubscriptionStream<EngineServerSubscriptionStreamParamsType>;\n}\n\n/**\n * Available actions on the subscription API.\n */\nexport interface EngineServerSubscriptionRequestByType {\n subscribe: EngineServerSubscriptionParams;\n unsubscribe: EngineServerSubscriptionParams;\n list: Record<string, never>;\n}\n\nexport type EngineServerSubscriptionRequestType =\n keyof EngineServerSubscriptionRequestByType;\n\n/**\n * Top level request to send to the server.\n */\nexport type EngineServerSubscriptionRequest<\n TRequestType extends EngineServerSubscriptionRequestType,\n> = {\n id: number;\n method: TRequestType;\n} & EngineServerSubscriptionRequestByType[TRequestType];\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
interface EngineServerOrderUpdateStreamParams {
|
|
2
|
-
|
|
2
|
+
/** when not provided, subscribes to all products */
|
|
3
|
+
product_id?: number;
|
|
3
4
|
subaccount: string;
|
|
4
5
|
}
|
|
5
6
|
interface EngineServerTradeStreamParams {
|
|
@@ -9,16 +10,29 @@ interface EngineServerBestBidOfferStreamParams {
|
|
|
9
10
|
product_id: number;
|
|
10
11
|
}
|
|
11
12
|
interface EngineServerFillStreamParams {
|
|
12
|
-
|
|
13
|
+
/** when not provided, subscribes to all products */
|
|
14
|
+
product_id?: number;
|
|
13
15
|
subaccount: string;
|
|
14
16
|
}
|
|
15
17
|
interface EngineServerPositionChangeStreamParams {
|
|
16
|
-
|
|
18
|
+
/** when not provided, subscribes to all products */
|
|
19
|
+
product_id?: number;
|
|
17
20
|
subaccount: string;
|
|
18
21
|
}
|
|
19
22
|
interface EngineServerBookDepthStreamParams {
|
|
20
23
|
product_id: number;
|
|
21
24
|
}
|
|
25
|
+
interface EngineServerLatestCandlestickStreamParams {
|
|
26
|
+
product_id: number;
|
|
27
|
+
granularity: number;
|
|
28
|
+
}
|
|
29
|
+
interface EngineServerLiquidationStreamParams {
|
|
30
|
+
/** when not provided, subscribes to all products */
|
|
31
|
+
product_id?: number;
|
|
32
|
+
}
|
|
33
|
+
interface EngineServerFundingPaymentStreamParams {
|
|
34
|
+
product_id: number;
|
|
35
|
+
}
|
|
22
36
|
/**
|
|
23
37
|
* Available subscription streams
|
|
24
38
|
*/
|
|
@@ -29,6 +43,9 @@ interface EngineServerSubscriptionStreamParamsByType {
|
|
|
29
43
|
fill: EngineServerFillStreamParams;
|
|
30
44
|
position_change: EngineServerPositionChangeStreamParams;
|
|
31
45
|
book_depth: EngineServerBookDepthStreamParams;
|
|
46
|
+
liquidation: EngineServerLiquidationStreamParams;
|
|
47
|
+
latest_candlestick: EngineServerLatestCandlestickStreamParams;
|
|
48
|
+
funding_payment: EngineServerFundingPaymentStreamParams;
|
|
32
49
|
}
|
|
33
50
|
type EngineServerSubscriptionStreamParamsType = keyof EngineServerSubscriptionStreamParamsByType;
|
|
34
51
|
/**
|
|
@@ -60,4 +77,4 @@ type EngineServerSubscriptionRequest<TRequestType extends EngineServerSubscripti
|
|
|
60
77
|
method: TRequestType;
|
|
61
78
|
} & EngineServerSubscriptionRequestByType[TRequestType];
|
|
62
79
|
|
|
63
|
-
export type { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams };
|
|
80
|
+
export type { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerFundingPaymentStreamParams, EngineServerLatestCandlestickStreamParams, EngineServerLiquidationStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
interface EngineServerOrderUpdateStreamParams {
|
|
2
|
-
|
|
2
|
+
/** when not provided, subscribes to all products */
|
|
3
|
+
product_id?: number;
|
|
3
4
|
subaccount: string;
|
|
4
5
|
}
|
|
5
6
|
interface EngineServerTradeStreamParams {
|
|
@@ -9,16 +10,29 @@ interface EngineServerBestBidOfferStreamParams {
|
|
|
9
10
|
product_id: number;
|
|
10
11
|
}
|
|
11
12
|
interface EngineServerFillStreamParams {
|
|
12
|
-
|
|
13
|
+
/** when not provided, subscribes to all products */
|
|
14
|
+
product_id?: number;
|
|
13
15
|
subaccount: string;
|
|
14
16
|
}
|
|
15
17
|
interface EngineServerPositionChangeStreamParams {
|
|
16
|
-
|
|
18
|
+
/** when not provided, subscribes to all products */
|
|
19
|
+
product_id?: number;
|
|
17
20
|
subaccount: string;
|
|
18
21
|
}
|
|
19
22
|
interface EngineServerBookDepthStreamParams {
|
|
20
23
|
product_id: number;
|
|
21
24
|
}
|
|
25
|
+
interface EngineServerLatestCandlestickStreamParams {
|
|
26
|
+
product_id: number;
|
|
27
|
+
granularity: number;
|
|
28
|
+
}
|
|
29
|
+
interface EngineServerLiquidationStreamParams {
|
|
30
|
+
/** when not provided, subscribes to all products */
|
|
31
|
+
product_id?: number;
|
|
32
|
+
}
|
|
33
|
+
interface EngineServerFundingPaymentStreamParams {
|
|
34
|
+
product_id: number;
|
|
35
|
+
}
|
|
22
36
|
/**
|
|
23
37
|
* Available subscription streams
|
|
24
38
|
*/
|
|
@@ -29,6 +43,9 @@ interface EngineServerSubscriptionStreamParamsByType {
|
|
|
29
43
|
fill: EngineServerFillStreamParams;
|
|
30
44
|
position_change: EngineServerPositionChangeStreamParams;
|
|
31
45
|
book_depth: EngineServerBookDepthStreamParams;
|
|
46
|
+
liquidation: EngineServerLiquidationStreamParams;
|
|
47
|
+
latest_candlestick: EngineServerLatestCandlestickStreamParams;
|
|
48
|
+
funding_payment: EngineServerFundingPaymentStreamParams;
|
|
32
49
|
}
|
|
33
50
|
type EngineServerSubscriptionStreamParamsType = keyof EngineServerSubscriptionStreamParamsByType;
|
|
34
51
|
/**
|
|
@@ -60,4 +77,4 @@ type EngineServerSubscriptionRequest<TRequestType extends EngineServerSubscripti
|
|
|
60
77
|
method: TRequestType;
|
|
61
78
|
} & EngineServerSubscriptionRequestByType[TRequestType];
|
|
62
79
|
|
|
63
|
-
export type { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams };
|
|
80
|
+
export type { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerFundingPaymentStreamParams, EngineServerLatestCandlestickStreamParams, EngineServerLiquidationStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams };
|
package/dist/utils/index.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { mapEngineMarketPrice, mapEngineServerBalanceHealthContributions, mapEngineServerIsolatedPositions, mapEngineServerOrder, mapEngineServerPerpProduct, mapEngineServerSpotProduct, mapEngineServerSymbol, mapEngineServerSymbols, mapEngineServerTickLiquidity, mapSubaccountSummary } from './queryDataMappers.cjs';
|
|
2
|
-
import '@nadohq/
|
|
2
|
+
import '@nadohq/shared';
|
|
3
3
|
import '../types/clientQueryTypes.cjs';
|
|
4
|
-
import '@nadohq/utils';
|
|
5
4
|
import '../types/serverQueryTypes.cjs';
|
|
6
5
|
import '../types/serverQueryModelTypes.cjs';
|