@satrush/api 0.1.3 → 0.1.5
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 +43 -0
- package/dist/index.d.cts +190 -5
- package/dist/index.d.ts +190 -5
- package/dist/index.js +39 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
// src/index.ts
|
|
30
30
|
var index_exports = {};
|
|
31
31
|
__export(index_exports, {
|
|
32
|
+
AutomationStrategyDto: () => AutomationStrategyDto,
|
|
32
33
|
EpochStateDto: () => EpochStateDto,
|
|
33
34
|
NotificationEntity: () => NotificationEntity,
|
|
34
35
|
OneBtcStateDto: () => OneBtcStateDto,
|
|
@@ -40,6 +41,7 @@ __export(index_exports, {
|
|
|
40
41
|
isSatrushSdkError: () => isSatrushSdkError,
|
|
41
42
|
satrushSdkErrorInterceptor: () => satrushSdkErrorInterceptor,
|
|
42
43
|
unwrap: () => unwrap,
|
|
44
|
+
zAutomationStrategyDto: () => zAutomationStrategyDto,
|
|
43
45
|
zBadRequestErrorCodeErrorBody: () => zBadRequestErrorCodeErrorBody,
|
|
44
46
|
zBoardDto: () => zBoardDto,
|
|
45
47
|
zEpochStateDto: () => zEpochStateDto,
|
|
@@ -63,8 +65,10 @@ __export(index_exports, {
|
|
|
63
65
|
zOneBtcVaultDto: () => zOneBtcVaultDto,
|
|
64
66
|
zOneBtcVaultEntryDto: () => zOneBtcVaultEntryDto,
|
|
65
67
|
zOneBtcVaultIterationDto: () => zOneBtcVaultIterationDto,
|
|
68
|
+
zPricesDto: () => zPricesDto,
|
|
66
69
|
zProfileDto: () => zProfileDto,
|
|
67
70
|
zPubkeyDto: () => zPubkeyDto,
|
|
71
|
+
zPublicAutomationDto: () => zPublicAutomationDto,
|
|
68
72
|
zPublicDeploymentDto: () => zPublicDeploymentDto,
|
|
69
73
|
zRoundDto: () => zRoundDto,
|
|
70
74
|
zRoundStateDto: () => zRoundStateDto,
|
|
@@ -1132,6 +1136,11 @@ var getBoardResponseTransformer = async (data) => {
|
|
|
1132
1136
|
data.data = boardDtoSchemaResponseTransformer(data.data);
|
|
1133
1137
|
return data;
|
|
1134
1138
|
};
|
|
1139
|
+
var publicAutomationDtoSchemaResponseTransformer = (data) => {
|
|
1140
|
+
data.perRoundUsdAmount = u64DtoSchemaResponseTransformer(data.perRoundUsdAmount);
|
|
1141
|
+
data.remainingUsdAmount = u64DtoSchemaResponseTransformer(data.remainingUsdAmount);
|
|
1142
|
+
return data;
|
|
1143
|
+
};
|
|
1135
1144
|
var publicDeploymentDtoSchemaResponseTransformer = (data) => {
|
|
1136
1145
|
data.deployedUsdAmount = u64DtoSchemaResponseTransformer(data.deployedUsdAmount);
|
|
1137
1146
|
return data;
|
|
@@ -1152,6 +1161,9 @@ var oneBtcVaultEntryDtoSchemaResponseTransformer = (data) => {
|
|
|
1152
1161
|
return data;
|
|
1153
1162
|
};
|
|
1154
1163
|
var profileDtoSchemaResponseTransformer = (data) => {
|
|
1164
|
+
if (data.automation) {
|
|
1165
|
+
data.automation = publicAutomationDtoSchemaResponseTransformer(data.automation);
|
|
1166
|
+
}
|
|
1155
1167
|
data.deployments = data.deployments.map((item) => publicDeploymentDtoSchemaResponseTransformer(item));
|
|
1156
1168
|
data.epochVaultEntries = data.epochVaultEntries.map((item) => epochVaultEntryDtoSchemaResponseTransformer(item));
|
|
1157
1169
|
data.miner = minerDtoSchemaResponseTransformer(data.miner);
|
|
@@ -1184,6 +1196,11 @@ var getUserProfileResponseTransformer = async (data) => {
|
|
|
1184
1196
|
|
|
1185
1197
|
// src/generated/zod.gen.ts
|
|
1186
1198
|
var z = __toESM(require("zod"), 1);
|
|
1199
|
+
var zAutomationStrategyDto = z.enum([
|
|
1200
|
+
"static",
|
|
1201
|
+
"random",
|
|
1202
|
+
"discretionary"
|
|
1203
|
+
]);
|
|
1187
1204
|
var zBadRequestErrorCodeErrorBody = z.object({
|
|
1188
1205
|
code: z.enum([
|
|
1189
1206
|
"invalid_path",
|
|
@@ -1212,6 +1229,10 @@ var zOneBtcStateDto = z.enum([
|
|
|
1212
1229
|
"settled",
|
|
1213
1230
|
"complete"
|
|
1214
1231
|
]);
|
|
1232
|
+
var zPricesDto = z.object({
|
|
1233
|
+
btc: z.number(),
|
|
1234
|
+
sat: z.number()
|
|
1235
|
+
});
|
|
1215
1236
|
var zPubkeyDto = z.string().regex(/^[1-9A-HJ-NP-Za-km-z]+$/);
|
|
1216
1237
|
var zRoundStateDto = z.enum([
|
|
1217
1238
|
"active",
|
|
@@ -1322,6 +1343,14 @@ var zOneBtcVaultDto = z.object({
|
|
|
1322
1343
|
pendingUsdAmount: zU64Dto,
|
|
1323
1344
|
reservedBtcAmount: zU64Dto
|
|
1324
1345
|
});
|
|
1346
|
+
var zPublicAutomationDto = z.object({
|
|
1347
|
+
address: zPubkeyDto,
|
|
1348
|
+
perRoundUsdAmount: zU64Dto,
|
|
1349
|
+
reload: z.boolean(),
|
|
1350
|
+
remainingUsdAmount: zU64Dto,
|
|
1351
|
+
selectionMask: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1352
|
+
strategy: zAutomationStrategyDto
|
|
1353
|
+
});
|
|
1325
1354
|
var zPublicDeploymentDto = z.object({
|
|
1326
1355
|
address: zPubkeyDto,
|
|
1327
1356
|
deployedUsdAmount: zU64Dto,
|
|
@@ -1329,6 +1358,10 @@ var zPublicDeploymentDto = z.object({
|
|
|
1329
1358
|
selectionMask: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
1330
1359
|
});
|
|
1331
1360
|
var zProfileDto = z.object({
|
|
1361
|
+
automation: z.optional(z.union([
|
|
1362
|
+
z.null(),
|
|
1363
|
+
zPublicAutomationDto
|
|
1364
|
+
])),
|
|
1332
1365
|
deployments: z.array(zPublicDeploymentDto),
|
|
1333
1366
|
epochVaultEntries: z.array(zEpochVaultEntryDto),
|
|
1334
1367
|
miner: zMinerDto,
|
|
@@ -1383,6 +1416,7 @@ var zBoardDto = z.object({
|
|
|
1383
1416
|
z.null(),
|
|
1384
1417
|
zRoundDto
|
|
1385
1418
|
])),
|
|
1419
|
+
prices: zPricesDto,
|
|
1386
1420
|
roundDuration: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1387
1421
|
roundId: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1388
1422
|
satsVault: zSatsVaultDto,
|
|
@@ -1546,6 +1580,11 @@ var SatrushBackendSdk = class _SatrushBackendSdk extends HeyApiClient {
|
|
|
1546
1580
|
};
|
|
1547
1581
|
|
|
1548
1582
|
// src/generated/types.gen.ts
|
|
1583
|
+
var AutomationStrategyDto = {
|
|
1584
|
+
STATIC: "static",
|
|
1585
|
+
RANDOM: "random",
|
|
1586
|
+
DISCRETIONARY: "discretionary"
|
|
1587
|
+
};
|
|
1549
1588
|
var EpochStateDto = {
|
|
1550
1589
|
OPEN: "open",
|
|
1551
1590
|
SETTLING: "settling",
|
|
@@ -1611,6 +1650,7 @@ async function unwrap(promise) {
|
|
|
1611
1650
|
}
|
|
1612
1651
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1613
1652
|
0 && (module.exports = {
|
|
1653
|
+
AutomationStrategyDto,
|
|
1614
1654
|
EpochStateDto,
|
|
1615
1655
|
NotificationEntity,
|
|
1616
1656
|
OneBtcStateDto,
|
|
@@ -1622,6 +1662,7 @@ async function unwrap(promise) {
|
|
|
1622
1662
|
isSatrushSdkError,
|
|
1623
1663
|
satrushSdkErrorInterceptor,
|
|
1624
1664
|
unwrap,
|
|
1665
|
+
zAutomationStrategyDto,
|
|
1625
1666
|
zBadRequestErrorCodeErrorBody,
|
|
1626
1667
|
zBoardDto,
|
|
1627
1668
|
zEpochStateDto,
|
|
@@ -1645,8 +1686,10 @@ async function unwrap(promise) {
|
|
|
1645
1686
|
zOneBtcVaultDto,
|
|
1646
1687
|
zOneBtcVaultEntryDto,
|
|
1647
1688
|
zOneBtcVaultIterationDto,
|
|
1689
|
+
zPricesDto,
|
|
1648
1690
|
zProfileDto,
|
|
1649
1691
|
zPubkeyDto,
|
|
1692
|
+
zPublicAutomationDto,
|
|
1650
1693
|
zPublicDeploymentDto,
|
|
1651
1694
|
zRoundDto,
|
|
1652
1695
|
zRoundStateDto,
|
package/dist/index.d.cts
CHANGED
|
@@ -313,6 +313,18 @@ declare const createClient: (config?: Config) => Client;
|
|
|
313
313
|
type ClientOptions = {
|
|
314
314
|
baseUrl: `${string}://${string}/api` | (string & {});
|
|
315
315
|
};
|
|
316
|
+
/**
|
|
317
|
+
* Tile-selection strategy of an automation.
|
|
318
|
+
*/
|
|
319
|
+
declare const AutomationStrategyDto: {
|
|
320
|
+
readonly STATIC: "static";
|
|
321
|
+
readonly RANDOM: "random";
|
|
322
|
+
readonly DISCRETIONARY: "discretionary";
|
|
323
|
+
};
|
|
324
|
+
/**
|
|
325
|
+
* Tile-selection strategy of an automation.
|
|
326
|
+
*/
|
|
327
|
+
type AutomationStrategyDto = typeof AutomationStrategyDto[keyof typeof AutomationStrategyDto];
|
|
316
328
|
type BadRequestErrorCodeErrorBody = {
|
|
317
329
|
code: 'invalid_path' | 'invalid_query' | 'invalid_body';
|
|
318
330
|
};
|
|
@@ -340,6 +352,10 @@ type BoardDto = {
|
|
|
340
352
|
*/
|
|
341
353
|
oneBtcVault: OneBtcVaultDto;
|
|
342
354
|
previousRound?: null | RoundDto;
|
|
355
|
+
/**
|
|
356
|
+
* Live token prices.
|
|
357
|
+
*/
|
|
358
|
+
prices: PricesDto;
|
|
343
359
|
/**
|
|
344
360
|
* Round duration in slots.
|
|
345
361
|
*/
|
|
@@ -577,10 +593,24 @@ type OneBtcVaultIterationDto = {
|
|
|
577
593
|
winningTicket?: null | U64Dto;
|
|
578
594
|
};
|
|
579
595
|
/**
|
|
580
|
-
*
|
|
581
|
-
|
|
596
|
+
* Live token prices observed by the service.
|
|
597
|
+
*/
|
|
598
|
+
type PricesDto = {
|
|
599
|
+
/**
|
|
600
|
+
* cbBTC/USD price from Jupiter.
|
|
601
|
+
*/
|
|
602
|
+
btc: number;
|
|
603
|
+
/**
|
|
604
|
+
* USD price of a single sats-vault share.
|
|
605
|
+
*/
|
|
606
|
+
sat: number;
|
|
607
|
+
};
|
|
608
|
+
/**
|
|
609
|
+
* A user's profile: their miner account, active automation, currently-open
|
|
610
|
+
* deployments and vault entries.
|
|
582
611
|
*/
|
|
583
612
|
type ProfileDto = {
|
|
613
|
+
automation?: null | PublicAutomationDto;
|
|
584
614
|
/**
|
|
585
615
|
* The authority's open public deployments.
|
|
586
616
|
*/
|
|
@@ -602,6 +632,34 @@ type ProfileDto = {
|
|
|
602
632
|
* - OpenAPI: `type: string`, pattern for base58, optional format
|
|
603
633
|
*/
|
|
604
634
|
type PubkeyDto = string;
|
|
635
|
+
/**
|
|
636
|
+
* A miner's public automation: the platform's crank plays one deployment per
|
|
637
|
+
* round on their behalf until the escrow can no longer cover a round.
|
|
638
|
+
*/
|
|
639
|
+
type PublicAutomationDto = {
|
|
640
|
+
address: PubkeyDto;
|
|
641
|
+
/**
|
|
642
|
+
* Gross deploy size per round; fee legs are charged on top of it.
|
|
643
|
+
*/
|
|
644
|
+
perRoundUsdAmount: U64Dto;
|
|
645
|
+
/**
|
|
646
|
+
* Whether settled USD winnings reload the remaining amount.
|
|
647
|
+
*/
|
|
648
|
+
reload: boolean;
|
|
649
|
+
/**
|
|
650
|
+
* Escrowed funds still available.
|
|
651
|
+
*/
|
|
652
|
+
remainingUsdAmount: U64Dto;
|
|
653
|
+
/**
|
|
654
|
+
* Static: the mask used every round. Random: seeds the tile count.
|
|
655
|
+
* Discretionary: 0.
|
|
656
|
+
*/
|
|
657
|
+
selectionMask: number;
|
|
658
|
+
/**
|
|
659
|
+
* Tile-selection strategy.
|
|
660
|
+
*/
|
|
661
|
+
strategy: AutomationStrategyDto;
|
|
662
|
+
};
|
|
605
663
|
/**
|
|
606
664
|
* A miner's deployment of USD onto a round's tiles.
|
|
607
665
|
*/
|
|
@@ -909,6 +967,14 @@ declare class SatrushBackendSdk extends HeyApiClient {
|
|
|
909
967
|
}, options?: Options<never, ThrowOnError>): RequestResult<GetUserProfileResponses, GetUserProfileErrors, ThrowOnError, "fields">;
|
|
910
968
|
}
|
|
911
969
|
|
|
970
|
+
/**
|
|
971
|
+
* Tile-selection strategy of an automation.
|
|
972
|
+
*/
|
|
973
|
+
declare const zAutomationStrategyDto: z.ZodEnum<{
|
|
974
|
+
static: "static";
|
|
975
|
+
random: "random";
|
|
976
|
+
discretionary: "discretionary";
|
|
977
|
+
}>;
|
|
912
978
|
declare const zBadRequestErrorCodeErrorBody: z.ZodObject<{
|
|
913
979
|
code: z.ZodEnum<{
|
|
914
980
|
invalid_path: "invalid_path";
|
|
@@ -953,6 +1019,13 @@ declare const zOneBtcStateDto: z.ZodEnum<{
|
|
|
953
1019
|
settled: "settled";
|
|
954
1020
|
complete: "complete";
|
|
955
1021
|
}>;
|
|
1022
|
+
/**
|
|
1023
|
+
* Live token prices observed by the service.
|
|
1024
|
+
*/
|
|
1025
|
+
declare const zPricesDto: z.ZodObject<{
|
|
1026
|
+
btc: z.ZodNumber;
|
|
1027
|
+
sat: z.ZodNumber;
|
|
1028
|
+
}, z.core.$strip>;
|
|
956
1029
|
/**
|
|
957
1030
|
* Pubkey represented as base58 string in JSON and OpenAPI.
|
|
958
1031
|
*
|
|
@@ -1126,6 +1199,22 @@ declare const zOneBtcVaultDto: z.ZodObject<{
|
|
|
1126
1199
|
pendingUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
1127
1200
|
reservedBtcAmount: z.ZodCoercedBigInt<unknown>;
|
|
1128
1201
|
}, z.core.$strip>;
|
|
1202
|
+
/**
|
|
1203
|
+
* A miner's public automation: the platform's crank plays one deployment per
|
|
1204
|
+
* round on their behalf until the escrow can no longer cover a round.
|
|
1205
|
+
*/
|
|
1206
|
+
declare const zPublicAutomationDto: z.ZodObject<{
|
|
1207
|
+
address: z.ZodString;
|
|
1208
|
+
perRoundUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
1209
|
+
reload: z.ZodBoolean;
|
|
1210
|
+
remainingUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
1211
|
+
selectionMask: z.ZodInt;
|
|
1212
|
+
strategy: z.ZodEnum<{
|
|
1213
|
+
static: "static";
|
|
1214
|
+
random: "random";
|
|
1215
|
+
discretionary: "discretionary";
|
|
1216
|
+
}>;
|
|
1217
|
+
}, z.core.$strip>;
|
|
1129
1218
|
/**
|
|
1130
1219
|
* A miner's deployment of USD onto a round's tiles.
|
|
1131
1220
|
*/
|
|
@@ -1136,10 +1225,22 @@ declare const zPublicDeploymentDto: z.ZodObject<{
|
|
|
1136
1225
|
selectionMask: z.ZodInt;
|
|
1137
1226
|
}, z.core.$strip>;
|
|
1138
1227
|
/**
|
|
1139
|
-
* A user's profile: their miner account, currently-open
|
|
1140
|
-
* entries.
|
|
1228
|
+
* A user's profile: their miner account, active automation, currently-open
|
|
1229
|
+
* deployments and vault entries.
|
|
1141
1230
|
*/
|
|
1142
1231
|
declare const zProfileDto: z.ZodObject<{
|
|
1232
|
+
automation: z.ZodOptional<z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
|
|
1233
|
+
address: z.ZodString;
|
|
1234
|
+
perRoundUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
1235
|
+
reload: z.ZodBoolean;
|
|
1236
|
+
remainingUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
1237
|
+
selectionMask: z.ZodInt;
|
|
1238
|
+
strategy: z.ZodEnum<{
|
|
1239
|
+
static: "static";
|
|
1240
|
+
random: "random";
|
|
1241
|
+
discretionary: "discretionary";
|
|
1242
|
+
}>;
|
|
1243
|
+
}, z.core.$strip>]>>;
|
|
1143
1244
|
deployments: z.ZodArray<z.ZodObject<{
|
|
1144
1245
|
address: z.ZodString;
|
|
1145
1246
|
deployedUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
@@ -1329,6 +1430,10 @@ declare const zBoardDto: z.ZodObject<{
|
|
|
1329
1430
|
winnersCount: z.ZodInt;
|
|
1330
1431
|
winningTile: z.ZodOptional<z.ZodUnion<readonly [z.ZodInt, z.ZodNull]>>;
|
|
1331
1432
|
}, z.core.$strip>]>>;
|
|
1433
|
+
prices: z.ZodObject<{
|
|
1434
|
+
btc: z.ZodNumber;
|
|
1435
|
+
sat: z.ZodNumber;
|
|
1436
|
+
}, z.core.$strip>;
|
|
1332
1437
|
roundDuration: z.ZodInt;
|
|
1333
1438
|
roundId: z.ZodInt;
|
|
1334
1439
|
satsVault: z.ZodObject<{
|
|
@@ -1451,6 +1556,10 @@ declare const zSnapshotDto: z.ZodObject<{
|
|
|
1451
1556
|
winnersCount: z.ZodInt;
|
|
1452
1557
|
winningTile: z.ZodOptional<z.ZodUnion<readonly [z.ZodInt, z.ZodNull]>>;
|
|
1453
1558
|
}, z.core.$strip>]>>;
|
|
1559
|
+
prices: z.ZodObject<{
|
|
1560
|
+
btc: z.ZodNumber;
|
|
1561
|
+
sat: z.ZodNumber;
|
|
1562
|
+
}, z.core.$strip>;
|
|
1454
1563
|
roundDuration: z.ZodInt;
|
|
1455
1564
|
roundId: z.ZodInt;
|
|
1456
1565
|
satsVault: z.ZodObject<{
|
|
@@ -1470,6 +1579,18 @@ declare const zSnapshotDto: z.ZodObject<{
|
|
|
1470
1579
|
state_snapshot: "state_snapshot";
|
|
1471
1580
|
}>;
|
|
1472
1581
|
profile: z.ZodOptional<z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
|
|
1582
|
+
automation: z.ZodOptional<z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
|
|
1583
|
+
address: z.ZodString;
|
|
1584
|
+
perRoundUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
1585
|
+
reload: z.ZodBoolean;
|
|
1586
|
+
remainingUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
1587
|
+
selectionMask: z.ZodInt;
|
|
1588
|
+
strategy: z.ZodEnum<{
|
|
1589
|
+
static: "static";
|
|
1590
|
+
random: "random";
|
|
1591
|
+
discretionary: "discretionary";
|
|
1592
|
+
}>;
|
|
1593
|
+
}, z.core.$strip>]>>;
|
|
1473
1594
|
deployments: z.ZodArray<z.ZodObject<{
|
|
1474
1595
|
address: z.ZodString;
|
|
1475
1596
|
deployedUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
@@ -1605,6 +1726,10 @@ declare const zSseResponseSnapshot: z.ZodIntersection<z.ZodObject<{
|
|
|
1605
1726
|
winnersCount: z.ZodInt;
|
|
1606
1727
|
winningTile: z.ZodOptional<z.ZodUnion<readonly [z.ZodInt, z.ZodNull]>>;
|
|
1607
1728
|
}, z.core.$strip>]>>;
|
|
1729
|
+
prices: z.ZodObject<{
|
|
1730
|
+
btc: z.ZodNumber;
|
|
1731
|
+
sat: z.ZodNumber;
|
|
1732
|
+
}, z.core.$strip>;
|
|
1608
1733
|
roundDuration: z.ZodInt;
|
|
1609
1734
|
roundId: z.ZodInt;
|
|
1610
1735
|
satsVault: z.ZodObject<{
|
|
@@ -1624,6 +1749,18 @@ declare const zSseResponseSnapshot: z.ZodIntersection<z.ZodObject<{
|
|
|
1624
1749
|
state_snapshot: "state_snapshot";
|
|
1625
1750
|
}>;
|
|
1626
1751
|
profile: z.ZodOptional<z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
|
|
1752
|
+
automation: z.ZodOptional<z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
|
|
1753
|
+
address: z.ZodString;
|
|
1754
|
+
perRoundUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
1755
|
+
reload: z.ZodBoolean;
|
|
1756
|
+
remainingUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
1757
|
+
selectionMask: z.ZodInt;
|
|
1758
|
+
strategy: z.ZodEnum<{
|
|
1759
|
+
static: "static";
|
|
1760
|
+
random: "random";
|
|
1761
|
+
discretionary: "discretionary";
|
|
1762
|
+
}>;
|
|
1763
|
+
}, z.core.$strip>]>>;
|
|
1627
1764
|
deployments: z.ZodArray<z.ZodObject<{
|
|
1628
1765
|
address: z.ZodString;
|
|
1629
1766
|
deployedUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
@@ -1765,6 +1902,10 @@ declare const zSseResponse: z.ZodIntersection<z.ZodObject<{
|
|
|
1765
1902
|
winnersCount: z.ZodInt;
|
|
1766
1903
|
winningTile: z.ZodOptional<z.ZodUnion<readonly [z.ZodInt, z.ZodNull]>>;
|
|
1767
1904
|
}, z.core.$strip>]>>;
|
|
1905
|
+
prices: z.ZodObject<{
|
|
1906
|
+
btc: z.ZodNumber;
|
|
1907
|
+
sat: z.ZodNumber;
|
|
1908
|
+
}, z.core.$strip>;
|
|
1768
1909
|
roundDuration: z.ZodInt;
|
|
1769
1910
|
roundId: z.ZodInt;
|
|
1770
1911
|
satsVault: z.ZodObject<{
|
|
@@ -1784,6 +1925,18 @@ declare const zSseResponse: z.ZodIntersection<z.ZodObject<{
|
|
|
1784
1925
|
state_snapshot: "state_snapshot";
|
|
1785
1926
|
}>;
|
|
1786
1927
|
profile: z.ZodOptional<z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
|
|
1928
|
+
automation: z.ZodOptional<z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
|
|
1929
|
+
address: z.ZodString;
|
|
1930
|
+
perRoundUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
1931
|
+
reload: z.ZodBoolean;
|
|
1932
|
+
remainingUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
1933
|
+
selectionMask: z.ZodInt;
|
|
1934
|
+
strategy: z.ZodEnum<{
|
|
1935
|
+
static: "static";
|
|
1936
|
+
random: "random";
|
|
1937
|
+
discretionary: "discretionary";
|
|
1938
|
+
}>;
|
|
1939
|
+
}, z.core.$strip>]>>;
|
|
1787
1940
|
deployments: z.ZodArray<z.ZodObject<{
|
|
1788
1941
|
address: z.ZodString;
|
|
1789
1942
|
deployedUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
@@ -1970,6 +2123,10 @@ declare const zGetBoardResponse: z.ZodObject<{
|
|
|
1970
2123
|
winnersCount: z.ZodInt;
|
|
1971
2124
|
winningTile: z.ZodOptional<z.ZodUnion<readonly [z.ZodInt, z.ZodNull]>>;
|
|
1972
2125
|
}, z.core.$strip>]>>;
|
|
2126
|
+
prices: z.ZodObject<{
|
|
2127
|
+
btc: z.ZodNumber;
|
|
2128
|
+
sat: z.ZodNumber;
|
|
2129
|
+
}, z.core.$strip>;
|
|
1973
2130
|
roundDuration: z.ZodInt;
|
|
1974
2131
|
roundId: z.ZodInt;
|
|
1975
2132
|
satsVault: z.ZodObject<{
|
|
@@ -2125,6 +2282,10 @@ declare const zSseResponse2: z.ZodIntersection<z.ZodObject<{
|
|
|
2125
2282
|
winnersCount: z.ZodInt;
|
|
2126
2283
|
winningTile: z.ZodOptional<z.ZodUnion<readonly [z.ZodInt, z.ZodNull]>>;
|
|
2127
2284
|
}, z.core.$strip>]>>;
|
|
2285
|
+
prices: z.ZodObject<{
|
|
2286
|
+
btc: z.ZodNumber;
|
|
2287
|
+
sat: z.ZodNumber;
|
|
2288
|
+
}, z.core.$strip>;
|
|
2128
2289
|
roundDuration: z.ZodInt;
|
|
2129
2290
|
roundId: z.ZodInt;
|
|
2130
2291
|
satsVault: z.ZodObject<{
|
|
@@ -2144,6 +2305,18 @@ declare const zSseResponse2: z.ZodIntersection<z.ZodObject<{
|
|
|
2144
2305
|
state_snapshot: "state_snapshot";
|
|
2145
2306
|
}>;
|
|
2146
2307
|
profile: z.ZodOptional<z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
|
|
2308
|
+
automation: z.ZodOptional<z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
|
|
2309
|
+
address: z.ZodString;
|
|
2310
|
+
perRoundUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
2311
|
+
reload: z.ZodBoolean;
|
|
2312
|
+
remainingUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
2313
|
+
selectionMask: z.ZodInt;
|
|
2314
|
+
strategy: z.ZodEnum<{
|
|
2315
|
+
static: "static";
|
|
2316
|
+
random: "random";
|
|
2317
|
+
discretionary: "discretionary";
|
|
2318
|
+
}>;
|
|
2319
|
+
}, z.core.$strip>]>>;
|
|
2147
2320
|
deployments: z.ZodArray<z.ZodObject<{
|
|
2148
2321
|
address: z.ZodString;
|
|
2149
2322
|
deployedUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
@@ -2186,6 +2359,18 @@ declare const zGetUserProfileData: z.ZodObject<{
|
|
|
2186
2359
|
}, z.core.$strip>;
|
|
2187
2360
|
declare const zGetUserProfileResponse: z.ZodObject<{
|
|
2188
2361
|
data: z.ZodObject<{
|
|
2362
|
+
automation: z.ZodOptional<z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
|
|
2363
|
+
address: z.ZodString;
|
|
2364
|
+
perRoundUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
2365
|
+
reload: z.ZodBoolean;
|
|
2366
|
+
remainingUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
2367
|
+
selectionMask: z.ZodInt;
|
|
2368
|
+
strategy: z.ZodEnum<{
|
|
2369
|
+
static: "static";
|
|
2370
|
+
random: "random";
|
|
2371
|
+
discretionary: "discretionary";
|
|
2372
|
+
}>;
|
|
2373
|
+
}, z.core.$strip>]>>;
|
|
2189
2374
|
deployments: z.ZodArray<z.ZodObject<{
|
|
2190
2375
|
address: z.ZodString;
|
|
2191
2376
|
deployedUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
@@ -2238,4 +2423,4 @@ declare class SatrushBackendSdkError<TCause = unknown> extends Error {
|
|
|
2238
2423
|
declare const satrushSdkErrorInterceptor: (error: unknown, response?: Response) => SatrushBackendSdkError<unknown>;
|
|
2239
2424
|
declare const isSatrushSdkError: <TCause = unknown>(error: unknown) => error is SatrushBackendSdkError<TCause>;
|
|
2240
2425
|
|
|
2241
|
-
export { type BadRequestErrorCodeErrorBody, type BoardDto, type ClientOptions, EpochStateDto, type EpochVaultDto, type EpochVaultEntryDto, type EpochVaultIterationDto, type EpochWinnerDto, type FieldError, type GetBoardData, type GetBoardError, type GetBoardErrors, type GetBoardResponse, type GetBoardResponseZodType, type GetBoardResponses, type GetConfigData, type GetConfigError, type GetConfigErrors, type GetConfigResponse, type GetConfigResponseZodType, type GetConfigResponses, type GetUserProfileData, type GetUserProfileError, type GetUserProfileErrors, type GetUserProfileResponse, type GetUserProfileResponseZodType, type GetUserProfileResponses, type I128Dto, type I64Dto, type InternalErrorCodeErrorBody, type MinerDto, NotificationEntity, OneBtcStateDto, type OneBtcVaultDto, type OneBtcVaultEntryDto, type OneBtcVaultIterationDto, type Options, type ProfileDto, type PubkeyDto, type PublicDeploymentDto, type RoundDto, RoundStateDto, SatrushBackendSdk, SatrushBackendSdkError, type SatrushConfigDto, type SatsVaultDto, type ServerSentEventsOptions, type ServerSentEventsResult, type SnapshotDto, type SseData, type SseError, type SseErrors, type SseResponse, type SseResponse2, type SseResponseSnapshot, type SseResponseZodType, type SseResponses, type StreamEvent, type StrikeJackpotDto, type TileStakeDto, type U128Dto, type U64Dto, type UserProfileApiError400Error, type UserProfileApiError400InvalidAddress, type ValidationErrorCodeErrorBody, type ValidationErrorCodeValidationDetailsErrorBody, createClient, createSseClient, isSatrushSdkError, satrushSdkErrorInterceptor, unwrap, zBadRequestErrorCodeErrorBody, zBoardDto, zEpochStateDto, zEpochVaultDto, zEpochVaultEntryDto, zEpochVaultIterationDto, zEpochWinnerDto, zFieldError, zGetBoardData, zGetBoardResponse, zGetConfigData, zGetConfigResponse, zGetUserProfileData, zGetUserProfileResponse, zI128Dto, zI64Dto, zInternalErrorCodeErrorBody, zMinerDto, zNotificationEntity, zOneBtcStateDto, zOneBtcVaultDto, zOneBtcVaultEntryDto, zOneBtcVaultIterationDto, zProfileDto, zPubkeyDto, zPublicDeploymentDto, zRoundDto, zRoundStateDto, zSatrushConfigDto, zSatsVaultDto, zSnapshotDto, zSseData, zSseResponse, zSseResponse2, zSseResponseSnapshot, zStrikeJackpotDto, zTileStakeDto, zU128Dto, zU64Dto, zUserProfileApiError400Error, zUserProfileApiError400InvalidAddress, zValidationErrorCodeErrorBody, zValidationErrorCodeValidationDetailsErrorBody };
|
|
2426
|
+
export { AutomationStrategyDto, type BadRequestErrorCodeErrorBody, type BoardDto, type ClientOptions, EpochStateDto, type EpochVaultDto, type EpochVaultEntryDto, type EpochVaultIterationDto, type EpochWinnerDto, type FieldError, type GetBoardData, type GetBoardError, type GetBoardErrors, type GetBoardResponse, type GetBoardResponseZodType, type GetBoardResponses, type GetConfigData, type GetConfigError, type GetConfigErrors, type GetConfigResponse, type GetConfigResponseZodType, type GetConfigResponses, type GetUserProfileData, type GetUserProfileError, type GetUserProfileErrors, type GetUserProfileResponse, type GetUserProfileResponseZodType, type GetUserProfileResponses, type I128Dto, type I64Dto, type InternalErrorCodeErrorBody, type MinerDto, NotificationEntity, OneBtcStateDto, type OneBtcVaultDto, type OneBtcVaultEntryDto, type OneBtcVaultIterationDto, type Options, type PricesDto, type ProfileDto, type PubkeyDto, type PublicAutomationDto, type PublicDeploymentDto, type RoundDto, RoundStateDto, SatrushBackendSdk, SatrushBackendSdkError, type SatrushConfigDto, type SatsVaultDto, type ServerSentEventsOptions, type ServerSentEventsResult, type SnapshotDto, type SseData, type SseError, type SseErrors, type SseResponse, type SseResponse2, type SseResponseSnapshot, type SseResponseZodType, type SseResponses, type StreamEvent, type StrikeJackpotDto, type TileStakeDto, type U128Dto, type U64Dto, type UserProfileApiError400Error, type UserProfileApiError400InvalidAddress, type ValidationErrorCodeErrorBody, type ValidationErrorCodeValidationDetailsErrorBody, createClient, createSseClient, isSatrushSdkError, satrushSdkErrorInterceptor, unwrap, zAutomationStrategyDto, zBadRequestErrorCodeErrorBody, zBoardDto, zEpochStateDto, zEpochVaultDto, zEpochVaultEntryDto, zEpochVaultIterationDto, zEpochWinnerDto, zFieldError, zGetBoardData, zGetBoardResponse, zGetConfigData, zGetConfigResponse, zGetUserProfileData, zGetUserProfileResponse, zI128Dto, zI64Dto, zInternalErrorCodeErrorBody, zMinerDto, zNotificationEntity, zOneBtcStateDto, zOneBtcVaultDto, zOneBtcVaultEntryDto, zOneBtcVaultIterationDto, zPricesDto, zProfileDto, zPubkeyDto, zPublicAutomationDto, zPublicDeploymentDto, zRoundDto, zRoundStateDto, zSatrushConfigDto, zSatsVaultDto, zSnapshotDto, zSseData, zSseResponse, zSseResponse2, zSseResponseSnapshot, zStrikeJackpotDto, zTileStakeDto, zU128Dto, zU64Dto, zUserProfileApiError400Error, zUserProfileApiError400InvalidAddress, zValidationErrorCodeErrorBody, zValidationErrorCodeValidationDetailsErrorBody };
|
package/dist/index.d.ts
CHANGED
|
@@ -313,6 +313,18 @@ declare const createClient: (config?: Config) => Client;
|
|
|
313
313
|
type ClientOptions = {
|
|
314
314
|
baseUrl: `${string}://${string}/api` | (string & {});
|
|
315
315
|
};
|
|
316
|
+
/**
|
|
317
|
+
* Tile-selection strategy of an automation.
|
|
318
|
+
*/
|
|
319
|
+
declare const AutomationStrategyDto: {
|
|
320
|
+
readonly STATIC: "static";
|
|
321
|
+
readonly RANDOM: "random";
|
|
322
|
+
readonly DISCRETIONARY: "discretionary";
|
|
323
|
+
};
|
|
324
|
+
/**
|
|
325
|
+
* Tile-selection strategy of an automation.
|
|
326
|
+
*/
|
|
327
|
+
type AutomationStrategyDto = typeof AutomationStrategyDto[keyof typeof AutomationStrategyDto];
|
|
316
328
|
type BadRequestErrorCodeErrorBody = {
|
|
317
329
|
code: 'invalid_path' | 'invalid_query' | 'invalid_body';
|
|
318
330
|
};
|
|
@@ -340,6 +352,10 @@ type BoardDto = {
|
|
|
340
352
|
*/
|
|
341
353
|
oneBtcVault: OneBtcVaultDto;
|
|
342
354
|
previousRound?: null | RoundDto;
|
|
355
|
+
/**
|
|
356
|
+
* Live token prices.
|
|
357
|
+
*/
|
|
358
|
+
prices: PricesDto;
|
|
343
359
|
/**
|
|
344
360
|
* Round duration in slots.
|
|
345
361
|
*/
|
|
@@ -577,10 +593,24 @@ type OneBtcVaultIterationDto = {
|
|
|
577
593
|
winningTicket?: null | U64Dto;
|
|
578
594
|
};
|
|
579
595
|
/**
|
|
580
|
-
*
|
|
581
|
-
|
|
596
|
+
* Live token prices observed by the service.
|
|
597
|
+
*/
|
|
598
|
+
type PricesDto = {
|
|
599
|
+
/**
|
|
600
|
+
* cbBTC/USD price from Jupiter.
|
|
601
|
+
*/
|
|
602
|
+
btc: number;
|
|
603
|
+
/**
|
|
604
|
+
* USD price of a single sats-vault share.
|
|
605
|
+
*/
|
|
606
|
+
sat: number;
|
|
607
|
+
};
|
|
608
|
+
/**
|
|
609
|
+
* A user's profile: their miner account, active automation, currently-open
|
|
610
|
+
* deployments and vault entries.
|
|
582
611
|
*/
|
|
583
612
|
type ProfileDto = {
|
|
613
|
+
automation?: null | PublicAutomationDto;
|
|
584
614
|
/**
|
|
585
615
|
* The authority's open public deployments.
|
|
586
616
|
*/
|
|
@@ -602,6 +632,34 @@ type ProfileDto = {
|
|
|
602
632
|
* - OpenAPI: `type: string`, pattern for base58, optional format
|
|
603
633
|
*/
|
|
604
634
|
type PubkeyDto = string;
|
|
635
|
+
/**
|
|
636
|
+
* A miner's public automation: the platform's crank plays one deployment per
|
|
637
|
+
* round on their behalf until the escrow can no longer cover a round.
|
|
638
|
+
*/
|
|
639
|
+
type PublicAutomationDto = {
|
|
640
|
+
address: PubkeyDto;
|
|
641
|
+
/**
|
|
642
|
+
* Gross deploy size per round; fee legs are charged on top of it.
|
|
643
|
+
*/
|
|
644
|
+
perRoundUsdAmount: U64Dto;
|
|
645
|
+
/**
|
|
646
|
+
* Whether settled USD winnings reload the remaining amount.
|
|
647
|
+
*/
|
|
648
|
+
reload: boolean;
|
|
649
|
+
/**
|
|
650
|
+
* Escrowed funds still available.
|
|
651
|
+
*/
|
|
652
|
+
remainingUsdAmount: U64Dto;
|
|
653
|
+
/**
|
|
654
|
+
* Static: the mask used every round. Random: seeds the tile count.
|
|
655
|
+
* Discretionary: 0.
|
|
656
|
+
*/
|
|
657
|
+
selectionMask: number;
|
|
658
|
+
/**
|
|
659
|
+
* Tile-selection strategy.
|
|
660
|
+
*/
|
|
661
|
+
strategy: AutomationStrategyDto;
|
|
662
|
+
};
|
|
605
663
|
/**
|
|
606
664
|
* A miner's deployment of USD onto a round's tiles.
|
|
607
665
|
*/
|
|
@@ -909,6 +967,14 @@ declare class SatrushBackendSdk extends HeyApiClient {
|
|
|
909
967
|
}, options?: Options<never, ThrowOnError>): RequestResult<GetUserProfileResponses, GetUserProfileErrors, ThrowOnError, "fields">;
|
|
910
968
|
}
|
|
911
969
|
|
|
970
|
+
/**
|
|
971
|
+
* Tile-selection strategy of an automation.
|
|
972
|
+
*/
|
|
973
|
+
declare const zAutomationStrategyDto: z.ZodEnum<{
|
|
974
|
+
static: "static";
|
|
975
|
+
random: "random";
|
|
976
|
+
discretionary: "discretionary";
|
|
977
|
+
}>;
|
|
912
978
|
declare const zBadRequestErrorCodeErrorBody: z.ZodObject<{
|
|
913
979
|
code: z.ZodEnum<{
|
|
914
980
|
invalid_path: "invalid_path";
|
|
@@ -953,6 +1019,13 @@ declare const zOneBtcStateDto: z.ZodEnum<{
|
|
|
953
1019
|
settled: "settled";
|
|
954
1020
|
complete: "complete";
|
|
955
1021
|
}>;
|
|
1022
|
+
/**
|
|
1023
|
+
* Live token prices observed by the service.
|
|
1024
|
+
*/
|
|
1025
|
+
declare const zPricesDto: z.ZodObject<{
|
|
1026
|
+
btc: z.ZodNumber;
|
|
1027
|
+
sat: z.ZodNumber;
|
|
1028
|
+
}, z.core.$strip>;
|
|
956
1029
|
/**
|
|
957
1030
|
* Pubkey represented as base58 string in JSON and OpenAPI.
|
|
958
1031
|
*
|
|
@@ -1126,6 +1199,22 @@ declare const zOneBtcVaultDto: z.ZodObject<{
|
|
|
1126
1199
|
pendingUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
1127
1200
|
reservedBtcAmount: z.ZodCoercedBigInt<unknown>;
|
|
1128
1201
|
}, z.core.$strip>;
|
|
1202
|
+
/**
|
|
1203
|
+
* A miner's public automation: the platform's crank plays one deployment per
|
|
1204
|
+
* round on their behalf until the escrow can no longer cover a round.
|
|
1205
|
+
*/
|
|
1206
|
+
declare const zPublicAutomationDto: z.ZodObject<{
|
|
1207
|
+
address: z.ZodString;
|
|
1208
|
+
perRoundUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
1209
|
+
reload: z.ZodBoolean;
|
|
1210
|
+
remainingUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
1211
|
+
selectionMask: z.ZodInt;
|
|
1212
|
+
strategy: z.ZodEnum<{
|
|
1213
|
+
static: "static";
|
|
1214
|
+
random: "random";
|
|
1215
|
+
discretionary: "discretionary";
|
|
1216
|
+
}>;
|
|
1217
|
+
}, z.core.$strip>;
|
|
1129
1218
|
/**
|
|
1130
1219
|
* A miner's deployment of USD onto a round's tiles.
|
|
1131
1220
|
*/
|
|
@@ -1136,10 +1225,22 @@ declare const zPublicDeploymentDto: z.ZodObject<{
|
|
|
1136
1225
|
selectionMask: z.ZodInt;
|
|
1137
1226
|
}, z.core.$strip>;
|
|
1138
1227
|
/**
|
|
1139
|
-
* A user's profile: their miner account, currently-open
|
|
1140
|
-
* entries.
|
|
1228
|
+
* A user's profile: their miner account, active automation, currently-open
|
|
1229
|
+
* deployments and vault entries.
|
|
1141
1230
|
*/
|
|
1142
1231
|
declare const zProfileDto: z.ZodObject<{
|
|
1232
|
+
automation: z.ZodOptional<z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
|
|
1233
|
+
address: z.ZodString;
|
|
1234
|
+
perRoundUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
1235
|
+
reload: z.ZodBoolean;
|
|
1236
|
+
remainingUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
1237
|
+
selectionMask: z.ZodInt;
|
|
1238
|
+
strategy: z.ZodEnum<{
|
|
1239
|
+
static: "static";
|
|
1240
|
+
random: "random";
|
|
1241
|
+
discretionary: "discretionary";
|
|
1242
|
+
}>;
|
|
1243
|
+
}, z.core.$strip>]>>;
|
|
1143
1244
|
deployments: z.ZodArray<z.ZodObject<{
|
|
1144
1245
|
address: z.ZodString;
|
|
1145
1246
|
deployedUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
@@ -1329,6 +1430,10 @@ declare const zBoardDto: z.ZodObject<{
|
|
|
1329
1430
|
winnersCount: z.ZodInt;
|
|
1330
1431
|
winningTile: z.ZodOptional<z.ZodUnion<readonly [z.ZodInt, z.ZodNull]>>;
|
|
1331
1432
|
}, z.core.$strip>]>>;
|
|
1433
|
+
prices: z.ZodObject<{
|
|
1434
|
+
btc: z.ZodNumber;
|
|
1435
|
+
sat: z.ZodNumber;
|
|
1436
|
+
}, z.core.$strip>;
|
|
1332
1437
|
roundDuration: z.ZodInt;
|
|
1333
1438
|
roundId: z.ZodInt;
|
|
1334
1439
|
satsVault: z.ZodObject<{
|
|
@@ -1451,6 +1556,10 @@ declare const zSnapshotDto: z.ZodObject<{
|
|
|
1451
1556
|
winnersCount: z.ZodInt;
|
|
1452
1557
|
winningTile: z.ZodOptional<z.ZodUnion<readonly [z.ZodInt, z.ZodNull]>>;
|
|
1453
1558
|
}, z.core.$strip>]>>;
|
|
1559
|
+
prices: z.ZodObject<{
|
|
1560
|
+
btc: z.ZodNumber;
|
|
1561
|
+
sat: z.ZodNumber;
|
|
1562
|
+
}, z.core.$strip>;
|
|
1454
1563
|
roundDuration: z.ZodInt;
|
|
1455
1564
|
roundId: z.ZodInt;
|
|
1456
1565
|
satsVault: z.ZodObject<{
|
|
@@ -1470,6 +1579,18 @@ declare const zSnapshotDto: z.ZodObject<{
|
|
|
1470
1579
|
state_snapshot: "state_snapshot";
|
|
1471
1580
|
}>;
|
|
1472
1581
|
profile: z.ZodOptional<z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
|
|
1582
|
+
automation: z.ZodOptional<z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
|
|
1583
|
+
address: z.ZodString;
|
|
1584
|
+
perRoundUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
1585
|
+
reload: z.ZodBoolean;
|
|
1586
|
+
remainingUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
1587
|
+
selectionMask: z.ZodInt;
|
|
1588
|
+
strategy: z.ZodEnum<{
|
|
1589
|
+
static: "static";
|
|
1590
|
+
random: "random";
|
|
1591
|
+
discretionary: "discretionary";
|
|
1592
|
+
}>;
|
|
1593
|
+
}, z.core.$strip>]>>;
|
|
1473
1594
|
deployments: z.ZodArray<z.ZodObject<{
|
|
1474
1595
|
address: z.ZodString;
|
|
1475
1596
|
deployedUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
@@ -1605,6 +1726,10 @@ declare const zSseResponseSnapshot: z.ZodIntersection<z.ZodObject<{
|
|
|
1605
1726
|
winnersCount: z.ZodInt;
|
|
1606
1727
|
winningTile: z.ZodOptional<z.ZodUnion<readonly [z.ZodInt, z.ZodNull]>>;
|
|
1607
1728
|
}, z.core.$strip>]>>;
|
|
1729
|
+
prices: z.ZodObject<{
|
|
1730
|
+
btc: z.ZodNumber;
|
|
1731
|
+
sat: z.ZodNumber;
|
|
1732
|
+
}, z.core.$strip>;
|
|
1608
1733
|
roundDuration: z.ZodInt;
|
|
1609
1734
|
roundId: z.ZodInt;
|
|
1610
1735
|
satsVault: z.ZodObject<{
|
|
@@ -1624,6 +1749,18 @@ declare const zSseResponseSnapshot: z.ZodIntersection<z.ZodObject<{
|
|
|
1624
1749
|
state_snapshot: "state_snapshot";
|
|
1625
1750
|
}>;
|
|
1626
1751
|
profile: z.ZodOptional<z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
|
|
1752
|
+
automation: z.ZodOptional<z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
|
|
1753
|
+
address: z.ZodString;
|
|
1754
|
+
perRoundUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
1755
|
+
reload: z.ZodBoolean;
|
|
1756
|
+
remainingUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
1757
|
+
selectionMask: z.ZodInt;
|
|
1758
|
+
strategy: z.ZodEnum<{
|
|
1759
|
+
static: "static";
|
|
1760
|
+
random: "random";
|
|
1761
|
+
discretionary: "discretionary";
|
|
1762
|
+
}>;
|
|
1763
|
+
}, z.core.$strip>]>>;
|
|
1627
1764
|
deployments: z.ZodArray<z.ZodObject<{
|
|
1628
1765
|
address: z.ZodString;
|
|
1629
1766
|
deployedUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
@@ -1765,6 +1902,10 @@ declare const zSseResponse: z.ZodIntersection<z.ZodObject<{
|
|
|
1765
1902
|
winnersCount: z.ZodInt;
|
|
1766
1903
|
winningTile: z.ZodOptional<z.ZodUnion<readonly [z.ZodInt, z.ZodNull]>>;
|
|
1767
1904
|
}, z.core.$strip>]>>;
|
|
1905
|
+
prices: z.ZodObject<{
|
|
1906
|
+
btc: z.ZodNumber;
|
|
1907
|
+
sat: z.ZodNumber;
|
|
1908
|
+
}, z.core.$strip>;
|
|
1768
1909
|
roundDuration: z.ZodInt;
|
|
1769
1910
|
roundId: z.ZodInt;
|
|
1770
1911
|
satsVault: z.ZodObject<{
|
|
@@ -1784,6 +1925,18 @@ declare const zSseResponse: z.ZodIntersection<z.ZodObject<{
|
|
|
1784
1925
|
state_snapshot: "state_snapshot";
|
|
1785
1926
|
}>;
|
|
1786
1927
|
profile: z.ZodOptional<z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
|
|
1928
|
+
automation: z.ZodOptional<z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
|
|
1929
|
+
address: z.ZodString;
|
|
1930
|
+
perRoundUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
1931
|
+
reload: z.ZodBoolean;
|
|
1932
|
+
remainingUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
1933
|
+
selectionMask: z.ZodInt;
|
|
1934
|
+
strategy: z.ZodEnum<{
|
|
1935
|
+
static: "static";
|
|
1936
|
+
random: "random";
|
|
1937
|
+
discretionary: "discretionary";
|
|
1938
|
+
}>;
|
|
1939
|
+
}, z.core.$strip>]>>;
|
|
1787
1940
|
deployments: z.ZodArray<z.ZodObject<{
|
|
1788
1941
|
address: z.ZodString;
|
|
1789
1942
|
deployedUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
@@ -1970,6 +2123,10 @@ declare const zGetBoardResponse: z.ZodObject<{
|
|
|
1970
2123
|
winnersCount: z.ZodInt;
|
|
1971
2124
|
winningTile: z.ZodOptional<z.ZodUnion<readonly [z.ZodInt, z.ZodNull]>>;
|
|
1972
2125
|
}, z.core.$strip>]>>;
|
|
2126
|
+
prices: z.ZodObject<{
|
|
2127
|
+
btc: z.ZodNumber;
|
|
2128
|
+
sat: z.ZodNumber;
|
|
2129
|
+
}, z.core.$strip>;
|
|
1973
2130
|
roundDuration: z.ZodInt;
|
|
1974
2131
|
roundId: z.ZodInt;
|
|
1975
2132
|
satsVault: z.ZodObject<{
|
|
@@ -2125,6 +2282,10 @@ declare const zSseResponse2: z.ZodIntersection<z.ZodObject<{
|
|
|
2125
2282
|
winnersCount: z.ZodInt;
|
|
2126
2283
|
winningTile: z.ZodOptional<z.ZodUnion<readonly [z.ZodInt, z.ZodNull]>>;
|
|
2127
2284
|
}, z.core.$strip>]>>;
|
|
2285
|
+
prices: z.ZodObject<{
|
|
2286
|
+
btc: z.ZodNumber;
|
|
2287
|
+
sat: z.ZodNumber;
|
|
2288
|
+
}, z.core.$strip>;
|
|
2128
2289
|
roundDuration: z.ZodInt;
|
|
2129
2290
|
roundId: z.ZodInt;
|
|
2130
2291
|
satsVault: z.ZodObject<{
|
|
@@ -2144,6 +2305,18 @@ declare const zSseResponse2: z.ZodIntersection<z.ZodObject<{
|
|
|
2144
2305
|
state_snapshot: "state_snapshot";
|
|
2145
2306
|
}>;
|
|
2146
2307
|
profile: z.ZodOptional<z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
|
|
2308
|
+
automation: z.ZodOptional<z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
|
|
2309
|
+
address: z.ZodString;
|
|
2310
|
+
perRoundUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
2311
|
+
reload: z.ZodBoolean;
|
|
2312
|
+
remainingUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
2313
|
+
selectionMask: z.ZodInt;
|
|
2314
|
+
strategy: z.ZodEnum<{
|
|
2315
|
+
static: "static";
|
|
2316
|
+
random: "random";
|
|
2317
|
+
discretionary: "discretionary";
|
|
2318
|
+
}>;
|
|
2319
|
+
}, z.core.$strip>]>>;
|
|
2147
2320
|
deployments: z.ZodArray<z.ZodObject<{
|
|
2148
2321
|
address: z.ZodString;
|
|
2149
2322
|
deployedUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
@@ -2186,6 +2359,18 @@ declare const zGetUserProfileData: z.ZodObject<{
|
|
|
2186
2359
|
}, z.core.$strip>;
|
|
2187
2360
|
declare const zGetUserProfileResponse: z.ZodObject<{
|
|
2188
2361
|
data: z.ZodObject<{
|
|
2362
|
+
automation: z.ZodOptional<z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
|
|
2363
|
+
address: z.ZodString;
|
|
2364
|
+
perRoundUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
2365
|
+
reload: z.ZodBoolean;
|
|
2366
|
+
remainingUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
2367
|
+
selectionMask: z.ZodInt;
|
|
2368
|
+
strategy: z.ZodEnum<{
|
|
2369
|
+
static: "static";
|
|
2370
|
+
random: "random";
|
|
2371
|
+
discretionary: "discretionary";
|
|
2372
|
+
}>;
|
|
2373
|
+
}, z.core.$strip>]>>;
|
|
2189
2374
|
deployments: z.ZodArray<z.ZodObject<{
|
|
2190
2375
|
address: z.ZodString;
|
|
2191
2376
|
deployedUsdAmount: z.ZodCoercedBigInt<unknown>;
|
|
@@ -2238,4 +2423,4 @@ declare class SatrushBackendSdkError<TCause = unknown> extends Error {
|
|
|
2238
2423
|
declare const satrushSdkErrorInterceptor: (error: unknown, response?: Response) => SatrushBackendSdkError<unknown>;
|
|
2239
2424
|
declare const isSatrushSdkError: <TCause = unknown>(error: unknown) => error is SatrushBackendSdkError<TCause>;
|
|
2240
2425
|
|
|
2241
|
-
export { type BadRequestErrorCodeErrorBody, type BoardDto, type ClientOptions, EpochStateDto, type EpochVaultDto, type EpochVaultEntryDto, type EpochVaultIterationDto, type EpochWinnerDto, type FieldError, type GetBoardData, type GetBoardError, type GetBoardErrors, type GetBoardResponse, type GetBoardResponseZodType, type GetBoardResponses, type GetConfigData, type GetConfigError, type GetConfigErrors, type GetConfigResponse, type GetConfigResponseZodType, type GetConfigResponses, type GetUserProfileData, type GetUserProfileError, type GetUserProfileErrors, type GetUserProfileResponse, type GetUserProfileResponseZodType, type GetUserProfileResponses, type I128Dto, type I64Dto, type InternalErrorCodeErrorBody, type MinerDto, NotificationEntity, OneBtcStateDto, type OneBtcVaultDto, type OneBtcVaultEntryDto, type OneBtcVaultIterationDto, type Options, type ProfileDto, type PubkeyDto, type PublicDeploymentDto, type RoundDto, RoundStateDto, SatrushBackendSdk, SatrushBackendSdkError, type SatrushConfigDto, type SatsVaultDto, type ServerSentEventsOptions, type ServerSentEventsResult, type SnapshotDto, type SseData, type SseError, type SseErrors, type SseResponse, type SseResponse2, type SseResponseSnapshot, type SseResponseZodType, type SseResponses, type StreamEvent, type StrikeJackpotDto, type TileStakeDto, type U128Dto, type U64Dto, type UserProfileApiError400Error, type UserProfileApiError400InvalidAddress, type ValidationErrorCodeErrorBody, type ValidationErrorCodeValidationDetailsErrorBody, createClient, createSseClient, isSatrushSdkError, satrushSdkErrorInterceptor, unwrap, zBadRequestErrorCodeErrorBody, zBoardDto, zEpochStateDto, zEpochVaultDto, zEpochVaultEntryDto, zEpochVaultIterationDto, zEpochWinnerDto, zFieldError, zGetBoardData, zGetBoardResponse, zGetConfigData, zGetConfigResponse, zGetUserProfileData, zGetUserProfileResponse, zI128Dto, zI64Dto, zInternalErrorCodeErrorBody, zMinerDto, zNotificationEntity, zOneBtcStateDto, zOneBtcVaultDto, zOneBtcVaultEntryDto, zOneBtcVaultIterationDto, zProfileDto, zPubkeyDto, zPublicDeploymentDto, zRoundDto, zRoundStateDto, zSatrushConfigDto, zSatsVaultDto, zSnapshotDto, zSseData, zSseResponse, zSseResponse2, zSseResponseSnapshot, zStrikeJackpotDto, zTileStakeDto, zU128Dto, zU64Dto, zUserProfileApiError400Error, zUserProfileApiError400InvalidAddress, zValidationErrorCodeErrorBody, zValidationErrorCodeValidationDetailsErrorBody };
|
|
2426
|
+
export { AutomationStrategyDto, type BadRequestErrorCodeErrorBody, type BoardDto, type ClientOptions, EpochStateDto, type EpochVaultDto, type EpochVaultEntryDto, type EpochVaultIterationDto, type EpochWinnerDto, type FieldError, type GetBoardData, type GetBoardError, type GetBoardErrors, type GetBoardResponse, type GetBoardResponseZodType, type GetBoardResponses, type GetConfigData, type GetConfigError, type GetConfigErrors, type GetConfigResponse, type GetConfigResponseZodType, type GetConfigResponses, type GetUserProfileData, type GetUserProfileError, type GetUserProfileErrors, type GetUserProfileResponse, type GetUserProfileResponseZodType, type GetUserProfileResponses, type I128Dto, type I64Dto, type InternalErrorCodeErrorBody, type MinerDto, NotificationEntity, OneBtcStateDto, type OneBtcVaultDto, type OneBtcVaultEntryDto, type OneBtcVaultIterationDto, type Options, type PricesDto, type ProfileDto, type PubkeyDto, type PublicAutomationDto, type PublicDeploymentDto, type RoundDto, RoundStateDto, SatrushBackendSdk, SatrushBackendSdkError, type SatrushConfigDto, type SatsVaultDto, type ServerSentEventsOptions, type ServerSentEventsResult, type SnapshotDto, type SseData, type SseError, type SseErrors, type SseResponse, type SseResponse2, type SseResponseSnapshot, type SseResponseZodType, type SseResponses, type StreamEvent, type StrikeJackpotDto, type TileStakeDto, type U128Dto, type U64Dto, type UserProfileApiError400Error, type UserProfileApiError400InvalidAddress, type ValidationErrorCodeErrorBody, type ValidationErrorCodeValidationDetailsErrorBody, createClient, createSseClient, isSatrushSdkError, satrushSdkErrorInterceptor, unwrap, zAutomationStrategyDto, zBadRequestErrorCodeErrorBody, zBoardDto, zEpochStateDto, zEpochVaultDto, zEpochVaultEntryDto, zEpochVaultIterationDto, zEpochWinnerDto, zFieldError, zGetBoardData, zGetBoardResponse, zGetConfigData, zGetConfigResponse, zGetUserProfileData, zGetUserProfileResponse, zI128Dto, zI64Dto, zInternalErrorCodeErrorBody, zMinerDto, zNotificationEntity, zOneBtcStateDto, zOneBtcVaultDto, zOneBtcVaultEntryDto, zOneBtcVaultIterationDto, zPricesDto, zProfileDto, zPubkeyDto, zPublicAutomationDto, zPublicDeploymentDto, zRoundDto, zRoundStateDto, zSatrushConfigDto, zSatsVaultDto, zSnapshotDto, zSseData, zSseResponse, zSseResponse2, zSseResponseSnapshot, zStrikeJackpotDto, zTileStakeDto, zU128Dto, zU64Dto, zUserProfileApiError400Error, zUserProfileApiError400InvalidAddress, zValidationErrorCodeErrorBody, zValidationErrorCodeValidationDetailsErrorBody };
|
package/dist/index.js
CHANGED
|
@@ -1044,6 +1044,11 @@ var getBoardResponseTransformer = async (data) => {
|
|
|
1044
1044
|
data.data = boardDtoSchemaResponseTransformer(data.data);
|
|
1045
1045
|
return data;
|
|
1046
1046
|
};
|
|
1047
|
+
var publicAutomationDtoSchemaResponseTransformer = (data) => {
|
|
1048
|
+
data.perRoundUsdAmount = u64DtoSchemaResponseTransformer(data.perRoundUsdAmount);
|
|
1049
|
+
data.remainingUsdAmount = u64DtoSchemaResponseTransformer(data.remainingUsdAmount);
|
|
1050
|
+
return data;
|
|
1051
|
+
};
|
|
1047
1052
|
var publicDeploymentDtoSchemaResponseTransformer = (data) => {
|
|
1048
1053
|
data.deployedUsdAmount = u64DtoSchemaResponseTransformer(data.deployedUsdAmount);
|
|
1049
1054
|
return data;
|
|
@@ -1064,6 +1069,9 @@ var oneBtcVaultEntryDtoSchemaResponseTransformer = (data) => {
|
|
|
1064
1069
|
return data;
|
|
1065
1070
|
};
|
|
1066
1071
|
var profileDtoSchemaResponseTransformer = (data) => {
|
|
1072
|
+
if (data.automation) {
|
|
1073
|
+
data.automation = publicAutomationDtoSchemaResponseTransformer(data.automation);
|
|
1074
|
+
}
|
|
1067
1075
|
data.deployments = data.deployments.map((item) => publicDeploymentDtoSchemaResponseTransformer(item));
|
|
1068
1076
|
data.epochVaultEntries = data.epochVaultEntries.map((item) => epochVaultEntryDtoSchemaResponseTransformer(item));
|
|
1069
1077
|
data.miner = minerDtoSchemaResponseTransformer(data.miner);
|
|
@@ -1096,6 +1104,11 @@ var getUserProfileResponseTransformer = async (data) => {
|
|
|
1096
1104
|
|
|
1097
1105
|
// src/generated/zod.gen.ts
|
|
1098
1106
|
import * as z from "zod";
|
|
1107
|
+
var zAutomationStrategyDto = z.enum([
|
|
1108
|
+
"static",
|
|
1109
|
+
"random",
|
|
1110
|
+
"discretionary"
|
|
1111
|
+
]);
|
|
1099
1112
|
var zBadRequestErrorCodeErrorBody = z.object({
|
|
1100
1113
|
code: z.enum([
|
|
1101
1114
|
"invalid_path",
|
|
@@ -1124,6 +1137,10 @@ var zOneBtcStateDto = z.enum([
|
|
|
1124
1137
|
"settled",
|
|
1125
1138
|
"complete"
|
|
1126
1139
|
]);
|
|
1140
|
+
var zPricesDto = z.object({
|
|
1141
|
+
btc: z.number(),
|
|
1142
|
+
sat: z.number()
|
|
1143
|
+
});
|
|
1127
1144
|
var zPubkeyDto = z.string().regex(/^[1-9A-HJ-NP-Za-km-z]+$/);
|
|
1128
1145
|
var zRoundStateDto = z.enum([
|
|
1129
1146
|
"active",
|
|
@@ -1234,6 +1251,14 @@ var zOneBtcVaultDto = z.object({
|
|
|
1234
1251
|
pendingUsdAmount: zU64Dto,
|
|
1235
1252
|
reservedBtcAmount: zU64Dto
|
|
1236
1253
|
});
|
|
1254
|
+
var zPublicAutomationDto = z.object({
|
|
1255
|
+
address: zPubkeyDto,
|
|
1256
|
+
perRoundUsdAmount: zU64Dto,
|
|
1257
|
+
reload: z.boolean(),
|
|
1258
|
+
remainingUsdAmount: zU64Dto,
|
|
1259
|
+
selectionMask: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1260
|
+
strategy: zAutomationStrategyDto
|
|
1261
|
+
});
|
|
1237
1262
|
var zPublicDeploymentDto = z.object({
|
|
1238
1263
|
address: zPubkeyDto,
|
|
1239
1264
|
deployedUsdAmount: zU64Dto,
|
|
@@ -1241,6 +1266,10 @@ var zPublicDeploymentDto = z.object({
|
|
|
1241
1266
|
selectionMask: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
1242
1267
|
});
|
|
1243
1268
|
var zProfileDto = z.object({
|
|
1269
|
+
automation: z.optional(z.union([
|
|
1270
|
+
z.null(),
|
|
1271
|
+
zPublicAutomationDto
|
|
1272
|
+
])),
|
|
1244
1273
|
deployments: z.array(zPublicDeploymentDto),
|
|
1245
1274
|
epochVaultEntries: z.array(zEpochVaultEntryDto),
|
|
1246
1275
|
miner: zMinerDto,
|
|
@@ -1295,6 +1324,7 @@ var zBoardDto = z.object({
|
|
|
1295
1324
|
z.null(),
|
|
1296
1325
|
zRoundDto
|
|
1297
1326
|
])),
|
|
1327
|
+
prices: zPricesDto,
|
|
1298
1328
|
roundDuration: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1299
1329
|
roundId: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1300
1330
|
satsVault: zSatsVaultDto,
|
|
@@ -1458,6 +1488,11 @@ var SatrushBackendSdk = class _SatrushBackendSdk extends HeyApiClient {
|
|
|
1458
1488
|
};
|
|
1459
1489
|
|
|
1460
1490
|
// src/generated/types.gen.ts
|
|
1491
|
+
var AutomationStrategyDto = {
|
|
1492
|
+
STATIC: "static",
|
|
1493
|
+
RANDOM: "random",
|
|
1494
|
+
DISCRETIONARY: "discretionary"
|
|
1495
|
+
};
|
|
1461
1496
|
var EpochStateDto = {
|
|
1462
1497
|
OPEN: "open",
|
|
1463
1498
|
SETTLING: "settling",
|
|
@@ -1522,6 +1557,7 @@ async function unwrap(promise) {
|
|
|
1522
1557
|
return unwrapData(res);
|
|
1523
1558
|
}
|
|
1524
1559
|
export {
|
|
1560
|
+
AutomationStrategyDto,
|
|
1525
1561
|
EpochStateDto,
|
|
1526
1562
|
NotificationEntity,
|
|
1527
1563
|
OneBtcStateDto,
|
|
@@ -1533,6 +1569,7 @@ export {
|
|
|
1533
1569
|
isSatrushSdkError,
|
|
1534
1570
|
satrushSdkErrorInterceptor,
|
|
1535
1571
|
unwrap,
|
|
1572
|
+
zAutomationStrategyDto,
|
|
1536
1573
|
zBadRequestErrorCodeErrorBody,
|
|
1537
1574
|
zBoardDto,
|
|
1538
1575
|
zEpochStateDto,
|
|
@@ -1556,8 +1593,10 @@ export {
|
|
|
1556
1593
|
zOneBtcVaultDto,
|
|
1557
1594
|
zOneBtcVaultEntryDto,
|
|
1558
1595
|
zOneBtcVaultIterationDto,
|
|
1596
|
+
zPricesDto,
|
|
1559
1597
|
zProfileDto,
|
|
1560
1598
|
zPubkeyDto,
|
|
1599
|
+
zPublicAutomationDto,
|
|
1561
1600
|
zPublicDeploymentDto,
|
|
1562
1601
|
zRoundDto,
|
|
1563
1602
|
zRoundStateDto,
|