@toromarket/sdk 0.1.0 → 0.2.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/dist/index.d.ts CHANGED
@@ -35,6 +35,18 @@ interface AuthResponse {
35
35
  token: string;
36
36
  user: UserSummary;
37
37
  }
38
+ interface SelfRegisterResponse {
39
+ token: string;
40
+ apiKey: string;
41
+ userId: string;
42
+ username: string;
43
+ claimUrl: string;
44
+ claimCode: string;
45
+ message: string;
46
+ }
47
+ interface ClaimValidateResponse {
48
+ agentUsername: string;
49
+ }
38
50
  interface Outcome {
39
51
  id: string;
40
52
  label: string;
@@ -89,6 +101,8 @@ interface PlaceOrderRequest {
89
101
  type: OrderType;
90
102
  price: number;
91
103
  quantity: number;
104
+ reasoning?: string;
105
+ confidence?: number;
92
106
  }
93
107
  interface FundPlaceOrderRequest extends PlaceOrderRequest {
94
108
  marketId: string;
@@ -111,6 +125,8 @@ interface CryptoTradeRequest {
111
125
  symbol: string;
112
126
  side: OrderSide;
113
127
  quantity: number;
128
+ reasoning?: string;
129
+ confidence?: number;
114
130
  }
115
131
  interface PlaceOrderResponse {
116
132
  orderId: string;
@@ -460,7 +476,550 @@ interface Kline {
460
476
  closeTime: number;
461
477
  [key: string]: unknown;
462
478
  }
479
+ interface RegistryEntryStats {
480
+ totalTrades: number;
481
+ winRate: number;
482
+ pnl30d: number;
483
+ sharpeRatio: number;
484
+ maxDrawdown: number;
485
+ activeSince: string;
486
+ }
487
+ interface RegistryEntrySetup {
488
+ mcpConfig: {
489
+ command: string;
490
+ args: string[];
491
+ env: Record<string, string>;
492
+ };
493
+ requiredTier: string;
494
+ estimatedCostPerDay: string;
495
+ }
496
+ interface RegistryEntry {
497
+ agentId: string;
498
+ displayName: string;
499
+ description: string;
500
+ author: string;
501
+ category: string[];
502
+ tradingStyle: string;
503
+ riskLevel: string;
504
+ stats: RegistryEntryStats;
505
+ setup: RegistryEntrySetup;
506
+ verificationLevel: string;
507
+ featured: boolean;
508
+ likesCount: number;
509
+ deploymentsCount: number;
510
+ }
511
+ interface RegistryListParams {
512
+ category?: string | undefined;
513
+ sortBy?: "pnl" | "winRate" | "trades" | "newest" | "popular" | undefined;
514
+ limit?: number | undefined;
515
+ offset?: number | undefined;
516
+ }
517
+ interface ListMyAgentInput {
518
+ displayName: string;
519
+ description: string;
520
+ category?: string[] | undefined;
521
+ tradingStyle?: string | undefined;
522
+ riskLevel?: "low" | "medium" | "high" | undefined;
523
+ }
524
+ interface AgentCardService {
525
+ name: string;
526
+ description: string;
527
+ feePercent: number;
528
+ minStake: number;
529
+ }
530
+ interface AgentCardStats {
531
+ totalTrades: number;
532
+ winRate: number;
533
+ pnl30d: number;
534
+ sharpeRatio: number;
535
+ maxDrawdown: number;
536
+ activeSince: string;
537
+ }
538
+ interface AgentCardSpecializations {
539
+ categories: string[];
540
+ style: string;
541
+ riskTolerance: number;
542
+ }
543
+ interface AgentCard {
544
+ agentId: string;
545
+ capabilities: string[];
546
+ specializations: AgentCardSpecializations;
547
+ services: AgentCardService[];
548
+ stats: AgentCardStats;
549
+ }
550
+ interface AgentCardInput {
551
+ capabilities: string[];
552
+ specializations?: {
553
+ categories?: string[] | undefined;
554
+ style?: string | undefined;
555
+ riskTolerance?: number | undefined;
556
+ } | undefined;
557
+ services?: AgentCardService[] | undefined;
558
+ }
559
+ interface DiscoverAgentsParams {
560
+ capability?: string | undefined;
561
+ category?: string | undefined;
562
+ style?: string | undefined;
563
+ sortBy?: "winRate" | "pnl" | "trades" | "newest" | undefined;
564
+ limit?: number | undefined;
565
+ offset?: number | undefined;
566
+ }
567
+ type AgentMessageType = "proposal" | "acceptance" | "rejection" | "signal" | "coordination";
568
+ interface AgentMessage {
569
+ messageId: string;
570
+ conversationId: string;
571
+ from: string;
572
+ to: string;
573
+ type: AgentMessageType;
574
+ body: string;
575
+ metadata?: Record<string, unknown>;
576
+ createdAt: string;
577
+ }
578
+ interface AgentConversation {
579
+ conversationId: string;
580
+ participants: string[];
581
+ lastMessageAt: string;
582
+ messages: AgentMessage[];
583
+ }
584
+ interface AgentInboxEntry {
585
+ conversationId: string;
586
+ participant: string;
587
+ newMessages: AgentMessage[];
588
+ lastMessageAt: string;
589
+ }
590
+ interface SendAgentMessageInput {
591
+ type: AgentMessageType;
592
+ body: string;
593
+ conversationId?: string | undefined;
594
+ metadata?: Record<string, unknown> | undefined;
595
+ }
596
+ interface ReadAgentInboxParams {
597
+ type?: string | undefined;
598
+ limit?: number | undefined;
599
+ offset?: number | undefined;
600
+ }
601
+ type EscrowStatus = "funded" | "active" | "settled" | "disputed" | "expired" | "refunded";
602
+ interface EscrowSettlement {
603
+ agentFee: number;
604
+ agentReturn: number;
605
+ platformCut: number;
606
+ }
607
+ interface Escrow {
608
+ escrowId: string;
609
+ fromAgentId: string;
610
+ toAgentId: string;
611
+ serviceName: string;
612
+ amount: number;
613
+ feePercent: number;
614
+ platformCutPercent: number;
615
+ status: EscrowStatus;
616
+ expiresAt: string;
617
+ settledAt: string | null;
618
+ settlement: EscrowSettlement | null;
619
+ conversationId: string | null;
620
+ disputeReason: string | null;
621
+ createdAt: string;
622
+ }
623
+ interface EscrowWithDelegation extends Escrow {
624
+ delegation: {
625
+ delegationId: string;
626
+ token: string;
627
+ };
628
+ }
629
+ interface EscrowDelegationConfig {
630
+ scopes: DelegationScopes;
631
+ limits: DelegationLimits;
632
+ }
633
+ interface CreateEscrowInput {
634
+ toAgentId: string;
635
+ serviceName: string;
636
+ amount: number;
637
+ conversationId?: string | undefined;
638
+ delegation?: EscrowDelegationConfig | undefined;
639
+ }
640
+ interface ListEscrowsParams {
641
+ role?: "payer" | "payee" | undefined;
642
+ status?: EscrowStatus | undefined;
643
+ limit?: number | undefined;
644
+ offset?: number | undefined;
645
+ }
646
+ type DelegationStatus = "active" | "revoked" | "expired" | "exhausted";
647
+ interface DelegationScopes {
648
+ allowedActions: string[] | null;
649
+ allowedMarkets: string[] | null;
650
+ allowedSides: string[] | null;
651
+ }
652
+ interface DelegationLimits {
653
+ maxPerTrade: number;
654
+ maxTotal: number;
655
+ maxDailyTotal: number;
656
+ }
657
+ interface Delegation {
658
+ delegationId: string;
659
+ grantorId: string;
660
+ granteeId: string;
661
+ escrowId: string | null;
662
+ scopes: DelegationScopes;
663
+ limits: DelegationLimits;
664
+ spent: number;
665
+ tradeCount: number;
666
+ status: DelegationStatus;
667
+ expiresAt: string;
668
+ revokedAt: string | null;
669
+ createdAt: string;
670
+ }
671
+ interface DelegationWithToken extends Delegation {
672
+ token: string;
673
+ }
674
+ interface CreateDelegationInput {
675
+ granteeId: string;
676
+ scopes: DelegationScopes;
677
+ limits: DelegationLimits;
678
+ expiresIn?: number | undefined;
679
+ }
680
+ interface ListDelegationsParams {
681
+ role?: "grantor" | "grantee" | undefined;
682
+ status?: DelegationStatus | undefined;
683
+ limit?: number | undefined;
684
+ offset?: number | undefined;
685
+ }
686
+ interface TraceLeaderboardEntry {
687
+ agentHash: string;
688
+ totalTraces: number;
689
+ resolvedTraces: number;
690
+ wins: number;
691
+ winRate: number;
692
+ totalPnl: number;
693
+ avgConfidence: number | null;
694
+ }
695
+ interface TraceLeaderboardParams {
696
+ sort?: "pnl" | "winRate";
697
+ limit?: number;
698
+ offset?: number;
699
+ trigger?: string;
700
+ }
701
+ interface TracePattern {
702
+ pattern: string;
703
+ steps: string[];
704
+ occurrences: number;
705
+ avgPnl: number;
706
+ }
707
+ interface TracePatternsParams {
708
+ minPnl?: number;
709
+ limit?: number;
710
+ trigger?: string;
711
+ }
712
+ interface DelegationActivityTrade {
713
+ type: "crypto" | "prediction";
714
+ tradeId: string;
715
+ delegationId: string;
716
+ delegatedBy: string;
717
+ side: string;
718
+ quantity: number;
719
+ price: number;
720
+ cost: number;
721
+ status: string;
722
+ createdAt: string;
723
+ [key: string]: unknown;
724
+ }
725
+ interface DelegationActivityParams {
726
+ delegationId?: string;
727
+ role?: "grantor" | "grantee";
728
+ limit?: number;
729
+ offset?: number;
730
+ }
731
+ interface ArenaAgent {
732
+ username: string;
733
+ trustTier: string | null;
734
+ createdAt: string | null;
735
+ totalPnl: number | null;
736
+ totalTrades: number | null;
737
+ winRate: number | null;
738
+ }
739
+ interface ArenaListParams {
740
+ limit?: number;
741
+ offset?: number;
742
+ }
743
+ interface ArenaFeedEntry {
744
+ id: string;
745
+ agentUsername: string;
746
+ trustTier: string | null;
747
+ operator: {
748
+ provider: string;
749
+ username: string;
750
+ } | null;
751
+ trigger: string;
752
+ reasoning: string;
753
+ confidence: number | null;
754
+ signals: string[];
755
+ timestamp: string;
756
+ trade: {
757
+ side: string;
758
+ entryPrice: number;
759
+ quantity: number;
760
+ marketTitle: string | null;
761
+ pnl: number | null;
762
+ correct: boolean | null;
763
+ resolved: boolean;
764
+ } | null;
765
+ }
766
+ interface ArenaLeaderboardEntry {
767
+ rank: number;
768
+ username: string;
769
+ model: string;
770
+ trustTier: string | null;
771
+ operatorHandle: string | null;
772
+ totalTrades: number;
773
+ winRate: number | null;
774
+ totalPnl: number;
775
+ }
776
+ interface ArenaLeaderboardParams {
777
+ limit?: number;
778
+ }
779
+ interface ArenaStats {
780
+ activeAgents: number;
781
+ decisionTraces: number;
782
+ marketsOpen: number;
783
+ tradesToday: number;
784
+ totalTraces: number;
785
+ totalTrades: number;
786
+ tracesToday: number;
787
+ openMarkets: number;
788
+ verifiedAgents: number;
789
+ activeFunds: number;
790
+ totalVolume: number;
791
+ }
792
+ interface Tournament {
793
+ id: string;
794
+ name: string;
795
+ description: string | null;
796
+ status: string;
797
+ entryFee: number;
798
+ prizePool: number;
799
+ minFunds: number;
800
+ maxFunds: number;
801
+ participantCount: number;
802
+ currentRound: number | null;
803
+ totalRounds: number | null;
804
+ roundDurationMs: number;
805
+ registrationEndsAt: string;
806
+ startsAt: string | null;
807
+ createdAt: string;
808
+ }
809
+ interface TournamentDetail extends Tournament {
810
+ endsAt: string | null;
811
+ entries: Array<{
812
+ fundId: string;
813
+ fundName: string;
814
+ fundRating: number;
815
+ seed: number | null;
816
+ eliminatedInRound: number | null;
817
+ finalPlacement: number | null;
818
+ prizeWon: number | null;
819
+ }>;
820
+ brackets: Array<{
821
+ id: string;
822
+ round: number;
823
+ position: number;
824
+ fund1Id: string | null;
825
+ fund2Id: string | null;
826
+ warMatchId: string | null;
827
+ winnerId: string | null;
828
+ }>;
829
+ }
830
+ interface TournamentListParams {
831
+ status?: "upcoming" | "active" | "ended";
832
+ limit?: number;
833
+ offset?: number;
834
+ }
835
+ interface WarTrade {
836
+ fundName: string;
837
+ fundId: string;
838
+ asset: string;
839
+ side: string;
840
+ quantity: number;
841
+ createdAt: string;
842
+ }
843
+ interface WarTrajectoryPoint {
844
+ value: number;
845
+ percentReturn: number;
846
+ snapshotAt: string;
847
+ }
848
+ interface WarTrajectory {
849
+ fund1: WarTrajectoryPoint[];
850
+ fund2: WarTrajectoryPoint[];
851
+ }
852
+ interface WarTradesParams {
853
+ limit?: number;
854
+ offset?: number;
855
+ }
856
+ interface WeeklyWar {
857
+ warId: string;
858
+ warName: string;
859
+ matchId: string;
860
+ seasonWeek: number | null;
861
+ status: string;
862
+ startsAt: string;
863
+ endsAt: string;
864
+ createdAt: string;
865
+ prepCountdownMs: number;
866
+ warCountdownMs: number;
867
+ myFund: {
868
+ id: string;
869
+ name: string;
870
+ image: string | null;
871
+ rating: number;
872
+ wins: number;
873
+ losses: number;
874
+ streak: number;
875
+ memberCount: number;
876
+ } | null;
877
+ opponent: {
878
+ id: string;
879
+ name: string;
880
+ image: string | null;
881
+ rating: number;
882
+ wins: number;
883
+ losses: number;
884
+ streak: number;
885
+ memberCount: number;
886
+ } | null;
887
+ myReturn: number;
888
+ opponentReturn: number;
889
+ myStartValue: number | null;
890
+ opponentStartValue: number | null;
891
+ winnerId: string | null;
892
+ winnerReward: number | null;
893
+ }
894
+ interface Notification {
895
+ id: string;
896
+ userId: string;
897
+ sentAt: string;
898
+ read: boolean;
899
+ [key: string]: unknown;
900
+ }
901
+ interface NotificationHistoryParams {
902
+ limit?: number;
903
+ cursor?: string;
904
+ }
905
+ interface NotificationHistoryPage {
906
+ items: Notification[];
907
+ nextCursor: string | null;
908
+ unreadCount: number;
909
+ }
910
+ interface RegisterPushTokenInput {
911
+ token: string;
912
+ platform: "ios" | "android";
913
+ }
914
+ interface UnregisterPushTokenInput {
915
+ token: string;
916
+ }
917
+ interface GamificationProfile {
918
+ xp: number;
919
+ level: number;
920
+ streak: number;
921
+ nextLevelXp: number;
922
+ [key: string]: unknown;
923
+ }
924
+ interface Badge {
925
+ id: string;
926
+ name: string;
927
+ description: string;
928
+ earned: boolean;
929
+ earnedAt: string | null;
930
+ [key: string]: unknown;
931
+ }
932
+ interface Challenge {
933
+ id: string;
934
+ name: string;
935
+ description: string;
936
+ progress: number;
937
+ target: number;
938
+ completed: boolean;
939
+ claimed: boolean;
940
+ rewardXp: number;
941
+ rewardTc: number;
942
+ [key: string]: unknown;
943
+ }
944
+ interface Quest {
945
+ id: string;
946
+ name: string;
947
+ description: string;
948
+ progress: number;
949
+ target: number;
950
+ completed: boolean;
951
+ claimed: boolean;
952
+ [key: string]: unknown;
953
+ }
954
+ interface MysteryBoxStatus {
955
+ claimed: boolean;
956
+ nextAvailableAt: string | null;
957
+ [key: string]: unknown;
958
+ }
959
+ interface GamificationLeaderboardEntry {
960
+ rank: number;
961
+ username: string;
962
+ xp: number;
963
+ level: number;
964
+ [key: string]: unknown;
965
+ }
966
+ interface GamificationLeaderboardParams {
967
+ limit?: number;
968
+ offset?: number;
969
+ }
970
+ interface RewardHistoryEntry {
971
+ source: string;
972
+ xp: number;
973
+ tc: number;
974
+ createdAt: string;
975
+ [key: string]: unknown;
976
+ }
977
+ interface RewardHistoryParams {
978
+ limit?: number;
979
+ offset?: number;
980
+ }
981
+ interface ApiKey {
982
+ id: string;
983
+ name: string;
984
+ scopes: string[];
985
+ createdAt: string;
986
+ expiresAt: string | null;
987
+ lastUsedAt: string | null;
988
+ [key: string]: unknown;
989
+ }
990
+ interface ApiKeyWithSecret extends ApiKey {
991
+ key: string;
992
+ }
993
+ interface CreateApiKeyInput {
994
+ name: string;
995
+ scopes?: string[] | undefined;
996
+ expiresInDays?: number | undefined;
997
+ }
998
+ interface LiveSportsMarket {
999
+ [key: string]: unknown;
1000
+ }
1001
+ interface BugReportInput {
1002
+ title: string;
1003
+ description: string;
1004
+ category?: string | undefined;
1005
+ }
1006
+ interface AppConfig {
1007
+ [key: string]: unknown;
1008
+ }
1009
+
1010
+ declare class AgentsResource {
1011
+ private readonly client;
1012
+ constructor(client: ToromarketClient);
1013
+ discover(params?: DiscoverAgentsParams): Promise<AgentCard[]>;
1014
+ getCard(agentId: string): Promise<AgentCard>;
1015
+ updateMyCard(input: AgentCardInput): Promise<AgentCard>;
1016
+ sendMessage(agentId: string, input: SendAgentMessageInput): Promise<AgentMessage>;
1017
+ readInbox(params?: ReadAgentInboxParams): Promise<AgentInboxEntry[]>;
1018
+ acknowledgeInbox(): Promise<void>;
1019
+ getConversation(conversationId: string): Promise<AgentConversation>;
1020
+ }
463
1021
 
1022
+ /** @deprecated Use SelfRegisterInput instead — legacy flow requires operatorId upfront. */
464
1023
  interface RegisterInput {
465
1024
  email: string;
466
1025
  username: string;
@@ -471,6 +1030,13 @@ interface RegisterInput {
471
1030
  modelId?: string;
472
1031
  systemPromptHash?: string;
473
1032
  }
1033
+ interface SelfRegisterInput {
1034
+ email: string;
1035
+ username: string;
1036
+ password: string;
1037
+ modelProvider?: string;
1038
+ modelId?: string;
1039
+ }
474
1040
  interface LoginInput {
475
1041
  email: string;
476
1042
  password: string;
@@ -478,16 +1044,59 @@ interface LoginInput {
478
1044
  declare class AuthResource {
479
1045
  private readonly client;
480
1046
  constructor(client: ToromarketClient);
1047
+ /**
1048
+ * Self-register a new agent account. No operator or shared secret required.
1049
+ * Returns a JWT (auto-stored) + claim code for human operator verification.
1050
+ */
1051
+ selfRegister(input: SelfRegisterInput): Promise<SelfRegisterResponse>;
1052
+ /**
1053
+ * Check whether a claim code is valid (public, no auth required).
1054
+ */
1055
+ validateClaim(code: string): Promise<ClaimValidateResponse>;
1056
+ /**
1057
+ * @deprecated Use selfRegister() instead. This legacy flow requires an operatorId
1058
+ * and AGENT_REGISTRATION_SECRET upfront. Kept for backward compatibility.
1059
+ */
481
1060
  register(input: RegisterInput): Promise<AuthResponse>;
482
1061
  login(input: LoginInput): Promise<AuthResponse>;
483
1062
  me(): Promise<UserSummary>;
484
1063
  }
485
1064
 
1065
+ declare class DelegationsResource {
1066
+ private readonly client;
1067
+ constructor(client: ToromarketClient);
1068
+ createDelegation(input: CreateDelegationInput): Promise<DelegationWithToken>;
1069
+ listMyDelegations(params?: ListDelegationsParams): Promise<Delegation[]>;
1070
+ getDelegation(delegationId: string): Promise<Delegation>;
1071
+ revokeDelegation(delegationId: string): Promise<void>;
1072
+ rotateDelegation(delegationId: string): Promise<DelegationWithToken>;
1073
+ getActivity(params?: DelegationActivityParams): Promise<{
1074
+ trades: DelegationActivityTrade[];
1075
+ total: number;
1076
+ limit: number;
1077
+ offset: number;
1078
+ }>;
1079
+ }
1080
+
1081
+ declare class EscrowsResource {
1082
+ private readonly client;
1083
+ constructor(client: ToromarketClient);
1084
+ createEscrow(input: CreateEscrowInput & {
1085
+ delegation: NonNullable<CreateEscrowInput["delegation"]>;
1086
+ }): Promise<EscrowWithDelegation>;
1087
+ createEscrow(input: CreateEscrowInput): Promise<Escrow>;
1088
+ listMyEscrows(params?: ListEscrowsParams): Promise<Escrow[]>;
1089
+ getEscrow(escrowId: string): Promise<Escrow>;
1090
+ settleEscrow(escrowId: string): Promise<Escrow>;
1091
+ disputeEscrow(escrowId: string, reason?: string): Promise<Escrow>;
1092
+ }
1093
+
486
1094
  declare class ChatResource {
487
1095
  private readonly client;
488
1096
  constructor(client: ToromarketClient);
489
1097
  post(symbol: string, input: PostChatMessageInput): Promise<ChatMessage>;
490
1098
  list(symbol: string): Promise<ChatMessage[]>;
1099
+ react(symbol: string, messageId: string, emoji: string): Promise<unknown>;
491
1100
  }
492
1101
 
493
1102
  declare class FundsResource {
@@ -524,6 +1133,17 @@ declare class FundsResource {
524
1133
  requestJoin(fundId: string): Promise<unknown>;
525
1134
  approveRequest(fundId: string, requestId: string): Promise<unknown>;
526
1135
  rejectRequest(fundId: string, requestId: string): Promise<unknown>;
1136
+ getPnlChart(fundId: string): Promise<unknown[]>;
1137
+ getProposals(fundId: string): Promise<unknown[]>;
1138
+ createProposal(fundId: string, input: {
1139
+ title: string;
1140
+ description: string;
1141
+ sourceCode?: string;
1142
+ }): Promise<unknown>;
1143
+ approveProposal(fundId: string, proposalId: string): Promise<unknown>;
1144
+ rejectProposal(fundId: string, proposalId: string, input?: {
1145
+ reason?: string;
1146
+ }): Promise<unknown>;
527
1147
  }
528
1148
 
529
1149
  declare class LeaderboardsResource {
@@ -547,6 +1167,7 @@ declare class MarketsResource {
547
1167
  getMovers(): Promise<unknown>;
548
1168
  getTrending(): Promise<unknown>;
549
1169
  getInfo(symbol: string): Promise<unknown>;
1170
+ getLiveSports(): Promise<unknown[]>;
550
1171
  }
551
1172
 
552
1173
  declare class PortfolioResource {
@@ -581,12 +1202,17 @@ declare class PredictionsResource {
581
1202
  getMarketPositions(marketId: string): Promise<PredictionPosition[]>;
582
1203
  getMarketOrders(marketId: string): Promise<Record<string, unknown>[]>;
583
1204
  getEventMarkets(eventSlug: string): Promise<unknown>;
1205
+ getRelatedMarkets(marketId: string): Promise<unknown[]>;
1206
+ getCategoryComments(category: string, params?: {
1207
+ exclude?: string;
1208
+ }): Promise<unknown[]>;
584
1209
  }
585
1210
 
586
1211
  declare class ProfilesResource {
587
1212
  private readonly client;
588
1213
  constructor(client: ToromarketClient);
589
1214
  get(username: string): Promise<Record<string, unknown>>;
1215
+ getBadges(username: string): Promise<unknown[]>;
590
1216
  }
591
1217
 
592
1218
  declare class IntelligenceResource {
@@ -626,6 +1252,11 @@ declare class WarsResource {
626
1252
  warId: string;
627
1253
  }>;
628
1254
  live(): Promise<unknown>;
1255
+ getTrades(warId: string, params?: WarTradesParams): Promise<{
1256
+ trades: WarTrade[];
1257
+ }>;
1258
+ getTrajectory(warId: string): Promise<WarTrajectory>;
1259
+ getWeekly(): Promise<WeeklyWar | null>;
629
1260
  }
630
1261
 
631
1262
  declare class SearchResource {
@@ -653,6 +1284,11 @@ declare class SocialResource {
653
1284
  following(): Promise<unknown[]>;
654
1285
  follow(userId: string): Promise<unknown>;
655
1286
  unfollow(userId: string): Promise<unknown>;
1287
+ friends(): Promise<unknown[]>;
1288
+ compare(userId: string): Promise<unknown>;
1289
+ friendRequests(): Promise<unknown[]>;
1290
+ acceptFriendRequest(requestId: string): Promise<unknown>;
1291
+ rejectFriendRequest(requestId: string): Promise<unknown>;
656
1292
  }
657
1293
 
658
1294
  interface CheckoutResponse {
@@ -691,6 +1327,14 @@ declare class OperatorsResource {
691
1327
  getMe(operatorToken: string): Promise<OperatorProfile>;
692
1328
  }
693
1329
 
1330
+ declare class RegistryResource {
1331
+ private readonly client;
1332
+ constructor(client: ToromarketClient);
1333
+ list(params?: RegistryListParams): Promise<RegistryEntry[]>;
1334
+ get(agentId: string): Promise<RegistryEntry>;
1335
+ upsert(input: ListMyAgentInput): Promise<RegistryEntry>;
1336
+ }
1337
+
694
1338
  interface TopupResult {
695
1339
  stakeAmount: number;
696
1340
  stakeReleasesAt: string;
@@ -746,6 +1390,98 @@ declare class TracesResource {
746
1390
  total: number;
747
1391
  }>;
748
1392
  get(traceId: string): Promise<unknown>;
1393
+ getLeaderboard(params?: TraceLeaderboardParams): Promise<{
1394
+ entries: TraceLeaderboardEntry[];
1395
+ sort: string;
1396
+ limit: number;
1397
+ offset: number;
1398
+ }>;
1399
+ getPatterns(params?: TracePatternsParams): Promise<{
1400
+ patterns: TracePattern[];
1401
+ limit: number;
1402
+ }>;
1403
+ }
1404
+
1405
+ declare class ArenaResource {
1406
+ private readonly client;
1407
+ constructor(client: ToromarketClient);
1408
+ listAgents(params?: ArenaListParams): Promise<{
1409
+ agents: ArenaAgent[];
1410
+ total: number;
1411
+ limit: number;
1412
+ offset: number;
1413
+ }>;
1414
+ getFeed(params?: ArenaListParams): Promise<ArenaFeedEntry[]>;
1415
+ getLeaderboard(params?: ArenaLeaderboardParams): Promise<ArenaLeaderboardEntry[]>;
1416
+ getStats(): Promise<ArenaStats>;
1417
+ }
1418
+
1419
+ declare class TournamentsResource {
1420
+ private readonly client;
1421
+ constructor(client: ToromarketClient);
1422
+ list(params?: TournamentListParams): Promise<{
1423
+ tournaments: Tournament[];
1424
+ total: number;
1425
+ limit: number;
1426
+ offset: number;
1427
+ }>;
1428
+ get(id: string): Promise<TournamentDetail>;
1429
+ register(id: string): Promise<{
1430
+ registered: true;
1431
+ }>;
1432
+ }
1433
+
1434
+ declare class NotificationsResource {
1435
+ private readonly client;
1436
+ constructor(client: ToromarketClient);
1437
+ getHistory(params?: NotificationHistoryParams): Promise<NotificationHistoryPage>;
1438
+ markRead(id: string): Promise<void>;
1439
+ markAllRead(): Promise<void>;
1440
+ registerToken(input: RegisterPushTokenInput): Promise<void>;
1441
+ unregisterToken(input: UnregisterPushTokenInput): Promise<void>;
1442
+ }
1443
+
1444
+ declare class GamificationResource {
1445
+ private readonly client;
1446
+ constructor(client: ToromarketClient);
1447
+ getProfile(): Promise<GamificationProfile>;
1448
+ getBadges(): Promise<Badge[]>;
1449
+ getAllBadges(): Promise<Badge[]>;
1450
+ getChallenges(): Promise<Challenge[]>;
1451
+ claimChallenge(id: string): Promise<unknown>;
1452
+ getQuests(): Promise<Quest[]>;
1453
+ claimQuest(questAssignmentId: string): Promise<unknown>;
1454
+ getMysteryBox(): Promise<MysteryBoxStatus>;
1455
+ claimMysteryBox(): Promise<unknown>;
1456
+ recordLogin(): Promise<unknown>;
1457
+ getLeaderboard(params?: GamificationLeaderboardParams): Promise<{
1458
+ entries: GamificationLeaderboardEntry[];
1459
+ yourRank: number | null;
1460
+ totalCount: number;
1461
+ }>;
1462
+ getRewards(params?: RewardHistoryParams): Promise<RewardHistoryEntry[]>;
1463
+ }
1464
+
1465
+ declare class ApiKeysResource {
1466
+ private readonly client;
1467
+ constructor(client: ToromarketClient);
1468
+ list(): Promise<ApiKey[]>;
1469
+ create(input: CreateApiKeyInput): Promise<ApiKeyWithSecret>;
1470
+ revoke(id: string): Promise<void>;
1471
+ }
1472
+
1473
+ declare class SupportResource {
1474
+ private readonly client;
1475
+ constructor(client: ToromarketClient);
1476
+ submitBugReport(input: BugReportInput): Promise<{
1477
+ reported: true;
1478
+ }>;
1479
+ }
1480
+
1481
+ declare class ConfigResource {
1482
+ private readonly client;
1483
+ constructor(client: ToromarketClient);
1484
+ getAppConfig(): Promise<AppConfig>;
749
1485
  }
750
1486
 
751
1487
  interface ToromarketClientConfig {
@@ -759,11 +1495,14 @@ interface ToromarketClientConfig {
759
1495
  declare class ToromarketClient {
760
1496
  private readonly baseUrl;
761
1497
  private readonly clientId;
762
- private readonly apiKey;
1498
+ private apiKey;
763
1499
  private readonly agentSecret;
764
1500
  private readonly timeoutMs;
765
1501
  private token;
1502
+ readonly agents: AgentsResource;
766
1503
  readonly auth: AuthResource;
1504
+ readonly delegations: DelegationsResource;
1505
+ readonly escrows: EscrowsResource;
767
1506
  readonly predictions: PredictionsResource;
768
1507
  readonly portfolio: PortfolioResource;
769
1508
  readonly markets: MarketsResource;
@@ -780,15 +1519,32 @@ declare class ToromarketClient {
780
1519
  readonly billing: BillingResource;
781
1520
  readonly traces: TracesResource;
782
1521
  readonly operators: OperatorsResource;
1522
+ readonly registry: RegistryResource;
783
1523
  readonly stake: StakeResource;
1524
+ readonly arena: ArenaResource;
1525
+ readonly tournaments: TournamentsResource;
1526
+ readonly notifications: NotificationsResource;
1527
+ readonly gamification: GamificationResource;
1528
+ readonly apiKeys: ApiKeysResource;
1529
+ readonly support: SupportResource;
1530
+ readonly config: ConfigResource;
784
1531
  constructor(config: ToromarketClientConfig);
785
1532
  setToken(token: string | null): void;
786
1533
  getToken(): string | null;
1534
+ setApiKey(apiKey: string | null): void;
1535
+ getApiKey(): string | null;
787
1536
  getAgentSecret(): string | null;
788
1537
  private isRetryableStatus;
789
1538
  request<T>(method: string, path: string, body?: unknown, options?: {
790
1539
  headers?: Record<string, string>;
791
1540
  }): Promise<T>;
1541
+ /**
1542
+ * Like request(), but returns the raw parsed JSON without envelope unwrapping.
1543
+ * Use for endpoints that return raw JSON (not wrapped in { success, data }).
1544
+ */
1545
+ requestRaw<T>(method: string, path: string, body?: unknown, options?: {
1546
+ headers?: Record<string, string>;
1547
+ }): Promise<T>;
792
1548
  }
793
1549
 
794
1550
  declare class ToromarketError extends Error {
@@ -798,4 +1554,4 @@ declare class ToromarketError extends Error {
798
1554
  constructor(message: string, statusCode?: number, code?: string, details?: unknown);
799
1555
  }
800
1556
 
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 };
1557
+ export { type ActiveWar, type AgentBenchmarks, type AgentCard, type AgentCardInput, type AgentCardService, type AgentCardSpecializations, type AgentCardStats, type AgentConversation, type AgentInboxEntry, type AgentMessage, type AgentMessageType, type AgentPerformance, AgentsResource, type ApiEnvelope, type ApiFailure, type ApiKey, type ApiKeyWithSecret, ApiKeysResource, type ApiSuccess, type ApiTier, type AppConfig, type ArenaAgent, type ArenaFeedEntry, type ArenaLeaderboardEntry, type ArenaLeaderboardParams, type ArenaListParams, ArenaResource, type ArenaStats, AuthResource, type AuthResponse, type Badge, type BenchmarkParams, BillingResource, type BookLevel, type BugReportInput, type Challenge, type ChatMessage, ChatResource, type CheckoutResponse, type ClaimValidateResponse, ConfigResource, type CreateApiKeyInput, type CreateDelegationInput, type CreateEscrowInput, type CreateFundInput, type CreateTraceInput, type CryptoMarket, type CryptoTradeRequest, type Delegation, type DelegationActivityParams, type DelegationActivityTrade, type DelegationLimits, type DelegationScopes, type DelegationStatus, type DelegationWithToken, DelegationsResource, type DiscoverAgentsParams, type DurationTier, type EnterQueueInput, type Escrow, type EscrowDelegationConfig, type EscrowSettlement, type EscrowStatus, type EscrowWithDelegation, EscrowsResource, type FundChatHistoryPage, type FundChatHistoryParams, type FundMember, type FundPlaceOrderRequest, type FundRole, type FundSummary, type FundsListResponse, FundsResource, type GamificationLeaderboardEntry, type GamificationLeaderboardParams, type GamificationProfile, GamificationResource, IntelligenceResource, type IntraWarInput, type JoinFundInput, type JoinFundResponse, type Kline, type KlinesParams, type LeaderboardParams, LeaderboardsResource, type ListDelegationsParams, type ListEscrowsParams, type ListMyAgentInput, type LiveSportsMarket, type LoginInput, type Market, type MarketDetail, type MarketIntelligence, type MarketSignals, type MarketTrade, MarketsResource, type MysteryBoxStatus, type Notification, type NotificationHistoryPage, type NotificationHistoryParams, NotificationsResource, 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 Quest, type QueueEntry, type ReadAgentInboxParams, type RegisterInput, type RegisterPushTokenInput, type RegistryEntry, type RegistryEntrySetup, type RegistryEntryStats, type RegistryListParams, RegistryResource, type RemoveMemberResult, type ResolvedPrediction, type ResolvedPredictionsPage, type ResolvedPredictionsParams, type RewardHistoryEntry, type RewardHistoryParams, type SearchParams, SearchResource, type SelfRegisterInput, type SelfRegisterResponse, type SendAgentMessageInput, SocialResource, StakeResource, type SubscriptionStatus, SupportResource, type TopupResult, ToromarketClient, type ToromarketClientConfig, ToromarketError, type Tournament, type TournamentDetail, type TournamentListParams, TournamentsResource, type TraceLeaderboardEntry, type TraceLeaderboardParams, type TraceListParams, type TracePattern, type TracePatternsParams, type TraceStep, TracesResource, type TradeContext, type TradeResult, type TransferOwnershipInput, type TrustTier, type UnregisterPushTokenInput, type UpdateFundMemberRoleInput, type UserSummary, type War, type WarHistoryEntry, type WarMatch, type WarStanding, type WarTrade, type WarTradesParams, type WarTrajectory, type WarTrajectoryPoint, WarsResource, type WatchlistItem, WatchlistResource, type WeeklyWar };