chainstream-sdk 0.1.0__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.
Files changed (261) hide show
  1. chainstream/__init__.py +46 -0
  2. chainstream/client.py +104 -0
  3. chainstream/openapi_client/__init__.py +156 -0
  4. chainstream/openapi_client/api/__init__.py +20 -0
  5. chainstream/openapi_client/api/blockchain_api.py +549 -0
  6. chainstream/openapi_client/api/defi_sol_moonshot_api.py +590 -0
  7. chainstream/openapi_client/api/defi_sol_pumpfun_api.py +314 -0
  8. chainstream/openapi_client/api/dex_api.py +1576 -0
  9. chainstream/openapi_client/api/dex_pool_api.py +645 -0
  10. chainstream/openapi_client/api/endpoint_api.py +1934 -0
  11. chainstream/openapi_client/api/ipfs_api.py +283 -0
  12. chainstream/openapi_client/api/jobs_api.py +562 -0
  13. chainstream/openapi_client/api/kyt_api.py +3743 -0
  14. chainstream/openapi_client/api/ranking_api.py +2067 -0
  15. chainstream/openapi_client/api/red_packet_api.py +2444 -0
  16. chainstream/openapi_client/api/token_api.py +9211 -0
  17. chainstream/openapi_client/api/trade_api.py +1352 -0
  18. chainstream/openapi_client/api/transaction_api.py +882 -0
  19. chainstream/openapi_client/api/wallet_api.py +1608 -0
  20. chainstream/openapi_client/api/watchlist_api.py +316 -0
  21. chainstream/openapi_client/api_client.py +801 -0
  22. chainstream/openapi_client/api_response.py +21 -0
  23. chainstream/openapi_client/configuration.py +572 -0
  24. chainstream/openapi_client/exceptions.py +217 -0
  25. chainstream/openapi_client/models/__init__.py +122 -0
  26. chainstream/openapi_client/models/address_exposure.py +94 -0
  27. chainstream/openapi_client/models/address_risk_response_dto.py +112 -0
  28. chainstream/openapi_client/models/alert_detail.py +100 -0
  29. chainstream/openapi_client/models/alterya_identification.py +106 -0
  30. chainstream/openapi_client/models/balance_change_type.py +38 -0
  31. chainstream/openapi_client/models/balance_token_type.py +38 -0
  32. chainstream/openapi_client/models/balance_update_dto.py +130 -0
  33. chainstream/openapi_client/models/balance_update_page.py +104 -0
  34. chainstream/openapi_client/models/blockchain_dto.py +94 -0
  35. chainstream/openapi_client/models/blockchain_latest_block_dto.py +90 -0
  36. chainstream/openapi_client/models/boolean_result_dto.py +88 -0
  37. chainstream/openapi_client/models/calculate_pnl_input.py +88 -0
  38. chainstream/openapi_client/models/candle.py +101 -0
  39. chainstream/openapi_client/models/chain.py +39 -0
  40. chainstream/openapi_client/models/chain_symbol.py +39 -0
  41. chainstream/openapi_client/models/chainalysis_address_identification.py +92 -0
  42. chainstream/openapi_client/models/claim_red_packet_input.py +103 -0
  43. chainstream/openapi_client/models/create_endpoint_input.py +102 -0
  44. chainstream/openapi_client/models/create_red_packet_input.py +112 -0
  45. chainstream/openapi_client/models/create_red_packet_reply.py +90 -0
  46. chainstream/openapi_client/models/create_token_input.py +110 -0
  47. chainstream/openapi_client/models/create_token_reply.py +90 -0
  48. chainstream/openapi_client/models/dev_token_dto.py +106 -0
  49. chainstream/openapi_client/models/dex_dto.py +94 -0
  50. chainstream/openapi_client/models/dex_page.py +106 -0
  51. chainstream/openapi_client/models/dex_pool_dto.py +161 -0
  52. chainstream/openapi_client/models/dex_pool_snapshot_dto.py +111 -0
  53. chainstream/openapi_client/models/dex_pool_snapshot_page.py +104 -0
  54. chainstream/openapi_client/models/dex_pool_token_liquidity.py +100 -0
  55. chainstream/openapi_client/models/dex_pool_token_snapshot_dto.py +100 -0
  56. chainstream/openapi_client/models/dex_quote_response.py +98 -0
  57. chainstream/openapi_client/models/direct_exposure_detail.py +90 -0
  58. chainstream/openapi_client/models/endpoint_list_response.py +102 -0
  59. chainstream/openapi_client/models/endpoint_operation_response.py +88 -0
  60. chainstream/openapi_client/models/endpoint_response.py +108 -0
  61. chainstream/openapi_client/models/endpoint_secret_response.py +88 -0
  62. chainstream/openapi_client/models/estimate_gas_limit_input.py +94 -0
  63. chainstream/openapi_client/models/estimate_gas_limit_response.py +90 -0
  64. chainstream/openapi_client/models/filter_condition.py +102 -0
  65. chainstream/openapi_client/models/gas_price_response.py +90 -0
  66. chainstream/openapi_client/models/job_dto.py +90 -0
  67. chainstream/openapi_client/models/job_streaming_dto.py +90 -0
  68. chainstream/openapi_client/models/kyt_register_transfer_request.py +108 -0
  69. chainstream/openapi_client/models/kyt_register_withdrawal_request.py +111 -0
  70. chainstream/openapi_client/models/link.py +97 -0
  71. chainstream/openapi_client/models/moonshot_create_token_input.py +145 -0
  72. chainstream/openapi_client/models/moonshot_create_token_reply.py +90 -0
  73. chainstream/openapi_client/models/moonshot_submit_create_token200_response.py +90 -0
  74. chainstream/openapi_client/models/moonshot_submit_create_token_input.py +90 -0
  75. chainstream/openapi_client/models/network_identification_org.py +88 -0
  76. chainstream/openapi_client/models/on_chain_activity.py +88 -0
  77. chainstream/openapi_client/models/pump_create_token_input.py +155 -0
  78. chainstream/openapi_client/models/pump_create_token_reply.py +90 -0
  79. chainstream/openapi_client/models/red_packet_claim_dto.py +103 -0
  80. chainstream/openapi_client/models/red_packet_claims_page.py +104 -0
  81. chainstream/openapi_client/models/red_packet_dto.py +121 -0
  82. chainstream/openapi_client/models/red_packet_reply.py +88 -0
  83. chainstream/openapi_client/models/red_packet_send_tx_input.py +88 -0
  84. chainstream/openapi_client/models/red_packet_send_tx_response.py +88 -0
  85. chainstream/openapi_client/models/red_packets_page.py +104 -0
  86. chainstream/openapi_client/models/register_address_request.py +88 -0
  87. chainstream/openapi_client/models/register_address_response_dto.py +88 -0
  88. chainstream/openapi_client/models/resolution.py +46 -0
  89. chainstream/openapi_client/models/send_tx_input.py +102 -0
  90. chainstream/openapi_client/models/send_tx_response.py +92 -0
  91. chainstream/openapi_client/models/swap_input.py +119 -0
  92. chainstream/openapi_client/models/swap_reply.py +90 -0
  93. chainstream/openapi_client/models/swap_route_input.py +127 -0
  94. chainstream/openapi_client/models/swap_route_response.py +98 -0
  95. chainstream/openapi_client/models/token.py +158 -0
  96. chainstream/openapi_client/models/token_creation_dto.py +107 -0
  97. chainstream/openapi_client/models/token_creation_page.py +106 -0
  98. chainstream/openapi_client/models/token_creators_dto.py +92 -0
  99. chainstream/openapi_client/models/token_extra_dto.py +128 -0
  100. chainstream/openapi_client/models/token_holder.py +94 -0
  101. chainstream/openapi_client/models/token_holder_page.py +106 -0
  102. chainstream/openapi_client/models/token_liquidity_snapshot_dto.py +106 -0
  103. chainstream/openapi_client/models/token_liquidity_snapshot_page.py +104 -0
  104. chainstream/openapi_client/models/token_list_page.py +106 -0
  105. chainstream/openapi_client/models/token_market_data.py +174 -0
  106. chainstream/openapi_client/models/token_metadata.py +132 -0
  107. chainstream/openapi_client/models/token_page.py +108 -0
  108. chainstream/openapi_client/models/token_price_dto.py +94 -0
  109. chainstream/openapi_client/models/token_price_page.py +106 -0
  110. chainstream/openapi_client/models/token_social_medias_dto.py +112 -0
  111. chainstream/openapi_client/models/token_stat.py +340 -0
  112. chainstream/openapi_client/models/token_trader.py +113 -0
  113. chainstream/openapi_client/models/token_trader_tag.py +45 -0
  114. chainstream/openapi_client/models/top_traders_dto.py +110 -0
  115. chainstream/openapi_client/models/top_traders_page.py +106 -0
  116. chainstream/openapi_client/models/trade_detail_dto.py +136 -0
  117. chainstream/openapi_client/models/trade_event.py +113 -0
  118. chainstream/openapi_client/models/trade_page.py +106 -0
  119. chainstream/openapi_client/models/trade_type.py +38 -0
  120. chainstream/openapi_client/models/transfer_alerts_response_dto.py +96 -0
  121. chainstream/openapi_client/models/transfer_base_response_dto.py +112 -0
  122. chainstream/openapi_client/models/transfer_direct_exposure_response_dto.py +92 -0
  123. chainstream/openapi_client/models/transfer_network_identifications_response_dto.py +98 -0
  124. chainstream/openapi_client/models/update_endpoint_input.py +104 -0
  125. chainstream/openapi_client/models/wallet_balance_detail_dto.py +136 -0
  126. chainstream/openapi_client/models/wallet_balances_dto.py +100 -0
  127. chainstream/openapi_client/models/wallet_pnl_dto.py +132 -0
  128. chainstream/openapi_client/models/withdrawal_address_identifications_response_dto.py +98 -0
  129. chainstream/openapi_client/models/withdrawal_base_response_dto.py +106 -0
  130. chainstream/openapi_client/models/withdrawal_fraud_assessment_response_dto.py +96 -0
  131. chainstream/openapi_client/rest.py +213 -0
  132. chainstream/openapi_client/test/__init__.py +0 -0
  133. chainstream/openapi_client/test/test_address_exposure.py +59 -0
  134. chainstream/openapi_client/test/test_address_risk_response_dto.py +81 -0
  135. chainstream/openapi_client/test/test_alert_detail.py +65 -0
  136. chainstream/openapi_client/test/test_alterya_identification.py +69 -0
  137. chainstream/openapi_client/test/test_balance_change_type.py +34 -0
  138. chainstream/openapi_client/test/test_balance_token_type.py +34 -0
  139. chainstream/openapi_client/test/test_balance_update_dto.py +93 -0
  140. chainstream/openapi_client/test/test_balance_update_page.py +105 -0
  141. chainstream/openapi_client/test/test_blockchain_api.py +46 -0
  142. chainstream/openapi_client/test/test_blockchain_dto.py +59 -0
  143. chainstream/openapi_client/test/test_blockchain_latest_block_dto.py +55 -0
  144. chainstream/openapi_client/test/test_boolean_result_dto.py +53 -0
  145. chainstream/openapi_client/test/test_calculate_pnl_input.py +52 -0
  146. chainstream/openapi_client/test/test_candle.py +65 -0
  147. chainstream/openapi_client/test/test_chain.py +34 -0
  148. chainstream/openapi_client/test/test_chain_symbol.py +34 -0
  149. chainstream/openapi_client/test/test_chainalysis_address_identification.py +57 -0
  150. chainstream/openapi_client/test/test_claim_red_packet_input.py +58 -0
  151. chainstream/openapi_client/test/test_create_endpoint_input.py +63 -0
  152. chainstream/openapi_client/test/test_create_red_packet_input.py +64 -0
  153. chainstream/openapi_client/test/test_create_red_packet_reply.py +55 -0
  154. chainstream/openapi_client/test/test_create_token_input.py +63 -0
  155. chainstream/openapi_client/test/test_create_token_reply.py +55 -0
  156. chainstream/openapi_client/test/test_defi_sol_moonshot_api.py +46 -0
  157. chainstream/openapi_client/test/test_defi_sol_pumpfun_api.py +39 -0
  158. chainstream/openapi_client/test/test_dev_token_dto.py +441 -0
  159. chainstream/openapi_client/test/test_dex_api.py +67 -0
  160. chainstream/openapi_client/test/test_dex_dto.py +56 -0
  161. chainstream/openapi_client/test/test_dex_page.py +70 -0
  162. chainstream/openapi_client/test/test_dex_pool_api.py +46 -0
  163. chainstream/openapi_client/test/test_dex_pool_dto.py +88 -0
  164. chainstream/openapi_client/test/test_dex_pool_snapshot_dto.py +96 -0
  165. chainstream/openapi_client/test/test_dex_pool_snapshot_page.py +81 -0
  166. chainstream/openapi_client/test/test_dex_pool_token_liquidity.py +65 -0
  167. chainstream/openapi_client/test/test_dex_pool_token_snapshot_dto.py +65 -0
  168. chainstream/openapi_client/test/test_dex_quote_response.py +57 -0
  169. chainstream/openapi_client/test/test_direct_exposure_detail.py +55 -0
  170. chainstream/openapi_client/test/test_endpoint_api.py +81 -0
  171. chainstream/openapi_client/test/test_endpoint_list_response.py +72 -0
  172. chainstream/openapi_client/test/test_endpoint_operation_response.py +52 -0
  173. chainstream/openapi_client/test/test_endpoint_response.py +66 -0
  174. chainstream/openapi_client/test/test_endpoint_secret_response.py +52 -0
  175. chainstream/openapi_client/test/test_estimate_gas_limit_input.py +58 -0
  176. chainstream/openapi_client/test/test_estimate_gas_limit_response.py +55 -0
  177. chainstream/openapi_client/test/test_filter_condition.py +54 -0
  178. chainstream/openapi_client/test/test_gas_price_response.py +55 -0
  179. chainstream/openapi_client/test/test_ipfs_api.py +39 -0
  180. chainstream/openapi_client/test/test_job_dto.py +55 -0
  181. chainstream/openapi_client/test/test_job_streaming_dto.py +55 -0
  182. chainstream/openapi_client/test/test_jobs_api.py +46 -0
  183. chainstream/openapi_client/test/test_kyt_api.py +130 -0
  184. chainstream/openapi_client/test/test_kyt_register_transfer_request.py +59 -0
  185. chainstream/openapi_client/test/test_kyt_register_withdrawal_request.py +65 -0
  186. chainstream/openapi_client/test/test_link.py +55 -0
  187. chainstream/openapi_client/test/test_moonshot_create_token_input.py +79 -0
  188. chainstream/openapi_client/test/test_moonshot_create_token_reply.py +55 -0
  189. chainstream/openapi_client/test/test_moonshot_submit_create_token200_response.py +53 -0
  190. chainstream/openapi_client/test/test_moonshot_submit_create_token_input.py +54 -0
  191. chainstream/openapi_client/test/test_network_identification_org.py +53 -0
  192. chainstream/openapi_client/test/test_on_chain_activity.py +53 -0
  193. chainstream/openapi_client/test/test_pump_create_token_input.py +71 -0
  194. chainstream/openapi_client/test/test_pump_create_token_reply.py +54 -0
  195. chainstream/openapi_client/test/test_ranking_api.py +67 -0
  196. chainstream/openapi_client/test/test_red_packet_api.py +88 -0
  197. chainstream/openapi_client/test/test_red_packet_claim_dto.py +67 -0
  198. chainstream/openapi_client/test/test_red_packet_claims_page.py +81 -0
  199. chainstream/openapi_client/test/test_red_packet_dto.py +85 -0
  200. chainstream/openapi_client/test/test_red_packet_reply.py +53 -0
  201. chainstream/openapi_client/test/test_red_packet_send_tx_input.py +53 -0
  202. chainstream/openapi_client/test/test_red_packet_send_tx_response.py +53 -0
  203. chainstream/openapi_client/test/test_red_packets_page.py +99 -0
  204. chainstream/openapi_client/test/test_register_address_request.py +53 -0
  205. chainstream/openapi_client/test/test_register_address_response_dto.py +53 -0
  206. chainstream/openapi_client/test/test_resolution.py +34 -0
  207. chainstream/openapi_client/test/test_send_tx_input.py +55 -0
  208. chainstream/openapi_client/test/test_send_tx_response.py +57 -0
  209. chainstream/openapi_client/test/test_swap_input.py +65 -0
  210. chainstream/openapi_client/test/test_swap_reply.py +55 -0
  211. chainstream/openapi_client/test/test_swap_route_input.py +69 -0
  212. chainstream/openapi_client/test/test_swap_route_response.py +85 -0
  213. chainstream/openapi_client/test/test_token.py +352 -0
  214. chainstream/openapi_client/test/test_token_api.py +193 -0
  215. chainstream/openapi_client/test/test_token_creation_dto.py +64 -0
  216. chainstream/openapi_client/test/test_token_creation_page.py +76 -0
  217. chainstream/openapi_client/test/test_token_creators_dto.py +54 -0
  218. chainstream/openapi_client/test/test_token_extra_dto.py +72 -0
  219. chainstream/openapi_client/test/test_token_holder.py +59 -0
  220. chainstream/openapi_client/test/test_token_holder_page.py +70 -0
  221. chainstream/openapi_client/test/test_token_liquidity_snapshot_dto.py +71 -0
  222. chainstream/openapi_client/test/test_token_liquidity_snapshot_page.py +83 -0
  223. chainstream/openapi_client/test/test_token_list_page.py +154 -0
  224. chainstream/openapi_client/test/test_token_market_data.py +101 -0
  225. chainstream/openapi_client/test/test_token_metadata.py +110 -0
  226. chainstream/openapi_client/test/test_token_page.py +155 -0
  227. chainstream/openapi_client/test/test_token_price_dto.py +59 -0
  228. chainstream/openapi_client/test/test_token_price_page.py +70 -0
  229. chainstream/openapi_client/test/test_token_social_medias_dto.py +64 -0
  230. chainstream/openapi_client/test/test_token_stat.py +257 -0
  231. chainstream/openapi_client/test/test_token_trader.py +65 -0
  232. chainstream/openapi_client/test/test_token_trader_tag.py +34 -0
  233. chainstream/openapi_client/test/test_top_traders_dto.py +75 -0
  234. chainstream/openapi_client/test/test_top_traders_page.py +86 -0
  235. chainstream/openapi_client/test/test_trade_api.py +53 -0
  236. chainstream/openapi_client/test/test_trade_detail_dto.py +101 -0
  237. chainstream/openapi_client/test/test_trade_event.py +77 -0
  238. chainstream/openapi_client/test/test_trade_page.py +112 -0
  239. chainstream/openapi_client/test/test_trade_type.py +34 -0
  240. chainstream/openapi_client/test/test_transaction_api.py +53 -0
  241. chainstream/openapi_client/test/test_transfer_alerts_response_dto.py +71 -0
  242. chainstream/openapi_client/test/test_transfer_base_response_dto.py +77 -0
  243. chainstream/openapi_client/test/test_transfer_direct_exposure_response_dto.py +57 -0
  244. chainstream/openapi_client/test/test_transfer_network_identifications_response_dto.py +61 -0
  245. chainstream/openapi_client/test/test_update_endpoint_input.py +64 -0
  246. chainstream/openapi_client/test/test_wallet_api.py +67 -0
  247. chainstream/openapi_client/test/test_wallet_balance_detail_dto.py +101 -0
  248. chainstream/openapi_client/test/test_wallet_balances_dto.py +111 -0
  249. chainstream/openapi_client/test/test_wallet_pnl_dto.py +97 -0
  250. chainstream/openapi_client/test/test_watchlist_api.py +39 -0
  251. chainstream/openapi_client/test/test_withdrawal_address_identifications_response_dto.py +65 -0
  252. chainstream/openapi_client/test/test_withdrawal_base_response_dto.py +71 -0
  253. chainstream/openapi_client/test/test_withdrawal_fraud_assessment_response_dto.py +73 -0
  254. chainstream/stream/__init__.py +74 -0
  255. chainstream/stream/client.py +761 -0
  256. chainstream/stream/fields.py +284 -0
  257. chainstream/stream/models.py +415 -0
  258. chainstream_sdk-0.1.0.dist-info/METADATA +80 -0
  259. chainstream_sdk-0.1.0.dist-info/RECORD +261 -0
  260. chainstream_sdk-0.1.0.dist-info/WHEEL +4 -0
  261. chainstream_sdk-0.1.0.dist-info/entry_points.txt +2 -0
