import { t as CandlestickPeriod } from "./CandlestickPeriod-DCpvV3PT.cjs"; import { n as IndexerEventType } from "./IndexerEventType-CXrGLtVb.cjs"; import { t as IndexerLeaderboardRankType } from "./IndexerLeaderboardType-BRzI5b0J.cjs"; import { c as NadoWithdrawCollateralV2Tx, o as NadoTx, s as NadoWithdrawCollateralTx } from "./NadoTx-B3fNEL7N.cjs"; import { E as IndexerServerFastWithdrawalSignatureParams, Jt as IndexerServerTriggerTypeFilter, Z as IndexerServerListSubaccountsParams, y as IndexerServerCashIncentivesWalletStatus } from "./serverTypes-sSPZDJZ-.cjs"; import { EIP712OrderValues, Market, OrderAppendix, PerpBalance, PerpMarket, ProductEngineType, SignatureParams, SpotBalance, SpotMarket, Subaccount } from "@nadohq/shared"; import BigNumber from "bignumber.js"; import { Address, Hex } from "viem"; //#region src/types/clientTypes.d.ts /** * Base types */ type IndexerSpotBalance = Omit; type IndexerPerpBalance = Omit; interface IndexerEventSpotStateSnapshot { type: ProductEngineType.SPOT; preBalance: IndexerSpotBalance; postBalance: IndexerSpotBalance; market: SpotMarket; } interface IndexerEventPerpStateSnapshot { type: ProductEngineType.PERP; preBalance: IndexerPerpBalance; postBalance: IndexerPerpBalance; market: PerpMarket; } type IndexerEventBalanceStateSnapshot = IndexerEventSpotStateSnapshot | IndexerEventPerpStateSnapshot; interface IndexerBalanceTrackedVars { netInterestUnrealized: BigNumber; netInterestCumulative: BigNumber; netFundingUnrealized: BigNumber; netFundingCumulative: BigNumber; netEntryUnrealized: BigNumber; netEntryCumulative: BigNumber; quoteVolumeCumulative: BigNumber; cumulativeTradeCount: BigNumber; } interface IndexerEvent { subaccount: string; isolated: boolean; isolatedProductId: number | null; productId: number; submissionIndex: string; eventType: IndexerEventType; state: TStateType; trackedVars: IndexerBalanceTrackedVars; } interface IndexerEventWithTx extends IndexerEvent { timestamp: BigNumber; tx: NadoTx; } /** * List subaccounts */ type ListIndexerSubaccountsParams = IndexerServerListSubaccountsParams; type ListIndexerSubaccountsResponse = ({ hexId: string; createdAt: number; isolated: boolean; } & Subaccount)[]; /** * Subaccount snapshots */ interface GetIndexerMultiSubaccountSnapshotsParams { subaccounts: Subaccount[]; timestamps: number[]; isolated?: boolean; } type IndexerSnapshotBalance = IndexerEvent; interface IndexerSubaccountSnapshot { timestamp: BigNumber; balances: IndexerSnapshotBalance[]; } interface GetIndexerMultiSubaccountSnapshotsResponse { subaccountHexIds: string[]; snapshots: Record>; } /** * Perp prices */ interface GetIndexerPerpPricesParams { productId: number; } interface IndexerPerpPrices { productId: number; indexPrice: BigNumber; markPrice: BigNumber; updateTime: BigNumber; } type GetIndexerPerpPricesResponse = IndexerPerpPrices; interface GetIndexerMultiProductPerpPricesParams { productIds: number[]; } type GetIndexerMultiProductPerpPricesResponse = Record; /** * Oracle prices */ interface GetIndexerOraclePricesParams { productIds: number[]; } interface IndexerOraclePrice { productId: number; oraclePrice: BigNumber; updateTime: BigNumber; } type GetIndexerOraclePricesResponse = IndexerOraclePrice[]; /** * Funding rates */ interface GetIndexerFundingRateParams { productId: number; } interface IndexerFundingRate { productId: number; fundingRate: BigNumber; updateTime: BigNumber; } type GetIndexerFundingRateResponse = IndexerFundingRate; interface GetIndexerMultiProductFundingRatesParams { productIds: number[]; } type GetIndexerMultiProductFundingRatesResponse = Record; /** * Funding rate history */ interface GetIndexerFundingRateHistoryParams { productId: number; /** * Unix epoch in seconds, inclusive lower bound. Only rates with `timestamp >= startTimeInclusive` * are returned, paging forward from that time. When omitted, the most recent `limit` rates are returned. */ startTimeInclusive?: number; /** * Unix epoch in seconds, inclusive upper bound. Only rates with `timestamp <= endTimeInclusive` * are returned. Defaults to the current time. */ endTimeInclusive?: number; /** Max number of rates to return. Defaults to 100, max 1000. */ limit?: number; } interface IndexerFundingRateHistoryEntry { productId: number; timestamp: BigNumber; /** * Realized hourly funding rate at this tick, where 1 = 100%. * Multiply by 24 for the daily equivalent. */ fundingRateFrac: BigNumber; } /** * Entries are always ordered ascending by `timestamp`. To paginate forward, * pass the last entry's `timestamp + 1` as the next request's `startTimeInclusive`. */ type GetIndexerFundingRateHistoryResponse = IndexerFundingRateHistoryEntry[]; /** * Portfolio */ interface GetIndexerPortfolioParams { /** * Cross-margin subaccount to query. Its value aggregates the cross-margin * account plus every isolated child; isolated subaccounts are rejected. */ subaccount: Subaccount; } type IndexerPortfolioPeriod = 'day' | 'week' | 'month' | 'allTime' | 'perpDay' | 'perpWeek' | 'perpMonth' | 'perpAllTime'; interface IndexerPortfolioPoint { timestamp: BigNumber; value: BigNumber; } /** * All five series are aligned: same timestamps, same length. They share the same * baseline — the first snapshot at or after the timeframe start — so every series * except `accountValueHistory` begins at `0` and accumulates from there. */ interface IndexerPortfolioHistory { accountValueHistory: IndexerPortfolioPoint[]; /** * Trading PnL over the timeframe, baseline-subtracted so the first visible * point is `0`. Capital flows (deposits/withdrawals/transfers) are netted out. */ pnlHistory: IndexerPortfolioPoint[]; /** * Cumulative traded quote volume within the timeframe up to each timestamp, * USDT0-denominated. */ volumeHistory: IndexerPortfolioPoint[]; /** * Average trade size within the timeframe up to each timestamp — the * timeframe's quote volume divided by its trade count, or `0` when no trades * have occurred yet. A trade is a single fill, so an order matched against * multiple resting orders counts once per fill. */ tradeSizeHistory: IndexerPortfolioPoint[]; /** * Number of distinct markets traded within the timeframe up to each * timestamp. Only markets with at least one fill inside the timeframe count. */ marketCountHistory: IndexerPortfolioPoint[]; } type GetIndexerPortfolioResponse = Record; /** * Portfolio Calendar */ interface GetIndexerPortfolioCalendarParams { /** * Cross-margin subaccount to query. Its value aggregates the cross-margin * account plus every isolated child; isolated subaccounts are rejected. */ subaccount: Subaccount; /** First day of the range, unix seconds, UTC midnight (divisible by 86400). */ startTime: number; /** Last day of the range, unix seconds, UTC midnight, inclusive. The range is capped at 500 days. */ endTime: number; } interface IndexerPortfolioCalendarDay { date: BigNumber; /** * The scope's trading PnL for the day (USDT0): change in mark-to-market value * over the day with capital flows (deposits/withdrawals/transfers) netted out. */ pnl: BigNumber; volume: BigNumber; /** * Number of fills of the scope during the day. A trade is a single fill — an * order matched against multiple resting orders counts once per fill. */ tradeCount: BigNumber; productIds: number[]; } /** * Both scopes cover the same set of days, ascending. Days before the * subaccount's first recorded activity return zeroed entries with an empty * `productIds`; days after the latest available data are omitted. */ interface GetIndexerPortfolioCalendarResponse { spot: IndexerPortfolioCalendarDay[]; perp: IndexerPortfolioCalendarDay[]; } /** * Candlesticks */ interface GetIndexerCandlesticksParams { productId: number; period: CandlestickPeriod; maxTimeInclusive?: number; limit: number; } interface Candlestick { time: BigNumber; open: BigNumber; high: BigNumber; low: BigNumber; close: BigNumber; volume: BigNumber; } type GetIndexerCandlesticksResponse = Candlestick[]; type GetIndexerEdgeCandlesticksResponse = GetIndexerCandlesticksResponse; type GetIndexerEdgeCandlesticksParams = GetIndexerCandlesticksParams; /** * Product snapshots */ interface GetIndexerProductSnapshotsParams { startCursor?: string; productId: number; maxTimestampInclusive?: number; limit: number; } interface IndexerProductSnapshot extends Market { submissionIndex: string; } type GetIndexerProductSnapshotsResponse = IndexerProductSnapshot[]; interface GetIndexerMultiProductSnapshotsParams { productIds: number[]; maxTimestampInclusive?: number[]; } type GetIndexerMultiProductSnapshotsResponse = Record>; interface IndexerSnapshotsIntervalParams { /** Currently accepts all integers, in seconds */ granularity: number; /** * Optional upper bound for snapshot timestamps (in seconds). * Without this, snapshots will default to align with last UTC midnight, * which can make "Last 24h" metrics inaccurate. */ maxTimeInclusive?: number; limit: number; } /** * Market snapshots */ interface GetIndexerMarketSnapshotsParams extends IndexerSnapshotsIntervalParams { productIds?: number[]; } interface IndexerMarketSnapshot { timestamp: BigNumber; cumulativeUsers: BigNumber; dailyActiveUsers: BigNumber; tvl: BigNumber; cumulativeVolumes: Record; cumulativeTakerFees: Record; cumulativeSequencerFees: Record; cumulativeMakerFees: Record; cumulativeTrades: Record; cumulativeLiquidationAmounts: Record; openInterestsQuote: Record; totalDeposits: Record; totalBorrows: Record; fundingRates: Record; depositRates: Record; borrowRates: Record; cumulativeTradeSizes: Record; cumulativeInflows: Record; cumulativeOutflows: Record; oraclePrices: Record; } type GetIndexerMarketSnapshotsResponse = IndexerMarketSnapshot[]; type GetIndexerEdgeMarketSnapshotsParams = IndexerSnapshotsIntervalParams; type GetIndexerEdgeMarketSnapshotResponse = Record; /** * Events */ type GetIndexerEventsLimitType = 'events' | 'txs'; interface GetIndexerEventsParams { startCursor?: string; subaccounts?: Subaccount[]; productIds?: number[]; isolated?: boolean; eventTypes?: IndexerEventType[]; maxTimestampInclusive?: number; desc?: boolean; limit?: { type: GetIndexerEventsLimitType; value: number; }; } type GetIndexerEventsResponse = IndexerEventWithTx[]; /** * Historical orders */ interface GetIndexerOrdersParams { startCursor?: string; subaccounts?: Subaccount[]; minTimestampInclusive?: number; maxTimestampInclusive?: number; limit?: number; productIds?: number[]; triggerTypes?: IndexerServerTriggerTypeFilter[]; isolated?: boolean; digests?: string[]; } interface IndexerOrder { digest: string; subaccount: string; productId: number; submissionIndex: string; lastFillSubmissionIndex: string; amount: BigNumber; price: BigNumber; expiration: number; appendix: OrderAppendix; nonce: BigNumber; isolated: boolean; recvTimeSeconds: number; baseFilled: BigNumber; quoteFilled: BigNumber; totalFee: BigNumber; builderFee: BigNumber; realizedPnl: BigNumber; closedAmount: BigNumber; closedNetEntry: BigNumber; preCloseMargin: BigNumber | null; firstFillTimestamp: BigNumber; lastFillTimestamp: BigNumber; /** Balances before the order was filled */ preBalances: IndexerMatchEventBalances; /** Balances after the order was filled */ postBalances: IndexerMatchEventBalances; } type GetIndexerOrdersResponse = IndexerOrder[]; /** * Match events */ interface GetIndexerMatchEventsParams { subaccounts?: Subaccount[]; productIds?: number[]; isolated?: boolean; maxTimestampInclusive?: number; limit: number; startCursor?: string; } interface IndexerMatchEventBalances { base: IndexerSpotBalance | IndexerPerpBalance; quote?: IndexerSpotBalance; } interface IndexerMatchEvent extends Subaccount { productId: number; digest: string; isolated: boolean; order: EIP712OrderValues; baseFilled: BigNumber; quoteFilled: BigNumber; totalFee: BigNumber; sequencerFee: BigNumber; builderFee: BigNumber; cumulativeBaseFilled: BigNumber; cumulativeQuoteFilled: BigNumber; cumulativeFee: BigNumber; submissionIndex: string; timestamp: BigNumber; isTaker: boolean; preEventTrackedVars: Pick; preBalances: IndexerMatchEventBalances; postBalances: IndexerMatchEventBalances; tx: NadoTx; realizedPnl: BigNumber; closedAmount: BigNumber; closedNetEntry: BigNumber; margin: BigNumber | null; } type GetIndexerMatchEventsResponse = IndexerMatchEvent[]; /** * Position history */ /** * Params for querying a subaccount's historical positions. All parameters except * `subaccount` are optional filters. */ interface GetIndexerPositionsParams { /** * Subaccount to query. Isolated positions are also returned under the parent * subaccount, so always query with the parent. */ subaccount: Subaccount; /** When provided, only return positions of the specified product. */ productId?: number; /** `true`: only isolated positions, `false`: only cross positions. Omit for both. */ isolated?: boolean; /** `true`: only positions that are still open, `false`: only closed positions. Omit for both. */ open?: boolean; /** * Max `openId`, inclusive. To paginate, pass the last returned position's * `openId - 1` as the next request's `startCursor`. */ startCursor?: string; /** Max number of positions to return. Defaults to 100, max 500. */ limit?: number; } /** * A historical position for a subaccount in a product. A position opens when the balance * goes from zero to non-zero or flips direction, and closes when the balance returns to * zero or flips again. All amount fields are absolute values; the side of the position is * given by `direction`. */ interface IndexerPosition { /** Subaccount hex ID associated with the position. */ subaccount: string; productId: number; isolated: boolean; /** Direction of the position. `true` for long, `false` for short. */ direction: boolean; /** `submissionIndex` of the transaction that opened the position. */ openId: string; /** `submissionIndex` of the transaction that closed the position; `-1` if still open. */ closeId: string; /** `submissionIndex` of the last transaction that updated the position. */ submissionIndex: string; /** Current size of the position; `0` once the position is closed. */ amount: BigNumber; /** Peak size reached by the position. */ maxAmount: BigNumber; /** Total amount opened on this position. */ totalOpenAmount: BigNumber; /** Total amount closed on this position. */ totalCloseAmount: BigNumber; /** Volume-weighted average entry price of the position. */ averageEntryPrice: BigNumber; /** Volume-weighted average exit price of the position. */ averageExitPrice: BigNumber; /** Total amount closed by liquidations on this position. */ liquidatedAmount: BigNumber; /** * Peak leverage reached by the isolated position; `0` for cross positions. * Set to `i128::MAX` (decimal adjusted) when the position's equity is below zero. */ maxIsolatedLeverage: BigNumber; /** Total fees paid on fills that increased the position. */ openFee: BigNumber; /** Total fees paid on fills that decreased the position. */ closeFee: BigNumber; /** Realized PnL for this position. */ realizedPnl: BigNumber; /** Unix epoch in seconds of when the position was opened. */ openTimestamp: BigNumber; /** Unix epoch in seconds of when the position was last updated. */ updateTimestamp: BigNumber; /** The transaction type that opened the position, e.g. `match_orders`. */ openReason: IndexerEventType; /** The transaction type that closed the position; `null` if still open. */ closeReason: IndexerEventType | null; /** Net funding payment on this position. Only for perp positions. */ netFundingPayment: BigNumber; /** Net interest payment on this position. Only for spot positions. */ netInterestPayment: BigNumber; /** Digest of the order that opened the position; `null` if not opened by a match. */ openDigest: string | null; /** Digest of the order that closed the position; `null` if not closed by a match or still open. */ closeDigest: string | null; netEntryUnrealized: BigNumber; } /** * Response for the positions query. */ interface GetIndexerPositionsResponse { /** Positions in descending order by `openId`. */ positions: IndexerPosition[]; /** * Events (with their transactions) at each position's boundaries: open and close, or * open and latest update while still open. Join them to positions via * `openId` / `closeId` / `submissionIndex`. */ events: IndexerEventWithTx[]; } /** * Quote price */ interface GetIndexerQuotePriceResponse { price: BigNumber; } /** * Linked Signer */ interface GetIndexerLinkedSignerParams { subaccount: Subaccount; } interface GetIndexerLinkedSignerResponse { totalTxLimit: BigNumber; remainingTxs: BigNumber; waitTimeUntilNextTx: BigNumber; signer: string; } /** * Interest / funding payments */ interface GetIndexerInterestFundingPaymentsParams { subaccount: Subaccount; productIds: number[]; maxTimestampInclusive?: number; limit: number; startCursor?: string; } interface IndexerProductPayment { productId: number; submissionIndex: string; timestamp: BigNumber; paymentAmount: BigNumber; balanceAmount: BigNumber; annualPaymentRate: BigNumber; oraclePrice: BigNumber; isolated: boolean; isolatedProductId: number | null; } interface GetIndexerInterestFundingPaymentsResponse { interestPayments: IndexerProductPayment[]; fundingPayments: IndexerProductPayment[]; nextCursor: string | null; } /** * Referral code */ interface GetIndexerReferralCodeParams { subaccount: Subaccount; } interface GetIndexerReferralCodeResponse { referralCode: string | null; } /** * Maker stats */ interface GetIndexerMakerStatisticsParams { productId: number; epoch: number; interval: number; } interface IndexerMakerSnapshot { timestamp: BigNumber; makerFee: BigNumber; uptime: BigNumber; sumQMin: BigNumber; qScore: BigNumber; makerShare: BigNumber; expectedMakerReward: BigNumber; } interface IndexerMaker { address: string; snapshots: IndexerMakerSnapshot[]; } interface GetIndexerMakerStatisticsResponse { rewardCoefficient: BigNumber; makers: IndexerMaker[]; } /** * Leaderboards */ interface GetIndexerLeaderboardParams { contestId: number; /** * The ranking metric to query by. * Optional for single-track contests (auto-selects the only track). * Required for multi-track contests — omitting it returns an error. */ rankType?: IndexerLeaderboardRankType; startCursor?: string; limit?: number; /** Sort order. Defaults to `'DESC'`. */ order?: 'ASC' | 'DESC'; } interface IndexerSocialAccountInfo { provider: 'twitter'; username: string; displayName: string; profileImageUrl: string; } interface IndexerLeaderboardTrackPosition { value: BigNumber; rank: BigNumber; qualificationStatus: 'qualified' | 'insufficient_account_value' | 'insufficient_volume' | 'insufficient_account_value_and_volume'; } interface IndexerLeaderboardParticipant { subaccount: Subaccount; contestId: number; accountValue: BigNumber; updateTime: BigNumber; tracks: Partial>; socialAccounts: IndexerSocialAccountInfo[]; } interface GetIndexerLeaderboardResponse { participants: IndexerLeaderboardParticipant[]; } interface GetIndexerLeaderboardParticipantParams { contestIds: number[]; subaccount: Subaccount; } interface GetIndexerLeaderboardParticipantResponse { participant: Record; } interface GetIndexerLeaderboardRegistrationsParams { subaccount: Subaccount; /** Filter by contest IDs. Omit to return all. */ contestIds?: number[]; /** Filter by contest active status. `true` = active only, `false` = inactive only, omit for all. */ active?: boolean; } interface RegisterLeaderboardParams extends Subaccount, SignatureParams { contestIds: number[]; /** In millis, defaults to 90s in the future. */ recvTime?: BigNumber; } interface IndexerLeaderboardRegistration { subaccount: Subaccount; contestId: number; updateTime: BigNumber; } interface GetIndexerLeaderboardRegistrationsResponse { registrations: IndexerLeaderboardRegistration[]; } type RegisterLeaderboardResponse = GetIndexerLeaderboardRegistrationsResponse; interface GetIndexerLeaderboardContestsParams { /** Filter by contest IDs. Omit to return all. */ contestIds?: number[]; /** Filter by contest active status. `true` = active only, `false` = inactive only, omit for all. */ active?: boolean; } interface IndexerLeaderboardContestTrack { trackId: number; rankType: IndexerLeaderboardRankType; sortOrder: 'ASC' | 'DESC'; accountValueThreshold: BigNumber; volumeThreshold: BigNumber; } interface IndexerLeaderboardContest { contestId: number; startTime: BigNumber; endTime: BigNumber; lastUpdated: BigNumber; totalParticipants: BigNumber; requiredProductIds: number[]; active: boolean; title: string; description: string; tracks: IndexerLeaderboardContestTrack[]; } interface GetIndexerLeaderboardContestsResponse { contests: IndexerLeaderboardContest[]; } /** * Social Accounts */ interface ConnectSocialAccountParams extends Subaccount, SignatureParams { provider: 'twitter'; /** In millis, defaults to 90s in the future. */ recvTime?: BigNumber; } interface ConnectSocialAccountResponse { url: string; } interface ListIndexerSocialAccountsParams { address: Address; } interface ListIndexerSocialAccountsResponse { accounts: IndexerSocialAccountInfo[]; } type RevokeSocialAccountParams = ConnectSocialAccountParams; type RevokeSocialAccountResponse = ListIndexerSocialAccountsResponse; type GetIndexerFastWithdrawalSignatureParams = IndexerServerFastWithdrawalSignatureParams; interface GetIndexerFastWithdrawalSignatureResponse { idx: bigint; tx: NadoWithdrawCollateralTx['withdraw_collateral']; txV2?: NadoWithdrawCollateralV2Tx['withdraw_collateral_v2']; txBytes: Hex; signatures: Hex[]; } /** * NLP */ type GetIndexerNlpSnapshotsParams = IndexerSnapshotsIntervalParams; interface IndexerNlpSnapshot { submissionIndex: string; timestamp: BigNumber; cumulativeVolume: BigNumber; cumulativeTrades: BigNumber; cumulativeMintAmountQuote: BigNumber; cumulativeBurnAmountQuote: BigNumber; cumulativePnl: BigNumber; tvl: BigNumber; oraclePrice: BigNumber; depositors: BigNumber; } interface GetIndexerNlpSnapshotsResponse { snapshots: IndexerNlpSnapshot[]; } interface GetIndexerBacklogResponse { totalTxs: BigNumber; totalSubmissions: BigNumber; backlogSize: BigNumber; updatedAt: BigNumber; backlogEtaInSeconds: BigNumber | null; txsPerSecond: BigNumber | null; } interface GetIndexerSubaccountDDAParams { subaccount: Subaccount; } interface GetIndexerSubaccountDDAResponse { address: Address; } /** * Private Alpha Choice */ interface GetIndexerPrivateAlphaChoiceParams { address: Address; } interface GetIndexerPrivateAlphaChoiceResponse { points: BigNumber; feeRefund: BigNumber; nftEligibility: boolean; } /** * Nado Points */ interface GetIndexerPointsParams { address: Address; } interface IndexerPointsEpoch { epoch: number; description: string; /** Unix timestamp in seconds */ startTime: BigNumber; /** Unix timestamp in seconds */ endTime: BigNumber; totalPoints: BigNumber; points: BigNumber; rank: number; tier: number; } interface IndexerAllTimePoints { points: BigNumber; rank: number; tier: number; } interface GetIndexerPointsResponse { pointsPerEpoch: IndexerPointsEpoch[]; allTimePoints: IndexerAllTimePoints; } /** * Nado XPoints (Nado x xStocks points program) */ interface GetIndexerXPointsParams { address: Address; } interface IndexerXPointsQuest { /** Quest identifier, e.g. `ProtocolDepositBoost` or `ProtocolTieredVolumeBoost` */ questType: string; points: BigNumber; } interface IndexerXPointsEpoch { epoch: number; description: string; startTime: BigNumber; endTime: BigNumber; totalPoints: BigNumber; rank: number; quests: IndexerXPointsQuest[]; } interface IndexerXPointsAllTime { totalPoints: BigNumber; rank: number; quests: IndexerXPointsQuest[]; } interface GetIndexerXPointsResponse { pointsPerEpoch: IndexerXPointsEpoch[]; allTimePoints: IndexerXPointsAllTime; } /** * Cash Incentives (platform volume and unlocked rewards) */ interface GetIndexerCashIncentivesParams { address: Address; } interface IndexerCashIncentivesEventMetadata { eventId: number; description: string; /** Unix timestamp in seconds */ epochStart: BigNumber; /** Unix timestamp in seconds */ epochEnd: BigNumber; maxVolume: BigNumber; maxReward: BigNumber; minVolume: BigNumber; minReward: BigNumber; } interface IndexerCashIncentivesEventPlatform { platformVolume: BigNumber; unlockedReward: BigNumber; } /** * `wallet.claim` variant carrying the data needed to build an Airdrop contract `claim` call. */ interface IndexerCashIncentivesClaimableClaim { /** Discriminant marking this claim as ready to submit onchain. */ status: 'claimable'; /** Airdrop contract holding the reward. */ airdropAddress: Address; /** * Reward event identifier within the airdrop contract. This is not the same as * {@link IndexerCashIncentivesEventMetadata.eventId}, which identifies the Cash Incentives campaign. */ week: number; /** * Cumulative claimable amount in raw token units, as committed to by the merkle root. Pass this to * the contract unchanged; use {@link IndexerCashIncentivesEventWallet.reward} for display, since * the reward token's decimals are not part of the response. */ totalAmount: BigNumber; /** Merkle proof for this wallet's reward. */ proof: Hex[]; } /** * `wallet.claim` variant for events with nothing to claim, which carries only the status. */ interface IndexerCashIncentivesUnclaimableClaim { /** Why there is nothing to claim yet. */ status: Exclude; } /** * Always present, tagged on `status`. Only the `claimable` variant carries proof data, so narrow on * `status === 'claimable'` before reading it. See * {@link IndexerServerCashIncentivesWalletStatus} for the meaning of each status. */ type IndexerCashIncentivesWalletClaim = IndexerCashIncentivesClaimableClaim | IndexerCashIncentivesUnclaimableClaim; interface IndexerCashIncentivesEventWallet { /** * Reward for this wallet as a decimal token amount, already converted from the x18 value the * indexer returns. Populated before the reward becomes claimable. */ reward: BigNumber; /** Claim state for this event, always present and tagged on `status`. */ claim: IndexerCashIncentivesWalletClaim; } interface IndexerCashIncentivesEvent { metadata: IndexerCashIncentivesEventMetadata; platform: IndexerCashIncentivesEventPlatform; wallet: IndexerCashIncentivesEventWallet; } interface IndexerCashIncentivesWalletSummary { totalReward: BigNumber; claimableReward: BigNumber; } interface GetIndexerCashIncentivesResponse { events: IndexerCashIncentivesEvent[]; walletSummary: IndexerCashIncentivesWalletSummary; } /** * V2 Tickers */ /** * Market type for ticker filtering */ type TickerMarketType = 'spot' | 'perp'; /** * Parameters for querying v2 tickers endpoint */ interface GetIndexerV2TickersParams { /** * Filter tickers by market type (spot or perp) * @example 'spot' * @example 'perp' */ market?: TickerMarketType; /** * Whether to include edge products * @default false */ edge?: boolean; } /** * Individual ticker data from v2 endpoint */ interface IndexerV2TickerResponse { /** Unique product identifier */ productId: number; /** Unique ticker identifier */ tickerId: string; /** Base currency symbol */ baseCurrency: string; /** Quote currency symbol */ quoteCurrency: string; /** Last traded price */ lastPrice: number; /** 24h trading volume in base currency */ baseVolume: number; /** 24h trading volume in quote currency */ quoteVolume: number; /** 24h price change percentage */ priceChangePercent24h: number; } /** * Response from v2 tickers endpoint * Maps ticker IDs to their respective ticker data */ type GetIndexerV2TickersResponse = Record; /** * Parameters for querying v2 symbols endpoint */ interface GetIndexerV2SymbolsParams { /** * Filter by product type * @example 'spot' * @example 'perp' */ productType?: 'spot' | 'perp'; /** * Comma-separated list of product IDs to filter by * @example '2,4,42' */ productIds?: string; } /** * Market hours information for a product */ interface IndexerV2MarketHours { /** Whether the market is currently in its regular trading session */ isOpen: boolean; /** Why the market is closed: "weekend" or "holiday". Null when open. */ reason: string | null; /** ISO 8601 UTC timestamp of the next session close. Null when closed. */ nextClose: string | null; /** ISO 8601 UTC timestamp of the next session open. Null when no upcoming open. */ nextOpen: string | null; } type IndexerV2TradingStatus = 'live' | 'post_only' | 'reduce_only' | 'soft_reduce_only' | 'not_tradable'; /** * Individual symbol data from v2 endpoint */ interface IndexerV2Symbol { /** Product type: "spot" or "perp" */ type: string; /** Unique product identifier */ productId: number; /** Trading symbol (e.g., "BTC-PERP", "WETH") */ symbol: string; /** Minimum price increment */ priceIncrement: BigNumber; /** Minimum order size increment (base denominated) */ sizeIncrement: string; /** Minimum order size (USDT0 denominated) */ minSize: string; /** Default maker fee rate (negative = rebate) */ makerFeeRate: BigNumber; /** Default taker fee rate */ takerFeeRate: BigNumber; /** Initial margin weight for long positions */ longWeightInitial: BigNumber; /** Maintenance margin weight for long positions */ longWeightMaintenance: BigNumber; /** Maximum open interest cap. Null if uncapped. */ maxOpenInterest: BigNumber | null; /** * Exchange rate for xStocks. Null if not applicable. */ exchangeRate: BigNumber | null; /** Current trading status */ tradingStatus: IndexerV2TradingStatus; /** Whether the market only accepts isolated margin orders */ isolatedOnly: boolean; /** Market hours information. Null for 24/7 markets. */ marketHours: IndexerV2MarketHours | null; /** * Boost tier for products with rewards boosts. Null for non-boosted products. * 0 = none, 1 = taker 4x / maker 4x, 2 = taker 3x / maker 4x */ boostType: number | null; /** Taker rewards multiplier. Null for non-boosted products. */ takerMultiplier: number | null; /** Maker rewards multiplier. Null for non-boosted products. */ makerMultiplier: number | null; } /** * Response from v2 symbols endpoint * Maps symbols to their respective data */ type GetIndexerV2SymbolsResponse = Record; //#endregion export { GetIndexerOrdersResponse as $, IndexerOraclePrice as $t, GetIndexerLeaderboardRegistrationsResponse as A, RevokeSocialAccountResponse as An, IndexerCashIncentivesEventPlatform as At, GetIndexerMultiProductFundingRatesParams as B, IndexerFundingRate as Bt, GetIndexerInterestFundingPaymentsResponse as C, ListIndexerSocialAccountsParams as Cn, GetIndexerXPointsParams as Ct, GetIndexerLeaderboardParticipantParams as D, RegisterLeaderboardParams as Dn, IndexerCashIncentivesClaimableClaim as Dt, GetIndexerLeaderboardParams as E, ListIndexerSubaccountsResponse as En, IndexerBalanceTrackedVars as Et, GetIndexerMakerStatisticsResponse as F, IndexerEvent as Ft, GetIndexerMultiProductSnapshotsResponse as G, IndexerLeaderboardRegistration as Gt, GetIndexerMultiProductPerpPricesParams as H, IndexerLeaderboardContest as Ht, GetIndexerMarketSnapshotsParams as I, IndexerEventBalanceStateSnapshot as It, GetIndexerNlpSnapshotsParams as J, IndexerMakerSnapshot as Jt, GetIndexerMultiSubaccountSnapshotsParams as K, IndexerLeaderboardTrackPosition as Kt, GetIndexerMarketSnapshotsResponse as L, IndexerEventPerpStateSnapshot as Lt, GetIndexerLinkedSignerParams as M, IndexerCashIncentivesUnclaimableClaim as Mt, GetIndexerLinkedSignerResponse as N, IndexerCashIncentivesWalletClaim as Nt, GetIndexerLeaderboardParticipantResponse as O, RegisterLeaderboardResponse as On, IndexerCashIncentivesEvent as Ot, GetIndexerMakerStatisticsParams as P, IndexerCashIncentivesWalletSummary as Pt, GetIndexerOrdersParams as Q, IndexerNlpSnapshot as Qt, GetIndexerMatchEventsParams as R, IndexerEventSpotStateSnapshot as Rt, GetIndexerInterestFundingPaymentsParams as S, IndexerXPointsQuest as Sn, GetIndexerV2TickersResponse as St, GetIndexerLeaderboardContestsResponse as T, ListIndexerSubaccountsParams as Tn, IndexerAllTimePoints as Tt, GetIndexerMultiProductPerpPricesResponse as U, IndexerLeaderboardContestTrack as Ut, GetIndexerMultiProductFundingRatesResponse as V, IndexerFundingRateHistoryEntry as Vt, GetIndexerMultiProductSnapshotsParams as W, IndexerLeaderboardParticipant as Wt, GetIndexerOraclePricesParams as X, IndexerMatchEvent as Xt, GetIndexerNlpSnapshotsResponse as Y, IndexerMarketSnapshot as Yt, GetIndexerOraclePricesResponse as Z, IndexerMatchEventBalances as Zt, GetIndexerFastWithdrawalSignatureResponse as _, IndexerV2Symbol as _n, GetIndexerSubaccountDDAParams as _t, GetIndexerCandlesticksParams as a, IndexerPortfolioHistory as an, GetIndexerPortfolioCalendarResponse as at, GetIndexerFundingRateParams as b, IndexerXPointsAllTime as bn, GetIndexerV2SymbolsResponse as bt, GetIndexerCashIncentivesResponse as c, IndexerPosition as cn, GetIndexerPositionsParams as ct, GetIndexerEdgeMarketSnapshotResponse as d, IndexerSnapshotBalance as dn, GetIndexerPrivateAlphaChoiceResponse as dt, IndexerOrder as en, GetIndexerPerpPricesParams as et, GetIndexerEdgeMarketSnapshotsParams as f, IndexerSnapshotsIntervalParams as fn, GetIndexerProductSnapshotsParams as ft, GetIndexerFastWithdrawalSignatureParams as g, IndexerV2MarketHours as gn, GetIndexerReferralCodeResponse as gt, GetIndexerEventsResponse as h, IndexerSubaccountSnapshot as hn, GetIndexerReferralCodeParams as ht, GetIndexerBacklogResponse as i, IndexerPortfolioCalendarDay as in, GetIndexerPortfolioCalendarParams as it, GetIndexerLeaderboardResponse as j, TickerMarketType as jn, IndexerCashIncentivesEventWallet as jt, GetIndexerLeaderboardRegistrationsParams as k, RevokeSocialAccountParams as kn, IndexerCashIncentivesEventMetadata as kt, GetIndexerEdgeCandlesticksParams as l, IndexerProductPayment as ln, GetIndexerPositionsResponse as lt, GetIndexerEventsParams as m, IndexerSpotBalance as mn, GetIndexerQuotePriceResponse as mt, ConnectSocialAccountParams as n, IndexerPerpPrices as nn, GetIndexerPointsParams as nt, GetIndexerCandlesticksResponse as o, IndexerPortfolioPeriod as on, GetIndexerPortfolioParams as ot, GetIndexerEventsLimitType as p, IndexerSocialAccountInfo as pn, GetIndexerProductSnapshotsResponse as pt, GetIndexerMultiSubaccountSnapshotsResponse as q, IndexerMaker as qt, ConnectSocialAccountResponse as r, IndexerPointsEpoch as rn, GetIndexerPointsResponse as rt, GetIndexerCashIncentivesParams as s, IndexerPortfolioPoint as sn, GetIndexerPortfolioResponse as st, Candlestick as t, IndexerPerpBalance as tn, GetIndexerPerpPricesResponse as tt, GetIndexerEdgeCandlesticksResponse as u, IndexerProductSnapshot as un, GetIndexerPrivateAlphaChoiceParams as ut, GetIndexerFundingRateHistoryParams as v, IndexerV2TickerResponse as vn, GetIndexerSubaccountDDAResponse as vt, GetIndexerLeaderboardContestsParams as w, ListIndexerSocialAccountsResponse as wn, GetIndexerXPointsResponse as wt, GetIndexerFundingRateResponse as x, IndexerXPointsEpoch as xn, GetIndexerV2TickersParams as xt, GetIndexerFundingRateHistoryResponse as y, IndexerV2TradingStatus as yn, GetIndexerV2SymbolsParams as yt, GetIndexerMatchEventsResponse as z, IndexerEventWithTx as zt }; //# sourceMappingURL=clientTypes-DnLNlJrL.d.cts.map