{"version":3,"file":"serverTypes.cjs","names":[],"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, NadoWithdrawCollateralV2Tx } 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  IndexerServerPosition,\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 IndexerServerFundingRateHistoryParams {\n  product_id: number;\n  start_time?: number | string;\n  end_time?: number | string;\n  // Max number of rates to return. Defaults to 100, max 1000.\n  limit?: number;\n}\n\nexport interface IndexerServerPriceParams {\n  product_id: number;\n}\n\nexport interface IndexerServerPerpPricesParams {\n  product_ids: number[];\n}\n\nexport interface IndexerServerPortfolioParams {\n  subaccount: string;\n}\n\nexport interface IndexerServerPortfolioCalendarParams {\n  subaccount: string;\n  // Unix seconds, UTC midnight\n  start_time: number | string;\n  end_time: number | string;\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\n/**\n * Params for the positions query. All parameters except `subaccount` are optional filters.\n */\nexport interface IndexerServerPositionsParams {\n  // Subaccount hex identifier. Isolated positions are also returned under the parent subaccount\n  subaccount: string;\n  // When provided, only return positions of the specified product\n  product_id?: number;\n  // If not given, will return both isolated & cross positions\n  isolated?: boolean;\n  // If not given, will return both open & closed positions\n  open?: boolean;\n  // open_id for pagination, inclusive (only positions with open_id <= idx are returned)\n  idx?: number | string;\n  // Max number of positions to return. Defaults to 100, max 500\n  limit?: number;\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\nexport interface IndexerServerXPointsParams {\n  address: string;\n}\n\nexport interface IndexerServerCashIncentivesParams {\n  wallet_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_rate_history: IndexerServerFundingRateHistoryParams;\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  portfolio: IndexerServerPortfolioParams;\n  portfolio_calendar: IndexerServerPortfolioCalendarParams;\n  positions: IndexerServerPositionsParams;\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  nado_xpoints: IndexerServerXPointsParams;\n  cash_incentives: IndexerServerCashIncentivesParams;\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 IndexerServerFundingRateHistoryEntry {\n  product_id: number;\n  // Epoch time in seconds of the settlement tick this funding rate was recorded at.\n  timestamp: string;\n  // Realized hourly funding rate at this tick, multiplied by 10^18 (% = rate * 100).\n  funding_rate_x18: string;\n}\n\nexport interface IndexerServerFundingRateHistoryResponse {\n  // Always ascending by timestamp.\n  funding_rates: IndexerServerFundingRateHistoryEntry[];\n}\n\nexport type IndexerServerPortfolioPeriod =\n  | 'day'\n  | 'week'\n  | 'month'\n  | 'allTime'\n  | 'perpDay'\n  | 'perpWeek'\n  | 'perpMonth'\n  | 'perpAllTime';\n\n/**\n * [timestamp (unix seconds), value] — both x18-free decimal strings. Values are\n * USDT0-denominated, except `marketCountHistory` points, which are integer counts.\n */\nexport type IndexerServerPortfolioPoint = [string, string];\n\n// All five series are aligned: same timestamps, same length.\nexport interface IndexerServerPortfolioHistory {\n  accountValueHistory: IndexerServerPortfolioPoint[];\n  pnlHistory: IndexerServerPortfolioPoint[];\n  volumeHistory: IndexerServerPortfolioPoint[];\n  tradeSizeHistory: IndexerServerPortfolioPoint[];\n  marketCountHistory: IndexerServerPortfolioPoint[];\n}\n\nexport type IndexerServerPortfolioResponse = [\n  IndexerServerPortfolioPeriod,\n  IndexerServerPortfolioHistory,\n][];\n\nexport interface IndexerServerPortfolioCalendarDay {\n  // UTC midnight of the day, unix seconds.\n  date: string;\n  pnl: string;\n  volume: string;\n  trade_count: string;\n  // Markets with at least one fill during the day, ascending. Empty when nothing was traded.\n  product_ids: number[];\n}\n\n// Both scopes cover the same set of days, ascending.\nexport interface IndexerServerPortfolioCalendarResponse {\n  spot: IndexerServerPortfolioCalendarDay[];\n  perp: IndexerServerPortfolioCalendarDay[];\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\n/**\n * Response for the positions query. Positions are in descending order by `open_id`.\n * `events` / `txs` are the events and transactions at each position's boundaries\n * (open and close, or open and latest update while still open), joined to positions\n * via `open_id` / `close_id` / `submission_idx`.\n */\nexport interface IndexerServerPositionsResponse {\n  positions: IndexerServerPosition[];\n  events: IndexerServerEvent[];\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  // Present only for `WithdrawCollateralV2` withdrawals.\n  tx_v2?: NadoWithdrawCollateralV2Tx['withdraw_collateral_v2'];\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 IndexerServerXPointsQuest {\n  quest_type: string;\n  points: string;\n}\n\nexport interface IndexerServerXPointsEpoch {\n  epoch: number;\n  description: string;\n  start_time: string;\n  end_time: string;\n  total_points: string;\n  rank: number;\n  quests: IndexerServerXPointsQuest[];\n}\n\nexport interface IndexerServerXPointsAllTime {\n  total_points: string;\n  rank: number;\n  quests: IndexerServerXPointsQuest[];\n}\n\nexport interface IndexerServerXPointsResponse {\n  points_per_epoch: IndexerServerXPointsEpoch[];\n  all_time_points: IndexerServerXPointsAllTime;\n}\n\nexport interface IndexerServerCashIncentivesEventMetadata {\n  event_id: number;\n  description: string;\n  // UNIX timestamp in seconds\n  epoch_start: string;\n  // UNIX timestamp in seconds\n  epoch_end: string;\n  // x18 string\n  max_volume: string;\n  // x18 string\n  max_reward: string;\n  // x18 string\n  min_volume: string;\n  // x18 string\n  min_reward: string;\n}\n\nexport interface IndexerServerCashIncentivesEventPlatform {\n  // x18 string\n  platform_volume: string;\n  // x18 string\n  unlocked_reward: string;\n}\n\n/**\n * Claim status of a wallet for a single Cash Incentives event.\n *\n * - `in_progress`: the event is still active.\n * - `pending`: the event has ended, but its settlement has not been published.\n * - `no_reward`: the settlement exists, but the wallet has no reward.\n * - `claimable`: the settlement grants this wallet a reward, and the proof to claim it is included.\n *\n * There is deliberately no `claimed` status. The airdrop contract's `getClaimed` is the source of\n * truth for whether a reward has already been taken, so a reward stays `claimable` here even after\n * it has been claimed onchain.\n */\nexport const INDEXER_SERVER_CASH_INCENTIVES_WALLET_STATUSES = [\n  'in_progress',\n  'pending',\n  'no_reward',\n  'claimable',\n] as const;\n\nexport type IndexerServerCashIncentivesWalletStatus =\n  (typeof INDEXER_SERVER_CASH_INCENTIVES_WALLET_STATUSES)[number];\n\n/**\n * `wallet.claim` variant carrying everything needed to claim onchain.\n */\nexport interface IndexerServerCashIncentivesClaimableClaim {\n  status: 'claimable';\n  airdrop_address: string;\n  // Reward event id within the airdrop contract, distinct from `metadata.event_id`\n  week: number;\n  // Integer string in raw token units, as committed to by the merkle root\n  total_amount: string;\n  // Merkle proof hashes\n  proof: string[];\n}\n\n/**\n * `wallet.claim` variant for events with nothing to claim, which carries only the status.\n */\nexport interface IndexerServerCashIncentivesUnclaimableClaim {\n  status: Exclude<IndexerServerCashIncentivesWalletStatus, 'claimable'>;\n}\n\n/**\n * Always present, tagged on `status`. Only the `claimable` variant carries proof data.\n */\nexport type IndexerServerCashIncentivesWalletClaim =\n  | IndexerServerCashIncentivesClaimableClaim\n  | IndexerServerCashIncentivesUnclaimableClaim;\n\nexport interface IndexerServerCashIncentivesEventWallet {\n  // x18 string\n  reward: string;\n  claim: IndexerServerCashIncentivesWalletClaim;\n}\n\nexport interface IndexerServerCashIncentivesEvent {\n  metadata: IndexerServerCashIncentivesEventMetadata;\n  platform: IndexerServerCashIncentivesEventPlatform;\n  wallet: IndexerServerCashIncentivesEventWallet;\n}\n\nexport interface IndexerServerCashIncentivesWalletSummary {\n  // x18 string\n  total_reward: string;\n  // x18 string\n  claimable_reward: string;\n}\n\nexport interface IndexerServerCashIncentivesResponse {\n  events: IndexerServerCashIncentivesEvent[];\n  wallet_summary: IndexerServerCashIncentivesWalletSummary;\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_rate_history: IndexerServerFundingRateHistoryResponse;\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  portfolio: IndexerServerPortfolioResponse;\n  portfolio_calendar: IndexerServerPortfolioCalendarResponse;\n  positions: IndexerServerPositionsResponse;\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  nado_xpoints: IndexerServerXPointsResponse;\n  cash_incentives: IndexerServerCashIncentivesResponse;\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  /**\n   * Defined only for perp markets with a max OI cap\n   */\n  max_open_interest_x18: string | null;\n  /**\n   * Defined only for xStocks spot markets\n   */\n  exchange_rate_x18: string | null;\n  trading_status: string;\n  isolated_only: boolean;\n  market_hours: IndexerServerV2MarketHours | null;\n  /**\n   * Boost tier for products with rewards boosts. Null for non-boosted products.\n   * 0 = none, 1 = taker 4x / maker 4x, 2 = taker 3x / maker 4x\n   */\n  boost_type: number | null;\n  /**\n   * Taker rewards multiplier. Null for non-boosted products.\n   */\n  taker_multiplier: number | null;\n  /**\n   * Maker rewards multiplier. Null for non-boosted products.\n   */\n  maker_multiplier: number | 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\n/**\n * Wire `request_type` the indexer echoes on failure envelopes. The indexer's failure envelope is\n * keyed by route (`<verb>_<query_type>`), mirroring the engine and trigger services. Kept as a\n * `${string}_${string}` template to avoid enumerating the full set of v1 query types declared\n * above.\n */\nexport type IndexerServerRequestType = `${string}_${string}`;\n\n/**\n * Failure envelope returned by the indexer service API. Mirrors the failure shape used by the\n * engine and trigger services: a `status: 'failure'` discriminant plus an `error`/`error_code`\n * pair and the originating `request_type`. A response missing this envelope shape (e.g. a\n * malformed body, or a non-JSON response) is a transport-level error, not a domain error.\n *\n * The v2 REST endpoints do not return this envelope — they use plain HTTP error responses\n * without an `error_code` field.\n */\nexport interface IndexerServerFailureResponse {\n  status: 'failure';\n  error: string;\n  error_code: number;\n  request_type: IndexerServerRequestType;\n}\n\n/**\n * Narrows an unknown response body to the indexer service API failure envelope.\n */\nexport function isIndexerServerFailureResponse(\n  data: unknown,\n): data is IndexerServerFailureResponse {\n  return (\n    typeof data === 'object' &&\n    data !== null &&\n    (data as Record<string, unknown>).status === 'failure'\n  );\n}\n"],"mappings":";;;;;;;;;;;;;;AAupBA,MAAa,iDAAiD;CAC5D;CACA;CACA;CACA;AACF;;;;AA+NA,SAAgB,+BACd,MACsC;CACtC,OACE,OAAO,SAAS,YAChB,SAAS,QACR,KAAiC,WAAW;AAEjD"}