@nadohq/engine-client 0.1.0-alpha.16 → 0.1.0-alpha.17
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/EngineQueryClient.cjs +14 -0
- package/dist/EngineQueryClient.cjs.map +1 -1
- package/dist/EngineQueryClient.d.cts +7 -1
- package/dist/EngineQueryClient.d.ts +7 -1
- package/dist/EngineQueryClient.js +15 -0
- package/dist/EngineQueryClient.js.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/types/clientQueryTypes.cjs.map +1 -1
- package/dist/types/clientQueryTypes.d.cts +14 -1
- package/dist/types/clientQueryTypes.d.ts +14 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/serverQueryTypes.cjs.map +1 -1
- package/dist/types/serverQueryTypes.d.cts +20 -1
- package/dist/types/serverQueryTypes.d.ts +20 -1
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/queryDataMappers.cjs +20 -0
- package/dist/utils/queryDataMappers.cjs.map +1 -1
- package/dist/utils/queryDataMappers.d.cts +4 -3
- package/dist/utils/queryDataMappers.d.ts +4 -3
- package/dist/utils/queryDataMappers.js +19 -0
- package/dist/utils/queryDataMappers.js.map +1 -1
- package/package.json +3 -3
- package/src/EngineQueryClient.ts +21 -0
- package/src/types/clientQueryTypes.ts +17 -0
- package/src/types/serverQueryTypes.ts +23 -0
- package/src/utils/queryDataMappers.ts +26 -0
|
@@ -13,10 +13,12 @@ import {
|
|
|
13
13
|
} from '@nadohq/shared';
|
|
14
14
|
import {
|
|
15
15
|
EngineMarketPrice,
|
|
16
|
+
EngineNlpLockedBalance,
|
|
16
17
|
EngineOrder,
|
|
17
18
|
EnginePriceTickLiquidity,
|
|
18
19
|
EngineServerIsolatedPositionsResponse,
|
|
19
20
|
EngineServerMarketPrice,
|
|
21
|
+
EngineServerNlpLockedBalancesResponse,
|
|
20
22
|
EngineServerOrderResponse,
|
|
21
23
|
EngineServerPerpProduct,
|
|
22
24
|
EngineServerPriceTickLiquidity,
|
|
@@ -27,6 +29,7 @@ import {
|
|
|
27
29
|
EngineSymbol,
|
|
28
30
|
EngineSymbolsResponse,
|
|
29
31
|
GetEngineIsolatedPositionsResponse,
|
|
32
|
+
GetEngineNlpLockedBalancesResponse,
|
|
30
33
|
GetEngineSubaccountSummaryResponse,
|
|
31
34
|
} from '../types';
|
|
32
35
|
import { mapEngineServerProductType } from './productEngineTypeMappers';
|
|
@@ -288,3 +291,26 @@ export function mapEngineMarketPrice(
|
|
|
288
291
|
productId: baseResponse.product_id,
|
|
289
292
|
};
|
|
290
293
|
}
|
|
294
|
+
|
|
295
|
+
export function mapEngineServerNlpLockedBalances(
|
|
296
|
+
baseResponse: EngineServerNlpLockedBalancesResponse,
|
|
297
|
+
): GetEngineNlpLockedBalancesResponse {
|
|
298
|
+
const lockedBalances: EngineNlpLockedBalance[] =
|
|
299
|
+
baseResponse.locked_balances.map((lockedBalance) => ({
|
|
300
|
+
productId: lockedBalance.product_id,
|
|
301
|
+
balance: toBigDecimal(lockedBalance.balance.amount),
|
|
302
|
+
unlockedAt: lockedBalance.unlocked_at,
|
|
303
|
+
}));
|
|
304
|
+
|
|
305
|
+
return {
|
|
306
|
+
lockedBalances,
|
|
307
|
+
balanceLocked: {
|
|
308
|
+
productId: baseResponse.balance_locked.product_id,
|
|
309
|
+
balance: toBigDecimal(baseResponse.balance_locked.balance.amount),
|
|
310
|
+
},
|
|
311
|
+
balanceUnlocked: {
|
|
312
|
+
productId: baseResponse.balance_unlocked.product_id,
|
|
313
|
+
balance: toBigDecimal(baseResponse.balance_unlocked.balance.amount),
|
|
314
|
+
},
|
|
315
|
+
};
|
|
316
|
+
}
|