@nadohq/engine-client 0.1.0-alpha.5 → 0.1.0-alpha.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/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/serverSubscriptionEventTypes.cjs.map +1 -1
- package/dist/types/serverSubscriptionEventTypes.d.cts +81 -22
- package/dist/types/serverSubscriptionEventTypes.d.ts +81 -22
- package/dist/types/serverSubscriptionTypes.cjs.map +1 -1
- package/dist/types/serverSubscriptionTypes.d.cts +17 -2
- package/dist/types/serverSubscriptionTypes.d.ts +17 -2
- package/package.json +3 -3
- package/src/types/serverSubscriptionEventTypes.ts +126 -21
- package/src/types/serverSubscriptionTypes.ts +19 -1
package/dist/index.d.cts
CHANGED
|
@@ -3,8 +3,8 @@ export { EngineBurnNlpParams, EngineCancelAndPlaceParams, EngineCancelOrdersPara
|
|
|
3
3
|
export { 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 } from './types/serverQueryTypes.cjs';
|
|
4
4
|
export { EngineServerBookInfo, EngineServerHealthBreakdown, EngineServerPerpBalance, EngineServerPerpBalanceData, EngineServerPerpProduct, EngineServerPerpState, EngineServerProductType, EngineServerRisk, EngineServerSpotBalance, EngineServerSpotBalanceData, EngineServerSpotConfig, EngineServerSpotProduct, EngineServerSpotState } from './types/serverQueryModelTypes.cjs';
|
|
5
5
|
export { EngineServerCancelOrdersParams, EngineServerCancelOrdersResponse, EngineServerExecuteFailureResult, EngineServerExecutePlaceOrderPayload, EngineServerExecuteRequestByType, EngineServerExecuteRequestType, EngineServerExecuteResponseDataByType, EngineServerExecuteResult, EngineServerExecuteSuccessResult, EngineServerPlaceOrderParams, EngineServerPlaceOrderResponse, EngineServerPlaceOrdersResponse, EngineServiceCancelAndPlaceParams } from './types/serverExecuteTypes.cjs';
|
|
6
|
-
export { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams } from './types/serverSubscriptionTypes.cjs';
|
|
7
|
-
export { EngineServerSubscriptionBestBidOfferEvent, EngineServerSubscriptionBookDepthEvent, EngineServerSubscriptionFillEvent, EngineServerSubscriptionOrderUpdateEvent, EngineServerSubscriptionPositionChangeEvent, EngineServerSubscriptionTradeEvent } from './types/serverSubscriptionEventTypes.cjs';
|
|
6
|
+
export { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerFundingPaymentStreamParams, EngineServerLatestCandlestickStreamParams, EngineServerLiquidationStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams } from './types/serverSubscriptionTypes.cjs';
|
|
7
|
+
export { EngineServerSubscriptionBaseEvent, EngineServerSubscriptionBestBidOfferEvent, EngineServerSubscriptionBookDepthEvent, EngineServerSubscriptionEvent, EngineServerSubscriptionEventType, EngineServerSubscriptionFillEvent, EngineServerSubscriptionFundingPaymentEvent, EngineServerSubscriptionLatestCandlestickEvent, EngineServerSubscriptionLiquidationEvent, EngineServerSubscriptionOrderUpdateEvent, EngineServerSubscriptionPositionChangeEvent, EngineServerSubscriptionTradeEvent, OrderUpdateReason, PositionChangeReason } from './types/serverSubscriptionEventTypes.cjs';
|
|
8
8
|
export { EngineServerFailureError } from './types/EngineServerFailureError.cjs';
|
|
9
9
|
export { EngineClient } from './EngineClient.cjs';
|
|
10
10
|
export { ENGINE_CLIENT_ENDPOINTS, ENGINE_WS_CLIENT_ENDPOINTS, ENGINE_WS_SUBSCRIPTION_CLIENT_ENDPOINTS } from './endpoints.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ export { EngineBurnNlpParams, EngineCancelAndPlaceParams, EngineCancelOrdersPara
|
|
|
3
3
|
export { 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 } from './types/serverQueryTypes.js';
|
|
4
4
|
export { EngineServerBookInfo, EngineServerHealthBreakdown, EngineServerPerpBalance, EngineServerPerpBalanceData, EngineServerPerpProduct, EngineServerPerpState, EngineServerProductType, EngineServerRisk, EngineServerSpotBalance, EngineServerSpotBalanceData, EngineServerSpotConfig, EngineServerSpotProduct, EngineServerSpotState } from './types/serverQueryModelTypes.js';
|
|
5
5
|
export { EngineServerCancelOrdersParams, EngineServerCancelOrdersResponse, EngineServerExecuteFailureResult, EngineServerExecutePlaceOrderPayload, EngineServerExecuteRequestByType, EngineServerExecuteRequestType, EngineServerExecuteResponseDataByType, EngineServerExecuteResult, EngineServerExecuteSuccessResult, EngineServerPlaceOrderParams, EngineServerPlaceOrderResponse, EngineServerPlaceOrdersResponse, EngineServiceCancelAndPlaceParams } from './types/serverExecuteTypes.js';
|
|
6
|
-
export { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams } from './types/serverSubscriptionTypes.js';
|
|
7
|
-
export { EngineServerSubscriptionBestBidOfferEvent, EngineServerSubscriptionBookDepthEvent, EngineServerSubscriptionFillEvent, EngineServerSubscriptionOrderUpdateEvent, EngineServerSubscriptionPositionChangeEvent, EngineServerSubscriptionTradeEvent } from './types/serverSubscriptionEventTypes.js';
|
|
6
|
+
export { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerFundingPaymentStreamParams, EngineServerLatestCandlestickStreamParams, EngineServerLiquidationStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams } from './types/serverSubscriptionTypes.js';
|
|
7
|
+
export { EngineServerSubscriptionBaseEvent, EngineServerSubscriptionBestBidOfferEvent, EngineServerSubscriptionBookDepthEvent, EngineServerSubscriptionEvent, EngineServerSubscriptionEventType, EngineServerSubscriptionFillEvent, EngineServerSubscriptionFundingPaymentEvent, EngineServerSubscriptionLatestCandlestickEvent, EngineServerSubscriptionLiquidationEvent, EngineServerSubscriptionOrderUpdateEvent, EngineServerSubscriptionPositionChangeEvent, EngineServerSubscriptionTradeEvent, OrderUpdateReason, PositionChangeReason } from './types/serverSubscriptionEventTypes.js';
|
|
8
8
|
export { EngineServerFailureError } from './types/EngineServerFailureError.js';
|
|
9
9
|
export { EngineClient } from './EngineClient.js';
|
|
10
10
|
export { ENGINE_CLIENT_ENDPOINTS, ENGINE_WS_CLIENT_ENDPOINTS, ENGINE_WS_SUBSCRIPTION_CLIENT_ENDPOINTS } from './endpoints.js';
|
package/dist/types/index.d.cts
CHANGED
|
@@ -3,7 +3,7 @@ export { EngineBurnNlpParams, EngineCancelAndPlaceParams, EngineCancelOrdersPara
|
|
|
3
3
|
export { 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 } from './serverQueryTypes.cjs';
|
|
4
4
|
export { EngineServerBookInfo, EngineServerHealthBreakdown, EngineServerPerpBalance, EngineServerPerpBalanceData, EngineServerPerpProduct, EngineServerPerpState, EngineServerProductType, EngineServerRisk, EngineServerSpotBalance, EngineServerSpotBalanceData, EngineServerSpotConfig, EngineServerSpotProduct, EngineServerSpotState } from './serverQueryModelTypes.cjs';
|
|
5
5
|
export { EngineServerCancelOrdersParams, EngineServerCancelOrdersResponse, EngineServerExecuteFailureResult, EngineServerExecutePlaceOrderPayload, EngineServerExecuteRequestByType, EngineServerExecuteRequestType, EngineServerExecuteResponseDataByType, EngineServerExecuteResult, EngineServerExecuteSuccessResult, EngineServerPlaceOrderParams, EngineServerPlaceOrderResponse, EngineServerPlaceOrdersResponse, EngineServiceCancelAndPlaceParams } from './serverExecuteTypes.cjs';
|
|
6
|
-
export { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams } from './serverSubscriptionTypes.cjs';
|
|
7
|
-
export { EngineServerSubscriptionBestBidOfferEvent, EngineServerSubscriptionBookDepthEvent, EngineServerSubscriptionFillEvent, EngineServerSubscriptionOrderUpdateEvent, EngineServerSubscriptionPositionChangeEvent, EngineServerSubscriptionTradeEvent } from './serverSubscriptionEventTypes.cjs';
|
|
6
|
+
export { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerFundingPaymentStreamParams, EngineServerLatestCandlestickStreamParams, EngineServerLiquidationStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams } from './serverSubscriptionTypes.cjs';
|
|
7
|
+
export { EngineServerSubscriptionBaseEvent, EngineServerSubscriptionBestBidOfferEvent, EngineServerSubscriptionBookDepthEvent, EngineServerSubscriptionEvent, EngineServerSubscriptionEventType, EngineServerSubscriptionFillEvent, EngineServerSubscriptionFundingPaymentEvent, EngineServerSubscriptionLatestCandlestickEvent, EngineServerSubscriptionLiquidationEvent, EngineServerSubscriptionOrderUpdateEvent, EngineServerSubscriptionPositionChangeEvent, EngineServerSubscriptionTradeEvent, OrderUpdateReason, PositionChangeReason } from './serverSubscriptionEventTypes.cjs';
|
|
8
8
|
export { EngineServerFailureError } from './EngineServerFailureError.cjs';
|
|
9
9
|
import '@nadohq/shared';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { EngineBurnNlpParams, EngineCancelAndPlaceParams, EngineCancelOrdersPara
|
|
|
3
3
|
export { 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 } from './serverQueryTypes.js';
|
|
4
4
|
export { EngineServerBookInfo, EngineServerHealthBreakdown, EngineServerPerpBalance, EngineServerPerpBalanceData, EngineServerPerpProduct, EngineServerPerpState, EngineServerProductType, EngineServerRisk, EngineServerSpotBalance, EngineServerSpotBalanceData, EngineServerSpotConfig, EngineServerSpotProduct, EngineServerSpotState } from './serverQueryModelTypes.js';
|
|
5
5
|
export { EngineServerCancelOrdersParams, EngineServerCancelOrdersResponse, EngineServerExecuteFailureResult, EngineServerExecutePlaceOrderPayload, EngineServerExecuteRequestByType, EngineServerExecuteRequestType, EngineServerExecuteResponseDataByType, EngineServerExecuteResult, EngineServerExecuteSuccessResult, EngineServerPlaceOrderParams, EngineServerPlaceOrderResponse, EngineServerPlaceOrdersResponse, EngineServiceCancelAndPlaceParams } from './serverExecuteTypes.js';
|
|
6
|
-
export { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams } from './serverSubscriptionTypes.js';
|
|
7
|
-
export { EngineServerSubscriptionBestBidOfferEvent, EngineServerSubscriptionBookDepthEvent, EngineServerSubscriptionFillEvent, EngineServerSubscriptionOrderUpdateEvent, EngineServerSubscriptionPositionChangeEvent, EngineServerSubscriptionTradeEvent } from './serverSubscriptionEventTypes.js';
|
|
6
|
+
export { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerFundingPaymentStreamParams, EngineServerLatestCandlestickStreamParams, EngineServerLiquidationStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams } from './serverSubscriptionTypes.js';
|
|
7
|
+
export { EngineServerSubscriptionBaseEvent, EngineServerSubscriptionBestBidOfferEvent, EngineServerSubscriptionBookDepthEvent, EngineServerSubscriptionEvent, EngineServerSubscriptionEventType, EngineServerSubscriptionFillEvent, EngineServerSubscriptionFundingPaymentEvent, EngineServerSubscriptionLatestCandlestickEvent, EngineServerSubscriptionLiquidationEvent, EngineServerSubscriptionOrderUpdateEvent, EngineServerSubscriptionPositionChangeEvent, EngineServerSubscriptionTradeEvent, OrderUpdateReason, PositionChangeReason } from './serverSubscriptionEventTypes.js';
|
|
8
8
|
export { EngineServerFailureError } from './EngineServerFailureError.js';
|
|
9
9
|
import '@nadohq/shared';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/serverSubscriptionEventTypes.ts"],"sourcesContent":["import { EngineServerPriceTickLiquidity } from './serverQueryTypes';\n\n/**\n * Event from subscribing to a `
|
|
1
|
+
{"version":3,"sources":["../../src/types/serverSubscriptionEventTypes.ts"],"sourcesContent":["import { EngineServerPriceTickLiquidity } 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}\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 digest: string;\n amount: string;\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":[]}
|
|
@@ -3,21 +3,23 @@ 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;
|
|
49
63
|
}
|
|
50
64
|
/**
|
|
51
65
|
* Event from subscribing to a `position_change` stream.
|
|
52
66
|
*/
|
|
53
|
-
interface EngineServerSubscriptionPositionChangeEvent {
|
|
67
|
+
interface EngineServerSubscriptionPositionChangeEvent extends EngineServerSubscriptionBaseEvent<'position_change'> {
|
|
54
68
|
timestamp: string;
|
|
55
|
-
product_id: number;
|
|
56
69
|
subaccount: string;
|
|
57
70
|
amount: string;
|
|
71
|
+
/** Zero for everything except perps */
|
|
58
72
|
v_quote_amount: string;
|
|
73
|
+
reason: PositionChangeReason;
|
|
59
74
|
}
|
|
60
75
|
/**
|
|
61
|
-
* Event from subscribing to
|
|
76
|
+
* Event from subscribing to an `order_update` stream.
|
|
62
77
|
*/
|
|
63
|
-
interface
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
78
|
+
interface EngineServerSubscriptionOrderUpdateEvent extends EngineServerSubscriptionBaseEvent<'order_update'> {
|
|
79
|
+
timestamp: string;
|
|
80
|
+
digest: string;
|
|
81
|
+
amount: string;
|
|
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 };
|
|
@@ -3,21 +3,23 @@ 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;
|
|
49
63
|
}
|
|
50
64
|
/**
|
|
51
65
|
* Event from subscribing to a `position_change` stream.
|
|
52
66
|
*/
|
|
53
|
-
interface EngineServerSubscriptionPositionChangeEvent {
|
|
67
|
+
interface EngineServerSubscriptionPositionChangeEvent extends EngineServerSubscriptionBaseEvent<'position_change'> {
|
|
54
68
|
timestamp: string;
|
|
55
|
-
product_id: number;
|
|
56
69
|
subaccount: string;
|
|
57
70
|
amount: string;
|
|
71
|
+
/** Zero for everything except perps */
|
|
58
72
|
v_quote_amount: string;
|
|
73
|
+
reason: PositionChangeReason;
|
|
59
74
|
}
|
|
60
75
|
/**
|
|
61
|
-
* Event from subscribing to
|
|
76
|
+
* Event from subscribing to an `order_update` stream.
|
|
62
77
|
*/
|
|
63
|
-
interface
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
78
|
+
interface EngineServerSubscriptionOrderUpdateEvent extends EngineServerSubscriptionBaseEvent<'order_update'> {
|
|
79
|
+
timestamp: string;
|
|
80
|
+
digest: string;
|
|
81
|
+
amount: string;
|
|
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: 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 product_id: number;\n subaccount: string;\n}\n\nexport interface EngineServerPositionChangeStreamParams {\n product_id
|
|
1
|
+
{"version":3,"sources":["../../src/types/serverSubscriptionTypes.ts"],"sourcesContent":["export interface EngineServerOrderUpdateStreamParams {\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 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":[]}
|
|
@@ -13,12 +13,24 @@ interface EngineServerFillStreamParams {
|
|
|
13
13
|
subaccount: string;
|
|
14
14
|
}
|
|
15
15
|
interface EngineServerPositionChangeStreamParams {
|
|
16
|
-
|
|
16
|
+
/** when not provided, subscribes to all products */
|
|
17
|
+
product_id?: number;
|
|
17
18
|
subaccount: string;
|
|
18
19
|
}
|
|
19
20
|
interface EngineServerBookDepthStreamParams {
|
|
20
21
|
product_id: number;
|
|
21
22
|
}
|
|
23
|
+
interface EngineServerLatestCandlestickStreamParams {
|
|
24
|
+
product_id: number;
|
|
25
|
+
granularity: number;
|
|
26
|
+
}
|
|
27
|
+
interface EngineServerLiquidationStreamParams {
|
|
28
|
+
/** when not provided, subscribes to all products */
|
|
29
|
+
product_id?: number;
|
|
30
|
+
}
|
|
31
|
+
interface EngineServerFundingPaymentStreamParams {
|
|
32
|
+
product_id: number;
|
|
33
|
+
}
|
|
22
34
|
/**
|
|
23
35
|
* Available subscription streams
|
|
24
36
|
*/
|
|
@@ -29,6 +41,9 @@ interface EngineServerSubscriptionStreamParamsByType {
|
|
|
29
41
|
fill: EngineServerFillStreamParams;
|
|
30
42
|
position_change: EngineServerPositionChangeStreamParams;
|
|
31
43
|
book_depth: EngineServerBookDepthStreamParams;
|
|
44
|
+
liquidation: EngineServerLiquidationStreamParams;
|
|
45
|
+
latest_candlestick: EngineServerLatestCandlestickStreamParams;
|
|
46
|
+
funding_payment: EngineServerFundingPaymentStreamParams;
|
|
32
47
|
}
|
|
33
48
|
type EngineServerSubscriptionStreamParamsType = keyof EngineServerSubscriptionStreamParamsByType;
|
|
34
49
|
/**
|
|
@@ -60,4 +75,4 @@ type EngineServerSubscriptionRequest<TRequestType extends EngineServerSubscripti
|
|
|
60
75
|
method: TRequestType;
|
|
61
76
|
} & EngineServerSubscriptionRequestByType[TRequestType];
|
|
62
77
|
|
|
63
|
-
export type { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams };
|
|
78
|
+
export type { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerFundingPaymentStreamParams, EngineServerLatestCandlestickStreamParams, EngineServerLiquidationStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams };
|
|
@@ -13,12 +13,24 @@ interface EngineServerFillStreamParams {
|
|
|
13
13
|
subaccount: string;
|
|
14
14
|
}
|
|
15
15
|
interface EngineServerPositionChangeStreamParams {
|
|
16
|
-
|
|
16
|
+
/** when not provided, subscribes to all products */
|
|
17
|
+
product_id?: number;
|
|
17
18
|
subaccount: string;
|
|
18
19
|
}
|
|
19
20
|
interface EngineServerBookDepthStreamParams {
|
|
20
21
|
product_id: number;
|
|
21
22
|
}
|
|
23
|
+
interface EngineServerLatestCandlestickStreamParams {
|
|
24
|
+
product_id: number;
|
|
25
|
+
granularity: number;
|
|
26
|
+
}
|
|
27
|
+
interface EngineServerLiquidationStreamParams {
|
|
28
|
+
/** when not provided, subscribes to all products */
|
|
29
|
+
product_id?: number;
|
|
30
|
+
}
|
|
31
|
+
interface EngineServerFundingPaymentStreamParams {
|
|
32
|
+
product_id: number;
|
|
33
|
+
}
|
|
22
34
|
/**
|
|
23
35
|
* Available subscription streams
|
|
24
36
|
*/
|
|
@@ -29,6 +41,9 @@ interface EngineServerSubscriptionStreamParamsByType {
|
|
|
29
41
|
fill: EngineServerFillStreamParams;
|
|
30
42
|
position_change: EngineServerPositionChangeStreamParams;
|
|
31
43
|
book_depth: EngineServerBookDepthStreamParams;
|
|
44
|
+
liquidation: EngineServerLiquidationStreamParams;
|
|
45
|
+
latest_candlestick: EngineServerLatestCandlestickStreamParams;
|
|
46
|
+
funding_payment: EngineServerFundingPaymentStreamParams;
|
|
32
47
|
}
|
|
33
48
|
type EngineServerSubscriptionStreamParamsType = keyof EngineServerSubscriptionStreamParamsByType;
|
|
34
49
|
/**
|
|
@@ -60,4 +75,4 @@ type EngineServerSubscriptionRequest<TRequestType extends EngineServerSubscripti
|
|
|
60
75
|
method: TRequestType;
|
|
61
76
|
} & EngineServerSubscriptionRequestByType[TRequestType];
|
|
62
77
|
|
|
63
|
-
export type { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams };
|
|
78
|
+
export type { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerFundingPaymentStreamParams, EngineServerLatestCandlestickStreamParams, EngineServerLiquidationStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadohq/engine-client",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "> TODO: description",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@nadohq/shared": "^0.1.0-alpha.
|
|
40
|
+
"@nadohq/shared": "^0.1.0-alpha.7",
|
|
41
41
|
"axios": "*",
|
|
42
42
|
"ts-mixer": "*"
|
|
43
43
|
},
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"viem": "*"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "c6f20e82e8d20e2c7a427b54a1728b6ab8adf058"
|
|
51
51
|
}
|
|
@@ -1,22 +1,48 @@
|
|
|
1
1
|
import { EngineServerPriceTickLiquidity } from './serverQueryTypes';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Reasons that can trigger position change events.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
7
|
-
|
|
6
|
+
export type PositionChangeReason =
|
|
7
|
+
| 'deposit_collateral'
|
|
8
|
+
| 'match_orders'
|
|
9
|
+
| 'withdraw_collateral'
|
|
10
|
+
| 'transfer_quote'
|
|
11
|
+
| 'settle_pnl'
|
|
12
|
+
| 'mint_nlp'
|
|
13
|
+
| 'burn_nlp'
|
|
14
|
+
| 'liquidate_subaccount';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Possible reasons for order updates.
|
|
18
|
+
*/
|
|
19
|
+
export type OrderUpdateReason = 'cancelled' | 'filled' | 'placed';
|
|
20
|
+
|
|
21
|
+
export type EngineServerSubscriptionEventType =
|
|
22
|
+
| 'trade'
|
|
23
|
+
| 'best_bid_offer'
|
|
24
|
+
| 'book_depth'
|
|
25
|
+
| 'fill'
|
|
26
|
+
| 'position_change'
|
|
27
|
+
| 'order_update'
|
|
28
|
+
| 'liquidation'
|
|
29
|
+
| 'latest_candlestick'
|
|
30
|
+
| 'funding_payment';
|
|
31
|
+
|
|
32
|
+
export interface EngineServerSubscriptionBaseEvent<
|
|
33
|
+
T extends
|
|
34
|
+
EngineServerSubscriptionEventType = EngineServerSubscriptionEventType,
|
|
35
|
+
> {
|
|
36
|
+
type: T;
|
|
8
37
|
product_id: number;
|
|
9
|
-
digest: string;
|
|
10
|
-
amount: string;
|
|
11
|
-
reason: string;
|
|
12
38
|
}
|
|
13
39
|
|
|
14
40
|
/**
|
|
15
41
|
* Event from subscribing to a `trade` stream.
|
|
16
42
|
*/
|
|
17
|
-
export interface EngineServerSubscriptionTradeEvent
|
|
43
|
+
export interface EngineServerSubscriptionTradeEvent
|
|
44
|
+
extends EngineServerSubscriptionBaseEvent<'trade'> {
|
|
18
45
|
timestamp: string;
|
|
19
|
-
product_id: number;
|
|
20
46
|
price: string;
|
|
21
47
|
taker_qty: string;
|
|
22
48
|
maker_qty: string;
|
|
@@ -26,49 +52,128 @@ export interface EngineServerSubscriptionTradeEvent {
|
|
|
26
52
|
/**
|
|
27
53
|
* Event from subscribing to a `best_bid_offer` stream.
|
|
28
54
|
*/
|
|
29
|
-
export interface EngineServerSubscriptionBestBidOfferEvent
|
|
55
|
+
export interface EngineServerSubscriptionBestBidOfferEvent
|
|
56
|
+
extends EngineServerSubscriptionBaseEvent<'best_bid_offer'> {
|
|
30
57
|
timestamp: string;
|
|
31
|
-
product_id: number;
|
|
32
58
|
bid_price: string;
|
|
33
59
|
bid_qty: string;
|
|
34
60
|
ask_price: string;
|
|
35
61
|
ask_qty: string;
|
|
36
62
|
}
|
|
37
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Event from subscribing to a `book_depth` stream.
|
|
66
|
+
*/
|
|
67
|
+
export interface EngineServerSubscriptionBookDepthEvent
|
|
68
|
+
extends EngineServerSubscriptionBaseEvent<'book_depth'> {
|
|
69
|
+
last_max_timestamp: string;
|
|
70
|
+
min_timestamp: string;
|
|
71
|
+
max_timestamp: string;
|
|
72
|
+
bids: EngineServerPriceTickLiquidity[];
|
|
73
|
+
asks: EngineServerPriceTickLiquidity[];
|
|
74
|
+
}
|
|
75
|
+
|
|
38
76
|
/**
|
|
39
77
|
* Event from subscribing to a `fill` stream.
|
|
40
78
|
*/
|
|
41
|
-
export interface EngineServerSubscriptionFillEvent
|
|
79
|
+
export interface EngineServerSubscriptionFillEvent
|
|
80
|
+
extends EngineServerSubscriptionBaseEvent<'fill'> {
|
|
42
81
|
// NOTE: `id` is excluded from the response to avoid parsing issues.
|
|
43
82
|
// type of `id` on the backend is `u64` which can overflow until we introduce proper parsing on the SDK.
|
|
44
83
|
timestamp: string;
|
|
45
|
-
product_id: number;
|
|
46
84
|
subaccount: string;
|
|
47
85
|
order_digest: string;
|
|
48
86
|
filled_qty: string;
|
|
49
87
|
remaining_qty: string;
|
|
88
|
+
original_qty: string;
|
|
50
89
|
price: string;
|
|
51
90
|
is_taker: boolean;
|
|
91
|
+
is_bid: boolean;
|
|
92
|
+
fee: string;
|
|
93
|
+
submission_idx: string;
|
|
52
94
|
}
|
|
53
95
|
|
|
54
96
|
/**
|
|
55
97
|
* Event from subscribing to a `position_change` stream.
|
|
56
98
|
*/
|
|
57
|
-
export interface EngineServerSubscriptionPositionChangeEvent
|
|
99
|
+
export interface EngineServerSubscriptionPositionChangeEvent
|
|
100
|
+
extends EngineServerSubscriptionBaseEvent<'position_change'> {
|
|
58
101
|
timestamp: string;
|
|
59
|
-
product_id: number;
|
|
60
102
|
subaccount: string;
|
|
61
103
|
amount: string;
|
|
104
|
+
/** Zero for everything except perps */
|
|
62
105
|
v_quote_amount: string;
|
|
106
|
+
reason: PositionChangeReason;
|
|
63
107
|
}
|
|
64
108
|
|
|
65
109
|
/**
|
|
66
|
-
* Event from subscribing to
|
|
110
|
+
* Event from subscribing to an `order_update` stream.
|
|
67
111
|
*/
|
|
68
|
-
export interface
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
112
|
+
export interface EngineServerSubscriptionOrderUpdateEvent
|
|
113
|
+
extends EngineServerSubscriptionBaseEvent<'order_update'> {
|
|
114
|
+
timestamp: string;
|
|
115
|
+
digest: string;
|
|
116
|
+
amount: string;
|
|
117
|
+
reason: OrderUpdateReason;
|
|
74
118
|
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Event from subscribing to a `liquidation` stream.
|
|
122
|
+
*/
|
|
123
|
+
export interface EngineServerSubscriptionLiquidationEvent
|
|
124
|
+
extends EngineServerSubscriptionBaseEvent<'liquidation'> {
|
|
125
|
+
timestamp: string;
|
|
126
|
+
/** Single element for regular liquidations, two elements for spread liquidations [spotId, perpId] */
|
|
127
|
+
product_ids: number[];
|
|
128
|
+
liquidator: string;
|
|
129
|
+
liquidatee: string;
|
|
130
|
+
/** Amount liquidated (positive for long, negative for short) */
|
|
131
|
+
amount: string;
|
|
132
|
+
/** Price at which liquidation occurred */
|
|
133
|
+
price: string;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Event from subscribing to a `latest_candlestick` stream.
|
|
138
|
+
*/
|
|
139
|
+
export interface EngineServerSubscriptionLatestCandlestickEvent
|
|
140
|
+
extends EngineServerSubscriptionBaseEvent<'latest_candlestick'> {
|
|
141
|
+
timestamp: string;
|
|
142
|
+
granularity: number;
|
|
143
|
+
open_x18: string;
|
|
144
|
+
high_x18: string;
|
|
145
|
+
low_x18: string;
|
|
146
|
+
close_x18: string;
|
|
147
|
+
volume: string;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Event from subscribing to a `funding_payment` stream.
|
|
152
|
+
*/
|
|
153
|
+
export interface EngineServerSubscriptionFundingPaymentEvent
|
|
154
|
+
extends EngineServerSubscriptionBaseEvent<'funding_payment'> {
|
|
155
|
+
timestamp: string;
|
|
156
|
+
/** Funding payment amount (positive = receive, negative = pay) */
|
|
157
|
+
payment_amount: string;
|
|
158
|
+
/** Open interest at time of funding */
|
|
159
|
+
open_interest: string;
|
|
160
|
+
/** Current cumulative funding values */
|
|
161
|
+
cumulative_funding_long_x18: string;
|
|
162
|
+
cumulative_funding_short_x18: string;
|
|
163
|
+
/** Time delta over which the funding payment was calculated */
|
|
164
|
+
dt: string;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Union type for all engine server subscription events.
|
|
169
|
+
*/
|
|
170
|
+
export type EngineServerSubscriptionEvent =
|
|
171
|
+
| EngineServerSubscriptionTradeEvent
|
|
172
|
+
| EngineServerSubscriptionBestBidOfferEvent
|
|
173
|
+
| EngineServerSubscriptionBookDepthEvent
|
|
174
|
+
| EngineServerSubscriptionFillEvent
|
|
175
|
+
| EngineServerSubscriptionPositionChangeEvent
|
|
176
|
+
| EngineServerSubscriptionOrderUpdateEvent
|
|
177
|
+
| EngineServerSubscriptionLiquidationEvent
|
|
178
|
+
| EngineServerSubscriptionLatestCandlestickEvent
|
|
179
|
+
| EngineServerSubscriptionFundingPaymentEvent;
|
|
@@ -17,7 +17,8 @@ export interface EngineServerFillStreamParams {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export interface EngineServerPositionChangeStreamParams {
|
|
20
|
-
|
|
20
|
+
/** when not provided, subscribes to all products */
|
|
21
|
+
product_id?: number;
|
|
21
22
|
subaccount: string;
|
|
22
23
|
}
|
|
23
24
|
|
|
@@ -25,6 +26,20 @@ export interface EngineServerBookDepthStreamParams {
|
|
|
25
26
|
product_id: number;
|
|
26
27
|
}
|
|
27
28
|
|
|
29
|
+
export interface EngineServerLatestCandlestickStreamParams {
|
|
30
|
+
product_id: number;
|
|
31
|
+
granularity: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface EngineServerLiquidationStreamParams {
|
|
35
|
+
/** when not provided, subscribes to all products */
|
|
36
|
+
product_id?: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface EngineServerFundingPaymentStreamParams {
|
|
40
|
+
product_id: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
28
43
|
/**
|
|
29
44
|
* Available subscription streams
|
|
30
45
|
*/
|
|
@@ -35,6 +50,9 @@ export interface EngineServerSubscriptionStreamParamsByType {
|
|
|
35
50
|
fill: EngineServerFillStreamParams;
|
|
36
51
|
position_change: EngineServerPositionChangeStreamParams;
|
|
37
52
|
book_depth: EngineServerBookDepthStreamParams;
|
|
53
|
+
liquidation: EngineServerLiquidationStreamParams;
|
|
54
|
+
latest_candlestick: EngineServerLatestCandlestickStreamParams;
|
|
55
|
+
funding_payment: EngineServerFundingPaymentStreamParams;
|
|
38
56
|
}
|
|
39
57
|
|
|
40
58
|
export type EngineServerSubscriptionStreamParamsType =
|