@nadohq/indexer-client 0.1.0-alpha.41 → 0.1.0-alpha.44
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.
- package/dist/IndexerBaseClient.cjs +16 -0
- package/dist/IndexerBaseClient.cjs.map +1 -1
- package/dist/IndexerBaseClient.d.cts +6 -1
- package/dist/IndexerBaseClient.d.ts +6 -1
- package/dist/IndexerBaseClient.js +16 -0
- package/dist/IndexerBaseClient.js.map +1 -1
- package/dist/dataMappers.cjs +3 -1
- package/dist/dataMappers.cjs.map +1 -1
- package/dist/dataMappers.js +3 -1
- package/dist/dataMappers.js.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/types/clientTypes.cjs.map +1 -1
- package/dist/types/clientTypes.d.cts +16 -1
- package/dist/types/clientTypes.d.ts +16 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/serverModelTypes.cjs.map +1 -1
- package/dist/types/serverModelTypes.d.cts +4 -0
- package/dist/types/serverModelTypes.d.ts +4 -0
- package/dist/types/serverTypes.cjs.map +1 -1
- package/dist/types/serverTypes.d.cts +11 -1
- package/dist/types/serverTypes.d.ts +11 -1
- package/package.json +4 -4
- package/src/IndexerBaseClient.ts +22 -0
- package/src/dataMappers.ts +2 -0
- package/src/types/clientTypes.ts +20 -0
- package/src/types/serverModelTypes.ts +4 -0
- package/src/types/serverTypes.ts +12 -0
|
@@ -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\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}\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\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}\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"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
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\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}\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\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}\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"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -138,6 +138,9 @@ interface IndexerServerNlpSnapshotsParams {
|
|
|
138
138
|
interface IndexerServerDDAQueryParams {
|
|
139
139
|
subaccount: string;
|
|
140
140
|
}
|
|
141
|
+
interface IndexerServerPrivateAlphaChoiceParams {
|
|
142
|
+
address: string;
|
|
143
|
+
}
|
|
141
144
|
interface IndexerServerQueryRequestByType {
|
|
142
145
|
account_snapshots: IndexerServerMultiSubaccountSnapshotsParams;
|
|
143
146
|
backlog: Record<string, never>;
|
|
@@ -168,6 +171,7 @@ interface IndexerServerQueryRequestByType {
|
|
|
168
171
|
subaccounts: IndexerServerListSubaccountsParams;
|
|
169
172
|
quote_price: Record<string, never>;
|
|
170
173
|
nlp_snapshots: IndexerServerNlpSnapshotsParams;
|
|
174
|
+
private_alpha_choice: IndexerServerPrivateAlphaChoiceParams;
|
|
171
175
|
}
|
|
172
176
|
type IndexerServerQueryRequestType = keyof IndexerServerQueryRequestByType;
|
|
173
177
|
/**
|
|
@@ -281,6 +285,11 @@ interface IndexerServerBacklogResponse {
|
|
|
281
285
|
backlog_eta_in_seconds: string | null;
|
|
282
286
|
txs_per_second: string | null;
|
|
283
287
|
}
|
|
288
|
+
interface IndexerServerPrivateAlphaChoiceResponse {
|
|
289
|
+
points: string;
|
|
290
|
+
fee_refund: string;
|
|
291
|
+
nft_eligibility: boolean;
|
|
292
|
+
}
|
|
284
293
|
interface IndexerServerQueryResponseByType {
|
|
285
294
|
account_snapshots: IndexerServerMultiSubaccountSnapshotsResponse;
|
|
286
295
|
backlog: IndexerServerBacklogResponse;
|
|
@@ -311,6 +320,7 @@ interface IndexerServerQueryResponseByType {
|
|
|
311
320
|
subaccounts: IndexerServerListSubaccountsResponse;
|
|
312
321
|
quote_price: IndexerServerQuotePriceResponse;
|
|
313
322
|
nlp_snapshots: IndexerServerNlpSnapshotsResponse;
|
|
323
|
+
private_alpha_choice: IndexerServerPrivateAlphaChoiceResponse;
|
|
314
324
|
}
|
|
315
325
|
/**
|
|
316
326
|
* V2 API Types
|
|
@@ -334,4 +344,4 @@ interface IndexerServerV2TickerResponse {
|
|
|
334
344
|
*/
|
|
335
345
|
type IndexerServerV2TickersResponse = Record<string, IndexerServerV2TickerResponse>;
|
|
336
346
|
|
|
337
|
-
export type { IndexerEdgeServerCandlesticksParams, IndexerEdgeServerCandlesticksResponse, IndexerEdgeServerMarketSnapshotsParams, IndexerEdgeServerMarketSnapshotsResponse, IndexerServerBacklogResponse, IndexerServerCandlesticksParams, IndexerServerCandlesticksResponse, IndexerServerDDAQueryParams, IndexerServerDDAResponse, IndexerServerEventsParams, IndexerServerEventsResponse, IndexerServerFastWithdrawalSignatureParams, IndexerServerFastWithdrawalSignatureResponse, IndexerServerFundingRate, IndexerServerFundingRateParams, IndexerServerFundingRateResponse, IndexerServerFundingRatesParams, IndexerServerFundingRatesResponse, IndexerServerInterestFundingParams, IndexerServerInterestFundingResponse, IndexerServerLeaderboardContestsParams, IndexerServerLeaderboardContestsResponse, IndexerServerLeaderboardParams, IndexerServerLeaderboardRankParams, IndexerServerLeaderboardRankResponse, IndexerServerLeaderboardRegistrationParams, IndexerServerLeaderboardRegistrationResponse, IndexerServerLeaderboardResponse, IndexerServerLinkedSignerParams, IndexerServerLinkedSignerResponse, IndexerServerListSubaccountsParams, IndexerServerListSubaccountsResponse, IndexerServerMakerStatisticsParams, IndexerServerMakerStatisticsResponse, IndexerServerMarketSnapshotsParams, IndexerServerMarketSnapshotsResponse, IndexerServerMatchEventsParams, IndexerServerMatchEventsResponse, IndexerServerMultiProductsParams, IndexerServerMultiProductsResponse, IndexerServerMultiSubaccountSnapshotsParams, IndexerServerMultiSubaccountSnapshotsResponse, IndexerServerNlpSnapshotsParams, IndexerServerNlpSnapshotsResponse, IndexerServerOraclePricesParams, IndexerServerOraclePricesResponse, IndexerServerOrdersParams, IndexerServerOrdersResponse, IndexerServerPerpPrices, IndexerServerPerpPricesParams, IndexerServerPerpPricesResponse, IndexerServerPriceParams, IndexerServerPriceResponse, IndexerServerProductsParams, IndexerServerProductsResponse, IndexerServerQueryRequestByType, IndexerServerQueryRequestType, IndexerServerQueryResponseByType, IndexerServerQuotePriceResponse, IndexerServerReferralCodeParams, IndexerServerReferralCodeResponse, IndexerServerTriggerTypeFilter, IndexerServerV2TickerResponse, IndexerServerV2TickersResponse };
|
|
347
|
+
export type { IndexerEdgeServerCandlesticksParams, IndexerEdgeServerCandlesticksResponse, IndexerEdgeServerMarketSnapshotsParams, IndexerEdgeServerMarketSnapshotsResponse, IndexerServerBacklogResponse, IndexerServerCandlesticksParams, IndexerServerCandlesticksResponse, IndexerServerDDAQueryParams, IndexerServerDDAResponse, IndexerServerEventsParams, IndexerServerEventsResponse, IndexerServerFastWithdrawalSignatureParams, IndexerServerFastWithdrawalSignatureResponse, IndexerServerFundingRate, IndexerServerFundingRateParams, IndexerServerFundingRateResponse, IndexerServerFundingRatesParams, IndexerServerFundingRatesResponse, IndexerServerInterestFundingParams, IndexerServerInterestFundingResponse, IndexerServerLeaderboardContestsParams, IndexerServerLeaderboardContestsResponse, IndexerServerLeaderboardParams, IndexerServerLeaderboardRankParams, IndexerServerLeaderboardRankResponse, IndexerServerLeaderboardRegistrationParams, IndexerServerLeaderboardRegistrationResponse, IndexerServerLeaderboardResponse, IndexerServerLinkedSignerParams, IndexerServerLinkedSignerResponse, IndexerServerListSubaccountsParams, IndexerServerListSubaccountsResponse, IndexerServerMakerStatisticsParams, IndexerServerMakerStatisticsResponse, IndexerServerMarketSnapshotsParams, IndexerServerMarketSnapshotsResponse, IndexerServerMatchEventsParams, IndexerServerMatchEventsResponse, IndexerServerMultiProductsParams, IndexerServerMultiProductsResponse, IndexerServerMultiSubaccountSnapshotsParams, IndexerServerMultiSubaccountSnapshotsResponse, IndexerServerNlpSnapshotsParams, IndexerServerNlpSnapshotsResponse, IndexerServerOraclePricesParams, IndexerServerOraclePricesResponse, IndexerServerOrdersParams, IndexerServerOrdersResponse, IndexerServerPerpPrices, IndexerServerPerpPricesParams, IndexerServerPerpPricesResponse, IndexerServerPriceParams, IndexerServerPriceResponse, IndexerServerPrivateAlphaChoiceParams, IndexerServerPrivateAlphaChoiceResponse, IndexerServerProductsParams, IndexerServerProductsResponse, IndexerServerQueryRequestByType, IndexerServerQueryRequestType, IndexerServerQueryResponseByType, IndexerServerQuotePriceResponse, IndexerServerReferralCodeParams, IndexerServerReferralCodeResponse, IndexerServerTriggerTypeFilter, IndexerServerV2TickerResponse, IndexerServerV2TickersResponse };
|
|
@@ -138,6 +138,9 @@ interface IndexerServerNlpSnapshotsParams {
|
|
|
138
138
|
interface IndexerServerDDAQueryParams {
|
|
139
139
|
subaccount: string;
|
|
140
140
|
}
|
|
141
|
+
interface IndexerServerPrivateAlphaChoiceParams {
|
|
142
|
+
address: string;
|
|
143
|
+
}
|
|
141
144
|
interface IndexerServerQueryRequestByType {
|
|
142
145
|
account_snapshots: IndexerServerMultiSubaccountSnapshotsParams;
|
|
143
146
|
backlog: Record<string, never>;
|
|
@@ -168,6 +171,7 @@ interface IndexerServerQueryRequestByType {
|
|
|
168
171
|
subaccounts: IndexerServerListSubaccountsParams;
|
|
169
172
|
quote_price: Record<string, never>;
|
|
170
173
|
nlp_snapshots: IndexerServerNlpSnapshotsParams;
|
|
174
|
+
private_alpha_choice: IndexerServerPrivateAlphaChoiceParams;
|
|
171
175
|
}
|
|
172
176
|
type IndexerServerQueryRequestType = keyof IndexerServerQueryRequestByType;
|
|
173
177
|
/**
|
|
@@ -281,6 +285,11 @@ interface IndexerServerBacklogResponse {
|
|
|
281
285
|
backlog_eta_in_seconds: string | null;
|
|
282
286
|
txs_per_second: string | null;
|
|
283
287
|
}
|
|
288
|
+
interface IndexerServerPrivateAlphaChoiceResponse {
|
|
289
|
+
points: string;
|
|
290
|
+
fee_refund: string;
|
|
291
|
+
nft_eligibility: boolean;
|
|
292
|
+
}
|
|
284
293
|
interface IndexerServerQueryResponseByType {
|
|
285
294
|
account_snapshots: IndexerServerMultiSubaccountSnapshotsResponse;
|
|
286
295
|
backlog: IndexerServerBacklogResponse;
|
|
@@ -311,6 +320,7 @@ interface IndexerServerQueryResponseByType {
|
|
|
311
320
|
subaccounts: IndexerServerListSubaccountsResponse;
|
|
312
321
|
quote_price: IndexerServerQuotePriceResponse;
|
|
313
322
|
nlp_snapshots: IndexerServerNlpSnapshotsResponse;
|
|
323
|
+
private_alpha_choice: IndexerServerPrivateAlphaChoiceResponse;
|
|
314
324
|
}
|
|
315
325
|
/**
|
|
316
326
|
* V2 API Types
|
|
@@ -334,4 +344,4 @@ interface IndexerServerV2TickerResponse {
|
|
|
334
344
|
*/
|
|
335
345
|
type IndexerServerV2TickersResponse = Record<string, IndexerServerV2TickerResponse>;
|
|
336
346
|
|
|
337
|
-
export type { IndexerEdgeServerCandlesticksParams, IndexerEdgeServerCandlesticksResponse, IndexerEdgeServerMarketSnapshotsParams, IndexerEdgeServerMarketSnapshotsResponse, IndexerServerBacklogResponse, IndexerServerCandlesticksParams, IndexerServerCandlesticksResponse, IndexerServerDDAQueryParams, IndexerServerDDAResponse, IndexerServerEventsParams, IndexerServerEventsResponse, IndexerServerFastWithdrawalSignatureParams, IndexerServerFastWithdrawalSignatureResponse, IndexerServerFundingRate, IndexerServerFundingRateParams, IndexerServerFundingRateResponse, IndexerServerFundingRatesParams, IndexerServerFundingRatesResponse, IndexerServerInterestFundingParams, IndexerServerInterestFundingResponse, IndexerServerLeaderboardContestsParams, IndexerServerLeaderboardContestsResponse, IndexerServerLeaderboardParams, IndexerServerLeaderboardRankParams, IndexerServerLeaderboardRankResponse, IndexerServerLeaderboardRegistrationParams, IndexerServerLeaderboardRegistrationResponse, IndexerServerLeaderboardResponse, IndexerServerLinkedSignerParams, IndexerServerLinkedSignerResponse, IndexerServerListSubaccountsParams, IndexerServerListSubaccountsResponse, IndexerServerMakerStatisticsParams, IndexerServerMakerStatisticsResponse, IndexerServerMarketSnapshotsParams, IndexerServerMarketSnapshotsResponse, IndexerServerMatchEventsParams, IndexerServerMatchEventsResponse, IndexerServerMultiProductsParams, IndexerServerMultiProductsResponse, IndexerServerMultiSubaccountSnapshotsParams, IndexerServerMultiSubaccountSnapshotsResponse, IndexerServerNlpSnapshotsParams, IndexerServerNlpSnapshotsResponse, IndexerServerOraclePricesParams, IndexerServerOraclePricesResponse, IndexerServerOrdersParams, IndexerServerOrdersResponse, IndexerServerPerpPrices, IndexerServerPerpPricesParams, IndexerServerPerpPricesResponse, IndexerServerPriceParams, IndexerServerPriceResponse, IndexerServerProductsParams, IndexerServerProductsResponse, IndexerServerQueryRequestByType, IndexerServerQueryRequestType, IndexerServerQueryResponseByType, IndexerServerQuotePriceResponse, IndexerServerReferralCodeParams, IndexerServerReferralCodeResponse, IndexerServerTriggerTypeFilter, IndexerServerV2TickerResponse, IndexerServerV2TickersResponse };
|
|
347
|
+
export type { IndexerEdgeServerCandlesticksParams, IndexerEdgeServerCandlesticksResponse, IndexerEdgeServerMarketSnapshotsParams, IndexerEdgeServerMarketSnapshotsResponse, IndexerServerBacklogResponse, IndexerServerCandlesticksParams, IndexerServerCandlesticksResponse, IndexerServerDDAQueryParams, IndexerServerDDAResponse, IndexerServerEventsParams, IndexerServerEventsResponse, IndexerServerFastWithdrawalSignatureParams, IndexerServerFastWithdrawalSignatureResponse, IndexerServerFundingRate, IndexerServerFundingRateParams, IndexerServerFundingRateResponse, IndexerServerFundingRatesParams, IndexerServerFundingRatesResponse, IndexerServerInterestFundingParams, IndexerServerInterestFundingResponse, IndexerServerLeaderboardContestsParams, IndexerServerLeaderboardContestsResponse, IndexerServerLeaderboardParams, IndexerServerLeaderboardRankParams, IndexerServerLeaderboardRankResponse, IndexerServerLeaderboardRegistrationParams, IndexerServerLeaderboardRegistrationResponse, IndexerServerLeaderboardResponse, IndexerServerLinkedSignerParams, IndexerServerLinkedSignerResponse, IndexerServerListSubaccountsParams, IndexerServerListSubaccountsResponse, IndexerServerMakerStatisticsParams, IndexerServerMakerStatisticsResponse, IndexerServerMarketSnapshotsParams, IndexerServerMarketSnapshotsResponse, IndexerServerMatchEventsParams, IndexerServerMatchEventsResponse, IndexerServerMultiProductsParams, IndexerServerMultiProductsResponse, IndexerServerMultiSubaccountSnapshotsParams, IndexerServerMultiSubaccountSnapshotsResponse, IndexerServerNlpSnapshotsParams, IndexerServerNlpSnapshotsResponse, IndexerServerOraclePricesParams, IndexerServerOraclePricesResponse, IndexerServerOrdersParams, IndexerServerOrdersResponse, IndexerServerPerpPrices, IndexerServerPerpPricesParams, IndexerServerPerpPricesResponse, IndexerServerPriceParams, IndexerServerPriceResponse, IndexerServerPrivateAlphaChoiceParams, IndexerServerPrivateAlphaChoiceResponse, IndexerServerProductsParams, IndexerServerProductsResponse, IndexerServerQueryRequestByType, IndexerServerQueryRequestType, IndexerServerQueryResponseByType, IndexerServerQuotePriceResponse, IndexerServerReferralCodeParams, IndexerServerReferralCodeResponse, IndexerServerTriggerTypeFilter, IndexerServerV2TickerResponse, IndexerServerV2TickersResponse };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadohq/indexer-client",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.44",
|
|
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.1.0-alpha.
|
|
45
|
-
"@nadohq/shared": "^0.1.0-alpha.
|
|
44
|
+
"@nadohq/engine-client": "^0.1.0-alpha.44",
|
|
45
|
+
"@nadohq/shared": "^0.1.0-alpha.44",
|
|
46
46
|
"axios": "*",
|
|
47
47
|
"ts-mixer": "*"
|
|
48
48
|
},
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"viem": "*"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "d2c756b567391feadc7653e5454b98c7563dd596"
|
|
56
56
|
}
|
package/src/IndexerBaseClient.ts
CHANGED
|
@@ -88,6 +88,8 @@ import {
|
|
|
88
88
|
GetIndexerOrdersResponse,
|
|
89
89
|
GetIndexerPerpPricesParams,
|
|
90
90
|
GetIndexerPerpPricesResponse,
|
|
91
|
+
GetIndexerPrivateAlphaChoiceParams,
|
|
92
|
+
GetIndexerPrivateAlphaChoiceResponse,
|
|
91
93
|
GetIndexerProductSnapshotsParams,
|
|
92
94
|
GetIndexerProductSnapshotsResponse,
|
|
93
95
|
GetIndexerQuotePriceResponse,
|
|
@@ -522,6 +524,8 @@ export class IndexerBaseClient {
|
|
|
522
524
|
postBalances,
|
|
523
525
|
tx,
|
|
524
526
|
isTaker: matchEvent.is_taker,
|
|
527
|
+
realizedPnl: toBigDecimal(matchEvent.realized_pnl),
|
|
528
|
+
closedSize: toBigDecimal(matchEvent.closed_amount),
|
|
525
529
|
...subaccountFromHex(matchEvent.order.sender),
|
|
526
530
|
};
|
|
527
531
|
});
|
|
@@ -831,6 +835,24 @@ export class IndexerBaseClient {
|
|
|
831
835
|
};
|
|
832
836
|
}
|
|
833
837
|
|
|
838
|
+
/**
|
|
839
|
+
* Retrieves private alpha choice information for a given address
|
|
840
|
+
* @param params
|
|
841
|
+
*/
|
|
842
|
+
async getPrivateAlphaChoice(
|
|
843
|
+
params: GetIndexerPrivateAlphaChoiceParams,
|
|
844
|
+
): Promise<GetIndexerPrivateAlphaChoiceResponse> {
|
|
845
|
+
const baseResponse = await this.query('private_alpha_choice', {
|
|
846
|
+
address: params.address,
|
|
847
|
+
});
|
|
848
|
+
|
|
849
|
+
return {
|
|
850
|
+
points: toBigDecimal(baseResponse.points),
|
|
851
|
+
feeRefund: toBigDecimal(baseResponse.fee_refund),
|
|
852
|
+
nftEligibility: baseResponse.nft_eligibility,
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
|
|
834
856
|
/**
|
|
835
857
|
* Get tickers from the v2 indexer endpoint
|
|
836
858
|
* @param params
|
package/src/dataMappers.ts
CHANGED
|
@@ -107,6 +107,8 @@ export function mapIndexerOrder(order: IndexerServerOrder): IndexerOrder {
|
|
|
107
107
|
baseFilled: toBigDecimal(order.base_filled),
|
|
108
108
|
quoteFilled: toBigDecimal(order.quote_filled),
|
|
109
109
|
totalFee: toBigDecimal(order.fee),
|
|
110
|
+
realizedPnl: toBigDecimal(order.realized_pnl),
|
|
111
|
+
closedSize: toBigDecimal(order.closed_amount),
|
|
110
112
|
};
|
|
111
113
|
}
|
|
112
114
|
|
package/src/types/clientTypes.ts
CHANGED
|
@@ -371,6 +371,9 @@ export interface IndexerOrder {
|
|
|
371
371
|
quoteFilled: BigDecimal;
|
|
372
372
|
// Includes sequencer fee
|
|
373
373
|
totalFee: BigDecimal;
|
|
374
|
+
realizedPnl: BigDecimal;
|
|
375
|
+
// Always positive
|
|
376
|
+
closedSize: BigDecimal;
|
|
374
377
|
}
|
|
375
378
|
|
|
376
379
|
export type GetIndexerOrdersResponse = IndexerOrder[];
|
|
@@ -421,6 +424,9 @@ export interface IndexerMatchEvent extends Subaccount {
|
|
|
421
424
|
preBalances: IndexerMatchEventBalances;
|
|
422
425
|
postBalances: IndexerMatchEventBalances;
|
|
423
426
|
tx: NadoTx;
|
|
427
|
+
realizedPnl: BigDecimal;
|
|
428
|
+
// Always positive
|
|
429
|
+
closedSize: BigDecimal;
|
|
424
430
|
}
|
|
425
431
|
|
|
426
432
|
export type GetIndexerMatchEventsResponse = IndexerMatchEvent[];
|
|
@@ -690,6 +696,20 @@ export interface GetIndexerSubaccountDDAResponse {
|
|
|
690
696
|
address: Address;
|
|
691
697
|
}
|
|
692
698
|
|
|
699
|
+
/**
|
|
700
|
+
* Private Alpha Choice
|
|
701
|
+
*/
|
|
702
|
+
|
|
703
|
+
export interface GetIndexerPrivateAlphaChoiceParams {
|
|
704
|
+
address: Address;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
export interface GetIndexerPrivateAlphaChoiceResponse {
|
|
708
|
+
points: BigDecimal;
|
|
709
|
+
feeRefund: BigDecimal;
|
|
710
|
+
nftEligibility: boolean;
|
|
711
|
+
}
|
|
712
|
+
|
|
693
713
|
/**
|
|
694
714
|
* V2 Tickers
|
|
695
715
|
*/
|
|
@@ -109,6 +109,8 @@ export interface IndexerServerOrder {
|
|
|
109
109
|
quote_filled: string;
|
|
110
110
|
// Includes sequencer fee
|
|
111
111
|
fee: string;
|
|
112
|
+
realized_pnl: string;
|
|
113
|
+
closed_amount: string;
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
/**
|
|
@@ -134,6 +136,8 @@ export interface IndexerServerMatchEvent {
|
|
|
134
136
|
pre_balance: IndexerServerMatchEventBalances;
|
|
135
137
|
post_balance: IndexerServerMatchEventBalances;
|
|
136
138
|
is_taker: boolean;
|
|
139
|
+
realized_pnl: string;
|
|
140
|
+
closed_amount: string;
|
|
137
141
|
}
|
|
138
142
|
|
|
139
143
|
export interface IndexerServerMatchEventBalances {
|
package/src/types/serverTypes.ts
CHANGED
|
@@ -207,6 +207,10 @@ export interface IndexerServerDDAQueryParams {
|
|
|
207
207
|
subaccount: string;
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
+
export interface IndexerServerPrivateAlphaChoiceParams {
|
|
211
|
+
address: string;
|
|
212
|
+
}
|
|
213
|
+
|
|
210
214
|
// Request
|
|
211
215
|
export interface IndexerServerQueryRequestByType {
|
|
212
216
|
account_snapshots: IndexerServerMultiSubaccountSnapshotsParams;
|
|
@@ -238,6 +242,7 @@ export interface IndexerServerQueryRequestByType {
|
|
|
238
242
|
subaccounts: IndexerServerListSubaccountsParams;
|
|
239
243
|
quote_price: Record<string, never>;
|
|
240
244
|
nlp_snapshots: IndexerServerNlpSnapshotsParams;
|
|
245
|
+
private_alpha_choice: IndexerServerPrivateAlphaChoiceParams;
|
|
241
246
|
}
|
|
242
247
|
|
|
243
248
|
export type IndexerServerQueryRequestType =
|
|
@@ -412,6 +417,12 @@ export interface IndexerServerBacklogResponse {
|
|
|
412
417
|
txs_per_second: string | null;
|
|
413
418
|
}
|
|
414
419
|
|
|
420
|
+
export interface IndexerServerPrivateAlphaChoiceResponse {
|
|
421
|
+
points: string;
|
|
422
|
+
fee_refund: string;
|
|
423
|
+
nft_eligibility: boolean;
|
|
424
|
+
}
|
|
425
|
+
|
|
415
426
|
// Response
|
|
416
427
|
export interface IndexerServerQueryResponseByType {
|
|
417
428
|
account_snapshots: IndexerServerMultiSubaccountSnapshotsResponse;
|
|
@@ -443,6 +454,7 @@ export interface IndexerServerQueryResponseByType {
|
|
|
443
454
|
subaccounts: IndexerServerListSubaccountsResponse;
|
|
444
455
|
quote_price: IndexerServerQuotePriceResponse;
|
|
445
456
|
nlp_snapshots: IndexerServerNlpSnapshotsResponse;
|
|
457
|
+
private_alpha_choice: IndexerServerPrivateAlphaChoiceResponse;
|
|
446
458
|
}
|
|
447
459
|
|
|
448
460
|
/**
|