drazill 0.2.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.
- drazill/__init__.py +341 -0
- drazill/_client.py +470 -0
- drazill/_errors.py +64 -0
- drazill/_pagination.py +166 -0
- drazill/_websocket.py +195 -0
- drazill/py.typed +0 -0
- drazill/resources/__init__.py +203 -0
- drazill/resources/activity.py +60 -0
- drazill/resources/api_keys.py +128 -0
- drazill/resources/auth.py +72 -0
- drazill/resources/bracket_orders.py +100 -0
- drazill/resources/calendar.py +38 -0
- drazill/resources/chat.py +238 -0
- drazill/resources/comments.py +266 -0
- drazill/resources/compliance.py +264 -0
- drazill/resources/conditional_orders.py +138 -0
- drazill/resources/contests.py +128 -0
- drazill/resources/copy_trades.py +262 -0
- drazill/resources/crypto.py +182 -0
- drazill/resources/data_dictionary.py +34 -0
- drazill/resources/data_exports.py +258 -0
- drazill/resources/developers.py +72 -0
- drazill/resources/disputes.py +140 -0
- drazill/resources/enterprise.py +504 -0
- drazill/resources/events.py +84 -0
- drazill/resources/feature_flags.py +48 -0
- drazill/resources/fees.py +50 -0
- drazill/resources/geo.py +50 -0
- drazill/resources/giveaway.py +68 -0
- drazill/resources/health.py +82 -0
- drazill/resources/hubs.py +50 -0
- drazill/resources/info.py +34 -0
- drazill/resources/institutional.py +116 -0
- drazill/resources/intelligence.py +184 -0
- drazill/resources/lessons.py +228 -0
- drazill/resources/live.py +36 -0
- drazill/resources/market_requests.py +70 -0
- drazill/resources/markets.py +1138 -0
- drazill/resources/me.py +408 -0
- drazill/resources/moderation.py +100 -0
- drazill/resources/news.py +48 -0
- drazill/resources/notifications.py +276 -0
- drazill/resources/openapi.py +50 -0
- drazill/resources/orders.py +476 -0
- drazill/resources/paper.py +230 -0
- drazill/resources/parlays.py +196 -0
- drazill/resources/portfolio.py +50 -0
- drazill/resources/price_alerts.py +108 -0
- drazill/resources/promos.py +74 -0
- drazill/resources/push.py +156 -0
- drazill/resources/qa_feedback.py +72 -0
- drazill/resources/rank.py +250 -0
- drazill/resources/referrals.py +108 -0
- drazill/resources/rewards.py +276 -0
- drazill/resources/risk_overlay.py +122 -0
- drazill/resources/search.py +72 -0
- drazill/resources/security.py +204 -0
- drazill/resources/series.py +34 -0
- drazill/resources/settings.py +34 -0
- drazill/resources/sports.py +318 -0
- drazill/resources/status.py +34 -0
- drazill/resources/taxonomy.py +66 -0
- drazill/resources/terminal.py +134 -0
- drazill/resources/trades.py +82 -0
- drazill/resources/trailing_stops.py +128 -0
- drazill/resources/twap_orders.py +140 -0
- drazill/resources/usage.py +58 -0
- drazill/resources/users.py +804 -0
- drazill/resources/waitlist.py +120 -0
- drazill/resources/wallet.py +766 -0
- drazill/resources/watchlist.py +136 -0
- drazill/resources/webhooks.py +292 -0
- drazill/types/__init__.py +22 -0
- drazill/types/common.py +49 -0
- drazill/types/models.py +11187 -0
- drazill/types/webhooks.py +23 -0
- drazill/webhooks.py +92 -0
- drazill-0.2.0.dist-info/METADATA +496 -0
- drazill-0.2.0.dist-info/RECORD +81 -0
- drazill-0.2.0.dist-info/WHEEL +4 -0
- drazill-0.2.0.dist-info/licenses/LICENSE +21 -0
drazill/__init__.py
ADDED
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
"""Drazill SDK - Official Python client for the Drazill Prediction Market API."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import TYPE_CHECKING, Optional
|
|
6
|
+
|
|
7
|
+
from drazill._client import (
|
|
8
|
+
DEFAULT_BASE_URL,
|
|
9
|
+
AsyncHttpClient,
|
|
10
|
+
RequestOptions,
|
|
11
|
+
SyncHttpClient,
|
|
12
|
+
resolve_base_url,
|
|
13
|
+
)
|
|
14
|
+
from drazill._errors import (
|
|
15
|
+
ApiError,
|
|
16
|
+
AuthenticationError,
|
|
17
|
+
DrazillError,
|
|
18
|
+
NetworkError,
|
|
19
|
+
RateLimitError,
|
|
20
|
+
ValidationError,
|
|
21
|
+
)
|
|
22
|
+
from drazill._pagination import (
|
|
23
|
+
aiter_cursor,
|
|
24
|
+
aiter_offset,
|
|
25
|
+
iter_cursor,
|
|
26
|
+
iter_offset,
|
|
27
|
+
)
|
|
28
|
+
from drazill.resources.activity import ActivityResource, AsyncActivityResource
|
|
29
|
+
from drazill.resources.api_keys import ApiKeysResource, AsyncApiKeysResource
|
|
30
|
+
from drazill.resources.auth import AuthResource, AsyncAuthResource
|
|
31
|
+
from drazill.resources.bracket_orders import BracketOrdersResource, AsyncBracketOrdersResource
|
|
32
|
+
from drazill.resources.calendar import CalendarResource, AsyncCalendarResource
|
|
33
|
+
from drazill.resources.chat import ChatResource, AsyncChatResource
|
|
34
|
+
from drazill.resources.comments import CommentsResource, AsyncCommentsResource
|
|
35
|
+
from drazill.resources.compliance import ComplianceResource, AsyncComplianceResource
|
|
36
|
+
from drazill.resources.conditional_orders import (
|
|
37
|
+
ConditionalOrdersResource,
|
|
38
|
+
AsyncConditionalOrdersResource,
|
|
39
|
+
)
|
|
40
|
+
from drazill.resources.contests import ContestsResource, AsyncContestsResource
|
|
41
|
+
from drazill.resources.copy_trades import CopyTradesResource, AsyncCopyTradesResource
|
|
42
|
+
from drazill.resources.crypto import CryptoResource, AsyncCryptoResource
|
|
43
|
+
from drazill.resources.data_dictionary import DataDictionaryResource, AsyncDataDictionaryResource
|
|
44
|
+
from drazill.resources.data_exports import DataExportsResource, AsyncDataExportsResource
|
|
45
|
+
from drazill.resources.developers import DevelopersResource, AsyncDevelopersResource
|
|
46
|
+
from drazill.resources.disputes import DisputesResource, AsyncDisputesResource
|
|
47
|
+
from drazill.resources.enterprise import EnterpriseResource, AsyncEnterpriseResource
|
|
48
|
+
from drazill.resources.events import EventsResource, AsyncEventsResource
|
|
49
|
+
from drazill.resources.feature_flags import FeatureFlagsResource, AsyncFeatureFlagsResource
|
|
50
|
+
from drazill.resources.fees import FeesResource, AsyncFeesResource
|
|
51
|
+
from drazill.resources.geo import GeoResource, AsyncGeoResource
|
|
52
|
+
from drazill.resources.giveaway import GiveawayResource, AsyncGiveawayResource
|
|
53
|
+
from drazill.resources.health import HealthResource, AsyncHealthResource
|
|
54
|
+
from drazill.resources.hubs import HubsResource, AsyncHubsResource
|
|
55
|
+
from drazill.resources.info import InfoResource, AsyncInfoResource
|
|
56
|
+
from drazill.resources.institutional import InstitutionalResource, AsyncInstitutionalResource
|
|
57
|
+
from drazill.resources.intelligence import IntelligenceResource, AsyncIntelligenceResource
|
|
58
|
+
from drazill.resources.lessons import LessonsResource, AsyncLessonsResource
|
|
59
|
+
from drazill.resources.live import LiveResource, AsyncLiveResource
|
|
60
|
+
from drazill.resources.market_requests import MarketRequestsResource, AsyncMarketRequestsResource
|
|
61
|
+
from drazill.resources.markets import MarketsResource, AsyncMarketsResource
|
|
62
|
+
from drazill.resources.me import MeResource, AsyncMeResource
|
|
63
|
+
from drazill.resources.moderation import ModerationResource, AsyncModerationResource
|
|
64
|
+
from drazill.resources.news import NewsResource, AsyncNewsResource
|
|
65
|
+
from drazill.resources.notifications import NotificationsResource, AsyncNotificationsResource
|
|
66
|
+
from drazill.resources.openapi import OpenapiResource, AsyncOpenapiResource
|
|
67
|
+
from drazill.resources.orders import OrdersResource, AsyncOrdersResource
|
|
68
|
+
from drazill.resources.paper import PaperResource, AsyncPaperResource
|
|
69
|
+
from drazill.resources.parlays import ParlaysResource, AsyncParlaysResource
|
|
70
|
+
from drazill.resources.portfolio import PortfolioResource, AsyncPortfolioResource
|
|
71
|
+
from drazill.resources.price_alerts import PriceAlertsResource, AsyncPriceAlertsResource
|
|
72
|
+
from drazill.resources.promos import PromosResource, AsyncPromosResource
|
|
73
|
+
from drazill.resources.push import PushResource, AsyncPushResource
|
|
74
|
+
from drazill.resources.qa_feedback import QaFeedbackResource, AsyncQaFeedbackResource
|
|
75
|
+
from drazill.resources.rank import RankResource, AsyncRankResource
|
|
76
|
+
from drazill.resources.referrals import ReferralsResource, AsyncReferralsResource
|
|
77
|
+
from drazill.resources.rewards import RewardsResource, AsyncRewardsResource
|
|
78
|
+
from drazill.resources.risk_overlay import RiskOverlayResource, AsyncRiskOverlayResource
|
|
79
|
+
from drazill.resources.search import SearchResource, AsyncSearchResource
|
|
80
|
+
from drazill.resources.security import SecurityResource, AsyncSecurityResource
|
|
81
|
+
from drazill.resources.series import SeriesResource, AsyncSeriesResource
|
|
82
|
+
from drazill.resources.settings import SettingsResource, AsyncSettingsResource
|
|
83
|
+
from drazill.resources.sports import SportsResource, AsyncSportsResource
|
|
84
|
+
from drazill.resources.status import StatusResource, AsyncStatusResource
|
|
85
|
+
from drazill.resources.taxonomy import TaxonomyResource, AsyncTaxonomyResource
|
|
86
|
+
from drazill.resources.terminal import TerminalResource, AsyncTerminalResource
|
|
87
|
+
from drazill.resources.trades import TradesResource, AsyncTradesResource
|
|
88
|
+
from drazill.resources.trailing_stops import TrailingStopsResource, AsyncTrailingStopsResource
|
|
89
|
+
from drazill.resources.twap_orders import TwapOrdersResource, AsyncTwapOrdersResource
|
|
90
|
+
from drazill.resources.usage import UsageResource, AsyncUsageResource
|
|
91
|
+
from drazill.resources.users import UsersResource, AsyncUsersResource
|
|
92
|
+
from drazill.resources.waitlist import WaitlistResource, AsyncWaitlistResource
|
|
93
|
+
from drazill.resources.wallet import WalletResource, AsyncWalletResource
|
|
94
|
+
from drazill.resources.watchlist import WatchlistResource, AsyncWatchlistResource
|
|
95
|
+
from drazill.resources.webhooks import WebhooksResource, AsyncWebhooksResource
|
|
96
|
+
from drazill.webhooks import construct_webhook_event, verify_webhook_signature
|
|
97
|
+
|
|
98
|
+
if TYPE_CHECKING:
|
|
99
|
+
from drazill._websocket import DrazillWebSocket
|
|
100
|
+
|
|
101
|
+
__version__ = "0.2.0"
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class DrazillClient:
|
|
105
|
+
"""Synchronous Drazill API client."""
|
|
106
|
+
|
|
107
|
+
def __init__(
|
|
108
|
+
self,
|
|
109
|
+
*,
|
|
110
|
+
api_key: Optional[str] = None,
|
|
111
|
+
bearer_token: Optional[str] = None,
|
|
112
|
+
base_url: Optional[str] = None,
|
|
113
|
+
timeout: float = 10.0,
|
|
114
|
+
max_retries: int = 3,
|
|
115
|
+
) -> None:
|
|
116
|
+
self._base_url = resolve_base_url(base_url)
|
|
117
|
+
self._http = SyncHttpClient(
|
|
118
|
+
api_key=api_key,
|
|
119
|
+
bearer_token=bearer_token,
|
|
120
|
+
base_url=self._base_url,
|
|
121
|
+
timeout=timeout,
|
|
122
|
+
max_retries=max_retries,
|
|
123
|
+
)
|
|
124
|
+
self._api_key = api_key
|
|
125
|
+
self._bearer_token = bearer_token
|
|
126
|
+
|
|
127
|
+
self.activity = ActivityResource(self._http)
|
|
128
|
+
self.api_keys = ApiKeysResource(self._http)
|
|
129
|
+
self.auth = AuthResource(self._http)
|
|
130
|
+
self.bracket_orders = BracketOrdersResource(self._http)
|
|
131
|
+
self.calendar = CalendarResource(self._http)
|
|
132
|
+
self.chat = ChatResource(self._http)
|
|
133
|
+
self.comments = CommentsResource(self._http)
|
|
134
|
+
self.compliance = ComplianceResource(self._http)
|
|
135
|
+
self.conditional_orders = ConditionalOrdersResource(self._http)
|
|
136
|
+
self.contests = ContestsResource(self._http)
|
|
137
|
+
self.copy_trades = CopyTradesResource(self._http)
|
|
138
|
+
self.crypto = CryptoResource(self._http)
|
|
139
|
+
self.data_dictionary = DataDictionaryResource(self._http)
|
|
140
|
+
self.data_exports = DataExportsResource(self._http)
|
|
141
|
+
self.developers = DevelopersResource(self._http)
|
|
142
|
+
self.disputes = DisputesResource(self._http)
|
|
143
|
+
self.enterprise = EnterpriseResource(self._http)
|
|
144
|
+
self.events = EventsResource(self._http)
|
|
145
|
+
self.feature_flags = FeatureFlagsResource(self._http)
|
|
146
|
+
self.fees = FeesResource(self._http)
|
|
147
|
+
self.geo = GeoResource(self._http)
|
|
148
|
+
self.giveaway = GiveawayResource(self._http)
|
|
149
|
+
self.health = HealthResource(self._http)
|
|
150
|
+
self.hubs = HubsResource(self._http)
|
|
151
|
+
self.info = InfoResource(self._http)
|
|
152
|
+
self.institutional = InstitutionalResource(self._http)
|
|
153
|
+
self.intelligence = IntelligenceResource(self._http)
|
|
154
|
+
self.lessons = LessonsResource(self._http)
|
|
155
|
+
self.live = LiveResource(self._http)
|
|
156
|
+
self.market_requests = MarketRequestsResource(self._http)
|
|
157
|
+
self.markets = MarketsResource(self._http)
|
|
158
|
+
self.me = MeResource(self._http)
|
|
159
|
+
self.moderation = ModerationResource(self._http)
|
|
160
|
+
self.news = NewsResource(self._http)
|
|
161
|
+
self.notifications = NotificationsResource(self._http)
|
|
162
|
+
self.openapi = OpenapiResource(self._http)
|
|
163
|
+
self.orders = OrdersResource(self._http)
|
|
164
|
+
self.paper = PaperResource(self._http)
|
|
165
|
+
self.parlays = ParlaysResource(self._http)
|
|
166
|
+
self.portfolio = PortfolioResource(self._http)
|
|
167
|
+
self.price_alerts = PriceAlertsResource(self._http)
|
|
168
|
+
self.promos = PromosResource(self._http)
|
|
169
|
+
self.push = PushResource(self._http)
|
|
170
|
+
self.qa_feedback = QaFeedbackResource(self._http)
|
|
171
|
+
self.rank = RankResource(self._http)
|
|
172
|
+
self.referrals = ReferralsResource(self._http)
|
|
173
|
+
self.rewards = RewardsResource(self._http)
|
|
174
|
+
self.risk_overlay = RiskOverlayResource(self._http)
|
|
175
|
+
self.search = SearchResource(self._http)
|
|
176
|
+
self.security = SecurityResource(self._http)
|
|
177
|
+
self.series = SeriesResource(self._http)
|
|
178
|
+
self.settings = SettingsResource(self._http)
|
|
179
|
+
self.sports = SportsResource(self._http)
|
|
180
|
+
self.status = StatusResource(self._http)
|
|
181
|
+
self.taxonomy = TaxonomyResource(self._http)
|
|
182
|
+
self.terminal = TerminalResource(self._http)
|
|
183
|
+
self.trades = TradesResource(self._http)
|
|
184
|
+
self.trailing_stops = TrailingStopsResource(self._http)
|
|
185
|
+
self.twap_orders = TwapOrdersResource(self._http)
|
|
186
|
+
self.usage = UsageResource(self._http)
|
|
187
|
+
self.users = UsersResource(self._http)
|
|
188
|
+
self.waitlist = WaitlistResource(self._http)
|
|
189
|
+
self.wallet = WalletResource(self._http)
|
|
190
|
+
self.watchlist = WatchlistResource(self._http)
|
|
191
|
+
self.webhooks = WebhooksResource(self._http)
|
|
192
|
+
|
|
193
|
+
def close(self) -> None:
|
|
194
|
+
self._http.close()
|
|
195
|
+
|
|
196
|
+
def __enter__(self) -> "DrazillClient":
|
|
197
|
+
return self
|
|
198
|
+
|
|
199
|
+
def __exit__(self, *args: object) -> None:
|
|
200
|
+
self.close()
|
|
201
|
+
|
|
202
|
+
def ws(self, **kwargs: object) -> "DrazillWebSocket":
|
|
203
|
+
from drazill._websocket import DrazillWebSocket
|
|
204
|
+
|
|
205
|
+
ws_url = self._base_url.replace("/api/v1", "").replace("http", "ws") + "/ws"
|
|
206
|
+
return DrazillWebSocket(
|
|
207
|
+
url=kwargs.get("url", ws_url), # type: ignore[arg-type]
|
|
208
|
+
api_key=self._api_key,
|
|
209
|
+
token=self._bearer_token,
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
class AsyncDrazillClient:
|
|
214
|
+
"""Asynchronous Drazill API client."""
|
|
215
|
+
|
|
216
|
+
def __init__(
|
|
217
|
+
self,
|
|
218
|
+
*,
|
|
219
|
+
api_key: Optional[str] = None,
|
|
220
|
+
bearer_token: Optional[str] = None,
|
|
221
|
+
base_url: Optional[str] = None,
|
|
222
|
+
timeout: float = 10.0,
|
|
223
|
+
max_retries: int = 3,
|
|
224
|
+
) -> None:
|
|
225
|
+
self._base_url = resolve_base_url(base_url)
|
|
226
|
+
self._http = AsyncHttpClient(
|
|
227
|
+
api_key=api_key,
|
|
228
|
+
bearer_token=bearer_token,
|
|
229
|
+
base_url=self._base_url,
|
|
230
|
+
timeout=timeout,
|
|
231
|
+
max_retries=max_retries,
|
|
232
|
+
)
|
|
233
|
+
self._api_key = api_key
|
|
234
|
+
self._bearer_token = bearer_token
|
|
235
|
+
|
|
236
|
+
self.activity = AsyncActivityResource(self._http)
|
|
237
|
+
self.api_keys = AsyncApiKeysResource(self._http)
|
|
238
|
+
self.auth = AsyncAuthResource(self._http)
|
|
239
|
+
self.bracket_orders = AsyncBracketOrdersResource(self._http)
|
|
240
|
+
self.calendar = AsyncCalendarResource(self._http)
|
|
241
|
+
self.chat = AsyncChatResource(self._http)
|
|
242
|
+
self.comments = AsyncCommentsResource(self._http)
|
|
243
|
+
self.compliance = AsyncComplianceResource(self._http)
|
|
244
|
+
self.conditional_orders = AsyncConditionalOrdersResource(self._http)
|
|
245
|
+
self.contests = AsyncContestsResource(self._http)
|
|
246
|
+
self.copy_trades = AsyncCopyTradesResource(self._http)
|
|
247
|
+
self.crypto = AsyncCryptoResource(self._http)
|
|
248
|
+
self.data_dictionary = AsyncDataDictionaryResource(self._http)
|
|
249
|
+
self.data_exports = AsyncDataExportsResource(self._http)
|
|
250
|
+
self.developers = AsyncDevelopersResource(self._http)
|
|
251
|
+
self.disputes = AsyncDisputesResource(self._http)
|
|
252
|
+
self.enterprise = AsyncEnterpriseResource(self._http)
|
|
253
|
+
self.events = AsyncEventsResource(self._http)
|
|
254
|
+
self.feature_flags = AsyncFeatureFlagsResource(self._http)
|
|
255
|
+
self.fees = AsyncFeesResource(self._http)
|
|
256
|
+
self.geo = AsyncGeoResource(self._http)
|
|
257
|
+
self.giveaway = AsyncGiveawayResource(self._http)
|
|
258
|
+
self.health = AsyncHealthResource(self._http)
|
|
259
|
+
self.hubs = AsyncHubsResource(self._http)
|
|
260
|
+
self.info = AsyncInfoResource(self._http)
|
|
261
|
+
self.institutional = AsyncInstitutionalResource(self._http)
|
|
262
|
+
self.intelligence = AsyncIntelligenceResource(self._http)
|
|
263
|
+
self.lessons = AsyncLessonsResource(self._http)
|
|
264
|
+
self.live = AsyncLiveResource(self._http)
|
|
265
|
+
self.market_requests = AsyncMarketRequestsResource(self._http)
|
|
266
|
+
self.markets = AsyncMarketsResource(self._http)
|
|
267
|
+
self.me = AsyncMeResource(self._http)
|
|
268
|
+
self.moderation = AsyncModerationResource(self._http)
|
|
269
|
+
self.news = AsyncNewsResource(self._http)
|
|
270
|
+
self.notifications = AsyncNotificationsResource(self._http)
|
|
271
|
+
self.openapi = AsyncOpenapiResource(self._http)
|
|
272
|
+
self.orders = AsyncOrdersResource(self._http)
|
|
273
|
+
self.paper = AsyncPaperResource(self._http)
|
|
274
|
+
self.parlays = AsyncParlaysResource(self._http)
|
|
275
|
+
self.portfolio = AsyncPortfolioResource(self._http)
|
|
276
|
+
self.price_alerts = AsyncPriceAlertsResource(self._http)
|
|
277
|
+
self.promos = AsyncPromosResource(self._http)
|
|
278
|
+
self.push = AsyncPushResource(self._http)
|
|
279
|
+
self.qa_feedback = AsyncQaFeedbackResource(self._http)
|
|
280
|
+
self.rank = AsyncRankResource(self._http)
|
|
281
|
+
self.referrals = AsyncReferralsResource(self._http)
|
|
282
|
+
self.rewards = AsyncRewardsResource(self._http)
|
|
283
|
+
self.risk_overlay = AsyncRiskOverlayResource(self._http)
|
|
284
|
+
self.search = AsyncSearchResource(self._http)
|
|
285
|
+
self.security = AsyncSecurityResource(self._http)
|
|
286
|
+
self.series = AsyncSeriesResource(self._http)
|
|
287
|
+
self.settings = AsyncSettingsResource(self._http)
|
|
288
|
+
self.sports = AsyncSportsResource(self._http)
|
|
289
|
+
self.status = AsyncStatusResource(self._http)
|
|
290
|
+
self.taxonomy = AsyncTaxonomyResource(self._http)
|
|
291
|
+
self.terminal = AsyncTerminalResource(self._http)
|
|
292
|
+
self.trades = AsyncTradesResource(self._http)
|
|
293
|
+
self.trailing_stops = AsyncTrailingStopsResource(self._http)
|
|
294
|
+
self.twap_orders = AsyncTwapOrdersResource(self._http)
|
|
295
|
+
self.usage = AsyncUsageResource(self._http)
|
|
296
|
+
self.users = AsyncUsersResource(self._http)
|
|
297
|
+
self.waitlist = AsyncWaitlistResource(self._http)
|
|
298
|
+
self.wallet = AsyncWalletResource(self._http)
|
|
299
|
+
self.watchlist = AsyncWatchlistResource(self._http)
|
|
300
|
+
self.webhooks = AsyncWebhooksResource(self._http)
|
|
301
|
+
|
|
302
|
+
async def close(self) -> None:
|
|
303
|
+
await self._http.close()
|
|
304
|
+
|
|
305
|
+
async def __aenter__(self) -> "AsyncDrazillClient":
|
|
306
|
+
return self
|
|
307
|
+
|
|
308
|
+
async def __aexit__(self, *args: object) -> None:
|
|
309
|
+
await self.close()
|
|
310
|
+
|
|
311
|
+
def ws(self, **kwargs: object) -> "DrazillWebSocket":
|
|
312
|
+
from drazill._websocket import DrazillWebSocket
|
|
313
|
+
|
|
314
|
+
ws_url = self._base_url.replace("/api/v1", "").replace("http", "ws") + "/ws"
|
|
315
|
+
return DrazillWebSocket(
|
|
316
|
+
url=kwargs.get("url", ws_url), # type: ignore[arg-type]
|
|
317
|
+
api_key=self._api_key,
|
|
318
|
+
token=self._bearer_token,
|
|
319
|
+
)
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
__all__ = [
|
|
323
|
+
"DrazillClient",
|
|
324
|
+
"AsyncDrazillClient",
|
|
325
|
+
"DrazillError",
|
|
326
|
+
"ApiError",
|
|
327
|
+
"AuthenticationError",
|
|
328
|
+
"RateLimitError",
|
|
329
|
+
"ValidationError",
|
|
330
|
+
"NetworkError",
|
|
331
|
+
"RequestOptions",
|
|
332
|
+
"iter_cursor",
|
|
333
|
+
"aiter_cursor",
|
|
334
|
+
"iter_offset",
|
|
335
|
+
"aiter_offset",
|
|
336
|
+
"construct_webhook_event",
|
|
337
|
+
"verify_webhook_signature",
|
|
338
|
+
"DEFAULT_BASE_URL",
|
|
339
|
+
"resolve_base_url",
|
|
340
|
+
"__version__",
|
|
341
|
+
]
|