cabalspy-id 0.5.1__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.
- cabalspy_id/__init__.py +271 -0
- cabalspy_id/_client.py +959 -0
- cabalspy_id/_constants.py +68 -0
- cabalspy_id/_errors.py +189 -0
- cabalspy_id/_oidc.py +599 -0
- cabalspy_id/_stream.py +431 -0
- cabalspy_id/_theses_stream.py +444 -0
- cabalspy_id/_thesis.py +717 -0
- cabalspy_id/_types.py +710 -0
- cabalspy_id/_users.py +46 -0
- cabalspy_id/_webhooks.py +116 -0
- cabalspy_id/api.py +201 -0
- cabalspy_id/py.typed +0 -0
- cabalspy_id/thesis.py +146 -0
- cabalspy_id-0.5.1.dist-info/METADATA +495 -0
- cabalspy_id-0.5.1.dist-info/RECORD +18 -0
- cabalspy_id-0.5.1.dist-info/WHEEL +4 -0
- cabalspy_id-0.5.1.dist-info/licenses/LICENSE +21 -0
cabalspy_id/__init__.py
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
"""CabalSpy ID — the verified social layer for crypto trading.
|
|
2
|
+
|
|
3
|
+
Login with CabalSpy ID (OpenID Connect), the Data API for verified wallets, KOL
|
|
4
|
+
badges, trading stats and token theses, the live stream, the public thesis API
|
|
5
|
+
and webhook verification.
|
|
6
|
+
|
|
7
|
+
from cabalspy_id import CabalSpyID, CabalSpyIDAuth, verify_webhook
|
|
8
|
+
|
|
9
|
+
auth = CabalSpyIDAuth(client_id="csid_...", client_secret="csid_sk_...",
|
|
10
|
+
redirect_uri="https://your.app/callback")
|
|
11
|
+
csid = CabalSpyID() # reads CABALSPY_ID_API_KEY / CABALSPY_API_KEY
|
|
12
|
+
profile = csid.profile(csid_id=claims["sub"])
|
|
13
|
+
|
|
14
|
+
Docs: https://docs.cabalspy.xyz/cabalspy-id
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from ._client import AsyncCabalSpyID, CabalSpyID, Envelope
|
|
18
|
+
from ._constants import (
|
|
19
|
+
CHAINS,
|
|
20
|
+
CURRENCY_BY_CHAIN,
|
|
21
|
+
DEFAULT_BASE_URL,
|
|
22
|
+
DEFAULT_ISSUER,
|
|
23
|
+
DEFAULT_STREAM_URL,
|
|
24
|
+
DEFAULT_THESES_STREAM_URL,
|
|
25
|
+
DEFAULT_THESIS_URL,
|
|
26
|
+
DEFAULT_THESIS_WS_URL,
|
|
27
|
+
LEADERBOARD_SORTS,
|
|
28
|
+
MAX_THESES_STREAM_TOKENS,
|
|
29
|
+
PERIODS,
|
|
30
|
+
SCOPES,
|
|
31
|
+
SDK_VERSION,
|
|
32
|
+
STREAM_TOPICS,
|
|
33
|
+
THESIS_EMOJIS,
|
|
34
|
+
THESIS_MAX_BODY,
|
|
35
|
+
THESIS_REPORT_REASONS,
|
|
36
|
+
THESIS_SCOPES,
|
|
37
|
+
WEBHOOK_EVENTS,
|
|
38
|
+
Chain,
|
|
39
|
+
Currency,
|
|
40
|
+
LeaderboardSort,
|
|
41
|
+
OidcScope,
|
|
42
|
+
Period,
|
|
43
|
+
Scope,
|
|
44
|
+
StreamTopic,
|
|
45
|
+
ThesisEmoji,
|
|
46
|
+
ThesisReportReason,
|
|
47
|
+
ThesisScope,
|
|
48
|
+
ThesisSort,
|
|
49
|
+
ThesisStance,
|
|
50
|
+
)
|
|
51
|
+
from ._errors import (
|
|
52
|
+
APIConnectionError,
|
|
53
|
+
AuthenticationError,
|
|
54
|
+
BadRequestError,
|
|
55
|
+
CabalSpyIDError,
|
|
56
|
+
InvalidResponseError,
|
|
57
|
+
NotFoundError,
|
|
58
|
+
OAuthError,
|
|
59
|
+
PlanUserLimitError,
|
|
60
|
+
RateLimit,
|
|
61
|
+
RateLimitError,
|
|
62
|
+
ServerError,
|
|
63
|
+
TokenVerificationError,
|
|
64
|
+
WebhookVerificationError,
|
|
65
|
+
)
|
|
66
|
+
from ._errors import PermissionError_ as PermissionError
|
|
67
|
+
from ._oidc import (
|
|
68
|
+
AsyncCabalSpyIDAuth,
|
|
69
|
+
AuthorizationRequest,
|
|
70
|
+
CabalSpyIDAuth,
|
|
71
|
+
LoginResult,
|
|
72
|
+
PkcePair,
|
|
73
|
+
generate_pkce,
|
|
74
|
+
is_limited,
|
|
75
|
+
)
|
|
76
|
+
from ._thesis import AsyncThesisClient, ThesisClient, ThesisLive, ThesisPage, TokenThesesPage
|
|
77
|
+
from ._types import (
|
|
78
|
+
ActiveHoldings,
|
|
79
|
+
ActiveTokens,
|
|
80
|
+
CabalSpyIDClaims,
|
|
81
|
+
DiscoveryDocument,
|
|
82
|
+
HealthResponse,
|
|
83
|
+
HistoryResponse,
|
|
84
|
+
HistoryToken,
|
|
85
|
+
HistoryTrade,
|
|
86
|
+
HoldingsResponse,
|
|
87
|
+
HoldingToken,
|
|
88
|
+
LeaderboardEntry,
|
|
89
|
+
LeaderboardResponse,
|
|
90
|
+
LifetimeStats,
|
|
91
|
+
MeResponse,
|
|
92
|
+
Pagination,
|
|
93
|
+
PeriodStats,
|
|
94
|
+
PnlCalendarDay,
|
|
95
|
+
PnlCalendarMonth,
|
|
96
|
+
PnlCalendarResponse,
|
|
97
|
+
PnlChartPoint,
|
|
98
|
+
Profile,
|
|
99
|
+
ResponseMeta,
|
|
100
|
+
Thesis,
|
|
101
|
+
ThesisAuthor,
|
|
102
|
+
ThesisEligibility,
|
|
103
|
+
ThesisNotices,
|
|
104
|
+
ThesisNotification,
|
|
105
|
+
ThesisNotifications,
|
|
106
|
+
ThesisPnl,
|
|
107
|
+
ThesisPosition,
|
|
108
|
+
ThesisReactions,
|
|
109
|
+
ThesisReactor,
|
|
110
|
+
ThesisSummary,
|
|
111
|
+
ThesisToken,
|
|
112
|
+
TokenOverview,
|
|
113
|
+
TokenResponse,
|
|
114
|
+
TrackerResponse,
|
|
115
|
+
TrackerTrade,
|
|
116
|
+
Trade,
|
|
117
|
+
TradeOwner,
|
|
118
|
+
TraderProfile,
|
|
119
|
+
VerifiedWallet,
|
|
120
|
+
WalletClaim,
|
|
121
|
+
WalletLookupResponse,
|
|
122
|
+
WebhookEvent,
|
|
123
|
+
WinRateBuckets,
|
|
124
|
+
WinRateDistribution,
|
|
125
|
+
XProfileClaim,
|
|
126
|
+
)
|
|
127
|
+
from ._users import HandleKind, handle_kind, has_x
|
|
128
|
+
from ._webhooks import HeaderSource, sign_webhook, verify_webhook
|
|
129
|
+
|
|
130
|
+
__version__ = SDK_VERSION
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def __getattr__(name: str) -> object:
|
|
134
|
+
# The stream needs the optional websockets dependency; import it lazily.
|
|
135
|
+
if name in ("CabalSpyIDStream", "STREAM_EVENTS", "THESIS_EVENTS"):
|
|
136
|
+
from . import _stream
|
|
137
|
+
|
|
138
|
+
return getattr(_stream, name)
|
|
139
|
+
if name in ("ThesesStream", "THESES_STREAM_EVENTS"):
|
|
140
|
+
from . import _theses_stream
|
|
141
|
+
|
|
142
|
+
return getattr(_theses_stream, name)
|
|
143
|
+
raise AttributeError(f"module 'cabalspy_id' has no attribute {name!r}")
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
__all__ = [
|
|
147
|
+
"__version__",
|
|
148
|
+
# clients
|
|
149
|
+
"CabalSpyID",
|
|
150
|
+
"AsyncCabalSpyID",
|
|
151
|
+
"CabalSpyIDStream",
|
|
152
|
+
"ThesesStream",
|
|
153
|
+
"Envelope",
|
|
154
|
+
"CabalSpyIDAuth",
|
|
155
|
+
"AsyncCabalSpyIDAuth",
|
|
156
|
+
"AuthorizationRequest",
|
|
157
|
+
"LoginResult",
|
|
158
|
+
"PkcePair",
|
|
159
|
+
"generate_pkce",
|
|
160
|
+
"is_limited",
|
|
161
|
+
"verify_webhook",
|
|
162
|
+
"sign_webhook",
|
|
163
|
+
"HeaderSource",
|
|
164
|
+
"has_x",
|
|
165
|
+
"handle_kind",
|
|
166
|
+
"HandleKind",
|
|
167
|
+
"ThesisClient",
|
|
168
|
+
"AsyncThesisClient",
|
|
169
|
+
"ThesisLive",
|
|
170
|
+
"TokenThesesPage",
|
|
171
|
+
"ThesisPage",
|
|
172
|
+
# errors
|
|
173
|
+
"CabalSpyIDError",
|
|
174
|
+
"BadRequestError",
|
|
175
|
+
"AuthenticationError",
|
|
176
|
+
"PermissionError",
|
|
177
|
+
"PlanUserLimitError",
|
|
178
|
+
"NotFoundError",
|
|
179
|
+
"RateLimitError",
|
|
180
|
+
"ServerError",
|
|
181
|
+
"APIConnectionError",
|
|
182
|
+
"InvalidResponseError",
|
|
183
|
+
"OAuthError",
|
|
184
|
+
"TokenVerificationError",
|
|
185
|
+
"WebhookVerificationError",
|
|
186
|
+
"RateLimit",
|
|
187
|
+
# constants
|
|
188
|
+
"SDK_VERSION",
|
|
189
|
+
"CHAINS",
|
|
190
|
+
"PERIODS",
|
|
191
|
+
"LEADERBOARD_SORTS",
|
|
192
|
+
"SCOPES",
|
|
193
|
+
"CURRENCY_BY_CHAIN",
|
|
194
|
+
"WEBHOOK_EVENTS",
|
|
195
|
+
"STREAM_EVENTS",
|
|
196
|
+
"THESIS_EVENTS",
|
|
197
|
+
"STREAM_TOPICS",
|
|
198
|
+
"THESES_STREAM_EVENTS",
|
|
199
|
+
"THESIS_SCOPES",
|
|
200
|
+
"MAX_THESES_STREAM_TOKENS",
|
|
201
|
+
"DEFAULT_THESES_STREAM_URL",
|
|
202
|
+
"ThesisScope",
|
|
203
|
+
"THESIS_EMOJIS",
|
|
204
|
+
"THESIS_REPORT_REASONS",
|
|
205
|
+
"THESIS_MAX_BODY",
|
|
206
|
+
"DEFAULT_THESIS_URL",
|
|
207
|
+
"DEFAULT_THESIS_WS_URL",
|
|
208
|
+
"StreamTopic",
|
|
209
|
+
"ThesisStance",
|
|
210
|
+
"ThesisSort",
|
|
211
|
+
"ThesisEmoji",
|
|
212
|
+
"ThesisReportReason",
|
|
213
|
+
"DEFAULT_BASE_URL",
|
|
214
|
+
"DEFAULT_STREAM_URL",
|
|
215
|
+
"DEFAULT_ISSUER",
|
|
216
|
+
"Chain",
|
|
217
|
+
"Period",
|
|
218
|
+
"LeaderboardSort",
|
|
219
|
+
"Currency",
|
|
220
|
+
"Scope",
|
|
221
|
+
"OidcScope",
|
|
222
|
+
# response types
|
|
223
|
+
"ResponseMeta",
|
|
224
|
+
"Pagination",
|
|
225
|
+
"HealthResponse",
|
|
226
|
+
"MeResponse",
|
|
227
|
+
"Profile",
|
|
228
|
+
"VerifiedWallet",
|
|
229
|
+
"WalletLookupResponse",
|
|
230
|
+
"TraderProfile",
|
|
231
|
+
"PeriodStats",
|
|
232
|
+
"WinRateBuckets",
|
|
233
|
+
"WinRateDistribution",
|
|
234
|
+
"ActiveTokens",
|
|
235
|
+
"HistoryToken",
|
|
236
|
+
"PnlChartPoint",
|
|
237
|
+
"TrackerTrade",
|
|
238
|
+
"TrackerResponse",
|
|
239
|
+
"LifetimeStats",
|
|
240
|
+
"TokenOverview",
|
|
241
|
+
"HistoryTrade",
|
|
242
|
+
"HistoryResponse",
|
|
243
|
+
"HoldingToken",
|
|
244
|
+
"ActiveHoldings",
|
|
245
|
+
"HoldingsResponse",
|
|
246
|
+
"PnlCalendarDay",
|
|
247
|
+
"PnlCalendarMonth",
|
|
248
|
+
"PnlCalendarResponse",
|
|
249
|
+
"LeaderboardEntry",
|
|
250
|
+
"LeaderboardResponse",
|
|
251
|
+
"Trade",
|
|
252
|
+
"TradeOwner",
|
|
253
|
+
"CabalSpyIDClaims",
|
|
254
|
+
"XProfileClaim",
|
|
255
|
+
"WalletClaim",
|
|
256
|
+
"TokenResponse",
|
|
257
|
+
"DiscoveryDocument",
|
|
258
|
+
"WebhookEvent",
|
|
259
|
+
"Thesis",
|
|
260
|
+
"ThesisAuthor",
|
|
261
|
+
"ThesisPnl",
|
|
262
|
+
"ThesisPosition",
|
|
263
|
+
"ThesisToken",
|
|
264
|
+
"ThesisSummary",
|
|
265
|
+
"ThesisEligibility",
|
|
266
|
+
"ThesisNotification",
|
|
267
|
+
"ThesisNotifications",
|
|
268
|
+
"ThesisNotices",
|
|
269
|
+
"ThesisReactor",
|
|
270
|
+
"ThesisReactions",
|
|
271
|
+
]
|