@crypticdot/defituna-api 1.10.12 → 1.10.14
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 +271 -139
- package/dist/index.d.ts +271 -139
- package/dist/index.js +260 -273
- package/dist/index.mjs +260 -273
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -53,7 +53,6 @@ __export(schemas_exports, {
|
|
|
53
53
|
PoolPriceCandle: () => PoolPriceCandle,
|
|
54
54
|
PoolProvider: () => PoolProvider,
|
|
55
55
|
PoolProviderSchema: () => PoolProviderSchema,
|
|
56
|
-
PoolSnapshot: () => PoolSnapshot,
|
|
57
56
|
PoolSubscriptionTopic: () => PoolSubscriptionTopic,
|
|
58
57
|
PoolSubscriptionTopicSchema: () => PoolSubscriptionTopicSchema,
|
|
59
58
|
PoolSwap: () => PoolSwap,
|
|
@@ -117,7 +116,7 @@ __export(schemas_exports, {
|
|
|
117
116
|
WalletSubscriptionTopic: () => WalletSubscriptionTopic,
|
|
118
117
|
WalletSubscriptionTopicSchema: () => WalletSubscriptionTopicSchema
|
|
119
118
|
});
|
|
120
|
-
import { z as
|
|
119
|
+
import { z as z11 } from "zod";
|
|
121
120
|
|
|
122
121
|
// src/client/schemas/basic.ts
|
|
123
122
|
import { z } from "zod";
|
|
@@ -188,7 +187,7 @@ var Pool = z3.object({
|
|
|
188
187
|
});
|
|
189
188
|
|
|
190
189
|
// src/client/schemas/state_snapshot.ts
|
|
191
|
-
import
|
|
190
|
+
import z10 from "zod";
|
|
192
191
|
|
|
193
192
|
// src/client/schemas/limit_orders.ts
|
|
194
193
|
import { z as z4 } from "zod";
|
|
@@ -512,44 +511,68 @@ var TunaLpPositionAction = z6.object({
|
|
|
512
511
|
})
|
|
513
512
|
});
|
|
514
513
|
|
|
514
|
+
// src/client/schemas/market.ts
|
|
515
|
+
import { z as z7 } from "zod";
|
|
516
|
+
var Market = z7.object({
|
|
517
|
+
address: z7.string(),
|
|
518
|
+
addressLookupTable: z7.string(),
|
|
519
|
+
maxLeverage: z7.number(),
|
|
520
|
+
maxSwapSlippage: z7.number(),
|
|
521
|
+
protocolFee: z7.number(),
|
|
522
|
+
protocolFeeOnCollateral: z7.number(),
|
|
523
|
+
liquidationFee: z7.number(),
|
|
524
|
+
liquidationThreshold: z7.number(),
|
|
525
|
+
oraclePriceDeviationThreshold: z7.number(),
|
|
526
|
+
rebalanceProtocolFee: z7.number(),
|
|
527
|
+
borrowedFundsA: AmountWithUsdSchema,
|
|
528
|
+
borrowedFundsB: AmountWithUsdSchema,
|
|
529
|
+
borrowLimitA: AmountWithUsdSchema,
|
|
530
|
+
borrowLimitB: AmountWithUsdSchema,
|
|
531
|
+
maxSpotPositionSizeA: AmountWithUsdSchema,
|
|
532
|
+
maxSpotPositionSizeB: AmountWithUsdSchema,
|
|
533
|
+
pool: Pool,
|
|
534
|
+
disabled: z7.boolean(),
|
|
535
|
+
createdAt: z7.coerce.date()
|
|
536
|
+
});
|
|
537
|
+
|
|
515
538
|
// src/client/schemas/order_book.ts
|
|
516
|
-
import
|
|
517
|
-
var OrderBookEntry =
|
|
518
|
-
concentratedAmount:
|
|
519
|
-
concentratedAmountQuote:
|
|
520
|
-
concentratedTotal:
|
|
521
|
-
concentratedTotalQuote:
|
|
522
|
-
limitAmount:
|
|
523
|
-
limitAmountQuote:
|
|
524
|
-
limitTotal:
|
|
525
|
-
limitTotalQuote:
|
|
526
|
-
price:
|
|
527
|
-
askSide:
|
|
539
|
+
import z8 from "zod";
|
|
540
|
+
var OrderBookEntry = z8.object({
|
|
541
|
+
concentratedAmount: z8.coerce.bigint(),
|
|
542
|
+
concentratedAmountQuote: z8.coerce.bigint(),
|
|
543
|
+
concentratedTotal: z8.coerce.bigint(),
|
|
544
|
+
concentratedTotalQuote: z8.coerce.bigint(),
|
|
545
|
+
limitAmount: z8.coerce.bigint(),
|
|
546
|
+
limitAmountQuote: z8.coerce.bigint(),
|
|
547
|
+
limitTotal: z8.coerce.bigint(),
|
|
548
|
+
limitTotalQuote: z8.coerce.bigint(),
|
|
549
|
+
price: z8.number(),
|
|
550
|
+
askSide: z8.boolean()
|
|
528
551
|
});
|
|
529
|
-
var OrderBook =
|
|
552
|
+
var OrderBook = z8.object({
|
|
530
553
|
entries: OrderBookEntry.array(),
|
|
531
|
-
poolPrice:
|
|
532
|
-
poolAddress:
|
|
554
|
+
poolPrice: z8.number(),
|
|
555
|
+
poolAddress: z8.string()
|
|
533
556
|
});
|
|
534
557
|
|
|
535
558
|
// src/client/schemas/spot_positions.ts
|
|
536
|
-
import { z as
|
|
559
|
+
import { z as z9 } from "zod";
|
|
537
560
|
var TunaSpotPositionState = {
|
|
538
561
|
OPEN: "open",
|
|
539
562
|
CLOSED: "closed"
|
|
540
563
|
};
|
|
541
|
-
var TunaSpotPositionStateSchema =
|
|
564
|
+
var TunaSpotPositionStateSchema = z9.enum([
|
|
542
565
|
TunaSpotPositionState.OPEN,
|
|
543
566
|
...Object.values(TunaSpotPositionState)
|
|
544
567
|
]);
|
|
545
|
-
var TunaSpotPosition =
|
|
546
|
-
address:
|
|
547
|
-
authority:
|
|
548
|
-
version:
|
|
568
|
+
var TunaSpotPosition = z9.object({
|
|
569
|
+
address: z9.string(),
|
|
570
|
+
authority: z9.string(),
|
|
571
|
+
version: z9.number(),
|
|
549
572
|
state: TunaSpotPositionStateSchema,
|
|
550
|
-
lowerLimitOrderPrice:
|
|
551
|
-
upperLimitOrderPrice:
|
|
552
|
-
entryPrice:
|
|
573
|
+
lowerLimitOrderPrice: z9.number(),
|
|
574
|
+
upperLimitOrderPrice: z9.number(),
|
|
575
|
+
entryPrice: z9.number(),
|
|
553
576
|
pool: Pool,
|
|
554
577
|
positionToken: TunaPositionPoolTokenSchema,
|
|
555
578
|
collateralToken: TunaPositionPoolTokenSchema,
|
|
@@ -558,85 +581,71 @@ var TunaSpotPosition = z8.object({
|
|
|
558
581
|
initialDebt: AmountWithUsdSchema,
|
|
559
582
|
currentDebt: AmountWithUsdSchema,
|
|
560
583
|
total: AmountWithUsdSchema,
|
|
561
|
-
leverage:
|
|
562
|
-
maxLeverage:
|
|
563
|
-
liquidationPrice:
|
|
584
|
+
leverage: z9.number(),
|
|
585
|
+
maxLeverage: z9.number(),
|
|
586
|
+
liquidationPrice: z9.number(),
|
|
564
587
|
pnlUsd: UsdPnlSchema,
|
|
565
|
-
openedAt:
|
|
566
|
-
closedAt:
|
|
588
|
+
openedAt: z9.coerce.date(),
|
|
589
|
+
closedAt: z9.nullable(z9.coerce.date())
|
|
567
590
|
});
|
|
568
|
-
var IncreaseSpotPositionQuote =
|
|
591
|
+
var IncreaseSpotPositionQuote = z9.object({
|
|
569
592
|
/** Required collateral amount */
|
|
570
|
-
collateralAmount:
|
|
593
|
+
collateralAmount: z9.coerce.bigint(),
|
|
571
594
|
/** Required amount to borrow */
|
|
572
|
-
borrowAmount:
|
|
595
|
+
borrowAmount: z9.coerce.bigint(),
|
|
573
596
|
/** Estimated position size in the position token. */
|
|
574
|
-
estimatedAmount:
|
|
597
|
+
estimatedAmount: z9.coerce.bigint(),
|
|
575
598
|
/** Swap input amount. */
|
|
576
|
-
swapInputAmount:
|
|
599
|
+
swapInputAmount: z9.coerce.bigint(),
|
|
577
600
|
/** Minimum swap output amount according to the provided slippage. */
|
|
578
|
-
minSwapOutputAmount:
|
|
601
|
+
minSwapOutputAmount: z9.coerce.bigint(),
|
|
579
602
|
/** Protocol fee in token A */
|
|
580
|
-
protocolFeeA:
|
|
603
|
+
protocolFeeA: z9.coerce.bigint(),
|
|
581
604
|
/** Protocol fee in token B */
|
|
582
|
-
protocolFeeB:
|
|
605
|
+
protocolFeeB: z9.coerce.bigint(),
|
|
583
606
|
/** Price impact in percents */
|
|
584
|
-
priceImpact:
|
|
607
|
+
priceImpact: z9.number(),
|
|
585
608
|
/** Liquidation price */
|
|
586
|
-
liquidationPrice:
|
|
609
|
+
liquidationPrice: z9.number()
|
|
587
610
|
});
|
|
588
|
-
var DecreaseSpotPositionQuote =
|
|
611
|
+
var DecreaseSpotPositionQuote = z9.object({
|
|
589
612
|
/** Confirmed position decrease percentage (100% = 1.0) */
|
|
590
|
-
decreasePercent:
|
|
613
|
+
decreasePercent: z9.number(),
|
|
591
614
|
/** The maximum acceptable swap input amount for position decrease according to the provided slippage
|
|
592
615
|
* (if collateral_token == position_token) OR the minimum swap output amount (if collateral_token != position_token).
|
|
593
616
|
*/
|
|
594
|
-
requiredSwapAmount:
|
|
617
|
+
requiredSwapAmount: z9.coerce.bigint(),
|
|
595
618
|
/** Estimated total amount of the adjusted position */
|
|
596
|
-
estimatedAmount:
|
|
619
|
+
estimatedAmount: z9.coerce.bigint(),
|
|
597
620
|
/** Estimated amount of the withdrawn collateral */
|
|
598
|
-
estimatedWithdrawnCollateral:
|
|
621
|
+
estimatedWithdrawnCollateral: z9.coerce.bigint(),
|
|
599
622
|
/** Price impact in percents */
|
|
600
|
-
priceImpact:
|
|
623
|
+
priceImpact: z9.number(),
|
|
601
624
|
/** Liquidation price */
|
|
602
|
-
liquidationPrice:
|
|
625
|
+
liquidationPrice: z9.number()
|
|
603
626
|
});
|
|
604
|
-
var CloseSpotPositionQuote =
|
|
627
|
+
var CloseSpotPositionQuote = z9.object({
|
|
605
628
|
/** Position decrease percentage */
|
|
606
|
-
decreasePercent:
|
|
629
|
+
decreasePercent: z9.number(),
|
|
607
630
|
/** The maximum acceptable swap input amount for position decrease according to the provided slippage
|
|
608
631
|
* (if collateral_token == position_token) OR the minimum swap output amount (if collateral_token != position_token).
|
|
609
632
|
*/
|
|
610
|
-
requiredSwapAmount:
|
|
633
|
+
requiredSwapAmount: z9.coerce.bigint(),
|
|
611
634
|
/** Estimated amount of the withdrawn collateral */
|
|
612
|
-
estimatedWithdrawnCollateral:
|
|
635
|
+
estimatedWithdrawnCollateral: z9.coerce.bigint(),
|
|
613
636
|
/** Price impact in percents */
|
|
614
|
-
priceImpact:
|
|
637
|
+
priceImpact: z9.number()
|
|
615
638
|
});
|
|
616
639
|
|
|
617
640
|
// src/client/schemas/state_snapshot.ts
|
|
618
|
-
var
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
fees24H: z9.number(),
|
|
627
|
-
borrowedFundsA: AmountWithUsdSchema,
|
|
628
|
-
borrowedFundsB: AmountWithUsdSchema,
|
|
629
|
-
borrowLimitA: AmountWithUsdSchema,
|
|
630
|
-
borrowLimitB: AmountWithUsdSchema
|
|
631
|
-
});
|
|
632
|
-
var StateSnapshot = z9.object({
|
|
633
|
-
slot: z9.coerce.bigint(),
|
|
634
|
-
blockTime: z9.coerce.date(),
|
|
635
|
-
pools: z9.optional(z9.record(z9.string(), PoolSnapshot)),
|
|
636
|
-
tunaSpotPositions: z9.optional(z9.array(TunaSpotPosition)),
|
|
637
|
-
tunaLpPositions: z9.optional(z9.array(TunaLpPositionDtoSchema)),
|
|
638
|
-
fusionLimitOrders: z9.optional(z9.array(LimitOrder)),
|
|
639
|
-
orderBooks: z9.optional(z9.record(z9.string(), OrderBook))
|
|
641
|
+
var StateSnapshot = z10.object({
|
|
642
|
+
slot: z10.coerce.bigint(),
|
|
643
|
+
blockTime: z10.coerce.date(),
|
|
644
|
+
markets: z10.optional(z10.array(Market)),
|
|
645
|
+
tunaSpotPositions: z10.optional(z10.array(TunaSpotPosition)),
|
|
646
|
+
tunaLpPositions: z10.optional(z10.array(TunaLpPositionDtoSchema)),
|
|
647
|
+
fusionLimitOrders: z10.optional(z10.array(LimitOrder)),
|
|
648
|
+
orderBooks: z10.optional(z10.array(OrderBook))
|
|
640
649
|
});
|
|
641
650
|
|
|
642
651
|
// src/client/schemas.ts
|
|
@@ -700,7 +709,6 @@ var StakingPositionHistoryActionType = {
|
|
|
700
709
|
};
|
|
701
710
|
var PoolSubscriptionTopic = {
|
|
702
711
|
ORDER_BOOK: "order_book",
|
|
703
|
-
POOL: "pool",
|
|
704
712
|
POOL_SWAPS: "pool_swaps"
|
|
705
713
|
};
|
|
706
714
|
var WalletSubscriptionTopic = {
|
|
@@ -712,81 +720,60 @@ var WalletSubscriptionTopic = {
|
|
|
712
720
|
TRADE_HISTORY: "trade_history",
|
|
713
721
|
ORDER_HISTORY: "order_history"
|
|
714
722
|
};
|
|
715
|
-
var NotificationEntitySchema =
|
|
716
|
-
var NotificationActionSchema =
|
|
717
|
-
var TradeHistoryActionSchema =
|
|
718
|
-
var TradeHistoryUIDirectionSchema =
|
|
723
|
+
var NotificationEntitySchema = z11.enum([NotificationEntity.POOL_SWAP, ...Object.values(NotificationEntity)]);
|
|
724
|
+
var NotificationActionSchema = z11.enum([NotificationAction.CREATE, ...Object.values(NotificationAction)]);
|
|
725
|
+
var TradeHistoryActionSchema = z11.enum([TradeHistoryAction.SWAP, ...Object.values(TradeHistoryAction)]);
|
|
726
|
+
var TradeHistoryUIDirectionSchema = z11.enum([
|
|
719
727
|
TradeHistoryUIDirection.BUY,
|
|
720
728
|
...Object.values(TradeHistoryUIDirection)
|
|
721
729
|
]);
|
|
722
|
-
var OrderHistoryOrderTypeSchema =
|
|
730
|
+
var OrderHistoryOrderTypeSchema = z11.enum([
|
|
723
731
|
OrderHistoryOrderType.MARKET,
|
|
724
732
|
...Object.values(OrderHistoryOrderType)
|
|
725
733
|
]);
|
|
726
|
-
var OrderHistoryStatusSchema =
|
|
727
|
-
var OrderHistoryUIDirectionSchema =
|
|
734
|
+
var OrderHistoryStatusSchema = z11.enum([OrderHistoryStatus.OPEN, ...Object.values(OrderHistoryStatus)]);
|
|
735
|
+
var OrderHistoryUIDirectionSchema = z11.enum([
|
|
728
736
|
OrderHistoryUIDirection.BUY,
|
|
729
737
|
...Object.values(OrderHistoryUIDirection)
|
|
730
738
|
]);
|
|
731
|
-
var StakingPositionHistoryActionTypeSchema =
|
|
739
|
+
var StakingPositionHistoryActionTypeSchema = z11.enum([
|
|
732
740
|
StakingPositionHistoryActionType.STAKE,
|
|
733
741
|
...Object.values(StakingPositionHistoryActionType)
|
|
734
742
|
]);
|
|
735
|
-
var PoolSubscriptionTopicSchema =
|
|
743
|
+
var PoolSubscriptionTopicSchema = z11.enum([
|
|
736
744
|
PoolSubscriptionTopic.ORDER_BOOK,
|
|
737
745
|
...Object.values(PoolSubscriptionTopic)
|
|
738
746
|
]);
|
|
739
|
-
var WalletSubscriptionTopicSchema =
|
|
747
|
+
var WalletSubscriptionTopicSchema = z11.enum([
|
|
740
748
|
WalletSubscriptionTopic.TUNA_POSITIONS,
|
|
741
749
|
...Object.values(WalletSubscriptionTopic)
|
|
742
750
|
]);
|
|
743
|
-
var PaginationMeta =
|
|
744
|
-
total:
|
|
745
|
-
});
|
|
746
|
-
var Market = z10.object({
|
|
747
|
-
address: z10.string(),
|
|
748
|
-
addressLookupTable: z10.string(),
|
|
749
|
-
maxLeverage: z10.number(),
|
|
750
|
-
maxSwapSlippage: z10.number(),
|
|
751
|
-
protocolFee: z10.number(),
|
|
752
|
-
protocolFeeOnCollateral: z10.number(),
|
|
753
|
-
liquidationFee: z10.number(),
|
|
754
|
-
liquidationThreshold: z10.number(),
|
|
755
|
-
oraclePriceDeviationThreshold: z10.number(),
|
|
756
|
-
rebalanceProtocolFee: z10.number(),
|
|
757
|
-
borrowedFundsA: AmountWithUsdSchema,
|
|
758
|
-
borrowedFundsB: AmountWithUsdSchema,
|
|
759
|
-
borrowLimitA: AmountWithUsdSchema,
|
|
760
|
-
borrowLimitB: AmountWithUsdSchema,
|
|
761
|
-
maxSpotPositionSizeA: AmountWithUsdSchema,
|
|
762
|
-
maxSpotPositionSizeB: AmountWithUsdSchema,
|
|
763
|
-
pool: Pool,
|
|
764
|
-
disabled: z10.boolean(),
|
|
765
|
-
createdAt: z10.coerce.date()
|
|
751
|
+
var PaginationMeta = z11.object({
|
|
752
|
+
total: z11.number()
|
|
766
753
|
});
|
|
767
|
-
var TokenOraclePrice =
|
|
768
|
-
mint:
|
|
769
|
-
price:
|
|
770
|
-
decimals:
|
|
771
|
-
time:
|
|
754
|
+
var TokenOraclePrice = z11.object({
|
|
755
|
+
mint: z11.string(),
|
|
756
|
+
price: z11.coerce.bigint(),
|
|
757
|
+
decimals: z11.number(),
|
|
758
|
+
time: z11.coerce.date()
|
|
772
759
|
});
|
|
773
|
-
var Vault =
|
|
774
|
-
address:
|
|
775
|
-
mint:
|
|
760
|
+
var Vault = z11.object({
|
|
761
|
+
address: z11.string(),
|
|
762
|
+
mint: z11.string(),
|
|
776
763
|
depositedFunds: AmountWithUsdSchema,
|
|
777
764
|
borrowedFunds: AmountWithUsdSchema,
|
|
778
765
|
supplyLimit: AmountWithUsdSchema,
|
|
779
|
-
borrowedShares:
|
|
780
|
-
depositedShares:
|
|
781
|
-
supplyApy:
|
|
782
|
-
borrowApy:
|
|
783
|
-
interestRate:
|
|
784
|
-
utilization:
|
|
785
|
-
pythOracleFeedId:
|
|
786
|
-
pythOraclePriceUpdate:
|
|
766
|
+
borrowedShares: z11.coerce.bigint(),
|
|
767
|
+
depositedShares: z11.coerce.bigint(),
|
|
768
|
+
supplyApy: z11.number(),
|
|
769
|
+
borrowApy: z11.number(),
|
|
770
|
+
interestRate: z11.coerce.bigint(),
|
|
771
|
+
utilization: z11.number(),
|
|
772
|
+
pythOracleFeedId: z11.string(),
|
|
773
|
+
pythOraclePriceUpdate: z11.string()
|
|
787
774
|
});
|
|
788
|
-
var VaultHistoricalStats =
|
|
789
|
-
date:
|
|
775
|
+
var VaultHistoricalStats = z11.object({
|
|
776
|
+
date: z11.preprocess((val, ctx) => {
|
|
790
777
|
if (typeof val === "string") {
|
|
791
778
|
const [year, month, day] = val.split("-").map(Number);
|
|
792
779
|
return new Date(year, month - 1, day);
|
|
@@ -795,214 +782,214 @@ var VaultHistoricalStats = z10.object({
|
|
|
795
782
|
code: "custom",
|
|
796
783
|
message: "Not a valid date string"
|
|
797
784
|
});
|
|
798
|
-
return
|
|
799
|
-
},
|
|
785
|
+
return z11.NEVER;
|
|
786
|
+
}, z11.date()),
|
|
800
787
|
supply: AmountWithUsdSchema,
|
|
801
788
|
borrow: AmountWithUsdSchema,
|
|
802
|
-
supplyApy:
|
|
803
|
-
borrowApr:
|
|
789
|
+
supplyApy: z11.number(),
|
|
790
|
+
borrowApr: z11.number()
|
|
804
791
|
});
|
|
805
|
-
var Tick =
|
|
806
|
-
index:
|
|
807
|
-
liquidity:
|
|
792
|
+
var Tick = z11.object({
|
|
793
|
+
index: z11.number(),
|
|
794
|
+
liquidity: z11.coerce.bigint()
|
|
808
795
|
});
|
|
809
|
-
var PoolTicks =
|
|
810
|
-
tickSpacing:
|
|
796
|
+
var PoolTicks = z11.object({
|
|
797
|
+
tickSpacing: z11.number(),
|
|
811
798
|
ticks: Tick.array()
|
|
812
799
|
});
|
|
813
|
-
var LendingPosition =
|
|
814
|
-
address:
|
|
815
|
-
authority:
|
|
816
|
-
mint:
|
|
817
|
-
vault:
|
|
818
|
-
shares:
|
|
800
|
+
var LendingPosition = z11.object({
|
|
801
|
+
address: z11.string(),
|
|
802
|
+
authority: z11.string(),
|
|
803
|
+
mint: z11.string(),
|
|
804
|
+
vault: z11.string(),
|
|
805
|
+
shares: z11.coerce.bigint(),
|
|
819
806
|
funds: AmountWithUsdSchema,
|
|
820
807
|
earned: AmountWithUsdSchema
|
|
821
808
|
});
|
|
822
|
-
var PoolSwap =
|
|
823
|
-
id:
|
|
824
|
-
amountIn:
|
|
825
|
-
amountOut:
|
|
826
|
-
amountUsd:
|
|
827
|
-
aToB:
|
|
828
|
-
pool:
|
|
829
|
-
time:
|
|
809
|
+
var PoolSwap = z11.object({
|
|
810
|
+
id: z11.string(),
|
|
811
|
+
amountIn: z11.coerce.bigint(),
|
|
812
|
+
amountOut: z11.coerce.bigint(),
|
|
813
|
+
amountUsd: z11.number(),
|
|
814
|
+
aToB: z11.boolean(),
|
|
815
|
+
pool: z11.string(),
|
|
816
|
+
time: z11.coerce.date()
|
|
830
817
|
});
|
|
831
|
-
var TradeHistoryEntry =
|
|
818
|
+
var TradeHistoryEntry = z11.object({
|
|
832
819
|
// Internal entry ID
|
|
833
|
-
id:
|
|
820
|
+
id: z11.string(),
|
|
834
821
|
pool: Pool,
|
|
835
|
-
authority:
|
|
836
|
-
aToB:
|
|
822
|
+
authority: z11.string(),
|
|
823
|
+
aToB: z11.boolean(),
|
|
837
824
|
// Trade action which created entry
|
|
838
825
|
action: TradeHistoryActionSchema,
|
|
839
826
|
// Trade direction formatted for ui display
|
|
840
827
|
uiDirection: TradeHistoryUIDirectionSchema,
|
|
841
828
|
// Trade price formatted for ui display
|
|
842
|
-
uiPrice:
|
|
829
|
+
uiPrice: z11.number(),
|
|
843
830
|
baseToken: AmountWithUsdSchema,
|
|
844
831
|
quoteToken: AmountWithUsdSchema,
|
|
845
832
|
fee: AmountWithUsdSchema,
|
|
846
|
-
pnl:
|
|
847
|
-
|
|
848
|
-
usd:
|
|
849
|
-
bps:
|
|
833
|
+
pnl: z11.nullable(
|
|
834
|
+
z11.object({
|
|
835
|
+
usd: z11.number(),
|
|
836
|
+
bps: z11.number()
|
|
850
837
|
})
|
|
851
838
|
),
|
|
852
|
-
txSignature:
|
|
853
|
-
positionAddress:
|
|
854
|
-
slot:
|
|
855
|
-
ts:
|
|
839
|
+
txSignature: z11.nullable(z11.string()),
|
|
840
|
+
positionAddress: z11.nullable(z11.string()),
|
|
841
|
+
slot: z11.coerce.bigint(),
|
|
842
|
+
ts: z11.coerce.date()
|
|
856
843
|
});
|
|
857
|
-
var OrderHistoryEntry =
|
|
844
|
+
var OrderHistoryEntry = z11.object({
|
|
858
845
|
// Internal entry ID
|
|
859
|
-
id:
|
|
846
|
+
id: z11.string(),
|
|
860
847
|
pool: Pool,
|
|
861
|
-
authority:
|
|
848
|
+
authority: z11.string(),
|
|
862
849
|
orderType: OrderHistoryOrderTypeSchema,
|
|
863
|
-
isReduceOnly:
|
|
864
|
-
aToB:
|
|
850
|
+
isReduceOnly: z11.nullable(z11.boolean()),
|
|
851
|
+
aToB: z11.boolean(),
|
|
865
852
|
uiDirection: OrderHistoryUIDirectionSchema,
|
|
866
|
-
uiPrice:
|
|
867
|
-
uiExecutionPrice:
|
|
853
|
+
uiPrice: z11.nullable(z11.number()),
|
|
854
|
+
uiExecutionPrice: z11.nullable(z11.number()),
|
|
868
855
|
status: OrderHistoryStatusSchema,
|
|
869
856
|
baseToken: AmountWithUsdSchema,
|
|
870
857
|
quoteToken: AmountWithUsdSchema,
|
|
871
|
-
baseTokenConsumedAmount:
|
|
872
|
-
quoteTokenFilledAmount:
|
|
873
|
-
txSignature:
|
|
874
|
-
positionAddress:
|
|
875
|
-
slot:
|
|
876
|
-
ts:
|
|
858
|
+
baseTokenConsumedAmount: z11.nullable(AmountWithUsdSchema),
|
|
859
|
+
quoteTokenFilledAmount: z11.nullable(AmountWithUsdSchema),
|
|
860
|
+
txSignature: z11.nullable(z11.string()),
|
|
861
|
+
positionAddress: z11.nullable(z11.string()),
|
|
862
|
+
slot: z11.coerce.bigint(),
|
|
863
|
+
ts: z11.coerce.date()
|
|
877
864
|
});
|
|
878
|
-
var StakingTreasury =
|
|
879
|
-
address:
|
|
880
|
-
stakedTokenMint:
|
|
881
|
-
rewardTokenMint:
|
|
882
|
-
apy:
|
|
883
|
-
uniqueStakers:
|
|
865
|
+
var StakingTreasury = z11.object({
|
|
866
|
+
address: z11.string(),
|
|
867
|
+
stakedTokenMint: z11.string(),
|
|
868
|
+
rewardTokenMint: z11.string(),
|
|
869
|
+
apy: z11.number(),
|
|
870
|
+
uniqueStakers: z11.number(),
|
|
884
871
|
totalStaked: AmountWithUsdSchema,
|
|
885
872
|
totalReward: AmountWithUsdSchema,
|
|
886
|
-
unstakeCooldownSeconds:
|
|
887
|
-
isStakingEnabled:
|
|
888
|
-
isUnstakingEnabled:
|
|
889
|
-
isWithdrawEnabled:
|
|
873
|
+
unstakeCooldownSeconds: z11.number(),
|
|
874
|
+
isStakingEnabled: z11.boolean(),
|
|
875
|
+
isUnstakingEnabled: z11.boolean(),
|
|
876
|
+
isWithdrawEnabled: z11.boolean()
|
|
890
877
|
});
|
|
891
|
-
var StakingPosition =
|
|
892
|
-
address:
|
|
893
|
-
owner:
|
|
878
|
+
var StakingPosition = z11.object({
|
|
879
|
+
address: z11.string(),
|
|
880
|
+
owner: z11.string(),
|
|
894
881
|
staked: AmountWithUsdSchema,
|
|
895
882
|
unstaked: AmountWithUsdSchema,
|
|
896
883
|
claimedReward: AmountWithUsdSchema,
|
|
897
884
|
unclaimedReward: AmountWithUsdSchema,
|
|
898
|
-
rank:
|
|
899
|
-
vesting:
|
|
885
|
+
rank: z11.nullable(z11.number()),
|
|
886
|
+
vesting: z11.object({
|
|
900
887
|
locked: AmountWithUsdSchema,
|
|
901
888
|
unlocked: AmountWithUsdSchema,
|
|
902
|
-
unlockRate:
|
|
903
|
-
unlockEverySeconds:
|
|
904
|
-
unlockCliffSeconds:
|
|
905
|
-
lockedAt:
|
|
889
|
+
unlockRate: z11.coerce.bigint(),
|
|
890
|
+
unlockEverySeconds: z11.number(),
|
|
891
|
+
unlockCliffSeconds: z11.number(),
|
|
892
|
+
lockedAt: z11.nullable(z11.coerce.date())
|
|
906
893
|
}),
|
|
907
|
-
lastUnstakedAt:
|
|
908
|
-
withdrawAvailableAt:
|
|
894
|
+
lastUnstakedAt: z11.nullable(z11.coerce.date()),
|
|
895
|
+
withdrawAvailableAt: z11.nullable(z11.coerce.date())
|
|
909
896
|
});
|
|
910
|
-
var StakingLeaderboardPosition =
|
|
911
|
-
rank:
|
|
912
|
-
address:
|
|
913
|
-
owner:
|
|
897
|
+
var StakingLeaderboardPosition = z11.object({
|
|
898
|
+
rank: z11.number(),
|
|
899
|
+
address: z11.string(),
|
|
900
|
+
owner: z11.string(),
|
|
914
901
|
staked: AmountWithUsdSchema
|
|
915
902
|
});
|
|
916
|
-
var StakingLeaderboardPage =
|
|
903
|
+
var StakingLeaderboardPage = z11.object({
|
|
917
904
|
data: StakingLeaderboardPosition.array(),
|
|
918
905
|
meta: PaginationMeta
|
|
919
906
|
});
|
|
920
|
-
var StakingPositionHistoryAction =
|
|
921
|
-
position:
|
|
907
|
+
var StakingPositionHistoryAction = z11.object({
|
|
908
|
+
position: z11.string(),
|
|
922
909
|
action: StakingPositionHistoryActionTypeSchema,
|
|
923
|
-
txSignature:
|
|
924
|
-
amount:
|
|
925
|
-
time:
|
|
910
|
+
txSignature: z11.string(),
|
|
911
|
+
amount: z11.coerce.bigint(),
|
|
912
|
+
time: z11.coerce.date()
|
|
926
913
|
});
|
|
927
|
-
var PoolPriceCandle =
|
|
928
|
-
time:
|
|
929
|
-
open:
|
|
930
|
-
close:
|
|
931
|
-
high:
|
|
932
|
-
low:
|
|
933
|
-
volume:
|
|
914
|
+
var PoolPriceCandle = z11.object({
|
|
915
|
+
time: z11.number(),
|
|
916
|
+
open: z11.number(),
|
|
917
|
+
close: z11.number(),
|
|
918
|
+
high: z11.number(),
|
|
919
|
+
low: z11.number(),
|
|
920
|
+
volume: z11.number()
|
|
934
921
|
});
|
|
935
|
-
var FeesStatsGroup =
|
|
936
|
-
time:
|
|
937
|
-
addLiquidityFees:
|
|
938
|
-
limitOrderFees:
|
|
939
|
-
yieldCompoundingFees:
|
|
940
|
-
liquidationFees:
|
|
941
|
-
totalLiquidationsNetworkFees:
|
|
942
|
-
totalLimitOrdersNetworkFees:
|
|
943
|
-
totalYieldCompoundingNetworkFees:
|
|
944
|
-
failedNetworkFees:
|
|
945
|
-
processedNetworkFees:
|
|
946
|
-
totalCollectedFees:
|
|
947
|
-
totalNetworkFees:
|
|
948
|
-
jitoLiquidationFees:
|
|
949
|
-
jitoLimitOrderFees:
|
|
950
|
-
jitoYieldCompoundingFees:
|
|
951
|
-
runningAddLiquidityFees:
|
|
952
|
-
runningLimitOrderFees:
|
|
953
|
-
runningYieldCompoundingFees:
|
|
954
|
-
runningLiquidationFees:
|
|
955
|
-
runningTotalLiquidationsNetworkFees:
|
|
956
|
-
runningTotalLimitOrdersNetworkFees:
|
|
957
|
-
runningTotalYieldCompoundingNetworkFees:
|
|
958
|
-
runningFailedNetworkFees:
|
|
959
|
-
runningProcessedNetworkFees:
|
|
960
|
-
runningJitoLiquidationFees:
|
|
961
|
-
runningJitoLimitOrderFees:
|
|
962
|
-
runningJitoYieldCompoundingFees:
|
|
963
|
-
runningTotalCollectedFees:
|
|
964
|
-
runningTotalNetworkFees:
|
|
922
|
+
var FeesStatsGroup = z11.object({
|
|
923
|
+
time: z11.coerce.date(),
|
|
924
|
+
addLiquidityFees: z11.number(),
|
|
925
|
+
limitOrderFees: z11.number(),
|
|
926
|
+
yieldCompoundingFees: z11.number(),
|
|
927
|
+
liquidationFees: z11.number(),
|
|
928
|
+
totalLiquidationsNetworkFees: z11.number(),
|
|
929
|
+
totalLimitOrdersNetworkFees: z11.number(),
|
|
930
|
+
totalYieldCompoundingNetworkFees: z11.number(),
|
|
931
|
+
failedNetworkFees: z11.number(),
|
|
932
|
+
processedNetworkFees: z11.number(),
|
|
933
|
+
totalCollectedFees: z11.number(),
|
|
934
|
+
totalNetworkFees: z11.number(),
|
|
935
|
+
jitoLiquidationFees: z11.number(),
|
|
936
|
+
jitoLimitOrderFees: z11.number(),
|
|
937
|
+
jitoYieldCompoundingFees: z11.number(),
|
|
938
|
+
runningAddLiquidityFees: z11.number(),
|
|
939
|
+
runningLimitOrderFees: z11.number(),
|
|
940
|
+
runningYieldCompoundingFees: z11.number(),
|
|
941
|
+
runningLiquidationFees: z11.number(),
|
|
942
|
+
runningTotalLiquidationsNetworkFees: z11.number(),
|
|
943
|
+
runningTotalLimitOrdersNetworkFees: z11.number(),
|
|
944
|
+
runningTotalYieldCompoundingNetworkFees: z11.number(),
|
|
945
|
+
runningFailedNetworkFees: z11.number(),
|
|
946
|
+
runningProcessedNetworkFees: z11.number(),
|
|
947
|
+
runningJitoLiquidationFees: z11.number(),
|
|
948
|
+
runningJitoLimitOrderFees: z11.number(),
|
|
949
|
+
runningJitoYieldCompoundingFees: z11.number(),
|
|
950
|
+
runningTotalCollectedFees: z11.number(),
|
|
951
|
+
runningTotalNetworkFees: z11.number()
|
|
965
952
|
});
|
|
966
|
-
var StakingRevenueStatsGroup =
|
|
967
|
-
time:
|
|
968
|
-
totalDepositsUsd:
|
|
969
|
-
totalDepositsSol:
|
|
970
|
-
runningTotalDepositsUsd:
|
|
971
|
-
runningTotalDepositsSol:
|
|
953
|
+
var StakingRevenueStatsGroup = z11.object({
|
|
954
|
+
time: z11.coerce.date(),
|
|
955
|
+
totalDepositsUsd: z11.number(),
|
|
956
|
+
totalDepositsSol: z11.coerce.bigint(),
|
|
957
|
+
runningTotalDepositsUsd: z11.number(),
|
|
958
|
+
runningTotalDepositsSol: z11.coerce.bigint()
|
|
972
959
|
});
|
|
973
|
-
var SwapQuoteByInput =
|
|
974
|
-
estimatedAmountOut:
|
|
975
|
-
minAmountOut:
|
|
976
|
-
feeAmount:
|
|
977
|
-
feeUsd:
|
|
960
|
+
var SwapQuoteByInput = z11.object({
|
|
961
|
+
estimatedAmountOut: z11.coerce.bigint(),
|
|
962
|
+
minAmountOut: z11.coerce.bigint(),
|
|
963
|
+
feeAmount: z11.coerce.bigint(),
|
|
964
|
+
feeUsd: z11.number(),
|
|
978
965
|
/** Price impact in percents */
|
|
979
|
-
priceImpact:
|
|
966
|
+
priceImpact: z11.number()
|
|
980
967
|
});
|
|
981
|
-
var SwapQuoteByOutput =
|
|
982
|
-
estimatedAmountIn:
|
|
983
|
-
maxAmountIn:
|
|
984
|
-
feeAmount:
|
|
985
|
-
feeUsd:
|
|
968
|
+
var SwapQuoteByOutput = z11.object({
|
|
969
|
+
estimatedAmountIn: z11.coerce.bigint(),
|
|
970
|
+
maxAmountIn: z11.coerce.bigint(),
|
|
971
|
+
feeAmount: z11.coerce.bigint(),
|
|
972
|
+
feeUsd: z11.number(),
|
|
986
973
|
/** Price impact in percents */
|
|
987
|
-
priceImpact:
|
|
974
|
+
priceImpact: z11.number()
|
|
988
975
|
});
|
|
989
|
-
var LimitOrderQuoteByInput =
|
|
990
|
-
amountOut:
|
|
976
|
+
var LimitOrderQuoteByInput = z11.object({
|
|
977
|
+
amountOut: z11.coerce.bigint()
|
|
991
978
|
});
|
|
992
|
-
var LimitOrderQuoteByOutput =
|
|
993
|
-
amountIn:
|
|
979
|
+
var LimitOrderQuoteByOutput = z11.object({
|
|
980
|
+
amountIn: z11.coerce.bigint()
|
|
994
981
|
});
|
|
995
982
|
var TradableAmount = AmountWithUsdSchema;
|
|
996
|
-
var UpdateStreamSubscriptionResult =
|
|
997
|
-
status:
|
|
983
|
+
var UpdateStreamSubscriptionResult = z11.object({
|
|
984
|
+
status: z11.string()
|
|
998
985
|
});
|
|
999
|
-
var createNotificationSchema = (dataSchema, metaSchema) =>
|
|
986
|
+
var createNotificationSchema = (dataSchema, metaSchema) => z11.object({
|
|
1000
987
|
entity: NotificationEntitySchema,
|
|
1001
988
|
action: NotificationActionSchema,
|
|
1002
989
|
data: dataSchema,
|
|
1003
|
-
id:
|
|
1004
|
-
authority:
|
|
1005
|
-
...metaSchema ? { meta: metaSchema } : { meta:
|
|
990
|
+
id: z11.string(),
|
|
991
|
+
authority: z11.nullish(z11.string()),
|
|
992
|
+
...metaSchema ? { meta: metaSchema } : { meta: z11.undefined().nullable() }
|
|
1006
993
|
});
|
|
1007
994
|
var PoolSwapNotification = createNotificationSchema(PoolSwap);
|
|
1008
995
|
var LendingPositionNotification = createNotificationSchema(LendingPosition);
|