@crypticdot/defituna-api 1.1.46 → 1.1.47
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.d.mts +23 -2
- package/dist/index.d.ts +23 -2
- package/dist/index.js +16 -0
- package/dist/index.mjs +16 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1572,6 +1572,25 @@ declare const FeesStatsGroup$1: z.ZodObject<{
|
|
|
1572
1572
|
runningTotalCollectedFees: number;
|
|
1573
1573
|
runningTotalNetworkFees: number;
|
|
1574
1574
|
}>;
|
|
1575
|
+
declare const StakingRevenueStatsGroup$1: z.ZodObject<{
|
|
1576
|
+
time: z.ZodDate;
|
|
1577
|
+
totalDepositsUsd: z.ZodNumber;
|
|
1578
|
+
totalDepositsSol: z.ZodBigInt;
|
|
1579
|
+
runningTotalDepositsUsd: z.ZodNumber;
|
|
1580
|
+
runningtotalDepositsSol: z.ZodBigInt;
|
|
1581
|
+
}, "strip", z.ZodTypeAny, {
|
|
1582
|
+
time: Date;
|
|
1583
|
+
totalDepositsUsd: number;
|
|
1584
|
+
totalDepositsSol: bigint;
|
|
1585
|
+
runningTotalDepositsUsd: number;
|
|
1586
|
+
runningtotalDepositsSol: bigint;
|
|
1587
|
+
}, {
|
|
1588
|
+
time: Date;
|
|
1589
|
+
totalDepositsUsd: number;
|
|
1590
|
+
totalDepositsSol: bigint;
|
|
1591
|
+
runningTotalDepositsUsd: number;
|
|
1592
|
+
runningtotalDepositsSol: bigint;
|
|
1593
|
+
}>;
|
|
1575
1594
|
declare const UpdateStreamSubscriptionResult: z.ZodObject<{
|
|
1576
1595
|
status: z.ZodString;
|
|
1577
1596
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -4207,7 +4226,7 @@ declare const schemas_UpdateStreamSubscriptionResult: typeof UpdateStreamSubscri
|
|
|
4207
4226
|
declare const schemas_WalletSubscriptionTopic: typeof WalletSubscriptionTopic;
|
|
4208
4227
|
declare const schemas_WalletSubscriptionTopicSchema: typeof WalletSubscriptionTopicSchema;
|
|
4209
4228
|
declare namespace schemas {
|
|
4210
|
-
export { FeesStatsGroup$1 as FeesStatsGroup, LendingPosition$1 as LendingPosition, schemas_LendingPositionNotification as LendingPositionNotification, LimitOrder$1 as LimitOrder, schemas_LimitOrderNotification as LimitOrderNotification, schemas_LimitOrderState as LimitOrderState, schemas_LimitOrderStateSchema as LimitOrderStateSchema, Market$1 as Market, Mint$1 as Mint, schemas_NotificationAction as NotificationAction, schemas_NotificationActionSchema as NotificationActionSchema, schemas_NotificationEntity as NotificationEntity, schemas_NotificationEntitySchema as NotificationEntitySchema, OrderBook$1 as OrderBook, OrderBookEntry$1 as OrderBookEntry, schemas_OrderBookNotification as OrderBookNotification, schemas_OrderBookNotificationMeta as OrderBookNotificationMeta, Pool$1 as Pool, PoolPriceCandle$1 as PoolPriceCandle, PoolPriceUpdate$1 as PoolPriceUpdate, schemas_PoolPriceUpdateNotification as PoolPriceUpdateNotification, schemas_PoolProvider as PoolProvider, schemas_PoolProviderSchema as PoolProviderSchema, schemas_PoolSubscriptionTopic as PoolSubscriptionTopic, schemas_PoolSubscriptionTopicSchema as PoolSubscriptionTopicSchema, PoolSwap$1 as PoolSwap, schemas_PoolSwapNotification as PoolSwapNotification, PoolTicks$1 as PoolTicks, StakingPosition$1 as StakingPosition, StakingPositionHistoryAction$1 as StakingPositionHistoryAction, StakingPositionHistoryActionType$1 as StakingPositionHistoryActionType, schemas_StakingPositionHistoryActionTypeSchema as StakingPositionHistoryActionTypeSchema, schemas_StakingPositionNotification as StakingPositionNotification, StakingTreasury$1 as StakingTreasury, Tick$1 as Tick, TokenOraclePrice$1 as TokenOraclePrice, TunaPosition$1 as TunaPosition, schemas_TunaPositionNotification as TunaPositionNotification, schemas_TunaPositionState as TunaPositionState, schemas_TunaPositionStateSchema as TunaPositionStateSchema, schemas_UpdateStreamSubscriptionResult as UpdateStreamSubscriptionResult, Vault$1 as Vault, VaultHistoricalStats$1 as VaultHistoricalStats, schemas_WalletSubscriptionTopic as WalletSubscriptionTopic, schemas_WalletSubscriptionTopicSchema as WalletSubscriptionTopicSchema };
|
|
4229
|
+
export { FeesStatsGroup$1 as FeesStatsGroup, LendingPosition$1 as LendingPosition, schemas_LendingPositionNotification as LendingPositionNotification, LimitOrder$1 as LimitOrder, schemas_LimitOrderNotification as LimitOrderNotification, schemas_LimitOrderState as LimitOrderState, schemas_LimitOrderStateSchema as LimitOrderStateSchema, Market$1 as Market, Mint$1 as Mint, schemas_NotificationAction as NotificationAction, schemas_NotificationActionSchema as NotificationActionSchema, schemas_NotificationEntity as NotificationEntity, schemas_NotificationEntitySchema as NotificationEntitySchema, OrderBook$1 as OrderBook, OrderBookEntry$1 as OrderBookEntry, schemas_OrderBookNotification as OrderBookNotification, schemas_OrderBookNotificationMeta as OrderBookNotificationMeta, Pool$1 as Pool, PoolPriceCandle$1 as PoolPriceCandle, PoolPriceUpdate$1 as PoolPriceUpdate, schemas_PoolPriceUpdateNotification as PoolPriceUpdateNotification, schemas_PoolProvider as PoolProvider, schemas_PoolProviderSchema as PoolProviderSchema, schemas_PoolSubscriptionTopic as PoolSubscriptionTopic, schemas_PoolSubscriptionTopicSchema as PoolSubscriptionTopicSchema, PoolSwap$1 as PoolSwap, schemas_PoolSwapNotification as PoolSwapNotification, PoolTicks$1 as PoolTicks, StakingPosition$1 as StakingPosition, StakingPositionHistoryAction$1 as StakingPositionHistoryAction, StakingPositionHistoryActionType$1 as StakingPositionHistoryActionType, schemas_StakingPositionHistoryActionTypeSchema as StakingPositionHistoryActionTypeSchema, schemas_StakingPositionNotification as StakingPositionNotification, StakingRevenueStatsGroup$1 as StakingRevenueStatsGroup, StakingTreasury$1 as StakingTreasury, Tick$1 as Tick, TokenOraclePrice$1 as TokenOraclePrice, TunaPosition$1 as TunaPosition, schemas_TunaPositionNotification as TunaPositionNotification, schemas_TunaPositionState as TunaPositionState, schemas_TunaPositionStateSchema as TunaPositionStateSchema, schemas_UpdateStreamSubscriptionResult as UpdateStreamSubscriptionResult, Vault$1 as Vault, VaultHistoricalStats$1 as VaultHistoricalStats, schemas_WalletSubscriptionTopic as WalletSubscriptionTopic, schemas_WalletSubscriptionTopicSchema as WalletSubscriptionTopicSchema };
|
|
4211
4230
|
}
|
|
4212
4231
|
|
|
4213
4232
|
type PoolProviderType = z.infer<typeof PoolProviderSchema>;
|
|
@@ -4235,6 +4254,7 @@ type StakingTreasury = z.infer<typeof StakingTreasury$1>;
|
|
|
4235
4254
|
type StakingPositionHistoryAction = z.infer<typeof StakingPositionHistoryAction$1>;
|
|
4236
4255
|
type PoolPriceCandle = z.infer<typeof PoolPriceCandle$1>;
|
|
4237
4256
|
type FeesStatsGroup = z.infer<typeof FeesStatsGroup$1>;
|
|
4257
|
+
type StakingRevenueStatsGroup = z.infer<typeof StakingRevenueStatsGroup$1>;
|
|
4238
4258
|
type PoolPriceUpdate = z.infer<typeof PoolPriceUpdate$1>;
|
|
4239
4259
|
type SubscriptionPayload = {
|
|
4240
4260
|
pools?: {
|
|
@@ -4319,10 +4339,11 @@ declare class TunaApiClient {
|
|
|
4319
4339
|
getUserStakingPosition(userAddress: string): Promise<StakingPosition>;
|
|
4320
4340
|
getUserStakingPositionHistory(userAddress: string): Promise<StakingPositionHistoryAction[]>;
|
|
4321
4341
|
getFeesStats(from: Date, to: Date, interval: string): Promise<FeesStatsGroup[]>;
|
|
4342
|
+
getStakingRevenueStats(from: Date, to: Date): Promise<StakingRevenueStatsGroup[]>;
|
|
4322
4343
|
getUpdatesStream(): Promise<EventSource>;
|
|
4323
4344
|
updateStreamSubscription(streamId: string, subscription: SubscriptionPayload): Promise<unknown>;
|
|
4324
4345
|
private buildURL;
|
|
4325
4346
|
private appendUrlSearchParams;
|
|
4326
4347
|
}
|
|
4327
4348
|
|
|
4328
|
-
export { type DurationInMs, type FeesStatsGroup, type GetPoolPriceCandlesOptions, type LendingPosition, type LimitOrder, type LimitOrderStateType, type Market, type Mint, NotificationAction, NotificationEntity, type OrderBook, type OrderBookEntry, type Pool, type PoolPriceCandle, type PoolPriceUpdate, PoolProvider, type PoolProviderType, type PoolSubscriptionTopicType, type PoolSwap, type PoolTicks, ProviderFilter, type StakingPosition, type StakingPositionHistoryAction, type StakingPositionHistoryActionType, type StakingTreasury, type SubscriptionPayload, type Tick, type TokenOraclePrice, TunaApiClient, type TunaApiClientConfig, type TunaPosition, TunaPositionState, type TunaPositionStateType, type Vault, type VaultHistoricalStats, type WalletSubscriptionTopicType, schemas };
|
|
4349
|
+
export { type DurationInMs, type FeesStatsGroup, type GetPoolPriceCandlesOptions, type LendingPosition, type LimitOrder, type LimitOrderStateType, type Market, type Mint, NotificationAction, NotificationEntity, type OrderBook, type OrderBookEntry, type Pool, type PoolPriceCandle, type PoolPriceUpdate, PoolProvider, type PoolProviderType, type PoolSubscriptionTopicType, type PoolSwap, type PoolTicks, ProviderFilter, type StakingPosition, type StakingPositionHistoryAction, type StakingPositionHistoryActionType, type StakingRevenueStatsGroup, type StakingTreasury, type SubscriptionPayload, type Tick, type TokenOraclePrice, TunaApiClient, type TunaApiClientConfig, type TunaPosition, TunaPositionState, type TunaPositionStateType, type Vault, type VaultHistoricalStats, type WalletSubscriptionTopicType, schemas };
|
package/dist/index.d.ts
CHANGED
|
@@ -1572,6 +1572,25 @@ declare const FeesStatsGroup$1: z.ZodObject<{
|
|
|
1572
1572
|
runningTotalCollectedFees: number;
|
|
1573
1573
|
runningTotalNetworkFees: number;
|
|
1574
1574
|
}>;
|
|
1575
|
+
declare const StakingRevenueStatsGroup$1: z.ZodObject<{
|
|
1576
|
+
time: z.ZodDate;
|
|
1577
|
+
totalDepositsUsd: z.ZodNumber;
|
|
1578
|
+
totalDepositsSol: z.ZodBigInt;
|
|
1579
|
+
runningTotalDepositsUsd: z.ZodNumber;
|
|
1580
|
+
runningtotalDepositsSol: z.ZodBigInt;
|
|
1581
|
+
}, "strip", z.ZodTypeAny, {
|
|
1582
|
+
time: Date;
|
|
1583
|
+
totalDepositsUsd: number;
|
|
1584
|
+
totalDepositsSol: bigint;
|
|
1585
|
+
runningTotalDepositsUsd: number;
|
|
1586
|
+
runningtotalDepositsSol: bigint;
|
|
1587
|
+
}, {
|
|
1588
|
+
time: Date;
|
|
1589
|
+
totalDepositsUsd: number;
|
|
1590
|
+
totalDepositsSol: bigint;
|
|
1591
|
+
runningTotalDepositsUsd: number;
|
|
1592
|
+
runningtotalDepositsSol: bigint;
|
|
1593
|
+
}>;
|
|
1575
1594
|
declare const UpdateStreamSubscriptionResult: z.ZodObject<{
|
|
1576
1595
|
status: z.ZodString;
|
|
1577
1596
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -4207,7 +4226,7 @@ declare const schemas_UpdateStreamSubscriptionResult: typeof UpdateStreamSubscri
|
|
|
4207
4226
|
declare const schemas_WalletSubscriptionTopic: typeof WalletSubscriptionTopic;
|
|
4208
4227
|
declare const schemas_WalletSubscriptionTopicSchema: typeof WalletSubscriptionTopicSchema;
|
|
4209
4228
|
declare namespace schemas {
|
|
4210
|
-
export { FeesStatsGroup$1 as FeesStatsGroup, LendingPosition$1 as LendingPosition, schemas_LendingPositionNotification as LendingPositionNotification, LimitOrder$1 as LimitOrder, schemas_LimitOrderNotification as LimitOrderNotification, schemas_LimitOrderState as LimitOrderState, schemas_LimitOrderStateSchema as LimitOrderStateSchema, Market$1 as Market, Mint$1 as Mint, schemas_NotificationAction as NotificationAction, schemas_NotificationActionSchema as NotificationActionSchema, schemas_NotificationEntity as NotificationEntity, schemas_NotificationEntitySchema as NotificationEntitySchema, OrderBook$1 as OrderBook, OrderBookEntry$1 as OrderBookEntry, schemas_OrderBookNotification as OrderBookNotification, schemas_OrderBookNotificationMeta as OrderBookNotificationMeta, Pool$1 as Pool, PoolPriceCandle$1 as PoolPriceCandle, PoolPriceUpdate$1 as PoolPriceUpdate, schemas_PoolPriceUpdateNotification as PoolPriceUpdateNotification, schemas_PoolProvider as PoolProvider, schemas_PoolProviderSchema as PoolProviderSchema, schemas_PoolSubscriptionTopic as PoolSubscriptionTopic, schemas_PoolSubscriptionTopicSchema as PoolSubscriptionTopicSchema, PoolSwap$1 as PoolSwap, schemas_PoolSwapNotification as PoolSwapNotification, PoolTicks$1 as PoolTicks, StakingPosition$1 as StakingPosition, StakingPositionHistoryAction$1 as StakingPositionHistoryAction, StakingPositionHistoryActionType$1 as StakingPositionHistoryActionType, schemas_StakingPositionHistoryActionTypeSchema as StakingPositionHistoryActionTypeSchema, schemas_StakingPositionNotification as StakingPositionNotification, StakingTreasury$1 as StakingTreasury, Tick$1 as Tick, TokenOraclePrice$1 as TokenOraclePrice, TunaPosition$1 as TunaPosition, schemas_TunaPositionNotification as TunaPositionNotification, schemas_TunaPositionState as TunaPositionState, schemas_TunaPositionStateSchema as TunaPositionStateSchema, schemas_UpdateStreamSubscriptionResult as UpdateStreamSubscriptionResult, Vault$1 as Vault, VaultHistoricalStats$1 as VaultHistoricalStats, schemas_WalletSubscriptionTopic as WalletSubscriptionTopic, schemas_WalletSubscriptionTopicSchema as WalletSubscriptionTopicSchema };
|
|
4229
|
+
export { FeesStatsGroup$1 as FeesStatsGroup, LendingPosition$1 as LendingPosition, schemas_LendingPositionNotification as LendingPositionNotification, LimitOrder$1 as LimitOrder, schemas_LimitOrderNotification as LimitOrderNotification, schemas_LimitOrderState as LimitOrderState, schemas_LimitOrderStateSchema as LimitOrderStateSchema, Market$1 as Market, Mint$1 as Mint, schemas_NotificationAction as NotificationAction, schemas_NotificationActionSchema as NotificationActionSchema, schemas_NotificationEntity as NotificationEntity, schemas_NotificationEntitySchema as NotificationEntitySchema, OrderBook$1 as OrderBook, OrderBookEntry$1 as OrderBookEntry, schemas_OrderBookNotification as OrderBookNotification, schemas_OrderBookNotificationMeta as OrderBookNotificationMeta, Pool$1 as Pool, PoolPriceCandle$1 as PoolPriceCandle, PoolPriceUpdate$1 as PoolPriceUpdate, schemas_PoolPriceUpdateNotification as PoolPriceUpdateNotification, schemas_PoolProvider as PoolProvider, schemas_PoolProviderSchema as PoolProviderSchema, schemas_PoolSubscriptionTopic as PoolSubscriptionTopic, schemas_PoolSubscriptionTopicSchema as PoolSubscriptionTopicSchema, PoolSwap$1 as PoolSwap, schemas_PoolSwapNotification as PoolSwapNotification, PoolTicks$1 as PoolTicks, StakingPosition$1 as StakingPosition, StakingPositionHistoryAction$1 as StakingPositionHistoryAction, StakingPositionHistoryActionType$1 as StakingPositionHistoryActionType, schemas_StakingPositionHistoryActionTypeSchema as StakingPositionHistoryActionTypeSchema, schemas_StakingPositionNotification as StakingPositionNotification, StakingRevenueStatsGroup$1 as StakingRevenueStatsGroup, StakingTreasury$1 as StakingTreasury, Tick$1 as Tick, TokenOraclePrice$1 as TokenOraclePrice, TunaPosition$1 as TunaPosition, schemas_TunaPositionNotification as TunaPositionNotification, schemas_TunaPositionState as TunaPositionState, schemas_TunaPositionStateSchema as TunaPositionStateSchema, schemas_UpdateStreamSubscriptionResult as UpdateStreamSubscriptionResult, Vault$1 as Vault, VaultHistoricalStats$1 as VaultHistoricalStats, schemas_WalletSubscriptionTopic as WalletSubscriptionTopic, schemas_WalletSubscriptionTopicSchema as WalletSubscriptionTopicSchema };
|
|
4211
4230
|
}
|
|
4212
4231
|
|
|
4213
4232
|
type PoolProviderType = z.infer<typeof PoolProviderSchema>;
|
|
@@ -4235,6 +4254,7 @@ type StakingTreasury = z.infer<typeof StakingTreasury$1>;
|
|
|
4235
4254
|
type StakingPositionHistoryAction = z.infer<typeof StakingPositionHistoryAction$1>;
|
|
4236
4255
|
type PoolPriceCandle = z.infer<typeof PoolPriceCandle$1>;
|
|
4237
4256
|
type FeesStatsGroup = z.infer<typeof FeesStatsGroup$1>;
|
|
4257
|
+
type StakingRevenueStatsGroup = z.infer<typeof StakingRevenueStatsGroup$1>;
|
|
4238
4258
|
type PoolPriceUpdate = z.infer<typeof PoolPriceUpdate$1>;
|
|
4239
4259
|
type SubscriptionPayload = {
|
|
4240
4260
|
pools?: {
|
|
@@ -4319,10 +4339,11 @@ declare class TunaApiClient {
|
|
|
4319
4339
|
getUserStakingPosition(userAddress: string): Promise<StakingPosition>;
|
|
4320
4340
|
getUserStakingPositionHistory(userAddress: string): Promise<StakingPositionHistoryAction[]>;
|
|
4321
4341
|
getFeesStats(from: Date, to: Date, interval: string): Promise<FeesStatsGroup[]>;
|
|
4342
|
+
getStakingRevenueStats(from: Date, to: Date): Promise<StakingRevenueStatsGroup[]>;
|
|
4322
4343
|
getUpdatesStream(): Promise<EventSource>;
|
|
4323
4344
|
updateStreamSubscription(streamId: string, subscription: SubscriptionPayload): Promise<unknown>;
|
|
4324
4345
|
private buildURL;
|
|
4325
4346
|
private appendUrlSearchParams;
|
|
4326
4347
|
}
|
|
4327
4348
|
|
|
4328
|
-
export { type DurationInMs, type FeesStatsGroup, type GetPoolPriceCandlesOptions, type LendingPosition, type LimitOrder, type LimitOrderStateType, type Market, type Mint, NotificationAction, NotificationEntity, type OrderBook, type OrderBookEntry, type Pool, type PoolPriceCandle, type PoolPriceUpdate, PoolProvider, type PoolProviderType, type PoolSubscriptionTopicType, type PoolSwap, type PoolTicks, ProviderFilter, type StakingPosition, type StakingPositionHistoryAction, type StakingPositionHistoryActionType, type StakingTreasury, type SubscriptionPayload, type Tick, type TokenOraclePrice, TunaApiClient, type TunaApiClientConfig, type TunaPosition, TunaPositionState, type TunaPositionStateType, type Vault, type VaultHistoricalStats, type WalletSubscriptionTopicType, schemas };
|
|
4349
|
+
export { type DurationInMs, type FeesStatsGroup, type GetPoolPriceCandlesOptions, type LendingPosition, type LimitOrder, type LimitOrderStateType, type Market, type Mint, NotificationAction, NotificationEntity, type OrderBook, type OrderBookEntry, type Pool, type PoolPriceCandle, type PoolPriceUpdate, PoolProvider, type PoolProviderType, type PoolSubscriptionTopicType, type PoolSwap, type PoolTicks, ProviderFilter, type StakingPosition, type StakingPositionHistoryAction, type StakingPositionHistoryActionType, type StakingRevenueStatsGroup, type StakingTreasury, type SubscriptionPayload, type Tick, type TokenOraclePrice, TunaApiClient, type TunaApiClientConfig, type TunaPosition, TunaPositionState, type TunaPositionStateType, type Vault, type VaultHistoricalStats, type WalletSubscriptionTopicType, schemas };
|
package/dist/index.js
CHANGED
|
@@ -79,6 +79,7 @@ __export(schemas_exports, {
|
|
|
79
79
|
StakingPositionHistoryActionType: () => StakingPositionHistoryActionType,
|
|
80
80
|
StakingPositionHistoryActionTypeSchema: () => StakingPositionHistoryActionTypeSchema,
|
|
81
81
|
StakingPositionNotification: () => StakingPositionNotification,
|
|
82
|
+
StakingRevenueStatsGroup: () => StakingRevenueStatsGroup,
|
|
82
83
|
StakingTreasury: () => StakingTreasury,
|
|
83
84
|
Tick: () => Tick,
|
|
84
85
|
TokenOraclePrice: () => TokenOraclePrice,
|
|
@@ -449,6 +450,13 @@ var FeesStatsGroup = import_zod.z.object({
|
|
|
449
450
|
runningTotalCollectedFees: import_zod.z.number(),
|
|
450
451
|
runningTotalNetworkFees: import_zod.z.number()
|
|
451
452
|
});
|
|
453
|
+
var StakingRevenueStatsGroup = import_zod.z.object({
|
|
454
|
+
time: import_zod.z.coerce.date(),
|
|
455
|
+
totalDepositsUsd: import_zod.z.number(),
|
|
456
|
+
totalDepositsSol: import_zod.z.coerce.bigint(),
|
|
457
|
+
runningTotalDepositsUsd: import_zod.z.number(),
|
|
458
|
+
runningtotalDepositsSol: import_zod.z.coerce.bigint()
|
|
459
|
+
});
|
|
452
460
|
var UpdateStreamSubscriptionResult = import_zod.z.object({
|
|
453
461
|
status: import_zod.z.string()
|
|
454
462
|
});
|
|
@@ -666,6 +674,14 @@ var TunaApiClient = class {
|
|
|
666
674
|
});
|
|
667
675
|
return await this.httpRequest(url.toString(), FeesStatsGroup.array());
|
|
668
676
|
}
|
|
677
|
+
async getStakingRevenueStats(from, to) {
|
|
678
|
+
const url = this.buildURL(`stats/staking/revenue`);
|
|
679
|
+
this.appendUrlSearchParams(url, {
|
|
680
|
+
from: from.toISOString(),
|
|
681
|
+
to: to.toISOString()
|
|
682
|
+
});
|
|
683
|
+
return await this.httpRequest(url.toString(), StakingRevenueStatsGroup.array());
|
|
684
|
+
}
|
|
669
685
|
async getUpdatesStream() {
|
|
670
686
|
const url = this.buildURL(`streams/sse`);
|
|
671
687
|
return new EventSource(url.toString());
|
package/dist/index.mjs
CHANGED
|
@@ -44,6 +44,7 @@ __export(schemas_exports, {
|
|
|
44
44
|
StakingPositionHistoryActionType: () => StakingPositionHistoryActionType,
|
|
45
45
|
StakingPositionHistoryActionTypeSchema: () => StakingPositionHistoryActionTypeSchema,
|
|
46
46
|
StakingPositionNotification: () => StakingPositionNotification,
|
|
47
|
+
StakingRevenueStatsGroup: () => StakingRevenueStatsGroup,
|
|
47
48
|
StakingTreasury: () => StakingTreasury,
|
|
48
49
|
Tick: () => Tick,
|
|
49
50
|
TokenOraclePrice: () => TokenOraclePrice,
|
|
@@ -414,6 +415,13 @@ var FeesStatsGroup = z.object({
|
|
|
414
415
|
runningTotalCollectedFees: z.number(),
|
|
415
416
|
runningTotalNetworkFees: z.number()
|
|
416
417
|
});
|
|
418
|
+
var StakingRevenueStatsGroup = z.object({
|
|
419
|
+
time: z.coerce.date(),
|
|
420
|
+
totalDepositsUsd: z.number(),
|
|
421
|
+
totalDepositsSol: z.coerce.bigint(),
|
|
422
|
+
runningTotalDepositsUsd: z.number(),
|
|
423
|
+
runningtotalDepositsSol: z.coerce.bigint()
|
|
424
|
+
});
|
|
417
425
|
var UpdateStreamSubscriptionResult = z.object({
|
|
418
426
|
status: z.string()
|
|
419
427
|
});
|
|
@@ -631,6 +639,14 @@ var TunaApiClient = class {
|
|
|
631
639
|
});
|
|
632
640
|
return await this.httpRequest(url.toString(), FeesStatsGroup.array());
|
|
633
641
|
}
|
|
642
|
+
async getStakingRevenueStats(from, to) {
|
|
643
|
+
const url = this.buildURL(`stats/staking/revenue`);
|
|
644
|
+
this.appendUrlSearchParams(url, {
|
|
645
|
+
from: from.toISOString(),
|
|
646
|
+
to: to.toISOString()
|
|
647
|
+
});
|
|
648
|
+
return await this.httpRequest(url.toString(), StakingRevenueStatsGroup.array());
|
|
649
|
+
}
|
|
634
650
|
async getUpdatesStream() {
|
|
635
651
|
const url = this.buildURL(`streams/sse`);
|
|
636
652
|
return new EventSource(url.toString());
|