@nadohq/indexer-client 0.41.0 → 0.42.0

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.
Files changed (115) hide show
  1. package/dist/{IndexerBaseClient-jaeUYv71.cjs → IndexerBaseClient-CSn4twzz.cjs} +36 -1
  2. package/dist/IndexerBaseClient-CSn4twzz.cjs.map +1 -0
  3. package/dist/IndexerBaseClient.cjs +1 -1
  4. package/dist/IndexerBaseClient.d.cts +16 -2
  5. package/dist/IndexerBaseClient.d.cts.map +1 -1
  6. package/dist/IndexerBaseClient.d.ts +16 -2
  7. package/dist/IndexerBaseClient.d.ts.map +1 -1
  8. package/dist/IndexerBaseClient.js +36 -1
  9. package/dist/IndexerBaseClient.js.map +1 -1
  10. package/dist/IndexerClient.cjs +1 -1
  11. package/dist/IndexerClient.d.cts +1 -1
  12. package/dist/IndexerClient.d.ts +1 -1
  13. package/dist/IndexerEventType-BFvrhslw.d.ts +10 -0
  14. package/dist/IndexerEventType-BFvrhslw.d.ts.map +1 -0
  15. package/dist/IndexerEventType-BpH10mEW.d.cts +10 -0
  16. package/dist/IndexerEventType-BpH10mEW.d.cts.map +1 -0
  17. package/dist/{IndexerServerFailureError-ClC8vkmR.d.ts → IndexerServerFailureError-BoGd4gih.d.ts} +2 -2
  18. package/dist/{IndexerServerFailureError-ClC8vkmR.d.ts.map → IndexerServerFailureError-BoGd4gih.d.ts.map} +1 -1
  19. package/dist/{IndexerServerFailureError-BMmMPfFJ.d.cts → IndexerServerFailureError-D-KNqVt3.d.cts} +2 -2
  20. package/dist/{IndexerServerFailureError-BMmMPfFJ.d.cts.map → IndexerServerFailureError-D-KNqVt3.d.cts.map} +1 -1
  21. package/dist/{NadoTx-Bd4U-zDu.d.ts → NadoTx-4BQkGyHz.d.cts} +3 -8
  22. package/dist/NadoTx-4BQkGyHz.d.cts.map +1 -0
  23. package/dist/{NadoTx-C3_f0YvI.d.cts → NadoTx-DPrcN9Eo.d.ts} +3 -8
  24. package/dist/NadoTx-DPrcN9Eo.d.ts.map +1 -0
  25. package/dist/{clientTypes-BLKeWmIr.d.ts → clientTypes-CnswaLwH.d.ts} +107 -5
  26. package/dist/clientTypes-CnswaLwH.d.ts.map +1 -0
  27. package/dist/{clientTypes-QBgifUeV.d.cts → clientTypes-DS2w6Osq.d.cts} +107 -5
  28. package/dist/clientTypes-DS2w6Osq.d.cts.map +1 -0
  29. package/dist/{collateralEventType-s-WbBniE.d.ts → collateralEventType-AJY6oQt6.d.ts} +2 -2
  30. package/dist/collateralEventType-AJY6oQt6.d.ts.map +1 -0
  31. package/dist/{collateralEventType-CNrryEno.d.cts → collateralEventType-f2RJiAwy.d.cts} +2 -2
  32. package/dist/collateralEventType-f2RJiAwy.d.cts.map +1 -0
  33. package/dist/dataMappers.cjs +38 -1
  34. package/dist/dataMappers.cjs.map +1 -1
  35. package/dist/dataMappers.d.cts +10 -4
  36. package/dist/dataMappers.d.cts.map +1 -1
  37. package/dist/dataMappers.d.ts +10 -4
  38. package/dist/dataMappers.d.ts.map +1 -1
  39. package/dist/dataMappers.js +37 -1
  40. package/dist/dataMappers.js.map +1 -1
  41. package/dist/index.cjs +3 -1
  42. package/dist/index.d.cts +10 -10
  43. package/dist/index.d.ts +10 -10
  44. package/dist/index.js +2 -1
  45. package/dist/{indexerBalanceValue-ZJec8hfI.d.ts → indexerBalanceValue-DV3dtvyV.d.ts} +2 -2
  46. package/dist/{indexerBalanceValue-ZJec8hfI.d.ts.map → indexerBalanceValue-DV3dtvyV.d.ts.map} +1 -1
  47. package/dist/{indexerBalanceValue-DqMAvUsj.d.cts → indexerBalanceValue-yMyf537D.d.cts} +2 -2
  48. package/dist/{indexerBalanceValue-DqMAvUsj.d.cts.map → indexerBalanceValue-yMyf537D.d.cts.map} +1 -1
  49. package/dist/{paginatedEventsTypes-D668Hgzl.d.ts → paginatedEventsTypes-BT--OHd5.d.ts} +4 -4
  50. package/dist/{paginatedEventsTypes-D668Hgzl.d.ts.map → paginatedEventsTypes-BT--OHd5.d.ts.map} +1 -1
  51. package/dist/{paginatedEventsTypes-4I9Ibp9q.d.cts → paginatedEventsTypes-DZllHmqY.d.cts} +4 -4
  52. package/dist/{paginatedEventsTypes-4I9Ibp9q.d.cts.map → paginatedEventsTypes-DZllHmqY.d.cts.map} +1 -1
  53. package/dist/{serverModelTypes-BAZNgoLE.d.ts → serverModelTypes-B78obnnd.d.ts} +40 -4
  54. package/dist/serverModelTypes-B78obnnd.d.ts.map +1 -0
  55. package/dist/{serverModelTypes-DC4dsX9i.d.cts → serverModelTypes-vhALknbV.d.cts} +40 -4
  56. package/dist/serverModelTypes-vhALknbV.d.cts.map +1 -0
  57. package/dist/{serverTypes-DeUDMCog.d.cts → serverTypes-CyqBF-nt.d.cts} +29 -5
  58. package/dist/serverTypes-CyqBF-nt.d.cts.map +1 -0
  59. package/dist/{serverTypes-BQafrknp.d.ts → serverTypes-Dod9cCEW.d.ts} +29 -5
  60. package/dist/serverTypes-Dod9cCEW.d.ts.map +1 -0
  61. package/dist/types/IndexerEventType.cjs +23 -0
  62. package/dist/types/IndexerEventType.cjs.map +1 -0
  63. package/dist/types/IndexerEventType.d.cts +2 -2
  64. package/dist/types/IndexerEventType.d.ts +2 -2
  65. package/dist/types/IndexerEventType.js +22 -1
  66. package/dist/types/IndexerEventType.js.map +1 -0
  67. package/dist/types/IndexerServerFailureError.cjs +1 -1
  68. package/dist/types/IndexerServerFailureError.d.cts +1 -1
  69. package/dist/types/IndexerServerFailureError.d.ts +1 -1
  70. package/dist/types/NadoTx.d.cts +2 -2
  71. package/dist/types/NadoTx.d.ts +2 -2
  72. package/dist/types/clientTypes.d.cts +2 -2
  73. package/dist/types/clientTypes.d.ts +2 -2
  74. package/dist/types/collateralEventType.d.cts +1 -1
  75. package/dist/types/collateralEventType.d.ts +1 -1
  76. package/dist/types/index.cjs +2 -0
  77. package/dist/types/index.d.cts +9 -9
  78. package/dist/types/index.d.ts +9 -9
  79. package/dist/types/index.js +2 -1
  80. package/dist/types/indexerErrorCodes.cjs +1 -1
  81. package/dist/types/paginatedEventsTypes.d.cts +1 -1
  82. package/dist/types/paginatedEventsTypes.d.ts +1 -1
  83. package/dist/types/serverModelTypes.d.cts +2 -2
  84. package/dist/types/serverModelTypes.d.ts +2 -2
  85. package/dist/types/serverTypes.cjs.map +1 -1
  86. package/dist/types/serverTypes.d.cts +2 -2
  87. package/dist/types/serverTypes.d.ts +2 -2
  88. package/dist/types/serverTypes.js.map +1 -1
  89. package/dist/utils/index.d.cts +1 -1
  90. package/dist/utils/index.d.ts +1 -1
  91. package/dist/utils/indexerBalanceValue.d.cts +1 -1
  92. package/dist/utils/indexerBalanceValue.d.ts +1 -1
  93. package/package.json +4 -4
  94. package/src/IndexerBaseClient.ts +50 -0
  95. package/src/dataMappers.ts +41 -0
  96. package/src/types/IndexerEventType.ts +19 -11
  97. package/src/types/NadoTx.ts +0 -7
  98. package/src/types/clientTypes.ts +106 -0
  99. package/src/types/serverModelTypes.ts +59 -0
  100. package/src/types/serverTypes.ts +33 -0
  101. package/dist/IndexerBaseClient-jaeUYv71.cjs.map +0 -1
  102. package/dist/IndexerEventType-9GB2zRoN.d.cts +0 -5
  103. package/dist/IndexerEventType-9GB2zRoN.d.cts.map +0 -1
  104. package/dist/IndexerEventType-Brm9aX8w.d.ts +0 -5
  105. package/dist/IndexerEventType-Brm9aX8w.d.ts.map +0 -1
  106. package/dist/NadoTx-Bd4U-zDu.d.ts.map +0 -1
  107. package/dist/NadoTx-C3_f0YvI.d.cts.map +0 -1
  108. package/dist/clientTypes-BLKeWmIr.d.ts.map +0 -1
  109. package/dist/clientTypes-QBgifUeV.d.cts.map +0 -1
  110. package/dist/collateralEventType-CNrryEno.d.cts.map +0 -1
  111. package/dist/collateralEventType-s-WbBniE.d.ts.map +0 -1
  112. package/dist/serverModelTypes-BAZNgoLE.d.ts.map +0 -1
  113. package/dist/serverModelTypes-DC4dsX9i.d.cts.map +0 -1
  114. package/dist/serverTypes-BQafrknp.d.ts.map +0 -1
  115. package/dist/serverTypes-DeUDMCog.d.cts.map +0 -1
@@ -1,8 +1,8 @@
1
1
  import { t as CandlestickPeriod } from "./CandlestickPeriod-D3_IoSev.cjs";
2
- import { t as IndexerEventType } from "./IndexerEventType-9GB2zRoN.cjs";
2
+ import { n as IndexerEventType } from "./IndexerEventType-BpH10mEW.cjs";
3
3
  import { t as IndexerLeaderboardRankType } from "./IndexerLeaderboardType-Ck12QVWR.cjs";
4
- import { c as NadoWithdrawCollateralV2Tx, o as NadoTx, s as NadoWithdrawCollateralTx } from "./NadoTx-C3_f0YvI.cjs";
5
- import { E as IndexerServerFastWithdrawalSignatureParams, Ut as IndexerServerTriggerTypeFilter, Z as IndexerServerListSubaccountsParams, y as IndexerServerCashIncentivesWalletStatus } from "./serverTypes-DeUDMCog.cjs";
4
+ import { a as NadoTx, o as NadoWithdrawCollateralTx, s as NadoWithdrawCollateralV2Tx } from "./NadoTx-4BQkGyHz.cjs";
5
+ import { E as IndexerServerFastWithdrawalSignatureParams, Gt as IndexerServerTriggerTypeFilter, Z as IndexerServerListSubaccountsParams, y as IndexerServerCashIncentivesWalletStatus } from "./serverTypes-CyqBF-nt.cjs";
6
6
  import { EIP712OrderValues, Market, OrderAppendix, PerpBalance, PerpMarket, ProductEngineType, SignatureParams, SpotBalance, SpotMarket, Subaccount } from "@nadohq/shared";
7
7
  import BigNumber from "bignumber.js";
8
8
  import { Address, Hex } from "viem";
@@ -381,6 +381,108 @@ interface IndexerMatchEvent extends Subaccount {
381
381
  margin: BigNumber | null;
382
382
  }
383
383
  type GetIndexerMatchEventsResponse = IndexerMatchEvent[];
