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.
- chainstream/__init__.py +46 -0
- chainstream/client.py +104 -0
- chainstream/openapi_client/__init__.py +156 -0
- chainstream/openapi_client/api/__init__.py +20 -0
- chainstream/openapi_client/api/blockchain_api.py +549 -0
- chainstream/openapi_client/api/defi_sol_moonshot_api.py +590 -0
- chainstream/openapi_client/api/defi_sol_pumpfun_api.py +314 -0
- chainstream/openapi_client/api/dex_api.py +1576 -0
- chainstream/openapi_client/api/dex_pool_api.py +645 -0
- chainstream/openapi_client/api/endpoint_api.py +1934 -0
- chainstream/openapi_client/api/ipfs_api.py +283 -0
- chainstream/openapi_client/api/jobs_api.py +562 -0
- chainstream/openapi_client/api/kyt_api.py +3743 -0
- chainstream/openapi_client/api/ranking_api.py +2067 -0
- chainstream/openapi_client/api/red_packet_api.py +2444 -0
- chainstream/openapi_client/api/token_api.py +9211 -0
- chainstream/openapi_client/api/trade_api.py +1352 -0
- chainstream/openapi_client/api/transaction_api.py +882 -0
- chainstream/openapi_client/api/wallet_api.py +1608 -0
- chainstream/openapi_client/api/watchlist_api.py +316 -0
- chainstream/openapi_client/api_client.py +801 -0
- chainstream/openapi_client/api_response.py +21 -0
- chainstream/openapi_client/configuration.py +572 -0
- chainstream/openapi_client/exceptions.py +217 -0
- chainstream/openapi_client/models/__init__.py +122 -0
- chainstream/openapi_client/models/address_exposure.py +94 -0
- chainstream/openapi_client/models/address_risk_response_dto.py +112 -0
- chainstream/openapi_client/models/alert_detail.py +100 -0
- chainstream/openapi_client/models/alterya_identification.py +106 -0
- chainstream/openapi_client/models/balance_change_type.py +38 -0
- chainstream/openapi_client/models/balance_token_type.py +38 -0
- chainstream/openapi_client/models/balance_update_dto.py +130 -0
- chainstream/openapi_client/models/balance_update_page.py +104 -0
- chainstream/openapi_client/models/blockchain_dto.py +94 -0
- chainstream/openapi_client/models/blockchain_latest_block_dto.py +90 -0
- chainstream/openapi_client/models/boolean_result_dto.py +88 -0
- chainstream/openapi_client/models/calculate_pnl_input.py +88 -0
- chainstream/openapi_client/models/candle.py +101 -0
- chainstream/openapi_client/models/chain.py +39 -0
- chainstream/openapi_client/models/chain_symbol.py +39 -0
- chainstream/openapi_client/models/chainalysis_address_identification.py +92 -0
- chainstream/openapi_client/models/claim_red_packet_input.py +103 -0
- chainstream/openapi_client/models/create_endpoint_input.py +102 -0
- chainstream/openapi_client/models/create_red_packet_input.py +112 -0
- chainstream/openapi_client/models/create_red_packet_reply.py +90 -0
- chainstream/openapi_client/models/create_token_input.py +110 -0
- chainstream/openapi_client/models/create_token_reply.py +90 -0
- chainstream/openapi_client/models/dev_token_dto.py +106 -0
- chainstream/openapi_client/models/dex_dto.py +94 -0
- chainstream/openapi_client/models/dex_page.py +106 -0
- chainstream/openapi_client/models/dex_pool_dto.py +161 -0
- chainstream/openapi_client/models/dex_pool_snapshot_dto.py +111 -0
- chainstream/openapi_client/models/dex_pool_snapshot_page.py +104 -0
- chainstream/openapi_client/models/dex_pool_token_liquidity.py +100 -0
- chainstream/openapi_client/models/dex_pool_token_snapshot_dto.py +100 -0
- chainstream/openapi_client/models/dex_quote_response.py +98 -0
- chainstream/openapi_client/models/direct_exposure_detail.py +90 -0
- chainstream/openapi_client/models/endpoint_list_response.py +102 -0
- chainstream/openapi_client/models/endpoint_operation_response.py +88 -0
- chainstream/openapi_client/models/endpoint_response.py +108 -0
- chainstream/openapi_client/models/endpoint_secret_response.py +88 -0
- chainstream/openapi_client/models/estimate_gas_limit_input.py +94 -0
- chainstream/openapi_client/models/estimate_gas_limit_response.py +90 -0
- chainstream/openapi_client/models/filter_condition.py +102 -0
- chainstream/openapi_client/models/gas_price_response.py +90 -0
- chainstream/openapi_client/models/job_dto.py +90 -0
- chainstream/openapi_client/models/job_streaming_dto.py +90 -0
- chainstream/openapi_client/models/kyt_register_transfer_request.py +108 -0
- chainstream/openapi_client/models/kyt_register_withdrawal_request.py +111 -0
- chainstream/openapi_client/models/link.py +97 -0
- chainstream/openapi_client/models/moonshot_create_token_input.py +145 -0
- chainstream/openapi_client/models/moonshot_create_token_reply.py +90 -0
- chainstream/openapi_client/models/moonshot_submit_create_token200_response.py +90 -0
- chainstream/openapi_client/models/moonshot_submit_create_token_input.py +90 -0
- chainstream/openapi_client/models/network_identification_org.py +88 -0
- chainstream/openapi_client/models/on_chain_activity.py +88 -0
- chainstream/openapi_client/models/pump_create_token_input.py +155 -0
- chainstream/openapi_client/models/pump_create_token_reply.py +90 -0
- chainstream/openapi_client/models/red_packet_claim_dto.py +103 -0
- chainstream/openapi_client/models/red_packet_claims_page.py +104 -0
- chainstream/openapi_client/models/red_packet_dto.py +121 -0
- chainstream/openapi_client/models/red_packet_reply.py +88 -0
- chainstream/openapi_client/models/red_packet_send_tx_input.py +88 -0
- chainstream/openapi_client/models/red_packet_send_tx_response.py +88 -0
- chainstream/openapi_client/models/red_packets_page.py +104 -0
- chainstream/openapi_client/models/register_address_request.py +88 -0
- chainstream/openapi_client/models/register_address_response_dto.py +88 -0
- chainstream/openapi_client/models/resolution.py +46 -0
- chainstream/openapi_client/models/send_tx_input.py +102 -0
- chainstream/openapi_client/models/send_tx_response.py +92 -0
- chainstream/openapi_client/models/swap_input.py +119 -0
- chainstream/openapi_client/models/swap_reply.py +90 -0
- chainstream/openapi_client/models/swap_route_input.py +127 -0
- chainstream/openapi_client/models/swap_route_response.py +98 -0
- chainstream/openapi_client/models/token.py +158 -0
- chainstream/openapi_client/models/token_creation_dto.py +107 -0
- chainstream/openapi_client/models/token_creation_page.py +106 -0
- chainstream/openapi_client/models/token_creators_dto.py +92 -0
- chainstream/openapi_client/models/token_extra_dto.py +128 -0
- chainstream/openapi_client/models/token_holder.py +94 -0
- chainstream/openapi_client/models/token_holder_page.py +106 -0
- chainstream/openapi_client/models/token_liquidity_snapshot_dto.py +106 -0
- chainstream/openapi_client/models/token_liquidity_snapshot_page.py +104 -0
- chainstream/openapi_client/models/token_list_page.py +106 -0
- chainstream/openapi_client/models/token_market_data.py +174 -0
- chainstream/openapi_client/models/token_metadata.py +132 -0
- chainstream/openapi_client/models/token_page.py +108 -0
- chainstream/openapi_client/models/token_price_dto.py +94 -0
- chainstream/openapi_client/models/token_price_page.py +106 -0
- chainstream/openapi_client/models/token_social_medias_dto.py +112 -0
- chainstream/openapi_client/models/token_stat.py +340 -0
- chainstream/openapi_client/models/token_trader.py +113 -0
- chainstream/openapi_client/models/token_trader_tag.py +45 -0
- chainstream/openapi_client/models/top_traders_dto.py +110 -0
- chainstream/openapi_client/models/top_traders_page.py +106 -0
- chainstream/openapi_client/models/trade_detail_dto.py +136 -0
- chainstream/openapi_client/models/trade_event.py +113 -0
- chainstream/openapi_client/models/trade_page.py +106 -0
- chainstream/openapi_client/models/trade_type.py +38 -0
- chainstream/openapi_client/models/transfer_alerts_response_dto.py +96 -0
- chainstream/openapi_client/models/transfer_base_response_dto.py +112 -0
- chainstream/openapi_client/models/transfer_direct_exposure_response_dto.py +92 -0
- chainstream/openapi_client/models/transfer_network_identifications_response_dto.py +98 -0
- chainstream/openapi_client/models/update_endpoint_input.py +104 -0
- chainstream/openapi_client/models/wallet_balance_detail_dto.py +136 -0
- chainstream/openapi_client/models/wallet_balances_dto.py +100 -0
- chainstream/openapi_client/models/wallet_pnl_dto.py +132 -0
- chainstream/openapi_client/models/withdrawal_address_identifications_response_dto.py +98 -0
- chainstream/openapi_client/models/withdrawal_base_response_dto.py +106 -0
- chainstream/openapi_client/models/withdrawal_fraud_assessment_response_dto.py +96 -0
- chainstream/openapi_client/rest.py +213 -0
- chainstream/openapi_client/test/__init__.py +0 -0
- chainstream/openapi_client/test/test_address_exposure.py +59 -0
- chainstream/openapi_client/test/test_address_risk_response_dto.py +81 -0
- chainstream/openapi_client/test/test_alert_detail.py +65 -0
- chainstream/openapi_client/test/test_alterya_identification.py +69 -0
- chainstream/openapi_client/test/test_balance_change_type.py +34 -0
- chainstream/openapi_client/test/test_balance_token_type.py +34 -0
- chainstream/openapi_client/test/test_balance_update_dto.py +93 -0
- chainstream/openapi_client/test/test_balance_update_page.py +105 -0
- chainstream/openapi_client/test/test_blockchain_api.py +46 -0
- chainstream/openapi_client/test/test_blockchain_dto.py +59 -0
- chainstream/openapi_client/test/test_blockchain_latest_block_dto.py +55 -0
- chainstream/openapi_client/test/test_boolean_result_dto.py +53 -0
- chainstream/openapi_client/test/test_calculate_pnl_input.py +52 -0
- chainstream/openapi_client/test/test_candle.py +65 -0
- chainstream/openapi_client/test/test_chain.py +34 -0
- chainstream/openapi_client/test/test_chain_symbol.py +34 -0
- chainstream/openapi_client/test/test_chainalysis_address_identification.py +57 -0
- chainstream/openapi_client/test/test_claim_red_packet_input.py +58 -0
- chainstream/openapi_client/test/test_create_endpoint_input.py +63 -0
- chainstream/openapi_client/test/test_create_red_packet_input.py +64 -0
- chainstream/openapi_client/test/test_create_red_packet_reply.py +55 -0
- chainstream/openapi_client/test/test_create_token_input.py +63 -0
- chainstream/openapi_client/test/test_create_token_reply.py +55 -0
- chainstream/openapi_client/test/test_defi_sol_moonshot_api.py +46 -0
- chainstream/openapi_client/test/test_defi_sol_pumpfun_api.py +39 -0
- chainstream/openapi_client/test/test_dev_token_dto.py +441 -0
- chainstream/openapi_client/test/test_dex_api.py +67 -0
- chainstream/openapi_client/test/test_dex_dto.py +56 -0
- chainstream/openapi_client/test/test_dex_page.py +70 -0
- chainstream/openapi_client/test/test_dex_pool_api.py +46 -0
- chainstream/openapi_client/test/test_dex_pool_dto.py +88 -0
- chainstream/openapi_client/test/test_dex_pool_snapshot_dto.py +96 -0
- chainstream/openapi_client/test/test_dex_pool_snapshot_page.py +81 -0
- chainstream/openapi_client/test/test_dex_pool_token_liquidity.py +65 -0
- chainstream/openapi_client/test/test_dex_pool_token_snapshot_dto.py +65 -0
- chainstream/openapi_client/test/test_dex_quote_response.py +57 -0
- chainstream/openapi_client/test/test_direct_exposure_detail.py +55 -0
- chainstream/openapi_client/test/test_endpoint_api.py +81 -0
- chainstream/openapi_client/test/test_endpoint_list_response.py +72 -0
- chainstream/openapi_client/test/test_endpoint_operation_response.py +52 -0
- chainstream/openapi_client/test/test_endpoint_response.py +66 -0
- chainstream/openapi_client/test/test_endpoint_secret_response.py +52 -0
- chainstream/openapi_client/test/test_estimate_gas_limit_input.py +58 -0
- chainstream/openapi_client/test/test_estimate_gas_limit_response.py +55 -0
- chainstream/openapi_client/test/test_filter_condition.py +54 -0
- chainstream/openapi_client/test/test_gas_price_response.py +55 -0
- chainstream/openapi_client/test/test_ipfs_api.py +39 -0
- chainstream/openapi_client/test/test_job_dto.py +55 -0
- chainstream/openapi_client/test/test_job_streaming_dto.py +55 -0
- chainstream/openapi_client/test/test_jobs_api.py +46 -0
- chainstream/openapi_client/test/test_kyt_api.py +130 -0
- chainstream/openapi_client/test/test_kyt_register_transfer_request.py +59 -0
- chainstream/openapi_client/test/test_kyt_register_withdrawal_request.py +65 -0
- chainstream/openapi_client/test/test_link.py +55 -0
- chainstream/openapi_client/test/test_moonshot_create_token_input.py +79 -0
- chainstream/openapi_client/test/test_moonshot_create_token_reply.py +55 -0
- chainstream/openapi_client/test/test_moonshot_submit_create_token200_response.py +53 -0
- chainstream/openapi_client/test/test_moonshot_submit_create_token_input.py +54 -0
- chainstream/openapi_client/test/test_network_identification_org.py +53 -0
- chainstream/openapi_client/test/test_on_chain_activity.py +53 -0
- chainstream/openapi_client/test/test_pump_create_token_input.py +71 -0
- chainstream/openapi_client/test/test_pump_create_token_reply.py +54 -0
- chainstream/openapi_client/test/test_ranking_api.py +67 -0
- chainstream/openapi_client/test/test_red_packet_api.py +88 -0
- chainstream/openapi_client/test/test_red_packet_claim_dto.py +67 -0
- chainstream/openapi_client/test/test_red_packet_claims_page.py +81 -0
- chainstream/openapi_client/test/test_red_packet_dto.py +85 -0
- chainstream/openapi_client/test/test_red_packet_reply.py +53 -0
- chainstream/openapi_client/test/test_red_packet_send_tx_input.py +53 -0
- chainstream/openapi_client/test/test_red_packet_send_tx_response.py +53 -0
- chainstream/openapi_client/test/test_red_packets_page.py +99 -0
- chainstream/openapi_client/test/test_register_address_request.py +53 -0
- chainstream/openapi_client/test/test_register_address_response_dto.py +53 -0
- chainstream/openapi_client/test/test_resolution.py +34 -0
- chainstream/openapi_client/test/test_send_tx_input.py +55 -0
- chainstream/openapi_client/test/test_send_tx_response.py +57 -0
- chainstream/openapi_client/test/test_swap_input.py +65 -0
- chainstream/openapi_client/test/test_swap_reply.py +55 -0
- chainstream/openapi_client/test/test_swap_route_input.py +69 -0
- chainstream/openapi_client/test/test_swap_route_response.py +85 -0
- chainstream/openapi_client/test/test_token.py +352 -0
- chainstream/openapi_client/test/test_token_api.py +193 -0
- chainstream/openapi_client/test/test_token_creation_dto.py +64 -0
- chainstream/openapi_client/test/test_token_creation_page.py +76 -0
- chainstream/openapi_client/test/test_token_creators_dto.py +54 -0
- chainstream/openapi_client/test/test_token_extra_dto.py +72 -0
- chainstream/openapi_client/test/test_token_holder.py +59 -0
- chainstream/openapi_client/test/test_token_holder_page.py +70 -0
- chainstream/openapi_client/test/test_token_liquidity_snapshot_dto.py +71 -0
- chainstream/openapi_client/test/test_token_liquidity_snapshot_page.py +83 -0
- chainstream/openapi_client/test/test_token_list_page.py +154 -0
- chainstream/openapi_client/test/test_token_market_data.py +101 -0
- chainstream/openapi_client/test/test_token_metadata.py +110 -0
- chainstream/openapi_client/test/test_token_page.py +155 -0
- chainstream/openapi_client/test/test_token_price_dto.py +59 -0
- chainstream/openapi_client/test/test_token_price_page.py +70 -0
- chainstream/openapi_client/test/test_token_social_medias_dto.py +64 -0
- chainstream/openapi_client/test/test_token_stat.py +257 -0
- chainstream/openapi_client/test/test_token_trader.py +65 -0
- chainstream/openapi_client/test/test_token_trader_tag.py +34 -0
- chainstream/openapi_client/test/test_top_traders_dto.py +75 -0
- chainstream/openapi_client/test/test_top_traders_page.py +86 -0
- chainstream/openapi_client/test/test_trade_api.py +53 -0
- chainstream/openapi_client/test/test_trade_detail_dto.py +101 -0
- chainstream/openapi_client/test/test_trade_event.py +77 -0
- chainstream/openapi_client/test/test_trade_page.py +112 -0
- chainstream/openapi_client/test/test_trade_type.py +34 -0
- chainstream/openapi_client/test/test_transaction_api.py +53 -0
- chainstream/openapi_client/test/test_transfer_alerts_response_dto.py +71 -0
- chainstream/openapi_client/test/test_transfer_base_response_dto.py +77 -0
- chainstream/openapi_client/test/test_transfer_direct_exposure_response_dto.py +57 -0
- chainstream/openapi_client/test/test_transfer_network_identifications_response_dto.py +61 -0
- chainstream/openapi_client/test/test_update_endpoint_input.py +64 -0
- chainstream/openapi_client/test/test_wallet_api.py +67 -0
- chainstream/openapi_client/test/test_wallet_balance_detail_dto.py +101 -0
- chainstream/openapi_client/test/test_wallet_balances_dto.py +111 -0
- chainstream/openapi_client/test/test_wallet_pnl_dto.py +97 -0
- chainstream/openapi_client/test/test_watchlist_api.py +39 -0
- chainstream/openapi_client/test/test_withdrawal_address_identifications_response_dto.py +65 -0
- chainstream/openapi_client/test/test_withdrawal_base_response_dto.py +71 -0
- chainstream/openapi_client/test/test_withdrawal_fraud_assessment_response_dto.py +73 -0
- chainstream/stream/__init__.py +74 -0
- chainstream/stream/client.py +761 -0
- chainstream/stream/fields.py +284 -0
- chainstream/stream/models.py +415 -0
- chainstream_sdk-0.1.0.dist-info/METADATA +80 -0
- chainstream_sdk-0.1.0.dist-info/RECORD +261 -0
- chainstream_sdk-0.1.0.dist-info/WHEEL +4 -0
- chainstream_sdk-0.1.0.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,217 @@
|
|
|
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
|
+
from typing import Any, Optional
|
|
16
|
+
from typing_extensions import Self
|
|
17
|
+
|
|
18
|
+
class OpenApiException(Exception):
|
|
19
|
+
"""The base exception class for all OpenAPIExceptions"""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class ApiTypeError(OpenApiException, TypeError):
|
|
23
|
+
def __init__(self, msg, path_to_item=None, valid_classes=None,
|
|
24
|
+
key_type=None) -> None:
|
|
25
|
+
""" Raises an exception for TypeErrors
|
|
26
|
+
|
|
27
|
+
Args:
|
|
28
|
+
msg (str): the exception message
|
|
29
|
+
|
|
30
|
+
Keyword Args:
|
|
31
|
+
path_to_item (list): a list of keys an indices to get to the
|
|
32
|
+
current_item
|
|
33
|
+
None if unset
|
|
34
|
+
valid_classes (tuple): the primitive classes that current item
|
|
35
|
+
should be an instance of
|
|
36
|
+
None if unset
|
|
37
|
+
key_type (bool): False if our value is a value in a dict
|
|
38
|
+
True if it is a key in a dict
|
|
39
|
+
False if our item is an item in a list
|
|
40
|
+
None if unset
|
|
41
|
+
"""
|
|
42
|
+
self.path_to_item = path_to_item
|
|
43
|
+
self.valid_classes = valid_classes
|
|
44
|
+
self.key_type = key_type
|
|
45
|
+
full_msg = msg
|
|
46
|
+
if path_to_item:
|
|
47
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
48
|
+
super(ApiTypeError, self).__init__(full_msg)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class ApiValueError(OpenApiException, ValueError):
|
|
52
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
53
|
+
"""
|
|
54
|
+
Args:
|
|
55
|
+
msg (str): the exception message
|
|
56
|
+
|
|
57
|
+
Keyword Args:
|
|
58
|
+
path_to_item (list) the path to the exception in the
|
|
59
|
+
received_data dict. None if unset
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
self.path_to_item = path_to_item
|
|
63
|
+
full_msg = msg
|
|
64
|
+
if path_to_item:
|
|
65
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
66
|
+
super(ApiValueError, self).__init__(full_msg)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class ApiAttributeError(OpenApiException, AttributeError):
|
|
70
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
71
|
+
"""
|
|
72
|
+
Raised when an attribute reference or assignment fails.
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
msg (str): the exception message
|
|
76
|
+
|
|
77
|
+
Keyword Args:
|
|
78
|
+
path_to_item (None/list) the path to the exception in the
|
|
79
|
+
received_data dict
|
|
80
|
+
"""
|
|
81
|
+
self.path_to_item = path_to_item
|
|
82
|
+
full_msg = msg
|
|
83
|
+
if path_to_item:
|
|
84
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
85
|
+
super(ApiAttributeError, self).__init__(full_msg)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
class ApiKeyError(OpenApiException, KeyError):
|
|
89
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
90
|
+
"""
|
|
91
|
+
Args:
|
|
92
|
+
msg (str): the exception message
|
|
93
|
+
|
|
94
|
+
Keyword Args:
|
|
95
|
+
path_to_item (None/list) the path to the exception in the
|
|
96
|
+
received_data dict
|
|
97
|
+
"""
|
|
98
|
+
self.path_to_item = path_to_item
|
|
99
|
+
full_msg = msg
|
|
100
|
+
if path_to_item:
|
|
101
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
102
|
+
super(ApiKeyError, self).__init__(full_msg)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
class ApiException(OpenApiException):
|
|
106
|
+
|
|
107
|
+
def __init__(
|
|
108
|
+
self,
|
|
109
|
+
status=None,
|
|
110
|
+
reason=None,
|
|
111
|
+
http_resp=None,
|
|
112
|
+
*,
|
|
113
|
+
body: Optional[str] = None,
|
|
114
|
+
data: Optional[Any] = None,
|
|
115
|
+
) -> None:
|
|
116
|
+
self.status = status
|
|
117
|
+
self.reason = reason
|
|
118
|
+
self.body = body
|
|
119
|
+
self.data = data
|
|
120
|
+
self.headers = None
|
|
121
|
+
|
|
122
|
+
if http_resp:
|
|
123
|
+
if self.status is None:
|
|
124
|
+
self.status = http_resp.status
|
|
125
|
+
if self.reason is None:
|
|
126
|
+
self.reason = http_resp.reason
|
|
127
|
+
if self.body is None:
|
|
128
|
+
try:
|
|
129
|
+
self.body = http_resp.data.decode('utf-8')
|
|
130
|
+
except Exception:
|
|
131
|
+
pass
|
|
132
|
+
self.headers = http_resp.getheaders()
|
|
133
|
+
|
|
134
|
+
@classmethod
|
|
135
|
+
def from_response(
|
|
136
|
+
cls,
|
|
137
|
+
*,
|
|
138
|
+
http_resp,
|
|
139
|
+
body: Optional[str],
|
|
140
|
+
data: Optional[Any],
|
|
141
|
+
) -> Self:
|
|
142
|
+
if http_resp.status == 400:
|
|
143
|
+
raise BadRequestException(http_resp=http_resp, body=body, data=data)
|
|
144
|
+
|
|
145
|
+
if http_resp.status == 401:
|
|
146
|
+
raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
|
|
147
|
+
|
|
148
|
+
if http_resp.status == 403:
|
|
149
|
+
raise ForbiddenException(http_resp=http_resp, body=body, data=data)
|
|
150
|
+
|
|
151
|
+
if http_resp.status == 404:
|
|
152
|
+
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
|
153
|
+
|
|
154
|
+
# Added new conditions for 409 and 422
|
|
155
|
+
if http_resp.status == 409:
|
|
156
|
+
raise ConflictException(http_resp=http_resp, body=body, data=data)
|
|
157
|
+
|
|
158
|
+
if http_resp.status == 422:
|
|
159
|
+
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
|
|
160
|
+
|
|
161
|
+
if 500 <= http_resp.status <= 599:
|
|
162
|
+
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
|
163
|
+
raise ApiException(http_resp=http_resp, body=body, data=data)
|
|
164
|
+
|
|
165
|
+
def __str__(self):
|
|
166
|
+
"""Custom error messages for exception"""
|
|
167
|
+
error_message = "({0})\n"\
|
|
168
|
+
"Reason: {1}\n".format(self.status, self.reason)
|
|
169
|
+
if self.headers:
|
|
170
|
+
error_message += "HTTP response headers: {0}\n".format(
|
|
171
|
+
self.headers)
|
|
172
|
+
|
|
173
|
+
if self.data or self.body:
|
|
174
|
+
error_message += "HTTP response body: {0}\n".format(self.data or self.body)
|
|
175
|
+
|
|
176
|
+
return error_message
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
class BadRequestException(ApiException):
|
|
180
|
+
pass
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
class NotFoundException(ApiException):
|
|
184
|
+
pass
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
class UnauthorizedException(ApiException):
|
|
188
|
+
pass
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
class ForbiddenException(ApiException):
|
|
192
|
+
pass
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
class ServiceException(ApiException):
|
|
196
|
+
pass
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
class ConflictException(ApiException):
|
|
200
|
+
"""Exception for HTTP 409 Conflict."""
|
|
201
|
+
pass
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
class UnprocessableEntityException(ApiException):
|
|
205
|
+
"""Exception for HTTP 422 Unprocessable Entity."""
|
|
206
|
+
pass
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
def render_path(path_to_item):
|
|
210
|
+
"""Returns a string representation of a path"""
|
|
211
|
+
result = ""
|
|
212
|
+
for pth in path_to_item:
|
|
213
|
+
if isinstance(pth, int):
|
|
214
|
+
result += "[{0}]".format(pth)
|
|
215
|
+
else:
|
|
216
|
+
result += "['{0}']".format(pth)
|
|
217
|
+
return result
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
"""
|
|
5
|
+
Dex Aggregator API
|
|
6
|
+
|
|
7
|
+
Dex Aggregator API ⚡️
|
|
8
|
+
|
|
9
|
+
The version of the OpenAPI document: 1.0
|
|
10
|
+
Contact: ai@sx.ai
|
|
11
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
12
|
+
|
|
13
|
+
Do not edit the class manually.
|
|
14
|
+
""" # noqa: E501
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# import models into model package
|
|
18
|
+
from chainstream.openapi_client.models.address_exposure import AddressExposure
|
|
19
|
+
from chainstream.openapi_client.models.address_risk_response_dto import AddressRiskResponseDTO
|
|
20
|
+
from chainstream.openapi_client.models.alert_detail import AlertDetail
|
|
21
|
+
from chainstream.openapi_client.models.alterya_identification import AlteryaIdentification
|
|
22
|
+
from chainstream.openapi_client.models.balance_change_type import BalanceChangeType
|
|
23
|
+
from chainstream.openapi_client.models.balance_token_type import BalanceTokenType
|
|
24
|
+
from chainstream.openapi_client.models.balance_update_dto import BalanceUpdateDTO
|
|
25
|
+
from chainstream.openapi_client.models.balance_update_page import BalanceUpdatePage
|
|
26
|
+
from chainstream.openapi_client.models.blockchain_dto import BlockchainDTO
|
|
27
|
+
from chainstream.openapi_client.models.blockchain_latest_block_dto import BlockchainLatestBlockDTO
|
|
28
|
+
from chainstream.openapi_client.models.boolean_result_dto import BooleanResultDTO
|
|
29
|
+
from chainstream.openapi_client.models.calculate_pnl_input import CalculatePnlInput
|
|
30
|
+
from chainstream.openapi_client.models.candle import Candle
|
|
31
|
+
from chainstream.openapi_client.models.chain import Chain
|
|
32
|
+
from chainstream.openapi_client.models.chain_symbol import ChainSymbol
|
|
33
|
+
from chainstream.openapi_client.models.chainalysis_address_identification import ChainalysisAddressIdentification
|
|
34
|
+
from chainstream.openapi_client.models.claim_red_packet_input import ClaimRedPacketInput
|
|
35
|
+
from chainstream.openapi_client.models.create_endpoint_input import CreateEndpointInput
|
|
36
|
+
from chainstream.openapi_client.models.create_red_packet_input import CreateRedPacketInput
|
|
37
|
+
from chainstream.openapi_client.models.create_red_packet_reply import CreateRedPacketReply
|
|
38
|
+
from chainstream.openapi_client.models.create_token_input import CreateTokenInput
|
|
39
|
+
from chainstream.openapi_client.models.create_token_reply import CreateTokenReply
|
|
40
|
+
from chainstream.openapi_client.models.dev_token_dto import DevTokenDTO
|
|
41
|
+
from chainstream.openapi_client.models.dex_dto import DexDTO
|
|
42
|
+
from chainstream.openapi_client.models.dex_page import DexPage
|
|
43
|
+
from chainstream.openapi_client.models.dex_pool_dto import DexPoolDTO
|
|
44
|
+
from chainstream.openapi_client.models.dex_pool_snapshot_dto import DexPoolSnapshotDTO
|
|
45
|
+
from chainstream.openapi_client.models.dex_pool_snapshot_page import DexPoolSnapshotPage
|
|
46
|
+
from chainstream.openapi_client.models.dex_pool_token_liquidity import DexPoolTokenLiquidity
|
|
47
|
+
from chainstream.openapi_client.models.dex_pool_token_snapshot_dto import DexPoolTokenSnapshotDTO
|
|
48
|
+
from chainstream.openapi_client.models.dex_quote_response import DexQuoteResponse
|
|
49
|
+
from chainstream.openapi_client.models.direct_exposure_detail import DirectExposureDetail
|
|
50
|
+
from chainstream.openapi_client.models.endpoint_list_response import EndpointListResponse
|
|
51
|
+
from chainstream.openapi_client.models.endpoint_operation_response import EndpointOperationResponse
|
|
52
|
+
from chainstream.openapi_client.models.endpoint_response import EndpointResponse
|
|
53
|
+
from chainstream.openapi_client.models.endpoint_secret_response import EndpointSecretResponse
|
|
54
|
+
from chainstream.openapi_client.models.estimate_gas_limit_input import EstimateGasLimitInput
|
|
55
|
+
from chainstream.openapi_client.models.estimate_gas_limit_response import EstimateGasLimitResponse
|
|
56
|
+
from chainstream.openapi_client.models.filter_condition import FilterCondition
|
|
57
|
+
from chainstream.openapi_client.models.gas_price_response import GasPriceResponse
|
|
58
|
+
from chainstream.openapi_client.models.job_dto import JobDTO
|
|
59
|
+
from chainstream.openapi_client.models.job_streaming_dto import JobStreamingDTO
|
|
60
|
+
from chainstream.openapi_client.models.kyt_register_transfer_request import KYTRegisterTransferRequest
|
|
61
|
+
from chainstream.openapi_client.models.kyt_register_withdrawal_request import KYTRegisterWithdrawalRequest
|
|
62
|
+
from chainstream.openapi_client.models.link import Link
|
|
63
|
+
from chainstream.openapi_client.models.moonshot_create_token_input import MoonshotCreateTokenInput
|
|
64
|
+
from chainstream.openapi_client.models.moonshot_create_token_reply import MoonshotCreateTokenReply
|
|
65
|
+
from chainstream.openapi_client.models.moonshot_submit_create_token200_response import MoonshotSubmitCreateToken200Response
|
|
66
|
+
from chainstream.openapi_client.models.moonshot_submit_create_token_input import MoonshotSubmitCreateTokenInput
|
|
67
|
+
from chainstream.openapi_client.models.network_identification_org import NetworkIdentificationOrg
|
|
68
|
+
from chainstream.openapi_client.models.on_chain_activity import OnChainActivity
|
|
69
|
+
from chainstream.openapi_client.models.pump_create_token_input import PumpCreateTokenInput
|
|
70
|
+
from chainstream.openapi_client.models.pump_create_token_reply import PumpCreateTokenReply
|
|
71
|
+
from chainstream.openapi_client.models.red_packet_claim_dto import RedPacketClaimDTO
|
|
72
|
+
from chainstream.openapi_client.models.red_packet_claims_page import RedPacketClaimsPage
|
|
73
|
+
from chainstream.openapi_client.models.red_packet_dto import RedPacketDTO
|
|
74
|
+
from chainstream.openapi_client.models.red_packet_reply import RedPacketReply
|
|
75
|
+
from chainstream.openapi_client.models.red_packet_send_tx_input import RedPacketSendTxInput
|
|
76
|
+
from chainstream.openapi_client.models.red_packet_send_tx_response import RedPacketSendTxResponse
|
|
77
|
+
from chainstream.openapi_client.models.red_packets_page import RedPacketsPage
|
|
78
|
+
from chainstream.openapi_client.models.register_address_request import RegisterAddressRequest
|
|
79
|
+
from chainstream.openapi_client.models.register_address_response_dto import RegisterAddressResponseDTO
|
|
80
|
+
from chainstream.openapi_client.models.resolution import Resolution
|
|
81
|
+
from chainstream.openapi_client.models.send_tx_input import SendTxInput
|
|
82
|
+
from chainstream.openapi_client.models.send_tx_response import SendTxResponse
|
|
83
|
+
from chainstream.openapi_client.models.swap_input import SwapInput
|
|
84
|
+
from chainstream.openapi_client.models.swap_reply import SwapReply
|
|
85
|
+
from chainstream.openapi_client.models.swap_route_input import SwapRouteInput
|
|
86
|
+
from chainstream.openapi_client.models.swap_route_response import SwapRouteResponse
|
|
87
|
+
from chainstream.openapi_client.models.token import Token
|
|
88
|
+
from chainstream.openapi_client.models.token_creation_dto import TokenCreationDTO
|
|
89
|
+
from chainstream.openapi_client.models.token_creation_page import TokenCreationPage
|
|
90
|
+
from chainstream.openapi_client.models.token_creators_dto import TokenCreatorsDTO
|
|
91
|
+
from chainstream.openapi_client.models.token_extra_dto import TokenExtraDTO
|
|
92
|
+
from chainstream.openapi_client.models.token_holder import TokenHolder
|
|
93
|
+
from chainstream.openapi_client.models.token_holder_page import TokenHolderPage
|
|
94
|
+
from chainstream.openapi_client.models.token_liquidity_snapshot_dto import TokenLiquiditySnapshotDTO
|
|
95
|
+
from chainstream.openapi_client.models.token_liquidity_snapshot_page import TokenLiquiditySnapshotPage
|
|
96
|
+
from chainstream.openapi_client.models.token_list_page import TokenListPage
|
|
97
|
+
from chainstream.openapi_client.models.token_market_data import TokenMarketData
|
|
98
|
+
from chainstream.openapi_client.models.token_metadata import TokenMetadata
|
|
99
|
+
from chainstream.openapi_client.models.token_page import TokenPage
|
|
100
|
+
from chainstream.openapi_client.models.token_price_dto import TokenPriceDTO
|
|
101
|
+
from chainstream.openapi_client.models.token_price_page import TokenPricePage
|
|
102
|
+
from chainstream.openapi_client.models.token_social_medias_dto import TokenSocialMediasDTO
|
|
103
|
+
from chainstream.openapi_client.models.token_stat import TokenStat
|
|
104
|
+
from chainstream.openapi_client.models.token_trader import TokenTrader
|
|
105
|
+
from chainstream.openapi_client.models.token_trader_tag import TokenTraderTag
|
|
106
|
+
from chainstream.openapi_client.models.top_traders_dto import TopTradersDTO
|
|
107
|
+
from chainstream.openapi_client.models.top_traders_page import TopTradersPage
|
|
108
|
+
from chainstream.openapi_client.models.trade_detail_dto import TradeDetailDTO
|
|
109
|
+
from chainstream.openapi_client.models.trade_event import TradeEvent
|
|
110
|
+
from chainstream.openapi_client.models.trade_page import TradePage
|
|
111
|
+
from chainstream.openapi_client.models.trade_type import TradeType
|
|
112
|
+
from chainstream.openapi_client.models.transfer_alerts_response_dto import TransferAlertsResponseDTO
|
|
113
|
+
from chainstream.openapi_client.models.transfer_base_response_dto import TransferBaseResponseDTO
|
|
114
|
+
from chainstream.openapi_client.models.transfer_direct_exposure_response_dto import TransferDirectExposureResponseDTO
|
|
115
|
+
from chainstream.openapi_client.models.transfer_network_identifications_response_dto import TransferNetworkIdentificationsResponseDTO
|
|
116
|
+
from chainstream.openapi_client.models.update_endpoint_input import UpdateEndpointInput
|
|
117
|
+
from chainstream.openapi_client.models.wallet_balance_detail_dto import WalletBalanceDetailDTO
|
|
118
|
+
from chainstream.openapi_client.models.wallet_balances_dto import WalletBalancesDTO
|
|
119
|
+
from chainstream.openapi_client.models.wallet_pnl_dto import WalletPnlDTO
|
|
120
|
+
from chainstream.openapi_client.models.withdrawal_address_identifications_response_dto import WithdrawalAddressIdentificationsResponseDTO
|
|
121
|
+
from chainstream.openapi_client.models.withdrawal_base_response_dto import WithdrawalBaseResponseDTO
|
|
122
|
+
from chainstream.openapi_client.models.withdrawal_fraud_assessment_response_dto import WithdrawalFraudAssessmentResponseDTO
|
|
@@ -0,0 +1,94 @@
|
|
|
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 AddressExposure(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
AddressExposure
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
category: StrictStr = Field(description="DTO.KYT.ADDRESS_EXPOSURE.CATEGORY")
|
|
31
|
+
value: StrictStr = Field(description="DTO.KYT.ADDRESS_EXPOSURE.VALUE")
|
|
32
|
+
exposure_type: StrictStr = Field(description="DTO.KYT.ADDRESS_EXPOSURE.EXPOSURE_TYPE", alias="exposureType")
|
|
33
|
+
direction: StrictStr = Field(description="DTO.KYT.ADDRESS_EXPOSURE.DIRECTION")
|
|
34
|
+
__properties: ClassVar[List[str]] = ["category", "value", "exposureType", "direction"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
populate_by_name=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
+
return json.dumps(self.to_dict())
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of AddressExposure from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
return _dict
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
79
|
+
"""Create an instance of AddressExposure from a dict"""
|
|
80
|
+
if obj is None:
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
if not isinstance(obj, dict):
|
|
84
|
+
return cls.model_validate(obj)
|
|
85
|
+
|
|
86
|
+
_obj = cls.model_validate({
|
|
87
|
+
"category": obj.get("category"),
|
|
88
|
+
"value": obj.get("value"),
|
|
89
|
+
"exposureType": obj.get("exposureType"),
|
|
90
|
+
"direction": obj.get("direction")
|
|
91
|
+
})
|
|
92
|
+
return _obj
|
|
93
|
+
|
|
94
|
+
|
|
@@ -0,0 +1,112 @@
|
|
|
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.address_exposure import AddressExposure
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class AddressRiskResponseDTO(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
AddressRiskResponseDTO
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
address: StrictStr = Field(description="DTO.KYT.ADDRESS_RISK_RESPONSE.ADDRESS")
|
|
32
|
+
risk: StrictStr = Field(description="DTO.KYT.ADDRESS_RISK_RESPONSE.RISK")
|
|
33
|
+
risk_reason: StrictStr = Field(description="DTO.KYT.ADDRESS_RISK_RESPONSE.RISK_REASON", alias="riskReason")
|
|
34
|
+
address_type: StrictStr = Field(description="DTO.KYT.ADDRESS_RISK_RESPONSE.ADDRESS_TYPE", alias="addressType")
|
|
35
|
+
cluster: StrictStr = Field(description="DTO.KYT.ADDRESS_RISK_RESPONSE.CLUSTER")
|
|
36
|
+
address_identifications: List[StrictStr] = Field(description="DTO.KYT.ADDRESS_RISK_RESPONSE.ADDRESS_IDENTIFICATIONS", alias="addressIdentifications")
|
|
37
|
+
exposures: List[AddressExposure] = Field(description="DTO.KYT.ADDRESS_RISK_RESPONSE.EXPOSURES")
|
|
38
|
+
triggers: List[StrictStr] = Field(description="DTO.KYT.ADDRESS_RISK_RESPONSE.TRIGGERS")
|
|
39
|
+
status: StrictStr = Field(description="DTO.KYT.ADDRESS_RISK_RESPONSE.STATUS")
|
|
40
|
+
__properties: ClassVar[List[str]] = ["address", "risk", "riskReason", "addressType", "cluster", "addressIdentifications", "exposures", "triggers", "status"]
|
|
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 AddressRiskResponseDTO 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 each item in exposures (list)
|
|
82
|
+
_items = []
|
|
83
|
+
if self.exposures:
|
|
84
|
+
for _item_exposures in self.exposures:
|
|
85
|
+
if _item_exposures:
|
|
86
|
+
_items.append(_item_exposures.to_dict())
|
|
87
|
+
_dict['exposures'] = _items
|
|
88
|
+
return _dict
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
92
|
+
"""Create an instance of AddressRiskResponseDTO from a dict"""
|
|
93
|
+
if obj is None:
|
|
94
|
+
return None
|
|
95
|
+
|
|
96
|
+
if not isinstance(obj, dict):
|
|
97
|
+
return cls.model_validate(obj)
|
|
98
|
+
|
|
99
|
+
_obj = cls.model_validate({
|
|
100
|
+
"address": obj.get("address"),
|
|
101
|
+
"risk": obj.get("risk"),
|
|
102
|
+
"riskReason": obj.get("riskReason"),
|
|
103
|
+
"addressType": obj.get("addressType"),
|
|
104
|
+
"cluster": obj.get("cluster"),
|
|
105
|
+
"addressIdentifications": obj.get("addressIdentifications"),
|
|
106
|
+
"exposures": [AddressExposure.from_dict(_item) for _item in obj["exposures"]] if obj.get("exposures") is not None else None,
|
|
107
|
+
"triggers": obj.get("triggers"),
|
|
108
|
+
"status": obj.get("status")
|
|
109
|
+
})
|
|
110
|
+
return _obj
|
|
111
|
+
|
|
112
|
+
|
|
@@ -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 AlertDetail(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
AlertDetail
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
alert_level: StrictStr = Field(description="DTO.KYT.ALERT_DETAIL.ALERT_LEVEL", alias="alertLevel")
|
|
31
|
+
service: StrictStr = Field(description="DTO.KYT.ALERT_DETAIL.SERVICE")
|
|
32
|
+
external_id: StrictStr = Field(description="DTO.KYT.ALERT_DETAIL.EXTERNAL_ID", alias="externalId")
|
|
33
|
+
alert_amount: StrictStr = Field(description="DTO.KYT.ALERT_DETAIL.ALERT_AMOUNT", alias="alertAmount")
|
|
34
|
+
exposure_type: StrictStr = Field(description="DTO.KYT.ALERT_DETAIL.EXPOSURE_TYPE", alias="exposureType")
|
|
35
|
+
category_id: StrictInt = Field(description="DTO.KYT.ALERT_DETAIL.CATEGORY_ID", alias="categoryId")
|
|
36
|
+
memo: StrictStr = Field(description="DTO.KYT.ALERT_DETAIL.MEMO")
|
|
37
|
+
__properties: ClassVar[List[str]] = ["alertLevel", "service", "externalId", "alertAmount", "exposureType", "categoryId", "memo"]
|
|
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 AlertDetail 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 AlertDetail 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
|
+
"alertLevel": obj.get("alertLevel"),
|
|
91
|
+
"service": obj.get("service"),
|
|
92
|
+
"externalId": obj.get("externalId"),
|
|
93
|
+
"alertAmount": obj.get("alertAmount"),
|
|
94
|
+
"exposureType": obj.get("exposureType"),
|
|
95
|
+
"categoryId": obj.get("categoryId"),
|
|
96
|
+
"memo": obj.get("memo")
|
|
97
|
+
})
|
|
98
|
+
return _obj
|
|
99
|
+
|
|
100
|
+
|