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,132 @@
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 WalletPnlDTO(BaseModel):
27
+ """
28
+ WalletPnlDTO
29
+ """ # noqa: E501
30
+ id: StrictInt = Field(description="DTO.WALLET.PNL.ID")
31
+ chain: StrictStr = Field(description="DTO.WALLET.PNL.CHAIN")
32
+ wallet_address: StrictStr = Field(description="DTO.WALLET.PNL.WALLET_ADDRESS", alias="walletAddress")
33
+ token_address: StrictStr = Field(description="DTO.WALLET.PNL.TOKEN_ADDRESS", alias="tokenAddress")
34
+ token_price_in_usd: StrictStr = Field(description="DTO.WALLET.PNL.TOKEN_PRICE", alias="tokenPriceInUsd")
35
+ open_time: StrictInt = Field(description="DTO.WALLET.PNL.OPEN_TIME", alias="openTime")
36
+ close_time: StrictInt = Field(description="DTO.WALLET.PNL.CLOSE_TIME", alias="closeTime")
37
+ last_time: StrictInt = Field(description="DTO.WALLET.PNL.LAST_TIME", alias="lastTime")
38
+ balance: StrictStr = Field(description="DTO.WALLET.PNL.BALANCE")
39
+ buy_amount: StrictStr = Field(description="DTO.WALLET.PNL.BUY_AMOUNT", alias="buyAmount")
40
+ buy_amount_in_usd: StrictStr = Field(description="DTO.WALLET.PNL.BUY_AMOUNT_USD", alias="buyAmountInUsd")
41
+ buys: StrictStr = Field(description="DTO.WALLET.PNL.BUYS")
42
+ sell_amount: StrictStr = Field(description="DTO.WALLET.PNL.SELL_AMOUNT", alias="sellAmount")
43
+ sell_amount_in_usd: StrictStr = Field(description="DTO.WALLET.PNL.SELL_AMOUNT_USD", alias="sellAmountInUsd")
44
+ sells: StrictStr = Field(description="DTO.WALLET.PNL.SELLS")
45
+ average_buy_price_in_usd: StrictStr = Field(description="DTO.WALLET.PNL.AVERAGE_BUY_PRICE", alias="averageBuyPriceInUsd")
46
+ average_sell_price_in_usd: StrictStr = Field(description="DTO.WALLET.PNL.AVERAGE_SELL_PRICE", alias="averageSellPriceInUsd")
47
+ unrealized_profit_in_usd: StrictStr = Field(description="DTO.WALLET.PNL.UNREALIZED_PROFIT", alias="unrealizedProfitInUsd")
48
+ unrealized_profit_ratio: StrictStr = Field(description="DTO.WALLET.PNL.UNREALIZED_PROFIT_RATIO", alias="unrealizedProfitRatio")
49
+ realized_profit_in_usd: StrictStr = Field(description="DTO.WALLET.PNL.REALIZED_PROFIT", alias="realizedProfitInUsd")
50
+ realized_profit_ratio: StrictStr = Field(description="DTO.WALLET.PNL.REALIZED_PROFIT_RATIO", alias="realizedProfitRatio")
51
+ total_realized_profit_in_usd: StrictStr = Field(description="DTO.WALLET.PNL.TOTAL_REALIZED_PROFIT", alias="totalRealizedProfitInUsd")
52
+ total_realized_profit_ratio: StrictStr = Field(description="DTO.WALLET.PNL.TOTAL_REALIZED_PROFIT_RATIO", alias="totalRealizedProfitRatio")
53
+ __properties: ClassVar[List[str]] = ["id", "chain", "walletAddress", "tokenAddress", "tokenPriceInUsd", "openTime", "closeTime", "lastTime", "balance", "buyAmount", "buyAmountInUsd", "buys", "sellAmount", "sellAmountInUsd", "sells", "averageBuyPriceInUsd", "averageSellPriceInUsd", "unrealizedProfitInUsd", "unrealizedProfitRatio", "realizedProfitInUsd", "realizedProfitRatio", "totalRealizedProfitInUsd", "totalRealizedProfitRatio"]
54
+
55
+ model_config = ConfigDict(
56
+ populate_by_name=True,
57
+ validate_assignment=True,
58
+ protected_namespaces=(),
59
+ )
60
+
61
+
62
+ def to_str(self) -> str:
63
+ """Returns the string representation of the model using alias"""
64
+ return pprint.pformat(self.model_dump(by_alias=True))
65
+
66
+ def to_json(self) -> str:
67
+ """Returns the JSON representation of the model using alias"""
68
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
69
+ return json.dumps(self.to_dict())
70
+
71
+ @classmethod
72
+ def from_json(cls, json_str: str) -> Optional[Self]:
73
+ """Create an instance of WalletPnlDTO from a JSON string"""
74
+ return cls.from_dict(json.loads(json_str))
75
+
76
+ def to_dict(self) -> Dict[str, Any]:
77
+ """Return the dictionary representation of the model using alias.
78
+
79
+ This has the following differences from calling pydantic's
80
+ `self.model_dump(by_alias=True)`:
81
+
82
+ * `None` is only added to the output dict for nullable fields that
83
+ were set at model initialization. Other fields with value `None`
84
+ are ignored.
85
+ """
86
+ excluded_fields: Set[str] = set([
87
+ ])
88
+
89
+ _dict = self.model_dump(
90
+ by_alias=True,
91
+ exclude=excluded_fields,
92
+ exclude_none=True,
93
+ )
94
+ return _dict
95
+
96
+ @classmethod
97
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
98
+ """Create an instance of WalletPnlDTO from a dict"""
99
+ if obj is None:
100
+ return None
101
+
102
+ if not isinstance(obj, dict):
103
+ return cls.model_validate(obj)
104
+
105
+ _obj = cls.model_validate({
106
+ "id": obj.get("id"),
107
+ "chain": obj.get("chain"),
108
+ "walletAddress": obj.get("walletAddress"),
109
+ "tokenAddress": obj.get("tokenAddress"),
110
+ "tokenPriceInUsd": obj.get("tokenPriceInUsd"),
111
+ "openTime": obj.get("openTime"),
112
+ "closeTime": obj.get("closeTime"),
113
+ "lastTime": obj.get("lastTime"),
114
+ "balance": obj.get("balance"),
115
+ "buyAmount": obj.get("buyAmount"),
116
+ "buyAmountInUsd": obj.get("buyAmountInUsd"),
117
+ "buys": obj.get("buys"),
118
+ "sellAmount": obj.get("sellAmount"),
119
+ "sellAmountInUsd": obj.get("sellAmountInUsd"),
120
+ "sells": obj.get("sells"),
121
+ "averageBuyPriceInUsd": obj.get("averageBuyPriceInUsd"),
122
+ "averageSellPriceInUsd": obj.get("averageSellPriceInUsd"),
123
+ "unrealizedProfitInUsd": obj.get("unrealizedProfitInUsd"),
124
+ "unrealizedProfitRatio": obj.get("unrealizedProfitRatio"),
125
+ "realizedProfitInUsd": obj.get("realizedProfitInUsd"),
126
+ "realizedProfitRatio": obj.get("realizedProfitRatio"),
127
+ "totalRealizedProfitInUsd": obj.get("totalRealizedProfitInUsd"),
128
+ "totalRealizedProfitRatio": obj.get("totalRealizedProfitRatio")
129
+ })
130
+ return _obj
131
+
132
+
@@ -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
23
+ from chainstream.openapi_client.models.chainalysis_address_identification import ChainalysisAddressIdentification
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class WithdrawalAddressIdentificationsResponseDTO(BaseModel):
28
+ """
29
+ WithdrawalAddressIdentificationsResponseDTO
30
+ """ # noqa: E501
31
+ chainalysis_identifications: List[ChainalysisAddressIdentification] = Field(description="DTO.KYT.WITHDRAWAL_ADDRESS_IDENTIFICATIONS_RESPONSE.CHAINALYSIS_IDENTIFICATIONS", alias="chainalysisIdentifications")
32
+ custom_addresses: List[StrictStr] = Field(description="DTO.KYT.WITHDRAWAL_ADDRESS_IDENTIFICATIONS_RESPONSE.CUSTOM_ADDRESSES", alias="customAddresses")
33
+ __properties: ClassVar[List[str]] = ["chainalysisIdentifications", "customAddresses"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of WithdrawalAddressIdentificationsResponseDTO from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ # override the default output from pydantic by calling `to_dict()` of each item in chainalysis_identifications (list)
75
+ _items = []
76
+ if self.chainalysis_identifications:
77
+ for _item_chainalysis_identifications in self.chainalysis_identifications:
78
+ if _item_chainalysis_identifications:
79
+ _items.append(_item_chainalysis_identifications.to_dict())
80
+ _dict['chainalysisIdentifications'] = _items
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of WithdrawalAddressIdentificationsResponseDTO from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "chainalysisIdentifications": [ChainalysisAddressIdentification.from_dict(_item) for _item in obj["chainalysisIdentifications"]] if obj.get("chainalysisIdentifications") is not None else None,
94
+ "customAddresses": obj.get("customAddresses")
95
+ })
96
+ return _obj
97
+
98
+
@@ -0,0 +1,106 @@
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
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class WithdrawalBaseResponseDTO(BaseModel):
27
+ """
28
+ WithdrawalBaseResponseDTO
29
+ """ # noqa: E501
30
+ asset: StrictStr = Field(description="DTO.KYT.WITHDRAWAL_BASE_RESPONSE.ASSET")
31
+ asset_id: StrictStr = Field(description="DTO.KYT.WITHDRAWAL_BASE_RESPONSE.ASSET_ID", alias="assetId")
32
+ network: StrictStr = Field(description="DTO.KYT.WITHDRAWAL_BASE_RESPONSE.NETWORK")
33
+ address: StrictStr = Field(description="DTO.KYT.WITHDRAWAL_BASE_RESPONSE.ADDRESS")
34
+ memo: StrictStr = Field(description="DTO.KYT.WITHDRAWAL_BASE_RESPONSE.MEMO")
35
+ attempt_identifier: StrictStr = Field(description="DTO.KYT.WITHDRAWAL_BASE_RESPONSE.ATTEMPT_IDENTIFIER", alias="attemptIdentifier")
36
+ asset_amount: StrictStr = Field(description="DTO.KYT.WITHDRAWAL_BASE_RESPONSE.ASSET_AMOUNT", alias="assetAmount")
37
+ external_id: StrictStr = Field(description="DTO.KYT.WITHDRAWAL_BASE_RESPONSE.EXTERNAL_ID", alias="externalId")
38
+ usd_amount: StrictStr = Field(description="DTO.KYT.WITHDRAWAL_BASE_RESPONSE.USD_AMOUNT", alias="usdAmount")
39
+ updated_at: StrictStr = Field(description="DTO.KYT.WITHDRAWAL_BASE_RESPONSE.UPDATED_AT", alias="updatedAt")
40
+ __properties: ClassVar[List[str]] = ["asset", "assetId", "network", "address", "memo", "attemptIdentifier", "assetAmount", "externalId", "usdAmount", "updatedAt"]
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 WithdrawalBaseResponseDTO 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
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of WithdrawalBaseResponseDTO from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "asset": obj.get("asset"),
94
+ "assetId": obj.get("assetId"),
95
+ "network": obj.get("network"),
96
+ "address": obj.get("address"),
97
+ "memo": obj.get("memo"),
98
+ "attemptIdentifier": obj.get("attemptIdentifier"),
99
+ "assetAmount": obj.get("assetAmount"),
100
+ "externalId": obj.get("externalId"),
101
+ "usdAmount": obj.get("usdAmount"),
102
+ "updatedAt": obj.get("updatedAt")
103
+ })
104
+ return _obj
105
+
106
+
@@ -0,0 +1,96 @@
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
22
+ from typing import Any, ClassVar, Dict, List
23
+ from chainstream.openapi_client.models.alterya_identification import AlteryaIdentification
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class WithdrawalFraudAssessmentResponseDTO(BaseModel):
28
+ """
29
+ WithdrawalFraudAssessmentResponseDTO
30
+ """ # noqa: E501
31
+ alterya_identifications: List[AlteryaIdentification] = Field(description="DTO.KYT.WITHDRAWAL_FRAUD_ASSESSMENT_RESPONSE.ALTERYA_IDENTIFICATIONS", alias="alteryaIdentifications")
32
+ __properties: ClassVar[List[str]] = ["alteryaIdentifications"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of WithdrawalFraudAssessmentResponseDTO from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ # override the default output from pydantic by calling `to_dict()` of each item in alterya_identifications (list)
74
+ _items = []
75
+ if self.alterya_identifications:
76
+ for _item_alterya_identifications in self.alterya_identifications:
77
+ if _item_alterya_identifications:
78
+ _items.append(_item_alterya_identifications.to_dict())
79
+ _dict['alteryaIdentifications'] = _items
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of WithdrawalFraudAssessmentResponseDTO from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate({
92
+ "alteryaIdentifications": [AlteryaIdentification.from_dict(_item) for _item in obj["alteryaIdentifications"]] if obj.get("alteryaIdentifications") is not None else None
93
+ })
94
+ return _obj
95
+
96
+
@@ -0,0 +1,213 @@
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
+ import io
17
+ import json
18
+ import re
19
+ import ssl
20
+ from typing import Optional, Union
21
+
22
+ import aiohttp
23
+ import aiohttp_retry
24
+
25
+ from chainstream.openapi_client.exceptions import ApiException, ApiValueError
26
+
27
+ RESTResponseType = aiohttp.ClientResponse
28
+
29
+ ALLOW_RETRY_METHODS = frozenset({'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PUT', 'TRACE'})
30
+
31
+ class RESTResponse(io.IOBase):
32
+
33
+ def __init__(self, resp) -> None:
34
+ self.response = resp
35
+ self.status = resp.status
36
+ self.reason = resp.reason
37
+ self.data = None
38
+
39
+ async def read(self):
40
+ if self.data is None:
41
+ self.data = await self.response.read()
42
+ return self.data
43
+
44
+ def getheaders(self):
45
+ """Returns a CIMultiDictProxy of the response headers."""
46
+ return self.response.headers
47
+
48
+ def getheader(self, name, default=None):
49
+ """Returns a given response header."""
50
+ return self.response.headers.get(name, default)
51
+
52
+
53
+ class RESTClientObject:
54
+
55
+ def __init__(self, configuration) -> None:
56
+
57
+ # maxsize is number of requests to host that are allowed in parallel
58
+ self.maxsize = configuration.connection_pool_maxsize
59
+
60
+ self.ssl_context = ssl.create_default_context(
61
+ cafile=configuration.ssl_ca_cert
62
+ )
63
+ if configuration.cert_file:
64
+ self.ssl_context.load_cert_chain(
65
+ configuration.cert_file, keyfile=configuration.key_file
66
+ )
67
+
68
+ if not configuration.verify_ssl:
69
+ self.ssl_context.check_hostname = False
70
+ self.ssl_context.verify_mode = ssl.CERT_NONE
71
+
72
+ self.proxy = configuration.proxy
73
+ self.proxy_headers = configuration.proxy_headers
74
+
75
+ self.retries = configuration.retries
76
+
77
+ self.pool_manager: Optional[aiohttp.ClientSession] = None
78
+ self.retry_client: Optional[aiohttp_retry.RetryClient] = None
79
+
80
+ async def close(self) -> None:
81
+ if self.pool_manager:
82
+ await self.pool_manager.close()
83
+ if self.retry_client is not None:
84
+ await self.retry_client.close()
85
+
86
+ async def request(
87
+ self,
88
+ method,
89
+ url,
90
+ headers=None,
91
+ body=None,
92
+ post_params=None,
93
+ _request_timeout=None
94
+ ):
95
+ """Execute request
96
+
97
+ :param method: http request method
98
+ :param url: http request url
99
+ :param headers: http request headers
100
+ :param body: request json body, for `application/json`
101
+ :param post_params: request post parameters,
102
+ `application/x-www-form-urlencoded`
103
+ and `multipart/form-data`
104
+ :param _request_timeout: timeout setting for this request. If one
105
+ number provided, it will be total request
106
+ timeout. It can also be a pair (tuple) of
107
+ (connection, read) timeouts.
108
+ """
109
+ method = method.upper()
110
+ assert method in [
111
+ 'GET',
112
+ 'HEAD',
113
+ 'DELETE',
114
+ 'POST',
115
+ 'PUT',
116
+ 'PATCH',
117
+ 'OPTIONS'
118
+ ]
119
+
120
+ if post_params and body:
121
+ raise ApiValueError(
122
+ "body parameter cannot be used with post_params parameter."
123
+ )
124
+
125
+ post_params = post_params or {}
126
+ headers = headers or {}
127
+ # url already contains the URL query string
128
+ timeout = _request_timeout or 5 * 60
129
+
130
+ if 'Content-Type' not in headers:
131
+ headers['Content-Type'] = 'application/json'
132
+
133
+ args = {
134
+ "method": method,
135
+ "url": url,
136
+ "timeout": timeout,
137
+ "headers": headers
138
+ }
139
+
140
+ if self.proxy:
141
+ args["proxy"] = self.proxy
142
+ if self.proxy_headers:
143
+ args["proxy_headers"] = self.proxy_headers
144
+
145
+ # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
146
+ if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
147
+ if re.search('json', headers['Content-Type'], re.IGNORECASE):
148
+ if body is not None:
149
+ body = json.dumps(body)
150
+ args["data"] = body
151
+ elif headers['Content-Type'] == 'application/x-www-form-urlencoded':
152
+ args["data"] = aiohttp.FormData(post_params)
153
+ elif headers['Content-Type'] == 'multipart/form-data':
154
+ # must del headers['Content-Type'], or the correct
155
+ # Content-Type which generated by aiohttp
156
+ del headers['Content-Type']
157
+ data = aiohttp.FormData()
158
+ for param in post_params:
159
+ k, v = param
160
+ if isinstance(v, tuple) and len(v) == 3:
161
+ data.add_field(
162
+ k,
163
+ value=v[1],
164
+ filename=v[0],
165
+ content_type=v[2]
166
+ )
167
+ else:
168
+ # Ensures that dict objects are serialized
169
+ if isinstance(v, dict):
170
+ v = json.dumps(v)
171
+ elif isinstance(v, int):
172
+ v = str(v)
173
+ data.add_field(k, v)
174
+ args["data"] = data
175
+
176
+ # Pass a `bytes` or `str` parameter directly in the body to support
177
+ # other content types than Json when `body` argument is provided
178
+ # in serialized form
179
+ elif isinstance(body, str) or isinstance(body, bytes):
180
+ args["data"] = body
181
+ else:
182
+ # Cannot generate the request from given parameters
183
+ msg = """Cannot prepare a request message for provided
184
+ arguments. Please check that your arguments match
185
+ declared content type."""
186
+ raise ApiException(status=0, reason=msg)
187
+
188
+ pool_manager: Union[aiohttp.ClientSession, aiohttp_retry.RetryClient]
189
+
190
+ # https pool manager
191
+ if self.pool_manager is None:
192
+ self.pool_manager = aiohttp.ClientSession(
193
+ connector=aiohttp.TCPConnector(limit=self.maxsize, ssl=self.ssl_context),
194
+ trust_env=True,
195
+ )
196
+ pool_manager = self.pool_manager
197
+
198
+ if self.retries is not None and method in ALLOW_RETRY_METHODS:
199
+ if self.retry_client is None:
200
+ self.retry_client = aiohttp_retry.RetryClient(
201
+ client_session=self.pool_manager,
202
+ retry_options=aiohttp_retry.ExponentialRetry(
203
+ attempts=self.retries,
204
+ factor=2.0,
205
+ start_timeout=0.1,
206
+ max_timeout=120.0
207
+ )
208
+ )
209
+ pool_manager = self.retry_client
210
+
211
+ r = await pool_manager.request(**args)
212
+
213
+ return RESTResponse(r)
File without changes