384
+ /**
385
+ * Position history
386
+ */
387
+ /**
388
+ * Params for querying a subaccount's historical positions. All parameters except
389
+ * `subaccount` are optional filters.
390
+ */
391
+ interface GetIndexerPositionsParams {
392
+ /**
393
+ * Subaccount to query. Isolated positions are also returned under the parent
394
+ * subaccount, so always query with the parent.
395
+ */
396
+ subaccount: Subaccount;
397
+ /** When provided, only return positions of the specified product. */
398
+ productId?: number;
399
+ /** `true`: only isolated positions, `false`: only cross positions. Omit for both. */
400
+ isolated?: boolean;
401
+ /** `true`: only positions that are still open, `false`: only closed positions. Omit for both. */
402
+ open?: boolean;
403
+ /**
404
+ * Max `openId`, inclusive. To paginate, pass the last returned position's
405
+ * `openId - 1` as the next request's `startCursor`.
406
+ */
407
+ startCursor?: string;
408
+ /** Max number of positions to return. Defaults to 100, max 500. */
409
+ limit?: number;
410
+ }
411
+ /**
412
+ * A historical position for a subaccount in a product. A position opens when the balance
413
+ * goes from zero to non-zero or flips direction, and closes when the balance returns to
414
+ * zero or flips again. All amount fields are absolute values; the side of the position is
415
+ * given by `direction`.
416
+ */
417
+ interface IndexerPosition {
418
+ /** Subaccount hex ID associated with the position. */
419
+ subaccount: string;
420
+ productId: number;
421
+ isolated: boolean;
422
+ /** Direction of the position. `true` for long, `false` for short. */
423
+ direction: boolean;
424
+ /** `submissionIndex` of the transaction that opened the position. */
425
+ openId: string;
426
+ /** `submissionIndex` of the transaction that closed the position; `-1` if still open. */
427
+ closeId: string;
428
+ /** `submissionIndex` of the last transaction that updated the position. */
429
+ submissionIndex: string;
430
+ /** Current size of the position; `0` once the position is closed. */
431
+ amount: BigNumber;
432
+ /** Peak size reached by the position. */
433
+ maxAmount: BigNumber;
434
+ /** Total amount opened on this position. */
435
+ totalOpenAmount: BigNumber;
436
+ /** Total amount closed on this position. */
437
+ totalCloseAmount: BigNumber;
438
+ /** Volume-weighted average entry price of the position. */
439
+ averageEntryPrice: BigNumber;
440
+ /** Volume-weighted average exit price of the position. */
441
+ averageExitPrice: BigNumber;
442
+ /** Total amount closed by liquidations on this position. */
443
+ liquidatedAmount: BigNumber;
444
+ /**
445
+ * Peak leverage reached by the isolated position; `0` for cross positions.
446
+ * Set to `i128::MAX` (decimal adjusted) when the position's equity is below zero.
447
+ */
448
+ maxIsolatedLeverage: BigNumber;
449
+ /** Total fees paid on fills that increased the position. */
450
+ openFee: BigNumber;
451
+ /** Total fees paid on fills that decreased the position. */
452
+ closeFee: BigNumber;
453
+ /** Realized PnL for this position. */
454
+ realizedPnl: BigNumber;
455
+ /** Unix epoch in seconds of when the position was opened. */
456
+ openTimestamp: BigNumber;
457
+ /** Unix epoch in seconds of when the position was last updated. */
458
+ updateTimestamp: BigNumber;
459
+ /** The transaction type that opened the position, e.g. `match_orders`. */
460
+ openReason: IndexerEventType;
461
+ /** The transaction type that closed the position; `null` if still open. */
462
+ closeReason: IndexerEventType | null;
463
+ /** Net funding payment on this position. Only for perp positions. */
464
+ netFundingPayment: BigNumber;
465
+ /** Net interest payment on this position. Only for spot positions. */
466
+ netInterestPayment: BigNumber;
467
+ /** Digest of the order that opened the position; `null` if not opened by a match. */
468
+ openDigest: string | null;
469
+ /** Digest of the order that closed the position; `null` if not closed by a match or still open. */
470
+ closeDigest: string | null;
471
+ netEntryUnrealized: BigNumber;
472
+ }
473
+ /**
474
+ * Response for the positions query.
475
+ */
476
+ interface GetIndexerPositionsResponse {
477
+ /** Positions in descending order by `openId`. */
478
+ positions: IndexerPosition[];
479
+ /**
480
+ * Events (with their transactions) at each position's boundaries: open and close, or
481
+ * open and latest update while still open. Join them to positions via
482
+ * `openId` / `closeId` / `submissionIndex`.
483
+ */
484
+ events: IndexerEventWithTx[];
485
+ }
384
486
  /**
385
487
  * Quote price
386
488
  */
