@numen-crypto/contract 0.18.2 → 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.js CHANGED
@@ -171,7 +171,8 @@ var TransactionTypeSchema = z.enum([
171
171
  "SELL",
172
172
  "COMMISSION",
173
173
  "BONUS",
174
- "ADJUSTMENT"
174
+ "ADJUSTMENT",
175
+ "PREDICTION"
175
176
  ]);
176
177
  var TransactionStatusSchema = z.enum(["PENDING", "PROCESSING", "COMPLETED", "FAILED", "CANCELLED"]);
177
178
  var TransactionSchema = z.object({
@@ -1269,6 +1270,68 @@ var TicketAttachmentUploadCommand;
1269
1270
  fileKey: z.string()
1270
1271
  });
1271
1272
  })(TicketAttachmentUploadCommand || (TicketAttachmentUploadCommand = {}));
1273
+ var PredictionSideSchema = z.enum(["YES", "NO"]);
1274
+ var PredictionStatusSchema = z.enum(["OPEN", "LOCKED", "RESOLVING", "RESOLVED", "VOID"]);
1275
+ var PredictionSchema = z.object({
1276
+ id: z.string().uuid(),
1277
+ slug: z.string(),
1278
+ title: z.string(),
1279
+ description: z.string().nullable(),
1280
+ category: z.string(),
1281
+ imageUrl: z.string().nullable(),
1282
+ status: PredictionStatusSchema,
1283
+ outcome: PredictionSideSchema.nullable(),
1284
+ asset: AssetSymbolSchema,
1285
+ betsCloseAt: z.string(),
1286
+ resolvesAt: z.string(),
1287
+ poolYes: MoneyStringSchema,
1288
+ poolNo: MoneyStringSchema,
1289
+ poolTotal: MoneyStringSchema,
1290
+ /** Share of the total pool sitting on YES, in basis points. */
1291
+ yesShareBp: z.number().int().min(0).max(1e4),
1292
+ participants: z.number().int().nonnegative(),
1293
+ minStake: MoneyStringSchema.nullable(),
1294
+ maxStake: MoneyStringSchema.nullable(),
1295
+ feeBp: z.number().int().min(0).max(1e4)
1296
+ });
1297
+ var PredictionPositionSchema = z.object({
1298
+ side: PredictionSideSchema,
1299
+ staked: MoneyStringSchema,
1300
+ /** What the position pays out right now if this side wins, stake included. */
1301
+ projectedPayout: MoneyStringSchema,
1302
+ settled: z.boolean(),
1303
+ payout: MoneyStringSchema.nullable()
1304
+ });
1305
+ var PredictionDetailSchema = PredictionSchema.extend({
1306
+ position: PredictionPositionSchema.nullable()
1307
+ });
1308
+ var ListPredictionsCommand;
1309
+ ((ListPredictionsCommand2) => {
1310
+ ListPredictionsCommand2.endpointDetails = endpoint(
1311
+ "GET",
1312
+ "/predictions",
1313
+ "Predictions open for betting and recently resolved"
1314
+ );
1315
+ ListPredictionsCommand2.QuerySchema = z.object({
1316
+ status: z.enum(["active", "resolved", "mine"]).optional()
1317
+ });
1318
+ ListPredictionsCommand2.ResponseSchema = z.object({ items: z.array(PredictionDetailSchema) });
1319
+ })(ListPredictionsCommand || (ListPredictionsCommand = {}));
1320
+ var GetPredictionCommand;
1321
+ ((GetPredictionCommand2) => {
1322
+ GetPredictionCommand2.endpointDetails = endpoint("GET", "/predictions/:slug", "One prediction with the caller position");
1323
+ GetPredictionCommand2.ResponseSchema = PredictionDetailSchema;
1324
+ })(GetPredictionCommand || (GetPredictionCommand = {}));
1325
+ var PlacePredictionBetCommand;
1326
+ ((PlacePredictionBetCommand2) => {
1327
+ PlacePredictionBetCommand2.endpointDetails = endpoint("POST", "/predictions/:slug/bet", "Stake on one side of a prediction");
1328
+ PlacePredictionBetCommand2.BodySchema = z.object({
1329
+ side: PredictionSideSchema,
1330
+ amount: MoneyStringSchema,
1331
+ idempotencyKey: z.string().min(8).max(128)
1332
+ });
1333
+ PlacePredictionBetCommand2.ResponseSchema = PredictionDetailSchema;
1334
+ })(PlacePredictionBetCommand || (PlacePredictionBetCommand = {}));
1272
1335
 
