@toromarket/sdk 0.1.0 → 0.2.1

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