@nadohq/indexer-client 0.6.0 → 0.8.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 (38) hide show
  1. package/dist/IndexerBaseClient.cjs +102 -27
  2. package/dist/IndexerBaseClient.cjs.map +1 -1
  3. package/dist/IndexerBaseClient.d.cts +29 -7
  4. package/dist/IndexerBaseClient.d.ts +29 -7
  5. package/dist/IndexerBaseClient.js +102 -27
  6. package/dist/IndexerBaseClient.js.map +1 -1
  7. package/dist/IndexerClient.cjs +6 -1
  8. package/dist/IndexerClient.cjs.map +1 -1
  9. package/dist/IndexerClient.js +6 -1
  10. package/dist/IndexerClient.js.map +1 -1
  11. package/dist/dataMappers.cjs +26 -12
  12. package/dist/dataMappers.cjs.map +1 -1
  13. package/dist/dataMappers.js +26 -12
  14. package/dist/dataMappers.js.map +1 -1
  15. package/dist/index.d.cts +3 -3
  16. package/dist/index.d.ts +3 -3
  17. package/dist/types/IndexerLeaderboardType.cjs.map +1 -1
  18. package/dist/types/IndexerLeaderboardType.d.cts +9 -1
  19. package/dist/types/IndexerLeaderboardType.d.ts +9 -1
  20. package/dist/types/clientTypes.cjs.map +1 -1
  21. package/dist/types/clientTypes.d.cts +64 -18
  22. package/dist/types/clientTypes.d.ts +64 -18
  23. package/dist/types/index.d.cts +3 -3
  24. package/dist/types/index.d.ts +3 -3
  25. package/dist/types/serverModelTypes.cjs.map +1 -1
  26. package/dist/types/serverModelTypes.d.cts +25 -10
  27. package/dist/types/serverModelTypes.d.ts +25 -10
  28. package/dist/types/serverTypes.cjs.map +1 -1
  29. package/dist/types/serverTypes.d.cts +38 -11
  30. package/dist/types/serverTypes.d.ts +38 -11
  31. package/package.json +4 -4
  32. package/src/IndexerBaseClient.ts +132 -36
  33. package/src/IndexerClient.ts +13 -5
  34. package/src/dataMappers.ts +26 -10
  35. package/src/types/IndexerLeaderboardType.ts +14 -2
  36. package/src/types/clientTypes.ts +78 -30
  37. package/src/types/serverModelTypes.ts +29 -9
  38. package/src/types/serverTypes.ts +46 -10
@@ -1,6 +1,7 @@
1
1
  import { EngineServerSpotBalance, EngineServerPerpBalance, EngineServerSpotProduct, EngineServerPerpProduct } from '@nadohq/engine-client';
2
2
  import { EIP712OrderValues } from '@nadohq/shared';
3
3
  import { IndexerEventType } from './IndexerEventType.js';
4
+ import { IndexerLeaderboardRankType } from './IndexerLeaderboardType.js';
4
5
  import { NadoTx } from './NadoTx.js';
5
6
 
