@crypticdot/defituna-api 1.1.42 → 1.1.44
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 +98 -6
- package/dist/index.d.ts +98 -6
- package/dist/index.js +41 -14
- package/dist/index.mjs +41 -14
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1440,13 +1440,16 @@ declare const StakingPositionHistoryAction$1: z.ZodObject<{
|
|
|
1440
1440
|
position: z.ZodString;
|
|
1441
1441
|
action: z.ZodEnum<["stake", ...("stake" | "unstake" | "withdraw" | "claim_rewards")[]]>;
|
|
1442
1442
|
txSignature: z.ZodString;
|
|
1443
|
+
amount: z.ZodBigInt;
|
|
1443
1444
|
time: z.ZodDate;
|
|
1444
1445
|
}, "strip", z.ZodTypeAny, {
|
|
1446
|
+
amount: bigint;
|
|
1445
1447
|
time: Date;
|
|
1446
1448
|
position: string;
|
|
1447
1449
|
action: "stake" | "unstake" | "withdraw" | "claim_rewards";
|
|
1448
1450
|
txSignature: string;
|
|
1449
1451
|
}, {
|
|
1452
|
+
amount: bigint;
|
|
1450
1453
|
time: Date;
|
|
1451
1454
|
position: string;
|
|
1452
1455
|
action: "stake" | "unstake" | "withdraw" | "claim_rewards";
|
|
@@ -1474,6 +1477,97 @@ declare const PoolPriceCandle$1: z.ZodObject<{
|
|
|
1474
1477
|
high: number;
|
|
1475
1478
|
low: number;
|
|
1476
1479
|
}>;
|
|
1480
|
+
declare const FeesStatsGroup$1: z.ZodObject<{
|
|
1481
|
+
time: z.ZodDate;
|
|
1482
|
+
addLiquidityFees: z.ZodNumber;
|
|
1483
|
+
limitOrderFees: z.ZodNumber;
|
|
1484
|
+
yieldCompoundingFees: z.ZodNumber;
|
|
1485
|
+
liquidationFees: z.ZodNumber;
|
|
1486
|
+
totalLiquidationsNetworkFees: z.ZodNumber;
|
|
1487
|
+
totalLimitOrdersNetworkFees: z.ZodNumber;
|
|
1488
|
+
totalYieldCompoundingNetworkFees: z.ZodNumber;
|
|
1489
|
+
failedNetworkFees: z.ZodNumber;
|
|
1490
|
+
processedNetworkFees: z.ZodNumber;
|
|
1491
|
+
totalCollectedFees: z.ZodNumber;
|
|
1492
|
+
totalNetworkFees: z.ZodNumber;
|
|
1493
|
+
jitoLiquidationFees: z.ZodNumber;
|
|
1494
|
+
jitoLimitOrderFees: z.ZodNumber;
|
|
1495
|
+
jitoYieldCompoundingFees: z.ZodNumber;
|
|
1496
|
+
runningAddLiquidityFees: z.ZodNumber;
|
|
1497
|
+
runningLimitOrderFees: z.ZodNumber;
|
|
1498
|
+
runningYieldCompoundingFees: z.ZodNumber;
|
|
1499
|
+
runningLiquidationFees: z.ZodNumber;
|
|
1500
|
+
runningTotalLiquidationsNetworkFees: z.ZodNumber;
|
|
1501
|
+
runningTotalLimitOrdersNetworkFees: z.ZodNumber;
|
|
1502
|
+
runningTotalYieldCompoundingNetworkFees: z.ZodNumber;
|
|
1503
|
+
runningFailedNetworkFees: z.ZodNumber;
|
|
1504
|
+
runningProcessedNetworkFees: z.ZodNumber;
|
|
1505
|
+
runningJitoLiquidationFees: z.ZodNumber;
|
|
1506
|
+
runningJitoLimitOrderFees: z.ZodNumber;
|
|
1507
|
+
runningJitoYieldCompoundingFees: z.ZodNumber;
|
|
1508
|
+
runningTotalCollectedFees: z.ZodNumber;
|
|
1509
|
+
runningTotalNetworkFees: z.ZodNumber;
|
|
1510
|
+
}, "strip", z.ZodTypeAny, {
|
|
1511
|
+
time: Date;
|
|
1512
|
+
addLiquidityFees: number;
|
|
1513
|
+
limitOrderFees: number;
|
|
1514
|
+
yieldCompoundingFees: number;
|
|
1515
|
+
liquidationFees: number;
|
|
1516
|
+
totalLiquidationsNetworkFees: number;
|
|
1517
|
+
totalLimitOrdersNetworkFees: number;
|
|
1518
|
+
totalYieldCompoundingNetworkFees: number;
|
|
1519
|
+
failedNetworkFees: number;
|
|
1520
|
+
processedNetworkFees: number;
|
|
1521
|
+
totalCollectedFees: number;
|
|
1522
|
+
totalNetworkFees: number;
|
|
1523
|
+
jitoLiquidationFees: number;
|
|
1524
|
+
jitoLimitOrderFees: number;
|
|
1525
|
+
jitoYieldCompoundingFees: number;
|
|
1526
|
+
runningAddLiquidityFees: number;
|
|
1527
|
+
runningLimitOrderFees: number;
|
|
1528
|
+
runningYieldCompoundingFees: number;
|
|
1529
|
+
runningLiquidationFees: number;
|
|
1530
|
+
runningTotalLiquidationsNetworkFees: number;
|
|
1531
|
+
runningTotalLimitOrdersNetworkFees: number;
|
|
1532
|
+
runningTotalYieldCompoundingNetworkFees: number;
|
|
1533
|
+
runningFailedNetworkFees: number;
|
|
1534
|
+
runningProcessedNetworkFees: number;
|
|
1535
|
+
runningJitoLiquidationFees: number;
|
|
1536
|
+
runningJitoLimitOrderFees: number;
|
|
1537
|
+
runningJitoYieldCompoundingFees: number;
|
|
1538
|
+
runningTotalCollectedFees: number;
|
|
1539
|
+
runningTotalNetworkFees: number;
|
|
1540
|
+
}, {
|
|
1541
|
+
time: Date;
|
|
1542
|
+
addLiquidityFees: number;
|
|
1543
|
+
limitOrderFees: number;
|
|
1544
|
+
yieldCompoundingFees: number;
|
|
1545
|
+
liquidationFees: number;
|
|
1546
|
+
totalLiquidationsNetworkFees: number;
|
|
1547
|
+
totalLimitOrdersNetworkFees: number;
|
|
1548
|
+
totalYieldCompoundingNetworkFees: number;
|
|
1549
|
+
failedNetworkFees: number;
|
|
1550
|
+
processedNetworkFees: number;
|
|
1551
|
+
totalCollectedFees: number;
|
|
1552
|
+
totalNetworkFees: number;
|
|
1553
|
+
jitoLiquidationFees: number;
|
|
1554
|
+
jitoLimitOrderFees: number;
|
|
1555
|
+
jitoYieldCompoundingFees: number;
|
|
1556
|
+
runningAddLiquidityFees: number;
|
|
1557
|
+
runningLimitOrderFees: number;
|
|
1558
|
+
runningYieldCompoundingFees: number;
|
|
1559
|
+
runningLiquidationFees: number;
|
|
1560
|
+
runningTotalLiquidationsNetworkFees: number;
|
|
1561
|
+
runningTotalLimitOrdersNetworkFees: number;
|
|
1562
|
+
runningTotalYieldCompoundingNetworkFees: number;
|
|
1563
|
+
runningFailedNetworkFees: number;
|
|
1564
|
+
runningProcessedNetworkFees: number;
|
|
1565
|
+
runningJitoLiquidationFees: number;
|
|
1566
|
+
runningJitoLimitOrderFees: number;
|
|
1567
|
+
runningJitoYieldCompoundingFees: number;
|
|
1568
|
+
runningTotalCollectedFees: number;
|
|
1569
|
+
runningTotalNetworkFees: number;
|
|
1570
|
+
}>;
|
|
1477
1571
|
declare const UpdateStreamSubscriptionResult: z.ZodObject<{
|
|
1478
1572
|
status: z.ZodString;
|
|
1479
1573
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -4109,7 +4203,7 @@ declare const schemas_UpdateStreamSubscriptionResult: typeof UpdateStreamSubscri
|
|
|
4109
4203
|
declare const schemas_WalletSubscriptionTopic: typeof WalletSubscriptionTopic;
|
|
4110
4204
|
declare const schemas_WalletSubscriptionTopicSchema: typeof WalletSubscriptionTopicSchema;
|
|
4111
4205
|
declare namespace schemas {
|
|
4112
|
-
export { 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 };
|
|
4206
|
+
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 };
|
|
4113
4207
|
}
|
|
4114
4208
|
|
|
4115
4209
|
type PoolProviderType = z.infer<typeof PoolProviderSchema>;
|
|
@@ -4136,6 +4230,7 @@ type StakingPosition = z.infer<typeof StakingPosition$1>;
|
|
|
4136
4230
|
type StakingTreasury = z.infer<typeof StakingTreasury$1>;
|
|
4137
4231
|
type StakingPositionHistoryAction = z.infer<typeof StakingPositionHistoryAction$1>;
|
|
4138
4232
|
type PoolPriceCandle = z.infer<typeof PoolPriceCandle$1>;
|
|
4233
|
+
type FeesStatsGroup = z.infer<typeof FeesStatsGroup$1>;
|
|
4139
4234
|
type PoolPriceUpdate = z.infer<typeof PoolPriceUpdate$1>;
|
|
4140
4235
|
type SubscriptionPayload = {
|
|
4141
4236
|
pools?: {
|
|
@@ -4219,14 +4314,11 @@ declare class TunaApiClient {
|
|
|
4219
4314
|
getUserLimitOrderByAddress(userAddress: string, limitOrderAddress: string): Promise<LimitOrder>;
|
|
4220
4315
|
getUserStakingPosition(userAddress: string): Promise<StakingPosition>;
|
|
4221
4316
|
getUserStakingPositionHistory(userAddress: string): Promise<StakingPositionHistoryAction[]>;
|
|
4222
|
-
|
|
4223
|
-
* @deprecated Use getUpdatesStream instead
|
|
4224
|
-
*/
|
|
4225
|
-
getPoolUpdatesStream(poolAddress: string, priceStep?: number, inverted?: boolean): Promise<EventSource>;
|
|
4317
|
+
getFeesStats(from: Date, to: Date, interval: string): Promise<FeesStatsGroup[]>;
|
|
4226
4318
|
getUpdatesStream(): Promise<EventSource>;
|
|
4227
4319
|
updateStreamSubscription(streamId: string, subscription: SubscriptionPayload): Promise<unknown>;
|
|
4228
4320
|
private buildURL;
|
|
4229
4321
|
private appendUrlSearchParams;
|
|
4230
4322
|
}
|
|
4231
4323
|
|
|
4232
|
-
export { type DurationInMs, 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 };
|
|
4324
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1440,13 +1440,16 @@ declare const StakingPositionHistoryAction$1: z.ZodObject<{
|
|
|
1440
1440
|
position: z.ZodString;
|
|
1441
1441
|
action: z.ZodEnum<["stake", ...("stake" | "unstake" | "withdraw" | "claim_rewards")[]]>;
|
|
1442
1442
|
txSignature: z.ZodString;
|
|
1443
|
+
amount: z.ZodBigInt;
|
|
1443
1444
|
time: z.ZodDate;
|
|
1444
1445
|
}, "strip", z.ZodTypeAny, {
|
|
1446
|
+
amount: bigint;
|
|
1445
1447
|
time: Date;
|
|
1446
1448
|
position: string;
|
|
1447
1449
|
action: "stake" | "unstake" | "withdraw" | "claim_rewards";
|
|
1448
1450
|
txSignature: string;
|
|
1449
1451
|
}, {
|
|
1452
|
+
amount: bigint;
|
|
1450
1453
|
time: Date;
|
|
1451
1454
|
position: string;
|
|
1452
1455
|
action: "stake" | "unstake" | "withdraw" | "claim_rewards";
|
|
@@ -1474,6 +1477,97 @@ declare const PoolPriceCandle$1: z.ZodObject<{
|
|
|
1474
1477
|
high: number;
|
|
1475
1478
|
low: number;
|
|
1476
1479
|
}>;
|
|
1480
|
+
declare const FeesStatsGroup$1: z.ZodObject<{
|
|
1481
|
+
time: z.ZodDate;
|
|
1482
|
+
addLiquidityFees: z.ZodNumber;
|
|
1483
|
+
limitOrderFees: z.ZodNumber;
|
|
1484
|
+
yieldCompoundingFees: z.ZodNumber;
|
|
1485
|
+
liquidationFees: z.ZodNumber;
|
|
1486
|
+
totalLiquidationsNetworkFees: z.ZodNumber;
|
|
1487
|
+
totalLimitOrdersNetworkFees: z.ZodNumber;
|
|
1488
|
+
totalYieldCompoundingNetworkFees: z.ZodNumber;
|
|
1489
|
+
failedNetworkFees: z.ZodNumber;
|
|
1490
|
+
processedNetworkFees: z.ZodNumber;
|
|
1491
|
+
totalCollectedFees: z.ZodNumber;
|
|
1492
|
+
totalNetworkFees: z.ZodNumber;
|
|
1493
|
+
jitoLiquidationFees: z.ZodNumber;
|
|
1494
|
+
jitoLimitOrderFees: z.ZodNumber;
|
|
1495
|
+
jitoYieldCompoundingFees: z.ZodNumber;
|
|
1496
|
+
runningAddLiquidityFees: z.ZodNumber;
|
|
1497
|
+
runningLimitOrderFees: z.ZodNumber;
|
|
1498
|
+
runningYieldCompoundingFees: z.ZodNumber;
|
|
1499
|
+
runningLiquidationFees: z.ZodNumber;
|
|
1500
|
+
runningTotalLiquidationsNetworkFees: z.ZodNumber;
|
|
1501
|
+
runningTotalLimitOrdersNetworkFees: z.ZodNumber;
|
|
1502
|
+
runningTotalYieldCompoundingNetworkFees: z.ZodNumber;
|
|
1503
|
+
runningFailedNetworkFees: z.ZodNumber;
|
|
1504
|
+
runningProcessedNetworkFees: z.ZodNumber;
|
|
1505
|
+
runningJitoLiquidationFees: z.ZodNumber;
|
|
1506
|
+
runningJitoLimitOrderFees: z.ZodNumber;
|
|
1507
|
+
runningJitoYieldCompoundingFees: z.ZodNumber;
|
|
1508
|
+
runningTotalCollectedFees: z.ZodNumber;
|
|
1509
|
+
runningTotalNetworkFees: z.ZodNumber;
|
|
1510
|
+
}, "strip", z.ZodTypeAny, {
|
|
1511
|
+
time: Date;
|
|
1512
|
+
addLiquidityFees: number;
|
|
1513
|
+
limitOrderFees: number;
|
|
1514
|
+
yieldCompoundingFees: number;
|
|
1515
|
+
liquidationFees: number;
|
|
1516
|
+
totalLiquidationsNetworkFees: number;
|
|
1517
|
+
totalLimitOrdersNetworkFees: number;
|
|
1518
|
+
totalYieldCompoundingNetworkFees: number;
|
|
1519
|
+
failedNetworkFees: number;
|
|
1520
|
+
processedNetworkFees: number;
|
|
1521
|
+
totalCollectedFees: number;
|
|
1522
|
+
totalNetworkFees: number;
|
|
1523
|
+
jitoLiquidationFees: number;
|
|
1524
|
+
jitoLimitOrderFees: number;
|
|
1525
|
+
jitoYieldCompoundingFees: number;
|
|
1526
|
+
runningAddLiquidityFees: number;
|
|
1527
|
+
runningLimitOrderFees: number;
|
|
1528
|
+
runningYieldCompoundingFees: number;
|
|
1529
|
+
runningLiquidationFees: number;
|
|
1530
|
+
runningTotalLiquidationsNetworkFees: number;
|
|
1531
|
+
runningTotalLimitOrdersNetworkFees: number;
|
|
1532
|
+
runningTotalYieldCompoundingNetworkFees: number;
|
|
1533
|
+
runningFailedNetworkFees: number;
|
|
1534
|
+
runningProcessedNetworkFees: number;
|
|
1535
|
+
runningJitoLiquidationFees: number;
|
|
1536
|
+
runningJitoLimitOrderFees: number;
|
|
1537
|
+
runningJitoYieldCompoundingFees: number;
|
|
1538
|
+
runningTotalCollectedFees: number;
|
|
1539
|
+
runningTotalNetworkFees: number;
|
|
1540
|
+
}, {
|
|
1541
|
+
time: Date;
|
|
1542
|
+
addLiquidityFees: number;
|
|
1543
|
+
limitOrderFees: number;
|
|
1544
|
+
yieldCompoundingFees: number;
|
|
1545
|
+
liquidationFees: number;
|
|
1546
|
+
totalLiquidationsNetworkFees: number;
|
|
1547
|
+
totalLimitOrdersNetworkFees: number;
|
|
1548
|
+
totalYieldCompoundingNetworkFees: number;
|
|
1549
|
+
failedNetworkFees: number;
|
|
1550
|
+
processedNetworkFees: number;
|
|
1551
|
+
totalCollectedFees: number;
|
|
1552
|
+
totalNetworkFees: number;
|
|
1553
|
+
jitoLiquidationFees: number;
|
|
1554
|
+
jitoLimitOrderFees: number;
|
|
1555
|
+
jitoYieldCompoundingFees: number;
|
|
1556
|
+
runningAddLiquidityFees: number;
|
|
1557
|
+
runningLimitOrderFees: number;
|
|
1558
|
+
runningYieldCompoundingFees: number;
|
|
1559
|
+
runningLiquidationFees: number;
|
|
1560
|
+
runningTotalLiquidationsNetworkFees: number;
|
|
1561
|
+
runningTotalLimitOrdersNetworkFees: number;
|
|
1562
|
+
runningTotalYieldCompoundingNetworkFees: number;
|
|
1563
|
+
runningFailedNetworkFees: number;
|
|
1564
|
+
runningProcessedNetworkFees: number;
|
|
1565
|
+
runningJitoLiquidationFees: number;
|
|
1566
|
+
runningJitoLimitOrderFees: number;
|
|
1567
|
+
runningJitoYieldCompoundingFees: number;
|
|
1568
|
+
runningTotalCollectedFees: number;
|
|
1569
|
+
runningTotalNetworkFees: number;
|
|
1570
|
+
}>;
|
|
1477
1571
|
declare const UpdateStreamSubscriptionResult: z.ZodObject<{
|
|
1478
1572
|
status: z.ZodString;
|
|
1479
1573
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -4109,7 +4203,7 @@ declare const schemas_UpdateStreamSubscriptionResult: typeof UpdateStreamSubscri
|
|
|
4109
4203
|
declare const schemas_WalletSubscriptionTopic: typeof WalletSubscriptionTopic;
|
|
4110
4204
|
declare const schemas_WalletSubscriptionTopicSchema: typeof WalletSubscriptionTopicSchema;
|
|
4111
4205
|
declare namespace schemas {
|
|
4112
|
-
export { 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 };
|
|
4206
|
+
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 };
|
|
4113
4207
|
}
|
|
4114
4208
|
|
|
4115
4209
|
type PoolProviderType = z.infer<typeof PoolProviderSchema>;
|
|
@@ -4136,6 +4230,7 @@ type StakingPosition = z.infer<typeof StakingPosition$1>;
|
|
|
4136
4230
|
type StakingTreasury = z.infer<typeof StakingTreasury$1>;
|
|
4137
4231
|
type StakingPositionHistoryAction = z.infer<typeof StakingPositionHistoryAction$1>;
|
|
4138
4232
|
type PoolPriceCandle = z.infer<typeof PoolPriceCandle$1>;
|
|
4233
|
+
type FeesStatsGroup = z.infer<typeof FeesStatsGroup$1>;
|
|
4139
4234
|
type PoolPriceUpdate = z.infer<typeof PoolPriceUpdate$1>;
|
|
4140
4235
|
type SubscriptionPayload = {
|
|
4141
4236
|
pools?: {
|
|
@@ -4219,14 +4314,11 @@ declare class TunaApiClient {
|
|
|
4219
4314
|
getUserLimitOrderByAddress(userAddress: string, limitOrderAddress: string): Promise<LimitOrder>;
|
|
4220
4315
|
getUserStakingPosition(userAddress: string): Promise<StakingPosition>;
|
|
4221
4316
|
getUserStakingPositionHistory(userAddress: string): Promise<StakingPositionHistoryAction[]>;
|
|
4222
|
-
|
|
4223
|
-
* @deprecated Use getUpdatesStream instead
|
|
4224
|
-
*/
|
|
4225
|
-
getPoolUpdatesStream(poolAddress: string, priceStep?: number, inverted?: boolean): Promise<EventSource>;
|
|
4317
|
+
getFeesStats(from: Date, to: Date, interval: string): Promise<FeesStatsGroup[]>;
|
|
4226
4318
|
getUpdatesStream(): Promise<EventSource>;
|
|
4227
4319
|
updateStreamSubscription(streamId: string, subscription: SubscriptionPayload): Promise<unknown>;
|
|
4228
4320
|
private buildURL;
|
|
4229
4321
|
private appendUrlSearchParams;
|
|
4230
4322
|
}
|
|
4231
4323
|
|
|
4232
|
-
export { type DurationInMs, 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 };
|
|
4324
|
+
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 };
|
package/dist/index.js
CHANGED
|
@@ -46,6 +46,7 @@ var import_snakecase_keys = __toESM(require("snakecase-keys"));
|
|
|
46
46
|
// src/client/schemas.ts
|
|
47
47
|
var schemas_exports = {};
|
|
48
48
|
__export(schemas_exports, {
|
|
49
|
+
FeesStatsGroup: () => FeesStatsGroup,
|
|
49
50
|
LendingPosition: () => LendingPosition,
|
|
50
51
|
LendingPositionNotification: () => LendingPositionNotification,
|
|
51
52
|
LimitOrder: () => LimitOrder,
|
|
@@ -404,6 +405,7 @@ var StakingPositionHistoryAction = import_zod.z.object({
|
|
|
404
405
|
position: import_zod.z.string(),
|
|
405
406
|
action: StakingPositionHistoryActionTypeSchema,
|
|
406
407
|
txSignature: import_zod.z.string(),
|
|
408
|
+
amount: import_zod.z.coerce.bigint(),
|
|
407
409
|
time: import_zod.z.coerce.date()
|
|
408
410
|
});
|
|
409
411
|
var PoolPriceCandle = import_zod.z.object({
|
|
@@ -414,6 +416,37 @@ var PoolPriceCandle = import_zod.z.object({
|
|
|
414
416
|
low: import_zod.z.number(),
|
|
415
417
|
volume: import_zod.z.number()
|
|
416
418
|
});
|
|
419
|
+
var FeesStatsGroup = import_zod.z.object({
|
|
420
|
+
time: import_zod.z.coerce.date(),
|
|
421
|
+
addLiquidityFees: import_zod.z.number(),
|
|
422
|
+
limitOrderFees: import_zod.z.number(),
|
|
423
|
+
yieldCompoundingFees: import_zod.z.number(),
|
|
424
|
+
liquidationFees: import_zod.z.number(),
|
|
425
|
+
totalLiquidationsNetworkFees: import_zod.z.number(),
|
|
426
|
+
totalLimitOrdersNetworkFees: import_zod.z.number(),
|
|
427
|
+
totalYieldCompoundingNetworkFees: import_zod.z.number(),
|
|
428
|
+
failedNetworkFees: import_zod.z.number(),
|
|
429
|
+
processedNetworkFees: import_zod.z.number(),
|
|
430
|
+
totalCollectedFees: import_zod.z.number(),
|
|
431
|
+
totalNetworkFees: import_zod.z.number(),
|
|
432
|
+
jitoLiquidationFees: import_zod.z.number(),
|
|
433
|
+
jitoLimitOrderFees: import_zod.z.number(),
|
|
434
|
+
jitoYieldCompoundingFees: import_zod.z.number(),
|
|
435
|
+
runningAddLiquidityFees: import_zod.z.number(),
|
|
436
|
+
runningLimitOrderFees: import_zod.z.number(),
|
|
437
|
+
runningYieldCompoundingFees: import_zod.z.number(),
|
|
438
|
+
runningLiquidationFees: import_zod.z.number(),
|
|
439
|
+
runningTotalLiquidationsNetworkFees: import_zod.z.number(),
|
|
440
|
+
runningTotalLimitOrdersNetworkFees: import_zod.z.number(),
|
|
441
|
+
runningTotalYieldCompoundingNetworkFees: import_zod.z.number(),
|
|
442
|
+
runningFailedNetworkFees: import_zod.z.number(),
|
|
443
|
+
runningProcessedNetworkFees: import_zod.z.number(),
|
|
444
|
+
runningJitoLiquidationFees: import_zod.z.number(),
|
|
445
|
+
runningJitoLimitOrderFees: import_zod.z.number(),
|
|
446
|
+
runningJitoYieldCompoundingFees: import_zod.z.number(),
|
|
447
|
+
runningTotalCollectedFees: import_zod.z.number(),
|
|
448
|
+
runningTotalNetworkFees: import_zod.z.number()
|
|
449
|
+
});
|
|
417
450
|
var UpdateStreamSubscriptionResult = import_zod.z.object({
|
|
418
451
|
status: import_zod.z.string()
|
|
419
452
|
});
|
|
@@ -622,20 +655,14 @@ var TunaApiClient = class {
|
|
|
622
655
|
const url = this.buildURL(`users/${userAddress}/staking-position/history`);
|
|
623
656
|
return await this.httpRequest(url.toString(), StakingPositionHistoryAction.array());
|
|
624
657
|
}
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
}
|
|
634
|
-
if (inverted) {
|
|
635
|
-
this.appendUrlSearchParams(url, { inverted: inverted.toString() });
|
|
636
|
-
}
|
|
637
|
-
this.appendUrlSearchParams(url, { ts: Date.now().toString() });
|
|
638
|
-
return new EventSource(url.toString());
|
|
658
|
+
async getFeesStats(from, to, interval) {
|
|
659
|
+
const url = this.buildURL(`stats/fees`);
|
|
660
|
+
this.appendUrlSearchParams(url, {
|
|
661
|
+
from: from.toISOString(),
|
|
662
|
+
to: to.toISOString(),
|
|
663
|
+
interval
|
|
664
|
+
});
|
|
665
|
+
return await this.httpRequest(url.toString(), FeesStatsGroup.array());
|
|
639
666
|
}
|
|
640
667
|
async getUpdatesStream() {
|
|
641
668
|
const url = this.buildURL(`streams/sse`);
|
package/dist/index.mjs
CHANGED
|
@@ -11,6 +11,7 @@ import snakecaseKeys from "snakecase-keys";
|
|
|
11
11
|
// src/client/schemas.ts
|
|
12
12
|
var schemas_exports = {};
|
|
13
13
|
__export(schemas_exports, {
|
|
14
|
+
FeesStatsGroup: () => FeesStatsGroup,
|
|
14
15
|
LendingPosition: () => LendingPosition,
|
|
15
16
|
LendingPositionNotification: () => LendingPositionNotification,
|
|
16
17
|
LimitOrder: () => LimitOrder,
|
|
@@ -369,6 +370,7 @@ var StakingPositionHistoryAction = z.object({
|
|
|
369
370
|
position: z.string(),
|
|
370
371
|
action: StakingPositionHistoryActionTypeSchema,
|
|
371
372
|
txSignature: z.string(),
|
|
373
|
+
amount: z.coerce.bigint(),
|
|
372
374
|
time: z.coerce.date()
|
|
373
375
|
});
|
|
374
376
|
var PoolPriceCandle = z.object({
|
|
@@ -379,6 +381,37 @@ var PoolPriceCandle = z.object({
|
|
|
379
381
|
low: z.number(),
|
|
380
382
|
volume: z.number()
|
|
381
383
|
});
|
|
384
|
+
var FeesStatsGroup = z.object({
|
|
385
|
+
time: z.coerce.date(),
|
|
386
|
+
addLiquidityFees: z.number(),
|
|
387
|
+
limitOrderFees: z.number(),
|
|
388
|
+
yieldCompoundingFees: z.number(),
|
|
389
|
+
liquidationFees: z.number(),
|
|
390
|
+
totalLiquidationsNetworkFees: z.number(),
|
|
391
|
+
totalLimitOrdersNetworkFees: z.number(),
|
|
392
|
+
totalYieldCompoundingNetworkFees: z.number(),
|
|
393
|
+
failedNetworkFees: z.number(),
|
|
394
|
+
processedNetworkFees: z.number(),
|
|
395
|
+
totalCollectedFees: z.number(),
|
|
396
|
+
totalNetworkFees: z.number(),
|
|
397
|
+
jitoLiquidationFees: z.number(),
|
|
398
|
+
jitoLimitOrderFees: z.number(),
|
|
399
|
+
jitoYieldCompoundingFees: z.number(),
|
|
400
|
+
runningAddLiquidityFees: z.number(),
|
|
401
|
+
runningLimitOrderFees: z.number(),
|
|
402
|
+
runningYieldCompoundingFees: z.number(),
|
|
403
|
+
runningLiquidationFees: z.number(),
|
|
404
|
+
runningTotalLiquidationsNetworkFees: z.number(),
|
|
405
|
+
runningTotalLimitOrdersNetworkFees: z.number(),
|
|
406
|
+
runningTotalYieldCompoundingNetworkFees: z.number(),
|
|
407
|
+
runningFailedNetworkFees: z.number(),
|
|
408
|
+
runningProcessedNetworkFees: z.number(),
|
|
409
|
+
runningJitoLiquidationFees: z.number(),
|
|
410
|
+
runningJitoLimitOrderFees: z.number(),
|
|
411
|
+
runningJitoYieldCompoundingFees: z.number(),
|
|
412
|
+
runningTotalCollectedFees: z.number(),
|
|
413
|
+
runningTotalNetworkFees: z.number()
|
|
414
|
+
});
|
|
382
415
|
var UpdateStreamSubscriptionResult = z.object({
|
|
383
416
|
status: z.string()
|
|
384
417
|
});
|
|
@@ -587,20 +620,14 @@ var TunaApiClient = class {
|
|
|
587
620
|
const url = this.buildURL(`users/${userAddress}/staking-position/history`);
|
|
588
621
|
return await this.httpRequest(url.toString(), StakingPositionHistoryAction.array());
|
|
589
622
|
}
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
}
|
|
599
|
-
if (inverted) {
|
|
600
|
-
this.appendUrlSearchParams(url, { inverted: inverted.toString() });
|
|
601
|
-
}
|
|
602
|
-
this.appendUrlSearchParams(url, { ts: Date.now().toString() });
|
|
603
|
-
return new EventSource(url.toString());
|
|
623
|
+
async getFeesStats(from, to, interval) {
|
|
624
|
+
const url = this.buildURL(`stats/fees`);
|
|
625
|
+
this.appendUrlSearchParams(url, {
|
|
626
|
+
from: from.toISOString(),
|
|
627
|
+
to: to.toISOString(),
|
|
628
|
+
interval
|
|
629
|
+
});
|
|
630
|
+
return await this.httpRequest(url.toString(), FeesStatsGroup.array());
|
|
604
631
|
}
|
|
605
632
|
async getUpdatesStream() {
|
|
606
633
|
const url = this.buildURL(`streams/sse`);
|