nado-protocol 0.2.6__py3-none-any.whl → 0.2.8__py3-none-any.whl

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.
@@ -78,54 +78,15 @@ class RewardsExecuteAPI(NadoBaseAPI):
78
78
  def _get_claim_tokens_contract_params(
79
79
  self, params: ClaimTokensParams, signer: LocalAccount
80
80
  ) -> ClaimTokensContractParams:
81
- epoch_merkle_proofs = self.context.indexer_client.get_token_merkle_proofs(
82
- signer.address
83
- ).merkle_proofs[params.epoch]
84
- total_claimable_amount = int(epoch_merkle_proofs.total_amount)
85
- if params.amount is not None:
86
- amount_to_claim = params.amount
87
- else:
88
- assert self.context.contracts.airdrop is not None
89
- amount_claimed = self.context.contracts.airdrop.functions.getClaimed(
90
- signer.address
91
- ).call()
92
- amount_to_claim = total_claimable_amount - amount_claimed[params.epoch]
93
- return ClaimTokensContractParams(
94
- epoch=params.epoch,
95
- amount_to_claim=amount_to_claim,
96
- total_claimable_amount=total_claimable_amount,
97
- merkle_proof=epoch_merkle_proofs.proof,
81
+ raise NotImplementedError(
82
+ "Token merkle proofs endpoint has been removed from the indexer. "
83
+ "This functionality is no longer available."
98
84
  )
99
85
 
100
86
  def _get_claim_foundation_rewards_contract_params(
101
87
  self, signer: LocalAccount
102
88
  ) -> ClaimFoundationRewardsContractParams:
103
- assert self.context.contracts.foundation_rewards_airdrop is not None
104
- claimed = (
105
- self.context.contracts.foundation_rewards_airdrop.functions.getClaimed(
106
- signer.address
107
- ).call()
89
+ raise NotImplementedError(
90
+ "Foundation rewards merkle proofs endpoint has been removed from the indexer. "
91
+ "This functionality is no longer available."
108
92
  )
109
- merkle_proofs = (
110
- self.context.indexer_client.get_foundation_rewards_merkle_proofs(
111
- signer.address
112
- )
113
- )
114
- claim_proofs = []
115
-
116
- for idx, proof in enumerate(merkle_proofs.merkle_proofs):
117
- if idx == 0:
118
- # week 0 is invalid
119
- continue
120
-
121
- total_amount = int(proof.total_amount)
122
-
123
- # There's no partial claim, so find weeks where there's a claimable amount and amt claimed is zero
124
- if total_amount > 0 and int(claimed[idx]) == 0:
125
- claim_proofs.append(
126
- ClaimFoundationRewardsProofStruct(
127
- totalAmount=total_amount, week=idx, proof=proof.proof
128
- )
129
- )
130
-
131
- return ClaimFoundationRewardsContractParams(claim_proofs=claim_proofs)
@@ -7,10 +7,8 @@ from nado_protocol.engine_client.types.query import (
7
7
  )
8
8
  from nado_protocol.indexer_client.types.query import (
9
9
  IndexerLinkedSignerRateLimitData,
10
- IndexerReferralCodeData,
11
10
  IndexerSubaccountsData,
12
11
  IndexerSubaccountsParams,
13
- IndexerTokenRewardsData,
14
12
  IndexerInterestAndFundingParams,
15
13
  IndexerInterestAndFundingData,
16
14
  )
@@ -57,18 +55,6 @@ class SubaccountQueryAPI(NadoBaseAPI):
57
55
  """
58
56
  return self.context.engine_client.get_fee_rates(subaccount)
59
57
 
60
- def get_subaccount_token_rewards(self, address: str) -> IndexerTokenRewardsData:
61
- """
62
- Query the token rewards accumulated per epoch for a specified wallet from the indexer.
63
-
64
- Args:
65
- address (str): Wallet address to be queried.
66
-
67
- Returns:
68
- IndexerTokenRewardsData: A data class object containing detailed information about the accrued token rewards.
69
- """
70
- return self.context.indexer_client.get_token_rewards(address)
71
-
72
58
  def get_subaccount_linked_signer_rate_limits(
73
59
  self, subaccount: str
74
60
  ) -> IndexerLinkedSignerRateLimitData:
@@ -83,18 +69,6 @@ class SubaccountQueryAPI(NadoBaseAPI):
83
69
  """
84
70
  return self.context.indexer_client.get_linked_signer_rate_limits(subaccount)
85
71
 
86
- def get_referral_code(self, subaccount: str) -> IndexerReferralCodeData:
87
- """
88
- Query the referral code for the specified wallet from the indexer.
89
-
90
- Args:
91
- subaccount (str): Unique identifier for the subaccount.
92
-
93
- Returns:
94
- IndexerReferralCodeData: A data class object containing the wallet's referral code.
95
- """
96
- return self.context.indexer_client.get_referral_code(subaccount)
97
-
98
72
  def get_subaccounts(
99
73
  self,
100
74
  address: Optional[str] = None,
@@ -1,3 +1,4 @@
1
+ import json
1
2
  from typing import Optional
2
3
  import requests
3
4
 
@@ -182,7 +183,10 @@ class EngineQueryClient:
182
183
  )
183
184
 
184
185
  def get_subaccount_info(
185
- self, subaccount: str, txs: Optional[list[QuerySubaccountInfoTx]] = None
186
+ self,
187
+ subaccount: str,
188
+ txs: Optional[list[QuerySubaccountInfoTx]] = None,
189
+ pre_state: Optional[bool] = None,
186
190
  ) -> SubaccountInfoData:
187
191
  """
188
192
  Query the engine for the state of a subaccount, including balances.
@@ -193,11 +197,26 @@ class EngineQueryClient:
193
197
  txs (list[QuerySubaccountInfoTx], optional): You can optionally provide a list of txs, to get an estimated view
194
198
  of what the subaccount state would look like if the transactions were applied.
195
199
 
200
+ pre_state (bool, optional): When True and txs are provided, returns the subaccount state before the
201
+ transactions were applied in the pre_state field. Defaults to False.
202
+
196
203
  Returns:
197
204
  SubaccountInfoData: Information about the specified subaccount.
198
205
  """
206
+ txns_str = None
207
+ if txs is not None:
208
+ txns_str = json.dumps([tx.dict() for tx in txs])
209
+
210
+ pre_state_str = None
211
+ if pre_state is not None:
212
+ pre_state_str = str(pre_state).lower()
213
+
199
214
  return ensure_data_type(
200
- self.query(QuerySubaccountInfoParams(subaccount=subaccount, txs=txs)).data,
215
+ self.query(
216
+ QuerySubaccountInfoParams(
217
+ subaccount=subaccount, txns=txns_str, pre_state=pre_state_str
218
+ )
219
+ ).data,
201
220
  SubaccountInfoData,
202
221
  )
203
222
 
@@ -60,6 +60,7 @@ __all__ = [
60
60
  "ContractsData",
61
61
  "NoncesData",
62
62
  "OrderData",
63
+ "PreState",
63
64
  "SubaccountInfoData",
64
65
  "SubaccountOpenOrdersData",
65
66
  "MarketLiquidityData",
@@ -101,7 +101,8 @@ class QuerySubaccountInfoParams(NadoBaseModel):
101
101
 
102
102
  type = EngineQueryType.SUBACCOUNT_INFO.value
103
103
  subaccount: str
104
- txs: Optional[list[QuerySubaccountInfoTx]]
104
+ txns: Optional[str]
105
+ pre_state: Optional[str]
105
106
 
106
107
 
107
108
  class QuerySubaccountOpenOrdersParams(NadoBaseModel):
@@ -299,6 +300,17 @@ class OrderData(NadoBaseModel):
299
300
  placed_at: str
300
301
 
301
302
 
303
+ class PreState(NadoBaseModel):
304
+ """
305
+ Model for subaccount state before simulated transactions were applied.
306
+ """
307
+
308
+ healths: list[SubaccountHealth]
309
+ health_contributions: list[list[str]]
310
+ spot_balances: list[SpotProductBalance]
311
+ perp_balances: list[PerpProductBalance]
312
+
313
+
302
314
  class SubaccountInfoData(NadoBaseModel):
303
315
  """
304
316
  Model for detailed info about a subaccount, including balances.
@@ -314,6 +326,7 @@ class SubaccountInfoData(NadoBaseModel):
314
326
  perp_balances: list[PerpProductBalance]
315
327
  spot_products: list[SpotProduct]
316
328
  perp_products: list[PerpProduct]
329
+ pre_state: Optional[PreState]
317
330
 
318
331
  def parse_subaccount_balance(
319
332
  self, product_id: int
@@ -14,8 +14,6 @@ from nado_protocol.indexer_client.types.query import (
14
14
  IndexerFundingRatesData,
15
15
  IndexerHistoricalOrdersByDigestParams,
16
16
  IndexerHistoricalOrdersData,
17
- IndexerReferralCodeData,
18
- IndexerReferralCodeParams,
19
17
  IndexerSubaccountHistoricalOrdersParams,
20
18
  IndexerLinkedSignerRateLimitData,
21
19
  IndexerLinkedSignerRateLimitParams,
@@ -23,8 +21,6 @@ from nado_protocol.indexer_client.types.query import (
23
21
  IndexerLiquidationFeedParams,
24
22
  IndexerMarketSnapshotsData,
25
23
  IndexerMarketSnapshotsParams,
26
- IndexerMakerStatisticsData,
27
- IndexerMakerStatisticsParams,
28
24
  IndexerMatchesParams,
29
25
  IndexerMatchesData,
30
26
  IndexerOraclePricesData,
@@ -36,17 +32,10 @@ from nado_protocol.indexer_client.types.query import (
36
32
  IndexerProductSnapshotsParams,
37
33
  IndexerRequest,
38
34
  IndexerResponse,
39
- IndexerSubaccountSummaryParams,
40
- IndexerSubaccountSummaryData,
41
35
  IndexerSubaccountsData,
42
36
  IndexerSubaccountsParams,
43
- IndexerTokenRewardsData,
44
- IndexerTokenRewardsParams,
45
- IndexerUsdcPriceParams,
46
- IndexerUsdcPriceData,
47
- IndexerTokenMerkleProofsParams,
48
- IndexerFoundationRewardsMerkleProofsParams,
49
- IndexerMerkleProofsData,
37
+ IndexerQuotePriceParams,
38
+ IndexerQuotePriceData,
50
39
  IndexerInterestAndFundingParams,
51
40
  IndexerInterestAndFundingData,
52
41
  IndexerAccountSnapshotsParams,
@@ -186,29 +175,6 @@ class IndexerQueryClient:
186
175
  self.query(IndexerEventsParams.parse_obj(params)).data, IndexerEventsData
187
176
  )
188
177
 
189
- def get_subaccount_summary(
190
- self, subaccount: str, timestamp: Optional[int] = None
191
- ) -> IndexerSubaccountSummaryData:
192
- """
193
- Retrieves a summary of a specified subaccount at a certain timestamp.
194
-
195
- Args:
196
- subaccount (str): The identifier for the subaccount.
197
-
198
- timestamp (int | None, optional): The timestamp for which to retrieve the subaccount summary. If not provided, the most recent summary is retrieved.
199
-
200
- Returns:
201
- IndexerSubaccountSummaryData: The summary of the specified subaccount at the provided timestamp.
202
- """
203
- return ensure_data_type(
204
- self.query(
205
- IndexerSubaccountSummaryParams(
206
- subaccount=subaccount, timestamp=timestamp
207
- )
208
- ).data,
209
- IndexerSubaccountSummaryData,
210
- )
211
-
212
178
  def get_product_snapshots(
213
179
  self, params: IndexerProductSnapshotsParams
214
180
  ) -> IndexerProductSnapshotsData:
@@ -319,38 +285,6 @@ class IndexerQueryClient:
319
285
  IndexerOraclePricesData,
320
286
  )
321
287
 
322
- def get_token_rewards(self, address: str) -> IndexerTokenRewardsData:
323
- """
324
- Retrieves the token reward data for a specific address.
325
-
326
- Args:
327
- address (str): The address for which to retrieve token reward data.
328
-
329
- Returns:
330
- IndexerTokenRewardsData: The token reward data for the specified address.
331
- """
332
- return ensure_data_type(
333
- self.query(IndexerTokenRewardsParams(address=address)).data,
334
- IndexerTokenRewardsData,
335
- )
336
-
337
- def get_maker_statistics(
338
- self, params: IndexerMakerStatisticsParams
339
- ) -> IndexerMakerStatisticsData:
340
- """
341
- Retrieves maker statistics based on provided parameters.
342
-
343
- Args:
344
- params (IndexerMakerStatisticsParams): The parameters for retrieving maker statistics.
345
-
346
- Returns:
347
- IndexerMakerStatisticsData: The maker statistics corresponding to the provided parameters.
348
- """
349
- return ensure_data_type(
350
- self.query(IndexerMakerStatisticsParams.parse_obj(params)).data,
351
- IndexerMakerStatisticsData,
352
- )
353
-
354
288
  def get_liquidation_feed(self) -> IndexerLiquidationFeedData:
355
289
  """
356
290
  Retrieves the liquidation feed data.
@@ -377,21 +311,6 @@ class IndexerQueryClient:
377
311
  IndexerLinkedSignerRateLimitData,
378
312
  )
379
313
 
380
- def get_referral_code(self, subaccount: str) -> IndexerReferralCodeData:
381
- """
382
- Retrieves the referral code for a given address.
383
-
384
- Args:
385
- subaccount (str): Unique identifier for the subaccount.
386
-
387
- Returns:
388
- IndexerReferralCodeData: The referral code for the specific address.
389
- """
390
- return ensure_data_type(
391
- self.query(IndexerReferralCodeParams(subaccount=subaccount)).data,
392
- IndexerReferralCodeData,
393
- )
394
-
395
314
  def get_subaccounts(
396
315
  self, params: IndexerSubaccountsParams
397
316
  ) -> IndexerSubaccountsData:
@@ -409,26 +328,10 @@ class IndexerQueryClient:
409
328
  IndexerSubaccountsData,
410
329
  )
411
330
 
412
- def get_usdc_price(self) -> IndexerUsdcPriceData:
413
- return ensure_data_type(
414
- self.query(IndexerUsdcPriceParams()).data,
415
- IndexerUsdcPriceData,
416
- )
417
-
418
- def get_token_merkle_proofs(self, address: str) -> IndexerMerkleProofsData:
331
+ def get_quote_price(self) -> IndexerQuotePriceData:
419
332
  return ensure_data_type(
420
- self.query(IndexerTokenMerkleProofsParams(address=address)).data,
421
- IndexerMerkleProofsData,
422
- )
423
-
424
- def get_foundation_rewards_merkle_proofs(
425
- self, address: str
426
- ) -> IndexerMerkleProofsData:
427
- return ensure_data_type(
428
- self.query(
429
- IndexerFoundationRewardsMerkleProofsParams(address=address)
430
- ).data,
431
- IndexerMerkleProofsData,
333
+ self.query(IndexerQuotePriceParams()).data,
334
+ IndexerQuotePriceData,
432
335
  )
433
336
 
434
337
  def get_interest_and_funding_payments(
@@ -25,50 +25,39 @@ __all__ = [
25
25
  "IndexerEventsTxsLimit",
26
26
  "IndexerEventsLimit",
27
27
  "IndexerEventsParams",
28
- "IndexerSubaccountSummaryParams",
29
28
  "IndexerProductSnapshotsParams",
30
29
  "IndexerCandlesticksParams",
31
30
  "IndexerFundingRateParams",
32
31
  "IndexerPerpPricesParams",
33
32
  "IndexerOraclePricesParams",
34
- "IndexerTokenRewardsParams",
35
- "IndexerMakerStatisticsParams",
36
33
  "IndexerLiquidationFeedParams",
37
34
  "IndexerLinkedSignerRateLimitParams",
38
- "IndexerReferralCodeParams",
39
35
  "IndexerSubaccountsParams",
40
36
  "IndexerParams",
41
37
  "IndexerHistoricalOrdersRequest",
42
38
  "IndexerMatchesRequest",
43
39
  "IndexerEventsRequest",
44
- "IndexerSubaccountSummaryRequest",
45
40
  "IndexerProductSnapshotsRequest",
46
41
  "IndexerCandlesticksRequest",
47
42
  "IndexerFundingRateRequest",
48
43
  "IndexerFundingRatesRequest",
49
44
  "IndexerPerpPricesRequest",
50
45
  "IndexerOraclePricesRequest",
51
- "IndexerTokenRewardsRequest",
52
- "IndexerMakerStatisticsRequest",
53
46
  "IndexerLiquidationFeedRequest",
54
47
  "IndexerLinkedSignerRateLimitRequest",
55
- "IndexerReferralCodeRequest",
56
48
  "IndexerSubaccountsRequest",
57
49
  "IndexerRequest",
58
50
  "IndexerHistoricalOrdersData",
59
51
  "IndexerMatchesData",
60
52
  "IndexerEventsData",
61
- "IndexerSubaccountSummaryData",
62
53
  "IndexerProductSnapshotsData",
63
54
  "IndexerCandlesticksData",
64
55
  "IndexerFundingRateData",
65
56
  "IndexerPerpPricesData",
66
57
  "IndexerOraclePricesData",
67
- "IndexerTokenRewardsData",
68
- "IndexerMakerStatisticsData",
69
58
  "IndexerLinkedSignerRateLimitData",
70
- "IndexerReferralCodeData",
71
59
  "IndexerSubaccountsData",
60
+ "IndexerQuotePriceData",
72
61
  "IndexerLiquidationFeedData",
73
62
  "IndexerResponseData",
74
63
  "IndexerResponse",
@@ -1,5 +1,5 @@
1
1
  from nado_protocol.utils.enum import StrEnum
2
- from typing import Dict, Optional, Union
2
+ from typing import Dict, List, Optional, Tuple, Type, Union
3
3
 
4
4
  from pydantic import Field, validator
5
5
  from nado_protocol.indexer_client.types.models import (
@@ -48,11 +48,8 @@ class IndexerQueryType(StrEnum):
48
48
  LINKED_SIGNER_RATE_LIMIT = "linked_signer_rate_limit"
49
49
  REFERRAL_CODE = "referral_code"
50
50
  SUBACCOUNTS = "subaccounts"
51
- USDC_PRICE = "usdc_price"
51
+ QUOTE_PRICE = "quote_price"
52
52
  ACCOUNT_SNAPSHOTS = "account_snapshots"
53
- # TODO: revise once this endpoint is live
54
- TOKEN_MERKLE_PROOFS = "token_merkle_proofs"
55
- FOUNDATION_REWARDS_MERKLE_PROOFS = "foundation_rewards_merkle_proofs"
56
53
  INTEREST_AND_FUNDING = "interest_and_funding"
57
54
  INK_AIRDROP = "ink_airdrop"
58
55
 
@@ -80,6 +77,10 @@ class IndexerSubaccountHistoricalOrdersParams(IndexerBaseParams):
80
77
  trigger_types: Optional[list[str]]
81
78
  isolated: Optional[bool]
82
79
 
80
+ class Config:
81
+ # Ensure this doesn't get confused with digest params
82
+ extra = "forbid"
83
+
83
84
 
84
85
  class IndexerHistoricalOrdersByDigestParams(NadoBaseModel):
85
86
  """
@@ -88,6 +89,10 @@ class IndexerHistoricalOrdersByDigestParams(NadoBaseModel):
88
89
 
89
90
  digests: list[str]
90
91
 
92
+ class Config:
93
+ # Ensure this doesn't get confused with subaccount params
94
+ extra = "forbid"
95
+
91
96
 
92
97
  class IndexerMatchesParams(IndexerBaseParams):
93
98
  """
@@ -130,16 +135,6 @@ class IndexerEventsParams(IndexerBaseParams):
130
135
  limit: Optional[IndexerEventsLimit] # type: ignore
131
136
 
132
137
 
133
- class IndexerSubaccountSummaryParams(NadoBaseModel):
134
- """
135
- Parameters for querying subaccount summary.
136
- """
137
-
138
- subaccount: str
139
- timestamp: Optional[int] = None
140
- active: Optional[bool] = None
141
-
142
-
143
138
  class IndexerProductSnapshotsParams(IndexerBaseParams):
144
139
  """
145
140
  Parameters for querying product snapshots.
@@ -207,24 +202,6 @@ class IndexerOraclePricesParams(NadoBaseModel):
207
202
  product_ids: list[int]
208
203
 
209
204
 
210
- class IndexerTokenRewardsParams(NadoBaseModel):
211
- """
212
- Parameters for querying token rewards.
213
- """
214
-
215
- address: str
216
-
217
-
218
- class IndexerMakerStatisticsParams(NadoBaseModel):
219
- """
220
- Parameters for querying maker statistics.
221
- """
222
-
223
- product_id: int
224
- epoch: int
225
- interval: int
226
-
227
-
228
205
  class IndexerLiquidationFeedParams(NadoBaseModel):
229
206
  """
230
207
  Parameters for querying liquidation feed.
@@ -241,14 +218,6 @@ class IndexerLinkedSignerRateLimitParams(NadoBaseModel):
241
218
  subaccount: str
242
219
 
243
220
 
244
- class IndexerReferralCodeParams(NadoBaseModel):
245
- """
246
- Parameters for querying a referral code.
247
- """
248
-
249
- subaccount: str
250
-
251
-
252
221
  class IndexerSubaccountsParams(NadoBaseModel):
253
222
  """
254
223
  Parameters for querying subaccounts.
@@ -259,30 +228,14 @@ class IndexerSubaccountsParams(NadoBaseModel):
259
228
  start: Optional[int]
260
229
 
261
230
 
262
- class IndexerUsdcPriceParams(NadoBaseModel):
231
+ class IndexerQuotePriceParams(NadoBaseModel):
263
232
  """
264
- Parameters for querying usdc price.
233
+ Parameters for querying quote price.
265
234
  """
266
235
 
267
236
  pass
268
237
 
269
238
 
270
- class IndexerTokenMerkleProofsParams(NadoBaseModel):
271
- """
272
- Parameters for querying token merkle proofs.
273
- """
274
-
275
- address: str
276
-
277
-
278
- class IndexerFoundationRewardsMerkleProofsParams(NadoBaseModel):
279
- """
280
- Parameters for querying Foundation Rewards merkle proofs.
281
- """
282
-
283
- address: str
284
-
285
-
286
239
  class IndexerInterestAndFundingParams(NadoBaseModel):
287
240
  """
288
241
  Parameters for querying interest and funding payments.
@@ -318,22 +271,16 @@ IndexerParams = Union[
318
271
  IndexerHistoricalOrdersByDigestParams,
319
272
  IndexerMatchesParams,
320
273
  IndexerEventsParams,
321
- IndexerSubaccountSummaryParams,
322
274
  IndexerProductSnapshotsParams,
323
275
  IndexerCandlesticksParams,
324
276
  IndexerFundingRateParams,
325
277
  IndexerPerpPricesParams,
326
278
  IndexerOraclePricesParams,
327
- IndexerTokenRewardsParams,
328
- IndexerMakerStatisticsParams,
329
279
  IndexerLiquidationFeedParams,
330
280
  IndexerLinkedSignerRateLimitParams,
331
- IndexerReferralCodeParams,
332
281
  IndexerSubaccountsParams,
333
- IndexerUsdcPriceParams,
282
+ IndexerQuotePriceParams,
334
283
  IndexerMarketSnapshotsParams,
335
- IndexerTokenMerkleProofsParams,
336
- IndexerFoundationRewardsMerkleProofsParams,
337
284
  IndexerInterestAndFundingParams,
338
285
  IndexerAccountSnapshotsParams,
339
286
  IndexerInkAirdropParams,
@@ -349,6 +296,9 @@ class IndexerHistoricalOrdersRequest(NadoBaseModel):
349
296
  IndexerSubaccountHistoricalOrdersParams, IndexerHistoricalOrdersByDigestParams
350
297
  ]
351
298
 
299
+ class Config:
300
+ smart_union = True
301
+
352
302
 
353
303
  class IndexerMatchesRequest(NadoBaseModel):
354
304
  """
@@ -366,14 +316,6 @@ class IndexerEventsRequest(NadoBaseModel):
366
316
  events: IndexerEventsParams
367
317
 
368
318
 
369
- class IndexerSubaccountSummaryRequest(NadoBaseModel):
370
- """
371
- Request object for querying subaccount summary.
372
- """
373
-
374
- summary: IndexerSubaccountSummaryParams
375
-
376
-
377
319
  class IndexerProductSnapshotsRequest(NadoBaseModel):
378
320
  """
379
321
  Request object for querying product snapshots.
@@ -430,22 +372,6 @@ class IndexerOraclePricesRequest(NadoBaseModel):
430
372
  oracle_price: IndexerOraclePricesParams
431
373
 
432
374
 
433
- class IndexerTokenRewardsRequest(NadoBaseModel):
434
- """
435
- Request object for querying token rewards.
436
- """
437
-
438
- rewards: IndexerTokenRewardsParams
439
-
440
-
441
- class IndexerMakerStatisticsRequest(NadoBaseModel):
442
- """
443
- Request object for querying maker statistics.
444
- """
445
-
446
- maker_statistics: IndexerMakerStatisticsParams
447
-
448
-
449
375
  class IndexerLiquidationFeedRequest(NadoBaseModel):
450
376
  """
451
377
  Request object for querying liquidation feed.
@@ -462,14 +388,6 @@ class IndexerLinkedSignerRateLimitRequest(NadoBaseModel):
462
388
  linked_signer_rate_limit: IndexerLinkedSignerRateLimitParams
463
389
 
464
390
 
465
- class IndexerReferralCodeRequest(NadoBaseModel):
466
- """
467
- Request object for querying a referral code.
468
- """
469
-
470
- referral_code: IndexerReferralCodeParams
471
-
472
-
473
391
  class IndexerSubaccountsRequest(NadoBaseModel):
474
392
  """
475
393
  Request object for querying subaccounts.
@@ -478,28 +396,12 @@ class IndexerSubaccountsRequest(NadoBaseModel):
478
396
  subaccounts: IndexerSubaccountsParams
479
397
 
480
398
 
481
- class IndexerUsdcPriceRequest(NadoBaseModel):
482
- """
483
- Request object for querying usdc price.
484
- """
485
-
486
- usdc_price: IndexerUsdcPriceParams
487
-
488
-
489
- class IndexerTokenMerkleProofsRequest(NadoBaseModel):
399
+ class IndexerQuotePriceRequest(NadoBaseModel):
490
400
  """
491
- Request object for querying token merkle proofs.
401
+ Request object for querying quote price.
492
402
  """
493
403
 
494
- token_merkle_proofs: IndexerTokenMerkleProofsParams
495
-
496
-
497
- class IndexerFoundationRewardsMerkleProofsRequest(NadoBaseModel):
498
- """
499
- Request object for querying Foundation Rewards merkle proofs.
500
- """
501
-
502
- foundation_rewards_merkle_proofs: IndexerFoundationRewardsMerkleProofsParams
404
+ quote_price: IndexerQuotePriceParams
503
405
 
504
406
 
505
407
  class IndexerInterestAndFundingRequest(NadoBaseModel):
@@ -530,22 +432,16 @@ IndexerRequest = Union[
530
432
  IndexerHistoricalOrdersRequest,
531
433
  IndexerMatchesRequest,
532
434
  IndexerEventsRequest,
533
- IndexerSubaccountSummaryRequest,
534
435
  IndexerProductSnapshotsRequest,
535
436
  IndexerCandlesticksRequest,
536
437
  IndexerFundingRateRequest,
537
438
  IndexerPerpPricesRequest,
538
439
  IndexerOraclePricesRequest,
539
- IndexerTokenRewardsRequest,
540
- IndexerMakerStatisticsRequest,
541
440
  IndexerLiquidationFeedRequest,
542
441
  IndexerLinkedSignerRateLimitRequest,
543
- IndexerReferralCodeRequest,
544
442
  IndexerSubaccountsRequest,
545
- IndexerUsdcPriceRequest,
443
+ IndexerQuotePriceRequest,
546
444
  IndexerMarketSnapshotsRequest,
547
- IndexerTokenMerkleProofsRequest,
548
- IndexerFoundationRewardsMerkleProofsRequest,
549
445
  IndexerInterestAndFundingRequest,
550
446
  IndexerAccountSnapshotsRequest,
551
447
  IndexerInkAirdropRequest,
@@ -578,14 +474,6 @@ class IndexerEventsData(NadoBaseModel):
578
474
  txs: list[IndexerTx]
579
475
 
580
476
 
581
- class IndexerSubaccountSummaryData(NadoBaseModel):
582
- """
583
- Data object for subaccount summary.
584
- """
585
-
586
- events: list[IndexerEvent]
587
-
588
-
589
477
  class IndexerProductSnapshotsData(NadoBaseModel):
590
478
  """
591
479
  Data object for product snapshots.
@@ -643,25 +531,6 @@ class IndexerOraclePricesData(NadoBaseModel):
643
531
  prices: list[IndexerOraclePrice]
644
532
 
645
533
 
646
- class IndexerTokenRewardsData(NadoBaseModel):
647
- """
648
- Data object for token rewards.
649
- """
650
-
651
- rewards: list[IndexerTokenReward]
652
- update_time: str
653
- total_referrals: str
654
-
655
-
656
- class IndexerMakerStatisticsData(NadoBaseModel):
657
- """
658
- Data object for maker statistics.
659
- """
660
-
661
- reward_coefficient: float
662
- makers: list[IndexerMarketMaker]
663
-
664
-
665
534
  class IndexerLinkedSignerRateLimitData(NadoBaseModel):
666
535
  """
667
536
  Data object for linked signer rate limits.
@@ -673,18 +542,6 @@ class IndexerLinkedSignerRateLimitData(NadoBaseModel):
673
542
  signer: str
674
543
 
675
544
 
676
- class IndexerReferralCodeData(NadoBaseModel):
677
- """
678
- Data object for referral codes.
679
- """
680
-
681
- referral_code: str
682
-
683
- @validator("referral_code", pre=True, always=True)
684
- def set_default_referral_code(cls, v):
685
- return v or ""
686
-
687
-
688
545
  class IndexerSubaccountsData(NadoBaseModel):
689
546
  """
690
547
  Data object for subaccounts response from the indexer.
@@ -693,22 +550,14 @@ class IndexerSubaccountsData(NadoBaseModel):
693
550
  subaccounts: list[IndexerSubaccount]
694
551
 
695
552
 
696
- class IndexerUsdcPriceData(NadoBaseModel):
553
+ class IndexerQuotePriceData(NadoBaseModel):
697
554
  """
698
- Data object for the usdc price response from the indexer.
555
+ Data object for the quote price response from the indexer.
699
556
  """
700
557
 
701
558
  price_x18: str
702
559
 
703
560
 
704
- class IndexerMerkleProofsData(NadoBaseModel):
705
- """
706
- Data object for the merkle proofs response from the indexer.
707
- """
708
-
709
- merkle_proofs: list[IndexerMerkleProof]
710
-
711
-
712
561
  class IndexerInterestAndFundingData(NadoBaseModel):
713
562
  """
714
563
  Data object for the interest and funding payments response from the indexer.
@@ -742,20 +591,15 @@ IndexerResponseData = Union[
742
591
  IndexerHistoricalOrdersData,
743
592
  IndexerMatchesData,
744
593
  IndexerEventsData,
745
- IndexerSubaccountSummaryData,
746
594
  IndexerProductSnapshotsData,
747
595
  IndexerCandlesticksData,
748
596
  IndexerFundingRateData,
749
597
  IndexerPerpPricesData,
750
598
  IndexerOraclePricesData,
751
- IndexerTokenRewardsData,
752
- IndexerMakerStatisticsData,
753
599
  IndexerLinkedSignerRateLimitData,
754
- IndexerReferralCodeData,
755
600
  IndexerSubaccountsData,
756
- IndexerUsdcPriceData,
601
+ IndexerQuotePriceData,
757
602
  IndexerMarketSnapshotsData,
758
- IndexerMerkleProofsData,
759
603
  IndexerInterestAndFundingData,
760
604
  IndexerLiquidationFeedData,
761
605
  IndexerFundingRatesData,
@@ -796,10 +640,6 @@ def to_indexer_request(params: IndexerParams) -> IndexerRequest:
796
640
  ),
797
641
  IndexerMatchesParams: (IndexerMatchesRequest, IndexerQueryType.MATCHES.value),
798
642
  IndexerEventsParams: (IndexerEventsRequest, IndexerQueryType.EVENTS.value),
799
- IndexerSubaccountSummaryParams: (
800
- IndexerSubaccountSummaryRequest,
801
- IndexerQueryType.SUMMARY.value,
802
- ),
803
643
  IndexerProductSnapshotsParams: (
804
644
  IndexerProductSnapshotsRequest,
805
645
  IndexerQueryType.PRODUCTS.value,
@@ -828,14 +668,6 @@ def to_indexer_request(params: IndexerParams) -> IndexerRequest:
828
668
  IndexerOraclePricesRequest,
829
669
  IndexerQueryType.ORACLE_PRICES.value,
830
670
  ),
831
- IndexerTokenRewardsParams: (
832
- IndexerTokenRewardsRequest,
833
- IndexerQueryType.REWARDS.value,
834
- ),
835
- IndexerMakerStatisticsParams: (
836
- IndexerMakerStatisticsRequest,
837
- IndexerQueryType.MAKER_STATISTICS.value,
838
- ),
839
671
  IndexerLiquidationFeedParams: (
840
672
  IndexerLiquidationFeedRequest,
841
673
  IndexerQueryType.LIQUIDATION_FEED.value,
@@ -844,25 +676,13 @@ def to_indexer_request(params: IndexerParams) -> IndexerRequest:
844
676
  IndexerLinkedSignerRateLimitRequest,
845
677
  IndexerQueryType.LINKED_SIGNER_RATE_LIMIT.value,
846
678
  ),
847
- IndexerReferralCodeParams: (
848
- IndexerReferralCodeRequest,
849
- IndexerQueryType.REFERRAL_CODE.value,
850
- ),
851
679
  IndexerSubaccountsParams: (
852
680
  IndexerSubaccountsRequest,
853
681
  IndexerQueryType.SUBACCOUNTS.value,
854
682
  ),
855
- IndexerUsdcPriceParams: (
856
- IndexerUsdcPriceRequest,
857
- IndexerQueryType.USDC_PRICE.value,
858
- ),
859
- IndexerTokenMerkleProofsParams: (
860
- IndexerTokenMerkleProofsRequest,
861
- IndexerQueryType.TOKEN_MERKLE_PROOFS.value,
862
- ),
863
- IndexerFoundationRewardsMerkleProofsParams: (
864
- IndexerFoundationRewardsMerkleProofsRequest,
865
- IndexerQueryType.FOUNDATION_REWARDS_MERKLE_PROOFS.value,
683
+ IndexerQuotePriceParams: (
684
+ IndexerQuotePriceRequest,
685
+ IndexerQueryType.QUOTE_PRICE.value,
866
686
  ),
867
687
  IndexerInterestAndFundingParams: (
868
688
  IndexerInterestAndFundingRequest,
@@ -879,11 +699,11 @@ def to_indexer_request(params: IndexerParams) -> IndexerRequest:
879
699
  }
880
700
 
881
701
  RequestClass, field_name = indexer_request_mapping[type(params)]
882
- return RequestClass(**{field_name: params})
702
+ return RequestClass.parse_obj({field_name: params.dict(exclude_none=False)}) # type: ignore[attr-defined]
883
703
 
884
704
 
885
705
  IndexerTickersData = Dict[str, IndexerTickerInfo]
886
706
 
887
707
  IndexerPerpContractsData = Dict[str, IndexerPerpContractInfo]
888
708
 
889
- IndexerHistoricalTradesData = list[IndexerTradeInfo]
709
+ IndexerHistoricalTradesData = List[IndexerTradeInfo]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nado-protocol
3
- Version: 0.2.6
3
+ Version: 0.2.8
4
4
  Summary: Nado Protocol SDK
5
5
  Keywords: nado protocol,nado sdk,nado protocol api
6
6
  Author: Jeury Mejia
@@ -8,7 +8,7 @@ nado_protocol/client/apis/market/query.py,sha256=CmL_btMtqp0iJFqUt_gszkhe-i4LlcN
8
8
  nado_protocol/client/apis/perp/__init__.py,sha256=KUGZ86Xo-NB-9uhqEyXkrqoGDhWeex0-AQwCfWfvpsg,742
9
9
  nado_protocol/client/apis/perp/query.py,sha256=r4E0tJo7-z9J3HOMufo6BZ9yTYtpCb-ANZeM05lf7rU,1420
10
10
  nado_protocol/client/apis/rewards/__init__.py,sha256=F7fTCEdGR2J2fMd5AhC1JruJSMKUZcoOvYotdSYWU7M,205
11
- nado_protocol/client/apis/rewards/execute.py,sha256=WHWpWB5523WQzXiEV-xD3xVDtSdrvIfQ0IiSN-0ItoA,5298
11
+ nado_protocol/client/apis/rewards/execute.py,sha256=U8U1YOFoVwATXQZP5RlIsMowyy9Q0TomEkAnJcbpiTA,3743
12
12
  nado_protocol/client/apis/rewards/query.py,sha256=DT1evscywPyXTEvNA5FC-L1JuLqf9YRl7pcj_Ad9JxI,507
13
13
  nado_protocol/client/apis/spot/__init__.py,sha256=QdoWAVrvfNAP-YDwM5Z-4N1lS6dgNzNgNqUp78IHMqU,1021
14
14
  nado_protocol/client/apis/spot/base.py,sha256=SagkZZ9Ehi7pSxM5lD-glOMEQj9aT3PGGW4UtGnVpuw,1177
@@ -16,7 +16,7 @@ nado_protocol/client/apis/spot/execute.py,sha256=u_O9vjoshv8Zfg8nIsnd8_X7PUO5CSh
16
16
  nado_protocol/client/apis/spot/query.py,sha256=6YcnfTlVnEHpUkB3eM8zvbYGBxSAw2Xy4yezMDTsZ9U,2954
17
17
  nado_protocol/client/apis/subaccount/__init__.py,sha256=vT857P7_DkIWvV0D5izFg52i-qp800-hlwLzSpIk4Cc,1301
18
18
  nado_protocol/client/apis/subaccount/execute.py,sha256=sbiR9VhRl713Cfus_fAzXQiYR6VZWzPROaTowQDGaA4,2005
19
- nado_protocol/client/apis/subaccount/query.py,sha256=_GhPUacgVdZvb1dy0_0UIT6pJlqaZSGET33ryN-a88s,5800
19
+ nado_protocol/client/apis/subaccount/query.py,sha256=468nG9sNq2Kw8nE4iH5Y6R5yuPienyNHs_PPOlmHTVo,4808
20
20
  nado_protocol/client/context.py,sha256=-H4FSuV-CG7nAConYq4RYjzH9baGU57DQVGDOyfV2X4,3448
21
21
  nado_protocol/contracts/__init__.py,sha256=XJhf8OmABtSwTvgEeA0ZTMLakvwsqkItMY-MOyfDqV4,13503
22
22
  nado_protocol/contracts/abis/Endpoint.json,sha256=8bhbVCW8twMCeqNYXTOREBTBGHEl9fKCenJAEXYiOAY,10931
@@ -41,17 +41,17 @@ nado_protocol/contracts/loader.py,sha256=_0W3ImcARs1bTu1lLMpHMrRNuEVYjrRWctvnEbK
41
41
  nado_protocol/contracts/types.py,sha256=km29Md8hCE8yivGdgbgMuQoO7GyE0yOVt9BaJatvjFY,4280
42
42
  nado_protocol/engine_client/__init__.py,sha256=RE_MxQaQVIp0K5EDhR1_uTjLJgEJBx2fLnhepc3cuAg,1137
43
43
  nado_protocol/engine_client/execute.py,sha256=Tmd1yvLTlvFFaSYqwOWTkzSxdE6QllGB8LHgsOim3Tc,15314
44
- nado_protocol/engine_client/query.py,sha256=zCBLeBOY1wkRM42EMsluBRtVw2TuaqJHp4UuIdHWh4c,16265
45
- nado_protocol/engine_client/types/__init__.py,sha256=pPjKLDJHclcbqROhU8B8OoxUjZkJI9a2qq5fUCVK7j4,2721
44
+ nado_protocol/engine_client/query.py,sha256=v7PqRsnX5jZskNnBpv38HB7BQ7mi8RBhUgczf5msEIc,16858
45
+ nado_protocol/engine_client/types/__init__.py,sha256=aCw_aNxCRy5PhrYpvUHuB7gQPcxHld9iMV5eTFWdEfw,2737
46
46
  nado_protocol/engine_client/types/execute.py,sha256=ANF_QwtJAqb9zvga1fjOIiSDt_wjUo4sbf8rVkc-sQ0,20709
47
47
  nado_protocol/engine_client/types/models.py,sha256=JIDyOLUBprGcMKHxW2M53_nCc7hoerglnFvfn7wgdXo,3862
48
- nado_protocol/engine_client/types/query.py,sha256=N6kPuWSUowMeZnUKpxF9NnMKZBKKe-0Q_B9ccFZkjQA,12185
48
+ nado_protocol/engine_client/types/query.py,sha256=5j4KcYUwGAoJFF0m2bmrqYXbU4iJ5IyzUTiEIzn6rh0,12516
49
49
  nado_protocol/engine_client/types/stream.py,sha256=F_AKqU4pClzUcM6D9Dc79f6RmraahJzj2-hQSXtQ0vQ,159
50
50
  nado_protocol/indexer_client/__init__.py,sha256=ea2exePtguCxJsBlisOQPtnFk8hRmFugeQAuSAaPhoc,922
51
- nado_protocol/indexer_client/query.py,sha256=Tm4IYmU0T_9ayFTce8SMRPi_NN8QgyHDr4rFC3h7hSw,17102
52
- nado_protocol/indexer_client/types/__init__.py,sha256=r3-jxMjrFNbA1nMRSGZjsE3qypmyWab6k20_gasdwL4,3548
51
+ nado_protocol/indexer_client/query.py,sha256=aMJoJfKXd9eE4j5me5FPOtsrHY8b5nXCpCV_NCZzh2E,13710
52
+ nado_protocol/indexer_client/types/__init__.py,sha256=p1Q0JVhx273MuH6Q2baOfVknnLkmuL8kH4TlHDSYVTc,3161
53
53
  nado_protocol/indexer_client/types/models.py,sha256=vD1YHHeK15hcU5_O4al7001Fi-gTl6EARMuR-Y8stOc,7533
54
- nado_protocol/indexer_client/types/query.py,sha256=FCIIUv049AoBtB5VEolwgX51wycCIjyw4Qq__z0TodY,20559
54
+ nado_protocol/indexer_client/types/query.py,sha256=g3bymk_Xpl3vK_z51178qEiDUsGAa5Oqe6jmSNhiMOc,16328
55
55
  nado_protocol/trigger_client/__init__.py,sha256=kD_WJWGOCDwX7GvGF5VGZibWR2uPYRcWpIWht31PYR4,545
56
56
  nado_protocol/trigger_client/execute.py,sha256=VkVla3SF6MX-ZJC_wZG72em41MPAKX-jv1_Lh4ydezU,15089
57
57
  nado_protocol/trigger_client/query.py,sha256=7M7opYEddNo0Wf9VQ7rha-WaoFQVv5F5OI-YLSRWrpk,2705
@@ -76,7 +76,7 @@ nado_protocol/utils/order.py,sha256=Q9TlcotvnB395dPhaKpn0EeN1WNTkpYBTUovlirr1_Y,
76
76
  nado_protocol/utils/subaccount.py,sha256=WJ7lgU2RekuzJAZH-hhCTbIBlRsl2oHozBm7OEMRV74,495
77
77
  nado_protocol/utils/time.py,sha256=tEwmrkc5VdzKLlgkJIAq2ce-nhrduJZNtVPydrrnTHs,360
78
78
  nado_protocol/utils/twap.py,sha256=hfBVK0CBa8m4uBArxTnNRoJr3o1rJucyopR_8_9gkOo,6197
79
- nado_protocol-0.2.6.dist-info/METADATA,sha256=HDjIgzF093U8m5ZGWGyaBS12PHeONrQ0gnNZrP3ZUb4,9558
80
- nado_protocol-0.2.6.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
81
- nado_protocol-0.2.6.dist-info/entry_points.txt,sha256=Df0O9lFc-m0SyOh6_d9FHeG1OT-esxGm-p_z7rTT9h0,340
82
- nado_protocol-0.2.6.dist-info/RECORD,,
79
+ nado_protocol-0.2.8.dist-info/METADATA,sha256=W26ydlZNiR7NihwnL_gzayKfPKqSWetgcxusYz3ioic,9558
80
+ nado_protocol-0.2.8.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
81
+ nado_protocol-0.2.8.dist-info/entry_points.txt,sha256=Df0O9lFc-m0SyOh6_d9FHeG1OT-esxGm-p_z7rTT9h0,340
82
+ nado_protocol-0.2.8.dist-info/RECORD,,