prism-py-sdk 0.4.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.
- prism/__init__.py +56 -0
- prism/_default_clients.py +32 -0
- prism/api/__init__.py +198 -0
- prism/api/client.py +63 -0
- prism/api/errors/__init__.py +44 -0
- prism/api/errors/bad_request_error.py +10 -0
- prism/api/errors/forbidden_error.py +10 -0
- prism/api/errors/internal_server_error.py +10 -0
- prism/api/errors/too_many_requests_error.py +10 -0
- prism/api/errors/unauthorized_error.py +10 -0
- prism/api/raw_client.py +13 -0
- prism/api/solana/__init__.py +52 -0
- prism/api/solana/client.py +63 -0
- prism/api/solana/dex/__init__.py +49 -0
- prism/api/solana/dex/client.py +1268 -0
- prism/api/solana/dex/raw_client.py +2497 -0
- prism/api/solana/dex/types/__init__.py +47 -0
- prism/api/solana/dex/types/get_swaps_dex_response.py +21 -0
- prism/api/solana/dex/types/get_trades_dex_response.py +21 -0
- prism/api/solana/dex/types/search_token_profiles_dex_response.py +21 -0
- prism/api/solana/dex/types/search_wallet_profiles_dex_response.py +21 -0
- prism/api/solana/raw_client.py +13 -0
- prism/api/types/__init__.py +190 -0
- prism/api/types/bad_request_error_body.py +19 -0
- prism/api/types/forbidden_error_body.py +19 -0
- prism/api/types/internal_server_error_body.py +19 -0
- prism/api/types/paginated_response.py +27 -0
- prism/api/types/payload_pagination.py +27 -0
- prism/api/types/solana_dex_price.py +23 -0
- prism/api/types/solana_dex_price_candle.py +26 -0
- prism/api/types/solana_dex_price_history.py +21 -0
- prism/api/types/solana_dex_price_snapshot.py +22 -0
- prism/api/types/solana_dex_price_stats.py +106 -0
- prism/api/types/solana_dex_profile_dynamic_labels.py +5 -0
- prism/api/types/solana_dex_profile_search_payload_dynamic_labels.py +11 -0
- prism/api/types/solana_dex_profile_search_payload_filter.py +42 -0
- prism/api/types/solana_dex_profile_search_payload_filter_operators.py +68 -0
- prism/api/types/solana_dex_profile_search_payload_filter_operators_eq.py +5 -0
- prism/api/types/solana_dex_profile_search_payload_filter_operators_in_item.py +5 -0
- prism/api/types/solana_dex_profile_search_payload_filter_operators_ne.py +5 -0
- prism/api/types/solana_dex_profile_search_payload_filter_operators_nin_item.py +5 -0
- prism/api/types/solana_dex_profile_search_payload_query.py +41 -0
- prism/api/types/solana_dex_profile_search_payload_sort.py +29 -0
- prism/api/types/solana_dex_profile_search_payload_sort_direction_enum.py +5 -0
- prism/api/types/solana_dex_protocol_field.py +6 -0
- prism/api/types/solana_dex_swap.py +40 -0
- prism/api/types/solana_dex_swap_type_enum.py +7 -0
- prism/api/types/solana_dex_token_profile.py +33 -0
- prism/api/types/solana_dex_token_profile_label_enum.py +5 -0
- prism/api/types/solana_dex_token_profile_labels.py +7 -0
- prism/api/types/solana_dex_token_profile_market.py +27 -0
- prism/api/types/solana_dex_token_profile_metadata.py +30 -0
- prism/api/types/solana_dex_token_profile_metrics.py +64 -0
- prism/api/types/solana_dex_token_profile_payload_options.py +42 -0
- prism/api/types/solana_dex_token_profile_search_payload_query_field.py +42 -0
- prism/api/types/solana_dex_token_profile_search_payload_query_field_targets_enum.py +7 -0
- prism/api/types/solana_dex_token_profile_time_window_enum.py +5 -0
- prism/api/types/solana_dex_trade.py +44 -0
- prism/api/types/solana_dex_trade_direction_enum.py +5 -0
- prism/api/types/solana_dex_trade_position_state_enum.py +5 -0
- prism/api/types/solana_dex_wallet_profile.py +33 -0
- prism/api/types/solana_dex_wallet_profile_identity.py +21 -0
- prism/api/types/solana_dex_wallet_profile_label_enum.py +7 -0
- prism/api/types/solana_dex_wallet_profile_labels.py +7 -0
- prism/api/types/solana_dex_wallet_profile_metadata.py +20 -0
- prism/api/types/solana_dex_wallet_profile_metrics.py +74 -0
- prism/api/types/solana_dex_wallet_profile_payload_options.py +42 -0
- prism/api/types/solana_dex_wallet_profile_search_payload_query.py +42 -0
- prism/api/types/solana_dex_wallet_profile_search_payload_query_targets_enum.py +8 -0
- prism/api/types/solana_dex_wallet_profile_time_window_enum.py +5 -0
- prism/api/types/too_many_requests_error_body.py +19 -0
- prism/api/types/unauthorized_error_body.py +19 -0
- prism/client.py +212 -0
- prism/core/__init__.py +137 -0
- prism/core/api_error.py +23 -0
- prism/core/client_wrapper.py +123 -0
- prism/core/datetime_utils.py +70 -0
- prism/core/events.py +38 -0
- prism/core/file.py +67 -0
- prism/core/force_multipart.py +18 -0
- prism/core/http_client.py +839 -0
- prism/core/http_response.py +59 -0
- prism/core/http_sse/__init__.py +42 -0
- prism/core/http_sse/_api.py +148 -0
- prism/core/http_sse/_decoders.py +61 -0
- prism/core/http_sse/_exceptions.py +7 -0
- prism/core/http_sse/_models.py +17 -0
- prism/core/jsonable_encoder.py +120 -0
- prism/core/logging.py +107 -0
- prism/core/parse_error.py +36 -0
- prism/core/pydantic_utilities.py +634 -0
- prism/core/query_encoder.py +58 -0
- prism/core/remove_none_from_dict.py +11 -0
- prism/core/request_options.py +35 -0
- prism/core/serialization.py +276 -0
- prism/core/websocket_compat.py +13 -0
- prism/environment.py +7 -0
- prism/py.typed +0 -0
- prism/version.py +3 -0
- prism/websocket/__init__.py +159 -0
- prism/websocket/subscription/__init__.py +127 -0
- prism/websocket/subscription/client.py +165 -0
- prism/websocket/subscription/raw_client.py +142 -0
- prism/websocket/subscription/socket_client.py +204 -0
- prism/websocket/subscription/types/__init__.py +125 -0
- prism/websocket/subscription/types/solana_assets_balance_change_message.py +30 -0
- prism/websocket/subscription/types/solana_assets_balance_change_type_enum.py +5 -0
- prism/websocket/subscription/types/solana_assets_transfer_message.py +31 -0
- prism/websocket/subscription/types/solana_assets_transfer_type_enum.py +5 -0
- prism/websocket/subscription/types/solana_dex_pool_message.py +33 -0
- prism/websocket/subscription/types/solana_dex_pool_message_event_type_enum.py +7 -0
- prism/websocket/subscription/types/solana_dex_pool_message_vault.py +21 -0
- prism/websocket/subscription/types/solana_dex_price_message.py +23 -0
- prism/websocket/subscription/types/solana_dex_swap_message.py +43 -0
- prism/websocket/subscription/types/solana_dex_swap_type_enum.py +7 -0
- prism/websocket/subscription/types/solana_dex_token_profile_label_enum.py +5 -0
- prism/websocket/subscription/types/solana_dex_token_profile_market.py +27 -0
- prism/websocket/subscription/types/solana_dex_token_profile_message.py +32 -0
- prism/websocket/subscription/types/solana_dex_token_profile_metadata.py +30 -0
- prism/websocket/subscription/types/solana_dex_token_profile_metrics.py +64 -0
- prism/websocket/subscription/types/solana_dex_trade_direction_enum.py +5 -0
- prism/websocket/subscription/types/solana_dex_trade_message.py +47 -0
- prism/websocket/subscription/types/solana_dex_trade_position_state_enum.py +5 -0
- prism/websocket/subscription/types/solana_dex_wallet_profile_identity.py +21 -0
- prism/websocket/subscription/types/solana_dex_wallet_profile_label_enum.py +7 -0
- prism/websocket/subscription/types/solana_dex_wallet_profile_message.py +32 -0
- prism/websocket/subscription/types/solana_dex_wallet_profile_metadata.py +20 -0
- prism/websocket/subscription/types/solana_dex_wallet_profile_metrics.py +74 -0
- prism/websocket/subscription/types/subscribe_payload.py +24 -0
- prism/websocket/subscription/types/subscribe_payload_params.py +25 -0
- prism/websocket/subscription/types/subscription_message.py +22 -0
- prism/websocket/subscription/types/subscription_message_data.py +23 -0
- prism/websocket/subscription/types/subscription_method_enum.py +5 -0
- prism/websocket/subscription/types/subscription_topic_enum.py +18 -0
- prism/websocket/subscription/types/unsubscribe_payload.py +25 -0
- prism/websocket/types/__init__.py +62 -0
- prism/websocket/types/subscribe_solana_assets_balance_changes_params.py +27 -0
- prism/websocket/types/subscribe_solana_assets_transfers_params.py +27 -0
- prism/websocket/types/subscribe_solana_dex_pools_params.py +22 -0
- prism/websocket/types/subscribe_solana_dex_position_profiles_params.py +22 -0
- prism/websocket/types/subscribe_solana_dex_prices_params.py +22 -0
- prism/websocket/types/subscribe_solana_dex_swaps_params.py +27 -0
- prism/websocket/types/subscribe_solana_dex_token_profiles_params.py +22 -0
- prism/websocket/types/subscribe_solana_dex_trades_params.py +27 -0
- prism/websocket/types/subscribe_solana_dex_wallet_profiles_params.py +22 -0
- prism_py_sdk-0.4.0.dist-info/LICENSE +21 -0
- prism_py_sdk-0.4.0.dist-info/METADATA +271 -0
- prism_py_sdk-0.4.0.dist-info/RECORD +149 -0
- prism_py_sdk-0.4.0.dist-info/WHEEL +4 -0
prism/__init__.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from . import api, websocket
|
|
10
|
+
from ._default_clients import DefaultAioHttpClient, DefaultAsyncHttpxClient
|
|
11
|
+
from .client import AsyncClient, Client
|
|
12
|
+
from .environment import ClientEnvironment
|
|
13
|
+
from .version import __version__
|
|
14
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
15
|
+
"AsyncClient": ".client",
|
|
16
|
+
"Client": ".client",
|
|
17
|
+
"ClientEnvironment": ".environment",
|
|
18
|
+
"DefaultAioHttpClient": "._default_clients",
|
|
19
|
+
"DefaultAsyncHttpxClient": "._default_clients",
|
|
20
|
+
"__version__": ".version",
|
|
21
|
+
"api": ".api",
|
|
22
|
+
"websocket": ".websocket",
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
27
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
28
|
+
if module_name is None:
|
|
29
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
30
|
+
try:
|
|
31
|
+
module = import_module(module_name, __package__)
|
|
32
|
+
if module_name == f".{attr_name}":
|
|
33
|
+
return module
|
|
34
|
+
else:
|
|
35
|
+
return getattr(module, attr_name)
|
|
36
|
+
except ImportError as e:
|
|
37
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
38
|
+
except AttributeError as e:
|
|
39
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def __dir__():
|
|
43
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
44
|
+
return sorted(lazy_attrs)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
__all__ = [
|
|
48
|
+
"AsyncClient",
|
|
49
|
+
"Client",
|
|
50
|
+
"ClientEnvironment",
|
|
51
|
+
"DefaultAioHttpClient",
|
|
52
|
+
"DefaultAsyncHttpxClient",
|
|
53
|
+
"__version__",
|
|
54
|
+
"api",
|
|
55
|
+
"websocket",
|
|
56
|
+
]
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
SDK_DEFAULT_TIMEOUT = 60
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
import httpx_aiohttp # type: ignore[import-not-found]
|
|
11
|
+
except ImportError:
|
|
12
|
+
|
|
13
|
+
class DefaultAioHttpClient(httpx.AsyncClient): # type: ignore
|
|
14
|
+
def __init__(self, **kwargs: typing.Any) -> None:
|
|
15
|
+
raise RuntimeError(
|
|
16
|
+
"To use the aiohttp client, install the aiohttp extra: pip install prism-py-sdk[aiohttp]"
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
else:
|
|
20
|
+
|
|
21
|
+
class DefaultAioHttpClient(httpx_aiohttp.HttpxAiohttpClient): # type: ignore
|
|
22
|
+
def __init__(self, **kwargs: typing.Any) -> None:
|
|
23
|
+
kwargs.setdefault("timeout", SDK_DEFAULT_TIMEOUT)
|
|
24
|
+
kwargs.setdefault("follow_redirects", True)
|
|
25
|
+
super().__init__(**kwargs)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class DefaultAsyncHttpxClient(httpx.AsyncClient):
|
|
29
|
+
def __init__(self, **kwargs: typing.Any) -> None:
|
|
30
|
+
kwargs.setdefault("timeout", SDK_DEFAULT_TIMEOUT)
|
|
31
|
+
kwargs.setdefault("follow_redirects", True)
|
|
32
|
+
super().__init__(**kwargs)
|
prism/api/__init__.py
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .types import (
|
|
10
|
+
BadRequestErrorBody,
|
|
11
|
+
ForbiddenErrorBody,
|
|
12
|
+
InternalServerErrorBody,
|
|
13
|
+
PaginatedResponse,
|
|
14
|
+
PayloadPagination,
|
|
15
|
+
SolanaDexPrice,
|
|
16
|
+
SolanaDexPriceCandle,
|
|
17
|
+
SolanaDexPriceHistory,
|
|
18
|
+
SolanaDexPriceSnapshot,
|
|
19
|
+
SolanaDexPriceStats,
|
|
20
|
+
SolanaDexProfileDynamicLabels,
|
|
21
|
+
SolanaDexProfileSearchPayloadDynamicLabels,
|
|
22
|
+
SolanaDexProfileSearchPayloadFilter,
|
|
23
|
+
SolanaDexProfileSearchPayloadFilterOperators,
|
|
24
|
+
SolanaDexProfileSearchPayloadFilterOperatorsEq,
|
|
25
|
+
SolanaDexProfileSearchPayloadFilterOperatorsInItem,
|
|
26
|
+
SolanaDexProfileSearchPayloadFilterOperatorsNe,
|
|
27
|
+
SolanaDexProfileSearchPayloadFilterOperatorsNinItem,
|
|
28
|
+
SolanaDexProfileSearchPayloadQuery,
|
|
29
|
+
SolanaDexProfileSearchPayloadSort,
|
|
30
|
+
SolanaDexProfileSearchPayloadSortDirectionEnum,
|
|
31
|
+
SolanaDexProtocolField,
|
|
32
|
+
SolanaDexSwap,
|
|
33
|
+
SolanaDexSwapTypeEnum,
|
|
34
|
+
SolanaDexTokenProfile,
|
|
35
|
+
SolanaDexTokenProfileLabelEnum,
|
|
36
|
+
SolanaDexTokenProfileLabels,
|
|
37
|
+
SolanaDexTokenProfileMarket,
|
|
38
|
+
SolanaDexTokenProfileMetadata,
|
|
39
|
+
SolanaDexTokenProfileMetrics,
|
|
40
|
+
SolanaDexTokenProfilePayloadOptions,
|
|
41
|
+
SolanaDexTokenProfileSearchPayloadQueryField,
|
|
42
|
+
SolanaDexTokenProfileSearchPayloadQueryFieldTargetsEnum,
|
|
43
|
+
SolanaDexTokenProfileTimeWindowEnum,
|
|
44
|
+
SolanaDexTrade,
|
|
45
|
+
SolanaDexTradeDirectionEnum,
|
|
46
|
+
SolanaDexTradePositionStateEnum,
|
|
47
|
+
SolanaDexWalletProfile,
|
|
48
|
+
SolanaDexWalletProfileIdentity,
|
|
49
|
+
SolanaDexWalletProfileLabelEnum,
|
|
50
|
+
SolanaDexWalletProfileLabels,
|
|
51
|
+
SolanaDexWalletProfileMetadata,
|
|
52
|
+
SolanaDexWalletProfileMetrics,
|
|
53
|
+
SolanaDexWalletProfilePayloadOptions,
|
|
54
|
+
SolanaDexWalletProfileSearchPayloadQuery,
|
|
55
|
+
SolanaDexWalletProfileSearchPayloadQueryTargetsEnum,
|
|
56
|
+
SolanaDexWalletProfileTimeWindowEnum,
|
|
57
|
+
TooManyRequestsErrorBody,
|
|
58
|
+
UnauthorizedErrorBody,
|
|
59
|
+
)
|
|
60
|
+
from .errors import BadRequestError, ForbiddenError, InternalServerError, TooManyRequestsError, UnauthorizedError
|
|
61
|
+
from . import solana
|
|
62
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
63
|
+
"BadRequestError": ".errors",
|
|
64
|
+
"BadRequestErrorBody": ".types",
|
|
65
|
+
"ForbiddenError": ".errors",
|
|
66
|
+
"ForbiddenErrorBody": ".types",
|
|
67
|
+
"InternalServerError": ".errors",
|
|
68
|
+
"InternalServerErrorBody": ".types",
|
|
69
|
+
"PaginatedResponse": ".types",
|
|
70
|
+
"PayloadPagination": ".types",
|
|
71
|
+
"SolanaDexPrice": ".types",
|
|
72
|
+
"SolanaDexPriceCandle": ".types",
|
|
73
|
+
"SolanaDexPriceHistory": ".types",
|
|
74
|
+
"SolanaDexPriceSnapshot": ".types",
|
|
75
|
+
"SolanaDexPriceStats": ".types",
|
|
76
|
+
"SolanaDexProfileDynamicLabels": ".types",
|
|
77
|
+
"SolanaDexProfileSearchPayloadDynamicLabels": ".types",
|
|
78
|
+
"SolanaDexProfileSearchPayloadFilter": ".types",
|
|
79
|
+
"SolanaDexProfileSearchPayloadFilterOperators": ".types",
|
|
80
|
+
"SolanaDexProfileSearchPayloadFilterOperatorsEq": ".types",
|
|
81
|
+
"SolanaDexProfileSearchPayloadFilterOperatorsInItem": ".types",
|
|
82
|
+
"SolanaDexProfileSearchPayloadFilterOperatorsNe": ".types",
|
|
83
|
+
"SolanaDexProfileSearchPayloadFilterOperatorsNinItem": ".types",
|
|
84
|
+
"SolanaDexProfileSearchPayloadQuery": ".types",
|
|
85
|
+
"SolanaDexProfileSearchPayloadSort": ".types",
|
|
86
|
+
"SolanaDexProfileSearchPayloadSortDirectionEnum": ".types",
|
|
87
|
+
"SolanaDexProtocolField": ".types",
|
|
88
|
+
"SolanaDexSwap": ".types",
|
|
89
|
+
"SolanaDexSwapTypeEnum": ".types",
|
|
90
|
+
"SolanaDexTokenProfile": ".types",
|
|
91
|
+
"SolanaDexTokenProfileLabelEnum": ".types",
|
|
92
|
+
"SolanaDexTokenProfileLabels": ".types",
|
|
93
|
+
"SolanaDexTokenProfileMarket": ".types",
|
|
94
|
+
"SolanaDexTokenProfileMetadata": ".types",
|
|
95
|
+
"SolanaDexTokenProfileMetrics": ".types",
|
|
96
|
+
"SolanaDexTokenProfilePayloadOptions": ".types",
|
|
97
|
+
"SolanaDexTokenProfileSearchPayloadQueryField": ".types",
|
|
98
|
+
"SolanaDexTokenProfileSearchPayloadQueryFieldTargetsEnum": ".types",
|
|
99
|
+
"SolanaDexTokenProfileTimeWindowEnum": ".types",
|
|
100
|
+
"SolanaDexTrade": ".types",
|
|
101
|
+
"SolanaDexTradeDirectionEnum": ".types",
|
|
102
|
+
"SolanaDexTradePositionStateEnum": ".types",
|
|
103
|
+
"SolanaDexWalletProfile": ".types",
|
|
104
|
+
"SolanaDexWalletProfileIdentity": ".types",
|
|
105
|
+
"SolanaDexWalletProfileLabelEnum": ".types",
|
|
106
|
+
"SolanaDexWalletProfileLabels": ".types",
|
|
107
|
+
"SolanaDexWalletProfileMetadata": ".types",
|
|
108
|
+
"SolanaDexWalletProfileMetrics": ".types",
|
|
109
|
+
"SolanaDexWalletProfilePayloadOptions": ".types",
|
|
110
|
+
"SolanaDexWalletProfileSearchPayloadQuery": ".types",
|
|
111
|
+
"SolanaDexWalletProfileSearchPayloadQueryTargetsEnum": ".types",
|
|
112
|
+
"SolanaDexWalletProfileTimeWindowEnum": ".types",
|
|
113
|
+
"TooManyRequestsError": ".errors",
|
|
114
|
+
"TooManyRequestsErrorBody": ".types",
|
|
115
|
+
"UnauthorizedError": ".errors",
|
|
116
|
+
"UnauthorizedErrorBody": ".types",
|
|
117
|
+
"solana": ".solana",
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
122
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
123
|
+
if module_name is None:
|
|
124
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
125
|
+
try:
|
|
126
|
+
module = import_module(module_name, __package__)
|
|
127
|
+
if module_name == f".{attr_name}":
|
|
128
|
+
return module
|
|
129
|
+
else:
|
|
130
|
+
return getattr(module, attr_name)
|
|
131
|
+
except ImportError as e:
|
|
132
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
133
|
+
except AttributeError as e:
|
|
134
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def __dir__():
|
|
138
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
139
|
+
return sorted(lazy_attrs)
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
__all__ = [
|
|
143
|
+
"BadRequestError",
|
|
144
|
+
"BadRequestErrorBody",
|
|
145
|
+
"ForbiddenError",
|
|
146
|
+
"ForbiddenErrorBody",
|
|
147
|
+
"InternalServerError",
|
|
148
|
+
"InternalServerErrorBody",
|
|
149
|
+
"PaginatedResponse",
|
|
150
|
+
"PayloadPagination",
|
|
151
|
+
"SolanaDexPrice",
|
|
152
|
+
"SolanaDexPriceCandle",
|
|
153
|
+
"SolanaDexPriceHistory",
|
|
154
|
+
"SolanaDexPriceSnapshot",
|
|
155
|
+
"SolanaDexPriceStats",
|
|
156
|
+
"SolanaDexProfileDynamicLabels",
|
|
157
|
+
"SolanaDexProfileSearchPayloadDynamicLabels",
|
|
158
|
+
"SolanaDexProfileSearchPayloadFilter",
|
|
159
|
+
"SolanaDexProfileSearchPayloadFilterOperators",
|
|
160
|
+
"SolanaDexProfileSearchPayloadFilterOperatorsEq",
|
|
161
|
+
"SolanaDexProfileSearchPayloadFilterOperatorsInItem",
|
|
162
|
+
"SolanaDexProfileSearchPayloadFilterOperatorsNe",
|
|
163
|
+
"SolanaDexProfileSearchPayloadFilterOperatorsNinItem",
|
|
164
|
+
"SolanaDexProfileSearchPayloadQuery",
|
|
165
|
+
"SolanaDexProfileSearchPayloadSort",
|
|
166
|
+
"SolanaDexProfileSearchPayloadSortDirectionEnum",
|
|
167
|
+
"SolanaDexProtocolField",
|
|
168
|
+
"SolanaDexSwap",
|
|
169
|
+
"SolanaDexSwapTypeEnum",
|
|
170
|
+
"SolanaDexTokenProfile",
|
|
171
|
+
"SolanaDexTokenProfileLabelEnum",
|
|
172
|
+
"SolanaDexTokenProfileLabels",
|
|
173
|
+
"SolanaDexTokenProfileMarket",
|
|
174
|
+
"SolanaDexTokenProfileMetadata",
|
|
175
|
+
"SolanaDexTokenProfileMetrics",
|
|
176
|
+
"SolanaDexTokenProfilePayloadOptions",
|
|
177
|
+
"SolanaDexTokenProfileSearchPayloadQueryField",
|
|
178
|
+
"SolanaDexTokenProfileSearchPayloadQueryFieldTargetsEnum",
|
|
179
|
+
"SolanaDexTokenProfileTimeWindowEnum",
|
|
180
|
+
"SolanaDexTrade",
|
|
181
|
+
"SolanaDexTradeDirectionEnum",
|
|
182
|
+
"SolanaDexTradePositionStateEnum",
|
|
183
|
+
"SolanaDexWalletProfile",
|
|
184
|
+
"SolanaDexWalletProfileIdentity",
|
|
185
|
+
"SolanaDexWalletProfileLabelEnum",
|
|
186
|
+
"SolanaDexWalletProfileLabels",
|
|
187
|
+
"SolanaDexWalletProfileMetadata",
|
|
188
|
+
"SolanaDexWalletProfileMetrics",
|
|
189
|
+
"SolanaDexWalletProfilePayloadOptions",
|
|
190
|
+
"SolanaDexWalletProfileSearchPayloadQuery",
|
|
191
|
+
"SolanaDexWalletProfileSearchPayloadQueryTargetsEnum",
|
|
192
|
+
"SolanaDexWalletProfileTimeWindowEnum",
|
|
193
|
+
"TooManyRequestsError",
|
|
194
|
+
"TooManyRequestsErrorBody",
|
|
195
|
+
"UnauthorizedError",
|
|
196
|
+
"UnauthorizedErrorBody",
|
|
197
|
+
"solana",
|
|
198
|
+
]
|
prism/api/client.py
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
|
|
7
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
|
+
from .raw_client import AsyncRawApiClient, RawApiClient
|
|
9
|
+
|
|
10
|
+
if typing.TYPE_CHECKING:
|
|
11
|
+
from .solana.client import AsyncSolanaClient, SolanaClient
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ApiClient:
|
|
15
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
16
|
+
self._raw_client = RawApiClient(client_wrapper=client_wrapper)
|
|
17
|
+
self._client_wrapper = client_wrapper
|
|
18
|
+
self._solana: typing.Optional[SolanaClient] = None
|
|
19
|
+
|
|
20
|
+
@property
|
|
21
|
+
def with_raw_response(self) -> RawApiClient:
|
|
22
|
+
"""
|
|
23
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
24
|
+
|
|
25
|
+
Returns
|
|
26
|
+
-------
|
|
27
|
+
RawApiClient
|
|
28
|
+
"""
|
|
29
|
+
return self._raw_client
|
|
30
|
+
|
|
31
|
+
@property
|
|
32
|
+
def solana(self):
|
|
33
|
+
if self._solana is None:
|
|
34
|
+
from .solana.client import SolanaClient # noqa: E402
|
|
35
|
+
|
|
36
|
+
self._solana = SolanaClient(client_wrapper=self._client_wrapper)
|
|
37
|
+
return self._solana
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class AsyncApiClient:
|
|
41
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
42
|
+
self._raw_client = AsyncRawApiClient(client_wrapper=client_wrapper)
|
|
43
|
+
self._client_wrapper = client_wrapper
|
|
44
|
+
self._solana: typing.Optional[AsyncSolanaClient] = None
|
|
45
|
+
|
|
46
|
+
@property
|
|
47
|
+
def with_raw_response(self) -> AsyncRawApiClient:
|
|
48
|
+
"""
|
|
49
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
50
|
+
|
|
51
|
+
Returns
|
|
52
|
+
-------
|
|
53
|
+
AsyncRawApiClient
|
|
54
|
+
"""
|
|
55
|
+
return self._raw_client
|
|
56
|
+
|
|
57
|
+
@property
|
|
58
|
+
def solana(self):
|
|
59
|
+
if self._solana is None:
|
|
60
|
+
from .solana.client import AsyncSolanaClient # noqa: E402
|
|
61
|
+
|
|
62
|
+
self._solana = AsyncSolanaClient(client_wrapper=self._client_wrapper)
|
|
63
|
+
return self._solana
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .bad_request_error import BadRequestError
|
|
10
|
+
from .forbidden_error import ForbiddenError
|
|
11
|
+
from .internal_server_error import InternalServerError
|
|
12
|
+
from .too_many_requests_error import TooManyRequestsError
|
|
13
|
+
from .unauthorized_error import UnauthorizedError
|
|
14
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
15
|
+
"BadRequestError": ".bad_request_error",
|
|
16
|
+
"ForbiddenError": ".forbidden_error",
|
|
17
|
+
"InternalServerError": ".internal_server_error",
|
|
18
|
+
"TooManyRequestsError": ".too_many_requests_error",
|
|
19
|
+
"UnauthorizedError": ".unauthorized_error",
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
24
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
25
|
+
if module_name is None:
|
|
26
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
27
|
+
try:
|
|
28
|
+
module = import_module(module_name, __package__)
|
|
29
|
+
if module_name == f".{attr_name}":
|
|
30
|
+
return module
|
|
31
|
+
else:
|
|
32
|
+
return getattr(module, attr_name)
|
|
33
|
+
except ImportError as e:
|
|
34
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
35
|
+
except AttributeError as e:
|
|
36
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def __dir__():
|
|
40
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
41
|
+
return sorted(lazy_attrs)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
__all__ = ["BadRequestError", "ForbiddenError", "InternalServerError", "TooManyRequestsError", "UnauthorizedError"]
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ...core.api_error import ApiError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class BadRequestError(ApiError):
|
|
9
|
+
def __init__(self, body: typing.Any, headers: typing.Optional[typing.Dict[str, str]] = None):
|
|
10
|
+
super().__init__(status_code=400, headers=headers, body=body)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ...core.api_error import ApiError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ForbiddenError(ApiError):
|
|
9
|
+
def __init__(self, body: typing.Any, headers: typing.Optional[typing.Dict[str, str]] = None):
|
|
10
|
+
super().__init__(status_code=403, headers=headers, body=body)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ...core.api_error import ApiError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class InternalServerError(ApiError):
|
|
9
|
+
def __init__(self, body: typing.Any, headers: typing.Optional[typing.Dict[str, str]] = None):
|
|
10
|
+
super().__init__(status_code=500, headers=headers, body=body)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ...core.api_error import ApiError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class TooManyRequestsError(ApiError):
|
|
9
|
+
def __init__(self, body: typing.Any, headers: typing.Optional[typing.Dict[str, str]] = None):
|
|
10
|
+
super().__init__(status_code=429, headers=headers, body=body)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ...core.api_error import ApiError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class UnauthorizedError(ApiError):
|
|
9
|
+
def __init__(self, body: typing.Any, headers: typing.Optional[typing.Dict[str, str]] = None):
|
|
10
|
+
super().__init__(status_code=401, headers=headers, body=body)
|
prism/api/raw_client.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class RawApiClient:
|
|
7
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
8
|
+
self._client_wrapper = client_wrapper
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AsyncRawApiClient:
|
|
12
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
13
|
+
self._client_wrapper = client_wrapper
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from . import dex
|
|
10
|
+
from .dex import (
|
|
11
|
+
GetSwapsDexResponse,
|
|
12
|
+
GetTradesDexResponse,
|
|
13
|
+
SearchTokenProfilesDexResponse,
|
|
14
|
+
SearchWalletProfilesDexResponse,
|
|
15
|
+
)
|
|
16
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
17
|
+
"GetSwapsDexResponse": ".dex",
|
|
18
|
+
"GetTradesDexResponse": ".dex",
|
|
19
|
+
"SearchTokenProfilesDexResponse": ".dex",
|
|
20
|
+
"SearchWalletProfilesDexResponse": ".dex",
|
|
21
|
+
"dex": ".dex",
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
26
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
27
|
+
if module_name is None:
|
|
28
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
29
|
+
try:
|
|
30
|
+
module = import_module(module_name, __package__)
|
|
31
|
+
if module_name == f".{attr_name}":
|
|
32
|
+
return module
|
|
33
|
+
else:
|
|
34
|
+
return getattr(module, attr_name)
|
|
35
|
+
except ImportError as e:
|
|
36
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
37
|
+
except AttributeError as e:
|
|
38
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def __dir__():
|
|
42
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
43
|
+
return sorted(lazy_attrs)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
__all__ = [
|
|
47
|
+
"GetSwapsDexResponse",
|
|
48
|
+
"GetTradesDexResponse",
|
|
49
|
+
"SearchTokenProfilesDexResponse",
|
|
50
|
+
"SearchWalletProfilesDexResponse",
|
|
51
|
+
"dex",
|
|
52
|
+
]
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
|
|
7
|
+
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
|
+
from .raw_client import AsyncRawSolanaClient, RawSolanaClient
|
|
9
|
+
|
|
10
|
+
if typing.TYPE_CHECKING:
|
|
11
|
+
from .dex.client import AsyncDexClient, DexClient
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class SolanaClient:
|
|
15
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
16
|
+
self._raw_client = RawSolanaClient(client_wrapper=client_wrapper)
|
|
17
|
+
self._client_wrapper = client_wrapper
|
|
18
|
+
self._dex: typing.Optional[DexClient] = None
|
|
19
|
+
|
|
20
|
+
@property
|
|
21
|
+
def with_raw_response(self) -> RawSolanaClient:
|
|
22
|
+
"""
|
|
23
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
24
|
+
|
|
25
|
+
Returns
|
|
26
|
+
-------
|
|
27
|
+
RawSolanaClient
|
|
28
|
+
"""
|
|
29
|
+
return self._raw_client
|
|
30
|
+
|
|
31
|
+
@property
|
|
32
|
+
def dex(self):
|
|
33
|
+
if self._dex is None:
|
|
34
|
+
from .dex.client import DexClient # noqa: E402
|
|
35
|
+
|
|
36
|
+
self._dex = DexClient(client_wrapper=self._client_wrapper)
|
|
37
|
+
return self._dex
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class AsyncSolanaClient:
|
|
41
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
42
|
+
self._raw_client = AsyncRawSolanaClient(client_wrapper=client_wrapper)
|
|
43
|
+
self._client_wrapper = client_wrapper
|
|
44
|
+
self._dex: typing.Optional[AsyncDexClient] = None
|
|
45
|
+
|
|
46
|
+
@property
|
|
47
|
+
def with_raw_response(self) -> AsyncRawSolanaClient:
|
|
48
|
+
"""
|
|
49
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
50
|
+
|
|
51
|
+
Returns
|
|
52
|
+
-------
|
|
53
|
+
AsyncRawSolanaClient
|
|
54
|
+
"""
|
|
55
|
+
return self._raw_client
|
|
56
|
+
|
|
57
|
+
@property
|
|
58
|
+
def dex(self):
|
|
59
|
+
if self._dex is None:
|
|
60
|
+
from .dex.client import AsyncDexClient # noqa: E402
|
|
61
|
+
|
|
62
|
+
self._dex = AsyncDexClient(client_wrapper=self._client_wrapper)
|
|
63
|
+
return self._dex
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .types import (
|
|
10
|
+
GetSwapsDexResponse,
|
|
11
|
+
GetTradesDexResponse,
|
|
12
|
+
SearchTokenProfilesDexResponse,
|
|
13
|
+
SearchWalletProfilesDexResponse,
|
|
14
|
+
)
|
|
15
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
16
|
+
"GetSwapsDexResponse": ".types",
|
|
17
|
+
"GetTradesDexResponse": ".types",
|
|
18
|
+
"SearchTokenProfilesDexResponse": ".types",
|
|
19
|
+
"SearchWalletProfilesDexResponse": ".types",
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
24
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
25
|
+
if module_name is None:
|
|
26
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
27
|
+
try:
|
|
28
|
+
module = import_module(module_name, __package__)
|
|
29
|
+
if module_name == f".{attr_name}":
|
|
30
|
+
return module
|
|
31
|
+
else:
|
|
32
|
+
return getattr(module, attr_name)
|
|
33
|
+
except ImportError as e:
|
|
34
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
35
|
+
except AttributeError as e:
|
|
36
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def __dir__():
|
|
40
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
41
|
+
return sorted(lazy_attrs)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
__all__ = [
|
|
45
|
+
"GetSwapsDexResponse",
|
|
46
|
+
"GetTradesDexResponse",
|
|
47
|
+
"SearchTokenProfilesDexResponse",
|
|
48
|
+
"SearchWalletProfilesDexResponse",
|
|
49
|
+
]
|