@satrush/api 0.1.25 → 0.1.27
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 +151 -2
- package/dist/index.d.cts +299 -12
- package/dist/index.d.ts +299 -12
- package/dist/index.js +140 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1186,6 +1186,7 @@ var getEpochWinnersResponseTransformer = async (data) => {
|
|
|
1186
1186
|
var leaderboardPageEntryDtoSchemaResponseTransformer = (data) => {
|
|
1187
1187
|
data.totalHashrateEarned = u64DtoSchemaResponseTransformer(data.totalHashrateEarned);
|
|
1188
1188
|
data.totalSatsEarned = u64DtoSchemaResponseTransformer(data.totalSatsEarned);
|
|
1189
|
+
data.totalStaked = u64DtoSchemaResponseTransformer(data.totalStaked);
|
|
1189
1190
|
data.totalUsdDeployed = u64DtoSchemaResponseTransformer(data.totalUsdDeployed);
|
|
1190
1191
|
return data;
|
|
1191
1192
|
};
|
|
@@ -1198,6 +1199,18 @@ var getLeaderboardResponseTransformer = async (data) => {
|
|
|
1198
1199
|
data.data = leaderboardPageDtoSchemaResponseTransformer(data.data);
|
|
1199
1200
|
return data;
|
|
1200
1201
|
};
|
|
1202
|
+
var affiliateLeaderboardEntryDtoSchemaResponseTransformer = (data) => {
|
|
1203
|
+
data.referralUsdVolume = u64DtoSchemaResponseTransformer(data.referralUsdVolume);
|
|
1204
|
+
return data;
|
|
1205
|
+
};
|
|
1206
|
+
var affiliateLeaderboardPageDtoSchemaResponseTransformer = (data) => {
|
|
1207
|
+
data.entries = data.entries.map((item) => affiliateLeaderboardEntryDtoSchemaResponseTransformer(item));
|
|
1208
|
+
return data;
|
|
1209
|
+
};
|
|
1210
|
+
var getAffiliateLeaderboardResponseTransformer = async (data) => {
|
|
1211
|
+
data.data = affiliateLeaderboardPageDtoSchemaResponseTransformer(data.data);
|
|
1212
|
+
return data;
|
|
1213
|
+
};
|
|
1201
1214
|
var leaderboardEntryDtoSchemaResponseTransformer = (data) => {
|
|
1202
1215
|
data.totalHashrateEarned = u64DtoSchemaResponseTransformer(data.totalHashrateEarned);
|
|
1203
1216
|
data.totalSatsEarned = u64DtoSchemaResponseTransformer(data.totalSatsEarned);
|
|
@@ -1219,6 +1232,7 @@ var getSatsEarnedLeaderboardResponseTransformer = async (data) => {
|
|
|
1219
1232
|
var walletLeaderboardDtoSchemaResponseTransformer = (data) => {
|
|
1220
1233
|
data.totalHashrateEarned = u64DtoSchemaResponseTransformer(data.totalHashrateEarned);
|
|
1221
1234
|
data.totalSatsEarned = u64DtoSchemaResponseTransformer(data.totalSatsEarned);
|
|
1235
|
+
data.totalStaked = u64DtoSchemaResponseTransformer(data.totalStaked);
|
|
1222
1236
|
data.totalUsdDeployed = u64DtoSchemaResponseTransformer(data.totalUsdDeployed);
|
|
1223
1237
|
data.updatedAt = new Date(data.updatedAt);
|
|
1224
1238
|
return data;
|
|
@@ -1474,8 +1488,10 @@ var minerDtoSchemaResponseTransformer = (data) => {
|
|
|
1474
1488
|
data.totalUsdClaimed = u64DtoSchemaResponseTransformer(data.totalUsdClaimed);
|
|
1475
1489
|
data.totalUsdDeployed = u64DtoSchemaResponseTransformer(data.totalUsdDeployed);
|
|
1476
1490
|
data.totalUsdEarned = u64DtoSchemaResponseTransformer(data.totalUsdEarned);
|
|
1491
|
+
data.unclaimedBtcAmount = u64DtoSchemaResponseTransformer(data.unclaimedBtcAmount);
|
|
1477
1492
|
data.unclaimedHashrateAmount = u64DtoSchemaResponseTransformer(data.unclaimedHashrateAmount);
|
|
1478
1493
|
data.unclaimedSatsShares = u64DtoSchemaResponseTransformer(data.unclaimedSatsShares);
|
|
1494
|
+
data.unclaimedTokenAmount = u64DtoSchemaResponseTransformer(data.unclaimedTokenAmount);
|
|
1479
1495
|
data.unclaimedTokenShares = u64DtoSchemaResponseTransformer(data.unclaimedTokenShares);
|
|
1480
1496
|
data.unclaimedUsdAmount = u64DtoSchemaResponseTransformer(data.unclaimedUsdAmount);
|
|
1481
1497
|
data.unrealizedBtcPnl = i64DtoSchemaResponseTransformer(data.unrealizedBtcPnl);
|
|
@@ -1786,6 +1802,7 @@ var zLeaderboardRanksDto = z.object({
|
|
|
1786
1802
|
rounds: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1787
1803
|
satsEarned: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1788
1804
|
score: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1805
|
+
staked: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1789
1806
|
streak: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
1790
1807
|
});
|
|
1791
1808
|
var zLeaderboardSortDto = z.enum([
|
|
@@ -1794,7 +1811,8 @@ var zLeaderboardSortDto = z.enum([
|
|
|
1794
1811
|
"rounds",
|
|
1795
1812
|
"sats_earned",
|
|
1796
1813
|
"hashrate",
|
|
1797
|
-
"streak"
|
|
1814
|
+
"streak",
|
|
1815
|
+
"staked"
|
|
1798
1816
|
]);
|
|
1799
1817
|
var zNotificationEntity = z.enum(["state_snapshot"]);
|
|
1800
1818
|
var zOneBtcHistoryApiError400InvalidRange = z.object({
|
|
@@ -1925,8 +1943,22 @@ var zStakingTreasuryApiError500Error = z.object({
|
|
|
1925
1943
|
var zTokenApiError500Error = z.object({
|
|
1926
1944
|
code: z.enum(["internal"])
|
|
1927
1945
|
});
|
|
1946
|
+
var zTokenSupplyDto = z.object({
|
|
1947
|
+
result: z.string()
|
|
1948
|
+
});
|
|
1928
1949
|
var zU128Dto = z.string();
|
|
1929
1950
|
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" });
|
|
1951
|
+
var zAffiliateLeaderboardEntryDto = z.object({
|
|
1952
|
+
authority: zPubkeyDto,
|
|
1953
|
+
rank: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1954
|
+
referralUsdVolume: zU64Dto,
|
|
1955
|
+
referredMiners: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1956
|
+
tag: z.string()
|
|
1957
|
+
});
|
|
1958
|
+
var zAffiliateLeaderboardPageDto = z.object({
|
|
1959
|
+
entries: z.array(zAffiliateLeaderboardEntryDto),
|
|
1960
|
+
total: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
1961
|
+
});
|
|
1930
1962
|
var zAffiliateStatsDto = z.object({
|
|
1931
1963
|
affiliateRateBps: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1932
1964
|
authority: zPubkeyDto,
|
|
@@ -2156,9 +2188,14 @@ var zLeaderboardPageEntryDto = z.object({
|
|
|
2156
2188
|
maxStreak: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
2157
2189
|
rank: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
2158
2190
|
score: z.number(),
|
|
2191
|
+
tag: z.optional(z.union([
|
|
2192
|
+
z.string(),
|
|
2193
|
+
z.null()
|
|
2194
|
+
])),
|
|
2159
2195
|
totalHashrateEarned: zU64Dto,
|
|
2160
2196
|
totalRoundsPlayed: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
2161
2197
|
totalSatsEarned: zU64Dto,
|
|
2198
|
+
totalStaked: zU64Dto,
|
|
2162
2199
|
totalUsdDeployed: zU64Dto
|
|
2163
2200
|
});
|
|
2164
2201
|
var zLeaderboardPageDto = z.object({
|
|
@@ -2279,8 +2316,10 @@ var zMinerDto = z.object({
|
|
|
2279
2316
|
totalUsdClaimed: zU64Dto,
|
|
2280
2317
|
totalUsdDeployed: zU64Dto,
|
|
2281
2318
|
totalUsdEarned: zU64Dto,
|
|
2319
|
+
unclaimedBtcAmount: zU64Dto,
|
|
2282
2320
|
unclaimedHashrateAmount: zU64Dto,
|
|
2283
2321
|
unclaimedSatsShares: zU64Dto,
|
|
2322
|
+
unclaimedTokenAmount: zU64Dto,
|
|
2284
2323
|
unclaimedTokenShares: zU64Dto,
|
|
2285
2324
|
unclaimedUsdAmount: zU64Dto,
|
|
2286
2325
|
unrealizedBtcPnl: zI64Dto,
|
|
@@ -3157,9 +3196,14 @@ var zWalletLeaderboardDto = z.object({
|
|
|
3157
3196
|
maxStreak: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
3158
3197
|
ranks: zLeaderboardRanksDto,
|
|
3159
3198
|
score: z.number(),
|
|
3199
|
+
tag: z.optional(z.union([
|
|
3200
|
+
z.string(),
|
|
3201
|
+
z.null()
|
|
3202
|
+
])),
|
|
3160
3203
|
totalHashrateEarned: zU64Dto,
|
|
3161
3204
|
totalRoundsPlayed: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
3162
3205
|
totalSatsEarned: zU64Dto,
|
|
3206
|
+
totalStaked: zU64Dto,
|
|
3163
3207
|
totalUsdDeployed: zU64Dto,
|
|
3164
3208
|
updatedAt: z.preprocess((value) => value instanceof Date ? value.toISOString() : value, z.iso.datetime())
|
|
3165
3209
|
});
|
|
@@ -3239,6 +3283,17 @@ var zGetLeaderboardData = z.object({
|
|
|
3239
3283
|
var zGetLeaderboardResponse = z.object({
|
|
3240
3284
|
data: zLeaderboardPageDto
|
|
3241
3285
|
});
|
|
3286
|
+
var zGetAffiliateLeaderboardData = z.object({
|
|
3287
|
+
body: z.optional(z.never()),
|
|
3288
|
+
path: z.optional(z.never()),
|
|
3289
|
+
query: z.optional(z.object({
|
|
3290
|
+
offset: z.optional(z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })),
|
|
3291
|
+
limit: z.optional(z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }))
|
|
3292
|
+
}))
|
|
3293
|
+
});
|
|
3294
|
+
var zGetAffiliateLeaderboardResponse = z.object({
|
|
3295
|
+
data: zAffiliateLeaderboardPageDto
|
|
3296
|
+
});
|
|
3242
3297
|
var zGetHashrateEarnedLeaderboardData = z.object({
|
|
3243
3298
|
body: z.optional(z.never()),
|
|
3244
3299
|
path: z.optional(z.never()),
|
|
@@ -3356,6 +3411,30 @@ var zGetTokenStatsData = z.object({
|
|
|
3356
3411
|
var zGetTokenStatsResponse = z.object({
|
|
3357
3412
|
data: zTokenStatsDto
|
|
3358
3413
|
});
|
|
3414
|
+
var zGetTokenBurnedSupplyData = z.object({
|
|
3415
|
+
body: z.optional(z.never()),
|
|
3416
|
+
path: z.optional(z.never()),
|
|
3417
|
+
query: z.optional(z.never())
|
|
3418
|
+
});
|
|
3419
|
+
var zGetTokenBurnedSupplyResponse = z.object({
|
|
3420
|
+
data: zTokenSupplyDto
|
|
3421
|
+
});
|
|
3422
|
+
var zGetTokenCirculatingSupplyData = z.object({
|
|
3423
|
+
body: z.optional(z.never()),
|
|
3424
|
+
path: z.optional(z.never()),
|
|
3425
|
+
query: z.optional(z.never())
|
|
3426
|
+
});
|
|
3427
|
+
var zGetTokenCirculatingSupplyResponse = z.object({
|
|
3428
|
+
data: zTokenSupplyDto
|
|
3429
|
+
});
|
|
3430
|
+
var zGetTokenTotalSupplyData = z.object({
|
|
3431
|
+
body: z.optional(z.never()),
|
|
3432
|
+
path: z.optional(z.never()),
|
|
3433
|
+
query: z.optional(z.never())
|
|
3434
|
+
});
|
|
3435
|
+
var zGetTokenTotalSupplyResponse = z.object({
|
|
3436
|
+
data: zTokenSupplyDto
|
|
3437
|
+
});
|
|
3359
3438
|
var zGetUserProfileData = z.object({
|
|
3360
3439
|
body: z.optional(z.never()),
|
|
3361
3440
|
path: z.object({
|
|
@@ -3612,6 +3691,20 @@ var SatrushBackendSdk = class _SatrushBackendSdk extends HeyApiClient {
|
|
|
3612
3691
|
...params
|
|
3613
3692
|
});
|
|
3614
3693
|
}
|
|
3694
|
+
/**
|
|
3695
|
+
* Request a page of the affiliate leaderboard, by referral USD volume
|
|
3696
|
+
*/
|
|
3697
|
+
getAffiliateLeaderboard(parameters, options) {
|
|
3698
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "offset" }, { in: "query", key: "limit" }] }]);
|
|
3699
|
+
return (options?.client ?? this.client).get({
|
|
3700
|
+
requestValidator: async (data) => await zGetAffiliateLeaderboardData.parseAsync(data),
|
|
3701
|
+
responseTransformer: getAffiliateLeaderboardResponseTransformer,
|
|
3702
|
+
responseValidator: async (data) => await zGetAffiliateLeaderboardResponse.parseAsync(data),
|
|
3703
|
+
url: "/v1/leaderboard/affiliates",
|
|
3704
|
+
...options,
|
|
3705
|
+
...params
|
|
3706
|
+
});
|
|
3707
|
+
}
|
|
3615
3708
|
/**
|
|
3616
3709
|
* Request the top miners by lifetime hashrate earned
|
|
3617
3710
|
*/
|
|
@@ -3784,6 +3877,39 @@ var SatrushBackendSdk = class _SatrushBackendSdk extends HeyApiClient {
|
|
|
3784
3877
|
...options
|
|
3785
3878
|
});
|
|
3786
3879
|
}
|
|
3880
|
+
/**
|
|
3881
|
+
* Request the protocol tokens burned so far (the protocol's buyback burns plus the LP wallet's burns) in whole tokens, in the shape CoinGecko's supply endpoints use
|
|
3882
|
+
*/
|
|
3883
|
+
getTokenBurnedSupply(options) {
|
|
3884
|
+
return (options?.client ?? this.client).get({
|
|
3885
|
+
requestValidator: async (data) => await zGetTokenBurnedSupplyData.parseAsync(data),
|
|
3886
|
+
responseValidator: async (data) => await zGetTokenBurnedSupplyResponse.parseAsync(data),
|
|
3887
|
+
url: "/v1/token/supply/burned",
|
|
3888
|
+
...options
|
|
3889
|
+
});
|
|
3890
|
+
}
|
|
3891
|
+
/**
|
|
3892
|
+
* Request the protocol token's circulating supply in whole tokens (total supply less the non-circulating wallets' balances), in the shape CoinGecko's supply endpoints use
|
|
3893
|
+
*/
|
|
3894
|
+
getTokenCirculatingSupply(options) {
|
|
3895
|
+
return (options?.client ?? this.client).get({
|
|
3896
|
+
requestValidator: async (data) => await zGetTokenCirculatingSupplyData.parseAsync(data),
|
|
3897
|
+
responseValidator: async (data) => await zGetTokenCirculatingSupplyResponse.parseAsync(data),
|
|
3898
|
+
url: "/v1/token/supply/circulating",
|
|
3899
|
+
...options
|
|
3900
|
+
});
|
|
3901
|
+
}
|
|
3902
|
+
/**
|
|
3903
|
+
* Request the protocol token's total supply in whole tokens, in the shape CoinGecko's supply endpoints use
|
|
3904
|
+
*/
|
|
3905
|
+
getTokenTotalSupply(options) {
|
|
3906
|
+
return (options?.client ?? this.client).get({
|
|
3907
|
+
requestValidator: async (data) => await zGetTokenTotalSupplyData.parseAsync(data),
|
|
3908
|
+
responseValidator: async (data) => await zGetTokenTotalSupplyResponse.parseAsync(data),
|
|
3909
|
+
url: "/v1/token/supply/total",
|
|
3910
|
+
...options
|
|
3911
|
+
});
|
|
3912
|
+
}
|
|
3787
3913
|
/**
|
|
3788
3914
|
* Request user profile
|
|
3789
3915
|
*/
|
|
@@ -3970,7 +4096,8 @@ var LeaderboardSortDto = {
|
|
|
3970
4096
|
ROUNDS: "rounds",
|
|
3971
4097
|
SATS_EARNED: "sats_earned",
|
|
3972
4098
|
HASHRATE: "hashrate",
|
|
3973
|
-
STREAK: "streak"
|
|
4099
|
+
STREAK: "streak",
|
|
4100
|
+
STAKED: "staked"
|
|
3974
4101
|
};
|
|
3975
4102
|
var NotificationEntity = { STATE_SNAPSHOT: "state_snapshot" };
|
|
3976
4103
|
var OneBtcStateDto = {
|
|
@@ -4058,6 +4185,8 @@ export {
|
|
|
4058
4185
|
isSatrushSdkError,
|
|
4059
4186
|
satrushSdkErrorInterceptor,
|
|
4060
4187
|
unwrap,
|
|
4188
|
+
zAffiliateLeaderboardEntryDto,
|
|
4189
|
+
zAffiliateLeaderboardPageDto,
|
|
4061
4190
|
zAffiliateStatsDto,
|
|
4062
4191
|
zAutomationStrategyDto,
|
|
4063
4192
|
zBadRequestErrorCodeErrorBody,
|
|
@@ -4087,6 +4216,8 @@ export {
|
|
|
4087
4216
|
zEpochWinnersApiError400InvalidRange,
|
|
4088
4217
|
zEpochWinnersApiError500Error,
|
|
4089
4218
|
zFieldError,
|
|
4219
|
+
zGetAffiliateLeaderboardData,
|
|
4220
|
+
zGetAffiliateLeaderboardResponse,
|
|
4090
4221
|
zGetBoardData,
|
|
4091
4222
|
zGetBoardResponse,
|
|
4092
4223
|
zGetConfigData,
|
|
@@ -4119,8 +4250,14 @@ export {
|
|
|
4119
4250
|
zGetSatsEarnedLeaderboardResponse,
|
|
4120
4251
|
zGetStakingTreasuryData,
|
|
4121
4252
|
zGetStakingTreasuryResponse,
|
|
4253
|
+
zGetTokenBurnedSupplyData,
|
|
4254
|
+
zGetTokenBurnedSupplyResponse,
|
|
4255
|
+
zGetTokenCirculatingSupplyData,
|
|
4256
|
+
zGetTokenCirculatingSupplyResponse,
|
|
4122
4257
|
zGetTokenStatsData,
|
|
4123
4258
|
zGetTokenStatsResponse,
|
|
4259
|
+
zGetTokenTotalSupplyData,
|
|
4260
|
+
zGetTokenTotalSupplyResponse,
|
|
4124
4261
|
zGetUserAffiliateData,
|
|
4125
4262
|
zGetUserAffiliateResponse,
|
|
4126
4263
|
zGetUserClaimsData,
|
|
@@ -4212,6 +4349,7 @@ export {
|
|
|
4212
4349
|
zTileStakeDto,
|
|
4213
4350
|
zTokenApiError500Error,
|
|
4214
4351
|
zTokenStatsDto,
|
|
4352
|
+
zTokenSupplyDto,
|
|
4215
4353
|
zTokenVaultDto,
|
|
4216
4354
|
zU128Dto,
|
|
4217
4355
|
zU64Dto,
|