@satrush/api 0.1.21 → 0.1.23
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 +72 -7
- package/dist/index.d.cts +151 -31
- package/dist/index.d.ts +151 -31
- package/dist/index.js +68 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1129,6 +1129,7 @@ var epochIterationDetailsDtoSchemaResponseTransformer = (data) => {
|
|
|
1129
1129
|
data.endedAt = new Date(data.endedAt);
|
|
1130
1130
|
}
|
|
1131
1131
|
data.poolBtcAmount = u64DtoSchemaResponseTransformer(data.poolBtcAmount);
|
|
1132
|
+
data.poolTokenAmount = u64DtoSchemaResponseTransformer(data.poolTokenAmount);
|
|
1132
1133
|
data.poolUsdAmount = u64DtoSchemaResponseTransformer(data.poolUsdAmount);
|
|
1133
1134
|
data.startedAt = new Date(data.startedAt);
|
|
1134
1135
|
data.totalTickets = u64DtoSchemaResponseTransformer(data.totalTickets);
|
|
@@ -1428,6 +1429,7 @@ var getRoundResponseTransformer = async (data) => {
|
|
|
1428
1429
|
var stakingTreasuryDtoSchemaResponseTransformer = (data) => {
|
|
1429
1430
|
data.totalRewardDeposited = u64DtoSchemaResponseTransformer(data.totalRewardDeposited);
|
|
1430
1431
|
data.totalStaked = u64DtoSchemaResponseTransformer(data.totalStaked);
|
|
1432
|
+
data.unstreamedReward = u64DtoSchemaResponseTransformer(data.unstreamedReward);
|
|
1431
1433
|
return data;
|
|
1432
1434
|
};
|
|
1433
1435
|
var getStakingTreasuryResponseTransformer = async (data) => {
|
|
@@ -1518,6 +1520,16 @@ var sseResponseTransformer = async (data) => {
|
|
|
1518
1520
|
data = sseResponseSchemaResponseTransformer(data);
|
|
1519
1521
|
return data;
|
|
1520
1522
|
};
|
|
1523
|
+
var tokenStatsDtoSchemaResponseTransformer = (data) => {
|
|
1524
|
+
data.buybackBurned = u64DtoSchemaResponseTransformer(data.buybackBurned);
|
|
1525
|
+
data.lpBurned = u64DtoSchemaResponseTransformer(data.lpBurned);
|
|
1526
|
+
data.totalBurned = u64DtoSchemaResponseTransformer(data.totalBurned);
|
|
1527
|
+
return data;
|
|
1528
|
+
};
|
|
1529
|
+
var getTokenStatsResponseTransformer = async (data) => {
|
|
1530
|
+
data.data = tokenStatsDtoSchemaResponseTransformer(data.data);
|
|
1531
|
+
return data;
|
|
1532
|
+
};
|
|
1521
1533
|
var getUserProfileResponseTransformer = async (data) => {
|
|
1522
1534
|
data.data = profileDtoSchemaResponseTransformer(data.data);
|
|
1523
1535
|
return data;
|
|
@@ -1905,6 +1917,9 @@ var zStakingTreasuryApiError404Error = z.object({
|
|
|
1905
1917
|
var zStakingTreasuryApiError500Error = z.object({
|
|
1906
1918
|
code: z.enum(["internal"])
|
|
1907
1919
|
});
|
|
1920
|
+
var zTokenApiError500Error = z.object({
|
|
1921
|
+
code: z.enum(["internal"])
|
|
1922
|
+
});
|
|
1908
1923
|
var zU128Dto = z.string();
|
|
1909
1924
|
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" });
|
|
1910
1925
|
var zAffiliateStatsDto = z.object({
|
|
@@ -2008,8 +2023,13 @@ var zEpochIterationDetailsDto = z.object({
|
|
|
2008
2023
|
z.number(),
|
|
2009
2024
|
z.null()
|
|
2010
2025
|
])),
|
|
2026
|
+
poolTokenAmount: zU64Dto,
|
|
2011
2027
|
poolUsdAmount: zU64Dto,
|
|
2012
2028
|
startedAt: z.preprocess((value) => value instanceof Date ? value.toISOString() : value, z.iso.datetime()),
|
|
2029
|
+
tokenPrice: z.optional(z.union([
|
|
2030
|
+
z.number(),
|
|
2031
|
+
z.null()
|
|
2032
|
+
])),
|
|
2013
2033
|
totalParticipants: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
2014
2034
|
totalTickets: zU64Dto,
|
|
2015
2035
|
triggeredAt: z.optional(z.union([
|
|
@@ -2210,6 +2230,10 @@ var zMinerDeploymentDto = z.object({
|
|
|
2210
2230
|
z.null()
|
|
2211
2231
|
])),
|
|
2212
2232
|
tokenEarned: zU64Dto,
|
|
2233
|
+
tokenEarnedUsd: z.optional(z.union([
|
|
2234
|
+
z.number(),
|
|
2235
|
+
z.null()
|
|
2236
|
+
])),
|
|
2213
2237
|
tokenSharesEarned: zU64Dto,
|
|
2214
2238
|
totalUsdStakeAmount: zU64Dto,
|
|
2215
2239
|
usdEarned: zU64Dto
|
|
@@ -2520,6 +2544,10 @@ var zRoundDeploymentDto = z.object({
|
|
|
2520
2544
|
z.null()
|
|
2521
2545
|
])),
|
|
2522
2546
|
tokenEarned: zU64Dto,
|
|
2547
|
+
tokenEarnedUsd: z.optional(z.union([
|
|
2548
|
+
z.number(),
|
|
2549
|
+
z.null()
|
|
2550
|
+
])),
|
|
2523
2551
|
tokenSharesEarned: zU64Dto,
|
|
2524
2552
|
totalUsdStakeAmount: zU64Dto,
|
|
2525
2553
|
usdEarned: zU64Dto,
|
|
@@ -2758,13 +2786,22 @@ var zStakingPositionDto = z.object({
|
|
|
2758
2786
|
});
|
|
2759
2787
|
var zStakingTreasuryDto = z.object({
|
|
2760
2788
|
address: zPubkeyDto,
|
|
2789
|
+
apr: z.optional(z.union([
|
|
2790
|
+
z.number(),
|
|
2791
|
+
z.null()
|
|
2792
|
+
])),
|
|
2761
2793
|
rewardTokenMint: zPubkeyDto,
|
|
2762
2794
|
rewardVault: zPubkeyDto,
|
|
2763
2795
|
stakedTokenMint: zPubkeyDto,
|
|
2764
2796
|
stakedVault: zPubkeyDto,
|
|
2765
2797
|
totalRewardDeposited: zU64Dto,
|
|
2766
2798
|
totalStaked: zU64Dto,
|
|
2767
|
-
|
|
2799
|
+
totalStakedUsd: z.optional(z.union([
|
|
2800
|
+
z.number(),
|
|
2801
|
+
z.null()
|
|
2802
|
+
])),
|
|
2803
|
+
totalStakers: z.int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
2804
|
+
unstreamedReward: zU64Dto
|
|
2768
2805
|
});
|
|
2769
2806
|
var zStrikeJackpotDto = z.object({
|
|
2770
2807
|
btcAmount: zU64Dto,
|
|
@@ -2811,6 +2848,11 @@ var zRoundDto = z.object({
|
|
|
2811
2848
|
z.null()
|
|
2812
2849
|
]))
|
|
2813
2850
|
});
|
|
2851
|
+
var zTokenStatsDto = z.object({
|
|
2852
|
+
buybackBurned: zU64Dto,
|
|
2853
|
+
lpBurned: zU64Dto,
|
|
2854
|
+
totalBurned: zU64Dto
|
|
2855
|
+
});
|
|
2814
2856
|
var zTokenVaultDto = z.object({
|
|
2815
2857
|
address: zPubkeyDto,
|
|
2816
2858
|
apr: z.optional(z.union([
|
|
@@ -3030,9 +3072,6 @@ var zUserStakingApiError400Error = z.union([
|
|
|
3030
3072
|
])
|
|
3031
3073
|
}).and(zBadRequestErrorCodeErrorBody)
|
|
3032
3074
|
]);
|
|
3033
|
-
var zUserStakingApiError404Error = z.object({
|
|
3034
|
-
code: z.enum(["not_found"])
|
|
3035
|
-
});
|
|
3036
3075
|
var zUserStakingApiError500Error = z.object({
|
|
3037
3076
|
code: z.enum(["internal"])
|
|
3038
3077
|
});
|
|
@@ -3299,6 +3338,14 @@ var zSseData = z.object({
|
|
|
3299
3338
|
}))
|
|
3300
3339
|
});
|
|
3301
3340
|
var zSseResponse2 = zSseResponse;
|
|
3341
|
+
var zGetTokenStatsData = z.object({
|
|
3342
|
+
body: z.optional(z.never()),
|
|
3343
|
+
path: z.optional(z.never()),
|
|
3344
|
+
query: z.optional(z.never())
|
|
3345
|
+
});
|
|
3346
|
+
var zGetTokenStatsResponse = z.object({
|
|
3347
|
+
data: zTokenStatsDto
|
|
3348
|
+
});
|
|
3302
3349
|
var zGetUserProfileData = z.object({
|
|
3303
3350
|
body: z.optional(z.never()),
|
|
3304
3351
|
path: z.object({
|
|
@@ -3715,6 +3762,18 @@ var SatrushBackendSdk = class _SatrushBackendSdk extends HeyApiClient {
|
|
|
3715
3762
|
...params
|
|
3716
3763
|
});
|
|
3717
3764
|
}
|
|
3765
|
+
/**
|
|
3766
|
+
* Request the protocol token stats: lifetime burned tokens, the protocol's buyback burns plus the LP wallet's burns
|
|
3767
|
+
*/
|
|
3768
|
+
getTokenStats(options) {
|
|
3769
|
+
return (options?.client ?? this.client).get({
|
|
3770
|
+
requestValidator: async (data) => await zGetTokenStatsData.parseAsync(data),
|
|
3771
|
+
responseTransformer: getTokenStatsResponseTransformer,
|
|
3772
|
+
responseValidator: async (data) => await zGetTokenStatsResponse.parseAsync(data),
|
|
3773
|
+
url: "/v1/token/stats",
|
|
3774
|
+
...options
|
|
3775
|
+
});
|
|
3776
|
+
}
|
|
3718
3777
|
/**
|
|
3719
3778
|
* Request user profile
|
|
3720
3779
|
*/
|
|
@@ -3861,7 +3920,7 @@ var SatrushBackendSdk = class _SatrushBackendSdk extends HeyApiClient {
|
|
|
3861
3920
|
});
|
|
3862
3921
|
}
|
|
3863
3922
|
/**
|
|
3864
|
-
* Request a wallet's staking position with its claimable reward projected now
|
|
3923
|
+
* Request a wallet's staking position with its claimable reward projected now (the zero position for a wallet that never staked)
|
|
3865
3924
|
*/
|
|
3866
3925
|
getUserStaking(parameters, options) {
|
|
3867
3926
|
const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "address" }] }]);
|
|
@@ -4050,6 +4109,8 @@ export {
|
|
|
4050
4109
|
zGetSatsEarnedLeaderboardResponse,
|
|
4051
4110
|
zGetStakingTreasuryData,
|
|
4052
4111
|
zGetStakingTreasuryResponse,
|
|
4112
|
+
zGetTokenStatsData,
|
|
4113
|
+
zGetTokenStatsResponse,
|
|
4053
4114
|
zGetUserAffiliateData,
|
|
4054
4115
|
zGetUserAffiliateResponse,
|
|
4055
4116
|
zGetUserClaimsData,
|
|
@@ -4139,6 +4200,8 @@ export {
|
|
|
4139
4200
|
zStakingTreasuryDto,
|
|
4140
4201
|
zStrikeJackpotDto,
|
|
4141
4202
|
zTileStakeDto,
|
|
4203
|
+
zTokenApiError500Error,
|
|
4204
|
+
zTokenStatsDto,
|
|
4142
4205
|
zTokenVaultDto,
|
|
4143
4206
|
zU128Dto,
|
|
4144
4207
|
zU64Dto,
|
|
@@ -4168,7 +4231,6 @@ export {
|
|
|
4168
4231
|
zUserReferralsApiError500Error,
|
|
4169
4232
|
zUserStakingApiError400Error,
|
|
4170
4233
|
zUserStakingApiError400InvalidAddress,
|
|
4171
|
-
zUserStakingApiError404Error,
|
|
4172
4234
|
zUserStakingApiError500Error,
|
|
4173
4235
|
zUserVaultEntriesApiError400Error,
|
|
4174
4236
|
zUserVaultEntriesApiError400InvalidAddress,
|