@@ -890,5 +992,5 @@ interface IndexerV2Symbol {
890
992
  */
891
993
  type GetIndexerV2SymbolsResponse = Record<string, IndexerV2Symbol>;
892
994
  //#endregion
893
- export { GetIndexerOrdersResponse as $, IndexerPointsEpoch as $t, GetIndexerLeaderboardRegistrationsResponse as A, IndexerCashIncentivesWalletSummary as At, GetIndexerMultiProductFundingRatesParams as B, IndexerLeaderboardParticipant as Bt, GetIndexerInterestFundingPaymentsResponse as C, RevokeSocialAccountParams as Cn, IndexerCashIncentivesClaimableClaim as Ct, GetIndexerLeaderboardParticipantParams as D, IndexerCashIncentivesEventWallet as Dt, GetIndexerLeaderboardParams as E, IndexerCashIncentivesEventPlatform as Et, GetIndexerMakerStatisticsResponse as F, IndexerEventWithTx as Ft, GetIndexerMultiProductSnapshotsResponse as G, IndexerMarketSnapshot as Gt, GetIndexerMultiProductPerpPricesParams as H, IndexerLeaderboardTrackPosition as Ht, GetIndexerMarketSnapshotsParams as I, IndexerFundingRate as It, GetIndexerNlpSnapshotsParams as J, IndexerNlpSnapshot as Jt, GetIndexerMultiSubaccountSnapshotsParams as K, IndexerMatchEvent as Kt, GetIndexerMarketSnapshotsResponse as L, IndexerFundingRateHistoryEntry as Lt, GetIndexerLinkedSignerParams as M, IndexerEventBalanceStateSnapshot as Mt, GetIndexerLinkedSignerResponse as N, IndexerEventPerpStateSnapshot as Nt, GetIndexerLeaderboardParticipantResponse as O, IndexerCashIncentivesUnclaimableClaim as Ot, GetIndexerMakerStatisticsParams as P, IndexerEventSpotStateSnapshot as Pt, GetIndexerOrdersParams as Q, IndexerPerpPrices as Qt, GetIndexerMatchEventsParams as R, IndexerLeaderboardContest as Rt, GetIndexerInterestFundingPaymentsParams as S, RegisterLeaderboardResponse as Sn, IndexerBalanceTrackedVars as St, GetIndexerLeaderboardContestsResponse as T, TickerMarketType as Tn, IndexerCashIncentivesEventMetadata as Tt, GetIndexerMultiProductPerpPricesResponse as U, IndexerMaker as Ut, GetIndexerMultiProductFundingRatesResponse as V, IndexerLeaderboardRegistration as Vt, GetIndexerMultiProductSnapshotsParams as W, IndexerMakerSnapshot as Wt, GetIndexerOraclePricesParams as X, IndexerOrder as Xt, GetIndexerNlpSnapshotsResponse as Y, IndexerOraclePrice as Yt, GetIndexerOraclePricesResponse as Z, IndexerPerpBalance as Zt, GetIndexerFastWithdrawalSignatureResponse as _, ListIndexerSocialAccountsParams as _n, GetIndexerV2TickersParams as _t, GetIndexerCandlesticksParams as a, IndexerSnapshotBalance as an, GetIndexerPortfolioResponse as at, GetIndexerFundingRateParams as b, ListIndexerSubaccountsResponse as bn, GetIndexerXPointsResponse as bt, GetIndexerCashIncentivesResponse as c, IndexerSpotBalance as cn, GetIndexerProductSnapshotsParams as ct, GetIndexerEdgeMarketSnapshotResponse as d, IndexerV2Symbol as dn, GetIndexerReferralCodeParams as dt, IndexerPortfolioHistory as en, GetIndexerPerpPricesParams as et, GetIndexerEdgeMarketSnapshotsParams as f, IndexerV2TickerResponse as fn, GetIndexerReferralCodeResponse as ft, GetIndexerFastWithdrawalSignatureParams as g, IndexerXPointsQuest as gn, GetIndexerV2SymbolsResponse as gt, GetIndexerEventsResponse as h, IndexerXPointsEpoch as hn, GetIndexerV2SymbolsParams as ht, GetIndexerBacklogResponse as i, IndexerProductSnapshot as in, GetIndexerPortfolioParams as it, GetIndexerLeaderboardResponse as j, IndexerEvent as jt, GetIndexerLeaderboardRegistrationsParams as k, IndexerCashIncentivesWalletClaim as kt, GetIndexerEdgeCandlesticksParams as l, IndexerSubaccountSnapshot as ln, GetIndexerProductSnapshotsResponse as lt, GetIndexerEventsParams as m, IndexerXPointsAllTime as mn, GetIndexerSubaccountDDAResponse as mt, ConnectSocialAccountParams as n, IndexerPortfolioPoint as nn, GetIndexerPointsParams as nt, GetIndexerCandlesticksResponse as o, IndexerSnapshotsIntervalParams as on, GetIndexerPrivateAlphaChoiceParams as ot, GetIndexerEventsLimitType as p, IndexerV2TradingStatus as pn, GetIndexerSubaccountDDAParams as pt, GetIndexerMultiSubaccountSnapshotsResponse as q, IndexerMatchEventBalances as qt, ConnectSocialAccountResponse as r, IndexerProductPayment as rn, GetIndexerPointsResponse as rt, GetIndexerCashIncentivesParams as s, IndexerSocialAccountInfo as sn, GetIndexerPrivateAlphaChoiceResponse as st, Candlestick as t, IndexerPortfolioPeriod as tn, GetIndexerPerpPricesResponse as tt, GetIndexerEdgeCandlesticksResponse as u, IndexerV2MarketHours as un, GetIndexerQuotePriceResponse as ut, GetIndexerFundingRateHistoryParams as v, ListIndexerSocialAccountsResponse as vn, GetIndexerV2TickersResponse as vt, GetIndexerLeaderboardContestsParams as w, RevokeSocialAccountResponse as wn, IndexerCashIncentivesEvent as wt, GetIndexerFundingRateResponse as x, RegisterLeaderboardParams as xn, IndexerAllTimePoints as xt, GetIndexerFundingRateHistoryResponse as y, ListIndexerSubaccountsParams as yn, GetIndexerXPointsParams as yt, GetIndexerMatchEventsResponse as z, IndexerLeaderboardContestTrack as zt };
894
- //# sourceMappingURL=clientTypes-QBgifUeV.d.cts.map
995
+ export { GetIndexerOrdersResponse as $, IndexerPerpBalance as $t, GetIndexerLeaderboardRegistrationsResponse as A, IndexerCashIncentivesUnclaimableClaim as At, GetIndexerMultiProductFundingRatesParams as B, IndexerLeaderboardContest as Bt, GetIndexerInterestFundingPaymentsResponse as C, ListIndexerSubaccountsResponse as Cn, IndexerAllTimePoints as Ct, GetIndexerLeaderboardParticipantParams as D, RevokeSocialAccountResponse as Dn, IndexerCashIncentivesEventMetadata as Dt, GetIndexerLeaderboardParams as E, RevokeSocialAccountParams as En, IndexerCashIncentivesEvent as Et, GetIndexerMakerStatisticsResponse as F, IndexerEventPerpStateSnapshot as Ft, GetIndexerMultiProductSnapshotsResponse as G, IndexerMaker as Gt, GetIndexerMultiProductPerpPricesParams as H, IndexerLeaderboardParticipant as Ht, GetIndexerMarketSnapshotsParams as I, IndexerEventSpotStateSnapshot as It, GetIndexerNlpSnapshotsParams as J, IndexerMatchEvent as Jt, GetIndexerMultiSubaccountSnapshotsParams as K, IndexerMakerSnapshot as Kt, GetIndexerMarketSnapshotsResponse as L, IndexerEventWithTx as Lt, GetIndexerLinkedSignerParams as M, IndexerCashIncentivesWalletSummary as Mt, GetIndexerLinkedSignerResponse as N, IndexerEvent as Nt, GetIndexerLeaderboardParticipantResponse as O, TickerMarketType as On, IndexerCashIncentivesEventPlatform as Ot, GetIndexerMakerStatisticsParams as P, IndexerEventBalanceStateSnapshot as Pt, GetIndexerOrdersParams as Q, IndexerOrder as Qt, GetIndexerMatchEventsParams as R, IndexerFundingRate as Rt, GetIndexerInterestFundingPaymentsParams as S, ListIndexerSubaccountsParams as Sn, GetIndexerXPointsResponse as St, GetIndexerLeaderboardContestsResponse as T, RegisterLeaderboardResponse as Tn, IndexerCashIncentivesClaimableClaim as Tt, GetIndexerMultiProductPerpPricesResponse as U, IndexerLeaderboardRegistration as Ut, GetIndexerMultiProductFundingRatesResponse as V, IndexerLeaderboardContestTrack as Vt, GetIndexerMultiProductSnapshotsParams as W, IndexerLeaderboardTrackPosition as Wt, GetIndexerOraclePricesParams as X, IndexerNlpSnapshot as Xt, GetIndexerNlpSnapshotsResponse as Y, IndexerMatchEventBalances as Yt, GetIndexerOraclePricesResponse as Z, IndexerOraclePrice as Zt, GetIndexerFastWithdrawalSignatureResponse as _, IndexerXPointsAllTime as _n, GetIndexerV2SymbolsParams as _t, GetIndexerCandlesticksParams as a, IndexerPosition as an, GetIndexerPortfolioResponse as at, GetIndexerFundingRateParams as b, ListIndexerSocialAccountsParams as bn, GetIndexerV2TickersResponse as bt, GetIndexerCashIncentivesResponse as c, IndexerSnapshotBalance as cn, GetIndexerPrivateAlphaChoiceParams as ct, GetIndexerEdgeMarketSnapshotResponse as d, IndexerSpotBalance as dn, GetIndexerProductSnapshotsResponse as dt, IndexerPerpPrices as en, GetIndexerPerpPricesParams as et, GetIndexerEdgeMarketSnapshotsParams as f, IndexerSubaccountSnapshot as fn, GetIndexerQuotePriceResponse as ft, GetIndexerFastWithdrawalSignatureParams as g, IndexerV2TradingStatus as gn, GetIndexerSubaccountDDAResponse as gt, GetIndexerEventsResponse as h, IndexerV2TickerResponse as hn, GetIndexerSubaccountDDAParams as ht, GetIndexerBacklogResponse as i, IndexerPortfolioPoint as in, GetIndexerPortfolioParams as it, GetIndexerLeaderboardResponse as j, IndexerCashIncentivesWalletClaim as jt, GetIndexerLeaderboardRegistrationsParams as k, IndexerCashIncentivesEventWallet as kt, GetIndexerEdgeCandlesticksParams as l, IndexerSnapshotsIntervalParams as ln, GetIndexerPrivateAlphaChoiceResponse as lt, GetIndexerEventsParams as m, IndexerV2Symbol as mn, GetIndexerReferralCodeResponse as mt, ConnectSocialAccountParams as n, IndexerPortfolioHistory as nn, GetIndexerPointsParams as nt, GetIndexerCandlesticksResponse as o, IndexerProductPayment as on, GetIndexerPositionsParams as ot, GetIndexerEventsLimitType as p, IndexerV2MarketHours as pn, GetIndexerReferralCodeParams as pt, GetIndexerMultiSubaccountSnapshotsResponse as q, IndexerMarketSnapshot as qt, ConnectSocialAccountResponse as r, IndexerPortfolioPeriod as rn, GetIndexerPointsResponse as rt, GetIndexerCashIncentivesParams as s, IndexerProductSnapshot as sn, GetIndexerPositionsResponse as st, Candlestick as t, IndexerPointsEpoch as tn, GetIndexerPerpPricesResponse as tt, GetIndexerEdgeCandlesticksResponse as u, IndexerSocialAccountInfo as un, GetIndexerProductSnapshotsParams as ut, GetIndexerFundingRateHistoryParams as v, IndexerXPointsEpoch as vn, GetIndexerV2SymbolsResponse as vt, GetIndexerLeaderboardContestsParams as w, RegisterLeaderboardParams as wn, IndexerBalanceTrackedVars as wt, GetIndexerFundingRateResponse as x, ListIndexerSocialAccountsResponse as xn, GetIndexerXPointsParams as xt, GetIndexerFundingRateHistoryResponse as y, IndexerXPointsQuest as yn, GetIndexerV2TickersParams as yt, GetIndexerMatchEventsResponse as z, IndexerFundingRateHistoryEntry as zt };
996
+ //# sourceMappingURL=clientTypes-DS2w6Osq.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientTypes-DS2w6Osq.d.cts","names":[],"sources":["../src/types/src/types/clientTypes.ts"],"mappings":";;;;;;;;;;;;AAiCA;KAAY,kBAAA,GAAqB,IAAI,CAAC,WAAA;AAAA,KAE1B,kBAAA,GAAqB,IAAI,CAAC,WAAA;AAAA,UAErB,6BAAA;EACf,IAAA,EAAM,iBAAA,CAAkB,IAAA;EACxB,UAAA,EAAY,kBAAA;EACZ,WAAA,EAAa,kBAAA;EACb,MAAA,EAAQ,UAAA;AAAA;AAAA,UAGO,6BAAA;EACf,IAAA,EAAM,iBAAA,CAAkB,IAAA;EACxB,UAAA,EAAY,kBAAA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BE;;;;EAgkBf,SAAA;EA/jBkB;EAikBlB,eAAA;EAhkBiB;EAkkBjB,eAAA;AAAA;AAjkBU;AAOZ;;;AAPY,KAwkBA,2BAAA,GAA8B,MAAM,SAAS,eAAA"}
@@ -1,7 +1,7 @@
1
- import { t as IndexerEventType } from "./IndexerEventType-Brm9aX8w.js";
1
+ import { n as IndexerEventType } from "./IndexerEventType-BFvrhslw.js";
2
2
 
3
3
  //#region src/types/collateralEventType.d.ts
4
4
  type CollateralEventType = Extract<IndexerEventType, 'deposit_collateral' | 'withdraw_collateral' | 'withdraw_collateral_v2' | 'transfer_quote'>;
5
5
  //#endregion
6
6
  export { CollateralEventType as t };
7
- //# sourceMappingURL=collateralEventType-s-WbBniE.d.ts.map
7
+ //# sourceMappingURL=collateralEventType-AJY6oQt6.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collateralEventType-AJY6oQt6.d.ts","names":[],"sources":["../src/types/src/types/collateralEventType.ts"],"mappings":";;;KAEY,mBAAA,GAAsB,OAAO,CACvC,gBAAA"}
@@ -1,7 +1,7 @@
1
- import { t as IndexerEventType } from "./IndexerEventType-9GB2zRoN.cjs";
1
+ import { n as IndexerEventType } from "./IndexerEventType-BpH10mEW.cjs";
2
2
 
3
3
  //#region src/types/collateralEventType.d.ts
4
4
  type CollateralEventType = Extract<IndexerEventType, 'deposit_collateral' | 'withdraw_collateral' | 'withdraw_collateral_v2' | 'transfer_quote'>;
5
5
  //#endregion
6
6
  export { CollateralEventType as t };
7
- //# sourceMappingURL=collateralEventType-CNrryEno.d.cts.map
7
+ //# sourceMappingURL=collateralEventType-f2RJiAwy.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collateralEventType-f2RJiAwy.d.cts","names":[],"sources":["../src/types/src/types/collateralEventType.ts"],"mappings":";;;KAEY,mBAAA,GAAsB,OAAO,CACvC,gBAAA"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- require("./IndexerBaseClient-jaeUYv71.cjs");
2
+ require("./IndexerBaseClient-CSn4twzz.cjs");
3
3
  let _nadohq_shared = require("@nadohq/shared");
4
4
  let _nadohq_engine_client = require("@nadohq/engine-client");
5
5
  //#region src/dataMappers.ts
@@ -104,6 +104,42 @@ function mapIndexerMatchEventBalances(eventBalances) {
104
104
  quote: eventBalances.quote ? mapIndexerServerBalance(eventBalances.quote) : void 0
105
105
  };
106
106
  }
