@sigrex/client 2.1.7 → 4.0.0

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/README.md CHANGED
@@ -103,7 +103,7 @@ async function getLLMSessions() {
103
103
 
104
104
  ## API Reference
105
105
 
106
- The client exposes nested namespaces to make finding endpoints easy and intuitive:
106
+ The client exposes nested namespaces to make finding endpoints easy and intuitive. Methods that return a list (or a paginated `{ total, data }` result) start with `list`, and methods that return a single item start with `get`:
107
107
 
108
108
  ### 1. Exchanges
109
109
 
@@ -111,7 +111,7 @@ Exposes CEX, DEX, and Prediction exchanges.
111
111
 
112
112
  - `client.exchanges.list(queryParams?)`
113
113
  - `client.exchanges.listCex()`
114
- - `client.exchanges.getDex(chain)`
114
+ - `client.exchanges.listDex(chain)`
115
115
  - `client.exchanges.listPrediction()`
116
116
  - `client.exchanges.listWithExchangeRate()`
117
117
 
@@ -161,6 +161,50 @@ Exposes key endpoints for managing third-party LLM and CEX keys securely.
161
161
  - **LLM Keys**: `client.apiKeys.llm.list()`, `client.apiKeys.llm.create()`, etc.
162
162
  - **Prediction Keys**: `client.apiKeys.prediction.list()`, `client.apiKeys.prediction.create()`, etc.
163
163
 
164
+ ### 6. Account
165
+
166
+ Exposes the authenticated user's account and friendships.
167
+
168
+ - `client.account.getMe()` (Account with package and subscription details)
169
+ - `client.account.listAllFriend(status)` (All friendships, sent and received)
170
+ - `client.account.listFriend(status, side, { page, limit })` (Paginated)
171
+ - `client.account.listFriendRejected({ page, limit })` (Paginated, received requests that were rejected)
172
+
173
+ `status` is one of `'pending' | 'accepted' | 'rejected'`; `side` is one of `'sent' | 'received' | 'both'`.
174
+
175
+ ### 7. Logs
176
+
177
+ Exposes signal, transaction, data, and error logs. Every method except `get(id)` is paginated: `page` (starting at 1) and `limit` are required (`limit` is capped at 100), and the response is `{ total, data }`.
178
+
179
+ - **Signal Logs**:
180
+ - `client.logs.signal.list({ page, limit })`
181
+ - `client.logs.signal.listHook(hookId, { page, limit })` (Bot hook)
182
+ - `client.logs.signal.listBySource(source, { page, limit })`
183
+ - `client.logs.signal.listBySourceAndId(source, id, { page, limit })`
184
+ - `source`: `'webhook' | 'email' | 'telegram' | 'llm-session' | 'code-strategy' | 'llm-reaction' | 'code-reaction'`
185
+ - **Transaction Logs**:
186
+ - `client.logs.transaction.list({ page, limit })`
187
+ - `client.logs.transaction.listSignalBot(type, service, id, { page, limit })` (Signal bot)
188
+ - `client.logs.transaction.get(id)`
189
+ - `type`: `'cex' | 'dex'`; `service`: `'spot' | 'futures' | 'stock' | 'prediction'`
190
+ - **Data Logs**:
191
+ - `client.logs.data.list({ page, limit })`
192
+ - `client.logs.data.listHook(hookId, { page, limit })` (Data hook)
193
+ - **Error Logs**:
194
+ - `client.logs.error.list({ page, limit })`
195
+ - `client.logs.error.listBySourceAndId(source, id, { page, limit })`
196
+ - `client.logs.error.get(id)`
197
+ - `source`: `'llm-session' | 'code-strategy' | 'llm-reaction' | 'code-reaction' | 'data-hook' | 'bot-hook' | 'invoice'`
198
+
199
+ ```typescript
200
+ // Example: Page through the signal logs of an LLM session
201
+ const { total, data } = await client.logs.signal.listBySourceAndId('llm-session', 'SESSION_ID', {
202
+ page: 1,
203
+ limit: 50,
204
+ });
205
+ console.log(`Showing ${data?.length} of ${total} signal logs`);
206
+ ```
207
+
164
208
  ---
165
209
 
166
210
  ## Error Handling