@satrush/api 0.1.14 → 0.1.15

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 CHANGED
@@ -92,6 +92,8 @@ __export(index_exports, {
92
92
  zGetOneBtcIterationParticipantsData: () => zGetOneBtcIterationParticipantsData,
93
93
  zGetOneBtcIterationParticipantsResponse: () => zGetOneBtcIterationParticipantsResponse,
94
94
  zGetOneBtcIterationResponse: () => zGetOneBtcIterationResponse,
95
+ zGetRoundData: () => zGetRoundData,
96
+ zGetRoundResponse: () => zGetRoundResponse,
95
97
  zGetRoundsData: () => zGetRoundsData,
96
98
  zGetRoundsPlayedLeaderboardData: () => zGetRoundsPlayedLeaderboardData,
97
99
  zGetRoundsPlayedLeaderboardResponse: () => zGetRoundsPlayedLeaderboardResponse,
@@ -145,6 +147,10 @@ __export(index_exports, {
145
147
  zPubkeyDto: () => zPubkeyDto,
146
148
  zPublicAutomationDto: () => zPublicAutomationDto,
147
149
  zPublicDeploymentDto: () => zPublicDeploymentDto,
150
+ zRoundDeploymentDto: () => zRoundDeploymentDto,
151
+ zRoundDetailsApiError404Error: () => zRoundDetailsApiError404Error,
152
+ zRoundDetailsApiError500Error: () => zRoundDetailsApiError500Error,
153
+ zRoundDetailsDto: () => zRoundDetailsDto,
148
154
  zRoundDto: () => zRoundDto,
149
155
  zRoundHistoryDto: () => zRoundHistoryDto,
150
156
  zRoundHistoryStateDto: () => zRoundHistoryStateDto,
@@ -1466,6 +1472,82 @@ var getRoundsResponseTransformer = async (data) => {
1466
1472
  data.data = data.data.map((item) => roundHistoryDtoSchemaResponseTransformer(item));
1467
1473
  return data;
1468
1474
  };
1475
+ var roundDeploymentDtoSchemaResponseTransformer = (data) => {
1476
+ if (data.btcEarned) {
1477
+ data.btcEarned = u64DtoSchemaResponseTransformer(data.btcEarned);
1478
+ }
1479
+ data.deployedAt = new Date(data.deployedAt);
1480
+ data.deployedUsdAmount = u64DtoSchemaResponseTransformer(data.deployedUsdAmount);
1481
+ data.hashrateEarned = u64DtoSchemaResponseTransformer(data.hashrateEarned);
1482
+ data.satsSharesEarned = u64DtoSchemaResponseTransformer(data.satsSharesEarned);
1483
+ if (data.settledAt) {
1484
+ data.settledAt = new Date(data.settledAt);
1485
+ }
1486
+ data.totalUsdStakeAmount = u64DtoSchemaResponseTransformer(data.totalUsdStakeAmount);
1487
+ data.usdEarned = u64DtoSchemaResponseTransformer(data.usdEarned);
1488
+ if (data.winningUsdStakeAmount) {
1489
+ data.winningUsdStakeAmount = u64DtoSchemaResponseTransformer(data.winningUsdStakeAmount);
1490
+ }
1491
+ return data;
1492
+ };
1493
+ var roundDetailsDtoSchemaResponseTransformer = (data) => {
1494
+ data.deployedAt = new Date(data.deployedAt);
1495
+ data.deployments = data.deployments.map((item) => roundDeploymentDtoSchemaResponseTransformer(item));
1496
+ if (data.epochFeeUsd) {
1497
+ data.epochFeeUsd = u64DtoSchemaResponseTransformer(data.epochFeeUsd);
1498
+ }
1499
+ if (data.oneBtcFeeUsd) {
1500
+ data.oneBtcFeeUsd = u64DtoSchemaResponseTransformer(data.oneBtcFeeUsd);
1501
+ }
1502
+ if (data.protocolFeeUsd) {
1503
+ data.protocolFeeUsd = u64DtoSchemaResponseTransformer(data.protocolFeeUsd);
1504
+ }
1505
+ if (data.settledAt) {
1506
+ data.settledAt = new Date(data.settledAt);
1507
+ }
1508
+ if (data.startedAt) {
1509
+ data.startedAt = new Date(data.startedAt);
1510
+ }
1511
+ if (data.strikeBonusBtc) {
1512
+ data.strikeBonusBtc = u64DtoSchemaResponseTransformer(data.strikeBonusBtc);
1513
+ }
1514
+ if (data.strikeBonusUsd) {
1515
+ data.strikeBonusUsd = u64DtoSchemaResponseTransformer(data.strikeBonusUsd);
1516
+ }
1517
+ if (data.strikeEpochBtc) {
1518
+ data.strikeEpochBtc = u64DtoSchemaResponseTransformer(data.strikeEpochBtc);
1519
+ }
1520
+ if (data.strikeEpochUsd) {
1521
+ data.strikeEpochUsd = u64DtoSchemaResponseTransformer(data.strikeEpochUsd);
1522
+ }
1523
+ if (data.strikeFeeUsd) {
1524
+ data.strikeFeeUsd = u64DtoSchemaResponseTransformer(data.strikeFeeUsd);
1525
+ }
1526
+ if (data.strikeReserveBtc) {
1527
+ data.strikeReserveBtc = u64DtoSchemaResponseTransformer(data.strikeReserveBtc);
1528
+ }
1529
+ if (data.strikeReserveUsd) {
1530
+ data.strikeReserveUsd = u64DtoSchemaResponseTransformer(data.strikeReserveUsd);
1531
+ }
1532
+ if (data.strikeSeedFromReserveBtc) {
1533
+ data.strikeSeedFromReserveBtc = u64DtoSchemaResponseTransformer(data.strikeSeedFromReserveBtc);
1534
+ }
1535
+ if (data.strikeSeedFromReserveUsd) {
1536
+ data.strikeSeedFromReserveUsd = u64DtoSchemaResponseTransformer(data.strikeSeedFromReserveUsd);
1537
+ }
1538
+ data.totalDeployedUsd = u64DtoSchemaResponseTransformer(data.totalDeployedUsd);
1539
+ if (data.totalPotBtc) {
1540
+ data.totalPotBtc = u64DtoSchemaResponseTransformer(data.totalPotBtc);
1541
+ }
1542
+ if (data.totalPotUsd) {
1543
+ data.totalPotUsd = u64DtoSchemaResponseTransformer(data.totalPotUsd);
1544
+ }
1545
+ return data;
1546
+ };
1547
+ var getRoundResponseTransformer = async (data) => {
1548
+ data.data = roundDetailsDtoSchemaResponseTransformer(data.data);
1549
+ return data;
1550
+ };
1469
1551
  var publicAutomationDtoSchemaResponseTransformer = (data) => {
1470
1552
  data.perRoundUsdAmount = u64DtoSchemaResponseTransformer(data.perRoundUsdAmount);
1471
1553
  data.remainingUsdAmount = u64DtoSchemaResponseTransformer(data.remainingUsdAmount);
@@ -1789,6 +1871,12 @@ var zPricesDto = z.object({
1789
1871
  sat: z.number()
1790
1872
  });
1791
1873
  var zPubkeyDto = z.string().regex(/^[1-9A-HJ-NP-Za-km-z]+$/);
1874
+ var zRoundDetailsApiError404Error = z.object({
1875
+ code: z.enum(["not_found"])
1876
+ });
1877
+ var zRoundDetailsApiError500Error = z.object({
1878
+ code: z.enum(["internal"])
1879
+ });
1792
1880
  var zRoundHistoryStateDto = z.enum([
1793
1881
  "pending",
1794
1882
  "active",
@@ -2304,6 +2392,139 @@ var zProfileDto = z.object({
2304
2392
  oneBtcVaultEntries: z.array(zOneBtcVaultEntryDto),
2305
2393
  unsettledDeployments: z.array(zPublicDeploymentDto)
2306
2394
  });
2395
+ var zRoundDeploymentDto = z.object({
2396
+ authority: zPubkeyDto,
2397
+ btcEarned: z.optional(z.union([
2398
+ z.null(),
2399
+ zU64Dto
2400
+ ])),
2401
+ btcEarnedUsd: z.optional(z.union([
2402
+ z.number(),
2403
+ z.null()
2404
+ ])),
2405
+ deployedAt: z.preprocess((value) => value instanceof Date ? value.toISOString() : value, z.iso.datetime()),
2406
+ deployedUsdAmount: zU64Dto,
2407
+ deployment: zPubkeyDto,
2408
+ hashrateEarned: zU64Dto,
2409
+ isAutomation: z.boolean(),
2410
+ isWon: z.optional(z.union([
2411
+ z.boolean(),
2412
+ z.null()
2413
+ ])),
2414
+ satsSharesEarned: zU64Dto,
2415
+ selectedTiles: z.optional(z.union([
2416
+ z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
2417
+ z.null()
2418
+ ])),
2419
+ settledAt: z.optional(z.union([
2420
+ z.preprocess((value) => value instanceof Date ? value.toISOString() : value, z.iso.datetime()),
2421
+ z.null()
2422
+ ])),
2423
+ totalUsdStakeAmount: zU64Dto,
2424
+ usdEarned: zU64Dto,
2425
+ winningUsdStakeAmount: z.optional(z.union([
2426
+ z.null(),
2427
+ zU64Dto
2428
+ ]))
2429
+ });
2430
+ var zRoundDetailsDto = z.object({
2431
+ address: zPubkeyDto,
2432
+ deployedAt: z.preprocess((value) => value instanceof Date ? value.toISOString() : value, z.iso.datetime()),
2433
+ deployments: z.array(zRoundDeploymentDto),
2434
+ epochFeeUsd: z.optional(z.union([
2435
+ z.null(),
2436
+ zU64Dto
2437
+ ])),
2438
+ id: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
2439
+ isHashrateBoosted: z.optional(z.union([
2440
+ z.boolean(),
2441
+ z.null()
2442
+ ])),
2443
+ isSatStrike: z.optional(z.union([
2444
+ z.boolean(),
2445
+ z.null()
2446
+ ])),
2447
+ minersCount: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
2448
+ oneBtcFeeUsd: z.optional(z.union([
2449
+ z.null(),
2450
+ zU64Dto
2451
+ ])),
2452
+ protocolFeeUsd: z.optional(z.union([
2453
+ z.null(),
2454
+ zU64Dto
2455
+ ])),
2456
+ settledAt: z.optional(z.union([
2457
+ z.preprocess((value) => value instanceof Date ? value.toISOString() : value, z.iso.datetime()),
2458
+ z.null()
2459
+ ])),
2460
+ settledMiners: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
2461
+ startedAt: z.optional(z.union([
2462
+ z.preprocess((value) => value instanceof Date ? value.toISOString() : value, z.iso.datetime()),
2463
+ z.null()
2464
+ ])),
2465
+ state: zRoundHistoryStateDto,
2466
+ strikeBonusBtc: z.optional(z.union([
2467
+ z.null(),
2468
+ zU64Dto
2469
+ ])),
2470
+ strikeBonusCombinedUsd: z.optional(z.union([
2471
+ z.number(),
2472
+ z.null()
2473
+ ])),
2474
+ strikeBonusUsd: z.optional(z.union([
2475
+ z.null(),
2476
+ zU64Dto
2477
+ ])),
2478
+ strikeEpochBtc: z.optional(z.union([
2479
+ z.null(),
2480
+ zU64Dto
2481
+ ])),
2482
+ strikeEpochUsd: z.optional(z.union([
2483
+ z.null(),
2484
+ zU64Dto
2485
+ ])),
2486
+ strikeFeeUsd: z.optional(z.union([
2487
+ z.null(),
2488
+ zU64Dto
2489
+ ])),
2490
+ strikeReserveBtc: z.optional(z.union([
2491
+ z.null(),
2492
+ zU64Dto
2493
+ ])),
2494
+ strikeReserveUsd: z.optional(z.union([
2495
+ z.null(),
2496
+ zU64Dto
2497
+ ])),
2498
+ strikeSeedFromReserveBtc: z.optional(z.union([
2499
+ z.null(),
2500
+ zU64Dto
2501
+ ])),
2502
+ strikeSeedFromReserveUsd: z.optional(z.union([
2503
+ z.null(),
2504
+ zU64Dto
2505
+ ])),
2506
+ totalDeployedUsd: zU64Dto,
2507
+ totalPotBtc: z.optional(z.union([
2508
+ z.null(),
2509
+ zU64Dto
2510
+ ])),
2511
+ totalPotCombinedUsd: z.optional(z.union([
2512
+ z.number(),
2513
+ z.null()
2514
+ ])),
2515
+ totalPotUsd: z.optional(z.union([
2516
+ z.null(),
2517
+ zU64Dto
2518
+ ])),
2519
+ winnersCount: z.optional(z.union([
2520
+ z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
2521
+ z.null()
2522
+ ])),
2523
+ winningTile: z.optional(z.union([
2524
+ z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
2525
+ z.null()
2526
+ ]))
2527
+ });
2307
2528
  var zRoundHistoryDto = z.object({
2308
2529
  id: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
2309
2530
  isHashrateBoosted: z.optional(z.union([
@@ -2779,6 +3000,16 @@ var zGetRoundsData = z.object({
2779
3000
  var zGetRoundsResponse = z.object({
2780
3001
  data: z.array(zRoundHistoryDto)
2781
3002
  });
3003
+ var zGetRoundData = z.object({
3004
+ body: z.optional(z.never()),
3005
+ path: z.object({
3006
+ id: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
3007
+ }),
3008
+ query: z.optional(z.never())
3009
+ });
3010
+ var zGetRoundResponse = z.object({
3011
+ data: zRoundDetailsDto
3012
+ });
2782
3013
  var zSseData = z.object({
2783
3014
  body: z.optional(z.never()),
2784
3015
  path: z.optional(z.never()),
@@ -3096,6 +3327,20 @@ var SatrushBackendSdk = class _SatrushBackendSdk extends HeyApiClient {
3096
3327
  ...params
3097
3328
  });
3098
3329
  }
3330
+ /**
3331
+ * Request round details
3332
+ */
3333
+ getRound(parameters, options) {
3334
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "id" }] }]);
3335
+ return (options?.client ?? this.client).get({
3336
+ requestValidator: async (data) => await zGetRoundData.parseAsync(data),
3337
+ responseTransformer: getRoundResponseTransformer,
3338
+ responseValidator: async (data) => await zGetRoundResponse.parseAsync(data),
3339
+ url: "/v1/rounds/{id}",
3340
+ ...options,
3341
+ ...params
3342
+ });
3343
+ }
3099
3344
  /**
3100
3345
  * Subscribe for SSE stream
3101
3346
  */
@@ -3366,6 +3611,8 @@ async function unwrap(promise) {
3366
3611
  zGetOneBtcIterationParticipantsData,
3367
3612
  zGetOneBtcIterationParticipantsResponse,
3368
3613
  zGetOneBtcIterationResponse,
3614
+ zGetRoundData,
3615
+ zGetRoundResponse,
3369
3616
  zGetRoundsData,
3370
3617
  zGetRoundsPlayedLeaderboardData,
3371
3618
  zGetRoundsPlayedLeaderboardResponse,
@@ -3419,6 +3666,10 @@ async function unwrap(promise) {
3419
3666
  zPubkeyDto,
3420
3667
  zPublicAutomationDto,
3421
3668
  zPublicDeploymentDto,
3669
+ zRoundDeploymentDto,
3670
+ zRoundDetailsApiError404Error,
3671
+ zRoundDetailsApiError500Error,
3672
+ zRoundDetailsDto,
3422
3673
  zRoundDto,
3423
3674
  zRoundHistoryDto,
3424
3675
  zRoundHistoryStateDto,