@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.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
|
|
@@ -712,81 +721,60 @@ var WalletSubscriptionTopic = {
|
|
|
712
721
|
TRADE_HISTORY: "trade_history",
|
|
713
722
|
ORDER_HISTORY: "order_history"
|
|
714
723
|
};
|
|
715
|
-
var NotificationEntitySchema =
|
|
716
|
-
var NotificationActionSchema =
|
|
717
|
-
var TradeHistoryActionSchema =
|
|
718
|
-
var TradeHistoryUIDirectionSchema =
|
|
724
|
+
var NotificationEntitySchema = z11.enum([NotificationEntity.POOL_SWAP, ...Object.values(NotificationEntity)]);
|
|
725
|
+
var NotificationActionSchema = z11.enum([NotificationAction.CREATE, ...Object.values(NotificationAction)]);
|
|
726
|
+
var TradeHistoryActionSchema = z11.enum([TradeHistoryAction.SWAP, ...Object.values(TradeHistoryAction)]);
|
|
727
|
+
var TradeHistoryUIDirectionSchema = z11.enum([
|
|
719
728
|
TradeHistoryUIDirection.BUY,
|
|
720
729
|
...Object.values(TradeHistoryUIDirection)
|
|
721
730
|
]);
|
|
722
|
-
var OrderHistoryOrderTypeSchema =
|
|
731
|
+
var OrderHistoryOrderTypeSchema = z11.enum([
|
|
723
732
|
OrderHistoryOrderType.MARKET,
|
|
724
733
|
...Object.values(OrderHistoryOrderType)
|
|
725
734
|
]);
|
|
726
|
-
var OrderHistoryStatusSchema =
|
|
727
|
-
var OrderHistoryUIDirectionSchema =
|
|
735
|
+
var OrderHistoryStatusSchema = z11.enum([OrderHistoryStatus.OPEN, ...Object.values(OrderHistoryStatus)]);
|
|
736
|
+
var OrderHistoryUIDirectionSchema = z11.enum([
|
|
728
737
|
OrderHistoryUIDirection.BUY,
|
|
729
738
|
...Object.values(OrderHistoryUIDirection)
|
|
730
739
|
]);
|
|
731
|
-
var StakingPositionHistoryActionTypeSchema =
|
|
740
|
+
var StakingPositionHistoryActionTypeSchema = z11.enum([
|
|
732
741
|
StakingPositionHistoryActionType.STAKE,
|
|
733
742
|
...Object.values(StakingPositionHistoryActionType)
|
|
734
743
|
]);
|
|
735
|
-
var PoolSubscriptionTopicSchema =
|
|
744
|
+
var PoolSubscriptionTopicSchema = z11.enum([
|
|
736
745
|
PoolSubscriptionTopic.ORDER_BOOK,
|
|
737
746
|
...Object.values(PoolSubscriptionTopic)
|
|
738
747
|
]);
|
|
739
|
-
var WalletSubscriptionTopicSchema =
|
|
748
|
+
var WalletSubscriptionTopicSchema = z11.enum([
|
|
740
749
|
WalletSubscriptionTopic.TUNA_POSITIONS,
|
|
741
750
|
...Object.values(WalletSubscriptionTopic)
|
|
742
751
|
]);
|
|
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()
|
|
752
|
+
var PaginationMeta = z11.object({
|
|
753
|
+
total: z11.number()
|
|
766
754
|
});
|
|
767
|
-
var TokenOraclePrice =
|
|
768
|
-
mint:
|
|
769
|
-
price:
|
|
770
|
-
decimals:
|
|
771
|
-
time:
|
|
755
|
+
var TokenOraclePrice = z11.object({
|
|
756
|
+
mint: z11.string(),
|
|
757
|
+
price: z11.coerce.bigint(),
|
|
758
|
+
decimals: z11.number(),
|
|
759
|
+
time: z11.coerce.date()
|
|
772
760
|
});
|
|
773
|
-
var Vault =
|
|
774
|
-
address:
|
|
775
|
-
mint:
|
|
761
|
+
var Vault = z11.object({
|
|
762
|
+
address: z11.string(),
|
|
763
|
+
mint: z11.string(),
|
|
776
764
|
depositedFunds: AmountWithUsdSchema,
|
|
777
765
|
borrowedFunds: AmountWithUsdSchema,
|
|
778
766
|
supplyLimit: AmountWithUsdSchema,
|
|
779
|
-
borrowedShares:
|
|
780
|
-
depositedShares:
|
|
781
|
-
supplyApy:
|
|
782
|
-
borrowApy:
|
|
783
|
-
interestRate:
|
|
784
|
-
utilization:
|
|
785
|
-
pythOracleFeedId:
|
|
786
|
-
pythOraclePriceUpdate:
|
|
767
|
+
borrowedShares: z11.coerce.bigint(),
|
|
768
|
+
depositedShares: z11.coerce.bigint(),
|
|
769
|
+
supplyApy: z11.number(),
|
|
770
|
+
borrowApy: z11.number(),
|
|
771
|
+
interestRate: z11.coerce.bigint(),
|
|
772
|
+
utilization: z11.number(),
|
|
773
|
+
pythOracleFeedId: z11.string(),
|
|
774
|
+
pythOraclePriceUpdate: z11.string()
|
|
787
775
|
});
|
|
788
|
-
var VaultHistoricalStats =
|
|
789
|
-
date:
|
|
776
|
+
var VaultHistoricalStats = z11.object({
|
|
777
|
+
date: z11.preprocess((val, ctx) => {
|
|
790
778
|
if (typeof val === "string") {
|
|
791
779
|
const [year, month, day] = val.split("-").map(Number);
|
|
792
780
|
return new Date(year, month - 1, day);
|
|
@@ -795,214 +783,214 @@ var VaultHistoricalStats = z10.object({
|
|
|
795
783
|
code: "custom",
|
|
796
784
|
message: "Not a valid date string"
|
|
797
785
|
});
|
|
798
|
-
return
|
|
799
|
-
},
|
|
786
|
+
return z11.NEVER;
|
|
787
|
+
}, z11.date()),
|
|
800
788
|
supply: AmountWithUsdSchema,
|
|
801
789
|
borrow: AmountWithUsdSchema,
|
|
802
|
-
supplyApy:
|
|
803
|
-
borrowApr:
|
|
790
|
+
supplyApy: z11.number(),
|
|
791
|
+
borrowApr: z11.number()
|
|
804
792
|
});
|
|
805
|
-
var Tick =
|
|
806
|
-
index:
|
|
807
|
-
liquidity:
|
|
793
|
+
var Tick = z11.object({
|
|
794
|
+
index: z11.number(),
|
|
795
|
+
liquidity: z11.coerce.bigint()
|
|
808
796
|
});
|
|
809
|
-
var PoolTicks =
|
|
810
|
-
tickSpacing:
|
|
797
|
+
var PoolTicks = z11.object({
|
|
798
|
+
tickSpacing: z11.number(),
|
|
811
799
|
ticks: Tick.array()
|
|
812
800
|
});
|
|
813
|
-
var LendingPosition =
|
|
814
|
-
address:
|
|
815
|
-
authority:
|
|
816
|
-
mint:
|
|
817
|
-
vault:
|
|
818
|
-
shares:
|
|
801
|
+
var LendingPosition = z11.object({
|
|
802
|
+
address: z11.string(),
|
|
803
|
+
authority: z11.string(),
|
|
804
|
+
mint: z11.string(),
|
|
805
|
+
vault: z11.string(),
|
|
806
|
+
shares: z11.coerce.bigint(),
|
|
819
807
|
funds: AmountWithUsdSchema,
|
|
820
808
|
earned: AmountWithUsdSchema
|
|
821
809
|
});
|
|
822
|
-
var PoolSwap =
|
|
823
|
-
id:
|
|
824
|
-
amountIn:
|
|
825
|
-
amountOut:
|
|
826
|
-
amountUsd:
|
|
827
|
-
aToB:
|
|
828
|
-
pool:
|
|
829
|
-
time:
|
|
810
|
+
var PoolSwap = z11.object({
|
|
811
|
+
id: z11.string(),
|
|
812
|
+
amountIn: z11.coerce.bigint(),
|
|
813
|
+
amountOut: z11.coerce.bigint(),
|
|
814
|
+
amountUsd: z11.number(),
|
|
815
|
+
aToB: z11.boolean(),
|
|
816
|
+
pool: z11.string(),
|
|
817
|
+
time: z11.coerce.date()
|
|
830
818
|
});
|
|
831
|
-
var TradeHistoryEntry =
|
|
819
|
+
var TradeHistoryEntry = z11.object({
|
|
832
820
|
// Internal entry ID
|
|
833
|
-
id:
|
|
821
|
+
id: z11.string(),
|
|
834
822
|
pool: Pool,
|
|
835
|
-
authority:
|
|
836
|
-
aToB:
|
|
823
|
+
authority: z11.string(),
|
|
824
|
+
aToB: z11.boolean(),
|
|
837
825
|
// Trade action which created entry
|
|
838
826
|
action: TradeHistoryActionSchema,
|
|
839
827
|
// Trade direction formatted for ui display
|
|
840
828
|
uiDirection: TradeHistoryUIDirectionSchema,
|
|
841
829
|
// Trade price formatted for ui display
|
|
842
|
-
uiPrice:
|
|
830
|
+
uiPrice: z11.number(),
|
|
843
831
|
baseToken: AmountWithUsdSchema,
|
|
844
832
|
quoteToken: AmountWithUsdSchema,
|
|
845
833
|
fee: AmountWithUsdSchema,
|
|
846
|
-
pnl:
|
|
847
|
-
|
|
848
|
-
usd:
|
|
849
|
-
bps:
|
|
834
|
+
pnl: z11.nullable(
|
|
835
|
+
z11.object({
|
|
836
|
+
usd: z11.number(),
|
|
837
|
+
bps: z11.number()
|
|
850
838
|
})
|
|
851
839
|
),
|
|
852
|
-
txSignature:
|
|
853
|
-
positionAddress:
|
|
854
|
-
slot:
|
|
855
|
-
ts:
|
|
840
|
+
txSignature: z11.nullable(z11.string()),
|
|
841
|
+
positionAddress: z11.nullable(z11.string()),
|
|
842
|
+
slot: z11.coerce.bigint(),
|
|
843
|
+
ts: z11.coerce.date()
|
|
856
844
|
});
|
|
857
|
-
var OrderHistoryEntry =
|
|
845
|
+
var OrderHistoryEntry = z11.object({
|
|
858
846
|
// Internal entry ID
|
|
859
|
-
id:
|
|
847
|
+
id: z11.string(),
|
|
860
848
|
pool: Pool,
|
|
861
|
-
authority:
|
|
849
|
+
authority: z11.string(),
|
|
862
850
|
orderType: OrderHistoryOrderTypeSchema,
|
|
863
|
-
isReduceOnly:
|
|
864
|
-
aToB:
|
|
851
|
+
isReduceOnly: z11.nullable(z11.boolean()),
|
|
852
|
+
aToB: z11.boolean(),
|
|
865
853
|
uiDirection: OrderHistoryUIDirectionSchema,
|
|
866
|
-
uiPrice:
|
|
867
|
-
uiExecutionPrice:
|
|
854
|
+
uiPrice: z11.nullable(z11.number()),
|
|
855
|
+
uiExecutionPrice: z11.nullable(z11.number()),
|
|
868
856
|
status: OrderHistoryStatusSchema,
|
|
869
857
|
baseToken: AmountWithUsdSchema,
|
|
870
858
|
quoteToken: AmountWithUsdSchema,
|
|
871
|
-
baseTokenConsumedAmount:
|
|
872
|
-
quoteTokenFilledAmount:
|
|
873
|
-
txSignature:
|
|
874
|
-
positionAddress:
|
|
875
|
-
slot:
|
|
876
|
-
ts:
|
|
859
|
+
baseTokenConsumedAmount: z11.nullable(AmountWithUsdSchema),
|
|
860
|
+
quoteTokenFilledAmount: z11.nullable(AmountWithUsdSchema),
|
|
861
|
+
txSignature: z11.nullable(z11.string()),
|
|
862
|
+
positionAddress: z11.nullable(z11.string()),
|
|
863
|
+
slot: z11.coerce.bigint(),
|
|
864
|
+
ts: z11.coerce.date()
|
|
877
865
|
});
|
|
878
|
-
var StakingTreasury =
|
|
879
|
-
address:
|
|
880
|
-
stakedTokenMint:
|
|
881
|
-
rewardTokenMint:
|
|
882
|
-
apy:
|
|
883
|
-
uniqueStakers:
|
|
866
|
+
var StakingTreasury = z11.object({
|
|
867
|
+
address: z11.string(),
|
|
868
|
+
stakedTokenMint: z11.string(),
|
|
869
|
+
rewardTokenMint: z11.string(),
|
|
870
|
+
apy: z11.number(),
|
|
871
|
+
uniqueStakers: z11.number(),
|
|
884
872
|
totalStaked: AmountWithUsdSchema,
|
|
885
873
|
totalReward: AmountWithUsdSchema,
|
|
886
|
-
unstakeCooldownSeconds:
|
|
887
|
-
isStakingEnabled:
|
|
888
|
-
isUnstakingEnabled:
|
|
889
|
-
isWithdrawEnabled:
|
|
874
|
+
unstakeCooldownSeconds: z11.number(),
|
|
875
|
+
isStakingEnabled: z11.boolean(),
|
|
876
|
+
isUnstakingEnabled: z11.boolean(),
|
|
877
|
+
isWithdrawEnabled: z11.boolean()
|
|
890
878
|
});
|
|
891
|
-
var StakingPosition =
|
|
892
|
-
address:
|
|
893
|
-
owner:
|
|
879
|
+
var StakingPosition = z11.object({
|
|
880
|
+
address: z11.string(),
|
|
881
|
+
owner: z11.string(),
|
|
894
882
|
staked: AmountWithUsdSchema,
|
|
895
883
|
unstaked: AmountWithUsdSchema,
|
|
896
884
|
claimedReward: AmountWithUsdSchema,
|
|
897
885
|
unclaimedReward: AmountWithUsdSchema,
|
|
898
|
-
rank:
|
|
899
|
-
vesting:
|
|
886
|
+
rank: z11.nullable(z11.number()),
|
|
887
|
+
vesting: z11.object({
|
|
900
888
|
locked: AmountWithUsdSchema,
|
|
901
889
|
unlocked: AmountWithUsdSchema,
|
|
902
|
-
unlockRate:
|
|
903
|
-
unlockEverySeconds:
|
|
904
|
-
unlockCliffSeconds:
|
|
905
|
-
lockedAt:
|
|
890
|
+
unlockRate: z11.coerce.bigint(),
|
|
891
|
+
unlockEverySeconds: z11.number(),
|
|
892
|
+
unlockCliffSeconds: z11.number(),
|
|
893
|
+
lockedAt: z11.nullable(z11.coerce.date())
|
|
906
894
|
}),
|
|
907
|
-
lastUnstakedAt:
|
|
908
|
-
withdrawAvailableAt:
|
|
895
|
+
lastUnstakedAt: z11.nullable(z11.coerce.date()),
|
|
896
|
+
withdrawAvailableAt: z11.nullable(z11.coerce.date())
|
|
909
897
|
});
|
|
910
|
-
var StakingLeaderboardPosition =
|
|
911
|
-
rank:
|
|
912
|
-
address:
|
|
913
|
-
owner:
|
|
898
|
+
var StakingLeaderboardPosition = z11.object({
|
|
899
|
+
rank: z11.number(),
|
|
900
|
+
address: z11.string(),
|
|
901
|
+
owner: z11.string(),
|
|
914
902
|
staked: AmountWithUsdSchema
|
|
915
903
|
});
|
|
916
|
-
var StakingLeaderboardPage =
|
|
904
|
+
var StakingLeaderboardPage = z11.object({
|
|
917
905
|
data: StakingLeaderboardPosition.array(),
|
|
918
906
|
meta: PaginationMeta
|
|
919
907
|
});
|
|
920
|
-
var StakingPositionHistoryAction =
|
|
921
|
-
position:
|
|
908
|
+
var StakingPositionHistoryAction = z11.object({
|
|
909
|
+
position: z11.string(),
|
|
922
910
|
action: StakingPositionHistoryActionTypeSchema,
|
|
923
|
-
txSignature:
|
|
924
|
-
amount:
|
|
925
|
-
time:
|
|
911
|
+
txSignature: z11.string(),
|
|
912
|
+
amount: z11.coerce.bigint(),
|
|
913
|
+
time: z11.coerce.date()
|
|
926
914
|
});
|
|
927
|
-
var PoolPriceCandle =
|
|
928
|
-
time:
|
|
929
|
-
open:
|
|
930
|
-
close:
|
|
931
|
-
high:
|
|
932
|
-
low:
|
|
933
|
-
volume:
|
|
915
|
+
var PoolPriceCandle = z11.object({
|
|
916
|
+
time: z11.number(),
|
|
917
|
+
open: z11.number(),
|
|
918
|
+
close: z11.number(),
|
|
919
|
+
high: z11.number(),
|
|
920
|
+
low: z11.number(),
|
|
921
|
+
volume: z11.number()
|
|
934
922
|
});
|
|
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:
|
|
923
|
+
var FeesStatsGroup = z11.object({
|
|
924
|
+
time: z11.coerce.date(),
|
|
925
|
+
addLiquidityFees: z11.number(),
|
|
926
|
+
limitOrderFees: z11.number(),
|
|
927
|
+
yieldCompoundingFees: z11.number(),
|
|
928
|
+
liquidationFees: z11.number(),
|
|
929
|
+
totalLiquidationsNetworkFees: z11.number(),
|
|
930
|
+
totalLimitOrdersNetworkFees: z11.number(),
|
|
931
|
+
totalYieldCompoundingNetworkFees: z11.number(),
|
|
932
|
+
failedNetworkFees: z11.number(),
|
|
933
|
+
processedNetworkFees: z11.number(),
|
|
934
|
+
totalCollectedFees: z11.number(),
|
|
935
|
+
totalNetworkFees: z11.number(),
|
|
936
|
+
jitoLiquidationFees: z11.number(),
|
|
937
|
+
jitoLimitOrderFees: z11.number(),
|
|
938
|
+
jitoYieldCompoundingFees: z11.number(),
|
|
939
|
+
runningAddLiquidityFees: z11.number(),
|
|
940
|
+
runningLimitOrderFees: z11.number(),
|
|
941
|
+
runningYieldCompoundingFees: z11.number(),
|
|
942
|
+
runningLiquidationFees: z11.number(),
|
|
943
|
+
runningTotalLiquidationsNetworkFees: z11.number(),
|
|
944
|
+
runningTotalLimitOrdersNetworkFees: z11.number(),
|
|
945
|
+
runningTotalYieldCompoundingNetworkFees: z11.number(),
|
|
946
|
+
runningFailedNetworkFees: z11.number(),
|
|
947
|
+
runningProcessedNetworkFees: z11.number(),
|
|
948
|
+
runningJitoLiquidationFees: z11.number(),
|
|
949
|
+
runningJitoLimitOrderFees: z11.number(),
|
|
950
|
+
runningJitoYieldCompoundingFees: z11.number(),
|
|
951
|
+
runningTotalCollectedFees: z11.number(),
|
|
952
|
+
runningTotalNetworkFees: z11.number()
|
|
965
953
|
});
|
|
966
|
-
var StakingRevenueStatsGroup =
|
|
967
|
-
time:
|
|
968
|
-
totalDepositsUsd:
|
|
969
|
-
totalDepositsSol:
|
|
970
|
-
runningTotalDepositsUsd:
|
|
971
|
-
runningTotalDepositsSol:
|
|
954
|
+
var StakingRevenueStatsGroup = z11.object({
|
|
955
|
+
time: z11.coerce.date(),
|
|
956
|
+
totalDepositsUsd: z11.number(),
|
|
957
|
+
totalDepositsSol: z11.coerce.bigint(),
|
|
958
|
+
runningTotalDepositsUsd: z11.number(),
|
|
959
|
+
runningTotalDepositsSol: z11.coerce.bigint()
|
|
972
960
|
});
|
|
973
|
-
var SwapQuoteByInput =
|
|
974
|
-
estimatedAmountOut:
|
|
975
|
-
minAmountOut:
|
|
976
|
-
feeAmount:
|
|
977
|
-
feeUsd:
|
|
961
|
+
var SwapQuoteByInput = z11.object({
|
|
962
|
+
estimatedAmountOut: z11.coerce.bigint(),
|
|
963
|
+
minAmountOut: z11.coerce.bigint(),
|
|
964
|
+
feeAmount: z11.coerce.bigint(),
|
|
965
|
+
feeUsd: z11.number(),
|
|
978
966
|
/** Price impact in percents */
|
|
979
|
-
priceImpact:
|
|
967
|
+
priceImpact: z11.number()
|
|
980
968
|
});
|
|
981
|
-
var SwapQuoteByOutput =
|
|
982
|
-
estimatedAmountIn:
|
|
983
|
-
maxAmountIn:
|
|
984
|
-
feeAmount:
|
|
985
|
-
feeUsd:
|
|
969
|
+
var SwapQuoteByOutput = z11.object({
|
|
970
|
+
estimatedAmountIn: z11.coerce.bigint(),
|
|
971
|
+
maxAmountIn: z11.coerce.bigint(),
|
|
972
|
+
feeAmount: z11.coerce.bigint(),
|
|
973
|
+
feeUsd: z11.number(),
|
|
986
974
|
/** Price impact in percents */
|
|
987
|
-
priceImpact:
|
|
975
|
+
priceImpact: z11.number()
|
|
988
976
|
});
|
|
989
|
-
var LimitOrderQuoteByInput =
|
|
990
|
-
amountOut:
|
|
977
|
+
var LimitOrderQuoteByInput = z11.object({
|
|
978
|
+
amountOut: z11.coerce.bigint()
|
|
991
979
|
});
|
|
992
|
-
var LimitOrderQuoteByOutput =
|
|
993
|
-
amountIn:
|
|
980
|
+
var LimitOrderQuoteByOutput = z11.object({
|
|
981
|
+
amountIn: z11.coerce.bigint()
|
|
994
982
|
});
|
|
995
983
|
var TradableAmount = AmountWithUsdSchema;
|
|
996
|
-
var UpdateStreamSubscriptionResult =
|
|
997
|
-
status:
|
|
984
|
+
var UpdateStreamSubscriptionResult = z11.object({
|
|
985
|
+
status: z11.string()
|
|
998
986
|
});
|
|
999
|
-
var createNotificationSchema = (dataSchema, metaSchema) =>
|
|
987
|
+
var createNotificationSchema = (dataSchema, metaSchema) => z11.object({
|
|
1000
988
|
entity: NotificationEntitySchema,
|
|
1001
989
|
action: NotificationActionSchema,
|
|
1002
990
|
data: dataSchema,
|
|
1003
|
-
id:
|
|
1004
|
-
authority:
|
|
1005
|
-
...metaSchema ? { meta: metaSchema } : { meta:
|
|
991
|
+
id: z11.string(),
|
|
992
|
+
authority: z11.nullish(z11.string()),
|
|
993
|
+
...metaSchema ? { meta: metaSchema } : { meta: z11.undefined().nullable() }
|
|
1006
994
|
});
|
|
1007
995
|
var PoolSwapNotification = createNotificationSchema(PoolSwap);
|
|
1008
996
|
var LendingPositionNotification = createNotificationSchema(LendingPosition);
|