@moneypot/hub 1.3.0-dev.15 → 1.3.0-dev.16
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.
|
@@ -37,7 +37,7 @@ declare const InputSchema: z.ZodObject<{
|
|
|
37
37
|
weight: number;
|
|
38
38
|
}[]>;
|
|
39
39
|
hashChainId: z.ZodString;
|
|
40
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.
|
|
40
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
41
41
|
}, "strict", z.ZodTypeAny, {
|
|
42
42
|
currency: string;
|
|
43
43
|
hashChainId: string;
|
|
@@ -47,7 +47,7 @@ declare const InputSchema: z.ZodObject<{
|
|
|
47
47
|
profit: number;
|
|
48
48
|
weight: number;
|
|
49
49
|
}[];
|
|
50
|
-
metadata?: Record<string,
|
|
50
|
+
metadata?: Record<string, unknown> | undefined;
|
|
51
51
|
}, {
|
|
52
52
|
currency: string;
|
|
53
53
|
hashChainId: string;
|
|
@@ -57,10 +57,11 @@ declare const InputSchema: z.ZodObject<{
|
|
|
57
57
|
profit: number;
|
|
58
58
|
weight: number;
|
|
59
59
|
}[];
|
|
60
|
-
metadata?: Record<string,
|
|
60
|
+
metadata?: Record<string, unknown> | undefined;
|
|
61
61
|
}>;
|
|
62
62
|
type Input = z.infer<typeof InputSchema>;
|
|
63
63
|
type Outcome = z.infer<typeof OutcomeSchema>;
|
|
64
|
+
type Metadata = NonNullable<Input["metadata"]>;
|
|
64
65
|
type FinalizeMetadataData = {
|
|
65
66
|
wager: number;
|
|
66
67
|
currencyKey: string;
|
|
@@ -72,8 +73,8 @@ type FinalizeMetadataData = {
|
|
|
72
73
|
export type OutcomeBetConfig = {
|
|
73
74
|
houseEdge: number;
|
|
74
75
|
saveOutcomes: boolean;
|
|
75
|
-
initializeMetadataFromUntrustedUserInput?: (input: Input) => Result<
|
|
76
|
-
finalizeMetadata?: (validatedMetadata:
|
|
76
|
+
initializeMetadataFromUntrustedUserInput?: (input: Input) => Result<Metadata, string>;
|
|
77
|
+
finalizeMetadata?: (validatedMetadata: Metadata, data: FinalizeMetadataData) => Metadata;
|
|
77
78
|
};
|
|
78
79
|
export type OutcomeBetConfigMap<BetKind extends string> = {
|
|
79
80
|
[betKind in BetKind]: OutcomeBetConfig;
|
|
@@ -39,7 +39,7 @@ const InputSchema = z
|
|
|
39
39
|
.refine((data) => data.some((o) => o.profit < 0), "At least one outcome should have profit < 0")
|
|
40
40
|
.refine((data) => data.some((o) => o.profit > 0), "At least one outcome should have profit > 0"),
|
|
41
41
|
hashChainId: z.string().uuid("Invalid hash chain ID"),
|
|
42
|
-
metadata: z.record(z.string(), z.
|
|
42
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
43
43
|
})
|
|
44
44
|
.strict();
|
|
45
45
|
const BetKindSchema = z
|