1273
1336
  // src/api/routes.ts
1274
1337
  var REST_API = {
@@ -1371,6 +1434,11 @@ var REST_API = {
1371
1434
  REPLY: "/tickets/:id/messages",
1372
1435
  ATTACHMENT_UPLOAD_URL: "/tickets/attachments/upload-url"
1373
1436
  },
1437
+ PREDICTIONS: {
1438
+ LIST: "/predictions",
1439
+ GET: "/predictions/:slug",
1440
+ BET: "/predictions/:slug/bet"
1441
+ },
1374
1442
  SUPPORT_TICKETS: {
1375
1443
  LIST: "/support/tickets",
1376
1444
  STREAM: "/support/tickets/stream",
@@ -1383,6 +1451,6 @@ var REST_API = {
1383
1451
  var API_PREFIX = "/api";
1384
1452
  var API_VERSION = "v1";
1385
1453
 
1386
- export { API_PREFIX, API_VERSION, ASSET_DECIMALS, ASSET_SYMBOLS, AVATAR_CONTENT_TYPES, AssetBalanceSchema, AssetSymbolSchema, AvatarContentTypeSchema, AvatarUploadUrlCommand, BONUS_ASSET, BrowsePartnersCommand, BuyPackageCommand, CONTENT_LOCALES, CancelOrderCommand, CancelWithdrawalCommand, CaptchaPolicyCommand, ChangePasswordCommand, ChartPeriodSchema, ChartPointSchema, ClaimDailyBonusCommand, ClaimTicketCommand, ClaimTutorialRewardCommand, ConfirmEmailChangeCommand, ConfirmTotpCommand, ConfirmWithdrawalCommand, ContentLocaleSchema, CreateTicketCommand, DEFAULT_CONTENT_LOCALE, DEPOSITABLE_ASSETS, DailyBonusClaimResultSchema, DailyBonusDaySchema, DailyBonusStatusSchema, DepositAddressCommand, DepositAddressSchema, DepositEntrySchema, DepositStatusSchema, DepositableAssetSchema, DisableTotpCommand, ERROR_CODE, EarningsOverviewSchema, ErrorResponseSchema, FUNDING_ASSET, ForgotPasswordCommand, GetDailyBonusCommand, GetEarningsCommand, GetIncomeCommand, GetLeaderboardCommand, GetOrderBookCommand, GetPackagesCommand, GetPartnersCommand, GetRanksCommand, GetSettingsCommand, GetSlidesCommand, GetSupportTicketCommand, GetTicketCommand, GetTokenChartCommand, GetTokenPriceCommand, GetTransactionsCommand, GetTutorialRewardCommand, GetWalletCommand, GetWheelCommand, IncomeOverviewSchema, IncomePeriodSchema, LeaderboardEntrySchema, LeaderboardPeriodSchema, LeaderboardSchema, LinkGoogleCommand, LinkProviderSchema, LinkTelegramCommand, LinkedAccountSchema, ListDepositsCommand, ListLinkedAccountsCommand, ListMyOrdersCommand, ListNotificationsCommand, ListSupportTicketsCommand, ListTicketsCommand, ListTradesCommand, ListWithdrawalsCommand, LoginCommand, LogoutCommand, MONEY_REGEX, MarkNotificationsReadCommand, MeCommand, MoneyStringSchema, MonthlyPricePointSchema, NMN_PRICE_DECIMALS, NotificationSchema, NotificationTypeSchema, OrderBookLevelSchema, OrderBookSchema, OrderSchema, OrderSideSchema, OrderStatusSchema, OrderTypeSchema, PackageSchema, PackageStatusSchema, PackagesOverviewSchema, PaginatedSchema, PaginationQuerySchema, PartnerAccrualSchema, PartnerBranchRootSchema, PartnerBranchSchema, PartnerLevelSchema, PartnerNodeSchema, PartnersOverviewSchema, PeriodSchema, PlaceOrderCommand, PositiveMoneyStringSchema, PublicTradeSchema, REST_API, RankDefSchema, RegisterCommand, ReplyTicketCommand, RequestEmailChangeCommand, RequestPasswordChangeCommand, RequestWithdrawalCommand, ResendVerificationCommand, ResetPasswordCommand, ResolveTicketCommand, SessionInfoSchema, SetupTotpCommand, SlideButtonStyleSchema, SlideKindSchema, SlideLinkTargetSchema, SlideSchema, SlidesResponseSchema, SpinWheelCommand, SupportReplyTicketCommand, SupportTicketDetailSchema, SupportTicketScopeSchema, SupportTicketSummarySchema, SupportTicketUserSchema, SwapCommand, SwapSideSchema, TICKET_CATEGORIES, TOKEN_ASSET, TelegramLinkCodeCommand, ThreatLevelSchema, TicketAttachmentInputSchema, TicketAttachmentSchema, TicketAttachmentUploadCommand, TicketAuthorTypeSchema, TicketBodySchema, TicketCategorySchema, TicketDetailSchema, TicketMessageSchema, TicketStatusSchema, TicketSummarySchema, TokenPriceSchema, TradeLimitsSchema, TradeResultSchema, TransactionSchema, TransactionStatusSchema, TransactionTypeSchema, UnlinkAccountCommand, UpdateProfileCommand, UpdateSettingsCommand, UpgradePackageCommand, UserProfileSchema, UserRankSchema, UserRoleSchema, UserSettingsSchema, UserStatusSchema, UuidSchema, VerifyEmailCommand, WHEEL_SLOT_COUNT, WalletOverviewSchema, WheelAmountModeSchema, WheelPrizeSchema, WheelSlotSchema, WheelSpinKindSchema, WheelSpinResultSchema, WheelStatusSchema, WheelWinSchema, WithdrawalSchema, WithdrawalStatusSchema, assetDecimals, endpoint, isContentLocale };
1454
+ export { API_PREFIX, API_VERSION, ASSET_DECIMALS, ASSET_SYMBOLS, AVATAR_CONTENT_TYPES, AssetBalanceSchema, AssetSymbolSchema, AvatarContentTypeSchema, AvatarUploadUrlCommand, BONUS_ASSET, BrowsePartnersCommand, BuyPackageCommand, CONTENT_LOCALES, CancelOrderCommand, CancelWithdrawalCommand, CaptchaPolicyCommand, ChangePasswordCommand, ChartPeriodSchema, ChartPointSchema, ClaimDailyBonusCommand, ClaimTicketCommand, ClaimTutorialRewardCommand, ConfirmEmailChangeCommand, ConfirmTotpCommand, ConfirmWithdrawalCommand, ContentLocaleSchema, CreateTicketCommand, DEFAULT_CONTENT_LOCALE, DEPOSITABLE_ASSETS, DailyBonusClaimResultSchema, DailyBonusDaySchema, DailyBonusStatusSchema, DepositAddressCommand, DepositAddressSchema, DepositEntrySchema, DepositStatusSchema, DepositableAssetSchema, DisableTotpCommand, ERROR_CODE, EarningsOverviewSchema, ErrorResponseSchema, FUNDING_ASSET, ForgotPasswordCommand, GetDailyBonusCommand, GetEarningsCommand, GetIncomeCommand, GetLeaderboardCommand, GetOrderBookCommand, GetPackagesCommand, GetPartnersCommand, GetPredictionCommand, GetRanksCommand, GetSettingsCommand, GetSlidesCommand, GetSupportTicketCommand, GetTicketCommand, GetTokenChartCommand, GetTokenPriceCommand, GetTransactionsCommand, GetTutorialRewardCommand, GetWalletCommand, GetWheelCommand, IncomeOverviewSchema, IncomePeriodSchema, LeaderboardEntrySchema, LeaderboardPeriodSchema, LeaderboardSchema, LinkGoogleCommand, LinkProviderSchema, LinkTelegramCommand, LinkedAccountSchema, ListDepositsCommand, ListLinkedAccountsCommand, ListMyOrdersCommand, ListNotificationsCommand, ListPredictionsCommand, ListSupportTicketsCommand, ListTicketsCommand, ListTradesCommand, ListWithdrawalsCommand, LoginCommand, LogoutCommand, MONEY_REGEX, MarkNotificationsReadCommand, MeCommand, MoneyStringSchema, MonthlyPricePointSchema, NMN_PRICE_DECIMALS, NotificationSchema, NotificationTypeSchema, OrderBookLevelSchema, OrderBookSchema, OrderSchema, OrderSideSchema, OrderStatusSchema, OrderTypeSchema, PackageSchema, PackageStatusSchema, PackagesOverviewSchema, PaginatedSchema, PaginationQuerySchema, PartnerAccrualSchema, PartnerBranchRootSchema, PartnerBranchSchema, PartnerLevelSchema, PartnerNodeSchema, PartnersOverviewSchema, PeriodSchema, PlaceOrderCommand, PlacePredictionBetCommand, PositiveMoneyStringSchema, PredictionDetailSchema, PredictionPositionSchema, PredictionSchema, PredictionSideSchema, PredictionStatusSchema, PublicTradeSchema, REST_API, RankDefSchema, RegisterCommand, ReplyTicketCommand, RequestEmailChangeCommand, RequestPasswordChangeCommand, RequestWithdrawalCommand, ResendVerificationCommand, ResetPasswordCommand, ResolveTicketCommand, SessionInfoSchema, SetupTotpCommand, SlideButtonStyleSchema, SlideKindSchema, SlideLinkTargetSchema, SlideSchema, SlidesResponseSchema, SpinWheelCommand, SupportReplyTicketCommand, SupportTicketDetailSchema, SupportTicketScopeSchema, SupportTicketSummarySchema, SupportTicketUserSchema, SwapCommand, SwapSideSchema, TICKET_CATEGORIES, TOKEN_ASSET, TelegramLinkCodeCommand, ThreatLevelSchema, TicketAttachmentInputSchema, TicketAttachmentSchema, TicketAttachmentUploadCommand, TicketAuthorTypeSchema, TicketBodySchema, TicketCategorySchema, TicketDetailSchema, TicketMessageSchema, TicketStatusSchema, TicketSummarySchema, TokenPriceSchema, TradeLimitsSchema, TradeResultSchema, TransactionSchema, TransactionStatusSchema, TransactionTypeSchema, UnlinkAccountCommand, UpdateProfileCommand, UpdateSettingsCommand, UpgradePackageCommand, UserProfileSchema, UserRankSchema, UserRoleSchema, UserSettingsSchema, UserStatusSchema, UuidSchema, VerifyEmailCommand, WHEEL_SLOT_COUNT, WalletOverviewSchema, WheelAmountModeSchema, WheelPrizeSchema, WheelSlotSchema, WheelSpinKindSchema, WheelSpinResultSchema, WheelStatusSchema, WheelWinSchema, WithdrawalSchema, WithdrawalStatusSchema, assetDecimals, endpoint, isContentLocale };
1387
1455
  //# sourceMappingURL=index.js.map
1388
1456
  //# sourceMappingURL=index.js.map