@numen-crypto/contract 0.18.2 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +77 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +621 -13
- package/dist/index.d.ts +621 -13
- package/dist/index.js +73 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -173,7 +173,8 @@ var TransactionTypeSchema = zod.z.enum([
|
|
|
173
173
|
"SELL",
|
|
174
174
|
"COMMISSION",
|
|
175
175
|
"BONUS",
|
|
176
|
-
"ADJUSTMENT"
|
|
176
|
+
"ADJUSTMENT",
|
|
177
|
+
"PREDICTION"
|
|
177
178
|
]);
|
|
178
179
|
var TransactionStatusSchema = zod.z.enum(["PENDING", "PROCESSING", "COMPLETED", "FAILED", "CANCELLED"]);
|
|
179
180
|
var TransactionSchema = zod.z.object({
|
|
@@ -1271,6 +1272,71 @@ exports.TicketAttachmentUploadCommand = void 0;
|
|
|
1271
1272
|
fileKey: zod.z.string()
|
|
1272
1273
|
});
|
|
1273
1274
|
})(exports.TicketAttachmentUploadCommand || (exports.TicketAttachmentUploadCommand = {}));
|
|
1275
|
+
var PredictionSideSchema = zod.z.enum(["YES", "NO"]);
|
|
1276
|
+
var PredictionStatusSchema = zod.z.enum(["OPEN", "LOCKED", "RESOLVING", "RESOLVED", "VOID"]);
|
|
1277
|
+
var PredictionSchema = zod.z.object({
|
|
1278
|
+
id: zod.z.string().uuid(),
|
|
1279
|
+
slug: zod.z.string(),
|
|
1280
|
+
title: zod.z.string(),
|
|
1281
|
+
description: zod.z.string().nullable(),
|
|
1282
|
+
category: zod.z.string(),
|
|
1283
|
+
imageUrl: zod.z.string().nullable(),
|
|
1284
|
+
status: PredictionStatusSchema,
|
|
1285
|
+
outcome: PredictionSideSchema.nullable(),
|
|
1286
|
+
asset: AssetSymbolSchema,
|
|
1287
|
+
betsCloseAt: zod.z.string(),
|
|
1288
|
+
resolvesAt: zod.z.string(),
|
|
1289
|
+
poolYes: MoneyStringSchema,
|
|
1290
|
+
poolNo: MoneyStringSchema,
|
|
1291
|
+
poolTotal: MoneyStringSchema,
|
|
1292
|
+
/** Staked by real bettors, house seed excluded — this is what actually funds a payout. */
|
|
1293
|
+
stakedYes: MoneyStringSchema,
|
|
1294
|
+
stakedNo: MoneyStringSchema,
|
|
1295
|
+
/** Share of the total pool sitting on YES, in basis points. */
|
|
1296
|
+
yesShareBp: zod.z.number().int().min(0).max(1e4),
|
|
1297
|
+
participants: zod.z.number().int().nonnegative(),
|
|
1298
|
+
minStake: MoneyStringSchema.nullable(),
|
|
1299
|
+
maxStake: MoneyStringSchema.nullable(),
|
|
1300
|
+
feeBp: zod.z.number().int().min(0).max(1e4)
|
|
1301
|
+
});
|
|
1302
|
+
var PredictionPositionSchema = zod.z.object({
|
|
1303
|
+
side: PredictionSideSchema,
|
|
1304
|
+
staked: MoneyStringSchema,
|
|
1305
|
+
/** What the position pays out right now if this side wins, stake included. */
|
|
1306
|
+
projectedPayout: MoneyStringSchema,
|
|
1307
|
+
settled: zod.z.boolean(),
|
|
1308
|
+
payout: MoneyStringSchema.nullable()
|
|
1309
|
+
});
|
|
1310
|
+
var PredictionDetailSchema = PredictionSchema.extend({
|
|
1311
|
+
position: PredictionPositionSchema.nullable()
|
|
1312
|
+
});
|
|
1313
|
+
exports.ListPredictionsCommand = void 0;
|
|
1314
|
+
((ListPredictionsCommand2) => {
|
|
1315
|
+
ListPredictionsCommand2.endpointDetails = endpoint(
|
|
1316
|
+
"GET",
|
|
1317
|
+
"/predictions",
|
|
1318
|
+
"Predictions open for betting and recently resolved"
|
|
1319
|
+
);
|
|
1320
|
+
ListPredictionsCommand2.QuerySchema = zod.z.object({
|
|
1321
|
+
status: zod.z.enum(["active", "resolved", "mine"]).optional()
|
|
1322
|
+
});
|
|
1323
|
+
ListPredictionsCommand2.ResponseSchema = zod.z.object({ items: zod.z.array(PredictionDetailSchema) });
|
|
1324
|
+
})(exports.ListPredictionsCommand || (exports.ListPredictionsCommand = {}));
|
|
1325
|
+
exports.GetPredictionCommand = void 0;
|
|
1326
|
+
((GetPredictionCommand2) => {
|
|
1327
|
+
GetPredictionCommand2.endpointDetails = endpoint("GET", "/predictions/:slug", "One prediction with the caller position");
|
|
1328
|
+
GetPredictionCommand2.ResponseSchema = PredictionDetailSchema;
|
|
1329
|
+
})(exports.GetPredictionCommand || (exports.GetPredictionCommand = {}));
|
|
1330
|
+
exports.PlacePredictionBetCommand = void 0;
|
|
1331
|
+
((PlacePredictionBetCommand2) => {
|
|
1332
|
+
PlacePredictionBetCommand2.endpointDetails = endpoint("POST", "/predictions/:slug/bet", "Stake on one side of a prediction");
|
|
1333
|
+
PlacePredictionBetCommand2.BodySchema = zod.z.object({
|
|
1334
|
+
side: PredictionSideSchema,
|
|
1335
|
+
amount: MoneyStringSchema,
|
|
1336
|
+
idempotencyKey: zod.z.string().min(8).max(128)
|
|
1337
|
+
});
|
|
1338
|
+
PlacePredictionBetCommand2.ResponseSchema = PredictionDetailSchema;
|
|
1339
|
+
})(exports.PlacePredictionBetCommand || (exports.PlacePredictionBetCommand = {}));
|
|
1274
1340
|
|
|
1275
1341
|
// src/api/routes.ts
|
|
1276
1342
|
var REST_API = {
|
|
@@ -1373,6 +1439,11 @@ var REST_API = {
|
|
|
1373
1439
|
REPLY: "/tickets/:id/messages",
|
|
1374
1440
|
ATTACHMENT_UPLOAD_URL: "/tickets/attachments/upload-url"
|
|
1375
1441
|
},
|
|
1442
|
+
PREDICTIONS: {
|
|
1443
|
+
LIST: "/predictions",
|
|
1444
|
+
GET: "/predictions/:slug",
|
|
1445
|
+
BET: "/predictions/:slug/bet"
|
|
1446
|
+
},
|
|
1376
1447
|
SUPPORT_TICKETS: {
|
|
1377
1448
|
LIST: "/support/tickets",
|
|
1378
1449
|
STREAM: "/support/tickets/stream",
|
|
@@ -1443,6 +1514,11 @@ exports.PartnerNodeSchema = PartnerNodeSchema;
|
|
|
1443
1514
|
exports.PartnersOverviewSchema = PartnersOverviewSchema;
|
|
1444
1515
|
exports.PeriodSchema = PeriodSchema;
|
|
1445
1516
|
exports.PositiveMoneyStringSchema = PositiveMoneyStringSchema;
|
|
1517
|
+
exports.PredictionDetailSchema = PredictionDetailSchema;
|
|
1518
|
+
exports.PredictionPositionSchema = PredictionPositionSchema;
|
|
1519
|
+
exports.PredictionSchema = PredictionSchema;
|
|
1520
|
+
exports.PredictionSideSchema = PredictionSideSchema;
|
|
1521
|
+
exports.PredictionStatusSchema = PredictionStatusSchema;
|
|
1446
1522
|
exports.PublicTradeSchema = PublicTradeSchema;
|
|
1447
1523
|
exports.REST_API = REST_API;
|
|
1448
1524
|
exports.RankDefSchema = RankDefSchema;
|