@nadohq/indexer-client 0.1.0-alpha.12 → 0.1.0-alpha.14
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 +1 -0
- package/dist/IndexerBaseClient.cjs.map +1 -1
- package/dist/IndexerBaseClient.js +1 -0
- package/dist/IndexerBaseClient.js.map +1 -1
- package/dist/IndexerClient.cjs +5 -4
- package/dist/IndexerClient.cjs.map +1 -1
- package/dist/IndexerClient.js +5 -2
- package/dist/IndexerClient.js.map +1 -1
- package/dist/dataMappers.d.cts +1 -1
- package/dist/dataMappers.d.ts +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/types/clientTypes.cjs.map +1 -1
- package/dist/types/clientTypes.d.cts +2 -1
- package/dist/types/clientTypes.d.ts +2 -1
- package/dist/types/index.cjs +11 -11
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +5 -5
- package/dist/types/index.d.ts +5 -5
- package/dist/types/index.js +5 -5
- package/dist/types/index.js.map +1 -1
- package/dist/types/paginatedEventsTypes.cjs.map +1 -1
- package/dist/types/paginatedEventsTypes.d.cts +6 -6
- package/dist/types/paginatedEventsTypes.d.ts +6 -6
- package/dist/types/serverTypes.cjs.map +1 -1
- package/dist/types/serverTypes.d.cts +3 -1
- package/dist/types/serverTypes.d.ts +3 -1
- package/package.json +4 -4
- package/src/IndexerBaseClient.ts +1 -0
- package/src/IndexerClient.ts +8 -5
- package/src/index.ts +2 -2
- package/src/types/clientTypes.ts +2 -0
- package/src/types/index.ts +5 -5
- package/src/types/paginatedEventsTypes.ts +1 -1
- package/src/types/serverTypes.ts +7 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/paginatedEventsTypes.ts"],"sourcesContent":["import { BigDecimal, Subaccount } from '@nadohq/shared';\nimport {\n GetIndexerInterestFundingPaymentsParams,\n GetIndexerInterestFundingPaymentsResponse,\n GetIndexerLeaderboardParams,\n GetIndexerLeaderboardResponse,\n GetIndexerMatchEventsParams,\n GetIndexerOrdersParams,\n IndexerEventBalanceStateSnapshot,\n IndexerEventPerpStateSnapshot,\n IndexerEventSpotStateSnapshot,\n IndexerEventWithTx,\n IndexerMatchEvent,\n IndexerOrder,\n} from './clientTypes';\nimport { CollateralEventType } from './collateralEventType';\nimport { NadoTx } from './NadoTx';\n\nexport interface IndexerPaginationParams {\n limit: number;\n // Retrieves events inclusive of this start cursor\n startCursor?: string;\n}\n\nexport interface IndexerPaginationMeta {\n hasMore: boolean;\n nextCursor?: string;\n}\n\nexport type WithPaginationMeta = { meta: IndexerPaginationMeta };\n\ntype BaseSubaccountPaginationParams = Subaccount &\n IndexerPaginationParams & {\n /**\n * If provided, only events with a timestamp in seconds <= this value will be returned\n * Specifying `startCursor` will supercede this value\n */\n maxTimestampInclusive?: number;\n };\n\nexport interface BaseIndexerPaginatedEvent extends Subaccount {\n timestamp: BigDecimal;\n submissionIndex: string;\n tx: NadoTx;\n}\n\nexport interface PaginatedIndexerEventsResponse<\n T extends BaseIndexerPaginatedEvent,\n> extends WithPaginationMeta {\n events: T[];\n}\n\n/**\n * Collateral\n */\n\nexport interface GetIndexerSubaccountCollateralEventsParams\n extends BaseSubaccountPaginationParams {\n eventTypes?: CollateralEventType[];\n // If not given, will return both isolated & non-iso events\n isolated?: boolean;\n}\n\nexport interface IndexerCollateralEvent extends BaseIndexerPaginatedEvent {\n eventType: CollateralEventType;\n // Positive for deposits, negative for withdrawals\n amount: BigDecimal;\n // The collateral balance after the event\n newAmount: BigDecimal;\n snapshot: IndexerEventSpotStateSnapshot;\n}\n\nexport type GetIndexerSubaccountCollateralEventsResponse =\n PaginatedIndexerEventsResponse<IndexerCollateralEvent>;\n\n/**\n * NLP\n */\nexport type GetIndexerSubaccountNlpEventsParams =\n BaseSubaccountPaginationParams;\n\nexport interface IndexerNlpEvent extends BaseIndexerPaginatedEvent {\n nlpDelta: BigDecimal;\n primaryQuoteDelta: BigDecimal;\n}\n\nexport type GetIndexerSubaccountNlpEventsResponse =\n PaginatedIndexerEventsResponse<IndexerNlpEvent>;\n\n/**\n * Match events\n */\n\nexport type GetIndexerSubaccountMatchEventParams =\n BaseSubaccountPaginationParams &\n Pick<GetIndexerMatchEventsParams, 'productIds' | 'isolated'>;\n\nexport type GetIndexerSubaccountMatchEventsResponse =\n PaginatedIndexerEventsResponse<IndexerMatchEvent>;\n\n/**\n * Orders\n */\n\nexport type GetIndexerPaginatedOrdersParams = BaseSubaccountPaginationParams &\n Pick<GetIndexerOrdersParams, 'productIds' | 'isolated'>;\n\nexport interface GetIndexerPaginatedOrdersResponse {\n orders: IndexerOrder[];\n meta: IndexerPaginationMeta;\n}\n\n/**\n * Liquidations\n */\n\nexport type GetIndexerSubaccountLiquidationEventsParams =\n BaseSubaccountPaginationParams;\n\ntype WithIndexerEvent<\n TData,\n TStateType extends IndexerEventBalanceStateSnapshot,\n> = TData & {\n indexerEvent: IndexerEventWithTx<TStateType>;\n};\n\nexport interface IndexerLiquidationEvent extends BaseIndexerPaginatedEvent {\n // Either spot or perp will then be liquidated if the subaccount maint. health is below 0\n // Both spot & perp can be liquidated in the same event from a spread liquidation\n spot?: WithIndexerEvent<\n {\n // The original balance that was liquidated\n // ex. if it was originally a short, amount is negative, but the net delta from the liquidation is positive\n amountLiquidated: BigDecimal;\n },\n IndexerEventSpotStateSnapshot\n >;\n perp?: WithIndexerEvent<\n {\n // The original balance that was liquidated\n // ex. if it was originally a short, amount is negative, but the net delta from the liquidation is positive\n amountLiquidated: BigDecimal;\n },\n IndexerEventPerpStateSnapshot\n >;\n // Quote delta for the subaccount\n // Only the SPOT QUOTE payment made for the liquidation. Does not include the perp vQuote balance change\n quote: WithIndexerEvent<\n {\n balanceDelta: BigDecimal;\n },\n IndexerEventSpotStateSnapshot\n >;\n}\n\nexport type GetIndexerSubaccountLiquidationEventsResponse =\n PaginatedIndexerEventsResponse<IndexerLiquidationEvent>;\n\n/**\n * Settlement\n */\n\nexport type GetIndexerSubaccountSettlementEventsParams =\n BaseSubaccountPaginationParams;\n\nexport interface IndexerSettlementEvent extends BaseIndexerPaginatedEvent {\n // Quote delta for the subaccount being settled\n quoteDelta: BigDecimal;\n snapshot: IndexerEventPerpStateSnapshot;\n isolated: boolean;\n}\n\nexport type GetIndexerSubaccountSettlementEventsResponse =\n PaginatedIndexerEventsResponse<IndexerSettlementEvent>;\n\n/**\n * Interest / Funding\n */\n\nexport type GetIndexerSubaccountInterestFundingPaymentsParams =\n BaseSubaccountPaginationParams &\n Pick<GetIndexerInterestFundingPaymentsParams, 'productIds' | 'startCursor'>;\n\nexport interface GetIndexerPaginatedInterestFundingPaymentsResponse\n extends GetIndexerInterestFundingPaymentsResponse {\n meta: IndexerPaginationMeta;\n}\n\nexport type GetIndexerPaginatedLeaderboardParams = IndexerPaginationParams &\n Pick<GetIndexerLeaderboardParams, 'contestId' | 'rankType'>;\n\nexport type GetIndexerPaginatedLeaderboardResponse = WithPaginationMeta &\n GetIndexerLeaderboardResponse;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/types/paginatedEventsTypes.ts"],"sourcesContent":["import { BigDecimal, Subaccount } from '@nadohq/shared';\nimport {\n GetIndexerInterestFundingPaymentsParams,\n GetIndexerInterestFundingPaymentsResponse,\n GetIndexerLeaderboardParams,\n GetIndexerLeaderboardResponse,\n GetIndexerMatchEventsParams,\n GetIndexerOrdersParams,\n IndexerEventBalanceStateSnapshot,\n IndexerEventPerpStateSnapshot,\n IndexerEventSpotStateSnapshot,\n IndexerEventWithTx,\n IndexerMatchEvent,\n IndexerOrder,\n} from './clientTypes';\nimport { CollateralEventType } from './collateralEventType';\nimport { NadoTx } from './NadoTx';\n\nexport interface IndexerPaginationParams {\n limit: number;\n // Retrieves events inclusive of this start cursor\n startCursor?: string;\n}\n\nexport interface IndexerPaginationMeta {\n hasMore: boolean;\n nextCursor?: string;\n}\n\nexport type WithPaginationMeta = { meta: IndexerPaginationMeta };\n\ntype BaseSubaccountPaginationParams = Subaccount &\n IndexerPaginationParams & {\n /**\n * If provided, only events with a timestamp in seconds <= this value will be returned\n * Specifying `startCursor` will supercede this value\n */\n maxTimestampInclusive?: number;\n };\n\nexport interface BaseIndexerPaginatedEvent extends Subaccount {\n timestamp: BigDecimal;\n submissionIndex: string;\n tx: NadoTx;\n}\n\nexport interface PaginatedIndexerEventsResponse<\n T extends BaseIndexerPaginatedEvent,\n> extends WithPaginationMeta {\n events: T[];\n}\n\n/**\n * Collateral\n */\n\nexport interface GetIndexerSubaccountCollateralEventsParams\n extends BaseSubaccountPaginationParams {\n eventTypes?: CollateralEventType[];\n // If not given, will return both isolated & non-iso events\n isolated?: boolean;\n}\n\nexport interface IndexerCollateralEvent extends BaseIndexerPaginatedEvent {\n eventType: CollateralEventType;\n // Positive for deposits, negative for withdrawals\n amount: BigDecimal;\n // The collateral balance after the event\n newAmount: BigDecimal;\n snapshot: IndexerEventSpotStateSnapshot;\n}\n\nexport type GetIndexerSubaccountCollateralEventsResponse =\n PaginatedIndexerEventsResponse<IndexerCollateralEvent>;\n\n/**\n * NLP\n */\nexport type GetIndexerSubaccountNlpEventsParams =\n BaseSubaccountPaginationParams;\n\nexport interface IndexerNlpEvent extends BaseIndexerPaginatedEvent {\n nlpDelta: BigDecimal;\n primaryQuoteDelta: BigDecimal;\n}\n\nexport type GetIndexerSubaccountNlpEventsResponse =\n PaginatedIndexerEventsResponse<IndexerNlpEvent>;\n\n/**\n * Match events\n */\n\nexport type GetIndexerSubaccountMatchEventParams =\n BaseSubaccountPaginationParams &\n Pick<GetIndexerMatchEventsParams, 'productIds' | 'isolated'>;\n\nexport type GetIndexerSubaccountMatchEventsResponse =\n PaginatedIndexerEventsResponse<IndexerMatchEvent>;\n\n/**\n * Orders\n */\n\nexport type GetIndexerPaginatedOrdersParams = BaseSubaccountPaginationParams &\n Pick<GetIndexerOrdersParams, 'productIds' | 'triggerTypes' | 'isolated'>;\n\nexport interface GetIndexerPaginatedOrdersResponse {\n orders: IndexerOrder[];\n meta: IndexerPaginationMeta;\n}\n\n/**\n * Liquidations\n */\n\nexport type GetIndexerSubaccountLiquidationEventsParams =\n BaseSubaccountPaginationParams;\n\ntype WithIndexerEvent<\n TData,\n TStateType extends IndexerEventBalanceStateSnapshot,\n> = TData & {\n indexerEvent: IndexerEventWithTx<TStateType>;\n};\n\nexport interface IndexerLiquidationEvent extends BaseIndexerPaginatedEvent {\n // Either spot or perp will then be liquidated if the subaccount maint. health is below 0\n // Both spot & perp can be liquidated in the same event from a spread liquidation\n spot?: WithIndexerEvent<\n {\n // The original balance that was liquidated\n // ex. if it was originally a short, amount is negative, but the net delta from the liquidation is positive\n amountLiquidated: BigDecimal;\n },\n IndexerEventSpotStateSnapshot\n >;\n perp?: WithIndexerEvent<\n {\n // The original balance that was liquidated\n // ex. if it was originally a short, amount is negative, but the net delta from the liquidation is positive\n amountLiquidated: BigDecimal;\n },\n IndexerEventPerpStateSnapshot\n >;\n // Quote delta for the subaccount\n // Only the SPOT QUOTE payment made for the liquidation. Does not include the perp vQuote balance change\n quote: WithIndexerEvent<\n {\n balanceDelta: BigDecimal;\n },\n IndexerEventSpotStateSnapshot\n >;\n}\n\nexport type GetIndexerSubaccountLiquidationEventsResponse =\n PaginatedIndexerEventsResponse<IndexerLiquidationEvent>;\n\n/**\n * Settlement\n */\n\nexport type GetIndexerSubaccountSettlementEventsParams =\n BaseSubaccountPaginationParams;\n\nexport interface IndexerSettlementEvent extends BaseIndexerPaginatedEvent {\n // Quote delta for the subaccount being settled\n quoteDelta: BigDecimal;\n snapshot: IndexerEventPerpStateSnapshot;\n isolated: boolean;\n}\n\nexport type GetIndexerSubaccountSettlementEventsResponse =\n PaginatedIndexerEventsResponse<IndexerSettlementEvent>;\n\n/**\n * Interest / Funding\n */\n\nexport type GetIndexerSubaccountInterestFundingPaymentsParams =\n BaseSubaccountPaginationParams &\n Pick<GetIndexerInterestFundingPaymentsParams, 'productIds' | 'startCursor'>;\n\nexport interface GetIndexerPaginatedInterestFundingPaymentsResponse\n extends GetIndexerInterestFundingPaymentsResponse {\n meta: IndexerPaginationMeta;\n}\n\nexport type GetIndexerPaginatedLeaderboardParams = IndexerPaginationParams &\n Pick<GetIndexerLeaderboardParams, 'contestId' | 'rankType'>;\n\nexport type GetIndexerPaginatedLeaderboardResponse = WithPaginationMeta &\n GetIndexerLeaderboardResponse;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import './CandlestickPeriod.cjs';
|
|
1
2
|
import { GetIndexerMatchEventsParams, IndexerMatchEvent, IndexerEventSpotStateSnapshot, GetIndexerOrdersParams, IndexerOrder, IndexerEventPerpStateSnapshot, IndexerEventBalanceStateSnapshot, IndexerEventWithTx, GetIndexerInterestFundingPaymentsParams, GetIndexerInterestFundingPaymentsResponse, GetIndexerLeaderboardParams, GetIndexerLeaderboardResponse } from './clientTypes.cjs';
|
|
2
|
-
import { Subaccount, BigDecimal } from '@nadohq/shared';
|
|
3
3
|
import { CollateralEventType } from './collateralEventType.cjs';
|
|
4
|
-
import { NadoTx } from './NadoTx.cjs';
|
|
5
|
-
import './serverTypes.cjs';
|
|
6
|
-
import './serverModelTypes.cjs';
|
|
7
|
-
import './CandlestickPeriod.cjs';
|
|
8
4
|
import './IndexerEventType.cjs';
|
|
9
5
|
import './IndexerLeaderboardType.cjs';
|
|
6
|
+
import { NadoTx } from './NadoTx.cjs';
|
|
7
|
+
import { Subaccount, BigDecimal } from '@nadohq/shared';
|
|
8
|
+
import './serverModelTypes.cjs';
|
|
9
|
+
import './serverTypes.cjs';
|
|
10
10
|
import 'viem';
|
|
11
11
|
import '@nadohq/engine-client';
|
|
12
12
|
|
|
@@ -67,7 +67,7 @@ type GetIndexerSubaccountMatchEventsResponse = PaginatedIndexerEventsResponse<In
|
|
|
67
67
|
/**
|
|
68
68
|
* Orders
|
|
69
69
|
*/
|
|
70
|
-
type GetIndexerPaginatedOrdersParams = BaseSubaccountPaginationParams & Pick<GetIndexerOrdersParams, 'productIds' | 'isolated'>;
|
|
70
|
+
type GetIndexerPaginatedOrdersParams = BaseSubaccountPaginationParams & Pick<GetIndexerOrdersParams, 'productIds' | 'triggerTypes' | 'isolated'>;
|
|
71
71
|
interface GetIndexerPaginatedOrdersResponse {
|
|
72
72
|
orders: IndexerOrder[];
|
|
73
73
|
meta: IndexerPaginationMeta;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import './CandlestickPeriod.js';
|
|
1
2
|
import { GetIndexerMatchEventsParams, IndexerMatchEvent, IndexerEventSpotStateSnapshot, GetIndexerOrdersParams, IndexerOrder, IndexerEventPerpStateSnapshot, IndexerEventBalanceStateSnapshot, IndexerEventWithTx, GetIndexerInterestFundingPaymentsParams, GetIndexerInterestFundingPaymentsResponse, GetIndexerLeaderboardParams, GetIndexerLeaderboardResponse } from './clientTypes.js';
|
|
2
|
-
import { Subaccount, BigDecimal } from '@nadohq/shared';
|
|
3
3
|
import { CollateralEventType } from './collateralEventType.js';
|
|
4
|
-
import { NadoTx } from './NadoTx.js';
|
|
5
|
-
import './serverTypes.js';
|
|
6
|
-
import './serverModelTypes.js';
|
|
7
|
-
import './CandlestickPeriod.js';
|
|
8
4
|
import './IndexerEventType.js';
|
|
9
5
|
import './IndexerLeaderboardType.js';
|
|
6
|
+
import { NadoTx } from './NadoTx.js';
|
|
7
|
+
import { Subaccount, BigDecimal } from '@nadohq/shared';
|
|
8
|
+
import './serverModelTypes.js';
|
|
9
|
+
import './serverTypes.js';
|
|
10
10
|
import 'viem';
|
|
11
11
|
import '@nadohq/engine-client';
|
|
12
12
|
|
|
@@ -67,7 +67,7 @@ type GetIndexerSubaccountMatchEventsResponse = PaginatedIndexerEventsResponse<In
|
|
|
67
67
|
/**
|
|
68
68
|
* Orders
|
|
69
69
|
*/
|
|
70
|
-
type GetIndexerPaginatedOrdersParams = BaseSubaccountPaginationParams & Pick<GetIndexerOrdersParams, 'productIds' | 'isolated'>;
|
|
70
|
+
type GetIndexerPaginatedOrdersParams = BaseSubaccountPaginationParams & Pick<GetIndexerOrdersParams, 'productIds' | 'triggerTypes' | 'isolated'>;
|
|
71
71
|
interface GetIndexerPaginatedOrdersResponse {
|
|
72
72
|
orders: IndexerOrder[];
|
|
73
73
|
meta: IndexerPaginationMeta;
|
|
@@ -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 IndexerServerOraclePrice,\n IndexerServerOrder,\n IndexerServerProductPayment,\n IndexerServerProductSnapshot,\n IndexerServerSnapshotsInterval,\n IndexerServerTx,\n IndexerServerNlpSnapshot,\n} from './serverModelTypes';\n\n/**\n * Params\n */\n\nexport interface IndexerServerListSubaccountsParams {\n // Inclusive, defaults to 0\n start?: number;\n // Defaults to 100\n limit?: number;\n address?: string;\n}\n\nexport interface IndexerServerMultiSubaccountSnapshotsParams {\n // Subaccount hex identifiers\n subaccounts: string[];\n timestamps: number[];\n // If not given, will return both isolated & non-iso balances\n isolated?: boolean;\n}\n\nexport interface IndexerServerReferralCodeParams {\n subaccount: string;\n}\n\nexport interface IndexerServerFundingRateParams {\n product_id: number;\n}\n\nexport interface IndexerServerFundingRatesParams {\n product_ids: number[];\n}\n\nexport interface IndexerServerPriceParams {\n product_id: number;\n}\n\nexport interface IndexerServerPerpPricesParams {\n product_ids: number[];\n}\n\nexport interface IndexerServerOraclePricesParams {\n product_ids: number[];\n}\n\nexport interface IndexerServerCandlesticksParams {\n product_id: number;\n granularity: number;\n // Seconds\n max_time?: number;\n limit: number;\n}\n\nexport type IndexerEdgeServerCandlesticksParams =\n IndexerServerCandlesticksParams;\n\nexport interface IndexerServerProductsParams {\n product_id: number;\n max_time?: number;\n limit: number;\n // submission_idx for pagination, inclusive\n idx?: string;\n}\n\nexport interface IndexerServerMultiProductsParams {\n product_ids: number[];\n max_time: number[];\n}\n\nexport interface IndexerServerEventsParams {\n subaccount?: string;\n product_ids?: number[];\n // If not given, will return both isolated & non-iso events\n isolated?: boolean;\n event_types?: IndexerEventType[];\n // Descending order for idx (time), defaults to true\n desc?: boolean;\n // submission_idx for pagination, inclusive\n idx?: string;\n max_time?: number;\n limit?:\n | {\n raw: number;\n }\n | {\n txs: number;\n };\n}\n\nexport interface IndexerServerOrdersParams {\n subaccount?: string;\n product_ids?: number[];\n digests?: string[];\n max_time?: number;\n limit?: number;\n // If not given, will return both isolated & non-iso orders\n isolated?: boolean;\n // submission_idx for pagination, inclusive\n idx?: string;\n}\n\nexport interface IndexerServerMatchEventsParams {\n subaccount?: string;\n product_ids?: number[];\n // If not given, will return both isolated & non-iso events\n isolated?: boolean;\n max_time?: number;\n limit: number;\n // submission_idx for pagination, inclusive\n idx?: string;\n}\n\nexport interface IndexerServerLinkedSignerParams {\n subaccount: string;\n}\n\nexport interface IndexerServerMarketSnapshotsParams {\n interval: IndexerServerMarketSnapshotInterval;\n // Defaults to all\n product_ids?: number[];\n}\n\nexport interface IndexerEdgeServerMarketSnapshotsParams {\n interval: IndexerServerMarketSnapshotInterval;\n}\n\nexport interface IndexerServerInterestFundingParams {\n subaccount: string;\n product_ids: number[];\n // If not given, defaults to latest\n max_idx?: string;\n max_time?: number;\n limit: number;\n}\n\nexport interface IndexerServerMakerStatisticsParams {\n product_id: number;\n epoch: number;\n interval: number;\n}\n\nexport interface IndexerServerLeaderboardParams {\n contest_id: number;\n rank_type: IndexerLeaderboardRankType;\n start?: number | string;\n limit?: number | string;\n}\n\nexport interface IndexerServerLeaderboardRankParams {\n subaccount: string;\n contest_ids: number[];\n}\n\nexport interface IndexerServerLeaderboardContestsParams {\n contest_ids: number[];\n}\n\nexport interface IndexerServerLeaderboardRegistrationParams {\n subaccount: string;\n contest_id: number;\n update_registration: SignedTx<EIP712LeaderboardAuthenticationValues> | null;\n}\n\nexport interface IndexerServerFastWithdrawalSignatureParams {\n /**\n * The submission index of the WithdrawCollateral tx to be used for fast withdraw.\n */\n idx: number | string;\n}\n\nexport interface IndexerServerNlpSnapshotsParams {\n interval: IndexerServerSnapshotsInterval;\n}\n\nexport interface IndexerServerDDAQueryParams {\n subaccount: string;\n}\n\n// Request\nexport interface IndexerServerQueryRequestByType {\n account_snapshots: IndexerServerMultiSubaccountSnapshotsParams;\n backlog: Record<string, never>;\n candlesticks: IndexerServerCandlesticksParams;\n direct_deposit_address: IndexerServerDDAQueryParams;\n edge_candlesticks: IndexerEdgeServerCandlesticksParams;\n edge_market_snapshots: IndexerEdgeServerMarketSnapshotsParams;\n events: IndexerServerEventsParams;\n fast_withdrawal_signature: IndexerServerFastWithdrawalSignatureParams;\n funding_rate: IndexerServerFundingRateParams;\n funding_rates: IndexerServerFundingRatesParams;\n interest_and_funding: IndexerServerInterestFundingParams;\n leaderboard: IndexerServerLeaderboardParams;\n leaderboard_contests: IndexerServerLeaderboardContestsParams;\n leaderboard_rank: IndexerServerLeaderboardRankParams;\n leaderboard_registration: IndexerServerLeaderboardRegistrationParams;\n linked_signer_rate_limit: IndexerServerLinkedSignerParams;\n maker_statistics: IndexerServerMakerStatisticsParams;\n market_snapshots: IndexerServerMarketSnapshotsParams;\n matches: IndexerServerMatchEventsParams;\n oracle_price: IndexerServerOraclePricesParams;\n orders: IndexerServerOrdersParams;\n perp_prices: IndexerServerPerpPricesParams;\n price: IndexerServerPriceParams;\n product_snapshots: IndexerServerMultiProductsParams;\n products: IndexerServerProductsParams;\n referral_code: IndexerServerReferralCodeParams;\n subaccounts: IndexerServerListSubaccountsParams;\n usdc_price: Record<string, never>;\n nlp_snapshots: IndexerServerNlpSnapshotsParams;\n}\n\nexport type IndexerServerQueryRequestType =\n keyof IndexerServerQueryRequestByType;\n\n/**\n * Responses\n */\n\nexport interface IndexerServerListSubaccountsResponse {\n subaccounts: {\n id: string;\n // Hex of subaccount bytes\n subaccount: string;\n }[];\n}\n\nexport interface IndexerServerMultiSubaccountSnapshotsResponse {\n // Map of subaccount hex -> timestamp requested -> latest events corresponding to each product\n snapshots: Record<string, Record<string, IndexerServerEvent[]>>;\n}\n\nexport interface IndexerServerReferralCodeResponse {\n referral_code: string | null;\n}\n\nexport interface IndexerServerFundingRate {\n product_id: number;\n funding_rate_x18: string;\n update_time: number;\n}\n\nexport type IndexerServerFundingRateResponse = IndexerServerFundingRate;\n\n// Map of productId -> IndexerServerFundingRate\nexport type IndexerServerFundingRatesResponse = Record<\n string,\n IndexerServerFundingRate\n>;\n\nexport interface IndexerServerPerpPrices {\n product_id: number;\n index_price_x18: string;\n mark_price_x18: string;\n update_time: number;\n}\n\nexport type IndexerServerPriceResponse = IndexerServerPerpPrices;\n\n// Map of productId -> IndexerServerPerpPrices\nexport type IndexerServerPerpPricesResponse = Record<\n string,\n IndexerServerPerpPrices\n>;\n\nexport interface IndexerServerOraclePricesResponse {\n prices: IndexerServerOraclePrice[];\n}\n\nexport interface IndexerServerCandlesticksResponse {\n candlesticks: IndexerServerCandlestick[];\n}\n\nexport type IndexerEdgeServerCandlesticksResponse =\n IndexerServerCandlesticksResponse;\n\nexport interface IndexerServerProductsResponse {\n products: IndexerServerProductSnapshot[];\n txs: IndexerServerTx[];\n}\n\n// Map of timestamp -> (productID -> IndexerServerProductSnapshot)\nexport type IndexerServerMultiProductsResponse = Record<\n string,\n Record<string, IndexerServerProductSnapshot>\n>;\n\nexport interface IndexerServerEventsResponse {\n events: IndexerServerEvent[];\n txs: IndexerServerTx[];\n}\n\nexport interface IndexerServerOrdersResponse {\n orders: IndexerServerOrder[];\n}\n\nexport interface IndexerServerMatchEventsResponse {\n matches: IndexerServerMatchEvent[];\n txs: IndexerServerTx[];\n}\n\nexport interface IndexerServerUsdcPriceResponse {\n price_x18: string;\n}\n\nexport interface IndexerServerLinkedSignerResponse {\n total_tx_limit: string;\n remaining_tx: string;\n wait_time: string;\n signer: string;\n}\n\nexport interface IndexerServerMarketSnapshotsResponse {\n snapshots: IndexerServerMarketSnapshot[];\n}\n\nexport interface IndexerEdgeServerMarketSnapshotsResponse {\n snapshots: Record<number, IndexerServerMarketSnapshot[]>;\n}\n\nexport interface IndexerServerInterestFundingResponse {\n interest_payments: IndexerServerProductPayment[];\n funding_payments: IndexerServerProductPayment[];\n next_idx: string;\n}\n\nexport interface IndexerServerMakerStatisticsResponse {\n reward_coefficient: string;\n makers: IndexerServerMaker[];\n}\n\nexport interface IndexerServerLeaderboardResponse {\n positions: IndexerServerLeaderboardPosition[];\n}\n\nexport interface IndexerServerLeaderboardRegistrationResponse {\n // For non-tiered contests, null if the user is not registered for the provided contestId.\n // For tiered contests (i.e., related contests), null if the user is not registered for any of the contests in the tier group.\n registration: IndexerServerLeaderboardRegistration | null;\n}\n\nexport interface IndexerServerLeaderboardRankResponse {\n // If the subaccount is not eligible for a given contest, it would not be included in the response.\n // contestId -> IndexerServerLeaderboardPosition\n positions: Record<string, IndexerServerLeaderboardPosition>;\n}\n\nexport interface IndexerServerLeaderboardContestsResponse {\n contests: IndexerServerLeaderboardContest[];\n}\n\nexport interface IndexerServerFastWithdrawalSignatureResponse {\n idx: string;\n tx: NadoWithdrawCollateralTx['withdraw_collateral'];\n tx_bytes: string;\n signatures: string[];\n}\n\nexport interface IndexerServerNlpSnapshotsResponse {\n snapshots: IndexerServerNlpSnapshot[];\n}\n\nexport interface IndexerServerDDAResponse {\n v1_address: string;\n}\n\nexport interface IndexerServerBacklogResponse {\n // Total number of transactions stored in the indexer DB\n total_txs: string;\n // Current nSubmissions value from the chain (i.e., number of processed txs)\n total_submissions: string;\n // Number of unprocessed transactions (total_txs - total_submissions)\n backlog_size: string;\n // UNIX timestamp (in seconds) of when the data was last updated\n updated_at: string;\n // Estimated time in seconds (float) to clear the entire backlog (null if unavailable)\n backlog_eta_in_seconds: string | null;\n // Current submission rate in transactions per second (float) (null if unavailable)\n txs_per_second: string | null;\n}\n\n// Response\nexport interface IndexerServerQueryResponseByType {\n account_snapshots: IndexerServerMultiSubaccountSnapshotsResponse;\n backlog: IndexerServerBacklogResponse;\n candlesticks: IndexerServerCandlesticksResponse;\n direct_deposit_address: IndexerServerDDAResponse;\n edge_candlesticks: IndexerEdgeServerCandlesticksResponse;\n edge_market_snapshots: IndexerEdgeServerMarketSnapshotsResponse;\n events: IndexerServerEventsResponse;\n fast_withdrawal_signature: IndexerServerFastWithdrawalSignatureResponse;\n funding_rate: IndexerServerFundingRateResponse;\n funding_rates: IndexerServerFundingRatesResponse;\n interest_and_funding: IndexerServerInterestFundingResponse;\n leaderboard: IndexerServerLeaderboardResponse;\n leaderboard_contests: IndexerServerLeaderboardContestsResponse;\n leaderboard_rank: IndexerServerLeaderboardRankResponse;\n leaderboard_registration: IndexerServerLeaderboardRegistrationResponse;\n linked_signer_rate_limit: IndexerServerLinkedSignerResponse;\n maker_statistics: IndexerServerMakerStatisticsResponse;\n market_snapshots: IndexerServerMarketSnapshotsResponse;\n matches: IndexerServerMatchEventsResponse;\n oracle_price: IndexerServerOraclePricesResponse;\n orders: IndexerServerOrdersResponse;\n perp_prices: IndexerServerPerpPricesResponse;\n price: IndexerServerPriceResponse;\n product_snapshots: IndexerServerMultiProductsResponse;\n products: IndexerServerProductsResponse;\n referral_code: IndexerServerReferralCodeResponse;\n subaccounts: IndexerServerListSubaccountsResponse;\n usdc_price: IndexerServerUsdcPriceResponse;\n nlp_snapshots: IndexerServerNlpSnapshotsResponse;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
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 subaccount?: string;\n product_ids?: number[];\n // If not given, will return both isolated & non-iso events\n isolated?: boolean;\n event_types?: IndexerEventType[];\n // Descending order for idx (time), defaults to true\n desc?: boolean;\n // submission_idx for pagination, inclusive\n idx?: string;\n max_time?: number;\n limit?:\n | {\n raw: number;\n }\n | {\n txs: number;\n };\n}\n\nexport type IndexerServerTriggerTypeFilter =\n | 'none'\n | 'price_trigger'\n | 'time_trigger';\n\nexport interface IndexerServerOrdersParams {\n subaccount?: 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 subaccount?: string;\n product_ids?: number[];\n // If not given, will return both isolated & non-iso events\n isolated?: boolean;\n max_time?: number;\n limit: number;\n // submission_idx for pagination, inclusive\n idx?: string;\n}\n\nexport interface IndexerServerLinkedSignerParams {\n subaccount: string;\n}\n\nexport interface IndexerServerMarketSnapshotsParams {\n interval: IndexerServerMarketSnapshotInterval;\n // Defaults to all\n product_ids?: number[];\n}\n\nexport interface IndexerEdgeServerMarketSnapshotsParams {\n interval: IndexerServerMarketSnapshotInterval;\n}\n\nexport interface IndexerServerInterestFundingParams {\n subaccount: string;\n product_ids: number[];\n // If not given, defaults to latest\n max_idx?: string;\n max_time?: number;\n limit: number;\n}\n\nexport interface IndexerServerMakerStatisticsParams {\n product_id: number;\n epoch: number;\n interval: number;\n}\n\nexport interface IndexerServerLeaderboardParams {\n contest_id: number;\n rank_type: IndexerLeaderboardRankType;\n start?: number | string;\n limit?: number | string;\n}\n\nexport interface IndexerServerLeaderboardRankParams {\n subaccount: string;\n contest_ids: number[];\n}\n\nexport interface IndexerServerLeaderboardContestsParams {\n contest_ids: number[];\n}\n\nexport interface IndexerServerLeaderboardRegistrationParams {\n subaccount: string;\n contest_id: number;\n update_registration: SignedTx<EIP712LeaderboardAuthenticationValues> | null;\n}\n\nexport interface IndexerServerFastWithdrawalSignatureParams {\n /**\n * The submission index of the WithdrawCollateral tx to be used for fast withdraw.\n */\n idx: number | string;\n}\n\nexport interface IndexerServerNlpSnapshotsParams {\n interval: IndexerServerSnapshotsInterval;\n}\n\nexport interface IndexerServerDDAQueryParams {\n subaccount: string;\n}\n\n// Request\nexport interface IndexerServerQueryRequestByType {\n account_snapshots: IndexerServerMultiSubaccountSnapshotsParams;\n backlog: Record<string, never>;\n candlesticks: IndexerServerCandlesticksParams;\n direct_deposit_address: IndexerServerDDAQueryParams;\n edge_candlesticks: IndexerEdgeServerCandlesticksParams;\n edge_market_snapshots: IndexerEdgeServerMarketSnapshotsParams;\n events: IndexerServerEventsParams;\n fast_withdrawal_signature: IndexerServerFastWithdrawalSignatureParams;\n funding_rate: IndexerServerFundingRateParams;\n funding_rates: IndexerServerFundingRatesParams;\n interest_and_funding: IndexerServerInterestFundingParams;\n leaderboard: IndexerServerLeaderboardParams;\n leaderboard_contests: IndexerServerLeaderboardContestsParams;\n leaderboard_rank: IndexerServerLeaderboardRankParams;\n leaderboard_registration: IndexerServerLeaderboardRegistrationParams;\n linked_signer_rate_limit: IndexerServerLinkedSignerParams;\n maker_statistics: IndexerServerMakerStatisticsParams;\n market_snapshots: IndexerServerMarketSnapshotsParams;\n matches: IndexerServerMatchEventsParams;\n oracle_price: IndexerServerOraclePricesParams;\n orders: IndexerServerOrdersParams;\n perp_prices: IndexerServerPerpPricesParams;\n price: IndexerServerPriceParams;\n product_snapshots: IndexerServerMultiProductsParams;\n products: IndexerServerProductsParams;\n referral_code: IndexerServerReferralCodeParams;\n subaccounts: IndexerServerListSubaccountsParams;\n usdc_price: Record<string, never>;\n nlp_snapshots: IndexerServerNlpSnapshotsParams;\n}\n\nexport type IndexerServerQueryRequestType =\n keyof IndexerServerQueryRequestByType;\n\n/**\n * Responses\n */\n\nexport interface IndexerServerListSubaccountsResponse {\n subaccounts: {\n id: string;\n // Hex of subaccount bytes\n subaccount: string;\n }[];\n}\n\nexport interface IndexerServerMultiSubaccountSnapshotsResponse {\n // Map of subaccount hex -> timestamp requested -> latest events corresponding to each product\n snapshots: Record<string, Record<string, IndexerServerEvent[]>>;\n}\n\nexport interface IndexerServerReferralCodeResponse {\n referral_code: string | null;\n}\n\nexport interface IndexerServerFundingRate {\n product_id: number;\n funding_rate_x18: string;\n update_time: number;\n}\n\nexport type IndexerServerFundingRateResponse = IndexerServerFundingRate;\n\n// Map of productId -> IndexerServerFundingRate\nexport type IndexerServerFundingRatesResponse = Record<\n string,\n IndexerServerFundingRate\n>;\n\nexport interface IndexerServerPerpPrices {\n product_id: number;\n index_price_x18: string;\n mark_price_x18: string;\n update_time: number;\n}\n\nexport type IndexerServerPriceResponse = IndexerServerPerpPrices;\n\n// Map of productId -> IndexerServerPerpPrices\nexport type IndexerServerPerpPricesResponse = Record<\n string,\n IndexerServerPerpPrices\n>;\n\nexport interface IndexerServerOraclePricesResponse {\n prices: IndexerServerOraclePrice[];\n}\n\nexport interface IndexerServerCandlesticksResponse {\n candlesticks: IndexerServerCandlestick[];\n}\n\nexport type IndexerEdgeServerCandlesticksResponse =\n IndexerServerCandlesticksResponse;\n\nexport interface IndexerServerProductsResponse {\n products: IndexerServerProductSnapshot[];\n txs: IndexerServerTx[];\n}\n\n// Map of timestamp -> (productID -> IndexerServerProductSnapshot)\nexport type IndexerServerMultiProductsResponse = Record<\n string,\n Record<string, IndexerServerProductSnapshot>\n>;\n\nexport interface IndexerServerEventsResponse {\n events: IndexerServerEvent[];\n txs: IndexerServerTx[];\n}\n\nexport interface IndexerServerOrdersResponse {\n orders: IndexerServerOrder[];\n}\n\nexport interface IndexerServerMatchEventsResponse {\n matches: IndexerServerMatchEvent[];\n txs: IndexerServerTx[];\n}\n\nexport interface IndexerServerUsdcPriceResponse {\n price_x18: string;\n}\n\nexport interface IndexerServerLinkedSignerResponse {\n total_tx_limit: string;\n remaining_tx: string;\n wait_time: string;\n signer: string;\n}\n\nexport interface IndexerServerMarketSnapshotsResponse {\n snapshots: IndexerServerMarketSnapshot[];\n}\n\nexport interface IndexerEdgeServerMarketSnapshotsResponse {\n snapshots: Record<number, IndexerServerMarketSnapshot[]>;\n}\n\nexport interface IndexerServerInterestFundingResponse {\n interest_payments: IndexerServerProductPayment[];\n funding_payments: IndexerServerProductPayment[];\n next_idx: string;\n}\n\nexport interface IndexerServerMakerStatisticsResponse {\n reward_coefficient: string;\n makers: IndexerServerMaker[];\n}\n\nexport interface IndexerServerLeaderboardResponse {\n positions: IndexerServerLeaderboardPosition[];\n}\n\nexport interface IndexerServerLeaderboardRegistrationResponse {\n // For non-tiered contests, null if the user is not registered for the provided contestId.\n // For tiered contests (i.e., related contests), null if the user is not registered for any of the contests in the tier group.\n registration: IndexerServerLeaderboardRegistration | null;\n}\n\nexport interface IndexerServerLeaderboardRankResponse {\n // If the subaccount is not eligible for a given contest, it would not be included in the response.\n // contestId -> IndexerServerLeaderboardPosition\n positions: Record<string, IndexerServerLeaderboardPosition>;\n}\n\nexport interface IndexerServerLeaderboardContestsResponse {\n contests: IndexerServerLeaderboardContest[];\n}\n\nexport interface IndexerServerFastWithdrawalSignatureResponse {\n idx: string;\n tx: NadoWithdrawCollateralTx['withdraw_collateral'];\n tx_bytes: string;\n signatures: string[];\n}\n\nexport interface IndexerServerNlpSnapshotsResponse {\n snapshots: IndexerServerNlpSnapshot[];\n}\n\nexport interface IndexerServerDDAResponse {\n v1_address: string;\n}\n\nexport interface IndexerServerBacklogResponse {\n // Total number of transactions stored in the indexer DB\n total_txs: string;\n // Current nSubmissions value from the chain (i.e., number of processed txs)\n total_submissions: string;\n // Number of unprocessed transactions (total_txs - total_submissions)\n backlog_size: string;\n // UNIX timestamp (in seconds) of when the data was last updated\n updated_at: string;\n // Estimated time in seconds (float) to clear the entire backlog (null if unavailable)\n backlog_eta_in_seconds: string | null;\n // Current submission rate in transactions per second (float) (null if unavailable)\n txs_per_second: string | null;\n}\n\n// Response\nexport interface IndexerServerQueryResponseByType {\n account_snapshots: IndexerServerMultiSubaccountSnapshotsResponse;\n backlog: IndexerServerBacklogResponse;\n candlesticks: IndexerServerCandlesticksResponse;\n direct_deposit_address: IndexerServerDDAResponse;\n edge_candlesticks: IndexerEdgeServerCandlesticksResponse;\n edge_market_snapshots: IndexerEdgeServerMarketSnapshotsResponse;\n events: IndexerServerEventsResponse;\n fast_withdrawal_signature: IndexerServerFastWithdrawalSignatureResponse;\n funding_rate: IndexerServerFundingRateResponse;\n funding_rates: IndexerServerFundingRatesResponse;\n interest_and_funding: IndexerServerInterestFundingResponse;\n leaderboard: IndexerServerLeaderboardResponse;\n leaderboard_contests: IndexerServerLeaderboardContestsResponse;\n leaderboard_rank: IndexerServerLeaderboardRankResponse;\n leaderboard_registration: IndexerServerLeaderboardRegistrationResponse;\n linked_signer_rate_limit: IndexerServerLinkedSignerResponse;\n maker_statistics: IndexerServerMakerStatisticsResponse;\n market_snapshots: IndexerServerMarketSnapshotsResponse;\n matches: IndexerServerMatchEventsResponse;\n oracle_price: IndexerServerOraclePricesResponse;\n orders: IndexerServerOrdersResponse;\n perp_prices: IndexerServerPerpPricesResponse;\n price: IndexerServerPriceResponse;\n product_snapshots: IndexerServerMultiProductsResponse;\n products: IndexerServerProductsResponse;\n referral_code: IndexerServerReferralCodeResponse;\n subaccounts: IndexerServerListSubaccountsResponse;\n usdc_price: IndexerServerUsdcPriceResponse;\n nlp_snapshots: IndexerServerNlpSnapshotsResponse;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -67,9 +67,11 @@ interface IndexerServerEventsParams {
|
|
|
67
67
|
txs: number;
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
+
type IndexerServerTriggerTypeFilter = 'none' | 'price_trigger' | 'time_trigger';
|
|
70
71
|
interface IndexerServerOrdersParams {
|
|
71
72
|
subaccount?: string;
|
|
72
73
|
product_ids?: number[];
|
|
74
|
+
trigger_types?: IndexerServerTriggerTypeFilter[];
|
|
73
75
|
digests?: string[];
|
|
74
76
|
max_time?: number;
|
|
75
77
|
limit?: number;
|
|
@@ -309,4 +311,4 @@ interface IndexerServerQueryResponseByType {
|
|
|
309
311
|
nlp_snapshots: IndexerServerNlpSnapshotsResponse;
|
|
310
312
|
}
|
|
311
313
|
|
|
312
|
-
export type { IndexerEdgeServerCandlesticksParams, IndexerEdgeServerCandlesticksResponse, IndexerEdgeServerMarketSnapshotsParams, IndexerEdgeServerMarketSnapshotsResponse, IndexerServerBacklogResponse, IndexerServerCandlesticksParams, IndexerServerCandlesticksResponse, IndexerServerDDAQueryParams, IndexerServerDDAResponse, IndexerServerEventsParams, IndexerServerEventsResponse, IndexerServerFastWithdrawalSignatureParams, IndexerServerFastWithdrawalSignatureResponse, IndexerServerFundingRate, IndexerServerFundingRateParams, IndexerServerFundingRateResponse, IndexerServerFundingRatesParams, IndexerServerFundingRatesResponse, IndexerServerInterestFundingParams, IndexerServerInterestFundingResponse, IndexerServerLeaderboardContestsParams, IndexerServerLeaderboardContestsResponse, IndexerServerLeaderboardParams, IndexerServerLeaderboardRankParams, IndexerServerLeaderboardRankResponse, IndexerServerLeaderboardRegistrationParams, IndexerServerLeaderboardRegistrationResponse, IndexerServerLeaderboardResponse, IndexerServerLinkedSignerParams, IndexerServerLinkedSignerResponse, IndexerServerListSubaccountsParams, IndexerServerListSubaccountsResponse, IndexerServerMakerStatisticsParams, IndexerServerMakerStatisticsResponse, IndexerServerMarketSnapshotsParams, IndexerServerMarketSnapshotsResponse, IndexerServerMatchEventsParams, IndexerServerMatchEventsResponse, IndexerServerMultiProductsParams, IndexerServerMultiProductsResponse, IndexerServerMultiSubaccountSnapshotsParams, IndexerServerMultiSubaccountSnapshotsResponse, IndexerServerNlpSnapshotsParams, IndexerServerNlpSnapshotsResponse, IndexerServerOraclePricesParams, IndexerServerOraclePricesResponse, IndexerServerOrdersParams, IndexerServerOrdersResponse, IndexerServerPerpPrices, IndexerServerPerpPricesParams, IndexerServerPerpPricesResponse, IndexerServerPriceParams, IndexerServerPriceResponse, IndexerServerProductsParams, IndexerServerProductsResponse, IndexerServerQueryRequestByType, IndexerServerQueryRequestType, IndexerServerQueryResponseByType, IndexerServerReferralCodeParams, IndexerServerReferralCodeResponse, IndexerServerUsdcPriceResponse };
|
|
314
|
+
export type { IndexerEdgeServerCandlesticksParams, IndexerEdgeServerCandlesticksResponse, IndexerEdgeServerMarketSnapshotsParams, IndexerEdgeServerMarketSnapshotsResponse, IndexerServerBacklogResponse, IndexerServerCandlesticksParams, IndexerServerCandlesticksResponse, IndexerServerDDAQueryParams, IndexerServerDDAResponse, IndexerServerEventsParams, IndexerServerEventsResponse, IndexerServerFastWithdrawalSignatureParams, IndexerServerFastWithdrawalSignatureResponse, IndexerServerFundingRate, IndexerServerFundingRateParams, IndexerServerFundingRateResponse, IndexerServerFundingRatesParams, IndexerServerFundingRatesResponse, IndexerServerInterestFundingParams, IndexerServerInterestFundingResponse, IndexerServerLeaderboardContestsParams, IndexerServerLeaderboardContestsResponse, IndexerServerLeaderboardParams, IndexerServerLeaderboardRankParams, IndexerServerLeaderboardRankResponse, IndexerServerLeaderboardRegistrationParams, IndexerServerLeaderboardRegistrationResponse, IndexerServerLeaderboardResponse, IndexerServerLinkedSignerParams, IndexerServerLinkedSignerResponse, IndexerServerListSubaccountsParams, IndexerServerListSubaccountsResponse, IndexerServerMakerStatisticsParams, IndexerServerMakerStatisticsResponse, IndexerServerMarketSnapshotsParams, IndexerServerMarketSnapshotsResponse, IndexerServerMatchEventsParams, IndexerServerMatchEventsResponse, IndexerServerMultiProductsParams, IndexerServerMultiProductsResponse, IndexerServerMultiSubaccountSnapshotsParams, IndexerServerMultiSubaccountSnapshotsResponse, IndexerServerNlpSnapshotsParams, IndexerServerNlpSnapshotsResponse, IndexerServerOraclePricesParams, IndexerServerOraclePricesResponse, IndexerServerOrdersParams, IndexerServerOrdersResponse, IndexerServerPerpPrices, IndexerServerPerpPricesParams, IndexerServerPerpPricesResponse, IndexerServerPriceParams, IndexerServerPriceResponse, IndexerServerProductsParams, IndexerServerProductsResponse, IndexerServerQueryRequestByType, IndexerServerQueryRequestType, IndexerServerQueryResponseByType, IndexerServerReferralCodeParams, IndexerServerReferralCodeResponse, IndexerServerTriggerTypeFilter, IndexerServerUsdcPriceResponse };
|
|
@@ -67,9 +67,11 @@ interface IndexerServerEventsParams {
|
|
|
67
67
|
txs: number;
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
+
type IndexerServerTriggerTypeFilter = 'none' | 'price_trigger' | 'time_trigger';
|
|
70
71
|
interface IndexerServerOrdersParams {
|
|
71
72
|
subaccount?: string;
|
|
72
73
|
product_ids?: number[];
|
|
74
|
+
trigger_types?: IndexerServerTriggerTypeFilter[];
|
|
73
75
|
digests?: string[];
|
|
74
76
|
max_time?: number;
|
|
75
77
|
limit?: number;
|
|
@@ -309,4 +311,4 @@ interface IndexerServerQueryResponseByType {
|
|
|
309
311
|
nlp_snapshots: IndexerServerNlpSnapshotsResponse;
|
|
310
312
|
}
|
|
311
313
|
|
|
312
|
-
export type { IndexerEdgeServerCandlesticksParams, IndexerEdgeServerCandlesticksResponse, IndexerEdgeServerMarketSnapshotsParams, IndexerEdgeServerMarketSnapshotsResponse, IndexerServerBacklogResponse, IndexerServerCandlesticksParams, IndexerServerCandlesticksResponse, IndexerServerDDAQueryParams, IndexerServerDDAResponse, IndexerServerEventsParams, IndexerServerEventsResponse, IndexerServerFastWithdrawalSignatureParams, IndexerServerFastWithdrawalSignatureResponse, IndexerServerFundingRate, IndexerServerFundingRateParams, IndexerServerFundingRateResponse, IndexerServerFundingRatesParams, IndexerServerFundingRatesResponse, IndexerServerInterestFundingParams, IndexerServerInterestFundingResponse, IndexerServerLeaderboardContestsParams, IndexerServerLeaderboardContestsResponse, IndexerServerLeaderboardParams, IndexerServerLeaderboardRankParams, IndexerServerLeaderboardRankResponse, IndexerServerLeaderboardRegistrationParams, IndexerServerLeaderboardRegistrationResponse, IndexerServerLeaderboardResponse, IndexerServerLinkedSignerParams, IndexerServerLinkedSignerResponse, IndexerServerListSubaccountsParams, IndexerServerListSubaccountsResponse, IndexerServerMakerStatisticsParams, IndexerServerMakerStatisticsResponse, IndexerServerMarketSnapshotsParams, IndexerServerMarketSnapshotsResponse, IndexerServerMatchEventsParams, IndexerServerMatchEventsResponse, IndexerServerMultiProductsParams, IndexerServerMultiProductsResponse, IndexerServerMultiSubaccountSnapshotsParams, IndexerServerMultiSubaccountSnapshotsResponse, IndexerServerNlpSnapshotsParams, IndexerServerNlpSnapshotsResponse, IndexerServerOraclePricesParams, IndexerServerOraclePricesResponse, IndexerServerOrdersParams, IndexerServerOrdersResponse, IndexerServerPerpPrices, IndexerServerPerpPricesParams, IndexerServerPerpPricesResponse, IndexerServerPriceParams, IndexerServerPriceResponse, IndexerServerProductsParams, IndexerServerProductsResponse, IndexerServerQueryRequestByType, IndexerServerQueryRequestType, IndexerServerQueryResponseByType, IndexerServerReferralCodeParams, IndexerServerReferralCodeResponse, IndexerServerUsdcPriceResponse };
|
|
314
|
+
export type { IndexerEdgeServerCandlesticksParams, IndexerEdgeServerCandlesticksResponse, IndexerEdgeServerMarketSnapshotsParams, IndexerEdgeServerMarketSnapshotsResponse, IndexerServerBacklogResponse, IndexerServerCandlesticksParams, IndexerServerCandlesticksResponse, IndexerServerDDAQueryParams, IndexerServerDDAResponse, IndexerServerEventsParams, IndexerServerEventsResponse, IndexerServerFastWithdrawalSignatureParams, IndexerServerFastWithdrawalSignatureResponse, IndexerServerFundingRate, IndexerServerFundingRateParams, IndexerServerFundingRateResponse, IndexerServerFundingRatesParams, IndexerServerFundingRatesResponse, IndexerServerInterestFundingParams, IndexerServerInterestFundingResponse, IndexerServerLeaderboardContestsParams, IndexerServerLeaderboardContestsResponse, IndexerServerLeaderboardParams, IndexerServerLeaderboardRankParams, IndexerServerLeaderboardRankResponse, IndexerServerLeaderboardRegistrationParams, IndexerServerLeaderboardRegistrationResponse, IndexerServerLeaderboardResponse, IndexerServerLinkedSignerParams, IndexerServerLinkedSignerResponse, IndexerServerListSubaccountsParams, IndexerServerListSubaccountsResponse, IndexerServerMakerStatisticsParams, IndexerServerMakerStatisticsResponse, IndexerServerMarketSnapshotsParams, IndexerServerMarketSnapshotsResponse, IndexerServerMatchEventsParams, IndexerServerMatchEventsResponse, IndexerServerMultiProductsParams, IndexerServerMultiProductsResponse, IndexerServerMultiSubaccountSnapshotsParams, IndexerServerMultiSubaccountSnapshotsResponse, IndexerServerNlpSnapshotsParams, IndexerServerNlpSnapshotsResponse, IndexerServerOraclePricesParams, IndexerServerOraclePricesResponse, IndexerServerOrdersParams, IndexerServerOrdersResponse, IndexerServerPerpPrices, IndexerServerPerpPricesParams, IndexerServerPerpPricesResponse, IndexerServerPriceParams, IndexerServerPriceResponse, IndexerServerProductsParams, IndexerServerProductsResponse, IndexerServerQueryRequestByType, IndexerServerQueryRequestType, IndexerServerQueryResponseByType, IndexerServerReferralCodeParams, IndexerServerReferralCodeResponse, IndexerServerTriggerTypeFilter, IndexerServerUsdcPriceResponse };
|
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.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "> TODO: description",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@nadohq/engine-client": "^0.1.0-alpha.
|
|
41
|
-
"@nadohq/shared": "^0.1.0-alpha.
|
|
40
|
+
"@nadohq/engine-client": "^0.1.0-alpha.14",
|
|
41
|
+
"@nadohq/shared": "^0.1.0-alpha.14",
|
|
42
42
|
"axios": "*",
|
|
43
43
|
"ts-mixer": "*"
|
|
44
44
|
},
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"viem": "*"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "cbd6f620e9c9789baeb196c46ffc5b00a47fe606"
|
|
52
52
|
}
|
package/src/IndexerBaseClient.ts
CHANGED
package/src/IndexerClient.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
+
NLP_PRODUCT_ID,
|
|
2
3
|
ProductEngineType,
|
|
3
4
|
QUOTE_PRODUCT_ID,
|
|
4
5
|
subaccountFromHex,
|
|
5
|
-
|
|
6
|
+
toBigDecimal,
|
|
7
|
+
toIntegerString,
|
|
6
8
|
} from '@nadohq/shared';
|
|
7
|
-
import { toBigDecimal, toIntegerString } from '@nadohq/shared';
|
|
8
9
|
|
|
9
10
|
import { IndexerBaseClient } from './IndexerBaseClient';
|
|
10
11
|
import {
|
|
@@ -22,17 +23,17 @@ import {
|
|
|
22
23
|
GetIndexerSubaccountLiquidationEventsResponse,
|
|
23
24
|
GetIndexerSubaccountMatchEventParams,
|
|
24
25
|
GetIndexerSubaccountMatchEventsResponse,
|
|
25
|
-
GetIndexerSubaccountSettlementEventsParams,
|
|
26
|
-
GetIndexerSubaccountSettlementEventsResponse,
|
|
27
26
|
GetIndexerSubaccountNlpEventsParams,
|
|
28
27
|
GetIndexerSubaccountNlpEventsResponse,
|
|
28
|
+
GetIndexerSubaccountSettlementEventsParams,
|
|
29
|
+
GetIndexerSubaccountSettlementEventsResponse,
|
|
29
30
|
IndexerCollateralEvent,
|
|
30
31
|
IndexerEventPerpStateSnapshot,
|
|
31
32
|
IndexerEventSpotStateSnapshot,
|
|
32
33
|
IndexerEventWithTx,
|
|
33
34
|
IndexerLiquidationEvent,
|
|
34
|
-
IndexerSettlementEvent,
|
|
35
35
|
IndexerNlpEvent,
|
|
36
|
+
IndexerSettlementEvent,
|
|
36
37
|
PaginatedIndexerEventsResponse,
|
|
37
38
|
} from './types';
|
|
38
39
|
|
|
@@ -195,6 +196,7 @@ export class IndexerClient extends IndexerBaseClient {
|
|
|
195
196
|
subaccountName,
|
|
196
197
|
subaccountOwner,
|
|
197
198
|
productIds,
|
|
199
|
+
triggerTypes,
|
|
198
200
|
isolated,
|
|
199
201
|
} = params;
|
|
200
202
|
|
|
@@ -205,6 +207,7 @@ export class IndexerClient extends IndexerBaseClient {
|
|
|
205
207
|
subaccount: { subaccountName, subaccountOwner },
|
|
206
208
|
limit,
|
|
207
209
|
productIds,
|
|
210
|
+
triggerTypes,
|
|
208
211
|
isolated,
|
|
209
212
|
});
|
|
210
213
|
|
package/src/index.ts
CHANGED
package/src/types/clientTypes.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { NadoTx, NadoWithdrawCollateralTx } from './NadoTx';
|
|
|
18
18
|
import {
|
|
19
19
|
IndexerServerFastWithdrawalSignatureParams,
|
|
20
20
|
IndexerServerListSubaccountsParams,
|
|
21
|
+
IndexerServerTriggerTypeFilter,
|
|
21
22
|
} from './serverTypes';
|
|
22
23
|
|
|
23
24
|
/**
|
|
@@ -341,6 +342,7 @@ export interface GetIndexerOrdersParams {
|
|
|
341
342
|
maxTimestampInclusive?: number;
|
|
342
343
|
limit?: number;
|
|
343
344
|
productIds?: number[];
|
|
345
|
+
triggerTypes?: IndexerServerTriggerTypeFilter[];
|
|
344
346
|
// If not given, will return both isolated & non-iso orders
|
|
345
347
|
isolated?: boolean;
|
|
346
348
|
digests?: string[];
|
package/src/types/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from './clientTypes';
|
|
2
|
-
export * from './paginatedEventsTypes';
|
|
3
|
-
export * from './serverTypes';
|
|
4
|
-
export * from './serverModelTypes';
|
|
5
1
|
export * from './CandlestickPeriod';
|
|
2
|
+
export * from './clientTypes';
|
|
3
|
+
export * from './collateralEventType';
|
|
6
4
|
export * from './IndexerEventType';
|
|
7
5
|
export * from './IndexerLeaderboardType';
|
|
8
|
-
export * from './collateralEventType';
|
|
9
6
|
export * from './NadoTx';
|
|
7
|
+
export * from './paginatedEventsTypes';
|
|
8
|
+
export * from './serverModelTypes';
|
|
9
|
+
export * from './serverTypes';
|
|
@@ -103,7 +103,7 @@ export type GetIndexerSubaccountMatchEventsResponse =
|
|
|
103
103
|
*/
|
|
104
104
|
|
|
105
105
|
export type GetIndexerPaginatedOrdersParams = BaseSubaccountPaginationParams &
|
|
106
|
-
Pick<GetIndexerOrdersParams, 'productIds' | 'isolated'>;
|
|
106
|
+
Pick<GetIndexerOrdersParams, 'productIds' | 'triggerTypes' | 'isolated'>;
|
|
107
107
|
|
|
108
108
|
export interface GetIndexerPaginatedOrdersResponse {
|
|
109
109
|
orders: IndexerOrder[];
|
package/src/types/serverTypes.ts
CHANGED
|
@@ -15,13 +15,13 @@ import {
|
|
|
15
15
|
IndexerServerMarketSnapshot,
|
|
16
16
|
IndexerServerMarketSnapshotInterval,
|
|
17
17
|
IndexerServerMatchEvent,
|
|
18
|
+
IndexerServerNlpSnapshot,
|
|
18
19
|
IndexerServerOraclePrice,
|
|
19
20
|
IndexerServerOrder,
|
|
20
21
|
IndexerServerProductPayment,
|
|
21
22
|
IndexerServerProductSnapshot,
|
|
22
23
|
IndexerServerSnapshotsInterval,
|
|
23
24
|
IndexerServerTx,
|
|
24
|
-
IndexerServerNlpSnapshot,
|
|
25
25
|
} from './serverModelTypes';
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -112,9 +112,15 @@ export interface IndexerServerEventsParams {
|
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
export type IndexerServerTriggerTypeFilter =
|
|
116
|
+
| 'none'
|
|
117
|
+
| 'price_trigger'
|
|
118
|
+
| 'time_trigger';
|
|
119
|
+
|
|
115
120
|
export interface IndexerServerOrdersParams {
|
|
116
121
|
subaccount?: string;
|
|
117
122
|
product_ids?: number[];
|
|
123
|
+
trigger_types?: IndexerServerTriggerTypeFilter[];
|
|
118
124
|
digests?: string[];
|
|
119
125
|
max_time?: number;
|
|
120
126
|
limit?: number;
|