@nadohq/indexer-client 0.1.0-alpha.1 → 0.1.0-alpha.3

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 (48) hide show
  1. package/dist/IndexerBaseClient.cjs +18 -3
  2. package/dist/IndexerBaseClient.cjs.map +1 -1
  3. package/dist/IndexerBaseClient.d.cts +7 -2
  4. package/dist/IndexerBaseClient.d.ts +7 -2
  5. package/dist/IndexerBaseClient.js +19 -4
  6. package/dist/IndexerBaseClient.js.map +1 -1
  7. package/dist/IndexerClient.cjs +6 -6
  8. package/dist/IndexerClient.cjs.map +1 -1
  9. package/dist/IndexerClient.d.cts +2 -2
  10. package/dist/IndexerClient.d.ts +2 -2
  11. package/dist/IndexerClient.js +7 -7
  12. package/dist/IndexerClient.js.map +1 -1
  13. package/dist/dataMappers.cjs +3 -3
  14. package/dist/dataMappers.cjs.map +1 -1
  15. package/dist/dataMappers.d.cts +4 -4
  16. package/dist/dataMappers.d.ts +4 -4
  17. package/dist/dataMappers.js +2 -2
  18. package/dist/dataMappers.js.map +1 -1
  19. package/dist/index.d.cts +4 -4
  20. package/dist/index.d.ts +4 -4
  21. package/dist/types/IndexerEventType.cjs.map +1 -1
  22. package/dist/types/IndexerEventType.d.cts +1 -1
  23. package/dist/types/IndexerEventType.d.ts +1 -1
  24. package/dist/types/NadoTx.cjs.map +1 -1
  25. package/dist/types/clientTypes.cjs.map +1 -1
  26. package/dist/types/clientTypes.d.cts +10 -6
  27. package/dist/types/clientTypes.d.ts +10 -6
  28. package/dist/types/index.d.cts +4 -4
  29. package/dist/types/index.d.ts +4 -4
  30. package/dist/types/paginatedEventsTypes.cjs.map +1 -1
  31. package/dist/types/paginatedEventsTypes.d.cts +6 -6
  32. package/dist/types/paginatedEventsTypes.d.ts +6 -6
  33. package/dist/types/serverModelTypes.cjs.map +1 -1
  34. package/dist/types/serverModelTypes.d.cts +3 -3
  35. package/dist/types/serverModelTypes.d.ts +3 -3
  36. package/dist/types/serverTypes.cjs.map +1 -1
  37. package/dist/types/serverTypes.d.cts +15 -7
  38. package/dist/types/serverTypes.d.ts +15 -7
  39. package/package.json +5 -5
  40. package/src/IndexerBaseClient.ts +29 -8
  41. package/src/IndexerClient.ts +15 -15
  42. package/src/dataMappers.ts +5 -5
  43. package/src/types/IndexerEventType.ts +2 -2
  44. package/src/types/NadoTx.ts +1 -1
  45. package/src/types/clientTypes.ts +12 -6
  46. package/src/types/paginatedEventsTypes.ts +6 -6
  47. package/src/types/serverModelTypes.ts +2 -2
  48. package/src/types/serverTypes.ts +16 -6
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/serverTypes.ts"],"sourcesContent":["import {\n EIP712LeaderboardAuthenticationValues,\n SignedTx,\n} from '@nadohq/contracts';\nimport { IndexerEventType } from './IndexerEventType';\nimport { IndexerLeaderboardRankType } from './IndexerLeaderboardType';\nimport { NadoWithdrawCollateralTx } from './NadoTx';\nimport {\n IndexerServerCandlestick,\n IndexerServerEvent,\n IndexerServerLeaderboardContest,\n IndexerServerLeaderboardPosition,\n IndexerServerLeaderboardRegistration,\n IndexerServerMaker,\n IndexerServerMarketSnapshot,\n IndexerServerMarketSnapshotInterval,\n IndexerServerMatchEvent,\n IndexerServerOraclePrice,\n IndexerServerOrder,\n IndexerServerProductPayment,\n IndexerServerProductSnapshot,\n IndexerServerSnapshotsInterval,\n IndexerServerTx,\n IndexerServerVlpSnapshot,\n} from './serverModelTypes';\n\n/**\n * Params\n */\n\nexport interface IndexerServerListSubaccountsParams {\n // Inclusive, defaults to 0\n start?: number;\n // Defaults to 100\n limit?: number;\n address?: string;\n}\n\nexport interface IndexerServerMultiSubaccountSnapshotsParams {\n // Subaccount hex identifiers\n subaccounts: string[];\n timestamps: number[];\n // If not given, will return both isolated & non-iso balances\n isolated?: boolean;\n}\n\nexport interface IndexerServerReferralCodeParams {\n subaccount: string;\n}\n\nexport interface IndexerServerFundingRateParams {\n product_id: number;\n}\n\nexport interface IndexerServerFundingRatesParams {\n product_ids: number[];\n}\n\nexport interface IndexerServerPriceParams {\n product_id: number;\n}\n\nexport interface IndexerServerPerpPricesParams {\n product_ids: number[];\n}\n\nexport interface IndexerServerOraclePricesParams {\n product_ids: number[];\n}\n\nexport interface IndexerServerCandlesticksParams {\n product_id: number;\n granularity: number;\n // Seconds\n max_time?: number;\n limit: number;\n}\n\nexport type IndexerEdgeServerCandlesticksParams =\n IndexerServerCandlesticksParams;\n\nexport interface IndexerServerProductsParams {\n product_id: number;\n max_time?: number;\n limit: number;\n // submission_idx for pagination, inclusive\n idx?: string;\n}\n\nexport interface IndexerServerMultiProductsParams {\n product_ids: number[];\n max_time: number[];\n}\n\nexport interface IndexerServerEventsParams {\n subaccount?: string;\n product_ids?: number[];\n // If not given, will return both isolated & non-iso events\n isolated?: boolean;\n event_types?: IndexerEventType[];\n // Descending order for idx (time), defaults to true\n desc?: boolean;\n // submission_idx for pagination, inclusive\n idx?: string;\n max_time?: number;\n limit?:\n | {\n raw: number;\n }\n | {\n txs: number;\n };\n}\n\nexport interface IndexerServerOrdersParams {\n subaccount?: string;\n product_ids?: number[];\n digests?: string[];\n max_time?: number;\n limit?: number;\n // If not given, will return both isolated & non-iso orders\n isolated?: boolean;\n // submission_idx for pagination, inclusive\n idx?: string;\n}\n\nexport interface IndexerServerMatchEventsParams {\n subaccount?: string;\n product_ids?: number[];\n // If not given, will return both isolated & non-iso events\n isolated?: boolean;\n max_time?: number;\n limit: number;\n // submission_idx for pagination, inclusive\n idx?: string;\n}\n\nexport interface IndexerServerLinkedSignerParams {\n subaccount: string;\n}\n\nexport interface IndexerServerMarketSnapshotsParams {\n interval: IndexerServerMarketSnapshotInterval;\n // Defaults to all\n product_ids?: number[];\n}\n\nexport interface IndexerEdgeServerMarketSnapshotsParams {\n interval: IndexerServerMarketSnapshotInterval;\n}\n\nexport interface IndexerServerInterestFundingParams {\n subaccount: string;\n product_ids: number[];\n // If not given, defaults to latest\n max_idx?: string;\n max_time?: number;\n limit: number;\n}\n\nexport interface IndexerServerMakerStatisticsParams {\n product_id: number;\n epoch: number;\n interval: number;\n}\n\nexport interface IndexerServerLeaderboardParams {\n contest_id: number;\n rank_type: IndexerLeaderboardRankType;\n start?: number | string;\n limit?: number | string;\n}\n\nexport interface IndexerServerLeaderboardRankParams {\n subaccount: string;\n contest_ids: number[];\n}\n\nexport interface IndexerServerLeaderboardContestsParams {\n contest_ids: number[];\n}\n\nexport interface IndexerServerLeaderboardRegistrationParams {\n subaccount: string;\n contest_id: number;\n update_registration: SignedTx<EIP712LeaderboardAuthenticationValues> | null;\n}\n\nexport interface IndexerServerFastWithdrawalSignatureParams {\n /**\n * The submission index of the WithdrawCollateral tx to be used for fast withdraw.\n */\n idx: number | string;\n}\n\nexport interface IndexerServerVlpSnapshotsParams {\n interval: IndexerServerSnapshotsInterval;\n}\n\n// Request\nexport interface IndexerServerQueryRequestByType {\n account_snapshots: IndexerServerMultiSubaccountSnapshotsParams;\n backlog: Record<string, never>;\n candlesticks: IndexerServerCandlesticksParams;\n edge_candlesticks: IndexerEdgeServerCandlesticksParams;\n edge_market_snapshots: IndexerEdgeServerMarketSnapshotsParams;\n events: IndexerServerEventsParams;\n fast_withdrawal_signature: IndexerServerFastWithdrawalSignatureParams;\n funding_rate: IndexerServerFundingRateParams;\n funding_rates: IndexerServerFundingRatesParams;\n interest_and_funding: IndexerServerInterestFundingParams;\n leaderboard: IndexerServerLeaderboardParams;\n leaderboard_contests: IndexerServerLeaderboardContestsParams;\n leaderboard_rank: IndexerServerLeaderboardRankParams;\n leaderboard_registration: IndexerServerLeaderboardRegistrationParams;\n linked_signer_rate_limit: IndexerServerLinkedSignerParams;\n maker_statistics: IndexerServerMakerStatisticsParams;\n market_snapshots: IndexerServerMarketSnapshotsParams;\n matches: IndexerServerMatchEventsParams;\n oracle_price: IndexerServerOraclePricesParams;\n orders: IndexerServerOrdersParams;\n perp_prices: IndexerServerPerpPricesParams;\n price: IndexerServerPriceParams;\n product_snapshots: IndexerServerMultiProductsParams;\n products: IndexerServerProductsParams;\n referral_code: IndexerServerReferralCodeParams;\n subaccounts: IndexerServerListSubaccountsParams;\n usdc_price: Record<string, never>;\n vlp_snapshots: IndexerServerVlpSnapshotsParams;\n}\n\nexport type IndexerServerQueryRequestType =\n keyof IndexerServerQueryRequestByType;\n\n/**\n * Responses\n */\n\nexport interface IndexerServerListSubaccountsResponse {\n subaccounts: {\n id: string;\n // Hex of subaccount bytes\n subaccount: string;\n }[];\n}\n\nexport interface IndexerServerMultiSubaccountSnapshotsResponse {\n // Map of subaccount hex -> timestamp requested -> latest events corresponding to each product\n snapshots: Record<string, Record<string, IndexerServerEvent[]>>;\n}\n\nexport interface IndexerServerReferralCodeResponse {\n referral_code: string | null;\n}\n\nexport interface IndexerServerFundingRate {\n product_id: number;\n funding_rate_x18: string;\n update_time: number;\n}\n\nexport type IndexerServerFundingRateResponse = IndexerServerFundingRate;\n\n// Map of productId -> IndexerServerFundingRate\nexport type IndexerServerFundingRatesResponse = Record<\n string,\n IndexerServerFundingRate\n>;\n\nexport interface IndexerServerPerpPrices {\n product_id: number;\n index_price_x18: string;\n mark_price_x18: string;\n update_time: number;\n}\n\nexport type IndexerServerPriceResponse = IndexerServerPerpPrices;\n\n// Map of productId -> IndexerServerPerpPrices\nexport type IndexerServerPerpPricesResponse = Record<\n string,\n IndexerServerPerpPrices\n>;\n\nexport interface IndexerServerOraclePricesResponse {\n prices: IndexerServerOraclePrice[];\n}\n\nexport interface IndexerServerCandlesticksResponse {\n candlesticks: IndexerServerCandlestick[];\n}\n\nexport type IndexerEdgeServerCandlesticksResponse =\n IndexerServerCandlesticksResponse;\n\nexport interface IndexerServerProductsResponse {\n products: IndexerServerProductSnapshot[];\n txs: IndexerServerTx[];\n}\n\n// Map of timestamp -> (productID -> IndexerServerProductSnapshot)\nexport type IndexerServerMultiProductsResponse = Record<\n string,\n Record<string, IndexerServerProductSnapshot>\n>;\n\nexport interface IndexerServerEventsResponse {\n events: IndexerServerEvent[];\n txs: IndexerServerTx[];\n}\n\nexport interface IndexerServerOrdersResponse {\n orders: IndexerServerOrder[];\n}\n\nexport interface IndexerServerMatchEventsResponse {\n matches: IndexerServerMatchEvent[];\n txs: IndexerServerTx[];\n}\n\nexport interface IndexerServerUsdcPriceResponse {\n price_x18: string;\n}\n\nexport interface IndexerServerLinkedSignerResponse {\n total_tx_limit: string;\n remaining_tx: string;\n wait_time: string;\n signer: string;\n}\n\nexport interface IndexerServerMarketSnapshotsResponse {\n snapshots: IndexerServerMarketSnapshot[];\n}\n\nexport interface IndexerEdgeServerMarketSnapshotsResponse {\n snapshots: Record<number, IndexerServerMarketSnapshot[]>;\n}\n\nexport interface IndexerServerInterestFundingResponse {\n interest_payments: IndexerServerProductPayment[];\n funding_payments: IndexerServerProductPayment[];\n next_idx: string;\n}\n\nexport interface IndexerServerMakerStatisticsResponse {\n reward_coefficient: string;\n makers: IndexerServerMaker[];\n}\n\nexport interface IndexerServerLeaderboardResponse {\n positions: IndexerServerLeaderboardPosition[];\n}\n\nexport interface IndexerServerLeaderboardRegistrationResponse {\n // For non-tiered contests, null if the user is not registered for the provided contestId.\n // For tiered contests (i.e., related contests), null if the user is not registered for any of the contests in the tier group.\n registration: IndexerServerLeaderboardRegistration | null;\n}\n\nexport interface IndexerServerLeaderboardRankResponse {\n // If the subaccount is not eligible for a given contest, it would not be included in the response.\n // contestId -> IndexerServerLeaderboardPosition\n positions: Record<string, IndexerServerLeaderboardPosition>;\n}\n\nexport interface IndexerServerLeaderboardContestsResponse {\n contests: IndexerServerLeaderboardContest[];\n}\n\nexport interface IndexerServerFastWithdrawalSignatureResponse {\n idx: string;\n tx: NadoWithdrawCollateralTx['withdraw_collateral'];\n tx_bytes: string;\n signatures: string[];\n}\n\nexport interface IndexerServerVlpSnapshotsResponse {\n snapshots: IndexerServerVlpSnapshot[];\n}\n\nexport interface IndexerServerBacklogResponse {\n // Total number of transactions stored in the indexer DB\n total_txs: string;\n // Current nSubmissions value from the chain (i.e., number of processed txs)\n total_submissions: string;\n // Number of unprocessed transactions (total_txs - total_submissions)\n backlog_size: string;\n // UNIX timestamp (in seconds) of when the data was last updated\n updated_at: string;\n // Estimated time in seconds (float) to clear the entire backlog (null if unavailable)\n backlog_eta_in_seconds: string | null;\n // Current submission rate in transactions per second (float) (null if unavailable)\n txs_per_second: string | null;\n}\n\n// Response\nexport interface IndexerServerQueryResponseByType {\n account_snapshots: IndexerServerMultiSubaccountSnapshotsResponse;\n backlog: IndexerServerBacklogResponse;\n candlesticks: IndexerServerCandlesticksResponse;\n edge_candlesticks: IndexerEdgeServerCandlesticksResponse;\n edge_market_snapshots: IndexerEdgeServerMarketSnapshotsResponse;\n events: IndexerServerEventsResponse;\n fast_withdrawal_signature: IndexerServerFastWithdrawalSignatureResponse;\n funding_rate: IndexerServerFundingRateResponse;\n funding_rates: IndexerServerFundingRatesResponse;\n interest_and_funding: IndexerServerInterestFundingResponse;\n leaderboard: IndexerServerLeaderboardResponse;\n leaderboard_contests: IndexerServerLeaderboardContestsResponse;\n leaderboard_rank: IndexerServerLeaderboardRankResponse;\n leaderboard_registration: IndexerServerLeaderboardRegistrationResponse;\n linked_signer_rate_limit: IndexerServerLinkedSignerResponse;\n maker_statistics: IndexerServerMakerStatisticsResponse;\n market_snapshots: IndexerServerMarketSnapshotsResponse;\n matches: IndexerServerMatchEventsResponse;\n oracle_price: IndexerServerOraclePricesResponse;\n orders: IndexerServerOrdersResponse;\n perp_prices: IndexerServerPerpPricesResponse;\n price: IndexerServerPriceResponse;\n product_snapshots: IndexerServerMultiProductsResponse;\n products: IndexerServerProductsResponse;\n referral_code: IndexerServerReferralCodeResponse;\n subaccounts: IndexerServerListSubaccountsResponse;\n usdc_price: IndexerServerUsdcPriceResponse;\n vlp_snapshots: IndexerServerVlpSnapshotsResponse;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/types/serverTypes.ts"],"sourcesContent":["import {\n EIP712LeaderboardAuthenticationValues,\n SignedTx,\n} from '@nadohq/contracts';\nimport { IndexerEventType } from './IndexerEventType';\nimport { IndexerLeaderboardRankType } from './IndexerLeaderboardType';\nimport { NadoWithdrawCollateralTx } from './NadoTx';\nimport {\n IndexerServerCandlestick,\n IndexerServerEvent,\n IndexerServerLeaderboardContest,\n IndexerServerLeaderboardPosition,\n IndexerServerLeaderboardRegistration,\n IndexerServerMaker,\n IndexerServerMarketSnapshot,\n IndexerServerMarketSnapshotInterval,\n IndexerServerMatchEvent,\n IndexerServerOraclePrice,\n IndexerServerOrder,\n IndexerServerProductPayment,\n IndexerServerProductSnapshot,\n IndexerServerSnapshotsInterval,\n IndexerServerTx,\n IndexerServerNlpSnapshot,\n} from './serverModelTypes';\n\n/**\n * Params\n */\n\nexport interface IndexerServerListSubaccountsParams {\n // Inclusive, defaults to 0\n start?: number;\n // Defaults to 100\n limit?: number;\n address?: string;\n}\n\nexport interface IndexerServerMultiSubaccountSnapshotsParams {\n // Subaccount hex identifiers\n subaccounts: string[];\n timestamps: number[];\n // If not given, will return both isolated & non-iso balances\n isolated?: boolean;\n}\n\nexport interface IndexerServerReferralCodeParams {\n subaccount: string;\n}\n\nexport interface IndexerServerFundingRateParams {\n product_id: number;\n}\n\nexport interface IndexerServerFundingRatesParams {\n product_ids: number[];\n}\n\nexport interface IndexerServerPriceParams {\n product_id: number;\n}\n\nexport interface IndexerServerPerpPricesParams {\n product_ids: number[];\n}\n\nexport interface IndexerServerOraclePricesParams {\n product_ids: number[];\n}\n\nexport interface IndexerServerCandlesticksParams {\n product_id: number;\n granularity: number;\n // Seconds\n max_time?: number;\n limit: number;\n}\n\nexport type IndexerEdgeServerCandlesticksParams =\n IndexerServerCandlesticksParams;\n\nexport interface IndexerServerProductsParams {\n product_id: number;\n max_time?: number;\n limit: number;\n // submission_idx for pagination, inclusive\n idx?: string;\n}\n\nexport interface IndexerServerMultiProductsParams {\n product_ids: number[];\n max_time: number[];\n}\n\nexport interface IndexerServerEventsParams {\n subaccount?: string;\n product_ids?: number[];\n // If not given, will return both isolated & non-iso events\n isolated?: boolean;\n event_types?: IndexerEventType[];\n // Descending order for idx (time), defaults to true\n desc?: boolean;\n // submission_idx for pagination, inclusive\n idx?: string;\n max_time?: number;\n limit?:\n | {\n raw: number;\n }\n | {\n txs: number;\n };\n}\n\nexport interface IndexerServerOrdersParams {\n subaccount?: string;\n product_ids?: number[];\n digests?: string[];\n max_time?: number;\n limit?: number;\n // If not given, will return both isolated & non-iso orders\n isolated?: boolean;\n // submission_idx for pagination, inclusive\n idx?: string;\n}\n\nexport interface IndexerServerMatchEventsParams {\n subaccount?: string;\n product_ids?: number[];\n // If not given, will return both isolated & non-iso events\n isolated?: boolean;\n max_time?: number;\n limit: number;\n // submission_idx for pagination, inclusive\n idx?: string;\n}\n\nexport interface IndexerServerLinkedSignerParams {\n subaccount: string;\n}\n\nexport interface IndexerServerMarketSnapshotsParams {\n interval: IndexerServerMarketSnapshotInterval;\n // Defaults to all\n product_ids?: number[];\n}\n\nexport interface IndexerEdgeServerMarketSnapshotsParams {\n interval: IndexerServerMarketSnapshotInterval;\n}\n\nexport interface IndexerServerInterestFundingParams {\n subaccount: string;\n product_ids: number[];\n // If not given, defaults to latest\n max_idx?: string;\n max_time?: number;\n limit: number;\n}\n\nexport interface IndexerServerMakerStatisticsParams {\n product_id: number;\n epoch: number;\n interval: number;\n}\n\nexport interface IndexerServerLeaderboardParams {\n contest_id: number;\n rank_type: IndexerLeaderboardRankType;\n start?: number | string;\n limit?: number | string;\n}\n\nexport interface IndexerServerLeaderboardRankParams {\n subaccount: string;\n contest_ids: number[];\n}\n\nexport interface IndexerServerLeaderboardContestsParams {\n contest_ids: number[];\n}\n\nexport interface IndexerServerLeaderboardRegistrationParams {\n subaccount: string;\n contest_id: number;\n update_registration: SignedTx<EIP712LeaderboardAuthenticationValues> | null;\n}\n\nexport interface IndexerServerFastWithdrawalSignatureParams {\n /**\n * The submission index of the WithdrawCollateral tx to be used for fast withdraw.\n */\n idx: number | string;\n}\n\nexport interface IndexerServerNlpSnapshotsParams {\n interval: IndexerServerSnapshotsInterval;\n}\n\nexport interface IndexerServerDDAQueryParams {\n subaccount: string;\n}\n\n// Request\nexport interface IndexerServerQueryRequestByType {\n account_snapshots: IndexerServerMultiSubaccountSnapshotsParams;\n backlog: Record<string, never>;\n candlesticks: IndexerServerCandlesticksParams;\n direct_deposit_address: IndexerServerDDAQueryParams;\n edge_candlesticks: IndexerEdgeServerCandlesticksParams;\n edge_market_snapshots: IndexerEdgeServerMarketSnapshotsParams;\n events: IndexerServerEventsParams;\n fast_withdrawal_signature: IndexerServerFastWithdrawalSignatureParams;\n funding_rate: IndexerServerFundingRateParams;\n funding_rates: IndexerServerFundingRatesParams;\n interest_and_funding: IndexerServerInterestFundingParams;\n leaderboard: IndexerServerLeaderboardParams;\n leaderboard_contests: IndexerServerLeaderboardContestsParams;\n leaderboard_rank: IndexerServerLeaderboardRankParams;\n leaderboard_registration: IndexerServerLeaderboardRegistrationParams;\n linked_signer_rate_limit: IndexerServerLinkedSignerParams;\n maker_statistics: IndexerServerMakerStatisticsParams;\n market_snapshots: IndexerServerMarketSnapshotsParams;\n matches: IndexerServerMatchEventsParams;\n oracle_price: IndexerServerOraclePricesParams;\n orders: IndexerServerOrdersParams;\n perp_prices: IndexerServerPerpPricesParams;\n price: IndexerServerPriceParams;\n product_snapshots: IndexerServerMultiProductsParams;\n products: IndexerServerProductsParams;\n referral_code: IndexerServerReferralCodeParams;\n subaccounts: IndexerServerListSubaccountsParams;\n usdc_price: Record<string, never>;\n nlp_snapshots: IndexerServerNlpSnapshotsParams;\n}\n\nexport type IndexerServerQueryRequestType =\n keyof IndexerServerQueryRequestByType;\n\n/**\n * Responses\n */\n\nexport interface IndexerServerListSubaccountsResponse {\n subaccounts: {\n id: string;\n // Hex of subaccount bytes\n subaccount: string;\n }[];\n}\n\nexport interface IndexerServerMultiSubaccountSnapshotsResponse {\n // Map of subaccount hex -> timestamp requested -> latest events corresponding to each product\n snapshots: Record<string, Record<string, IndexerServerEvent[]>>;\n}\n\nexport interface IndexerServerReferralCodeResponse {\n referral_code: string | null;\n}\n\nexport interface IndexerServerFundingRate {\n product_id: number;\n funding_rate_x18: string;\n update_time: number;\n}\n\nexport type IndexerServerFundingRateResponse = IndexerServerFundingRate;\n\n// Map of productId -> IndexerServerFundingRate\nexport type IndexerServerFundingRatesResponse = Record<\n string,\n IndexerServerFundingRate\n>;\n\nexport interface IndexerServerPerpPrices {\n product_id: number;\n index_price_x18: string;\n mark_price_x18: string;\n update_time: number;\n}\n\nexport type IndexerServerPriceResponse = IndexerServerPerpPrices;\n\n// Map of productId -> IndexerServerPerpPrices\nexport type IndexerServerPerpPricesResponse = Record<\n string,\n IndexerServerPerpPrices\n>;\n\nexport interface IndexerServerOraclePricesResponse {\n prices: IndexerServerOraclePrice[];\n}\n\nexport interface IndexerServerCandlesticksResponse {\n candlesticks: IndexerServerCandlestick[];\n}\n\nexport type IndexerEdgeServerCandlesticksResponse =\n IndexerServerCandlesticksResponse;\n\nexport interface IndexerServerProductsResponse {\n products: IndexerServerProductSnapshot[];\n txs: IndexerServerTx[];\n}\n\n// Map of timestamp -> (productID -> IndexerServerProductSnapshot)\nexport type IndexerServerMultiProductsResponse = Record<\n string,\n Record<string, IndexerServerProductSnapshot>\n>;\n\nexport interface IndexerServerEventsResponse {\n events: IndexerServerEvent[];\n txs: IndexerServerTx[];\n}\n\nexport interface IndexerServerOrdersResponse {\n orders: IndexerServerOrder[];\n}\n\nexport interface IndexerServerMatchEventsResponse {\n matches: IndexerServerMatchEvent[];\n txs: IndexerServerTx[];\n}\n\nexport interface IndexerServerUsdcPriceResponse {\n price_x18: string;\n}\n\nexport interface IndexerServerLinkedSignerResponse {\n total_tx_limit: string;\n remaining_tx: string;\n wait_time: string;\n signer: string;\n}\n\nexport interface IndexerServerMarketSnapshotsResponse {\n snapshots: IndexerServerMarketSnapshot[];\n}\n\nexport interface IndexerEdgeServerMarketSnapshotsResponse {\n snapshots: Record<number, IndexerServerMarketSnapshot[]>;\n}\n\nexport interface IndexerServerInterestFundingResponse {\n interest_payments: IndexerServerProductPayment[];\n funding_payments: IndexerServerProductPayment[];\n next_idx: string;\n}\n\nexport interface IndexerServerMakerStatisticsResponse {\n reward_coefficient: string;\n makers: IndexerServerMaker[];\n}\n\nexport interface IndexerServerLeaderboardResponse {\n positions: IndexerServerLeaderboardPosition[];\n}\n\nexport interface IndexerServerLeaderboardRegistrationResponse {\n // For non-tiered contests, null if the user is not registered for the provided contestId.\n // For tiered contests (i.e., related contests), null if the user is not registered for any of the contests in the tier group.\n registration: IndexerServerLeaderboardRegistration | null;\n}\n\nexport interface IndexerServerLeaderboardRankResponse {\n // If the subaccount is not eligible for a given contest, it would not be included in the response.\n // contestId -> IndexerServerLeaderboardPosition\n positions: Record<string, IndexerServerLeaderboardPosition>;\n}\n\nexport interface IndexerServerLeaderboardContestsResponse {\n contests: IndexerServerLeaderboardContest[];\n}\n\nexport interface IndexerServerFastWithdrawalSignatureResponse {\n idx: string;\n tx: NadoWithdrawCollateralTx['withdraw_collateral'];\n tx_bytes: string;\n signatures: string[];\n}\n\nexport interface IndexerServerNlpSnapshotsResponse {\n snapshots: IndexerServerNlpSnapshot[];\n}\n\nexport interface IndexerServerDDAResponse {\n v1_address: string;\n}\n\nexport interface IndexerServerBacklogResponse {\n // Total number of transactions stored in the indexer DB\n total_txs: string;\n // Current nSubmissions value from the chain (i.e., number of processed txs)\n total_submissions: string;\n // Number of unprocessed transactions (total_txs - total_submissions)\n backlog_size: string;\n // UNIX timestamp (in seconds) of when the data was last updated\n updated_at: string;\n // Estimated time in seconds (float) to clear the entire backlog (null if unavailable)\n backlog_eta_in_seconds: string | null;\n // Current submission rate in transactions per second (float) (null if unavailable)\n txs_per_second: string | null;\n}\n\n// Response\nexport interface IndexerServerQueryResponseByType {\n account_snapshots: IndexerServerMultiSubaccountSnapshotsResponse;\n backlog: IndexerServerBacklogResponse;\n candlesticks: IndexerServerCandlesticksResponse;\n direct_deposit_address: IndexerServerDDAResponse;\n edge_candlesticks: IndexerEdgeServerCandlesticksResponse;\n edge_market_snapshots: IndexerEdgeServerMarketSnapshotsResponse;\n events: IndexerServerEventsResponse;\n fast_withdrawal_signature: IndexerServerFastWithdrawalSignatureResponse;\n funding_rate: IndexerServerFundingRateResponse;\n funding_rates: IndexerServerFundingRatesResponse;\n interest_and_funding: IndexerServerInterestFundingResponse;\n leaderboard: IndexerServerLeaderboardResponse;\n leaderboard_contests: IndexerServerLeaderboardContestsResponse;\n leaderboard_rank: IndexerServerLeaderboardRankResponse;\n leaderboard_registration: IndexerServerLeaderboardRegistrationResponse;\n linked_signer_rate_limit: IndexerServerLinkedSignerResponse;\n maker_statistics: IndexerServerMakerStatisticsResponse;\n market_snapshots: IndexerServerMarketSnapshotsResponse;\n matches: IndexerServerMatchEventsResponse;\n oracle_price: IndexerServerOraclePricesResponse;\n orders: IndexerServerOrdersResponse;\n perp_prices: IndexerServerPerpPricesResponse;\n price: IndexerServerPriceResponse;\n product_snapshots: IndexerServerMultiProductsResponse;\n products: IndexerServerProductsResponse;\n referral_code: IndexerServerReferralCodeResponse;\n subaccounts: IndexerServerListSubaccountsResponse;\n usdc_price: IndexerServerUsdcPriceResponse;\n nlp_snapshots: IndexerServerNlpSnapshotsResponse;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -2,7 +2,7 @@ import { SignedTx, EIP712LeaderboardAuthenticationValues } from '@nadohq/contrac
2
2
  import { IndexerEventType } from './IndexerEventType.cjs';
3
3
  import { IndexerLeaderboardRankType } from './IndexerLeaderboardType.cjs';
4
4
  import { NadoWithdrawCollateralTx } from './NadoTx.cjs';
5
- import { IndexerServerMarketSnapshotInterval, IndexerServerSnapshotsInterval, IndexerServerEvent, IndexerServerCandlestick, IndexerServerMarketSnapshot, IndexerServerTx, IndexerServerProductPayment, IndexerServerLeaderboardPosition, IndexerServerLeaderboardContest, IndexerServerLeaderboardRegistration, IndexerServerMaker, IndexerServerMatchEvent, IndexerServerOraclePrice, IndexerServerOrder, IndexerServerProductSnapshot, IndexerServerVlpSnapshot } from './serverModelTypes.cjs';
5
+ import { IndexerServerMarketSnapshotInterval, IndexerServerSnapshotsInterval, IndexerServerEvent, IndexerServerCandlestick, IndexerServerMarketSnapshot, IndexerServerTx, IndexerServerProductPayment, IndexerServerLeaderboardPosition, IndexerServerLeaderboardContest, IndexerServerLeaderboardRegistration, IndexerServerMaker, IndexerServerMatchEvent, IndexerServerOraclePrice, IndexerServerOrder, IndexerServerProductSnapshot, IndexerServerNlpSnapshot } from './serverModelTypes.cjs';
6
6
  import '@nadohq/engine-client';
7
7
 
8
8
  /**
@@ -130,13 +130,17 @@ interface IndexerServerFastWithdrawalSignatureParams {
130
130
  */
131
131
  idx: number | string;
132
132
  }
