cabalspy-id 0.5.1 → 0.5.2
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.
- package/CHANGELOG.md +146 -112
- package/LICENSE +21 -21
- package/README.md +505 -475
- package/dist/api.cjs +5 -3
- package/dist/api.cjs.map +1 -1
- package/dist/api.d.cts +1 -1
- package/dist/api.d.ts +1 -1
- package/dist/api.js +16 -14
- package/dist/chunk-A2ZAFAWC.cjs.map +1 -1
- package/dist/chunk-ABFIPCBY.cjs +109 -0
- package/dist/chunk-ABFIPCBY.cjs.map +1 -0
- package/dist/{chunk-Z3UPDOBY.js → chunk-DBYCRBVS.js} +9 -7
- package/dist/chunk-DBYCRBVS.js.map +1 -0
- package/dist/{chunk-P3MDLWLN.cjs → chunk-PKFIMBPW.cjs} +113 -54
- package/dist/chunk-PKFIMBPW.cjs.map +1 -0
- package/dist/{chunk-L4RHSWOA.cjs → chunk-ULEBNY2A.cjs} +121 -212
- package/dist/chunk-ULEBNY2A.cjs.map +1 -0
- package/dist/{chunk-X3OFGGSE.cjs → chunk-VDFCMYLR.cjs} +50 -48
- package/dist/chunk-VDFCMYLR.cjs.map +1 -0
- package/dist/chunk-VOTYIQAY.js +109 -0
- package/dist/chunk-VOTYIQAY.js.map +1 -0
- package/dist/{chunk-3LKLY5WQ.js → chunk-XLBO2RSL.js} +15 -106
- package/dist/chunk-XLBO2RSL.js.map +1 -0
- package/dist/{chunk-3P7QK2PG.js → chunk-Z23B5TY6.js} +89 -30
- package/dist/chunk-Z23B5TY6.js.map +1 -0
- package/dist/index.cjs +13 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +25 -17
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +55 -2
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +28 -5
- package/dist/react.d.ts +28 -5
- package/dist/react.js +55 -2
- package/dist/react.js.map +1 -1
- package/dist/thesis.cjs +11 -3
- package/dist/thesis.cjs.map +1 -1
- package/dist/thesis.d.cts +42 -11
- package/dist/thesis.d.ts +42 -11
- package/dist/thesis.js +24 -16
- package/dist/{users-BDLkwW1p.d.cts → users-3DAw88_U.d.cts} +4 -4
- package/dist/{users-CDlDRuyv.d.ts → users-B4r33i4O.d.ts} +4 -4
- package/dist/widget.cjs +28 -12
- package/dist/widget.cjs.map +1 -1
- package/dist/widget.d.cts +37 -6
- package/dist/widget.d.ts +37 -6
- package/dist/widget.js +17 -1
- package/dist/widget.js.map +1 -1
- package/package.json +147 -147
- package/dist/chunk-3LKLY5WQ.js.map +0 -1
- package/dist/chunk-3P7QK2PG.js.map +0 -1
- package/dist/chunk-L4RHSWOA.cjs.map +0 -1
- package/dist/chunk-P3MDLWLN.cjs.map +0 -1
- package/dist/chunk-X3OFGGSE.cjs.map +0 -1
- package/dist/chunk-Z3UPDOBY.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,112 +1,146 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this package are documented here. The format follows
|
|
4
|
-
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses
|
|
5
|
-
[Semantic Versioning](https://semver.org/).
|
|
6
|
-
|
|
7
|
-
## [0.5.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
(
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
`
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
- `
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
- `
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
[
|
|
111
|
-
|
|
112
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this package are documented here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses
|
|
5
|
+
[Semantic Versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [0.5.2] - 2026-10-15
|
|
8
|
+
|
|
9
|
+
The public thesis API (`https://id.cabalspy.xyz/thesis/v1/...`) and its live socket
|
|
10
|
+
(`wss://id.cabalspy.xyz/thesis/v1/ws/{chain}/{mint}`) now require your instance's public
|
|
11
|
+
client_id on every call. It is shown in the dashboard next to the API key; it is not a secret
|
|
12
|
+
and not the API key. The Data API (`CabalSpyID`, API key) is unchanged.
|
|
13
|
+
|
|
14
|
+
### Changed (breaking for the thesis client)
|
|
15
|
+
|
|
16
|
+
- `ThesisClient` requires `clientId`: `new ThesisClient({ clientId: 'csid_...', accessToken? })`.
|
|
17
|
+
Without it (or with an empty string) the constructor throws an `AuthenticationError` with
|
|
18
|
+
`code: 'client_id_required'`.
|
|
19
|
+
- Every `ThesisClient` call sends the header `X-CSID-Client-Id: <clientId>`; `live()` adds
|
|
20
|
+
`client_id=<clientId>` to the socket URL (`scope=instance` keeps working with the same client_id).
|
|
21
|
+
`post()` and `reply()` always send `client_id` in the body.
|
|
22
|
+
- The theses widget helpers require `clientId`: `mountTheses()`, `thesisWidgetAttributes()` and
|
|
23
|
+
`<CabalSpyTheses>` throw `client_id_required` without it (the widget passes it as `data-client-id`).
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- New server error codes, mapped to the existing error classes: `client_id_required` and
|
|
28
|
+
`invalid_client` (401, `AuthenticationError`), `origin_not_allowed` (403, `PermissionError`),
|
|
29
|
+
`rate_limited` (429, `RateLimitError`, `retryAfter` from Retry-After, 60 s).
|
|
30
|
+
- `ThesisLive` handles the close codes 4401 (`client_id_required` / `invalid_client`) and 4403
|
|
31
|
+
(`origin_not_allowed`) as final (no reconnect) and backs off 60 s after 4429 (`rate_limited`).
|
|
32
|
+
- Exports `CLIENT_ID_HEADER`, `THESIS_WS_CLOSE_CODES` and `thesisCloseError()`.
|
|
33
|
+
- `setThesisSignInHandler(fn | null)` in `cabalspy-id/widget` (forwards to widget.js'
|
|
34
|
+
`CSID.thesis.setSignInHandler`, waiting for widget.js when needed) and the `onSignIn` prop of
|
|
35
|
+
`<CabalSpyTheses>` (removed on unmount): the widget's "Sign in to write" calls your function
|
|
36
|
+
instead of the page's login button / popup; it gets a thesis-capable token, passes it with
|
|
37
|
+
`setThesisAccessToken(token)` and resolves `true` (`false` = not signed in). While a handler is
|
|
38
|
+
set, the page is the source of truth for sign-in. New type `ThesisSignInHandler`.
|
|
39
|
+
|
|
40
|
+
## [0.5.1] - 2026-10-15
|
|
41
|
+
|
|
42
|
+
### Changed
|
|
43
|
+
|
|
44
|
+
- People can sign in with X, Telegram or Google. Types match accounts without X: `x` is
|
|
45
|
+
`null` in userinfo claims and Data API profiles, `twitter` is `null` in profiles, trading
|
|
46
|
+
profile blocks and leaderboards, `telegram` is documented (`https://t.me/<name>` or `""`),
|
|
47
|
+
handles may be `tg.<name>` or `id.<hex>`.
|
|
48
|
+
|
|
49
|
+
### Added
|
|
50
|
+
|
|
51
|
+
- `hasX()` and `handleKind()` helpers and a README section "Users without X".
|
|
52
|
+
|
|
53
|
+
## [0.5.0] - 2026-10-14
|
|
54
|
+
|
|
55
|
+
### Added
|
|
56
|
+
|
|
57
|
+
- Entry points `cabalspy-id/api` (Data API, trade stream, login, webhooks), `cabalspy-id/thesis`
|
|
58
|
+
(thesis methods, `ThesisClient`, `ThesesStream`) and `cabalspy-id/widget` (browser:
|
|
59
|
+
`mountLoginButton`, `mountTheses`, `setThesisAccessToken`, `startLogin`, `onWidgetEvents`,
|
|
60
|
+
`loginButtonAttributes`, `thesisWidgetAttributes`), plus `cabalspy-id/widget/react`
|
|
61
|
+
(same as `cabalspy-id/react`). The root export is unchanged.
|
|
62
|
+
- Shared chunks in the ESM and CommonJS builds, so classes are identical across entry points.
|
|
63
|
+
- Packages table (socialfi-api, socialfi-thesis, socialfi-widget) in the README.
|
|
64
|
+
|
|
65
|
+
### Changed
|
|
66
|
+
|
|
67
|
+
- The React components use the same attribute mapping as `cabalspy-id/widget`.
|
|
68
|
+
|
|
69
|
+
## [0.4.1] - 2026-10-14
|
|
70
|
+
|
|
71
|
+
### Changed
|
|
72
|
+
|
|
73
|
+
- Package description, keywords and README: CabalSpy ID as a SocialFi API & SDK. No code changes.
|
|
74
|
+
|
|
75
|
+
## [0.4.0] - 2026-10-14
|
|
76
|
+
|
|
77
|
+
### Added
|
|
78
|
+
|
|
79
|
+
- `Thesis.reacted_by` (who reacted recently) and `Thesis.latest_replies` (reply preview on theses).
|
|
80
|
+
- Moderation notifications: Data API `thesisNotifications(csidId)` and
|
|
81
|
+
`appealThesisDecision(csidId, notificationId, message)`; public `ThesisClient.notifications()`,
|
|
82
|
+
`markNotificationsRead()` and `appeal(notificationId, message)`. Types `ThesisNotification`,
|
|
83
|
+
`ThesisNotifications`; `ThesisClient.me()` returns `notices` ({ unread, latest, url }).
|
|
84
|
+
- Webhook types `thesis.reply` (`ThesisReplyData`) and `thesis.reaction` (`ThesisReactionData`).
|
|
85
|
+
- Error code `reporting_paused` (403, `PermissionError`) documented.
|
|
86
|
+
|
|
87
|
+
## [0.3.0] - 2026-10-13
|
|
88
|
+
|
|
89
|
+
### Added
|
|
90
|
+
|
|
91
|
+
- `scope` (`global` | `instance`) on `listTheses`, `iterTheses`, `thesisSummary` and `latestTheses`.
|
|
92
|
+
- `ThesesStream` (`csid.thesesStream()`) for `wss://api-id.cabalspy.xyz/v1/theses/stream` (every plan):
|
|
93
|
+
`subscribe` / `unsubscribe` up to 200 tokens, `subscribeAll` / `unsubscribeAll`, subscriptions
|
|
94
|
+
restored after reconnects, heartbeat watchdog, events and async iteration.
|
|
95
|
+
- `ThesisClient`: `scope` and `clientId` options (reads, `live()`, and post attribution).
|
|
96
|
+
- React `<CabalSpyTheses>`: `clientId` and every design prop (`scope`, `sort`, `font`, `radius`,
|
|
97
|
+
`bg`, `card`, `text`, `muted`, `border`, `accent`, `accentText`, `bull`, `bear`, `showHeader`,
|
|
98
|
+
`showSentiment`, `compact`, `height`).
|
|
99
|
+
|
|
100
|
+
## [0.2.0] - 2026-10-13
|
|
101
|
+
|
|
102
|
+
### Added
|
|
103
|
+
|
|
104
|
+
- Token theses in the Data API: `listTheses` / `iterTheses`, `thesisSummary`, `thesis`,
|
|
105
|
+
`thesisReplies` / `iterThesisReplies`, `latestTheses`, `userTheses`, `thesisEligibility`,
|
|
106
|
+
and writes in a user's name: `postThesis`, `replyToThesis`, `reactToThesis`, `reportThesis`,
|
|
107
|
+
`deleteThesis`. Typed `Thesis`, `ThesisPosition`, `ThesisSummary`, `ThesisEligibility`.
|
|
108
|
+
- `CabalSpyID.postRaw` / `post`. Writes are only retried after the API's own rate limit
|
|
109
|
+
(`rate_limit_exceeded`), never after a server or network error.
|
|
110
|
+
- Stream: `events: ['trades', 'theses']` and `mint`; events `thesis`, `thesis.reply`,
|
|
111
|
+
`thesis.reaction`, `thesis.removed`; `stream.theses()` iterator.
|
|
112
|
+
- `ThesisClient` for the public thesis API (`https://id.cabalspy.xyz/thesis/v1`) with the user's
|
|
113
|
+
access token, and `ThesisClient.live()` for the public per-token websocket.
|
|
114
|
+
- React: `<CabalSpyTheses chain mint theme height radius accessToken />`.
|
|
115
|
+
- Webhook type `thesis.created` (`ThesisCreatedData`), OAuth scope `thesis`.
|
|
116
|
+
|
|
117
|
+
## [0.1.0] - 2026-10-13
|
|
118
|
+
|
|
119
|
+
First release.
|
|
120
|
+
|
|
121
|
+
### Added
|
|
122
|
+
|
|
123
|
+
- `CabalSpyID` Data API client for `https://api-id.cabalspy.xyz/v1`: `health`, `me`, `users`,
|
|
124
|
+
`profile`, `walletLookup`, `tracker`, `history`, `holdings`, `pnlCalendar`, `leaderboard`,
|
|
125
|
+
`latestTransactions`, with typed responses, `*Raw` envelope variants, `instance` support,
|
|
126
|
+
retries with backoff, rate limit info and async iterators (`iterUsers`, `iterHistory`,
|
|
127
|
+
`iterLeaderboard`).
|
|
128
|
+
- `CabalSpyIDStream` for the live trade stream (`/v1/stream`): auto-reconnect, heartbeat
|
|
129
|
+
watchdog, fatal configuration errors, async iteration.
|
|
130
|
+
- `CabalSpyIDAuth` OpenID Connect helpers: discovery, `createAuthorizationUrl` (PKCE S256,
|
|
131
|
+
state, nonce), `handleCallback`, `exchangeCode`, `refresh`, `revoke`, `userinfo`,
|
|
132
|
+
`verifyIdToken` and `verifyAccessToken` (ES256 via JWKS with WebCrypto), `isLimited`.
|
|
133
|
+
- `verifyWebhook` / `signWebhook` for Standard Webhooks signatures.
|
|
134
|
+
- `cabalspy-id/react`: `<CabalSpyLogin />` and `useCabalSpyID()`.
|
|
135
|
+
- Typed errors: `BadRequestError`, `AuthenticationError`, `PermissionError`,
|
|
136
|
+
`PlanUserLimitError`, `NotFoundError`, `RateLimitError`, `ServerError`, `ConnectionError`,
|
|
137
|
+
`InvalidResponseError`, `OAuthError`, `TokenVerificationError`, `WebhookVerificationError`.
|
|
138
|
+
|
|
139
|
+
[0.5.2]: https://github.com/CabalSpy/cabalspy-id-js/compare/v0.5.1...v0.5.2
|
|
140
|
+
[0.5.1]: https://github.com/CabalSpy/cabalspy-id-js/compare/v0.5.0...v0.5.1
|
|
141
|
+
[0.5.0]: https://github.com/CabalSpy/cabalspy-id-js/compare/v0.4.1...v0.5.0
|
|
142
|
+
[0.4.1]: https://github.com/CabalSpy/cabalspy-id-js/compare/v0.4.0...v0.4.1
|
|
143
|
+
[0.4.0]: https://github.com/CabalSpy/cabalspy-id-js/compare/v0.3.0...v0.4.0
|
|
144
|
+
[0.3.0]: https://github.com/CabalSpy/cabalspy-id-js/compare/v0.2.0...v0.3.0
|
|
145
|
+
[0.2.0]: https://github.com/CabalSpy/cabalspy-id-js/compare/v0.1.0...v0.2.0
|
|
146
|
+
[0.1.0]: https://github.com/CabalSpy/cabalspy-id-js/releases/tag/v0.1.0
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 CabalSpy
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 CabalSpy
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|