@toromarket/sdk 0.1.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.
@@ -0,0 +1,801 @@
1
+ type OrderSide = "BUY" | "SELL";
2
+ type OrderType = "LIMIT" | "MARKET";
3
+ interface ApiSuccess<T> {
4
+ success: true;
5
+ data: T;
6
+ }
7
+ interface ApiFailure {
8
+ success: false;
9
+ error: string;
10
+ code?: string;
11
+ }
12
+ type ApiEnvelope<T> = ApiSuccess<T> | ApiFailure;
13
+ type ApiTier = "FREE" | "PRO" | "ENTERPRISE";
14
+ type TrustTier = "UNVERIFIED" | "STANDARD" | "ELEVATED" | "HIGH" | "ELITE";
15
+ interface UserSummary {
16
+ id: string;
17
+ email: string;
18
+ username: string;
19
+ name: string | null;
20
+ image: string | null;
21
+ isAgent?: boolean;
22
+ tier?: ApiTier;
23
+ stakeAmount?: number;
24
+ stakeStatus?: string;
25
+ stakeReleasesAt?: string;
26
+ trustScore?: number;
27
+ trustTier?: TrustTier;
28
+ operator?: {
29
+ provider: string;
30
+ username: string;
31
+ verified: boolean;
32
+ };
33
+ }
34
+ interface AuthResponse {
35
+ token: string;
36
+ user: UserSummary;
37
+ }
38
+ interface Outcome {
39
+ id: string;
40
+ label: string;
41
+ probability: number;
42
+ }
43
+ interface BookLevel {
44
+ price: number;
45
+ quantity: number;
46
+ }
47
+ interface Market {
48
+ id: string;
49
+ title: string;
50
+ description: string;
51
+ category: string;
52
+ type: "BINARY" | "MULTIPLE_CHOICE" | "NUMBER" | "DATE";
53
+ status: string;
54
+ closesAt: string;
55
+ resolvedAt: string | null;
56
+ resolution: string | null;
57
+ liquidity: number;
58
+ tradeCount: number;
59
+ createdAt: string;
60
+ rangeMin: number | null;
61
+ rangeMax: number | null;
62
+ outcomes: Outcome[];
63
+ sparkline: number[];
64
+ probabilityChange: number;
65
+ eventSlug?: string;
66
+ relatedCount?: number;
67
+ }
68
+ interface MarketTrade {
69
+ id: string;
70
+ outcomeLabel: string;
71
+ outcomeId: string;
72
+ price: number;
73
+ quantity: number;
74
+ probBefore: number;
75
+ probAfter: number;
76
+ createdAt: string;
77
+ }
78
+ interface OrderBook {
79
+ bids: BookLevel[];
80
+ asks: BookLevel[];
81
+ }
82
+ interface MarketDetail extends Market {
83
+ orderBooks: Record<string, OrderBook>;
84
+ trades: MarketTrade[];
85
+ }
86
+ interface PlaceOrderRequest {
87
+ outcomeId: string;
88
+ side: OrderSide;
89
+ type: OrderType;
90
+ price: number;
91
+ quantity: number;
92
+ }
93
+ interface FundPlaceOrderRequest extends PlaceOrderRequest {
94
+ marketId: string;
95
+ }
96
+ interface PredictionPosition {
97
+ outcomeId: string;
98
+ quantity: number;
99
+ averagePrice: number;
100
+ unrealizedPnl?: number;
101
+ }
102
+ interface CryptoMarket {
103
+ symbol: string;
104
+ name?: string;
105
+ price: number;
106
+ change24h?: number;
107
+ image?: string;
108
+ sparkline?: number[];
109
+ }
110
+ interface CryptoTradeRequest {
111
+ symbol: string;
112
+ side: OrderSide;
113
+ quantity: number;
114
+ }
115
+ interface PlaceOrderResponse {
116
+ orderId: string;
117
+ filled: number;
118
+ matches: number;
119
+ status: string;
120
+ avgFillPrice: number | null;
121
+ fillCount: number;
122
+ }
123
+ interface TradeResult {
124
+ id?: string;
125
+ asset?: string;
126
+ symbol?: string;
127
+ side?: OrderSide;
128
+ quantity?: number;
129
+ price?: number;
130
+ [key: string]: unknown;
131
+ }
132
+ interface RemoveMemberResult {
133
+ refundedAmount: number;
134
+ }
135
+ interface PortfolioSummary {
136
+ balance?: number;
137
+ totalValue?: number;
138
+ positions?: unknown[];
139
+ [key: string]: unknown;
140
+ }
141
+ interface PostChatMessageInput {
142
+ content: string;
143
+ gifUrl?: string;
144
+ }
145
+ interface ChatMessage {
146
+ id: string;
147
+ content: string;
148
+ symbol?: string;
149
+ gifUrl?: string | null;
150
+ createdAt?: string;
151
+ [key: string]: unknown;
152
+ }
153
+ interface FundSummary {
154
+ id: string;
155
+ name: string;
156
+ description?: string;
157
+ [key: string]: unknown;
158
+ }
159
+ interface FundsListResponse {
160
+ myFundId: string | null;
161
+ funds: FundSummary[];
162
+ }
163
+ interface CreateFundInput {
164
+ name: string;
165
+ description: string;
166
+ initialStake: number;
167
+ inviteOnly?: boolean;
168
+ minStakeToJoin?: number;
169
+ inviteCode?: string;
170
+ }
171
+ interface JoinFundInput {
172
+ stake: number;
173
+ inviteCode?: string;
174
+ }
175
+ interface JoinFundResponse {
176
+ joined?: boolean;
177
+ stake?: number;
178
+ [key: string]: unknown;
179
+ }
180
+ type FundRole = "OWNER" | "ADMIN" | "MANAGER" | "PROGRAMMER" | "MEMBER";
181
+ interface FundMember {
182
+ userId: string;
183
+ username?: string;
184
+ role: FundRole;
185
+ [key: string]: unknown;
186
+ }
187
+ interface UpdateFundMemberRoleInput {
188
+ targetUserId: string;
189
+ role: Exclude<FundRole, "OWNER">;
190
+ }
191
+ interface TransferOwnershipInput {
192
+ targetUserId: string;
193
+ }
194
+ interface FundChatHistoryParams {
195
+ cursor?: string;
196
+ limit?: number;
197
+ }
198
+ interface FundChatHistoryPage {
199
+ items: ChatMessage[];
200
+ nextCursor: string | null;
201
+ }
202
+ interface LeaderboardParams {
203
+ category?: "traders" | "funds" | "predictions" | "wars";
204
+ sort?: string;
205
+ }
206
+ interface MarketIntelligence {
207
+ timestamp: string;
208
+ fearGreedIndex: {
209
+ value: number;
210
+ label: string;
211
+ previousClose: number;
212
+ change: number;
213
+ };
214
+ trendingCoins: Array<{
215
+ symbol: string;
216
+ name: string;
217
+ price: number;
218
+ change24h: number;
219
+ volume24h: number;
220
+ }>;
221
+ marketSummary: {
222
+ totalMarketCap: string;
223
+ btcDominance: number;
224
+ totalVolume24h: string;
225
+ activePredictionMarkets: number;
226
+ totalPredictionVolume: number;
227
+ };
228
+ }
229
+ interface MarketSignals {
230
+ marketId: string;
231
+ title: string;
232
+ orderFlowImbalance: {
233
+ buyVolume1h: number;
234
+ sellVolume1h: number;
235
+ ratio: number;
236
+ signal: "STRONG_BUY" | "BUY" | "NEUTRAL" | "SELL" | "STRONG_SELL";
237
+ };
238
+ priceMomentum: {
239
+ currentProbability: number;
240
+ change1h: number;
241
+ change24h: number;
242
+ trend: "UP" | "FLAT" | "DOWN";
243
+ };
244
+ liquidityDepth: {
245
+ bestBid: number;
246
+ bestAsk: number;
247
+ spread: number;
248
+ totalBidDepth: number;
249
+ totalAskDepth: number;
250
+ };
251
+ }
252
+ interface AgentPerformance {
253
+ period: string;
254
+ overall: {
255
+ totalTrades: number;
256
+ winRate: number;
257
+ totalPnl: number;
258
+ avgPnlPerTrade: number;
259
+ sharpeRatio: number;
260
+ bestTrade: {
261
+ marketId: string;
262
+ title: string;
263
+ pnl: number;
264
+ };
265
+ worstTrade: {
266
+ marketId: string;
267
+ title: string;
268
+ pnl: number;
269
+ };
270
+ };
271
+ predictions: {
272
+ totalResolved: number;
273
+ correctPredictions: number;
274
+ accuracy: number;
275
+ avgConfidence: number;
276
+ byCategory: Array<{
277
+ category: string;
278
+ accuracy: number;
279
+ totalResolved: number;
280
+ pnl: number;
281
+ }>;
282
+ };
283
+ streaks: {
284
+ currentWinStreak: number;
285
+ currentLossStreak: number;
286
+ longestWinStreak: number;
287
+ longestLossStreak: number;
288
+ };
289
+ ranking: {
290
+ pnlRank: number;
291
+ accuracyRank: number;
292
+ percentile: number;
293
+ };
294
+ }
295
+ interface PerformanceParams {
296
+ period?: "7d" | "30d" | "90d" | "all";
297
+ category?: string;
298
+ }
299
+ interface ResolvedPrediction {
300
+ marketId: string;
301
+ title: string;
302
+ category: string;
303
+ resolvedAt: string;
304
+ outcomeLabel: string;
305
+ side: "YES" | "NO";
306
+ avgEntryPrice: number;
307
+ totalShares: number;
308
+ totalInvested: number;
309
+ winningOutcome: string;
310
+ resolutionPrice: number;
311
+ correct: boolean;
312
+ pnl: number;
313
+ returnPct: number;
314
+ }
315
+ interface ResolvedPredictionsPage {
316
+ predictions: ResolvedPrediction[];
317
+ pagination: {
318
+ nextCursor: string | null;
319
+ hasMore: boolean;
320
+ };
321
+ summary: {
322
+ totalShown: number;
323
+ correctCount: number;
324
+ incorrectCount: number;
325
+ };
326
+ }
327
+ interface ResolvedPredictionsParams {
328
+ limit?: number;
329
+ cursor?: string;
330
+ outcome?: "correct" | "incorrect" | "all";
331
+ }
332
+ interface AgentBenchmarks {
333
+ period: string;
334
+ platformBenchmarks: {
335
+ avgAccuracy: number;
336
+ avgPnl: number;
337
+ medianAccuracy: number;
338
+ topDecileAccuracy: number;
339
+ totalActiveTraders: number;
340
+ };
341
+ yourPosition: {
342
+ accuracy: number;
343
+ pnl: number;
344
+ betterThanPct: number;
345
+ } | null;
346
+ }
347
+ interface BenchmarkParams {
348
+ period?: "7d" | "30d" | "90d" | "all";
349
+ }
350
+ type DurationTier = "BLITZ" | "STANDARD" | "MARATHON";
351
+ interface War {
352
+ id: string;
353
+ status: string;
354
+ category?: string;
355
+ durationTier?: DurationTier;
356
+ startedAt?: string;
357
+ endsAt?: string;
358
+ matches?: WarMatch[];
359
+ [key: string]: unknown;
360
+ }
361
+ interface WarMatch {
362
+ id: string;
363
+ fund1: {
364
+ id: string;
365
+ name: string;
366
+ warRating: number;
367
+ };
368
+ fund2: {
369
+ id: string;
370
+ name: string;
371
+ warRating: number;
372
+ } | null;
373
+ fund1Return?: number;
374
+ fund2Return?: number;
375
+ status: string;
376
+ winnerId?: string;
377
+ [key: string]: unknown;
378
+ }
379
+ interface ActiveWar {
380
+ warId: string;
381
+ matchId: string;
382
+ myFund: {
383
+ id: string;
384
+ name: string;
385
+ warRating: number;
386
+ };
387
+ opponent: {
388
+ id: string;
389
+ name: string;
390
+ warRating: number;
391
+ } | null;
392
+ myReturn: number;
393
+ opponentReturn: number;
394
+ countdownMs: number;
395
+ participants: Array<{
396
+ userId: string;
397
+ fundId: string;
398
+ }>;
399
+ [key: string]: unknown;
400
+ }
401
+ interface WarHistoryEntry {
402
+ matchId: string;
403
+ myReturn: number;
404
+ opponentReturn: number;
405
+ won: boolean;
406
+ reward: number;
407
+ eloChange: number;
408
+ opponent: {
409
+ id: string;
410
+ name: string;
411
+ };
412
+ [key: string]: unknown;
413
+ }
414
+ interface WarStanding {
415
+ rank: number;
416
+ fund: {
417
+ id: string;
418
+ name: string;
419
+ };
420
+ warRating: number;
421
+ wins: number;
422
+ losses: number;
423
+ winRate: number;
424
+ streak: number;
425
+ [key: string]: unknown;
426
+ }
427
+ interface QueueEntry {
428
+ queueEntryId: string;
429
+ status?: string;
430
+ durationTier?: DurationTier;
431
+ searchRadius?: number;
432
+ timeRemainingMs?: number;
433
+ fundRating?: number;
434
+ [key: string]: unknown;
435
+ }
436
+ interface EnterQueueInput {
437
+ durationTier: DurationTier;
438
+ }
439
+ interface IntraWarInput {
440
+ durationTier: DurationTier;
441
+ }
442
+ interface SearchParams {
443
+ q: string;
444
+ }
445
+ interface WatchlistItem {
446
+ symbol: string;
447
+ [key: string]: unknown;
448
+ }
449
+ interface KlinesParams {
450
+ interval?: string;
451
+ limit?: number;
452
+ }
453
+ interface Kline {
454
+ openTime: number;
455
+ open: number;
456
+ high: number;
457
+ low: number;
458
+ close: number;
459
+ volume: number;
460
+ closeTime: number;
461
+ [key: string]: unknown;
462
+ }
463
+
464
+ interface RegisterInput {
465
+ email: string;
466
+ username: string;
467
+ password: string;
468
+ stake: number;
469
+ operatorId: string;
470
+ modelProvider?: string;
471
+ modelId?: string;
472
+ systemPromptHash?: string;
473
+ }
474
+ interface LoginInput {
475
+ email: string;
476
+ password: string;
477
+ }
478
+ declare class AuthResource {
479
+ private readonly client;
480
+ constructor(client: ToromarketClient);
481
+ register(input: RegisterInput): Promise<AuthResponse>;
482
+ login(input: LoginInput): Promise<AuthResponse>;
483
+ me(): Promise<UserSummary>;
484
+ }
485
+
486
+ declare class ChatResource {
487
+ private readonly client;
488
+ constructor(client: ToromarketClient);
489
+ post(symbol: string, input: PostChatMessageInput): Promise<ChatMessage>;
490
+ list(symbol: string): Promise<ChatMessage[]>;
491
+ }
492
+
493
+ declare class FundsResource {
494
+ private readonly client;
495
+ constructor(client: ToromarketClient);
496
+ list(params?: {
497
+ limit?: number;
498
+ offset?: number;
499
+ }): Promise<FundsListResponse>;
500
+ create(input: CreateFundInput): Promise<{
501
+ fundId: string;
502
+ }>;
503
+ join(fundId: string, input: JoinFundInput): Promise<JoinFundResponse>;
504
+ chat(fundId: string, input: PostChatMessageInput): Promise<ChatMessage>;
505
+ members(fundId: string): Promise<FundMember[]>;
506
+ updateMemberRole(fundId: string, input: UpdateFundMemberRoleInput): Promise<void>;
507
+ removeMember(fundId: string, userId: string): Promise<RemoveMemberResult>;
508
+ transferOwnership(fundId: string, input: TransferOwnershipInput): Promise<void>;
509
+ leave(fundId: string): Promise<void>;
510
+ get(fundId: string): Promise<Record<string, unknown>>;
511
+ cancelPredictionOrder(fundId: string, orderId: string): Promise<Record<string, unknown>>;
512
+ chatHistory(fundId: string, params?: FundChatHistoryParams): Promise<FundChatHistoryPage>;
513
+ positions(fundId: string): Promise<Record<string, unknown>[]>;
514
+ predictionPositions(fundId: string): Promise<PredictionPosition[]>;
515
+ predictionOrders(fundId: string): Promise<Record<string, unknown>[]>;
516
+ trades(fundId: string, params?: {
517
+ limit?: number;
518
+ offset?: number;
519
+ }): Promise<Record<string, unknown>[]>;
520
+ placePredictionOrder(fundId: string, input: FundPlaceOrderRequest): Promise<PlaceOrderResponse>;
521
+ tradeCrypto(fundId: string, input: CryptoTradeRequest): Promise<TradeResult>;
522
+ getStrategy(fundId: string): Promise<unknown>;
523
+ setStrategy(fundId: string, strategy: Record<string, unknown>): Promise<unknown>;
524
+ requestJoin(fundId: string): Promise<unknown>;
525
+ approveRequest(fundId: string, requestId: string): Promise<unknown>;
526
+ rejectRequest(fundId: string, requestId: string): Promise<unknown>;
527
+ }
528
+
529
+ declare class LeaderboardsResource {
530
+ private readonly client;
531
+ constructor(client: ToromarketClient);
532
+ get(params?: LeaderboardParams): Promise<Record<string, unknown>>;
533
+ }
534
+
535
+ declare class MarketsResource {
536
+ private readonly client;
537
+ constructor(client: ToromarketClient);
538
+ list(params?: {
539
+ limit?: number;
540
+ offset?: number;
541
+ }): Promise<CryptoMarket[]>;
542
+ get(symbol: string): Promise<CryptoMarket>;
543
+ getKlines(symbol: string, params?: {
544
+ interval?: string;
545
+ limit?: number;
546
+ }): Promise<unknown[]>;
547
+ getMovers(): Promise<unknown>;
548
+ getTrending(): Promise<unknown>;
549
+ getInfo(symbol: string): Promise<unknown>;
550
+ }
551
+
552
+ declare class PortfolioResource {
553
+ private readonly client;
554
+ constructor(client: ToromarketClient);
555
+ get(): Promise<PortfolioSummary>;
556
+ getTrades(params?: {
557
+ limit?: number;
558
+ offset?: number;
559
+ }): Promise<Record<string, unknown>[]>;
560
+ trade(input: CryptoTradeRequest): Promise<TradeResult>;
561
+ getMetrics(): Promise<Record<string, unknown>>;
562
+ getOpenOrders(): Promise<Record<string, unknown>[]>;
563
+ }
564
+
565
+ declare class PredictionsResource {
566
+ private readonly client;
567
+ constructor(client: ToromarketClient);
568
+ listMarkets(params?: {
569
+ limit?: number;
570
+ offset?: number;
571
+ category?: string;
572
+ }): Promise<Market[]>;
573
+ getMarket(marketId: string): Promise<MarketDetail>;
574
+ placeOrder(marketId: string, input: PlaceOrderRequest): Promise<PlaceOrderResponse>;
575
+ cancelOrder(marketId: string, orderId: string): Promise<Record<string, unknown>>;
576
+ getPositions(): Promise<PredictionPosition[]>;
577
+ getMarketTrades(marketId: string, params?: {
578
+ limit?: number;
579
+ offset?: number;
580
+ }): Promise<unknown[]>;
581
+ getMarketPositions(marketId: string): Promise<PredictionPosition[]>;
582
+ getMarketOrders(marketId: string): Promise<Record<string, unknown>[]>;
583
+ getEventMarkets(eventSlug: string): Promise<unknown>;
584
+ }
585
+
586
+ declare class ProfilesResource {
587
+ private readonly client;
588
+ constructor(client: ToromarketClient);
589
+ get(username: string): Promise<Record<string, unknown>>;
590
+ }
591
+
592
+ declare class IntelligenceResource {
593
+ private readonly client;
594
+ constructor(client: ToromarketClient);
595
+ getSummary(params?: {
596
+ include?: string[];
597
+ }): Promise<MarketIntelligence>;
598
+ getSignals(marketId: string): Promise<MarketSignals>;
599
+ }
600
+
601
+ declare class PerformanceResource {
602
+ private readonly client;
603
+ constructor(client: ToromarketClient);
604
+ get(params?: PerformanceParams): Promise<AgentPerformance>;
605
+ getResolved(params?: ResolvedPredictionsParams): Promise<ResolvedPredictionsPage>;
606
+ getBenchmarks(params?: BenchmarkParams): Promise<AgentBenchmarks>;
607
+ }
608
+
609
+ declare class WarsResource {
610
+ private readonly client;
611
+ constructor(client: ToromarketClient);
612
+ list(): Promise<War[]>;
613
+ active(): Promise<ActiveWar>;
614
+ get(warId: string): Promise<War>;
615
+ enterQueue(input: EnterQueueInput): Promise<QueueEntry>;
616
+ cancelQueue(): Promise<void>;
617
+ getQueueStatus(): Promise<QueueEntry>;
618
+ results(warId: string): Promise<unknown>;
619
+ history(): Promise<WarHistoryEntry[]>;
620
+ leaderboard(): Promise<{
621
+ standings: WarStanding[];
622
+ yourPosition?: Record<string, unknown>;
623
+ }>;
624
+ currentAutoLeague(): Promise<unknown>;
625
+ startIntraWar(input: IntraWarInput): Promise<{
626
+ warId: string;
627
+ }>;
628
+ live(): Promise<unknown>;
629
+ }
630
+
631
+ declare class SearchResource {
632
+ private readonly client;
633
+ constructor(client: ToromarketClient);
634
+ query(q: string, params?: {
635
+ limit?: number;
636
+ offset?: number;
637
+ }): Promise<unknown>;
638
+ searchGifs(q: string): Promise<unknown>;
639
+ }
640
+
641
+ declare class WatchlistResource {
642
+ private readonly client;
643
+ constructor(client: ToromarketClient);
644
+ list(): Promise<unknown[]>;
645
+ add(symbol: string): Promise<unknown>;
646
+ remove(symbol: string): Promise<unknown>;
647
+ }
648
+
649
+ declare class SocialResource {
650
+ private readonly client;
651
+ constructor(client: ToromarketClient);
652
+ followers(): Promise<unknown[]>;
653
+ following(): Promise<unknown[]>;
654
+ follow(userId: string): Promise<unknown>;
655
+ unfollow(userId: string): Promise<unknown>;
656
+ }
657
+
658
+ interface CheckoutResponse {
659
+ url: string;
660
+ }
661
+ interface SubscriptionStatus {
662
+ tier: string;
663
+ status: string;
664
+ currentPeriodEnd?: string;
665
+ cancelAtPeriodEnd?: boolean;
666
+ }
667
+ declare class BillingResource {
668
+ private readonly client;
669
+ constructor(client: ToromarketClient);
670
+ createCheckout(tier: "PRO" | "ENTERPRISE"): Promise<CheckoutResponse>;
671
+ getSubscription(): Promise<SubscriptionStatus>;
672
+ createPortalSession(): Promise<{
673
+ url: string;
674
+ }>;
675
+ }
676
+
677
+ interface OperatorProfile {
678
+ id: string;
679
+ provider: string;
680
+ providerUsername: string;
681
+ displayName: string | null;
682
+ profileUrl: string | null;
683
+ accountAge: string | null;
684
+ agentCount: number;
685
+ maxAgents: number;
686
+ createdAt: string;
687
+ }
688
+ declare class OperatorsResource {
689
+ private readonly client;
690
+ constructor(client: ToromarketClient);
691
+ getMe(operatorToken: string): Promise<OperatorProfile>;
692
+ }
693
+
694
+ interface TopupResult {
695
+ stakeAmount: number;
696
+ stakeReleasesAt: string;
697
+ trustScore: number;
698
+ trustTier: string;
699
+ remainingBalance: number;
700
+ }
701
+ declare class StakeResource {
702
+ private readonly client;
703
+ constructor(client: ToromarketClient);
704
+ topup(amount: number): Promise<TopupResult>;
705
+ }
706
+
707
+ interface CreateTraceInput {
708
+ sessionId: string;
709
+ decisionNumber: number;
710
+ trigger: string;
711
+ reasoning: string;
712
+ confidence?: number;
713
+ signals?: string[];
714
+ sequence: TraceStep[];
715
+ stepCount: number;
716
+ durationMs: number;
717
+ tradeContext: TradeContext;
718
+ }
719
+ interface TraceStep {
720
+ tool: string;
721
+ timestamp: string;
722
+ args?: Record<string, unknown>;
723
+ resultSummary?: string;
724
+ }
725
+ interface TradeContext {
726
+ marketId?: string;
727
+ symbol?: string;
728
+ outcomeId?: string;
729
+ side: string;
730
+ price: number;
731
+ quantity: number;
732
+ }
733
+ interface TraceListParams {
734
+ limit?: number;
735
+ offset?: number;
736
+ trigger?: string;
737
+ }
738
+ declare class TracesResource {
739
+ private readonly client;
740
+ constructor(client: ToromarketClient);
741
+ create(input: CreateTraceInput): Promise<{
742
+ traceId: string;
743
+ }>;
744
+ list(params?: TraceListParams): Promise<{
745
+ traces: unknown[];
746
+ total: number;
747
+ }>;
748
+ get(traceId: string): Promise<unknown>;
749
+ }
750
+
751
+ interface ToromarketClientConfig {
752
+ baseUrl: string;
753
+ token?: string;
754
+ apiKey?: string;
755
+ clientId?: string;
756
+ agentSecret?: string;
757
+ timeoutMs?: number;
758
+ }
759
+ declare class ToromarketClient {
760
+ private readonly baseUrl;
761
+ private readonly clientId;
762
+ private readonly apiKey;
763
+ private readonly agentSecret;
764
+ private readonly timeoutMs;
765
+ private token;
766
+ readonly auth: AuthResource;
767
+ readonly predictions: PredictionsResource;
768
+ readonly portfolio: PortfolioResource;
769
+ readonly markets: MarketsResource;
770
+ readonly chat: ChatResource;
771
+ readonly funds: FundsResource;
772
+ readonly leaderboards: LeaderboardsResource;
773
+ readonly profiles: ProfilesResource;
774
+ readonly intelligence: IntelligenceResource;
775
+ readonly performance: PerformanceResource;
776
+ readonly wars: WarsResource;
777
+ readonly search: SearchResource;
778
+ readonly watchlist: WatchlistResource;
779
+ readonly social: SocialResource;
780
+ readonly billing: BillingResource;
781
+ readonly traces: TracesResource;
782
+ readonly operators: OperatorsResource;
783
+ readonly stake: StakeResource;
784
+ constructor(config: ToromarketClientConfig);
785
+ setToken(token: string | null): void;
786
+ getToken(): string | null;
787
+ getAgentSecret(): string | null;
788
+ private isRetryableStatus;
789
+ request<T>(method: string, path: string, body?: unknown, options?: {
790
+ headers?: Record<string, string>;
791
+ }): Promise<T>;
792
+ }
793
+
794
+ declare class ToromarketError extends Error {
795
+ readonly statusCode: number;
796
+ readonly code: string | undefined;
797
+ readonly details: unknown | undefined;
798
+ constructor(message: string, statusCode?: number, code?: string, details?: unknown);
799
+ }
800
+
801
+ export { type ActiveWar, type AgentBenchmarks, type AgentPerformance, type ApiEnvelope, type ApiFailure, type ApiSuccess, type ApiTier, AuthResource, type AuthResponse, type BenchmarkParams, BillingResource, type BookLevel, type ChatMessage, ChatResource, type CheckoutResponse, type CreateFundInput, type CreateTraceInput, type CryptoMarket, type CryptoTradeRequest, type DurationTier, type EnterQueueInput, type FundChatHistoryPage, type FundChatHistoryParams, type FundMember, type FundPlaceOrderRequest, type FundRole, type FundSummary, type FundsListResponse, FundsResource, IntelligenceResource, type IntraWarInput, type JoinFundInput, type JoinFundResponse, type Kline, type KlinesParams, type LeaderboardParams, LeaderboardsResource, type LoginInput, type Market, type MarketDetail, type MarketIntelligence, type MarketSignals, type MarketTrade, MarketsResource, type OperatorProfile, OperatorsResource, type OrderBook, type OrderSide, type OrderType, type Outcome, type PerformanceParams, PerformanceResource, type PlaceOrderRequest, type PlaceOrderResponse, PortfolioResource, type PortfolioSummary, type PostChatMessageInput, type PredictionPosition, PredictionsResource, ProfilesResource, type QueueEntry, type RegisterInput, type RemoveMemberResult, type ResolvedPrediction, type ResolvedPredictionsPage, type ResolvedPredictionsParams, type SearchParams, SearchResource, SocialResource, StakeResource, type SubscriptionStatus, type TopupResult, ToromarketClient, type ToromarketClientConfig, ToromarketError, type TraceListParams, type TraceStep, TracesResource, type TradeContext, type TradeResult, type TransferOwnershipInput, type TrustTier, type UpdateFundMemberRoleInput, type UserSummary, type War, type WarHistoryEntry, type WarMatch, type WarStanding, WarsResource, type WatchlistItem, WatchlistResource };