107
+ /**
108
+ * Maps a position returned by the indexer positions query to its client representation.
109
+ * @param position - The position in server (snake_case, x18 prices) format.
110
+ * @returns The position with camelCase fields and BigNumber values.
111
+ */
112
+ function mapIndexerPosition(position) {
113
+ return {
114
+ subaccount: position.subaccount,
115
+ productId: position.product_id,
116
+ isolated: position.isolated,
117
+ direction: position.direction,
118
+ openId: position.open_id,
119
+ closeId: position.close_id,
120
+ submissionIndex: position.submission_idx,
121
+ amount: (0, _nadohq_shared.toBigNumber)(position.amount),
122
+ maxAmount: (0, _nadohq_shared.toBigNumber)(position.max_amount),
123
+ totalOpenAmount: (0, _nadohq_shared.toBigNumber)(position.total_open_amount),
124
+ totalCloseAmount: (0, _nadohq_shared.toBigNumber)(position.total_close_amount),
125
+ averageEntryPrice: (0, _nadohq_shared.removeDecimals)(position.average_entry_price),
126
+ averageExitPrice: (0, _nadohq_shared.removeDecimals)(position.average_exit_price),
127
+ liquidatedAmount: (0, _nadohq_shared.toBigNumber)(position.liquidated_amount),
128
+ maxIsolatedLeverage: (0, _nadohq_shared.removeDecimals)(position.max_isolated_leverage_x18),
129
+ openFee: (0, _nadohq_shared.toBigNumber)(position.open_fee),
130
+ closeFee: (0, _nadohq_shared.toBigNumber)(position.close_fee),
131
+ realizedPnl: (0, _nadohq_shared.toBigNumber)(position.realized_pnl),
132
+ openTimestamp: (0, _nadohq_shared.toBigNumber)(position.open_timestamp),
133
+ updateTimestamp: (0, _nadohq_shared.toBigNumber)(position.update_timestamp),
134
+ openReason: position.open_reason,
135
+ closeReason: position.close_reason,
136
+ netFundingPayment: (0, _nadohq_shared.toBigNumber)(position.net_funding_payment),
137
+ netInterestPayment: (0, _nadohq_shared.toBigNumber)(position.net_interest_payment),
138
+ openDigest: position.open_digest,
139
+ closeDigest: position.close_digest,
140
+ netEntryUnrealized: (0, _nadohq_shared.toBigNumber)(position.net_entry_unrealized)
141
+ };
142
+ }
107
143
  function mapIndexerProductPayment(payment) {
108
144
  return {
109
145
  submissionIndex: payment.idx,
@@ -325,6 +361,7 @@ exports.mapIndexerNlpSnapshot = mapIndexerNlpSnapshot;
325
361
  exports.mapIndexerOrder = mapIndexerOrder;
326
362
  exports.mapIndexerPerpPrices = mapIndexerPerpPrices;
327
363
  exports.mapIndexerPortfolio = mapIndexerPortfolio;
364
+ exports.mapIndexerPosition = mapIndexerPosition;
328
365
  exports.mapIndexerProductPayment = mapIndexerProductPayment;
329
366
  exports.mapIndexerServerBalance = mapIndexerServerBalance;
330
367
  exports.mapIndexerServerProduct = mapIndexerServerProduct;
@@ -1 +1 @@
1
- {"version":3,"file":"dataMappers.cjs","names":["ProductEngineType","toBigNumber"],"sources":["../src/dataMappers.ts"],"sourcesContent":["import {\n mapEngineServerPerpProduct,\n mapEngineServerSpotProduct,\n} from '@nadohq/engine-client';\nimport {\n getRecvTimeFromOrderNonce,\n mapValues,\n Market,\n PerpMarket,\n ProductEngineType,\n removeDecimals,\n SpotMarket,\n subaccountFromHex,\n toBigNumber,\n toIntegerString,\n unpackOrderAppendix,\n} from '@nadohq/shared';\nimport {\n Candlestick,\n GetIndexerPortfolioResponse,\n IndexerEvent,\n IndexerEventWithTx,\n IndexerFundingRate,\n IndexerFundingRateHistoryEntry,\n IndexerLeaderboardContest,\n IndexerLeaderboardParticipant,\n IndexerLeaderboardRegistration,\n IndexerMaker,\n IndexerMarketSnapshot,\n IndexerMatchEventBalances,\n IndexerNlpSnapshot,\n IndexerOrder,\n IndexerPerpBalance,\n IndexerPerpPrices,\n IndexerPortfolioPoint,\n IndexerProductPayment,\n IndexerServerBalance,\n IndexerServerCandlestick,\n IndexerServerEvent,\n IndexerServerFundingRate,\n IndexerServerFundingRateHistoryEntry,\n IndexerServerLeaderboardContest,\n IndexerServerLeaderboardPosition,\n IndexerServerLeaderboardRegistration,\n IndexerServerMaker,\n IndexerServerMarketSnapshot,\n IndexerServerMatchEventBalances,\n IndexerServerNlpSnapshot,\n IndexerServerOrder,\n IndexerServerPerpPrices,\n IndexerServerPortfolioPoint,\n IndexerServerPortfolioResponse,\n IndexerServerProduct,\n IndexerServerProductPayment,\n IndexerServerSnapshotsInterval,\n IndexerServerTx,\n IndexerServerV2MarketHours,\n IndexerServerV2Symbol,\n IndexerServerV2TickerResponse,\n IndexerSnapshotsIntervalParams,\n IndexerSpotBalance,\n IndexerV2MarketHours,\n IndexerV2Symbol,\n IndexerV2TickerResponse,\n IndexerV2TradingStatus,\n} from './types';\n\nexport function mapSnapshotsIntervalToServerParams(\n params: IndexerSnapshotsIntervalParams,\n): IndexerServerSnapshotsInterval {\n return {\n count: params.limit,\n max_time: params.maxTimeInclusive\n ? toIntegerString(params.maxTimeInclusive)\n : undefined,\n granularity: params.granularity,\n };\n}\n\nexport function mapIndexerServerProduct(product: IndexerServerProduct): Market {\n if ('spot' in product) {\n return mapEngineServerSpotProduct(product.spot);\n }\n return mapEngineServerPerpProduct(product.perp);\n}\n\nexport function mapIndexerServerBalance(\n balance: IndexerServerBalance,\n): IndexerSpotBalance | IndexerPerpBalance {\n if ('spot' in balance) {\n return {\n amount: toBigNumber(balance.spot.balance.amount),\n productId: balance.spot.product_id,\n type: ProductEngineType.SPOT,\n };\n }\n return {\n amount: toBigNumber(balance.perp.balance.amount),\n productId: balance.perp.product_id,\n type: ProductEngineType.PERP,\n vQuoteBalance: toBigNumber(balance.perp.balance.v_quote_balance),\n };\n}\n\nexport function mapIndexerOrder(order: IndexerServerOrder): IndexerOrder {\n const appendix = unpackOrderAppendix(order.appendix);\n return {\n amount: toBigNumber(order.amount),\n digest: order.digest,\n expiration: Number(order.expiration),\n appendix,\n nonce: toBigNumber(order.nonce),\n isolated: order.isolated,\n recvTimeSeconds: getRecvTimeFromOrderNonce(order.nonce) / 1000,\n price: removeDecimals(order.price_x18),\n productId: order.product_id,\n subaccount: order.subaccount,\n submissionIndex: order.submission_idx,\n lastFillSubmissionIndex: order.last_fill_submission_idx,\n baseFilled: toBigNumber(order.base_filled),\n quoteFilled: toBigNumber(order.quote_filled),\n totalFee: toBigNumber(order.fee),\n builderFee: toBigNumber(order.builder_fee),\n realizedPnl: toBigNumber(order.realized_pnl),\n closedAmount: toBigNumber(order.closed_amount),\n closedNetEntry: toBigNumber(order.closed_net_entry),\n preCloseMargin: order.closed_margin\n ? toBigNumber(order.closed_margin)\n : null,\n firstFillTimestamp: toBigNumber(order.first_fill_timestamp),\n lastFillTimestamp: toBigNumber(order.last_fill_timestamp),\n preBalances: mapIndexerMatchEventBalances(order.pre_balance),\n postBalances: mapIndexerMatchEventBalances(order.post_balance),\n };\n}\n\nexport function mapIndexerEvent(event: IndexerServerEvent): IndexerEvent {\n const eventState: IndexerEvent['state'] = (() => {\n // Assume backend data is consistent\n if ('spot' in event.pre_balance) {\n return {\n type: ProductEngineType.SPOT,\n market: mapIndexerServerProduct(event.product) as SpotMarket,\n preBalance: mapIndexerServerBalance(\n event.pre_balance,\n ) as IndexerSpotBalance,\n postBalance: mapIndexerServerBalance(\n event.post_balance,\n ) as IndexerSpotBalance,\n };\n }\n return {\n type: ProductEngineType.PERP,\n market: mapIndexerServerProduct(event.product) as PerpMarket,\n preBalance: mapIndexerServerBalance(\n event.pre_balance,\n ) as IndexerPerpBalance,\n postBalance: mapIndexerServerBalance(\n event.post_balance,\n ) as IndexerPerpBalance,\n };\n })();\n\n return {\n eventType: event.event_type,\n productId: event.product_id,\n isolated: event.isolated,\n isolatedProductId: event.isolated_product_id,\n state: eventState,\n subaccount: event.subaccount,\n submissionIndex: event.submission_idx,\n trackedVars: {\n netEntryCumulative: toBigNumber(event.net_entry_cumulative),\n netEntryUnrealized: toBigNumber(event.net_entry_unrealized),\n netFundingCumulative: toBigNumber(event.net_funding_cumulative),\n netFundingUnrealized: toBigNumber(event.net_funding_unrealized),\n netInterestCumulative: toBigNumber(event.net_interest_cumulative),\n netInterestUnrealized: toBigNumber(event.net_interest_unrealized),\n quoteVolumeCumulative: toBigNumber(event.quote_volume_cumulative),\n cumulativeTradeCount: toBigNumber(event.cumulative_trade_count),\n },\n };\n}\n\nexport function mapIndexerEventWithTx(\n event: IndexerServerEvent,\n tx: IndexerServerTx,\n): IndexerEventWithTx {\n return {\n timestamp: toBigNumber(tx.timestamp),\n tx: tx.tx,\n ...mapIndexerEvent(event),\n };\n}\n\nexport function mapIndexerMatchEventBalances(\n eventBalances: IndexerServerMatchEventBalances,\n): IndexerMatchEventBalances {\n return {\n base: mapIndexerServerBalance(eventBalances.base),\n quote: eventBalances.quote\n ? (mapIndexerServerBalance(eventBalances.quote) as IndexerSpotBalance)\n : undefined,\n };\n}\n\nexport function mapIndexerProductPayment(\n payment: IndexerServerProductPayment,\n): IndexerProductPayment {\n return {\n submissionIndex: payment.idx,\n timestamp: toBigNumber(payment.timestamp),\n paymentAmount: toBigNumber(payment.amount),\n balanceAmount: toBigNumber(payment.balance_amount),\n annualPaymentRate: removeDecimals(payment.rate_x18),\n oraclePrice: removeDecimals(payment.oracle_price_x18),\n isolated: payment.isolated,\n productId: payment.product_id,\n isolatedProductId: payment.isolated_product_id,\n };\n}\n\nexport function mapIndexerPerpPrices(\n perpPrices: IndexerServerPerpPrices,\n): IndexerPerpPrices {\n return {\n indexPrice: removeDecimals(perpPrices.index_price_x18),\n markPrice: removeDecimals(perpPrices.mark_price_x18),\n updateTime: toBigNumber(perpPrices.update_time),\n productId: perpPrices.product_id,\n };\n}\n\nexport function mapIndexerFundingRate(\n fundingRate: IndexerServerFundingRate,\n): IndexerFundingRate {\n return {\n fundingRate: removeDecimals(fundingRate.funding_rate_x18),\n updateTime: toBigNumber(fundingRate.update_time),\n productId: fundingRate.product_id,\n };\n}\n\nexport function mapIndexerFundingRateHistory(\n entry: IndexerServerFundingRateHistoryEntry,\n): IndexerFundingRateHistoryEntry {\n return {\n productId: entry.product_id,\n timestamp: toBigNumber(entry.timestamp),\n fundingRateFrac: removeDecimals(entry.funding_rate_x18),\n };\n}\n\nfunction mapIndexerPortfolioPoint([\n timestamp,\n value,\n]: IndexerServerPortfolioPoint): IndexerPortfolioPoint {\n return {\n timestamp: toBigNumber(timestamp),\n value: toBigNumber(value),\n };\n}\n\nexport function mapIndexerPortfolio(\n response: IndexerServerPortfolioResponse,\n): GetIndexerPortfolioResponse {\n return Object.fromEntries(\n response.map(([period, history]) => [\n period,\n {\n accountValueHistory: history.accountValueHistory.map(\n mapIndexerPortfolioPoint,\n ),\n pnlHistory: history.pnlHistory.map(mapIndexerPortfolioPoint),\n volumeHistory: history.volumeHistory.map(mapIndexerPortfolioPoint),\n tradeSizeHistory: history.tradeSizeHistory.map(\n mapIndexerPortfolioPoint,\n ),\n marketCountHistory: history.marketCountHistory.map(\n mapIndexerPortfolioPoint,\n ),\n },\n ]),\n ) as GetIndexerPortfolioResponse;\n}\n\nexport function mapIndexerMakerStatistics(\n maker: IndexerServerMaker,\n): IndexerMaker {\n return {\n address: maker.address,\n snapshots: maker.data.map((makerData) => {\n return {\n timestamp: toBigNumber(makerData.timestamp),\n makerFee: toBigNumber(makerData.maker_fee),\n uptime: toBigNumber(makerData.uptime),\n sumQMin: toBigNumber(makerData.sum_q_min),\n qScore: toBigNumber(makerData.q_score),\n makerShare: toBigNumber(makerData.maker_share),\n expectedMakerReward: toBigNumber(makerData.expected_maker_reward),\n };\n }),\n };\n}\n\nexport function mapIndexerLeaderboardPosition(\n position: IndexerServerLeaderboardPosition,\n): IndexerLeaderboardParticipant {\n const tracks = mapValues(position.tracks, (trackData) => ({\n value: toBigNumber(trackData.value),\n rank: toBigNumber(trackData.rank),\n qualificationStatus: trackData.qualification_status,\n }));\n\n return {\n subaccount: subaccountFromHex(position.subaccount),\n contestId: position.contest_id,\n accountValue: toBigNumber(position.account_value),\n updateTime: toBigNumber(position.update_time),\n tracks,\n socialAccounts: position.social_accounts.map((account) => ({\n provider: account.provider,\n username: account.username,\n displayName: account.display_name,\n profileImageUrl: account.profile_image_url,\n })),\n };\n}\n\nexport function mapIndexerLeaderboardRegistration(\n registration: IndexerServerLeaderboardRegistration,\n): IndexerLeaderboardRegistration {\n return {\n subaccount: subaccountFromHex(registration.subaccount),\n contestId: registration.contest_id,\n updateTime: toBigNumber(registration.update_time),\n };\n}\n\nexport function mapIndexerLeaderboardContest(\n contest: IndexerServerLeaderboardContest,\n): IndexerLeaderboardContest {\n const startTime = toBigNumber(contest.start_time);\n const endTime = toBigNumber(contest.end_time);\n\n return {\n contestId: contest.contest_id,\n startTime,\n endTime,\n totalParticipants: toBigNumber(contest.count),\n requiredProductIds: contest.product_ids,\n active: contest.active,\n lastUpdated: toBigNumber(contest.last_updated),\n title: contest.title,\n description: contest.description,\n tracks: contest.tracks.map((track) => ({\n trackId: track.track_id,\n rankType: track.rank_type,\n sortOrder: track.sort_order,\n accountValueThreshold: toBigNumber(track.threshold),\n volumeThreshold: toBigNumber(track.volume_threshold),\n })),\n };\n}\n\nexport function mapIndexerCandlesticks(\n candlestick: IndexerServerCandlestick,\n): Candlestick {\n return {\n close: removeDecimals(candlestick.close_x18),\n high: removeDecimals(candlestick.high_x18),\n low: removeDecimals(candlestick.low_x18),\n open: removeDecimals(candlestick.open_x18),\n time: toBigNumber(candlestick.timestamp),\n volume: toBigNumber(candlestick.volume),\n };\n}\n\nexport function mapIndexerMarketSnapshot(\n snapshot: IndexerServerMarketSnapshot,\n): IndexerMarketSnapshot {\n return {\n timestamp: toBigNumber(snapshot.timestamp),\n cumulativeUsers: toBigNumber(snapshot.cumulative_users),\n dailyActiveUsers: toBigNumber(snapshot.daily_active_users),\n tvl: toBigNumber(snapshot.tvl),\n borrowRates: mapValues(snapshot.borrow_rates, (value) =>\n removeDecimals(value),\n ),\n cumulativeLiquidationAmounts: mapValues(\n snapshot.cumulative_liquidation_amounts,\n toBigNumber,\n ),\n cumulativeMakerFees: mapValues(snapshot.cumulative_maker_fees, toBigNumber),\n cumulativeSequencerFees: mapValues(\n snapshot.cumulative_sequencer_fees,\n toBigNumber,\n ),\n cumulativeTakerFees: mapValues(snapshot.cumulative_taker_fees, toBigNumber),\n cumulativeTrades: mapValues(snapshot.cumulative_trades, toBigNumber),\n cumulativeVolumes: mapValues(snapshot.cumulative_volumes, toBigNumber),\n depositRates: mapValues(snapshot.deposit_rates, (value) =>\n removeDecimals(value),\n ),\n fundingRates: mapValues(snapshot.funding_rates, (value) =>\n removeDecimals(value),\n ),\n openInterestsQuote: mapValues(snapshot.open_interests, toBigNumber),\n totalBorrows: mapValues(snapshot.total_borrows, toBigNumber),\n totalDeposits: mapValues(snapshot.total_deposits, toBigNumber),\n cumulativeTradeSizes: mapValues(\n snapshot.cumulative_trade_sizes,\n toBigNumber,\n ),\n cumulativeInflows: mapValues(snapshot.cumulative_inflows, toBigNumber),\n cumulativeOutflows: mapValues(snapshot.cumulative_outflows, toBigNumber),\n oraclePrices: mapValues(snapshot.oracle_prices, (value) =>\n removeDecimals(value),\n ),\n };\n}\n\nexport function mapIndexerNlpSnapshot(\n snapshot: IndexerServerNlpSnapshot,\n): IndexerNlpSnapshot {\n return {\n submissionIndex: snapshot.submission_idx,\n timestamp: toBigNumber(snapshot.timestamp),\n cumulativeBurnAmountQuote: toBigNumber(snapshot.cumulative_burn_quote),\n cumulativeMintAmountQuote: toBigNumber(snapshot.cumulative_mint_quote),\n cumulativePnl: toBigNumber(snapshot.cumulative_pnl),\n cumulativeTrades: toBigNumber(snapshot.cumulative_trades),\n cumulativeVolume: toBigNumber(snapshot.cumulative_volume),\n depositors: toBigNumber(snapshot.depositors),\n oraclePrice: removeDecimals(snapshot.oracle_price_x18),\n tvl: toBigNumber(snapshot.tvl),\n };\n}\n\nexport function mapIndexerV2Ticker(\n ticker: IndexerServerV2TickerResponse,\n): IndexerV2TickerResponse {\n return {\n productId: ticker.product_id,\n tickerId: ticker.ticker_id,\n baseCurrency: ticker.base_currency,\n quoteCurrency: ticker.quote_currency,\n lastPrice: ticker.last_price,\n baseVolume: ticker.base_volume,\n quoteVolume: ticker.quote_volume,\n priceChangePercent24h: ticker.price_change_percent_24h,\n };\n}\n\nexport function mapIndexerV2MarketHours(\n hours: IndexerServerV2MarketHours,\n): IndexerV2MarketHours {\n return {\n isOpen: hours.is_open,\n reason: hours.reason,\n nextClose: hours.next_close,\n nextOpen: hours.next_open,\n };\n}\n\nexport function mapIndexerV2Symbols(\n symbol: IndexerServerV2Symbol,\n): IndexerV2Symbol {\n return {\n type: symbol.type,\n productId: symbol.product_id,\n symbol: symbol.symbol,\n priceIncrement: removeDecimals(symbol.price_increment_x18),\n sizeIncrement: symbol.size_increment,\n minSize: symbol.min_size,\n makerFeeRate: removeDecimals(symbol.maker_fee_rate_x18),\n takerFeeRate: removeDecimals(symbol.taker_fee_rate_x18),\n longWeightInitial: removeDecimals(symbol.long_weight_initial_x18),\n longWeightMaintenance: removeDecimals(symbol.long_weight_maintenance_x18),\n maxOpenInterest: symbol.max_open_interest_x18\n ? removeDecimals(symbol.max_open_interest_x18)\n : null,\n exchangeRate: symbol.exchange_rate_x18\n ? removeDecimals(symbol.exchange_rate_x18)\n : null,\n tradingStatus: symbol.trading_status as IndexerV2TradingStatus,\n isolatedOnly: symbol.isolated_only,\n marketHours: symbol.market_hours\n ? mapIndexerV2MarketHours(symbol.market_hours)\n : null,\n boostType: symbol.boost_type ?? null,\n takerMultiplier: symbol.taker_multiplier ?? null,\n makerMultiplier: symbol.maker_multiplier ?? null,\n };\n}\n"],"mappings":";;;;;AAmEA,SAAgB,mCACd,QACgC;CAChC,OAAO;EACL,OAAO,OAAO;EACd,UAAU,OAAO,oBAAA,GAAA,eAAA,iBACG,OAAO,gBAAgB,IACvC,KAAA;EACJ,aAAa,OAAO;CACtB;AACF;AAEA,SAAgB,wBAAwB,SAAuC;CAC7E,IAAI,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C,iBAAiB,OAAO,oBAAoB;CAC9C;AACF"}
1
+ {"version":3,"file":"dataMappers.cjs","names":["ProductEngineType","toBigNumber"],"sources":["../src/dataMappers.ts"],"sourcesContent":["import {\n mapEngineServerPerpProduct,\n mapEngineServerSpotProduct,\n} from '@nadohq/engine-client';\nimport {\n getRecvTimeFromOrderNonce,\n mapValues,\n Market,\n PerpMarket,\n ProductEngineType,\n removeDecimals,\n SpotMarket,\n subaccountFromHex,\n toBigNumber,\n toIntegerString,\n unpackOrderAppendix,\n} from '@nadohq/shared';\nimport {\n Candlestick,\n GetIndexerPortfolioResponse,\n IndexerEvent,\n IndexerEventWithTx,\n IndexerFundingRate,\n IndexerFundingRateHistoryEntry,\n IndexerLeaderboardContest,\n IndexerLeaderboardParticipant,\n IndexerLeaderboardRegistration,\n IndexerMaker,\n IndexerMarketSnapshot,\n IndexerMatchEventBalances,\n IndexerNlpSnapshot,\n IndexerOrder,\n IndexerPerpBalance,\n IndexerPerpPrices,\n IndexerPortfolioPoint,\n IndexerPosition,\n IndexerProductPayment,\n IndexerServerBalance,\n IndexerServerCandlestick,\n IndexerServerEvent,\n IndexerServerFundingRate,\n IndexerServerFundingRateHistoryEntry,\n IndexerServerLeaderboardContest,\n IndexerServerLeaderboardPosition,\n IndexerServerLeaderboardRegistration,\n IndexerServerMaker,\n IndexerServerMarketSnapshot,\n IndexerServerMatchEventBalances,\n IndexerServerNlpSnapshot,\n IndexerServerOrder,\n IndexerServerPerpPrices,\n IndexerServerPortfolioPoint,\n IndexerServerPortfolioResponse,\n IndexerServerPosition,\n IndexerServerProduct,\n IndexerServerProductPayment,\n IndexerServerSnapshotsInterval,\n IndexerServerTx,\n IndexerServerV2MarketHours,\n IndexerServerV2Symbol,\n IndexerServerV2TickerResponse,\n IndexerSnapshotsIntervalParams,\n IndexerSpotBalance,\n IndexerV2MarketHours,\n IndexerV2Symbol,\n IndexerV2TickerResponse,\n IndexerV2TradingStatus,\n} from './types';\n\nexport function mapSnapshotsIntervalToServerParams(\n params: IndexerSnapshotsIntervalParams,\n): IndexerServerSnapshotsInterval {\n return {\n count: params.limit,\n max_time: params.maxTimeInclusive\n ? toIntegerString(params.maxTimeInclusive)\n : undefined,\n granularity: params.granularity,\n };\n}\n\nexport function mapIndexerServerProduct(product: IndexerServerProduct): Market {\n if ('spot' in product) {\n return mapEngineServerSpotProduct(product.spot);\n }\n return mapEngineServerPerpProduct(product.perp);\n}\n\nexport function mapIndexerServerBalance(\n balance: IndexerServerBalance,\n): IndexerSpotBalance | IndexerPerpBalance {\n if ('spot' in balance) {\n return {\n amount: toBigNumber(balance.spot.balance.amount),\n productId: balance.spot.product_id,\n type: ProductEngineType.SPOT,\n };\n }\n return {\n amount: toBigNumber(balance.perp.balance.amount),\n productId: balance.perp.product_id,\n type: ProductEngineType.PERP,\n vQuoteBalance: toBigNumber(balance.perp.balance.v_quote_balance),\n };\n}\n\nexport function mapIndexerOrder(order: IndexerServerOrder): IndexerOrder {\n const appendix = unpackOrderAppendix(order.appendix);\n return {\n amount: toBigNumber(order.amount),\n digest: order.digest,\n expiration: Number(order.expiration),\n appendix,\n nonce: toBigNumber(order.nonce),\n isolated: order.isolated,\n recvTimeSeconds: getRecvTimeFromOrderNonce(order.nonce) / 1000,\n price: removeDecimals(order.price_x18),\n productId: order.product_id,\n subaccount: order.subaccount,\n submissionIndex: order.submission_idx,\n lastFillSubmissionIndex: order.last_fill_submission_idx,\n baseFilled: toBigNumber(order.base_filled),\n quoteFilled: toBigNumber(order.quote_filled),\n totalFee: toBigNumber(order.fee),\n builderFee: toBigNumber(order.builder_fee),\n realizedPnl: toBigNumber(order.realized_pnl),\n closedAmount: toBigNumber(order.closed_amount),\n closedNetEntry: toBigNumber(order.closed_net_entry),\n preCloseMargin: order.closed_margin\n ? toBigNumber(order.closed_margin)\n : null,\n firstFillTimestamp: toBigNumber(order.first_fill_timestamp),\n lastFillTimestamp: toBigNumber(order.last_fill_timestamp),\n preBalances: mapIndexerMatchEventBalances(order.pre_balance),\n postBalances: mapIndexerMatchEventBalances(order.post_balance),\n };\n}\n\nexport function mapIndexerEvent(event: IndexerServerEvent): IndexerEvent {\n const eventState: IndexerEvent['state'] = (() => {\n // Assume backend data is consistent\n if ('spot' in event.pre_balance) {\n return {\n type: ProductEngineType.SPOT,\n market: mapIndexerServerProduct(event.product) as SpotMarket,\n preBalance: mapIndexerServerBalance(\n event.pre_balance,\n ) as IndexerSpotBalance,\n postBalance: mapIndexerServerBalance(\n event.post_balance,\n ) as IndexerSpotBalance,\n };\n }\n return {\n type: ProductEngineType.PERP,\n market: mapIndexerServerProduct(event.product) as PerpMarket,\n preBalance: mapIndexerServerBalance(\n event.pre_balance,\n ) as IndexerPerpBalance,\n postBalance: mapIndexerServerBalance(\n event.post_balance,\n ) as IndexerPerpBalance,\n };\n })();\n\n return {\n eventType: event.event_type,\n productId: event.product_id,\n isolated: event.isolated,\n isolatedProductId: event.isolated_product_id,\n state: eventState,\n subaccount: event.subaccount,\n submissionIndex: event.submission_idx,\n trackedVars: {\n netEntryCumulative: toBigNumber(event.net_entry_cumulative),\n netEntryUnrealized: toBigNumber(event.net_entry_unrealized),\n netFundingCumulative: toBigNumber(event.net_funding_cumulative),\n netFundingUnrealized: toBigNumber(event.net_funding_unrealized),\n netInterestCumulative: toBigNumber(event.net_interest_cumulative),\n netInterestUnrealized: toBigNumber(event.net_interest_unrealized),\n quoteVolumeCumulative: toBigNumber(event.quote_volume_cumulative),\n cumulativeTradeCount: toBigNumber(event.cumulative_trade_count),\n },\n };\n}\n\nexport function mapIndexerEventWithTx(\n event: IndexerServerEvent,\n tx: IndexerServerTx,\n): IndexerEventWithTx {\n return {\n timestamp: toBigNumber(tx.timestamp),\n tx: tx.tx,\n ...mapIndexerEvent(event),\n };\n}\n\nexport function mapIndexerMatchEventBalances(\n eventBalances: IndexerServerMatchEventBalances,\n): IndexerMatchEventBalances {\n return {\n base: mapIndexerServerBalance(eventBalances.base),\n quote: eventBalances.quote\n ? (mapIndexerServerBalance(eventBalances.quote) as IndexerSpotBalance)\n : undefined,\n };\n}\n\n/**\n * Maps a position returned by the indexer positions query to its client representation.\n * @param position - The position in server (snake_case, x18 prices) format.\n * @returns The position with camelCase fields and BigNumber values.\n */\nexport function mapIndexerPosition(\n position: IndexerServerPosition,\n): IndexerPosition {\n return {\n subaccount: position.subaccount,\n productId: position.product_id,\n isolated: position.isolated,\n direction: position.direction,\n openId: position.open_id,\n closeId: position.close_id,\n submissionIndex: position.submission_idx,\n amount: toBigNumber(position.amount),\n maxAmount: toBigNumber(position.max_amount),\n totalOpenAmount: toBigNumber(position.total_open_amount),\n totalCloseAmount: toBigNumber(position.total_close_amount),\n averageEntryPrice: removeDecimals(position.average_entry_price),\n averageExitPrice: removeDecimals(position.average_exit_price),\n liquidatedAmount: toBigNumber(position.liquidated_amount),\n maxIsolatedLeverage: removeDecimals(position.max_isolated_leverage_x18),\n openFee: toBigNumber(position.open_fee),\n closeFee: toBigNumber(position.close_fee),\n realizedPnl: toBigNumber(position.realized_pnl),\n openTimestamp: toBigNumber(position.open_timestamp),\n updateTimestamp: toBigNumber(position.update_timestamp),\n openReason: position.open_reason,\n closeReason: position.close_reason,\n netFundingPayment: toBigNumber(position.net_funding_payment),\n netInterestPayment: toBigNumber(position.net_interest_payment),\n openDigest: position.open_digest,\n closeDigest: position.close_digest,\n netEntryUnrealized: toBigNumber(position.net_entry_unrealized),\n };\n}\n\nexport function mapIndexerProductPayment(\n payment: IndexerServerProductPayment,\n): IndexerProductPayment {\n return {\n submissionIndex: payment.idx,\n timestamp: toBigNumber(payment.timestamp),\n paymentAmount: toBigNumber(payment.amount),\n balanceAmount: toBigNumber(payment.balance_amount),\n annualPaymentRate: removeDecimals(payment.rate_x18),\n oraclePrice: removeDecimals(payment.oracle_price_x18),\n isolated: payment.isolated,\n productId: payment.product_id,\n isolatedProductId: payment.isolated_product_id,\n };\n}\n\nexport function mapIndexerPerpPrices(\n perpPrices: IndexerServerPerpPrices,\n): IndexerPerpPrices {\n return {\n indexPrice: removeDecimals(perpPrices.index_price_x18),\n markPrice: removeDecimals(perpPrices.mark_price_x18),\n updateTime: toBigNumber(perpPrices.update_time),\n productId: perpPrices.product_id,\n };\n}\n\nexport function mapIndexerFundingRate(\n fundingRate: IndexerServerFundingRate,\n): IndexerFundingRate {\n return {\n fundingRate: removeDecimals(fundingRate.funding_rate_x18),\n updateTime: toBigNumber(fundingRate.update_time),\n productId: fundingRate.product_id,\n };\n}\n\nexport function mapIndexerFundingRateHistory(\n entry: IndexerServerFundingRateHistoryEntry,\n): IndexerFundingRateHistoryEntry {\n return {\n productId: entry.product_id,\n timestamp: toBigNumber(entry.timestamp),\n fundingRateFrac: removeDecimals(entry.funding_rate_x18),\n };\n}\n\nfunction mapIndexerPortfolioPoint([\n timestamp,\n value,\n]: IndexerServerPortfolioPoint): IndexerPortfolioPoint {\n return {\n timestamp: toBigNumber(timestamp),\n value: toBigNumber(value),\n };\n}\n\nexport function mapIndexerPortfolio(\n response: IndexerServerPortfolioResponse,\n): GetIndexerPortfolioResponse {\n return Object.fromEntries(\n response.map(([period, history]) => [\n period,\n {\n accountValueHistory: history.accountValueHistory.map(\n mapIndexerPortfolioPoint,\n ),\n pnlHistory: history.pnlHistory.map(mapIndexerPortfolioPoint),\n volumeHistory: history.volumeHistory.map(mapIndexerPortfolioPoint),\n tradeSizeHistory: history.tradeSizeHistory.map(\n mapIndexerPortfolioPoint,\n ),\n marketCountHistory: history.marketCountHistory.map(\n mapIndexerPortfolioPoint,\n ),\n },\n ]),\n ) as GetIndexerPortfolioResponse;\n}\n\nexport function mapIndexerMakerStatistics(\n maker: IndexerServerMaker,\n): IndexerMaker {\n return {\n address: maker.address,\n snapshots: maker.data.map((makerData) => {\n return {\n timestamp: toBigNumber(makerData.timestamp),\n makerFee: toBigNumber(makerData.maker_fee),\n uptime: toBigNumber(makerData.uptime),\n sumQMin: toBigNumber(makerData.sum_q_min),\n qScore: toBigNumber(makerData.q_score),\n makerShare: toBigNumber(makerData.maker_share),\n expectedMakerReward: toBigNumber(makerData.expected_maker_reward),\n };\n }),\n };\n}\n\nexport function mapIndexerLeaderboardPosition(\n position: IndexerServerLeaderboardPosition,\n): IndexerLeaderboardParticipant {\n const tracks = mapValues(position.tracks, (trackData) => ({\n value: toBigNumber(trackData.value),\n rank: toBigNumber(trackData.rank),\n qualificationStatus: trackData.qualification_status,\n }));\n\n return {\n subaccount: subaccountFromHex(position.subaccount),\n contestId: position.contest_id,\n accountValue: toBigNumber(position.account_value),\n updateTime: toBigNumber(position.update_time),\n tracks,\n socialAccounts: position.social_accounts.map((account) => ({\n provider: account.provider,\n username: account.username,\n displayName: account.display_name,\n profileImageUrl: account.profile_image_url,\n })),\n };\n}\n\nexport function mapIndexerLeaderboardRegistration(\n registration: IndexerServerLeaderboardRegistration,\n): IndexerLeaderboardRegistration {\n return {\n subaccount: subaccountFromHex(registration.subaccount),\n contestId: registration.contest_id,\n updateTime: toBigNumber(registration.update_time),\n };\n}\n\nexport function mapIndexerLeaderboardContest(\n contest: IndexerServerLeaderboardContest,\n): IndexerLeaderboardContest {\n const startTime = toBigNumber(contest.start_time);\n const endTime = toBigNumber(contest.end_time);\n\n return {\n contestId: contest.contest_id,\n startTime,\n endTime,\n totalParticipants: toBigNumber(contest.count),\n requiredProductIds: contest.product_ids,\n active: contest.active,\n lastUpdated: toBigNumber(contest.last_updated),\n title: contest.title,\n description: contest.description,\n tracks: contest.tracks.map((track) => ({\n trackId: track.track_id,\n rankType: track.rank_type,\n sortOrder: track.sort_order,\n accountValueThreshold: toBigNumber(track.threshold),\n volumeThreshold: toBigNumber(track.volume_threshold),\n })),\n };\n}\n\nexport function mapIndexerCandlesticks(\n candlestick: IndexerServerCandlestick,\n): Candlestick {\n return {\n close: removeDecimals(candlestick.close_x18),\n high: removeDecimals(candlestick.high_x18),\n low: removeDecimals(candlestick.low_x18),\n open: removeDecimals(candlestick.open_x18),\n time: toBigNumber(candlestick.timestamp),\n volume: toBigNumber(candlestick.volume),\n };\n}\n\nexport function mapIndexerMarketSnapshot(\n snapshot: IndexerServerMarketSnapshot,\n): IndexerMarketSnapshot {\n return {\n timestamp: toBigNumber(snapshot.timestamp),\n cumulativeUsers: toBigNumber(snapshot.cumulative_users),\n dailyActiveUsers: toBigNumber(snapshot.daily_active_users),\n tvl: toBigNumber(snapshot.tvl),\n borrowRates: mapValues(snapshot.borrow_rates, (value) =>\n removeDecimals(value),\n ),\n cumulativeLiquidationAmounts: mapValues(\n snapshot.cumulative_liquidation_amounts,\n toBigNumber,\n ),\n cumulativeMakerFees: mapValues(snapshot.cumulative_maker_fees, toBigNumber),\n cumulativeSequencerFees: mapValues(\n snapshot.cumulative_sequencer_fees,\n toBigNumber,\n ),\n cumulativeTakerFees: mapValues(snapshot.cumulative_taker_fees, toBigNumber),\n cumulativeTrades: mapValues(snapshot.cumulative_trades, toBigNumber),\n cumulativeVolumes: mapValues(snapshot.cumulative_volumes, toBigNumber),\n depositRates: mapValues(snapshot.deposit_rates, (value) =>\n removeDecimals(value),\n ),\n fundingRates: mapValues(snapshot.funding_rates, (value) =>\n removeDecimals(value),\n ),\n openInterestsQuote: mapValues(snapshot.open_interests, toBigNumber),\n totalBorrows: mapValues(snapshot.total_borrows, toBigNumber),\n totalDeposits: mapValues(snapshot.total_deposits, toBigNumber),\n cumulativeTradeSizes: mapValues(\n snapshot.cumulative_trade_sizes,\n toBigNumber,\n ),\n cumulativeInflows: mapValues(snapshot.cumulative_inflows, toBigNumber),\n cumulativeOutflows: mapValues(snapshot.cumulative_outflows, toBigNumber),\n oraclePrices: mapValues(snapshot.oracle_prices, (value) =>\n removeDecimals(value),\n ),\n };\n}\n\nexport function mapIndexerNlpSnapshot(\n snapshot: IndexerServerNlpSnapshot,\n): IndexerNlpSnapshot {\n return {\n submissionIndex: snapshot.submission_idx,\n timestamp: toBigNumber(snapshot.timestamp),\n cumulativeBurnAmountQuote: toBigNumber(snapshot.cumulative_burn_quote),\n cumulativeMintAmountQuote: toBigNumber(snapshot.cumulative_mint_quote),\n cumulativePnl: toBigNumber(snapshot.cumulative_pnl),\n cumulativeTrades: toBigNumber(snapshot.cumulative_trades),\n cumulativeVolume: toBigNumber(snapshot.cumulative_volume),\n depositors: toBigNumber(snapshot.depositors),\n oraclePrice: removeDecimals(snapshot.oracle_price_x18),\n tvl: toBigNumber(snapshot.tvl),\n };\n}\n\nexport function mapIndexerV2Ticker(\n ticker: IndexerServerV2TickerResponse,\n): IndexerV2TickerResponse {\n return {\n productId: ticker.product_id,\n tickerId: ticker.ticker_id,\n baseCurrency: ticker.base_currency,\n quoteCurrency: ticker.quote_currency,\n lastPrice: ticker.last_price,\n baseVolume: ticker.base_volume,\n quoteVolume: ticker.quote_volume,\n priceChangePercent24h: ticker.price_change_percent_24h,\n };\n}\n\nexport function mapIndexerV2MarketHours(\n hours: IndexerServerV2MarketHours,\n): IndexerV2MarketHours {\n return {\n isOpen: hours.is_open,\n reason: hours.reason,\n nextClose: hours.next_close,\n nextOpen: hours.next_open,\n };\n}\n\nexport function mapIndexerV2Symbols(\n symbol: IndexerServerV2Symbol,\n): IndexerV2Symbol {\n return {\n type: symbol.type,\n productId: symbol.product_id,\n symbol: symbol.symbol,\n priceIncrement: removeDecimals(symbol.price_increment_x18),\n sizeIncrement: symbol.size_increment,\n minSize: symbol.min_size,\n makerFeeRate: removeDecimals(symbol.maker_fee_rate_x18),\n takerFeeRate: removeDecimals(symbol.taker_fee_rate_x18),\n longWeightInitial: removeDecimals(symbol.long_weight_initial_x18),\n longWeightMaintenance: removeDecimals(symbol.long_weight_maintenance_x18),\n maxOpenInterest: symbol.max_open_interest_x18\n ? removeDecimals(symbol.max_open_interest_x18)\n : null,\n exchangeRate: symbol.exchange_rate_x18\n ? removeDecimals(symbol.exchange_rate_x18)\n : null,\n tradingStatus: symbol.trading_status as IndexerV2TradingStatus,\n isolatedOnly: symbol.isolated_only,\n marketHours: symbol.market_hours\n ? mapIndexerV2MarketHours(symbol.market_hours)\n : null,\n boostType: symbol.boost_type ?? null,\n takerMultiplier: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Ac;EAChC,iBAAiB,OAAO,oBAAoB;EAC5C,iBAAiB,OAAO,oBAAoB;CAC9C;AACF"}
@@ -1,6 +1,6 @@
1
- import { C as IndexerServerTx, _ as IndexerServerOrder, d as IndexerServerMarketSnapshot, h as IndexerServerNlpSnapshot, i as IndexerServerLeaderboardContest, l as IndexerServerMaker, m as IndexerServerMatchEventBalances, n as IndexerServerCandlestick, o as IndexerServerLeaderboardPosition, r as IndexerServerEvent, s as IndexerServerLeaderboardRegistration, t as IndexerServerBalance, v as IndexerServerProduct, x as IndexerServerSnapshotsInterval, y as IndexerServerProductPayment } from "./serverModelTypes-DC4dsX9i.cjs";
2
- import { Gt as IndexerServerV2Symbol, O as IndexerServerFundingRate, Tt as IndexerServerPortfolioResponse, Wt as IndexerServerV2MarketHours, ht as IndexerServerPerpPrices, k as IndexerServerFundingRateHistoryEntry, qt as IndexerServerV2TickerResponse } from "./serverTypes-DeUDMCog.cjs";
3
- import { Bt as IndexerLeaderboardParticipant, Ft as IndexerEventWithTx, Gt as IndexerMarketSnapshot, It as IndexerFundingRate, Jt as IndexerNlpSnapshot, Lt as IndexerFundingRateHistoryEntry, Qt as IndexerPerpPrices, Rt as IndexerLeaderboardContest, Ut as IndexerMaker, Vt as IndexerLeaderboardRegistration, Xt as IndexerOrder, Zt as IndexerPerpBalance, at as GetIndexerPortfolioResponse, cn as IndexerSpotBalance, dn as IndexerV2Symbol, fn as IndexerV2TickerResponse, jt as IndexerEvent, on as IndexerSnapshotsIntervalParams, qt as IndexerMatchEventBalances, rn as IndexerProductPayment, t as Candlestick, un as IndexerV2MarketHours } from "./clientTypes-QBgifUeV.cjs";
1
+ import { S as IndexerServerSnapshotsInterval, _ as IndexerServerOrder, b as IndexerServerProductPayment, d as IndexerServerMarketSnapshot, h as IndexerServerNlpSnapshot, i as IndexerServerLeaderboardContest, l as IndexerServerMaker, m as IndexerServerMatchEventBalances, n as IndexerServerCandlestick, o as IndexerServerLeaderboardPosition, r as IndexerServerEvent, s as IndexerServerLeaderboardRegistration, t as IndexerServerBalance, v as IndexerServerPosition, w as IndexerServerTx, y as IndexerServerProduct } from "./serverModelTypes-vhALknbV.cjs";
2
+ import { Kt as IndexerServerV2MarketHours, O as IndexerServerFundingRate, Tt as IndexerServerPortfolioResponse, Yt as IndexerServerV2TickerResponse, ht as IndexerServerPerpPrices, k as IndexerServerFundingRateHistoryEntry, qt as IndexerServerV2Symbol } from "./serverTypes-CyqBF-nt.cjs";
3
+ import { $t as IndexerPerpBalance, Bt as IndexerLeaderboardContest, Gt as IndexerMaker, Ht as IndexerLeaderboardParticipant, Lt as IndexerEventWithTx, Nt as IndexerEvent, Qt as IndexerOrder, Rt as IndexerFundingRate, Ut as IndexerLeaderboardRegistration, Xt as IndexerNlpSnapshot, Yt as IndexerMatchEventBalances, an as IndexerPosition, at as GetIndexerPortfolioResponse, dn as IndexerSpotBalance, en as IndexerPerpPrices, hn as IndexerV2TickerResponse, ln as IndexerSnapshotsIntervalParams, mn as IndexerV2Symbol, on as IndexerProductPayment, pn as IndexerV2MarketHours, qt as IndexerMarketSnapshot, t as Candlestick, zt as IndexerFundingRateHistoryEntry } from "./clientTypes-DS2w6Osq.cjs";
4
4
  import { Market } from "@nadohq/shared";
5
5
 
6
6
  //#region src/dataMappers.d.ts
@@ -11,6 +11,12 @@ declare function mapIndexerOrder(order: IndexerServerOrder): IndexerOrder;
11
11
  declare function mapIndexerEvent(event: IndexerServerEvent): IndexerEvent;
12
12
  declare function mapIndexerEventWithTx(event: IndexerServerEvent, tx: IndexerServerTx): IndexerEventWithTx;
13
13
  declare function mapIndexerMatchEventBalances(eventBalances: IndexerServerMatchEventBalances): IndexerMatchEventBalances;
14
+ /**
15
+ * Maps a position returned by the indexer positions query to its client representation.
16
+ * @param position - The position in server (snake_case, x18 prices) format.
17
+ * @returns The position with camelCase fields and BigNumber values.
18
+ */
19
+ declare function mapIndexerPosition(position: IndexerServerPosition): IndexerPosition;
14
20
  declare function mapIndexerProductPayment(payment: IndexerServerProductPayment): IndexerProductPayment;
15
21
  declare function mapIndexerPerpPrices(perpPrices: IndexerServerPerpPrices): IndexerPerpPrices;
16
22
  declare function mapIndexerFundingRate(fundingRate: IndexerServerFundingRate): IndexerFundingRate;
@@ -27,5 +33,5 @@ declare function mapIndexerV2Ticker(ticker: IndexerServerV2TickerResponse): Inde
27
33
  declare function mapIndexerV2MarketHours(hours: IndexerServerV2MarketHours): IndexerV2MarketHours;
28
34
  declare function mapIndexerV2Symbols(symbol: IndexerServerV2Symbol): IndexerV2Symbol;
29
35
  //#endregion
30
- export { mapIndexerCandlesticks, mapIndexerEvent, mapIndexerEventWithTx, mapIndexerFundingRate, mapIndexerFundingRateHistory, mapIndexerLeaderboardContest, mapIndexerLeaderboardPosition, mapIndexerLeaderboardRegistration, mapIndexerMakerStatistics, mapIndexerMarketSnapshot, mapIndexerMatchEventBalances, mapIndexerNlpSnapshot, mapIndexerOrder, mapIndexerPerpPrices, mapIndexerPortfolio, mapIndexerProductPayment, mapIndexerServerBalance, mapIndexerServerProduct, mapIndexerV2MarketHours, mapIndexerV2Symbols, mapIndexerV2Ticker, mapSnapshotsIntervalToServerParams };
36
+ export { mapIndexerCandlesticks, mapIndexerEvent, mapIndexerEventWithTx, mapIndexerFundingRate, mapIndexerFundingRateHistory, mapIndexerLeaderboardContest, mapIndexerLeaderboardPosition, mapIndexerLeaderboardRegistration, mapIndexerMakerStatistics, mapIndexerMarketSnapshot, mapIndexerMatchEventBalances, mapIndexerNlpSnapshot, mapIndexerOrder, mapIndexerPerpPrices, mapIndexerPortfolio, mapIndexerPosition, mapIndexerProductPayment, mapIndexerServerBalance, mapIndexerServerProduct, mapIndexerV2MarketHours, mapIndexerV2Symbols, mapIndexerV2Ticker, mapSnapshotsIntervalToServerParams };
31
37
  //# sourceMappingURL=dataMappers.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dataMappers.d.cts","names":[],"sources":["../src/src/dataMappers.ts"],"mappings":";;;;;;iBAmEgB,kCAAA,CACd,MA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AAW;AAAA,iBAWE,wBAAA,CACd,QAAA,EAAU,2BAAA,GACT,qBAAqB;AAAA,iBA0CR,qBAAA,CACd,QAAA,EAAU,wBAAA,GACT,kBAAkB;AAAA,iBAeL,kBAAA,CACd,MAAA,EAAQ,6BAAA,GACP,uBAAuB;AAAA,iBAaV,uBAAA,CACd,KAAA,EAAO,0BAAA,GACN,oBAAoB;AAAA,iBASP,mBAAA,CACd,MAAA,EAAQ,qBAAA,GACP,eAAe"}
@@ -1,6 +1,6 @@
1
- import { C as IndexerServerTx, _ as IndexerServerOrder, d as IndexerServerMarketSnapshot, h as IndexerServerNlpSnapshot, i as IndexerServerLeaderboardContest, l as IndexerServerMaker, m as IndexerServerMatchEventBalances, n as IndexerServerCandlestick, o as IndexerServerLeaderboardPosition, r as IndexerServerEvent, s as IndexerServerLeaderboardRegistration, t as IndexerServerBalance, v as IndexerServerProduct, x as IndexerServerSnapshotsInterval, y as IndexerServerProductPayment } from "./serverModelTypes-BAZNgoLE.js";
2
- import { Gt as IndexerServerV2Symbol, O as IndexerServerFundingRate, Tt as IndexerServerPortfolioResponse, Wt as IndexerServerV2MarketHours, ht as IndexerServerPerpPrices, k as IndexerServerFundingRateHistoryEntry, qt as IndexerServerV2TickerResponse } from "./serverTypes-BQafrknp.js";
3
- import { Bt as IndexerLeaderboardParticipant, Ft as IndexerEventWithTx, Gt as IndexerMarketSnapshot, It as IndexerFundingRate, Jt as IndexerNlpSnapshot, Lt as IndexerFundingRateHistoryEntry, Qt as IndexerPerpPrices, Rt as IndexerLeaderboardContest, Ut as IndexerMaker, Vt as IndexerLeaderboardRegistration, Xt as IndexerOrder, Zt as IndexerPerpBalance, at as GetIndexerPortfolioResponse, cn as IndexerSpotBalance, dn as IndexerV2Symbol, fn as IndexerV2TickerResponse, jt as IndexerEvent, on as IndexerSnapshotsIntervalParams, qt as IndexerMatchEventBalances, rn as IndexerProductPayment, t as Candlestick, un as IndexerV2MarketHours } from "./clientTypes-BLKeWmIr.js";
1
+ import { S as IndexerServerSnapshotsInterval, _ as IndexerServerOrder, b as IndexerServerProductPayment, d as IndexerServerMarketSnapshot, h as IndexerServerNlpSnapshot, i as IndexerServerLeaderboardContest, l as IndexerServerMaker, m as IndexerServerMatchEventBalances, n as IndexerServerCandlestick, o as IndexerServerLeaderboardPosition, r as IndexerServerEvent, s as IndexerServerLeaderboardRegistration, t as IndexerServerBalance, v as IndexerServerPosition, w as IndexerServerTx, y as IndexerServerProduct } from "./serverModelTypes-B78obnnd.js";
2
+ import { Kt as IndexerServerV2MarketHours, O as IndexerServerFundingRate, Tt as IndexerServerPortfolioResponse, Yt as IndexerServerV2TickerResponse, ht as IndexerServerPerpPrices, k as IndexerServerFundingRateHistoryEntry, qt as IndexerServerV2Symbol } from "./serverTypes-Dod9cCEW.js";
3
+ import { $t as IndexerPerpBalance, Bt as IndexerLeaderboardContest, Gt as IndexerMaker, Ht as IndexerLeaderboardParticipant, Lt as IndexerEventWithTx, Nt as IndexerEvent, Qt as IndexerOrder, Rt as IndexerFundingRate, Ut as IndexerLeaderboardRegistration, Xt as IndexerNlpSnapshot, Yt as IndexerMatchEventBalances, an as IndexerPosition, at as GetIndexerPortfolioResponse, dn as IndexerSpotBalance, en as IndexerPerpPrices, hn as IndexerV2TickerResponse, ln as IndexerSnapshotsIntervalParams, mn as IndexerV2Symbol, on as IndexerProductPayment, pn as IndexerV2MarketHours, qt as IndexerMarketSnapshot, t as Candlestick, zt as IndexerFundingRateHistoryEntry } from "./clientTypes-CnswaLwH.js";
4
4
  import { Market } from "@nadohq/shared";
5
5
 
6
6
  //#region src/dataMappers.d.ts
@@ -11,6 +11,12 @@ declare function mapIndexerOrder(order: IndexerServerOrder): IndexerOrder;
11
11
  declare function mapIndexerEvent(event: IndexerServerEvent): IndexerEvent;
12
12
  declare function mapIndexerEventWithTx(event: IndexerServerEvent, tx: IndexerServerTx): IndexerEventWithTx;
13
13
  declare function mapIndexerMatchEventBalances(eventBalances: IndexerServerMatchEventBalances): IndexerMatchEventBalances;
14
+ /**
15
+ * Maps a position returned by the indexer positions query to its client representation.
16
+ * @param position - The position in server (snake_case, x18 prices) format.
17
+ * @returns The position with camelCase fields and BigNumber values.
18
+ */
19
+ declare function mapIndexerPosition(position: IndexerServerPosition): IndexerPosition;
14
20
  declare function mapIndexerProductPayment(payment: IndexerServerProductPayment): IndexerProductPayment;
15
21
  declare function mapIndexerPerpPrices(perpPrices: IndexerServerPerpPrices): IndexerPerpPrices;
16
22
  declare function mapIndexerFundingRate(fundingRate: IndexerServerFundingRate): IndexerFundingRate;
@@ -27,5 +33,5 @@ declare function mapIndexerV2Ticker(ticker: IndexerServerV2TickerResponse): Inde
27
33
  declare function mapIndexerV2MarketHours(hours: IndexerServerV2MarketHours): IndexerV2MarketHours;
28
34
  declare function mapIndexerV2Symbols(symbol: IndexerServerV2Symbol): IndexerV2Symbol;
29
35
  //#endregion
30
- export { mapIndexerCandlesticks, mapIndexerEvent, mapIndexerEventWithTx, mapIndexerFundingRate, mapIndexerFundingRateHistory, mapIndexerLeaderboardContest, mapIndexerLeaderboardPosition, mapIndexerLeaderboardRegistration, mapIndexerMakerStatistics, mapIndexerMarketSnapshot, mapIndexerMatchEventBalances, mapIndexerNlpSnapshot, mapIndexerOrder, mapIndexerPerpPrices, mapIndexerPortfolio, mapIndexerProductPayment, mapIndexerServerBalance, mapIndexerServerProduct, mapIndexerV2MarketHours, mapIndexerV2Symbols, mapIndexerV2Ticker, mapSnapshotsIntervalToServerParams };
36
+ export { mapIndexerCandlesticks, mapIndexerEvent, mapIndexerEventWithTx, mapIndexerFundingRate, mapIndexerFundingRateHistory, mapIndexerLeaderboardContest, mapIndexerLeaderboardPosition, mapIndexerLeaderboardRegistration, mapIndexerMakerStatistics, mapIndexerMarketSnapshot, mapIndexerMatchEventBalances, mapIndexerNlpSnapshot, mapIndexerOrder, mapIndexerPerpPrices, mapIndexerPortfolio, mapIndexerPosition, mapIndexerProductPayment, mapIndexerServerBalance, mapIndexerServerProduct, mapIndexerV2MarketHours, mapIndexerV2Symbols, mapIndexerV2Ticker, mapSnapshotsIntervalToServerParams };
31
37
  //# sourceMappingURL=dataMappers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dataMappers.d.ts","names":[],"sources":["../src/src/dataMappers.ts"],"mappings":";;;;;;iBAmEgB,kCAAA,CACd,MAAA,EAAQ,8BAAA,GACP,8BAA8B;AAAA,iBAUjB,uBAAA,CAAwB,OAAA,EAAS,oBAAA,GAAuB,MAAM;AAAA,iBAO9D,uBAAA,CACd,OAAA,EAAS,oBAAA,GACR,kBAAA,GAAqB,kBAAA;AAAA,iBAgBR,eAAA,CAAgB,KAAA,EAAO,kBAAA,GAAqB,YAAY;AAAA,iBAgCxD,eAAA,CAAgB,KAAA,EAAO,kBAAA,GAAqB,YAAY;AAAA,iBAgDxD,qBAAA,CACd,KAAA,EAAO,kBAAA,EACP,EAAA,EAAI,eAAA,GACH,kBAAA;AAAA,iBAQa,4BAAA,CACd,aAAA,EAAe,+BAAA,GACd,yBAAyB;AAAA,iBASZ,wBAAA,CACd,OAAA,EAAS,2BAAA,GACR,qBAAqB;AAAA,iBAcR,oBAAA,CACd,UAAA,EAAY,uBAAA,GACX,iBAAiB;AAAA,iBASJ,qBAAA,CACd,WAAA,EAAa,wBAAA,GACZ,kBAAkB;AAAA,iBAQL,4BAAA,CACd,KAAA,EAAO,oCAAA,GACN,8BAA8B;AAAA,iBAkBjB,mBAAA,CACd,QAAA,EAAU,8BAAA,GACT,2BAA2B;AAAA,iBAqBd,yBAAA,CACd,KAAA,EAAO,kBAAA,GACN,YAAY;AAAA,iBAiBC,6BAAA,CACd,QAAA,EAAU,gCAAA,GACT,6BAA6B;AAAA,iBAsBhB,iCAAA,CACd,YAAA,EAAc,oCAAA,GACb,8BAA8B;AAAA,iBAQjB,4BAAA,CACd,OAAA,EAAS,+BAAA,GACR,yBAAyB;AAAA,iBAwBZ,sBAAA,CACd,WAAA,EAAa,wBAAA,GACZ,WAAW;AAAA,iBAWE,wBA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AA,EAAU,gCAAA,GACT,6BAA6B;AAAA,iBAsBhB,iCAAA,CACd,YAAA,EAAc,oCAAA,GACb,8BAA8B;AAAA,iBAQjB,4BAAA,CACd,OAAA,EAAS,+BAAA,GACR,yBAAyB;AAAA,iBAwBZ,sBAAA,CACd,WAAA,EAAa,wBAAA,GACZ,WAAW;AAAA,iBAWE,wBAAA,CACd,QAAA,EAAU,2BAAA,GACT,qBAAqB;AAAA,iBA0CR,qBAAA,CACd,QAAA,EAAU,wBAAA,GACT,kBAAkB;AAAA,iBAeL,kBAAA,CACd,MAAA,EAAQ,6BAAA,GACP,uBAAuB;AAAA,iBAaV,uBAAA,CACd,KAAA,EAAO,0BAAA,GACN,oBAAoB;AAAA,iBASP,mBAAA,CACd,MAAA,EAAQ,qBAAA,GACP,eAAe"}
@@ -102,6 +102,42 @@ function mapIndexerMatchEventBalances(eventBalances) {
102
102
  quote: eventBalances.quote ? mapIndexerServerBalance(eventBalances.quote) : void 0
103
103
  };
104
104
  }
105
+ /**
106
+ * Maps a position returned by the indexer positions query to its client representation.
107
+ * @param position - The position in server (snake_case, x18 prices) format.
108
+ * @returns The position with camelCase fields and BigNumber values.
109
+ */
110
+ function mapIndexerPosition(position) {
111
+ return {
112
+ subaccount: position.subaccount,
113
+ productId: position.product_id,
114
+ isolated: position.isolated,
115
+ direction: position.direction,
116
+ openId: position.open_id,
117
+ closeId: position.close_id,
118
+ submissionIndex: position.submission_idx,
119
+ amount: toBigNumber(position.amount),
120
+ maxAmount: toBigNumber(position.max_amount),
121
+ totalOpenAmount: toBigNumber(position.total_open_amount),
122
+ totalCloseAmount: toBigNumber(position.total_close_amount),
123
+ averageEntryPrice: removeDecimals(position.average_entry_price),
124
+ averageExitPrice: removeDecimals(position.average_exit_price),
125
+ liquidatedAmount: toBigNumber(position.liquidated_amount),
126
+ maxIsolatedLeverage: removeDecimals(position.max_isolated_leverage_x18),
127
+ openFee: toBigNumber(position.open_fee),
128
+ closeFee: toBigNumber(position.close_fee),
129
+ realizedPnl: toBigNumber(position.realized_pnl),
130
+ openTimestamp: toBigNumber(position.open_timestamp),
131
+ updateTimestamp: toBigNumber(position.update_timestamp),
132
+ openReason: position.open_reason,
133
+ closeReason: position.close_reason,
134
+ netFundingPayment: toBigNumber(position.net_funding_payment),
135
+ netInterestPayment: toBigNumber(position.net_interest_payment),
136
+ openDigest: position.open_digest,
137
+ closeDigest: position.close_digest,
138
+ netEntryUnrealized: toBigNumber(position.net_entry_unrealized)
139
+ };
140
+ }
105
141
  function mapIndexerProductPayment(payment) {
106
142
  return {
107
143
  submissionIndex: payment.idx,
@@ -308,6 +344,6 @@ function mapIndexerV2Symbols(symbol) {
308
344
  };
309
345
  }
310
346
  //#endregion
311
- export { mapIndexerCandlesticks, mapIndexerEvent, mapIndexerEventWithTx, mapIndexerFundingRate, mapIndexerFundingRateHistory, mapIndexerLeaderboardContest, mapIndexerLeaderboardPosition, mapIndexerLeaderboardRegistration, mapIndexerMakerStatistics, mapIndexerMarketSnapshot, mapIndexerMatchEventBalances, mapIndexerNlpSnapshot, mapIndexerOrder, mapIndexerPerpPrices, mapIndexerPortfolio, mapIndexerProductPayment, mapIndexerServerBalance, mapIndexerServerProduct, mapIndexerV2MarketHours, mapIndexerV2Symbols, mapIndexerV2Ticker, mapSnapshotsIntervalToServerParams };
347
+ export { mapIndexerCandlesticks, mapIndexerEvent, mapIndexerEventWithTx, mapIndexerFundingRate, mapIndexerFundingRateHistory, mapIndexerLeaderboardContest, mapIndexerLeaderboardPosition, mapIndexerLeaderboardRegistration, mapIndexerMakerStatistics, mapIndexerMarketSnapshot, mapIndexerMatchEventBalances, mapIndexerNlpSnapshot, mapIndexerOrder, mapIndexerPerpPrices, mapIndexerPortfolio, mapIndexerPosition, mapIndexerProductPayment, mapIndexerServerBalance, mapIndexerServerProduct, mapIndexerV2MarketHours, mapIndexerV2Symbols, mapIndexerV2Ticker, mapSnapshotsIntervalToServerParams };
312
348
 
313
349
  //# sourceMappingURL=dataMappers.js.map