@crypticdot/defituna-api 1.10.12 → 1.10.13
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 +270 -137
- package/dist/index.d.ts +270 -137
- package/dist/index.js +260 -272
- package/dist/index.mjs +260 -272
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -90,7 +90,6 @@ __export(schemas_exports, {
|
|
|
90
90
|
PoolPriceCandle: () => PoolPriceCandle,
|
|
91
91
|
PoolProvider: () => PoolProvider,
|
|
92
92
|
PoolProviderSchema: () => PoolProviderSchema,
|
|
93
|
-
PoolSnapshot: () => PoolSnapshot,
|
|
94
93
|
PoolSubscriptionTopic: () => PoolSubscriptionTopic,
|
|
95
94
|
PoolSubscriptionTopicSchema: () => PoolSubscriptionTopicSchema,
|
|
96
95
|
PoolSwap: () => PoolSwap,
|
|
@@ -154,7 +153,7 @@ __export(schemas_exports, {
|
|
|
154
153
|
WalletSubscriptionTopic: () => WalletSubscriptionTopic,
|
|
155
154
|
WalletSubscriptionTopicSchema: () => WalletSubscriptionTopicSchema
|
|
156
155
|
});
|
|
157
|
-
var
|
|
156
|
+
var import_zod11 = require("zod");
|
|
158
157
|
|
|
159
158
|
// src/client/schemas/basic.ts
|
|
160
159
|
var import_zod = require("zod");
|
|
@@ -225,7 +224,7 @@ var Pool = import_zod3.default.object({
|
|
|
225
224
|
});
|
|
226
225
|
|
|
227
226
|
// src/client/schemas/state_snapshot.ts
|
|
228
|
-
var
|
|
227
|
+
var import_zod10 = __toESM(require("zod"));
|
|
229
228
|
|
|
230
229
|
// src/client/schemas/limit_orders.ts
|
|
231
230
|
var import_zod4 = require("zod");
|
|
@@ -549,44 +548,68 @@ var TunaLpPositionAction = import_zod6.default.object({
|
|
|
549
548
|
})
|
|
550
549
|
});
|
|
551
550
|
|
|
551
|
+
// src/client/schemas/market.ts
|
|
552
|
+
var import_zod7 = require("zod");
|
|
553
|
+
var Market = import_zod7.z.object({
|
|
554
|
+
address: import_zod7.z.string(),
|
|
555
|
+
addressLookupTable: import_zod7.z.string(),
|
|
556
|
+
maxLeverage: import_zod7.z.number(),
|
|
557
|
+
maxSwapSlippage: import_zod7.z.number(),
|
|
558
|
+
protocolFee: import_zod7.z.number(),
|
|
559
|
+
protocolFeeOnCollateral: import_zod7.z.number(),
|
|
560
|
+
liquidationFee: import_zod7.z.number(),
|
|
561
|
+
liquidationThreshold: import_zod7.z.number(),
|
|
562
|
+
oraclePriceDeviationThreshold: import_zod7.z.number(),
|
|
563
|
+
rebalanceProtocolFee: import_zod7.z.number(),
|
|
564
|
+
borrowedFundsA: AmountWithUsdSchema,
|
|
565
|
+
borrowedFundsB: AmountWithUsdSchema,
|
|
566
|
+
borrowLimitA: AmountWithUsdSchema,
|
|
567
|
+
borrowLimitB: AmountWithUsdSchema,
|
|
568
|
+
maxSpotPositionSizeA: AmountWithUsdSchema,
|
|
569
|
+
maxSpotPositionSizeB: AmountWithUsdSchema,
|
|
570
|
+
pool: Pool,
|
|
571
|
+
disabled: import_zod7.z.boolean(),
|
|
572
|
+
createdAt: import_zod7.z.coerce.date()
|
|
573
|
+
});
|
|
574
|
+
|
|
552
575
|
// src/client/schemas/order_book.ts
|
|
553
|
-
var
|
|
554
|
-
var OrderBookEntry =
|
|
555
|
-
concentratedAmount:
|
|
556
|
-
concentratedAmountQuote:
|
|
557
|
-
concentratedTotal:
|
|
558
|
-
concentratedTotalQuote:
|
|
559
|
-
limitAmount:
|
|
560
|
-
limitAmountQuote:
|
|
561
|
-
limitTotal:
|
|
562
|
-
limitTotalQuote:
|
|
563
|
-
price:
|
|
564
|
-
askSide:
|
|
576
|
+
var import_zod8 = __toESM(require("zod"));
|
|
577
|
+
var OrderBookEntry = import_zod8.default.object({
|
|
578
|
+
concentratedAmount: import_zod8.default.coerce.bigint(),
|
|
579
|
+
concentratedAmountQuote: import_zod8.default.coerce.bigint(),
|
|
580
|
+
concentratedTotal: import_zod8.default.coerce.bigint(),
|
|
581
|
+
concentratedTotalQuote: import_zod8.default.coerce.bigint(),
|
|
582
|
+
limitAmount: import_zod8.default.coerce.bigint(),
|
|
583
|
+
limitAmountQuote: import_zod8.default.coerce.bigint(),
|
|
584
|
+
limitTotal: import_zod8.default.coerce.bigint(),
|
|
585
|
+
limitTotalQuote: import_zod8.default.coerce.bigint(),
|
|
586
|
+
price: import_zod8.default.number(),
|
|
587
|
+
askSide: import_zod8.default.boolean()
|
|
565
588
|
});
|
|
566
|
-
var OrderBook =
|
|
589
|
+
var OrderBook = import_zod8.default.object({
|
|
567
590
|
entries: OrderBookEntry.array(),
|
|
568
|
-
poolPrice:
|
|
569
|
-
poolAddress:
|
|
591
|
+
poolPrice: import_zod8.default.number(),
|
|
592
|
+
poolAddress: import_zod8.default.string()
|
|
570
593
|
});
|
|
571
594
|
|
|
572
595
|
// src/client/schemas/spot_positions.ts
|
|
573
|
-
var
|
|
596
|
+
var import_zod9 = require("zod");
|
|
574
597
|
var TunaSpotPositionState = {
|
|
575
598
|
OPEN: "open",
|
|
576
599
|
CLOSED: "closed"
|
|
577
600
|
};
|
|
578
|
-
var TunaSpotPositionStateSchema =
|
|
601
|
+
var TunaSpotPositionStateSchema = import_zod9.z.enum([
|
|
579
602
|
TunaSpotPositionState.OPEN,
|
|
580
603
|
...Object.values(TunaSpotPositionState)
|
|
581
604
|
]);
|
|
582
|
-
var TunaSpotPosition =
|
|
583
|
-
address:
|
|
584
|
-
authority:
|
|
585
|
-
version:
|
|
605
|
+
var TunaSpotPosition = import_zod9.z.object({
|
|
606
|
+
address: import_zod9.z.string(),
|
|
607
|
+
authority: import_zod9.z.string(),
|
|
608
|
+
version: import_zod9.z.number(),
|
|
586
609
|
state: TunaSpotPositionStateSchema,
|
|
587
|
-
lowerLimitOrderPrice:
|
|
588
|
-
upperLimitOrderPrice:
|
|
589
|
-
entryPrice:
|
|
610
|
+
lowerLimitOrderPrice: import_zod9.z.number(),
|
|
611
|
+
upperLimitOrderPrice: import_zod9.z.number(),
|
|
612
|
+
entryPrice: import_zod9.z.number(),
|
|
590
613
|
pool: Pool,
|
|
591
614
|
positionToken: TunaPositionPoolTokenSchema,
|
|
592
615
|
collateralToken: TunaPositionPoolTokenSchema,
|
|
@@ -595,85 +618,71 @@ var TunaSpotPosition = import_zod8.z.object({
|
|
|
595
618
|
initialDebt: AmountWithUsdSchema,
|
|
596
619
|
currentDebt: AmountWithUsdSchema,
|
|
597
620
|
total: AmountWithUsdSchema,
|
|
598
|
-
leverage:
|
|
599
|
-
maxLeverage:
|
|
600
|
-
liquidationPrice:
|
|
621
|
+
leverage: import_zod9.z.number(),
|
|
622
|
+
maxLeverage: import_zod9.z.number(),
|
|
623
|
+
liquidationPrice: import_zod9.z.number(),
|
|
601
624
|
pnlUsd: UsdPnlSchema,
|
|
602
|
-
openedAt:
|
|
603
|
-
closedAt:
|
|
625
|
+
openedAt: import_zod9.z.coerce.date(),
|
|
626
|
+
closedAt: import_zod9.z.nullable(import_zod9.z.coerce.date())
|
|
604
627
|
});
|
|
605
|
-
var IncreaseSpotPositionQuote =
|
|
628
|
+
var IncreaseSpotPositionQuote = import_zod9.z.object({
|
|
606
629
|
/** Required collateral amount */
|
|
607
|
-
collateralAmount:
|
|
630
|
+
collateralAmount: import_zod9.z.coerce.bigint(),
|
|
608
631
|
/** Required amount to borrow */
|
|
609
|
-
borrowAmount:
|
|
632
|
+
borrowAmount: import_zod9.z.coerce.bigint(),
|
|
610
633
|
/** Estimated position size in the position token. */
|
|
611
|
-
estimatedAmount:
|
|
634
|
+
estimatedAmount: import_zod9.z.coerce.bigint(),
|
|
612
635
|
/** Swap input amount. */
|
|
613
|
-
swapInputAmount:
|
|
636
|
+
swapInputAmount: import_zod9.z.coerce.bigint(),
|
|
614
637
|
/** Minimum swap output amount according to the provided slippage. */
|
|
615
|
-
minSwapOutputAmount:
|
|
638
|
+
minSwapOutputAmount: import_zod9.z.coerce.bigint(),
|
|
616
639
|
/** Protocol fee in token A */
|
|
617
|
-
protocolFeeA:
|
|
640
|
+
protocolFeeA: import_zod9.z.coerce.bigint(),
|
|
618
641
|
/** Protocol fee in token B */
|
|
619
|
-
protocolFeeB:
|
|
642
|
+
protocolFeeB: import_zod9.z.coerce.bigint(),
|
|
620
643
|
/** Price impact in percents */
|
|
621
|
-
priceImpact:
|
|
644
|
+
priceImpact: import_zod9.z.number(),
|
|
622
645
|
/** Liquidation price */
|
|
623
|
-
liquidationPrice:
|
|
646
|
+
liquidationPrice: import_zod9.z.number()
|
|
624
647
|
});
|
|
625
|
-
var DecreaseSpotPositionQuote =
|
|
648
|
+
var DecreaseSpotPositionQuote = import_zod9.z.object({
|
|
626
649
|
/** Confirmed position decrease percentage (100% = 1.0) */
|
|
627
|
-
decreasePercent:
|
|
650
|
+
decreasePercent: import_zod9.z.number(),
|
|
628
651
|
/** The maximum acceptable swap input amount for position decrease according to the provided slippage
|
|
629
652
|
* (if collateral_token == position_token) OR the minimum swap output amount (if collateral_token != position_token).
|
|
630
653
|
*/
|
|
631
|
-
requiredSwapAmount:
|
|
654
|
+
requiredSwapAmount: import_zod9.z.coerce.bigint(),
|
|
632
655
|
/** Estimated total amount of the adjusted position */
|
|
633
|
-
estimatedAmount:
|
|
656
|
+
estimatedAmount: import_zod9.z.coerce.bigint(),
|
|
634
657
|
/** Estimated amount of the withdrawn collateral */
|
|
635
|
-
estimatedWithdrawnCollateral:
|
|
658
|
+
estimatedWithdrawnCollateral: import_zod9.z.coerce.bigint(),
|
|
636
659
|
/** Price impact in percents */
|
|
637
|
-
priceImpact:
|
|
660
|
+
priceImpact: import_zod9.z.number(),
|
|
638
661
|
/** Liquidation price */
|
|
639
|
-
liquidationPrice:
|
|
662
|
+
liquidationPrice: import_zod9.z.number()
|
|
640
663
|
});
|
|
641
|
-
var CloseSpotPositionQuote =
|
|
664
|
+
var CloseSpotPositionQuote = import_zod9.z.object({
|
|
642
665
|
/** Position decrease percentage */
|
|
643
|
-
decreasePercent:
|
|
666
|
+
decreasePercent: import_zod9.z.number(),
|
|
644
667
|
/** The maximum acceptable swap input amount for position decrease according to the provided slippage
|
|
645
668
|
* (if collateral_token == position_token) OR the minimum swap output amount (if collateral_token != position_token).
|
|
646
669
|
*/
|
|
647
|
-
requiredSwapAmount:
|
|
670
|
+
requiredSwapAmount: import_zod9.z.coerce.bigint(),
|
|
648
671
|
/** Estimated amount of the withdrawn collateral */
|
|
649
|
-
estimatedWithdrawnCollateral:
|
|
672
|
+
estimatedWithdrawnCollateral: import_zod9.z.coerce.bigint(),
|
|
650
673
|
/** Price impact in percents */
|
|
651
|
-
priceImpact:
|
|
674
|
+
priceImpact: import_zod9.z.number()
|
|
652
675
|
});
|
|
653
676
|
|
|
654
677
|
// src/client/schemas/state_snapshot.ts
|
|
655
|
-
var
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
fees24H: import_zod9.default.number(),
|
|
664
|
-
borrowedFundsA: AmountWithUsdSchema,
|
|
665
|
-
borrowedFundsB: AmountWithUsdSchema,
|
|
666
|
-
borrowLimitA: AmountWithUsdSchema,
|
|
667
|
-
borrowLimitB: AmountWithUsdSchema
|
|
668
|
-
});
|
|
669
|
-
var StateSnapshot = import_zod9.default.object({
|
|
670
|
-
slot: import_zod9.default.coerce.bigint(),
|
|
671
|
-
blockTime: import_zod9.default.coerce.date(),
|
|
672
|
-
pools: import_zod9.default.optional(import_zod9.default.record(import_zod9.default.string(), PoolSnapshot)),
|
|
673
|
-
tunaSpotPositions: import_zod9.default.optional(import_zod9.default.array(TunaSpotPosition)),
|
|
674
|
-
tunaLpPositions: import_zod9.default.optional(import_zod9.default.array(TunaLpPositionDtoSchema)),
|
|
675
|
-
fusionLimitOrders: import_zod9.default.optional(import_zod9.default.array(LimitOrder)),
|
|
676
|
-
orderBooks: import_zod9.default.optional(import_zod9.default.record(import_zod9.default.string(), OrderBook))
|
|
678
|
+
var StateSnapshot = import_zod10.default.object({
|
|
679
|
+
slot: import_zod10.default.coerce.bigint(),
|
|
680
|
+
blockTime: import_zod10.default.coerce.date(),
|
|
681
|
+
markets: import_zod10.default.optional(import_zod10.default.array(Market)),
|
|
682
|
+
tunaSpotPositions: import_zod10.default.optional(import_zod10.default.array(TunaSpotPosition)),
|
|
683
|
+
tunaLpPositions: import_zod10.default.optional(import_zod10.default.array(TunaLpPositionDtoSchema)),
|
|
684
|
+
fusionLimitOrders: import_zod10.default.optional(import_zod10.default.array(LimitOrder)),
|
|
685
|
+
orderBooks: import_zod10.default.optional(import_zod10.default.array(OrderBook))
|
|
677
686
|
});
|
|
678
687
|
|
|
679
688
|
// src/client/schemas.ts
|
|
@@ -749,81 +758,60 @@ var WalletSubscriptionTopic = {
|
|
|
749
758
|
TRADE_HISTORY: "trade_history",
|
|
750
759
|
ORDER_HISTORY: "order_history"
|
|
751
760
|
};
|
|
752
|
-
var NotificationEntitySchema =
|
|
753
|
-
var NotificationActionSchema =
|
|
754
|
-
var TradeHistoryActionSchema =
|
|
755
|
-
var TradeHistoryUIDirectionSchema =
|
|
761
|
+
var NotificationEntitySchema = import_zod11.z.enum([NotificationEntity.POOL_SWAP, ...Object.values(NotificationEntity)]);
|
|
762
|
+
var NotificationActionSchema = import_zod11.z.enum([NotificationAction.CREATE, ...Object.values(NotificationAction)]);
|
|
763
|
+
var TradeHistoryActionSchema = import_zod11.z.enum([TradeHistoryAction.SWAP, ...Object.values(TradeHistoryAction)]);
|
|
764
|
+
var TradeHistoryUIDirectionSchema = import_zod11.z.enum([
|
|
756
765
|
TradeHistoryUIDirection.BUY,
|
|
757
766
|
...Object.values(TradeHistoryUIDirection)
|
|
758
767
|
]);
|
|
759
|
-
var OrderHistoryOrderTypeSchema =
|
|
768
|
+
var OrderHistoryOrderTypeSchema = import_zod11.z.enum([
|
|
760
769
|
OrderHistoryOrderType.MARKET,
|
|
761
770
|
...Object.values(OrderHistoryOrderType)
|
|
762
771
|
]);
|
|
763
|
-
var OrderHistoryStatusSchema =
|
|
764
|
-
var OrderHistoryUIDirectionSchema =
|
|
772
|
+
var OrderHistoryStatusSchema = import_zod11.z.enum([OrderHistoryStatus.OPEN, ...Object.values(OrderHistoryStatus)]);
|
|
773
|
+
var OrderHistoryUIDirectionSchema = import_zod11.z.enum([
|
|
765
774
|
OrderHistoryUIDirection.BUY,
|
|
766
775
|
...Object.values(OrderHistoryUIDirection)
|
|
767
776
|
]);
|
|
768
|
-
var StakingPositionHistoryActionTypeSchema =
|
|
777
|
+
var StakingPositionHistoryActionTypeSchema = import_zod11.z.enum([
|
|
769
778
|
StakingPositionHistoryActionType.STAKE,
|
|
770
779
|
...Object.values(StakingPositionHistoryActionType)
|
|
771
780
|
]);
|
|
772
|
-
var PoolSubscriptionTopicSchema =
|
|
781
|
+
var PoolSubscriptionTopicSchema = import_zod11.z.enum([
|
|
773
782
|
PoolSubscriptionTopic.ORDER_BOOK,
|
|
774
783
|
...Object.values(PoolSubscriptionTopic)
|
|
775
784
|
]);
|
|
776
|
-
var WalletSubscriptionTopicSchema =
|
|
785
|
+
var WalletSubscriptionTopicSchema = import_zod11.z.enum([
|
|
777
786
|
WalletSubscriptionTopic.TUNA_POSITIONS,
|
|
778
787
|
...Object.values(WalletSubscriptionTopic)
|
|
779
788
|
]);
|
|
780
|
-
var PaginationMeta =
|
|
781
|
-
total:
|
|
782
|
-
});
|
|
783
|
-
var Market = import_zod10.z.object({
|
|
784
|
-
address: import_zod10.z.string(),
|
|
785
|
-
addressLookupTable: import_zod10.z.string(),
|
|
786
|
-
maxLeverage: import_zod10.z.number(),
|
|
787
|
-
maxSwapSlippage: import_zod10.z.number(),
|
|
788
|
-
protocolFee: import_zod10.z.number(),
|
|
789
|
-
protocolFeeOnCollateral: import_zod10.z.number(),
|
|
790
|
-
liquidationFee: import_zod10.z.number(),
|
|
791
|
-
liquidationThreshold: import_zod10.z.number(),
|
|
792
|
-
oraclePriceDeviationThreshold: import_zod10.z.number(),
|
|
793
|
-
rebalanceProtocolFee: import_zod10.z.number(),
|
|
794
|
-
borrowedFundsA: AmountWithUsdSchema,
|
|
795
|
-
borrowedFundsB: AmountWithUsdSchema,
|
|
796
|
-
borrowLimitA: AmountWithUsdSchema,
|
|
797
|
-
borrowLimitB: AmountWithUsdSchema,
|
|
798
|
-
maxSpotPositionSizeA: AmountWithUsdSchema,
|
|
799
|
-
maxSpotPositionSizeB: AmountWithUsdSchema,
|
|
800
|
-
pool: Pool,
|
|
801
|
-
disabled: import_zod10.z.boolean(),
|
|
802
|
-
createdAt: import_zod10.z.coerce.date()
|
|
789
|
+
var PaginationMeta = import_zod11.z.object({
|
|
790
|
+
total: import_zod11.z.number()
|
|
803
791
|
});
|
|
804
|
-
var TokenOraclePrice =
|
|
805
|
-
mint:
|
|
806
|
-
price:
|
|
807
|
-
decimals:
|
|
808
|
-
time:
|
|
792
|
+
var TokenOraclePrice = import_zod11.z.object({
|
|
793
|
+
mint: import_zod11.z.string(),
|
|
794
|
+
price: import_zod11.z.coerce.bigint(),
|
|
795
|
+
decimals: import_zod11.z.number(),
|
|
796
|
+
time: import_zod11.z.coerce.date()
|
|
809
797
|
});
|
|
810
|
-
var Vault =
|
|
811
|
-
address:
|
|
812
|
-
mint:
|
|
798
|
+
var Vault = import_zod11.z.object({
|
|
799
|
+
address: import_zod11.z.string(),
|
|
800
|
+
mint: import_zod11.z.string(),
|
|
813
801
|
depositedFunds: AmountWithUsdSchema,
|
|
814
802
|
borrowedFunds: AmountWithUsdSchema,
|
|
815
803
|
supplyLimit: AmountWithUsdSchema,
|
|
816
|
-
borrowedShares:
|
|
817
|
-
depositedShares:
|
|
818
|
-
supplyApy:
|
|
819
|
-
borrowApy:
|
|
820
|
-
interestRate:
|
|
821
|
-
utilization:
|
|
822
|
-
pythOracleFeedId:
|
|
823
|
-
pythOraclePriceUpdate:
|
|
804
|
+
borrowedShares: import_zod11.z.coerce.bigint(),
|
|
805
|
+
depositedShares: import_zod11.z.coerce.bigint(),
|
|
806
|
+
supplyApy: import_zod11.z.number(),
|
|
807
|
+
borrowApy: import_zod11.z.number(),
|
|
808
|
+
interestRate: import_zod11.z.coerce.bigint(),
|
|
809
|
+
utilization: import_zod11.z.number(),
|
|
810
|
+
pythOracleFeedId: import_zod11.z.string(),
|
|
811
|
+
pythOraclePriceUpdate: import_zod11.z.string()
|
|
824
812
|
});
|
|
825
|
-
var VaultHistoricalStats =
|
|
826
|
-
date:
|
|
813
|
+
var VaultHistoricalStats = import_zod11.z.object({
|
|
814
|
+
date: import_zod11.z.preprocess((val, ctx) => {
|
|
827
815
|
if (typeof val === "string") {
|
|
828
816
|
const [year, month, day] = val.split("-").map(Number);
|
|
829
817
|
return new Date(year, month - 1, day);
|
|
@@ -832,214 +820,214 @@ var VaultHistoricalStats = import_zod10.z.object({
|
|
|
832
820
|
code: "custom",
|
|
833
821
|
message: "Not a valid date string"
|
|
834
822
|
});
|
|
835
|
-
return
|
|
836
|
-
},
|
|
823
|
+
return import_zod11.z.NEVER;
|
|
824
|
+
}, import_zod11.z.date()),
|
|
837
825
|
supply: AmountWithUsdSchema,
|
|
838
826
|
borrow: AmountWithUsdSchema,
|
|
839
|
-
supplyApy:
|
|
840
|
-
borrowApr:
|
|
827
|
+
supplyApy: import_zod11.z.number(),
|
|
828
|
+
borrowApr: import_zod11.z.number()
|
|
841
829
|
});
|
|
842
|
-
var Tick =
|
|
843
|
-
index:
|
|
844
|
-
liquidity:
|
|
830
|
+
var Tick = import_zod11.z.object({
|
|
831
|
+
index: import_zod11.z.number(),
|
|
832
|
+
liquidity: import_zod11.z.coerce.bigint()
|
|
845
833
|
});
|
|
846
|
-
var PoolTicks =
|
|
847
|
-
tickSpacing:
|
|
834
|
+
var PoolTicks = import_zod11.z.object({
|
|
835
|
+
tickSpacing: import_zod11.z.number(),
|
|
848
836
|
ticks: Tick.array()
|
|
849
837
|
});
|
|
850
|
-
var LendingPosition =
|
|
851
|
-
address:
|
|
852
|
-
authority:
|
|
853
|
-
mint:
|
|
854
|
-
vault:
|
|
855
|
-
shares:
|
|
838
|
+
var LendingPosition = import_zod11.z.object({
|
|
839
|
+
address: import_zod11.z.string(),
|
|
840
|
+
authority: import_zod11.z.string(),
|
|
841
|
+
mint: import_zod11.z.string(),
|
|
842
|
+
vault: import_zod11.z.string(),
|
|
843
|
+
shares: import_zod11.z.coerce.bigint(),
|
|
856
844
|
funds: AmountWithUsdSchema,
|
|
857
845
|
earned: AmountWithUsdSchema
|
|
858
846
|
});
|
|
859
|
-
var PoolSwap =
|
|
860
|
-
id:
|
|
861
|
-
amountIn:
|
|
862
|
-
amountOut:
|
|
863
|
-
amountUsd:
|
|
864
|
-
aToB:
|
|
865
|
-
pool:
|
|
866
|
-
time:
|
|
847
|
+
var PoolSwap = import_zod11.z.object({
|
|
848
|
+
id: import_zod11.z.string(),
|
|
849
|
+
amountIn: import_zod11.z.coerce.bigint(),
|
|
850
|
+
amountOut: import_zod11.z.coerce.bigint(),
|
|
851
|
+
amountUsd: import_zod11.z.number(),
|
|
852
|
+
aToB: import_zod11.z.boolean(),
|
|
853
|
+
pool: import_zod11.z.string(),
|
|
854
|
+
time: import_zod11.z.coerce.date()
|
|
867
855
|
});
|
|
868
|
-
var TradeHistoryEntry =
|
|
856
|
+
var TradeHistoryEntry = import_zod11.z.object({
|
|
869
857
|
// Internal entry ID
|
|
870
|
-
id:
|
|
858
|
+
id: import_zod11.z.string(),
|
|
871
859
|
pool: Pool,
|
|
872
|
-
authority:
|
|
873
|
-
aToB:
|
|
860
|
+
authority: import_zod11.z.string(),
|
|
861
|
+
aToB: import_zod11.z.boolean(),
|
|
874
862
|
// Trade action which created entry
|
|
875
863
|
action: TradeHistoryActionSchema,
|
|
876
864
|
// Trade direction formatted for ui display
|
|
877
865
|
uiDirection: TradeHistoryUIDirectionSchema,
|
|
878
866
|
// Trade price formatted for ui display
|
|
879
|
-
uiPrice:
|
|
867
|
+
uiPrice: import_zod11.z.number(),
|
|
880
868
|
baseToken: AmountWithUsdSchema,
|
|
881
869
|
quoteToken: AmountWithUsdSchema,
|
|
882
870
|
fee: AmountWithUsdSchema,
|
|
883
|
-
pnl:
|
|
884
|
-
|
|
885
|
-
usd:
|
|
886
|
-
bps:
|
|
871
|
+
pnl: import_zod11.z.nullable(
|
|
872
|
+
import_zod11.z.object({
|
|
873
|
+
usd: import_zod11.z.number(),
|
|
874
|
+
bps: import_zod11.z.number()
|
|
887
875
|
})
|
|
888
876
|
),
|
|
889
|
-
txSignature:
|
|
890
|
-
positionAddress:
|
|
891
|
-
slot:
|
|
892
|
-
ts:
|
|
877
|
+
txSignature: import_zod11.z.nullable(import_zod11.z.string()),
|
|
878
|
+
positionAddress: import_zod11.z.nullable(import_zod11.z.string()),
|
|
879
|
+
slot: import_zod11.z.coerce.bigint(),
|
|
880
|
+
ts: import_zod11.z.coerce.date()
|
|
893
881
|
});
|
|
894
|
-
var OrderHistoryEntry =
|
|
882
|
+
var OrderHistoryEntry = import_zod11.z.object({
|
|
895
883
|
// Internal entry ID
|
|
896
|
-
id:
|
|
884
|
+
id: import_zod11.z.string(),
|
|
897
885
|
pool: Pool,
|
|
898
|
-
authority:
|
|
886
|
+
authority: import_zod11.z.string(),
|
|
899
887
|
orderType: OrderHistoryOrderTypeSchema,
|
|
900
|
-
isReduceOnly:
|
|
901
|
-
aToB:
|
|
888
|
+
isReduceOnly: import_zod11.z.nullable(import_zod11.z.boolean()),
|
|
889
|
+
aToB: import_zod11.z.boolean(),
|
|
902
890
|
uiDirection: OrderHistoryUIDirectionSchema,
|
|
903
|
-
uiPrice:
|
|
904
|
-
uiExecutionPrice:
|
|
891
|
+
uiPrice: import_zod11.z.nullable(import_zod11.z.number()),
|
|
892
|
+
uiExecutionPrice: import_zod11.z.nullable(import_zod11.z.number()),
|
|
905
893
|
status: OrderHistoryStatusSchema,
|
|
906
894
|
baseToken: AmountWithUsdSchema,
|
|
907
895
|
quoteToken: AmountWithUsdSchema,
|
|
908
|
-
baseTokenConsumedAmount:
|
|
909
|
-
quoteTokenFilledAmount:
|
|
910
|
-
txSignature:
|
|
911
|
-
positionAddress:
|
|
912
|
-
slot:
|
|
913
|
-
ts:
|
|
896
|
+
baseTokenConsumedAmount: import_zod11.z.nullable(AmountWithUsdSchema),
|
|
897
|
+
quoteTokenFilledAmount: import_zod11.z.nullable(AmountWithUsdSchema),
|
|
898
|
+
txSignature: import_zod11.z.nullable(import_zod11.z.string()),
|
|
899
|
+
positionAddress: import_zod11.z.nullable(import_zod11.z.string()),
|
|
900
|
+
slot: import_zod11.z.coerce.bigint(),
|
|
901
|
+
ts: import_zod11.z.coerce.date()
|
|
914
902
|
});
|
|
915
|
-
var StakingTreasury =
|
|
916
|
-
address:
|
|
917
|
-
stakedTokenMint:
|
|
918
|
-
rewardTokenMint:
|
|
919
|
-
apy:
|
|
920
|
-
uniqueStakers:
|
|
903
|
+
var StakingTreasury = import_zod11.z.object({
|
|
904
|
+
address: import_zod11.z.string(),
|
|
905
|
+
stakedTokenMint: import_zod11.z.string(),
|
|
906
|
+
rewardTokenMint: import_zod11.z.string(),
|
|
907
|
+
apy: import_zod11.z.number(),
|
|
908
|
+
uniqueStakers: import_zod11.z.number(),
|
|
921
909
|
totalStaked: AmountWithUsdSchema,
|
|
922
910
|
totalReward: AmountWithUsdSchema,
|
|
923
|
-
unstakeCooldownSeconds:
|
|
924
|
-
isStakingEnabled:
|
|
925
|
-
isUnstakingEnabled:
|
|
926
|
-
isWithdrawEnabled:
|
|
911
|
+
unstakeCooldownSeconds: import_zod11.z.number(),
|
|
912
|
+
isStakingEnabled: import_zod11.z.boolean(),
|
|
913
|
+
isUnstakingEnabled: import_zod11.z.boolean(),
|
|
914
|
+
isWithdrawEnabled: import_zod11.z.boolean()
|
|
927
915
|
});
|
|
928
|
-
var StakingPosition =
|
|
929
|
-
address:
|
|
930
|
-
owner:
|
|
916
|
+
var StakingPosition = import_zod11.z.object({
|
|
917
|
+
address: import_zod11.z.string(),
|
|
918
|
+
owner: import_zod11.z.string(),
|
|
931
919
|
staked: AmountWithUsdSchema,
|
|
932
920
|
unstaked: AmountWithUsdSchema,
|
|
933
921
|
claimedReward: AmountWithUsdSchema,
|
|
934
922
|
unclaimedReward: AmountWithUsdSchema,
|
|
935
|
-
rank:
|
|
936
|
-
vesting:
|
|
923
|
+
rank: import_zod11.z.nullable(import_zod11.z.number()),
|
|
924
|
+
vesting: import_zod11.z.object({
|
|
937
925
|
locked: AmountWithUsdSchema,
|
|
938
926
|
unlocked: AmountWithUsdSchema,
|
|
939
|
-
unlockRate:
|
|
940
|
-
unlockEverySeconds:
|
|
941
|
-
unlockCliffSeconds:
|
|
942
|
-
lockedAt:
|
|
927
|
+
unlockRate: import_zod11.z.coerce.bigint(),
|
|
928
|
+
unlockEverySeconds: import_zod11.z.number(),
|
|
929
|
+
unlockCliffSeconds: import_zod11.z.number(),
|
|
930
|
+
lockedAt: import_zod11.z.nullable(import_zod11.z.coerce.date())
|
|
943
931
|
}),
|
|
944
|
-
lastUnstakedAt:
|
|
945
|
-
withdrawAvailableAt:
|
|
932
|
+
lastUnstakedAt: import_zod11.z.nullable(import_zod11.z.coerce.date()),
|
|
933
|
+
withdrawAvailableAt: import_zod11.z.nullable(import_zod11.z.coerce.date())
|
|
946
934
|
});
|
|
947
|
-
var StakingLeaderboardPosition =
|
|
948
|
-
rank:
|
|
949
|
-
address:
|
|
950
|
-
owner:
|
|
935
|
+
var StakingLeaderboardPosition = import_zod11.z.object({
|
|
936
|
+
rank: import_zod11.z.number(),
|
|
937
|
+
address: import_zod11.z.string(),
|
|
938
|
+
owner: import_zod11.z.string(),
|
|
951
939
|
staked: AmountWithUsdSchema
|
|
952
940
|
});
|
|
953
|
-
var StakingLeaderboardPage =
|
|
941
|
+
var StakingLeaderboardPage = import_zod11.z.object({
|
|
954
942
|
data: StakingLeaderboardPosition.array(),
|
|
955
943
|
meta: PaginationMeta
|
|
956
944
|
});
|
|
957
|
-
var StakingPositionHistoryAction =
|
|
958
|
-
position:
|
|
945
|
+
var StakingPositionHistoryAction = import_zod11.z.object({
|
|
946
|
+
position: import_zod11.z.string(),
|
|
959
947
|
action: StakingPositionHistoryActionTypeSchema,
|
|
960
|
-
txSignature:
|
|
961
|
-
amount:
|
|
962
|
-
time:
|
|
948
|
+
txSignature: import_zod11.z.string(),
|
|
949
|
+
amount: import_zod11.z.coerce.bigint(),
|
|
950
|
+
time: import_zod11.z.coerce.date()
|
|
963
951
|
});
|
|
964
|
-
var PoolPriceCandle =
|
|
965
|
-
time:
|
|
966
|
-
open:
|
|
967
|
-
close:
|
|
968
|
-
high:
|
|
969
|
-
low:
|
|
970
|
-
volume:
|
|
952
|
+
var PoolPriceCandle = import_zod11.z.object({
|
|
953
|
+
time: import_zod11.z.number(),
|
|
954
|
+
open: import_zod11.z.number(),
|
|
955
|
+
close: import_zod11.z.number(),
|
|
956
|
+
high: import_zod11.z.number(),
|
|
957
|
+
low: import_zod11.z.number(),
|
|
958
|
+
volume: import_zod11.z.number()
|
|
971
959
|
});
|
|
972
|
-
var FeesStatsGroup =
|
|
973
|
-
time:
|
|
974
|
-
addLiquidityFees:
|
|
975
|
-
limitOrderFees:
|
|
976
|
-
yieldCompoundingFees:
|
|
977
|
-
liquidationFees:
|
|
978
|
-
totalLiquidationsNetworkFees:
|
|
979
|
-
totalLimitOrdersNetworkFees:
|
|
980
|
-
totalYieldCompoundingNetworkFees:
|
|
981
|
-
failedNetworkFees:
|
|
982
|
-
processedNetworkFees:
|
|
983
|
-
totalCollectedFees:
|
|
984
|
-
totalNetworkFees:
|
|
985
|
-
jitoLiquidationFees:
|
|
986
|
-
jitoLimitOrderFees:
|
|
987
|
-
jitoYieldCompoundingFees:
|
|
988
|
-
runningAddLiquidityFees:
|
|
989
|
-
runningLimitOrderFees:
|
|
990
|
-
runningYieldCompoundingFees:
|
|
991
|
-
runningLiquidationFees:
|
|
992
|
-
runningTotalLiquidationsNetworkFees:
|
|
993
|
-
runningTotalLimitOrdersNetworkFees:
|
|
994
|
-
runningTotalYieldCompoundingNetworkFees:
|
|
995
|
-
runningFailedNetworkFees:
|
|
996
|
-
runningProcessedNetworkFees:
|
|
997
|
-
runningJitoLiquidationFees:
|
|
998
|
-
runningJitoLimitOrderFees:
|
|
999
|
-
runningJitoYieldCompoundingFees:
|
|
1000
|
-
runningTotalCollectedFees:
|
|
1001
|
-
runningTotalNetworkFees:
|
|
960
|
+
var FeesStatsGroup = import_zod11.z.object({
|
|
961
|
+
time: import_zod11.z.coerce.date(),
|
|
962
|
+
addLiquidityFees: import_zod11.z.number(),
|
|
963
|
+
limitOrderFees: import_zod11.z.number(),
|
|
964
|
+
yieldCompoundingFees: import_zod11.z.number(),
|
|
965
|
+
liquidationFees: import_zod11.z.number(),
|
|
966
|
+
totalLiquidationsNetworkFees: import_zod11.z.number(),
|
|
967
|
+
totalLimitOrdersNetworkFees: import_zod11.z.number(),
|
|
968
|
+
totalYieldCompoundingNetworkFees: import_zod11.z.number(),
|
|
969
|
+
failedNetworkFees: import_zod11.z.number(),
|
|
970
|
+
processedNetworkFees: import_zod11.z.number(),
|
|
971
|
+
totalCollectedFees: import_zod11.z.number(),
|
|
972
|
+
totalNetworkFees: import_zod11.z.number(),
|
|
973
|
+
jitoLiquidationFees: import_zod11.z.number(),
|
|
974
|
+
jitoLimitOrderFees: import_zod11.z.number(),
|
|
975
|
+
jitoYieldCompoundingFees: import_zod11.z.number(),
|
|
976
|
+
runningAddLiquidityFees: import_zod11.z.number(),
|
|
977
|
+
runningLimitOrderFees: import_zod11.z.number(),
|
|
978
|
+
runningYieldCompoundingFees: import_zod11.z.number(),
|
|
979
|
+
runningLiquidationFees: import_zod11.z.number(),
|
|
980
|
+
runningTotalLiquidationsNetworkFees: import_zod11.z.number(),
|
|
981
|
+
runningTotalLimitOrdersNetworkFees: import_zod11.z.number(),
|
|
982
|
+
runningTotalYieldCompoundingNetworkFees: import_zod11.z.number(),
|
|
983
|
+
runningFailedNetworkFees: import_zod11.z.number(),
|
|
984
|
+
runningProcessedNetworkFees: import_zod11.z.number(),
|
|
985
|
+
runningJitoLiquidationFees: import_zod11.z.number(),
|
|
986
|
+
runningJitoLimitOrderFees: import_zod11.z.number(),
|
|
987
|
+
runningJitoYieldCompoundingFees: import_zod11.z.number(),
|
|
988
|
+
runningTotalCollectedFees: import_zod11.z.number(),
|
|
989
|
+
runningTotalNetworkFees: import_zod11.z.number()
|
|
1002
990
|
});
|
|
1003
|
-
var StakingRevenueStatsGroup =
|
|
1004
|
-
time:
|
|
1005
|
-
totalDepositsUsd:
|
|
1006
|
-
totalDepositsSol:
|
|
1007
|
-
runningTotalDepositsUsd:
|
|
1008
|
-
runningTotalDepositsSol:
|
|
991
|
+
var StakingRevenueStatsGroup = import_zod11.z.object({
|
|
992
|
+
time: import_zod11.z.coerce.date(),
|
|
993
|
+
totalDepositsUsd: import_zod11.z.number(),
|
|
994
|
+
totalDepositsSol: import_zod11.z.coerce.bigint(),
|
|
995
|
+
runningTotalDepositsUsd: import_zod11.z.number(),
|
|
996
|
+
runningTotalDepositsSol: import_zod11.z.coerce.bigint()
|
|
1009
997
|
});
|
|
1010
|
-
var SwapQuoteByInput =
|
|
1011
|
-
estimatedAmountOut:
|
|
1012
|
-
minAmountOut:
|
|
1013
|
-
feeAmount:
|
|
1014
|
-
feeUsd:
|
|
998
|
+
var SwapQuoteByInput = import_zod11.z.object({
|
|
999
|
+
estimatedAmountOut: import_zod11.z.coerce.bigint(),
|
|
1000
|
+
minAmountOut: import_zod11.z.coerce.bigint(),
|
|
1001
|
+
feeAmount: import_zod11.z.coerce.bigint(),
|
|
1002
|
+
feeUsd: import_zod11.z.number(),
|
|
1015
1003
|
/** Price impact in percents */
|
|
1016
|
-
priceImpact:
|
|
1004
|
+
priceImpact: import_zod11.z.number()
|
|
1017
1005
|
});
|
|
1018
|
-
var SwapQuoteByOutput =
|
|
1019
|
-
estimatedAmountIn:
|
|
1020
|
-
maxAmountIn:
|
|
1021
|
-
feeAmount:
|
|
1022
|
-
feeUsd:
|
|
1006
|
+
var SwapQuoteByOutput = import_zod11.z.object({
|
|
1007
|
+
estimatedAmountIn: import_zod11.z.coerce.bigint(),
|
|
1008
|
+
maxAmountIn: import_zod11.z.coerce.bigint(),
|
|
1009
|
+
feeAmount: import_zod11.z.coerce.bigint(),
|
|
1010
|
+
feeUsd: import_zod11.z.number(),
|
|
1023
1011
|
/** Price impact in percents */
|
|
1024
|
-
priceImpact:
|
|
1012
|
+
priceImpact: import_zod11.z.number()
|
|
1025
1013
|
});
|
|
1026
|
-
var LimitOrderQuoteByInput =
|
|
1027
|
-
amountOut:
|
|
1014
|
+
var LimitOrderQuoteByInput = import_zod11.z.object({
|
|
1015
|
+
amountOut: import_zod11.z.coerce.bigint()
|
|
1028
1016
|
});
|
|
1029
|
-
var LimitOrderQuoteByOutput =
|
|
1030
|
-
amountIn:
|
|
1017
|
+
var LimitOrderQuoteByOutput = import_zod11.z.object({
|
|
1018
|
+
amountIn: import_zod11.z.coerce.bigint()
|
|
1031
1019
|
});
|
|
1032
1020
|
var TradableAmount = AmountWithUsdSchema;
|
|
1033
|
-
var UpdateStreamSubscriptionResult =
|
|
1034
|
-
status:
|
|
1021
|
+
var UpdateStreamSubscriptionResult = import_zod11.z.object({
|
|
1022
|
+
status: import_zod11.z.string()
|
|
1035
1023
|
});
|
|
1036
|
-
var createNotificationSchema = (dataSchema, metaSchema) =>
|
|
1024
|
+
var createNotificationSchema = (dataSchema, metaSchema) => import_zod11.z.object({
|
|
1037
1025
|
entity: NotificationEntitySchema,
|
|
1038
1026
|
action: NotificationActionSchema,
|
|
1039
1027
|
data: dataSchema,
|
|
1040
|
-
id:
|
|
1041
|
-
authority:
|
|
1042
|
-
...metaSchema ? { meta: metaSchema } : { meta:
|
|
1028
|
+
id: import_zod11.z.string(),
|
|
1029
|
+
authority: import_zod11.z.nullish(import_zod11.z.string()),
|
|
1030
|
+
...metaSchema ? { meta: metaSchema } : { meta: import_zod11.z.undefined().nullable() }
|
|
1043
1031
|
});
|
|
1044
1032
|
var PoolSwapNotification = createNotificationSchema(PoolSwap);
|
|
1045
1033
|
var LendingPositionNotification = createNotificationSchema(LendingPosition);
|