@satrush/api 0.1.5 → 0.1.7
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 +380 -22
- package/dist/index.d.cts +874 -64
- package/dist/index.d.ts +874 -64
- package/dist/index.js +358 -22
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -987,6 +987,8 @@ var epochVaultDtoSchemaResponseTransformer = (data) => {
|
|
|
987
987
|
if (data.currentIteration) {
|
|
988
988
|
data.currentIteration = epochVaultIterationDtoSchemaResponseTransformer(data.currentIteration);
|
|
989
989
|
}
|
|
990
|
+
data.iterationEndsAt = new Date(data.iterationEndsAt);
|
|
991
|
+
data.iterationStartedAt = new Date(data.iterationStartedAt);
|
|
990
992
|
data.lastTriggerSlot = u64DtoSchemaResponseTransformer(data.lastTriggerSlot);
|
|
991
993
|
data.pendingUsdAmount = u64DtoSchemaResponseTransformer(data.pendingUsdAmount);
|
|
992
994
|
data.poolBtcAmount = u64DtoSchemaResponseTransformer(data.poolBtcAmount);
|
|
@@ -1020,6 +1022,9 @@ var satsVaultDtoSchemaResponseTransformer = (data) => {
|
|
|
1020
1022
|
};
|
|
1021
1023
|
var strikeJackpotDtoSchemaResponseTransformer = (data) => {
|
|
1022
1024
|
data.btcAmount = u64DtoSchemaResponseTransformer(data.btcAmount);
|
|
1025
|
+
if (data.lastTriggerAt) {
|
|
1026
|
+
data.lastTriggerAt = new Date(data.lastTriggerAt);
|
|
1027
|
+
}
|
|
1023
1028
|
data.pendingUsdAmount = u64DtoSchemaResponseTransformer(data.pendingUsdAmount);
|
|
1024
1029
|
data.usdAmount = u64DtoSchemaResponseTransformer(data.usdAmount);
|
|
1025
1030
|
return data;
|
|
@@ -1035,6 +1040,8 @@ var boardDtoSchemaResponseTransformer = (data) => {
|
|
|
1035
1040
|
if (data.previousRound) {
|
|
1036
1041
|
data.previousRound = roundDtoSchemaResponseTransformer(data.previousRound);
|
|
1037
1042
|
}
|
|
1043
|
+
data.roundEndsAt = new Date(data.roundEndsAt);
|
|
1044
|
+
data.roundStartedAt = new Date(data.roundStartedAt);
|
|
1038
1045
|
data.satsVault = satsVaultDtoSchemaResponseTransformer(data.satsVault);
|
|
1039
1046
|
data.startSlot = u64DtoSchemaResponseTransformer(data.startSlot);
|
|
1040
1047
|
data.strike = strikeJackpotDtoSchemaResponseTransformer(data.strike);
|
|
@@ -1044,13 +1051,29 @@ var getBoardResponseTransformer = async (data) => {
|
|
|
1044
1051
|
data.data = boardDtoSchemaResponseTransformer(data.data);
|
|
1045
1052
|
return data;
|
|
1046
1053
|
};
|
|
1054
|
+
var satrushConfigDtoSchemaResponseTransformer = (data) => {
|
|
1055
|
+
data.minDeployUsdAmount = u64DtoSchemaResponseTransformer(data.minDeployUsdAmount);
|
|
1056
|
+
return data;
|
|
1057
|
+
};
|
|
1058
|
+
var getConfigResponseTransformer = async (data) => {
|
|
1059
|
+
data.data = satrushConfigDtoSchemaResponseTransformer(data.data);
|
|
1060
|
+
return data;
|
|
1061
|
+
};
|
|
1062
|
+
var leaderboardEntryDtoSchemaResponseTransformer = (data) => {
|
|
1063
|
+
data.totalUsdDeployed = u64DtoSchemaResponseTransformer(data.totalUsdDeployed);
|
|
1064
|
+
return data;
|
|
1065
|
+
};
|
|
1066
|
+
var getLeaderboardResponseTransformer = async (data) => {
|
|
1067
|
+
data.data = data.data.map((item) => leaderboardEntryDtoSchemaResponseTransformer(item));
|
|
1068
|
+
return data;
|
|
1069
|
+
};
|
|
1047
1070
|
var publicAutomationDtoSchemaResponseTransformer = (data) => {
|
|
1048
1071
|
data.perRoundUsdAmount = u64DtoSchemaResponseTransformer(data.perRoundUsdAmount);
|
|
1049
1072
|
data.remainingUsdAmount = u64DtoSchemaResponseTransformer(data.remainingUsdAmount);
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
data.
|
|
1073
|
+
data.totalHashrateEarned = u64DtoSchemaResponseTransformer(data.totalHashrateEarned);
|
|
1074
|
+
data.totalSatsEarned = u64DtoSchemaResponseTransformer(data.totalSatsEarned);
|
|
1075
|
+
data.totalUsdDeployed = u64DtoSchemaResponseTransformer(data.totalUsdDeployed);
|
|
1076
|
+
data.totalUsdEarned = u64DtoSchemaResponseTransformer(data.totalUsdEarned);
|
|
1054
1077
|
return data;
|
|
1055
1078
|
};
|
|
1056
1079
|
var epochVaultEntryDtoSchemaResponseTransformer = (data) => {
|
|
@@ -1059,8 +1082,18 @@ var epochVaultEntryDtoSchemaResponseTransformer = (data) => {
|
|
|
1059
1082
|
};
|
|
1060
1083
|
var minerDtoSchemaResponseTransformer = (data) => {
|
|
1061
1084
|
data.hashrateAmount = u64DtoSchemaResponseTransformer(data.hashrateAmount);
|
|
1062
|
-
data.
|
|
1085
|
+
data.totalBtcReceived = u64DtoSchemaResponseTransformer(data.totalBtcReceived);
|
|
1086
|
+
data.totalHashrateEarned = u64DtoSchemaResponseTransformer(data.totalHashrateEarned);
|
|
1087
|
+
data.totalSatsClaimed = u64DtoSchemaResponseTransformer(data.totalSatsClaimed);
|
|
1088
|
+
data.totalSatsEarned = u64DtoSchemaResponseTransformer(data.totalSatsEarned);
|
|
1089
|
+
data.totalUsdClaimed = u64DtoSchemaResponseTransformer(data.totalUsdClaimed);
|
|
1090
|
+
data.totalUsdDeployed = u64DtoSchemaResponseTransformer(data.totalUsdDeployed);
|
|
1091
|
+
data.totalUsdEarned = u64DtoSchemaResponseTransformer(data.totalUsdEarned);
|
|
1092
|
+
data.unclaimedHashrateAmount = u64DtoSchemaResponseTransformer(data.unclaimedHashrateAmount);
|
|
1093
|
+
data.unclaimedSatsShares = u64DtoSchemaResponseTransformer(data.unclaimedSatsShares);
|
|
1063
1094
|
data.unclaimedUsdAmount = u64DtoSchemaResponseTransformer(data.unclaimedUsdAmount);
|
|
1095
|
+
data.unsettledSatsShares = u64DtoSchemaResponseTransformer(data.unsettledSatsShares);
|
|
1096
|
+
data.unsettledUsdAmount = u64DtoSchemaResponseTransformer(data.unsettledUsdAmount);
|
|
1064
1097
|
return data;
|
|
1065
1098
|
};
|
|
1066
1099
|
var oneBtcVaultEntryDtoSchemaResponseTransformer = (data) => {
|
|
@@ -1068,14 +1101,18 @@ var oneBtcVaultEntryDtoSchemaResponseTransformer = (data) => {
|
|
|
1068
1101
|
data.ticketsCount = u64DtoSchemaResponseTransformer(data.ticketsCount);
|
|
1069
1102
|
return data;
|
|
1070
1103
|
};
|
|
1104
|
+
var publicDeploymentDtoSchemaResponseTransformer = (data) => {
|
|
1105
|
+
data.deployedUsdAmount = u64DtoSchemaResponseTransformer(data.deployedUsdAmount);
|
|
1106
|
+
return data;
|
|
1107
|
+
};
|
|
1071
1108
|
var profileDtoSchemaResponseTransformer = (data) => {
|
|
1072
1109
|
if (data.automation) {
|
|
1073
1110
|
data.automation = publicAutomationDtoSchemaResponseTransformer(data.automation);
|
|
1074
1111
|
}
|
|
1075
|
-
data.deployments = data.deployments.map((item) => publicDeploymentDtoSchemaResponseTransformer(item));
|
|
1076
1112
|
data.epochVaultEntries = data.epochVaultEntries.map((item) => epochVaultEntryDtoSchemaResponseTransformer(item));
|
|
1077
1113
|
data.miner = minerDtoSchemaResponseTransformer(data.miner);
|
|
1078
1114
|
data.oneBtcVaultEntries = data.oneBtcVaultEntries.map((item) => oneBtcVaultEntryDtoSchemaResponseTransformer(item));
|
|
1115
|
+
data.unsettledDeployments = data.unsettledDeployments.map((item) => publicDeploymentDtoSchemaResponseTransformer(item));
|
|
1079
1116
|
return data;
|
|
1080
1117
|
};
|
|
1081
1118
|
var snapshotDtoSchemaResponseTransformer = (data) => {
|
|
@@ -1101,6 +1138,42 @@ var getUserProfileResponseTransformer = async (data) => {
|
|
|
1101
1138
|
data.data = profileDtoSchemaResponseTransformer(data.data);
|
|
1102
1139
|
return data;
|
|
1103
1140
|
};
|
|
1141
|
+
var minerClaimDtoSchemaResponseTransformer = (data) => {
|
|
1142
|
+
if (data.btcReceived) {
|
|
1143
|
+
data.btcReceived = u64DtoSchemaResponseTransformer(data.btcReceived);
|
|
1144
|
+
}
|
|
1145
|
+
data.claimedAt = new Date(data.claimedAt);
|
|
1146
|
+
if (data.hashrateClaimed) {
|
|
1147
|
+
data.hashrateClaimed = u64DtoSchemaResponseTransformer(data.hashrateClaimed);
|
|
1148
|
+
}
|
|
1149
|
+
if (data.satsClaimed) {
|
|
1150
|
+
data.satsClaimed = u64DtoSchemaResponseTransformer(data.satsClaimed);
|
|
1151
|
+
}
|
|
1152
|
+
if (data.usdClaimed) {
|
|
1153
|
+
data.usdClaimed = u64DtoSchemaResponseTransformer(data.usdClaimed);
|
|
1154
|
+
}
|
|
1155
|
+
return data;
|
|
1156
|
+
};
|
|
1157
|
+
var getUserClaimsResponseTransformer = async (data) => {
|
|
1158
|
+
data.data = data.data.map((item) => minerClaimDtoSchemaResponseTransformer(item));
|
|
1159
|
+
return data;
|
|
1160
|
+
};
|
|
1161
|
+
var minerDeploymentDtoSchemaResponseTransformer = (data) => {
|
|
1162
|
+
data.deployedAt = new Date(data.deployedAt);
|
|
1163
|
+
data.deployedUsdAmount = u64DtoSchemaResponseTransformer(data.deployedUsdAmount);
|
|
1164
|
+
data.hashrateEarned = u64DtoSchemaResponseTransformer(data.hashrateEarned);
|
|
1165
|
+
data.satsSharesEarned = u64DtoSchemaResponseTransformer(data.satsSharesEarned);
|
|
1166
|
+
if (data.settledAt) {
|
|
1167
|
+
data.settledAt = new Date(data.settledAt);
|
|
1168
|
+
}
|
|
1169
|
+
data.totalUsdStakeAmount = u64DtoSchemaResponseTransformer(data.totalUsdStakeAmount);
|
|
1170
|
+
data.usdEarned = u64DtoSchemaResponseTransformer(data.usdEarned);
|
|
1171
|
+
return data;
|
|
1172
|
+
};
|
|
1173
|
+
var getUserDeploymentsResponseTransformer = async (data) => {
|
|
1174
|
+
data.data = data.data.map((item) => minerDeploymentDtoSchemaResponseTransformer(item));
|
|
1175
|
+
return data;
|
|
1176
|
+
};
|
|
1104
1177
|
|
|
1105
1178
|
// src/generated/zod.gen.ts
|
|
1106
1179
|
import * as z from "zod";
|
|
@@ -1116,6 +1189,7 @@ var zBadRequestErrorCodeErrorBody = z.object({
|
|
|
1116
1189
|
"invalid_body"
|
|
1117
1190
|
])
|
|
1118
1191
|
});
|
|
1192
|
+
var zClaimTypeDto = z.enum(["usd", "sats"]);
|
|
1119
1193
|
var zEpochStateDto = z.enum([
|
|
1120
1194
|
"open",
|
|
1121
1195
|
"settling",
|
|
@@ -1137,6 +1211,10 @@ var zOneBtcStateDto = z.enum([
|
|
|
1137
1211
|
"settled",
|
|
1138
1212
|
"complete"
|
|
1139
1213
|
]);
|
|
1214
|
+
var zPreviousRoundDto = z.object({
|
|
1215
|
+
roundId: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1216
|
+
winningTile: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
1217
|
+
});
|
|
1140
1218
|
var zPricesDto = z.object({
|
|
1141
1219
|
btc: z.number(),
|
|
1142
1220
|
sat: z.number()
|
|
@@ -1148,17 +1226,6 @@ var zRoundStateDto = z.enum([
|
|
|
1148
1226
|
"settled",
|
|
1149
1227
|
"finished"
|
|
1150
1228
|
]);
|
|
1151
|
-
var zSatrushConfigDto = z.object({
|
|
1152
|
-
address: zPubkeyDto,
|
|
1153
|
-
btcMint: zPubkeyDto,
|
|
1154
|
-
epochFeeBps: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1155
|
-
oneBtcFeeBps: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1156
|
-
protocolFeeBps: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1157
|
-
satsVaultClaimFeeBps: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1158
|
-
satsVaultRoundFeeBps: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1159
|
-
strikeFeeBps: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1160
|
-
usdMint: zPubkeyDto
|
|
1161
|
-
});
|
|
1162
1229
|
var zU128Dto = z.string();
|
|
1163
1230
|
var zU64Dto = z.coerce.bigint().min(BigInt("0"), { error: "Invalid value: Expected uint64 to be >= 0" }).max(BigInt("18446744073709551615"), { error: "Invalid value: Expected uint64 to be <= 18446744073709551615" });
|
|
1164
1231
|
var zEpochVaultEntryDto = z.object({
|
|
@@ -1206,7 +1273,9 @@ var zEpochVaultDto = z.object({
|
|
|
1206
1273
|
z.null(),
|
|
1207
1274
|
zEpochVaultIterationDto
|
|
1208
1275
|
])),
|
|
1276
|
+
iterationEndsAt: z.preprocess((value) => value instanceof Date ? value.toISOString() : value, z.iso.datetime()),
|
|
1209
1277
|
iterationId: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1278
|
+
iterationStartedAt: z.preprocess((value) => value instanceof Date ? value.toISOString() : value, z.iso.datetime()),
|
|
1210
1279
|
lastTriggerSlot: zU64Dto,
|
|
1211
1280
|
pendingUsdAmount: zU64Dto,
|
|
1212
1281
|
poolBtcAmount: zU64Dto,
|
|
@@ -1214,13 +1283,83 @@ var zEpochVaultDto = z.object({
|
|
|
1214
1283
|
reservedBtcAmount: zU64Dto,
|
|
1215
1284
|
reservedUsdAmount: zU64Dto
|
|
1216
1285
|
});
|
|
1286
|
+
var zLeaderboardEntryDto = z.object({
|
|
1287
|
+
authority: zPubkeyDto,
|
|
1288
|
+
maxStreak: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1289
|
+
rank: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1290
|
+
totalRoundsPlayed: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1291
|
+
totalUsdDeployed: zU64Dto
|
|
1292
|
+
});
|
|
1293
|
+
var zMinerClaimDto = z.object({
|
|
1294
|
+
authority: zPubkeyDto,
|
|
1295
|
+
btcReceived: z.optional(z.union([
|
|
1296
|
+
z.null(),
|
|
1297
|
+
zU64Dto
|
|
1298
|
+
])),
|
|
1299
|
+
claimType: zClaimTypeDto,
|
|
1300
|
+
claimedAt: z.preprocess((value) => value instanceof Date ? value.toISOString() : value, z.iso.datetime()),
|
|
1301
|
+
hashrateClaimed: z.optional(z.union([
|
|
1302
|
+
z.null(),
|
|
1303
|
+
zU64Dto
|
|
1304
|
+
])),
|
|
1305
|
+
id: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1306
|
+
satsClaimed: z.optional(z.union([
|
|
1307
|
+
z.null(),
|
|
1308
|
+
zU64Dto
|
|
1309
|
+
])),
|
|
1310
|
+
signature: z.string(),
|
|
1311
|
+
usdClaimed: z.optional(z.union([
|
|
1312
|
+
z.null(),
|
|
1313
|
+
zU64Dto
|
|
1314
|
+
]))
|
|
1315
|
+
});
|
|
1316
|
+
var zMinerDeploymentDto = z.object({
|
|
1317
|
+
authority: zPubkeyDto,
|
|
1318
|
+
deployedAt: z.preprocess((value) => value instanceof Date ? value.toISOString() : value, z.iso.datetime()),
|
|
1319
|
+
deployedUsdAmount: zU64Dto,
|
|
1320
|
+
deployment: zPubkeyDto,
|
|
1321
|
+
hashrateEarned: zU64Dto,
|
|
1322
|
+
isAutomation: z.boolean(),
|
|
1323
|
+
isReload: z.optional(z.union([
|
|
1324
|
+
z.boolean(),
|
|
1325
|
+
z.null()
|
|
1326
|
+
])),
|
|
1327
|
+
isWon: z.optional(z.union([
|
|
1328
|
+
z.boolean(),
|
|
1329
|
+
z.null()
|
|
1330
|
+
])),
|
|
1331
|
+
roundId: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1332
|
+
satsSharesEarned: zU64Dto,
|
|
1333
|
+
selectedTiles: z.optional(z.union([
|
|
1334
|
+
z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1335
|
+
z.null()
|
|
1336
|
+
])),
|
|
1337
|
+
settledAt: z.optional(z.union([
|
|
1338
|
+
z.preprocess((value) => value instanceof Date ? value.toISOString() : value, z.iso.datetime()),
|
|
1339
|
+
z.null()
|
|
1340
|
+
])),
|
|
1341
|
+
totalUsdStakeAmount: zU64Dto,
|
|
1342
|
+
usdEarned: zU64Dto
|
|
1343
|
+
});
|
|
1217
1344
|
var zMinerDto = z.object({
|
|
1218
1345
|
authority: zPubkeyDto,
|
|
1219
1346
|
currentStreakCount: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1220
1347
|
hashrateAmount: zU64Dto,
|
|
1221
1348
|
lastMinedRoundId: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1222
|
-
|
|
1223
|
-
|
|
1349
|
+
maxStreak: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1350
|
+
totalBtcReceived: zU64Dto,
|
|
1351
|
+
totalHashrateEarned: zU64Dto,
|
|
1352
|
+
totalRounds: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1353
|
+
totalSatsClaimed: zU64Dto,
|
|
1354
|
+
totalSatsEarned: zU64Dto,
|
|
1355
|
+
totalUsdClaimed: zU64Dto,
|
|
1356
|
+
totalUsdDeployed: zU64Dto,
|
|
1357
|
+
totalUsdEarned: zU64Dto,
|
|
1358
|
+
unclaimedHashrateAmount: zU64Dto,
|
|
1359
|
+
unclaimedSatsShares: zU64Dto,
|
|
1360
|
+
unclaimedUsdAmount: zU64Dto,
|
|
1361
|
+
unsettledSatsShares: zU64Dto,
|
|
1362
|
+
unsettledUsdAmount: zU64Dto
|
|
1224
1363
|
});
|
|
1225
1364
|
var zOneBtcVaultEntryDto = z.object({
|
|
1226
1365
|
address: zPubkeyDto,
|
|
@@ -1253,11 +1392,17 @@ var zOneBtcVaultDto = z.object({
|
|
|
1253
1392
|
});
|
|
1254
1393
|
var zPublicAutomationDto = z.object({
|
|
1255
1394
|
address: zPubkeyDto,
|
|
1395
|
+
executedDeployments: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1256
1396
|
perRoundUsdAmount: zU64Dto,
|
|
1257
1397
|
reload: z.boolean(),
|
|
1398
|
+
remainingDeployments: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1258
1399
|
remainingUsdAmount: zU64Dto,
|
|
1259
1400
|
selectionMask: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1260
|
-
strategy: zAutomationStrategyDto
|
|
1401
|
+
strategy: zAutomationStrategyDto,
|
|
1402
|
+
totalHashrateEarned: zU64Dto,
|
|
1403
|
+
totalSatsEarned: zU64Dto,
|
|
1404
|
+
totalUsdDeployed: zU64Dto,
|
|
1405
|
+
totalUsdEarned: zU64Dto
|
|
1261
1406
|
});
|
|
1262
1407
|
var zPublicDeploymentDto = z.object({
|
|
1263
1408
|
address: zPubkeyDto,
|
|
@@ -1270,10 +1415,24 @@ var zProfileDto = z.object({
|
|
|
1270
1415
|
z.null(),
|
|
1271
1416
|
zPublicAutomationDto
|
|
1272
1417
|
])),
|
|
1273
|
-
deployments: z.array(zPublicDeploymentDto),
|
|
1274
1418
|
epochVaultEntries: z.array(zEpochVaultEntryDto),
|
|
1275
1419
|
miner: zMinerDto,
|
|
1276
|
-
oneBtcVaultEntries: z.array(zOneBtcVaultEntryDto)
|
|
1420
|
+
oneBtcVaultEntries: z.array(zOneBtcVaultEntryDto),
|
|
1421
|
+
unsettledDeployments: z.array(zPublicDeploymentDto)
|
|
1422
|
+
});
|
|
1423
|
+
var zSatrushConfigDto = z.object({
|
|
1424
|
+
address: zPubkeyDto,
|
|
1425
|
+
btcMint: zPubkeyDto,
|
|
1426
|
+
epochFeeBps: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1427
|
+
epochVaultIterationDuration: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1428
|
+
minDeployUsdAmount: zU64Dto,
|
|
1429
|
+
oneBtcFeeBps: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1430
|
+
protocolFeeBps: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1431
|
+
satsVaultClaimFeeBps: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1432
|
+
satsVaultRoundFeeBps: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1433
|
+
strikeFeeBps: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1434
|
+
unclaimedHashrateBps: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1435
|
+
usdMint: zPubkeyDto
|
|
1277
1436
|
});
|
|
1278
1437
|
var zSatsVaultDto = z.object({
|
|
1279
1438
|
address: zPubkeyDto,
|
|
@@ -1282,6 +1441,10 @@ var zSatsVaultDto = z.object({
|
|
|
1282
1441
|
});
|
|
1283
1442
|
var zStrikeJackpotDto = z.object({
|
|
1284
1443
|
btcAmount: zU64Dto,
|
|
1444
|
+
lastTriggerAt: z.optional(z.union([
|
|
1445
|
+
z.preprocess((value) => value instanceof Date ? value.toISOString() : value, z.iso.datetime()),
|
|
1446
|
+
z.null()
|
|
1447
|
+
])),
|
|
1285
1448
|
lastTriggerRoundId: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1286
1449
|
pendingUsdAmount: zU64Dto,
|
|
1287
1450
|
usdAmount: zU64Dto
|
|
@@ -1324,9 +1487,12 @@ var zBoardDto = z.object({
|
|
|
1324
1487
|
z.null(),
|
|
1325
1488
|
zRoundDto
|
|
1326
1489
|
])),
|
|
1490
|
+
previousRounds: z.array(zPreviousRoundDto),
|
|
1327
1491
|
prices: zPricesDto,
|
|
1328
1492
|
roundDuration: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1493
|
+
roundEndsAt: z.preprocess((value) => value instanceof Date ? value.toISOString() : value, z.iso.datetime()),
|
|
1329
1494
|
roundId: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1495
|
+
roundStartedAt: z.preprocess((value) => value instanceof Date ? value.toISOString() : value, z.iso.datetime()),
|
|
1330
1496
|
satsVault: zSatsVaultDto,
|
|
1331
1497
|
startSlot: zU64Dto,
|
|
1332
1498
|
strike: zStrikeJackpotDto
|
|
@@ -1345,6 +1511,66 @@ var zSseResponseSnapshot = zSnapshotDto.and(z.object({
|
|
|
1345
1511
|
var zSseResponse = z.object({
|
|
1346
1512
|
entity: z.literal("state_snapshot")
|
|
1347
1513
|
}).and(zSseResponseSnapshot);
|
|
1514
|
+
var zUserClaimsApiError400InvalidAddress = z.object({
|
|
1515
|
+
code: z.enum(["invalid_address"])
|
|
1516
|
+
});
|
|
1517
|
+
var zUserClaimsApiError400InvalidBefore = z.object({
|
|
1518
|
+
code: z.enum(["invalid_before"])
|
|
1519
|
+
});
|
|
1520
|
+
var zUserClaimsApiError400InvalidRange = z.object({
|
|
1521
|
+
code: z.enum(["invalid_range"])
|
|
1522
|
+
});
|
|
1523
|
+
var zUserClaimsApiError400Error = z.union([
|
|
1524
|
+
z.object({
|
|
1525
|
+
code: z.literal("invalid_address")
|
|
1526
|
+
}).and(zUserClaimsApiError400InvalidAddress),
|
|
1527
|
+
z.object({
|
|
1528
|
+
code: z.literal("invalid_before")
|
|
1529
|
+
}).and(zUserClaimsApiError400InvalidBefore),
|
|
1530
|
+
z.object({
|
|
1531
|
+
code: z.literal("invalid_range")
|
|
1532
|
+
}).and(zUserClaimsApiError400InvalidRange),
|
|
1533
|
+
z.object({
|
|
1534
|
+
code: z.union([
|
|
1535
|
+
z.literal("invalid_body"),
|
|
1536
|
+
z.literal("invalid_path"),
|
|
1537
|
+
z.literal("invalid_query")
|
|
1538
|
+
])
|
|
1539
|
+
}).and(zBadRequestErrorCodeErrorBody)
|
|
1540
|
+
]);
|
|
1541
|
+
var zUserClaimsApiError500Error = z.object({
|
|
1542
|
+
code: z.enum(["internal"])
|
|
1543
|
+
});
|
|
1544
|
+
var zUserDeploymentsApiError400InvalidAddress = z.object({
|
|
1545
|
+
code: z.enum(["invalid_address"])
|
|
1546
|
+
});
|
|
1547
|
+
var zUserDeploymentsApiError400InvalidBefore = z.object({
|
|
1548
|
+
code: z.enum(["invalid_before"])
|
|
1549
|
+
});
|
|
1550
|
+
var zUserDeploymentsApiError400InvalidRange = z.object({
|
|
1551
|
+
code: z.enum(["invalid_range"])
|
|
1552
|
+
});
|
|
1553
|
+
var zUserDeploymentsApiError400Error = z.union([
|
|
1554
|
+
z.object({
|
|
1555
|
+
code: z.literal("invalid_address")
|
|
1556
|
+
}).and(zUserDeploymentsApiError400InvalidAddress),
|
|
1557
|
+
z.object({
|
|
1558
|
+
code: z.literal("invalid_before")
|
|
1559
|
+
}).and(zUserDeploymentsApiError400InvalidBefore),
|
|
1560
|
+
z.object({
|
|
1561
|
+
code: z.literal("invalid_range")
|
|
1562
|
+
}).and(zUserDeploymentsApiError400InvalidRange),
|
|
1563
|
+
z.object({
|
|
1564
|
+
code: z.union([
|
|
1565
|
+
z.literal("invalid_body"),
|
|
1566
|
+
z.literal("invalid_path"),
|
|
1567
|
+
z.literal("invalid_query")
|
|
1568
|
+
])
|
|
1569
|
+
}).and(zBadRequestErrorCodeErrorBody)
|
|
1570
|
+
]);
|
|
1571
|
+
var zUserDeploymentsApiError500Error = z.object({
|
|
1572
|
+
code: z.enum(["internal"])
|
|
1573
|
+
});
|
|
1348
1574
|
var zUserProfileApiError400InvalidAddress = z.object({
|
|
1349
1575
|
code: z.enum(["invalid_address"])
|
|
1350
1576
|
});
|
|
@@ -1388,6 +1614,14 @@ var zGetConfigData = z.object({
|
|
|
1388
1614
|
var zGetConfigResponse = z.object({
|
|
1389
1615
|
data: zSatrushConfigDto
|
|
1390
1616
|
});
|
|
1617
|
+
var zGetLeaderboardData = z.object({
|
|
1618
|
+
body: z.optional(z.never()),
|
|
1619
|
+
path: z.optional(z.never()),
|
|
1620
|
+
query: z.optional(z.never())
|
|
1621
|
+
});
|
|
1622
|
+
var zGetLeaderboardResponse = z.object({
|
|
1623
|
+
data: z.array(zLeaderboardEntryDto)
|
|
1624
|
+
});
|
|
1391
1625
|
var zSseData = z.object({
|
|
1392
1626
|
body: z.optional(z.never()),
|
|
1393
1627
|
path: z.optional(z.never()),
|
|
@@ -1406,6 +1640,34 @@ var zGetUserProfileData = z.object({
|
|
|
1406
1640
|
var zGetUserProfileResponse = z.object({
|
|
1407
1641
|
data: zProfileDto
|
|
1408
1642
|
});
|
|
1643
|
+
var zGetUserClaimsData = z.object({
|
|
1644
|
+
body: z.optional(z.never()),
|
|
1645
|
+
path: z.object({
|
|
1646
|
+
address: z.string()
|
|
1647
|
+
}),
|
|
1648
|
+
query: z.optional(z.object({
|
|
1649
|
+
before: z.optional(z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })),
|
|
1650
|
+
after: z.optional(z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })),
|
|
1651
|
+
limit: z.optional(z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }))
|
|
1652
|
+
}))
|
|
1653
|
+
});
|
|
1654
|
+
var zGetUserClaimsResponse = z.object({
|
|
1655
|
+
data: z.array(zMinerClaimDto)
|
|
1656
|
+
});
|
|
1657
|
+
var zGetUserDeploymentsData = z.object({
|
|
1658
|
+
body: z.optional(z.never()),
|
|
1659
|
+
path: z.object({
|
|
1660
|
+
address: z.string()
|
|
1661
|
+
}),
|
|
1662
|
+
query: z.optional(z.object({
|
|
1663
|
+
before: z.optional(z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })),
|
|
1664
|
+
after: z.optional(z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })),
|
|
1665
|
+
limit: z.optional(z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }))
|
|
1666
|
+
}))
|
|
1667
|
+
});
|
|
1668
|
+
var zGetUserDeploymentsResponse = z.object({
|
|
1669
|
+
data: z.array(zMinerDeploymentDto)
|
|
1670
|
+
});
|
|
1409
1671
|
|
|
1410
1672
|
// src/generated/sdk.gen.ts
|
|
1411
1673
|
var HeyApiClient = class {
|
|
@@ -1452,11 +1714,24 @@ var SatrushBackendSdk = class _SatrushBackendSdk extends HeyApiClient {
|
|
|
1452
1714
|
getConfig(options) {
|
|
1453
1715
|
return (options?.client ?? this.client).get({
|
|
1454
1716
|
requestValidator: async (data) => await zGetConfigData.parseAsync(data),
|
|
1717
|
+
responseTransformer: getConfigResponseTransformer,
|
|
1455
1718
|
responseValidator: async (data) => await zGetConfigResponse.parseAsync(data),
|
|
1456
1719
|
url: "/v1/config",
|
|
1457
1720
|
...options
|
|
1458
1721
|
});
|
|
1459
1722
|
}
|
|
1723
|
+
/**
|
|
1724
|
+
* Request the top miners by lifetime USD deployed
|
|
1725
|
+
*/
|
|
1726
|
+
getLeaderboard(options) {
|
|
1727
|
+
return (options?.client ?? this.client).get({
|
|
1728
|
+
requestValidator: async (data) => await zGetLeaderboardData.parseAsync(data),
|
|
1729
|
+
responseTransformer: getLeaderboardResponseTransformer,
|
|
1730
|
+
responseValidator: async (data) => await zGetLeaderboardResponse.parseAsync(data),
|
|
1731
|
+
url: "/v1/leaderboard",
|
|
1732
|
+
...options
|
|
1733
|
+
});
|
|
1734
|
+
}
|
|
1460
1735
|
/**
|
|
1461
1736
|
* Subscribe for SSE stream
|
|
1462
1737
|
*/
|
|
@@ -1485,6 +1760,44 @@ var SatrushBackendSdk = class _SatrushBackendSdk extends HeyApiClient {
|
|
|
1485
1760
|
...params
|
|
1486
1761
|
});
|
|
1487
1762
|
}
|
|
1763
|
+
/**
|
|
1764
|
+
* Request user claims
|
|
1765
|
+
*/
|
|
1766
|
+
getUserClaims(parameters, options) {
|
|
1767
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
1768
|
+
{ in: "path", key: "address" },
|
|
1769
|
+
{ in: "query", key: "before" },
|
|
1770
|
+
{ in: "query", key: "after" },
|
|
1771
|
+
{ in: "query", key: "limit" }
|
|
1772
|
+
] }]);
|
|
1773
|
+
return (options?.client ?? this.client).get({
|
|
1774
|
+
requestValidator: async (data) => await zGetUserClaimsData.parseAsync(data),
|
|
1775
|
+
responseTransformer: getUserClaimsResponseTransformer,
|
|
1776
|
+
responseValidator: async (data) => await zGetUserClaimsResponse.parseAsync(data),
|
|
1777
|
+
url: "/v1/users/{address}/claims",
|
|
1778
|
+
...options,
|
|
1779
|
+
...params
|
|
1780
|
+
});
|
|
1781
|
+
}
|
|
1782
|
+
/**
|
|
1783
|
+
* Request user deployments
|
|
1784
|
+
*/
|
|
1785
|
+
getUserDeployments(parameters, options) {
|
|
1786
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
1787
|
+
{ in: "path", key: "address" },
|
|
1788
|
+
{ in: "query", key: "before" },
|
|
1789
|
+
{ in: "query", key: "after" },
|
|
1790
|
+
{ in: "query", key: "limit" }
|
|
1791
|
+
] }]);
|
|
1792
|
+
return (options?.client ?? this.client).get({
|
|
1793
|
+
requestValidator: async (data) => await zGetUserDeploymentsData.parseAsync(data),
|
|
1794
|
+
responseTransformer: getUserDeploymentsResponseTransformer,
|
|
1795
|
+
responseValidator: async (data) => await zGetUserDeploymentsResponse.parseAsync(data),
|
|
1796
|
+
url: "/v1/users/{address}/deployments",
|
|
1797
|
+
...options,
|
|
1798
|
+
...params
|
|
1799
|
+
});
|
|
1800
|
+
}
|
|
1488
1801
|
};
|
|
1489
1802
|
|
|
1490
1803
|
// src/generated/types.gen.ts
|
|
@@ -1493,6 +1806,7 @@ var AutomationStrategyDto = {
|
|
|
1493
1806
|
RANDOM: "random",
|
|
1494
1807
|
DISCRETIONARY: "discretionary"
|
|
1495
1808
|
};
|
|
1809
|
+
var ClaimTypeDto = { USD: "usd", SATS: "sats" };
|
|
1496
1810
|
var EpochStateDto = {
|
|
1497
1811
|
OPEN: "open",
|
|
1498
1812
|
SETTLING: "settling",
|
|
@@ -1558,6 +1872,7 @@ async function unwrap(promise) {
|
|
|
1558
1872
|
}
|
|
1559
1873
|
export {
|
|
1560
1874
|
AutomationStrategyDto,
|
|
1875
|
+
ClaimTypeDto,
|
|
1561
1876
|
EpochStateDto,
|
|
1562
1877
|
NotificationEntity,
|
|
1563
1878
|
OneBtcStateDto,
|
|
@@ -1572,6 +1887,7 @@ export {
|
|
|
1572
1887
|
zAutomationStrategyDto,
|
|
1573
1888
|
zBadRequestErrorCodeErrorBody,
|
|
1574
1889
|
zBoardDto,
|
|
1890
|
+
zClaimTypeDto,
|
|
1575
1891
|
zEpochStateDto,
|
|
1576
1892
|
zEpochVaultDto,
|
|
1577
1893
|
zEpochVaultEntryDto,
|
|
@@ -1582,17 +1898,27 @@ export {
|
|
|
1582
1898
|
zGetBoardResponse,
|
|
1583
1899
|
zGetConfigData,
|
|
1584
1900
|
zGetConfigResponse,
|
|
1901
|
+
zGetLeaderboardData,
|
|
1902
|
+
zGetLeaderboardResponse,
|
|
1903
|
+
zGetUserClaimsData,
|
|
1904
|
+
zGetUserClaimsResponse,
|
|
1905
|
+
zGetUserDeploymentsData,
|
|
1906
|
+
zGetUserDeploymentsResponse,
|
|
1585
1907
|
zGetUserProfileData,
|
|
1586
1908
|
zGetUserProfileResponse,
|
|
1587
1909
|
zI128Dto,
|
|
1588
1910
|
zI64Dto,
|
|
1589
1911
|
zInternalErrorCodeErrorBody,
|
|
1912
|
+
zLeaderboardEntryDto,
|
|
1913
|
+
zMinerClaimDto,
|
|
1914
|
+
zMinerDeploymentDto,
|
|
1590
1915
|
zMinerDto,
|
|
1591
1916
|
zNotificationEntity,
|
|
1592
1917
|
zOneBtcStateDto,
|
|
1593
1918
|
zOneBtcVaultDto,
|
|
1594
1919
|
zOneBtcVaultEntryDto,
|
|
1595
1920
|
zOneBtcVaultIterationDto,
|
|
1921
|
+
zPreviousRoundDto,
|
|
1596
1922
|
zPricesDto,
|
|
1597
1923
|
zProfileDto,
|
|
1598
1924
|
zPubkeyDto,
|
|
@@ -1611,6 +1937,16 @@ export {
|
|
|
1611
1937
|
zTileStakeDto,
|
|
1612
1938
|
zU128Dto,
|
|
1613
1939
|
zU64Dto,
|
|
1940
|
+
zUserClaimsApiError400Error,
|
|
1941
|
+
zUserClaimsApiError400InvalidAddress,
|
|
1942
|
+
zUserClaimsApiError400InvalidBefore,
|
|
1943
|
+
zUserClaimsApiError400InvalidRange,
|
|
1944
|
+
zUserClaimsApiError500Error,
|
|
1945
|
+
zUserDeploymentsApiError400Error,
|
|
1946
|
+
zUserDeploymentsApiError400InvalidAddress,
|
|
1947
|
+
zUserDeploymentsApiError400InvalidBefore,
|
|
1948
|
+
zUserDeploymentsApiError400InvalidRange,
|
|
1949
|
+
zUserDeploymentsApiError500Error,
|
|
1614
1950
|
zUserProfileApiError400Error,
|
|
1615
1951
|
zUserProfileApiError400InvalidAddress,
|
|
1616
1952
|
zValidationErrorCodeErrorBody,
|