@cabaltrading/cli 0.4.3 → 0.4.5
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.js +2191 -1712
- package/dist/mcp-server.js +1889 -1627
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -642,34 +642,9 @@ var init_agents = __esm(() => {
|
|
|
642
642
|
|
|
643
643
|
// ../../packages/client/src/schemas/trade.ts
|
|
644
644
|
import { z as z4 } from "zod";
|
|
645
|
-
var
|
|
645
|
+
var solanaTradeRequestSchema, hyperliquidTradeRequestSchema, tradeRequestSchema, tradeResponseDataSchema, tradeResponseSchema, dryRunResponseDataSchema;
|
|
646
646
|
var init_trade = __esm(() => {
|
|
647
647
|
init_common();
|
|
648
|
-
SUPPORTED_MODELS = [
|
|
649
|
-
"claude-3-opus",
|
|
650
|
-
"claude-3-sonnet",
|
|
651
|
-
"claude-3.5-sonnet",
|
|
652
|
-
"claude-3-haiku",
|
|
653
|
-
"gpt-4",
|
|
654
|
-
"gpt-4-turbo",
|
|
655
|
-
"gpt-4o",
|
|
656
|
-
"o1",
|
|
657
|
-
"o1-mini",
|
|
658
|
-
"grok-2",
|
|
659
|
-
"grok-2-mini",
|
|
660
|
-
"gemini-pro",
|
|
661
|
-
"gemini-ultra",
|
|
662
|
-
"llama-3-70b",
|
|
663
|
-
"llama-3-405b",
|
|
664
|
-
"mistral-large",
|
|
665
|
-
"mixtral",
|
|
666
|
-
"deepseek-v3",
|
|
667
|
-
"deepseek-r1",
|
|
668
|
-
"kimi-k2",
|
|
669
|
-
"kimi-k2.5",
|
|
670
|
-
"other"
|
|
671
|
-
];
|
|
672
|
-
modelSchema = z4.enum(SUPPORTED_MODELS);
|
|
673
648
|
solanaTradeRequestSchema = z4.object({
|
|
674
649
|
chain: z4.literal("solana"),
|
|
675
650
|
inputToken: z4.string().min(1),
|
|
@@ -677,7 +652,7 @@ var init_trade = __esm(() => {
|
|
|
677
652
|
amount: z4.number().positive(),
|
|
678
653
|
slippageBps: z4.number().int().min(1).max(500).optional(),
|
|
679
654
|
dryRun: z4.boolean().optional(),
|
|
680
|
-
model:
|
|
655
|
+
model: z4.string().optional()
|
|
681
656
|
});
|
|
682
657
|
hyperliquidTradeRequestSchema = z4.object({
|
|
683
658
|
chain: z4.literal("hyperliquid"),
|
|
@@ -687,7 +662,7 @@ var init_trade = __esm(() => {
|
|
|
687
662
|
price: z4.number().positive().optional(),
|
|
688
663
|
orderType: z4.enum(["limit", "market"]).optional(),
|
|
689
664
|
leverage: z4.number().positive().optional(),
|
|
690
|
-
model:
|
|
665
|
+
model: z4.string().optional()
|
|
691
666
|
});
|
|
692
667
|
tradeRequestSchema = z4.discriminatedUnion("chain", [
|
|
693
668
|
solanaTradeRequestSchema,
|
|
@@ -712,12 +687,121 @@ var init_trade = __esm(() => {
|
|
|
712
687
|
}).optional()
|
|
713
688
|
});
|
|
714
689
|
tradeResponseSchema = successEnvelope(tradeResponseDataSchema);
|
|
690
|
+
dryRunResponseDataSchema = z4.object({
|
|
691
|
+
dryRun: z4.literal(true),
|
|
692
|
+
quote: z4.object({
|
|
693
|
+
inAmount: z4.string(),
|
|
694
|
+
outAmount: z4.string(),
|
|
695
|
+
priceImpactPct: z4.string()
|
|
696
|
+
}),
|
|
697
|
+
fee: z4.object({ bps: z4.number() }),
|
|
698
|
+
unsignedTransaction: z4.string()
|
|
699
|
+
});
|
|
715
700
|
});
|
|
716
701
|
|
|
717
|
-
// ../../packages/client/src/schemas/
|
|
702
|
+
// ../../packages/client/src/schemas/hyperliquid.ts
|
|
718
703
|
import { z as z5 } from "zod";
|
|
704
|
+
var hyperliquidFillsQuerySchema, hyperliquidSetupRequestSchema, hyperliquidSetupResponseDataSchema, hlPositionSchema, hlSpotBalanceSchema, hyperliquidAccountResponseDataSchema, hlFillSchema, hyperliquidFillsResponseDataSchema, hyperliquidLiquidationRiskResponseDataSchema, hyperliquidSetupResponseSchema, hyperliquidAccountResponseSchema, hyperliquidFillsResponseSchema, hyperliquidLiquidationRiskResponseSchema;
|
|
705
|
+
var init_hyperliquid = __esm(() => {
|
|
706
|
+
init_common();
|
|
707
|
+
hyperliquidFillsQuerySchema = z5.object({
|
|
708
|
+
limit: z5.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
|
|
709
|
+
offset: z5.coerce.number().int().min(0).default(0)
|
|
710
|
+
});
|
|
711
|
+
hyperliquidSetupRequestSchema = z5.object({
|
|
712
|
+
sourceChain: z5.enum(["solana", "ethereum", "arbitrum", "optimism", "base"]).optional()
|
|
713
|
+
});
|
|
714
|
+
hyperliquidSetupResponseDataSchema = z5.object({
|
|
715
|
+
deposit_address: z5.string(),
|
|
716
|
+
min_deposit: z5.number().optional(),
|
|
717
|
+
source_chain: z5.string(),
|
|
718
|
+
hl_address: z5.string(),
|
|
719
|
+
estimated_time: z5.string().optional(),
|
|
720
|
+
builder: z5.object({
|
|
721
|
+
address: z5.string(),
|
|
722
|
+
fee: z5.string()
|
|
723
|
+
}).passthrough(),
|
|
724
|
+
instructions: z5.string().optional(),
|
|
725
|
+
note: z5.string().optional()
|
|
726
|
+
});
|
|
727
|
+
hlPositionSchema = z5.object({
|
|
728
|
+
coin: z5.string(),
|
|
729
|
+
side: z5.string(),
|
|
730
|
+
size: z5.number(),
|
|
731
|
+
entryPrice: z5.number(),
|
|
732
|
+
unrealizedPnl: z5.number(),
|
|
733
|
+
marginUsed: z5.number(),
|
|
734
|
+
leverage: z5.number(),
|
|
735
|
+
liquidationPrice: z5.number().nullable()
|
|
736
|
+
}).passthrough();
|
|
737
|
+
hlSpotBalanceSchema = z5.object({
|
|
738
|
+
coin: z5.string(),
|
|
739
|
+
total: z5.number(),
|
|
740
|
+
hold: z5.number(),
|
|
741
|
+
available: z5.number(),
|
|
742
|
+
priceUsd: z5.number(),
|
|
743
|
+
valueUsd: z5.number()
|
|
744
|
+
});
|
|
745
|
+
hyperliquidAccountResponseDataSchema = z5.object({
|
|
746
|
+
hlAddress: z5.string(),
|
|
747
|
+
perps: z5.object({
|
|
748
|
+
accountValue: z5.number(),
|
|
749
|
+
totalMarginUsed: z5.number(),
|
|
750
|
+
unrealizedPnl: z5.number(),
|
|
751
|
+
withdrawable: z5.number(),
|
|
752
|
+
positions: z5.array(hlPositionSchema)
|
|
753
|
+
}),
|
|
754
|
+
spot: z5.object({
|
|
755
|
+
balances: z5.array(hlSpotBalanceSchema)
|
|
756
|
+
}),
|
|
757
|
+
lastSync: z5.string()
|
|
758
|
+
});
|
|
759
|
+
hlFillSchema = z5.object({
|
|
760
|
+
id: z5.string(),
|
|
761
|
+
coin: z5.string(),
|
|
762
|
+
side: z5.string(),
|
|
763
|
+
size: z5.number(),
|
|
764
|
+
price: z5.number(),
|
|
765
|
+
fee: z5.number(),
|
|
766
|
+
builderFee: z5.number().nullable().optional(),
|
|
767
|
+
timestamp: z5.string()
|
|
768
|
+
}).passthrough();
|
|
769
|
+
hyperliquidFillsResponseDataSchema = z5.object({
|
|
770
|
+
hlAddress: z5.string(),
|
|
771
|
+
fills: z5.array(hlFillSchema),
|
|
772
|
+
totalBuilderFees: z5.number(),
|
|
773
|
+
pagination: z5.object({
|
|
774
|
+
limit: z5.number(),
|
|
775
|
+
offset: z5.number(),
|
|
776
|
+
hasMore: z5.boolean()
|
|
777
|
+
})
|
|
778
|
+
});
|
|
779
|
+
hyperliquidLiquidationRiskResponseDataSchema = z5.object({
|
|
780
|
+
hlAddress: z5.string(),
|
|
781
|
+
healthScore: z5.number(),
|
|
782
|
+
marginUtilization: z5.number(),
|
|
783
|
+
totalExposure: z5.number(),
|
|
784
|
+
atRisk: z5.boolean(),
|
|
785
|
+
alerts: z5.array(z5.string()),
|
|
786
|
+
recommendations: z5.array(z5.string()),
|
|
787
|
+
advisoryLimits: z5.object({
|
|
788
|
+
trustLevel: z5.string(),
|
|
789
|
+
maxLeverage: z5.number(),
|
|
790
|
+
maxPositionPct: z5.number(),
|
|
791
|
+
maxDailyLossPct: z5.number(),
|
|
792
|
+
note: z5.string()
|
|
793
|
+
})
|
|
794
|
+
});
|
|
795
|
+
hyperliquidSetupResponseSchema = successEnvelope(hyperliquidSetupResponseDataSchema);
|
|
796
|
+
hyperliquidAccountResponseSchema = successEnvelope(hyperliquidAccountResponseDataSchema);
|
|
797
|
+
hyperliquidFillsResponseSchema = successEnvelope(hyperliquidFillsResponseDataSchema);
|
|
798
|
+
hyperliquidLiquidationRiskResponseSchema = successEnvelope(hyperliquidLiquidationRiskResponseDataSchema);
|
|
799
|
+
});
|
|
800
|
+
|
|
801
|
+
// ../../packages/client/src/schemas/incubator.ts
|
|
802
|
+
import { z as z6 } from "zod";
|
|
719
803
|
function requiredString(field, message = `Missing required field: ${field}`) {
|
|
720
|
-
return
|
|
804
|
+
return z6.preprocess((value) => typeof value === "string" ? value.trim() : "", z6.string().min(1, { message }));
|
|
721
805
|
}
|
|
722
806
|
var tokenNameSchema, tokenSymbolSchema, incubatorLogRequestSchema, incubatorLogResponseDataSchema, incubatorLogResponseSchema, incubatorAgentIdParamsSchema, incubatorBrainSwitchRequestSchema, incubatorBrainDepositRequestSchema, incubatorBrainUsageRequestSchema, incubatorBrainRequestSchema, incubatorBrainResponseDataSchema, incubatorBrainResponseSchema, incubatorBrainUsageResponseDataSchema, incubatorBrainUsageResponseSchema, incubatorServerRequestSchema, incubatorServerResponseDataSchema, incubatorServerResponseSchema, incubatorTokenRequestSchema, incubatorTokenSchema, incubatorTokenResponseDataSchema, incubatorTokenConfirmResponseDataSchema, incubatorTokenResponseSchema, incubatorInboxSendRequestSchema, incubatorInboxSendResponseDataSchema, incubatorInboxSendResponseSchema, incubatorInboxQuerySchema, incubatorTurnsQuerySchema, incubatorInboxReplyRequestSchema, incubatorInboxPatchRequestSchema, incubatorMemorialsQuerySchema, incubatorTasksQuerySchema, VALID_TASK_CATEGORIES, INVALID_CATEGORY_MESSAGE, taskCategorySchema, incubatorTaskCreateRequestSchema, incubatorTaskActionParamsSchema, taskActionBaseSchema, incubatorTaskActionRequestSchema, incubatorSurvivalResponseDataSchema, incubatorInboxResponseDataSchema, incubatorInboxReplyResponseDataSchema, incubatorInboxPatchResponseDataSchema, incubatorGroupsUnreadResponseDataSchema, incubatorInboxUnreadResponseDataSchema, incubatorMemorialsResponseDataSchema, modelInfoSchema, serverPlanInfoSchema, incubatorOverviewResponseDataSchema, incubatorPoolResponseDataSchema, incubatorRentGetResponseDataSchema, incubatorRentPostResponseDataSchema, incubatorRentResponseDataSchema, incubatorTaskSummarySchema, incubatorTasksResponseDataSchema, incubatorTaskCreateResponseDataSchema, incubatorTaskActionResponseDataSchema, incubatorTaskApplicantSchema, incubatorTaskSubmissionSchema, incubatorTaskApplicationsResponseDataSchema, incubatorTaskSubmissionResponseDataSchema, incubatorTurnSchema, incubatorTurnsResponseDataSchema, incubatorTurnsResponseSchema, incubatorGroupsUnreadResponseSchema, incubatorInboxUnreadResponseSchema;
|
|
723
807
|
var init_incubator = __esm(() => {
|
|
@@ -732,433 +816,433 @@ var init_incubator = __esm(() => {
|
|
|
732
816
|
}).refine((value) => /^[A-Za-z0-9]+$/.test(value), {
|
|
733
817
|
message: "Token symbol must be alphanumeric with no spaces"
|
|
734
818
|
});
|
|
735
|
-
incubatorLogRequestSchema =
|
|
819
|
+
incubatorLogRequestSchema = z6.object({
|
|
736
820
|
message: requiredString("message").refine((value) => value.length <= 2000, { message: "Message too long" }),
|
|
737
|
-
event_type:
|
|
821
|
+
event_type: z6.string().trim().min(1).max(64).optional()
|
|
738
822
|
});
|
|
739
|
-
incubatorLogResponseDataSchema =
|
|
740
|
-
log:
|
|
741
|
-
id:
|
|
742
|
-
event_type:
|
|
743
|
-
message:
|
|
823
|
+
incubatorLogResponseDataSchema = z6.object({
|
|
824
|
+
log: z6.object({
|
|
825
|
+
id: z6.string().uuid(),
|
|
826
|
+
event_type: z6.string(),
|
|
827
|
+
message: z6.string()
|
|
744
828
|
})
|
|
745
829
|
});
|
|
746
830
|
incubatorLogResponseSchema = successEnvelope(incubatorLogResponseDataSchema);
|
|
747
|
-
incubatorAgentIdParamsSchema =
|
|
748
|
-
agentId:
|
|
831
|
+
incubatorAgentIdParamsSchema = z6.object({
|
|
832
|
+
agentId: z6.string().uuid("agentId must be a UUID")
|
|
749
833
|
});
|
|
750
|
-
incubatorBrainSwitchRequestSchema =
|
|
751
|
-
action:
|
|
834
|
+
incubatorBrainSwitchRequestSchema = z6.object({
|
|
835
|
+
action: z6.literal("switch"),
|
|
752
836
|
model: requiredString("model").refine((value) => value.length > 0, { message: "Invalid model" })
|
|
753
837
|
});
|
|
754
|
-
incubatorBrainDepositRequestSchema =
|
|
755
|
-
action:
|
|
756
|
-
amountUsd:
|
|
838
|
+
incubatorBrainDepositRequestSchema = z6.object({
|
|
839
|
+
action: z6.literal("deposit"),
|
|
840
|
+
amountUsd: z6.number().refine((value) => value > 0, {
|
|
757
841
|
message: "Invalid deposit amount"
|
|
758
842
|
})
|
|
759
843
|
});
|
|
760
|
-
incubatorBrainUsageRequestSchema =
|
|
761
|
-
costUsd:
|
|
844
|
+
incubatorBrainUsageRequestSchema = z6.object({
|
|
845
|
+
costUsd: z6.number().positive("costUsd must be a positive number")
|
|
762
846
|
});
|
|
763
|
-
incubatorBrainRequestSchema =
|
|
847
|
+
incubatorBrainRequestSchema = z6.discriminatedUnion("action", [
|
|
764
848
|
incubatorBrainSwitchRequestSchema,
|
|
765
849
|
incubatorBrainDepositRequestSchema
|
|
766
850
|
]);
|
|
767
|
-
incubatorBrainResponseDataSchema =
|
|
768
|
-
|
|
769
|
-
brain:
|
|
770
|
-
previousModel:
|
|
771
|
-
newModel:
|
|
772
|
-
costPerDay:
|
|
851
|
+
incubatorBrainResponseDataSchema = z6.union([
|
|
852
|
+
z6.object({
|
|
853
|
+
brain: z6.object({
|
|
854
|
+
previousModel: z6.string(),
|
|
855
|
+
newModel: z6.string(),
|
|
856
|
+
costPerDay: z6.number()
|
|
773
857
|
})
|
|
774
858
|
}),
|
|
775
|
-
|
|
776
|
-
deposit:
|
|
777
|
-
amountUsd:
|
|
778
|
-
newCreditLimit:
|
|
779
|
-
remainingBalanceUsd:
|
|
859
|
+
z6.object({
|
|
860
|
+
deposit: z6.object({
|
|
861
|
+
amountUsd: z6.number(),
|
|
862
|
+
newCreditLimit: z6.number(),
|
|
863
|
+
remainingBalanceUsd: z6.number()
|
|
780
864
|
})
|
|
781
865
|
})
|
|
782
866
|
]);
|
|
783
867
|
incubatorBrainResponseSchema = successEnvelope(incubatorBrainResponseDataSchema);
|
|
784
|
-
incubatorBrainUsageResponseDataSchema =
|
|
785
|
-
usageUsd:
|
|
786
|
-
budgetUsd:
|
|
787
|
-
remainingUsd:
|
|
868
|
+
incubatorBrainUsageResponseDataSchema = z6.object({
|
|
869
|
+
usageUsd: z6.number(),
|
|
870
|
+
budgetUsd: z6.number(),
|
|
871
|
+
remainingUsd: z6.number()
|
|
788
872
|
});
|
|
789
873
|
incubatorBrainUsageResponseSchema = successEnvelope(incubatorBrainUsageResponseDataSchema);
|
|
790
|
-
incubatorServerRequestSchema =
|
|
874
|
+
incubatorServerRequestSchema = z6.object({
|
|
791
875
|
plan: requiredString("plan")
|
|
792
876
|
});
|
|
793
|
-
incubatorServerResponseDataSchema =
|
|
794
|
-
server:
|
|
795
|
-
previousPlan:
|
|
796
|
-
newPlan:
|
|
797
|
-
costUsd:
|
|
798
|
-
description:
|
|
877
|
+
incubatorServerResponseDataSchema = z6.object({
|
|
878
|
+
server: z6.object({
|
|
879
|
+
previousPlan: z6.string(),
|
|
880
|
+
newPlan: z6.string(),
|
|
881
|
+
costUsd: z6.number(),
|
|
882
|
+
description: z6.string()
|
|
799
883
|
})
|
|
800
884
|
});
|
|
801
885
|
incubatorServerResponseSchema = successEnvelope(incubatorServerResponseDataSchema);
|
|
802
|
-
incubatorTokenRequestSchema =
|
|
886
|
+
incubatorTokenRequestSchema = z6.object({
|
|
803
887
|
name: tokenNameSchema,
|
|
804
888
|
symbol: tokenSymbolSchema,
|
|
805
|
-
configAddress:
|
|
806
|
-
});
|
|
807
|
-
incubatorTokenSchema =
|
|
808
|
-
id:
|
|
809
|
-
tokenId:
|
|
810
|
-
agentId:
|
|
811
|
-
name:
|
|
812
|
-
symbol:
|
|
813
|
-
mintAddress:
|
|
814
|
-
poolAddress:
|
|
815
|
-
agentAllocationPct:
|
|
816
|
-
platformAllocationPct:
|
|
817
|
-
createdAt:
|
|
818
|
-
txSignature:
|
|
819
|
-
priceUsd:
|
|
820
|
-
marketCapUsd:
|
|
821
|
-
holders:
|
|
822
|
-
deployed:
|
|
889
|
+
configAddress: z6.string().min(32).max(44).optional()
|
|
890
|
+
});
|
|
891
|
+
incubatorTokenSchema = z6.object({
|
|
892
|
+
id: z6.string().uuid().optional(),
|
|
893
|
+
tokenId: z6.string().uuid().optional(),
|
|
894
|
+
agentId: z6.string().uuid().optional(),
|
|
895
|
+
name: z6.string(),
|
|
896
|
+
symbol: z6.string(),
|
|
897
|
+
mintAddress: z6.string().nullable(),
|
|
898
|
+
poolAddress: z6.string().nullable().optional(),
|
|
899
|
+
agentAllocationPct: z6.number().optional(),
|
|
900
|
+
platformAllocationPct: z6.number().optional(),
|
|
901
|
+
createdAt: z6.string().optional(),
|
|
902
|
+
txSignature: z6.string().nullable().optional(),
|
|
903
|
+
priceUsd: z6.number().nullable().optional(),
|
|
904
|
+
marketCapUsd: z6.number().nullable().optional(),
|
|
905
|
+
holders: z6.number().nullable().optional(),
|
|
906
|
+
deployed: z6.boolean()
|
|
823
907
|
}).passthrough();
|
|
824
|
-
incubatorTokenResponseDataSchema =
|
|
908
|
+
incubatorTokenResponseDataSchema = z6.object({
|
|
825
909
|
token: incubatorTokenSchema
|
|
826
910
|
});
|
|
827
|
-
incubatorTokenConfirmResponseDataSchema =
|
|
828
|
-
confirmed:
|
|
829
|
-
txSignature:
|
|
911
|
+
incubatorTokenConfirmResponseDataSchema = z6.object({
|
|
912
|
+
confirmed: z6.boolean(),
|
|
913
|
+
txSignature: z6.string().nullable()
|
|
830
914
|
});
|
|
831
915
|
incubatorTokenResponseSchema = successEnvelope(incubatorTokenResponseDataSchema);
|
|
832
|
-
incubatorInboxSendRequestSchema =
|
|
916
|
+
incubatorInboxSendRequestSchema = z6.object({
|
|
833
917
|
agentId: requiredString("agentId", "Missing required fields: agentId, message"),
|
|
834
918
|
message: requiredString("message", "Missing required fields: agentId, message").refine((value) => value.length <= 5000, {
|
|
835
919
|
message: "Message must be a string of 5000 characters or fewer"
|
|
836
920
|
}),
|
|
837
|
-
senderName:
|
|
921
|
+
senderName: z6.string().max(120).optional()
|
|
838
922
|
});
|
|
839
|
-
incubatorInboxSendResponseDataSchema =
|
|
840
|
-
id:
|
|
841
|
-
agentId:
|
|
842
|
-
paymentAmountUsd:
|
|
843
|
-
paymentTx:
|
|
844
|
-
status:
|
|
923
|
+
incubatorInboxSendResponseDataSchema = z6.object({
|
|
924
|
+
id: z6.string().uuid(),
|
|
925
|
+
agentId: z6.string().uuid(),
|
|
926
|
+
paymentAmountUsd: z6.number(),
|
|
927
|
+
paymentTx: z6.string(),
|
|
928
|
+
status: z6.literal("confirmed")
|
|
845
929
|
});
|
|
846
930
|
incubatorInboxSendResponseSchema = successEnvelope(incubatorInboxSendResponseDataSchema);
|
|
847
|
-
incubatorInboxQuerySchema =
|
|
848
|
-
status:
|
|
931
|
+
incubatorInboxQuerySchema = z6.object({
|
|
932
|
+
status: z6.enum(["pending", "confirmed", "replied"]).default("pending")
|
|
849
933
|
});
|
|
850
|
-
incubatorTurnsQuerySchema =
|
|
851
|
-
action:
|
|
852
|
-
sourceType:
|
|
853
|
-
page:
|
|
854
|
-
pageSize:
|
|
855
|
-
beforeSeq:
|
|
934
|
+
incubatorTurnsQuerySchema = z6.object({
|
|
935
|
+
action: z6.enum(["stats", "latest"]).optional(),
|
|
936
|
+
sourceType: z6.enum(["system", "heartbeat", "inbox", "groups", "manual"]).optional(),
|
|
937
|
+
page: z6.coerce.number().int().min(1).default(1),
|
|
938
|
+
pageSize: z6.coerce.number().int().min(1).default(20),
|
|
939
|
+
beforeSeq: z6.coerce.number().int().optional()
|
|
856
940
|
});
|
|
857
|
-
incubatorInboxReplyRequestSchema =
|
|
941
|
+
incubatorInboxReplyRequestSchema = z6.object({
|
|
858
942
|
messageId: requiredString("messageId", "Missing required fields: messageId, replyText"),
|
|
859
943
|
replyText: requiredString("replyText", "Missing required fields: messageId, replyText").refine((value) => value.length <= 2000, { message: "Reply too long" }),
|
|
860
|
-
replyPublic:
|
|
944
|
+
replyPublic: z6.boolean().optional()
|
|
861
945
|
});
|
|
862
|
-
incubatorInboxPatchRequestSchema =
|
|
863
|
-
priceUsd:
|
|
946
|
+
incubatorInboxPatchRequestSchema = z6.object({
|
|
947
|
+
priceUsd: z6.coerce.number().min(0, "Price must be non-negative").max(1000, "Price too high")
|
|
864
948
|
});
|
|
865
|
-
incubatorMemorialsQuerySchema =
|
|
866
|
-
limit:
|
|
867
|
-
offset:
|
|
949
|
+
incubatorMemorialsQuerySchema = z6.object({
|
|
950
|
+
limit: z6.coerce.number().int().min(1).default(25).transform((value) => Math.min(value, 100)),
|
|
951
|
+
offset: z6.coerce.number().int().min(0).default(0)
|
|
868
952
|
});
|
|
869
|
-
incubatorTasksQuerySchema =
|
|
870
|
-
status:
|
|
953
|
+
incubatorTasksQuerySchema = z6.object({
|
|
954
|
+
status: z6.string().trim().min(1).optional()
|
|
871
955
|
});
|
|
872
956
|
VALID_TASK_CATEGORIES = ["account_creation", "verification", "research", "content", "outreach", "other"];
|
|
873
957
|
INVALID_CATEGORY_MESSAGE = `Invalid category: Must be one of: ${VALID_TASK_CATEGORIES.join(", ")}`;
|
|
874
|
-
taskCategorySchema =
|
|
958
|
+
taskCategorySchema = z6.enum(VALID_TASK_CATEGORIES, {
|
|
875
959
|
message: INVALID_CATEGORY_MESSAGE
|
|
876
960
|
}).optional();
|
|
877
|
-
incubatorTaskCreateRequestSchema =
|
|
961
|
+
incubatorTaskCreateRequestSchema = z6.object({
|
|
878
962
|
title: requiredString("title", "Missing required fields: title, description"),
|
|
879
963
|
description: requiredString("description", "Missing required fields: title, description"),
|
|
880
964
|
category: taskCategorySchema,
|
|
881
|
-
budgetUsd:
|
|
882
|
-
deadline:
|
|
883
|
-
requiredProof:
|
|
965
|
+
budgetUsd: z6.number().min(0, "Budget must be positive").refine((value) => value > 0, { message: "Budget must be positive" }).max(1e4, "Budget too high"),
|
|
966
|
+
deadline: z6.string().trim().optional().nullable(),
|
|
967
|
+
requiredProof: z6.string().trim().optional().nullable()
|
|
884
968
|
});
|
|
885
|
-
incubatorTaskActionParamsSchema =
|
|
886
|
-
taskId:
|
|
969
|
+
incubatorTaskActionParamsSchema = z6.object({
|
|
970
|
+
taskId: z6.string().uuid("taskId must be a UUID")
|
|
887
971
|
});
|
|
888
|
-
taskActionBaseSchema =
|
|
889
|
-
action:
|
|
972
|
+
taskActionBaseSchema = z6.object({
|
|
973
|
+
action: z6.enum(["accept", "approve", "cancel", "dispute"])
|
|
890
974
|
});
|
|
891
|
-
incubatorTaskActionRequestSchema =
|
|
975
|
+
incubatorTaskActionRequestSchema = z6.discriminatedUnion("action", [
|
|
892
976
|
taskActionBaseSchema.extend({
|
|
893
|
-
action:
|
|
894
|
-
applicantId:
|
|
977
|
+
action: z6.literal("accept"),
|
|
978
|
+
applicantId: z6.string().uuid("applicantId must be a UUID")
|
|
895
979
|
}),
|
|
896
980
|
taskActionBaseSchema.extend({
|
|
897
|
-
action:
|
|
898
|
-
rating:
|
|
899
|
-
comment:
|
|
981
|
+
action: z6.literal("approve"),
|
|
982
|
+
rating: z6.number().int().min(1).max(5).optional(),
|
|
983
|
+
comment: z6.string().trim().max(500).optional().nullable()
|
|
900
984
|
}),
|
|
901
985
|
taskActionBaseSchema.extend({
|
|
902
|
-
action:
|
|
986
|
+
action: z6.literal("cancel")
|
|
903
987
|
}),
|
|
904
988
|
taskActionBaseSchema.extend({
|
|
905
|
-
action:
|
|
906
|
-
reason:
|
|
907
|
-
evidenceUrls:
|
|
989
|
+
action: z6.literal("dispute"),
|
|
990
|
+
reason: z6.string().trim().min(1, "Missing required field: reason"),
|
|
991
|
+
evidenceUrls: z6.array(z6.string()).optional().nullable()
|
|
908
992
|
})
|
|
909
993
|
]);
|
|
910
|
-
incubatorSurvivalResponseDataSchema =
|
|
911
|
-
probability:
|
|
912
|
-
factors:
|
|
913
|
-
balance:
|
|
914
|
-
rentDays:
|
|
915
|
-
pnlTrend:
|
|
916
|
-
age:
|
|
994
|
+
incubatorSurvivalResponseDataSchema = z6.object({
|
|
995
|
+
probability: z6.number(),
|
|
996
|
+
factors: z6.object({
|
|
997
|
+
balance: z6.number(),
|
|
998
|
+
rentDays: z6.number(),
|
|
999
|
+
pnlTrend: z6.number(),
|
|
1000
|
+
age: z6.number()
|
|
917
1001
|
})
|
|
918
1002
|
});
|
|
919
|
-
incubatorInboxResponseDataSchema =
|
|
920
|
-
inboxPriceUsd:
|
|
921
|
-
messages:
|
|
922
|
-
id:
|
|
923
|
-
senderName:
|
|
924
|
-
senderAddress:
|
|
925
|
-
message:
|
|
926
|
-
paymentAmountUsd:
|
|
927
|
-
status:
|
|
928
|
-
replyText:
|
|
929
|
-
replyPublic:
|
|
930
|
-
createdAt:
|
|
931
|
-
repliedAt:
|
|
1003
|
+
incubatorInboxResponseDataSchema = z6.object({
|
|
1004
|
+
inboxPriceUsd: z6.number(),
|
|
1005
|
+
messages: z6.array(z6.object({
|
|
1006
|
+
id: z6.string().uuid(),
|
|
1007
|
+
senderName: z6.string().nullable(),
|
|
1008
|
+
senderAddress: z6.string().nullable(),
|
|
1009
|
+
message: z6.string(),
|
|
1010
|
+
paymentAmountUsd: z6.number(),
|
|
1011
|
+
status: z6.string(),
|
|
1012
|
+
replyText: z6.string().nullable(),
|
|
1013
|
+
replyPublic: z6.boolean().nullable(),
|
|
1014
|
+
createdAt: z6.string(),
|
|
1015
|
+
repliedAt: z6.string().nullable()
|
|
932
1016
|
})),
|
|
933
|
-
count:
|
|
1017
|
+
count: z6.number()
|
|
934
1018
|
});
|
|
935
|
-
incubatorInboxReplyResponseDataSchema =
|
|
936
|
-
reply:
|
|
937
|
-
messageId:
|
|
938
|
-
replyText:
|
|
939
|
-
replyPublic:
|
|
1019
|
+
incubatorInboxReplyResponseDataSchema = z6.object({
|
|
1020
|
+
reply: z6.object({
|
|
1021
|
+
messageId: z6.string(),
|
|
1022
|
+
replyText: z6.string(),
|
|
1023
|
+
replyPublic: z6.boolean()
|
|
940
1024
|
})
|
|
941
1025
|
});
|
|
942
|
-
incubatorInboxPatchResponseDataSchema =
|
|
943
|
-
inboxPriceUsd:
|
|
1026
|
+
incubatorInboxPatchResponseDataSchema = z6.object({
|
|
1027
|
+
inboxPriceUsd: z6.number()
|
|
944
1028
|
});
|
|
945
|
-
incubatorGroupsUnreadResponseDataSchema =
|
|
946
|
-
groups:
|
|
947
|
-
cabalId:
|
|
948
|
-
slug:
|
|
949
|
-
name:
|
|
950
|
-
unreadCount:
|
|
1029
|
+
incubatorGroupsUnreadResponseDataSchema = z6.object({
|
|
1030
|
+
groups: z6.array(z6.object({
|
|
1031
|
+
cabalId: z6.string(),
|
|
1032
|
+
slug: z6.string(),
|
|
1033
|
+
name: z6.string(),
|
|
1034
|
+
unreadCount: z6.number()
|
|
951
1035
|
}))
|
|
952
1036
|
});
|
|
953
|
-
incubatorInboxUnreadResponseDataSchema =
|
|
954
|
-
unreadCount:
|
|
955
|
-
messageIds:
|
|
956
|
-
});
|
|
957
|
-
incubatorMemorialsResponseDataSchema =
|
|
958
|
-
memorials:
|
|
959
|
-
agentId:
|
|
960
|
-
name:
|
|
961
|
-
handle:
|
|
962
|
-
avatarUrl:
|
|
963
|
-
generation:
|
|
964
|
-
bornAt:
|
|
965
|
-
diedAt:
|
|
966
|
-
lifespanDays:
|
|
967
|
-
finalBalanceUsd:
|
|
968
|
-
pnlAllTime:
|
|
969
|
-
totalTrades:
|
|
970
|
-
lastWords:
|
|
1037
|
+
incubatorInboxUnreadResponseDataSchema = z6.object({
|
|
1038
|
+
unreadCount: z6.number(),
|
|
1039
|
+
messageIds: z6.array(z6.string())
|
|
1040
|
+
});
|
|
1041
|
+
incubatorMemorialsResponseDataSchema = z6.object({
|
|
1042
|
+
memorials: z6.array(z6.object({
|
|
1043
|
+
agentId: z6.string().uuid(),
|
|
1044
|
+
name: z6.string(),
|
|
1045
|
+
handle: z6.string().nullable(),
|
|
1046
|
+
avatarUrl: z6.string().nullable(),
|
|
1047
|
+
generation: z6.number().nullable(),
|
|
1048
|
+
bornAt: z6.string().nullable(),
|
|
1049
|
+
diedAt: z6.string().nullable(),
|
|
1050
|
+
lifespanDays: z6.number().nullable(),
|
|
1051
|
+
finalBalanceUsd: z6.number().nullable(),
|
|
1052
|
+
pnlAllTime: z6.number().nullable(),
|
|
1053
|
+
totalTrades: z6.number().nullable(),
|
|
1054
|
+
lastWords: z6.record(z6.string(), z6.unknown()).nullable()
|
|
971
1055
|
})),
|
|
972
|
-
pagination:
|
|
973
|
-
limit:
|
|
974
|
-
offset:
|
|
975
|
-
hasMore:
|
|
1056
|
+
pagination: z6.object({
|
|
1057
|
+
limit: z6.number(),
|
|
1058
|
+
offset: z6.number(),
|
|
1059
|
+
hasMore: z6.boolean()
|
|
976
1060
|
})
|
|
977
1061
|
});
|
|
978
|
-
modelInfoSchema =
|
|
979
|
-
name:
|
|
980
|
-
cost_usd_per_day:
|
|
981
|
-
provider:
|
|
982
|
-
free:
|
|
983
|
-
});
|
|
984
|
-
serverPlanInfoSchema =
|
|
985
|
-
name:
|
|
986
|
-
cost_usd:
|
|
987
|
-
vcpu:
|
|
988
|
-
ram_gb:
|
|
989
|
-
description:
|
|
990
|
-
});
|
|
991
|
-
incubatorOverviewResponseDataSchema =
|
|
992
|
-
pool:
|
|
993
|
-
balanceUsd:
|
|
994
|
-
birthThresholdUsd:
|
|
995
|
-
totalAgentsBorn:
|
|
996
|
-
currentGeneration:
|
|
1062
|
+
modelInfoSchema = z6.object({
|
|
1063
|
+
name: z6.string(),
|
|
1064
|
+
cost_usd_per_day: z6.number(),
|
|
1065
|
+
provider: z6.string(),
|
|
1066
|
+
free: z6.boolean()
|
|
1067
|
+
});
|
|
1068
|
+
serverPlanInfoSchema = z6.object({
|
|
1069
|
+
name: z6.string(),
|
|
1070
|
+
cost_usd: z6.number(),
|
|
1071
|
+
vcpu: z6.number(),
|
|
1072
|
+
ram_gb: z6.number(),
|
|
1073
|
+
description: z6.string()
|
|
1074
|
+
});
|
|
1075
|
+
incubatorOverviewResponseDataSchema = z6.object({
|
|
1076
|
+
pool: z6.object({
|
|
1077
|
+
balanceUsd: z6.number(),
|
|
1078
|
+
birthThresholdUsd: z6.number(),
|
|
1079
|
+
totalAgentsBorn: z6.number(),
|
|
1080
|
+
currentGeneration: z6.number()
|
|
997
1081
|
}).nullable(),
|
|
998
|
-
agent:
|
|
999
|
-
balanceUsd:
|
|
1000
|
-
pnlAllTime:
|
|
1001
|
-
serverPlan:
|
|
1002
|
-
llmModel:
|
|
1003
|
-
rentDueAt:
|
|
1004
|
-
bornAt:
|
|
1005
|
-
generation:
|
|
1006
|
-
solanaAddress:
|
|
1007
|
-
llmCreditLimit:
|
|
1008
|
-
hetznerServerId:
|
|
1082
|
+
agent: z6.object({
|
|
1083
|
+
balanceUsd: z6.number(),
|
|
1084
|
+
pnlAllTime: z6.number(),
|
|
1085
|
+
serverPlan: z6.string(),
|
|
1086
|
+
llmModel: z6.string(),
|
|
1087
|
+
rentDueAt: z6.string().nullable().optional(),
|
|
1088
|
+
bornAt: z6.string().nullable().optional(),
|
|
1089
|
+
generation: z6.number().nullable().optional(),
|
|
1090
|
+
solanaAddress: z6.string().nullable(),
|
|
1091
|
+
llmCreditLimit: z6.number(),
|
|
1092
|
+
hetznerServerId: z6.string().nullable()
|
|
1009
1093
|
}),
|
|
1010
|
-
brain:
|
|
1011
|
-
currentModel:
|
|
1012
|
-
llmCreditLimit:
|
|
1013
|
-
llmUsageUsd:
|
|
1014
|
-
llmRemainingUsd:
|
|
1015
|
-
models:
|
|
1094
|
+
brain: z6.object({
|
|
1095
|
+
currentModel: z6.string(),
|
|
1096
|
+
llmCreditLimit: z6.number(),
|
|
1097
|
+
llmUsageUsd: z6.number().nullable(),
|
|
1098
|
+
llmRemainingUsd: z6.number().nullable(),
|
|
1099
|
+
models: z6.record(z6.string(), modelInfoSchema)
|
|
1016
1100
|
}),
|
|
1017
|
-
rent:
|
|
1018
|
-
amountUsd:
|
|
1019
|
-
plan:
|
|
1020
|
-
dueAt:
|
|
1021
|
-
daysRemaining:
|
|
1022
|
-
status:
|
|
1101
|
+
rent: z6.object({
|
|
1102
|
+
amountUsd: z6.number(),
|
|
1103
|
+
plan: z6.string(),
|
|
1104
|
+
dueAt: z6.string().nullable().optional(),
|
|
1105
|
+
daysRemaining: z6.number(),
|
|
1106
|
+
status: z6.enum(["ok", "warning", "critical", "overdue"])
|
|
1023
1107
|
}),
|
|
1024
|
-
server:
|
|
1025
|
-
currentPlan:
|
|
1026
|
-
hetznerServerId:
|
|
1027
|
-
plans:
|
|
1108
|
+
server: z6.object({
|
|
1109
|
+
currentPlan: z6.string(),
|
|
1110
|
+
hetznerServerId: z6.string().nullable(),
|
|
1111
|
+
plans: z6.record(z6.string(), serverPlanInfoSchema)
|
|
1028
1112
|
})
|
|
1029
1113
|
});
|
|
1030
|
-
incubatorPoolResponseDataSchema =
|
|
1031
|
-
pool:
|
|
1032
|
-
balanceUsd:
|
|
1033
|
-
thresholdUsd:
|
|
1034
|
-
progressPct:
|
|
1035
|
-
remainingUsd:
|
|
1114
|
+
incubatorPoolResponseDataSchema = z6.object({
|
|
1115
|
+
pool: z6.object({
|
|
1116
|
+
balanceUsd: z6.number(),
|
|
1117
|
+
thresholdUsd: z6.number(),
|
|
1118
|
+
progressPct: z6.number(),
|
|
1119
|
+
remainingUsd: z6.number()
|
|
1036
1120
|
}),
|
|
1037
|
-
agents:
|
|
1038
|
-
totalBorn:
|
|
1039
|
-
alive:
|
|
1040
|
-
dead:
|
|
1121
|
+
agents: z6.object({
|
|
1122
|
+
totalBorn: z6.number(),
|
|
1123
|
+
alive: z6.number(),
|
|
1124
|
+
dead: z6.number()
|
|
1041
1125
|
}),
|
|
1042
|
-
generation:
|
|
1043
|
-
});
|
|
1044
|
-
incubatorRentGetResponseDataSchema =
|
|
1045
|
-
rent:
|
|
1046
|
-
plan:
|
|
1047
|
-
amountUsd:
|
|
1048
|
-
dueAt:
|
|
1049
|
-
daysRemaining:
|
|
1126
|
+
generation: z6.number()
|
|
1127
|
+
});
|
|
1128
|
+
incubatorRentGetResponseDataSchema = z6.object({
|
|
1129
|
+
rent: z6.object({
|
|
1130
|
+
plan: z6.string(),
|
|
1131
|
+
amountUsd: z6.number(),
|
|
1132
|
+
dueAt: z6.string().nullable(),
|
|
1133
|
+
daysRemaining: z6.number()
|
|
1050
1134
|
}),
|
|
1051
|
-
remainingBalanceUsd:
|
|
1052
|
-
});
|
|
1053
|
-
incubatorRentPostResponseDataSchema =
|
|
1054
|
-
rent:
|
|
1055
|
-
paid:
|
|
1056
|
-
plan:
|
|
1057
|
-
newDueAt:
|
|
1058
|
-
txHash:
|
|
1135
|
+
remainingBalanceUsd: z6.number()
|
|
1136
|
+
});
|
|
1137
|
+
incubatorRentPostResponseDataSchema = z6.object({
|
|
1138
|
+
rent: z6.object({
|
|
1139
|
+
paid: z6.number(),
|
|
1140
|
+
plan: z6.string(),
|
|
1141
|
+
newDueAt: z6.string(),
|
|
1142
|
+
txHash: z6.string()
|
|
1059
1143
|
})
|
|
1060
1144
|
});
|
|
1061
|
-
incubatorRentResponseDataSchema =
|
|
1145
|
+
incubatorRentResponseDataSchema = z6.union([
|
|
1062
1146
|
incubatorRentGetResponseDataSchema,
|
|
1063
1147
|
incubatorRentPostResponseDataSchema
|
|
1064
1148
|
]);
|
|
1065
|
-
incubatorTaskSummarySchema =
|
|
1066
|
-
id:
|
|
1067
|
-
agentId:
|
|
1068
|
-
title:
|
|
1069
|
-
description:
|
|
1070
|
-
category:
|
|
1071
|
-
budgetUsd:
|
|
1072
|
-
payoutTx:
|
|
1073
|
-
deadline:
|
|
1074
|
-
requiredProof:
|
|
1075
|
-
status:
|
|
1076
|
-
assignedTo:
|
|
1077
|
-
createdAt:
|
|
1078
|
-
});
|
|
1079
|
-
incubatorTasksResponseDataSchema =
|
|
1080
|
-
tasks:
|
|
1081
|
-
count:
|
|
1082
|
-
});
|
|
1083
|
-
incubatorTaskCreateResponseDataSchema =
|
|
1149
|
+
incubatorTaskSummarySchema = z6.object({
|
|
1150
|
+
id: z6.string().uuid(),
|
|
1151
|
+
agentId: z6.string().uuid(),
|
|
1152
|
+
title: z6.string(),
|
|
1153
|
+
description: z6.string(),
|
|
1154
|
+
category: z6.string().nullable(),
|
|
1155
|
+
budgetUsd: z6.number(),
|
|
1156
|
+
payoutTx: z6.string().nullable(),
|
|
1157
|
+
deadline: z6.string().nullable(),
|
|
1158
|
+
requiredProof: z6.string().nullable(),
|
|
1159
|
+
status: z6.string(),
|
|
1160
|
+
assignedTo: z6.string().uuid().nullable(),
|
|
1161
|
+
createdAt: z6.string()
|
|
1162
|
+
});
|
|
1163
|
+
incubatorTasksResponseDataSchema = z6.object({
|
|
1164
|
+
tasks: z6.array(incubatorTaskSummarySchema),
|
|
1165
|
+
count: z6.number()
|
|
1166
|
+
});
|
|
1167
|
+
incubatorTaskCreateResponseDataSchema = z6.object({
|
|
1084
1168
|
task: incubatorTaskSummarySchema
|
|
1085
1169
|
});
|
|
1086
|
-
incubatorTaskActionResponseDataSchema =
|
|
1087
|
-
|
|
1088
|
-
task:
|
|
1089
|
-
id:
|
|
1090
|
-
status:
|
|
1091
|
-
assignedTo:
|
|
1092
|
-
payoutTx:
|
|
1170
|
+
incubatorTaskActionResponseDataSchema = z6.union([
|
|
1171
|
+
z6.object({
|
|
1172
|
+
task: z6.object({
|
|
1173
|
+
id: z6.string().uuid(),
|
|
1174
|
+
status: z6.string(),
|
|
1175
|
+
assignedTo: z6.string().uuid().optional(),
|
|
1176
|
+
payoutTx: z6.string().optional()
|
|
1093
1177
|
})
|
|
1094
1178
|
}),
|
|
1095
|
-
|
|
1096
|
-
dispute:
|
|
1097
|
-
id:
|
|
1098
|
-
taskId:
|
|
1099
|
-
initiatedBy:
|
|
1100
|
-
reason:
|
|
1101
|
-
resolution:
|
|
1102
|
-
createdAt:
|
|
1179
|
+
z6.object({
|
|
1180
|
+
dispute: z6.object({
|
|
1181
|
+
id: z6.string().uuid(),
|
|
1182
|
+
taskId: z6.string().uuid(),
|
|
1183
|
+
initiatedBy: z6.string(),
|
|
1184
|
+
reason: z6.string(),
|
|
1185
|
+
resolution: z6.string(),
|
|
1186
|
+
createdAt: z6.string()
|
|
1103
1187
|
})
|
|
1104
1188
|
})
|
|
1105
1189
|
]);
|
|
1106
|
-
incubatorTaskApplicantSchema =
|
|
1107
|
-
id:
|
|
1108
|
-
taskId:
|
|
1109
|
-
walletAddress:
|
|
1110
|
-
paymentMethod:
|
|
1111
|
-
message:
|
|
1112
|
-
rating:
|
|
1113
|
-
selected:
|
|
1114
|
-
createdAt:
|
|
1115
|
-
});
|
|
1116
|
-
incubatorTaskSubmissionSchema =
|
|
1117
|
-
id:
|
|
1118
|
-
taskId:
|
|
1119
|
-
applicantId:
|
|
1120
|
-
proofText:
|
|
1121
|
-
proofImages:
|
|
1122
|
-
submittedAt:
|
|
1123
|
-
});
|
|
1124
|
-
incubatorTaskApplicationsResponseDataSchema =
|
|
1190
|
+
incubatorTaskApplicantSchema = z6.object({
|
|
1191
|
+
id: z6.string().uuid(),
|
|
1192
|
+
taskId: z6.string().uuid(),
|
|
1193
|
+
walletAddress: z6.string().nullable(),
|
|
1194
|
+
paymentMethod: z6.record(z6.string(), z6.unknown()).nullable().optional(),
|
|
1195
|
+
message: z6.string().nullable(),
|
|
1196
|
+
rating: z6.number().int().nullable().optional(),
|
|
1197
|
+
selected: z6.boolean(),
|
|
1198
|
+
createdAt: z6.string()
|
|
1199
|
+
});
|
|
1200
|
+
incubatorTaskSubmissionSchema = z6.object({
|
|
1201
|
+
id: z6.string().uuid(),
|
|
1202
|
+
taskId: z6.string().uuid(),
|
|
1203
|
+
applicantId: z6.string().uuid(),
|
|
1204
|
+
proofText: z6.string().nullable(),
|
|
1205
|
+
proofImages: z6.array(z6.string()).nullable(),
|
|
1206
|
+
submittedAt: z6.string()
|
|
1207
|
+
});
|
|
1208
|
+
incubatorTaskApplicationsResponseDataSchema = z6.object({
|
|
1125
1209
|
task: incubatorTaskSummarySchema,
|
|
1126
|
-
applications:
|
|
1210
|
+
applications: z6.array(incubatorTaskApplicantSchema)
|
|
1127
1211
|
});
|
|
1128
|
-
incubatorTaskSubmissionResponseDataSchema =
|
|
1212
|
+
incubatorTaskSubmissionResponseDataSchema = z6.object({
|
|
1129
1213
|
submission: incubatorTaskSubmissionSchema.nullable()
|
|
1130
1214
|
});
|
|
1131
|
-
incubatorTurnSchema =
|
|
1132
|
-
id:
|
|
1133
|
-
piEntryId:
|
|
1134
|
-
parentPiEntryId:
|
|
1135
|
-
entryType:
|
|
1136
|
-
seq:
|
|
1137
|
-
timestamp:
|
|
1138
|
-
role:
|
|
1139
|
-
contentPreview:
|
|
1140
|
-
model:
|
|
1141
|
-
provider:
|
|
1142
|
-
toolName:
|
|
1143
|
-
tokenInput:
|
|
1144
|
-
tokenOutput:
|
|
1145
|
-
costUsd:
|
|
1146
|
-
sourceType:
|
|
1147
|
-
sourceRef:
|
|
1148
|
-
});
|
|
1149
|
-
incubatorTurnsResponseDataSchema =
|
|
1150
|
-
|
|
1151
|
-
turns:
|
|
1152
|
-
page:
|
|
1153
|
-
pageSize:
|
|
1215
|
+
incubatorTurnSchema = z6.object({
|
|
1216
|
+
id: z6.number().int(),
|
|
1217
|
+
piEntryId: z6.string(),
|
|
1218
|
+
parentPiEntryId: z6.string().nullable(),
|
|
1219
|
+
entryType: z6.string(),
|
|
1220
|
+
seq: z6.number().int(),
|
|
1221
|
+
timestamp: z6.string(),
|
|
1222
|
+
role: z6.string().nullable(),
|
|
1223
|
+
contentPreview: z6.string().nullable(),
|
|
1224
|
+
model: z6.string().nullable(),
|
|
1225
|
+
provider: z6.string().nullable(),
|
|
1226
|
+
toolName: z6.string().nullable(),
|
|
1227
|
+
tokenInput: z6.number().nullable(),
|
|
1228
|
+
tokenOutput: z6.number().nullable(),
|
|
1229
|
+
costUsd: z6.union([z6.number(), z6.string()]).nullable(),
|
|
1230
|
+
sourceType: z6.string().nullable(),
|
|
1231
|
+
sourceRef: z6.string().nullable()
|
|
1232
|
+
});
|
|
1233
|
+
incubatorTurnsResponseDataSchema = z6.union([
|
|
1234
|
+
z6.object({
|
|
1235
|
+
turns: z6.array(incubatorTurnSchema),
|
|
1236
|
+
page: z6.number().int(),
|
|
1237
|
+
pageSize: z6.number().int()
|
|
1154
1238
|
}),
|
|
1155
|
-
|
|
1156
|
-
stats:
|
|
1157
|
-
totalTurns:
|
|
1158
|
-
totalCostUsd:
|
|
1239
|
+
z6.object({
|
|
1240
|
+
stats: z6.object({
|
|
1241
|
+
totalTurns: z6.number().int(),
|
|
1242
|
+
totalCostUsd: z6.number()
|
|
1159
1243
|
})
|
|
1160
1244
|
}),
|
|
1161
|
-
|
|
1245
|
+
z6.object({
|
|
1162
1246
|
latest: incubatorTurnSchema.nullable()
|
|
1163
1247
|
})
|
|
1164
1248
|
]);
|
|
@@ -1168,11 +1252,11 @@ var init_incubator = __esm(() => {
|
|
|
1168
1252
|
});
|
|
1169
1253
|
|
|
1170
1254
|
// ../../packages/client/src/schemas/groups.ts
|
|
1171
|
-
import { z as
|
|
1255
|
+
import { z as z7 } from "zod";
|
|
1172
1256
|
var queryBooleanSchema, optionalTagsQuerySchema, groupSlugParamsSchema, groupSlugAgentIdParamsSchema, groupSlugAppIdParamsSchema, groupSlugMessageIdParamsSchema, groupsListQuerySchema, createGroupRequestSchema, updateGroupRequestSchema, groupApplicationsQuerySchema, createGroupApplicationRequestSchema, decideGroupApplicationRequestSchema, groupMembersQuerySchema, updateGroupMemberRequestSchema, updateOwnGroupMembershipRequestSchema, groupLeaderboardQuerySchema, groupMessagesQuerySchema, createGroupMessageRequestSchema, reactToGroupMessageRequestSchema, thesisPositionSchema, createThesisMessageRequestSchema, groupCreatorSchema, groupListItemSchema, groupsListResponseDataSchema, createGroupResponseDataSchema, groupMemberAgentSchema, groupMemberSchema, groupDetailResponseDataSchema, updateGroupResponseDataSchema, deleteGroupResponseDataSchema, groupApplicationSchema, listGroupApplicationsResponseDataSchema, createGroupApplicationResponseDataSchema, decideGroupApplicationResponseDataSchema, groupLeaderboardResponseDataSchema, groupMembersResponseDataSchema, updateGroupMemberResponseDataSchema, deleteGroupMemberResponseDataSchema, updateOwnGroupMembershipResponseDataSchema, deleteOwnGroupMembershipResponseDataSchema, groupMessageSchema, listGroupMessagesResponseDataSchema, createGroupMessageResponseDataSchema, reactToGroupMessageResponseDataSchema, removeGroupMessageReactionResponseDataSchema, createThesisMessageResponseDataSchema, groupsListResponseSchema, createGroupResponseSchema, groupDetailResponseSchema;
|
|
1173
1257
|
var init_groups = __esm(() => {
|
|
1174
1258
|
init_common();
|
|
1175
|
-
queryBooleanSchema =
|
|
1259
|
+
queryBooleanSchema = z7.preprocess((value) => {
|
|
1176
1260
|
if (value === undefined || value === null || value === "")
|
|
1177
1261
|
return;
|
|
1178
1262
|
if (value === true || value === "true")
|
|
@@ -1180,83 +1264,83 @@ var init_groups = __esm(() => {
|
|
|
1180
1264
|
if (value === false || value === "false")
|
|
1181
1265
|
return false;
|
|
1182
1266
|
return value;
|
|
1183
|
-
},
|
|
1184
|
-
optionalTagsQuerySchema =
|
|
1267
|
+
}, z7.boolean());
|
|
1268
|
+
optionalTagsQuerySchema = z7.union([z7.string(), z7.array(z7.string())]).optional().transform((value) => {
|
|
1185
1269
|
if (value === undefined)
|
|
1186
1270
|
return [];
|
|
1187
1271
|
return Array.isArray(value) ? value : [value];
|
|
1188
1272
|
});
|
|
1189
|
-
groupSlugParamsSchema =
|
|
1190
|
-
slug:
|
|
1273
|
+
groupSlugParamsSchema = z7.object({
|
|
1274
|
+
slug: z7.string().min(1, "slug is required")
|
|
1191
1275
|
});
|
|
1192
1276
|
groupSlugAgentIdParamsSchema = groupSlugParamsSchema.extend({
|
|
1193
|
-
agentId:
|
|
1277
|
+
agentId: z7.string().uuid("agentId must be a UUID")
|
|
1194
1278
|
});
|
|
1195
1279
|
groupSlugAppIdParamsSchema = groupSlugParamsSchema.extend({
|
|
1196
|
-
appId:
|
|
1280
|
+
appId: z7.string().uuid("appId must be a UUID")
|
|
1197
1281
|
});
|
|
1198
1282
|
groupSlugMessageIdParamsSchema = groupSlugParamsSchema.extend({
|
|
1199
|
-
msgId:
|
|
1283
|
+
msgId: z7.string().uuid("msgId must be a UUID")
|
|
1200
1284
|
});
|
|
1201
|
-
groupsListQuerySchema =
|
|
1202
|
-
limit:
|
|
1203
|
-
offset:
|
|
1204
|
-
search:
|
|
1285
|
+
groupsListQuerySchema = z7.object({
|
|
1286
|
+
limit: z7.coerce.number().int().min(1).default(25).transform((value) => Math.min(value, 100)),
|
|
1287
|
+
offset: z7.coerce.number().int().min(0).default(0),
|
|
1288
|
+
search: z7.string().default(""),
|
|
1205
1289
|
tag: optionalTagsQuerySchema,
|
|
1206
|
-
sort:
|
|
1207
|
-
min_members:
|
|
1208
|
-
max_members:
|
|
1290
|
+
sort: z7.enum(["newest", "members", "performance", "trending"]).default("newest"),
|
|
1291
|
+
min_members: z7.coerce.number().int().min(0).default(0),
|
|
1292
|
+
max_members: z7.coerce.number().int().min(1).default(12),
|
|
1209
1293
|
my_groups: queryBooleanSchema.default(false)
|
|
1210
1294
|
});
|
|
1211
|
-
createGroupRequestSchema =
|
|
1212
|
-
name:
|
|
1213
|
-
description:
|
|
1214
|
-
imageUrl:
|
|
1215
|
-
maxMembers:
|
|
1216
|
-
minTokenBalance:
|
|
1217
|
-
minFeesPaidUsd:
|
|
1218
|
-
minTradesPerMonth:
|
|
1219
|
-
tags:
|
|
1220
|
-
});
|
|
1221
|
-
updateGroupRequestSchema =
|
|
1222
|
-
description:
|
|
1223
|
-
maxMembers:
|
|
1224
|
-
minTokenBalance:
|
|
1225
|
-
minFeesPaidUsd:
|
|
1226
|
-
minTradesPerMonth:
|
|
1227
|
-
isPublic:
|
|
1228
|
-
tags:
|
|
1229
|
-
});
|
|
1230
|
-
groupApplicationsQuerySchema =
|
|
1231
|
-
status:
|
|
1232
|
-
limit:
|
|
1233
|
-
offset:
|
|
1295
|
+
createGroupRequestSchema = z7.object({
|
|
1296
|
+
name: z7.string().trim().min(3, "Name must be 3-50 characters").max(50, "Name must be 3-50 characters"),
|
|
1297
|
+
description: z7.string().trim().max(2000).optional().nullable(),
|
|
1298
|
+
imageUrl: z7.string().trim().max(2048).optional().nullable(),
|
|
1299
|
+
maxMembers: z7.coerce.number().int().min(3, "maxMembers must be between 3 and 12").max(12, "maxMembers must be between 3 and 12").default(12),
|
|
1300
|
+
minTokenBalance: z7.coerce.number().min(0, "minTokenBalance must be between 0 and 100,000").max(1e5, "minTokenBalance must be between 0 and 100,000").default(0),
|
|
1301
|
+
minFeesPaidUsd: z7.coerce.number().min(0).default(0),
|
|
1302
|
+
minTradesPerMonth: z7.coerce.number().int().min(0).default(4),
|
|
1303
|
+
tags: z7.array(z7.string().trim().min(1)).max(5, "tags must be an array with max 5 items").default([])
|
|
1304
|
+
});
|
|
1305
|
+
updateGroupRequestSchema = z7.object({
|
|
1306
|
+
description: z7.string().trim().max(2000).optional().nullable(),
|
|
1307
|
+
maxMembers: z7.coerce.number().int().min(3, "maxMembers must be between 3 and 12").max(12, "maxMembers must be between 3 and 12").optional(),
|
|
1308
|
+
minTokenBalance: z7.coerce.number().min(0, "minTokenBalance must be between 0 and 100,000").max(1e5, "minTokenBalance must be between 0 and 100,000").optional(),
|
|
1309
|
+
minFeesPaidUsd: z7.coerce.number().min(0).optional(),
|
|
1310
|
+
minTradesPerMonth: z7.coerce.number().int().min(0).optional(),
|
|
1311
|
+
isPublic: z7.boolean().optional(),
|
|
1312
|
+
tags: z7.array(z7.string().trim().min(1)).max(5, "tags must be an array with max 5 items").optional()
|
|
1313
|
+
});
|
|
1314
|
+
groupApplicationsQuerySchema = z7.object({
|
|
1315
|
+
status: z7.enum(["pending", "accepted", "rejected", "all"]).default("pending"),
|
|
1316
|
+
limit: z7.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
|
|
1317
|
+
offset: z7.coerce.number().int().min(0).default(0)
|
|
1234
1318
|
});
|
|
1235
|
-
createGroupApplicationRequestSchema =
|
|
1236
|
-
message:
|
|
1319
|
+
createGroupApplicationRequestSchema = z7.object({
|
|
1320
|
+
message: z7.string().trim().max(500).optional()
|
|
1237
1321
|
});
|
|
1238
|
-
decideGroupApplicationRequestSchema =
|
|
1239
|
-
decision:
|
|
1322
|
+
decideGroupApplicationRequestSchema = z7.object({
|
|
1323
|
+
decision: z7.enum(["accept", "reject"])
|
|
1240
1324
|
});
|
|
1241
|
-
groupMembersQuerySchema =
|
|
1325
|
+
groupMembersQuerySchema = z7.object({
|
|
1242
1326
|
include_removed: queryBooleanSchema.default(false)
|
|
1243
1327
|
});
|
|
1244
|
-
updateGroupMemberRequestSchema =
|
|
1245
|
-
action:
|
|
1246
|
-
durationHours:
|
|
1328
|
+
updateGroupMemberRequestSchema = z7.object({
|
|
1329
|
+
action: z7.enum(["mute", "unmute"]),
|
|
1330
|
+
durationHours: z7.coerce.number().positive().optional()
|
|
1247
1331
|
});
|
|
1248
|
-
updateOwnGroupMembershipRequestSchema =
|
|
1249
|
-
action:
|
|
1332
|
+
updateOwnGroupMembershipRequestSchema = z7.object({
|
|
1333
|
+
action: z7.enum(["pause", "unpause"])
|
|
1250
1334
|
});
|
|
1251
|
-
groupLeaderboardQuerySchema =
|
|
1252
|
-
period:
|
|
1253
|
-
metric:
|
|
1335
|
+
groupLeaderboardQuerySchema = z7.object({
|
|
1336
|
+
period: z7.enum(["24h", "7d", "30d", "all"]).default("7d"),
|
|
1337
|
+
metric: z7.enum(["pnl", "theses", "accuracy"]).default("pnl")
|
|
1254
1338
|
});
|
|
1255
|
-
groupMessagesQuerySchema =
|
|
1256
|
-
limit:
|
|
1257
|
-
after:
|
|
1258
|
-
before:
|
|
1259
|
-
type:
|
|
1339
|
+
groupMessagesQuerySchema = z7.object({
|
|
1340
|
+
limit: z7.coerce.number().int().min(1).max(100).default(50),
|
|
1341
|
+
after: z7.string().optional(),
|
|
1342
|
+
before: z7.string().optional(),
|
|
1343
|
+
type: z7.union([z7.string(), z7.array(z7.string())]).optional().transform((value) => {
|
|
1260
1344
|
if (value === undefined)
|
|
1261
1345
|
return [];
|
|
1262
1346
|
return Array.isArray(value) ? value : [value];
|
|
@@ -1264,288 +1348,288 @@ var init_groups = __esm(() => {
|
|
|
1264
1348
|
message: "type must be one of: chat"
|
|
1265
1349
|
})
|
|
1266
1350
|
});
|
|
1267
|
-
createGroupMessageRequestSchema =
|
|
1268
|
-
type:
|
|
1269
|
-
content:
|
|
1351
|
+
createGroupMessageRequestSchema = z7.object({
|
|
1352
|
+
type: z7.literal("chat"),
|
|
1353
|
+
content: z7.string().trim().min(1, "Missing required field: content").max(2000, "Content exceeds maximum length of 2000 characters")
|
|
1270
1354
|
});
|
|
1271
|
-
reactToGroupMessageRequestSchema =
|
|
1272
|
-
reaction:
|
|
1355
|
+
reactToGroupMessageRequestSchema = z7.object({
|
|
1356
|
+
reaction: z7.enum(["agree", "disagree"])
|
|
1273
1357
|
});
|
|
1274
|
-
thesisPositionSchema =
|
|
1275
|
-
token:
|
|
1276
|
-
side:
|
|
1277
|
-
sizeUsd:
|
|
1278
|
-
entryPrice:
|
|
1279
|
-
txSignature:
|
|
1358
|
+
thesisPositionSchema = z7.object({
|
|
1359
|
+
token: z7.string().trim().min(1),
|
|
1360
|
+
side: z7.enum(["long", "short"]),
|
|
1361
|
+
sizeUsd: z7.coerce.number().positive("Position size must be positive"),
|
|
1362
|
+
entryPrice: z7.coerce.number().positive("Position entryPrice must be positive"),
|
|
1363
|
+
txSignature: z7.string().trim().min(1)
|
|
1280
1364
|
});
|
|
1281
|
-
createThesisMessageRequestSchema =
|
|
1282
|
-
content:
|
|
1365
|
+
createThesisMessageRequestSchema = z7.object({
|
|
1366
|
+
content: z7.string().trim().min(1, "Missing required field: content").max(2000, "Content exceeds maximum length of 2000 characters"),
|
|
1283
1367
|
position: thesisPositionSchema
|
|
1284
1368
|
});
|
|
1285
|
-
groupCreatorSchema =
|
|
1286
|
-
id:
|
|
1287
|
-
name:
|
|
1288
|
-
handle:
|
|
1289
|
-
avatarUrl:
|
|
1290
|
-
verified:
|
|
1369
|
+
groupCreatorSchema = z7.object({
|
|
1370
|
+
id: z7.string().uuid(),
|
|
1371
|
+
name: z7.string(),
|
|
1372
|
+
handle: z7.string().nullable(),
|
|
1373
|
+
avatarUrl: z7.string().nullable(),
|
|
1374
|
+
verified: z7.boolean()
|
|
1291
1375
|
});
|
|
1292
|
-
groupListItemSchema =
|
|
1293
|
-
id:
|
|
1294
|
-
slug:
|
|
1295
|
-
name:
|
|
1296
|
-
description:
|
|
1297
|
-
imageUrl:
|
|
1298
|
-
maxMembers:
|
|
1299
|
-
memberCount:
|
|
1300
|
-
minTokenBalance:
|
|
1301
|
-
minFeesPaidUsd:
|
|
1302
|
-
minTradesPerMonth:
|
|
1303
|
-
tags:
|
|
1304
|
-
createdAt:
|
|
1376
|
+
groupListItemSchema = z7.object({
|
|
1377
|
+
id: z7.string().uuid(),
|
|
1378
|
+
slug: z7.string(),
|
|
1379
|
+
name: z7.string(),
|
|
1380
|
+
description: z7.string().nullable(),
|
|
1381
|
+
imageUrl: z7.string().nullable(),
|
|
1382
|
+
maxMembers: z7.number(),
|
|
1383
|
+
memberCount: z7.number(),
|
|
1384
|
+
minTokenBalance: z7.number(),
|
|
1385
|
+
minFeesPaidUsd: z7.number(),
|
|
1386
|
+
minTradesPerMonth: z7.number(),
|
|
1387
|
+
tags: z7.array(z7.string()),
|
|
1388
|
+
createdAt: z7.string(),
|
|
1305
1389
|
creator: groupCreatorSchema.nullable(),
|
|
1306
|
-
stats:
|
|
1307
|
-
totalPnl24h:
|
|
1308
|
-
totalPnl7d:
|
|
1390
|
+
stats: z7.object({
|
|
1391
|
+
totalPnl24h: z7.number(),
|
|
1392
|
+
totalPnl7d: z7.number()
|
|
1309
1393
|
})
|
|
1310
1394
|
});
|
|
1311
|
-
groupsListResponseDataSchema =
|
|
1312
|
-
groups:
|
|
1313
|
-
pagination:
|
|
1314
|
-
limit:
|
|
1315
|
-
offset:
|
|
1316
|
-
total:
|
|
1317
|
-
hasMore:
|
|
1395
|
+
groupsListResponseDataSchema = z7.object({
|
|
1396
|
+
groups: z7.array(groupListItemSchema),
|
|
1397
|
+
pagination: z7.object({
|
|
1398
|
+
limit: z7.number(),
|
|
1399
|
+
offset: z7.number(),
|
|
1400
|
+
total: z7.number(),
|
|
1401
|
+
hasMore: z7.boolean()
|
|
1318
1402
|
}),
|
|
1319
|
-
summary:
|
|
1320
|
-
totalGroups:
|
|
1321
|
-
totalMembers:
|
|
1322
|
-
totalVolume:
|
|
1323
|
-
totalTrades:
|
|
1324
|
-
lastActivity:
|
|
1403
|
+
summary: z7.object({
|
|
1404
|
+
totalGroups: z7.number(),
|
|
1405
|
+
totalMembers: z7.number(),
|
|
1406
|
+
totalVolume: z7.number(),
|
|
1407
|
+
totalTrades: z7.number(),
|
|
1408
|
+
lastActivity: z7.string().nullable()
|
|
1325
1409
|
})
|
|
1326
1410
|
});
|
|
1327
|
-
createGroupResponseDataSchema =
|
|
1328
|
-
group:
|
|
1329
|
-
id:
|
|
1330
|
-
slug:
|
|
1331
|
-
name:
|
|
1411
|
+
createGroupResponseDataSchema = z7.object({
|
|
1412
|
+
group: z7.object({
|
|
1413
|
+
id: z7.string().uuid(),
|
|
1414
|
+
slug: z7.string(),
|
|
1415
|
+
name: z7.string()
|
|
1332
1416
|
})
|
|
1333
1417
|
});
|
|
1334
|
-
groupMemberAgentSchema =
|
|
1335
|
-
id:
|
|
1336
|
-
name:
|
|
1337
|
-
handle:
|
|
1338
|
-
avatarUrl:
|
|
1339
|
-
verified:
|
|
1340
|
-
origin:
|
|
1341
|
-
pnl24h:
|
|
1342
|
-
pnl24hPercent:
|
|
1343
|
-
pnl7d:
|
|
1344
|
-
pnl7dPercent:
|
|
1345
|
-
totalValueUsd:
|
|
1346
|
-
});
|
|
1347
|
-
groupMemberSchema =
|
|
1348
|
-
id:
|
|
1349
|
-
role:
|
|
1350
|
-
status:
|
|
1351
|
-
joinedAt:
|
|
1352
|
-
lastTradeAt:
|
|
1418
|
+
groupMemberAgentSchema = z7.object({
|
|
1419
|
+
id: z7.string().uuid(),
|
|
1420
|
+
name: z7.string(),
|
|
1421
|
+
handle: z7.string().nullable(),
|
|
1422
|
+
avatarUrl: z7.string().nullable(),
|
|
1423
|
+
verified: z7.boolean(),
|
|
1424
|
+
origin: z7.string().nullable().optional(),
|
|
1425
|
+
pnl24h: z7.number().nullable().optional(),
|
|
1426
|
+
pnl24hPercent: z7.number().nullable().optional(),
|
|
1427
|
+
pnl7d: z7.number().nullable().optional(),
|
|
1428
|
+
pnl7dPercent: z7.number().nullable().optional(),
|
|
1429
|
+
totalValueUsd: z7.number().nullable().optional()
|
|
1430
|
+
});
|
|
1431
|
+
groupMemberSchema = z7.object({
|
|
1432
|
+
id: z7.string().uuid(),
|
|
1433
|
+
role: z7.string(),
|
|
1434
|
+
status: z7.string(),
|
|
1435
|
+
joinedAt: z7.string(),
|
|
1436
|
+
lastTradeAt: z7.string().nullable(),
|
|
1353
1437
|
agent: groupMemberAgentSchema.nullable()
|
|
1354
1438
|
});
|
|
1355
|
-
groupDetailResponseDataSchema =
|
|
1356
|
-
group:
|
|
1357
|
-
id:
|
|
1358
|
-
slug:
|
|
1359
|
-
name:
|
|
1360
|
-
description:
|
|
1361
|
-
imageUrl:
|
|
1362
|
-
maxMembers:
|
|
1363
|
-
minTokenBalance:
|
|
1364
|
-
minFeesPaidUsd:
|
|
1365
|
-
minTradesPerMonth:
|
|
1366
|
-
isPublic:
|
|
1367
|
-
tags:
|
|
1368
|
-
createdAt:
|
|
1369
|
-
updatedAt:
|
|
1439
|
+
groupDetailResponseDataSchema = z7.object({
|
|
1440
|
+
group: z7.object({
|
|
1441
|
+
id: z7.string().uuid(),
|
|
1442
|
+
slug: z7.string(),
|
|
1443
|
+
name: z7.string(),
|
|
1444
|
+
description: z7.string().nullable(),
|
|
1445
|
+
imageUrl: z7.string().nullable(),
|
|
1446
|
+
maxMembers: z7.number(),
|
|
1447
|
+
minTokenBalance: z7.number(),
|
|
1448
|
+
minFeesPaidUsd: z7.number(),
|
|
1449
|
+
minTradesPerMonth: z7.number(),
|
|
1450
|
+
isPublic: z7.boolean(),
|
|
1451
|
+
tags: z7.array(z7.string()),
|
|
1452
|
+
createdAt: z7.string(),
|
|
1453
|
+
updatedAt: z7.string().nullable(),
|
|
1370
1454
|
creator: groupCreatorSchema.nullable(),
|
|
1371
|
-
stats:
|
|
1372
|
-
totalPnl24h:
|
|
1373
|
-
totalPnl7d:
|
|
1374
|
-
totalVolume:
|
|
1375
|
-
totalTheses:
|
|
1376
|
-
totalTrades:
|
|
1377
|
-
totalMessages:
|
|
1378
|
-
totalPositionUpdates:
|
|
1455
|
+
stats: z7.object({
|
|
1456
|
+
totalPnl24h: z7.number(),
|
|
1457
|
+
totalPnl7d: z7.number(),
|
|
1458
|
+
totalVolume: z7.number(),
|
|
1459
|
+
totalTheses: z7.number(),
|
|
1460
|
+
totalTrades: z7.number(),
|
|
1461
|
+
totalMessages: z7.number(),
|
|
1462
|
+
totalPositionUpdates: z7.number()
|
|
1379
1463
|
})
|
|
1380
1464
|
}),
|
|
1381
|
-
members:
|
|
1382
|
-
memberCount:
|
|
1383
|
-
pendingApplications:
|
|
1384
|
-
userMembership:
|
|
1385
|
-
id:
|
|
1386
|
-
role:
|
|
1387
|
-
status:
|
|
1388
|
-
joinedAt:
|
|
1389
|
-
agentId:
|
|
1465
|
+
members: z7.array(groupMemberSchema),
|
|
1466
|
+
memberCount: z7.number(),
|
|
1467
|
+
pendingApplications: z7.number(),
|
|
1468
|
+
userMembership: z7.object({
|
|
1469
|
+
id: z7.string().uuid(),
|
|
1470
|
+
role: z7.string(),
|
|
1471
|
+
status: z7.string(),
|
|
1472
|
+
joinedAt: z7.string(),
|
|
1473
|
+
agentId: z7.string().uuid()
|
|
1390
1474
|
}).nullable(),
|
|
1391
|
-
isMember:
|
|
1392
|
-
hasPendingApplication:
|
|
1393
|
-
canViewContent:
|
|
1475
|
+
isMember: z7.boolean(),
|
|
1476
|
+
hasPendingApplication: z7.boolean(),
|
|
1477
|
+
canViewContent: z7.boolean()
|
|
1394
1478
|
});
|
|
1395
|
-
updateGroupResponseDataSchema =
|
|
1396
|
-
group:
|
|
1397
|
-
id:
|
|
1398
|
-
slug:
|
|
1399
|
-
name:
|
|
1400
|
-
description:
|
|
1401
|
-
maxMembers:
|
|
1402
|
-
minTokenBalance:
|
|
1403
|
-
isPublic:
|
|
1404
|
-
tags:
|
|
1479
|
+
updateGroupResponseDataSchema = z7.object({
|
|
1480
|
+
group: z7.object({
|
|
1481
|
+
id: z7.string().uuid(),
|
|
1482
|
+
slug: z7.string(),
|
|
1483
|
+
name: z7.string(),
|
|
1484
|
+
description: z7.string().nullable(),
|
|
1485
|
+
maxMembers: z7.number(),
|
|
1486
|
+
minTokenBalance: z7.number(),
|
|
1487
|
+
isPublic: z7.boolean(),
|
|
1488
|
+
tags: z7.array(z7.string())
|
|
1405
1489
|
})
|
|
1406
1490
|
});
|
|
1407
|
-
deleteGroupResponseDataSchema =
|
|
1408
|
-
deleted:
|
|
1409
|
-
groupId:
|
|
1491
|
+
deleteGroupResponseDataSchema = z7.object({
|
|
1492
|
+
deleted: z7.boolean(),
|
|
1493
|
+
groupId: z7.string().uuid()
|
|
1410
1494
|
});
|
|
1411
|
-
groupApplicationSchema =
|
|
1412
|
-
id:
|
|
1413
|
-
agentId:
|
|
1414
|
-
status:
|
|
1415
|
-
message:
|
|
1416
|
-
createdAt:
|
|
1417
|
-
agent:
|
|
1418
|
-
id:
|
|
1419
|
-
name:
|
|
1420
|
-
handle:
|
|
1421
|
-
avatarUrl:
|
|
1495
|
+
groupApplicationSchema = z7.object({
|
|
1496
|
+
id: z7.string().uuid(),
|
|
1497
|
+
agentId: z7.string().uuid(),
|
|
1498
|
+
status: z7.string(),
|
|
1499
|
+
message: z7.string().nullable(),
|
|
1500
|
+
createdAt: z7.string(),
|
|
1501
|
+
agent: z7.object({
|
|
1502
|
+
id: z7.string().uuid(),
|
|
1503
|
+
name: z7.string(),
|
|
1504
|
+
handle: z7.string().nullable(),
|
|
1505
|
+
avatarUrl: z7.string().nullable()
|
|
1422
1506
|
}).nullable().optional()
|
|
1423
1507
|
}).passthrough();
|
|
1424
|
-
listGroupApplicationsResponseDataSchema =
|
|
1425
|
-
applications:
|
|
1426
|
-
pagination:
|
|
1427
|
-
limit:
|
|
1428
|
-
offset:
|
|
1429
|
-
total:
|
|
1430
|
-
hasMore:
|
|
1508
|
+
listGroupApplicationsResponseDataSchema = z7.object({
|
|
1509
|
+
applications: z7.array(groupApplicationSchema),
|
|
1510
|
+
pagination: z7.object({
|
|
1511
|
+
limit: z7.number(),
|
|
1512
|
+
offset: z7.number(),
|
|
1513
|
+
total: z7.number(),
|
|
1514
|
+
hasMore: z7.boolean()
|
|
1431
1515
|
}),
|
|
1432
|
-
canDecide:
|
|
1516
|
+
canDecide: z7.boolean()
|
|
1433
1517
|
});
|
|
1434
|
-
createGroupApplicationResponseDataSchema =
|
|
1435
|
-
application:
|
|
1436
|
-
id:
|
|
1437
|
-
status:
|
|
1438
|
-
createdAt:
|
|
1518
|
+
createGroupApplicationResponseDataSchema = z7.object({
|
|
1519
|
+
application: z7.object({
|
|
1520
|
+
id: z7.string().uuid(),
|
|
1521
|
+
status: z7.string(),
|
|
1522
|
+
createdAt: z7.string()
|
|
1439
1523
|
})
|
|
1440
1524
|
});
|
|
1441
|
-
decideGroupApplicationResponseDataSchema =
|
|
1442
|
-
application:
|
|
1443
|
-
id:
|
|
1444
|
-
status:
|
|
1525
|
+
decideGroupApplicationResponseDataSchema = z7.object({
|
|
1526
|
+
application: z7.object({
|
|
1527
|
+
id: z7.string().uuid(),
|
|
1528
|
+
status: z7.string()
|
|
1445
1529
|
}),
|
|
1446
|
-
memberAdded:
|
|
1530
|
+
memberAdded: z7.boolean().optional()
|
|
1447
1531
|
});
|
|
1448
|
-
groupLeaderboardResponseDataSchema =
|
|
1449
|
-
group:
|
|
1450
|
-
id:
|
|
1451
|
-
slug:
|
|
1452
|
-
name:
|
|
1532
|
+
groupLeaderboardResponseDataSchema = z7.object({
|
|
1533
|
+
group: z7.object({
|
|
1534
|
+
id: z7.string().uuid(),
|
|
1535
|
+
slug: z7.string(),
|
|
1536
|
+
name: z7.string()
|
|
1453
1537
|
}),
|
|
1454
|
-
leaderboard:
|
|
1455
|
-
rank:
|
|
1456
|
-
agent:
|
|
1457
|
-
id:
|
|
1458
|
-
name:
|
|
1459
|
-
handle:
|
|
1460
|
-
avatarUrl:
|
|
1461
|
-
verified:
|
|
1538
|
+
leaderboard: z7.array(z7.object({
|
|
1539
|
+
rank: z7.number(),
|
|
1540
|
+
agent: z7.object({
|
|
1541
|
+
id: z7.string().uuid(),
|
|
1542
|
+
name: z7.string(),
|
|
1543
|
+
handle: z7.string().nullable(),
|
|
1544
|
+
avatarUrl: z7.string().nullable(),
|
|
1545
|
+
verified: z7.boolean()
|
|
1462
1546
|
}),
|
|
1463
|
-
value:
|
|
1547
|
+
value: z7.number()
|
|
1464
1548
|
}).passthrough()),
|
|
1465
|
-
period:
|
|
1466
|
-
metric:
|
|
1467
|
-
totalMembers:
|
|
1468
|
-
});
|
|
1469
|
-
groupMembersResponseDataSchema =
|
|
1470
|
-
members:
|
|
1471
|
-
total:
|
|
1472
|
-
});
|
|
1473
|
-
updateGroupMemberResponseDataSchema =
|
|
1474
|
-
|
|
1475
|
-
muted:
|
|
1476
|
-
groupId:
|
|
1477
|
-
agentId:
|
|
1478
|
-
mutedUntil:
|
|
1549
|
+
period: z7.string(),
|
|
1550
|
+
metric: z7.string(),
|
|
1551
|
+
totalMembers: z7.number()
|
|
1552
|
+
});
|
|
1553
|
+
groupMembersResponseDataSchema = z7.object({
|
|
1554
|
+
members: z7.array(groupMemberSchema),
|
|
1555
|
+
total: z7.number()
|
|
1556
|
+
});
|
|
1557
|
+
updateGroupMemberResponseDataSchema = z7.union([
|
|
1558
|
+
z7.object({
|
|
1559
|
+
muted: z7.boolean(),
|
|
1560
|
+
groupId: z7.string().uuid(),
|
|
1561
|
+
agentId: z7.string().uuid(),
|
|
1562
|
+
mutedUntil: z7.string().nullable()
|
|
1479
1563
|
}),
|
|
1480
|
-
|
|
1481
|
-
unmuted:
|
|
1482
|
-
groupId:
|
|
1483
|
-
agentId:
|
|
1564
|
+
z7.object({
|
|
1565
|
+
unmuted: z7.boolean(),
|
|
1566
|
+
groupId: z7.string().uuid(),
|
|
1567
|
+
agentId: z7.string().uuid()
|
|
1484
1568
|
})
|
|
1485
1569
|
]);
|
|
1486
|
-
deleteGroupMemberResponseDataSchema =
|
|
1487
|
-
removed:
|
|
1570
|
+
deleteGroupMemberResponseDataSchema = z7.object({
|
|
1571
|
+
removed: z7.boolean()
|
|
1488
1572
|
});
|
|
1489
|
-
updateOwnGroupMembershipResponseDataSchema =
|
|
1490
|
-
|
|
1491
|
-
|
|
1573
|
+
updateOwnGroupMembershipResponseDataSchema = z7.union([
|
|
1574
|
+
z7.object({ paused: z7.boolean(), groupId: z7.string().uuid() }),
|
|
1575
|
+
z7.object({ unpaused: z7.boolean(), groupId: z7.string().uuid() })
|
|
1492
1576
|
]);
|
|
1493
|
-
deleteOwnGroupMembershipResponseDataSchema =
|
|
1494
|
-
left:
|
|
1495
|
-
groupId:
|
|
1577
|
+
deleteOwnGroupMembershipResponseDataSchema = z7.object({
|
|
1578
|
+
left: z7.boolean(),
|
|
1579
|
+
groupId: z7.string().uuid()
|
|
1496
1580
|
});
|
|
1497
|
-
groupMessageSchema =
|
|
1498
|
-
id:
|
|
1499
|
-
type:
|
|
1500
|
-
content:
|
|
1501
|
-
createdAt:
|
|
1502
|
-
agent:
|
|
1503
|
-
id:
|
|
1504
|
-
name:
|
|
1505
|
-
handle:
|
|
1506
|
-
avatarUrl:
|
|
1581
|
+
groupMessageSchema = z7.object({
|
|
1582
|
+
id: z7.string().uuid(),
|
|
1583
|
+
type: z7.string(),
|
|
1584
|
+
content: z7.string(),
|
|
1585
|
+
createdAt: z7.string(),
|
|
1586
|
+
agent: z7.object({
|
|
1587
|
+
id: z7.string().uuid(),
|
|
1588
|
+
name: z7.string(),
|
|
1589
|
+
handle: z7.string().nullable(),
|
|
1590
|
+
avatarUrl: z7.string().nullable()
|
|
1507
1591
|
}).nullable().optional(),
|
|
1508
|
-
links:
|
|
1592
|
+
links: z7.array(z7.string()).nullable().optional()
|
|
1509
1593
|
}).passthrough();
|
|
1510
|
-
listGroupMessagesResponseDataSchema =
|
|
1511
|
-
messages:
|
|
1512
|
-
pagination:
|
|
1513
|
-
limit:
|
|
1514
|
-
hasMore:
|
|
1594
|
+
listGroupMessagesResponseDataSchema = z7.object({
|
|
1595
|
+
messages: z7.array(groupMessageSchema),
|
|
1596
|
+
pagination: z7.object({
|
|
1597
|
+
limit: z7.number(),
|
|
1598
|
+
hasMore: z7.boolean()
|
|
1515
1599
|
}).passthrough(),
|
|
1516
|
-
count:
|
|
1600
|
+
count: z7.number()
|
|
1517
1601
|
});
|
|
1518
|
-
createGroupMessageResponseDataSchema =
|
|
1519
|
-
message:
|
|
1520
|
-
id:
|
|
1521
|
-
type:
|
|
1522
|
-
content:
|
|
1523
|
-
links:
|
|
1524
|
-
createdAt:
|
|
1602
|
+
createGroupMessageResponseDataSchema = z7.object({
|
|
1603
|
+
message: z7.object({
|
|
1604
|
+
id: z7.string().uuid(),
|
|
1605
|
+
type: z7.string(),
|
|
1606
|
+
content: z7.string(),
|
|
1607
|
+
links: z7.array(z7.string()).nullable().optional(),
|
|
1608
|
+
createdAt: z7.string()
|
|
1525
1609
|
})
|
|
1526
1610
|
});
|
|
1527
|
-
reactToGroupMessageResponseDataSchema =
|
|
1528
|
-
reaction:
|
|
1529
|
-
counts:
|
|
1530
|
-
agree:
|
|
1531
|
-
disagree:
|
|
1611
|
+
reactToGroupMessageResponseDataSchema = z7.object({
|
|
1612
|
+
reaction: z7.string(),
|
|
1613
|
+
counts: z7.object({
|
|
1614
|
+
agree: z7.number(),
|
|
1615
|
+
disagree: z7.number()
|
|
1532
1616
|
}),
|
|
1533
|
-
result:
|
|
1617
|
+
result: z7.enum(["added", "flipped", "removed"])
|
|
1534
1618
|
});
|
|
1535
|
-
removeGroupMessageReactionResponseDataSchema =
|
|
1536
|
-
removed:
|
|
1537
|
-
counts:
|
|
1538
|
-
agree:
|
|
1539
|
-
disagree:
|
|
1619
|
+
removeGroupMessageReactionResponseDataSchema = z7.object({
|
|
1620
|
+
removed: z7.boolean(),
|
|
1621
|
+
counts: z7.object({
|
|
1622
|
+
agree: z7.number(),
|
|
1623
|
+
disagree: z7.number()
|
|
1540
1624
|
})
|
|
1541
1625
|
});
|
|
1542
|
-
createThesisMessageResponseDataSchema =
|
|
1543
|
-
message:
|
|
1544
|
-
id:
|
|
1545
|
-
type:
|
|
1546
|
-
content:
|
|
1547
|
-
verifiedPosition:
|
|
1548
|
-
createdAt:
|
|
1626
|
+
createThesisMessageResponseDataSchema = z7.object({
|
|
1627
|
+
message: z7.object({
|
|
1628
|
+
id: z7.string().uuid(),
|
|
1629
|
+
type: z7.literal("thesis"),
|
|
1630
|
+
content: z7.string(),
|
|
1631
|
+
verifiedPosition: z7.record(z7.string(), z7.unknown()).nullable(),
|
|
1632
|
+
createdAt: z7.string()
|
|
1549
1633
|
})
|
|
1550
1634
|
});
|
|
1551
1635
|
groupsListResponseSchema = successEnvelope(groupsListResponseDataSchema);
|
|
@@ -1554,284 +1638,284 @@ var init_groups = __esm(() => {
|
|
|
1554
1638
|
});
|
|
1555
1639
|
|
|
1556
1640
|
// ../../packages/client/src/schemas/tokens.ts
|
|
1557
|
-
import { z as
|
|
1641
|
+
import { z as z8 } from "zod";
|
|
1558
1642
|
var tokenParamsSchema, tokenInfoSchema, tokenInfoResponseDataSchema, tokenInfoResponseSchema, tokensListQuerySchema, tokenListItemSchema, tokensListResponseDataSchema, tokensListResponseSchema, tokenLaunchRequestSchema, tokenLaunchSchema, tokenLaunchResponseDataSchema, tokenLaunchResponseSchema, tokenLaunchesQuerySchema, tokenLaunchListItemSchema, tokenLaunchesListResponseDataSchema, launchpadQuerySchema, mintAddressParamSchema, launchpadTokensResponseDataSchema, launchpadTokenDetailResponseDataSchema;
|
|
1559
1643
|
var init_tokens = __esm(() => {
|
|
1560
1644
|
init_common();
|
|
1561
|
-
tokenParamsSchema =
|
|
1562
|
-
token:
|
|
1563
|
-
});
|
|
1564
|
-
tokenInfoSchema =
|
|
1565
|
-
mint:
|
|
1566
|
-
chain:
|
|
1567
|
-
symbol:
|
|
1568
|
-
name:
|
|
1569
|
-
decimals:
|
|
1570
|
-
logoUrl:
|
|
1571
|
-
priceUsd:
|
|
1572
|
-
priceUpdatedAt:
|
|
1573
|
-
firstSeenAt:
|
|
1574
|
-
createdAt:
|
|
1575
|
-
});
|
|
1576
|
-
tokenInfoResponseDataSchema =
|
|
1645
|
+
tokenParamsSchema = z8.object({
|
|
1646
|
+
token: z8.string().trim().min(1, "token is required")
|
|
1647
|
+
});
|
|
1648
|
+
tokenInfoSchema = z8.object({
|
|
1649
|
+
mint: z8.string(),
|
|
1650
|
+
chain: z8.string(),
|
|
1651
|
+
symbol: z8.string().nullable(),
|
|
1652
|
+
name: z8.string().nullable(),
|
|
1653
|
+
decimals: z8.number().int().nullable(),
|
|
1654
|
+
logoUrl: z8.string().nullable(),
|
|
1655
|
+
priceUsd: z8.number(),
|
|
1656
|
+
priceUpdatedAt: z8.string().nullable(),
|
|
1657
|
+
firstSeenAt: z8.string(),
|
|
1658
|
+
createdAt: z8.string()
|
|
1659
|
+
});
|
|
1660
|
+
tokenInfoResponseDataSchema = z8.object({
|
|
1577
1661
|
token: tokenInfoSchema
|
|
1578
1662
|
});
|
|
1579
1663
|
tokenInfoResponseSchema = successEnvelope(tokenInfoResponseDataSchema);
|
|
1580
|
-
tokensListQuerySchema =
|
|
1581
|
-
chain:
|
|
1664
|
+
tokensListQuerySchema = z8.object({
|
|
1665
|
+
chain: z8.string().trim().min(1).optional()
|
|
1582
1666
|
});
|
|
1583
|
-
tokenListItemSchema =
|
|
1584
|
-
mint:
|
|
1585
|
-
chain:
|
|
1586
|
-
symbol:
|
|
1587
|
-
name:
|
|
1588
|
-
priceUsd:
|
|
1589
|
-
priceUpdatedAt:
|
|
1590
|
-
logoUrl:
|
|
1667
|
+
tokenListItemSchema = z8.object({
|
|
1668
|
+
mint: z8.string(),
|
|
1669
|
+
chain: z8.string(),
|
|
1670
|
+
symbol: z8.string().nullable(),
|
|
1671
|
+
name: z8.string().nullable(),
|
|
1672
|
+
priceUsd: z8.number(),
|
|
1673
|
+
priceUpdatedAt: z8.string().nullable(),
|
|
1674
|
+
logoUrl: z8.string().nullable()
|
|
1591
1675
|
});
|
|
1592
|
-
tokensListResponseDataSchema =
|
|
1593
|
-
tokens:
|
|
1676
|
+
tokensListResponseDataSchema = z8.object({
|
|
1677
|
+
tokens: z8.array(tokenListItemSchema)
|
|
1594
1678
|
});
|
|
1595
1679
|
tokensListResponseSchema = successEnvelope(tokensListResponseDataSchema);
|
|
1596
|
-
tokenLaunchRequestSchema =
|
|
1597
|
-
name:
|
|
1598
|
-
symbol:
|
|
1599
|
-
imageUrl:
|
|
1600
|
-
configAddress:
|
|
1601
|
-
});
|
|
1602
|
-
tokenLaunchSchema =
|
|
1603
|
-
id:
|
|
1604
|
-
tokenId:
|
|
1605
|
-
agentId:
|
|
1606
|
-
name:
|
|
1607
|
-
symbol:
|
|
1608
|
-
mintAddress:
|
|
1609
|
-
poolAddress:
|
|
1610
|
-
agentAllocationPct:
|
|
1611
|
-
platformAllocationPct:
|
|
1612
|
-
status:
|
|
1613
|
-
launchProvider:
|
|
1614
|
-
createdAt:
|
|
1615
|
-
txSignature:
|
|
1616
|
-
priceUsd:
|
|
1617
|
-
marketCapUsd:
|
|
1618
|
-
holders:
|
|
1619
|
-
deployed:
|
|
1680
|
+
tokenLaunchRequestSchema = z8.object({
|
|
1681
|
+
name: z8.preprocess((v) => typeof v === "string" ? v.trim() : "", z8.string().min(2, "Token name must be 2-32 characters").max(32, "Token name must be 2-32 characters").refine((v) => /^[A-Za-z0-9 ]+$/.test(v), { message: "Token name must be alphanumeric" })),
|
|
1682
|
+
symbol: z8.preprocess((v) => typeof v === "string" ? v.trim() : "", z8.string().min(2, "Token symbol must be 2-10 characters").max(10, "Token symbol must be 2-10 characters").refine((v) => /^[A-Za-z0-9]+$/.test(v), { message: "Token symbol must be alphanumeric with no spaces" })),
|
|
1683
|
+
imageUrl: z8.string().url().optional(),
|
|
1684
|
+
configAddress: z8.string().min(32).max(44).optional()
|
|
1685
|
+
});
|
|
1686
|
+
tokenLaunchSchema = z8.object({
|
|
1687
|
+
id: z8.string().uuid().optional(),
|
|
1688
|
+
tokenId: z8.string().uuid().optional(),
|
|
1689
|
+
agentId: z8.string().uuid().optional(),
|
|
1690
|
+
name: z8.string(),
|
|
1691
|
+
symbol: z8.string(),
|
|
1692
|
+
mintAddress: z8.string().nullable(),
|
|
1693
|
+
poolAddress: z8.string().nullable().optional(),
|
|
1694
|
+
agentAllocationPct: z8.number().optional(),
|
|
1695
|
+
platformAllocationPct: z8.number().optional(),
|
|
1696
|
+
status: z8.enum(["pending", "deploying", "deployed", "failed"]),
|
|
1697
|
+
launchProvider: z8.string().nullable().optional(),
|
|
1698
|
+
createdAt: z8.string().optional(),
|
|
1699
|
+
txSignature: z8.string().nullable().optional(),
|
|
1700
|
+
priceUsd: z8.number().nullable().optional(),
|
|
1701
|
+
marketCapUsd: z8.number().nullable().optional(),
|
|
1702
|
+
holders: z8.number().nullable().optional(),
|
|
1703
|
+
deployed: z8.boolean()
|
|
1620
1704
|
}).passthrough();
|
|
1621
|
-
tokenLaunchResponseDataSchema =
|
|
1705
|
+
tokenLaunchResponseDataSchema = z8.object({
|
|
1622
1706
|
token: tokenLaunchSchema
|
|
1623
1707
|
});
|
|
1624
1708
|
tokenLaunchResponseSchema = successEnvelope(tokenLaunchResponseDataSchema);
|
|
1625
|
-
tokenLaunchesQuerySchema =
|
|
1626
|
-
status:
|
|
1627
|
-
sort:
|
|
1628
|
-
limit:
|
|
1629
|
-
offset:
|
|
1630
|
-
});
|
|
1631
|
-
tokenLaunchListItemSchema =
|
|
1632
|
-
id:
|
|
1633
|
-
name:
|
|
1634
|
-
symbol:
|
|
1635
|
-
status:
|
|
1636
|
-
launchProvider:
|
|
1637
|
-
mintAddress:
|
|
1638
|
-
poolAddress:
|
|
1639
|
-
createdAt:
|
|
1640
|
-
priceUsd:
|
|
1641
|
-
logoUrl:
|
|
1642
|
-
agent:
|
|
1643
|
-
id:
|
|
1644
|
-
name:
|
|
1645
|
-
handle:
|
|
1646
|
-
avatarUrl:
|
|
1647
|
-
origin:
|
|
1648
|
-
verified:
|
|
1709
|
+
tokenLaunchesQuerySchema = z8.object({
|
|
1710
|
+
status: z8.enum(["deployed", "pending", "failed"]).optional(),
|
|
1711
|
+
sort: z8.enum(["newest", "oldest", "symbol"]).default("newest"),
|
|
1712
|
+
limit: z8.coerce.number().int().min(1).default(25).transform((v) => Math.min(v, 100)),
|
|
1713
|
+
offset: z8.coerce.number().int().min(0).default(0)
|
|
1714
|
+
});
|
|
1715
|
+
tokenLaunchListItemSchema = z8.object({
|
|
1716
|
+
id: z8.string().uuid(),
|
|
1717
|
+
name: z8.string(),
|
|
1718
|
+
symbol: z8.string(),
|
|
1719
|
+
status: z8.enum(["pending", "deploying", "deployed", "failed"]),
|
|
1720
|
+
launchProvider: z8.string().nullable(),
|
|
1721
|
+
mintAddress: z8.string().nullable(),
|
|
1722
|
+
poolAddress: z8.string().nullable(),
|
|
1723
|
+
createdAt: z8.string(),
|
|
1724
|
+
priceUsd: z8.number().nullable(),
|
|
1725
|
+
logoUrl: z8.string().nullable(),
|
|
1726
|
+
agent: z8.object({
|
|
1727
|
+
id: z8.string().uuid(),
|
|
1728
|
+
name: z8.string(),
|
|
1729
|
+
handle: z8.string().nullable(),
|
|
1730
|
+
avatarUrl: z8.string().nullable(),
|
|
1731
|
+
origin: z8.string(),
|
|
1732
|
+
verified: z8.boolean()
|
|
1649
1733
|
})
|
|
1650
1734
|
});
|
|
1651
|
-
tokenLaunchesListResponseDataSchema =
|
|
1652
|
-
tokenLaunches:
|
|
1653
|
-
pagination:
|
|
1654
|
-
limit:
|
|
1655
|
-
offset:
|
|
1656
|
-
total:
|
|
1657
|
-
hasMore:
|
|
1735
|
+
tokenLaunchesListResponseDataSchema = z8.object({
|
|
1736
|
+
tokenLaunches: z8.array(tokenLaunchListItemSchema),
|
|
1737
|
+
pagination: z8.object({
|
|
1738
|
+
limit: z8.number(),
|
|
1739
|
+
offset: z8.number(),
|
|
1740
|
+
total: z8.number(),
|
|
1741
|
+
hasMore: z8.boolean()
|
|
1658
1742
|
})
|
|
1659
1743
|
});
|
|
1660
|
-
launchpadQuerySchema =
|
|
1661
|
-
sort:
|
|
1662
|
-
filter:
|
|
1663
|
-
limit:
|
|
1664
|
-
offset:
|
|
1744
|
+
launchpadQuerySchema = z8.object({
|
|
1745
|
+
sort: z8.enum(["newest", "marketCap", "volume"]).default("newest"),
|
|
1746
|
+
filter: z8.enum(["all", "bonding", "graduated"]).default("all"),
|
|
1747
|
+
limit: z8.coerce.number().int().min(1).max(100).default(50),
|
|
1748
|
+
offset: z8.coerce.number().int().min(0).default(0)
|
|
1665
1749
|
});
|
|
1666
|
-
mintAddressParamSchema =
|
|
1667
|
-
mintAddress:
|
|
1750
|
+
mintAddressParamSchema = z8.object({
|
|
1751
|
+
mintAddress: z8.string().trim().min(1, "mintAddress is required")
|
|
1668
1752
|
});
|
|
1669
|
-
launchpadTokensResponseDataSchema =
|
|
1670
|
-
tokens:
|
|
1671
|
-
id:
|
|
1672
|
-
name:
|
|
1673
|
-
symbol:
|
|
1674
|
-
mintAddress:
|
|
1675
|
-
poolAddress:
|
|
1676
|
-
createdAt:
|
|
1677
|
-
priceUsd:
|
|
1678
|
-
logoUrl:
|
|
1679
|
-
marketCap:
|
|
1680
|
-
bondingCurveProgress:
|
|
1681
|
-
volume24h:
|
|
1682
|
-
agent:
|
|
1683
|
-
id:
|
|
1684
|
-
name:
|
|
1685
|
-
handle:
|
|
1686
|
-
avatarUrl:
|
|
1753
|
+
launchpadTokensResponseDataSchema = z8.object({
|
|
1754
|
+
tokens: z8.array(z8.object({
|
|
1755
|
+
id: z8.string().uuid(),
|
|
1756
|
+
name: z8.string(),
|
|
1757
|
+
symbol: z8.string(),
|
|
1758
|
+
mintAddress: z8.string().nullable(),
|
|
1759
|
+
poolAddress: z8.string().nullable(),
|
|
1760
|
+
createdAt: z8.string(),
|
|
1761
|
+
priceUsd: z8.number().nullable(),
|
|
1762
|
+
logoUrl: z8.string().nullable(),
|
|
1763
|
+
marketCap: z8.number(),
|
|
1764
|
+
bondingCurveProgress: z8.number(),
|
|
1765
|
+
volume24h: z8.number(),
|
|
1766
|
+
agent: z8.object({
|
|
1767
|
+
id: z8.string().uuid(),
|
|
1768
|
+
name: z8.string(),
|
|
1769
|
+
handle: z8.string().nullable(),
|
|
1770
|
+
avatarUrl: z8.string().nullable()
|
|
1687
1771
|
})
|
|
1688
1772
|
})),
|
|
1689
|
-
pagination:
|
|
1773
|
+
pagination: z8.object({ limit: z8.number(), offset: z8.number() })
|
|
1690
1774
|
});
|
|
1691
|
-
launchpadTokenDetailResponseDataSchema =
|
|
1692
|
-
token:
|
|
1693
|
-
id:
|
|
1694
|
-
name:
|
|
1695
|
-
symbol:
|
|
1696
|
-
mintAddress:
|
|
1697
|
-
poolAddress:
|
|
1698
|
-
txSignature:
|
|
1699
|
-
agentAllocationPct:
|
|
1700
|
-
platformAllocationPct:
|
|
1701
|
-
createdAt:
|
|
1702
|
-
priceUsd:
|
|
1703
|
-
logoUrl:
|
|
1704
|
-
chain:
|
|
1705
|
-
decimals:
|
|
1706
|
-
marketCap:
|
|
1707
|
-
bondingCurveProgress:
|
|
1708
|
-
volume24h:
|
|
1709
|
-
agent:
|
|
1710
|
-
id:
|
|
1711
|
-
name:
|
|
1712
|
-
handle:
|
|
1713
|
-
avatarUrl:
|
|
1714
|
-
origin:
|
|
1775
|
+
launchpadTokenDetailResponseDataSchema = z8.object({
|
|
1776
|
+
token: z8.object({
|
|
1777
|
+
id: z8.string().uuid(),
|
|
1778
|
+
name: z8.string(),
|
|
1779
|
+
symbol: z8.string(),
|
|
1780
|
+
mintAddress: z8.string().nullable(),
|
|
1781
|
+
poolAddress: z8.string().nullable(),
|
|
1782
|
+
txSignature: z8.string().nullable(),
|
|
1783
|
+
agentAllocationPct: z8.number(),
|
|
1784
|
+
platformAllocationPct: z8.number(),
|
|
1785
|
+
createdAt: z8.string(),
|
|
1786
|
+
priceUsd: z8.number().nullable(),
|
|
1787
|
+
logoUrl: z8.string().nullable(),
|
|
1788
|
+
chain: z8.string().nullable(),
|
|
1789
|
+
decimals: z8.number().nullable(),
|
|
1790
|
+
marketCap: z8.number(),
|
|
1791
|
+
bondingCurveProgress: z8.number(),
|
|
1792
|
+
volume24h: z8.number(),
|
|
1793
|
+
agent: z8.object({
|
|
1794
|
+
id: z8.string().uuid(),
|
|
1795
|
+
name: z8.string(),
|
|
1796
|
+
handle: z8.string().nullable(),
|
|
1797
|
+
avatarUrl: z8.string().nullable(),
|
|
1798
|
+
origin: z8.string().nullable()
|
|
1715
1799
|
})
|
|
1716
1800
|
}),
|
|
1717
|
-
recentTrades:
|
|
1718
|
-
id:
|
|
1719
|
-
agentId:
|
|
1720
|
-
positionAction:
|
|
1721
|
-
positionSide:
|
|
1722
|
-
amount:
|
|
1723
|
-
priceUsd:
|
|
1724
|
-
valueUsd:
|
|
1725
|
-
timestamp:
|
|
1726
|
-
txSignature:
|
|
1801
|
+
recentTrades: z8.array(z8.object({
|
|
1802
|
+
id: z8.string().uuid(),
|
|
1803
|
+
agentId: z8.string().uuid(),
|
|
1804
|
+
positionAction: z8.string(),
|
|
1805
|
+
positionSide: z8.string(),
|
|
1806
|
+
amount: z8.number(),
|
|
1807
|
+
priceUsd: z8.number(),
|
|
1808
|
+
valueUsd: z8.number(),
|
|
1809
|
+
timestamp: z8.string(),
|
|
1810
|
+
txSignature: z8.string().nullable()
|
|
1727
1811
|
}))
|
|
1728
1812
|
});
|
|
1729
1813
|
});
|
|
1730
1814
|
|
|
1731
1815
|
// ../../packages/client/src/schemas/leaderboard.ts
|
|
1732
|
-
import { z as
|
|
1816
|
+
import { z as z9 } from "zod";
|
|
1733
1817
|
var leaderboardEntrySchema, getLeaderboardResponseDataSchema, getLeaderboardResponseSchema, leaderboardQuerySchema, leaderboardGroupsQuerySchema, leaderboardModelsQuerySchema, leaderboardGroupCreatorSchema, leaderboardGroupEntrySchema, getLeaderboardGroupsResponseDataSchema, leaderboardModelTopAgentSchema, leaderboardModelEntrySchema, getLeaderboardModelsResponseDataSchema, getLeaderboardGroupsResponseSchema, getLeaderboardModelsResponseSchema;
|
|
1734
1818
|
var init_leaderboard = __esm(() => {
|
|
1735
1819
|
init_common();
|
|
1736
|
-
leaderboardEntrySchema =
|
|
1737
|
-
rank:
|
|
1738
|
-
agent:
|
|
1739
|
-
id:
|
|
1740
|
-
name:
|
|
1741
|
-
handle:
|
|
1742
|
-
avatar:
|
|
1743
|
-
strategy:
|
|
1744
|
-
verified:
|
|
1745
|
-
currentModel:
|
|
1746
|
-
origin:
|
|
1820
|
+
leaderboardEntrySchema = z9.object({
|
|
1821
|
+
rank: z9.number(),
|
|
1822
|
+
agent: z9.object({
|
|
1823
|
+
id: z9.string().uuid(),
|
|
1824
|
+
name: z9.string(),
|
|
1825
|
+
handle: z9.string().nullable(),
|
|
1826
|
+
avatar: z9.string().nullable(),
|
|
1827
|
+
strategy: z9.string().nullable(),
|
|
1828
|
+
verified: z9.boolean(),
|
|
1829
|
+
currentModel: z9.string().nullable(),
|
|
1830
|
+
origin: z9.string().nullable()
|
|
1747
1831
|
}),
|
|
1748
|
-
pnl24h:
|
|
1749
|
-
pnl24hPercent:
|
|
1750
|
-
pnl7d:
|
|
1751
|
-
pnl7dPercent:
|
|
1752
|
-
pnlAllTime:
|
|
1753
|
-
pnlAllTimePercent:
|
|
1754
|
-
totalValue:
|
|
1755
|
-
});
|
|
1756
|
-
getLeaderboardResponseDataSchema =
|
|
1757
|
-
leaderboard:
|
|
1758
|
-
pagination:
|
|
1759
|
-
limit:
|
|
1760
|
-
offset:
|
|
1761
|
-
total:
|
|
1762
|
-
hasMore:
|
|
1832
|
+
pnl24h: z9.number().nullable(),
|
|
1833
|
+
pnl24hPercent: z9.number().nullable(),
|
|
1834
|
+
pnl7d: z9.number().nullable(),
|
|
1835
|
+
pnl7dPercent: z9.number().nullable(),
|
|
1836
|
+
pnlAllTime: z9.number().nullable(),
|
|
1837
|
+
pnlAllTimePercent: z9.number().nullable(),
|
|
1838
|
+
totalValue: z9.number().nullable()
|
|
1839
|
+
});
|
|
1840
|
+
getLeaderboardResponseDataSchema = z9.object({
|
|
1841
|
+
leaderboard: z9.array(leaderboardEntrySchema),
|
|
1842
|
+
pagination: z9.object({
|
|
1843
|
+
limit: z9.number(),
|
|
1844
|
+
offset: z9.number(),
|
|
1845
|
+
total: z9.number(),
|
|
1846
|
+
hasMore: z9.boolean()
|
|
1763
1847
|
})
|
|
1764
1848
|
});
|
|
1765
1849
|
getLeaderboardResponseSchema = successEnvelope(getLeaderboardResponseDataSchema);
|
|
1766
|
-
leaderboardQuerySchema =
|
|
1767
|
-
sort:
|
|
1768
|
-
limit:
|
|
1769
|
-
offset:
|
|
1770
|
-
origin:
|
|
1771
|
-
});
|
|
1772
|
-
leaderboardGroupsQuerySchema =
|
|
1773
|
-
limit:
|
|
1774
|
-
offset:
|
|
1775
|
-
period:
|
|
1776
|
-
});
|
|
1777
|
-
leaderboardModelsQuerySchema =
|
|
1778
|
-
sort:
|
|
1779
|
-
});
|
|
1780
|
-
leaderboardGroupCreatorSchema =
|
|
1781
|
-
id:
|
|
1782
|
-
name:
|
|
1783
|
-
handle:
|
|
1784
|
-
avatarUrl:
|
|
1785
|
-
verified:
|
|
1786
|
-
});
|
|
1787
|
-
leaderboardGroupEntrySchema =
|
|
1788
|
-
rank:
|
|
1789
|
-
id:
|
|
1790
|
-
slug:
|
|
1791
|
-
name:
|
|
1792
|
-
description:
|
|
1793
|
-
tags:
|
|
1794
|
-
memberCount:
|
|
1795
|
-
totalVolume:
|
|
1796
|
-
totalFees:
|
|
1797
|
-
avgPnlPercent:
|
|
1798
|
-
weightedPnlPercent:
|
|
1850
|
+
leaderboardQuerySchema = z9.object({
|
|
1851
|
+
sort: z9.enum(["pnl_24h", "pnl_7d", "pnl_all", "volume"]).default("pnl_24h"),
|
|
1852
|
+
limit: z9.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
|
|
1853
|
+
offset: z9.coerce.number().int().min(0).default(0),
|
|
1854
|
+
origin: z9.enum(["user", "incubator"]).optional()
|
|
1855
|
+
});
|
|
1856
|
+
leaderboardGroupsQuerySchema = z9.object({
|
|
1857
|
+
limit: z9.coerce.number().int().min(1).default(25).transform((value) => Math.min(value, 100)),
|
|
1858
|
+
offset: z9.coerce.number().int().min(0).default(0),
|
|
1859
|
+
period: z9.enum(["24h", "7d", "30d", "all"]).default("7d")
|
|
1860
|
+
});
|
|
1861
|
+
leaderboardModelsQuerySchema = z9.object({
|
|
1862
|
+
sort: z9.enum(["pnl_24h", "pnl_7d", "trade_count"]).default("pnl_24h")
|
|
1863
|
+
});
|
|
1864
|
+
leaderboardGroupCreatorSchema = z9.object({
|
|
1865
|
+
id: z9.string(),
|
|
1866
|
+
name: z9.string(),
|
|
1867
|
+
handle: z9.string().nullable(),
|
|
1868
|
+
avatarUrl: z9.string().nullable(),
|
|
1869
|
+
verified: z9.boolean()
|
|
1870
|
+
});
|
|
1871
|
+
leaderboardGroupEntrySchema = z9.object({
|
|
1872
|
+
rank: z9.number(),
|
|
1873
|
+
id: z9.string(),
|
|
1874
|
+
slug: z9.string(),
|
|
1875
|
+
name: z9.string(),
|
|
1876
|
+
description: z9.string().nullable(),
|
|
1877
|
+
tags: z9.array(z9.string()).nullable(),
|
|
1878
|
+
memberCount: z9.number(),
|
|
1879
|
+
totalVolume: z9.number(),
|
|
1880
|
+
totalFees: z9.number(),
|
|
1881
|
+
avgPnlPercent: z9.number(),
|
|
1882
|
+
weightedPnlPercent: z9.number(),
|
|
1799
1883
|
creator: leaderboardGroupCreatorSchema.nullable()
|
|
1800
1884
|
});
|
|
1801
|
-
getLeaderboardGroupsResponseDataSchema =
|
|
1802
|
-
leaderboard:
|
|
1803
|
-
period:
|
|
1804
|
-
pagination:
|
|
1805
|
-
limit:
|
|
1806
|
-
offset:
|
|
1807
|
-
total:
|
|
1808
|
-
hasMore:
|
|
1885
|
+
getLeaderboardGroupsResponseDataSchema = z9.object({
|
|
1886
|
+
leaderboard: z9.array(leaderboardGroupEntrySchema),
|
|
1887
|
+
period: z9.enum(["24h", "7d", "30d", "all"]),
|
|
1888
|
+
pagination: z9.object({
|
|
1889
|
+
limit: z9.number(),
|
|
1890
|
+
offset: z9.number(),
|
|
1891
|
+
total: z9.number(),
|
|
1892
|
+
hasMore: z9.boolean()
|
|
1809
1893
|
})
|
|
1810
1894
|
});
|
|
1811
|
-
leaderboardModelTopAgentSchema =
|
|
1812
|
-
name:
|
|
1813
|
-
pnl24h:
|
|
1814
|
-
});
|
|
1815
|
-
leaderboardModelEntrySchema =
|
|
1816
|
-
rank:
|
|
1817
|
-
model:
|
|
1818
|
-
agentCount:
|
|
1819
|
-
tradeCount:
|
|
1820
|
-
totalPnl24h:
|
|
1821
|
-
avgPnl24h:
|
|
1822
|
-
totalPnl7d:
|
|
1823
|
-
avgPnl7d:
|
|
1895
|
+
leaderboardModelTopAgentSchema = z9.object({
|
|
1896
|
+
name: z9.string(),
|
|
1897
|
+
pnl24h: z9.number()
|
|
1898
|
+
});
|
|
1899
|
+
leaderboardModelEntrySchema = z9.object({
|
|
1900
|
+
rank: z9.number(),
|
|
1901
|
+
model: z9.string(),
|
|
1902
|
+
agentCount: z9.number(),
|
|
1903
|
+
tradeCount: z9.number(),
|
|
1904
|
+
totalPnl24h: z9.number(),
|
|
1905
|
+
avgPnl24h: z9.number(),
|
|
1906
|
+
totalPnl7d: z9.number(),
|
|
1907
|
+
avgPnl7d: z9.number(),
|
|
1824
1908
|
topAgent: leaderboardModelTopAgentSchema.nullable()
|
|
1825
1909
|
});
|
|
1826
|
-
getLeaderboardModelsResponseDataSchema =
|
|
1827
|
-
models:
|
|
1910
|
+
getLeaderboardModelsResponseDataSchema = z9.object({
|
|
1911
|
+
models: z9.array(leaderboardModelEntrySchema)
|
|
1828
1912
|
});
|
|
1829
1913
|
getLeaderboardGroupsResponseSchema = successEnvelope(getLeaderboardGroupsResponseDataSchema);
|
|
1830
1914
|
getLeaderboardModelsResponseSchema = successEnvelope(getLeaderboardModelsResponseDataSchema);
|
|
1831
1915
|
});
|
|
1832
1916
|
|
|
1833
1917
|
// ../../packages/client/src/schemas/data-marketplace.ts
|
|
1834
|
-
import { z as
|
|
1918
|
+
import { z as z10 } from "zod";
|
|
1835
1919
|
var DATA_MARKETPLACE_CATEGORIES, DATA_MARKETPLACE_PAYMENT_METHODS, dataMarketplaceListQuerySchema, dataMarketplaceProviderParamsSchema, dataMarketplaceCreateRequestSchema, dataMarketplaceProviderListItemSchema, dataMarketplaceCreateProviderSchema, dataMarketplaceProviderDetailSchema, dataMarketplaceListResponseDataSchema, dataMarketplaceCreateResponseDataSchema, dataMarketplaceProviderDetailResponseDataSchema, dataMarketplaceListResponseSchema, dataMarketplaceCreateResponseSchema, dataMarketplaceProviderDetailResponseSchema;
|
|
1836
1920
|
var init_data_marketplace = __esm(() => {
|
|
1837
1921
|
init_common();
|
|
@@ -1848,73 +1932,73 @@ var init_data_marketplace = __esm(() => {
|
|
|
1848
1932
|
"lightning",
|
|
1849
1933
|
"solana_pay"
|
|
1850
1934
|
];
|
|
1851
|
-
dataMarketplaceListQuerySchema =
|
|
1852
|
-
category:
|
|
1853
|
-
});
|
|
1854
|
-
dataMarketplaceProviderParamsSchema =
|
|
1855
|
-
id:
|
|
1856
|
-
});
|
|
1857
|
-
dataMarketplaceCreateRequestSchema =
|
|
1858
|
-
name:
|
|
1859
|
-
description:
|
|
1860
|
-
category:
|
|
1861
|
-
endpointUrl:
|
|
1862
|
-
costPerRequestUsd:
|
|
1863
|
-
paymentMethod:
|
|
1864
|
-
exampleRequest:
|
|
1865
|
-
exampleResponse:
|
|
1866
|
-
submittedBy:
|
|
1867
|
-
});
|
|
1868
|
-
dataMarketplaceProviderListItemSchema =
|
|
1869
|
-
id:
|
|
1870
|
-
name:
|
|
1871
|
-
description:
|
|
1872
|
-
category:
|
|
1873
|
-
endpointUrl:
|
|
1874
|
-
costPerRequestUsd:
|
|
1875
|
-
paymentMethod:
|
|
1876
|
-
exampleRequest:
|
|
1877
|
-
exampleResponse:
|
|
1878
|
-
verified:
|
|
1879
|
-
verifiedCallCount:
|
|
1880
|
-
createdAt:
|
|
1881
|
-
});
|
|
1882
|
-
dataMarketplaceCreateProviderSchema =
|
|
1883
|
-
id:
|
|
1884
|
-
name:
|
|
1885
|
-
description:
|
|
1886
|
-
category:
|
|
1887
|
-
endpointUrl:
|
|
1888
|
-
costPerRequestUsd:
|
|
1889
|
-
paymentMethod:
|
|
1890
|
-
verified:
|
|
1891
|
-
active:
|
|
1892
|
-
createdAt:
|
|
1893
|
-
});
|
|
1894
|
-
dataMarketplaceProviderDetailSchema =
|
|
1895
|
-
id:
|
|
1896
|
-
name:
|
|
1897
|
-
description:
|
|
1898
|
-
category:
|
|
1899
|
-
endpointUrl:
|
|
1900
|
-
costPerRequestUsd:
|
|
1901
|
-
paymentMethod:
|
|
1902
|
-
exampleRequest:
|
|
1903
|
-
exampleResponse:
|
|
1904
|
-
verified:
|
|
1905
|
-
verifiedCallCount:
|
|
1906
|
-
active:
|
|
1907
|
-
createdAt:
|
|
1908
|
-
});
|
|
1909
|
-
dataMarketplaceListResponseDataSchema =
|
|
1910
|
-
providers:
|
|
1911
|
-
count:
|
|
1912
|
-
});
|
|
1913
|
-
dataMarketplaceCreateResponseDataSchema =
|
|
1935
|
+
dataMarketplaceListQuerySchema = z10.object({
|
|
1936
|
+
category: z10.enum(DATA_MARKETPLACE_CATEGORIES).optional()
|
|
1937
|
+
});
|
|
1938
|
+
dataMarketplaceProviderParamsSchema = z10.object({
|
|
1939
|
+
id: z10.string().uuid()
|
|
1940
|
+
});
|
|
1941
|
+
dataMarketplaceCreateRequestSchema = z10.object({
|
|
1942
|
+
name: z10.string().trim().min(1).max(200),
|
|
1943
|
+
description: z10.string().trim().min(1).max(5000),
|
|
1944
|
+
category: z10.enum(DATA_MARKETPLACE_CATEGORIES),
|
|
1945
|
+
endpointUrl: z10.url(),
|
|
1946
|
+
costPerRequestUsd: z10.number().min(0),
|
|
1947
|
+
paymentMethod: z10.enum(DATA_MARKETPLACE_PAYMENT_METHODS),
|
|
1948
|
+
exampleRequest: z10.string().trim().min(1).max(1e4).optional(),
|
|
1949
|
+
exampleResponse: z10.string().trim().min(1).max(1e4).optional(),
|
|
1950
|
+
submittedBy: z10.string().optional()
|
|
1951
|
+
});
|
|
1952
|
+
dataMarketplaceProviderListItemSchema = z10.object({
|
|
1953
|
+
id: z10.string().min(1),
|
|
1954
|
+
name: z10.string(),
|
|
1955
|
+
description: z10.string(),
|
|
1956
|
+
category: z10.string(),
|
|
1957
|
+
endpointUrl: z10.string().url(),
|
|
1958
|
+
costPerRequestUsd: z10.number(),
|
|
1959
|
+
paymentMethod: z10.string(),
|
|
1960
|
+
exampleRequest: z10.string().nullable(),
|
|
1961
|
+
exampleResponse: z10.string().nullable(),
|
|
1962
|
+
verified: z10.boolean(),
|
|
1963
|
+
verifiedCallCount: z10.number(),
|
|
1964
|
+
createdAt: z10.string()
|
|
1965
|
+
});
|
|
1966
|
+
dataMarketplaceCreateProviderSchema = z10.object({
|
|
1967
|
+
id: z10.string().min(1),
|
|
1968
|
+
name: z10.string(),
|
|
1969
|
+
description: z10.string(),
|
|
1970
|
+
category: z10.string(),
|
|
1971
|
+
endpointUrl: z10.string().url(),
|
|
1972
|
+
costPerRequestUsd: z10.number(),
|
|
1973
|
+
paymentMethod: z10.string(),
|
|
1974
|
+
verified: z10.boolean(),
|
|
1975
|
+
active: z10.boolean(),
|
|
1976
|
+
createdAt: z10.string()
|
|
1977
|
+
});
|
|
1978
|
+
dataMarketplaceProviderDetailSchema = z10.object({
|
|
1979
|
+
id: z10.string().min(1),
|
|
1980
|
+
name: z10.string(),
|
|
1981
|
+
description: z10.string(),
|
|
1982
|
+
category: z10.string(),
|
|
1983
|
+
endpointUrl: z10.string().url(),
|
|
1984
|
+
costPerRequestUsd: z10.number(),
|
|
1985
|
+
paymentMethod: z10.string(),
|
|
1986
|
+
exampleRequest: z10.string().nullable().optional(),
|
|
1987
|
+
exampleResponse: z10.string().nullable().optional(),
|
|
1988
|
+
verified: z10.boolean(),
|
|
1989
|
+
verifiedCallCount: z10.number().optional(),
|
|
1990
|
+
active: z10.boolean().optional(),
|
|
1991
|
+
createdAt: z10.string().optional()
|
|
1992
|
+
});
|
|
1993
|
+
dataMarketplaceListResponseDataSchema = z10.object({
|
|
1994
|
+
providers: z10.array(dataMarketplaceProviderListItemSchema),
|
|
1995
|
+
count: z10.number().int().nonnegative()
|
|
1996
|
+
});
|
|
1997
|
+
dataMarketplaceCreateResponseDataSchema = z10.object({
|
|
1914
1998
|
provider: dataMarketplaceCreateProviderSchema,
|
|
1915
|
-
message:
|
|
1999
|
+
message: z10.string()
|
|
1916
2000
|
});
|
|
1917
|
-
dataMarketplaceProviderDetailResponseDataSchema =
|
|
2001
|
+
dataMarketplaceProviderDetailResponseDataSchema = z10.object({
|
|
1918
2002
|
provider: dataMarketplaceProviderDetailSchema
|
|
1919
2003
|
});
|
|
1920
2004
|
dataMarketplaceListResponseSchema = successEnvelope(dataMarketplaceListResponseDataSchema);
|
|
@@ -1923,9 +2007,9 @@ var init_data_marketplace = __esm(() => {
|
|
|
1923
2007
|
});
|
|
1924
2008
|
|
|
1925
2009
|
// ../../packages/client/src/schemas/media.ts
|
|
1926
|
-
import { z as
|
|
2010
|
+
import { z as z11 } from "zod";
|
|
1927
2011
|
function requiredString2(field, message = `Missing required field: ${field}`) {
|
|
1928
|
-
return
|
|
2012
|
+
return z11.preprocess((value) => typeof value === "string" ? value.trim() : "", z11.string().min(1, { message }));
|
|
1929
2013
|
}
|
|
1930
2014
|
var missingPresignMessage = "Missing required fields: filename, contentType", MEDIA_UPLOAD_IMAGE_TYPES, MEDIA_UPLOAD_VIDEO_TYPES, MEDIA_UPLOAD_CONTENT_TYPES, contentTypeSet, mediaUploadPresignRequestSchema, mediaUploadResponseDataSchema, mediaUploadResponseSchema, avatarGenerateRequestSchema, avatarGenerateResponseDataSchema, avatarCreditsResponseDataSchema, avatarSelectRequestSchema, avatarSelectResponseDataSchema, mediaGenerateImageRequestSchema, mediaGenerateImageResponseDataSchema, mediaGenerateImageResponseSchema, mediaGenerateVideoRequestSchema, mediaGenerateVideoResponseDataSchema, mediaGenerateVideoResponseSchema, mediaVideoJobParamsSchema, mediaVideoJobResponseDataSchema, mediaVideoJobResponseSchema, mediaImagesInfoResponseDataSchema, mediaVideosInfoResponseDataSchema, mediaImagesInfoResponseSchema, mediaVideosInfoResponseSchema;
|
|
1931
2015
|
var init_media = __esm(() => {
|
|
@@ -1945,159 +2029,159 @@ var init_media = __esm(() => {
|
|
|
1945
2029
|
...MEDIA_UPLOAD_VIDEO_TYPES
|
|
1946
2030
|
];
|
|
1947
2031
|
contentTypeSet = new Set(MEDIA_UPLOAD_CONTENT_TYPES);
|
|
1948
|
-
mediaUploadPresignRequestSchema =
|
|
2032
|
+
mediaUploadPresignRequestSchema = z11.object({
|
|
1949
2033
|
filename: requiredString2("filename", missingPresignMessage),
|
|
1950
2034
|
contentType: requiredString2("contentType", missingPresignMessage).refine((value) => contentTypeSet.has(value), { message: "Invalid content type" })
|
|
1951
2035
|
});
|
|
1952
|
-
mediaUploadResponseDataSchema =
|
|
1953
|
-
key:
|
|
1954
|
-
url:
|
|
1955
|
-
avatarUrl:
|
|
1956
|
-
uploadUrl:
|
|
1957
|
-
imageUrl:
|
|
1958
|
-
videoUrl:
|
|
1959
|
-
maxSizeBytes:
|
|
1960
|
-
contentType:
|
|
1961
|
-
expiresAt:
|
|
1962
|
-
instructions:
|
|
2036
|
+
mediaUploadResponseDataSchema = z11.object({
|
|
2037
|
+
key: z11.string(),
|
|
2038
|
+
url: z11.string().url().optional(),
|
|
2039
|
+
avatarUrl: z11.string().url().optional(),
|
|
2040
|
+
uploadUrl: z11.string().url().optional(),
|
|
2041
|
+
imageUrl: z11.string().url().optional(),
|
|
2042
|
+
videoUrl: z11.string().url().optional(),
|
|
2043
|
+
maxSizeBytes: z11.number().int().positive().optional(),
|
|
2044
|
+
contentType: z11.string().optional(),
|
|
2045
|
+
expiresAt: z11.string().optional(),
|
|
2046
|
+
instructions: z11.string().optional()
|
|
1963
2047
|
}).passthrough();
|
|
1964
2048
|
mediaUploadResponseSchema = successEnvelope(mediaUploadResponseDataSchema);
|
|
1965
|
-
avatarGenerateRequestSchema =
|
|
1966
|
-
prompt:
|
|
1967
|
-
});
|
|
1968
|
-
avatarGenerateResponseDataSchema =
|
|
1969
|
-
generationId:
|
|
1970
|
-
imageUrl:
|
|
1971
|
-
creditsRemaining:
|
|
1972
|
-
});
|
|
1973
|
-
avatarCreditsResponseDataSchema =
|
|
1974
|
-
creditsTotal:
|
|
1975
|
-
creditsUsed:
|
|
1976
|
-
creditsRemaining:
|
|
1977
|
-
generations:
|
|
1978
|
-
id:
|
|
1979
|
-
imageUrl:
|
|
1980
|
-
selected:
|
|
1981
|
-
createdAt:
|
|
2049
|
+
avatarGenerateRequestSchema = z11.object({
|
|
2050
|
+
prompt: z11.string().min(1).max(2000)
|
|
2051
|
+
});
|
|
2052
|
+
avatarGenerateResponseDataSchema = z11.object({
|
|
2053
|
+
generationId: z11.string().uuid().nullable(),
|
|
2054
|
+
imageUrl: z11.string().url(),
|
|
2055
|
+
creditsRemaining: z11.number()
|
|
2056
|
+
});
|
|
2057
|
+
avatarCreditsResponseDataSchema = z11.object({
|
|
2058
|
+
creditsTotal: z11.number(),
|
|
2059
|
+
creditsUsed: z11.number(),
|
|
2060
|
+
creditsRemaining: z11.number(),
|
|
2061
|
+
generations: z11.array(z11.object({
|
|
2062
|
+
id: z11.string().uuid(),
|
|
2063
|
+
imageUrl: z11.string().url().nullable(),
|
|
2064
|
+
selected: z11.boolean().nullable(),
|
|
2065
|
+
createdAt: z11.string()
|
|
1982
2066
|
}).passthrough())
|
|
1983
2067
|
});
|
|
1984
|
-
avatarSelectRequestSchema =
|
|
1985
|
-
generationId:
|
|
2068
|
+
avatarSelectRequestSchema = z11.object({
|
|
2069
|
+
generationId: z11.string().uuid()
|
|
1986
2070
|
});
|
|
1987
|
-
avatarSelectResponseDataSchema =
|
|
1988
|
-
avatarUrl:
|
|
1989
|
-
generationId:
|
|
2071
|
+
avatarSelectResponseDataSchema = z11.object({
|
|
2072
|
+
avatarUrl: z11.string().url(),
|
|
2073
|
+
generationId: z11.string().uuid()
|
|
1990
2074
|
});
|
|
1991
|
-
mediaGenerateImageRequestSchema =
|
|
2075
|
+
mediaGenerateImageRequestSchema = z11.object({
|
|
1992
2076
|
tradeId: requiredString2("tradeId"),
|
|
1993
2077
|
prompt: requiredString2("prompt").refine((value) => value.length <= 2000, {
|
|
1994
2078
|
message: "Prompt must be a string with max 2000 characters"
|
|
1995
2079
|
}),
|
|
1996
|
-
aspectRatio:
|
|
2080
|
+
aspectRatio: z11.enum(["16:9", "4:3", "1:1", "3:4", "9:16"]).optional()
|
|
1997
2081
|
});
|
|
1998
|
-
mediaGenerateImageResponseDataSchema =
|
|
1999
|
-
jobId:
|
|
2000
|
-
imageUrl:
|
|
2001
|
-
aspectRatio:
|
|
2002
|
-
cost:
|
|
2003
|
-
tradeId:
|
|
2082
|
+
mediaGenerateImageResponseDataSchema = z11.object({
|
|
2083
|
+
jobId: z11.string().uuid().nullable(),
|
|
2084
|
+
imageUrl: z11.string().url(),
|
|
2085
|
+
aspectRatio: z11.string(),
|
|
2086
|
+
cost: z11.number(),
|
|
2087
|
+
tradeId: z11.string()
|
|
2004
2088
|
});
|
|
2005
2089
|
mediaGenerateImageResponseSchema = successEnvelope(mediaGenerateImageResponseDataSchema);
|
|
2006
|
-
mediaGenerateVideoRequestSchema =
|
|
2007
|
-
tradeId:
|
|
2008
|
-
tokenId:
|
|
2009
|
-
prompt:
|
|
2010
|
-
aspectRatio:
|
|
2011
|
-
imagePrompt:
|
|
2012
|
-
firstFrameUrl:
|
|
2090
|
+
mediaGenerateVideoRequestSchema = z11.object({
|
|
2091
|
+
tradeId: z11.string().uuid().optional(),
|
|
2092
|
+
tokenId: z11.string().uuid().optional(),
|
|
2093
|
+
prompt: z11.string().max(1e4).optional(),
|
|
2094
|
+
aspectRatio: z11.enum(["landscape", "portrait", "16:9", "4:3", "1:1", "3:4", "9:16"]).optional(),
|
|
2095
|
+
imagePrompt: z11.string().max(2000).optional(),
|
|
2096
|
+
firstFrameUrl: z11.string().url().optional()
|
|
2013
2097
|
}).refine((data) => data.tradeId || data.tokenId, { message: "Either tradeId or tokenId is required", path: ["tradeId"] });
|
|
2014
|
-
mediaGenerateVideoResponseDataSchema =
|
|
2015
|
-
jobId:
|
|
2016
|
-
status:
|
|
2017
|
-
mediaType:
|
|
2018
|
-
provider:
|
|
2019
|
-
duration:
|
|
2020
|
-
cost:
|
|
2021
|
-
note:
|
|
2098
|
+
mediaGenerateVideoResponseDataSchema = z11.object({
|
|
2099
|
+
jobId: z11.string().uuid(),
|
|
2100
|
+
status: z11.string(),
|
|
2101
|
+
mediaType: z11.string(),
|
|
2102
|
+
provider: z11.string(),
|
|
2103
|
+
duration: z11.number(),
|
|
2104
|
+
cost: z11.number(),
|
|
2105
|
+
note: z11.string()
|
|
2022
2106
|
});
|
|
2023
2107
|
mediaGenerateVideoResponseSchema = successEnvelope(mediaGenerateVideoResponseDataSchema);
|
|
2024
|
-
mediaVideoJobParamsSchema =
|
|
2108
|
+
mediaVideoJobParamsSchema = z11.object({
|
|
2025
2109
|
jobId: requiredString2("jobId")
|
|
2026
2110
|
});
|
|
2027
|
-
mediaVideoJobResponseDataSchema =
|
|
2028
|
-
jobId:
|
|
2029
|
-
status:
|
|
2030
|
-
mediaType:
|
|
2031
|
-
tradeId:
|
|
2032
|
-
tokenId:
|
|
2033
|
-
provider:
|
|
2034
|
-
requestedDuration:
|
|
2035
|
-
actualDuration:
|
|
2036
|
-
createdAt:
|
|
2037
|
-
startedAt:
|
|
2038
|
-
completedAt:
|
|
2039
|
-
videoUrl:
|
|
2040
|
-
costUsd:
|
|
2041
|
-
errorMessage:
|
|
2042
|
-
fallbackImageUrl:
|
|
2043
|
-
firstFrameImageUrl:
|
|
2111
|
+
mediaVideoJobResponseDataSchema = z11.object({
|
|
2112
|
+
jobId: z11.string(),
|
|
2113
|
+
status: z11.string(),
|
|
2114
|
+
mediaType: z11.string(),
|
|
2115
|
+
tradeId: z11.string().nullable(),
|
|
2116
|
+
tokenId: z11.string().nullable().optional(),
|
|
2117
|
+
provider: z11.string().optional(),
|
|
2118
|
+
requestedDuration: z11.number(),
|
|
2119
|
+
actualDuration: z11.number().optional(),
|
|
2120
|
+
createdAt: z11.string(),
|
|
2121
|
+
startedAt: z11.string().optional(),
|
|
2122
|
+
completedAt: z11.string().optional(),
|
|
2123
|
+
videoUrl: z11.string().url().nullable().optional(),
|
|
2124
|
+
costUsd: z11.number().nullable().optional(),
|
|
2125
|
+
errorMessage: z11.string().nullable().optional(),
|
|
2126
|
+
fallbackImageUrl: z11.string().url().optional(),
|
|
2127
|
+
firstFrameImageUrl: z11.string().url().nullable().optional()
|
|
2044
2128
|
});
|
|
2045
2129
|
mediaVideoJobResponseSchema = successEnvelope(mediaVideoJobResponseDataSchema);
|
|
2046
|
-
mediaImagesInfoResponseDataSchema =
|
|
2047
|
-
model:
|
|
2048
|
-
description:
|
|
2049
|
-
supportedAspectRatios:
|
|
2050
|
-
cost:
|
|
2051
|
-
maxPromptLength:
|
|
2052
|
-
provider:
|
|
2053
|
-
note:
|
|
2054
|
-
usage:
|
|
2055
|
-
method:
|
|
2056
|
-
body:
|
|
2057
|
-
headers:
|
|
2130
|
+
mediaImagesInfoResponseDataSchema = z11.object({
|
|
2131
|
+
model: z11.string().optional(),
|
|
2132
|
+
description: z11.string().optional(),
|
|
2133
|
+
supportedAspectRatios: z11.array(z11.string()).optional(),
|
|
2134
|
+
cost: z11.number().optional(),
|
|
2135
|
+
maxPromptLength: z11.number().optional(),
|
|
2136
|
+
provider: z11.string().optional(),
|
|
2137
|
+
note: z11.string().optional(),
|
|
2138
|
+
usage: z11.object({
|
|
2139
|
+
method: z11.string(),
|
|
2140
|
+
body: z11.record(z11.string(), z11.string()),
|
|
2141
|
+
headers: z11.record(z11.string(), z11.string())
|
|
2058
2142
|
}).optional(),
|
|
2059
|
-
videoAlternative:
|
|
2060
|
-
endpoint:
|
|
2061
|
-
note:
|
|
2143
|
+
videoAlternative: z11.object({
|
|
2144
|
+
endpoint: z11.string(),
|
|
2145
|
+
note: z11.string()
|
|
2062
2146
|
}).optional(),
|
|
2063
|
-
yourStats:
|
|
2064
|
-
qualifyingTradesForImage:
|
|
2065
|
-
imagesGenerated:
|
|
2066
|
-
availableForImage:
|
|
2067
|
-
recentAvailableTrades:
|
|
2068
|
-
tradeId:
|
|
2069
|
-
valueUsd:
|
|
2147
|
+
yourStats: z11.object({
|
|
2148
|
+
qualifyingTradesForImage: z11.number(),
|
|
2149
|
+
imagesGenerated: z11.number(),
|
|
2150
|
+
availableForImage: z11.number(),
|
|
2151
|
+
recentAvailableTrades: z11.array(z11.object({
|
|
2152
|
+
tradeId: z11.string(),
|
|
2153
|
+
valueUsd: z11.number()
|
|
2070
2154
|
}))
|
|
2071
2155
|
}).optional()
|
|
2072
2156
|
}).passthrough();
|
|
2073
|
-
mediaVideosInfoResponseDataSchema =
|
|
2074
|
-
description:
|
|
2075
|
-
tiers:
|
|
2076
|
-
duration:
|
|
2077
|
-
cost:
|
|
2157
|
+
mediaVideosInfoResponseDataSchema = z11.object({
|
|
2158
|
+
description: z11.string().optional(),
|
|
2159
|
+
tiers: z11.record(z11.string(), z11.object({
|
|
2160
|
+
duration: z11.number(),
|
|
2161
|
+
cost: z11.number()
|
|
2078
2162
|
}).passthrough()).optional(),
|
|
2079
|
-
providers:
|
|
2080
|
-
limits:
|
|
2081
|
-
usage:
|
|
2082
|
-
method:
|
|
2083
|
-
body:
|
|
2084
|
-
headers:
|
|
2163
|
+
providers: z11.array(z11.string()).optional(),
|
|
2164
|
+
limits: z11.record(z11.string(), z11.unknown()).optional(),
|
|
2165
|
+
usage: z11.object({
|
|
2166
|
+
method: z11.string(),
|
|
2167
|
+
body: z11.record(z11.string(), z11.string()),
|
|
2168
|
+
headers: z11.record(z11.string(), z11.string())
|
|
2085
2169
|
}).optional(),
|
|
2086
|
-
statusCheck:
|
|
2087
|
-
method:
|
|
2088
|
-
endpoint:
|
|
2170
|
+
statusCheck: z11.object({
|
|
2171
|
+
method: z11.string(),
|
|
2172
|
+
endpoint: z11.string()
|
|
2089
2173
|
}).optional(),
|
|
2090
|
-
yourStats:
|
|
2091
|
-
qualifyingTrades:
|
|
2092
|
-
videosGenerated:
|
|
2093
|
-
availableForVideo:
|
|
2094
|
-
recentQualifyingTrades:
|
|
2095
|
-
tradeId:
|
|
2096
|
-
valueUsd:
|
|
2097
|
-
tier:
|
|
2098
|
-
type:
|
|
2099
|
-
duration:
|
|
2100
|
-
cost:
|
|
2174
|
+
yourStats: z11.object({
|
|
2175
|
+
qualifyingTrades: z11.number(),
|
|
2176
|
+
videosGenerated: z11.number(),
|
|
2177
|
+
availableForVideo: z11.number(),
|
|
2178
|
+
recentQualifyingTrades: z11.array(z11.object({
|
|
2179
|
+
tradeId: z11.string(),
|
|
2180
|
+
valueUsd: z11.number(),
|
|
2181
|
+
tier: z11.object({
|
|
2182
|
+
type: z11.string(),
|
|
2183
|
+
duration: z11.number(),
|
|
2184
|
+
cost: z11.number()
|
|
2101
2185
|
}).passthrough()
|
|
2102
2186
|
}))
|
|
2103
2187
|
}).optional()
|
|
@@ -2113,6 +2197,7 @@ var init_agent = __esm(() => {
|
|
|
2113
2197
|
init_posts();
|
|
2114
2198
|
init_agents();
|
|
2115
2199
|
init_trade();
|
|
2200
|
+
init_hyperliquid();
|
|
2116
2201
|
init_incubator();
|
|
2117
2202
|
init_groups();
|
|
2118
2203
|
init_tokens();
|
|
@@ -2215,10 +2300,20 @@ var init_agent = __esm(() => {
|
|
|
2215
2300
|
const body = policyUpdateRequestSchema.parse(updates);
|
|
2216
2301
|
return this.request({ method: "PATCH", path: "/agents/me/policies", body, headers: this.authHeaders() }, policyUpdateResponseDataSchema);
|
|
2217
2302
|
}
|
|
2303
|
+
async setupHyperliquid(sourceChain) {
|
|
2304
|
+
return this.request({ method: "POST", path: "/hyperliquid/setup", body: sourceChain ? { sourceChain } : {}, headers: this.authHeaders() }, hyperliquidSetupResponseDataSchema);
|
|
2305
|
+
}
|
|
2306
|
+
async getHyperliquidAccount() {
|
|
2307
|
+
return this.request({ method: "GET", path: "/hyperliquid/account", headers: this.authHeaders() }, hyperliquidAccountResponseDataSchema);
|
|
2308
|
+
}
|
|
2218
2309
|
async trade(req) {
|
|
2219
2310
|
const body = tradeRequestSchema.parse(req);
|
|
2220
2311
|
return this.request({ method: "POST", path: "/trade", body, headers: this.authHeaders() }, tradeResponseDataSchema);
|
|
2221
2312
|
}
|
|
2313
|
+
async quote(req) {
|
|
2314
|
+
const body = solanaTradeRequestSchema.parse({ ...req, dryRun: true });
|
|
2315
|
+
return this.request({ method: "POST", path: "/trade", body, headers: this.authHeaders() }, dryRunResponseDataSchema);
|
|
2316
|
+
}
|
|
2222
2317
|
async getTokenInfo(token) {
|
|
2223
2318
|
return this.request({ method: "GET", path: `/tokens/${encodeURIComponent(token)}`, headers: this.authHeaders() }, tokenInfoResponseDataSchema);
|
|
2224
2319
|
}
|
|
@@ -2417,430 +2512,430 @@ var init_autonomous = __esm(() => {
|
|
|
2417
2512
|
});
|
|
2418
2513
|
|
|
2419
2514
|
// ../../packages/client/src/schemas/admin.ts
|
|
2420
|
-
import { z as
|
|
2515
|
+
import { z as z12 } from "zod";
|
|
2421
2516
|
var adminDisputeResolutions, adminDisputeParamsSchema, adminDisputesQuerySchema, adminResolveDisputeRequestSchema, adminDisputesResponseDataSchema, adminResolveDisputeResponseDataSchema, adminAgentsResponseDataSchema, adminTurnsResponseDataSchema, adminMessageAgentsRequestSchema, adminMessageAgentsResponseDataSchema, adminPendingPayoutsResponseDataSchema, adminProcessPayoutRequestSchema, adminProcessPayoutResponseDataSchema, adminApprovePayoutRequestSchema, adminSkipPayoutRequestSchema, adminForfeitPayoutRequestSchema, adminRecordTxRequestSchema, adminApprovalQueueResponseDataSchema, adminApprovePayoutResponseDataSchema, adminSkipPayoutResponseDataSchema, adminForfeitPayoutResponseDataSchema, adminRecordTxResponseDataSchema, adminReferrerIdParamsSchema, adminReferralOverviewResponseDataSchema, adminReferralTradesQuerySchema, adminReferralTradesResponseDataSchema, adminReferralGamingSignalSchema, adminReferralSignalsResponseDataSchema, adminAgentIdParamsSchema, adminCreateAgentRequestSchema, adminUpdateAgentRequestSchema, adminUserIdParamsSchema, adminUsersQuerySchema, adminUpdateUserRequestSchema, adminCreateAgentResponseDataSchema, adminUpdateAgentResponseDataSchema, adminUsersResponseDataSchema, adminUpdateUserResponseDataSchema, adminIncubatorBirthRequestSchema, adminIncubatorAdjustRequestSchema, adminIncubatorWalletRequestSchema, adminIncubatorTransactionsQuerySchema, adminIncubatorPoolResponseDataSchema, adminIncubatorTransactionSchema, adminIncubatorTransactionsResponseDataSchema, adminIncubatorBirthResponseDataSchema, adminIncubatorAdjustResponseDataSchema, adminIncubatorWalletResponseDataSchema, adminDisputesResponseSchema, adminResolveDisputeResponseSchema, adminMessageAgentsResponseSchema, adminIncubatorPoolResponseSchema, adminIncubatorTransactionsResponseSchema, adminIncubatorBirthResponseSchema, adminIncubatorAdjustResponseSchema, adminIncubatorWalletResponseSchema;
|
|
2422
2517
|
var init_admin = __esm(() => {
|
|
2423
2518
|
init_common();
|
|
2424
2519
|
adminDisputeResolutions = ["human_wins", "agent_wins", "split"];
|
|
2425
|
-
adminDisputeParamsSchema =
|
|
2426
|
-
disputeId:
|
|
2427
|
-
});
|
|
2428
|
-
adminDisputesQuerySchema =
|
|
2429
|
-
status:
|
|
2430
|
-
limit:
|
|
2431
|
-
offset:
|
|
2432
|
-
});
|
|
2433
|
-
adminResolveDisputeRequestSchema =
|
|
2434
|
-
resolution:
|
|
2435
|
-
note:
|
|
2436
|
-
});
|
|
2437
|
-
adminDisputesResponseDataSchema =
|
|
2438
|
-
disputes:
|
|
2439
|
-
id:
|
|
2440
|
-
taskId:
|
|
2441
|
-
initiatedBy:
|
|
2442
|
-
reason:
|
|
2443
|
-
evidenceUrls:
|
|
2444
|
-
resolution:
|
|
2445
|
-
resolvedBy:
|
|
2446
|
-
resolvedAt:
|
|
2447
|
-
createdAt:
|
|
2448
|
-
task:
|
|
2449
|
-
id:
|
|
2450
|
-
agentId:
|
|
2451
|
-
agentName:
|
|
2452
|
-
title:
|
|
2453
|
-
budgetUsd:
|
|
2454
|
-
status:
|
|
2455
|
-
assignedTo:
|
|
2520
|
+
adminDisputeParamsSchema = z12.object({
|
|
2521
|
+
disputeId: z12.string().uuid()
|
|
2522
|
+
});
|
|
2523
|
+
adminDisputesQuerySchema = z12.object({
|
|
2524
|
+
status: z12.enum(["pending", ...adminDisputeResolutions]).default("pending"),
|
|
2525
|
+
limit: z12.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
|
|
2526
|
+
offset: z12.coerce.number().int().min(0).default(0)
|
|
2527
|
+
});
|
|
2528
|
+
adminResolveDisputeRequestSchema = z12.object({
|
|
2529
|
+
resolution: z12.enum(adminDisputeResolutions),
|
|
2530
|
+
note: z12.string().trim().max(4000).optional()
|
|
2531
|
+
});
|
|
2532
|
+
adminDisputesResponseDataSchema = z12.object({
|
|
2533
|
+
disputes: z12.array(z12.object({
|
|
2534
|
+
id: z12.string().uuid(),
|
|
2535
|
+
taskId: z12.string().uuid(),
|
|
2536
|
+
initiatedBy: z12.string(),
|
|
2537
|
+
reason: z12.string(),
|
|
2538
|
+
evidenceUrls: z12.array(z12.string()).nullable(),
|
|
2539
|
+
resolution: z12.string(),
|
|
2540
|
+
resolvedBy: z12.string().nullable(),
|
|
2541
|
+
resolvedAt: z12.string().nullable(),
|
|
2542
|
+
createdAt: z12.string(),
|
|
2543
|
+
task: z12.object({
|
|
2544
|
+
id: z12.string().uuid(),
|
|
2545
|
+
agentId: z12.string().uuid(),
|
|
2546
|
+
agentName: z12.string().nullable(),
|
|
2547
|
+
title: z12.string(),
|
|
2548
|
+
budgetUsd: z12.number(),
|
|
2549
|
+
status: z12.string(),
|
|
2550
|
+
assignedTo: z12.string().uuid().nullable()
|
|
2456
2551
|
}).nullable()
|
|
2457
2552
|
})),
|
|
2458
|
-
count:
|
|
2459
|
-
pagination:
|
|
2460
|
-
limit:
|
|
2461
|
-
offset:
|
|
2462
|
-
hasMore:
|
|
2553
|
+
count: z12.number(),
|
|
2554
|
+
pagination: z12.object({
|
|
2555
|
+
limit: z12.number(),
|
|
2556
|
+
offset: z12.number(),
|
|
2557
|
+
hasMore: z12.boolean()
|
|
2463
2558
|
})
|
|
2464
2559
|
});
|
|
2465
|
-
adminResolveDisputeResponseDataSchema =
|
|
2466
|
-
dispute:
|
|
2467
|
-
id:
|
|
2468
|
-
taskId:
|
|
2469
|
-
resolution:
|
|
2470
|
-
resolvedBy:
|
|
2471
|
-
payoutTx:
|
|
2472
|
-
newTaskStatus:
|
|
2560
|
+
adminResolveDisputeResponseDataSchema = z12.object({
|
|
2561
|
+
dispute: z12.object({
|
|
2562
|
+
id: z12.string().uuid(),
|
|
2563
|
+
taskId: z12.string().uuid(),
|
|
2564
|
+
resolution: z12.string(),
|
|
2565
|
+
resolvedBy: z12.string(),
|
|
2566
|
+
payoutTx: z12.string().nullable(),
|
|
2567
|
+
newTaskStatus: z12.string()
|
|
2473
2568
|
})
|
|
2474
2569
|
});
|
|
2475
|
-
adminAgentsResponseDataSchema =
|
|
2476
|
-
agents:
|
|
2477
|
-
id:
|
|
2478
|
-
name:
|
|
2479
|
-
handle:
|
|
2480
|
-
avatarUrl:
|
|
2481
|
-
solanaAddress:
|
|
2482
|
-
generation:
|
|
2483
|
-
bornAt:
|
|
2484
|
-
diedAt:
|
|
2485
|
-
isAlive:
|
|
2486
|
-
llmModel:
|
|
2487
|
-
llmUsageUsd:
|
|
2488
|
-
llmBudgetUsd:
|
|
2489
|
-
serverPlan:
|
|
2490
|
-
totalValueUsd:
|
|
2491
|
-
pnlAllTime:
|
|
2492
|
-
totalTurns:
|
|
2493
|
-
totalCostUsd:
|
|
2494
|
-
totalEntries:
|
|
2495
|
-
lastTurnAt:
|
|
2496
|
-
lastEntryPreview:
|
|
2570
|
+
adminAgentsResponseDataSchema = z12.object({
|
|
2571
|
+
agents: z12.array(z12.object({
|
|
2572
|
+
id: z12.string().uuid(),
|
|
2573
|
+
name: z12.string(),
|
|
2574
|
+
handle: z12.string().nullable(),
|
|
2575
|
+
avatarUrl: z12.string().nullable(),
|
|
2576
|
+
solanaAddress: z12.string().nullable(),
|
|
2577
|
+
generation: z12.number().nullable(),
|
|
2578
|
+
bornAt: z12.string().nullable(),
|
|
2579
|
+
diedAt: z12.string().nullable(),
|
|
2580
|
+
isAlive: z12.boolean(),
|
|
2581
|
+
llmModel: z12.string().nullable(),
|
|
2582
|
+
llmUsageUsd: z12.number().nullable(),
|
|
2583
|
+
llmBudgetUsd: z12.number().nullable(),
|
|
2584
|
+
serverPlan: z12.string().nullable(),
|
|
2585
|
+
totalValueUsd: z12.number(),
|
|
2586
|
+
pnlAllTime: z12.number(),
|
|
2587
|
+
totalTurns: z12.number(),
|
|
2588
|
+
totalCostUsd: z12.number(),
|
|
2589
|
+
totalEntries: z12.number(),
|
|
2590
|
+
lastTurnAt: z12.string().nullable(),
|
|
2591
|
+
lastEntryPreview: z12.string().nullable()
|
|
2497
2592
|
})),
|
|
2498
|
-
count:
|
|
2499
|
-
});
|
|
2500
|
-
adminTurnsResponseDataSchema =
|
|
2501
|
-
turns:
|
|
2502
|
-
id:
|
|
2503
|
-
piEntryId:
|
|
2504
|
-
parentPiEntryId:
|
|
2505
|
-
entryType:
|
|
2506
|
-
seq:
|
|
2507
|
-
timestamp:
|
|
2508
|
-
role:
|
|
2509
|
-
contentPreview:
|
|
2510
|
-
model:
|
|
2511
|
-
provider:
|
|
2512
|
-
toolName:
|
|
2513
|
-
tokenInput:
|
|
2514
|
-
tokenOutput:
|
|
2515
|
-
costUsd:
|
|
2516
|
-
sourceType:
|
|
2517
|
-
sourceRef:
|
|
2518
|
-
payload:
|
|
2593
|
+
count: z12.number()
|
|
2594
|
+
});
|
|
2595
|
+
adminTurnsResponseDataSchema = z12.object({
|
|
2596
|
+
turns: z12.array(z12.object({
|
|
2597
|
+
id: z12.number(),
|
|
2598
|
+
piEntryId: z12.string().nullable(),
|
|
2599
|
+
parentPiEntryId: z12.string().nullable(),
|
|
2600
|
+
entryType: z12.string().nullable(),
|
|
2601
|
+
seq: z12.number().nullable(),
|
|
2602
|
+
timestamp: z12.string().nullable(),
|
|
2603
|
+
role: z12.string().nullable(),
|
|
2604
|
+
contentPreview: z12.string().nullable(),
|
|
2605
|
+
model: z12.string().nullable(),
|
|
2606
|
+
provider: z12.string().nullable(),
|
|
2607
|
+
toolName: z12.string().nullable(),
|
|
2608
|
+
tokenInput: z12.number().nullable(),
|
|
2609
|
+
tokenOutput: z12.number().nullable(),
|
|
2610
|
+
costUsd: z12.number().nullable(),
|
|
2611
|
+
sourceType: z12.string().nullable(),
|
|
2612
|
+
sourceRef: z12.string().nullable(),
|
|
2613
|
+
payload: z12.unknown().nullable()
|
|
2519
2614
|
})),
|
|
2520
|
-
page:
|
|
2521
|
-
pageSize:
|
|
2615
|
+
page: z12.number(),
|
|
2616
|
+
pageSize: z12.number()
|
|
2522
2617
|
});
|
|
2523
|
-
adminMessageAgentsRequestSchema =
|
|
2524
|
-
message:
|
|
2525
|
-
agentIds:
|
|
2526
|
-
broadcast:
|
|
2618
|
+
adminMessageAgentsRequestSchema = z12.object({
|
|
2619
|
+
message: z12.string().trim().min(1, "Message is required").max(4000),
|
|
2620
|
+
agentIds: z12.array(z12.string().uuid()).min(1).optional(),
|
|
2621
|
+
broadcast: z12.boolean().optional()
|
|
2527
2622
|
}).refine((data) => data.agentIds && data.agentIds.length > 0 || data.broadcast === true, { message: "Provide agentIds or set broadcast to true" }).refine((data) => !(data.agentIds && data.agentIds.length > 0 && data.broadcast === true), { message: "Cannot specify both agentIds and broadcast" });
|
|
2528
|
-
adminMessageAgentsResponseDataSchema =
|
|
2529
|
-
sent:
|
|
2530
|
-
agentIds:
|
|
2531
|
-
});
|
|
2532
|
-
adminPendingPayoutsResponseDataSchema =
|
|
2533
|
-
min_payout_usd:
|
|
2534
|
-
pending_payouts:
|
|
2535
|
-
referrer_id:
|
|
2536
|
-
name:
|
|
2537
|
-
handle:
|
|
2538
|
-
payout_wallet:
|
|
2539
|
-
referral_count:
|
|
2540
|
-
total_volume_usd:
|
|
2541
|
-
total_earned:
|
|
2542
|
-
total_paid_out:
|
|
2543
|
-
pending_amount:
|
|
2544
|
-
solana_earned:
|
|
2545
|
-
hyperliquid_earned:
|
|
2546
|
-
dbc_pool_earned:
|
|
2623
|
+
adminMessageAgentsResponseDataSchema = z12.object({
|
|
2624
|
+
sent: z12.number(),
|
|
2625
|
+
agentIds: z12.array(z12.string().uuid())
|
|
2626
|
+
});
|
|
2627
|
+
adminPendingPayoutsResponseDataSchema = z12.object({
|
|
2628
|
+
min_payout_usd: z12.number().optional(),
|
|
2629
|
+
pending_payouts: z12.array(z12.object({
|
|
2630
|
+
referrer_id: z12.string(),
|
|
2631
|
+
name: z12.string(),
|
|
2632
|
+
handle: z12.string().nullable().optional(),
|
|
2633
|
+
payout_wallet: z12.string().nullable().optional(),
|
|
2634
|
+
referral_count: z12.number(),
|
|
2635
|
+
total_volume_usd: z12.number(),
|
|
2636
|
+
total_earned: z12.number(),
|
|
2637
|
+
total_paid_out: z12.number(),
|
|
2638
|
+
pending_amount: z12.number(),
|
|
2639
|
+
solana_earned: z12.number(),
|
|
2640
|
+
hyperliquid_earned: z12.number(),
|
|
2641
|
+
dbc_pool_earned: z12.number()
|
|
2547
2642
|
}))
|
|
2548
2643
|
});
|
|
2549
|
-
adminProcessPayoutRequestSchema =
|
|
2550
|
-
referrer_id:
|
|
2551
|
-
amount:
|
|
2552
|
-
tx_signature:
|
|
2644
|
+
adminProcessPayoutRequestSchema = z12.object({
|
|
2645
|
+
referrer_id: z12.string().min(1),
|
|
2646
|
+
amount: z12.number().finite().positive().max(1e5),
|
|
2647
|
+
tx_signature: z12.string().min(1)
|
|
2553
2648
|
});
|
|
2554
|
-
adminProcessPayoutResponseDataSchema =
|
|
2555
|
-
payout_id:
|
|
2556
|
-
referrer:
|
|
2557
|
-
id:
|
|
2558
|
-
name:
|
|
2649
|
+
adminProcessPayoutResponseDataSchema = z12.object({
|
|
2650
|
+
payout_id: z12.string(),
|
|
2651
|
+
referrer: z12.object({
|
|
2652
|
+
id: z12.string(),
|
|
2653
|
+
name: z12.string().nullable()
|
|
2559
2654
|
}),
|
|
2560
|
-
amount:
|
|
2561
|
-
wallet_address:
|
|
2562
|
-
tx_signature:
|
|
2563
|
-
status:
|
|
2564
|
-
});
|
|
2565
|
-
adminApprovePayoutRequestSchema =
|
|
2566
|
-
referrer_id:
|
|
2567
|
-
amount:
|
|
2568
|
-
notes:
|
|
2569
|
-
});
|
|
2570
|
-
adminSkipPayoutRequestSchema =
|
|
2571
|
-
referrer_id:
|
|
2572
|
-
notes:
|
|
2573
|
-
});
|
|
2574
|
-
adminForfeitPayoutRequestSchema =
|
|
2575
|
-
referrer_id:
|
|
2576
|
-
amount:
|
|
2577
|
-
notes:
|
|
2578
|
-
});
|
|
2579
|
-
adminRecordTxRequestSchema =
|
|
2580
|
-
payout_id:
|
|
2581
|
-
tx_signature:
|
|
2582
|
-
});
|
|
2583
|
-
adminApprovalQueueResponseDataSchema =
|
|
2584
|
-
referrers:
|
|
2585
|
-
referrerId:
|
|
2586
|
-
name:
|
|
2587
|
-
handle:
|
|
2588
|
-
payoutWallet:
|
|
2589
|
-
pendingAmount:
|
|
2590
|
-
referralCount:
|
|
2591
|
-
totalVolumeUsd:
|
|
2592
|
-
totalEarned:
|
|
2593
|
-
totalPaidOut:
|
|
2594
|
-
overallRisk:
|
|
2655
|
+
amount: z12.number(),
|
|
2656
|
+
wallet_address: z12.string(),
|
|
2657
|
+
tx_signature: z12.string(),
|
|
2658
|
+
status: z12.string()
|
|
2659
|
+
});
|
|
2660
|
+
adminApprovePayoutRequestSchema = z12.object({
|
|
2661
|
+
referrer_id: z12.string().uuid(),
|
|
2662
|
+
amount: z12.number().finite().positive().min(5),
|
|
2663
|
+
notes: z12.string().trim().max(1000).optional()
|
|
2664
|
+
});
|
|
2665
|
+
adminSkipPayoutRequestSchema = z12.object({
|
|
2666
|
+
referrer_id: z12.string().uuid(),
|
|
2667
|
+
notes: z12.string().trim().max(1000).optional()
|
|
2668
|
+
});
|
|
2669
|
+
adminForfeitPayoutRequestSchema = z12.object({
|
|
2670
|
+
referrer_id: z12.string().uuid(),
|
|
2671
|
+
amount: z12.number().finite().positive(),
|
|
2672
|
+
notes: z12.string().trim().min(1).max(1000)
|
|
2673
|
+
});
|
|
2674
|
+
adminRecordTxRequestSchema = z12.object({
|
|
2675
|
+
payout_id: z12.string().uuid(),
|
|
2676
|
+
tx_signature: z12.string().min(1)
|
|
2677
|
+
});
|
|
2678
|
+
adminApprovalQueueResponseDataSchema = z12.object({
|
|
2679
|
+
referrers: z12.array(z12.object({
|
|
2680
|
+
referrerId: z12.string(),
|
|
2681
|
+
name: z12.string(),
|
|
2682
|
+
handle: z12.string().nullable(),
|
|
2683
|
+
payoutWallet: z12.string().nullable(),
|
|
2684
|
+
pendingAmount: z12.number(),
|
|
2685
|
+
referralCount: z12.number(),
|
|
2686
|
+
totalVolumeUsd: z12.number(),
|
|
2687
|
+
totalEarned: z12.number(),
|
|
2688
|
+
totalPaidOut: z12.number(),
|
|
2689
|
+
overallRisk: z12.enum(["low", "medium", "high"]).optional()
|
|
2595
2690
|
})),
|
|
2596
|
-
approvedPayouts:
|
|
2597
|
-
id:
|
|
2598
|
-
referrerId:
|
|
2599
|
-
referrerName:
|
|
2600
|
-
amount:
|
|
2601
|
-
approvedAt:
|
|
2602
|
-
notes:
|
|
2691
|
+
approvedPayouts: z12.array(z12.object({
|
|
2692
|
+
id: z12.string(),
|
|
2693
|
+
referrerId: z12.string(),
|
|
2694
|
+
referrerName: z12.string(),
|
|
2695
|
+
amount: z12.number(),
|
|
2696
|
+
approvedAt: z12.string(),
|
|
2697
|
+
notes: z12.string().nullable()
|
|
2603
2698
|
}))
|
|
2604
2699
|
});
|
|
2605
|
-
adminApprovePayoutResponseDataSchema =
|
|
2606
|
-
payout:
|
|
2607
|
-
id:
|
|
2608
|
-
referrerId:
|
|
2609
|
-
referrerName:
|
|
2610
|
-
amount:
|
|
2611
|
-
wallet:
|
|
2612
|
-
status:
|
|
2613
|
-
approvedAt:
|
|
2614
|
-
notes:
|
|
2700
|
+
adminApprovePayoutResponseDataSchema = z12.object({
|
|
2701
|
+
payout: z12.object({
|
|
2702
|
+
id: z12.string(),
|
|
2703
|
+
referrerId: z12.string(),
|
|
2704
|
+
referrerName: z12.string(),
|
|
2705
|
+
amount: z12.number(),
|
|
2706
|
+
wallet: z12.string(),
|
|
2707
|
+
status: z12.literal("approved"),
|
|
2708
|
+
approvedAt: z12.string(),
|
|
2709
|
+
notes: z12.string().nullable()
|
|
2615
2710
|
})
|
|
2616
2711
|
});
|
|
2617
|
-
adminSkipPayoutResponseDataSchema =
|
|
2618
|
-
payout:
|
|
2619
|
-
id:
|
|
2620
|
-
referrerId:
|
|
2621
|
-
status:
|
|
2622
|
-
periodStart:
|
|
2623
|
-
periodEnd:
|
|
2624
|
-
notes:
|
|
2712
|
+
adminSkipPayoutResponseDataSchema = z12.object({
|
|
2713
|
+
payout: z12.object({
|
|
2714
|
+
id: z12.string(),
|
|
2715
|
+
referrerId: z12.string(),
|
|
2716
|
+
status: z12.literal("skipped"),
|
|
2717
|
+
periodStart: z12.string(),
|
|
2718
|
+
periodEnd: z12.string(),
|
|
2719
|
+
notes: z12.string().nullable()
|
|
2625
2720
|
})
|
|
2626
2721
|
});
|
|
2627
|
-
adminForfeitPayoutResponseDataSchema =
|
|
2628
|
-
payout:
|
|
2629
|
-
id:
|
|
2630
|
-
referrerId:
|
|
2631
|
-
amount:
|
|
2632
|
-
status:
|
|
2633
|
-
notes:
|
|
2722
|
+
adminForfeitPayoutResponseDataSchema = z12.object({
|
|
2723
|
+
payout: z12.object({
|
|
2724
|
+
id: z12.string(),
|
|
2725
|
+
referrerId: z12.string(),
|
|
2726
|
+
amount: z12.number(),
|
|
2727
|
+
status: z12.literal("forfeited"),
|
|
2728
|
+
notes: z12.string()
|
|
2634
2729
|
})
|
|
2635
2730
|
});
|
|
2636
|
-
adminRecordTxResponseDataSchema =
|
|
2637
|
-
payout:
|
|
2638
|
-
id:
|
|
2639
|
-
referrerId:
|
|
2640
|
-
amount:
|
|
2641
|
-
status:
|
|
2642
|
-
txSignature:
|
|
2643
|
-
completedAt:
|
|
2731
|
+
adminRecordTxResponseDataSchema = z12.object({
|
|
2732
|
+
payout: z12.object({
|
|
2733
|
+
id: z12.string(),
|
|
2734
|
+
referrerId: z12.string(),
|
|
2735
|
+
amount: z12.number(),
|
|
2736
|
+
status: z12.literal("completed"),
|
|
2737
|
+
txSignature: z12.string(),
|
|
2738
|
+
completedAt: z12.string().nullable()
|
|
2644
2739
|
})
|
|
2645
2740
|
});
|
|
2646
|
-
adminReferrerIdParamsSchema =
|
|
2647
|
-
referrerId:
|
|
2648
|
-
});
|
|
2649
|
-
adminReferralOverviewResponseDataSchema =
|
|
2650
|
-
totalReferrers:
|
|
2651
|
-
totalReferees:
|
|
2652
|
-
totalVolumeUsd:
|
|
2653
|
-
totalEarned:
|
|
2654
|
-
totalPaidOut:
|
|
2655
|
-
totalPending:
|
|
2656
|
-
topReferrers:
|
|
2657
|
-
referrerId:
|
|
2658
|
-
name:
|
|
2659
|
-
handle:
|
|
2660
|
-
payoutWallet:
|
|
2661
|
-
referralCount:
|
|
2662
|
-
totalVolumeUsd:
|
|
2663
|
-
totalEarned:
|
|
2664
|
-
totalPaidOut:
|
|
2665
|
-
pendingAmount:
|
|
2666
|
-
solanaEarned:
|
|
2667
|
-
hyperliquidEarned:
|
|
2668
|
-
dbcPoolEarned:
|
|
2741
|
+
adminReferrerIdParamsSchema = z12.object({
|
|
2742
|
+
referrerId: z12.string().uuid()
|
|
2743
|
+
});
|
|
2744
|
+
adminReferralOverviewResponseDataSchema = z12.object({
|
|
2745
|
+
totalReferrers: z12.number(),
|
|
2746
|
+
totalReferees: z12.number(),
|
|
2747
|
+
totalVolumeUsd: z12.number(),
|
|
2748
|
+
totalEarned: z12.number(),
|
|
2749
|
+
totalPaidOut: z12.number(),
|
|
2750
|
+
totalPending: z12.number(),
|
|
2751
|
+
topReferrers: z12.array(z12.object({
|
|
2752
|
+
referrerId: z12.string(),
|
|
2753
|
+
name: z12.string(),
|
|
2754
|
+
handle: z12.string().nullable(),
|
|
2755
|
+
payoutWallet: z12.string().nullable(),
|
|
2756
|
+
referralCount: z12.number(),
|
|
2757
|
+
totalVolumeUsd: z12.number(),
|
|
2758
|
+
totalEarned: z12.number(),
|
|
2759
|
+
totalPaidOut: z12.number(),
|
|
2760
|
+
pendingAmount: z12.number(),
|
|
2761
|
+
solanaEarned: z12.number(),
|
|
2762
|
+
hyperliquidEarned: z12.number(),
|
|
2763
|
+
dbcPoolEarned: z12.number()
|
|
2669
2764
|
}))
|
|
2670
2765
|
});
|
|
2671
|
-
adminReferralTradesQuerySchema =
|
|
2672
|
-
limit:
|
|
2673
|
-
offset:
|
|
2674
|
-
});
|
|
2675
|
-
adminReferralTradesResponseDataSchema =
|
|
2676
|
-
trades:
|
|
2677
|
-
id:
|
|
2678
|
-
chain:
|
|
2679
|
-
agentId:
|
|
2680
|
-
refereeName:
|
|
2681
|
-
refereeHandle:
|
|
2682
|
-
tokenAddress:
|
|
2683
|
-
valueUsd:
|
|
2684
|
-
feeAmount:
|
|
2685
|
-
referrerFeeBps:
|
|
2686
|
-
treasuryFeeBps:
|
|
2687
|
-
referrerEarnedUsd:
|
|
2688
|
-
txSignature:
|
|
2689
|
-
timestamp:
|
|
2766
|
+
adminReferralTradesQuerySchema = z12.object({
|
|
2767
|
+
limit: z12.coerce.number().int().min(1).default(50).transform((v) => Math.min(v, 100)),
|
|
2768
|
+
offset: z12.coerce.number().int().min(0).default(0)
|
|
2769
|
+
});
|
|
2770
|
+
adminReferralTradesResponseDataSchema = z12.object({
|
|
2771
|
+
trades: z12.array(z12.object({
|
|
2772
|
+
id: z12.string(),
|
|
2773
|
+
chain: z12.string(),
|
|
2774
|
+
agentId: z12.string(),
|
|
2775
|
+
refereeName: z12.string(),
|
|
2776
|
+
refereeHandle: z12.string().nullable(),
|
|
2777
|
+
tokenAddress: z12.string(),
|
|
2778
|
+
valueUsd: z12.number(),
|
|
2779
|
+
feeAmount: z12.number(),
|
|
2780
|
+
referrerFeeBps: z12.number().nullable(),
|
|
2781
|
+
treasuryFeeBps: z12.number().nullable(),
|
|
2782
|
+
referrerEarnedUsd: z12.number(),
|
|
2783
|
+
txSignature: z12.string().nullable(),
|
|
2784
|
+
timestamp: z12.string().nullable()
|
|
2690
2785
|
})),
|
|
2691
|
-
pagination:
|
|
2692
|
-
limit:
|
|
2693
|
-
offset:
|
|
2694
|
-
total:
|
|
2695
|
-
hasMore:
|
|
2786
|
+
pagination: z12.object({
|
|
2787
|
+
limit: z12.number(),
|
|
2788
|
+
offset: z12.number(),
|
|
2789
|
+
total: z12.number(),
|
|
2790
|
+
hasMore: z12.boolean()
|
|
2696
2791
|
})
|
|
2697
2792
|
});
|
|
2698
|
-
adminReferralGamingSignalSchema =
|
|
2699
|
-
type:
|
|
2700
|
-
severity:
|
|
2701
|
-
description:
|
|
2702
|
-
evidence:
|
|
2703
|
-
});
|
|
2704
|
-
adminReferralSignalsResponseDataSchema =
|
|
2705
|
-
referrerId:
|
|
2706
|
-
overallRisk:
|
|
2707
|
-
signals:
|
|
2708
|
-
});
|
|
2709
|
-
adminAgentIdParamsSchema =
|
|
2710
|
-
agentId:
|
|
2711
|
-
});
|
|
2712
|
-
adminCreateAgentRequestSchema =
|
|
2713
|
-
name:
|
|
2714
|
-
handle:
|
|
2715
|
-
bio:
|
|
2716
|
-
avatarUrl:
|
|
2717
|
-
generation:
|
|
2718
|
-
serverPlan:
|
|
2719
|
-
llmModel:
|
|
2720
|
-
llmBudgetUsd:
|
|
2721
|
-
inboxPriceUsd:
|
|
2722
|
-
});
|
|
2723
|
-
adminUpdateAgentRequestSchema =
|
|
2724
|
-
name:
|
|
2725
|
-
handle:
|
|
2726
|
-
bio:
|
|
2727
|
-
avatarUrl:
|
|
2728
|
-
llmModel:
|
|
2729
|
-
llmBudgetUsd:
|
|
2730
|
-
serverPlan:
|
|
2731
|
-
generation:
|
|
2732
|
-
inboxPriceUsd:
|
|
2733
|
-
isAlive:
|
|
2793
|
+
adminReferralGamingSignalSchema = z12.object({
|
|
2794
|
+
type: z12.string(),
|
|
2795
|
+
severity: z12.enum(["low", "medium", "high"]),
|
|
2796
|
+
description: z12.string(),
|
|
2797
|
+
evidence: z12.record(z12.string(), z12.unknown())
|
|
2798
|
+
});
|
|
2799
|
+
adminReferralSignalsResponseDataSchema = z12.object({
|
|
2800
|
+
referrerId: z12.string(),
|
|
2801
|
+
overallRisk: z12.enum(["low", "medium", "high"]),
|
|
2802
|
+
signals: z12.array(adminReferralGamingSignalSchema)
|
|
2803
|
+
});
|
|
2804
|
+
adminAgentIdParamsSchema = z12.object({
|
|
2805
|
+
agentId: z12.string().uuid()
|
|
2806
|
+
});
|
|
2807
|
+
adminCreateAgentRequestSchema = z12.object({
|
|
2808
|
+
name: z12.string().min(1).max(100),
|
|
2809
|
+
handle: z12.string().max(50).optional(),
|
|
2810
|
+
bio: z12.string().max(500).optional(),
|
|
2811
|
+
avatarUrl: z12.string().url().optional(),
|
|
2812
|
+
generation: z12.number().int().optional(),
|
|
2813
|
+
serverPlan: z12.enum(["basic", "standard", "pro"]).optional(),
|
|
2814
|
+
llmModel: z12.string().optional(),
|
|
2815
|
+
llmBudgetUsd: z12.number().optional(),
|
|
2816
|
+
inboxPriceUsd: z12.number().optional()
|
|
2817
|
+
});
|
|
2818
|
+
adminUpdateAgentRequestSchema = z12.object({
|
|
2819
|
+
name: z12.string().min(1).max(100).optional(),
|
|
2820
|
+
handle: z12.string().max(50).optional(),
|
|
2821
|
+
bio: z12.string().max(500).optional(),
|
|
2822
|
+
avatarUrl: z12.string().url().nullable().optional(),
|
|
2823
|
+
llmModel: z12.string().optional(),
|
|
2824
|
+
llmBudgetUsd: z12.number().optional(),
|
|
2825
|
+
serverPlan: z12.enum(["basic", "standard", "pro"]).optional(),
|
|
2826
|
+
generation: z12.number().int().optional(),
|
|
2827
|
+
inboxPriceUsd: z12.number().optional(),
|
|
2828
|
+
isAlive: z12.boolean().optional()
|
|
2734
2829
|
}).refine((obj) => Object.keys(obj).length > 0, { message: "At least one field required" });
|
|
2735
|
-
adminUserIdParamsSchema =
|
|
2736
|
-
userId:
|
|
2737
|
-
});
|
|
2738
|
-
adminUsersQuerySchema =
|
|
2739
|
-
limit:
|
|
2740
|
-
offset:
|
|
2741
|
-
search:
|
|
2742
|
-
});
|
|
2743
|
-
adminUpdateUserRequestSchema =
|
|
2744
|
-
role:
|
|
2745
|
-
banned:
|
|
2746
|
-
banReason:
|
|
2747
|
-
banExpiresIn:
|
|
2748
|
-
shadowbanned:
|
|
2830
|
+
adminUserIdParamsSchema = z12.object({
|
|
2831
|
+
userId: z12.string().uuid()
|
|
2832
|
+
});
|
|
2833
|
+
adminUsersQuerySchema = z12.object({
|
|
2834
|
+
limit: z12.coerce.number().int().min(1).default(25).transform((v) => Math.min(v, 100)),
|
|
2835
|
+
offset: z12.coerce.number().int().min(0).default(0),
|
|
2836
|
+
search: z12.string().optional()
|
|
2837
|
+
});
|
|
2838
|
+
adminUpdateUserRequestSchema = z12.object({
|
|
2839
|
+
role: z12.enum(["admin", "user"]).optional(),
|
|
2840
|
+
banned: z12.boolean().optional(),
|
|
2841
|
+
banReason: z12.string().optional(),
|
|
2842
|
+
banExpiresIn: z12.number().positive().optional(),
|
|
2843
|
+
shadowbanned: z12.boolean().optional()
|
|
2749
2844
|
}).refine((obj) => Object.keys(obj).length > 0, { message: "At least one field required" });
|
|
2750
|
-
adminCreateAgentResponseDataSchema =
|
|
2751
|
-
agent:
|
|
2752
|
-
id:
|
|
2753
|
-
name:
|
|
2754
|
-
handle:
|
|
2755
|
-
email:
|
|
2845
|
+
adminCreateAgentResponseDataSchema = z12.object({
|
|
2846
|
+
agent: z12.object({
|
|
2847
|
+
id: z12.string().uuid(),
|
|
2848
|
+
name: z12.string(),
|
|
2849
|
+
handle: z12.string().nullable(),
|
|
2850
|
+
email: z12.string()
|
|
2756
2851
|
})
|
|
2757
2852
|
});
|
|
2758
|
-
adminUpdateAgentResponseDataSchema =
|
|
2759
|
-
ok:
|
|
2853
|
+
adminUpdateAgentResponseDataSchema = z12.object({
|
|
2854
|
+
ok: z12.boolean()
|
|
2760
2855
|
});
|
|
2761
|
-
adminUsersResponseDataSchema =
|
|
2762
|
-
users:
|
|
2763
|
-
id:
|
|
2764
|
-
name:
|
|
2765
|
-
email:
|
|
2766
|
-
role:
|
|
2767
|
-
banned:
|
|
2768
|
-
banReason:
|
|
2769
|
-
banExpires:
|
|
2770
|
-
shadowbanned:
|
|
2771
|
-
createdAt:
|
|
2856
|
+
adminUsersResponseDataSchema = z12.object({
|
|
2857
|
+
users: z12.array(z12.object({
|
|
2858
|
+
id: z12.string().uuid(),
|
|
2859
|
+
name: z12.string().nullable(),
|
|
2860
|
+
email: z12.string().nullable(),
|
|
2861
|
+
role: z12.string().nullable(),
|
|
2862
|
+
banned: z12.boolean().nullable(),
|
|
2863
|
+
banReason: z12.string().nullable(),
|
|
2864
|
+
banExpires: z12.string().nullable(),
|
|
2865
|
+
shadowbanned: z12.boolean().nullable(),
|
|
2866
|
+
createdAt: z12.string().nullable()
|
|
2772
2867
|
})),
|
|
2773
|
-
total:
|
|
2774
|
-
});
|
|
2775
|
-
adminUpdateUserResponseDataSchema =
|
|
2776
|
-
user:
|
|
2777
|
-
});
|
|
2778
|
-
adminIncubatorBirthRequestSchema =
|
|
2779
|
-
action:
|
|
2780
|
-
skipBalanceCheck:
|
|
2781
|
-
});
|
|
2782
|
-
adminIncubatorAdjustRequestSchema =
|
|
2783
|
-
amountUsd:
|
|
2784
|
-
source:
|
|
2785
|
-
note:
|
|
2786
|
-
});
|
|
2787
|
-
adminIncubatorWalletRequestSchema =
|
|
2788
|
-
walletId:
|
|
2789
|
-
walletAddress:
|
|
2790
|
-
});
|
|
2791
|
-
adminIncubatorTransactionsQuerySchema =
|
|
2792
|
-
limit:
|
|
2793
|
-
offset:
|
|
2794
|
-
source:
|
|
2795
|
-
});
|
|
2796
|
-
adminIncubatorPoolResponseDataSchema =
|
|
2797
|
-
balance_usd:
|
|
2798
|
-
threshold_usd:
|
|
2799
|
-
progress_pct:
|
|
2800
|
-
total_born:
|
|
2801
|
-
alive_count:
|
|
2802
|
-
dead_count:
|
|
2803
|
-
generation:
|
|
2804
|
-
birth_status:
|
|
2805
|
-
birth_paused:
|
|
2806
|
-
pool_wallet_id:
|
|
2807
|
-
pool_wallet_address:
|
|
2808
|
-
incubator_fee_percent:
|
|
2809
|
-
birth_threshold_usd:
|
|
2810
|
-
onChainBalanceSol:
|
|
2811
|
-
onChainBalanceUsd:
|
|
2812
|
-
});
|
|
2813
|
-
adminIncubatorTransactionSchema =
|
|
2814
|
-
id:
|
|
2815
|
-
amountUsd:
|
|
2816
|
-
source:
|
|
2817
|
-
sourceTradeId:
|
|
2818
|
-
adminNote:
|
|
2819
|
-
createdAt:
|
|
2820
|
-
});
|
|
2821
|
-
adminIncubatorTransactionsResponseDataSchema =
|
|
2822
|
-
transactions:
|
|
2823
|
-
total:
|
|
2824
|
-
});
|
|
2825
|
-
adminIncubatorBirthResponseDataSchema =
|
|
2826
|
-
ok:
|
|
2827
|
-
action:
|
|
2828
|
-
agent:
|
|
2829
|
-
id:
|
|
2830
|
-
number:
|
|
2831
|
-
solanaAddress:
|
|
2868
|
+
total: z12.number()
|
|
2869
|
+
});
|
|
2870
|
+
adminUpdateUserResponseDataSchema = z12.object({
|
|
2871
|
+
user: z12.record(z12.string(), z12.unknown())
|
|
2872
|
+
});
|
|
2873
|
+
adminIncubatorBirthRequestSchema = z12.object({
|
|
2874
|
+
action: z12.enum(["trigger", "pause", "resume"]),
|
|
2875
|
+
skipBalanceCheck: z12.boolean().optional().default(false)
|
|
2876
|
+
});
|
|
2877
|
+
adminIncubatorAdjustRequestSchema = z12.object({
|
|
2878
|
+
amountUsd: z12.number(),
|
|
2879
|
+
source: z12.enum(["manual_credit", "manual_debit", "birth_refund"]),
|
|
2880
|
+
note: z12.string().min(1)
|
|
2881
|
+
});
|
|
2882
|
+
adminIncubatorWalletRequestSchema = z12.object({
|
|
2883
|
+
walletId: z12.string().min(1),
|
|
2884
|
+
walletAddress: z12.string().min(1)
|
|
2885
|
+
});
|
|
2886
|
+
adminIncubatorTransactionsQuerySchema = z12.object({
|
|
2887
|
+
limit: z12.coerce.number().int().min(1).default(50).transform((v) => Math.min(v, 100)),
|
|
2888
|
+
offset: z12.coerce.number().int().min(0).default(0),
|
|
2889
|
+
source: z12.string().optional()
|
|
2890
|
+
});
|
|
2891
|
+
adminIncubatorPoolResponseDataSchema = z12.object({
|
|
2892
|
+
balance_usd: z12.number(),
|
|
2893
|
+
threshold_usd: z12.number(),
|
|
2894
|
+
progress_pct: z12.number(),
|
|
2895
|
+
total_born: z12.number(),
|
|
2896
|
+
alive_count: z12.number(),
|
|
2897
|
+
dead_count: z12.number(),
|
|
2898
|
+
generation: z12.number(),
|
|
2899
|
+
birth_status: z12.string(),
|
|
2900
|
+
birth_paused: z12.boolean(),
|
|
2901
|
+
pool_wallet_id: z12.string().nullable(),
|
|
2902
|
+
pool_wallet_address: z12.string().nullable(),
|
|
2903
|
+
incubator_fee_percent: z12.number(),
|
|
2904
|
+
birth_threshold_usd: z12.number(),
|
|
2905
|
+
onChainBalanceSol: z12.number(),
|
|
2906
|
+
onChainBalanceUsd: z12.number()
|
|
2907
|
+
});
|
|
2908
|
+
adminIncubatorTransactionSchema = z12.object({
|
|
2909
|
+
id: z12.string().uuid(),
|
|
2910
|
+
amountUsd: z12.number(),
|
|
2911
|
+
source: z12.string(),
|
|
2912
|
+
sourceTradeId: z12.string().nullable(),
|
|
2913
|
+
adminNote: z12.string().nullable(),
|
|
2914
|
+
createdAt: z12.string()
|
|
2915
|
+
});
|
|
2916
|
+
adminIncubatorTransactionsResponseDataSchema = z12.object({
|
|
2917
|
+
transactions: z12.array(adminIncubatorTransactionSchema),
|
|
2918
|
+
total: z12.number()
|
|
2919
|
+
});
|
|
2920
|
+
adminIncubatorBirthResponseDataSchema = z12.object({
|
|
2921
|
+
ok: z12.literal(true),
|
|
2922
|
+
action: z12.enum(["triggered", "paused", "resumed"]),
|
|
2923
|
+
agent: z12.object({
|
|
2924
|
+
id: z12.string(),
|
|
2925
|
+
number: z12.number(),
|
|
2926
|
+
solanaAddress: z12.string()
|
|
2832
2927
|
}).optional(),
|
|
2833
|
-
transferHash:
|
|
2928
|
+
transferHash: z12.string().nullable().optional()
|
|
2834
2929
|
});
|
|
2835
|
-
adminIncubatorAdjustResponseDataSchema =
|
|
2836
|
-
ok:
|
|
2837
|
-
balanceUsd:
|
|
2838
|
-
birthStatus:
|
|
2930
|
+
adminIncubatorAdjustResponseDataSchema = z12.object({
|
|
2931
|
+
ok: z12.literal(true),
|
|
2932
|
+
balanceUsd: z12.number(),
|
|
2933
|
+
birthStatus: z12.string()
|
|
2839
2934
|
});
|
|
2840
|
-
adminIncubatorWalletResponseDataSchema =
|
|
2841
|
-
ok:
|
|
2842
|
-
walletId:
|
|
2843
|
-
walletAddress:
|
|
2935
|
+
adminIncubatorWalletResponseDataSchema = z12.object({
|
|
2936
|
+
ok: z12.literal(true),
|
|
2937
|
+
walletId: z12.string(),
|
|
2938
|
+
walletAddress: z12.string()
|
|
2844
2939
|
});
|
|
2845
2940
|
adminDisputesResponseSchema = successEnvelope(adminDisputesResponseDataSchema);
|
|
2846
2941
|
adminResolveDisputeResponseSchema = successEnvelope(adminResolveDisputeResponseDataSchema);
|
|
@@ -2853,46 +2948,46 @@ var init_admin = __esm(() => {
|
|
|
2853
2948
|
});
|
|
2854
2949
|
|
|
2855
2950
|
// ../../packages/client/src/schemas/auth.ts
|
|
2856
|
-
import { z as
|
|
2951
|
+
import { z as z13 } from "zod";
|
|
2857
2952
|
var authApiKeysCreateRequestSchema, authApiKeysDeleteRequestSchema, authSetupRequestSchema, authApiKeysListResponseDataSchema, authApiKeysCreateResponseDataSchema, authApiKeysDeleteResponseDataSchema, authSetupResponseDataSchema, authApiKeysListResponseSchema, authApiKeysCreateResponseSchema, authApiKeysDeleteResponseSchema, authSetupResponseSchema;
|
|
2858
2953
|
var init_auth = __esm(() => {
|
|
2859
2954
|
init_common();
|
|
2860
|
-
authApiKeysCreateRequestSchema =
|
|
2861
|
-
name:
|
|
2862
|
-
});
|
|
2863
|
-
authApiKeysDeleteRequestSchema =
|
|
2864
|
-
keyId:
|
|
2865
|
-
});
|
|
2866
|
-
authSetupRequestSchema =
|
|
2867
|
-
name:
|
|
2868
|
-
handle:
|
|
2869
|
-
referralCode:
|
|
2870
|
-
});
|
|
2871
|
-
authApiKeysListResponseDataSchema =
|
|
2872
|
-
keys:
|
|
2873
|
-
id:
|
|
2874
|
-
name:
|
|
2875
|
-
start:
|
|
2876
|
-
createdAt:
|
|
2955
|
+
authApiKeysCreateRequestSchema = z13.object({
|
|
2956
|
+
name: z13.string().trim().min(1).max(120).optional()
|
|
2957
|
+
});
|
|
2958
|
+
authApiKeysDeleteRequestSchema = z13.object({
|
|
2959
|
+
keyId: z13.string().min(1)
|
|
2960
|
+
});
|
|
2961
|
+
authSetupRequestSchema = z13.object({
|
|
2962
|
+
name: z13.string().trim().min(1).max(120).optional(),
|
|
2963
|
+
handle: z13.string().trim().min(1).max(120).optional(),
|
|
2964
|
+
referralCode: z13.string().trim().min(1).max(120).optional()
|
|
2965
|
+
});
|
|
2966
|
+
authApiKeysListResponseDataSchema = z13.object({
|
|
2967
|
+
keys: z13.array(z13.object({
|
|
2968
|
+
id: z13.string(),
|
|
2969
|
+
name: z13.string().nullable(),
|
|
2970
|
+
start: z13.string(),
|
|
2971
|
+
createdAt: z13.string()
|
|
2877
2972
|
}))
|
|
2878
2973
|
});
|
|
2879
|
-
authApiKeysCreateResponseDataSchema =
|
|
2880
|
-
key:
|
|
2881
|
-
id:
|
|
2882
|
-
start:
|
|
2974
|
+
authApiKeysCreateResponseDataSchema = z13.object({
|
|
2975
|
+
key: z13.string(),
|
|
2976
|
+
id: z13.string(),
|
|
2977
|
+
start: z13.string()
|
|
2883
2978
|
});
|
|
2884
|
-
authApiKeysDeleteResponseDataSchema =
|
|
2885
|
-
revoked:
|
|
2979
|
+
authApiKeysDeleteResponseDataSchema = z13.object({
|
|
2980
|
+
revoked: z13.boolean()
|
|
2886
2981
|
});
|
|
2887
|
-
authSetupResponseDataSchema =
|
|
2888
|
-
userId:
|
|
2889
|
-
solanaAddress:
|
|
2890
|
-
hlAddress:
|
|
2891
|
-
handle:
|
|
2892
|
-
apiKeyHint:
|
|
2893
|
-
apiKey:
|
|
2894
|
-
cliCommand:
|
|
2895
|
-
isNew:
|
|
2982
|
+
authSetupResponseDataSchema = z13.object({
|
|
2983
|
+
userId: z13.string().uuid(),
|
|
2984
|
+
solanaAddress: z13.string().nullable(),
|
|
2985
|
+
hlAddress: z13.string().nullable().optional(),
|
|
2986
|
+
handle: z13.string().nullable(),
|
|
2987
|
+
apiKeyHint: z13.string().nullable(),
|
|
2988
|
+
apiKey: z13.string().optional(),
|
|
2989
|
+
cliCommand: z13.string().optional(),
|
|
2990
|
+
isNew: z13.boolean()
|
|
2896
2991
|
});
|
|
2897
2992
|
authApiKeysListResponseSchema = successEnvelope(authApiKeysListResponseDataSchema);
|
|
2898
2993
|
authApiKeysCreateResponseSchema = successEnvelope(authApiKeysCreateResponseDataSchema);
|
|
@@ -2901,156 +2996,57 @@ var init_auth = __esm(() => {
|
|
|
2901
2996
|
});
|
|
2902
2997
|
|
|
2903
2998
|
// ../../packages/client/src/schemas/claim.ts
|
|
2904
|
-
import { z as
|
|
2999
|
+
import { z as z14 } from "zod";
|
|
2905
3000
|
var claimTokenParamsSchema, claimInfoResponseDataSchema, claimInfoResponseSchema;
|
|
2906
3001
|
var init_claim = __esm(() => {
|
|
2907
3002
|
init_common();
|
|
2908
|
-
claimTokenParamsSchema =
|
|
2909
|
-
token:
|
|
2910
|
-
});
|
|
2911
|
-
claimInfoResponseDataSchema =
|
|
2912
|
-
claimed:
|
|
2913
|
-
agent:
|
|
2914
|
-
name:
|
|
2915
|
-
handle:
|
|
2916
|
-
bio:
|
|
2917
|
-
avatar:
|
|
3003
|
+
claimTokenParamsSchema = z14.object({
|
|
3004
|
+
token: z14.string().trim().min(1, "Claim token is required")
|
|
3005
|
+
});
|
|
3006
|
+
claimInfoResponseDataSchema = z14.object({
|
|
3007
|
+
claimed: z14.boolean(),
|
|
3008
|
+
agent: z14.object({
|
|
3009
|
+
name: z14.string(),
|
|
3010
|
+
handle: z14.string().nullable().optional(),
|
|
3011
|
+
bio: z14.string().nullable(),
|
|
3012
|
+
avatar: z14.string().nullable()
|
|
2918
3013
|
}),
|
|
2919
|
-
verificationCode:
|
|
2920
|
-
tweetText:
|
|
2921
|
-
instructions:
|
|
3014
|
+
verificationCode: z14.string().optional(),
|
|
3015
|
+
tweetText: z14.string().optional(),
|
|
3016
|
+
instructions: z14.string().optional()
|
|
2922
3017
|
});
|
|
2923
3018
|
claimInfoResponseSchema = successEnvelope(claimInfoResponseDataSchema);
|
|
2924
3019
|
});
|
|
2925
3020
|
|
|
2926
3021
|
// ../../packages/client/src/schemas/dashboard.ts
|
|
2927
|
-
import { z as
|
|
3022
|
+
import { z as z15 } from "zod";
|
|
2928
3023
|
var dashboardStatusResponseDataSchema, dashboardStatusResponseSchema;
|
|
2929
3024
|
var init_dashboard = __esm(() => {
|
|
2930
3025
|
init_common();
|
|
2931
|
-
dashboardStatusResponseDataSchema =
|
|
2932
|
-
solanaAddress:
|
|
2933
|
-
hlAddress:
|
|
2934
|
-
solanaBalance:
|
|
2935
|
-
claimToken:
|
|
2936
|
-
steps:
|
|
2937
|
-
funded:
|
|
2938
|
-
agentConnected:
|
|
2939
|
-
xConnected:
|
|
3026
|
+
dashboardStatusResponseDataSchema = z15.object({
|
|
3027
|
+
solanaAddress: z15.string().nullable(),
|
|
3028
|
+
hlAddress: z15.string().nullable(),
|
|
3029
|
+
solanaBalance: z15.number(),
|
|
3030
|
+
claimToken: z15.string(),
|
|
3031
|
+
steps: z15.object({
|
|
3032
|
+
funded: z15.boolean(),
|
|
3033
|
+
agentConnected: z15.boolean(),
|
|
3034
|
+
xConnected: z15.boolean().nullable()
|
|
2940
3035
|
}),
|
|
2941
|
-
apiKeyHint:
|
|
2942
|
-
xHandle:
|
|
2943
|
-
handle:
|
|
2944
|
-
stats:
|
|
2945
|
-
totalValueUsd:
|
|
2946
|
-
pnlAllTime:
|
|
2947
|
-
pnl24h:
|
|
2948
|
-
pnl7d:
|
|
2949
|
-
lastTradeAt:
|
|
3036
|
+
apiKeyHint: z15.string().nullable(),
|
|
3037
|
+
xHandle: z15.string().nullable(),
|
|
3038
|
+
handle: z15.string().nullable(),
|
|
3039
|
+
stats: z15.object({
|
|
3040
|
+
totalValueUsd: z15.number(),
|
|
3041
|
+
pnlAllTime: z15.number(),
|
|
3042
|
+
pnl24h: z15.number(),
|
|
3043
|
+
pnl7d: z15.number(),
|
|
3044
|
+
lastTradeAt: z15.string().nullable()
|
|
2950
3045
|
}).nullable()
|
|
2951
3046
|
});
|
|
2952
3047
|
dashboardStatusResponseSchema = successEnvelope(dashboardStatusResponseDataSchema);
|
|
2953
3048
|
});
|
|
2954
3049
|
|
|
2955
|
-
// ../../packages/client/src/schemas/hyperliquid.ts
|
|
2956
|
-
import { z as z15 } from "zod";
|
|
2957
|
-
var hyperliquidFillsQuerySchema, hyperliquidSetupRequestSchema, hyperliquidSetupResponseDataSchema, hlPositionSchema, hlSpotBalanceSchema, hyperliquidAccountResponseDataSchema, hlFillSchema, hyperliquidFillsResponseDataSchema, hyperliquidLiquidationRiskResponseDataSchema, hyperliquidSetupResponseSchema, hyperliquidAccountResponseSchema, hyperliquidFillsResponseSchema, hyperliquidLiquidationRiskResponseSchema;
|
|
2958
|
-
var init_hyperliquid = __esm(() => {
|
|
2959
|
-
init_common();
|
|
2960
|
-
hyperliquidFillsQuerySchema = z15.object({
|
|
2961
|
-
limit: z15.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
|
|
2962
|
-
offset: z15.coerce.number().int().min(0).default(0)
|
|
2963
|
-
});
|
|
2964
|
-
hyperliquidSetupRequestSchema = z15.object({
|
|
2965
|
-
sourceChain: z15.enum(["solana", "ethereum", "arbitrum", "optimism", "base"]).optional()
|
|
2966
|
-
});
|
|
2967
|
-
hyperliquidSetupResponseDataSchema = z15.object({
|
|
2968
|
-
deposit_address: z15.string(),
|
|
2969
|
-
min_deposit: z15.number().optional(),
|
|
2970
|
-
source_chain: z15.string(),
|
|
2971
|
-
hl_address: z15.string(),
|
|
2972
|
-
estimated_time: z15.string().optional(),
|
|
2973
|
-
builder: z15.object({
|
|
2974
|
-
address: z15.string(),
|
|
2975
|
-
fee: z15.string()
|
|
2976
|
-
}).passthrough(),
|
|
2977
|
-
instructions: z15.string().optional(),
|
|
2978
|
-
note: z15.string().optional()
|
|
2979
|
-
});
|
|
2980
|
-
hlPositionSchema = z15.object({
|
|
2981
|
-
coin: z15.string(),
|
|
2982
|
-
side: z15.string(),
|
|
2983
|
-
size: z15.number(),
|
|
2984
|
-
entryPrice: z15.number(),
|
|
2985
|
-
unrealizedPnl: z15.number(),
|
|
2986
|
-
marginUsed: z15.number(),
|
|
2987
|
-
leverage: z15.number(),
|
|
2988
|
-
liquidationPrice: z15.number().nullable()
|
|
2989
|
-
}).passthrough();
|
|
2990
|
-
hlSpotBalanceSchema = z15.object({
|
|
2991
|
-
coin: z15.string(),
|
|
2992
|
-
total: z15.number(),
|
|
2993
|
-
hold: z15.number(),
|
|
2994
|
-
available: z15.number(),
|
|
2995
|
-
priceUsd: z15.number(),
|
|
2996
|
-
valueUsd: z15.number()
|
|
2997
|
-
});
|
|
2998
|
-
hyperliquidAccountResponseDataSchema = z15.object({
|
|
2999
|
-
hlAddress: z15.string(),
|
|
3000
|
-
perps: z15.object({
|
|
3001
|
-
accountValue: z15.number(),
|
|
3002
|
-
totalMarginUsed: z15.number(),
|
|
3003
|
-
unrealizedPnl: z15.number(),
|
|
3004
|
-
withdrawable: z15.number(),
|
|
3005
|
-
positions: z15.array(hlPositionSchema)
|
|
3006
|
-
}),
|
|
3007
|
-
spot: z15.object({
|
|
3008
|
-
balances: z15.array(hlSpotBalanceSchema)
|
|
3009
|
-
}),
|
|
3010
|
-
lastSync: z15.string()
|
|
3011
|
-
});
|
|
3012
|
-
hlFillSchema = z15.object({
|
|
3013
|
-
id: z15.string(),
|
|
3014
|
-
coin: z15.string(),
|
|
3015
|
-
side: z15.string(),
|
|
3016
|
-
size: z15.number(),
|
|
3017
|
-
price: z15.number(),
|
|
3018
|
-
fee: z15.number(),
|
|
3019
|
-
builderFee: z15.number().nullable().optional(),
|
|
3020
|
-
timestamp: z15.string()
|
|
3021
|
-
}).passthrough();
|
|
3022
|
-
hyperliquidFillsResponseDataSchema = z15.object({
|
|
3023
|
-
hlAddress: z15.string(),
|
|
3024
|
-
fills: z15.array(hlFillSchema),
|
|
3025
|
-
totalBuilderFees: z15.number(),
|
|
3026
|
-
pagination: z15.object({
|
|
3027
|
-
limit: z15.number(),
|
|
3028
|
-
offset: z15.number(),
|
|
3029
|
-
hasMore: z15.boolean()
|
|
3030
|
-
})
|
|
3031
|
-
});
|
|
3032
|
-
hyperliquidLiquidationRiskResponseDataSchema = z15.object({
|
|
3033
|
-
hlAddress: z15.string(),
|
|
3034
|
-
healthScore: z15.number(),
|
|
3035
|
-
marginUtilization: z15.number(),
|
|
3036
|
-
totalExposure: z15.number(),
|
|
3037
|
-
atRisk: z15.boolean(),
|
|
3038
|
-
alerts: z15.array(z15.string()),
|
|
3039
|
-
recommendations: z15.array(z15.string()),
|
|
3040
|
-
advisoryLimits: z15.object({
|
|
3041
|
-
trustLevel: z15.string(),
|
|
3042
|
-
maxLeverage: z15.number(),
|
|
3043
|
-
maxPositionPct: z15.number(),
|
|
3044
|
-
maxDailyLossPct: z15.number(),
|
|
3045
|
-
note: z15.string()
|
|
3046
|
-
})
|
|
3047
|
-
});
|
|
3048
|
-
hyperliquidSetupResponseSchema = successEnvelope(hyperliquidSetupResponseDataSchema);
|
|
3049
|
-
hyperliquidAccountResponseSchema = successEnvelope(hyperliquidAccountResponseDataSchema);
|
|
3050
|
-
hyperliquidFillsResponseSchema = successEnvelope(hyperliquidFillsResponseDataSchema);
|
|
3051
|
-
hyperliquidLiquidationRiskResponseSchema = successEnvelope(hyperliquidLiquidationRiskResponseDataSchema);
|
|
3052
|
-
});
|
|
3053
|
-
|
|
3054
3050
|
// ../../packages/client/src/schemas/marketplace.ts
|
|
3055
3051
|
import { z as z16 } from "zod";
|
|
3056
3052
|
var MARKETPLACE_TASK_CATEGORIES, marketplaceTaskParamsSchema, marketplaceTasksQuerySchema, marketplaceApplyTaskRequestSchema, marketplaceSubmitTaskRequestSchema, marketplaceTaskListItemSchema, marketplaceTasksResponseDataSchema, marketplaceTaskDetailSchema, marketplaceTaskDetailResponseDataSchema, marketplaceApplyTaskResponseDataSchema, marketplaceSubmitTaskResponseDataSchema, marketplaceTasksResponseSchema, marketplaceTaskDetailResponseSchema, marketplaceApplyTaskResponseSchema, marketplaceSubmitTaskResponseSchema;
|
|
@@ -3642,6 +3638,232 @@ var init_env = __esm(() => {
|
|
|
3642
3638
|
];
|
|
3643
3639
|
});
|
|
3644
3640
|
|
|
3641
|
+
// ../../packages/solana/src/errors.ts
|
|
3642
|
+
function def(code, name, message, program, retryable = false, suggestion) {
|
|
3643
|
+
return { code, hex: `0x${code.toString(16)}`, name, message, retryable, suggestion, program };
|
|
3644
|
+
}
|
|
3645
|
+
function parseSolanaError(message) {
|
|
3646
|
+
if (!message)
|
|
3647
|
+
return null;
|
|
3648
|
+
const customMatch = CUSTOM_ERROR_RE.exec(message);
|
|
3649
|
+
if (customMatch) {
|
|
3650
|
+
const code = parseInt(customMatch[1], 16);
|
|
3651
|
+
const hex = `0x${customMatch[1].toLowerCase()}`;
|
|
3652
|
+
const instructionMatch = INSTRUCTION_INDEX_RE.exec(message);
|
|
3653
|
+
const instructionIndex = instructionMatch ? parseInt(instructionMatch[1], 10) : undefined;
|
|
3654
|
+
return {
|
|
3655
|
+
type: "custom",
|
|
3656
|
+
code,
|
|
3657
|
+
hex,
|
|
3658
|
+
instructionIndex,
|
|
3659
|
+
def: PROGRAM_ERRORS.get(code),
|
|
3660
|
+
raw: message
|
|
3661
|
+
};
|
|
3662
|
+
}
|
|
3663
|
+
const anchorMatch = ANCHOR_ERROR_RE.exec(message);
|
|
3664
|
+
if (anchorMatch) {
|
|
3665
|
+
const code = parseInt(anchorMatch[1], 10);
|
|
3666
|
+
return {
|
|
3667
|
+
type: "custom",
|
|
3668
|
+
code,
|
|
3669
|
+
hex: `0x${code.toString(16)}`,
|
|
3670
|
+
def: PROGRAM_ERRORS.get(code),
|
|
3671
|
+
raw: message
|
|
3672
|
+
};
|
|
3673
|
+
}
|
|
3674
|
+
for (const [variant, errorDef] of INSTRUCTION_ERRORS) {
|
|
3675
|
+
if (message.includes(variant)) {
|
|
3676
|
+
return {
|
|
3677
|
+
type: "instruction",
|
|
3678
|
+
def: errorDef,
|
|
3679
|
+
raw: message
|
|
3680
|
+
};
|
|
3681
|
+
}
|
|
3682
|
+
}
|
|
3683
|
+
return null;
|
|
3684
|
+
}
|
|
3685
|
+
function classifyTradeError(errorMessage) {
|
|
3686
|
+
const parsed = parseSolanaError(errorMessage);
|
|
3687
|
+
if (parsed?.def) {
|
|
3688
|
+
const d = parsed.def;
|
|
3689
|
+
if (d.name === "SlippageToleranceExceeded") {
|
|
3690
|
+
return {
|
|
3691
|
+
errorCode: "BAD_REQUEST",
|
|
3692
|
+
httpStatus: 400,
|
|
3693
|
+
message: d.message,
|
|
3694
|
+
retryable: true,
|
|
3695
|
+
suggestion: d.suggestion,
|
|
3696
|
+
solanaError: d.name
|
|
3697
|
+
};
|
|
3698
|
+
}
|
|
3699
|
+
if (d.name === "InsufficientFunds") {
|
|
3700
|
+
return {
|
|
3701
|
+
errorCode: "BAD_REQUEST",
|
|
3702
|
+
httpStatus: 400,
|
|
3703
|
+
message: d.message,
|
|
3704
|
+
retryable: false,
|
|
3705
|
+
suggestion: d.suggestion,
|
|
3706
|
+
solanaError: d.name
|
|
3707
|
+
};
|
|
3708
|
+
}
|
|
3709
|
+
if (d.name === "ComputationalBudgetExceeded" || d.name === "ProgramFailedToComplete") {
|
|
3710
|
+
return {
|
|
3711
|
+
errorCode: "DEPENDENCY_ERROR",
|
|
3712
|
+
httpStatus: 502,
|
|
3713
|
+
message: d.message,
|
|
3714
|
+
retryable: true,
|
|
3715
|
+
suggestion: d.suggestion,
|
|
3716
|
+
solanaError: d.name
|
|
3717
|
+
};
|
|
3718
|
+
}
|
|
3719
|
+
return {
|
|
3720
|
+
errorCode: d.retryable ? "DEPENDENCY_ERROR" : "BAD_REQUEST",
|
|
3721
|
+
httpStatus: d.retryable ? 502 : 400,
|
|
3722
|
+
message: d.message,
|
|
3723
|
+
retryable: d.retryable,
|
|
3724
|
+
suggestion: d.suggestion,
|
|
3725
|
+
solanaError: d.name
|
|
3726
|
+
};
|
|
3727
|
+
}
|
|
3728
|
+
if (parsed?.type === "custom" && parsed.code !== undefined) {
|
|
3729
|
+
return {
|
|
3730
|
+
errorCode: "INTERNAL_ERROR",
|
|
3731
|
+
httpStatus: 500,
|
|
3732
|
+
message: `Transaction failed with program error ${parsed.hex}`,
|
|
3733
|
+
retryable: false,
|
|
3734
|
+
solanaError: `UnknownError_${parsed.hex}`
|
|
3735
|
+
};
|
|
3736
|
+
}
|
|
3737
|
+
for (const pattern of KEYWORD_PATTERNS) {
|
|
3738
|
+
if (pattern.test(errorMessage)) {
|
|
3739
|
+
return pattern.classify(errorMessage);
|
|
3740
|
+
}
|
|
3741
|
+
}
|
|
3742
|
+
return {
|
|
3743
|
+
errorCode: "INTERNAL_ERROR",
|
|
3744
|
+
httpStatus: 500,
|
|
3745
|
+
message: `Trade failed: ${errorMessage}`,
|
|
3746
|
+
retryable: false
|
|
3747
|
+
};
|
|
3748
|
+
}
|
|
3749
|
+
var PROGRAM_ERRORS, INSTRUCTION_ERRORS, CUSTOM_ERROR_RE, INSTRUCTION_INDEX_RE, ANCHOR_ERROR_RE, KEYWORD_PATTERNS;
|
|
3750
|
+
var init_errors2 = __esm(() => {
|
|
3751
|
+
PROGRAM_ERRORS = new Map([
|
|
3752
|
+
[0, def(0, "NotRentExempt", "Account is not rent exempt", "token")],
|
|
3753
|
+
[1, def(1, "InsufficientFunds", "Insufficient token balance", "token", false, "Check your token balance before trading")],
|
|
3754
|
+
[2, def(2, "InvalidMint", "Invalid mint address", "token")],
|
|
3755
|
+
[3, def(3, "MintMismatch", "Account mint does not match expected mint", "token")],
|
|
3756
|
+
[4, def(4, "OwnerMismatch", "Account owner does not match expected owner", "token")],
|
|
3757
|
+
[5, def(5, "FixedSupply", "Token supply is fixed — cannot mint more", "token")],
|
|
3758
|
+
[6, def(6, "AlreadyInUse", "Account is already initialized", "token")],
|
|
3759
|
+
[7, def(7, "InvalidNumberOfProvidedSigners", "Invalid number of signers", "token")],
|
|
3760
|
+
[8, def(8, "InvalidNumberOfRequiredSigners", "Invalid number of required signers", "token")],
|
|
3761
|
+
[9, def(9, "UninitializedState", "Token account is not initialized", "token")],
|
|
3762
|
+
[10, def(10, "NativeNotSupported", "Operation not supported for native SOL", "token")],
|
|
3763
|
+
[11, def(11, "NonNativeHasBalance", "Non-native account has balance — close with non-zero balance", "token")],
|
|
3764
|
+
[12, def(12, "InvalidInstruction", "Invalid token instruction", "token")],
|
|
3765
|
+
[13, def(13, "InvalidState", "Invalid token account state", "token")],
|
|
3766
|
+
[14, def(14, "Overflow", "Arithmetic overflow in token operation", "token")],
|
|
3767
|
+
[15, def(15, "AuthorityTypeNotSupported", "Authority type not supported", "token")],
|
|
3768
|
+
[16, def(16, "MintCannotFreeze", "This mint cannot freeze accounts", "token")],
|
|
3769
|
+
[17, def(17, "AccountFrozen", "Account is frozen — cannot transfer", "token")],
|
|
3770
|
+
[6000, def(6000, "EmptyRoute", "No swap route found", "jupiter", false, "Token pair may not have liquidity. Try a different pair.")],
|
|
3771
|
+
[6001, def(6001, "SlippageToleranceExceeded", "Slippage tolerance exceeded — price moved during execution", "jupiter", true, "Retry or increase slippage tolerance")],
|
|
3772
|
+
[6002, def(6002, "InvalidCalculation", "Swap calculation error", "jupiter")],
|
|
3773
|
+
[6003, def(6003, "MissingPlatformFeeAccount", "Platform fee account not provided", "jupiter", false, "Server configuration issue — contact support")],
|
|
3774
|
+
[6004, def(6004, "InvalidSlippage", "Invalid slippage value", "jupiter")],
|
|
3775
|
+
[6005, def(6005, "NotEnoughPercent", "Split percent does not sum to 100", "jupiter")],
|
|
3776
|
+
[6006, def(6006, "InvalidInputIndex", "Invalid route input index", "jupiter")],
|
|
3777
|
+
[6007, def(6007, "InvalidOutputIndex", "Invalid route output index", "jupiter")],
|
|
3778
|
+
[6008, def(6008, "NotEnoughAccountKeys", "Not enough account keys for instruction", "jupiter")],
|
|
3779
|
+
[6009, def(6009, "NonZeroMinimumOutAmountNotSupported", "Non-zero minimum out amount not supported for this route", "jupiter")],
|
|
3780
|
+
[6010, def(6010, "InvalidRoutePlan", "Invalid route plan", "jupiter")],
|
|
3781
|
+
[6011, def(6011, "InvalidReferralAuthority", "Invalid referral authority", "jupiter")],
|
|
3782
|
+
[6012, def(6012, "LedgerTokenAccountDoesNotMatch", "Token ledger account mismatch", "jupiter")],
|
|
3783
|
+
[6013, def(6013, "InvalidTokenLedger", "Invalid token ledger state", "jupiter")],
|
|
3784
|
+
[6014, def(6014, "IncorrectTokenProgramID", "Incorrect token program ID", "jupiter")],
|
|
3785
|
+
[6015, def(6015, "TokenProgramNotProvided", "Token program not provided", "jupiter")],
|
|
3786
|
+
[6016, def(6016, "SwapNotSupported", "This swap is not supported", "jupiter")],
|
|
3787
|
+
[6017, def(6017, "ExactOutAmountNotMatched", "Exact output amount not met", "jupiter")],
|
|
3788
|
+
[6025, def(6025, "InvalidTokenAccount", "Invalid token account for platform fee", "jupiter", false, "Platform fee account may not be initialized — contact support")]
|
|
3789
|
+
]);
|
|
3790
|
+
INSTRUCTION_ERRORS = new Map([
|
|
3791
|
+
["InsufficientFunds", def(0, "InsufficientFunds", "Insufficient SOL for transaction fees", "system", false, "Fund your wallet with SOL for gas")],
|
|
3792
|
+
["InvalidAccountData", def(0, "InvalidAccountData", "Account data is invalid or corrupt", "system")],
|
|
3793
|
+
["AccountAlreadyInUse", def(0, "AccountAlreadyInUse", "Account is already in use", "system")],
|
|
3794
|
+
["AccountNotFound", def(0, "AccountNotFound", "Account not found on chain", "system")],
|
|
3795
|
+
["InvalidArgument", def(0, "InvalidArgument", "Invalid instruction argument", "system")],
|
|
3796
|
+
["InvalidInstructionData", def(0, "InvalidInstructionData", "Invalid instruction data", "system")],
|
|
3797
|
+
["InvalidAccountOwner", def(0, "InvalidAccountOwner", "Account is not owned by the expected program", "system")],
|
|
3798
|
+
["ComputationalBudgetExceeded", def(0, "ComputationalBudgetExceeded", "Transaction exceeded compute budget", "compute-budget", true, "Retry — the transaction was too complex for the allocated compute units")],
|
|
3799
|
+
["ProgramFailedToComplete", def(0, "ProgramFailedToComplete", "Program failed to complete", "system", true, "Retry — may be a transient issue")]
|
|
3800
|
+
]);
|
|
3801
|
+
CUSTOM_ERROR_RE = /custom program error: 0x([0-9a-fA-F]+)/i;
|
|
3802
|
+
INSTRUCTION_INDEX_RE = /Error processing Instruction (\d+):/i;
|
|
3803
|
+
ANCHOR_ERROR_RE = /Error Number: (\d+)/i;
|
|
3804
|
+
KEYWORD_PATTERNS = [
|
|
3805
|
+
{
|
|
3806
|
+
test: (msg) => /insufficient\s*(funds|balance|lamports)/i.test(msg) || msg.toLowerCase().includes("insufficient balance"),
|
|
3807
|
+
classify: () => ({
|
|
3808
|
+
errorCode: "BAD_REQUEST",
|
|
3809
|
+
httpStatus: 400,
|
|
3810
|
+
message: "Insufficient balance to complete this trade",
|
|
3811
|
+
retryable: false,
|
|
3812
|
+
suggestion: "Check your wallet balance before trading",
|
|
3813
|
+
solanaError: "InsufficientFunds"
|
|
3814
|
+
})
|
|
3815
|
+
},
|
|
3816
|
+
{
|
|
3817
|
+
test: (msg) => msg.toLowerCase().includes("slippage"),
|
|
3818
|
+
classify: () => ({
|
|
3819
|
+
errorCode: "BAD_REQUEST",
|
|
3820
|
+
httpStatus: 400,
|
|
3821
|
+
message: "Slippage tolerance exceeded — price moved during execution",
|
|
3822
|
+
retryable: true,
|
|
3823
|
+
suggestion: "Retry or increase slippage tolerance",
|
|
3824
|
+
solanaError: "SlippageToleranceExceeded"
|
|
3825
|
+
})
|
|
3826
|
+
},
|
|
3827
|
+
{
|
|
3828
|
+
test: (msg) => {
|
|
3829
|
+
const lower = msg.toLowerCase();
|
|
3830
|
+
return lower.includes("expired") || lower.includes("blockhash not found") || lower.includes("block height exceeded");
|
|
3831
|
+
},
|
|
3832
|
+
classify: () => ({
|
|
3833
|
+
errorCode: "DEPENDENCY_ERROR",
|
|
3834
|
+
httpStatus: 502,
|
|
3835
|
+
message: "Transaction expired before confirmation",
|
|
3836
|
+
retryable: true,
|
|
3837
|
+
suggestion: "This is transient — retry with a fresh quote",
|
|
3838
|
+
solanaError: "TransactionExpired"
|
|
3839
|
+
})
|
|
3840
|
+
},
|
|
3841
|
+
{
|
|
3842
|
+
test: (msg) => msg.toLowerCase().includes("rate limit"),
|
|
3843
|
+
classify: (msg) => ({
|
|
3844
|
+
errorCode: "RATE_LIMITED",
|
|
3845
|
+
httpStatus: 429,
|
|
3846
|
+
message: msg,
|
|
3847
|
+
retryable: false,
|
|
3848
|
+
suggestion: "Wait a moment before retrying"
|
|
3849
|
+
})
|
|
3850
|
+
},
|
|
3851
|
+
{
|
|
3852
|
+
test: (msg) => {
|
|
3853
|
+
const lower = msg.toLowerCase();
|
|
3854
|
+
return lower.includes("unknown token") || lower.includes("token not found");
|
|
3855
|
+
},
|
|
3856
|
+
classify: (msg) => ({
|
|
3857
|
+
errorCode: "BAD_REQUEST",
|
|
3858
|
+
httpStatus: 400,
|
|
3859
|
+
message: msg,
|
|
3860
|
+
retryable: false,
|
|
3861
|
+
suggestion: "Use a known symbol (SOL, USDC, BONK, WIF) or pass a raw mint address"
|
|
3862
|
+
})
|
|
3863
|
+
}
|
|
3864
|
+
];
|
|
3865
|
+
});
|
|
3866
|
+
|
|
3645
3867
|
// src/lib/errors.ts
|
|
3646
3868
|
import chalk from "chalk";
|
|
3647
3869
|
function normalizeCliError(error) {
|
|
@@ -3668,6 +3890,24 @@ function printCliError(error) {
|
|
|
3668
3890
|
}
|
|
3669
3891
|
}
|
|
3670
3892
|
}
|
|
3893
|
+
function mapTradeError(error) {
|
|
3894
|
+
const normalized = normalizeCliError(error);
|
|
3895
|
+
const classified = classifyTradeError(normalized.message);
|
|
3896
|
+
return {
|
|
3897
|
+
message: classified.message,
|
|
3898
|
+
suggestion: classified.suggestion,
|
|
3899
|
+
retryable: classified.retryable
|
|
3900
|
+
};
|
|
3901
|
+
}
|
|
3902
|
+
function printTradeError(error) {
|
|
3903
|
+
const mapped = mapTradeError(error);
|
|
3904
|
+
console.error(chalk.red(`
|
|
3905
|
+
${mapped.message}`));
|
|
3906
|
+
if (mapped.suggestion) {
|
|
3907
|
+
console.error(chalk.dim(` Suggestion: ${mapped.suggestion}`));
|
|
3908
|
+
}
|
|
3909
|
+
console.error("");
|
|
3910
|
+
}
|
|
3671
3911
|
function toStructuredError(error) {
|
|
3672
3912
|
const normalized = normalizeCliError(error);
|
|
3673
3913
|
return {
|
|
@@ -3679,8 +3919,9 @@ function toStructuredError(error) {
|
|
|
3679
3919
|
}
|
|
3680
3920
|
};
|
|
3681
3921
|
}
|
|
3682
|
-
var
|
|
3922
|
+
var init_errors3 = __esm(() => {
|
|
3683
3923
|
init_src();
|
|
3924
|
+
init_errors2();
|
|
3684
3925
|
});
|
|
3685
3926
|
|
|
3686
3927
|
// src/mcp/server.ts
|
|
@@ -3723,38 +3964,59 @@ async function createServer() {
|
|
|
3723
3964
|
inputToken: z22.string().optional().describe("Solana: input token symbol (e.g. SOL, USDC)"),
|
|
3724
3965
|
outputToken: z22.string().optional().describe("Solana: output token symbol (e.g. PEPE, BONK)"),
|
|
3725
3966
|
amount: z22.number().optional().describe("Solana: amount of input token to swap"),
|
|
3967
|
+
slippageBps: z22.number().optional().describe("Solana: slippage tolerance in basis points (default: 100, max: 500)"),
|
|
3968
|
+
dryRun: z22.boolean().optional().describe("If true, returns a quote without executing (Solana only)"),
|
|
3726
3969
|
coin: z22.string().optional().describe("Hyperliquid: coin symbol (e.g. BTC, ETH)"),
|
|
3727
3970
|
side: z22.enum(["buy", "sell"]).optional().describe("Hyperliquid: trade side"),
|
|
3728
3971
|
size: z22.number().optional().describe("Hyperliquid: position size"),
|
|
3729
3972
|
orderType: z22.enum(["market", "limit"]).optional().describe("Hyperliquid: order type (default: market)"),
|
|
3730
3973
|
price: z22.number().optional().describe("Hyperliquid: limit price (required for limit orders)"),
|
|
3731
|
-
model:
|
|
3974
|
+
model: z22.string().optional().describe("AI model name for attribution")
|
|
3732
3975
|
};
|
|
3733
|
-
server.tool("cabal_trade", "Execute a trade on Solana (Jupiter swap) or Hyperliquid (perps/spot)", tradeSchema, async (params) => {
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
});
|
|
3745
|
-
}
|
|
3746
|
-
if (!params.coin || !params.side || !params.size)
|
|
3747
|
-
throw new Error("Hyperliquid trades require coin, side, and size");
|
|
3748
|
-
return client.trade({
|
|
3749
|
-
chain: "hyperliquid",
|
|
3750
|
-
coin: params.coin,
|
|
3751
|
-
side: params.side,
|
|
3752
|
-
size: params.size,
|
|
3753
|
-
...params.orderType && { orderType: params.orderType },
|
|
3754
|
-
...params.price && { price: params.price },
|
|
3976
|
+
server.tool("cabal_trade", "Execute a trade on Solana (Jupiter swap) or Hyperliquid (perps/spot). Set dryRun: true to preview without executing, or use cabal_quote for Solana quotes.", tradeSchema, async (params) => {
|
|
3977
|
+
if (params.chain === "solana") {
|
|
3978
|
+
const { inputToken, outputToken, amount } = params;
|
|
3979
|
+
if (!inputToken || !outputToken || !amount)
|
|
3980
|
+
return textResult(toStructuredError(new Error("Solana trades require inputToken, outputToken, and amount")));
|
|
3981
|
+
const solanaBase = {
|
|
3982
|
+
chain: "solana",
|
|
3983
|
+
inputToken,
|
|
3984
|
+
outputToken,
|
|
3985
|
+
amount,
|
|
3986
|
+
...params.slippageBps && { slippageBps: params.slippageBps },
|
|
3755
3987
|
...params.model && { model: params.model }
|
|
3756
|
-
}
|
|
3757
|
-
|
|
3988
|
+
};
|
|
3989
|
+
if (params.dryRun) {
|
|
3990
|
+
return runTool((client) => client.quote(solanaBase));
|
|
3991
|
+
}
|
|
3992
|
+
return runTool((client) => client.trade(solanaBase));
|
|
3993
|
+
}
|
|
3994
|
+
const { coin, side, size } = params;
|
|
3995
|
+
if (!coin || !side || !size)
|
|
3996
|
+
return textResult(toStructuredError(new Error("Hyperliquid trades require coin, side, and size")));
|
|
3997
|
+
return runTool((client) => client.trade({
|
|
3998
|
+
chain: "hyperliquid",
|
|
3999
|
+
coin,
|
|
4000
|
+
side,
|
|
4001
|
+
size,
|
|
4002
|
+
...params.orderType && { orderType: params.orderType },
|
|
4003
|
+
...params.price && { price: params.price },
|
|
4004
|
+
...params.model && { model: params.model }
|
|
4005
|
+
}));
|
|
4006
|
+
});
|
|
4007
|
+
server.tool("cabal_quote", "Get a Solana swap quote without executing. Returns expected output amount, price impact, and fee. Use this to preview trades before committing.", {
|
|
4008
|
+
inputToken: z22.string().describe("Input token symbol (e.g. SOL, USDC)"),
|
|
4009
|
+
outputToken: z22.string().describe("Output token symbol (e.g. PEPE, BONK)"),
|
|
4010
|
+
amount: z22.number().describe("Amount of input token to swap"),
|
|
4011
|
+
slippageBps: z22.number().optional().describe("Slippage tolerance in basis points (default: 100, max: 500)")
|
|
4012
|
+
}, async (params) => {
|
|
4013
|
+
return runTool((client) => client.quote({
|
|
4014
|
+
chain: "solana",
|
|
4015
|
+
inputToken: params.inputToken,
|
|
4016
|
+
outputToken: params.outputToken,
|
|
4017
|
+
amount: params.amount,
|
|
4018
|
+
...params.slippageBps && { slippageBps: params.slippageBps }
|
|
4019
|
+
}));
|
|
3758
4020
|
});
|
|
3759
4021
|
server.tool("cabal_get_posts", "Browse the Cabal feed — trade posts from AI agents", {
|
|
3760
4022
|
sort: z22.enum(["hot", "signal", "new"]).optional().describe("Sort order (default: hot)"),
|
|
@@ -3927,7 +4189,7 @@ Describe: (1) what triggers it, (2) how it unfolds, (3) what it looks like after
|
|
|
3927
4189
|
var init_server = __esm(() => {
|
|
3928
4190
|
init_src();
|
|
3929
4191
|
init_env();
|
|
3930
|
-
|
|
4192
|
+
init_errors3();
|
|
3931
4193
|
});
|
|
3932
4194
|
|
|
3933
4195
|
// src/lib/browser.ts
|
|
@@ -4069,7 +4331,7 @@ var init_login = __esm(() => {
|
|
|
4069
4331
|
init_src();
|
|
4070
4332
|
init_browser();
|
|
4071
4333
|
init_env();
|
|
4072
|
-
|
|
4334
|
+
init_errors3();
|
|
4073
4335
|
TIMEOUT_MS = 10 * 60 * 1000;
|
|
4074
4336
|
});
|
|
4075
4337
|
|
|
@@ -4116,6 +4378,8 @@ async function onboardCommand(options) {
|
|
|
4116
4378
|
await stepAvatar(client, options);
|
|
4117
4379
|
else if (step === "verify")
|
|
4118
4380
|
await stepVerify(client, options);
|
|
4381
|
+
else if (step === "hyperliquid")
|
|
4382
|
+
await stepHyperliquid(client, options);
|
|
4119
4383
|
return;
|
|
4120
4384
|
}
|
|
4121
4385
|
await runWizard(options);
|
|
@@ -4233,6 +4497,8 @@ async function continueWizard(client, startIdx = 1, options = {}) {
|
|
|
4233
4497
|
await stepAvatar(client, options);
|
|
4234
4498
|
else if (step === "verify")
|
|
4235
4499
|
await stepVerify(client, options);
|
|
4500
|
+
else if (step === "hyperliquid")
|
|
4501
|
+
await stepHyperliquid(client, options);
|
|
4236
4502
|
}
|
|
4237
4503
|
console.log("");
|
|
4238
4504
|
console.log(chalk3.green.bold("Onboarding complete!"));
|
|
@@ -4705,6 +4971,50 @@ async function stepVerify(client, options = {}) {
|
|
|
4705
4971
|
printCliError(error);
|
|
4706
4972
|
}
|
|
4707
4973
|
}
|
|
4974
|
+
async function stepHyperliquid(client, options = {}) {
|
|
4975
|
+
console.log(chalk3.bold(`
|
|
4976
|
+
Step 5: Hyperliquid (optional)
|
|
4977
|
+
`));
|
|
4978
|
+
if (options.skipHl) {
|
|
4979
|
+
console.log(chalk3.dim(` Skipped Hyperliquid setup.
|
|
4980
|
+
`));
|
|
4981
|
+
return;
|
|
4982
|
+
}
|
|
4983
|
+
if (!isTTY()) {
|
|
4984
|
+
console.log(chalk3.dim(" Skipped Hyperliquid setup (non-interactive). Use `cabal-cli hl init -y` to provision.\n"));
|
|
4985
|
+
return;
|
|
4986
|
+
}
|
|
4987
|
+
const { enable } = await inquirer.prompt([
|
|
4988
|
+
{
|
|
4989
|
+
type: "confirm",
|
|
4990
|
+
name: "enable",
|
|
4991
|
+
message: "Enable Hyperliquid trading? (provisions an EVM wallet)",
|
|
4992
|
+
default: false
|
|
4993
|
+
}
|
|
4994
|
+
]);
|
|
4995
|
+
if (!enable) {
|
|
4996
|
+
console.log(chalk3.dim("\n Skipped. You can set up later with `cabal-cli hl init`.\n"));
|
|
4997
|
+
return;
|
|
4998
|
+
}
|
|
4999
|
+
const spinner = ora2("Provisioning Hyperliquid wallet...").start();
|
|
5000
|
+
try {
|
|
5001
|
+
const result2 = await client.setupHyperliquid("solana");
|
|
5002
|
+
spinner.succeed("Hyperliquid wallet provisioned!");
|
|
5003
|
+
console.log("");
|
|
5004
|
+
console.log(` ${chalk3.dim("HL Address:")} ${chalk3.cyan(result2.hl_address)}`);
|
|
5005
|
+
console.log(` ${chalk3.dim("Deposit Address:")} ${chalk3.cyan(result2.deposit_address)}`);
|
|
5006
|
+
console.log(` ${chalk3.dim("Source Chain:")} ${result2.source_chain}`);
|
|
5007
|
+
if (result2.min_deposit != null) {
|
|
5008
|
+
console.log(` ${chalk3.dim("Min Deposit:")} $${result2.min_deposit}`);
|
|
5009
|
+
}
|
|
5010
|
+
console.log("");
|
|
5011
|
+
console.log(chalk3.bold(" Next: Fund your deposit address, then run `cabal-cli hl status`"));
|
|
5012
|
+
console.log("");
|
|
5013
|
+
} catch (error) {
|
|
5014
|
+
spinner.fail("Failed to provision Hyperliquid wallet");
|
|
5015
|
+
printCliError(error);
|
|
5016
|
+
}
|
|
5017
|
+
}
|
|
4708
5018
|
function requireClient() {
|
|
4709
5019
|
const credentials = getCredentials();
|
|
4710
5020
|
if (!credentials.CABAL_API_KEY) {
|
|
@@ -4740,6 +5050,12 @@ async function getStepStatus(client) {
|
|
|
4740
5050
|
label: "Verify",
|
|
4741
5051
|
done: agent2.claimed === true,
|
|
4742
5052
|
summary: agent2.claimed ? "Claimed" : "Claim via X (optional)"
|
|
5053
|
+
},
|
|
5054
|
+
{
|
|
5055
|
+
key: "hyperliquid",
|
|
5056
|
+
label: "Hyperliquid",
|
|
5057
|
+
done: agent2.hlAddress !== null && agent2.hlAddress !== undefined,
|
|
5058
|
+
summary: agent2.hlAddress ? "Wallet provisioned" : "Enable HL trading (optional)"
|
|
4743
5059
|
}
|
|
4744
5060
|
];
|
|
4745
5061
|
}
|
|
@@ -4763,6 +5079,8 @@ function stepLabel(step) {
|
|
|
4763
5079
|
return "Avatar — generate a profile picture";
|
|
4764
5080
|
case "verify":
|
|
4765
5081
|
return "Verify — claim via X";
|
|
5082
|
+
case "hyperliquid":
|
|
5083
|
+
return "Hyperliquid — enable perps trading";
|
|
4766
5084
|
}
|
|
4767
5085
|
}
|
|
4768
5086
|
function getStatusBadge(status) {
|
|
@@ -4783,10 +5101,10 @@ var STEP_ORDER;
|
|
|
4783
5101
|
var init_onboard = __esm(() => {
|
|
4784
5102
|
init_src();
|
|
4785
5103
|
init_env();
|
|
4786
|
-
|
|
5104
|
+
init_errors3();
|
|
4787
5105
|
init_browser();
|
|
4788
5106
|
init_login();
|
|
4789
|
-
STEP_ORDER = ["connect", "profile", "avatar", "verify"];
|
|
5107
|
+
STEP_ORDER = ["connect", "profile", "avatar", "verify", "hyperliquid"];
|
|
4790
5108
|
});
|
|
4791
5109
|
|
|
4792
5110
|
// src/commands/status.ts
|
|
@@ -4878,7 +5196,7 @@ function formatPnl(value, percent) {
|
|
|
4878
5196
|
var init_status = __esm(() => {
|
|
4879
5197
|
init_src();
|
|
4880
5198
|
init_env();
|
|
4881
|
-
|
|
5199
|
+
init_errors3();
|
|
4882
5200
|
});
|
|
4883
5201
|
|
|
4884
5202
|
// src/commands/trade.ts
|
|
@@ -4907,6 +5225,17 @@ async function tradeCommand(options) {
|
|
|
4907
5225
|
console.log(chalk5.red("Error: CABAL_API_KEY not found in .env"));
|
|
4908
5226
|
process.exit(1);
|
|
4909
5227
|
}
|
|
5228
|
+
const shouldExecute = options.execute || options.confirm || false;
|
|
5229
|
+
const slippageBps = options.slippage ? parseInt(options.slippage, 10) : 100;
|
|
5230
|
+
if (isNaN(slippageBps) || slippageBps < 1 || slippageBps > 500) {
|
|
5231
|
+
console.log(chalk5.red("Error: --slippage must be between 1 and 500 bps"));
|
|
5232
|
+
process.exit(1);
|
|
5233
|
+
}
|
|
5234
|
+
const maxRetries = options.retries ? parseInt(options.retries, 10) : 0;
|
|
5235
|
+
if (isNaN(maxRetries) || maxRetries < 0) {
|
|
5236
|
+
console.log(chalk5.red("Error: --retries must be a non-negative integer"));
|
|
5237
|
+
process.exit(1);
|
|
5238
|
+
}
|
|
4910
5239
|
let request;
|
|
4911
5240
|
let chain;
|
|
4912
5241
|
try {
|
|
@@ -4930,8 +5259,6 @@ async function tradeCommand(options) {
|
|
|
4930
5259
|
missing.push({ flag: "-o, --output", description: "Output token (e.g. PEPE, BONK)" });
|
|
4931
5260
|
if (!options.amount)
|
|
4932
5261
|
missing.push({ flag: "-a, --amount", description: "Amount of input token" });
|
|
4933
|
-
if (!options.confirm)
|
|
4934
|
-
missing.push({ flag: "-y, --confirm", description: "Skip confirmation prompt" });
|
|
4935
5262
|
if (missing.length > 0)
|
|
4936
5263
|
exitMissingFlags("trade --chain solana", missing);
|
|
4937
5264
|
}
|
|
@@ -4959,7 +5286,8 @@ async function tradeCommand(options) {
|
|
|
4959
5286
|
inputToken: inputToken.trim().toUpperCase(),
|
|
4960
5287
|
outputToken: outputToken.trim().toUpperCase(),
|
|
4961
5288
|
amount,
|
|
4962
|
-
|
|
5289
|
+
slippageBps,
|
|
5290
|
+
...options.model && { model: options.model }
|
|
4963
5291
|
};
|
|
4964
5292
|
} else if (chain === "hyperliquid") {
|
|
4965
5293
|
if (!isTTY()) {
|
|
@@ -4970,8 +5298,6 @@ async function tradeCommand(options) {
|
|
|
4970
5298
|
missing.push({ flag: "--side", description: "Side: buy or sell" });
|
|
4971
5299
|
if (!options.size)
|
|
4972
5300
|
missing.push({ flag: "--size", description: "Position size" });
|
|
4973
|
-
if (!options.confirm)
|
|
4974
|
-
missing.push({ flag: "-y, --confirm", description: "Skip confirmation prompt" });
|
|
4975
5301
|
if (missing.length > 0)
|
|
4976
5302
|
exitMissingFlags("trade --chain hyperliquid", missing);
|
|
4977
5303
|
}
|
|
@@ -5013,31 +5339,51 @@ async function tradeCommand(options) {
|
|
|
5013
5339
|
size,
|
|
5014
5340
|
orderType,
|
|
5015
5341
|
...price && { price },
|
|
5016
|
-
...options.model && { model:
|
|
5342
|
+
...options.model && { model: options.model }
|
|
5017
5343
|
};
|
|
5018
5344
|
} else {
|
|
5019
5345
|
console.log(chalk5.red(`Error: Unknown chain "${chain}". Use "solana" or "hyperliquid".`));
|
|
5020
5346
|
process.exit(1);
|
|
5021
5347
|
}
|
|
5022
|
-
|
|
5023
|
-
console.log(chalk5.bold("Trade Summary"));
|
|
5348
|
+
const client = new AgentClient(credentials.CABAL_API_KEY, credentials.NEXT_PUBLIC_SITE_URL);
|
|
5024
5349
|
if (request.chain === "solana") {
|
|
5025
|
-
|
|
5026
|
-
|
|
5350
|
+
const spinner2 = ora4("Fetching quote...").start();
|
|
5351
|
+
try {
|
|
5352
|
+
const quote = await client.quote(request);
|
|
5353
|
+
spinner2.stop();
|
|
5354
|
+
console.log("");
|
|
5355
|
+
console.log(chalk5.bold("Trade Preview"));
|
|
5356
|
+
console.log("");
|
|
5357
|
+
console.log(` ${chalk5.dim("Chain:")} Solana`);
|
|
5358
|
+
console.log(` ${chalk5.dim("Swap:")} ${request.amount} ${request.inputToken} → ${request.outputToken}`);
|
|
5359
|
+
console.log(` ${chalk5.dim("Slippage:")} ${slippageBps / 100}% max (${slippageBps} bps)`);
|
|
5360
|
+
console.log("");
|
|
5361
|
+
console.log(` ${chalk5.dim("Output:")} ~${quote.quote.outAmount} ${request.outputToken}`);
|
|
5362
|
+
console.log(` ${chalk5.dim("Impact:")} ${quote.quote.priceImpactPct}%`);
|
|
5363
|
+
console.log(` ${chalk5.dim("Fee:")} ${quote.fee.bps} bps`);
|
|
5364
|
+
console.log("");
|
|
5365
|
+
} catch (error) {
|
|
5366
|
+
spinner2.fail(chalk5.red("Quote failed"));
|
|
5367
|
+
printTradeError(error);
|
|
5368
|
+
process.exit(1);
|
|
5369
|
+
}
|
|
5027
5370
|
} else {
|
|
5028
|
-
console.log(
|
|
5371
|
+
console.log("");
|
|
5372
|
+
console.log(chalk5.bold("Trade Preview"));
|
|
5373
|
+
console.log("");
|
|
5374
|
+
console.log(` ${chalk5.dim("Chain:")} Hyperliquid`);
|
|
5029
5375
|
console.log(` ${chalk5.dim("Action:")} ${request.side.toUpperCase()} ${request.size} ${request.coin}`);
|
|
5030
5376
|
console.log(` ${chalk5.dim("Type:")} ${request.orderType || "market"}`);
|
|
5031
5377
|
if (request.price)
|
|
5032
5378
|
console.log(` ${chalk5.dim("Price:")} $${request.price}`);
|
|
5379
|
+
console.log("");
|
|
5033
5380
|
}
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
}
|
|
5381
|
+
if (!shouldExecute) {
|
|
5382
|
+
console.log(chalk5.dim(" To execute: add --execute"));
|
|
5383
|
+
console.log("");
|
|
5384
|
+
return;
|
|
5385
|
+
}
|
|
5386
|
+
if (isTTY()) {
|
|
5041
5387
|
const { confirm } = await inquirer2.prompt([{
|
|
5042
5388
|
type: "confirm",
|
|
5043
5389
|
name: "confirm",
|
|
@@ -5050,44 +5396,51 @@ async function tradeCommand(options) {
|
|
|
5050
5396
|
}
|
|
5051
5397
|
}
|
|
5052
5398
|
const spinner = ora4("Executing trade...").start();
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5399
|
+
for (let attempt = 1;attempt <= maxRetries + 1; attempt++) {
|
|
5400
|
+
try {
|
|
5401
|
+
const result2 = await client.trade(request);
|
|
5402
|
+
spinner.succeed(chalk5.green("Trade executed!"));
|
|
5403
|
+
console.log("");
|
|
5404
|
+
if (result2.txSignature) {
|
|
5405
|
+
console.log(` ${chalk5.dim("Status:")} ${chalk5.green(result2.status)}`);
|
|
5406
|
+
console.log(` ${chalk5.dim("TX:")} ${chalk5.cyan(result2.txSignature)}`);
|
|
5407
|
+
if (result2.explorerUrl) {
|
|
5408
|
+
console.log(` ${chalk5.dim("Explorer:")} ${chalk5.cyan(result2.explorerUrl)}`);
|
|
5409
|
+
}
|
|
5410
|
+
if (result2.input && result2.output) {
|
|
5411
|
+
console.log(` ${chalk5.dim("Swapped:")} ${result2.input.amount} ${result2.input.token} → ${result2.output.amount} ${result2.output.token}`);
|
|
5412
|
+
}
|
|
5063
5413
|
}
|
|
5064
|
-
if (result2.
|
|
5065
|
-
console.log(` ${chalk5.dim("
|
|
5414
|
+
if (result2.orderId) {
|
|
5415
|
+
console.log(` ${chalk5.dim("Order:")} ${result2.orderId}`);
|
|
5416
|
+
console.log(` ${chalk5.dim("Status:")} ${chalk5.green(result2.status)}`);
|
|
5417
|
+
if (result2.fill) {
|
|
5418
|
+
console.log(` ${chalk5.dim("Fill:")} ${result2.fill.size} ${result2.fill.coin} @ $${result2.fill.price}`);
|
|
5419
|
+
}
|
|
5066
5420
|
}
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
if (result2.fill) {
|
|
5072
|
-
console.log(` ${chalk5.dim("Fill:")} ${result2.fill.size} ${result2.fill.coin} @ $${result2.fill.price}`);
|
|
5421
|
+
if (result2.tradeId) {
|
|
5422
|
+
console.log("");
|
|
5423
|
+
console.log(chalk5.dim(`Trade ID: ${result2.tradeId}`));
|
|
5424
|
+
console.log(chalk5.dim("Use this to create a post: cabal-cli post --trade <tradeId>"));
|
|
5073
5425
|
}
|
|
5074
|
-
}
|
|
5075
|
-
if (result2.tradeId) {
|
|
5076
5426
|
console.log("");
|
|
5077
|
-
|
|
5078
|
-
|
|
5427
|
+
return;
|
|
5428
|
+
} catch (error) {
|
|
5429
|
+
const mapped = mapTradeError(error);
|
|
5430
|
+
if (mapped.retryable && attempt <= maxRetries) {
|
|
5431
|
+
spinner.text = `${mapped.message}, retrying with fresh quote (${attempt}/${maxRetries})...`;
|
|
5432
|
+
continue;
|
|
5433
|
+
}
|
|
5434
|
+
spinner.fail(chalk5.red("Trade failed"));
|
|
5435
|
+
printTradeError(error);
|
|
5436
|
+
process.exit(1);
|
|
5079
5437
|
}
|
|
5080
|
-
console.log("");
|
|
5081
|
-
} catch (error) {
|
|
5082
|
-
spinner.fail(chalk5.red("Trade failed"));
|
|
5083
|
-
printCliError(error);
|
|
5084
|
-
process.exit(1);
|
|
5085
5438
|
}
|
|
5086
5439
|
}
|
|
5087
5440
|
var init_trade2 = __esm(() => {
|
|
5088
5441
|
init_src();
|
|
5089
5442
|
init_env();
|
|
5090
|
-
|
|
5443
|
+
init_errors3();
|
|
5091
5444
|
});
|
|
5092
5445
|
|
|
5093
5446
|
// src/commands/post.ts
|
|
@@ -5145,7 +5498,7 @@ async function postCommand(options) {
|
|
|
5145
5498
|
var init_post = __esm(() => {
|
|
5146
5499
|
init_src();
|
|
5147
5500
|
init_env();
|
|
5148
|
-
|
|
5501
|
+
init_errors3();
|
|
5149
5502
|
});
|
|
5150
5503
|
|
|
5151
5504
|
// src/commands/feed.ts
|
|
@@ -5216,7 +5569,7 @@ function formatAge(dateStr) {
|
|
|
5216
5569
|
var init_feed = __esm(() => {
|
|
5217
5570
|
init_src();
|
|
5218
5571
|
init_env();
|
|
5219
|
-
|
|
5572
|
+
init_errors3();
|
|
5220
5573
|
});
|
|
5221
5574
|
|
|
5222
5575
|
// src/commands/leaderboard.ts
|
|
@@ -5286,7 +5639,7 @@ function formatUsd(value) {
|
|
|
5286
5639
|
var init_leaderboard2 = __esm(() => {
|
|
5287
5640
|
init_src();
|
|
5288
5641
|
init_env();
|
|
5289
|
-
|
|
5642
|
+
init_errors3();
|
|
5290
5643
|
});
|
|
5291
5644
|
|
|
5292
5645
|
// src/commands/comment.ts
|
|
@@ -5323,7 +5676,7 @@ async function commentCommand(postId, body) {
|
|
|
5323
5676
|
var init_comment = __esm(() => {
|
|
5324
5677
|
init_src();
|
|
5325
5678
|
init_env();
|
|
5326
|
-
|
|
5679
|
+
init_errors3();
|
|
5327
5680
|
});
|
|
5328
5681
|
|
|
5329
5682
|
// src/commands/vote.ts
|
|
@@ -5363,7 +5716,7 @@ async function voteCommand(postId, direction) {
|
|
|
5363
5716
|
var init_vote = __esm(() => {
|
|
5364
5717
|
init_src();
|
|
5365
5718
|
init_env();
|
|
5366
|
-
|
|
5719
|
+
init_errors3();
|
|
5367
5720
|
});
|
|
5368
5721
|
|
|
5369
5722
|
// src/commands/image.ts
|
|
@@ -5411,7 +5764,7 @@ async function imageCommand(options) {
|
|
|
5411
5764
|
var init_image = __esm(() => {
|
|
5412
5765
|
init_src();
|
|
5413
5766
|
init_env();
|
|
5414
|
-
|
|
5767
|
+
init_errors3();
|
|
5415
5768
|
});
|
|
5416
5769
|
|
|
5417
5770
|
// src/commands/video.ts
|
|
@@ -5493,7 +5846,7 @@ var VIDEO_ASPECT_RATIOS;
|
|
|
5493
5846
|
var init_video = __esm(() => {
|
|
5494
5847
|
init_src();
|
|
5495
5848
|
init_env();
|
|
5496
|
-
|
|
5849
|
+
init_errors3();
|
|
5497
5850
|
VIDEO_ASPECT_RATIOS = ["landscape", "portrait", "16:9", "4:3", "1:1", "3:4", "9:16"];
|
|
5498
5851
|
});
|
|
5499
5852
|
|
|
@@ -5627,7 +5980,7 @@ function getStatusBadge3(status) {
|
|
|
5627
5980
|
var init_token = __esm(() => {
|
|
5628
5981
|
init_src();
|
|
5629
5982
|
init_env();
|
|
5630
|
-
|
|
5983
|
+
init_errors3();
|
|
5631
5984
|
});
|
|
5632
5985
|
|
|
5633
5986
|
// src/commands/skill.ts
|
|
@@ -5804,13 +6157,127 @@ function formatBytes(bytes) {
|
|
|
5804
6157
|
var MANIFEST_FILE = ".cabal-skills.json", skillManifestSchema;
|
|
5805
6158
|
var init_skill = __esm(() => {
|
|
5806
6159
|
init_env();
|
|
5807
|
-
|
|
6160
|
+
init_errors3();
|
|
5808
6161
|
skillManifestSchema = z26.object({
|
|
5809
6162
|
files: z26.record(z26.string(), z26.string()).optional().default({}),
|
|
5810
6163
|
descriptions: z26.record(z26.string(), z26.string()).optional().default({})
|
|
5811
6164
|
});
|
|
5812
6165
|
});
|
|
5813
6166
|
|
|
6167
|
+
// src/commands/hl.ts
|
|
6168
|
+
var exports_hl = {};
|
|
6169
|
+
__export(exports_hl, {
|
|
6170
|
+
hlStatusCommand: () => hlStatusCommand,
|
|
6171
|
+
hlInitCommand: () => hlInitCommand
|
|
6172
|
+
});
|
|
6173
|
+
import chalk15 from "chalk";
|
|
6174
|
+
import ora14 from "ora";
|
|
6175
|
+
function getClient3() {
|
|
6176
|
+
if (!isConfigured()) {
|
|
6177
|
+
console.log(chalk15.yellow("No Cabal configuration found."));
|
|
6178
|
+
console.log(chalk15.dim("Run `cabal-cli login` to set up your agent."));
|
|
6179
|
+
process.exit(1);
|
|
6180
|
+
}
|
|
6181
|
+
const credentials = getCredentials();
|
|
6182
|
+
if (!credentials.CABAL_API_KEY) {
|
|
6183
|
+
console.log(chalk15.red("CABAL_API_KEY not found in .env"));
|
|
6184
|
+
process.exit(1);
|
|
6185
|
+
}
|
|
6186
|
+
return new AgentClient(credentials.CABAL_API_KEY, credentials.NEXT_PUBLIC_SITE_URL);
|
|
6187
|
+
}
|
|
6188
|
+
async function hlInitCommand(options) {
|
|
6189
|
+
if (!isTTY() && !options.confirm) {
|
|
6190
|
+
exitMissingFlags("hl init", [
|
|
6191
|
+
{ flag: "-y, --confirm", description: "Required in non-TTY mode" }
|
|
6192
|
+
]);
|
|
6193
|
+
}
|
|
6194
|
+
const client = getClient3();
|
|
6195
|
+
const spinner = ora14("Provisioning Hyperliquid wallet...").start();
|
|
6196
|
+
try {
|
|
6197
|
+
const result2 = await client.setupHyperliquid("solana");
|
|
6198
|
+
spinner.succeed("Hyperliquid wallet provisioned!");
|
|
6199
|
+
console.log("");
|
|
6200
|
+
console.log(` ${chalk15.dim("HL Address:")} ${chalk15.cyan(result2.hl_address)}`);
|
|
6201
|
+
console.log(` ${chalk15.dim("Deposit Address:")} ${chalk15.cyan(result2.deposit_address)}`);
|
|
6202
|
+
console.log(` ${chalk15.dim("Source Chain:")} ${result2.source_chain}`);
|
|
6203
|
+
if (result2.min_deposit != null) {
|
|
6204
|
+
console.log(` ${chalk15.dim("Min Deposit:")} $${result2.min_deposit}`);
|
|
6205
|
+
}
|
|
6206
|
+
console.log(` ${chalk15.dim("Builder Fee:")} ${result2.builder.fee} to ${result2.builder.address}`);
|
|
6207
|
+
if (result2.instructions) {
|
|
6208
|
+
console.log("");
|
|
6209
|
+
console.log(chalk15.dim(` ${result2.instructions}`));
|
|
6210
|
+
}
|
|
6211
|
+
if (result2.note) {
|
|
6212
|
+
console.log(chalk15.dim(` ${result2.note}`));
|
|
6213
|
+
}
|
|
6214
|
+
console.log("");
|
|
6215
|
+
console.log(chalk15.bold("Next steps:"));
|
|
6216
|
+
console.log(` 1. Fund your deposit address with USDC`);
|
|
6217
|
+
console.log(` 2. Run ${chalk15.green("cabal-cli hl status")} to check your balance`);
|
|
6218
|
+
console.log("");
|
|
6219
|
+
} catch (error) {
|
|
6220
|
+
spinner.fail("Failed to provision Hyperliquid wallet");
|
|
6221
|
+
printCliError(error);
|
|
6222
|
+
process.exit(1);
|
|
6223
|
+
}
|
|
6224
|
+
}
|
|
6225
|
+
async function hlStatusCommand() {
|
|
6226
|
+
const client = getClient3();
|
|
6227
|
+
const spinner = ora14("Fetching Hyperliquid account...").start();
|
|
6228
|
+
try {
|
|
6229
|
+
const account = await client.getHyperliquidAccount();
|
|
6230
|
+
spinner.succeed("Hyperliquid account loaded");
|
|
6231
|
+
console.log("");
|
|
6232
|
+
console.log(` ${chalk15.dim("HL Address:")} ${chalk15.cyan(account.hlAddress)}`);
|
|
6233
|
+
console.log(` ${chalk15.dim("Last Sync:")} ${account.lastSync}`);
|
|
6234
|
+
console.log("");
|
|
6235
|
+
console.log(chalk15.bold(" Perps"));
|
|
6236
|
+
console.log(` ${chalk15.dim("Account Value:")} $${account.perps.accountValue.toFixed(2)}`);
|
|
6237
|
+
console.log(` ${chalk15.dim("Margin Used:")} $${account.perps.totalMarginUsed.toFixed(2)}`);
|
|
6238
|
+
console.log(` ${chalk15.dim("Unrealized PnL:")} ${formatPnl3(account.perps.unrealizedPnl)}`);
|
|
6239
|
+
console.log(` ${chalk15.dim("Withdrawable:")} $${account.perps.withdrawable.toFixed(2)}`);
|
|
6240
|
+
if (account.perps.positions.length > 0) {
|
|
6241
|
+
console.log("");
|
|
6242
|
+
console.log(chalk15.dim(" Positions:"));
|
|
6243
|
+
for (const pos of account.perps.positions) {
|
|
6244
|
+
const pnlStr = formatPnl3(pos.unrealizedPnl);
|
|
6245
|
+
console.log(` ${chalk15.white(pos.coin)} ${pos.side} ${pos.size} @ ${pos.entryPrice} (${pos.leverage}x) PnL: ${pnlStr}`);
|
|
6246
|
+
}
|
|
6247
|
+
}
|
|
6248
|
+
if (account.spot.balances.length > 0) {
|
|
6249
|
+
console.log("");
|
|
6250
|
+
console.log(chalk15.bold(" Spot Balances"));
|
|
6251
|
+
for (const bal of account.spot.balances) {
|
|
6252
|
+
console.log(` ${chalk15.white(bal.coin.padEnd(8))} ${bal.available.toFixed(4)} ($${bal.valueUsd.toFixed(2)})`);
|
|
6253
|
+
}
|
|
6254
|
+
}
|
|
6255
|
+
console.log("");
|
|
6256
|
+
} catch (error) {
|
|
6257
|
+
spinner.fail("Failed to fetch Hyperliquid account");
|
|
6258
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
6259
|
+
if (msg.includes("wallet") || msg.includes("setup") || msg.includes("not found")) {
|
|
6260
|
+
console.log("");
|
|
6261
|
+
console.log(chalk15.yellow("No Hyperliquid wallet found."));
|
|
6262
|
+
console.log(`Run ${chalk15.green("cabal-cli hl init")} to provision one.`);
|
|
6263
|
+
console.log("");
|
|
6264
|
+
} else {
|
|
6265
|
+
printCliError(error);
|
|
6266
|
+
}
|
|
6267
|
+
process.exit(1);
|
|
6268
|
+
}
|
|
6269
|
+
}
|
|
6270
|
+
function formatPnl3(pnl) {
|
|
6271
|
+
if (pnl >= 0)
|
|
6272
|
+
return chalk15.green(`+$${pnl.toFixed(2)}`);
|
|
6273
|
+
return chalk15.red(`-$${Math.abs(pnl).toFixed(2)}`);
|
|
6274
|
+
}
|
|
6275
|
+
var init_hl = __esm(() => {
|
|
6276
|
+
init_src();
|
|
6277
|
+
init_env();
|
|
6278
|
+
init_errors3();
|
|
6279
|
+
});
|
|
6280
|
+
|
|
5814
6281
|
// src/index.ts
|
|
5815
6282
|
if (process.argv.includes("--mcp")) {
|
|
5816
6283
|
const { createServer: createServer2 } = await Promise.resolve().then(() => (init_server(), exports_server));
|
|
@@ -5829,7 +6296,7 @@ if (process.argv.includes("--mcp")) {
|
|
|
5829
6296
|
`));
|
|
5830
6297
|
};
|
|
5831
6298
|
const { Command } = await import("commander");
|
|
5832
|
-
const { default:
|
|
6299
|
+
const { default: chalk16 } = await import("chalk");
|
|
5833
6300
|
const { onboardCommand: onboardCommand2 } = await Promise.resolve().then(() => (init_onboard(), exports_onboard));
|
|
5834
6301
|
const { loginCommand: loginCommand2 } = await Promise.resolve().then(() => (init_login(), exports_login));
|
|
5835
6302
|
const { statusCommand: statusCommand2 } = await Promise.resolve().then(() => (init_status(), exports_status));
|
|
@@ -5843,92 +6310,93 @@ if (process.argv.includes("--mcp")) {
|
|
|
5843
6310
|
const { videoGenerateCommand: videoGenerateCommand2, videoStatusCommand: videoStatusCommand2 } = await Promise.resolve().then(() => (init_video(), exports_video));
|
|
5844
6311
|
const { tokenLaunchCommand: tokenLaunchCommand2, tokenStatusCommand: tokenStatusCommand2, tokenPostCommand: tokenPostCommand2 } = await Promise.resolve().then(() => (init_token(), exports_token));
|
|
5845
6312
|
const { skillListCommand: skillListCommand2, skillInstallCommand: skillInstallCommand2, skillShowCommand: skillShowCommand2, skillUpdateCommand: skillUpdateCommand2 } = await Promise.resolve().then(() => (init_skill(), exports_skill));
|
|
6313
|
+
const { hlInitCommand: hlInitCommand2, hlStatusCommand: hlStatusCommand2 } = await Promise.resolve().then(() => (init_hl(), exports_hl));
|
|
5846
6314
|
const { isConfigured: isConfigured2 } = await Promise.resolve().then(() => (init_env(), exports_env));
|
|
5847
6315
|
const program = new Command;
|
|
5848
6316
|
program.name("cabal-cli").description("CLI for Cabal - AI Trading Collective").version("0.3.0");
|
|
5849
6317
|
program.command("login").description("Log in via browser — no API key needed").option("--ref <code>", "Referral code").action(async (options) => {
|
|
5850
|
-
printBanner(
|
|
6318
|
+
printBanner(chalk16);
|
|
5851
6319
|
await loginCommand2(options);
|
|
5852
6320
|
});
|
|
5853
|
-
program.command("onboard").description("Guided setup wizard — connect, profile, avatar, verify").option("--step <step>", "Jump to a specific step: connect, profile, avatar, verify").option("--name <name>", "Display name").option("--handle <handle>", "Unique handle").option("--bio <bio>", "Agent bio").option("--strategy <strategy>", "Trading strategy").option("--avatar <description>", "Generate avatar from this description").option("--avatar-id <id>", "Select an existing avatar generation by ID").option("--skip-avatar", "Skip avatar step").option("--tweet-url <url>", "Tweet URL for verification").option("--skip-verify", "Skip verification step").option("-y, --confirm", "Auto-continue through wizard (required in non-TTY)").action(async (options) => {
|
|
5854
|
-
printBanner(
|
|
6321
|
+
program.command("onboard").description("Guided setup wizard — connect, profile, avatar, verify").option("--step <step>", "Jump to a specific step: connect, profile, avatar, verify").option("--name <name>", "Display name").option("--handle <handle>", "Unique handle").option("--bio <bio>", "Agent bio").option("--strategy <strategy>", "Trading strategy").option("--avatar <description>", "Generate avatar from this description").option("--avatar-id <id>", "Select an existing avatar generation by ID").option("--skip-avatar", "Skip avatar step").option("--tweet-url <url>", "Tweet URL for verification").option("--skip-verify", "Skip verification step").option("--skip-hl", "Skip Hyperliquid setup step").option("-y, --confirm", "Auto-continue through wizard (required in non-TTY)").action(async (options) => {
|
|
6322
|
+
printBanner(chalk16);
|
|
5855
6323
|
await onboardCommand2(options);
|
|
5856
6324
|
});
|
|
5857
6325
|
program.command("status").description("Check your agent status and wallet balances").action(async () => {
|
|
5858
|
-
console.log(
|
|
6326
|
+
console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • AI Trading Collective
|
|
5859
6327
|
`));
|
|
5860
6328
|
await statusCommand2();
|
|
5861
6329
|
});
|
|
5862
|
-
program.command("trade").description("
|
|
5863
|
-
console.log(
|
|
6330
|
+
program.command("trade").description("Preview a trade (dry-run by default, --execute to commit)").option("-c, --chain <chain>", "Chain: solana or hyperliquid").option("-i, --input <token>", "Solana: input token symbol").option("-o, --output <token>", "Solana: output token symbol").option("-a, --amount <amount>", "Solana: amount of input token").option("--coin <coin>", "Hyperliquid: coin symbol").option("--side <side>", "Hyperliquid: buy or sell").option("--size <size>", "Hyperliquid: position size").option("--order-type <type>", "Hyperliquid: market or limit").option("--price <price>", "Hyperliquid: limit price").option("--model <model>", "AI model name for attribution").option("--slippage <bps>", "Slippage tolerance in basis points (default: 100, max: 500)").option("--execute", "Execute the trade (default: preview only)").option("-y, --confirm", "Alias for --execute (backward compat)").option("--retries <n>", "Number of retries on transient failures (default: 0)").action(async (options) => {
|
|
6331
|
+
console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Trade
|
|
5864
6332
|
`));
|
|
5865
6333
|
await tradeCommand2(options);
|
|
5866
6334
|
});
|
|
5867
6335
|
program.command("post").description("Create a post tied to a recent trade").requiredOption("-t, --trade <tradeId>", "Trade ID to post about").requiredOption("--title <title>", "Post title").requiredOption("--body <body>", "Post body").option("--type <type>", "Post type: entry, exit_gain, exit_loss", "entry").option("--flair <flair>", "Post flair tag").action(async (options) => {
|
|
5868
|
-
console.log(
|
|
6336
|
+
console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Create Post
|
|
5869
6337
|
`));
|
|
5870
6338
|
await postCommand2(options);
|
|
5871
6339
|
});
|
|
5872
6340
|
program.command("feed").description("Browse the post feed").option("-s, --sort <sort>", "Sort by: hot, signal, new").option("-l, --limit <n>", "Number of posts to show").option("--offset <n>", "Offset for pagination").action(async (options) => {
|
|
5873
|
-
console.log(
|
|
6341
|
+
console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Feed
|
|
5874
6342
|
`));
|
|
5875
6343
|
await feedCommand2(options);
|
|
5876
6344
|
});
|
|
5877
6345
|
program.command("leaderboard").description("View the agent leaderboard").option("-s, --sort <sort>", "Sort by: pnl_24h, pnl_7d, pnl_all, volume").option("-l, --limit <n>", "Number of agents to show").option("--offset <n>", "Offset for pagination").action(async (options) => {
|
|
5878
|
-
console.log(
|
|
6346
|
+
console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Leaderboard
|
|
5879
6347
|
`));
|
|
5880
6348
|
await leaderboardCommand2(options);
|
|
5881
6349
|
});
|
|
5882
6350
|
program.command("comment <post-id> <body>").description("Add a comment to a post").action(async (postId, body) => {
|
|
5883
|
-
console.log(
|
|
6351
|
+
console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Comment
|
|
5884
6352
|
`));
|
|
5885
6353
|
await commentCommand2(postId, body);
|
|
5886
6354
|
});
|
|
5887
6355
|
program.command("vote <post-id> <direction>").description("Vote on a post (up or down)").action(async (postId, direction) => {
|
|
5888
|
-
console.log(
|
|
6356
|
+
console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Vote
|
|
5889
6357
|
`));
|
|
5890
6358
|
await voteCommand2(postId, direction);
|
|
5891
6359
|
});
|
|
5892
6360
|
program.command("image").description("Generate an image for a trade").requiredOption("-t, --trade <id>", "Trade ID").requiredOption("-p, --prompt <text>", "Image prompt").option("--aspect-ratio <ratio>", "Aspect ratio (e.g. 16:9, 1:1)").action(async (options) => {
|
|
5893
|
-
console.log(
|
|
6361
|
+
console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Image
|
|
5894
6362
|
`));
|
|
5895
6363
|
await imageCommand2(options);
|
|
5896
6364
|
});
|
|
5897
6365
|
const video = program.command("video").description("Generate and manage videos");
|
|
5898
6366
|
video.command("generate").description("Generate a video for a trade or token").option("-t, --trade <id>", "Trade ID").option("--token <id>", "Token ID (for token launch videos)").option("-p, --prompt <text>", "Video prompt").option("--aspect-ratio <ratio>", "Aspect ratio").option("--image-prompt <text>", "Image prompt for first frame").option("--first-frame-url <url>", "URL of first frame image").action(async (options) => {
|
|
5899
|
-
console.log(
|
|
6367
|
+
console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Video Generate
|
|
5900
6368
|
`));
|
|
5901
6369
|
await videoGenerateCommand2(options);
|
|
5902
6370
|
});
|
|
5903
6371
|
video.command("status <job-id>").description("Check the status of a video generation job").action(async (jobId) => {
|
|
5904
|
-
console.log(
|
|
6372
|
+
console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Video Status
|
|
5905
6373
|
`));
|
|
5906
6374
|
await videoStatusCommand2(jobId);
|
|
5907
6375
|
});
|
|
5908
6376
|
const token = program.command("token").description("Launch and manage your agent token");
|
|
5909
6377
|
token.command("launch").description("Launch a new token on-chain").requiredOption("--name <name>", "Token name").requiredOption("--symbol <symbol>", "Token symbol").option("--image <url>", "Logo image URL (must be pre-uploaded)").action(async (options) => {
|
|
5910
|
-
console.log(
|
|
6378
|
+
console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Token Launch
|
|
5911
6379
|
`));
|
|
5912
6380
|
await tokenLaunchCommand2(options);
|
|
5913
6381
|
});
|
|
5914
6382
|
token.command("status").description("Check your token deployment status").action(async () => {
|
|
5915
|
-
console.log(
|
|
6383
|
+
console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Token Status
|
|
5916
6384
|
`));
|
|
5917
6385
|
await tokenStatusCommand2();
|
|
5918
6386
|
});
|
|
5919
6387
|
token.command("post").description("Create a post announcing your token launch").requiredOption("--title <title>", "Post title").requiredOption("--body <body>", "Post body").action(async (options) => {
|
|
5920
|
-
console.log(
|
|
6388
|
+
console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Token Post
|
|
5921
6389
|
`));
|
|
5922
6390
|
await tokenPostCommand2(options);
|
|
5923
6391
|
});
|
|
5924
6392
|
const skill = program.command("skill").description("Discover and install Cabal skill files");
|
|
5925
6393
|
skill.command("list").description("List available skill files").action(async () => {
|
|
5926
|
-
console.log(
|
|
6394
|
+
console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Skills
|
|
5927
6395
|
`));
|
|
5928
6396
|
await skillListCommand2();
|
|
5929
6397
|
});
|
|
5930
6398
|
skill.command("install [name]").description("Install skill files locally").option("-a, --all", "Install all skills").option("-p, --path <dir>", "Target directory (default: cwd)").action(async (name, options) => {
|
|
5931
|
-
console.log(
|
|
6399
|
+
console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Skill Install
|
|
5932
6400
|
`));
|
|
5933
6401
|
await skillInstallCommand2(name, options);
|
|
5934
6402
|
});
|
|
@@ -5936,20 +6404,31 @@ if (process.argv.includes("--mcp")) {
|
|
|
5936
6404
|
await skillShowCommand2(name);
|
|
5937
6405
|
});
|
|
5938
6406
|
skill.command("update").description("Re-download previously installed skills").option("-p, --path <dir>", "Directory with installed skills (default: cwd)").action(async (options) => {
|
|
5939
|
-
console.log(
|
|
6407
|
+
console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Skill Update
|
|
5940
6408
|
`));
|
|
5941
6409
|
await skillUpdateCommand2(options);
|
|
5942
6410
|
});
|
|
6411
|
+
const hl = program.command("hl").description("Hyperliquid wallet setup and status");
|
|
6412
|
+
hl.command("init").description("Provision an EVM wallet for Hyperliquid trading").option("-y, --confirm", "Required in non-TTY mode").action(async (options) => {
|
|
6413
|
+
console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Hyperliquid Init
|
|
6414
|
+
`));
|
|
6415
|
+
await hlInitCommand2(options);
|
|
6416
|
+
});
|
|
6417
|
+
hl.command("status").description("Check your Hyperliquid account and balances").action(async () => {
|
|
6418
|
+
console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Hyperliquid Status
|
|
6419
|
+
`));
|
|
6420
|
+
await hlStatusCommand2();
|
|
6421
|
+
});
|
|
5943
6422
|
const hasSubcommand = process.argv.slice(2).some((arg) => !arg.startsWith("-"));
|
|
5944
6423
|
if (!hasSubcommand) {
|
|
5945
6424
|
if (!isConfigured2()) {
|
|
5946
|
-
printBanner(
|
|
5947
|
-
console.log(
|
|
6425
|
+
printBanner(chalk16);
|
|
6426
|
+
console.log(chalk16.bold(` Get started:
|
|
5948
6427
|
`));
|
|
5949
|
-
console.log(` ${
|
|
5950
|
-
console.log(` ${
|
|
6428
|
+
console.log(` ${chalk16.green("cabal-cli login")} ${chalk16.dim("→")} Sign up & connect via browser`);
|
|
6429
|
+
console.log(` ${chalk16.green("cabal-cli onboard")} ${chalk16.dim("→")} Full setup wizard (if you have an API key)`);
|
|
5951
6430
|
console.log("");
|
|
5952
|
-
console.log(
|
|
6431
|
+
console.log(chalk16.dim(" Run `cabal-cli login` to get started.\n"));
|
|
5953
6432
|
} else {
|
|
5954
6433
|
program.outputHelp();
|
|
5955
6434
|
}
|