@numen-crypto/contract 0.18.1 → 0.19.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 +82 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +675 -103
- package/dist/index.d.ts +675 -103
- package/dist/index.js +78 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -130,16 +130,16 @@ var SessionInfoSchema = zod.z.object({
|
|
|
130
130
|
lastSeenAt: zod.z.string().datetime(),
|
|
131
131
|
current: zod.z.boolean()
|
|
132
132
|
});
|
|
133
|
-
var ASSET_SYMBOLS = ["NMN", "
|
|
133
|
+
var ASSET_SYMBOLS = ["NMN", "bNMN", "USDT", "BTC", "ETH", "BNB", "TRX", "SOL"];
|
|
134
134
|
var AssetSymbolSchema = zod.z.enum(ASSET_SYMBOLS);
|
|
135
135
|
var DEPOSITABLE_ASSETS = ["USDT", "BTC", "ETH", "BNB", "TRX", "SOL"];
|
|
136
136
|
var DepositableAssetSchema = zod.z.enum(DEPOSITABLE_ASSETS);
|
|
137
137
|
var TOKEN_ASSET = "NMN";
|
|
138
|
-
var BONUS_ASSET = "
|
|
138
|
+
var BONUS_ASSET = "bNMN";
|
|
139
139
|
var FUNDING_ASSET = "USDT";
|
|
140
140
|
var ASSET_DECIMALS = {
|
|
141
141
|
NMN: 4,
|
|
142
|
-
|
|
142
|
+
bNMN: 4,
|
|
143
143
|
USDT: 2,
|
|
144
144
|
BTC: 8,
|
|
145
145
|
ETH: 8,
|
|
@@ -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({
|
|
@@ -283,8 +284,8 @@ var PackagesOverviewSchema = zod.z.object({
|
|
|
283
284
|
sellIntervalDays: zod.z.number().int().positive().nullable(),
|
|
284
285
|
nextSellAt: zod.z.string().datetime().nullable(),
|
|
285
286
|
balanceUsdt: MoneyStringSchema,
|
|
286
|
-
|
|
287
|
-
|
|
287
|
+
balanceBnmn: MoneyStringSchema,
|
|
288
|
+
bnmnPackageRate: MoneyStringSchema,
|
|
288
289
|
tokenPrice: MoneyStringSchema
|
|
289
290
|
});
|
|
290
291
|
var SlideKindSchema = zod.z.enum(["image", "text"]);
|
|
@@ -767,15 +768,15 @@ exports.BuyPackageCommand = void 0;
|
|
|
767
768
|
);
|
|
768
769
|
BuyPackageCommand2.RequestSchema = zod.z.object({
|
|
769
770
|
idempotencyKey: zod.z.string().min(8).max(255),
|
|
770
|
-
payWith: zod.z.enum(["USDT", "
|
|
771
|
+
payWith: zod.z.enum(["USDT", "bNMN"]).default("USDT")
|
|
771
772
|
});
|
|
772
773
|
BuyPackageCommand2.ResponseSchema = zod.z.object({
|
|
773
774
|
purchaseId: zod.z.string().uuid(),
|
|
774
775
|
priceUsd: MoneyStringSchema,
|
|
775
776
|
nmnAmount: MoneyStringSchema,
|
|
776
777
|
tokenPrice: MoneyStringSchema,
|
|
777
|
-
paidWith: zod.z.enum(["USDT", "
|
|
778
|
-
|
|
778
|
+
paidWith: zod.z.enum(["USDT", "bNMN"]),
|
|
779
|
+
bnmnSpent: MoneyStringSchema.nullable()
|
|
779
780
|
});
|
|
780
781
|
})(exports.BuyPackageCommand || (exports.BuyPackageCommand = {}));
|
|
781
782
|
exports.UpgradePackageCommand = void 0;
|
|
@@ -1271,6 +1272,68 @@ 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
|
+
/** Share of the total pool sitting on YES, in basis points. */
|
|
1293
|
+
yesShareBp: zod.z.number().int().min(0).max(1e4),
|
|
1294
|
+
participants: zod.z.number().int().nonnegative(),
|
|
1295
|
+
minStake: MoneyStringSchema.nullable(),
|
|
1296
|
+
maxStake: MoneyStringSchema.nullable(),
|
|
1297
|
+
feeBp: zod.z.number().int().min(0).max(1e4)
|
|
1298
|
+
});
|
|
1299
|
+
var PredictionPositionSchema = zod.z.object({
|
|
1300
|
+
side: PredictionSideSchema,
|
|
1301
|
+
staked: MoneyStringSchema,
|
|
1302
|
+
/** What the position pays out right now if this side wins, stake included. */
|
|
1303
|
+
projectedPayout: MoneyStringSchema,
|
|
1304
|
+
settled: zod.z.boolean(),
|
|
1305
|
+
payout: MoneyStringSchema.nullable()
|
|
1306
|
+
});
|
|
1307
|
+
var PredictionDetailSchema = PredictionSchema.extend({
|
|
1308
|
+
position: PredictionPositionSchema.nullable()
|
|
1309
|
+
});
|
|
1310
|
+
exports.ListPredictionsCommand = void 0;
|
|
1311
|
+
((ListPredictionsCommand2) => {
|
|
1312
|
+
ListPredictionsCommand2.endpointDetails = endpoint(
|
|
1313
|
+
"GET",
|
|
1314
|
+
"/predictions",
|
|
1315
|
+
"Predictions open for betting and recently resolved"
|
|
1316
|
+
);
|
|
1317
|
+
ListPredictionsCommand2.QuerySchema = zod.z.object({
|
|
1318
|
+
status: zod.z.enum(["active", "resolved", "mine"]).optional()
|
|
1319
|
+
});
|
|
1320
|
+
ListPredictionsCommand2.ResponseSchema = zod.z.object({ items: zod.z.array(PredictionDetailSchema) });
|
|
1321
|
+
})(exports.ListPredictionsCommand || (exports.ListPredictionsCommand = {}));
|
|
1322
|
+
exports.GetPredictionCommand = void 0;
|
|
1323
|
+
((GetPredictionCommand2) => {
|
|
1324
|
+
GetPredictionCommand2.endpointDetails = endpoint("GET", "/predictions/:slug", "One prediction with the caller position");
|
|
1325
|
+
GetPredictionCommand2.ResponseSchema = PredictionDetailSchema;
|
|
1326
|
+
})(exports.GetPredictionCommand || (exports.GetPredictionCommand = {}));
|
|
1327
|
+
exports.PlacePredictionBetCommand = void 0;
|
|
1328
|
+
((PlacePredictionBetCommand2) => {
|
|
1329
|
+
PlacePredictionBetCommand2.endpointDetails = endpoint("POST", "/predictions/:slug/bet", "Stake on one side of a prediction");
|
|
1330
|
+
PlacePredictionBetCommand2.BodySchema = zod.z.object({
|
|
1331
|
+
side: PredictionSideSchema,
|
|
1332
|
+
amount: MoneyStringSchema,
|
|
1333
|
+
idempotencyKey: zod.z.string().min(8).max(128)
|
|
1334
|
+
});
|
|
1335
|
+
PlacePredictionBetCommand2.ResponseSchema = PredictionDetailSchema;
|
|
1336
|
+
})(exports.PlacePredictionBetCommand || (exports.PlacePredictionBetCommand = {}));
|
|
1274
1337
|
|
|
1275
1338
|
// src/api/routes.ts
|
|
1276
1339
|
var REST_API = {
|
|
@@ -1373,6 +1436,11 @@ var REST_API = {
|
|
|
1373
1436
|
REPLY: "/tickets/:id/messages",
|
|
1374
1437
|
ATTACHMENT_UPLOAD_URL: "/tickets/attachments/upload-url"
|
|
1375
1438
|
},
|
|
1439
|
+
PREDICTIONS: {
|
|
1440
|
+
LIST: "/predictions",
|
|
1441
|
+
GET: "/predictions/:slug",
|
|
1442
|
+
BET: "/predictions/:slug/bet"
|
|
1443
|
+
},
|
|
1376
1444
|
SUPPORT_TICKETS: {
|
|
1377
1445
|
LIST: "/support/tickets",
|
|
1378
1446
|
STREAM: "/support/tickets/stream",
|
|
@@ -1443,6 +1511,11 @@ exports.PartnerNodeSchema = PartnerNodeSchema;
|
|
|
1443
1511
|
exports.PartnersOverviewSchema = PartnersOverviewSchema;
|
|
1444
1512
|
exports.PeriodSchema = PeriodSchema;
|
|
1445
1513
|
exports.PositiveMoneyStringSchema = PositiveMoneyStringSchema;
|
|
1514
|
+
exports.PredictionDetailSchema = PredictionDetailSchema;
|
|
1515
|
+
exports.PredictionPositionSchema = PredictionPositionSchema;
|
|
1516
|
+
exports.PredictionSchema = PredictionSchema;
|
|
1517
|
+
exports.PredictionSideSchema = PredictionSideSchema;
|
|
1518
|
+
exports.PredictionStatusSchema = PredictionStatusSchema;
|
|
1446
1519
|
exports.PublicTradeSchema = PublicTradeSchema;
|
|
1447
1520
|
exports.REST_API = REST_API;
|
|
1448
1521
|
exports.RankDefSchema = RankDefSchema;
|