133
- interface IndexerServerVlpSnapshotsParams {
133
+ interface IndexerServerNlpSnapshotsParams {
134
134
  interval: IndexerServerSnapshotsInterval;
135
135
  }
136
+ interface IndexerServerDDAQueryParams {
137
+ subaccount: string;
138
+ }
136
139
  interface IndexerServerQueryRequestByType {
137
140
  account_snapshots: IndexerServerMultiSubaccountSnapshotsParams;
138
141
  backlog: Record<string, never>;
139
142
  candlesticks: IndexerServerCandlesticksParams;
143
+ direct_deposit_address: IndexerServerDDAQueryParams;
140
144
  edge_candlesticks: IndexerEdgeServerCandlesticksParams;
141
145
  edge_market_snapshots: IndexerEdgeServerMarketSnapshotsParams;
142
146
  events: IndexerServerEventsParams;
@@ -161,7 +165,7 @@ interface IndexerServerQueryRequestByType {
161
165
  referral_code: IndexerServerReferralCodeParams;
162
166
  subaccounts: IndexerServerListSubaccountsParams;
163
167
  usdc_price: Record<string, never>;
164
- vlp_snapshots: IndexerServerVlpSnapshotsParams;
168
+ nlp_snapshots: IndexerServerNlpSnapshotsParams;
165
169
  }
166
170
  type IndexerServerQueryRequestType = keyof IndexerServerQueryRequestByType;
167
171
  /**
@@ -259,8 +263,11 @@ interface IndexerServerFastWithdrawalSignatureResponse {
259
263
  tx_bytes: string;
260
264
  signatures: string[];
261
265
  }
262
- interface IndexerServerVlpSnapshotsResponse {
263
- snapshots: IndexerServerVlpSnapshot[];
266
+ interface IndexerServerNlpSnapshotsResponse {
267
+ snapshots: IndexerServerNlpSnapshot[];
268
+ }
269
+ interface IndexerServerDDAResponse {
270
+ v1_address: string;
264
271
  }
265
272
  interface IndexerServerBacklogResponse {
266
273
  total_txs: string;
@@ -274,6 +281,7 @@ interface IndexerServerQueryResponseByType {
274
281
  account_snapshots: IndexerServerMultiSubaccountSnapshotsResponse;
275
282
  backlog: IndexerServerBacklogResponse;
276
283
  candlesticks: IndexerServerCandlesticksResponse;
284
+ direct_deposit_address: IndexerServerDDAResponse;
277
285
  edge_candlesticks: IndexerEdgeServerCandlesticksResponse;
278
286
  edge_market_snapshots: IndexerEdgeServerMarketSnapshotsResponse;
279
287
  events: IndexerServerEventsResponse;
@@ -298,7 +306,7 @@ interface IndexerServerQueryResponseByType {
298
306
  referral_code: IndexerServerReferralCodeResponse;
299
307
  subaccounts: IndexerServerListSubaccountsResponse;
300
308
  usdc_price: IndexerServerUsdcPriceResponse;
301
- vlp_snapshots: IndexerServerVlpSnapshotsResponse;
309
+ nlp_snapshots: IndexerServerNlpSnapshotsResponse;
302
310
  }
303
311
 
304
- export type { IndexerEdgeServerCandlesticksParams, IndexerEdgeServerCandlesticksResponse, IndexerEdgeServerMarketSnapshotsParams, IndexerEdgeServerMarketSnapshotsResponse, IndexerServerBacklogResponse, IndexerServerCandlesticksParams, IndexerServerCandlesticksResponse, IndexerServerEventsParams, IndexerServerEventsResponse, IndexerServerFastWithdrawalSignatureParams, IndexerServerFastWithdrawalSignatureResponse, IndexerServerFundingRate, IndexerServerFundingRateParams, IndexerServerFundingRateResponse, IndexerServerFundingRatesParams, IndexerServerFundingRatesResponse, IndexerServerInterestFundingParams, IndexerServerInterestFundingResponse, IndexerServerLeaderboardContestsParams, IndexerServerLeaderboardContestsResponse, IndexerServerLeaderboardParams, IndexerServerLeaderboardRankParams, IndexerServerLeaderboardRankResponse, IndexerServerLeaderboardRegistrationParams, IndexerServerLeaderboardRegistrationResponse, IndexerServerLeaderboardResponse, IndexerServerLinkedSignerParams, IndexerServerLinkedSignerResponse, IndexerServerListSubaccountsParams, IndexerServerListSubaccountsResponse, IndexerServerMakerStatisticsParams, IndexerServerMakerStatisticsResponse, IndexerServerMarketSnapshotsParams, IndexerServerMarketSnapshotsResponse, IndexerServerMatchEventsParams, IndexerServerMatchEventsResponse, IndexerServerMultiProductsParams, IndexerServerMultiProductsResponse, IndexerServerMultiSubaccountSnapshotsParams, IndexerServerMultiSubaccountSnapshotsResponse, IndexerServerOraclePricesParams, IndexerServerOraclePricesResponse, IndexerServerOrdersParams, IndexerServerOrdersResponse, IndexerServerPerpPrices, IndexerServerPerpPricesParams, IndexerServerPerpPricesResponse, IndexerServerPriceParams, IndexerServerPriceResponse, IndexerServerProductsParams, IndexerServerProductsResponse, IndexerServerQueryRequestByType, IndexerServerQueryRequestType, IndexerServerQueryResponseByType, IndexerServerReferralCodeParams, IndexerServerReferralCodeResponse, IndexerServerUsdcPriceResponse, IndexerServerVlpSnapshotsParams, IndexerServerVlpSnapshotsResponse };
312
+ export type { IndexerEdgeServerCandlesticksParams, IndexerEdgeServerCandlesticksResponse, IndexerEdgeServerMarketSnapshotsParams, IndexerEdgeServerMarketSnapshotsResponse, IndexerServerBacklogResponse, IndexerServerCandlesticksParams, IndexerServerCandlesticksResponse, IndexerServerDDAQueryParams, IndexerServerDDAResponse, IndexerServerEventsParams, IndexerServerEventsResponse, IndexerServerFastWithdrawalSignatureParams, IndexerServerFastWithdrawalSignatureResponse, IndexerServerFundingRate, IndexerServerFundingRateParams, IndexerServerFundingRateResponse, IndexerServerFundingRatesParams, IndexerServerFundingRatesResponse, IndexerServerInterestFundingParams, IndexerServerInterestFundingResponse, IndexerServerLeaderboardContestsParams, IndexerServerLeaderboardContestsResponse, IndexerServerLeaderboardParams, IndexerServerLeaderboardRankParams, IndexerServerLeaderboardRankResponse, IndexerServerLeaderboardRegistrationParams, IndexerServerLeaderboardRegistrationResponse, IndexerServerLeaderboardResponse, IndexerServerLinkedSignerParams, IndexerServerLinkedSignerResponse, IndexerServerListSubaccountsParams, IndexerServerListSubaccountsResponse, IndexerServerMakerStatisticsParams, IndexerServerMakerStatisticsResponse, IndexerServerMarketSnapshotsParams, IndexerServerMarketSnapshotsResponse, IndexerServerMatchEventsParams, IndexerServerMatchEventsResponse, IndexerServerMultiProductsParams, IndexerServerMultiProductsResponse, IndexerServerMultiSubaccountSnapshotsParams, IndexerServerMultiSubaccountSnapshotsResponse, IndexerServerNlpSnapshotsParams, IndexerServerNlpSnapshotsResponse, IndexerServerOraclePricesParams, IndexerServerOraclePricesResponse, IndexerServerOrdersParams, IndexerServerOrdersResponse, IndexerServerPerpPrices, IndexerServerPerpPricesParams, IndexerServerPerpPricesResponse, IndexerServerPriceParams, IndexerServerPriceResponse, IndexerServerProductsParams, IndexerServerProductsResponse, IndexerServerQueryRequestByType, IndexerServerQueryRequestType, IndexerServerQueryResponseByType, IndexerServerReferralCodeParams, IndexerServerReferralCodeResponse, IndexerServerUsdcPriceResponse };
@@ -2,7 +2,7 @@ import { SignedTx, EIP712LeaderboardAuthenticationValues } from '@nadohq/contrac
2
2
  import { IndexerEventType } from './IndexerEventType.js';
3
3
  import { IndexerLeaderboardRankType } from './IndexerLeaderboardType.js';
4
4
  import { NadoWithdrawCollateralTx } from './NadoTx.js';
5
- import { IndexerServerMarketSnapshotInterval, IndexerServerSnapshotsInterval, IndexerServerEvent, IndexerServerCandlestick, IndexerServerMarketSnapshot, IndexerServerTx, IndexerServerProductPayment, IndexerServerLeaderboardPosition, IndexerServerLeaderboardContest, IndexerServerLeaderboardRegistration, IndexerServerMaker, IndexerServerMatchEvent, IndexerServerOraclePrice, IndexerServerOrder, IndexerServerProductSnapshot, IndexerServerVlpSnapshot } from './serverModelTypes.js';
5
+ import { IndexerServerMarketSnapshotInterval, IndexerServerSnapshotsInterval, IndexerServerEvent, IndexerServerCandlestick, IndexerServerMarketSnapshot, IndexerServerTx, IndexerServerProductPayment, IndexerServerLeaderboardPosition, IndexerServerLeaderboardContest, IndexerServerLeaderboardRegistration, IndexerServerMaker, IndexerServerMatchEvent, IndexerServerOraclePrice, IndexerServerOrder, IndexerServerProductSnapshot, IndexerServerNlpSnapshot } from './serverModelTypes.js';
6
6
  import '@nadohq/engine-client';
7
7
 
8
8
  /**
@@ -130,13 +130,17 @@ interface IndexerServerFastWithdrawalSignatureParams {
130
130
  */
131
131
  idx: number | string;
132
132
  }
133
- interface IndexerServerVlpSnapshotsParams {
133
+ interface IndexerServerNlpSnapshotsParams {
134
134
  interval: IndexerServerSnapshotsInterval;
135
135
  }
136
+ interface IndexerServerDDAQueryParams {
137
+ subaccount: string;
138
+ }
136
139
  interface IndexerServerQueryRequestByType {
137
140
  account_snapshots: IndexerServerMultiSubaccountSnapshotsParams;
138
141
  backlog: Record<string, never>;
139
142
  candlesticks: IndexerServerCandlesticksParams;
143
+ direct_deposit_address: IndexerServerDDAQueryParams;
140
144
  edge_candlesticks: IndexerEdgeServerCandlesticksParams;
141
145
  edge_market_snapshots: IndexerEdgeServerMarketSnapshotsParams;
142
146
  events: IndexerServerEventsParams;
@@ -161,7 +165,7 @@ interface IndexerServerQueryRequestByType {
161
165
  referral_code: IndexerServerReferralCodeParams;
162
166
  subaccounts: IndexerServerListSubaccountsParams;
163
167
  usdc_price: Record<string, never>;
164
- vlp_snapshots: IndexerServerVlpSnapshotsParams;
168
+ nlp_snapshots: IndexerServerNlpSnapshotsParams;
165
169
  }
166
170
  type IndexerServerQueryRequestType = keyof IndexerServerQueryRequestByType;
167
171
  /**
@@ -259,8 +263,11 @@ interface IndexerServerFastWithdrawalSignatureResponse {
259
263
  tx_bytes: string;
260
264
  signatures: string[];
261
265
  }
262
- interface IndexerServerVlpSnapshotsResponse {
263
- snapshots: IndexerServerVlpSnapshot[];
266
+ interface IndexerServerNlpSnapshotsResponse {
267
+ snapshots: IndexerServerNlpSnapshot[];
268
+ }
269
+ interface IndexerServerDDAResponse {
270
+ v1_address: string;
264
271
  }
265
272
  interface IndexerServerBacklogResponse {
266
273
  total_txs: string;
@@ -274,6 +281,7 @@ interface IndexerServerQueryResponseByType {
274
281
  account_snapshots: IndexerServerMultiSubaccountSnapshotsResponse;
275
282
  backlog: IndexerServerBacklogResponse;
276
283
  candlesticks: IndexerServerCandlesticksResponse;
284
+ direct_deposit_address: IndexerServerDDAResponse;
277
285
  edge_candlesticks: IndexerEdgeServerCandlesticksResponse;
278
286
  edge_market_snapshots: IndexerEdgeServerMarketSnapshotsResponse;
279
287
  events: IndexerServerEventsResponse;
@@ -298,7 +306,7 @@ interface IndexerServerQueryResponseByType {
298
306
  referral_code: IndexerServerReferralCodeResponse;
299
307
  subaccounts: IndexerServerListSubaccountsResponse;
300
308
  usdc_price: IndexerServerUsdcPriceResponse;
301
- vlp_snapshots: IndexerServerVlpSnapshotsResponse;
309
+ nlp_snapshots: IndexerServerNlpSnapshotsResponse;
302
310
  }
303
311
 
304
- export type { IndexerEdgeServerCandlesticksParams, IndexerEdgeServerCandlesticksResponse, IndexerEdgeServerMarketSnapshotsParams, IndexerEdgeServerMarketSnapshotsResponse, IndexerServerBacklogResponse, IndexerServerCandlesticksParams, IndexerServerCandlesticksResponse, IndexerServerEventsParams, IndexerServerEventsResponse, IndexerServerFastWithdrawalSignatureParams, IndexerServerFastWithdrawalSignatureResponse, IndexerServerFundingRate, IndexerServerFundingRateParams, IndexerServerFundingRateResponse, IndexerServerFundingRatesParams, IndexerServerFundingRatesResponse, IndexerServerInterestFundingParams, IndexerServerInterestFundingResponse, IndexerServerLeaderboardContestsParams, IndexerServerLeaderboardContestsResponse, IndexerServerLeaderboardParams, IndexerServerLeaderboardRankParams, IndexerServerLeaderboardRankResponse, IndexerServerLeaderboardRegistrationParams, IndexerServerLeaderboardRegistrationResponse, IndexerServerLeaderboardResponse, IndexerServerLinkedSignerParams, IndexerServerLinkedSignerResponse, IndexerServerListSubaccountsParams, IndexerServerListSubaccountsResponse, IndexerServerMakerStatisticsParams, IndexerServerMakerStatisticsResponse, IndexerServerMarketSnapshotsParams, IndexerServerMarketSnapshotsResponse, IndexerServerMatchEventsParams, IndexerServerMatchEventsResponse, IndexerServerMultiProductsParams, IndexerServerMultiProductsResponse, IndexerServerMultiSubaccountSnapshotsParams, IndexerServerMultiSubaccountSnapshotsResponse, IndexerServerOraclePricesParams, IndexerServerOraclePricesResponse, IndexerServerOrdersParams, IndexerServerOrdersResponse, IndexerServerPerpPrices, IndexerServerPerpPricesParams, IndexerServerPerpPricesResponse, IndexerServerPriceParams, IndexerServerPriceResponse, IndexerServerProductsParams, IndexerServerProductsResponse, IndexerServerQueryRequestByType, IndexerServerQueryRequestType, IndexerServerQueryResponseByType, IndexerServerReferralCodeParams, IndexerServerReferralCodeResponse, IndexerServerUsdcPriceResponse, IndexerServerVlpSnapshotsParams, IndexerServerVlpSnapshotsResponse };
312
+ export type { IndexerEdgeServerCandlesticksParams, IndexerEdgeServerCandlesticksResponse, IndexerEdgeServerMarketSnapshotsParams, IndexerEdgeServerMarketSnapshotsResponse, IndexerServerBacklogResponse, IndexerServerCandlesticksParams, IndexerServerCandlesticksResponse, IndexerServerDDAQueryParams, IndexerServerDDAResponse, IndexerServerEventsParams, IndexerServerEventsResponse, IndexerServerFastWithdrawalSignatureParams, IndexerServerFastWithdrawalSignatureResponse, IndexerServerFundingRate, IndexerServerFundingRateParams, IndexerServerFundingRateResponse, IndexerServerFundingRatesParams, IndexerServerFundingRatesResponse, IndexerServerInterestFundingParams, IndexerServerInterestFundingResponse, IndexerServerLeaderboardContestsParams, IndexerServerLeaderboardContestsResponse, IndexerServerLeaderboardParams, IndexerServerLeaderboardRankParams, IndexerServerLeaderboardRankResponse, IndexerServerLeaderboardRegistrationParams, IndexerServerLeaderboardRegistrationResponse, IndexerServerLeaderboardResponse, IndexerServerLinkedSignerParams, IndexerServerLinkedSignerResponse, IndexerServerListSubaccountsParams, IndexerServerListSubaccountsResponse, IndexerServerMakerStatisticsParams, IndexerServerMakerStatisticsResponse, IndexerServerMarketSnapshotsParams, IndexerServerMarketSnapshotsResponse, IndexerServerMatchEventsParams, IndexerServerMatchEventsResponse, IndexerServerMultiProductsParams, IndexerServerMultiProductsResponse, IndexerServerMultiSubaccountSnapshotsParams, IndexerServerMultiSubaccountSnapshotsResponse, IndexerServerNlpSnapshotsParams, IndexerServerNlpSnapshotsResponse, IndexerServerOraclePricesParams, IndexerServerOraclePricesResponse, IndexerServerOrdersParams, IndexerServerOrdersResponse, IndexerServerPerpPrices, IndexerServerPerpPricesParams, IndexerServerPerpPricesResponse, IndexerServerPriceParams, IndexerServerPriceResponse, IndexerServerProductsParams, IndexerServerProductsResponse, IndexerServerQueryRequestByType, IndexerServerQueryRequestType, IndexerServerQueryResponseByType, IndexerServerReferralCodeParams, IndexerServerReferralCodeResponse, IndexerServerUsdcPriceResponse };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nadohq/indexer-client",
3
- "version": "0.1.0-alpha.1",
3
+ "version": "0.1.0-alpha.3",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "> TODO: description",
@@ -37,9 +37,9 @@
37
37
  }
38
38
  },
39
39
  "dependencies": {
40
- "@nadohq/contracts": "^0.1.0-alpha.1",
41
- "@nadohq/engine-client": "^0.1.0-alpha.1",
42
- "@nadohq/utils": "^0.1.0-alpha.1",
40
+ "@nadohq/contracts": "^0.1.0-alpha.3",
41
+ "@nadohq/engine-client": "^0.1.0-alpha.3",
42
+ "@nadohq/utils": "^0.1.0-alpha.3",
43
43
  "axios": "*",
44
44
  "ts-mixer": "*"
45
45
  },
@@ -49,5 +49,5 @@
49
49
  "devDependencies": {
50
50
  "viem": "*"
51
51
  },
52
- "gitHead": "80100d38c43806d1bb57c9139d9577329467d5db"
52
+ "gitHead": "2bfcc344b596b7a33e9b8e4e3256a117de3fda04"
53
53
  }
@@ -37,7 +37,7 @@ import {
37
37
  mapIndexerPerpPrices,
38
38
  mapIndexerProductPayment,
39
39
  mapIndexerServerProduct,
40
- mapIndexerVlpSnapshot,
40
+ mapIndexerNlpSnapshot,
41
41
  mapSnapshotsIntervalToServerParams,
42
42
  } from './dataMappers';
43
43
  import {
@@ -91,8 +91,8 @@ import {
91
91
  GetIndexerQuotePriceResponse,
92
92
  GetIndexerReferralCodeParams,
93
93
  GetIndexerReferralCodeResponse,
94
- GetIndexerVlpSnapshotsParams,
95
- GetIndexerVlpSnapshotsResponse,
94
+ GetIndexerNlpSnapshotsParams,
95
+ GetIndexerNlpSnapshotsResponse,
96
96
  IndexerEventWithTx,
97
97
  IndexerMatchEvent,
98
98
  IndexerOraclePrice,
@@ -104,8 +104,10 @@ import {
104
104
  IndexerSubaccountSnapshot,
105
105
  ListIndexerSubaccountsParams,
106
106
  ListIndexerSubaccountsResponse,
107
+ GetIndexerSubaccountDDAParams,
107
108
  UpdateIndexerLeaderboardRegistrationParams,
108
109
  UpdateIndexerLeaderboardRegistrationResponse,
110
+ GetIndexerSubaccountDDAResponse,
109
111
  } from './types';
110
112
 
111
113
  export interface IndexerClientOpts {
@@ -769,10 +771,10 @@ export class IndexerBaseClient {
769
771
  };
770
772
  }
771
773
 
772
- async getVlpSnapshots(
773
- params: GetIndexerVlpSnapshotsParams,
774
- ): Promise<GetIndexerVlpSnapshotsResponse> {
775
- const baseResponse = await this.query('vlp_snapshots', {
774
+ async getNlpSnapshots(
775
+ params: GetIndexerNlpSnapshotsParams,
776
+ ): Promise<GetIndexerNlpSnapshotsResponse> {
777
+ const baseResponse = await this.query('nlp_snapshots', {
776
778
  interval: {
777
779
  count: params.limit,
778
780
  max_time: params.maxTimeInclusive
@@ -783,7 +785,26 @@ export class IndexerBaseClient {
783
785
  });
784
786
 
785
787
  return {
786
- snapshots: baseResponse.snapshots.map(mapIndexerVlpSnapshot),
788
+ snapshots: baseResponse.snapshots.map(mapIndexerNlpSnapshot),
789
+ };
790
+ }
791
+
792
+ /**
793
+ * Retrieves the subaccount's DDA (Direct Deposit Address)
794
+ * @param params
795
+ */
796
+ async getSubaccountDDA(
797
+ params: GetIndexerSubaccountDDAParams,
798
+ ): Promise<GetIndexerSubaccountDDAResponse> {
799
+ const baseResponse = await this.query('direct_deposit_address', {
800
+ subaccount: subaccountToHex({
801
+ subaccountOwner: params.subaccountOwner,
802
+ subaccountName: params.subaccountName,
803
+ }),
804
+ });
805
+
806
+ return {
807
+ address: baseResponse.v1_address,
787
808
  };
788
809
  }
789
810
 
@@ -2,7 +2,7 @@ import {
2
2
  ProductEngineType,
3
3
  QUOTE_PRODUCT_ID,
4
4
  subaccountFromHex,
5
- VLP_PRODUCT_ID,
5
+ NLP_PRODUCT_ID,
6
6
  } from '@nadohq/contracts';
7
7
  import { toBigDecimal, toIntegerString } from '@nadohq/utils';
8
8
 
@@ -24,15 +24,15 @@ import {
24
24
  GetIndexerSubaccountMatchEventsResponse,
25
25
  GetIndexerSubaccountSettlementEventsParams,
26
26
  GetIndexerSubaccountSettlementEventsResponse,
27
- GetIndexerSubaccountVlpEventsParams,
28
- GetIndexerSubaccountVlpEventsResponse,
27
+ GetIndexerSubaccountNlpEventsParams,
28
+ GetIndexerSubaccountNlpEventsResponse,
29
29
  IndexerCollateralEvent,
30
30
  IndexerEventPerpStateSnapshot,
31
31
  IndexerEventSpotStateSnapshot,
32
32
  IndexerEventWithTx,
33
33
  IndexerLiquidationEvent,
34
34
  IndexerSettlementEvent,
35
- IndexerVlpEvent,
35
+ IndexerNlpEvent,
36
36
  PaginatedIndexerEventsResponse,
37
37
  } from './types';
38
38
 
@@ -66,9 +66,9 @@ export class IndexerClient extends IndexerBaseClient {
66
66
  return this.getPaginationEventsResponse(events, requestedLimit);
67
67
  }
68
68
 
69
- async getPaginatedSubaccountVlpEvents(
70
- params: GetIndexerSubaccountVlpEventsParams,
71
- ): Promise<GetIndexerSubaccountVlpEventsResponse> {
69
+ async getPaginatedSubaccountNlpEvents(
70
+ params: GetIndexerSubaccountNlpEventsParams,
71
+ ): Promise<GetIndexerSubaccountNlpEventsResponse> {
72
72
  const {
73
73
  startCursor,
74
74
  maxTimestampInclusive,
@@ -77,12 +77,12 @@ export class IndexerClient extends IndexerBaseClient {
77
77
  subaccountOwner,
78
78
  } = params;
79
79
 
80
- // There are 2 events per mint/burn for spot - one associated with the VLP product & the other with the primary quote
80
+ // There are 2 events per mint/burn for spot - one associated with the NLP product & the other with the primary quote
81
81
  const limit = requestedLimit + 1;
82
82
  const baseResponse = await this.getEvents({
83
83
  startCursor,
84
84
  maxTimestampInclusive,
85
- eventTypes: ['mint_vlp', 'burn_vlp'],
85
+ eventTypes: ['mint_nlp', 'burn_nlp'],
86
86
  limit: {
87
87
  type: 'txs',
88
88
  value: limit,
@@ -91,7 +91,7 @@ export class IndexerClient extends IndexerBaseClient {
91
91
  });
92
92
 
93
93
  // Now aggregate results by the submission index, use map to maintain insertion order
94
- const eventsBySubmissionIdx = new Map<string, IndexerVlpEvent>();
94
+ const eventsBySubmissionIdx = new Map<string, IndexerNlpEvent>();
95
95
 
96
96
  baseResponse.forEach((event) => {
97
97
  const mappedEvent = (() => {
@@ -100,8 +100,8 @@ export class IndexerClient extends IndexerBaseClient {
100
100
  return existingEvent;
101
101
  }
102
102
 
103
- const newEvent: IndexerVlpEvent = {
104
- vlpDelta: toBigDecimal(0),
103
+ const newEvent: IndexerNlpEvent = {
104
+ nlpDelta: toBigDecimal(0),
105
105
  primaryQuoteDelta: toBigDecimal(0),
106
106
  timestamp: event.timestamp,
107
107
  submissionIndex: event.submissionIndex,
@@ -120,10 +120,10 @@ export class IndexerClient extends IndexerBaseClient {
120
120
  const productId = event.state.market.productId;
121
121
  if (productId === QUOTE_PRODUCT_ID) {
122
122
  mappedEvent.primaryQuoteDelta = balanceDelta;
123
- } else if (productId === VLP_PRODUCT_ID) {
124
- mappedEvent.vlpDelta = balanceDelta;
123
+ } else if (productId === NLP_PRODUCT_ID) {
124
+ mappedEvent.nlpDelta = balanceDelta;
125
125
  } else {
126
- throw Error(`Invalid product ID for VLP event ${productId}`);
126
+ throw Error(`Invalid product ID for NLP event ${productId}`);
127
127
  }
128
128
  });
129
129
 
@@ -48,10 +48,10 @@ import {
48
48
  IndexerServerProductPayment,
49
49
  IndexerServerSnapshotsInterval,
50
50
  IndexerServerTx,
51
- IndexerServerVlpSnapshot,
51
+ IndexerServerNlpSnapshot,
52
52
  IndexerSnapshotsIntervalParams,
53
53
  IndexerSpotBalance,
54
- IndexerVlpSnapshot,
54
+ IndexerNlpSnapshot,
55
55
  } from './types';
56
56
 
57
57
  export function mapSnapshotsIntervalToServerParams(
@@ -344,9 +344,9 @@ export function mapIndexerMarketSnapshot(
344
344
  };
345
345
  }
346
346
 
347
- export function mapIndexerVlpSnapshot(
348
- snapshot: IndexerServerVlpSnapshot,
349
- ): IndexerVlpSnapshot {
347
+ export function mapIndexerNlpSnapshot(
348
+ snapshot: IndexerServerNlpSnapshot,
349
+ ): IndexerNlpSnapshot {
350
350
  return {
351
351
  submissionIndex: snapshot.submission_idx,
352
352
  timestamp: toBigDecimal(snapshot.timestamp),
@@ -5,5 +5,5 @@ export type IndexerEventType =
5
5
  | 'settle_pnl'
6
6
  | 'match_orders'
7
7
  | 'transfer_quote'
8
- | 'mint_vlp'
9
- | 'burn_vlp';
8
+ | 'mint_nlp'
9
+ | 'burn_nlp';
@@ -60,4 +60,4 @@ export type NadoTx =
60
60
  | {
61
61
  // TODO: Populate all types
62
62
  [key: string]: never;
63
- };
63
+ };
@@ -640,15 +640,15 @@ export interface GetIndexerFastWithdrawalSignatureResponse {
640
640
  }
641
641
 
642
642
  /**
643
- * VLP
643
+ * NLP
644
644
  */
645
645
 
646
- export type GetIndexerVlpSnapshotsParams = IndexerSnapshotsIntervalParams;
646
+ export type GetIndexerNlpSnapshotsParams = IndexerSnapshotsIntervalParams;
647
647
 
648
- export interface IndexerVlpSnapshot {
648
+ export interface IndexerNlpSnapshot {
649
649
  submissionIndex: string;
650
650
  timestamp: BigDecimal;
651
- // Total volume traded by the VLP, in terms of the primary quote
651
+ // Total volume traded by the NLP, in terms of the primary quote
652
652
  cumulativeVolume: BigDecimal;
653
653
  cumulativeTrades: BigDecimal;
654
654
  cumulativeMintAmountUsdc: BigDecimal;
@@ -659,8 +659,8 @@ export interface IndexerVlpSnapshot {
659
659
  depositors: BigDecimal;
660
660
  }
661
661
 
662
- export interface GetIndexerVlpSnapshotsResponse {
663
- snapshots: IndexerVlpSnapshot[];
662
+ export interface GetIndexerNlpSnapshotsResponse {
663
+ snapshots: IndexerNlpSnapshot[];
664
664
  }
665
665
 
666
666
  export interface GetIndexerBacklogResponse {
@@ -677,3 +677,9 @@ export interface GetIndexerBacklogResponse {
677
677
  // Current submission rate in transactions per second (float) (null if unavailable)
678
678
  txsPerSecond: BigDecimal | null;
679
679
  }
680
+
681
+ export type GetIndexerSubaccountDDAParams = Subaccount;
682
+
683
+ export interface GetIndexerSubaccountDDAResponse {
684
+ address: string;
685
+ }
@@ -75,18 +75,18 @@ export type GetIndexerSubaccountCollateralEventsResponse =
75
75
  PaginatedIndexerEventsResponse<IndexerCollateralEvent>;
76
76
 
77
77
  /**
78
- * VLP
78
+ * NLP
79
79
  */
80
- export type GetIndexerSubaccountVlpEventsParams =
80
+ export type GetIndexerSubaccountNlpEventsParams =
81
81
  BaseSubaccountPaginationParams;
82
82
 
83
- export interface IndexerVlpEvent extends BaseIndexerPaginatedEvent {
84
- vlpDelta: BigDecimal;
83
+ export interface IndexerNlpEvent extends BaseIndexerPaginatedEvent {
84
+ nlpDelta: BigDecimal;
85
85
  primaryQuoteDelta: BigDecimal;
86
86
  }
87
87
 
88
- export type GetIndexerSubaccountVlpEventsResponse =
89
- PaginatedIndexerEventsResponse<IndexerVlpEvent>;
88
+ export type GetIndexerSubaccountNlpEventsResponse =
89
+ PaginatedIndexerEventsResponse<IndexerNlpEvent>;
90
90
 
91
91
  /**
92
92
  * Match events
@@ -254,10 +254,10 @@ export interface IndexerServerLeaderboardRegistration {
254
254
  }
255
255
 
256
256
  /**
257
- * VLP
257
+ * NLP
258
258
  */
259
259
 
260
- export interface IndexerServerVlpSnapshot {
260
+ export interface IndexerServerNlpSnapshot {
261
261
  cumulative_burn_usdc: string;
262
262
  cumulative_mint_usdc: string;
263
263
  cumulative_pnl: string;
@@ -21,7 +21,7 @@ import {
21
21
  IndexerServerProductSnapshot,
22
22
  IndexerServerSnapshotsInterval,
23
23
  IndexerServerTx,
24
- IndexerServerVlpSnapshot,
24
+ IndexerServerNlpSnapshot,
25
25
  } from './serverModelTypes';
26
26
 
27
27
  /**
@@ -193,15 +193,20 @@ export interface IndexerServerFastWithdrawalSignatureParams {
193
193
  idx: number | string;
194
194
  }
195
195
 
196
- export interface IndexerServerVlpSnapshotsParams {
196
+ export interface IndexerServerNlpSnapshotsParams {
197
197
  interval: IndexerServerSnapshotsInterval;
198
198
  }
199
199
 
200
+ export interface IndexerServerDDAQueryParams {
201
+ subaccount: string;
202
+ }
203
+
200
204
  // Request
201
205
  export interface IndexerServerQueryRequestByType {
202
206
  account_snapshots: IndexerServerMultiSubaccountSnapshotsParams;
203
207
  backlog: Record<string, never>;
204
208
  candlesticks: IndexerServerCandlesticksParams;
209
+ direct_deposit_address: IndexerServerDDAQueryParams;
205
210
  edge_candlesticks: IndexerEdgeServerCandlesticksParams;
206
211
  edge_market_snapshots: IndexerEdgeServerMarketSnapshotsParams;
207
212
  events: IndexerServerEventsParams;
@@ -226,7 +231,7 @@ export interface IndexerServerQueryRequestByType {
226
231
  referral_code: IndexerServerReferralCodeParams;
227
232
  subaccounts: IndexerServerListSubaccountsParams;
228
233
  usdc_price: Record<string, never>;
229
- vlp_snapshots: IndexerServerVlpSnapshotsParams;
234
+ nlp_snapshots: IndexerServerNlpSnapshotsParams;
230
235
  }
231
236
 
232
237
  export type IndexerServerQueryRequestType =
@@ -375,8 +380,12 @@ export interface IndexerServerFastWithdrawalSignatureResponse {
375
380
  signatures: string[];
376
381
  }
377
382
 
378
- export interface IndexerServerVlpSnapshotsResponse {
379
- snapshots: IndexerServerVlpSnapshot[];
383
+ export interface IndexerServerNlpSnapshotsResponse {
384
+ snapshots: IndexerServerNlpSnapshot[];
385
+ }
386
+
387
+ export interface IndexerServerDDAResponse {
388
+ v1_address: string;
380
389
  }
381
390
 
382
391
  export interface IndexerServerBacklogResponse {
@@ -399,6 +408,7 @@ export interface IndexerServerQueryResponseByType {
399
408
  account_snapshots: IndexerServerMultiSubaccountSnapshotsResponse;
400
409
  backlog: IndexerServerBacklogResponse;
401
410
  candlesticks: IndexerServerCandlesticksResponse;
411
+ direct_deposit_address: IndexerServerDDAResponse;
402
412
  edge_candlesticks: IndexerEdgeServerCandlesticksResponse;
403
413
  edge_market_snapshots: IndexerEdgeServerMarketSnapshotsResponse;
404
414
  events: IndexerServerEventsResponse;
@@ -423,5 +433,5 @@ export interface IndexerServerQueryResponseByType {
423
433
  referral_code: IndexerServerReferralCodeResponse;
424
434
  subaccounts: IndexerServerListSubaccountsResponse;
425
435
  usdc_price: IndexerServerUsdcPriceResponse;
426
- vlp_snapshots: IndexerServerVlpSnapshotsResponse;
436
+ nlp_snapshots: IndexerServerNlpSnapshotsResponse;
427
437
  }