@satrush/api 0.1.1 → 0.1.3
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 +327 -43
- package/dist/index.d.cts +1226 -38
- package/dist/index.d.ts +1226 -38
- package/dist/index.js +308 -43
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -104,6 +104,55 @@ var buildClientParams = (args, fields) => {
|
|
|
104
104
|
return params;
|
|
105
105
|
};
|
|
106
106
|
|
|
107
|
+
// src/utils/sse.ts
|
|
108
|
+
var isRecord = (value) => !!value && typeof value === "object" && !Array.isArray(value);
|
|
109
|
+
var applySseResponseTransforms = async (payload) => {
|
|
110
|
+
if (!isRecord(payload)) return payload;
|
|
111
|
+
return payload;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// src/utils/transforms.ts
|
|
115
|
+
var snakeToCamel = (value) => value.replace(/_([a-z0-9])/g, (_, c) => c.toUpperCase());
|
|
116
|
+
var camelToSnake = (value) => value.replace(/[A-Z]/g, (c) => `_${c.toLowerCase()}`);
|
|
117
|
+
var isPlainObject = (value) => !!value && typeof value === "object" && Object.getPrototypeOf(value) === Object.prototype;
|
|
118
|
+
var mapKeysDeep = (value, mapKey) => {
|
|
119
|
+
if (Array.isArray(value)) {
|
|
120
|
+
return value.map((item) => mapKeysDeep(item, mapKey));
|
|
121
|
+
}
|
|
122
|
+
if (isPlainObject(value)) {
|
|
123
|
+
const next = {};
|
|
124
|
+
for (const [key, val] of Object.entries(value)) {
|
|
125
|
+
next[mapKey(key)] = mapKeysDeep(val, mapKey);
|
|
126
|
+
}
|
|
127
|
+
return next;
|
|
128
|
+
}
|
|
129
|
+
return value;
|
|
130
|
+
};
|
|
131
|
+
var shouldTransformBody = (value) => isPlainObject(value) || Array.isArray(value);
|
|
132
|
+
var snakecaseQuerySerializerParams = (value) => {
|
|
133
|
+
if (!isPlainObject(value)) return value;
|
|
134
|
+
if (!isPlainObject(value.parameters)) return value;
|
|
135
|
+
const nextParameters = {};
|
|
136
|
+
for (const [key, param] of Object.entries(value.parameters)) {
|
|
137
|
+
nextParameters[camelToSnake(key)] = param;
|
|
138
|
+
}
|
|
139
|
+
return { ...value, parameters: nextParameters };
|
|
140
|
+
};
|
|
141
|
+
var applyRequestCaseTransforms = (options) => {
|
|
142
|
+
const next = { ...options };
|
|
143
|
+
if ("query" in next && isPlainObject(next.query)) {
|
|
144
|
+
next.query = mapKeysDeep(next.query, camelToSnake);
|
|
145
|
+
}
|
|
146
|
+
if ("querySerializer" in next && next.querySerializer) {
|
|
147
|
+
next.querySerializer = snakecaseQuerySerializerParams(next.querySerializer);
|
|
148
|
+
}
|
|
149
|
+
if ("body" in next && shouldTransformBody(next.body)) {
|
|
150
|
+
next.body = mapKeysDeep(next.body, camelToSnake);
|
|
151
|
+
}
|
|
152
|
+
return next;
|
|
153
|
+
};
|
|
154
|
+
var applyResponseCaseTransforms = (value) => mapKeysDeep(value, snakeToCamel);
|
|
155
|
+
|
|
107
156
|
// src/generated/core/serverSentEvents.gen.ts
|
|
108
157
|
var createSseClient = ({
|
|
109
158
|
onRequest,
|
|
@@ -194,9 +243,11 @@ var createSseClient = ({
|
|
|
194
243
|
}
|
|
195
244
|
}
|
|
196
245
|
if (parsedJson) {
|
|
246
|
+
data = applyResponseCaseTransforms(data);
|
|
197
247
|
if (responseValidator) {
|
|
198
248
|
await responseValidator(data);
|
|
199
249
|
}
|
|
250
|
+
data = await applySseResponseTransforms(data);
|
|
200
251
|
if (responseTransformer) {
|
|
201
252
|
data = await responseTransformer(data);
|
|
202
253
|
}
|
|
@@ -452,48 +503,6 @@ function getValidRequestBody(options) {
|
|
|
452
503
|
return void 0;
|
|
453
504
|
}
|
|
454
505
|
|
|
455
|
-
// src/utils/transforms.ts
|
|
456
|
-
var snakeToCamel = (value) => value.replace(/_([a-z0-9])/g, (_, c) => c.toUpperCase());
|
|
457
|
-
var camelToSnake = (value) => value.replace(/[A-Z]/g, (c) => `_${c.toLowerCase()}`);
|
|
458
|
-
var isPlainObject = (value) => !!value && typeof value === "object" && Object.getPrototypeOf(value) === Object.prototype;
|
|
459
|
-
var mapKeysDeep = (value, mapKey) => {
|
|
460
|
-
if (Array.isArray(value)) {
|
|
461
|
-
return value.map((item) => mapKeysDeep(item, mapKey));
|
|
462
|
-
}
|
|
463
|
-
if (isPlainObject(value)) {
|
|
464
|
-
const next = {};
|
|
465
|
-
for (const [key, val] of Object.entries(value)) {
|
|
466
|
-
next[mapKey(key)] = mapKeysDeep(val, mapKey);
|
|
467
|
-
}
|
|
468
|
-
return next;
|
|
469
|
-
}
|
|
470
|
-
return value;
|
|
471
|
-
};
|
|
472
|
-
var shouldTransformBody = (value) => isPlainObject(value) || Array.isArray(value);
|
|
473
|
-
var snakecaseQuerySerializerParams = (value) => {
|
|
474
|
-
if (!isPlainObject(value)) return value;
|
|
475
|
-
if (!isPlainObject(value.parameters)) return value;
|
|
476
|
-
const nextParameters = {};
|
|
477
|
-
for (const [key, param] of Object.entries(value.parameters)) {
|
|
478
|
-
nextParameters[camelToSnake(key)] = param;
|
|
479
|
-
}
|
|
480
|
-
return { ...value, parameters: nextParameters };
|
|
481
|
-
};
|
|
482
|
-
var applyRequestCaseTransforms = (options) => {
|
|
483
|
-
const next = { ...options };
|
|
484
|
-
if ("query" in next && isPlainObject(next.query)) {
|
|
485
|
-
next.query = mapKeysDeep(next.query, camelToSnake);
|
|
486
|
-
}
|
|
487
|
-
if ("querySerializer" in next && next.querySerializer) {
|
|
488
|
-
next.querySerializer = snakecaseQuerySerializerParams(next.querySerializer);
|
|
489
|
-
}
|
|
490
|
-
if ("body" in next && shouldTransformBody(next.body)) {
|
|
491
|
-
next.body = mapKeysDeep(next.body, camelToSnake);
|
|
492
|
-
}
|
|
493
|
-
return next;
|
|
494
|
-
};
|
|
495
|
-
var applyResponseCaseTransforms = (value) => mapKeysDeep(value, snakeToCamel);
|
|
496
|
-
|
|
497
506
|
// src/generated/core/auth.gen.ts
|
|
498
507
|
var getAuthToken = async (auth, callback) => {
|
|
499
508
|
const token = typeof callback === "function" ? await callback(auth) : callback;
|
|
@@ -957,6 +966,58 @@ var roundDtoSchemaResponseTransformer = (data) => {
|
|
|
957
966
|
data.tileStakes = data.tileStakes.map((item) => tileStakeDtoSchemaResponseTransformer(item));
|
|
958
967
|
return data;
|
|
959
968
|
};
|
|
969
|
+
var epochWinnerDtoSchemaResponseTransformer = (data) => {
|
|
970
|
+
data.tickets = u64DtoSchemaResponseTransformer(data.tickets);
|
|
971
|
+
return data;
|
|
972
|
+
};
|
|
973
|
+
var epochVaultIterationDtoSchemaResponseTransformer = (data) => {
|
|
974
|
+
if (data.claimableBtc) {
|
|
975
|
+
data.claimableBtc = u64DtoSchemaResponseTransformer(data.claimableBtc);
|
|
976
|
+
}
|
|
977
|
+
if (data.claimableUsd) {
|
|
978
|
+
data.claimableUsd = u64DtoSchemaResponseTransformer(data.claimableUsd);
|
|
979
|
+
}
|
|
980
|
+
data.totalTickets = u64DtoSchemaResponseTransformer(data.totalTickets);
|
|
981
|
+
if (data.winners) {
|
|
982
|
+
data.winners = data.winners.map((item) => epochWinnerDtoSchemaResponseTransformer(item));
|
|
983
|
+
}
|
|
984
|
+
return data;
|
|
985
|
+
};
|
|
986
|
+
var epochVaultDtoSchemaResponseTransformer = (data) => {
|
|
987
|
+
if (data.currentIteration) {
|
|
988
|
+
data.currentIteration = epochVaultIterationDtoSchemaResponseTransformer(data.currentIteration);
|
|
989
|
+
}
|
|
990
|
+
data.lastTriggerSlot = u64DtoSchemaResponseTransformer(data.lastTriggerSlot);
|
|
991
|
+
data.pendingUsdAmount = u64DtoSchemaResponseTransformer(data.pendingUsdAmount);
|
|
992
|
+
data.poolBtcAmount = u64DtoSchemaResponseTransformer(data.poolBtcAmount);
|
|
993
|
+
data.poolUsdAmount = u64DtoSchemaResponseTransformer(data.poolUsdAmount);
|
|
994
|
+
data.reservedBtcAmount = u64DtoSchemaResponseTransformer(data.reservedBtcAmount);
|
|
995
|
+
data.reservedUsdAmount = u64DtoSchemaResponseTransformer(data.reservedUsdAmount);
|
|
996
|
+
return data;
|
|
997
|
+
};
|
|
998
|
+
var oneBtcVaultIterationDtoSchemaResponseTransformer = (data) => {
|
|
999
|
+
data.prizeBtc = u64DtoSchemaResponseTransformer(data.prizeBtc);
|
|
1000
|
+
data.totalTickets = u64DtoSchemaResponseTransformer(data.totalTickets);
|
|
1001
|
+
if (data.winningTicket) {
|
|
1002
|
+
data.winningTicket = u64DtoSchemaResponseTransformer(data.winningTicket);
|
|
1003
|
+
}
|
|
1004
|
+
return data;
|
|
1005
|
+
};
|
|
1006
|
+
var oneBtcVaultDtoSchemaResponseTransformer = (data) => {
|
|
1007
|
+
data.btcAmount = u64DtoSchemaResponseTransformer(data.btcAmount);
|
|
1008
|
+
if (data.currentIteration) {
|
|
1009
|
+
data.currentIteration = oneBtcVaultIterationDtoSchemaResponseTransformer(data.currentIteration);
|
|
1010
|
+
}
|
|
1011
|
+
data.lastTriggerSlot = u64DtoSchemaResponseTransformer(data.lastTriggerSlot);
|
|
1012
|
+
data.pendingUsdAmount = u64DtoSchemaResponseTransformer(data.pendingUsdAmount);
|
|
1013
|
+
data.reservedBtcAmount = u64DtoSchemaResponseTransformer(data.reservedBtcAmount);
|
|
1014
|
+
return data;
|
|
1015
|
+
};
|
|
1016
|
+
var satsVaultDtoSchemaResponseTransformer = (data) => {
|
|
1017
|
+
data.btcAmount = u64DtoSchemaResponseTransformer(data.btcAmount);
|
|
1018
|
+
data.btcShares = u64DtoSchemaResponseTransformer(data.btcShares);
|
|
1019
|
+
return data;
|
|
1020
|
+
};
|
|
960
1021
|
var strikeJackpotDtoSchemaResponseTransformer = (data) => {
|
|
961
1022
|
data.btcAmount = u64DtoSchemaResponseTransformer(data.btcAmount);
|
|
962
1023
|
data.pendingUsdAmount = u64DtoSchemaResponseTransformer(data.pendingUsdAmount);
|
|
@@ -969,9 +1030,12 @@ var boardDtoSchemaResponseTransformer = (data) => {
|
|
|
969
1030
|
}
|
|
970
1031
|
data.currentSlot = u64DtoSchemaResponseTransformer(data.currentSlot);
|
|
971
1032
|
data.endSlot = u64DtoSchemaResponseTransformer(data.endSlot);
|
|
1033
|
+
data.epochVault = epochVaultDtoSchemaResponseTransformer(data.epochVault);
|
|
1034
|
+
data.oneBtcVault = oneBtcVaultDtoSchemaResponseTransformer(data.oneBtcVault);
|
|
972
1035
|
if (data.previousRound) {
|
|
973
1036
|
data.previousRound = roundDtoSchemaResponseTransformer(data.previousRound);
|
|
974
1037
|
}
|
|
1038
|
+
data.satsVault = satsVaultDtoSchemaResponseTransformer(data.satsVault);
|
|
975
1039
|
data.startSlot = u64DtoSchemaResponseTransformer(data.startSlot);
|
|
976
1040
|
data.strike = strikeJackpotDtoSchemaResponseTransformer(data.strike);
|
|
977
1041
|
return data;
|
|
@@ -984,15 +1048,45 @@ var publicDeploymentDtoSchemaResponseTransformer = (data) => {
|
|
|
984
1048
|
data.deployedUsdAmount = u64DtoSchemaResponseTransformer(data.deployedUsdAmount);
|
|
985
1049
|
return data;
|
|
986
1050
|
};
|
|
1051
|
+
var epochVaultEntryDtoSchemaResponseTransformer = (data) => {
|
|
1052
|
+
data.tickets = u64DtoSchemaResponseTransformer(data.tickets);
|
|
1053
|
+
return data;
|
|
1054
|
+
};
|
|
987
1055
|
var minerDtoSchemaResponseTransformer = (data) => {
|
|
988
1056
|
data.hashrateAmount = u64DtoSchemaResponseTransformer(data.hashrateAmount);
|
|
989
1057
|
data.unclaimedBtcShares = u64DtoSchemaResponseTransformer(data.unclaimedBtcShares);
|
|
990
1058
|
data.unclaimedUsdAmount = u64DtoSchemaResponseTransformer(data.unclaimedUsdAmount);
|
|
991
1059
|
return data;
|
|
992
1060
|
};
|
|
1061
|
+
var oneBtcVaultEntryDtoSchemaResponseTransformer = (data) => {
|
|
1062
|
+
data.startTicketId = u64DtoSchemaResponseTransformer(data.startTicketId);
|
|
1063
|
+
data.ticketsCount = u64DtoSchemaResponseTransformer(data.ticketsCount);
|
|
1064
|
+
return data;
|
|
1065
|
+
};
|
|
993
1066
|
var profileDtoSchemaResponseTransformer = (data) => {
|
|
994
1067
|
data.deployments = data.deployments.map((item) => publicDeploymentDtoSchemaResponseTransformer(item));
|
|
1068
|
+
data.epochVaultEntries = data.epochVaultEntries.map((item) => epochVaultEntryDtoSchemaResponseTransformer(item));
|
|
995
1069
|
data.miner = minerDtoSchemaResponseTransformer(data.miner);
|
|
1070
|
+
data.oneBtcVaultEntries = data.oneBtcVaultEntries.map((item) => oneBtcVaultEntryDtoSchemaResponseTransformer(item));
|
|
1071
|
+
return data;
|
|
1072
|
+
};
|
|
1073
|
+
var snapshotDtoSchemaResponseTransformer = (data) => {
|
|
1074
|
+
data.board = boardDtoSchemaResponseTransformer(data.board);
|
|
1075
|
+
if (data.profile) {
|
|
1076
|
+
data.profile = profileDtoSchemaResponseTransformer(data.profile);
|
|
1077
|
+
}
|
|
1078
|
+
return data;
|
|
1079
|
+
};
|
|
1080
|
+
var sseResponseSnapshotSchemaResponseTransformer = (data) => {
|
|
1081
|
+
data = snapshotDtoSchemaResponseTransformer(data);
|
|
1082
|
+
return data;
|
|
1083
|
+
};
|
|
1084
|
+
var sseResponseSchemaResponseTransformer = (data) => {
|
|
1085
|
+
data = sseResponseSnapshotSchemaResponseTransformer(data);
|
|
1086
|
+
return data;
|
|
1087
|
+
};
|
|
1088
|
+
var sseResponseTransformer = async (data) => {
|
|
1089
|
+
data = sseResponseSchemaResponseTransformer(data);
|
|
996
1090
|
return data;
|
|
997
1091
|
};
|
|
998
1092
|
var getUserProfileResponseTransformer = async (data) => {
|
|
@@ -1009,6 +1103,12 @@ var zBadRequestErrorCodeErrorBody = z.object({
|
|
|
1009
1103
|
"invalid_body"
|
|
1010
1104
|
])
|
|
1011
1105
|
});
|
|
1106
|
+
var zEpochStateDto = z.enum([
|
|
1107
|
+
"open",
|
|
1108
|
+
"settling",
|
|
1109
|
+
"settled",
|
|
1110
|
+
"complete"
|
|
1111
|
+
]);
|
|
1012
1112
|
var zFieldError = z.object({
|
|
1013
1113
|
field: z.string(),
|
|
1014
1114
|
message: z.string()
|
|
@@ -1018,6 +1118,12 @@ var zI64Dto = z.coerce.bigint().min(BigInt("-9223372036854775808"), { error: "In
|
|
|
1018
1118
|
var zInternalErrorCodeErrorBody = z.object({
|
|
1019
1119
|
code: z.enum(["internal_error"])
|
|
1020
1120
|
});
|
|
1121
|
+
var zNotificationEntity = z.enum(["state_snapshot"]);
|
|
1122
|
+
var zOneBtcStateDto = z.enum([
|
|
1123
|
+
"open",
|
|
1124
|
+
"settled",
|
|
1125
|
+
"complete"
|
|
1126
|
+
]);
|
|
1021
1127
|
var zPubkeyDto = z.string().regex(/^[1-9A-HJ-NP-Za-km-z]+$/);
|
|
1022
1128
|
var zRoundStateDto = z.enum([
|
|
1023
1129
|
"active",
|
|
@@ -1038,6 +1144,59 @@ var zSatrushConfigDto = z.object({
|
|
|
1038
1144
|
});
|
|
1039
1145
|
var zU128Dto = z.string();
|
|
1040
1146
|
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" });
|
|
1147
|
+
var zEpochVaultEntryDto = z.object({
|
|
1148
|
+
address: zPubkeyDto,
|
|
1149
|
+
iterationId: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1150
|
+
pageIndex: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1151
|
+
tickets: zU64Dto
|
|
1152
|
+
});
|
|
1153
|
+
var zEpochWinnerDto = z.object({
|
|
1154
|
+
authority: zPubkeyDto,
|
|
1155
|
+
claimed: z.boolean(),
|
|
1156
|
+
tickets: zU64Dto
|
|
1157
|
+
});
|
|
1158
|
+
var zEpochVaultIterationDto = z.object({
|
|
1159
|
+
address: zPubkeyDto,
|
|
1160
|
+
claimableBtc: z.optional(z.union([
|
|
1161
|
+
z.null(),
|
|
1162
|
+
zU64Dto
|
|
1163
|
+
])),
|
|
1164
|
+
claimableUsd: z.optional(z.union([
|
|
1165
|
+
z.null(),
|
|
1166
|
+
zU64Dto
|
|
1167
|
+
])),
|
|
1168
|
+
id: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1169
|
+
pageCount: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1170
|
+
participantsCount: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1171
|
+
state: zEpochStateDto,
|
|
1172
|
+
totalTickets: zU64Dto,
|
|
1173
|
+
winners: z.optional(z.union([
|
|
1174
|
+
z.array(zEpochWinnerDto),
|
|
1175
|
+
z.null()
|
|
1176
|
+
])),
|
|
1177
|
+
winnersClaimed: z.optional(z.union([
|
|
1178
|
+
z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1179
|
+
z.null()
|
|
1180
|
+
])),
|
|
1181
|
+
winnersSelected: z.optional(z.union([
|
|
1182
|
+
z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1183
|
+
z.null()
|
|
1184
|
+
]))
|
|
1185
|
+
});
|
|
1186
|
+
var zEpochVaultDto = z.object({
|
|
1187
|
+
address: zPubkeyDto,
|
|
1188
|
+
currentIteration: z.optional(z.union([
|
|
1189
|
+
z.null(),
|
|
1190
|
+
zEpochVaultIterationDto
|
|
1191
|
+
])),
|
|
1192
|
+
iterationId: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1193
|
+
lastTriggerSlot: zU64Dto,
|
|
1194
|
+
pendingUsdAmount: zU64Dto,
|
|
1195
|
+
poolBtcAmount: zU64Dto,
|
|
1196
|
+
poolUsdAmount: zU64Dto,
|
|
1197
|
+
reservedBtcAmount: zU64Dto,
|
|
1198
|
+
reservedUsdAmount: zU64Dto
|
|
1199
|
+
});
|
|
1041
1200
|
var zMinerDto = z.object({
|
|
1042
1201
|
authority: zPubkeyDto,
|
|
1043
1202
|
currentStreakCount: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
@@ -1046,6 +1205,35 @@ var zMinerDto = z.object({
|
|
|
1046
1205
|
unclaimedBtcShares: zU64Dto,
|
|
1047
1206
|
unclaimedUsdAmount: zU64Dto
|
|
1048
1207
|
});
|
|
1208
|
+
var zOneBtcVaultEntryDto = z.object({
|
|
1209
|
+
address: zPubkeyDto,
|
|
1210
|
+
iterationId: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1211
|
+
startTicketId: zU64Dto,
|
|
1212
|
+
ticketsCount: zU64Dto
|
|
1213
|
+
});
|
|
1214
|
+
var zOneBtcVaultIterationDto = z.object({
|
|
1215
|
+
address: zPubkeyDto,
|
|
1216
|
+
id: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1217
|
+
prizeBtc: zU64Dto,
|
|
1218
|
+
state: zOneBtcStateDto,
|
|
1219
|
+
totalTickets: zU64Dto,
|
|
1220
|
+
winningTicket: z.optional(z.union([
|
|
1221
|
+
z.null(),
|
|
1222
|
+
zU64Dto
|
|
1223
|
+
]))
|
|
1224
|
+
});
|
|
1225
|
+
var zOneBtcVaultDto = z.object({
|
|
1226
|
+
address: zPubkeyDto,
|
|
1227
|
+
btcAmount: zU64Dto,
|
|
1228
|
+
currentIteration: z.optional(z.union([
|
|
1229
|
+
z.null(),
|
|
1230
|
+
zOneBtcVaultIterationDto
|
|
1231
|
+
])),
|
|
1232
|
+
iterationId: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1233
|
+
lastTriggerSlot: zU64Dto,
|
|
1234
|
+
pendingUsdAmount: zU64Dto,
|
|
1235
|
+
reservedBtcAmount: zU64Dto
|
|
1236
|
+
});
|
|
1049
1237
|
var zPublicDeploymentDto = z.object({
|
|
1050
1238
|
address: zPubkeyDto,
|
|
1051
1239
|
deployedUsdAmount: zU64Dto,
|
|
@@ -1054,7 +1242,14 @@ var zPublicDeploymentDto = z.object({
|
|
|
1054
1242
|
});
|
|
1055
1243
|
var zProfileDto = z.object({
|
|
1056
1244
|
deployments: z.array(zPublicDeploymentDto),
|
|
1057
|
-
|
|
1245
|
+
epochVaultEntries: z.array(zEpochVaultEntryDto),
|
|
1246
|
+
miner: zMinerDto,
|
|
1247
|
+
oneBtcVaultEntries: z.array(zOneBtcVaultEntryDto)
|
|
1248
|
+
});
|
|
1249
|
+
var zSatsVaultDto = z.object({
|
|
1250
|
+
address: zPubkeyDto,
|
|
1251
|
+
btcAmount: zU64Dto,
|
|
1252
|
+
btcShares: zU64Dto
|
|
1058
1253
|
});
|
|
1059
1254
|
var zStrikeJackpotDto = z.object({
|
|
1060
1255
|
btcAmount: zU64Dto,
|
|
@@ -1094,15 +1289,32 @@ var zBoardDto = z.object({
|
|
|
1094
1289
|
address: zPubkeyDto,
|
|
1095
1290
|
currentSlot: zU64Dto,
|
|
1096
1291
|
endSlot: zU64Dto,
|
|
1292
|
+
epochVault: zEpochVaultDto,
|
|
1293
|
+
oneBtcVault: zOneBtcVaultDto,
|
|
1097
1294
|
previousRound: z.optional(z.union([
|
|
1098
1295
|
z.null(),
|
|
1099
1296
|
zRoundDto
|
|
1100
1297
|
])),
|
|
1101
1298
|
roundDuration: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1102
1299
|
roundId: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1300
|
+
satsVault: zSatsVaultDto,
|
|
1103
1301
|
startSlot: zU64Dto,
|
|
1104
1302
|
strike: zStrikeJackpotDto
|
|
1105
1303
|
});
|
|
1304
|
+
var zSnapshotDto = z.object({
|
|
1305
|
+
board: zBoardDto,
|
|
1306
|
+
entity: zNotificationEntity,
|
|
1307
|
+
profile: z.optional(z.union([
|
|
1308
|
+
z.null(),
|
|
1309
|
+
zProfileDto
|
|
1310
|
+
]))
|
|
1311
|
+
});
|
|
1312
|
+
var zSseResponseSnapshot = zSnapshotDto.and(z.object({
|
|
1313
|
+
entity: z.enum(["state_snapshot"])
|
|
1314
|
+
}));
|
|
1315
|
+
var zSseResponse = z.object({
|
|
1316
|
+
entity: z.literal("state_snapshot")
|
|
1317
|
+
}).and(zSseResponseSnapshot);
|
|
1106
1318
|
var zUserProfileApiError400InvalidAddress = z.object({
|
|
1107
1319
|
code: z.enum(["invalid_address"])
|
|
1108
1320
|
});
|
|
@@ -1146,6 +1358,14 @@ var zGetConfigData = z.object({
|
|
|
1146
1358
|
var zGetConfigResponse = z.object({
|
|
1147
1359
|
data: zSatrushConfigDto
|
|
1148
1360
|
});
|
|
1361
|
+
var zSseData = z.object({
|
|
1362
|
+
body: z.optional(z.never()),
|
|
1363
|
+
path: z.optional(z.never()),
|
|
1364
|
+
query: z.optional(z.object({
|
|
1365
|
+
wallet: z.optional(z.string())
|
|
1366
|
+
}))
|
|
1367
|
+
});
|
|
1368
|
+
var zSseResponse2 = zSseResponse;
|
|
1149
1369
|
var zGetUserProfileData = z.object({
|
|
1150
1370
|
body: z.optional(z.never()),
|
|
1151
1371
|
path: z.object({
|
|
@@ -1207,6 +1427,20 @@ var SatrushBackendSdk = class _SatrushBackendSdk extends HeyApiClient {
|
|
|
1207
1427
|
...options
|
|
1208
1428
|
});
|
|
1209
1429
|
}
|
|
1430
|
+
/**
|
|
1431
|
+
* Subscribe for SSE stream
|
|
1432
|
+
*/
|
|
1433
|
+
sse(parameters, options) {
|
|
1434
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "wallet" }] }]);
|
|
1435
|
+
return (options?.client ?? this.client).sse.get({
|
|
1436
|
+
requestValidator: async (data) => await zSseData.parseAsync(data),
|
|
1437
|
+
responseTransformer: sseResponseTransformer,
|
|
1438
|
+
responseValidator: async (data) => await zSseResponse2.parseAsync(data),
|
|
1439
|
+
url: "/v1/streams/sse",
|
|
1440
|
+
...options,
|
|
1441
|
+
...params
|
|
1442
|
+
});
|
|
1443
|
+
}
|
|
1210
1444
|
/**
|
|
1211
1445
|
* Request user profile
|
|
1212
1446
|
*/
|
|
@@ -1224,6 +1458,18 @@ var SatrushBackendSdk = class _SatrushBackendSdk extends HeyApiClient {
|
|
|
1224
1458
|
};
|
|
1225
1459
|
|
|
1226
1460
|
// src/generated/types.gen.ts
|
|
1461
|
+
var EpochStateDto = {
|
|
1462
|
+
OPEN: "open",
|
|
1463
|
+
SETTLING: "settling",
|
|
1464
|
+
SETTLED: "settled",
|
|
1465
|
+
COMPLETE: "complete"
|
|
1466
|
+
};
|
|
1467
|
+
var NotificationEntity = { STATE_SNAPSHOT: "state_snapshot" };
|
|
1468
|
+
var OneBtcStateDto = {
|
|
1469
|
+
OPEN: "open",
|
|
1470
|
+
SETTLED: "settled",
|
|
1471
|
+
COMPLETE: "complete"
|
|
1472
|
+
};
|
|
1227
1473
|
var RoundStateDto = {
|
|
1228
1474
|
ACTIVE: "active",
|
|
1229
1475
|
REVEALED: "revealed",
|
|
@@ -1276,6 +1522,9 @@ async function unwrap(promise) {
|
|
|
1276
1522
|
return unwrapData(res);
|
|
1277
1523
|
}
|
|
1278
1524
|
export {
|
|
1525
|
+
EpochStateDto,
|
|
1526
|
+
NotificationEntity,
|
|
1527
|
+
OneBtcStateDto,
|
|
1279
1528
|
RoundStateDto,
|
|
1280
1529
|
SatrushBackendSdk,
|
|
1281
1530
|
SatrushBackendSdkError,
|
|
@@ -1286,6 +1535,11 @@ export {
|
|
|
1286
1535
|
unwrap,
|
|
1287
1536
|
zBadRequestErrorCodeErrorBody,
|
|
1288
1537
|
zBoardDto,
|
|
1538
|
+
zEpochStateDto,
|
|
1539
|
+
zEpochVaultDto,
|
|
1540
|
+
zEpochVaultEntryDto,
|
|
1541
|
+
zEpochVaultIterationDto,
|
|
1542
|
+
zEpochWinnerDto,
|
|
1289
1543
|
zFieldError,
|
|
1290
1544
|
zGetBoardData,
|
|
1291
1545
|
zGetBoardResponse,
|
|
@@ -1297,12 +1551,23 @@ export {
|
|
|
1297
1551
|
zI64Dto,
|
|
1298
1552
|
zInternalErrorCodeErrorBody,
|
|
1299
1553
|
zMinerDto,
|
|
1554
|
+
zNotificationEntity,
|
|
1555
|
+
zOneBtcStateDto,
|
|
1556
|
+
zOneBtcVaultDto,
|
|
1557
|
+
zOneBtcVaultEntryDto,
|
|
1558
|
+
zOneBtcVaultIterationDto,
|
|
1300
1559
|
zProfileDto,
|
|
1301
1560
|
zPubkeyDto,
|
|
1302
1561
|
zPublicDeploymentDto,
|
|
1303
1562
|
zRoundDto,
|
|
1304
1563
|
zRoundStateDto,
|
|
1305
1564
|
zSatrushConfigDto,
|
|
1565
|
+
zSatsVaultDto,
|
|
1566
|
+
zSnapshotDto,
|
|
1567
|
+
zSseData,
|
|
1568
|
+
zSseResponse,
|
|
1569
|
+
zSseResponse2,
|
|
1570
|
+
zSseResponseSnapshot,
|
|
1306
1571
|
zStrikeJackpotDto,
|
|
1307
1572
|
zTileStakeDto,
|
|
1308
1573
|
zU128Dto,
|