6
7
  interface IndexerServerSnapshotsInterval {
@@ -198,28 +199,42 @@ interface IndexerServerMaker {
198
199
  /**
199
200
  * Leaderboard
200
201
  */
202
+ interface IndexerServerSocialAccount {
203
+ provider: 'twitter';
204
+ username: string;
205
+ display_name: string;
206
+ profile_image_url: string;
207
+ }
208
+ interface IndexerServerLeaderboardTrackPosition {
209
+ value: string;
210
+ rank: string;
211
+ qualification_status: 'qualified' | 'insufficient_account_value';
212
+ }
213
+ interface IndexerServerLeaderboardContestTrack {
214
+ track_id: number;
215
+ rank_type: IndexerLeaderboardRankType;
216
+ sort_order: 'ASC' | 'DESC';
217
+ threshold: string;
218
+ }
201
219
  interface IndexerServerLeaderboardPosition {
202
220
  subaccount: string;
203
221
  contest_id: number;
204
- pnl: string;
205
- pnl_rank: string;
206
- roi: string;
207
- roi_rank: string;
208
222
  account_value: string;
209
- volume?: string;
210
223
  update_time: string;
224
+ tracks: Partial<Record<IndexerLeaderboardRankType, IndexerServerLeaderboardTrackPosition>>;
225
+ social_accounts: IndexerServerSocialAccount[];
211
226
  }
212
227
  interface IndexerServerLeaderboardContest {
213
228
  contest_id: number;
214
229
  start_time: string;
215
230
  end_time: string;
216
- timeframe: string;
217
231
  count: string;
218
- threshold: string;
219
- volume_threshold: string;
220
- product_ids: number[];
221
232
  last_updated: string;
233
+ product_ids: number[];
222
234
  active: boolean;
235
+ title: string;
236
+ description: string;
237
+ tracks: IndexerServerLeaderboardContestTrack[];
223
238
  }
224
239
  interface IndexerServerLeaderboardRegistration {
225
240
  subaccount: string;
@@ -242,4 +257,4 @@ interface IndexerServerNlpSnapshot {
242
257
  tvl: string;
243
258
  }
244
259
 
245
- export type { IndexerServerBalance, IndexerServerCandlestick, IndexerServerEvent, IndexerServerLeaderboardContest, IndexerServerLeaderboardPosition, IndexerServerLeaderboardRegistration, IndexerServerMaker, IndexerServerMakerData, IndexerServerMarketSnapshot, IndexerServerMarketSnapshotInterval, IndexerServerMatchEvent, IndexerServerMatchEventBalances, IndexerServerNlpSnapshot, IndexerServerOraclePrice, IndexerServerOrder, IndexerServerProduct, IndexerServerProductPayment, IndexerServerProductSnapshot, IndexerServerSnapshotsInterval, IndexerServerTx };
260
+ export type { IndexerServerBalance, IndexerServerCandlestick, IndexerServerEvent, IndexerServerLeaderboardContest, IndexerServerLeaderboardContestTrack, IndexerServerLeaderboardPosition, IndexerServerLeaderboardRegistration, IndexerServerLeaderboardTrackPosition, IndexerServerMaker, IndexerServerMakerData, IndexerServerMarketSnapshot, IndexerServerMarketSnapshotInterval, IndexerServerMatchEvent, IndexerServerMatchEventBalances, IndexerServerNlpSnapshot, IndexerServerOraclePrice, IndexerServerOrder, IndexerServerProduct, IndexerServerProductPayment, IndexerServerProductSnapshot, IndexerServerSnapshotsInterval, IndexerServerSocialAccount, IndexerServerTx };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/serverTypes.ts"],"sourcesContent":["import {\n EIP712LeaderboardAuthenticationValues,\n SignedTx,\n} from '@nadohq/shared';\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 IndexerServerNlpSnapshot,\n IndexerServerOraclePrice,\n IndexerServerOrder,\n IndexerServerProductPayment,\n IndexerServerProductSnapshot,\n IndexerServerSnapshotsInterval,\n IndexerServerTx,\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 subaccounts?: 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 type IndexerServerTriggerTypeFilter =\n | 'none'\n | 'price_trigger'\n | 'time_trigger';\n\nexport interface IndexerServerOrdersParams {\n subaccounts?: string[];\n product_ids?: number[];\n trigger_types?: IndexerServerTriggerTypeFilter[];\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 subaccounts?: 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\nexport interface IndexerServerPrivateAlphaChoiceParams {\n address: string;\n}\n\nexport interface IndexerServerPointsParams {\n address: 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 quote_price: Record<string, never>;\n nlp_snapshots: IndexerServerNlpSnapshotsParams;\n private_alpha_choice: IndexerServerPrivateAlphaChoiceParams;\n nado_points: IndexerServerPointsParams;\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 // UNIX timestamp in seconds\n created_at: string;\n isolated: boolean;\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 IndexerServerQuotePriceResponse {\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\nexport interface IndexerServerPrivateAlphaChoiceResponse {\n points: string;\n fee_refund: string;\n nft_eligibility: boolean;\n}\n\nexport interface IndexerServerPointsEpoch {\n epoch: number;\n description: string;\n start_time: string;\n end_time: string;\n total_points: string;\n points: string;\n rank: number;\n tier: number;\n}\n\nexport interface IndexerServerAllTimePoints {\n points: string;\n rank: number;\n tier: number;\n}\n\nexport interface IndexerServerPointsResponse {\n points_per_epoch: IndexerServerPointsEpoch[];\n all_time_points: IndexerServerAllTimePoints;\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 quote_price: IndexerServerQuotePriceResponse;\n nlp_snapshots: IndexerServerNlpSnapshotsResponse;\n private_alpha_choice: IndexerServerPrivateAlphaChoiceResponse;\n nado_points: IndexerServerPointsResponse;\n}\n\n/**\n * V2 API Types\n */\n\n/**\n * Individual ticker data from v2 indexer endpoint (server format)\n */\nexport interface IndexerServerV2TickerResponse {\n product_id: number;\n ticker_id: string;\n base_currency: string;\n quote_currency: string;\n last_price: number;\n base_volume: number;\n quote_volume: number;\n price_change_percent_24h: number;\n}\n\n/**\n * Response from v2 tickers endpoint (server format)\n * Maps ticker IDs to their respective ticker data\n */\nexport type IndexerServerV2TickersResponse = Record<\n string,\n IndexerServerV2TickerResponse\n>;\n\n/**\n * Market hours data from v2 symbols endpoint (server format)\n */\nexport interface IndexerServerV2MarketHours {\n is_open: boolean;\n reason: string | null;\n next_close: string | null;\n next_open: string | null;\n}\n\n/**\n * Individual symbol data from v2 indexer endpoint (server format)\n */\nexport interface IndexerServerV2Symbol {\n type: string;\n product_id: number;\n symbol: string;\n price_increment_x18: string;\n size_increment: string;\n min_size: string;\n maker_fee_rate_x18: string;\n taker_fee_rate_x18: string;\n long_weight_initial_x18: string;\n long_weight_maintenance_x18: string;\n max_open_interest_x18: string | null;\n trading_status: string;\n isolated_only: boolean;\n market_hours: IndexerServerV2MarketHours | null;\n}\n\n/**\n * Response from v2 symbols endpoint (server format)\n * Maps symbols to their respective data\n */\nexport type IndexerServerV2SymbolsResponse = Record<\n string,\n IndexerServerV2Symbol\n>;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/types/serverTypes.ts"],"sourcesContent":["import {\n EIP712LeaderboardAuthenticationValues,\n EIP712SocialAuthenticationValues,\n SignedTx,\n} from '@nadohq/shared';\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 IndexerServerNlpSnapshot,\n IndexerServerOraclePrice,\n IndexerServerOrder,\n IndexerServerProductPayment,\n IndexerServerProductSnapshot,\n IndexerServerSnapshotsInterval,\n IndexerServerSocialAccount,\n IndexerServerTx,\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 subaccounts?: 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 type IndexerServerTriggerTypeFilter =\n | 'none'\n | 'price_trigger'\n | 'time_trigger';\n\nexport interface IndexerServerOrdersParams {\n subaccounts?: string[];\n product_ids?: number[];\n trigger_types?: IndexerServerTriggerTypeFilter[];\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 subaccounts?: 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 order?: 'ASC' | 'DESC';\n}\n\nexport interface IndexerServerLeaderboardRankParams {\n subaccount: string;\n contest_ids: number[];\n}\n\nexport interface IndexerServerLeaderboardContestsParams {\n contest_ids: number[];\n active?: boolean;\n}\n\nexport interface IndexerServerLeaderboardRegistrationsParams {\n subaccount: string;\n contest_ids: number[];\n active?: boolean;\n}\n\nexport interface IndexerServerLeaderboardRegisterParams {\n update_registration: SignedTx<EIP712LeaderboardAuthenticationValues>;\n}\n\nexport interface IndexerServerSocialConnectParams {\n update_social_account: SignedTx<EIP712SocialAuthenticationValues>;\n}\n\nexport interface IndexerServerListSocialAccountsParams {\n address: string;\n}\n\nexport type IndexerServerRevokeSocialAccountParams =\n IndexerServerSocialConnectParams;\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\nexport interface IndexerServerPrivateAlphaChoiceParams {\n address: string;\n}\n\nexport interface IndexerServerPointsParams {\n address: 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_register: IndexerServerLeaderboardRegisterParams;\n leaderboard_registrations: IndexerServerLeaderboardRegistrationsParams;\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 quote_price: Record<string, never>;\n nlp_snapshots: IndexerServerNlpSnapshotsParams;\n private_alpha_choice: IndexerServerPrivateAlphaChoiceParams;\n nado_points: IndexerServerPointsParams;\n social_connect: IndexerServerSocialConnectParams;\n list_social_accounts: IndexerServerListSocialAccountsParams;\n revoke_social_account: IndexerServerRevokeSocialAccountParams;\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 // UNIX timestamp in seconds\n created_at: string;\n isolated: boolean;\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 IndexerServerQuotePriceResponse {\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 IndexerServerLeaderboardRegistrationsResponse {\n registrations: IndexerServerLeaderboardRegistration[];\n}\n\nexport type IndexerServerLeaderboardRegisterResponse =\n IndexerServerLeaderboardRegistrationsResponse;\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\nexport interface IndexerServerPrivateAlphaChoiceResponse {\n points: string;\n fee_refund: string;\n nft_eligibility: boolean;\n}\n\nexport interface IndexerServerPointsEpoch {\n epoch: number;\n description: string;\n start_time: string;\n end_time: string;\n total_points: string;\n points: string;\n rank: number;\n tier: number;\n}\n\nexport interface IndexerServerAllTimePoints {\n points: string;\n rank: number;\n tier: number;\n}\n\nexport interface IndexerServerPointsResponse {\n points_per_epoch: IndexerServerPointsEpoch[];\n all_time_points: IndexerServerAllTimePoints;\n}\n\nexport interface IndexerServerSocialConnectResponse {\n url: string;\n}\n\nexport interface IndexerServerSocialAccountsResponse {\n accounts: IndexerServerSocialAccount[];\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_register: IndexerServerLeaderboardRegisterResponse;\n leaderboard_registrations: IndexerServerLeaderboardRegistrationsResponse;\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 quote_price: IndexerServerQuotePriceResponse;\n nlp_snapshots: IndexerServerNlpSnapshotsResponse;\n private_alpha_choice: IndexerServerPrivateAlphaChoiceResponse;\n nado_points: IndexerServerPointsResponse;\n social_connect: IndexerServerSocialConnectResponse;\n list_social_accounts: IndexerServerSocialAccountsResponse;\n revoke_social_account: IndexerServerSocialAccountsResponse;\n}\n\n/**\n * V2 API Types\n */\n\n/**\n * Individual ticker data from v2 indexer endpoint (server format)\n */\nexport interface IndexerServerV2TickerResponse {\n product_id: number;\n ticker_id: string;\n base_currency: string;\n quote_currency: string;\n last_price: number;\n base_volume: number;\n quote_volume: number;\n price_change_percent_24h: number;\n}\n\n/**\n * Response from v2 tickers endpoint (server format)\n * Maps ticker IDs to their respective ticker data\n */\nexport type IndexerServerV2TickersResponse = Record<\n string,\n IndexerServerV2TickerResponse\n>;\n\n/**\n * Market hours data from v2 symbols endpoint (server format)\n */\nexport interface IndexerServerV2MarketHours {\n is_open: boolean;\n reason: string | null;\n next_close: string | null;\n next_open: string | null;\n}\n\n/**\n * Individual symbol data from v2 indexer endpoint (server format)\n */\nexport interface IndexerServerV2Symbol {\n type: string;\n product_id: number;\n symbol: string;\n price_increment_x18: string;\n size_increment: string;\n min_size: string;\n maker_fee_rate_x18: string;\n taker_fee_rate_x18: string;\n long_weight_initial_x18: string;\n long_weight_maintenance_x18: string;\n max_open_interest_x18: string | null;\n trading_status: string;\n isolated_only: boolean;\n market_hours: IndexerServerV2MarketHours | null;\n}\n\n/**\n * Response from v2 symbols endpoint (server format)\n * Maps symbols to their respective data\n */\nexport type IndexerServerV2SymbolsResponse = Record<\n string,\n IndexerServerV2Symbol\n>;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,8 +1,8 @@
1
- import { SignedTx, EIP712LeaderboardAuthenticationValues } from '@nadohq/shared';
1
+ import { SignedTx, EIP712LeaderboardAuthenticationValues, EIP712SocialAuthenticationValues } from '@nadohq/shared';
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, IndexerServerNlpSnapshot } from './serverModelTypes.cjs';
5
+ import { IndexerServerMarketSnapshotInterval, IndexerServerSnapshotsInterval, IndexerServerEvent, IndexerServerCandlestick, IndexerServerMarketSnapshot, IndexerServerTx, IndexerServerProductPayment, IndexerServerLeaderboardPosition, IndexerServerLeaderboardContest, IndexerServerLeaderboardRegistration, IndexerServerMaker, IndexerServerMatchEvent, IndexerServerOraclePrice, IndexerServerOrder, IndexerServerProductSnapshot, IndexerServerNlpSnapshot, IndexerServerSocialAccount } from './serverModelTypes.cjs';
6
6
  import '@nadohq/engine-client';
7
7
 
8
8
  /**
@@ -110,9 +110,10 @@ interface IndexerServerMakerStatisticsParams {
110
110
  }
111
111
  interface IndexerServerLeaderboardParams {
112
112
  contest_id: number;
113
- rank_type: IndexerLeaderboardRankType;
113
+ rank_type?: IndexerLeaderboardRankType;
114
114
  start?: number | string;
115
115
  limit?: number | string;
116
+ order?: 'ASC' | 'DESC';
116
117
  }
117
118
  interface IndexerServerLeaderboardRankParams {
118
119
  subaccount: string;
@@ -120,12 +121,23 @@ interface IndexerServerLeaderboardRankParams {
120
121
  }
121
122
  interface IndexerServerLeaderboardContestsParams {
122
123
  contest_ids: number[];
124
+ active?: boolean;
123
125
  }
124
- interface IndexerServerLeaderboardRegistrationParams {
126
+ interface IndexerServerLeaderboardRegistrationsParams {
125
127
  subaccount: string;
126
- contest_id: number;
127
- update_registration: SignedTx<EIP712LeaderboardAuthenticationValues> | null;
128
+ contest_ids: number[];
129
+ active?: boolean;
130
+ }
131
+ interface IndexerServerLeaderboardRegisterParams {
132
+ update_registration: SignedTx<EIP712LeaderboardAuthenticationValues>;
133
+ }
134
+ interface IndexerServerSocialConnectParams {
135
+ update_social_account: SignedTx<EIP712SocialAuthenticationValues>;
128
136
  }
137
+ interface IndexerServerListSocialAccountsParams {
138
+ address: string;
139
+ }
140
+ type IndexerServerRevokeSocialAccountParams = IndexerServerSocialConnectParams;
129
141
  interface IndexerServerFastWithdrawalSignatureParams {
130
142
  /**
131
143
  * The submission index of the WithdrawCollateral tx to be used for fast withdraw.
@@ -159,7 +171,8 @@ interface IndexerServerQueryRequestByType {
159
171
  leaderboard: IndexerServerLeaderboardParams;
160
172
  leaderboard_contests: IndexerServerLeaderboardContestsParams;
161
173
  leaderboard_rank: IndexerServerLeaderboardRankParams;
162
- leaderboard_registration: IndexerServerLeaderboardRegistrationParams;
174
+ leaderboard_register: IndexerServerLeaderboardRegisterParams;
175
+ leaderboard_registrations: IndexerServerLeaderboardRegistrationsParams;
163
176
  linked_signer_rate_limit: IndexerServerLinkedSignerParams;
164
177
  maker_statistics: IndexerServerMakerStatisticsParams;
165
178
  market_snapshots: IndexerServerMarketSnapshotsParams;
@@ -176,6 +189,9 @@ interface IndexerServerQueryRequestByType {
176
189
  nlp_snapshots: IndexerServerNlpSnapshotsParams;
177
190
  private_alpha_choice: IndexerServerPrivateAlphaChoiceParams;
178
191
  nado_points: IndexerServerPointsParams;
192
+ social_connect: IndexerServerSocialConnectParams;
193
+ list_social_accounts: IndexerServerListSocialAccountsParams;
194
+ revoke_social_account: IndexerServerRevokeSocialAccountParams;
179
195
  }
180
196
  type IndexerServerQueryRequestType = keyof IndexerServerQueryRequestByType;
181
197
  /**
@@ -260,9 +276,10 @@ interface IndexerServerMakerStatisticsResponse {
260
276
  interface IndexerServerLeaderboardResponse {
261
277
  positions: IndexerServerLeaderboardPosition[];
262
278
  }
263
- interface IndexerServerLeaderboardRegistrationResponse {
264
- registration: IndexerServerLeaderboardRegistration | null;
279
+ interface IndexerServerLeaderboardRegistrationsResponse {
280
+ registrations: IndexerServerLeaderboardRegistration[];
265
281
  }
282
+ type IndexerServerLeaderboardRegisterResponse = IndexerServerLeaderboardRegistrationsResponse;
266
283
  interface IndexerServerLeaderboardRankResponse {
267
284
  positions: Record<string, IndexerServerLeaderboardPosition>;
268
285
  }
@@ -313,6 +330,12 @@ interface IndexerServerPointsResponse {
313
330
  points_per_epoch: IndexerServerPointsEpoch[];
314
331
  all_time_points: IndexerServerAllTimePoints;
315
332
  }
333
+ interface IndexerServerSocialConnectResponse {
334
+ url: string;
335
+ }
336
+ interface IndexerServerSocialAccountsResponse {
337
+ accounts: IndexerServerSocialAccount[];
338
+ }
316
339
  interface IndexerServerQueryResponseByType {
317
340
  account_snapshots: IndexerServerMultiSubaccountSnapshotsResponse;
318
341
  backlog: IndexerServerBacklogResponse;
@@ -328,7 +351,8 @@ interface IndexerServerQueryResponseByType {
328
351
  leaderboard: IndexerServerLeaderboardResponse;
329
352
  leaderboard_contests: IndexerServerLeaderboardContestsResponse;
330
353
  leaderboard_rank: IndexerServerLeaderboardRankResponse;
331
- leaderboard_registration: IndexerServerLeaderboardRegistrationResponse;
354
+ leaderboard_register: IndexerServerLeaderboardRegisterResponse;
355
+ leaderboard_registrations: IndexerServerLeaderboardRegistrationsResponse;
332
356
  linked_signer_rate_limit: IndexerServerLinkedSignerResponse;
333
357
  maker_statistics: IndexerServerMakerStatisticsResponse;
334
358
  market_snapshots: IndexerServerMarketSnapshotsResponse;
@@ -345,6 +369,9 @@ interface IndexerServerQueryResponseByType {
345
369
  nlp_snapshots: IndexerServerNlpSnapshotsResponse;
346
370
  private_alpha_choice: IndexerServerPrivateAlphaChoiceResponse;
347
371
  nado_points: IndexerServerPointsResponse;
372
+ social_connect: IndexerServerSocialConnectResponse;
373
+ list_social_accounts: IndexerServerSocialAccountsResponse;
374
+ revoke_social_account: IndexerServerSocialAccountsResponse;
348
375
  }
349
376
  /**
350
377
  * V2 API Types
@@ -401,4 +428,4 @@ interface IndexerServerV2Symbol {
401
428
  */
402
429
  type IndexerServerV2SymbolsResponse = Record<string, IndexerServerV2Symbol>;
403
430
 
404
- export type { IndexerEdgeServerCandlesticksParams, IndexerEdgeServerCandlesticksResponse, IndexerEdgeServerMarketSnapshotsParams, IndexerEdgeServerMarketSnapshotsResponse, IndexerServerAllTimePoints, 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, IndexerServerPointsEpoch, IndexerServerPointsParams, IndexerServerPointsResponse, IndexerServerPriceParams, IndexerServerPriceResponse, IndexerServerPrivateAlphaChoiceParams, IndexerServerPrivateAlphaChoiceResponse, IndexerServerProductsParams, IndexerServerProductsResponse, IndexerServerQueryRequestByType, IndexerServerQueryRequestType, IndexerServerQueryResponseByType, IndexerServerQuotePriceResponse, IndexerServerReferralCodeParams, IndexerServerReferralCodeResponse, IndexerServerTriggerTypeFilter, IndexerServerV2MarketHours, IndexerServerV2Symbol, IndexerServerV2SymbolsResponse, IndexerServerV2TickerResponse, IndexerServerV2TickersResponse };
431
+ export type { IndexerEdgeServerCandlesticksParams, IndexerEdgeServerCandlesticksResponse, IndexerEdgeServerMarketSnapshotsParams, IndexerEdgeServerMarketSnapshotsResponse, IndexerServerAllTimePoints, IndexerServerBacklogResponse, IndexerServerCandlesticksParams, IndexerServerCandlesticksResponse, IndexerServerDDAQueryParams, IndexerServerDDAResponse, IndexerServerEventsParams, IndexerServerEventsResponse, IndexerServerFastWithdrawalSignatureParams, IndexerServerFastWithdrawalSignatureResponse, IndexerServerFundingRate, IndexerServerFundingRateParams, IndexerServerFundingRateResponse, IndexerServerFundingRatesParams, IndexerServerFundingRatesResponse, IndexerServerInterestFundingParams, IndexerServerInterestFundingResponse, IndexerServerLeaderboardContestsParams, IndexerServerLeaderboardContestsResponse, IndexerServerLeaderboardParams, IndexerServerLeaderboardRankParams, IndexerServerLeaderboardRankResponse, IndexerServerLeaderboardRegisterParams, IndexerServerLeaderboardRegisterResponse, IndexerServerLeaderboardRegistrationsParams, IndexerServerLeaderboardRegistrationsResponse, IndexerServerLeaderboardResponse, IndexerServerLinkedSignerParams, IndexerServerLinkedSignerResponse, IndexerServerListSocialAccountsParams, IndexerServerListSubaccountsParams, IndexerServerListSubaccountsResponse, IndexerServerMakerStatisticsParams, IndexerServerMakerStatisticsResponse, IndexerServerMarketSnapshotsParams, IndexerServerMarketSnapshotsResponse, IndexerServerMatchEventsParams, IndexerServerMatchEventsResponse, IndexerServerMultiProductsParams, IndexerServerMultiProductsResponse, IndexerServerMultiSubaccountSnapshotsParams, IndexerServerMultiSubaccountSnapshotsResponse, IndexerServerNlpSnapshotsParams, IndexerServerNlpSnapshotsResponse, IndexerServerOraclePricesParams, IndexerServerOraclePricesResponse, IndexerServerOrdersParams, IndexerServerOrdersResponse, IndexerServerPerpPrices, IndexerServerPerpPricesParams, IndexerServerPerpPricesResponse, IndexerServerPointsEpoch, IndexerServerPointsParams, IndexerServerPointsResponse, IndexerServerPriceParams, IndexerServerPriceResponse, IndexerServerPrivateAlphaChoiceParams, IndexerServerPrivateAlphaChoiceResponse, IndexerServerProductsParams, IndexerServerProductsResponse, IndexerServerQueryRequestByType, IndexerServerQueryRequestType, IndexerServerQueryResponseByType, IndexerServerQuotePriceResponse, IndexerServerReferralCodeParams, IndexerServerReferralCodeResponse, IndexerServerRevokeSocialAccountParams, IndexerServerSocialAccountsResponse, IndexerServerSocialConnectParams, IndexerServerSocialConnectResponse, IndexerServerTriggerTypeFilter, IndexerServerV2MarketHours, IndexerServerV2Symbol, IndexerServerV2SymbolsResponse, IndexerServerV2TickerResponse, IndexerServerV2TickersResponse };
@@ -1,8 +1,8 @@
1
- import { SignedTx, EIP712LeaderboardAuthenticationValues } from '@nadohq/shared';
1
+ import { SignedTx, EIP712LeaderboardAuthenticationValues, EIP712SocialAuthenticationValues } from '@nadohq/shared';
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, IndexerServerNlpSnapshot } from './serverModelTypes.js';
5
+ import { IndexerServerMarketSnapshotInterval, IndexerServerSnapshotsInterval, IndexerServerEvent, IndexerServerCandlestick, IndexerServerMarketSnapshot, IndexerServerTx, IndexerServerProductPayment, IndexerServerLeaderboardPosition, IndexerServerLeaderboardContest, IndexerServerLeaderboardRegistration, IndexerServerMaker, IndexerServerMatchEvent, IndexerServerOraclePrice, IndexerServerOrder, IndexerServerProductSnapshot, IndexerServerNlpSnapshot, IndexerServerSocialAccount } from './serverModelTypes.js';
6
6
  import '@nadohq/engine-client';
7
7
 
8
8
  /**
@@ -110,9 +110,10 @@ interface IndexerServerMakerStatisticsParams {
110
110
  }
111
111
  interface IndexerServerLeaderboardParams {
112
112
  contest_id: number;
113
- rank_type: IndexerLeaderboardRankType;
113
+ rank_type?: IndexerLeaderboardRankType;
114
114
  start?: number | string;
115
115
  limit?: number | string;
116
+ order?: 'ASC' | 'DESC';
116
117
  }
117
118
  interface IndexerServerLeaderboardRankParams {
118
119
  subaccount: string;
@@ -120,12 +121,23 @@ interface IndexerServerLeaderboardRankParams {
120
121
  }
121
122
  interface IndexerServerLeaderboardContestsParams {
122
123
  contest_ids: number[];
124
+ active?: boolean;
123
125
  }
124
- interface IndexerServerLeaderboardRegistrationParams {
126
+ interface IndexerServerLeaderboardRegistrationsParams {
125
127
  subaccount: string;
126
- contest_id: number;
127
- update_registration: SignedTx<EIP712LeaderboardAuthenticationValues> | null;
128
+ contest_ids: number[];
129
+ active?: boolean;
130
+ }
131
+ interface IndexerServerLeaderboardRegisterParams {
132
+ update_registration: SignedTx<EIP712LeaderboardAuthenticationValues>;
133
+ }
134
+ interface IndexerServerSocialConnectParams {
135
+ update_social_account: SignedTx<EIP712SocialAuthenticationValues>;
128
136
  }
137
+ interface IndexerServerListSocialAccountsParams {
138
+ address: string;
139
+ }
140
+ type IndexerServerRevokeSocialAccountParams = IndexerServerSocialConnectParams;
129
141
  interface IndexerServerFastWithdrawalSignatureParams {
130
142
  /**
131
143
  * The submission index of the WithdrawCollateral tx to be used for fast withdraw.
@@ -159,7 +171,8 @@ interface IndexerServerQueryRequestByType {
159
171
  leaderboard: IndexerServerLeaderboardParams;
160
172
  leaderboard_contests: IndexerServerLeaderboardContestsParams;
161
173
  leaderboard_rank: IndexerServerLeaderboardRankParams;
162
- leaderboard_registration: IndexerServerLeaderboardRegistrationParams;
174
+ leaderboard_register: IndexerServerLeaderboardRegisterParams;
175
+ leaderboard_registrations: IndexerServerLeaderboardRegistrationsParams;
163
176
  linked_signer_rate_limit: IndexerServerLinkedSignerParams;
164
177
  maker_statistics: IndexerServerMakerStatisticsParams;
165
178
  market_snapshots: IndexerServerMarketSnapshotsParams;
@@ -176,6 +189,9 @@ interface IndexerServerQueryRequestByType {
176
189
  nlp_snapshots: IndexerServerNlpSnapshotsParams;
177
190
  private_alpha_choice: IndexerServerPrivateAlphaChoiceParams;
178
191
  nado_points: IndexerServerPointsParams;
192
+ social_connect: IndexerServerSocialConnectParams;
193
+ list_social_accounts: IndexerServerListSocialAccountsParams;
194
+ revoke_social_account: IndexerServerRevokeSocialAccountParams;
179
195
  }
180
196
  type IndexerServerQueryRequestType = keyof IndexerServerQueryRequestByType;
181
197
  /**
@@ -260,9 +276,10 @@ interface IndexerServerMakerStatisticsResponse {
260
276
  interface IndexerServerLeaderboardResponse {
261
277
  positions: IndexerServerLeaderboardPosition[];
262
278
  }
263
- interface IndexerServerLeaderboardRegistrationResponse {
264
- registration: IndexerServerLeaderboardRegistration | null;
279
+ interface IndexerServerLeaderboardRegistrationsResponse {
280
+ registrations: IndexerServerLeaderboardRegistration[];
265
281
  }
282
+ type IndexerServerLeaderboardRegisterResponse = IndexerServerLeaderboardRegistrationsResponse;
266
283
  interface IndexerServerLeaderboardRankResponse {
267
284
  positions: Record<string, IndexerServerLeaderboardPosition>;
268
285
  }
@@ -313,6 +330,12 @@ interface IndexerServerPointsResponse {
313
330
  points_per_epoch: IndexerServerPointsEpoch[];
314
331
  all_time_points: IndexerServerAllTimePoints;
315
332
  }
333
+ interface IndexerServerSocialConnectResponse {
334
+ url: string;
335
+ }
336
+ interface IndexerServerSocialAccountsResponse {
337
+ accounts: IndexerServerSocialAccount[];
338
+ }
316
339
  interface IndexerServerQueryResponseByType {
317
340
  account_snapshots: IndexerServerMultiSubaccountSnapshotsResponse;
318
341
  backlog: IndexerServerBacklogResponse;
@@ -328,7 +351,8 @@ interface IndexerServerQueryResponseByType {
328
351
  leaderboard: IndexerServerLeaderboardResponse;
329
352
  leaderboard_contests: IndexerServerLeaderboardContestsResponse;
330
353
  leaderboard_rank: IndexerServerLeaderboardRankResponse;
331
- leaderboard_registration: IndexerServerLeaderboardRegistrationResponse;
354
+ leaderboard_register: IndexerServerLeaderboardRegisterResponse;
355
+ leaderboard_registrations: IndexerServerLeaderboardRegistrationsResponse;
332
356
  linked_signer_rate_limit: IndexerServerLinkedSignerResponse;
333
357
  maker_statistics: IndexerServerMakerStatisticsResponse;
334
358
  market_snapshots: IndexerServerMarketSnapshotsResponse;
@@ -345,6 +369,9 @@ interface IndexerServerQueryResponseByType {
345
369
  nlp_snapshots: IndexerServerNlpSnapshotsResponse;
346
370
  private_alpha_choice: IndexerServerPrivateAlphaChoiceResponse;
347
371
  nado_points: IndexerServerPointsResponse;
372
+ social_connect: IndexerServerSocialConnectResponse;
373
+ list_social_accounts: IndexerServerSocialAccountsResponse;
374
+ revoke_social_account: IndexerServerSocialAccountsResponse;
348
375
  }
349
376
  /**
350
377
  * V2 API Types
@@ -401,4 +428,4 @@ interface IndexerServerV2Symbol {
401
428
  */
402
429
  type IndexerServerV2SymbolsResponse = Record<string, IndexerServerV2Symbol>;
403
430
 
404
- export type { IndexerEdgeServerCandlesticksParams, IndexerEdgeServerCandlesticksResponse, IndexerEdgeServerMarketSnapshotsParams, IndexerEdgeServerMarketSnapshotsResponse, IndexerServerAllTimePoints, 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, IndexerServerPointsEpoch, IndexerServerPointsParams, IndexerServerPointsResponse, IndexerServerPriceParams, IndexerServerPriceResponse, IndexerServerPrivateAlphaChoiceParams, IndexerServerPrivateAlphaChoiceResponse, IndexerServerProductsParams, IndexerServerProductsResponse, IndexerServerQueryRequestByType, IndexerServerQueryRequestType, IndexerServerQueryResponseByType, IndexerServerQuotePriceResponse, IndexerServerReferralCodeParams, IndexerServerReferralCodeResponse, IndexerServerTriggerTypeFilter, IndexerServerV2MarketHours, IndexerServerV2Symbol, IndexerServerV2SymbolsResponse, IndexerServerV2TickerResponse, IndexerServerV2TickersResponse };
431
+ export type { IndexerEdgeServerCandlesticksParams, IndexerEdgeServerCandlesticksResponse, IndexerEdgeServerMarketSnapshotsParams, IndexerEdgeServerMarketSnapshotsResponse, IndexerServerAllTimePoints, IndexerServerBacklogResponse, IndexerServerCandlesticksParams, IndexerServerCandlesticksResponse, IndexerServerDDAQueryParams, IndexerServerDDAResponse, IndexerServerEventsParams, IndexerServerEventsResponse, IndexerServerFastWithdrawalSignatureParams, IndexerServerFastWithdrawalSignatureResponse, IndexerServerFundingRate, IndexerServerFundingRateParams, IndexerServerFundingRateResponse, IndexerServerFundingRatesParams, IndexerServerFundingRatesResponse, IndexerServerInterestFundingParams, IndexerServerInterestFundingResponse, IndexerServerLeaderboardContestsParams, IndexerServerLeaderboardContestsResponse, IndexerServerLeaderboardParams, IndexerServerLeaderboardRankParams, IndexerServerLeaderboardRankResponse, IndexerServerLeaderboardRegisterParams, IndexerServerLeaderboardRegisterResponse, IndexerServerLeaderboardRegistrationsParams, IndexerServerLeaderboardRegistrationsResponse, IndexerServerLeaderboardResponse, IndexerServerLinkedSignerParams, IndexerServerLinkedSignerResponse, IndexerServerListSocialAccountsParams, IndexerServerListSubaccountsParams, IndexerServerListSubaccountsResponse, IndexerServerMakerStatisticsParams, IndexerServerMakerStatisticsResponse, IndexerServerMarketSnapshotsParams, IndexerServerMarketSnapshotsResponse, IndexerServerMatchEventsParams, IndexerServerMatchEventsResponse, IndexerServerMultiProductsParams, IndexerServerMultiProductsResponse, IndexerServerMultiSubaccountSnapshotsParams, IndexerServerMultiSubaccountSnapshotsResponse, IndexerServerNlpSnapshotsParams, IndexerServerNlpSnapshotsResponse, IndexerServerOraclePricesParams, IndexerServerOraclePricesResponse, IndexerServerOrdersParams, IndexerServerOrdersResponse, IndexerServerPerpPrices, IndexerServerPerpPricesParams, IndexerServerPerpPricesResponse, IndexerServerPointsEpoch, IndexerServerPointsParams, IndexerServerPointsResponse, IndexerServerPriceParams, IndexerServerPriceResponse, IndexerServerPrivateAlphaChoiceParams, IndexerServerPrivateAlphaChoiceResponse, IndexerServerProductsParams, IndexerServerProductsResponse, IndexerServerQueryRequestByType, IndexerServerQueryRequestType, IndexerServerQueryResponseByType, IndexerServerQuotePriceResponse, IndexerServerReferralCodeParams, IndexerServerReferralCodeResponse, IndexerServerRevokeSocialAccountParams, IndexerServerSocialAccountsResponse, IndexerServerSocialConnectParams, IndexerServerSocialConnectResponse, IndexerServerTriggerTypeFilter, IndexerServerV2MarketHours, IndexerServerV2Symbol, IndexerServerV2SymbolsResponse, IndexerServerV2TickerResponse, IndexerServerV2TickersResponse };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nadohq/indexer-client",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "> TODO: description",
@@ -41,8 +41,8 @@
41
41
  "module": "./dist/index.js",
42
42
  "types": "./dist/index.d.ts",
43
43
  "dependencies": {
44
- "@nadohq/engine-client": "^0.6.0",
45
- "@nadohq/shared": "^0.6.0",
44
+ "@nadohq/engine-client": "^0.8.0",
45
+ "@nadohq/shared": "^0.8.0",
46
46
  "axios": "*",
47
47
  "ts-mixer": "*"
48
48
  },
@@ -54,5 +54,5 @@
54
54
  "bignumber.js": "workspace:*",
55
55
  "viem": "workspace:*"
56
56
  },
57
- "gitHead": "1ddd5c3e543913867665b7fe00b16cbaa9fc0b9f"
57
+ "gitHead": "1c5358e0dc2728f74ad86d85fe27f0218c0d655e"
58
58
  }