@crypticdot/defituna-api 1.10.9 → 1.10.11

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