@velora-dex/widget 0.8.4-dev.0 → 0.8.5-dev.0
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/components/widget/AppHeader/Activities/hooks.d.ts.map +1 -1
- package/dist/components/widget/AppHeader/Activities/hooks.js +162 -143
- package/dist/components/widget/AppHeader/Activities/hooks.js.map +1 -1
- package/dist/components/widget/AppHeader/Activities/utils.d.ts +3 -3
- package/dist/components/widget/AppHeader/Activities/utils.d.ts.map +1 -1
- package/dist/components/widget/AppHeader/Activities/utils.js +28 -21
- package/dist/components/widget/AppHeader/Activities/utils.js.map +1 -1
- package/dist/components/widget/BridgeList/hooks.d.ts +2 -2
- package/dist/components/widget/BridgeList/hooks.d.ts.map +1 -1
- package/dist/components/widget/BridgeList/hooks.js.map +1 -1
- package/dist/components/widget/BridgeSelectorExpandable/BridgeSelectorExpandable.d.ts +2 -2
- package/dist/components/widget/BridgeSelectorExpandable/BridgeSelectorExpandable.d.ts.map +1 -1
- package/dist/components/widget/BridgeSelectorExpandable/BridgeSelectorExpandable.js.map +1 -1
- package/dist/components/widget/Dialog/SelectTokenDialog/SelectTokenDialog.js.map +1 -1
- package/dist/components/widget/Dialog/SelectTokenDialog/TokenListBody/AcrossTokenList.d.ts +1 -1
- package/dist/components/widget/Dialog/SelectTokenDialog/TokenListBody/AcrossTokenList.d.ts.map +1 -1
- package/dist/components/widget/Dialog/SelectTokenDialog/TokenListBody/AcrossTokenList.js.map +1 -1
- package/dist/components/widget/LimitOrderItem/LimitOrderDetails/LimitOrderDetails.js +1 -1
- package/dist/components/widget/LimitOrderItem/LimitOrderDetails/LimitOrderDetails.js.map +1 -1
- package/dist/components/widget/LimitOrderItem/LimitOrderListItem.d.ts +5 -5
- package/dist/components/widget/LimitOrderItem/LimitOrderListItem.d.ts.map +1 -1
- package/dist/components/widget/LimitOrderItem/LimitOrderListItem.js +107 -105
- package/dist/components/widget/LimitOrderItem/LimitOrderListItem.js.map +1 -1
- package/dist/components/widget/LimitOrderItem/types.d.ts +2 -2
- package/dist/components/widget/LimitOrderItem/types.d.ts.map +1 -1
- package/dist/components/widget/LimitOrderItem/utils.d.ts +2 -2
- package/dist/components/widget/LimitOrderItem/utils.d.ts.map +1 -1
- package/dist/components/widget/LimitOrderItem/utils.js.map +1 -1
- package/dist/components/widget/OtcOrderItem/OtcOrderDetails/Controls.js +1 -1
- package/dist/components/widget/OtcOrderItem/OtcOrderDetails/Controls.js.map +1 -1
- package/dist/components/widget/OtcOrderItem/OtcOrderDetails/OtcOrderDetails.js +1 -1
- package/dist/components/widget/OtcOrderItem/OtcOrderDetails/OtcOrderDetails.js.map +1 -1
- package/dist/components/widget/OtcOrderItem/OtcOrderListItem.d.ts +2 -2
- package/dist/components/widget/OtcOrderItem/OtcOrderListItem.d.ts.map +1 -1
- package/dist/components/widget/OtcOrderItem/OtcOrderListItem.js +23 -23
- package/dist/components/widget/OtcOrderItem/OtcOrderListItem.js.map +1 -1
- package/dist/components/widget/OtcOrderItem/types.d.ts +2 -2
- package/dist/components/widget/OtcOrderItem/types.d.ts.map +1 -1
- package/dist/components/widget/OtcOrderItem/utils.d.ts +2 -2
- package/dist/components/widget/OtcOrderItem/utils.d.ts.map +1 -1
- package/dist/components/widget/OtcOrderItem/utils.js +1 -1
- package/dist/components/widget/OtcOrderItem/utils.js.map +1 -1
- package/dist/components/widget/ReviewAndConfirm/FillOtcReviewAndConfirm/FillOtcReviewAndConfirm.js +1 -1
- package/dist/components/widget/ReviewAndConfirm/FillOtcReviewAndConfirm/FillOtcReviewAndConfirm.js.map +1 -1
- package/dist/components/widget/ReviewAndConfirm/FillOtcReviewAndConfirm/utils.d.ts +2 -2
- package/dist/components/widget/ReviewAndConfirm/FillOtcReviewAndConfirm/utils.d.ts.map +1 -1
- package/dist/components/widget/ReviewAndConfirm/FillOtcReviewAndConfirm/utils.js.map +1 -1
- package/dist/components/widget/TradeOverview/DeltaOrderTradeOverview.d.ts +2 -2
- package/dist/components/widget/TradeOverview/DeltaOrderTradeOverview.d.ts.map +1 -1
- package/dist/components/widget/TradeOverview/DeltaOrderTradeOverview.js +86 -86
- package/dist/components/widget/TradeOverview/DeltaOrderTradeOverview.js.map +1 -1
- package/dist/components/widget/TradeOverview/TradeComplete/utils.d.ts.map +1 -1
- package/dist/components/widget/TradeOverview/TradeComplete/utils.js +37 -37
- package/dist/components/widget/TradeOverview/TradeComplete/utils.js.map +1 -1
- package/dist/components/widget/TradeOverview/TwapOrderTradeOverview.d.ts +2 -2
- package/dist/components/widget/TradeOverview/TwapOrderTradeOverview.d.ts.map +1 -1
- package/dist/components/widget/TradeOverview/TwapOrderTradeOverview.js +83 -83
- package/dist/components/widget/TradeOverview/TwapOrderTradeOverview.js.map +1 -1
- package/dist/core/TradeFlowScreenButton.d.ts +3 -3
- package/dist/core/TradeFlowScreenButton.d.ts.map +1 -1
- package/dist/core/TradeFlowScreenButton.js.map +1 -1
- package/dist/core/Updaters.js +1 -1
- package/dist/core/Updaters.js.map +1 -1
- package/dist/core/across/isCrosschainPossible.d.ts +1 -1
- package/dist/core/across/isCrosschainPossible.d.ts.map +1 -1
- package/dist/core/across/isCrosschainPossible.js.map +1 -1
- package/dist/core/across/utils.d.ts +1 -1
- package/dist/core/across/utils.d.ts.map +1 -1
- package/dist/core/across/utils.js +15 -25
- package/dist/core/across/utils.js.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/inputs/hooks/useTokenToInputProps.js.map +1 -1
- package/dist/core/inputs/hooks/useWarningMessage.d.ts +1 -1
- package/dist/core/inputs/hooks/useWarningMessage.d.ts.map +1 -1
- package/dist/core/inputs/hooks/useWarningMessage.js.map +1 -1
- package/dist/core/inputs/state/guards.d.ts +3 -0
- package/dist/core/inputs/state/guards.d.ts.map +1 -0
- package/dist/core/inputs/state/guards.js +12 -0
- package/dist/core/inputs/state/guards.js.map +1 -0
- package/dist/core/inputs/state/inputAmountAtom.d.ts +2 -2
- package/dist/core/inputs/state/inputAmountAtom.d.ts.map +1 -1
- package/dist/core/inputs/state/inputAmountAtom.js +8 -7
- package/dist/core/inputs/state/inputAmountAtom.js.map +1 -1
- package/dist/core/inputs/state/setTokenByAddressAtom.js +1 -1
- package/dist/core/inputs/state/setTokenByAddressAtom.js.map +1 -1
- package/dist/core/limit/state/limitInputAmountAtom.d.ts +2 -2
- package/dist/core/limit/state/limitInputAmountAtom.d.ts.map +1 -1
- package/dist/core/limit/state/limitInputAmountAtom.js +14 -13
- package/dist/core/limit/state/limitInputAmountAtom.js.map +1 -1
- package/dist/core/limit/state/utils.d.ts +1 -1
- package/dist/core/limit/useLimitRate.d.ts +1 -1
- package/dist/core/limit/useLimitTokenToInputProps.js.map +1 -1
- package/dist/core/otc/state/otcInputAmountAtom.d.ts +2 -2
- package/dist/core/otc/state/otcInputAmountAtom.d.ts.map +1 -1
- package/dist/core/otc/state/otcInputAmountAtom.js +14 -13
- package/dist/core/otc/state/otcInputAmountAtom.js.map +1 -1
- package/dist/core/state/configAtom.js +2 -2
- package/dist/core/state/configAtom.js.map +1 -1
- package/dist/core/state/configEffectAtom.js +1 -1
- package/dist/core/state/configEffectAtom.js.map +1 -1
- package/dist/core/state/getSelectableDestChains.d.ts +1 -1
- package/dist/core/state/getSelectableDestChains.d.ts.map +1 -1
- package/dist/core/state/getSelectableDestChains.js.map +1 -1
- package/dist/core/twap/state/twapInputAmountAtom.d.ts +2 -2
- package/dist/core/twap/state/twapInputAmountAtom.d.ts.map +1 -1
- package/dist/core/twap/state/twapInputAmountAtom.js +10 -9
- package/dist/core/twap/state/twapInputAmountAtom.js.map +1 -1
- package/dist/core/twap/twapDetails/minimumReceiveable.d.ts +2 -2
- package/dist/core/twap/twapDetails/minimumReceiveable.d.ts.map +1 -1
- package/dist/core/twap/twapDetails/minimumReceiveable.js.map +1 -1
- package/dist/events/hooks/useOnPriceUpdates.js.map +1 -1
- package/dist/events/types/cancelOrder.d.ts +3 -3
- package/dist/events/types/cancelOrder.d.ts.map +1 -1
- package/dist/events/types/fill.d.ts +2 -2
- package/dist/events/types/fill.d.ts.map +1 -1
- package/dist/events/types/otc.d.ts +2 -2
- package/dist/events/types/otc.d.ts.map +1 -1
- package/dist/events/types/priceChange.d.ts +2 -2
- package/dist/events/types/priceChange.d.ts.map +1 -1
- package/dist/events/types/swap.d.ts +3 -3
- package/dist/events/types/swap.d.ts.map +1 -1
- package/dist/events/types/twap.d.ts +2 -2
- package/dist/events/types/twap.d.ts.map +1 -1
- package/dist/hooks/otc/mutations/useCancelLimitOrder.d.ts +2 -2
- package/dist/hooks/otc/mutations/useCancelLimitOrder.d.ts.map +1 -1
- package/dist/hooks/otc/mutations/useCancelLimitOrder.js +4 -7
- package/dist/hooks/otc/mutations/useCancelLimitOrder.js.map +1 -1
- package/dist/hooks/otc/mutations/useCreateLimitOrder.d.ts +3 -3
- package/dist/hooks/otc/mutations/useCreateLimitOrder.d.ts.map +1 -1
- package/dist/hooks/otc/mutations/useCreateLimitOrder.js +7 -10
- package/dist/hooks/otc/mutations/useCreateLimitOrder.js.map +1 -1
- package/dist/hooks/otc/mutations/useFillOrder.d.ts +2 -2
- package/dist/hooks/otc/mutations/useFillOrder.d.ts.map +1 -1
- package/dist/hooks/otc/mutations/useFillOrder.js +2 -2
- package/dist/hooks/otc/mutations/useFillOrder.js.map +1 -1
- package/dist/hooks/otc/mutations/utils.d.ts +2 -2
- package/dist/hooks/otc/mutations/utils.d.ts.map +1 -1
- package/dist/hooks/otc/mutations/utils.js.map +1 -1
- package/dist/hooks/otc/queries/useLimitOrderRequiredBalance.js +1 -1
- package/dist/hooks/otc/queries/useLimitOrderRequiredBalance.js.map +1 -1
- package/dist/hooks/otc/queries/useLimitOrders.d.ts +29 -29
- package/dist/hooks/otc/queries/useLimitOrders.d.ts.map +1 -1
- package/dist/hooks/otc/queries/useLimitOrders.js +7 -7
- package/dist/hooks/otc/queries/useLimitOrders.js.map +1 -1
- package/dist/hooks/otc/queries/utils.d.ts +6 -6
- package/dist/hooks/otc/queries/utils.d.ts.map +1 -1
- package/dist/hooks/otc/queries/utils.js +1 -1
- package/dist/hooks/otc/queries/utils.js.map +1 -1
- package/dist/hooks/otc/tradeFlow/useFillOtcOrderFlow.d.ts +2 -2
- package/dist/hooks/otc/tradeFlow/useFillOtcOrderFlow.d.ts.map +1 -1
- package/dist/hooks/otc/tradeFlow/useFillOtcOrderFlow.js +1 -1
- package/dist/hooks/otc/tradeFlow/useFillOtcOrderFlow.js.map +1 -1
- package/dist/hooks/otc/tradeFlow/useOtcOrderFlow.d.ts +5 -5
- package/dist/hooks/otc/tradeFlow/useOtcOrderFlow.d.ts.map +1 -1
- package/dist/hooks/otc/tradeFlow/useOtcOrderFlow.js +1 -1
- package/dist/hooks/otc/tradeFlow/useOtcOrderFlow.js.map +1 -1
- package/dist/hooks/otc/tradeFlow/useOtcOrderStep.js +1 -1
- package/dist/hooks/otc/tradeFlow/useOtcOrderStep.js.map +1 -1
- package/dist/hooks/swap/prices/delta/bridge/useSelectedBridgePrice.d.ts +3 -3
- package/dist/hooks/swap/prices/delta/bridge/useSelectedBridgePrice.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/bridge/useSelectedBridgePrice.js.map +1 -1
- package/dist/hooks/swap/prices/delta/bridge/utils.d.ts +6 -39
- package/dist/hooks/swap/prices/delta/bridge/utils.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/bridge/utils.js +0 -1
- package/dist/hooks/swap/prices/delta/bridge/utils.js.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/twap/useCreateTwapOrder.d.ts +2 -2
- package/dist/hooks/swap/prices/delta/mutations/twap/useCreateTwapOrder.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/twap/useCreateTwapOrder.js +1 -1
- package/dist/hooks/swap/prices/delta/mutations/twap/useCreateTwapOrder.js.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/twap/usePostTwapOrder.d.ts +2 -2
- package/dist/hooks/swap/prices/delta/mutations/twap/usePostTwapOrder.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/twap/usePostTwapOrder.js +1 -1
- package/dist/hooks/swap/prices/delta/mutations/twap/usePostTwapOrder.js.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/twap/useTwapOrderToPost.js +1 -1
- package/dist/hooks/swap/prices/delta/mutations/twap/useTwapOrderToPost.js.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/types.d.ts +3 -3
- package/dist/hooks/swap/prices/delta/mutations/types.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useCancelDeltaOrders.js +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useCancelDeltaOrders.js.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useCancelDeltaOrdersEvents.d.ts +2 -2
- package/dist/hooks/swap/prices/delta/mutations/useCancelDeltaOrdersEvents.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useCancelDeltaOrdersEvents.js.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useCancelOrWithdrawAndCancelDeltaOrder.d.ts +2 -2
- package/dist/hooks/swap/prices/delta/mutations/useCancelOrWithdrawAndCancelDeltaOrder.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useCancelOrWithdrawAndCancelDeltaOrder.js +62 -60
- package/dist/hooks/swap/prices/delta/mutations/useCancelOrWithdrawAndCancelDeltaOrder.js.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useCreateDeltaOrder.d.ts +2 -2
- package/dist/hooks/swap/prices/delta/mutations/useCreateDeltaOrder.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useCreateDeltaOrder.js +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useCreateDeltaOrder.js.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useDeltaOrderToPost.js +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useDeltaOrderToPost.js.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useIsDeltaOrderCancellable.d.ts +2 -2
- package/dist/hooks/swap/prices/delta/mutations/useIsDeltaOrderCancellable.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useIsDeltaOrderCancellable.js +22 -20
- package/dist/hooks/swap/prices/delta/mutations/useIsDeltaOrderCancellable.js.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/usePostDeltaOrder.d.ts +2 -2
- package/dist/hooks/swap/prices/delta/mutations/usePostDeltaOrder.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/usePostDeltaOrder.js +1 -1
- package/dist/hooks/swap/prices/delta/mutations/usePostDeltaOrder.js.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useSendDepositPreSignDeltaOrderTx.js +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useSendDepositPreSignDeltaOrderTx.js.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useWithdrawAndCancelDeltaOrder.js +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useWithdrawAndCancelDeltaOrder.js.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/utils.d.ts +5 -5
- package/dist/hooks/swap/prices/delta/mutations/utils.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/utils.js.map +1 -1
- package/dist/hooks/swap/prices/delta/orders/types.d.ts +10 -7
- package/dist/hooks/swap/prices/delta/orders/types.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/orders/unposted/index.d.ts +2 -2
- package/dist/hooks/swap/prices/delta/orders/unposted/index.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/orders/unposted/index.js.map +1 -1
- package/dist/hooks/swap/prices/delta/orders/unposted/utils.d.ts +15 -13
- package/dist/hooks/swap/prices/delta/orders/unposted/utils.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/orders/unposted/utils.js +18 -18
- package/dist/hooks/swap/prices/delta/orders/unposted/utils.js.map +1 -1
- package/dist/hooks/swap/prices/delta/orders/utils.d.ts +43 -18
- package/dist/hooks/swap/prices/delta/orders/utils.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/orders/utils.js +28 -18
- package/dist/hooks/swap/prices/delta/orders/utils.js.map +1 -1
- package/dist/hooks/swap/prices/delta/queries/bridgeInfo/bridgeInfosLoadedAtom.d.ts +2 -0
- package/dist/hooks/swap/prices/delta/queries/bridgeInfo/bridgeInfosLoadedAtom.d.ts.map +1 -0
- package/dist/hooks/swap/prices/delta/queries/{bridgeRoutes/bridgeRoutesLoadedAtom.js → bridgeInfo/bridgeInfosLoadedAtom.js} +4 -4
- package/dist/hooks/swap/prices/delta/queries/bridgeInfo/bridgeInfosLoadedAtom.js.map +1 -0
- package/dist/hooks/swap/prices/delta/queries/bridgeInfo/common.d.ts +8 -0
- package/dist/hooks/swap/prices/delta/queries/bridgeInfo/common.d.ts.map +1 -0
- package/dist/hooks/swap/prices/delta/queries/bridgeInfo/common.js +17 -0
- package/dist/hooks/swap/prices/delta/queries/bridgeInfo/common.js.map +1 -0
- package/dist/hooks/swap/prices/delta/queries/bridgeInfo/getBridgeInfoQueryData.d.ts +3 -0
- package/dist/hooks/swap/prices/delta/queries/bridgeInfo/getBridgeInfoQueryData.d.ts.map +1 -0
- package/dist/hooks/swap/prices/delta/queries/bridgeInfo/getBridgeInfoQueryData.js +11 -0
- package/dist/hooks/swap/prices/delta/queries/bridgeInfo/getBridgeInfoQueryData.js.map +1 -0
- package/dist/hooks/swap/prices/delta/queries/bridgeInfo/types.d.ts +19 -0
- package/dist/hooks/swap/prices/delta/queries/bridgeInfo/types.d.ts.map +1 -0
- package/dist/hooks/swap/prices/delta/queries/bridgeInfo/useBridgeInfo.d.ts +3 -0
- package/dist/hooks/swap/prices/delta/queries/bridgeInfo/useBridgeInfo.d.ts.map +1 -0
- package/dist/hooks/swap/prices/delta/queries/bridgeInfo/useBridgeInfo.js +31 -0
- package/dist/hooks/swap/prices/delta/queries/bridgeInfo/useBridgeInfo.js.map +1 -0
- package/dist/hooks/swap/prices/delta/queries/bridgeProtocols/useBridgeProtocols.js +1 -1
- package/dist/hooks/swap/prices/delta/queries/bridgeProtocols/useBridgeProtocols.js.map +1 -1
- package/dist/hooks/swap/prices/delta/queries/errors.js.map +1 -1
- package/dist/hooks/swap/prices/delta/queries/useDeltaOrderRequiredBalance.js +1 -1
- package/dist/hooks/swap/prices/delta/queries/useDeltaOrderRequiredBalance.js.map +1 -1
- package/dist/hooks/swap/prices/delta/queries/useDeltaOrders.d.ts +6 -6
- package/dist/hooks/swap/prices/delta/queries/useDeltaOrders.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/queries/useDeltaOrders.js +1 -1
- package/dist/hooks/swap/prices/delta/queries/useDeltaOrders.js.map +1 -1
- package/dist/hooks/swap/prices/delta/queries/useDeltaPriceQuery.d.ts +13 -13
- package/dist/hooks/swap/prices/delta/queries/useDeltaPriceQuery.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/queries/useDeltaPriceQuery.js +2 -2
- package/dist/hooks/swap/prices/delta/queries/useDeltaPriceQuery.js.map +1 -1
- package/dist/hooks/swap/prices/delta/queries/useIsTokenSupportedInDelta.js +1 -1
- package/dist/hooks/swap/prices/delta/queries/useIsTokenSupportedInDelta.js.map +1 -1
- package/dist/hooks/swap/prices/delta/queries/useWatchDeltaOrder.d.ts +14 -14
- package/dist/hooks/swap/prices/delta/queries/useWatchDeltaOrder.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/queries/useWatchDeltaOrder.js +58 -72
- package/dist/hooks/swap/prices/delta/queries/useWatchDeltaOrder.js.map +1 -1
- package/dist/hooks/swap/prices/types.d.ts +2 -2
- package/dist/hooks/swap/prices/types.d.ts.map +1 -1
- package/dist/hooks/swap/prices/useSwapPrices.d.ts +3 -3
- package/dist/hooks/swap/prices/useSwapPrices.d.ts.map +1 -1
- package/dist/hooks/swap/prices/useSwapPrices.js.map +1 -1
- package/dist/hooks/swap/prices/useTokenInputsFromTwapPrice.d.ts +2 -2
- package/dist/hooks/swap/prices/useTokenInputsFromTwapPrice.d.ts.map +1 -1
- package/dist/hooks/swap/prices/useTokenInputsFromTwapPrice.js.map +1 -1
- package/dist/hooks/swap/prices/useTwapPrices.d.ts +4 -4
- package/dist/hooks/swap/prices/useTwapPrices.d.ts.map +1 -1
- package/dist/hooks/swap/prices/useTwapPrices.js.map +1 -1
- package/dist/hooks/swap/tradeFlow/common/factory/depositAndSubmitOrderFactory.d.ts +5 -5
- package/dist/hooks/swap/tradeFlow/common/factory/depositAndSubmitOrderFactory.d.ts.map +1 -1
- package/dist/hooks/swap/tradeFlow/common/factory/depositAndSubmitOrderFactory.js.map +1 -1
- package/dist/hooks/swap/tradeFlow/common/factory/preSignAndSubmitOrderFactory.d.ts +4 -4
- package/dist/hooks/swap/tradeFlow/common/factory/preSignAndSubmitOrderFactory.d.ts.map +1 -1
- package/dist/hooks/swap/tradeFlow/common/factory/preSignAndSubmitOrderFactory.js.map +1 -1
- package/dist/hooks/swap/tradeFlow/useDeltaFlow.d.ts +5 -5
- package/dist/hooks/swap/tradeFlow/useDeltaFlow.d.ts.map +1 -1
- package/dist/hooks/swap/tradeFlow/useDeltaFlow.js.map +1 -1
- package/dist/hooks/swap/tradeFlow/useDeltaSwapStep.js.map +1 -1
- package/dist/hooks/swap/tradeFlow/useLimitOrderFlow.d.ts +2 -2
- package/dist/hooks/swap/tradeFlow/useLimitOrderFlow.d.ts.map +1 -1
- package/dist/hooks/swap/tradeFlow/useLimitOrderFlow.js.map +1 -1
- package/dist/hooks/swap/tradeFlow/useTwapFlow.d.ts +5 -5
- package/dist/hooks/swap/tradeFlow/useTwapFlow.d.ts.map +1 -1
- package/dist/hooks/swap/tradeFlow/useTwapFlow.js.map +1 -1
- package/dist/hooks/tokens/useAllTokensWithFilter.d.ts +1 -1
- package/dist/hooks/tokens/useAllTokensWithFilter.d.ts.map +1 -1
- package/dist/hooks/tokens/useAllTokensWithFilter.js.map +1 -1
- package/dist/hooks/tokens/useTokensFromAcross.d.ts +1 -1
- package/dist/hooks/tokens/useTokensFromAcross.d.ts.map +1 -1
- package/dist/hooks/tokens/useTokensFromAcross.js +10 -7
- package/dist/hooks/tokens/useTokensFromAcross.js.map +1 -1
- package/dist/hooks/useAvailableCrosses.d.ts +1 -1
- package/dist/hooks/useAvailableCrosses.d.ts.map +1 -1
- package/dist/hooks/useAvailableCrosses.js +17 -18
- package/dist/hooks/useAvailableCrosses.js.map +1 -1
- package/dist/hooks/useBridgeInfo.d.ts +6 -0
- package/dist/hooks/useBridgeInfo.d.ts.map +1 -0
- package/dist/hooks/{useBridgeRoutes.js → useBridgeInfo.js} +4 -4
- package/dist/hooks/useBridgeInfo.js.map +1 -0
- package/dist/hooks/useIsCrosschainPossible.d.ts +1 -1
- package/dist/hooks/useIsCrosschainPossible.d.ts.map +1 -1
- package/dist/hooks/useIsCrosschainPossible.js +13 -15
- package/dist/hooks/useIsCrosschainPossible.js.map +1 -1
- package/dist/hooks/useSDK.d.ts +19 -19
- package/dist/hooks/useSDK.d.ts.map +1 -1
- package/dist/hooks/useSDK.js +42 -42
- package/dist/hooks/useSDK.js.map +1 -1
- package/dist/hooks/useSelectableDestChains.d.ts +1 -1
- package/dist/hooks/useSelectableDestChains.d.ts.map +1 -1
- package/dist/hooks/useSelectableDestChains.js.map +1 -1
- package/dist/lib/queryClient.js +1 -1
- package/dist/lib/queryClient.js.map +1 -1
- package/dist/lib/utils/toasts.d.ts +3 -3
- package/dist/lib/utils/toasts.d.ts.map +1 -1
- package/dist/lib/utils/toasts.js.map +1 -1
- package/dist/lib/utils/twap.d.ts +3 -3
- package/dist/lib/utils/twap.d.ts.map +1 -1
- package/dist/lib/utils/twap.js +0 -1
- package/dist/lib/utils/twap.js.map +1 -1
- package/package.json +2 -2
- package/dist/hooks/swap/prices/delta/bridge/types.d.ts +0 -43
- package/dist/hooks/swap/prices/delta/bridge/types.d.ts.map +0 -1
- package/dist/hooks/swap/prices/delta/bridge/useBridgedDeposit.d.ts +0 -18
- package/dist/hooks/swap/prices/delta/bridge/useBridgedDeposit.d.ts.map +0 -1
- package/dist/hooks/swap/prices/delta/bridge/useSuggestedFees.d.ts +0 -5
- package/dist/hooks/swap/prices/delta/bridge/useSuggestedFees.d.ts.map +0 -1
- package/dist/hooks/swap/prices/delta/queries/bridgeRoutes/bridgeRoutesLoadedAtom.d.ts +0 -2
- package/dist/hooks/swap/prices/delta/queries/bridgeRoutes/bridgeRoutesLoadedAtom.d.ts.map +0 -1
- package/dist/hooks/swap/prices/delta/queries/bridgeRoutes/bridgeRoutesLoadedAtom.js.map +0 -1
- package/dist/hooks/swap/prices/delta/queries/bridgeRoutes/common.d.ts +0 -6
- package/dist/hooks/swap/prices/delta/queries/bridgeRoutes/common.d.ts.map +0 -1
- package/dist/hooks/swap/prices/delta/queries/bridgeRoutes/common.js +0 -9
- package/dist/hooks/swap/prices/delta/queries/bridgeRoutes/common.js.map +0 -1
- package/dist/hooks/swap/prices/delta/queries/bridgeRoutes/getBridgeRoutesQueryData.d.ts +0 -3
- package/dist/hooks/swap/prices/delta/queries/bridgeRoutes/getBridgeRoutesQueryData.d.ts.map +0 -1
- package/dist/hooks/swap/prices/delta/queries/bridgeRoutes/getBridgeRoutesQueryData.js +0 -11
- package/dist/hooks/swap/prices/delta/queries/bridgeRoutes/getBridgeRoutesQueryData.js.map +0 -1
- package/dist/hooks/swap/prices/delta/queries/bridgeRoutes/types.d.ts +0 -19
- package/dist/hooks/swap/prices/delta/queries/bridgeRoutes/types.d.ts.map +0 -1
- package/dist/hooks/swap/prices/delta/queries/bridgeRoutes/useBridgeRoutes.d.ts +0 -3
- package/dist/hooks/swap/prices/delta/queries/bridgeRoutes/useBridgeRoutes.d.ts.map +0 -1
- package/dist/hooks/swap/prices/delta/queries/bridgeRoutes/useBridgeRoutes.js +0 -31
- package/dist/hooks/swap/prices/delta/queries/bridgeRoutes/useBridgeRoutes.js.map +0 -1
- package/dist/hooks/useBridgeRoutes.d.ts +0 -6
- package/dist/hooks/useBridgeRoutes.d.ts.map +0 -1
- package/dist/hooks/useBridgeRoutes.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDeltaOrderRequiredBalance.js","names":["
|
|
1
|
+
{"version":3,"file":"useDeltaOrderRequiredBalance.js","names":["useDeltaSDK","assert","MarkRequired","useAccount","useChainId","useMinViemClient","useQuery","UseQueryOptions","UseQueryResult","isAddress","Address","SupportedChainId","LONG_STALE_TIME_FOR_REACTIVENESS","DeltaOrderRequiredBalanceReturn","Record","DeltaOrderRequiredBalanceQueryParams","Omit","Error","TData","DeltaOrderRequiredBalanceQueryKey","DeltaOrderRequiredBalanceQueryResult","DeltaOrderRequiredBalanceQueryInput","tokenAddress","query","base","chainId","account","useDeltaOrderRequiredBalance","t0","$","_c","address","t1","minClient","t2","client","sdk","t3","deltaOrderRequiredBalanceQueryKey","t4","t5","signal","getRequiredBalanceForDeltaOrders","userAddress","enabled","t6","queryKey","queryFn","toLowerCase","const","DeltaOrderRequiredAllowanceInput","amount","DeltaOrderRequiredAllowanceResult","combinedAllowance","isLoading","useDeltaOrderRequiredAllowance","data","balanceRequiredForCurrentOrders","staleTime","select","balanceRequired","BigInt","undefined"],"sources":["../../../../../../src/hooks/swap/prices/delta/queries/useDeltaOrderRequiredBalance.ts"],"sourcesContent":["import { useDeltaSDK } from \"@/hooks/useSDK\";\nimport { assert, type MarkRequired } from \"ts-essentials\";\nimport { useAccount, useChainId } from \"wagmi\";\nimport { useMinViemClient } from \"@/hooks/useMinViemClient\";\nimport {\n useQuery,\n type UseQueryOptions,\n type UseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport { isAddress, type Address } from \"viem\";\nimport type { SupportedChainId } from \"@/lib/web3/wagmi/types\";\nimport { LONG_STALE_TIME_FOR_REACTIVENESS } from \"@/lib/constants/time\";\n\n// ============================================================================\n// Types for getRequiredBalanceForDeltaOrders\n// ============================================================================\n\ntype DeltaOrderRequiredBalanceReturn = Record<string, string>;\n\ntype DeltaOrderRequiredBalanceQueryParams<\n TData = DeltaOrderRequiredBalanceReturn,\n> = Omit<\n UseQueryOptions<\n DeltaOrderRequiredBalanceReturn,\n Error,\n TData,\n DeltaOrderRequiredBalanceQueryKey\n >,\n \"queryKey\" | \"queryFn\"\n>;\ntype DeltaOrderRequiredBalanceQueryResult<\n TData = DeltaOrderRequiredBalanceReturn,\n> = UseQueryResult<TData, Error>;\n\ntype DeltaOrderRequiredBalanceQueryInput<\n TData = DeltaOrderRequiredBalanceReturn,\n> = {\n tokenAddress?: string;\n query?: DeltaOrderRequiredBalanceQueryParams<TData>;\n};\n\ntype DeltaOrderRequiredBalanceQueryKey = [\n base: \"delta/getRequiredBalance\",\n { chainId: number; account?: Address; tokenAddress?: string },\n];\n\nexport function useDeltaOrderRequiredBalance<\n TData = DeltaOrderRequiredBalanceReturn,\n>({\n tokenAddress,\n query,\n}: DeltaOrderRequiredBalanceQueryInput<TData>): DeltaOrderRequiredBalanceQueryResult<TData> {\n const chainId = useChainId();\n const { address: account } = useAccount();\n const { minClient } = useMinViemClient({ chainId, account });\n\n const { sdk } = useDeltaSDK({\n chainId,\n client: minClient,\n account,\n });\n\n return useQuery<\n DeltaOrderRequiredBalanceReturn,\n Error,\n TData,\n DeltaOrderRequiredBalanceQueryKey\n >({\n queryKey: deltaOrderRequiredBalanceQueryKey({\n chainId,\n account,\n tokenAddress,\n }),\n queryFn: ({ signal }) => {\n assert(sdk, \"SDK not initialized\");\n assert(account, \"account is required\");\n\n return sdk.getRequiredBalanceForDeltaOrders(\n { userAddress: account, tokenAddress },\n { signal }\n );\n },\n ...query,\n enabled:\n !!(chainId && account && sdk) &&\n // either no specific token given\n (!tokenAddress ||\n // or a token with a valid address\n isAddress(tokenAddress)) &&\n (query?.enabled ?? true),\n });\n}\n\nexport function deltaOrderRequiredBalanceQueryKey({\n chainId,\n account,\n tokenAddress,\n}: {\n chainId: SupportedChainId;\n account?: Address;\n tokenAddress?: string;\n}): DeltaOrderRequiredBalanceQueryKey {\n return [\n \"delta/getRequiredBalance\",\n {\n chainId,\n account: account?.toLowerCase() as Address,\n tokenAddress: tokenAddress?.toLowerCase(),\n },\n ] as const;\n}\n\ntype DeltaOrderRequiredAllowanceInput = {\n tokenAddress?: string;\n amount?: string | bigint;\n enabled: boolean;\n};\n\ntype DeltaOrderRequiredAllowanceResult = {\n combinedAllowance?: bigint;\n isLoading: boolean;\n};\nexport function useDeltaOrderRequiredAllowance({\n tokenAddress,\n amount,\n enabled,\n}: MarkRequired<DeltaOrderRequiredAllowanceInput, \"amount\">): MarkRequired<\n DeltaOrderRequiredAllowanceResult,\n \"combinedAllowance\"\n>;\nexport function useDeltaOrderRequiredAllowance({\n tokenAddress,\n amount,\n enabled,\n}: DeltaOrderRequiredAllowanceInput & {\n amount: undefined;\n}): DeltaOrderRequiredAllowanceResult & { combinedAllowance: undefined };\nexport function useDeltaOrderRequiredAllowance({\n tokenAddress,\n amount,\n enabled,\n}: DeltaOrderRequiredAllowanceInput): DeltaOrderRequiredAllowanceResult;\nexport function useDeltaOrderRequiredAllowance({\n tokenAddress,\n amount,\n enabled,\n}: DeltaOrderRequiredAllowanceInput): DeltaOrderRequiredAllowanceResult {\n const { data: balanceRequiredForCurrentOrders, isLoading } =\n useDeltaOrderRequiredBalance({\n tokenAddress,\n query: {\n enabled: !!tokenAddress && enabled,\n staleTime: LONG_STALE_TIME_FOR_REACTIVENESS,\n select: (data) => {\n if (!tokenAddress) return 0n;\n\n const balanceRequired = data[tokenAddress.toLowerCase()];\n if (!balanceRequired) return 0n;\n return BigInt(balanceRequired);\n },\n },\n });\n\n if (!amount || !enabled || !balanceRequiredForCurrentOrders)\n // don't include current orders allowance if not enabled\n return {\n isLoading,\n combinedAllowance: amount !== undefined ? BigInt(amount) : undefined,\n };\n\n // amount required to cover allowance of current Orders + amount for the new Order\n const combinedAllowance = BigInt(amount) + balanceRequiredForCurrentOrders;\n\n return {\n combinedAllowance,\n isLoading,\n };\n}\n"],"mappings":";;;;;;;;;AA+CA,SAAO2B,EAAAC,GAAA;CAAA,IAAAC,IAAAC,EAAA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;EACAD,mBAAmBF,MAAWW,KAAAA,IAA6BA,KAAAA,IAAjBD,OAAOV,EAAO;EACzD,GAKI;EACLE,mBAHwBQ,OAAOV,EAAO,GAAGM;EAIzCH;EACD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { QueryClient, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
|
|
2
|
-
import {
|
|
2
|
+
import { DeltaAuction, GetDeltaOrdersFunctions } from '@velora-dex/sdk';
|
|
3
3
|
import { MarkOptional } from 'ts-essentials';
|
|
4
4
|
type DeltaOrderByHashParams = string;
|
|
5
|
-
type DeltaOrderByHashReturn =
|
|
5
|
+
type DeltaOrderByHashReturn = DeltaAuction;
|
|
6
6
|
type DeltaOrderByHashQueryParams<TData = DeltaOrderByHashReturn> = Omit<UseQueryOptions<DeltaOrderByHashReturn, Error, TData, DeltaOrderByHashQueryKey>, "queryKey" | "queryFn">;
|
|
7
7
|
type DeltaOrderByHashQueryResult<TData = DeltaOrderByHashReturn> = UseQueryResult<TData, Error>;
|
|
8
8
|
type DeltaOrderByHashQueryInput<TData = DeltaOrderByHashReturn> = {
|
|
@@ -14,7 +14,7 @@ type DeltaOrderByHashQueryKey = [
|
|
|
14
14
|
orderParams: DeltaOrderByHashParams
|
|
15
15
|
];
|
|
16
16
|
type DeltaOrderByIdParams = string;
|
|
17
|
-
type DeltaOrderByIdReturn =
|
|
17
|
+
type DeltaOrderByIdReturn = DeltaAuction;
|
|
18
18
|
type DeltaOrderByIdQueryParams<TData = DeltaOrderByIdReturn> = Omit<UseQueryOptions<DeltaOrderByIdReturn, Error, TData, DeltaOrderByIdQueryKey>, "queryKey" | "queryFn">;
|
|
19
19
|
type DeltaOrderByIdQueryResult<TData = DeltaOrderByIdReturn> = UseQueryResult<TData, Error>;
|
|
20
20
|
type DeltaOrderByIdQueryInput<TData = DeltaOrderByIdReturn> = {
|
|
@@ -25,8 +25,8 @@ type DeltaOrderByIdQueryKey = [
|
|
|
25
25
|
base: "swap/delta/order-by-id",
|
|
26
26
|
orderParams: DeltaOrderByIdParams
|
|
27
27
|
];
|
|
28
|
-
type DeltaOrdersParams = Parameters<
|
|
29
|
-
type DeltaOrdersReturn = Awaited<ReturnType<
|
|
28
|
+
type DeltaOrdersParams = Parameters<GetDeltaOrdersFunctions["getDeltaOrders"]>[0];
|
|
29
|
+
type DeltaOrdersReturn = Awaited<ReturnType<GetDeltaOrdersFunctions["getDeltaOrders"]>>;
|
|
30
30
|
type DeltaOrdersQueryParams<TData = DeltaOrdersReturn> = Omit<UseQueryOptions<DeltaOrdersReturn, Error, TData, DeltaOrdersQueryKey>, "queryKey" | "queryFn">;
|
|
31
31
|
type DeltaOrdersQueryResult<TData = DeltaOrdersReturn> = UseQueryResult<TData, Error>;
|
|
32
32
|
type DeltaOrdersQueryInput<TData = DeltaOrdersReturn> = {
|
|
@@ -45,7 +45,7 @@ declare const DELTA_ORDER_BY_HASH_QUERY_KEY = "swap/delta/order-by-hash";
|
|
|
45
45
|
export declare function useDeltaOrderByHashQuery<TData = DeltaOrderByHashReturn>({ orderHash, query, }: DeltaOrderByHashQueryInput<TData>): DeltaOrderByHashQueryResult<TData>;
|
|
46
46
|
export declare function ensureDeltaOrderByHashFactory({ queryClient, sdk, }: {
|
|
47
47
|
queryClient?: QueryClient;
|
|
48
|
-
sdk:
|
|
48
|
+
sdk: GetDeltaOrdersFunctions;
|
|
49
49
|
}): (orderHash: string) => Promise<DeltaOrderByHashReturn>;
|
|
50
50
|
export declare function useDeltaOrderByIdQuery<TData = DeltaOrderByIdReturn>({ orderParams, query, }: DeltaOrderByIdQueryInput<TData>): DeltaOrderByIdQueryResult<TData>;
|
|
51
51
|
export declare function useDeltaOrdersQuery<TData = DeltaOrdersReturn>({ orderParams, query, }: DeltaOrdersQueryInput<TData>): DeltaOrdersQueryResult<TData>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDeltaOrders.d.ts","sourceRoot":"","sources":["../../../../../../src/hooks/swap/prices/delta/queries/useDeltaOrders.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,EAEX,KAAK,eAAe,EACpB,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"useDeltaOrders.d.ts","sourceRoot":"","sources":["../../../../../../src/hooks/swap/prices/delta/queries/useDeltaOrders.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,EAEX,KAAK,eAAe,EACpB,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAOlD,KAAK,sBAAsB,GAAG,MAAM,CAAC;AACrC,KAAK,sBAAsB,GAAG,YAAY,CAAC;AAE3C,KAAK,2BAA2B,CAAC,KAAK,GAAG,sBAAsB,IAAI,IAAI,CACrE,eAAe,CACb,sBAAsB,EACtB,KAAK,EACL,KAAK,EACL,wBAAwB,CACzB,EACD,UAAU,GAAG,SAAS,CACvB,CAAC;AACF,KAAK,2BAA2B,CAAC,KAAK,GAAG,sBAAsB,IAC7D,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAE/B,KAAK,0BAA0B,CAAC,KAAK,GAAG,sBAAsB,IAAI;IAChE,SAAS,EAAE,sBAAsB,CAAC;IAClC,KAAK,CAAC,EAAE,2BAA2B,CAAC,KAAK,CAAC,CAAC;CAC5C,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,OAAO,6BAA6B;IAC1C,WAAW,EAAE,sBAAsB;CACpC,CAAC;AAMF,KAAK,oBAAoB,GAAG,MAAM,CAAC;AACnC,KAAK,oBAAoB,GAAG,YAAY,CAAC;AAEzC,KAAK,yBAAyB,CAAC,KAAK,GAAG,oBAAoB,IAAI,IAAI,CACjE,eAAe,CAAC,oBAAoB,EAAE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
-
import {
|
|
2
|
+
import { useDeltaSDK as t } from "../../../../useSDK.js";
|
|
3
3
|
import { queryClient as n } from "../../../../../lib/queryClient.js";
|
|
4
4
|
import { c as r } from "react-compiler-runtime";
|
|
5
5
|
import { useQuery as i } from "@tanstack/react-query";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDeltaOrders.js","names":["useDeltaV2SDK","queryClient","_queryClient","assertProp","QueryClient","useQuery","UseQueryOptions","UseQueryResult","DeltaV2","MarkOptional","useAccount","DeltaOrderByHashParams","DeltaOrderByHashReturn","DeltaAuction","DeltaOrderByHashQueryParams","Omit","Error","TData","DeltaOrderByHashQueryKey","DeltaOrderByHashQueryResult","DeltaOrderByHashQueryInput","orderHash","query","base","DELTA_ORDER_BY_HASH_QUERY_KEY","orderParams","DeltaOrderByIdParams","DeltaOrderByIdReturn","DeltaOrderByIdQueryParams","DeltaOrderByIdQueryKey","DeltaOrderByIdQueryResult","DeltaOrderByIdQueryInput","DeltaOrdersParams","Parameters","GetDeltaOrdersFunctions","DeltaOrdersReturn","Awaited","ReturnType","DeltaOrdersQueryParams","DeltaOrdersQueryKey","DeltaOrdersQueryResult","DeltaOrdersQueryInput","UserDeltaOrdersQueryInput","useDeltaOrderByHashQuery","t0","$","_c","t1","Symbol","for","chainId","sdk","t2","t3","t4","signal","getDeltaOrderByHash","enabled","t5","queryKey","queryFn","ensureDeltaOrderByHashFactory","Promise","ensureFn","ensureQueryData","useDeltaOrderByIdQuery","getDeltaOrderById","useDeltaOrdersQuery","deltaOrdersQueryKey","getDeltaOrders","userAddress","useUserDeltaOrdersQuery","_orderParams","address","account","toLowerCase","const"],"sources":["../../../../../../src/hooks/swap/prices/delta/queries/useDeltaOrders.ts"],"sourcesContent":["import { useDeltaV2SDK } from \"@/hooks/useSDK\";\nimport { queryClient as _queryClient } from \"@/lib/queryClient\";\nimport { assertProp } from \"@/lib/utils\";\nimport {\n QueryClient,\n useQuery,\n type UseQueryOptions,\n type UseQueryResult,\n} from \"@tanstack/react-query\";\nimport type { DeltaV2 } from \"@velora-dex/sdk\";\nimport type { MarkOptional } from \"ts-essentials\";\nimport { useAccount } from \"wagmi\";\n\n// ============================================================================\n// Types for getDeltaOrderByHash\n// ============================================================================\n\ntype DeltaOrderByHashParams = string; // orderHash\ntype DeltaOrderByHashReturn = DeltaV2.DeltaAuction;\n\ntype DeltaOrderByHashQueryParams<TData = DeltaOrderByHashReturn> = Omit<\n UseQueryOptions<\n DeltaOrderByHashReturn,\n Error,\n TData,\n DeltaOrderByHashQueryKey\n >,\n \"queryKey\" | \"queryFn\"\n>;\ntype DeltaOrderByHashQueryResult<TData = DeltaOrderByHashReturn> =\n UseQueryResult<TData, Error>;\n\ntype DeltaOrderByHashQueryInput<TData = DeltaOrderByHashReturn> = {\n orderHash: DeltaOrderByHashParams;\n query?: DeltaOrderByHashQueryParams<TData>;\n};\n\ntype DeltaOrderByHashQueryKey = [\n base: typeof DELTA_ORDER_BY_HASH_QUERY_KEY,\n orderParams: DeltaOrderByHashParams,\n];\n\n// ============================================================================\n// Types for getDeltaOrderById\n// ============================================================================\n\ntype DeltaOrderByIdParams = string; // orderId\ntype DeltaOrderByIdReturn = DeltaV2.DeltaAuction;\n\ntype DeltaOrderByIdQueryParams<TData = DeltaOrderByIdReturn> = Omit<\n UseQueryOptions<DeltaOrderByIdReturn, Error, TData, DeltaOrderByIdQueryKey>,\n \"queryKey\" | \"queryFn\"\n>;\ntype DeltaOrderByIdQueryResult<TData = DeltaOrderByIdReturn> = UseQueryResult<\n TData,\n Error\n>;\n\ntype DeltaOrderByIdQueryInput<TData = DeltaOrderByIdReturn> = {\n orderParams: DeltaOrderByIdParams;\n query?: DeltaOrderByIdQueryParams<TData>;\n};\n\ntype DeltaOrderByIdQueryKey = [\n base: \"swap/delta/order-by-id\",\n orderParams: DeltaOrderByIdParams,\n];\n\n// ============================================================================\n// Types for getDeltaOrders\n// ============================================================================\n\ntype DeltaOrdersParams = Parameters<\n DeltaV2.GetDeltaOrdersFunctions[\"getDeltaOrders\"]\n>[0];\ntype DeltaOrdersReturn = Awaited<\n ReturnType<DeltaV2.GetDeltaOrdersFunctions[\"getDeltaOrders\"]>\n>;\n\ntype DeltaOrdersQueryParams<TData = DeltaOrdersReturn> = Omit<\n UseQueryOptions<DeltaOrdersReturn, Error, TData, DeltaOrdersQueryKey>,\n \"queryKey\" | \"queryFn\"\n>;\ntype DeltaOrdersQueryResult<TData = DeltaOrdersReturn> = UseQueryResult<\n TData,\n Error\n>;\n\ntype DeltaOrdersQueryInput<TData = DeltaOrdersReturn> = {\n orderParams: MarkOptional<DeltaOrdersParams, \"userAddress\">;\n query?: DeltaOrdersQueryParams<TData>;\n};\n\ntype UserDeltaOrdersQueryInput<TData = DeltaOrdersReturn> = {\n orderParams: Omit<DeltaOrdersParams, \"userAddress\">;\n query?: DeltaOrdersQueryParams<TData>;\n};\n\ntype DeltaOrdersQueryKey = [\n base: \"swap/delta/orders\",\n orderParams: MarkOptional<DeltaOrdersParams, \"userAddress\">,\n];\n\n// ============================================================================\n// Hook for getDeltaOrderByHash\n// ============================================================================\n\nconst DELTA_ORDER_BY_HASH_QUERY_KEY = \"swap/delta/order-by-hash\";\n\nexport function useDeltaOrderByHashQuery<TData = DeltaOrderByHashReturn>({\n orderHash,\n query,\n}: DeltaOrderByHashQueryInput<TData>): DeltaOrderByHashQueryResult<TData> {\n const { sdk } = useDeltaV2SDK({ chainId: 1 }); // chain doesn't matter\n\n return useQuery<\n DeltaOrderByHashReturn,\n Error,\n TData,\n DeltaOrderByHashQueryKey\n >({\n queryKey: [DELTA_ORDER_BY_HASH_QUERY_KEY, orderHash],\n queryFn: ({ signal }) => sdk.getDeltaOrderByHash(orderHash, { signal }),\n ...query,\n enabled: query?.enabled ?? true,\n });\n}\n\nexport function ensureDeltaOrderByHashFactory({\n queryClient = _queryClient,\n sdk,\n}: {\n queryClient?: QueryClient;\n sdk: DeltaV2.GetDeltaOrdersFunctions;\n}): (orderHash: string) => Promise<DeltaOrderByHashReturn> {\n const ensureFn = async (orderHash: string) => {\n return queryClient.ensureQueryData<\n DeltaOrderByHashReturn,\n Error,\n DeltaOrderByHashReturn,\n DeltaOrderByHashQueryKey\n >({\n queryKey: [DELTA_ORDER_BY_HASH_QUERY_KEY, orderHash],\n queryFn: ({ signal }) => sdk.getDeltaOrderByHash(orderHash, { signal }),\n });\n };\n\n return ensureFn;\n}\n\n// ============================================================================\n// Hook for getDeltaOrderById\n// ============================================================================\n\nexport function useDeltaOrderByIdQuery<TData = DeltaOrderByIdReturn>({\n orderParams,\n query,\n}: DeltaOrderByIdQueryInput<TData>): DeltaOrderByIdQueryResult<TData> {\n const { sdk } = useDeltaV2SDK({ chainId: 1 }); // chain doesn't matter\n\n return useQuery<DeltaOrderByIdReturn, Error, TData, DeltaOrderByIdQueryKey>({\n queryKey: [\"swap/delta/order-by-id\", orderParams],\n queryFn: ({ signal }) => sdk.getDeltaOrderById(orderParams, { signal }),\n ...query,\n enabled: query?.enabled ?? true,\n });\n}\n\n// ============================================================================\n// Hook for getDeltaOrders\n// ============================================================================\n\nexport function useDeltaOrdersQuery<TData = DeltaOrdersReturn>({\n orderParams,\n query,\n}: DeltaOrdersQueryInput<TData>): DeltaOrdersQueryResult<TData> {\n const { sdk } = useDeltaV2SDK({ chainId: 1 }); // chain doesn't matter\n\n return useQuery<DeltaOrdersReturn, Error, TData, DeltaOrdersQueryKey>({\n queryKey: deltaOrdersQueryKey(orderParams),\n queryFn: ({ signal }) => {\n assertProp(orderParams, \"userAddress\");\n return sdk.getDeltaOrders(orderParams, { signal });\n },\n ...query,\n enabled: !!orderParams.userAddress && (query?.enabled ?? true),\n });\n}\n\nexport function useUserDeltaOrdersQuery<TData = DeltaOrdersReturn>({\n orderParams: _orderParams,\n query,\n}: UserDeltaOrdersQueryInput<TData>): DeltaOrdersQueryResult<TData> {\n const { address: account } = useAccount();\n\n const orderParams = {\n ..._orderParams,\n userAddress: account,\n };\n\n return useDeltaOrdersQuery({ orderParams, query });\n}\n\nexport function deltaOrdersQueryKey({\n userAddress,\n ...orderParams\n}: MarkOptional<DeltaOrdersParams, \"userAddress\">): DeltaOrdersQueryKey {\n return [\n \"swap/delta/orders\",\n {\n ...orderParams,\n userAddress: userAddress?.toLowerCase(),\n },\n ] as const;\n}\n"],"mappings":";;;;;;;AA2GA,IAAMwB,IAAgC;AAqBtC,SAAgBqC,EAA8B,EAC5C5D,aAAAA,IAAcC,GACdiD,UAIyD;CAazD,OAAOY,OAZiB1C,MACfpB,EAAY+D,gBAKjB;EACAL,UAAU,CAACnC,GAA+BH,EAAU;EACpDuC,UAAU,EAAEL,gBAAaJ,EAAIK,oBAAoBnC,GAAW,EAAEkC,WAAQ,CAAA;EACvE,CAAC;;AA4BN,SAAOY,EAAAvB,GAAA;CAAA,IAAAC,IAAAC,EAAA,GAAA,EAAwD,EAAArB,gBAAAH,aAAAsB,GAGhCG;CAAA,AAAAF,EAAA,OAAAG,OAAAC,IAAA,4BAAA,IACCF,IAAA,EAAAG,SAAW,GAAG,EAAAL,EAAA,KAAAE,KAAAA,IAAAF,EAAA;CAA5C,IAAA,EAAAM,WAAgBnD,EAAc+C,EAAe,EAACK;CAAA,AAAAP,EAAA,OAAApB,IAGF2B,IAAAP,EAAA,MAAhCO,IAAAgB,EAAoB3C,EAAY,EAAAoB,EAAA,KAAApB,GAAAoB,EAAA,KAAAO;CAAA,IAAAC;CAAA,AAAAR,EAAA,OAAApB,KAAAoB,EAAA,OAAAM,KACjCE,KAAAC,MAAA;EAAC,IAAA,EAAAC,cAAAD;EAC8B,OAAtCnD,EAAWsB,GAAa,cAAc,EAC/B0B,EAAGkB,eAAgB5C,GAAa,EAAA8B,WAAU,CAAC;IACnDV,EAAA,KAAApB,GAAAoB,EAAA,KAAAM,GAAAN,EAAA,KAAAQ,KAAAA,IAAAR,EAAA;CAEQ,IAAAS,IAAA,CAAC,CAAC7B,EAAW6C,gBAAiBhD,GAAKmC,WAAL,KAAuBC;CAC/D,OAD+Db,EAAA,OAAAvB,KAAAuB,EAAA,OAAAO,KAAAP,EAAA,OAAAQ,KAAAR,EAAA,OAAAS,KAPMI,IAAA;EAAAC,UAC1DP;EAAgCQ,SACjCP;EAGR,GACE/B;EAAKmC,SACCH;EACV,EAAAT,EAAA,KAAAvB,GAAAuB,EAAA,KAAAO,GAAAP,EAAA,KAAAQ,GAAAR,EAAA,KAAAS,GAAAT,EAAA,MAAAa,KAAAA,IAAAb,EAAA,KARMxC,EAA+DqD,EAQpE;;AAGJ,SAAOa,EAAA3B,GAAA;CAAA,IAAAC,IAAAC,EAAA,EAAA,EAA4D,EAAArB,aAAA+C,GAAAlD,aAAAsB,GAIjE,EAAA6B,SAAAC,MAA6BhE,GAAY,EAACqC;CAAA,AAAAF,EAAA,OAAA2B,KAAA3B,EAAA,OAAA6B,KAEtB3B,IAAA;EAAA,GACfyB;EAAYF,aACFI;EACd,EAAA7B,EAAA,KAAA2B,GAAA3B,EAAA,KAAA6B,GAAA7B,EAAA,KAAAE,KAAAA,IAAAF,EAAA;CAHD,IAAApB,IAAoBsB,GAGlBK;CAE+C,OAF/CP,EAAA,OAAApB,KAAAoB,EAAA,OAAAvB,KAEyB8B,IAAA;EAAA3B;EAAAH;EAAsB,EAAAuB,EAAA,KAAApB,GAAAoB,EAAA,KAAAvB,GAAAuB,EAAA,KAAAO,KAAAA,IAAAP,EAAA,IAA1CsB,EAAoBf,EAAuB;;AAGpD,SAAgBgB,EAAoB,EAClCE,gBACA,GAAG7C,KACmE;CACtE,OAAO,CACL,qBACA;EACE,GAAGA;EACH6C,aAAaA,GAAaK,aAAY;EACvC,CACF"}
|
|
1
|
+
{"version":3,"file":"useDeltaOrders.js","names":["useDeltaSDK","queryClient","_queryClient","assertProp","QueryClient","useQuery","UseQueryOptions","UseQueryResult","DeltaAuction","GetDeltaOrdersFunctions","MarkOptional","useAccount","DeltaOrderByHashParams","DeltaOrderByHashReturn","DeltaOrderByHashQueryParams","Omit","Error","TData","DeltaOrderByHashQueryKey","DeltaOrderByHashQueryResult","DeltaOrderByHashQueryInput","orderHash","query","base","DELTA_ORDER_BY_HASH_QUERY_KEY","orderParams","DeltaOrderByIdParams","DeltaOrderByIdReturn","DeltaOrderByIdQueryParams","DeltaOrderByIdQueryKey","DeltaOrderByIdQueryResult","DeltaOrderByIdQueryInput","DeltaOrdersParams","Parameters","DeltaOrdersReturn","Awaited","ReturnType","DeltaOrdersQueryParams","DeltaOrdersQueryKey","DeltaOrdersQueryResult","DeltaOrdersQueryInput","UserDeltaOrdersQueryInput","useDeltaOrderByHashQuery","t0","$","_c","t1","Symbol","for","chainId","sdk","t2","t3","t4","signal","getDeltaOrderByHash","enabled","t5","queryKey","queryFn","ensureDeltaOrderByHashFactory","Promise","ensureFn","ensureQueryData","useDeltaOrderByIdQuery","getDeltaOrderById","useDeltaOrdersQuery","deltaOrdersQueryKey","getDeltaOrders","userAddress","useUserDeltaOrdersQuery","_orderParams","address","account","toLowerCase","const"],"sources":["../../../../../../src/hooks/swap/prices/delta/queries/useDeltaOrders.ts"],"sourcesContent":["import { useDeltaSDK } from \"@/hooks/useSDK\";\nimport { queryClient as _queryClient } from \"@/lib/queryClient\";\nimport { assertProp } from \"@/lib/utils\";\nimport {\n QueryClient,\n useQuery,\n type UseQueryOptions,\n type UseQueryResult,\n} from \"@tanstack/react-query\";\nimport type { DeltaAuction, GetDeltaOrdersFunctions } from \"@velora-dex/sdk\";\nimport type { MarkOptional } from \"ts-essentials\";\nimport { useAccount } from \"wagmi\";\n\n// ============================================================================\n// Types for getDeltaOrderByHash\n// ============================================================================\n\ntype DeltaOrderByHashParams = string; // orderHash\ntype DeltaOrderByHashReturn = DeltaAuction;\n\ntype DeltaOrderByHashQueryParams<TData = DeltaOrderByHashReturn> = Omit<\n UseQueryOptions<\n DeltaOrderByHashReturn,\n Error,\n TData,\n DeltaOrderByHashQueryKey\n >,\n \"queryKey\" | \"queryFn\"\n>;\ntype DeltaOrderByHashQueryResult<TData = DeltaOrderByHashReturn> =\n UseQueryResult<TData, Error>;\n\ntype DeltaOrderByHashQueryInput<TData = DeltaOrderByHashReturn> = {\n orderHash: DeltaOrderByHashParams;\n query?: DeltaOrderByHashQueryParams<TData>;\n};\n\ntype DeltaOrderByHashQueryKey = [\n base: typeof DELTA_ORDER_BY_HASH_QUERY_KEY,\n orderParams: DeltaOrderByHashParams,\n];\n\n// ============================================================================\n// Types for getDeltaOrderById\n// ============================================================================\n\ntype DeltaOrderByIdParams = string; // orderId\ntype DeltaOrderByIdReturn = DeltaAuction;\n\ntype DeltaOrderByIdQueryParams<TData = DeltaOrderByIdReturn> = Omit<\n UseQueryOptions<DeltaOrderByIdReturn, Error, TData, DeltaOrderByIdQueryKey>,\n \"queryKey\" | \"queryFn\"\n>;\ntype DeltaOrderByIdQueryResult<TData = DeltaOrderByIdReturn> = UseQueryResult<\n TData,\n Error\n>;\n\ntype DeltaOrderByIdQueryInput<TData = DeltaOrderByIdReturn> = {\n orderParams: DeltaOrderByIdParams;\n query?: DeltaOrderByIdQueryParams<TData>;\n};\n\ntype DeltaOrderByIdQueryKey = [\n base: \"swap/delta/order-by-id\",\n orderParams: DeltaOrderByIdParams,\n];\n\n// ============================================================================\n// Types for getDeltaOrders\n// ============================================================================\n\ntype DeltaOrdersParams = Parameters<\n GetDeltaOrdersFunctions[\"getDeltaOrders\"]\n>[0];\ntype DeltaOrdersReturn = Awaited<\n ReturnType<GetDeltaOrdersFunctions[\"getDeltaOrders\"]>\n>;\n\ntype DeltaOrdersQueryParams<TData = DeltaOrdersReturn> = Omit<\n UseQueryOptions<DeltaOrdersReturn, Error, TData, DeltaOrdersQueryKey>,\n \"queryKey\" | \"queryFn\"\n>;\ntype DeltaOrdersQueryResult<TData = DeltaOrdersReturn> = UseQueryResult<\n TData,\n Error\n>;\n\ntype DeltaOrdersQueryInput<TData = DeltaOrdersReturn> = {\n orderParams: MarkOptional<DeltaOrdersParams, \"userAddress\">;\n query?: DeltaOrdersQueryParams<TData>;\n};\n\ntype UserDeltaOrdersQueryInput<TData = DeltaOrdersReturn> = {\n orderParams: Omit<DeltaOrdersParams, \"userAddress\">;\n query?: DeltaOrdersQueryParams<TData>;\n};\n\ntype DeltaOrdersQueryKey = [\n base: \"swap/delta/orders\",\n orderParams: MarkOptional<DeltaOrdersParams, \"userAddress\">,\n];\n\n// ============================================================================\n// Hook for getDeltaOrderByHash\n// ============================================================================\n\nconst DELTA_ORDER_BY_HASH_QUERY_KEY = \"swap/delta/order-by-hash\";\n\nexport function useDeltaOrderByHashQuery<TData = DeltaOrderByHashReturn>({\n orderHash,\n query,\n}: DeltaOrderByHashQueryInput<TData>): DeltaOrderByHashQueryResult<TData> {\n const { sdk } = useDeltaSDK({ chainId: 1 }); // chain doesn't matter\n\n return useQuery<\n DeltaOrderByHashReturn,\n Error,\n TData,\n DeltaOrderByHashQueryKey\n >({\n queryKey: [DELTA_ORDER_BY_HASH_QUERY_KEY, orderHash],\n queryFn: ({ signal }) => sdk.getDeltaOrderByHash(orderHash, { signal }),\n ...query,\n enabled: query?.enabled ?? true,\n });\n}\n\nexport function ensureDeltaOrderByHashFactory({\n queryClient = _queryClient,\n sdk,\n}: {\n queryClient?: QueryClient;\n sdk: GetDeltaOrdersFunctions;\n}): (orderHash: string) => Promise<DeltaOrderByHashReturn> {\n const ensureFn = async (orderHash: string) => {\n return queryClient.ensureQueryData<\n DeltaOrderByHashReturn,\n Error,\n DeltaOrderByHashReturn,\n DeltaOrderByHashQueryKey\n >({\n queryKey: [DELTA_ORDER_BY_HASH_QUERY_KEY, orderHash],\n queryFn: ({ signal }) => sdk.getDeltaOrderByHash(orderHash, { signal }),\n });\n };\n\n return ensureFn;\n}\n\n// ============================================================================\n// Hook for getDeltaOrderById\n// ============================================================================\n\nexport function useDeltaOrderByIdQuery<TData = DeltaOrderByIdReturn>({\n orderParams,\n query,\n}: DeltaOrderByIdQueryInput<TData>): DeltaOrderByIdQueryResult<TData> {\n const { sdk } = useDeltaSDK({ chainId: 1 }); // chain doesn't matter\n\n return useQuery<DeltaOrderByIdReturn, Error, TData, DeltaOrderByIdQueryKey>({\n queryKey: [\"swap/delta/order-by-id\", orderParams],\n queryFn: ({ signal }) => sdk.getDeltaOrderById(orderParams, { signal }),\n ...query,\n enabled: query?.enabled ?? true,\n });\n}\n\n// ============================================================================\n// Hook for getDeltaOrders\n// ============================================================================\n\nexport function useDeltaOrdersQuery<TData = DeltaOrdersReturn>({\n orderParams,\n query,\n}: DeltaOrdersQueryInput<TData>): DeltaOrdersQueryResult<TData> {\n const { sdk } = useDeltaSDK({ chainId: 1 }); // chain doesn't matter\n\n return useQuery<DeltaOrdersReturn, Error, TData, DeltaOrdersQueryKey>({\n queryKey: deltaOrdersQueryKey(orderParams),\n queryFn: ({ signal }) => {\n assertProp(orderParams, \"userAddress\");\n return sdk.getDeltaOrders(orderParams, { signal });\n },\n ...query,\n enabled: !!orderParams.userAddress && (query?.enabled ?? true),\n });\n}\n\nexport function useUserDeltaOrdersQuery<TData = DeltaOrdersReturn>({\n orderParams: _orderParams,\n query,\n}: UserDeltaOrdersQueryInput<TData>): DeltaOrdersQueryResult<TData> {\n const { address: account } = useAccount();\n\n const orderParams = {\n ..._orderParams,\n userAddress: account,\n };\n\n // by default the PaginatedResponse returns only limit=100 last Orders\n return useDeltaOrdersQuery({ orderParams, query });\n}\n\nexport function deltaOrdersQueryKey({\n userAddress,\n ...orderParams\n}: MarkOptional<DeltaOrdersParams, \"userAddress\">): DeltaOrdersQueryKey {\n return [\n \"swap/delta/orders\",\n {\n ...orderParams,\n userAddress: userAddress?.toLowerCase(),\n },\n ] as const;\n}\n"],"mappings":";;;;;;;AA2GA,IAAMwB,IAAgC;AAqBtC,SAAgBoC,EAA8B,EAC5C3D,aAAAA,IAAcC,GACdgD,UAIyD;CAazD,OAAOY,OAZiBzC,MACfpB,EAAY8D,gBAKjB;EACAL,UAAU,CAAClC,GAA+BH,EAAU;EACpDsC,UAAU,EAAEL,gBAAaJ,EAAIK,oBAAoBlC,GAAW,EAAEiC,WAAQ,CAAA;EACv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EAACmC;CAAA,AAAAF,EAAA,OAAA2B,KAAA3B,EAAA,OAAA6B,KAEtB3B,IAAA;EAAA,GACfyB;EAAYF,aACFI;EACd,EAAA7B,EAAA,KAAA2B,GAAA3B,EAAA,KAAA6B,GAAA7B,EAAA,KAAAE,KAAAA,IAAAF,EAAA;CAHD,IAAAnB,IAAoBqB,GAGlBK;CAG+C,OAH/CP,EAAA,OAAAnB,KAAAmB,EAAA,OAAAtB,KAGyB6B,IAAA;EAAA1B;EAAAH;EAAsB,EAAAsB,EAAA,KAAAnB,GAAAmB,EAAA,KAAAtB,GAAAsB,EAAA,KAAAO,KAAAA,IAAAP,EAAA,IAA1CsB,EAAoBf,EAAuB;;AAGpD,SAAgBgB,EAAoB,EAClCE,gBACA,GAAG5C,KACmE;CACtE,OAAO,CACL,qBACA;EACE,GAAGA;EACH4C,aAAaA,GAAaK,aAAY;EACvC,CACF"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Query, QueryClient, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
|
|
2
|
-
import {
|
|
2
|
+
import { DeltaPrice, DeltaPriceParams, OptimalRate } from '@velora-dex/sdk';
|
|
3
3
|
import { MarkOptional } from 'ts-essentials';
|
|
4
|
-
type RequiredDeltaPriceParams = Omit<
|
|
4
|
+
type RequiredDeltaPriceParams = Omit<DeltaPriceParams, "destChainId">;
|
|
5
5
|
export type DeltaPriceQueryParams = MarkOptional<RequiredDeltaPriceParams, "destToken" | "destDecimals">;
|
|
6
|
-
type DeltaQueryParams<TData =
|
|
7
|
-
type DeltaQueryResult<TData =
|
|
8
|
-
type DeltaPriceQueryInput<TData =
|
|
6
|
+
type DeltaQueryParams<TData = DeltaPrice> = Omit<UseQueryOptions<DeltaPrice, Error, TData, DeltaPriceQueryKey>, "queryKey" | "queryFn">;
|
|
7
|
+
type DeltaQueryResult<TData = DeltaPrice> = UseQueryResult<TData, Error>;
|
|
8
|
+
type DeltaPriceQueryInput<TData = DeltaPrice> = {
|
|
9
9
|
priceParams: DeltaPriceQueryParams;
|
|
10
10
|
query?: DeltaQueryParams<TData>;
|
|
11
11
|
chainId: number;
|
|
@@ -20,29 +20,29 @@ export type DeltaPriceQueryKey = readonly [
|
|
|
20
20
|
destChainId?: number;
|
|
21
21
|
}
|
|
22
22
|
];
|
|
23
|
-
export declare function useDeltaPriceQuery<TData =
|
|
23
|
+
export declare function useDeltaPriceQuery<TData = DeltaPrice>({ priceParams: _priceParams, query, chainId, timeout, destChainId, }: DeltaPriceQueryInput<TData>): {
|
|
24
24
|
result: DeltaQueryResult<TData>;
|
|
25
25
|
queryKey: DeltaPriceQueryKey;
|
|
26
26
|
};
|
|
27
|
-
export declare function isDeltaPrice(price: OptimalRate |
|
|
28
|
-
export declare function isBridgePrice(price:
|
|
27
|
+
export declare function isDeltaPrice(price: OptimalRate | DeltaPrice): price is DeltaPrice;
|
|
28
|
+
export declare function isBridgePrice(price: DeltaPrice): boolean;
|
|
29
29
|
type GetDeltaPriceQueryForPriceInput = {
|
|
30
|
-
price:
|
|
30
|
+
price: DeltaPrice;
|
|
31
31
|
chainId: number;
|
|
32
32
|
};
|
|
33
|
-
type DeltaPriceQuery = Query<
|
|
33
|
+
type DeltaPriceQuery = Query<DeltaPrice, Error, DeltaPrice, DeltaPriceQueryKey>;
|
|
34
34
|
type GetDeltaPriceQueryForPrice = (input: GetDeltaPriceQueryForPriceInput) => DeltaPriceQuery | undefined;
|
|
35
35
|
export declare function useDeltaPriceQueryForPrice(): GetDeltaPriceQueryForPrice;
|
|
36
36
|
type SubscribeToDeltaPriceInput = {
|
|
37
37
|
queryKey: DeltaPriceQueryKey;
|
|
38
|
-
onData?: (data:
|
|
38
|
+
onData?: (data: DeltaPrice) => void;
|
|
39
39
|
onError?: (error: Error) => void;
|
|
40
40
|
};
|
|
41
41
|
type SubscribeToDeltaPriceResult = (input: SubscribeToDeltaPriceInput) => () => void;
|
|
42
42
|
export declare function useSubscribeToDeltaPrice(): SubscribeToDeltaPriceResult;
|
|
43
|
-
export declare function getLastDeltaPrice(queryClient: QueryClient):
|
|
43
|
+
export declare function getLastDeltaPrice(queryClient: QueryClient): DeltaPrice | undefined;
|
|
44
44
|
export declare function isLastDeltaPriceQueryInError(queryClient: QueryClient): boolean;
|
|
45
|
-
export declare function
|
|
45
|
+
export declare function isDataDeltaPrice(price: unknown): price is DeltaPrice;
|
|
46
46
|
export declare function useDeltaPriceQueryKey({ priceParams, chainId, destChainId, }: Pick<DeltaPriceQueryInput, "priceParams" | "chainId"> & {
|
|
47
47
|
destChainId?: number;
|
|
48
48
|
}): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDeltaPriceQuery.d.ts","sourceRoot":"","sources":["../../../../../../src/hooks/swap/prices/delta/queries/useDeltaPriceQuery.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EACL,WAAW,EAIX,KAAK,eAAe,EACpB,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"useDeltaPriceQuery.d.ts","sourceRoot":"","sources":["../../../../../../src/hooks/swap/prices/delta/queries/useDeltaPriceQuery.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EACL,WAAW,EAIX,KAAK,eAAe,EACpB,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAK1D,KAAK,wBAAwB,GAAG,IAAI,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;AACtE,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAC9C,wBAAwB,EACxB,WAAW,GAAG,cAAc,CAC7B,CAAC;AAEF,KAAK,gBAAgB,CAAC,KAAK,GAAG,UAAU,IAAI,IAAI,CAC9C,eAAe,CAAC,UAAU,EAAE,KAAK,EA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ACnB,CAAC;AAEF,KAAK,0BAA0B,GAAG,CAChC,KAAK,EAAE,+BAA+B,KACnC,eAAe,GAAG,SAAS,CAAC;AAGjC,wBAAgB,0BAA0B,IAAI,0BAA0B,CAmBvE;AAED,KAAK,0BAA0B,GAAG;IAChC,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACpC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC,CAAC;AAEF,KAAK,2BAA2B,GAAG,CACjC,KAAK,EAAE,0BAA0B,KAC9B,MAAM,IAAI,CAAC;AAGhB,wBAAgB,wBAAwB,IAAI,2BAA2B,CA2BtE;AAcD,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,WAAW,GACvB,UAAU,GAAG,SAAS,CAIxB;AAED,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,WAAW,GACvB,OAAO,CAIT;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,UAAU,CAQrB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,WAAW,EACX,OAAO,EACP,WAAW,GACZ,EAAE,IAAI,CAAC,oBAAoB,EAAE,aAAa,GAAG,SAAS,CAAC,GAAG;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;;;;;;;;;;;;;;;;;;;;;;sBAWmB,MAAM;;EAkDzB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useDeltaSDK as e } from "../../../../useSDK.js";
|
|
2
2
|
import { PRICE_FETCH_TIMEOUT_MS as t } from "../../constants.js";
|
|
3
3
|
import { c as n } from "react-compiler-runtime";
|
|
4
4
|
import { useMemo as r } from "react";
|
|
@@ -135,6 +135,6 @@ function y({ priceParams: e, chainId: t, destChainId: n }) {
|
|
|
135
135
|
]);
|
|
136
136
|
}
|
|
137
137
|
//#endregion
|
|
138
|
-
export { l as DeltaPriceQueryKeyPrefix, g as getLastDeltaPrice, p as isBridgePrice, v as
|
|
138
|
+
export { l as DeltaPriceQueryKeyPrefix, g as getLastDeltaPrice, p as isBridgePrice, v as isDataDeltaPrice, f as isDeltaPrice, _ as isLastDeltaPriceQueryInError, u as useDeltaPriceQuery, m as useSubscribeToDeltaPrice };
|
|
139
139
|
|
|
140
140
|
//# sourceMappingURL=useDeltaPriceQuery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDeltaPriceQuery.js","names":["useDeltaV2SDK","Query","QueryClient","QueryObserver","useQuery","useQueryClient","UseQueryOptions","UseQueryResult","useDebouncedValue","DeltaV2","OptimalRate","assert","MarkOptional","useMemo","PRICE_FETCH_TIMEOUT_MS","RequiredDeltaPriceParams","Omit","DeltaPriceParams","DeltaPriceQueryParams","DeltaQueryParams","DeltaPrice","Error","TData","DeltaPriceQueryKey","DeltaQueryResult","DeltaPriceQueryInput","priceParams","query","chainId","timeout","destChainId","DeltaPriceQueryKeyPrefix","base","useDeltaPriceQuery","t0","$","_c","_priceParams","t1","undefined","t2","sdk","queryEnabled","enabled","t3","queryKey","sanitizedPriceParams","useDeltaPriceQueryKey","t4","t5","signal","isPriceParamsValid","price","getDeltaPrice","t6","queryFn","result","t7","destToken","destDecimals","Number","amount","isDeltaPrice","isBridgePrice","route","bridge","GetDeltaPriceQueryForPriceInput","DeltaPriceQuery","GetDeltaPriceQueryForPrice","input","useDeltaPriceQueryForPrice","queryClient","queryCache","getQueryCache","query_0","find","exact","predicate","state","data","SubscribeToDeltaPriceInput","onData","onError","error","SubscribeToDeltaPriceResult","useSubscribeToDeltaPrice","observer","subscribe","getLastDeltaPriceQuery","type","getLastDeltaPrice","isLastDeltaPriceQueryInError","isDataDeltaPriceV2","Pick","debouncedAmount","wait","srcToken","srcDecimals","userAddress","beneficiary","partner","partnerFeeBps","side","includeAgents","excludeAgents","includeBridges","excludeBridges","allowBridgeAndSwap","maxImpact","degenMode"],"sources":["../../../../../../src/hooks/swap/prices/delta/queries/useDeltaPriceQuery.ts"],"sourcesContent":["import { useDeltaV2SDK } from \"@/hooks/useSDK\";\nimport {\n Query,\n QueryClient,\n QueryObserver,\n useQuery,\n useQueryClient,\n type UseQueryOptions,\n type UseQueryResult,\n} from \"@tanstack/react-query\";\nimport { useDebouncedValue } from \"@tanstack/react-pacer/debouncer\";\nimport type { DeltaV2, OptimalRate } from \"@velora-dex/sdk\";\nimport { assert, type MarkOptional } from \"ts-essentials\";\nimport { useMemo } from \"react\";\nimport { PRICE_FETCH_TIMEOUT_MS } from \"../../constants\";\n\n// destChainId is passed separately to keep the query key stable\ntype RequiredDeltaPriceParams = Omit<DeltaV2.DeltaPriceParams, \"destChainId\">;\nexport type DeltaPriceQueryParams = MarkOptional<\n RequiredDeltaPriceParams,\n \"destToken\" | \"destDecimals\" // destToken is not available in SwapForm initially\n>;\n\ntype DeltaQueryParams<TData = DeltaV2.DeltaPrice> = Omit<\n UseQueryOptions<DeltaV2.DeltaPrice, Error, TData, DeltaPriceQueryKey>,\n \"queryKey\" | \"queryFn\"\n>;\ntype DeltaQueryResult<TData = DeltaV2.DeltaPrice> = UseQueryResult<\n TData,\n Error\n>;\n\ntype DeltaPriceQueryInput<TData = DeltaV2.DeltaPrice> = {\n priceParams: DeltaPriceQueryParams;\n query?: DeltaQueryParams<TData>;\n chainId: number;\n timeout?: number;\n destChainId?: number;\n};\n\nexport const DeltaPriceQueryKeyPrefix = \"swap/prices/delta\";\n\nexport type DeltaPriceQueryKey = readonly [\n base: typeof DeltaPriceQueryKeyPrefix,\n chainId: number,\n priceParams: DeltaPriceQueryParams & {\n destChainId?: number;\n },\n];\n\nexport function useDeltaPriceQuery<TData = DeltaV2.DeltaPrice>({\n priceParams: _priceParams,\n query,\n chainId,\n timeout = PRICE_FETCH_TIMEOUT_MS,\n destChainId,\n}: DeltaPriceQueryInput<TData>): {\n result: DeltaQueryResult<TData>;\n queryKey: DeltaPriceQueryKey;\n} {\n const { sdk } = useDeltaV2SDK({ chainId });\n\n const queryEnabled = query?.enabled ?? true;\n\n const { queryKey, sanitizedPriceParams } = useDeltaPriceQueryKey({\n priceParams: _priceParams,\n chainId,\n destChainId,\n });\n\n const result = useQuery<DeltaV2.DeltaPrice, Error, TData, DeltaPriceQueryKey>(\n {\n queryKey,\n queryFn: ({ signal }) => {\n assert(\n isPriceParamsValid(sanitizedPriceParams),\n \"destToken is required\"\n );\n const price = sdk.getDeltaPrice(sanitizedPriceParams, {\n signal,\n timeout,\n });\n return price;\n },\n ...query,\n enabled: queryEnabled && isPriceParamsValid(sanitizedPriceParams),\n }\n );\n\n return { result, queryKey };\n}\n\nfunction isPriceParamsValid(\n priceParams: DeltaPriceQueryParams\n): priceParams is RequiredDeltaPriceParams {\n return (\n !!priceParams.destToken &&\n priceParams.destDecimals !== undefined &&\n Number(priceParams.amount) > 0\n );\n}\n\nexport function isDeltaPrice(\n price: OptimalRate | DeltaV2.DeltaPrice\n): price is DeltaV2.DeltaPrice {\n return \"route\" in price;\n}\n\nexport function isBridgePrice(price: DeltaV2.DeltaPrice): boolean {\n return price.route.bridge !== null;\n}\n\ntype GetDeltaPriceQueryForPriceInput = {\n price: DeltaV2.DeltaPrice;\n chainId: number;\n};\n\ntype DeltaPriceQuery = Query<\n DeltaV2.DeltaPrice,\n Error,\n DeltaV2.DeltaPrice,\n DeltaPriceQueryKey\n>;\n\ntype GetDeltaPriceQueryForPrice = (\n input: GetDeltaPriceQueryForPriceInput\n) => DeltaPriceQuery | undefined;\n\n// get query for a given deltaPrice\nexport function useDeltaPriceQueryForPrice(): GetDeltaPriceQueryForPrice {\n const queryClient = useQueryClient();\n\n return ({ chainId, price }) => {\n const queryKey: [DeltaPriceQueryKey[0], DeltaPriceQueryKey[1]] = [\n DeltaPriceQueryKeyPrefix,\n chainId,\n ];\n const queryCache = queryClient.getQueryCache();\n const query = queryCache.find<\n DeltaV2.DeltaPrice,\n Error,\n DeltaV2.DeltaPrice\n >({\n queryKey,\n exact: false,\n predicate: (query) => {\n return query.state.data === price;\n },\n });\n\n return query as DeltaPriceQuery | undefined;\n };\n}\n\ntype SubscribeToDeltaPriceInput = {\n queryKey: DeltaPriceQueryKey;\n onData?: (data: DeltaV2.DeltaPrice) => void;\n onError?: (error: Error) => void;\n};\n\ntype SubscribeToDeltaPriceResult = (\n input: SubscribeToDeltaPriceInput\n) => () => void;\n\n// independently subscribe to a price query\nexport function useSubscribeToDeltaPrice(): SubscribeToDeltaPriceResult {\n const queryClient = useQueryClient();\n\n return ({ queryKey, onData, onError }) => {\n const observer = new QueryObserver<\n DeltaV2.DeltaPrice,\n Error,\n DeltaV2.DeltaPrice,\n DeltaV2.DeltaPrice,\n DeltaPriceQueryKey\n >(queryClient, {\n queryKey,\n // only receive updates from existing subscriptions\n enabled: false,\n });\n\n // return unsubscribe function\n return observer.subscribe((result) => {\n if (result.error) {\n onError?.(result.error);\n return;\n }\n if (result.data) {\n onData?.(result.data);\n }\n });\n };\n}\n\nfunction getLastDeltaPriceQuery(\n queryClient: QueryClient\n): Query<DeltaV2.DeltaPrice, Error, DeltaV2.DeltaPrice> | undefined {\n return queryClient\n .getQueryCache()\n .find<DeltaV2.DeltaPrice, Error, DeltaV2.DeltaPrice>({\n queryKey: [DeltaPriceQueryKeyPrefix],\n exact: false,\n type: \"active\", // only the most recent query will be active\n });\n}\n\nexport function getLastDeltaPrice(\n queryClient: QueryClient\n): DeltaV2.DeltaPrice | undefined {\n const query = getLastDeltaPriceQuery(queryClient);\n\n return query?.state.data;\n}\n\nexport function isLastDeltaPriceQueryInError(\n queryClient: QueryClient\n): boolean {\n const query = getLastDeltaPriceQuery(queryClient);\n const error = query?.state.error;\n return !!error;\n}\n\nexport function isDataDeltaPriceV2(\n price: unknown\n): price is DeltaV2.DeltaPrice {\n return (\n typeof price === \"object\" &&\n price !== null &&\n \"route\" in price &&\n \"inputToken\" in price &&\n \"outputToken\" in price\n );\n}\n\nexport function useDeltaPriceQueryKey({\n priceParams,\n chainId,\n destChainId,\n}: Pick<DeltaPriceQueryInput, \"priceParams\" | \"chainId\"> & {\n destChainId?: number;\n}) {\n \"use no memo\";\n\n // amount tends to change fast during input\n const [debouncedAmount] = useDebouncedValue(priceParams.amount, {\n wait: 500,\n });\n\n return useMemo(() => {\n // avoid passing unnecessary params to url?search and queryKey\n const sanitizedPriceParams: DeltaPriceQueryParams & {\n destChainId?: number;\n } = {\n amount: debouncedAmount,\n srcToken: priceParams.srcToken,\n destToken: priceParams.destToken,\n srcDecimals: priceParams.srcDecimals,\n destDecimals: priceParams.destDecimals,\n userAddress: priceParams.userAddress,\n beneficiary: priceParams.beneficiary,\n partner: priceParams.partner,\n partnerFeeBps: priceParams.partnerFeeBps,\n side: priceParams.side,\n includeAgents: priceParams.includeAgents,\n excludeAgents: priceParams.excludeAgents,\n includeBridges: priceParams.includeBridges,\n excludeBridges: priceParams.excludeBridges,\n allowBridgeAndSwap: priceParams.allowBridgeAndSwap,\n destChainId: destChainId,\n maxImpact: priceParams.maxImpact,\n degenMode: priceParams.degenMode,\n };\n\n const queryKey: DeltaPriceQueryKey = [\n DeltaPriceQueryKeyPrefix,\n chainId,\n sanitizedPriceParams,\n ];\n\n return { queryKey, sanitizedPriceParams };\n }, [\n priceParams.beneficiary,\n priceParams.destDecimals,\n priceParams.destToken,\n priceParams.excludeAgents,\n priceParams.includeAgents,\n priceParams.includeBridges,\n priceParams.excludeBridges,\n priceParams.partner,\n priceParams.partnerFeeBps,\n priceParams.side,\n priceParams.srcDecimals,\n priceParams.srcToken,\n priceParams.userAddress,\n priceParams.allowBridgeAndSwap,\n priceParams.maxImpact,\n priceParams.degenMode,\n chainId,\n debouncedAmount,\n destChainId,\n ]);\n}\n"],"mappings":";;;;;;;;AAwCA,IAAa+B,IAA2B;AAUxC,SAAOE,EAAAC,GAAA;CAAA,IAAAC,IAAAC,EAAA,GAAA,EAAwD,EAAAV,aAAAW,GAAAV,UAAAC,YAAAC,SAAAS,GAAAR,mBAAAI,GAI7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riceQuery.js","names":["useDeltaSDK","Query","QueryClient","QueryObserver","useQuery","useQueryClient","UseQueryOptions","UseQueryResult","useDebouncedValue","DeltaPrice","DeltaPriceParams","OptimalRate","assert","MarkOptional","useMemo","PRICE_FETCH_TIMEOUT_MS","RequiredDeltaPriceParams","Omit","DeltaPriceQueryParams","DeltaQueryParams","Error","TData","DeltaPriceQueryKey","DeltaQueryResult","DeltaPriceQueryInput","priceParams","query","chainId","timeout","destChainId","DeltaPriceQueryKeyPrefix","base","useDeltaPriceQuery","t0","$","_c","_priceParams","t1","undefined","t2","sdk","queryEnabled","enabled","t3","queryKey","sanitizedPriceParams","useDeltaPriceQueryKey","t4","t5","signal","isPriceParamsValid","price","getDeltaPrice","t6","queryFn","result","t7","destToken","destDecimals","Number","amount","isDeltaPrice","isBridgePrice","route","bridge","GetDeltaPriceQueryForPriceInput","DeltaPriceQuery","GetDeltaPriceQueryForPrice","input","useDeltaPriceQueryForPrice","queryClient","queryCache","getQueryCache","query_0","find","exact","predicate","state","data","SubscribeToDeltaPriceInput","onData","onError","error","SubscribeToDeltaPriceResult","useSubscribeToDeltaPrice","observer","subscribe","getLastDeltaPriceQuery","type","getLastDeltaPrice","isLastDeltaPriceQueryInError","isDataDeltaPrice","Pick","debouncedAmount","wait","srcToken","srcDecimals","userAddress","beneficiary","partner","partnerFeeBps","side","includeAgents","excludeAgents","includeBridges","excludeBridges","allowBridgeAndSwap","maxImpact","degenMode"],"sources":["../../../../../../src/hooks/swap/prices/delta/queries/useDeltaPriceQuery.ts"],"sourcesContent":["import { useDeltaSDK } from \"@/hooks/useSDK\";\nimport {\n Query,\n QueryClient,\n QueryObserver,\n useQuery,\n useQueryClient,\n type UseQueryOptions,\n type UseQueryResult,\n} from \"@tanstack/react-query\";\nimport { useDebouncedValue } from \"@tanstack/react-pacer/debouncer\";\nimport type {\n DeltaPrice,\n DeltaPriceParams,\n OptimalRate,\n} from \"@velora-dex/sdk\";\nimport { assert, type MarkOptional } from \"ts-essentials\";\nimport { useMemo } from \"react\";\nimport { PRICE_FETCH_TIMEOUT_MS } from \"../../constants\";\n\n// destChainId is passed separately to keep the query key stable\ntype RequiredDeltaPriceParams = Omit<DeltaPriceParams, \"destChainId\">;\nexport type DeltaPriceQueryParams = MarkOptional<\n RequiredDeltaPriceParams,\n \"destToken\" | \"destDecimals\" // destToken is not available in SwapForm initially\n>;\n\ntype DeltaQueryParams<TData = DeltaPrice> = Omit<\n UseQueryOptions<DeltaPrice, Error, TData, DeltaPriceQueryKey>,\n \"queryKey\" | \"queryFn\"\n>;\ntype DeltaQueryResult<TData = DeltaPrice> = UseQueryResult<TData, Error>;\n\ntype DeltaPriceQueryInput<TData = DeltaPrice> = {\n priceParams: DeltaPriceQueryParams;\n query?: DeltaQueryParams<TData>;\n chainId: number;\n timeout?: number;\n destChainId?: number;\n};\n\nexport const DeltaPriceQueryKeyPrefix = \"swap/prices/delta\";\n\nexport type DeltaPriceQueryKey = readonly [\n base: typeof DeltaPriceQueryKeyPrefix,\n chainId: number,\n priceParams: DeltaPriceQueryParams & {\n destChainId?: number;\n },\n];\n\nexport function useDeltaPriceQuery<TData = DeltaPrice>({\n priceParams: _priceParams,\n query,\n chainId,\n timeout = PRICE_FETCH_TIMEOUT_MS,\n destChainId,\n}: DeltaPriceQueryInput<TData>): {\n result: DeltaQueryResult<TData>;\n queryKey: DeltaPriceQueryKey;\n} {\n const { sdk } = useDeltaSDK({ chainId });\n\n const queryEnabled = query?.enabled ?? true;\n\n const { queryKey, sanitizedPriceParams } = useDeltaPriceQueryKey({\n priceParams: _priceParams,\n chainId,\n destChainId,\n });\n\n const result = useQuery<DeltaPrice, Error, TData, DeltaPriceQueryKey>({\n queryKey,\n queryFn: ({ signal }) => {\n assert(isPriceParamsValid(sanitizedPriceParams), \"destToken is required\");\n const price = sdk.getDeltaPrice(sanitizedPriceParams, {\n signal,\n timeout,\n });\n return price;\n },\n ...query,\n enabled: queryEnabled && isPriceParamsValid(sanitizedPriceParams),\n });\n\n return { result, queryKey };\n}\n\nfunction isPriceParamsValid(\n priceParams: DeltaPriceQueryParams\n): priceParams is RequiredDeltaPriceParams {\n return (\n !!priceParams.destToken &&\n priceParams.destDecimals !== undefined &&\n Number(priceParams.amount) > 0\n );\n}\n\nexport function isDeltaPrice(\n price: OptimalRate | DeltaPrice\n): price is DeltaPrice {\n return \"route\" in price;\n}\n\nexport function isBridgePrice(price: DeltaPrice): boolean {\n return price.route.bridge !== null;\n}\n\ntype GetDeltaPriceQueryForPriceInput = {\n price: DeltaPrice;\n chainId: number;\n};\n\ntype DeltaPriceQuery = Query<\n DeltaPrice,\n Error,\n DeltaPrice,\n DeltaPriceQueryKey\n>;\n\ntype GetDeltaPriceQueryForPrice = (\n input: GetDeltaPriceQueryForPriceInput\n) => DeltaPriceQuery | undefined;\n\n// get query for a given deltaPrice\nexport function useDeltaPriceQueryForPrice(): GetDeltaPriceQueryForPrice {\n const queryClient = useQueryClient();\n\n return ({ chainId, price }) => {\n const queryKey: [DeltaPriceQueryKey[0], DeltaPriceQueryKey[1]] = [\n DeltaPriceQueryKeyPrefix,\n chainId,\n ];\n const queryCache = queryClient.getQueryCache();\n const query = queryCache.find<DeltaPrice, Error, DeltaPrice>({\n queryKey,\n exact: false,\n predicate: (query) => {\n return query.state.data === price;\n },\n });\n\n return query as DeltaPriceQuery | undefined;\n };\n}\n\ntype SubscribeToDeltaPriceInput = {\n queryKey: DeltaPriceQueryKey;\n onData?: (data: DeltaPrice) => void;\n onError?: (error: Error) => void;\n};\n\ntype SubscribeToDeltaPriceResult = (\n input: SubscribeToDeltaPriceInput\n) => () => void;\n\n// independently subscribe to a price query\nexport function useSubscribeToDeltaPrice(): SubscribeToDeltaPriceResult {\n const queryClient = useQueryClient();\n\n return ({ queryKey, onData, onError }) => {\n const observer = new QueryObserver<\n DeltaPrice,\n Error,\n DeltaPrice,\n DeltaPrice,\n DeltaPriceQueryKey\n >(queryClient, {\n queryKey,\n // only receive updates from existing subscriptions\n enabled: false,\n });\n\n // return unsubscribe function\n return observer.subscribe((result) => {\n if (result.error) {\n onError?.(result.error);\n return;\n }\n if (result.data) {\n onData?.(result.data);\n }\n });\n };\n}\n\nfunction getLastDeltaPriceQuery(\n queryClient: QueryClient\n): Query<DeltaPrice, Error, DeltaPrice> | undefined {\n return queryClient\n .getQueryCache()\n .find<DeltaPrice, Error, DeltaPrice>({\n queryKey: [DeltaPriceQueryKeyPrefix],\n exact: false,\n type: \"active\", // only the most recent query will be active\n });\n}\n\nexport function getLastDeltaPrice(\n queryClient: QueryClient\n): DeltaPrice | undefined {\n const query = getLastDeltaPriceQuery(queryClient);\n\n return query?.state.data;\n}\n\nexport function isLastDeltaPriceQueryInError(\n queryClient: QueryClient\n): boolean {\n const query = getLastDeltaPriceQuery(queryClient);\n const error = query?.state.error;\n return !!error;\n}\n\nexport function isDataDeltaPrice(\n price: unknown\n): price is DeltaPrice {\n return (\n typeof price === \"object\" &&\n price !== null &&\n \"route\" in price &&\n \"inputToken\" in price &&\n \"outputToken\" in price\n );\n}\n\nexport function useDeltaPriceQueryKey({\n priceParams,\n chainId,\n destChainId,\n}: Pick<DeltaPriceQueryInput, \"priceParams\" | \"chainId\"> & {\n destChainId?: number;\n}) {\n \"use no memo\";\n\n // amount tends to change fast during input\n const [debouncedAmount] = useDebouncedValue(priceParams.amount, {\n wait: 500,\n });\n\n return useMemo(() => {\n // avoid passing unnecessary params to url?search and queryKey\n const sanitizedPriceParams: DeltaPriceQueryParams & {\n destChainId?: number;\n } = {\n amount: debouncedAmount,\n srcToken: priceParams.srcToken,\n destToken: priceParams.destToken,\n srcDecimals: priceParams.srcDecimals,\n destDecimals: priceParams.destDecimals,\n userAddress: priceParams.userAddress,\n beneficiary: priceParams.beneficiary,\n partner: priceParams.partner,\n partnerFeeBps: priceParams.partnerFeeBps,\n side: priceParams.side,\n includeAgents: priceParams.includeAgents,\n excludeAgents: priceParams.excludeAgents,\n includeBridges: priceParams.includeBridges,\n excludeBridges: priceParams.excludeBridges,\n allowBridgeAndSwap: priceParams.allowBridgeAndSwap,\n destChainId: destChainId,\n maxImpact: priceParams.maxImpact,\n degenMode: priceParams.degenMode,\n };\n\n const queryKey: DeltaPriceQueryKey = [\n DeltaPriceQueryKeyPrefix,\n chainId,\n sanitizedPriceParams,\n ];\n\n return { queryKey, sanitizedPriceParams };\n }, [\n priceParams.beneficiary,\n priceParams.destDecimals,\n priceParams.destToken,\n priceParams.excludeAgents,\n priceParams.includeAgents,\n priceParams.includeBridges,\n priceParams.excludeBridges,\n priceParams.partner,\n priceParams.partnerFeeBps,\n priceParams.side,\n priceParams.srcDecimals,\n priceParams.srcToken,\n priceParams.userAddress,\n priceParams.allowBridgeAndSwap,\n priceParams.maxImpact,\n priceParams.degenMode,\n chainId,\n debouncedAmount,\n destChainId,\n ]);\n}\n"],"mappings":";;;;;;;;AAyCA,IAAa8B,IAA2B;AAUxC,SAAOE,EAAAC,GAAA;CAAA,IAAAC,IAAAC,EAAA,GAAA,EAAgD,EAAAV,aAAAW,GAAAV,UAAAC,YAAAC,SAAAS,GAAAR,mBAAAI,GAIrDL,IAAAS,MAAAC,KAAAA,IAAAvB,IAAAsB,GAAgCE;CAAA,AAAAL,EAAA,OAAAP,IAMOY,IAAAL,EAAA,MAAXK,IAAA,EAAAZ,YAAW,EAAAO,EAAA,KAAAP,GAAAO,EAAA,KAAAK;CAAvC,IAAA,EAAAC,WAAgBxC,EAAYuC,EAAY,EAExCE,IAAqBf,GAAKgB,WAAL,IAAuBC;CAAA,AAAAT,EAAA,OAAAE,KAAAF,EAAA,OAAAP,KAAAO,EAAA,OAAAL,KAEqBc,IAAA;EAAAlB,aAClDW;EAAYT;EAAAE;EAG1B,EAAAK,EAAA,KAAAE,GAAAF,EAAA,KAAAP,GAAAO,EAAA,KAAAL,GAAAK,EAAA,KAAAS,KAAAA,IAAAT,EAAA;CAJD,IAAA,EAAAU,aAAAC,4BAA2CC,EAAsBH,EAI/D,EAACI;CAAA,AAAAb,EAAA,OAAAW,KAAAX,EAAA,OAA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,SAAS1E,EAAY0E;GACrBC,eAAe3E,EAAY2E;GAC3BC,MAAM5E,EAAY4E;GAClBC,eAAe7E,EAAY6E;GAC3BC,eAAe9E,EAAY8E;GAC3BC,gBAAgB/E,EAAY+E;GAC5BC,gBAAgBhF,EAAYgF;GAC5BC,oBAAoBjF,EAAYiF;GACnB7E;GACb8E,WAAWlF,EAAYkF;GACvBC,WAAWnF,EAAYmF;GACxB;EAQD,OAAO;GAAEhE,UAAAA;IALPd;IACAH;IACAkB;IAGOD;GAAUC;GAAsB;IACxC;EACDpB,EAAYyE;EACZzE,EAAYiC;EACZjC,EAAYgC;EACZhC,EAAY8E;EACZ9E,EAAY6E;EACZ7E,EAAY+E;EACZ/E,EAAYgF;EACZhF,EAAY0E;EACZ1E,EAAY2E;EACZ3E,EAAY4E;EACZ5E,EAAYuE;EACZvE,EAAYsE;EACZtE,EAAYwE;EACZxE,EAAYiF;EACZjF,EAAYkF;EACZlF,EAAYmF;EACZjF;EACAkE;EACAhE;EACD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useDeltaSDK as e } from "../../../../useSDK.js";
|
|
2
2
|
import { useGlobalDeltaEnabled as t } from "../../../../useGlobalDeltaEnabled.js";
|
|
3
3
|
import { c as n } from "react-compiler-runtime";
|
|
4
4
|
import { useQuery as r } from "@tanstack/react-query";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsTokenSupportedInDelta.js","names":["useGlobalDeltaEnabled","
|
|
1
|
+
{"version":3,"file":"useIsTokenSupportedInDelta.js","names":["useGlobalDeltaEnabled","useDeltaSDK","useQuery","UseQueryOptions","UseQueryResult","assert","IsTokenSupportedInDeltaParams","IsTokenSupportedInDeltaReturn","IsTokenSupportedInDeltaQueryParams","Omit","Error","TData","IsTokenSupportedInDeltaQueryKey","IsTokenSupportedInDeltaQueryResult","IsTokenSupportedInDeltaQueryInput","token","query","chainId","base","useIsTokenSupportedInDeltaQuery","t0","$","_c","t1","sdk","enabledOnCurrentChain","t2","toLowerCase","t3","t4","t5","signal","isSupported","isTokenSupportedInDelta","enabled","t6","queryKey","queryFn","staleTime","Infinity","gcTime"],"sources":["../../../../../../src/hooks/swap/prices/delta/queries/useIsTokenSupportedInDelta.ts"],"sourcesContent":["import { useGlobalDeltaEnabled } from \"@/hooks/useGlobalDeltaEnabled\";\nimport { useDeltaSDK } from \"@/hooks/useSDK\";\nimport {\n useQuery,\n type UseQueryOptions,\n type UseQueryResult,\n} from \"@tanstack/react-query\";\nimport { assert } from \"ts-essentials\";\n\ntype IsTokenSupportedInDeltaParams = string | undefined; // token address\ntype IsTokenSupportedInDeltaReturn = boolean;\n\ntype IsTokenSupportedInDeltaQueryParams<TData = IsTokenSupportedInDeltaReturn> =\n Omit<\n UseQueryOptions<\n IsTokenSupportedInDeltaReturn,\n Error,\n TData,\n IsTokenSupportedInDeltaQueryKey\n >,\n \"queryKey\" | \"queryFn\"\n >;\ntype IsTokenSupportedInDeltaQueryResult<TData = IsTokenSupportedInDeltaReturn> =\n UseQueryResult<TData, Error>;\n\ntype IsTokenSupportedInDeltaQueryInput<TData = IsTokenSupportedInDeltaReturn> =\n {\n token: IsTokenSupportedInDeltaParams;\n query?: IsTokenSupportedInDeltaQueryParams<TData>;\n chainId: number;\n };\n\ntype IsTokenSupportedInDeltaQueryKey = [\n base: \"swap/delta/is-token-supported\",\n chainId: number,\n token: IsTokenSupportedInDeltaParams,\n];\n\nexport function useIsTokenSupportedInDeltaQuery<\n TData = IsTokenSupportedInDeltaReturn,\n>({\n token,\n query,\n chainId,\n}: IsTokenSupportedInDeltaQueryInput<TData>): IsTokenSupportedInDeltaQueryResult<TData> {\n const { sdk } = useDeltaSDK({ chainId });\n const { enabledOnCurrentChain } = useGlobalDeltaEnabled();\n\n return useQuery<\n IsTokenSupportedInDeltaReturn,\n Error,\n TData,\n IsTokenSupportedInDeltaQueryKey\n >({\n queryKey: [\"swap/delta/is-token-supported\", chainId, token?.toLowerCase()],\n queryFn: ({ signal }) => {\n assert(token, \"token is required\");\n const isSupported = sdk.isTokenSupportedInDelta(token, { signal });\n return isSupported;\n },\n // never changes during App session\n staleTime: Infinity,\n gcTime: Infinity,\n ...query,\n enabled: !!token && enabledOnCurrentChain && (query?.enabled ?? true),\n });\n}\n"],"mappings":";;;;;;AAsCA,SAAOmB,EAAAC,GAAA;CAAA,IAAAC,IAAAC,EAAA,GAAA,EAEL,EAAAP,UAAAC,UAAAC,eAAAG,GAIyCG;CAAA,AAAAF,EAAA,OAAAJ,IACFM,IAAAF,EAAA,MAAXE,IAAA,EAAAN,YAAW,EAAAI,EAAA,KAAAJ,GAAAI,EAAA,KAAAE;CAAvC,IAAA,EAAAC,WAAgBvB,EAAYsB,EAAY,EACxC,EAAAE,6BAAkCzB,GAAuB,EAAC0B;CAAA,AAAAL,EAAA,OAAAN,IAQiBW,IAAAL,EAAA,MAApBK,IAAAX,GAAKY,aAAe,EAAAN,EAAA,KAAAN,GAAAM,EAAA,KAAAK;CAAA,IAAAE;CAAA,AAAAP,EAAA,OAAAJ,KAAAI,EAAA,OAAAK,KAA/DE,IAAA;EAAC;EAAiCX;EAASS;EAAqB,EAAAL,EAAA,KAAAJ,GAAAI,EAAA,KAAAK,GAAAL,EAAA,KAAAO,KAAAA,IAAAP,EAAA;CAAA,IAAAQ;CAAA,AAAAR,EAAA,OAAAG,KAAAH,EAAA,OAAAN,KACjEc,KAAAC,MAAA;EAAC,IAAA,EAAAC,cAAAD;EAE2D,OADnEzB,EAAOU,GAAO,oBAAoB,EACdS,EAAGS,wBAAyBlB,GAAO,EAAAgB,WAAU,CAC1DC;IACRX,EAAA,KAAAG,GAAAH,EAAA,KAAAN,GAAAM,EAAA,KAAAQ,KAAAA,IAAAR,EAAA;CAKQ,IAAAS,IAAA,CAAC,CAACf,KAAFU,MAAqCT,GAAKkB,WAAL,KAAuBC;CACtE,OADsEd,EAAA,QAAAL,KAAAK,EAAA,QAAAO,KAAAP,EAAA,QAAAQ,KAAAR,EAAA,QAAAS,KAXrEK,IAAA;EAAAC,UACUR;EAAgES,SACjER;EAIRS,WAEUC;EAAQC,QACXD;EAAQ,GACbvB;EAAKkB,SACCJ;EACV,EAAAT,EAAA,MAAAL,GAAAK,EAAA,MAAAO,GAAAP,EAAA,MAAAQ,GAAAR,EAAA,MAAAS,GAAAT,EAAA,MAAAc,KAAAA,IAAAd,EAAA,KAjBMnB,EAKLiC,EAYA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
|
-
import {
|
|
2
|
+
import { ExecutedDeltaAuction, FailedDeltaAuction } from '../orders/types';
|
|
3
|
+
import { DeltaAuction } from '@velora-dex/sdk';
|
|
3
4
|
declare const SINGLE_DELTA_AUCTION_QUERY_KEY_PREFIX = "single_delta_auction";
|
|
4
5
|
type SingleDeltaAuctionQueryKey = [
|
|
5
6
|
base: typeof SINGLE_DELTA_AUCTION_QUERY_KEY_PREFIX,
|
|
@@ -8,29 +9,28 @@ type SingleDeltaAuctionQueryKey = [
|
|
|
8
9
|
export declare function deltaAuctionPollingQueryKey({ orderId, }?: {
|
|
9
10
|
orderId?: string;
|
|
10
11
|
}): SingleDeltaAuctionQueryKey;
|
|
11
|
-
type
|
|
12
|
-
type UseWatchDeltaAuctionQueryInput<TData = DeltaV2Order> = {
|
|
12
|
+
type UseWatchDeltaAuctionQueryInput<TData = DeltaAuction> = {
|
|
13
13
|
orderId?: string;
|
|
14
14
|
enabled?: boolean;
|
|
15
15
|
refetchInterval?: number;
|
|
16
|
-
select?: (data:
|
|
17
|
-
onAuctionSuccess?: (auction:
|
|
18
|
-
onAuctionFailure?: (auction:
|
|
19
|
-
onUpdatedAuction?: (auction:
|
|
16
|
+
select?: (data: DeltaAuction) => TData;
|
|
17
|
+
onAuctionSuccess?: (auction: ExecutedDeltaAuction) => void;
|
|
18
|
+
onAuctionFailure?: (auction: FailedDeltaAuction) => void;
|
|
19
|
+
onUpdatedAuction?: (auction: DeltaAuction) => void;
|
|
20
20
|
};
|
|
21
|
-
export declare function useWatchDeltaAuction<TData =
|
|
22
|
-
type EnsureOrderExecutedFn<TData extends
|
|
21
|
+
export declare function useWatchDeltaAuction<TData = DeltaAuction>({ orderId, enabled, refetchInterval, select, onAuctionSuccess, onAuctionFailure, onUpdatedAuction, }: UseWatchDeltaAuctionQueryInput<TData>): UseQueryResult<TData>;
|
|
22
|
+
type EnsureOrderExecutedFn<TData extends DeltaAuction = DeltaAuction> = (options: {
|
|
23
23
|
orderId: string;
|
|
24
24
|
signal?: AbortSignal;
|
|
25
25
|
}) => Promise<TData>;
|
|
26
|
-
export declare function useEnsureDeltaOrderExecuted<TData extends
|
|
26
|
+
export declare function useEnsureDeltaOrderExecuted<TData extends DeltaAuction = DeltaAuction>({ onAuctionSuccess, onAuctionFailure, refetchInterval, }?: Pick<UseWatchDeltaAuctionQueryInput, "onAuctionSuccess" | "onAuctionFailure" | "refetchInterval">): EnsureOrderExecutedFn<TData>;
|
|
27
27
|
type UseWatchMultiDeltaAuctions = {
|
|
28
28
|
orderIds: string[];
|
|
29
29
|
enabled?: boolean;
|
|
30
|
-
onAuctionSuccess?: (auction:
|
|
31
|
-
onAuctionFailure?: (auction:
|
|
32
|
-
onUpdatedAuction?: (auction:
|
|
30
|
+
onAuctionSuccess?: (auction: ExecutedDeltaAuction) => void;
|
|
31
|
+
onAuctionFailure?: (auction: FailedDeltaAuction) => void;
|
|
32
|
+
onUpdatedAuction?: (auction: DeltaAuction) => void;
|
|
33
33
|
};
|
|
34
|
-
export declare function useWatchMultiDeltaAuctions({ orderIds, enabled, onAuctionSuccess, onAuctionFailure, onUpdatedAuction, }: UseWatchMultiDeltaAuctions): UseQueryResult<
|
|
34
|
+
export declare function useWatchMultiDeltaAuctions({ orderIds, enabled, onAuctionSuccess, onAuctionFailure, onUpdatedAuction, }: UseWatchMultiDeltaAuctions): UseQueryResult<DeltaAuction>[];
|
|
35
35
|
export {};
|
|
36
36
|
//# sourceMappingURL=useWatchDeltaOrder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWatchDeltaOrder.d.ts","sourceRoot":"","sources":["../../../../../../src/hooks/swap/prices/delta/queries/useWatchDeltaOrder.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"useWatchDeltaOrder.d.ts","sourceRoot":"","sources":["../../../../../../src/hooks/swap/prices/delta/queries/useWatchDeltaOrder.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAW/B,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAGhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAIpD,QAAA,MAAM,qCAAqC,yBAAyB,CAAC;AACrE,KAAK,0BAA0B,GAAG;IAChC,IAAI,EAAE,OAAO,qCAAqC;IAClD,OAAO,CAAC,EAAE,MAAM;CACjB,CAAC;AAEF,wBAAgB,2BAA2B,CAAC,EAC1C,OAAO,GACR,GAAE;IACD,OAAO,CAAC,EAAE,MAAM,CAAC;CACb,GAAG,0BAA0B,CAElC;AAmHD,KAAK,8BAA8B,CAAC,KAAK,GAAG,YAAY,IAAI;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,KAAK,CAAC;IACvC,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC3D,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACzD,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAA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