@nadohq/engine-client 0.1.0-alpha.3 → 0.1.0-alpha.30
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 +2 -3
- package/dist/EngineBaseClient.d.ts +2 -3
- 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 +25 -50
- package/dist/EngineExecuteBuilder.cjs.map +1 -1
- package/dist/EngineExecuteBuilder.d.cts +6 -17
- package/dist/EngineExecuteBuilder.d.ts +6 -17
- package/dist/EngineExecuteBuilder.js +15 -40
- package/dist/EngineExecuteBuilder.js.map +1 -1
- package/dist/EngineExecuteClient.cjs +5 -9
- package/dist/EngineExecuteClient.cjs.map +1 -1
- package/dist/EngineExecuteClient.d.cts +3 -4
- package/dist/EngineExecuteClient.d.ts +3 -4
- package/dist/EngineExecuteClient.js +5 -9
- package/dist/EngineExecuteClient.js.map +1 -1
- package/dist/EngineQueryClient.cjs +70 -53
- package/dist/EngineQueryClient.cjs.map +1 -1
- package/dist/EngineQueryClient.d.cts +17 -12
- package/dist/EngineQueryClient.d.ts +17 -12
- package/dist/EngineQueryClient.js +50 -31
- 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.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -12
- package/dist/index.d.ts +11 -12
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- 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 +11 -12
- package/dist/types/clientExecuteTypes.d.ts +11 -12
- package/dist/types/clientQueryTypes.cjs.map +1 -1
- package/dist/types/clientQueryTypes.d.cts +41 -23
- package/dist/types/clientQueryTypes.d.ts +41 -23
- package/dist/types/index.cjs +10 -10
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +8 -9
- package/dist/types/index.d.ts +8 -9
- package/dist/types/index.js +5 -5
- package/dist/types/index.js.map +1 -1
- package/dist/types/serverExecuteTypes.cjs.map +1 -1
- package/dist/types/serverExecuteTypes.d.cts +13 -14
- package/dist/types/serverExecuteTypes.d.ts +13 -14
- package/dist/types/serverQueryModelTypes.cjs.map +1 -1
- package/dist/types/serverQueryModelTypes.d.cts +25 -2
- package/dist/types/serverQueryModelTypes.d.ts +25 -2
- package/dist/types/serverQueryTypes.cjs.map +1 -1
- package/dist/types/serverQueryTypes.d.cts +37 -26
- package/dist/types/serverQueryTypes.d.ts +37 -26
- package/dist/types/serverSubscriptionEventTypes.cjs.map +1 -1
- package/dist/types/serverSubscriptionEventTypes.d.cts +87 -23
- package/dist/types/serverSubscriptionEventTypes.d.ts +87 -23
- 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 +3 -4
- package/dist/utils/index.d.ts +3 -4
- 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 +113 -90
- package/dist/utils/queryDataMappers.cjs.map +1 -1
- package/dist/utils/queryDataMappers.d.cts +6 -5
- package/dist/utils/queryDataMappers.d.ts +6 -5
- package/dist/utils/queryDataMappers.js +39 -19
- package/dist/utils/queryDataMappers.js.map +1 -1
- package/package.json +3 -4
- package/src/EngineBaseClient.ts +5 -3
- package/src/EngineExecuteBuilder.ts +16 -53
- package/src/EngineExecuteClient.ts +5 -13
- package/src/EngineQueryClient.ts +62 -32
- package/src/EngineWebClient.ts +0 -2
- package/src/endpoints.ts +4 -5
- package/src/index.ts +2 -2
- package/src/types/EngineServerFailureError.ts +2 -2
- package/src/types/clientExecuteTypes.ts +12 -17
- package/src/types/clientQueryTypes.ts +57 -32
- package/src/types/index.ts +5 -5
- package/src/types/serverExecuteTypes.ts +14 -18
- package/src/types/serverQueryModelTypes.ts +26 -1
- package/src/types/serverQueryTypes.ts +46 -29
- package/src/types/serverSubscriptionEventTypes.ts +131 -21
- package/src/types/serverSubscriptionTypes.ts +23 -3
- package/src/utils/productEngineTypeMappers.ts +1 -1
- package/src/utils/queryDataMappers.ts +50 -20
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BigDecimal } from '@nadohq/utils';
|
|
1
|
+
import { Subaccount, BalanceWithProduct, HealthStatusByType, BalanceHealthContributions, SpotBalanceWithProduct, PerpBalanceWithProduct, BigDecimal, ProductEngineType, MarketWithProduct, HealthGroup, OrderAppendix, EIP712OrderParams, SignedEIP712OrderParams, BalanceSide } from '@nadohq/shared';
|
|
3
2
|
import { EngineServerNoncesParams, EngineServerTimeResponse } from './serverQueryTypes.js';
|
|
4
3
|
import './serverQueryModelTypes.js';
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
interface GetEngineSubaccountSummaryResponse {
|
|
6
|
+
exists: boolean;
|
|
7
|
+
balances: BalanceWithProduct[];
|
|
8
|
+
health: HealthStatusByType;
|
|
9
|
+
}
|
|
10
|
+
type GetEngineSubaccountSummaryParams = Subaccount;
|
|
8
11
|
type GetEngineIsolatedPositionsParams = Subaccount;
|
|
9
12
|
interface SubaccountIsolatedPosition {
|
|
10
13
|
subaccount: Subaccount;
|
|
@@ -25,12 +28,8 @@ interface SubaccountProductDeltaTx {
|
|
|
25
28
|
interface GetEngineContractsResponse {
|
|
26
29
|
chainId: number;
|
|
27
30
|
endpointAddr: string;
|
|
28
|
-
/**
|
|
29
|
-
* Address for the orderbook contract, with the product ID being the index
|
|
30
|
-
*/
|
|
31
|
-
orderbookAddrs: string[];
|
|
32
31
|
}
|
|
33
|
-
type GetEngineEstimatedSubaccountSummaryParams =
|
|
32
|
+
type GetEngineEstimatedSubaccountSummaryParams = Subaccount & {
|
|
34
33
|
txs: SubaccountTx[];
|
|
35
34
|
};
|
|
36
35
|
type GetEngineNoncesParams = EngineServerNoncesParams;
|
|
@@ -59,7 +58,7 @@ interface EngineSymbol {
|
|
|
59
58
|
longWeightInitial: BigDecimal;
|
|
60
59
|
longWeightMaintenance: BigDecimal;
|
|
61
60
|
}
|
|
62
|
-
type GetEngineAllMarketsResponse =
|
|
61
|
+
type GetEngineAllMarketsResponse = MarketWithProduct[];
|
|
63
62
|
interface GetEngineHealthGroupsResponse {
|
|
64
63
|
healthGroups: HealthGroup[];
|
|
65
64
|
}
|
|
@@ -72,13 +71,11 @@ interface EngineOrder extends Subaccount {
|
|
|
72
71
|
price: BigDecimal;
|
|
73
72
|
totalAmount: BigDecimal;
|
|
74
73
|
unfilledAmount: BigDecimal;
|
|
75
|
-
expiration:
|
|
76
|
-
margin: BigDecimal | null;
|
|
74
|
+
expiration: number;
|
|
77
75
|
nonce: string;
|
|
78
76
|
digest: string;
|
|
79
|
-
orderParams: EIP712OrderParams;
|
|
80
77
|
placementTime: number;
|
|
81
|
-
|
|
78
|
+
appendix: OrderAppendix;
|
|
82
79
|
}
|
|
83
80
|
type GetEngineOrderResponse = EngineOrder;
|
|
84
81
|
interface ValidateSignedEngineOrderParams {
|
|
@@ -87,7 +84,6 @@ interface ValidateSignedEngineOrderParams {
|
|
|
87
84
|
}
|
|
88
85
|
interface ValidateEngineOrderParams {
|
|
89
86
|
productId: number;
|
|
90
|
-
orderbookAddr: string;
|
|
91
87
|
chainId: number;
|
|
92
88
|
order: EIP712OrderParams;
|
|
93
89
|
}
|
|
@@ -120,6 +116,7 @@ interface GetEngineSubaccountFeeRatesResponse {
|
|
|
120
116
|
liquidationSequencerFee: BigDecimal;
|
|
121
117
|
healthCheckSequencerFee: BigDecimal;
|
|
122
118
|
takerSequencerFee: BigDecimal;
|
|
119
|
+
feeTier: number;
|
|
123
120
|
}
|
|
124
121
|
interface EnginePriceTickLiquidity {
|
|
125
122
|
price: BigDecimal;
|
|
@@ -154,6 +151,8 @@ interface GetEngineMaxOrderSizeParams extends Subaccount {
|
|
|
154
151
|
side: BalanceSide;
|
|
155
152
|
spotLeverage?: boolean;
|
|
156
153
|
reduceOnly?: boolean;
|
|
154
|
+
isolated?: boolean;
|
|
155
|
+
isoBorrowMargin?: boolean;
|
|
157
156
|
}
|
|
158
157
|
type GetEngineMaxOrderSizeResponse = BigDecimal;
|
|
159
158
|
interface GetEngineMaxWithdrawableParams extends Subaccount {
|
|
@@ -167,13 +166,6 @@ interface GetEngineLinkedSignerResponse {
|
|
|
167
166
|
signer: string;
|
|
168
167
|
}
|
|
169
168
|
type GetEngineInsuranceResponse = BigDecimal;
|
|
170
|
-
interface EngineMinDepositRate {
|
|
171
|
-
productId: number;
|
|
172
|
-
minDepositRate: BigDecimal;
|
|
173
|
-
}
|
|
174
|
-
interface GetEngineMinDepositRatesResponse {
|
|
175
|
-
minDepositRates: Record<number, EngineMinDepositRate>;
|
|
176
|
-
}
|
|
177
169
|
/**
|
|
178
170
|
* Given an IP, backend will either:
|
|
179
171
|
* - Allow queries only through archive / engine (query_only)
|
|
@@ -185,5 +177,31 @@ interface GetEngineMaxMintNlpAmountParams extends Subaccount {
|
|
|
185
177
|
spotLeverage?: boolean;
|
|
186
178
|
}
|
|
187
179
|
type GetEngineMaxMintNlpAmountResponse = BigDecimal;
|
|
180
|
+
type GetEngineMaxBurnNlpAmountParams = Subaccount;
|
|
181
|
+
type GetEngineMaxBurnNlpAmountResponse = BigDecimal;
|
|
182
|
+
type GetEngineNlpLockedBalancesParams = Subaccount;
|
|
183
|
+
interface EngineNlpBalance {
|
|
184
|
+
productId: number;
|
|
185
|
+
balance: BigDecimal;
|
|
186
|
+
}
|
|
187
|
+
interface EngineNlpLockedBalance extends EngineNlpBalance {
|
|
188
|
+
unlockedAt: number;
|
|
189
|
+
}
|
|
190
|
+
interface GetEngineNlpLockedBalancesResponse {
|
|
191
|
+
lockedBalances: EngineNlpLockedBalance[];
|
|
192
|
+
balanceLocked: EngineNlpBalance;
|
|
193
|
+
balanceUnlocked: EngineNlpBalance;
|
|
194
|
+
}
|
|
195
|
+
interface NlpPool {
|
|
196
|
+
poolId: number;
|
|
197
|
+
subaccountHex: string;
|
|
198
|
+
ownerAddress: string;
|
|
199
|
+
balanceWeight: BigDecimal;
|
|
200
|
+
subaccountInfo: GetEngineSubaccountSummaryResponse;
|
|
201
|
+
openOrders: EngineOrder[];
|
|
202
|
+
}
|
|
203
|
+
interface GetEngineNlpPoolInfoResponse {
|
|
204
|
+
nlpPools: NlpPool[];
|
|
205
|
+
}
|
|
188
206
|
|
|
189
|
-
export type { EngineMarketPrice,
|
|
207
|
+
export type { EngineMarketPrice, EngineNlpBalance, EngineNlpLockedBalance, EngineOrder, EnginePriceTickLiquidity, EngineSubaccountOrders, EngineSymbol, EngineSymbolsResponse, GetEngineAllMarketsResponse, GetEngineContractsResponse, GetEngineEstimatedSubaccountSummaryParams, GetEngineHealthGroupsResponse, GetEngineInsuranceResponse, GetEngineIpBlockStatusResponse, GetEngineIsolatedPositionsParams, GetEngineIsolatedPositionsResponse, GetEngineLinkedSignerParams, GetEngineLinkedSignerResponse, GetEngineMarketLiquidityParams, GetEngineMarketLiquidityResponse, GetEngineMarketPriceParams, GetEngineMarketPriceResponse, GetEngineMarketPricesParams, GetEngineMarketPricesResponse, GetEngineMaxBurnNlpAmountParams, GetEngineMaxBurnNlpAmountResponse, GetEngineMaxMintNlpAmountParams, GetEngineMaxMintNlpAmountResponse, GetEngineMaxOrderSizeParams, GetEngineMaxOrderSizeResponse, GetEngineMaxWithdrawableParams, GetEngineMaxWithdrawableResponse, GetEngineNlpLockedBalancesParams, GetEngineNlpLockedBalancesResponse, GetEngineNlpPoolInfoResponse, GetEngineNoncesParams, GetEngineNoncesResponse, GetEngineOrderParams, GetEngineOrderResponse, GetEngineSubaccountFeeRatesParams, GetEngineSubaccountFeeRatesResponse, GetEngineSubaccountOrdersParams, GetEngineSubaccountOrdersResponse, GetEngineSubaccountProductOrdersParams, GetEngineSubaccountProductOrdersResponse, GetEngineSubaccountSummaryParams, GetEngineSubaccountSummaryResponse, GetEngineSymbolsParams, GetEngineTimeResponse, NlpPool, SubaccountIsolatedPosition, SubaccountOrderFeeRates, SubaccountProductDeltaTx, SubaccountTx, ValidateEngineOrderParams, ValidateEngineOrderResponse, ValidateSignedEngineOrderParams };
|
package/dist/types/index.cjs
CHANGED
|
@@ -17,23 +17,23 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
17
17
|
// src/types/index.ts
|
|
18
18
|
var types_exports = {};
|
|
19
19
|
module.exports = __toCommonJS(types_exports);
|
|
20
|
-
__reExport(types_exports, require("./clientQueryTypes.cjs"), module.exports);
|
|
21
20
|
__reExport(types_exports, require("./clientExecuteTypes.cjs"), module.exports);
|
|
22
|
-
__reExport(types_exports, require("./
|
|
23
|
-
__reExport(types_exports, require("./
|
|
21
|
+
__reExport(types_exports, require("./clientQueryTypes.cjs"), module.exports);
|
|
22
|
+
__reExport(types_exports, require("./EngineServerFailureError.cjs"), module.exports);
|
|
24
23
|
__reExport(types_exports, require("./serverExecuteTypes.cjs"), module.exports);
|
|
25
|
-
__reExport(types_exports, require("./
|
|
24
|
+
__reExport(types_exports, require("./serverQueryModelTypes.cjs"), module.exports);
|
|
25
|
+
__reExport(types_exports, require("./serverQueryTypes.cjs"), module.exports);
|
|
26
26
|
__reExport(types_exports, require("./serverSubscriptionEventTypes.cjs"), module.exports);
|
|
27
|
-
__reExport(types_exports, require("./
|
|
27
|
+
__reExport(types_exports, require("./serverSubscriptionTypes.cjs"), module.exports);
|
|
28
28
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29
29
|
0 && (module.exports = {
|
|
30
|
-
...require("./clientQueryTypes.cjs"),
|
|
31
30
|
...require("./clientExecuteTypes.cjs"),
|
|
32
|
-
...require("./
|
|
33
|
-
...require("./
|
|
31
|
+
...require("./clientQueryTypes.cjs"),
|
|
32
|
+
...require("./EngineServerFailureError.cjs"),
|
|
34
33
|
...require("./serverExecuteTypes.cjs"),
|
|
35
|
-
...require("./
|
|
34
|
+
...require("./serverQueryModelTypes.cjs"),
|
|
35
|
+
...require("./serverQueryTypes.cjs"),
|
|
36
36
|
...require("./serverSubscriptionEventTypes.cjs"),
|
|
37
|
-
...require("./
|
|
37
|
+
...require("./serverSubscriptionTypes.cjs")
|
|
38
38
|
});
|
|
39
39
|
//# sourceMappingURL=index.cjs.map
|
package/dist/types/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["export * from './
|
|
1
|
+
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["export * from './clientExecuteTypes';\nexport * from './clientQueryTypes';\nexport * from './EngineServerFailureError';\nexport * from './serverExecuteTypes';\nexport * from './serverQueryModelTypes';\nexport * from './serverQueryTypes';\nexport * from './serverSubscriptionEventTypes';\nexport * from './serverSubscriptionTypes';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,qCAAd;AACA,0BAAc,mCADd;AAEA,0BAAc,2CAFd;AAGA,0BAAc,qCAHd;AAIA,0BAAc,wCAJd;AAKA,0BAAc,mCALd;AAMA,0BAAc,+CANd;AAOA,0BAAc,0CAPd;","names":[]}
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
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, EngineServerMinDepositRate, EngineServerMinDepositRatesResponse, 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
|
-
export { EngineServerBookInfo, EngineServerHealthBreakdown, EngineServerPerpBalance, EngineServerPerpBalanceData, EngineServerPerpProduct, EngineServerPerpState, EngineServerProductType, EngineServerRisk, EngineServerSpotBalance, EngineServerSpotBalanceData, EngineServerSpotConfig, EngineServerSpotProduct, EngineServerSpotState } from './serverQueryModelTypes.cjs';
|
|
5
|
-
export { EngineServerCancelOrdersParams, EngineServerCancelOrdersResponse, EngineServerExecuteFailureResult, EngineServerExecutePlaceIsolatedOrderPayload, EngineServerExecutePlaceOrderPayload, EngineServerExecuteRequestByType, EngineServerExecuteRequestType, EngineServerExecuteResponseDataByType, EngineServerExecuteResult, EngineServerExecuteSuccessResult, EngineServerPlaceIsolatedOrderParams, EngineServerPlaceOrderParams, EngineServerPlaceOrderResponse, 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';
|
|
1
|
+
export { EngineBurnNlpParams, EngineCancelAndPlaceParams, EngineCancelOrdersParams, EngineCancelProductOrdersParams, EngineExecuteRequestParamsByType, EngineLinkSignerParams, EngineLiquidateSubaccountParams, EngineMintNlpParams, EngineOrderParams, EnginePlaceOrderParams, EnginePlaceOrderResult, EnginePlaceOrdersParams, EngineTransferQuoteParams, EngineWithdrawCollateralParams, SignatureParams, WithBaseEngineExecuteParams, WithSignature } from './clientExecuteTypes.cjs';
|
|
2
|
+
export { EngineMarketPrice, EngineNlpBalance, EngineNlpLockedBalance, EngineOrder, EnginePriceTickLiquidity, EngineSubaccountOrders, EngineSymbol, EngineSymbolsResponse, GetEngineAllMarketsResponse, GetEngineContractsResponse, GetEngineEstimatedSubaccountSummaryParams, GetEngineHealthGroupsResponse, GetEngineInsuranceResponse, GetEngineIpBlockStatusResponse, GetEngineIsolatedPositionsParams, GetEngineIsolatedPositionsResponse, GetEngineLinkedSignerParams, GetEngineLinkedSignerResponse, GetEngineMarketLiquidityParams, GetEngineMarketLiquidityResponse, GetEngineMarketPriceParams, GetEngineMarketPriceResponse, GetEngineMarketPricesParams, GetEngineMarketPricesResponse, GetEngineMaxBurnNlpAmountParams, GetEngineMaxBurnNlpAmountResponse, GetEngineMaxMintNlpAmountParams, GetEngineMaxMintNlpAmountResponse, GetEngineMaxOrderSizeParams, GetEngineMaxOrderSizeResponse, GetEngineMaxWithdrawableParams, GetEngineMaxWithdrawableResponse, GetEngineNlpLockedBalancesParams, GetEngineNlpLockedBalancesResponse, GetEngineNlpPoolInfoResponse, GetEngineNoncesParams, GetEngineNoncesResponse, GetEngineOrderParams, GetEngineOrderResponse, GetEngineSubaccountFeeRatesParams, GetEngineSubaccountFeeRatesResponse, GetEngineSubaccountOrdersParams, GetEngineSubaccountOrdersResponse, GetEngineSubaccountProductOrdersParams, GetEngineSubaccountProductOrdersResponse, GetEngineSubaccountSummaryParams, GetEngineSubaccountSummaryResponse, GetEngineSymbolsParams, GetEngineTimeResponse, NlpPool, SubaccountIsolatedPosition, SubaccountOrderFeeRates, SubaccountProductDeltaTx, SubaccountTx, ValidateEngineOrderParams, ValidateEngineOrderResponse, ValidateSignedEngineOrderParams } from './clientQueryTypes.cjs';
|
|
8
3
|
export { EngineServerFailureError } from './EngineServerFailureError.cjs';
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
export { EngineServerCancelOrdersParams, EngineServerCancelOrdersResponse, EngineServerExecuteFailureResult, EngineServerExecutePlaceOrderPayload, EngineServerExecuteRequestByType, EngineServerExecuteRequestType, EngineServerExecuteResponseDataByType, EngineServerExecuteResult, EngineServerExecuteSuccessResult, EngineServerPlaceOrderParams, EngineServerPlaceOrderResponse, EngineServerPlaceOrdersResponse, EngineServiceCancelAndPlaceParams } from './serverExecuteTypes.cjs';
|
|
5
|
+
export { EngineServerBookInfo, EngineServerHealthBreakdown, EngineServerNlpBalance, EngineServerNlpLockedBalance, EngineServerOrder, EngineServerPerpBalance, EngineServerPerpBalanceData, EngineServerPerpProduct, EngineServerPerpState, EngineServerProductType, EngineServerRisk, EngineServerSpotBalance, EngineServerSpotBalanceData, EngineServerSpotConfig, EngineServerSpotProduct, EngineServerSpotState } from './serverQueryModelTypes.cjs';
|
|
6
|
+
export { EngineInsuranceResponse, EngineServerAllProductsResponse, EngineServerContractsResponse, EngineServerEdgeAllProductsResponse, EngineServerFeeRatesResponse, EngineServerGetOrderQueryParams, EngineServerHealthGroupsResponse, EngineServerIpBlockResponse, EngineServerIsolatedPosition, EngineServerIsolatedPositionsQueryParams, EngineServerIsolatedPositionsResponse, EngineServerLinkedSignerParams, EngineServerLinkedSignerResponse, EngineServerMarketLiquidityQueryParams, EngineServerMarketLiquidityResponse, EngineServerMarketPrice, EngineServerMarketPriceQueryParams, EngineServerMarketPriceResponse, EngineServerMarketPricesQueryParams, EngineServerMarketPricesResponse, EngineServerMaxBurnNlpQueryParams, EngineServerMaxBurnNlpResponse, EngineServerMaxMintNlpQueryParams, EngineServerMaxMintNlpResponse, EngineServerMaxOrderSizeQueryParams, EngineServerMaxOrderSizeResponse, EngineServerMaxWithdrawableQueryParams, EngineServerMaxWithdrawableResponse, EngineServerNlpLockedBalancesQueryParams, EngineServerNlpLockedBalancesResponse, EngineServerNlpPool, EngineServerNlpPoolInfoResponse, EngineServerNoncesParams, EngineServerNoncesResponse, 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';
|
|
7
|
+
export { EngineServerSubscriptionBaseEvent, EngineServerSubscriptionBestBidOfferEvent, EngineServerSubscriptionBookDepthEvent, EngineServerSubscriptionEvent, EngineServerSubscriptionEventType, EngineServerSubscriptionFillEvent, EngineServerSubscriptionFundingPaymentEvent, EngineServerSubscriptionLatestCandlestickEvent, EngineServerSubscriptionLiquidationEvent, EngineServerSubscriptionOrderUpdateEvent, EngineServerSubscriptionPositionChangeEvent, EngineServerSubscriptionTradeEvent, OrderUpdateReason, PositionChangeReason } from './serverSubscriptionEventTypes.cjs';
|
|
8
|
+
export { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerFundingPaymentStreamParams, EngineServerLatestCandlestickStreamParams, EngineServerLiquidationStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams } from './serverSubscriptionTypes.cjs';
|
|
9
|
+
import '@nadohq/shared';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
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, EngineServerMinDepositRate, EngineServerMinDepositRatesResponse, 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
|
-
export { EngineServerBookInfo, EngineServerHealthBreakdown, EngineServerPerpBalance, EngineServerPerpBalanceData, EngineServerPerpProduct, EngineServerPerpState, EngineServerProductType, EngineServerRisk, EngineServerSpotBalance, EngineServerSpotBalanceData, EngineServerSpotConfig, EngineServerSpotProduct, EngineServerSpotState } from './serverQueryModelTypes.js';
|
|
5
|
-
export { EngineServerCancelOrdersParams, EngineServerCancelOrdersResponse, EngineServerExecuteFailureResult, EngineServerExecutePlaceIsolatedOrderPayload, EngineServerExecutePlaceOrderPayload, EngineServerExecuteRequestByType, EngineServerExecuteRequestType, EngineServerExecuteResponseDataByType, EngineServerExecuteResult, EngineServerExecuteSuccessResult, EngineServerPlaceIsolatedOrderParams, EngineServerPlaceOrderParams, EngineServerPlaceOrderResponse, 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';
|
|
1
|
+
export { EngineBurnNlpParams, EngineCancelAndPlaceParams, EngineCancelOrdersParams, EngineCancelProductOrdersParams, EngineExecuteRequestParamsByType, EngineLinkSignerParams, EngineLiquidateSubaccountParams, EngineMintNlpParams, EngineOrderParams, EnginePlaceOrderParams, EnginePlaceOrderResult, EnginePlaceOrdersParams, EngineTransferQuoteParams, EngineWithdrawCollateralParams, SignatureParams, WithBaseEngineExecuteParams, WithSignature } from './clientExecuteTypes.js';
|
|
2
|
+
export { EngineMarketPrice, EngineNlpBalance, EngineNlpLockedBalance, EngineOrder, EnginePriceTickLiquidity, EngineSubaccountOrders, EngineSymbol, EngineSymbolsResponse, GetEngineAllMarketsResponse, GetEngineContractsResponse, GetEngineEstimatedSubaccountSummaryParams, GetEngineHealthGroupsResponse, GetEngineInsuranceResponse, GetEngineIpBlockStatusResponse, GetEngineIsolatedPositionsParams, GetEngineIsolatedPositionsResponse, GetEngineLinkedSignerParams, GetEngineLinkedSignerResponse, GetEngineMarketLiquidityParams, GetEngineMarketLiquidityResponse, GetEngineMarketPriceParams, GetEngineMarketPriceResponse, GetEngineMarketPricesParams, GetEngineMarketPricesResponse, GetEngineMaxBurnNlpAmountParams, GetEngineMaxBurnNlpAmountResponse, GetEngineMaxMintNlpAmountParams, GetEngineMaxMintNlpAmountResponse, GetEngineMaxOrderSizeParams, GetEngineMaxOrderSizeResponse, GetEngineMaxWithdrawableParams, GetEngineMaxWithdrawableResponse, GetEngineNlpLockedBalancesParams, GetEngineNlpLockedBalancesResponse, GetEngineNlpPoolInfoResponse, GetEngineNoncesParams, GetEngineNoncesResponse, GetEngineOrderParams, GetEngineOrderResponse, GetEngineSubaccountFeeRatesParams, GetEngineSubaccountFeeRatesResponse, GetEngineSubaccountOrdersParams, GetEngineSubaccountOrdersResponse, GetEngineSubaccountProductOrdersParams, GetEngineSubaccountProductOrdersResponse, GetEngineSubaccountSummaryParams, GetEngineSubaccountSummaryResponse, GetEngineSymbolsParams, GetEngineTimeResponse, NlpPool, SubaccountIsolatedPosition, SubaccountOrderFeeRates, SubaccountProductDeltaTx, SubaccountTx, ValidateEngineOrderParams, ValidateEngineOrderResponse, ValidateSignedEngineOrderParams } from './clientQueryTypes.js';
|
|
8
3
|
export { EngineServerFailureError } from './EngineServerFailureError.js';
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
export { EngineServerCancelOrdersParams, EngineServerCancelOrdersResponse, EngineServerExecuteFailureResult, EngineServerExecutePlaceOrderPayload, EngineServerExecuteRequestByType, EngineServerExecuteRequestType, EngineServerExecuteResponseDataByType, EngineServerExecuteResult, EngineServerExecuteSuccessResult, EngineServerPlaceOrderParams, EngineServerPlaceOrderResponse, EngineServerPlaceOrdersResponse, EngineServiceCancelAndPlaceParams } from './serverExecuteTypes.js';
|
|
5
|
+
export { EngineServerBookInfo, EngineServerHealthBreakdown, EngineServerNlpBalance, EngineServerNlpLockedBalance, EngineServerOrder, EngineServerPerpBalance, EngineServerPerpBalanceData, EngineServerPerpProduct, EngineServerPerpState, EngineServerProductType, EngineServerRisk, EngineServerSpotBalance, EngineServerSpotBalanceData, EngineServerSpotConfig, EngineServerSpotProduct, EngineServerSpotState } from './serverQueryModelTypes.js';
|
|
6
|
+
export { EngineInsuranceResponse, EngineServerAllProductsResponse, EngineServerContractsResponse, EngineServerEdgeAllProductsResponse, EngineServerFeeRatesResponse, EngineServerGetOrderQueryParams, EngineServerHealthGroupsResponse, EngineServerIpBlockResponse, EngineServerIsolatedPosition, EngineServerIsolatedPositionsQueryParams, EngineServerIsolatedPositionsResponse, EngineServerLinkedSignerParams, EngineServerLinkedSignerResponse, EngineServerMarketLiquidityQueryParams, EngineServerMarketLiquidityResponse, EngineServerMarketPrice, EngineServerMarketPriceQueryParams, EngineServerMarketPriceResponse, EngineServerMarketPricesQueryParams, EngineServerMarketPricesResponse, EngineServerMaxBurnNlpQueryParams, EngineServerMaxBurnNlpResponse, EngineServerMaxMintNlpQueryParams, EngineServerMaxMintNlpResponse, EngineServerMaxOrderSizeQueryParams, EngineServerMaxOrderSizeResponse, EngineServerMaxWithdrawableQueryParams, EngineServerMaxWithdrawableResponse, EngineServerNlpLockedBalancesQueryParams, EngineServerNlpLockedBalancesResponse, EngineServerNlpPool, EngineServerNlpPoolInfoResponse, EngineServerNoncesParams, EngineServerNoncesResponse, 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';
|
|
7
|
+
export { EngineServerSubscriptionBaseEvent, EngineServerSubscriptionBestBidOfferEvent, EngineServerSubscriptionBookDepthEvent, EngineServerSubscriptionEvent, EngineServerSubscriptionEventType, EngineServerSubscriptionFillEvent, EngineServerSubscriptionFundingPaymentEvent, EngineServerSubscriptionLatestCandlestickEvent, EngineServerSubscriptionLiquidationEvent, EngineServerSubscriptionOrderUpdateEvent, EngineServerSubscriptionPositionChangeEvent, EngineServerSubscriptionTradeEvent, OrderUpdateReason, PositionChangeReason } from './serverSubscriptionEventTypes.js';
|
|
8
|
+
export { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerFundingPaymentStreamParams, EngineServerLatestCandlestickStreamParams, EngineServerLiquidationStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams } from './serverSubscriptionTypes.js';
|
|
9
|
+
import '@nadohq/shared';
|
package/dist/types/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// src/types/index.ts
|
|
2
|
-
export * from "./clientQueryTypes.js";
|
|
3
2
|
export * from "./clientExecuteTypes.js";
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
3
|
+
export * from "./clientQueryTypes.js";
|
|
4
|
+
export * from "./EngineServerFailureError.js";
|
|
6
5
|
export * from "./serverExecuteTypes.js";
|
|
7
|
-
export * from "./
|
|
6
|
+
export * from "./serverQueryModelTypes.js";
|
|
7
|
+
export * from "./serverQueryTypes.js";
|
|
8
8
|
export * from "./serverSubscriptionEventTypes.js";
|
|
9
|
-
export * from "./
|
|
9
|
+
export * from "./serverSubscriptionTypes.js";
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["export * from './
|
|
1
|
+
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["export * from './clientExecuteTypes';\nexport * from './clientQueryTypes';\nexport * from './EngineServerFailureError';\nexport * from './serverExecuteTypes';\nexport * from './serverQueryModelTypes';\nexport * from './serverQueryTypes';\nexport * from './serverSubscriptionEventTypes';\nexport * from './serverSubscriptionTypes';\n"],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/serverExecuteTypes.ts"],"sourcesContent":["import {\n EIP712BurnNlpValues,\n
|
|
1
|
+
{"version":3,"sources":["../../src/types/serverExecuteTypes.ts"],"sourcesContent":["import {\n EIP712BurnNlpValues,\n EIP712LinkSignerValues,\n EIP712LiquidateSubaccountValues,\n EIP712MintNlpValues,\n EIP712OrderCancellationValues,\n EIP712OrderParams,\n EIP712OrderValues,\n EIP712ProductOrdersCancellationValues,\n EIP712TransferQuoteValues,\n EIP712WithdrawCollateralValues,\n SignedTx,\n} from '@nadohq/shared';\nimport { EngineServerOrderResponse } from './serverQueryTypes';\n\nexport interface EngineServerPlaceOrderResponse {\n digest: string;\n error: string | null;\n}\n\nexport type EngineServerPlaceOrdersResponse = EngineServerPlaceOrderResponse[];\n\nexport interface EngineServerCancelOrdersResponse {\n cancelled_orders: EngineServerOrderResponse[];\n}\n\nexport interface EngineServerExecuteResponseDataByType {\n burn_nlp: null;\n cancel_and_place: EngineServerPlaceOrderResponse;\n cancel_orders: EngineServerCancelOrdersResponse;\n cancel_product_orders: EngineServerCancelOrdersResponse;\n link_signer: null;\n liquidate_subaccount: null;\n mint_nlp: null;\n place_order: EngineServerPlaceOrderResponse;\n place_orders: EngineServerPlaceOrdersResponse;\n transfer_quote: null;\n withdraw_collateral: null;\n}\n\nexport interface EngineServerExecuteSuccessResult<\n T extends EngineServerExecuteRequestType = EngineServerExecuteRequestType,\n> {\n status: 'success';\n data: EngineServerExecuteResponseDataByType[T];\n signature: string;\n request_type: EngineServerExecuteResultRequestType;\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}\n\nexport interface EngineServerExecuteFailureResult {\n status: 'failure';\n signature: string;\n error: string;\n error_code: number;\n request_type: EngineServerExecuteResultRequestType;\n}\n\nexport type EngineServerExecuteResult<\n T extends EngineServerExecuteRequestType = EngineServerExecuteRequestType,\n> = EngineServerExecuteSuccessResult<T> | EngineServerExecuteFailureResult;\n\ntype EngineServerExecuteResultRequestType = {\n [K in keyof EngineServerExecuteRequestByType]: `execute_${K}`;\n}[keyof EngineServerExecuteRequestByType];\n\nexport interface EngineServerPlaceOrderParams {\n id: number | null;\n product_id: number;\n order: EIP712OrderValues;\n // Bytes\n signature: string;\n // Engine defaults this to true\n spot_leverage: boolean | null;\n // For isolated orders, this specifies whether margin can be borrowed (i.e. whether the cross account can have a negative USDT balance)\n borrow_margin: boolean | null;\n}\n\nexport type EngineServerCancelOrdersParams = SignedTx<\n Omit<EIP712OrderCancellationValues, 'productIds'> & {\n // number[] is technically assignable to \"Bytes\", so we need to override the ByteFieldsToHex result here\n productIds: number[];\n }\n>;\n\nexport type EngineServiceCancelAndPlaceParams = Omit<\n EngineServerCancelOrdersParams,\n 'tx' | 'signature'\n> & {\n cancel_tx: EngineServerCancelOrdersParams['tx'];\n cancel_signature: EngineServerCancelOrdersParams['signature'];\n place_order: EngineServerPlaceOrderParams;\n};\n\ntype WithSpotLeverage<T> = T & {\n spot_leverage: boolean | null;\n};\n\nexport interface EngineServerExecuteRequestByType {\n burn_nlp: SignedTx<EIP712BurnNlpValues>;\n cancel_and_place: EngineServiceCancelAndPlaceParams;\n cancel_orders: EngineServerCancelOrdersParams;\n cancel_product_orders: SignedTx<\n Omit<EIP712ProductOrdersCancellationValues, 'productIds'> & {\n // number[] is technically assignable to \"Bytes\", so we need to override the ByteFieldsToHex result here\n productIds: number[];\n }\n >;\n link_signer: SignedTx<EIP712LinkSignerValues>;\n liquidate_subaccount: SignedTx<EIP712LiquidateSubaccountValues>;\n mint_nlp: WithSpotLeverage<SignedTx<EIP712MintNlpValues>>;\n place_order: EngineServerPlaceOrderParams;\n place_orders: {\n orders: EngineServerPlaceOrderParams[];\n /**\n * If `true`, aborts the batch after the first failed order; if `false`, remaining orders continue to execute.\n * If `null`, the default value is `false`.\n */\n cancel_on_failure: boolean | null;\n };\n transfer_quote: SignedTx<EIP712TransferQuoteValues>;\n withdraw_collateral: WithSpotLeverage<\n SignedTx<EIP712WithdrawCollateralValues>\n >;\n}\n\nexport type EngineServerExecuteRequestType =\n keyof EngineServerExecuteRequestByType;\n\nexport interface EngineServerExecutePlaceOrderPayload {\n payload: EngineServerExecuteRequestByType['place_order'];\n orderParams: EIP712OrderParams;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { SignedTx, EIP712BurnNlpValues, EIP712OrderCancellationValues, EIP712OrderValues, EIP712ProductOrdersCancellationValues, EIP712LinkSignerValues, EIP712LiquidateSubaccountValues, EIP712MintNlpValues, EIP712TransferQuoteValues, EIP712WithdrawCollateralValues, EIP712OrderParams
|
|
1
|
+
import { SignedTx, EIP712BurnNlpValues, EIP712OrderCancellationValues, EIP712OrderValues, EIP712ProductOrdersCancellationValues, EIP712LinkSignerValues, EIP712LiquidateSubaccountValues, EIP712MintNlpValues, EIP712TransferQuoteValues, EIP712WithdrawCollateralValues, EIP712OrderParams } from '@nadohq/shared';
|
|
2
2
|
import { EngineServerOrderResponse } from './serverQueryTypes.cjs';
|
|
3
3
|
import './serverQueryModelTypes.cjs';
|
|
4
4
|
|
|
5
5
|
interface EngineServerPlaceOrderResponse {
|
|
6
6
|
digest: string;
|
|
7
|
+
error: string | null;
|
|
7
8
|
}
|
|
9
|
+
type EngineServerPlaceOrdersResponse = EngineServerPlaceOrderResponse[];
|
|
8
10
|
interface EngineServerCancelOrdersResponse {
|
|
9
11
|
cancelled_orders: EngineServerOrderResponse[];
|
|
10
12
|
}
|
|
@@ -16,8 +18,8 @@ interface EngineServerExecuteResponseDataByType {
|
|
|
16
18
|
link_signer: null;
|
|
17
19
|
liquidate_subaccount: null;
|
|
18
20
|
mint_nlp: null;
|
|
19
|
-
place_isolated_order: EngineServerPlaceOrderResponse;
|
|
20
21
|
place_order: EngineServerPlaceOrderResponse;
|
|
22
|
+
place_orders: EngineServerPlaceOrdersResponse;
|
|
21
23
|
transfer_quote: null;
|
|
22
24
|
withdraw_collateral: null;
|
|
23
25
|
}
|
|
@@ -44,12 +46,6 @@ interface EngineServerPlaceOrderParams {
|
|
|
44
46
|
order: EIP712OrderValues;
|
|
45
47
|
signature: string;
|
|
46
48
|
spot_leverage: boolean | null;
|
|
47
|
-
}
|
|
48
|
-
interface EngineServerPlaceIsolatedOrderParams {
|
|
49
|
-
id: number | null;
|
|
50
|
-
product_id: number;
|
|
51
|
-
isolated_order: EIP712OrderValues;
|
|
52
|
-
signature: string;
|
|
53
49
|
borrow_margin: boolean | null;
|
|
54
50
|
}
|
|
55
51
|
type EngineServerCancelOrdersParams = SignedTx<Omit<EIP712OrderCancellationValues, 'productIds'> & {
|
|
@@ -73,8 +69,15 @@ interface EngineServerExecuteRequestByType {
|
|
|
73
69
|
link_signer: SignedTx<EIP712LinkSignerValues>;
|
|
74
70
|
liquidate_subaccount: SignedTx<EIP712LiquidateSubaccountValues>;
|
|
75
71
|
mint_nlp: WithSpotLeverage<SignedTx<EIP712MintNlpValues>>;
|
|
76
|
-
place_isolated_order: EngineServerPlaceIsolatedOrderParams;
|
|
77
72
|
place_order: EngineServerPlaceOrderParams;
|
|
73
|
+
place_orders: {
|
|
74
|
+
orders: EngineServerPlaceOrderParams[];
|
|
75
|
+
/**
|
|
76
|
+
* If `true`, aborts the batch after the first failed order; if `false`, remaining orders continue to execute.
|
|
77
|
+
* If `null`, the default value is `false`.
|
|
78
|
+
*/
|
|
79
|
+
cancel_on_failure: boolean | null;
|
|
80
|
+
};
|
|
78
81
|
transfer_quote: SignedTx<EIP712TransferQuoteValues>;
|
|
79
82
|
withdraw_collateral: WithSpotLeverage<SignedTx<EIP712WithdrawCollateralValues>>;
|
|
80
83
|
}
|
|
@@ -83,9 +86,5 @@ interface EngineServerExecutePlaceOrderPayload {
|
|
|
83
86
|
payload: EngineServerExecuteRequestByType['place_order'];
|
|
84
87
|
orderParams: EIP712OrderParams;
|
|
85
88
|
}
|
|
86
|
-
interface EngineServerExecutePlaceIsolatedOrderPayload {
|
|
87
|
-
payload: EngineServerExecuteRequestByType['place_isolated_order'];
|
|
88
|
-
orderParams: EIP712IsolatedOrderParams;
|
|
89
|
-
}
|
|
90
89
|
|
|
91
|
-
export type { EngineServerCancelOrdersParams, EngineServerCancelOrdersResponse, EngineServerExecuteFailureResult,
|
|
90
|
+
export type { EngineServerCancelOrdersParams, EngineServerCancelOrdersResponse, EngineServerExecuteFailureResult, EngineServerExecutePlaceOrderPayload, EngineServerExecuteRequestByType, EngineServerExecuteRequestType, EngineServerExecuteResponseDataByType, EngineServerExecuteResult, EngineServerExecuteSuccessResult, EngineServerPlaceOrderParams, EngineServerPlaceOrderResponse, EngineServerPlaceOrdersResponse, EngineServiceCancelAndPlaceParams };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { SignedTx, EIP712BurnNlpValues, EIP712OrderCancellationValues, EIP712OrderValues, EIP712ProductOrdersCancellationValues, EIP712LinkSignerValues, EIP712LiquidateSubaccountValues, EIP712MintNlpValues, EIP712TransferQuoteValues, EIP712WithdrawCollateralValues, EIP712OrderParams
|
|
1
|
+
import { SignedTx, EIP712BurnNlpValues, EIP712OrderCancellationValues, EIP712OrderValues, EIP712ProductOrdersCancellationValues, EIP712LinkSignerValues, EIP712LiquidateSubaccountValues, EIP712MintNlpValues, EIP712TransferQuoteValues, EIP712WithdrawCollateralValues, EIP712OrderParams } from '@nadohq/shared';
|
|
2
2
|
import { EngineServerOrderResponse } from './serverQueryTypes.js';
|
|
3
3
|
import './serverQueryModelTypes.js';
|
|
4
4
|
|
|
5
5
|
interface EngineServerPlaceOrderResponse {
|
|
6
6
|
digest: string;
|
|
7
|
+
error: string | null;
|
|
7
8
|
}
|
|
9
|
+
type EngineServerPlaceOrdersResponse = EngineServerPlaceOrderResponse[];
|
|
8
10
|
interface EngineServerCancelOrdersResponse {
|
|
9
11
|
cancelled_orders: EngineServerOrderResponse[];
|
|
10
12
|
}
|
|
@@ -16,8 +18,8 @@ interface EngineServerExecuteResponseDataByType {
|
|
|
16
18
|
link_signer: null;
|
|
17
19
|
liquidate_subaccount: null;
|
|
18
20
|
mint_nlp: null;
|
|
19
|
-
place_isolated_order: EngineServerPlaceOrderResponse;
|
|
20
21
|
place_order: EngineServerPlaceOrderResponse;
|
|
22
|
+
place_orders: EngineServerPlaceOrdersResponse;
|
|
21
23
|
transfer_quote: null;
|
|
22
24
|
withdraw_collateral: null;
|
|
23
25
|
}
|
|
@@ -44,12 +46,6 @@ interface EngineServerPlaceOrderParams {
|
|
|
44
46
|
order: EIP712OrderValues;
|
|
45
47
|
signature: string;
|
|
46
48
|
spot_leverage: boolean | null;
|
|
47
|
-
}
|
|
48
|
-
interface EngineServerPlaceIsolatedOrderParams {
|
|
49
|
-
id: number | null;
|
|
50
|
-
product_id: number;
|
|
51
|
-
isolated_order: EIP712OrderValues;
|
|
52
|
-
signature: string;
|
|
53
49
|
borrow_margin: boolean | null;
|
|
54
50
|
}
|
|
55
51
|
type EngineServerCancelOrdersParams = SignedTx<Omit<EIP712OrderCancellationValues, 'productIds'> & {
|
|
@@ -73,8 +69,15 @@ interface EngineServerExecuteRequestByType {
|
|
|
73
69
|
link_signer: SignedTx<EIP712LinkSignerValues>;
|
|
74
70
|
liquidate_subaccount: SignedTx<EIP712LiquidateSubaccountValues>;
|
|
75
71
|
mint_nlp: WithSpotLeverage<SignedTx<EIP712MintNlpValues>>;
|
|
76
|
-
place_isolated_order: EngineServerPlaceIsolatedOrderParams;
|
|
77
72
|
place_order: EngineServerPlaceOrderParams;
|
|
73
|
+
place_orders: {
|
|
74
|
+
orders: EngineServerPlaceOrderParams[];
|
|
75
|
+
/**
|
|
76
|
+
* If `true`, aborts the batch after the first failed order; if `false`, remaining orders continue to execute.
|
|
77
|
+
* If `null`, the default value is `false`.
|
|
78
|
+
*/
|
|
79
|
+
cancel_on_failure: boolean | null;
|
|
80
|
+
};
|
|
78
81
|
transfer_quote: SignedTx<EIP712TransferQuoteValues>;
|
|
79
82
|
withdraw_collateral: WithSpotLeverage<SignedTx<EIP712WithdrawCollateralValues>>;
|
|
80
83
|
}
|
|
@@ -83,9 +86,5 @@ interface EngineServerExecutePlaceOrderPayload {
|
|
|
83
86
|
payload: EngineServerExecuteRequestByType['place_order'];
|
|
84
87
|
orderParams: EIP712OrderParams;
|
|
85
88
|
}
|
|
86
|
-
interface EngineServerExecutePlaceIsolatedOrderPayload {
|
|
87
|
-
payload: EngineServerExecuteRequestByType['place_isolated_order'];
|
|
88
|
-
orderParams: EIP712IsolatedOrderParams;
|
|
89
|
-
}
|
|
90
89
|
|
|
91
|
-
export type { EngineServerCancelOrdersParams, EngineServerCancelOrdersResponse, EngineServerExecuteFailureResult,
|
|
90
|
+
export type { EngineServerCancelOrdersParams, EngineServerCancelOrdersResponse, EngineServerExecuteFailureResult, EngineServerExecutePlaceOrderPayload, EngineServerExecuteRequestByType, EngineServerExecuteRequestType, EngineServerExecuteResponseDataByType, EngineServerExecuteResult, EngineServerExecuteSuccessResult, EngineServerPlaceOrderParams, EngineServerPlaceOrderResponse, EngineServerPlaceOrdersResponse, EngineServiceCancelAndPlaceParams };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/serverQueryModelTypes.ts"],"sourcesContent":["export interface EngineServerHealthBreakdown {\n health: string;\n assets: string;\n liabilities: string;\n}\n\nexport interface EngineServerSpotBalanceData {\n amount: string;\n
|
|
1
|
+
{"version":3,"sources":["../../src/types/serverQueryModelTypes.ts"],"sourcesContent":["export interface EngineServerHealthBreakdown {\n health: string;\n assets: string;\n liabilities: string;\n}\n\nexport interface EngineServerSpotBalanceData {\n amount: string;\n}\n\nexport interface EngineServerPerpBalanceData {\n amount: string;\n v_quote_balance: string;\n last_cumulative_funding_x18: string;\n}\n\nexport interface EngineServerRisk {\n long_weight_initial_x18: string;\n short_weight_initial_x18: string;\n long_weight_maintenance_x18: string;\n short_weight_maintenance_x18: string;\n large_position_penalty_x18: string;\n}\n\nexport interface EngineServerBookInfo {\n size_increment: string;\n price_increment_x18: string;\n min_size: string;\n collected_fees: string;\n}\n\nexport interface EngineServerSpotConfig {\n token: string;\n interest_inflection_util_x18: string;\n interest_floor_x18: string;\n interest_small_cap_x18: string;\n interest_large_cap_x18: string;\n min_deposit_rate_x18: string;\n}\n\nexport interface EngineServerSpotState {\n cumulative_deposits_multiplier_x18: string;\n cumulative_borrows_multiplier_x18: string;\n total_deposits_normalized: string;\n total_borrows_normalized: string;\n}\n\nexport interface EngineServerPerpState {\n cumulative_funding_long_x18: string;\n cumulative_funding_short_x18: string;\n available_settle: string;\n open_interest: string;\n}\n\nexport interface EngineServerSpotProduct {\n product_id: number;\n oracle_price_x18: string;\n risk: EngineServerRisk;\n config: EngineServerSpotConfig;\n state: EngineServerSpotState;\n book_info: EngineServerBookInfo;\n}\n\nexport interface EngineServerSpotBalance {\n product_id: number;\n balance: EngineServerSpotBalanceData;\n}\n\nexport interface EngineServerPerpProduct {\n product_id: number;\n oracle_price_x18: string;\n index_price_x18: string;\n risk: EngineServerRisk;\n state: EngineServerPerpState;\n book_info: EngineServerBookInfo;\n}\n\nexport interface EngineServerPerpBalance {\n product_id: number;\n balance: EngineServerPerpBalanceData;\n}\n\nexport type EngineServerProductType = 'perp' | 'spot';\n\nexport interface EngineServerOrder {\n product_id: number;\n sender: string;\n price_x18: string;\n amount: string;\n expiration: string;\n nonce: string;\n unfilled_amount: string;\n digest: string;\n placed_at: number;\n order_type: string;\n appendix: string;\n}\n\nexport interface EngineServerNlpBalance {\n product_id: number;\n balance: {\n amount: string;\n };\n}\nexport interface EngineServerNlpLockedBalance {\n unlocked_at: number;\n balance: EngineServerNlpBalance;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -5,7 +5,6 @@ interface EngineServerHealthBreakdown {
|
|
|
5
5
|
}
|
|
6
6
|
interface EngineServerSpotBalanceData {
|
|
7
7
|
amount: string;
|
|
8
|
-
last_cumulative_multiplier_x18: string;
|
|
9
8
|
}
|
|
10
9
|
interface EngineServerPerpBalanceData {
|
|
11
10
|
amount: string;
|
|
@@ -31,6 +30,7 @@ interface EngineServerSpotConfig {
|
|
|
31
30
|
interest_floor_x18: string;
|
|
32
31
|
interest_small_cap_x18: string;
|
|
33
32
|
interest_large_cap_x18: string;
|
|
33
|
+
min_deposit_rate_x18: string;
|
|
34
34
|
}
|
|
35
35
|
interface EngineServerSpotState {
|
|
36
36
|
cumulative_deposits_multiplier_x18: string;
|
|
@@ -69,5 +69,28 @@ interface EngineServerPerpBalance {
|
|
|
69
69
|
balance: EngineServerPerpBalanceData;
|
|
70
70
|
}
|
|
71
71
|
type EngineServerProductType = 'perp' | 'spot';
|
|
72
|
+
interface EngineServerOrder {
|
|
73
|
+
product_id: number;
|
|
74
|
+
sender: string;
|
|
75
|
+
price_x18: string;
|
|
76
|
+
amount: string;
|
|
77
|
+
expiration: string;
|
|
78
|
+
nonce: string;
|
|
79
|
+
unfilled_amount: string;
|
|
80
|
+
digest: string;
|
|
81
|
+
placed_at: number;
|
|
82
|
+
order_type: string;
|
|
83
|
+
appendix: string;
|
|
84
|
+
}
|
|
85
|
+
interface EngineServerNlpBalance {
|
|
86
|
+
product_id: number;
|
|
87
|
+
balance: {
|
|
88
|
+
amount: string;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
interface EngineServerNlpLockedBalance {
|
|
92
|
+
unlocked_at: number;
|
|
93
|
+
balance: EngineServerNlpBalance;
|
|
94
|
+
}
|
|
72
95
|
|
|
73
|
-
export type { EngineServerBookInfo, EngineServerHealthBreakdown, EngineServerPerpBalance, EngineServerPerpBalanceData, EngineServerPerpProduct, EngineServerPerpState, EngineServerProductType, EngineServerRisk, EngineServerSpotBalance, EngineServerSpotBalanceData, EngineServerSpotConfig, EngineServerSpotProduct, EngineServerSpotState };
|
|
96
|
+
export type { EngineServerBookInfo, EngineServerHealthBreakdown, EngineServerNlpBalance, EngineServerNlpLockedBalance, EngineServerOrder, EngineServerPerpBalance, EngineServerPerpBalanceData, EngineServerPerpProduct, EngineServerPerpState, EngineServerProductType, EngineServerRisk, EngineServerSpotBalance, EngineServerSpotBalanceData, EngineServerSpotConfig, EngineServerSpotProduct, EngineServerSpotState };
|
|
@@ -5,7 +5,6 @@ interface EngineServerHealthBreakdown {
|
|
|
5
5
|
}
|
|
6
6
|
interface EngineServerSpotBalanceData {
|
|
7
7
|
amount: string;
|
|
8
|
-
last_cumulative_multiplier_x18: string;
|
|
9
8
|
}
|
|
10
9
|
interface EngineServerPerpBalanceData {
|
|
11
10
|
amount: string;
|
|
@@ -31,6 +30,7 @@ interface EngineServerSpotConfig {
|
|
|
31
30
|
interest_floor_x18: string;
|
|
32
31
|
interest_small_cap_x18: string;
|
|
33
32
|
interest_large_cap_x18: string;
|
|
33
|
+
min_deposit_rate_x18: string;
|
|
34
34
|
}
|
|
35
35
|
interface EngineServerSpotState {
|
|
36
36
|
cumulative_deposits_multiplier_x18: string;
|
|
@@ -69,5 +69,28 @@ interface EngineServerPerpBalance {
|
|
|
69
69
|
balance: EngineServerPerpBalanceData;
|
|
70
70
|
}
|
|
71
71
|
type EngineServerProductType = 'perp' | 'spot';
|
|
72
|
+
interface EngineServerOrder {
|
|
73
|
+
product_id: number;
|
|
74
|
+
sender: string;
|
|
75
|
+
price_x18: string;
|
|
76
|
+
amount: string;
|
|
77
|
+
expiration: string;
|
|
78
|
+
nonce: string;
|
|
79
|
+
unfilled_amount: string;
|
|
80
|
+
digest: string;
|
|
81
|
+
placed_at: number;
|
|
82
|
+
order_type: string;
|
|
83
|
+
appendix: string;
|
|
84
|
+
}
|
|
85
|
+
interface EngineServerNlpBalance {
|
|
86
|
+
product_id: number;
|
|
87
|
+
balance: {
|
|
88
|
+
amount: string;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
interface EngineServerNlpLockedBalance {
|
|
92
|
+
unlocked_at: number;
|
|
93
|
+
balance: EngineServerNlpBalance;
|
|
94
|
+
}
|
|
72
95
|
|
|
73
|
-
export type { EngineServerBookInfo, EngineServerHealthBreakdown, EngineServerPerpBalance, EngineServerPerpBalanceData, EngineServerPerpProduct, EngineServerPerpState, EngineServerProductType, EngineServerRisk, EngineServerSpotBalance, EngineServerSpotBalanceData, EngineServerSpotConfig, EngineServerSpotProduct, EngineServerSpotState };
|
|
96
|
+
export type { EngineServerBookInfo, EngineServerHealthBreakdown, EngineServerNlpBalance, EngineServerNlpLockedBalance, EngineServerOrder, EngineServerPerpBalance, EngineServerPerpBalanceData, EngineServerPerpProduct, EngineServerPerpState, EngineServerProductType, EngineServerRisk, EngineServerSpotBalance, EngineServerSpotBalanceData, EngineServerSpotConfig, EngineServerSpotProduct, EngineServerSpotState };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/serverQueryTypes.ts"],"sourcesContent":["import { HealthStatus } from '@nadohq/contracts';\nimport {\n EngineServerHealthBreakdown,\n EngineServerPerpBalance,\n EngineServerPerpProduct,\n EngineServerProductType,\n EngineServerSpotBalance,\n EngineServerSpotProduct,\n} from './serverQueryModelTypes';\n\nexport interface EngineServerNoncesParams {\n address: string;\n}\n\nexport interface EngineServerSubaccountInfoQueryParams {\n subaccount: string;\n txns?: Array<{\n apply_delta: {\n product_id: number;\n subaccount: string;\n amount_delta: string;\n v_quote_delta: string;\n };\n }>;\n}\n\nexport interface EngineServerIsolatedPositionsQueryParams {\n subaccount: string;\n}\n\nexport interface EngineServerSymbolsQueryParams {\n product_type?: EngineServerProductType;\n product_ids?: number[];\n}\n\nexport interface EngineServerMarketPriceQueryParams {\n product_id: number;\n}\n\nexport interface EngineServerMarketPricesQueryParams {\n product_ids: number[];\n}\n\nexport interface EngineServerGetOrderQueryParams {\n product_id: number;\n digest: string;\n}\n\nexport interface EngineServerValidateOrderQueryParams {\n product_id: number;\n // Bytes for order, does not need to be signed\n order: string;\n}\n\nexport interface EngineServerOrdersQueryParams {\n sender: string;\n product_ids: number[];\n}\n\nexport interface EngineServerSubaccountOrdersQueryParams {\n sender: string;\n product_id: number;\n}\n\nexport interface EngineServerSubaccountFeeRatesParams {\n sender: string;\n}\n\nexport interface EngineServerMarketLiquidityQueryParams {\n product_id: number;\n depth: number;\n}\n\nexport interface EngineServerMaxWithdrawableQueryParams {\n sender: string;\n product_id: number;\n // If not given, engine defaults to true (leverage/borrow enabled)\n spot_leverage: string | null;\n}\n\nexport interface EngineServerMaxOrderSizeQueryParams {\n sender: string;\n product_id: number;\n price_x18: string;\n // Note: When `reduce_only` is true, `direction` must be opposite of the current position, otherwise it returns 0.\n direction: 'long' | 'short';\n // If not given, engine defaults to true (leverage/borrow enabled)\n spot_leverage: string | null;\n // If not given, engine defaults to false. If true, the max order size will be capped to the subaccount's current position size;\n // If no position exists, it will return 0.\n reduce_only: string | null;\n}\n\nexport interface EngineServerLinkedSignerParams {\n subaccount: string;\n}\n\nexport interface EngineServerMaxMintNlpQueryParams {\n sender: string;\n // If not given, engine defaults to true (leverage/borrow enabled)\n spot_leverage: string | null;\n}\n\nexport interface EngineServerQueryRequestByType {\n all_products: Record<string, never>;\n contracts: Record<string, never>;\n edge_all_products: Record<string, never>;\n fee_rates: EngineServerSubaccountFeeRatesParams;\n health_groups: Record<string, never>;\n insurance: Record<string, never>;\n isolated_positions: EngineServerIsolatedPositionsQueryParams;\n linked_signer: EngineServerLinkedSignerParams;\n market_liquidity: EngineServerMarketLiquidityQueryParams;\n market_price: EngineServerMarketPriceQueryParams;\n market_prices: EngineServerMarketPricesQueryParams;\n max_nlp_mintable: EngineServerMaxMintNlpQueryParams;\n max_order_size: EngineServerMaxOrderSizeQueryParams;\n max_withdrawable: EngineServerMaxWithdrawableQueryParams;\n min_deposit_rates: Record<string, never>;\n nonces: EngineServerNoncesParams;\n order: EngineServerGetOrderQueryParams;\n orders: EngineServerOrdersQueryParams;\n status: Record<string, never>;\n subaccount_info: Omit<EngineServerSubaccountInfoQueryParams, 'txns'> & {\n // JSON serialized txns\n txns?: string;\n };\n subaccount_orders: EngineServerSubaccountOrdersQueryParams;\n symbols: EngineServerSymbolsQueryParams;\n validate_order: EngineServerValidateOrderQueryParams;\n}\n\nexport type EngineServerQueryRequestType = keyof EngineServerQueryRequestByType;\n\nexport type EngineServerQueryRequest<\n TRequestType extends EngineServerQueryRequestType,\n> = {\n type: TRequestType;\n} & EngineServerQueryRequestByType[TRequestType];\n\nexport interface EngineServerContractsResponse {\n chain_id: string;\n endpoint_addr: string;\n // Index is product ID\n book_addrs: string[];\n}\n\n// Unless in active state, engine is not fully operational\nexport type EngineServerStatusResponse =\n | 'started'\n | 'active'\n | 'stopping'\n | 'syncing'\n | 'live_syncing'\n | 'failed';\n\nexport interface EngineServerNoncesResponse {\n order_nonce: string;\n tx_nonce: string;\n}\n\nexport interface EngineServerSubaccountInfoResponse {\n exists: boolean;\n subaccount: string;\n healths: [\n initial: EngineServerHealthBreakdown,\n maintenance: EngineServerHealthBreakdown,\n unweighted: EngineServerHealthBreakdown,\n ];\n // First index is product ID, each subarray is of length 3 [initial, maintenance, unweighted]\n health_contributions: string[][];\n spot_count: number;\n perp_count: number;\n spot_balances: EngineServerSpotBalance[];\n perp_balances: EngineServerPerpBalance[];\n spot_products: EngineServerSpotProduct[];\n perp_products: EngineServerPerpProduct[];\n}\n\nexport interface EngineServerIsolatedPosition {\n subaccount: string;\n healths: [\n initial: HealthStatus,\n maintenance: HealthStatus,\n unweighted: HealthStatus,\n ];\n quote_healths: [initial: string, maintenance: string, unweighted: string];\n base_healths: [initial: string, maintenance: string, unweighted: string];\n quote_balance: EngineServerSpotBalance;\n base_balance: EngineServerPerpBalance;\n quote_product: EngineServerSpotProduct;\n base_product: EngineServerPerpProduct;\n}\n\nexport type EngineServerIsolatedPositionsResponse = {\n isolated_positions: EngineServerIsolatedPosition[];\n};\n\nexport interface EngineServerSymbol {\n type: EngineServerProductType;\n product_id: number;\n symbol: string;\n price_increment_x18: string;\n size_increment: string;\n min_size: string;\n min_depth_x18: string;\n max_spread_rate_x18: string;\n maker_fee_rate_x18: string;\n taker_fee_rate_x18: string;\n long_weight_initial_x18: string;\n long_weight_maintenance_x18: string;\n}\n\nexport interface EngineServerSymbolsResponse {\n symbols: Record<string, EngineServerSymbol>;\n}\n\nexport interface EngineServerAllProductsResponse {\n spot_products: EngineServerSpotProduct[];\n perp_products: EngineServerPerpProduct[];\n}\n\nexport interface EngineServerHealthGroupsResponse {\n health_groups: [spotProductId: number, perpProductId: number][];\n}\n\n// Price, liquidity pairs\nexport type EngineServerPriceTickLiquidity = [\n priceX18: string,\n liquidity: string,\n];\n\nexport interface EngineServerMarketLiquidityResponse {\n bids: EngineServerPriceTickLiquidity[];\n asks: EngineServerPriceTickLiquidity[];\n}\n\nexport interface EngineServerSubaccountOrders {\n sender: string;\n product_id: number;\n orders: EngineServerOrder[];\n}\n\nexport type EngineServerSubaccountOrdersResponse = EngineServerSubaccountOrders;\n\nexport interface EngineServerProductOrdersResponse {\n sender: string;\n product_orders: EngineServerSubaccountOrders[];\n}\n\nexport interface EngineServerFeeRatesResponse {\n liquidation_sequencer_fee: string;\n health_check_sequencer_fee: string;\n taker_sequencer_fee: string;\n // Product ID is the index\n withdraw_sequencer_fees: string[];\n taker_fee_rates_x18: string[];\n maker_fee_rates_x18: string[];\n}\n\nexport interface EngineServerMarketPrice {\n product_id: number;\n bid_x18: string;\n ask_x18: string;\n}\n\nexport type EngineServerMarketPriceResponse = EngineServerMarketPrice;\n\nexport interface EngineServerMarketPricesResponse {\n market_prices: EngineServerMarketPrice[];\n}\n\nexport interface EngineServerOrder {\n product_id: number;\n sender: string;\n price_x18: string;\n amount: string;\n expiration: string;\n nonce: string;\n unfilled_amount: string;\n digest: string;\n placed_at: number;\n order_type: string;\n margin: string | null;\n}\n\nexport type EngineServerOrderResponse = EngineServerOrder;\n\nexport interface EngineServerValidateOrderResponse {\n product_id: number;\n order: string;\n valid: boolean;\n}\n\nexport interface EngineServerMaxOrderSizeResponse {\n max_order_size: string;\n}\n\nexport interface EngineServerMaxWithdrawableResponse {\n max_withdrawable: string;\n}\n\nexport type EngineServerTimeResponse = number;\n\nexport interface EngineServerIpBlockResponse {\n blocked: boolean;\n reason: string;\n}\n\nexport interface EngineServerLinkedSignerResponse {\n linked_signer: string;\n}\n\nexport interface EngineInsuranceResponse {\n insurance: string;\n}\n\nexport interface EngineServerMinDepositRate {\n product_id: number;\n min_deposit_rate_x18: string;\n}\n\nexport interface EngineServerMinDepositRatesResponse {\n // product_id -> EngineServerMinDepositRate\n min_deposit_rates: Record<number, EngineServerMinDepositRate>;\n}\n\nexport interface EngineServerEdgeAllProductsResponse {\n // chain_id -> EngineServerAllProductsResponse\n edge_all_products: Record<number, EngineServerAllProductsResponse>;\n}\n\nexport interface EngineServerMaxMintNlpResponse {\n max_quote_amount: string;\n}\n\nexport interface EngineServerQueryResponseByType {\n all_products: EngineServerAllProductsResponse;\n contracts: EngineServerContractsResponse;\n edge_all_products: EngineServerEdgeAllProductsResponse;\n fee_rates: EngineServerFeeRatesResponse;\n health_groups: EngineServerHealthGroupsResponse;\n insurance: EngineInsuranceResponse;\n isolated_positions: EngineServerIsolatedPositionsResponse;\n linked_signer: EngineServerLinkedSignerResponse;\n market_liquidity: EngineServerMarketLiquidityResponse;\n market_price: EngineServerMarketPriceResponse;\n market_prices: EngineServerMarketPricesResponse;\n max_nlp_mintable: EngineServerMaxMintNlpResponse;\n max_order_size: EngineServerMaxOrderSizeResponse;\n max_withdrawable: EngineServerMaxWithdrawableResponse;\n min_deposit_rates: EngineServerMinDepositRatesResponse;\n nonces: EngineServerNoncesResponse;\n order: EngineServerOrderResponse;\n orders: EngineServerProductOrdersResponse;\n status: EngineServerStatusResponse;\n subaccount_info: EngineServerSubaccountInfoResponse;\n subaccount_orders: EngineServerSubaccountOrdersResponse;\n symbols: EngineServerSymbolsResponse;\n validate_order: EngineServerValidateOrderResponse;\n}\n\nexport interface EngineServerQuerySuccessResponse<\n TQueryType extends\n keyof EngineServerQueryResponseByType = EngineServerQueryRequestType,\n> {\n status: 'success';\n data: EngineServerQueryResponseByType[TQueryType];\n}\n\nexport interface EngineServerQueryFailureResponse {\n status: 'failure';\n error: string;\n error_code: number;\n}\n\nexport type EngineServerQueryResponse<\n TQueryType extends\n keyof EngineServerQueryResponseByType = EngineServerQueryRequestType,\n> =\n | EngineServerQuerySuccessResponse<TQueryType>\n | EngineServerQueryFailureResponse;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/types/serverQueryTypes.ts"],"sourcesContent":["import { HealthStatus } from '@nadohq/shared';\nimport {\n EngineServerHealthBreakdown,\n EngineServerNlpBalance,\n EngineServerNlpLockedBalance,\n EngineServerOrder,\n EngineServerPerpBalance,\n EngineServerPerpProduct,\n EngineServerProductType,\n EngineServerSpotBalance,\n EngineServerSpotProduct,\n} from './serverQueryModelTypes';\n\nexport interface EngineServerNoncesParams {\n address: string;\n}\n\nexport interface EngineServerSubaccountInfoQueryParams {\n subaccount: string;\n txns?: Array<{\n apply_delta: {\n product_id: number;\n subaccount: string;\n amount_delta: string;\n v_quote_delta: string;\n };\n }>;\n}\n\nexport interface EngineServerIsolatedPositionsQueryParams {\n subaccount: string;\n}\n\nexport interface EngineServerSymbolsQueryParams {\n product_type?: EngineServerProductType;\n product_ids?: number[];\n}\n\nexport interface EngineServerMarketPriceQueryParams {\n product_id: number;\n}\n\nexport interface EngineServerMarketPricesQueryParams {\n product_ids: number[];\n}\n\nexport interface EngineServerGetOrderQueryParams {\n product_id: number;\n digest: string;\n}\n\nexport interface EngineServerValidateOrderQueryParams {\n product_id: number;\n // Bytes for order, does not need to be signed\n order: string;\n}\n\nexport interface EngineServerOrdersQueryParams {\n sender: string;\n product_ids: number[];\n}\n\nexport interface EngineServerSubaccountOrdersQueryParams {\n sender: string;\n product_id: number;\n}\n\nexport interface EngineServerSubaccountFeeRatesParams {\n sender: string;\n}\n\nexport interface EngineServerMarketLiquidityQueryParams {\n product_id: number;\n depth: number;\n}\n\nexport interface EngineServerMaxWithdrawableQueryParams {\n sender: string;\n product_id: number;\n // If not given, engine defaults to true (leverage/borrow enabled)\n spot_leverage: string | null;\n}\n\nexport interface EngineServerMaxOrderSizeQueryParams {\n sender: string;\n product_id: number;\n price_x18: string;\n // Note: When `reduce_only` is true, `direction` must be opposite of the current position, otherwise it returns 0.\n direction: 'long' | 'short';\n // If not given, engine defaults to true (leverage/borrow enabled)\n spot_leverage: string | null;\n // If not given, engine defaults to false. If true, the max order size will be capped to the subaccount's current position size;\n // If no position exists, it will return 0.\n reduce_only: string | null;\n isolated: string | null;\n // For isolated, max order size includes available collateral to transfer from parent cross subaccount\n // If not given, engine defaults to true (borrow enabled)\n borrow_margin: string | null;\n}\n\nexport interface EngineServerLinkedSignerParams {\n subaccount: string;\n}\n\nexport interface EngineServerMaxMintNlpQueryParams {\n sender: string;\n // If not given, engine defaults to true (leverage/borrow enabled)\n spot_leverage: string | null;\n}\n\nexport interface EngineServerMaxBurnNlpQueryParams {\n sender: string;\n}\n\nexport interface EngineServerNlpLockedBalancesQueryParams {\n subaccount: string;\n}\n\nexport interface EngineServerQueryRequestByType {\n all_products: Record<string, never>;\n contracts: Record<string, never>;\n edge_all_products: Record<string, never>;\n fee_rates: EngineServerSubaccountFeeRatesParams;\n health_groups: Record<string, never>;\n insurance: Record<string, never>;\n isolated_positions: EngineServerIsolatedPositionsQueryParams;\n linked_signer: EngineServerLinkedSignerParams;\n market_liquidity: EngineServerMarketLiquidityQueryParams;\n market_price: EngineServerMarketPriceQueryParams;\n market_prices: EngineServerMarketPricesQueryParams;\n max_nlp_burnable: EngineServerMaxBurnNlpQueryParams;\n max_nlp_mintable: EngineServerMaxMintNlpQueryParams;\n max_order_size: EngineServerMaxOrderSizeQueryParams;\n nlp_locked_balances: EngineServerNlpLockedBalancesQueryParams;\n nlp_pool_info: Record<string, never>;\n max_withdrawable: EngineServerMaxWithdrawableQueryParams;\n nonces: EngineServerNoncesParams;\n order: EngineServerGetOrderQueryParams;\n orders: EngineServerOrdersQueryParams;\n status: Record<string, never>;\n subaccount_info: Omit<EngineServerSubaccountInfoQueryParams, 'txns'> & {\n // JSON serialized txns\n txns?: string;\n };\n subaccount_orders: EngineServerSubaccountOrdersQueryParams;\n symbols: EngineServerSymbolsQueryParams;\n validate_order: EngineServerValidateOrderQueryParams;\n}\n\nexport type EngineServerQueryRequestType = keyof EngineServerQueryRequestByType;\n\nexport type EngineServerQueryRequest<\n TRequestType extends EngineServerQueryRequestType,\n> = {\n type: TRequestType;\n} & EngineServerQueryRequestByType[TRequestType];\n\nexport interface EngineServerContractsResponse {\n chain_id: string;\n endpoint_addr: string;\n}\n\n// Unless in active state, engine is not fully operational\nexport type EngineServerStatusResponse =\n | 'started'\n | 'active'\n | 'stopping'\n | 'syncing'\n | 'live_syncing'\n | 'failed';\n\nexport interface EngineServerNoncesResponse {\n order_nonce: string;\n tx_nonce: string;\n}\n\nexport interface EngineServerSubaccountInfoResponse {\n exists: boolean;\n subaccount: string;\n healths: [\n initial: EngineServerHealthBreakdown,\n maintenance: EngineServerHealthBreakdown,\n unweighted: EngineServerHealthBreakdown,\n ];\n // First index is product ID, each subarray is of length 3 [initial, maintenance, unweighted]\n health_contributions: string[][];\n spot_count: number;\n perp_count: number;\n spot_balances: EngineServerSpotBalance[];\n perp_balances: EngineServerPerpBalance[];\n spot_products: EngineServerSpotProduct[];\n perp_products: EngineServerPerpProduct[];\n}\n\nexport interface EngineServerIsolatedPosition {\n subaccount: string;\n healths: [\n initial: HealthStatus,\n maintenance: HealthStatus,\n unweighted: HealthStatus,\n ];\n quote_healths: [initial: string, maintenance: string, unweighted: string];\n base_healths: [initial: string, maintenance: string, unweighted: string];\n quote_balance: EngineServerSpotBalance;\n base_balance: EngineServerPerpBalance;\n quote_product: EngineServerSpotProduct;\n base_product: EngineServerPerpProduct;\n}\n\nexport type EngineServerIsolatedPositionsResponse = {\n isolated_positions: EngineServerIsolatedPosition[];\n};\n\nexport interface EngineServerSymbol {\n type: EngineServerProductType;\n product_id: number;\n symbol: string;\n price_increment_x18: string;\n size_increment: string;\n min_size: string;\n min_depth_x18: string;\n max_spread_rate_x18: string;\n maker_fee_rate_x18: string;\n taker_fee_rate_x18: string;\n long_weight_initial_x18: string;\n long_weight_maintenance_x18: string;\n}\n\nexport interface EngineServerSymbolsResponse {\n symbols: Record<string, EngineServerSymbol>;\n}\n\nexport interface EngineServerAllProductsResponse {\n spot_products: EngineServerSpotProduct[];\n perp_products: EngineServerPerpProduct[];\n}\n\nexport interface EngineServerHealthGroupsResponse {\n health_groups: [spotProductId: number, perpProductId: number][];\n}\n\n// Price, liquidity pairs\nexport type EngineServerPriceTickLiquidity = [\n priceX18: string,\n liquidity: string,\n];\n\nexport interface EngineServerMarketLiquidityResponse {\n bids: EngineServerPriceTickLiquidity[];\n asks: EngineServerPriceTickLiquidity[];\n}\n\nexport interface EngineServerSubaccountOrders {\n sender: string;\n product_id: number;\n orders: EngineServerOrder[];\n}\n\nexport type EngineServerSubaccountOrdersResponse = EngineServerSubaccountOrders;\n\nexport interface EngineServerProductOrdersResponse {\n sender: string;\n product_orders: EngineServerSubaccountOrders[];\n}\n\nexport interface EngineServerFeeRatesResponse {\n liquidation_sequencer_fee: string;\n health_check_sequencer_fee: string;\n taker_sequencer_fee: string;\n // Product ID is the index\n withdraw_sequencer_fees: string[];\n taker_fee_rates_x18: string[];\n maker_fee_rates_x18: string[];\n fee_tier: number;\n}\n\nexport interface EngineServerMarketPrice {\n product_id: number;\n bid_x18: string;\n ask_x18: string;\n}\n\nexport type EngineServerMarketPriceResponse = EngineServerMarketPrice;\n\nexport interface EngineServerMarketPricesResponse {\n market_prices: EngineServerMarketPrice[];\n}\n\nexport type EngineServerOrderResponse = EngineServerOrder;\n\nexport interface EngineServerValidateOrderResponse {\n product_id: number;\n order: string;\n valid: boolean;\n}\n\nexport interface EngineServerMaxOrderSizeResponse {\n max_order_size: string;\n}\n\nexport interface EngineServerMaxWithdrawableResponse {\n max_withdrawable: string;\n}\n\nexport type EngineServerTimeResponse = number;\n\nexport interface EngineServerIpBlockResponse {\n blocked: boolean;\n reason: string;\n}\n\nexport interface EngineServerLinkedSignerResponse {\n linked_signer: string;\n}\n\nexport interface EngineInsuranceResponse {\n insurance: string;\n}\n\nexport interface EngineServerEdgeAllProductsResponse {\n // chain_id -> EngineServerAllProductsResponse\n edge_all_products: Record<number, EngineServerAllProductsResponse>;\n}\n\nexport interface EngineServerMaxBurnNlpResponse {\n max_nlp_amount: string;\n}\n\nexport interface EngineServerMaxMintNlpResponse {\n max_quote_amount: string;\n}\n\nexport interface EngineServerNlpLockedBalancesResponse {\n balance_locked: EngineServerNlpBalance;\n balance_unlocked: EngineServerNlpBalance;\n locked_balances: EngineServerNlpLockedBalance[];\n}\n\nexport interface EngineServerNlpPool {\n pool_id: number;\n subaccount: string;\n owner: string;\n balance_weight_x18: string;\n subaccount_info: EngineServerSubaccountInfoResponse;\n open_orders: EngineServerOrder[];\n}\n\nexport interface EngineServerNlpPoolInfoResponse {\n nlp_pools: EngineServerNlpPool[];\n}\n\nexport interface EngineServerQueryResponseByType {\n all_products: EngineServerAllProductsResponse;\n contracts: EngineServerContractsResponse;\n edge_all_products: EngineServerEdgeAllProductsResponse;\n fee_rates: EngineServerFeeRatesResponse;\n health_groups: EngineServerHealthGroupsResponse;\n insurance: EngineInsuranceResponse;\n isolated_positions: EngineServerIsolatedPositionsResponse;\n linked_signer: EngineServerLinkedSignerResponse;\n market_liquidity: EngineServerMarketLiquidityResponse;\n market_price: EngineServerMarketPriceResponse;\n market_prices: EngineServerMarketPricesResponse;\n max_nlp_burnable: EngineServerMaxBurnNlpResponse;\n max_nlp_mintable: EngineServerMaxMintNlpResponse;\n max_order_size: EngineServerMaxOrderSizeResponse;\n nlp_locked_balances: EngineServerNlpLockedBalancesResponse;\n nlp_pool_info: EngineServerNlpPoolInfoResponse;\n max_withdrawable: EngineServerMaxWithdrawableResponse;\n nonces: EngineServerNoncesResponse;\n order: EngineServerOrderResponse;\n orders: EngineServerProductOrdersResponse;\n status: EngineServerStatusResponse;\n subaccount_info: EngineServerSubaccountInfoResponse;\n subaccount_orders: EngineServerSubaccountOrdersResponse;\n symbols: EngineServerSymbolsResponse;\n validate_order: EngineServerValidateOrderResponse;\n}\n\nexport interface EngineServerQuerySuccessResponse<\n TQueryType extends\n keyof EngineServerQueryResponseByType = EngineServerQueryRequestType,\n> {\n status: 'success';\n data: EngineServerQueryResponseByType[TQueryType];\n}\n\nexport interface EngineServerQueryFailureResponse {\n status: 'failure';\n error: string;\n error_code: number;\n}\n\nexport type EngineServerQueryResponse<\n TQueryType extends\n keyof EngineServerQueryResponseByType = EngineServerQueryRequestType,\n> =\n | EngineServerQuerySuccessResponse<TQueryType>\n | EngineServerQueryFailureResponse;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|