@@ -0,0 +1,161 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Dex Aggregator API
5
+
6
+ Dex Aggregator API ⚡️
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Contact: ai@sx.ai
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional, Union
23
+ from chainstream.openapi_client.models.dex_pool_token_liquidity import DexPoolTokenLiquidity
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class DexPoolDTO(BaseModel):
28
+ """
29
+ DexPoolDTO
30
+ """ # noqa: E501
31
+ program_address: Optional[StrictStr] = Field(default=None, description="DTO.DEX.PROGRAM_ADDRESS", alias="programAddress")
32
+ protocol_family: Optional[StrictStr] = Field(default=None, description="DTO.DEX.PROTOCOL_FAMILY", alias="protocolFamily")
33
+ image: Optional[StrictStr] = Field(default=None, description="DTO.DEX.IMAGE")
34
+ chain: StrictStr = Field(description="DTO.DEX.CHAIN")
35
+ pool_address: StrictStr = Field(description="DTO.DEXPOOL.POOL_ADDRESS", alias="poolAddress")
36
+ protocol_name: Optional[StrictStr] = Field(default=None, description="DTO.DEXPOOL.PROTOCOL_NAME", alias="protocolName")
37
+ token_a_address: StrictStr = Field(description="DTO.DEXPOOL.TOKEN_A", alias="tokenAAddress")
38
+ token_b_address: StrictStr = Field(description="DTO.DEXPOOL.TOKEN_B", alias="tokenBAddress")
39
+ tvl_in_usd: Optional[StrictStr] = Field(default=None, description="DTO.DEXPOOL.TVL_USD", alias="tvlInUsd")
40
+ tvl_in_sol: Optional[StrictStr] = Field(default=None, description="DTO.DEXPOOL.TVL_SOL", alias="tvlInSol")
41
+ type: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="DTO.DEXPOOL.TYPE")
42
+ version: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="DTO.DEXPOOL.VERSION")
43
+ liquidity_model: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="DTO.DEXPOOL.LIQUIDITY_MODEL", alias="liquidityModel")
44
+ fee_rate: Optional[StrictStr] = Field(default=None, description="DTO.DEXPOOL.FEE_RATE", alias="feeRate")
45
+ tick_spacing: Optional[StrictInt] = Field(default=None, description="DTO.DEXPOOL.TICK_SPACING", alias="tickSpacing")
46
+ token_count: Optional[StrictInt] = Field(default=None, description="DTO.DEXPOOL.TOKEN_COUNT", alias="tokenCount")
47
+ created_block_timestamp: Optional[StrictStr] = Field(default=None, description="DTO.DEXPOOL.CREATED_BLOCK_TIMESTAMP", alias="createdBlockTimestamp")
48
+ token_a_liquidity: Optional[DexPoolTokenLiquidity] = Field(default=None, description="DTO.DEXPOOL.TOKEN_A_LIQUIDITY", alias="tokenALiquidity")
49
+ token_b_liquidity: Optional[DexPoolTokenLiquidity] = Field(default=None, description="DTO.DEXPOOL.TOKEN_B_LIQUIDITY", alias="tokenBLiquidity")
50
+ __properties: ClassVar[List[str]] = ["programAddress", "protocolFamily", "image", "chain", "poolAddress", "protocolName", "tokenAAddress", "tokenBAddress", "tvlInUsd", "tvlInSol", "type", "version", "liquidityModel", "feeRate", "tickSpacing", "tokenCount", "createdBlockTimestamp", "tokenALiquidity", "tokenBLiquidity"]
51
+
52
+ @field_validator('type')
53
+ def type_validate_enum(cls, value):
54
+ """Validates the enum"""
55
+ if value is None:
56
+ return value
57
+
58
+ if value not in set([0, 1, 2, 3, 4]):
59
+ raise ValueError("must be one of enum values (0, 1, 2, 3, 4)")
60
+ return value
61
+
62
+ @field_validator('version')
63
+ def version_validate_enum(cls, value):
64
+ """Validates the enum"""
65
+ if value is None:
66
+ return value
67
+
68
+ if value not in set([0, 1, 2, 3]):
69
+ raise ValueError("must be one of enum values (0, 1, 2, 3)")
70
+ return value
71
+
72
+ @field_validator('liquidity_model')
73
+ def liquidity_model_validate_enum(cls, value):
74
+ """Validates the enum"""
75
+ if value is None:
76
+ return value
77
+
78
+ if value not in set([0, 1, 2, 3, 4]):
79
+ raise ValueError("must be one of enum values (0, 1, 2, 3, 4)")
80
+ return value
81
+
82
+ model_config = ConfigDict(
83
+ populate_by_name=True,
84
+ validate_assignment=True,
85
+ protected_namespaces=(),
86
+ )
87
+
88
+
89
+ def to_str(self) -> str:
90
+ """Returns the string representation of the model using alias"""
91
+ return pprint.pformat(self.model_dump(by_alias=True))
92
+
93
+ def to_json(self) -> str:
94
+ """Returns the JSON representation of the model using alias"""
95
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
96
+ return json.dumps(self.to_dict())
97
+
98
+ @classmethod
99
+ def from_json(cls, json_str: str) -> Optional[Self]:
100
+ """Create an instance of DexPoolDTO from a JSON string"""
101
+ return cls.from_dict(json.loads(json_str))
102
+
103
+ def to_dict(self) -> Dict[str, Any]:
104
+ """Return the dictionary representation of the model using alias.
105
+
106
+ This has the following differences from calling pydantic's
107
+ `self.model_dump(by_alias=True)`:
108
+
109
+ * `None` is only added to the output dict for nullable fields that
110
+ were set at model initialization. Other fields with value `None`
111
+ are ignored.
112
+ """
113
+ excluded_fields: Set[str] = set([
114
+ ])
115
+
116
+ _dict = self.model_dump(
117
+ by_alias=True,
118
+ exclude=excluded_fields,
119
+ exclude_none=True,
120
+ )
121
+ # override the default output from pydantic by calling `to_dict()` of token_a_liquidity
122
+ if self.token_a_liquidity:
123
+ _dict['tokenALiquidity'] = self.token_a_liquidity.to_dict()
124
+ # override the default output from pydantic by calling `to_dict()` of token_b_liquidity
125
+ if self.token_b_liquidity:
126
+ _dict['tokenBLiquidity'] = self.token_b_liquidity.to_dict()
127
+ return _dict
128
+
129
+ @classmethod
130
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
131
+ """Create an instance of DexPoolDTO from a dict"""
132
+ if obj is None:
133
+ return None
134
+
135
+ if not isinstance(obj, dict):
136
+ return cls.model_validate(obj)
137
+
138
+ _obj = cls.model_validate({
139
+ "programAddress": obj.get("programAddress"),
140
+ "protocolFamily": obj.get("protocolFamily"),
141
+ "image": obj.get("image"),
142
+ "chain": obj.get("chain"),
143
+ "poolAddress": obj.get("poolAddress"),
144
+ "protocolName": obj.get("protocolName"),
145
+ "tokenAAddress": obj.get("tokenAAddress"),
146
+ "tokenBAddress": obj.get("tokenBAddress"),
147
+ "tvlInUsd": obj.get("tvlInUsd"),
148
+ "tvlInSol": obj.get("tvlInSol"),
149
+ "type": obj.get("type"),
150
+ "version": obj.get("version"),
151
+ "liquidityModel": obj.get("liquidityModel"),
152
+ "feeRate": obj.get("feeRate"),
153
+ "tickSpacing": obj.get("tickSpacing"),
154
+ "tokenCount": obj.get("tokenCount"),
155
+ "createdBlockTimestamp": obj.get("createdBlockTimestamp"),
156
+ "tokenALiquidity": DexPoolTokenLiquidity.from_dict(obj["tokenALiquidity"]) if obj.get("tokenALiquidity") is not None else None,
157
+ "tokenBLiquidity": DexPoolTokenLiquidity.from_dict(obj["tokenBLiquidity"]) if obj.get("tokenBLiquidity") is not None else None
158
+ })
159
+ return _obj
160
+
161
+
@@ -0,0 +1,111 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Dex Aggregator API
5
+
6
+ Dex Aggregator API ⚡️
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Contact: ai@sx.ai
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from chainstream.openapi_client.models.dex_pool_token_snapshot_dto import DexPoolTokenSnapshotDTO
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class DexPoolSnapshotDTO(BaseModel):
28
+ """
29
+ DexPoolSnapshotDTO
30
+ """ # noqa: E501
31
+ pool_address: StrictStr = Field(description="DTO.DEXPOOL.POOL_ADDRESS", alias="poolAddress")
32
+ snapshot_time: StrictInt = Field(description="DTO.DEXPOOL.SNAPSHOT.SNAPSHOT_TIME", alias="snapshotTime")
33
+ tvl_in_usd: StrictStr = Field(description="DTO.DEXPOOL.TVL_USD", alias="tvlInUsd")
34
+ tvl_in_native: StrictStr = Field(description="DTO.DEXPOOL.TVL_SOL", alias="tvlInNative")
35
+ token_a: DexPoolTokenSnapshotDTO = Field(description="DTO.DEXPOOL.SNAPSHOT.TOKEN_A", alias="tokenA")
36
+ token_b: DexPoolTokenSnapshotDTO = Field(description="DTO.DEXPOOL.SNAPSHOT.TOKEN_B", alias="tokenB")
37
+ block_height: StrictInt = Field(description="DTO.DEXPOOL.SNAPSHOT.BLOCK_HEIGHT", alias="blockHeight")
38
+ block_slot: Optional[StrictInt] = Field(default=None, description="DTO.DEXPOOL.SNAPSHOT.BLOCK_SLOT", alias="blockSlot")
39
+ block_timestamp: StrictInt = Field(description="DTO.DEXPOOL.SNAPSHOT.BLOCK_TIMESTAMP", alias="blockTimestamp")
40
+ __properties: ClassVar[List[str]] = ["poolAddress", "snapshotTime", "tvlInUsd", "tvlInNative", "tokenA", "tokenB", "blockHeight", "blockSlot", "blockTimestamp"]
41
+
42
+ model_config = ConfigDict(
43
+ populate_by_name=True,
44
+ validate_assignment=True,
45
+ protected_namespaces=(),
46
+ )
47
+
48
+
49
+ def to_str(self) -> str:
50
+ """Returns the string representation of the model using alias"""
51
+ return pprint.pformat(self.model_dump(by_alias=True))
52
+
53
+ def to_json(self) -> str:
54
+ """Returns the JSON representation of the model using alias"""
55
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
56
+ return json.dumps(self.to_dict())
57
+
58
+ @classmethod
59
+ def from_json(cls, json_str: str) -> Optional[Self]:
60
+ """Create an instance of DexPoolSnapshotDTO from a JSON string"""
61
+ return cls.from_dict(json.loads(json_str))
62
+
63
+ def to_dict(self) -> Dict[str, Any]:
64
+ """Return the dictionary representation of the model using alias.
65
+
66
+ This has the following differences from calling pydantic's
67
+ `self.model_dump(by_alias=True)`:
68
+
69
+ * `None` is only added to the output dict for nullable fields that
70
+ were set at model initialization. Other fields with value `None`
71
+ are ignored.
72
+ """
73
+ excluded_fields: Set[str] = set([
74
+ ])
75
+
76
+ _dict = self.model_dump(
77
+ by_alias=True,
78
+ exclude=excluded_fields,
79
+ exclude_none=True,
80
+ )
81
+ # override the default output from pydantic by calling `to_dict()` of token_a
82
+ if self.token_a:
83
+ _dict['tokenA'] = self.token_a.to_dict()
84
+ # override the default output from pydantic by calling `to_dict()` of token_b
85
+ if self.token_b:
86
+ _dict['tokenB'] = self.token_b.to_dict()
87
+ return _dict
88
+
89
+ @classmethod
90
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
91
+ """Create an instance of DexPoolSnapshotDTO from a dict"""
92
+ if obj is None:
93
+ return None
94
+
95
+ if not isinstance(obj, dict):
96
+ return cls.model_validate(obj)
97
+
98
+ _obj = cls.model_validate({
99
+ "poolAddress": obj.get("poolAddress"),
100
+ "snapshotTime": obj.get("snapshotTime"),
101
+ "tvlInUsd": obj.get("tvlInUsd"),
102
+ "tvlInNative": obj.get("tvlInNative"),
103
+ "tokenA": DexPoolTokenSnapshotDTO.from_dict(obj["tokenA"]) if obj.get("tokenA") is not None else None,
104
+ "tokenB": DexPoolTokenSnapshotDTO.from_dict(obj["tokenB"]) if obj.get("tokenB") is not None else None,
105
+ "blockHeight": obj.get("blockHeight"),
106
+ "blockSlot": obj.get("blockSlot"),
107
+ "blockTimestamp": obj.get("blockTimestamp")
108
+ })
109
+ return _obj
110
+
111
+
@@ -0,0 +1,104 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Dex Aggregator API
5
+
6
+ Dex Aggregator API ⚡️
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Contact: ai@sx.ai
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from chainstream.openapi_client.models.dex_pool_snapshot_dto import DexPoolSnapshotDTO
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class DexPoolSnapshotPage(BaseModel):
28
+ """
29
+ DexPoolSnapshotPage
30
+ """ # noqa: E501
31
+ data: List[DexPoolSnapshotDTO] = Field(description="DTO.PAGE.DATA")
32
+ start_cursor: Optional[StrictStr] = Field(default=None, description="DTO.PAGE.START_CURSOR", alias="startCursor")
33
+ end_cursor: Optional[StrictStr] = Field(default=None, description="DTO.PAGE.END_CURSOR", alias="endCursor")
34
+ has_next: StrictBool = Field(description="DTO.PAGE.HAS_NEXT", alias="hasNext")
35
+ has_prev: StrictBool = Field(description="DTO.PAGE.HAS_PREV", alias="hasPrev")
36
+ __properties: ClassVar[List[str]] = ["data", "startCursor", "endCursor", "hasNext", "hasPrev"]
37
+
38
+ model_config = ConfigDict(
39
+ populate_by_name=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
+ """Create an instance of DexPoolSnapshotPage from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ ])
71
+
72
+ _dict = self.model_dump(
73
+ by_alias=True,
74
+ exclude=excluded_fields,
75
+ exclude_none=True,
76
+ )
77
+ # override the default output from pydantic by calling `to_dict()` of each item in data (list)
78
+ _items = []
79
+ if self.data:
80
+ for _item_data in self.data:
81
+ if _item_data:
82
+ _items.append(_item_data.to_dict())
83
+ _dict['data'] = _items
84
+ return _dict
85
+
86
+ @classmethod
87
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
88
+ """Create an instance of DexPoolSnapshotPage from a dict"""
89
+ if obj is None:
90
+ return None
91
+
92
+ if not isinstance(obj, dict):
93
+ return cls.model_validate(obj)
94
+
95
+ _obj = cls.model_validate({
96
+ "data": [DexPoolSnapshotDTO.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None,
97
+ "startCursor": obj.get("startCursor"),
98
+ "endCursor": obj.get("endCursor"),
99
+ "hasNext": obj.get("hasNext") if obj.get("hasNext") is not None else False,
100
+ "hasPrev": obj.get("hasPrev") if obj.get("hasPrev") is not None else False
101
+ })
102
+ return _obj
103
+
104
+
@@ -0,0 +1,100 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Dex Aggregator API
5
+
6
+ Dex Aggregator API ⚡️
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Contact: ai@sx.ai
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
22
+ from typing import Any, ClassVar, Dict, List
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class DexPoolTokenLiquidity(BaseModel):
27
+ """
28
+ DexPoolTokenLiquidity
29
+ """ # noqa: E501
30
+ token_address: StrictStr = Field(description="DTO.DEXPOOL.TOKEN_ADDRESS", alias="tokenAddress")
31
+ token_decimals: StrictInt = Field(description="DTO.DEXPOOL.TOKEN_DECIMALS", alias="tokenDecimals")
32
+ vault_amount: StrictStr = Field(description="DTO.DEXPOOL.VAULT_AMOUNT", alias="vaultAmount")
33
+ amount_in_usd: StrictStr = Field(description="DTO.DEXPOOL.AMOUNT_IN_USD", alias="amountInUsd")
34
+ amount_in_native: StrictStr = Field(description="DTO.DEXPOOL.AMOUNT_IN_NATIVE", alias="amountInNative")
35
+ price_usd: StrictStr = Field(description="DTO.DEXPOOL.PRICE_USD", alias="priceUsd")
36
+ price_native: StrictStr = Field(description="DTO.DEXPOOL.PRICE_NATIVE", alias="priceNative")
37
+ __properties: ClassVar[List[str]] = ["tokenAddress", "tokenDecimals", "vaultAmount", "amountInUsd", "amountInNative", "priceUsd", "priceNative"]
38
+
39
+ model_config = ConfigDict(
40
+ populate_by_name=True,
41
+ validate_assignment=True,
42
+ protected_namespaces=(),
43
+ )
44
+
45
+
46
+ def to_str(self) -> str:
47
+ """Returns the string representation of the model using alias"""
48
+ return pprint.pformat(self.model_dump(by_alias=True))
49
+
50
+ def to_json(self) -> str:
51
+ """Returns the JSON representation of the model using alias"""
52
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
53
+ return json.dumps(self.to_dict())
54
+
55
+ @classmethod
56
+ def from_json(cls, json_str: str) -> Optional[Self]:
57
+ """Create an instance of DexPoolTokenLiquidity from a JSON string"""
58
+ return cls.from_dict(json.loads(json_str))
59
+
60
+ def to_dict(self) -> Dict[str, Any]:
61
+ """Return the dictionary representation of the model using alias.
62
+
63
+ This has the following differences from calling pydantic's
64
+ `self.model_dump(by_alias=True)`:
65
+
66
+ * `None` is only added to the output dict for nullable fields that
67
+ were set at model initialization. Other fields with value `None`
68
+ are ignored.
69
+ """
70
+ excluded_fields: Set[str] = set([
71
+ ])
72
+
73
+ _dict = self.model_dump(
74
+ by_alias=True,
75
+ exclude=excluded_fields,
76
+ exclude_none=True,
77
+ )
78
+ return _dict
79
+
80
+ @classmethod
81
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
82
+ """Create an instance of DexPoolTokenLiquidity from a dict"""
83
+ if obj is None:
84
+ return None
85
+
86
+ if not isinstance(obj, dict):
87
+ return cls.model_validate(obj)
88
+
89
+ _obj = cls.model_validate({
90
+ "tokenAddress": obj.get("tokenAddress"),
91
+ "tokenDecimals": obj.get("tokenDecimals"),
92
+ "vaultAmount": obj.get("vaultAmount"),
93
+ "amountInUsd": obj.get("amountInUsd"),
94
+ "amountInNative": obj.get("amountInNative"),
95
+ "priceUsd": obj.get("priceUsd"),
96
+ "priceNative": obj.get("priceNative")
97
+ })
98
+ return _obj
99
+
100
+
@@ -0,0 +1,100 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Dex Aggregator API
5
+
6
+ Dex Aggregator API ⚡️
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Contact: ai@sx.ai
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
22
+ from typing import Any, ClassVar, Dict, List
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class DexPoolTokenSnapshotDTO(BaseModel):
27
+ """
28
+ DexPoolTokenSnapshotDTO
29
+ """ # noqa: E501
30
+ token_address: StrictStr = Field(description="DTO.DEXPOOL.TOKEN_ADDRESS", alias="tokenAddress")
31
+ token_decimals: StrictInt = Field(description="DTO.DEXPOOL.TOKEN_DECIMALS", alias="tokenDecimals")
32
+ vault_amount: StrictStr = Field(description="DTO.DEXPOOL.VAULT_AMOUNT", alias="vaultAmount")
33
+ amount_in_usd: StrictStr = Field(description="DTO.DEXPOOL.AMOUNT_IN_USD", alias="amountInUsd")
34
+ amount_in_native: StrictStr = Field(description="DTO.DEXPOOL.AMOUNT_IN_NATIVE", alias="amountInNative")
35
+ price_usd: StrictStr = Field(description="DTO.DEXPOOL.PRICE_USD", alias="priceUsd")
36
+ price_native: StrictStr = Field(description="DTO.DEXPOOL.PRICE_NATIVE", alias="priceNative")
37
+ __properties: ClassVar[List[str]] = ["tokenAddress", "tokenDecimals", "vaultAmount", "amountInUsd", "amountInNative", "priceUsd", "priceNative"]
38
+
39
+ model_config = ConfigDict(
40
+ populate_by_name=True,
41
+ validate_assignment=True,
42
+ protected_namespaces=(),
43
+ )
44
+
45
+
46
+ def to_str(self) -> str:
47
+ """Returns the string representation of the model using alias"""
48
+ return pprint.pformat(self.model_dump(by_alias=True))
49
+
50
+ def to_json(self) -> str:
51
+ """Returns the JSON representation of the model using alias"""
52
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
53
+ return json.dumps(self.to_dict())
54
+
55
+ @classmethod
56
+ def from_json(cls, json_str: str) -> Optional[Self]:
57
+ """Create an instance of DexPoolTokenSnapshotDTO from a JSON string"""
58
+ return cls.from_dict(json.loads(json_str))
59
+
60
+ def to_dict(self) -> Dict[str, Any]:
61
+ """Return the dictionary representation of the model using alias.
62
+
63
+ This has the following differences from calling pydantic's
64
+ `self.model_dump(by_alias=True)`:
65
+
66
+ * `None` is only added to the output dict for nullable fields that
67
+ were set at model initialization. Other fields with value `None`
68
+ are ignored.
69
+ """
70
+ excluded_fields: Set[str] = set([
71
+ ])
72
+
73
+ _dict = self.model_dump(
74
+ by_alias=True,
75
+ exclude=excluded_fields,
76
+ exclude_none=True,
77
+ )
78
+ return _dict
79
+
80
+ @classmethod
81
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
82
+ """Create an instance of DexPoolTokenSnapshotDTO from a dict"""
83
+ if obj is None:
84
+ return None
85
+
86
+ if not isinstance(obj, dict):
87
+ return cls.model_validate(obj)
88
+
89
+ _obj = cls.model_validate({
90
+ "tokenAddress": obj.get("tokenAddress"),
91
+ "tokenDecimals": obj.get("tokenDecimals"),
92
+ "vaultAmount": obj.get("vaultAmount"),
93
+ "amountInUsd": obj.get("amountInUsd"),
94
+ "amountInNative": obj.get("amountInNative"),
95
+ "priceUsd": obj.get("priceUsd"),
96
+ "priceNative": obj.get("priceNative")
97
+ })
98
+ return _obj
99
+
100
+
@@ -0,0 +1,98 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Dex Aggregator API
5
+
6
+ Dex Aggregator API ⚡️
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Contact: ai@sx.ai
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class DexQuoteResponse(BaseModel):
27
+ """
28
+ DexQuoteResponse
29
+ """ # noqa: E501
30
+ amount_out: Optional[StrictStr] = Field(default=None, description="DTO.DEX.QUOTE.AMOUNT_OUT", alias="amountOut")
31
+ min_amount_out: Optional[StrictStr] = Field(default=None, description="DTO.DEX.QUOTE.MIN_AMOUNT_OUT", alias="minAmountOut")
32
+ current_price: Optional[StrictStr] = Field(default=None, description="DTO.DEX.QUOTE.CURRENT_PRICE", alias="currentPrice")
33
+ execution_price: Optional[StrictStr] = Field(default=None, description="DTO.DEX.QUOTE.EXECUTION_PRICE", alias="executionPrice")
34
+ price_impact: Optional[StrictStr] = Field(default=None, description="DTO.DEX.QUOTE.PRICE_IMPACT", alias="priceImpact")
35
+ fee: Optional[StrictStr] = Field(default=None, description="DTO.DEX.QUOTE.FEE")
36
+ __properties: ClassVar[List[str]] = ["amountOut", "minAmountOut", "currentPrice", "executionPrice", "priceImpact", "fee"]
37
+
38
+ model_config = ConfigDict(
39
+ populate_by_name=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
+ """Create an instance of DexQuoteResponse from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ ])
71
+
72
+ _dict = self.model_dump(
73
+ by_alias=True,
74
+ exclude=excluded_fields,
75
+ exclude_none=True,
76
+ )
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81
+ """Create an instance of DexQuoteResponse from a dict"""
82
+ if obj is None:
83
+ return None
84
+
85
+ if not isinstance(obj, dict):
86
+ return cls.model_validate(obj)
87
+
88
+ _obj = cls.model_validate({
89
+ "amountOut": obj.get("amountOut"),
90
+ "minAmountOut": obj.get("minAmountOut"),
91
+ "currentPrice": obj.get("currentPrice"),
92
+ "executionPrice": obj.get("executionPrice"),
93
+ "priceImpact": obj.get("priceImpact"),
94
+ "fee": obj.get("fee")
95
+ })
96
+ return _obj
97
+
98
+