@velora-dex/widget 0.5.1-dev.1 → 0.6.1-dev.1
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/assets/two-dots.svg.js +12 -0
- package/dist/assets/two-dots.svg.js.map +1 -0
- package/dist/components/web3/ConnectWallets/walletFlags.d.ts +90 -0
- package/dist/components/web3/ConnectWallets/walletFlags.d.ts.map +1 -0
- package/dist/components/web3/ConnectWallets/walletFlags.js +104 -0
- package/dist/components/web3/ConnectWallets/walletFlags.js.map +1 -0
- package/dist/components/web3/ConnectWallets/walletIcons.d.ts +4 -1
- package/dist/components/web3/ConnectWallets/walletIcons.d.ts.map +1 -1
- package/dist/components/web3/ConnectWallets/walletIcons.js +23 -3
- package/dist/components/web3/ConnectWallets/walletIcons.js.map +1 -1
- package/dist/components/widget/AppHeader/Activities/Drawers.d.ts.map +1 -1
- package/dist/components/widget/AppHeader/Activities/Drawers.js +24 -14
- package/dist/components/widget/AppHeader/Activities/Drawers.js.map +1 -1
- package/dist/components/widget/Button/CancelButton/CancelButton.js +44 -40
- package/dist/components/widget/Button/CancelButton/CancelButton.js.map +1 -1
- package/dist/components/widget/Button/CancelButton/CancelButtonWithDrawer.d.ts +15 -0
- package/dist/components/widget/Button/CancelButton/CancelButtonWithDrawer.d.ts.map +1 -0
- package/dist/components/widget/Button/CancelButton/CancelButtonWithDrawer.js +66 -0
- package/dist/components/widget/Button/CancelButton/CancelButtonWithDrawer.js.map +1 -0
- package/dist/components/widget/Drawer/state/useDrawerControls.d.ts +6 -3
- package/dist/components/widget/Drawer/state/useDrawerControls.d.ts.map +1 -1
- package/dist/components/widget/Drawer/state/useDrawerControls.js +75 -2
- package/dist/components/widget/Drawer/state/useDrawerControls.js.map +1 -1
- package/dist/components/widget/LimitOrderItem/LimitOrderDetails/Controls.d.ts.map +1 -1
- package/dist/components/widget/LimitOrderItem/LimitOrderDetails/Controls.js +85 -49
- package/dist/components/widget/LimitOrderItem/LimitOrderDetails/Controls.js.map +1 -1
- package/dist/components/widget/LimitOrderItem/LimitOrderDetails/LimitOrderDetails.d.ts.map +1 -1
- package/dist/components/widget/LimitOrderItem/LimitOrderDetails/LimitOrderDetails.js +53 -61
- package/dist/components/widget/LimitOrderItem/LimitOrderDetails/LimitOrderDetails.js.map +1 -1
- package/dist/components/widget/LimitOrderItem/LimitOrderListItem.d.ts +7 -5
- package/dist/components/widget/LimitOrderItem/LimitOrderListItem.d.ts.map +1 -1
- package/dist/components/widget/LimitOrderItem/LimitOrderListItem.js +53 -45
- package/dist/components/widget/LimitOrderItem/LimitOrderListItem.js.map +1 -1
- package/dist/components/widget/LimitOrderItem/types.d.ts +0 -1
- package/dist/components/widget/LimitOrderItem/types.d.ts.map +1 -1
- package/dist/components/widget/LimitOrderItem/utils.d.ts.map +1 -1
- package/dist/components/widget/LimitOrderItem/utils.js +2 -11
- package/dist/components/widget/LimitOrderItem/utils.js.map +1 -1
- package/dist/components/widget/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/components/widget/NumberInput/NumberInput.js +65 -68
- package/dist/components/widget/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/widget/OtcOrderItem/OtcOrderDetails/Controls.d.ts.map +1 -1
- package/dist/components/widget/OtcOrderItem/OtcOrderDetails/Controls.js +33 -22
- package/dist/components/widget/OtcOrderItem/OtcOrderDetails/Controls.js.map +1 -1
- package/dist/components/widget/OtcOrderItem/utils.d.ts.map +1 -1
- package/dist/components/widget/OtcOrderItem/utils.js +2 -5
- package/dist/components/widget/OtcOrderItem/utils.js.map +1 -1
- package/dist/components/widget/TradeOverview/CancelButtonWithDrawer.d.ts +7 -0
- package/dist/components/widget/TradeOverview/CancelButtonWithDrawer.d.ts.map +1 -0
- package/dist/components/widget/TradeOverview/CancelButtonWithDrawer.js +84 -0
- package/dist/components/widget/TradeOverview/CancelButtonWithDrawer.js.map +1 -0
- package/dist/components/widget/TradeOverview/CancelOrder/ConfirmCancel.d.ts +12 -0
- package/dist/components/widget/TradeOverview/CancelOrder/ConfirmCancel.d.ts.map +1 -0
- package/dist/components/widget/TradeOverview/CancelOrder/ConfirmCancel.js +227 -0
- package/dist/components/widget/TradeOverview/CancelOrder/ConfirmCancel.js.map +1 -0
- package/dist/components/widget/TradeOverview/CancelOrder/constants.d.ts +8 -0
- package/dist/components/widget/TradeOverview/CancelOrder/constants.d.ts.map +1 -0
- package/dist/components/widget/TradeOverview/CancelOrder/constants.js +20 -0
- package/dist/components/widget/TradeOverview/CancelOrder/constants.js.map +1 -0
- package/dist/components/widget/TradeOverview/CancelOrder/utils.d.ts +12 -0
- package/dist/components/widget/TradeOverview/CancelOrder/utils.d.ts.map +1 -0
- package/dist/components/widget/TradeOverview/CancelOrder/utils.js +49 -0
- package/dist/components/widget/TradeOverview/CancelOrder/utils.js.map +1 -0
- package/dist/components/widget/TradeOverview/MarketSwapTradeOverview.d.ts +2 -2
- package/dist/components/widget/TradeOverview/MarketSwapTradeOverview.d.ts.map +1 -1
- package/dist/components/widget/TradeOverview/MarketSwapTradeOverview.js +38 -28
- package/dist/components/widget/TradeOverview/MarketSwapTradeOverview.js.map +1 -1
- package/dist/components/widget/TradeOverview/TradeComplete/TradeCompleteFooter.d.ts.map +1 -1
- package/dist/components/widget/TradeOverview/TradeComplete/TradeCompleteFooter.js +16 -18
- package/dist/components/widget/TradeOverview/TradeComplete/TradeCompleteFooter.js.map +1 -1
- package/dist/components/widget/TradeOverview/TradeComplete/TradeCompleteHeader.d.ts +2 -1
- package/dist/components/widget/TradeOverview/TradeComplete/TradeCompleteHeader.d.ts.map +1 -1
- package/dist/components/widget/TradeOverview/TradeComplete/TradeCompleteHeader.js +63 -52
- package/dist/components/widget/TradeOverview/TradeComplete/TradeCompleteHeader.js.map +1 -1
- package/dist/components/widget/TradeOverview/TradeComplete/index.d.ts.map +1 -1
- package/dist/components/widget/TradeOverview/TradeComplete/index.js +21 -14
- package/dist/components/widget/TradeOverview/TradeComplete/index.js.map +1 -1
- package/dist/components/widget/TradeOverview/TradeComplete/useTradeCompleteDetails.d.ts.map +1 -1
- package/dist/components/widget/TradeOverview/TradeComplete/useTradeCompleteDetails.js +125 -102
- package/dist/components/widget/TradeOverview/TradeComplete/useTradeCompleteDetails.js.map +1 -1
- package/dist/components/widget/TradeOverview/TradeComplete/utils.d.ts.map +1 -1
- package/dist/components/widget/TradeOverview/TradeComplete/utils.js +6 -5
- package/dist/components/widget/TradeOverview/TradeComplete/utils.js.map +1 -1
- package/dist/components/widget/TradeOverview/TradeError/TradeErrorDetails.d.ts +2 -1
- package/dist/components/widget/TradeOverview/TradeError/TradeErrorDetails.d.ts.map +1 -1
- package/dist/components/widget/TradeOverview/TradeError/TradeErrorDetails.js +66 -24
- package/dist/components/widget/TradeOverview/TradeError/TradeErrorDetails.js.map +1 -1
- package/dist/components/widget/TradeOverview/TradeError/index.d.ts.map +1 -1
- package/dist/components/widget/TradeOverview/TradeError/index.js +11 -7
- package/dist/components/widget/TradeOverview/TradeError/index.js.map +1 -1
- package/dist/components/widget/TradeOverview/TradeError/utils.d.ts +4 -1
- package/dist/components/widget/TradeOverview/TradeError/utils.d.ts.map +1 -1
- package/dist/components/widget/TradeOverview/TradeError/utils.js +20 -2
- package/dist/components/widget/TradeOverview/TradeError/utils.js.map +1 -1
- package/dist/components/widget/TradeOverview/TradeOverview.d.ts +5 -4
- package/dist/components/widget/TradeOverview/TradeOverview.d.ts.map +1 -1
- package/dist/components/widget/TradeOverview/TradeOverview.js.map +1 -1
- package/dist/components/widget/TradeOverview/TradeOverviewFooter.d.ts.map +1 -1
- package/dist/components/widget/TradeOverview/TradeOverviewFooter.js +15 -21
- package/dist/components/widget/TradeOverview/TradeOverviewFooter.js.map +1 -1
- package/dist/components/widget/TradeOverview/steps.d.ts +1 -1
- package/dist/components/widget/TradeOverview/steps.d.ts.map +1 -1
- package/dist/components/widget/TradeOverview/steps.js.map +1 -1
- package/dist/components/widget/TradeOverview/tradeFlowContext.d.ts +24 -5
- package/dist/components/widget/TradeOverview/tradeFlowContext.d.ts.map +1 -1
- package/dist/components/widget/TradeOverview/tradeFlowContext.js +39 -11
- package/dist/components/widget/TradeOverview/tradeFlowContext.js.map +1 -1
- package/dist/components/widget/TransactionDetails/LimitOrderDetails/Controls.d.ts +4 -1
- package/dist/components/widget/TransactionDetails/LimitOrderDetails/Controls.d.ts.map +1 -1
- package/dist/components/widget/TransactionDetails/LimitOrderDetails/Controls.js +133 -31
- package/dist/components/widget/TransactionDetails/LimitOrderDetails/Controls.js.map +1 -1
- package/dist/components/widget/TransactionDetails/LimitOrderDetails/TransactionDetails.d.ts +7 -2
- package/dist/components/widget/TransactionDetails/LimitOrderDetails/TransactionDetails.d.ts.map +1 -1
- package/dist/components/widget/TransactionDetails/LimitOrderDetails/TransactionDetails.js +18 -14
- package/dist/components/widget/TransactionDetails/LimitOrderDetails/TransactionDetails.js.map +1 -1
- package/dist/components/widget/TransactionDetails/TransactionListItem.d.ts.map +1 -1
- package/dist/components/widget/TransactionDetails/TransactionListItem.js +1 -1
- package/dist/components/widget/TransactionDetails/TransactionListItem.js.map +1 -1
- package/dist/components/widget/Twap/CustomDurationDrawer.d.ts +6 -0
- package/dist/components/widget/Twap/CustomDurationDrawer.d.ts.map +1 -0
- package/dist/components/widget/Twap/CustomDurationDrawer.js +237 -0
- package/dist/components/widget/Twap/CustomDurationDrawer.js.map +1 -0
- package/dist/components/widget/Twap/OrderDuration.d.ts.map +1 -1
- package/dist/components/widget/Twap/OrderDuration.js +83 -16
- package/dist/components/widget/Twap/OrderDuration.js.map +1 -1
- package/dist/configurator/Configurator.d.ts.map +1 -1
- package/dist/core/Updaters.d.ts.map +1 -1
- package/dist/core/Updaters.js +2 -0
- package/dist/core/Updaters.js.map +1 -1
- package/dist/core/inputs/state/setTokenByAddressAtom.js +4 -4
- package/dist/core/inputs/state/setTokenByAddressAtom.js.map +1 -1
- package/dist/core/state/widgetEventsAtom.d.ts.map +1 -1
- package/dist/core/state/widgetEventsAtom.js +53 -39
- package/dist/core/state/widgetEventsAtom.js.map +1 -1
- package/dist/core/twap/state/constants.d.ts +4 -0
- package/dist/core/twap/state/constants.d.ts.map +1 -1
- package/dist/core/twap/state/constants.js +14 -25
- package/dist/core/twap/state/constants.js.map +1 -1
- package/dist/core/twap/state/twapParamsAtom.d.ts +9 -0
- package/dist/core/twap/state/twapParamsAtom.d.ts.map +1 -1
- package/dist/core/twap/state/twapParamsAtom.js +10 -1
- package/dist/core/twap/state/twapParamsAtom.js.map +1 -1
- package/dist/core/twap/useTwapDetailsListProps.d.ts.map +1 -1
- package/dist/core/twap/useTwapDetailsListProps.js +3 -2
- package/dist/core/twap/useTwapDetailsListProps.js.map +1 -1
- package/dist/events/getters/twap.d.ts.map +1 -1
- package/dist/events/getters/twap.js +4 -9
- package/dist/events/getters/twap.js.map +1 -1
- package/dist/events/types/{cancel.d.ts → cancelOrder.d.ts} +5 -2
- package/dist/events/types/cancelOrder.d.ts.map +1 -0
- package/dist/events/types/cancelTx.d.ts +35 -0
- package/dist/events/types/cancelTx.d.ts.map +1 -0
- package/dist/events/types/common.d.ts +1 -1
- package/dist/events/types/common.d.ts.map +1 -1
- package/dist/events/types/index.d.ts +5 -2
- package/dist/events/types/index.d.ts.map +1 -1
- package/dist/events/types/swap.d.ts +11 -1
- package/dist/events/types/swap.d.ts.map +1 -1
- package/dist/hooks/connectors/useIsConnectedSafe.js +1 -0
- package/dist/hooks/connectors/useIsConnectedSafe.js.map +1 -1
- package/dist/hooks/getCode/useIsAccountContract.js.map +1 -1
- package/dist/hooks/otc/mutations/useCancelLimitOrder.d.ts +20 -2
- package/dist/hooks/otc/mutations/useCancelLimitOrder.d.ts.map +1 -1
- package/dist/hooks/otc/mutations/useCancelLimitOrder.js +197 -74
- package/dist/hooks/otc/mutations/useCancelLimitOrder.js.map +1 -1
- package/dist/hooks/otc/tradeFlow/useFillOtcOrderFlow.d.ts.map +1 -1
- package/dist/hooks/otc/tradeFlow/useFillOtcOrderFlow.js +0 -1
- package/dist/hooks/otc/tradeFlow/useFillOtcOrderFlow.js.map +1 -1
- package/dist/hooks/otc/tradeFlow/useOtcOrderFlow.d.ts +6 -1
- package/dist/hooks/otc/tradeFlow/useOtcOrderFlow.d.ts.map +1 -1
- package/dist/hooks/otc/tradeFlow/useOtcOrderFlow.js +37 -24
- package/dist/hooks/otc/tradeFlow/useOtcOrderFlow.js.map +1 -1
- package/dist/hooks/otc/tradeFlow/useOtcOrderStep.d.ts +2 -2
- package/dist/hooks/otc/tradeFlow/useOtcOrderStep.d.ts.map +1 -1
- package/dist/hooks/otc/tradeFlow/useOtcOrderStep.js +28 -42
- package/dist/hooks/otc/tradeFlow/useOtcOrderStep.js.map +1 -1
- package/dist/hooks/swap/prices/delta/bridge/utils.js +1 -4
- package/dist/hooks/swap/prices/delta/bridge/utils.js.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useCancelDeltaOrdersEvents.d.ts +6 -1
- package/dist/hooks/swap/prices/delta/mutations/useCancelDeltaOrdersEvents.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useCancelDeltaOrdersEvents.js +16 -0
- package/dist/hooks/swap/prices/delta/mutations/useCancelDeltaOrdersEvents.js.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useCancelOrWithdrawAndCancelDeltaOrder.d.ts +11 -5
- package/dist/hooks/swap/prices/delta/mutations/useCancelOrWithdrawAndCancelDeltaOrder.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useCancelOrWithdrawAndCancelDeltaOrder.js +176 -145
- package/dist/hooks/swap/prices/delta/mutations/useCancelOrWithdrawAndCancelDeltaOrder.js.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useIsDeltaOrderCancellable.d.ts +11 -0
- package/dist/hooks/swap/prices/delta/mutations/useIsDeltaOrderCancellable.d.ts.map +1 -0
- package/dist/hooks/swap/prices/delta/mutations/useIsDeltaOrderCancellable.js +69 -0
- package/dist/hooks/swap/prices/delta/mutations/useIsDeltaOrderCancellable.js.map +1 -0
- package/dist/hooks/swap/prices/delta/mutations/useWithdrawAndCancelDeltaOrder.d.ts +3 -3
- package/dist/hooks/swap/prices/delta/mutations/useWithdrawAndCancelDeltaOrder.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/mutations/useWithdrawAndCancelDeltaOrder.js +32 -35
- package/dist/hooks/swap/prices/delta/mutations/useWithdrawAndCancelDeltaOrder.js.map +1 -1
- package/dist/hooks/swap/prices/delta/orders/types.d.ts +1 -5
- package/dist/hooks/swap/prices/delta/orders/types.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/orders/utils.d.ts +2 -2
- package/dist/hooks/swap/prices/delta/orders/utils.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/orders/utils.js +7 -4
- package/dist/hooks/swap/prices/delta/orders/utils.js.map +1 -1
- package/dist/hooks/swap/prices/delta/queries/errors.d.ts +10 -12
- package/dist/hooks/swap/prices/delta/queries/errors.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/queries/errors.js +8 -29
- package/dist/hooks/swap/prices/delta/queries/errors.js.map +1 -1
- package/dist/hooks/swap/prices/delta/queries/useWatchDeltaOrder.d.ts +7 -9
- package/dist/hooks/swap/prices/delta/queries/useWatchDeltaOrder.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/queries/useWatchDeltaOrder.js +6 -35
- package/dist/hooks/swap/prices/delta/queries/useWatchDeltaOrder.js.map +1 -1
- package/dist/hooks/swap/prices/market/mutations/useSendMarketSwapTx.d.ts +6 -2
- package/dist/hooks/swap/prices/market/mutations/useSendMarketSwapTx.d.ts.map +1 -1
- package/dist/hooks/swap/prices/market/mutations/useSendMarketSwapTx.js +8 -2
- package/dist/hooks/swap/prices/market/mutations/useSendMarketSwapTx.js.map +1 -1
- package/dist/hooks/swap/prices/usePricesParams.js +6 -1
- package/dist/hooks/swap/prices/usePricesParams.js.map +1 -1
- package/dist/hooks/swap/prices/useSwapPrices.js +12 -12
- package/dist/hooks/swap/prices/useSwapPrices.js.map +1 -1
- package/dist/hooks/swap/prices/useTwapPrices.d.ts.map +1 -1
- package/dist/hooks/swap/prices/useTwapPrices.js +26 -13
- package/dist/hooks/swap/prices/useTwapPrices.js.map +1 -1
- package/dist/hooks/swap/tradeFlow/common/errors.d.ts +6 -0
- package/dist/hooks/swap/tradeFlow/common/errors.d.ts.map +1 -1
- package/dist/hooks/swap/tradeFlow/common/errors.js +15 -1
- package/dist/hooks/swap/tradeFlow/common/errors.js.map +1 -1
- package/dist/hooks/swap/tradeFlow/common/useApproveOrPermit.d.ts +1 -1
- package/dist/hooks/swap/tradeFlow/common/useApproveOrPermit.d.ts.map +1 -1
- package/dist/hooks/swap/tradeFlow/common/useApproveOrPermit.js.map +1 -1
- package/dist/hooks/swap/tradeFlow/useDeltaFlow.d.ts +9 -4
- package/dist/hooks/swap/tradeFlow/useDeltaFlow.d.ts.map +1 -1
- package/dist/hooks/swap/tradeFlow/useDeltaFlow.js +55 -28
- package/dist/hooks/swap/tradeFlow/useDeltaFlow.js.map +1 -1
- package/dist/hooks/swap/tradeFlow/useDeltaSwapStep.d.ts +2 -2
- package/dist/hooks/swap/tradeFlow/useDeltaSwapStep.d.ts.map +1 -1
- package/dist/hooks/swap/tradeFlow/useDeltaSwapStep.js +45 -57
- package/dist/hooks/swap/tradeFlow/useDeltaSwapStep.js.map +1 -1
- package/dist/hooks/swap/tradeFlow/useLimitOrderFlow.d.ts +8 -3
- package/dist/hooks/swap/tradeFlow/useLimitOrderFlow.d.ts.map +1 -1
- package/dist/hooks/swap/tradeFlow/useLimitOrderFlow.js +27 -10
- package/dist/hooks/swap/tradeFlow/useLimitOrderFlow.js.map +1 -1
- package/dist/hooks/swap/tradeFlow/useLimitOrderStep.d.ts +4 -4
- package/dist/hooks/swap/tradeFlow/useLimitOrderStep.d.ts.map +1 -1
- package/dist/hooks/swap/tradeFlow/useLimitOrderStep.js +23 -37
- package/dist/hooks/swap/tradeFlow/useLimitOrderStep.js.map +1 -1
- package/dist/hooks/swap/tradeFlow/useMarketFlow.d.ts +13 -1
- package/dist/hooks/swap/tradeFlow/useMarketFlow.d.ts.map +1 -1
- package/dist/hooks/swap/tradeFlow/useMarketFlow.js +93 -26
- package/dist/hooks/swap/tradeFlow/useMarketFlow.js.map +1 -1
- package/dist/hooks/swap/tradeFlow/useMarketSwapStep.d.ts +7 -1
- package/dist/hooks/swap/tradeFlow/useMarketSwapStep.d.ts.map +1 -1
- package/dist/hooks/swap/tradeFlow/useMarketSwapStep.js +59 -42
- package/dist/hooks/swap/tradeFlow/useMarketSwapStep.js.map +1 -1
- package/dist/hooks/swap/tradeFlow/useTwapFlow.d.ts +9 -3
- package/dist/hooks/swap/tradeFlow/useTwapFlow.d.ts.map +1 -1
- package/dist/hooks/swap/tradeFlow/useTwapFlow.js +40 -16
- package/dist/hooks/swap/tradeFlow/useTwapFlow.js.map +1 -1
- package/dist/hooks/swap/tradeFlow/useTwapSwapStep.d.ts +2 -2
- package/dist/hooks/swap/tradeFlow/useTwapSwapStep.d.ts.map +1 -1
- package/dist/hooks/swap/tradeFlow/useTwapSwapStep.js +11 -23
- package/dist/hooks/swap/tradeFlow/useTwapSwapStep.js.map +1 -1
- package/dist/hooks/txs/mutations/useReplaceTx.d.ts +86 -0
- package/dist/hooks/txs/mutations/useReplaceTx.d.ts.map +1 -0
- package/dist/hooks/txs/mutations/useReplaceTx.js +514 -0
- package/dist/hooks/txs/mutations/useReplaceTx.js.map +1 -0
- package/dist/hooks/txs/mutations/useSendTx.d.ts +7 -2
- package/dist/hooks/txs/mutations/useSendTx.d.ts.map +1 -1
- package/dist/hooks/txs/mutations/useSendTx.js.map +1 -1
- package/dist/hooks/txs/queries/useAccountNonce.d.ts +9 -0
- package/dist/hooks/txs/queries/useAccountNonce.d.ts.map +1 -0
- package/dist/hooks/txs/queries/useAccountNonce.js +31 -0
- package/dist/hooks/txs/queries/useAccountNonce.js.map +1 -0
- package/dist/hooks/txs/queries/useTxFees.d.ts +16 -0
- package/dist/hooks/txs/queries/useTxFees.d.ts.map +1 -0
- package/dist/hooks/txs/queries/useTxFees.js +103 -0
- package/dist/hooks/txs/queries/useTxFees.js.map +1 -0
- package/dist/hooks/txs/queries/useTxHistory.d.ts.map +1 -1
- package/dist/hooks/txs/queries/useTxHistory.js +3 -2
- package/dist/hooks/txs/queries/useTxHistory.js.map +1 -1
- package/dist/hooks/txs/queries/useTxResponse.d.ts +2390 -0
- package/dist/hooks/txs/queries/useTxResponse.d.ts.map +1 -0
- package/dist/hooks/txs/queries/useTxResponse.js +75 -0
- package/dist/hooks/txs/queries/useTxResponse.js.map +1 -0
- package/dist/hooks/txs/queries/useWalletCanReplaceTx.d.ts +2 -0
- package/dist/hooks/txs/queries/useWalletCanReplaceTx.d.ts.map +1 -0
- package/dist/hooks/txs/queries/useWalletCanReplaceTx.js +30 -0
- package/dist/hooks/txs/queries/useWalletCanReplaceTx.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/utils/index.d.ts +17 -3
- package/dist/lib/utils/index.d.ts.map +1 -1
- package/dist/lib/utils/index.js.map +1 -1
- package/dist/lib/utils/price.d.ts +0 -1
- package/dist/lib/utils/price.d.ts.map +1 -1
- package/dist/lib/utils/price.js +2 -4
- package/dist/lib/utils/price.js.map +1 -1
- package/dist/lib/utils/toasts.d.ts +1 -2
- 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.map +1 -1
- package/dist/lib/utils/twap.js.map +1 -1
- package/dist/styles.css +12 -3
- package/dist/tokens/constants.d.ts.map +1 -1
- package/dist/tokens/constants.js +9 -9
- package/dist/tokens/constants.js.map +1 -1
- package/dist/tokens/defaultTokens.js +17 -17
- package/dist/tokens/defaultTokens.js.map +1 -1
- package/dist/tokens/lists/constants.d.ts +1 -1
- package/dist/tokens/lists/constants.d.ts.map +1 -1
- package/dist/tokens/lists/constants.js +1 -1
- package/dist/tokens/lists/constants.js.map +1 -1
- package/dist/transactions/queries/ensureEstimateFeesPerGas.d.ts +16 -0
- package/dist/transactions/queries/ensureEstimateFeesPerGas.d.ts.map +1 -0
- package/dist/transactions/queries/ensureEstimateFeesPerGas.js +23 -0
- package/dist/transactions/queries/ensureEstimateFeesPerGas.js.map +1 -0
- package/dist/transactions/queries/ensureTxReceipt.d.ts.map +1 -1
- package/dist/transactions/queries/ensureTxReceipt.js +1 -1
- package/dist/transactions/queries/ensureTxReceipt.js.map +1 -1
- package/dist/transactions/queries/ensureTxResponse.d.ts +17 -0
- package/dist/transactions/queries/ensureTxResponse.d.ts.map +1 -0
- package/dist/transactions/queries/ensureTxResponse.js +23 -0
- package/dist/transactions/queries/ensureTxResponse.js.map +1 -0
- package/dist/transactions/state/hooks/useMarkTxAsDropped.d.ts +7 -0
- package/dist/transactions/state/hooks/useMarkTxAsDropped.d.ts.map +1 -0
- package/dist/transactions/state/hooks/useMarkTxAsDropped.js +10 -0
- package/dist/transactions/state/hooks/useMarkTxAsDropped.js.map +1 -0
- package/dist/transactions/state/transactionsActionAtom.d.ts +12 -0
- package/dist/transactions/state/transactionsActionAtom.d.ts.map +1 -1
- package/dist/transactions/state/transactionsActionAtom.js +40 -1
- package/dist/transactions/state/transactionsActionAtom.js.map +1 -1
- package/dist/transactions/status.d.ts +1 -1
- package/dist/transactions/status.d.ts.map +1 -1
- package/dist/transactions/status.js +6 -0
- package/dist/transactions/status.js.map +1 -1
- package/dist/transactions/types.d.ts +15 -2
- package/dist/transactions/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/events/types/cancel.d.ts.map +0 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { d as distExports } from '../../../_virtual/index.js';
|
|
3
|
+
import { CancelButton } from '../Button/CancelButton/CancelButton.js';
|
|
4
|
+
import { cancelOrderTooltip } from '../Button/CancelButton/constants.js';
|
|
5
|
+
import { ControlledDrawer } from '../Drawer/index.js';
|
|
6
|
+
import { useLocalDrawerControls } from '../Drawer/state/useDrawerControls.js';
|
|
7
|
+
import { ConfirmCancelOrder } from './CancelOrder/ConfirmCancel.js';
|
|
8
|
+
import { getOrderCancelDetailsForTradeFlowType } from './CancelOrder/utils.js';
|
|
9
|
+
import { useTradeFlowContext } from './tradeFlowContext.js';
|
|
10
|
+
|
|
11
|
+
function CancelButtonWithDrawer(t0) {
|
|
12
|
+
const $ = distExports.c(18);
|
|
13
|
+
const {
|
|
14
|
+
onCancelOrder,
|
|
15
|
+
className
|
|
16
|
+
} = t0;
|
|
17
|
+
const {
|
|
18
|
+
orderCancellationStep,
|
|
19
|
+
tradeFlowType
|
|
20
|
+
} = useTradeFlowContext();
|
|
21
|
+
const isPending = orderCancellationStep === "order-cancellation-approval" || orderCancellationStep === "order-cancellation-execution";
|
|
22
|
+
let t1;
|
|
23
|
+
if ($[0] !== tradeFlowType) {
|
|
24
|
+
t1 = getOrderCancelDetailsForTradeFlowType(tradeFlowType);
|
|
25
|
+
$[0] = tradeFlowType;
|
|
26
|
+
$[1] = t1;
|
|
27
|
+
} else {
|
|
28
|
+
t1 = $[1];
|
|
29
|
+
}
|
|
30
|
+
const orderCancelDetails = t1;
|
|
31
|
+
const cancelOrderDrawerControls = useLocalDrawerControls();
|
|
32
|
+
const onClick = orderCancelDetails ? cancelOrderDrawerControls.onOpen : onCancelOrder;
|
|
33
|
+
let t2;
|
|
34
|
+
if ($[2] !== className || $[3] !== isPending || $[4] !== onClick) {
|
|
35
|
+
t2 = /* @__PURE__ */ jsx(CancelButton, { className, disabled: isPending, isLoading: isPending, onClick, tooltip: cancelOrderTooltip, children: "Cancel Order" });
|
|
36
|
+
$[2] = className;
|
|
37
|
+
$[3] = isPending;
|
|
38
|
+
$[4] = onClick;
|
|
39
|
+
$[5] = t2;
|
|
40
|
+
} else {
|
|
41
|
+
t2 = $[5];
|
|
42
|
+
}
|
|
43
|
+
const CancelBtn = t2;
|
|
44
|
+
if (orderCancelDetails === null) {
|
|
45
|
+
return CancelBtn;
|
|
46
|
+
}
|
|
47
|
+
let t3;
|
|
48
|
+
if ($[6] !== isPending || $[7] !== onCancelOrder || $[8] !== orderCancelDetails.orderType || $[9] !== orderCancellationStep) {
|
|
49
|
+
t3 = /* @__PURE__ */ jsx(ConfirmCancelOrder, { orderTypeToCancel: orderCancelDetails.orderType, onConfirmCancel: onCancelOrder, isCancelling: isPending, step: orderCancellationStep });
|
|
50
|
+
$[6] = isPending;
|
|
51
|
+
$[7] = onCancelOrder;
|
|
52
|
+
$[8] = orderCancelDetails.orderType;
|
|
53
|
+
$[9] = orderCancellationStep;
|
|
54
|
+
$[10] = t3;
|
|
55
|
+
} else {
|
|
56
|
+
t3 = $[10];
|
|
57
|
+
}
|
|
58
|
+
let t4;
|
|
59
|
+
if ($[11] !== cancelOrderDrawerControls || $[12] !== orderCancelDetails.cancelTexts.drawerTitle || $[13] !== t3) {
|
|
60
|
+
t4 = /* @__PURE__ */ jsx(ControlledDrawer, { ...cancelOrderDrawerControls, title: orderCancelDetails.cancelTexts.drawerTitle, showGoBackButton: true, children: t3 });
|
|
61
|
+
$[11] = cancelOrderDrawerControls;
|
|
62
|
+
$[12] = orderCancelDetails.cancelTexts.drawerTitle;
|
|
63
|
+
$[13] = t3;
|
|
64
|
+
$[14] = t4;
|
|
65
|
+
} else {
|
|
66
|
+
t4 = $[14];
|
|
67
|
+
}
|
|
68
|
+
let t5;
|
|
69
|
+
if ($[15] !== CancelBtn || $[16] !== t4) {
|
|
70
|
+
t5 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
71
|
+
CancelBtn,
|
|
72
|
+
t4
|
|
73
|
+
] });
|
|
74
|
+
$[15] = CancelBtn;
|
|
75
|
+
$[16] = t4;
|
|
76
|
+
$[17] = t5;
|
|
77
|
+
} else {
|
|
78
|
+
t5 = $[17];
|
|
79
|
+
}
|
|
80
|
+
return t5;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export { CancelButtonWithDrawer };
|
|
84
|
+
//# sourceMappingURL=CancelButtonWithDrawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CancelButtonWithDrawer.js","sources":["../../../../src/components/widget/TradeOverview/CancelButtonWithDrawer.tsx"],"sourcesContent":["import { CancelButton } from \"../Button/CancelButton/CancelButton\";\nimport { cancelOrderTooltip } from \"../Button/CancelButton/constants\";\nimport { ControlledDrawer } from \"../Drawer\";\nimport { useLocalDrawerControls } from \"../Drawer/state/useDrawerControls\";\nimport { ConfirmCancelOrder } from \"./CancelOrder/ConfirmCancel\";\nimport { getOrderCancelDetailsForTradeFlowType } from \"./CancelOrder/utils\";\nimport { useTradeFlowContext } from \"./tradeFlowContext\";\n\ntype CancelButtonWithDrawerProps = {\n className?: string;\n onCancelOrder: () => void;\n};\n\nexport function CancelButtonWithDrawer({\n onCancelOrder,\n className,\n}: CancelButtonWithDrawerProps) {\n const { orderCancellationStep, tradeFlowType } = useTradeFlowContext();\n\n const isPending =\n orderCancellationStep === \"order-cancellation-approval\" ||\n orderCancellationStep === \"order-cancellation-execution\";\n\n const orderCancelDetails =\n getOrderCancelDetailsForTradeFlowType(tradeFlowType);\n\n const cancelOrderDrawerControls = useLocalDrawerControls();\n\n const onClick = orderCancelDetails\n ? cancelOrderDrawerControls.onOpen\n : onCancelOrder;\n\n const CancelBtn = (\n <CancelButton\n className={className}\n disabled={isPending}\n isLoading={isPending}\n onClick={onClick}\n tooltip={cancelOrderTooltip}\n >\n Cancel Order\n </CancelButton>\n );\n\n if (orderCancelDetails === null) {\n return CancelBtn;\n }\n\n return (\n <>\n {CancelBtn}\n <ControlledDrawer\n {...cancelOrderDrawerControls}\n title={orderCancelDetails.cancelTexts.drawerTitle}\n showGoBackButton\n >\n <ConfirmCancelOrder\n orderTypeToCancel={orderCancelDetails.orderType}\n onConfirmCancel={onCancelOrder}\n isCancelling={isPending}\n step={orderCancellationStep}\n />\n </ControlledDrawer>\n </>\n );\n}\n"],"names":["CancelButtonWithDrawer","t0","$","_c","onCancelOrder","className","orderCancellationStep","tradeFlowType","useTradeFlowContext","isPending","t1","getOrderCancelDetailsForTradeFlowType","orderCancelDetails","cancelOrderDrawerControls","useLocalDrawerControls","onClick","onOpen","t2","cancelOrderTooltip","CancelBtn","t3","orderType","t4","cancelTexts","drawerTitle","t5"],"mappings":";;;;;;;;;;AAaO,SAAAA,uBAAAC,EAAAA,EAAA;AAAA,EAAA,MAAAC,CAAAA,GAAAC,cAAA,EAAA,CAAA;AAAgC,EAAA,MAAA;AAAA,IAAAC,aAAAA;AAAAA,IAAAC;AAAAA,GAAA,GAAAJ,EAAAA;AAIrC,EAAA,MAAA;AAAA,IAAAK,qBAAAA;AAAAA,IAAAC;AAAAA,MAAiDC,mBAAAA,EAAoB;AAErE,EAAA,MAAAC,SAAAA,GACEH,qBAAAA,KAA0B,6BAAA,IAC1BA,qBAAAA,KAA0B,8BAAA;AAA+B,EAAA,IAAAI,EAAAA;AAAA,EAAA,IAAAR,CAAAA,QAAAK,aAAAA,EAAA;AAGzDG,IAAAA,EAAAA,GAAAC,sCAAsCJ,aAAa,CAAA;AAACL,IAAAA,CAAAA,MAAAK,aAAAA;AAAAL,IAAAA,CAAAA,MAAAQ,EAAAA;AAAAA,EAAA,CAAA,MAAA;AAAAA,IAAAA,EAAAA,GAAAR,EAAA,CAAA,CAAA;AAAA,EAAA;AADtD,EAAA,MAAAU,kBAAAA,GACEF,EAAAA;AAEF,EAAA,MAAAG,4BAAkCC,sBAAAA,EAAuB;AAEzD,EAAA,MAAAC,OAAAA,GAAgBH,kBAAAA,GACZC,yBAAAA,CAAyBG,MAAAA,GADbZ,aAAAA;AAEE,EAAA,IAAAa,EAAAA;AAAA,EAAA,IAAAf,CAAAA,CAAA,CAAA,CAAA,KAAAG,SAAAA,IAAAH,CAAAA,QAAAO,SAAAA,IAAAP,CAAAA,CAAA,CAAA,CAAA,KAAAa,OAAAA,EAAA;AAGhBE,IAAAA,EAAAA,mBAAA,GAAA,CAAC,YAA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ancellation-pre-confirm" | CancelOrderStepKey;
|
|
4
|
+
type ConfirmCancelOrderProps = {
|
|
5
|
+
orderTypeToCancel: OrderTypeToCancel;
|
|
6
|
+
onConfirmCancel: () => void;
|
|
7
|
+
isCancelling: boolean;
|
|
8
|
+
step?: ConfirmCancelOrderStep;
|
|
9
|
+
};
|
|
10
|
+
export declare const ConfirmCancelOrder: ({ orderTypeToCancel, onConfirmCancel, isCancelling, step, }: ConfirmCancelOrderProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=ConfirmCancel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmCancel.d.ts","sourceRoot":"","sources":["../../../../../src/components/widget/TradeOverview/CancelOrder/ConfirmCancel.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAkInD,MAAM,MAAM,sBAAsB,GAC9B,gCAAgC,GAChC,kBAAkB,CAAC;AAEvB,KAAK,uBAAuB,GAAG;IAC7B,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,YAAY,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,sBAAsB,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,6DAKhC,uBAAuB,4CAWzB,CAAC"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { d as distExports } from '../../../../_virtual/index.js';
|
|
3
|
+
import { Switch } from '../../../ui/switch.js';
|
|
4
|
+
import { WarningWithTitle } from '../../Warning/Warning.js';
|
|
5
|
+
import { useState, useId } from 'react';
|
|
6
|
+
import { CancelOrderTexts } from './constants.js';
|
|
7
|
+
import { CancelButton } from '../../Button/CancelButton/CancelButton.js';
|
|
8
|
+
import { cn } from '../../../../lib/utils/index.js';
|
|
9
|
+
|
|
10
|
+
const warningClasses = {
|
|
11
|
+
root: "bg-[rgba(255,153,0,0.05)]"
|
|
12
|
+
};
|
|
13
|
+
const TxNonceWarning = "When cancelling a pending transaction your wallet must respect a custom `nonce` transaction parameter that matches the nonce of the cancelling transaction.";
|
|
14
|
+
const CancelOrderWarning = (t0) => {
|
|
15
|
+
const $ = distExports.c(10);
|
|
16
|
+
const {
|
|
17
|
+
orderTypeToCancel
|
|
18
|
+
} = t0;
|
|
19
|
+
const {
|
|
20
|
+
warningTitle,
|
|
21
|
+
warningMessage
|
|
22
|
+
} = CancelOrderTexts[orderTypeToCancel];
|
|
23
|
+
let t1;
|
|
24
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
25
|
+
t1 = /* @__PURE__ */ jsx("div", { children: "Because execution is asynchronous, your cancellation may not take effect immediately. The order could still execute if matched before the cancellation is processed." });
|
|
26
|
+
$[0] = t1;
|
|
27
|
+
} else {
|
|
28
|
+
t1 = $[0];
|
|
29
|
+
}
|
|
30
|
+
let t2;
|
|
31
|
+
if ($[1] !== orderTypeToCancel) {
|
|
32
|
+
t2 = orderTypeToCancel === "Market Swap" && /* @__PURE__ */ jsx("div", { children: TxNonceWarning });
|
|
33
|
+
$[1] = orderTypeToCancel;
|
|
34
|
+
$[2] = t2;
|
|
35
|
+
} else {
|
|
36
|
+
t2 = $[2];
|
|
37
|
+
}
|
|
38
|
+
let t3;
|
|
39
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
40
|
+
t3 = /* @__PURE__ */ jsx("div", { children: "Proceed only if you understand this risk." });
|
|
41
|
+
$[3] = t3;
|
|
42
|
+
} else {
|
|
43
|
+
t3 = $[3];
|
|
44
|
+
}
|
|
45
|
+
let t4;
|
|
46
|
+
if ($[4] !== t2 || $[5] !== warningMessage) {
|
|
47
|
+
t4 = /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
48
|
+
warningMessage,
|
|
49
|
+
t1,
|
|
50
|
+
t2,
|
|
51
|
+
t3
|
|
52
|
+
] });
|
|
53
|
+
$[4] = t2;
|
|
54
|
+
$[5] = warningMessage;
|
|
55
|
+
$[6] = t4;
|
|
56
|
+
} else {
|
|
57
|
+
t4 = $[6];
|
|
58
|
+
}
|
|
59
|
+
let t5;
|
|
60
|
+
if ($[7] !== t4 || $[8] !== warningTitle) {
|
|
61
|
+
t5 = /* @__PURE__ */ jsx(WarningWithTitle, { title: warningTitle, message: t4, classes: warningClasses });
|
|
62
|
+
$[7] = t4;
|
|
63
|
+
$[8] = warningTitle;
|
|
64
|
+
$[9] = t5;
|
|
65
|
+
} else {
|
|
66
|
+
t5 = $[9];
|
|
67
|
+
}
|
|
68
|
+
return t5;
|
|
69
|
+
};
|
|
70
|
+
const progressStep2Text = {
|
|
71
|
+
"order-cancellation-pre-confirm": "I understand the risks mentioned above",
|
|
72
|
+
"order-cancellation-approval": "We need a signature on your wallet to cancel your order",
|
|
73
|
+
"order-cancellation-execution": "The order is being cancelled, but it may still be executed",
|
|
74
|
+
"order-cancellation-success": "Order cancelled",
|
|
75
|
+
"order-cancellation-error": "Order cancellation failed"
|
|
76
|
+
};
|
|
77
|
+
const CancelOrderToggleAndStep = (t0) => {
|
|
78
|
+
const $ = distExports.c(13);
|
|
79
|
+
const {
|
|
80
|
+
step,
|
|
81
|
+
checked,
|
|
82
|
+
setToggle
|
|
83
|
+
} = t0;
|
|
84
|
+
let SwitchComponent = null;
|
|
85
|
+
const labelId = useId();
|
|
86
|
+
if (step === "order-cancellation-pre-confirm") {
|
|
87
|
+
let t12;
|
|
88
|
+
if ($[0] !== checked || $[1] !== labelId || $[2] !== setToggle) {
|
|
89
|
+
t12 = /* @__PURE__ */ jsx(Switch, { id: labelId, checked, className: "cursor-pointer", onCheckedChange: setToggle });
|
|
90
|
+
$[0] = checked;
|
|
91
|
+
$[1] = labelId;
|
|
92
|
+
$[2] = setToggle;
|
|
93
|
+
$[3] = t12;
|
|
94
|
+
} else {
|
|
95
|
+
t12 = $[3];
|
|
96
|
+
}
|
|
97
|
+
SwitchComponent = t12;
|
|
98
|
+
}
|
|
99
|
+
const text = progressStep2Text[step];
|
|
100
|
+
const t1 = !!SwitchComponent;
|
|
101
|
+
let t2;
|
|
102
|
+
if ($[4] !== t1) {
|
|
103
|
+
t2 = cn("flex items-center gap-1.5 w-fit", {
|
|
104
|
+
"cursor-pointer": t1
|
|
105
|
+
});
|
|
106
|
+
$[4] = t1;
|
|
107
|
+
$[5] = t2;
|
|
108
|
+
} else {
|
|
109
|
+
t2 = $[5];
|
|
110
|
+
}
|
|
111
|
+
const t3 = SwitchComponent ? labelId : void 0;
|
|
112
|
+
let t4;
|
|
113
|
+
if ($[6] !== text) {
|
|
114
|
+
t4 = /* @__PURE__ */ jsx("div", { className: "text-sm text-contrast-4 dark:text-contrast-6", children: text });
|
|
115
|
+
$[6] = text;
|
|
116
|
+
$[7] = t4;
|
|
117
|
+
} else {
|
|
118
|
+
t4 = $[7];
|
|
119
|
+
}
|
|
120
|
+
let t5;
|
|
121
|
+
if ($[8] !== SwitchComponent || $[9] !== t2 || $[10] !== t3 || $[11] !== t4) {
|
|
122
|
+
t5 = /* @__PURE__ */ jsxs("label", { className: t2, htmlFor: t3, children: [
|
|
123
|
+
SwitchComponent,
|
|
124
|
+
t4
|
|
125
|
+
] });
|
|
126
|
+
$[8] = SwitchComponent;
|
|
127
|
+
$[9] = t2;
|
|
128
|
+
$[10] = t3;
|
|
129
|
+
$[11] = t4;
|
|
130
|
+
$[12] = t5;
|
|
131
|
+
} else {
|
|
132
|
+
t5 = $[12];
|
|
133
|
+
}
|
|
134
|
+
return t5;
|
|
135
|
+
};
|
|
136
|
+
const CancelOrderControls = (t0) => {
|
|
137
|
+
const $ = distExports.c(12);
|
|
138
|
+
const {
|
|
139
|
+
onConfirmCancel,
|
|
140
|
+
isCancelling,
|
|
141
|
+
step
|
|
142
|
+
} = t0;
|
|
143
|
+
const [acknowledged, setAcknowledged] = useState(false);
|
|
144
|
+
const isPending = isCancelling || step === "order-cancellation-approval" || step === "order-cancellation-execution";
|
|
145
|
+
const isSuccess = step === "order-cancellation-success";
|
|
146
|
+
let t1;
|
|
147
|
+
if ($[0] !== acknowledged || $[1] !== step) {
|
|
148
|
+
t1 = /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(CancelOrderToggleAndStep, { step, checked: acknowledged, setToggle: setAcknowledged }) });
|
|
149
|
+
$[0] = acknowledged;
|
|
150
|
+
$[1] = step;
|
|
151
|
+
$[2] = t1;
|
|
152
|
+
} else {
|
|
153
|
+
t1 = $[2];
|
|
154
|
+
}
|
|
155
|
+
const t2 = !acknowledged || isPending || isSuccess;
|
|
156
|
+
const t3 = isPending || isSuccess ? "cta" : "default";
|
|
157
|
+
const t4 = isPending ? "Cancelling Your Order" : "Confirm";
|
|
158
|
+
let t5;
|
|
159
|
+
if ($[3] !== isPending || $[4] !== onConfirmCancel || $[5] !== t2 || $[6] !== t3 || $[7] !== t4) {
|
|
160
|
+
t5 = /* @__PURE__ */ jsx("div", { className: "mt-7 flex items-center justify-between gap-2", children: /* @__PURE__ */ jsx(CancelButton, { isLoading: isPending, onClick: onConfirmCancel, disabled: t2, variant: t3, children: t4 }) });
|
|
161
|
+
$[3] = isPending;
|
|
162
|
+
$[4] = onConfirmCancel;
|
|
163
|
+
$[5] = t2;
|
|
164
|
+
$[6] = t3;
|
|
165
|
+
$[7] = t4;
|
|
166
|
+
$[8] = t5;
|
|
167
|
+
} else {
|
|
168
|
+
t5 = $[8];
|
|
169
|
+
}
|
|
170
|
+
let t6;
|
|
171
|
+
if ($[9] !== t1 || $[10] !== t5) {
|
|
172
|
+
t6 = /* @__PURE__ */ jsxs("div", { children: [
|
|
173
|
+
t1,
|
|
174
|
+
t5
|
|
175
|
+
] });
|
|
176
|
+
$[9] = t1;
|
|
177
|
+
$[10] = t5;
|
|
178
|
+
$[11] = t6;
|
|
179
|
+
} else {
|
|
180
|
+
t6 = $[11];
|
|
181
|
+
}
|
|
182
|
+
return t6;
|
|
183
|
+
};
|
|
184
|
+
const ConfirmCancelOrder = (t0) => {
|
|
185
|
+
const $ = distExports.c(9);
|
|
186
|
+
const {
|
|
187
|
+
orderTypeToCancel,
|
|
188
|
+
onConfirmCancel,
|
|
189
|
+
isCancelling,
|
|
190
|
+
step: t1
|
|
191
|
+
} = t0;
|
|
192
|
+
const step = t1 === void 0 ? "order-cancellation-pre-confirm" : t1;
|
|
193
|
+
let t2;
|
|
194
|
+
if ($[0] !== orderTypeToCancel) {
|
|
195
|
+
t2 = /* @__PURE__ */ jsx(CancelOrderWarning, { orderTypeToCancel });
|
|
196
|
+
$[0] = orderTypeToCancel;
|
|
197
|
+
$[1] = t2;
|
|
198
|
+
} else {
|
|
199
|
+
t2 = $[1];
|
|
200
|
+
}
|
|
201
|
+
let t3;
|
|
202
|
+
if ($[2] !== isCancelling || $[3] !== onConfirmCancel || $[4] !== step) {
|
|
203
|
+
t3 = /* @__PURE__ */ jsx(CancelOrderControls, { onConfirmCancel, isCancelling, step });
|
|
204
|
+
$[2] = isCancelling;
|
|
205
|
+
$[3] = onConfirmCancel;
|
|
206
|
+
$[4] = step;
|
|
207
|
+
$[5] = t3;
|
|
208
|
+
} else {
|
|
209
|
+
t3 = $[5];
|
|
210
|
+
}
|
|
211
|
+
let t4;
|
|
212
|
+
if ($[6] !== t2 || $[7] !== t3) {
|
|
213
|
+
t4 = /* @__PURE__ */ jsxs("div", { className: "p-6 flex flex-col gap-7", children: [
|
|
214
|
+
t2,
|
|
215
|
+
t3
|
|
216
|
+
] });
|
|
217
|
+
$[6] = t2;
|
|
218
|
+
$[7] = t3;
|
|
219
|
+
$[8] = t4;
|
|
220
|
+
} else {
|
|
221
|
+
t4 = $[8];
|
|
222
|
+
}
|
|
223
|
+
return t4;
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
export { ConfirmCancelOrder };
|
|
227
|
+
//# sourceMappingURL=ConfirmCancel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmCancel.js","sources":["../../../../../src/components/widget/TradeOverview/CancelOrder/ConfirmCancel.tsx"],"sourcesContent":["import { Switch } from \"@/components/ui/switch\";\nimport { WarningWithTitle } from \"../../Warning/Warning\";\nimport { useId, useState } from \"react\";\nimport type { WarningProps } from \"../../Warning/types\";\nimport { CancelOrderTexts, type OrderTypeToCancel } from \"./constants\";\nimport type { CancelOrderStepKey } from \"../steps\";\nimport { CancelButton } from \"../../Button/CancelButton/CancelButton\";\nimport { cn } from \"@/lib/utils\";\n\nconst warningClasses: WarningProps[\"classes\"] = {\n root: \"bg-[rgba(255,153,0,0.05)]\",\n};\n\ntype CancelOrderWarningProps = {\n orderTypeToCancel: OrderTypeToCancel;\n};\n\nconst TxNonceWarning =\n \"When cancelling a pending transaction your wallet must respect a custom `nonce` transaction parameter that matches the nonce of the cancelling transaction.\";\n\nconst CancelOrderWarning = ({ orderTypeToCancel }: CancelOrderWarningProps) => {\n const { warningTitle, warningMessage } = CancelOrderTexts[orderTypeToCancel];\n return (\n <WarningWithTitle\n title={warningTitle}\n message={\n <div className=\"flex flex-col gap-2\">\n {warningMessage}\n <div>\n Because execution is asynchronous, your cancellation may not take\n effect immediately. The order could still execute if matched before\n the cancellation is processed.\n </div>\n {orderTypeToCancel === \"Market Swap\" && <div>{TxNonceWarning}</div>}\n <div>Proceed only if you understand this risk.</div>\n </div>\n }\n classes={warningClasses}\n />\n );\n};\n\ntype CancelOrderControlsProps = {\n onConfirmCancel: () => void;\n isCancelling: boolean;\n step: ConfirmCancelOrderStep;\n};\n\ntype CancelOrderToggleAndStepProps = {\n step: ConfirmCancelOrderStep;\n checked: boolean;\n setToggle: React.Dispatch<React.SetStateAction<boolean>>;\n};\n\nconst progressStep2Text: Record<ConfirmCancelOrderStep, string> = {\n \"order-cancellation-pre-confirm\": \"I understand the risks mentioned above\",\n \"order-cancellation-approval\":\n \"We need a signature on your wallet to cancel your order\",\n \"order-cancellation-execution\":\n \"The order is being cancelled, but it may still be executed\",\n \"order-cancellation-success\": \"Order cancelled\",\n \"order-cancellation-error\": \"Order cancellation failed\",\n};\n\nconst CancelOrderToggleAndStep = ({\n step,\n checked,\n setToggle,\n}: CancelOrderToggleAndStepProps) => {\n let SwitchComponent: React.ReactNode = null;\n\n // guarantees uniqueness for Component instance (even when many such Components are rendered)\n const labelId = useId();\n\n if (step === \"order-cancellation-pre-confirm\") {\n SwitchComponent = (\n <Switch\n id={labelId}\n checked={checked}\n className=\"cursor-pointer\"\n onCheckedChange={setToggle}\n />\n );\n }\n\n const text = progressStep2Text[step];\n return (\n <label\n className={cn(\"flex items-center gap-1.5 w-fit\", {\n \"cursor-pointer\": !!SwitchComponent,\n })}\n htmlFor={SwitchComponent ? labelId : undefined}\n >\n {SwitchComponent}\n <div className=\"text-sm text-contrast-4 dark:text-contrast-6\">{text}</div>\n </label>\n );\n};\n\nconst CancelOrderControls = ({\n onConfirmCancel,\n isCancelling,\n step,\n}: CancelOrderControlsProps) => {\n const [acknowledged, setAcknowledged] = useState(false);\n\n const isPending =\n isCancelling ||\n step === \"order-cancellation-approval\" ||\n step === \"order-cancellation-execution\";\n const isSuccess = step === \"order-cancellation-success\";\n\n return (\n <div>\n <div>\n <CancelOrderToggleAndStep\n step={step}\n checked={acknowledged}\n setToggle={setAcknowledged}\n />\n </div>\n <div className=\"mt-7 flex items-center justify-between gap-2\">\n <CancelButton\n isLoading={isPending}\n onClick={onConfirmCancel}\n disabled={!acknowledged || isPending || isSuccess}\n variant={isPending || isSuccess ? \"cta\" : \"default\"}\n >\n {isPending ? \"Cancelling Your Order\" : \"Confirm\"}\n </CancelButton>\n </div>\n </div>\n );\n};\n\nexport type ConfirmCancelOrderStep =\n | \"order-cancellation-pre-confirm\"\n | CancelOrderStepKey;\n\ntype ConfirmCancelOrderProps = {\n orderTypeToCancel: OrderTypeToCancel;\n onConfirmCancel: () => void;\n isCancelling: boolean;\n step?: ConfirmCancelOrderStep;\n};\n\nexport const ConfirmCancelOrder = ({\n orderTypeToCancel,\n onConfirmCancel,\n isCancelling,\n step = \"order-cancellation-pre-confirm\",\n}: ConfirmCancelOrderProps) => {\n return (\n <div className=\"p-6 flex flex-col gap-7\">\n <CancelOrderWarning orderTypeToCancel={orderTypeToCancel} />\n <CancelOrderControls\n onConfirmCancel={onConfirmCancel}\n isCancelling={isCancelling}\n step={step}\n />\n </div>\n );\n};\n"],"names":["warningClasses","root","TxNonceWarning","CancelOrderWarning","t0","$","_c","orderTypeToCancel","warningTitle","warningMessage","CancelOrderTexts","t1","Symbol","for","t2","t3","t4","t5","progressStep2Text","CancelOrderToggleAndStep","step","checked","setToggle","SwitchComponent","labelId","useId","text","cn","undefined","CancelOrderControls","onConfirmCancel","isCancelling","acknowledged","setAcknowledged","useState","isPending","isSuccess","t6","ConfirmCancelOrder"],"mappings":";;;;;;;;;AASA,MAAMA,cAAAA,GAA0C;AAAA,EAC9CC,IAAAA,EAAM;AACR,CAAA;AAMA,MAAMC,cAAAA,GACJ,6JAAA;AAEF,MAAMC,qBAAqBC,CAAAA,EAAAA,KAAA;AAAA,EAAA,MAAAC,CAAAA,GAAAC,cAAA,EAAA,CAAA;AAAC,EAAA,MAAA;AAAA,IAAAC;AAAAA,GAAA,GAAAH,EAAAA;AAC1B,EAAA,MAAA;AAAA,IAAAI,YAAAA;AAAAA,IAAAC;AAAAA,GAAA,GAAyCC,iBAAiBH,iBAAiB,CAAA;AAAE,EAAA,IAAAI,EAAAA;AAAA,EAAA,IAAAN,EAAA,CAAA,CAAA,KAAAO,MAAAA,CAAAC,GAAAA,CAAA,2BAAA,CAAA,EAAA;AAOrEF,IAAAA,EAAAA,mBAAA,GAAA,CAAA,SAAK,QAAA,EAAA,sKAAA,EAIL,CAAA;AAAMN,IAAAA,CAAAA,MAAAM,EAAAA;AAAAA,EAAA,CAAA,MAAA;AAAAA,IAAAA,EAAAA,GAAAN,EAAA,CAAA,CAAA;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AAA,EACkBe,eAAAA,EACHC,YAAAA,EACRX,IAAAA,EAAI,CAAA;AACVf,IAAAA,CAAAA,MAAA0B,YAAAA;AAAA1B,IAAAA,CAAAA,MAAAyB,eAAAA;AAAAzB,IAAAA,CAAAA,MAAAe,IAAAA;AAAAf,IAAAA,CAAAA,MAAAU,EAAAA;AAAAA,EAAA,CAAA,MAAA;AAAAA,IAAAA,EAAAA,GAAAV,EAAA,CAAA,CAAA;AAAA,EAAA;AAAA,EAAA,IAAAW,EAAAA;AAAA,EAAA,IAAAX,EAAA,CAAA,CAAA,KAAAS,MAAAT,CAAAA,QAAAU,EAAAA,EAAA;AANJC,IAAAA,EAAAA,mBAAA,IAAA,CAAA,KAAA,EAAA,EAAe,SAAA,EAAA,yBAAA,EACbF,QAAAA,EAAAA;AAAAA,MAAAA,EAAAA;AAAAA,MACAC;AAAAA,KAAAA,EAKF,CAAA;AAAMV,IAAAA,CAAAA,MAAAS,EAAAA;AAAAT,IAAAA,CAAAA,MAAAU,EAAAA;AAAAV,IAAAA,CAAAA,MAAAW,EAAAA;AAAAA,EAAA,CAAA,MAAA;AAAAA,IAAAA,EAAAA,GAAAX,EAAA,CAAA,CAAA;AAAA,EAAA;AAAA,EAAA,OAPNW,EAAAA;AAOM;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type OrderTypeToCancel = "Market Swap" | "Delta Swap" | "Delta Limit";
|
|
2
|
+
export type CancelOrderText = {
|
|
3
|
+
drawerTitle: string;
|
|
4
|
+
warningTitle: React.ReactNode;
|
|
5
|
+
warningMessage: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare const CancelOrderTexts: Record<OrderTypeToCancel, CancelOrderText>;
|
|
8
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/components/widget/TradeOverview/CancelOrder/constants.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,YAAY,GAAG,aAAa,CAAC;AAC7E,MAAM,MAAM,eAAe,GAAG;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,iBAAiB,EAAE,eAAe,CAkBvE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const CancelOrderTexts = {
|
|
2
|
+
"Market Swap": {
|
|
3
|
+
drawerTitle: "Cancel Market Order",
|
|
4
|
+
warningTitle: "You are about to cancel a Market Swap Order",
|
|
5
|
+
warningMessage: null
|
|
6
|
+
},
|
|
7
|
+
"Delta Swap": {
|
|
8
|
+
drawerTitle: "Cancel Delta Order",
|
|
9
|
+
warningTitle: "You are about to cancel a Delta Swap Order",
|
|
10
|
+
warningMessage: "Delta Orders use intent-based execution. After you submit your trade intent, the protocol routes it across a large mempool of liquidity sources and execution agents."
|
|
11
|
+
},
|
|
12
|
+
"Delta Limit": {
|
|
13
|
+
drawerTitle: "Cancel Delta Order",
|
|
14
|
+
warningTitle: "You are about to cancel a Delta Limit Order",
|
|
15
|
+
warningMessage: "Delta Limit Orders use intent-based execution. After you submit your trade, the protocol routes it across a large mempool of liquidity sources and execution agents."
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { CancelOrderTexts };
|
|
20
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../../src/components/widget/TradeOverview/CancelOrder/constants.ts"],"sourcesContent":["export type OrderTypeToCancel = \"Market Swap\" | \"Delta Swap\" | \"Delta Limit\";\nexport type CancelOrderText = {\n drawerTitle: string;\n warningTitle: React.ReactNode;\n warningMessage: React.ReactNode;\n};\n\nexport const CancelOrderTexts: Record<OrderTypeToCancel, CancelOrderText> = {\n \"Market Swap\": {\n drawerTitle: \"Cancel Market Order\",\n warningTitle: \"You are about to cancel a Market Swap Order\",\n warningMessage: null,\n },\n \"Delta Swap\": {\n drawerTitle: \"Cancel Delta Order\",\n warningTitle: \"You are about to cancel a Delta Swap Order\",\n warningMessage:\n \"Delta Orders use intent-based execution. After you submit your trade intent, the protocol routes it across a large mempool of liquidity sources and execution agents.\",\n },\n \"Delta Limit\": {\n drawerTitle: \"Cancel Delta Order\",\n warningTitle: \"You are about to cancel a Delta Limit Order\",\n warningMessage:\n \"Delta Limit Orders use intent-based execution. After you submit your trade, the protocol routes it across a large mempool of liquidity sources and execution agents.\",\n },\n};\n"],"names":["CancelOrderTexts","drawerTitle","warningTitle","warningMessage"],"mappings":"AAOO,MAAMA,gBAAAA,GAA+D;AAAA,EAC1E,aAAA,EAAe;AAAA,IACbC,WAAAA,EAAa,qBAAA;AAAA,IACbC,YAAAA,EAAc,6CAAA;AAAA,IACdC,cAAAA,EAAgB;AAAA,GAClB;AAAA,EACA,YAAA,EAAc;AAAA,IACZF,WAAAA,EAAa,oBAAA;AAAA,IACbC,YAAAA,EAAc,4CAAA;AAAA,IACdC,cAAAA,EACE;AAAA,GACJ;AAAA,EACA,aAAA,EAAe;AAAA,IACbF,WAAAA,EAAa,oBAAA;AAAA,IACbC,YAAAA,EAAc,6CAAA;AAAA,IACdC,cAAAA,EACE;AAAA;AAEN;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TradeFlowType } from '../../../../hooks/swap/tradeFlow/common/types';
|
|
2
|
+
import { OrderItem } from '../../AppHeader/Activities/utils';
|
|
3
|
+
import { CancelOrderText, OrderTypeToCancel } from './constants';
|
|
4
|
+
export declare function getOrderCancelDetailsForOrderItem(orderItem: OrderItem): {
|
|
5
|
+
orderType: OrderTypeToCancel;
|
|
6
|
+
cancelTexts: CancelOrderText;
|
|
7
|
+
} | null;
|
|
8
|
+
export declare function getOrderCancelDetailsForTradeFlowType(tradeFlowType: TradeFlowType): {
|
|
9
|
+
orderType: OrderTypeToCancel;
|
|
10
|
+
cancelTexts: CancelOrderText;
|
|
11
|
+
} | null;
|
|
12
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/widget/TradeOverview/CancelOrder/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACvB,MAAM,aAAa,CAAC;AA4BrB,wBAAgB,iCAAiC,CAC/C,SAAS,EAAE,SAAS,GACnB;IAAE,SAAS,EAAE,iBAAiB,CAAC;IAAC,WAAW,EAAE,eAAe,CAAA;CAAE,GAAG,IAAI,CAOvE;AAiBD,wBAAgB,qCAAqC,CACnD,aAAa,EAAE,aAAa,GAC3B;IAAE,SAAS,EAAE,iBAAiB,CAAC;IAAC,WAAW,EAAE,eAAe,CAAA;CAAE,GAAG,IAAI,CAOvE"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { isOtcOrderItem, isLimitOrderItem, isTransactionListItem } from '../../AppHeader/Activities/utils.js';
|
|
2
|
+
import { CancelOrderTexts } from './constants.js';
|
|
3
|
+
|
|
4
|
+
function getCancelOrderTexts(orderType) {
|
|
5
|
+
return CancelOrderTexts[orderType];
|
|
6
|
+
}
|
|
7
|
+
function getOrderTypeToCancelFromOrderItem(orderItem) {
|
|
8
|
+
if (isOtcOrderItem(orderItem)) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
if (isLimitOrderItem(orderItem)) {
|
|
12
|
+
return orderItem.type === "LIMIT" ? "Delta Limit" : "Delta Swap";
|
|
13
|
+
}
|
|
14
|
+
if (isTransactionListItem(orderItem) && orderItem.action === "swap") {
|
|
15
|
+
return "Market Swap";
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
function getOrderCancelDetailsForOrderItem(orderItem) {
|
|
20
|
+
const orderType = getOrderTypeToCancelFromOrderItem(orderItem);
|
|
21
|
+
if (orderType === null) return null;
|
|
22
|
+
return {
|
|
23
|
+
orderType,
|
|
24
|
+
cancelTexts: getCancelOrderTexts(orderType)
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function getOrderTypeToCancelFromTradeFlowType(tradeFlowType) {
|
|
28
|
+
if (tradeFlowType === "deltaOrder") {
|
|
29
|
+
return "Delta Swap";
|
|
30
|
+
}
|
|
31
|
+
if (tradeFlowType === "limitOrder") {
|
|
32
|
+
return "Delta Limit";
|
|
33
|
+
}
|
|
34
|
+
if (tradeFlowType === "marketSwap") {
|
|
35
|
+
return "Market Swap";
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
function getOrderCancelDetailsForTradeFlowType(tradeFlowType) {
|
|
40
|
+
const orderType = getOrderTypeToCancelFromTradeFlowType(tradeFlowType);
|
|
41
|
+
if (orderType === null) return null;
|
|
42
|
+
return {
|
|
43
|
+
orderType,
|
|
44
|
+
cancelTexts: getCancelOrderTexts(orderType)
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { getOrderCancelDetailsForOrderItem, getOrderCancelDetailsForTradeFlowType };
|
|
49
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../../src/components/widget/TradeOverview/CancelOrder/utils.ts"],"sourcesContent":["import type { TradeFlowType } from \"@/hooks/swap/tradeFlow/common/types\";\nimport {\n isLimitOrderItem,\n isOtcOrderItem,\n isTransactionListItem,\n type OrderItem,\n} from \"../../AppHeader/Activities/utils\";\nimport {\n CancelOrderTexts,\n type CancelOrderText,\n type OrderTypeToCancel,\n} from \"./constants\";\n\nfunction getCancelOrderTexts(orderType: OrderTypeToCancel): CancelOrderText {\n return CancelOrderTexts[orderType];\n}\n\n/**\n * Derives the cancel order type from an OrderItem:\n * - Delta limit (itemType \"limit-order\" with type \"LIMIT\") → \"Delta Limit\"\n * - Delta swap (itemType \"limit-order\" with type \"MARKET\") → \"Delta Swap\"\n * - Market swap (itemType \"transaction\" with action \"swap\") → \"Market Swap\"\n * Returns null for OTC orders (no cancel flow in this context).\n */\nfunction getOrderTypeToCancelFromOrderItem(\n orderItem: OrderItem\n): OrderTypeToCancel | null {\n if (isOtcOrderItem(orderItem)) {\n return null;\n }\n if (isLimitOrderItem(orderItem)) {\n return orderItem.type === \"LIMIT\" ? \"Delta Limit\" : \"Delta Swap\";\n }\n if (isTransactionListItem(orderItem) && orderItem.action === \"swap\") {\n return \"Market Swap\";\n }\n return null;\n}\n\nexport function getOrderCancelDetailsForOrderItem(\n orderItem: OrderItem\n): { orderType: OrderTypeToCancel; cancelTexts: CancelOrderText } | null {\n const orderType = getOrderTypeToCancelFromOrderItem(orderItem);\n if (orderType === null) return null;\n return {\n orderType,\n cancelTexts: getCancelOrderTexts(orderType),\n };\n}\n\nfunction getOrderTypeToCancelFromTradeFlowType(\n tradeFlowType: TradeFlowType\n): OrderTypeToCancel | null {\n if (tradeFlowType === \"deltaOrder\") {\n return \"Delta Swap\";\n }\n if (tradeFlowType === \"limitOrder\") {\n return \"Delta Limit\";\n }\n if (tradeFlowType === \"marketSwap\") {\n return \"Market Swap\";\n }\n return null;\n}\n\nexport function getOrderCancelDetailsForTradeFlowType(\n tradeFlowType: TradeFlowType\n): { orderType: OrderTypeToCancel; cancelTexts: CancelOrderText } | null {\n const orderType = getOrderTypeToCancelFromTradeFlowType(tradeFlowType);\n if (orderType === null) return null;\n return {\n orderType,\n cancelTexts: getCancelOrderTexts(orderType),\n };\n}\n"],"names":["getCancelOrderTexts","orderType","CancelOrderTexts","getOrderTypeToCancelFromOrderItem","orderItem","isOtcOrderItem","isLimitOrderItem","type","isTransactionListItem","action","getOrderCancelDetailsForOrderItem","cancelTexts","getOrderTypeToCancelFromTradeFlowType","tradeFlowType","getOrderCancelDetailsForTradeFlowType"],"mappings":";;;AAaA,SAASA,oBAAoBC,SAAAA,EAA+C;AAC1E,EAAA,OAAOC,iBAAiBD,SAAS,CAAA;AACnC;AASA,SAASE,kCACPC,SAAAA,EAC0B;AAC1B,EAAA,IAAIC,cAAAA,CAAeD,SAAS,CAAA,EAAG;AAC7B,IAAA,OAAO,IAAA;AAAA,EACT;AACA,EAAA,IAAIE,gBAAAA,CAAiBF,SAAS,CAAA,EAAG;AAC/B,IAAA,OAAOA,SAAAA,CAAUG,IAAAA,KAAS,OAAA,GAAU,aAAA,GAAgB,YAAA;AAAA,EACtD;AACA,EAAA,IAAIC,qBAAAA,CAAsBJ,SAAS,CAAA,IAAKA,SAAAA,CAAUK,WAAW,MAAA,EAAQ;AACnE,IAAA,OAAO,aAAA;AAAA,EACT;AACA,EAAA,OAAO,IAAA;AACT;AAEO,SAASC,kCACdN,SAAAA,EACuE;AACvE,EAAA,MAAMH,SAAAA,GAAYE,kCAAkCC,SAAS,CAAA;AAC7D,EAAA,IAAIH,SAAAA,KAAc,MAAM,OAAO,IAAA;AAC/B,EAAA,OAAO;AAAA,IACLA,SAAAA;AAAAA,IACAU,WAAAA,EAAaX,oBAAoBC,SAAS;AAAA,GAC5C;AACF;AAEA,SAASW,sCACPC,aAAAA,EAC0B;AAC1B,EAAA,IAAIA,kBAAkB,YAAA,EAAc;AAClC,IAAA,OAAO,YAAA;AAAA,EACT;AACA,EAAA,IAAIA,kBAAkB,YAAA,EAAc;AAClC,IAAA,OAAO,aAAA;AAAA,EACT;AACA,EAAA,IAAIA,kBAAkB,YAAA,EAAc;AAClC,IAAA,OAAO,aAAA;AAAA,EACT;AACA,EAAA,OAAO,IAAA;AACT;AAEO,SAASC,sCACdD,aAAAA,EACuE;AACvE,EAAA,MAAMZ,SAAAA,GAAYW,sCAAsCC,aAAa,CAAA;AACrE,EAAA,IAAIZ,SAAAA,KAAc,MAAM,OAAO,IAAA;AAC/B,EAAA,OAAO;AAAA,IACLA,SAAAA;AAAAA,IACAU,WAAAA,EAAaX,oBAAoBC,SAAS;AAAA,GAC5C;AACF;;;;"}
|
|
@@ -4,8 +4,8 @@ import { MinTradeOverviewProps, TradeOverviewProps } from './TradeOverview';
|
|
|
4
4
|
import { MarketSwapFlowType } from '../../../hooks/swap/tradeFlow/common/types';
|
|
5
5
|
import { OptimalRate } from '@velora-dex/sdk';
|
|
6
6
|
export type { FlowStep } from './Step/types';
|
|
7
|
-
type MarketSwapTradeOverviewProps = Pick<TradeOverviewProps<MarketSwapStepKey, SubmitSwapResult, MarketSwapFlowType>, "fromToken" | "toToken" | "fromAmount" | "toAmount" | "onDismiss" | "onHelp" | "onCancelFlow" | "onResubmit" | "onRestartFlow" | "isFlowCancellable" | "explorerLink" | "activeStep" | "result" | "error" | "erroredStep" | "tradeFlowType" | "swapSide">;
|
|
8
|
-
export declare function MarketSwapTradeOverview({ fromToken, toToken, fromAmount, toAmount, swapSide, onDismiss, onHelp, onCancelFlow, onResubmit, onRestartFlow, activeStep, isFlowCancellable, explorerLink, result, error, erroredStep, tradeFlowType, }: MarketSwapTradeOverviewProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
type MarketSwapTradeOverviewProps = Pick<TradeOverviewProps<MarketSwapStepKey, SubmitSwapResult, MarketSwapFlowType>, "fromToken" | "toToken" | "fromAmount" | "toAmount" | "onDismiss" | "onHelp" | "onCancelFlow" | "onResubmit" | "onRestartFlow" | "isFlowCancellable" | "explorerLink" | "activeStep" | "result" | "error" | "erroredStep" | "tradeFlowType" | "swapSide" | "onCancelOrder" | "orderCancellationStep">;
|
|
8
|
+
export declare function MarketSwapTradeOverview({ fromToken, toToken, fromAmount, toAmount, swapSide, onDismiss, onHelp, onCancelFlow, onResubmit, onRestartFlow, activeStep, isFlowCancellable, explorerLink, result, error, erroredStep, tradeFlowType, onCancelOrder, orderCancellationStep, }: MarketSwapTradeOverviewProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export type MarketSwapTradeOverviewFlowProps = {
|
|
10
10
|
marketPrice: OptimalRate;
|
|
11
11
|
orderProps: MinTradeOverviewProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarketSwapTradeOverview.d.ts","sourceRoot":"","sources":["../../../../src/components/widget/TradeOverview/MarketSwapTradeOverview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAmB,KAAK,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAKnD,YAAY,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,KAAK,4BAA4B,GAAG,IAAI,CACtC,kBAAkB,CAAC,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,EACzE,WAAW,GACX,SAAS,GACT,YAAY,GACZ,UAAU,GACV,WAAW,GACX,QAAQ,GACR,cAAc,GACd,YAAY,GACZ,eAAe,GACf,mBAAmB,GACnB,cAAc,GACd,YAAY,GACZ,QAAQ,GACR,OAAO,GACP,aAAa,GACb,eAAe,GACf,UAAU,
|
|
1
|
+
{"version":3,"file":"MarketSwapTradeOverview.d.ts","sourceRoot":"","sources":["../../../../src/components/widget/TradeOverview/MarketSwapTradeOverview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAmB,KAAK,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAKnD,YAAY,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,KAAK,4BAA4B,GAAG,IAAI,CACtC,kBAAkB,CAAC,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,EACzE,WAAW,GACX,SAAS,GACT,YAAY,GACZ,UAAU,GACV,WAAW,GACX,QAAQ,GACR,cAAc,GACd,YAAY,GACZ,eAAe,GACf,mBAAmB,GACnB,cAAc,GACd,YAAY,GACZ,QAAQ,GACR,OAAO,GACP,aAAa,GACb,eAAe,GACf,UAAU,GACV,eAAe,GACf,uBAAuB,CAC1B,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,EACtC,SAAS,EACT,OAAO,EACP,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,MAAM,EACN,YAAY,EACZ,UAAU,EACV,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,MAAM,EACN,KAAK,EACL,WAAW,EACX,aAAa,EACb,aAAa,EACb,qBAAqB,GACtB,EAAE,4BAA4B,2CAyB9B;AAED,MAAM,MAAM,gCAAgC,GAAG;IAC7C,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,qBAAqB,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAwGF,eAAO,MAAM,6BAA6B,GACxC,OAAO,gCAAgC,4CAIxC,CAAC"}
|
|
@@ -9,7 +9,7 @@ import { useSwapAmountsWithSlippage } from './utils/useSwapAmountsWithSlippage.j
|
|
|
9
9
|
import { useRunOnMount } from '../../../core/screen/hooks/useRunOnMount.js';
|
|
10
10
|
|
|
11
11
|
function MarketSwapTradeOverview(t0) {
|
|
12
|
-
const $ = distExports.c(
|
|
12
|
+
const $ = distExports.c(20);
|
|
13
13
|
const {
|
|
14
14
|
fromToken,
|
|
15
15
|
toToken,
|
|
@@ -27,11 +27,13 @@ function MarketSwapTradeOverview(t0) {
|
|
|
27
27
|
result,
|
|
28
28
|
error,
|
|
29
29
|
erroredStep,
|
|
30
|
-
tradeFlowType
|
|
30
|
+
tradeFlowType,
|
|
31
|
+
onCancelOrder,
|
|
32
|
+
orderCancellationStep
|
|
31
33
|
} = t0;
|
|
32
34
|
let t1;
|
|
33
|
-
if ($[0] !== activeStep || $[1] !== error || $[2] !== erroredStep || $[3] !== explorerLink || $[4] !== fromAmount || $[5] !== fromToken || $[6] !== isFlowCancellable || $[7] !== onCancelFlow || $[8] !==
|
|
34
|
-
t1 = /* @__PURE__ */ jsx(TradeOverview, { fromToken, toToken, fromAmount, toAmount, swapSide, steps: MarketSwapSteps, activeStep, onDismiss, onHelp, onCancelFlow, onResubmit, onRestartFlow, isFlowCancellable, explorerLink, result, error, erroredStep, tradeFlowType });
|
|
35
|
+
if ($[0] !== activeStep || $[1] !== error || $[2] !== erroredStep || $[3] !== explorerLink || $[4] !== fromAmount || $[5] !== fromToken || $[6] !== isFlowCancellable || $[7] !== onCancelFlow || $[8] !== onCancelOrder || $[9] !== onDismiss || $[10] !== onHelp || $[11] !== onRestartFlow || $[12] !== onResubmit || $[13] !== orderCancellationStep || $[14] !== result || $[15] !== swapSide || $[16] !== toAmount || $[17] !== toToken || $[18] !== tradeFlowType) {
|
|
36
|
+
t1 = /* @__PURE__ */ jsx(TradeOverview, { fromToken, toToken, fromAmount, toAmount, swapSide, steps: MarketSwapSteps, activeStep, onDismiss, onHelp, onCancelFlow, onResubmit, onRestartFlow, isFlowCancellable, explorerLink, result, error, erroredStep, tradeFlowType, onCancelOrder, orderCancellationStep });
|
|
35
37
|
$[0] = activeStep;
|
|
36
38
|
$[1] = error;
|
|
37
39
|
$[2] = erroredStep;
|
|
@@ -40,23 +42,25 @@ function MarketSwapTradeOverview(t0) {
|
|
|
40
42
|
$[5] = fromToken;
|
|
41
43
|
$[6] = isFlowCancellable;
|
|
42
44
|
$[7] = onCancelFlow;
|
|
43
|
-
$[8] =
|
|
44
|
-
$[9] =
|
|
45
|
-
$[10] =
|
|
46
|
-
$[11] =
|
|
47
|
-
$[12] =
|
|
48
|
-
$[13] =
|
|
49
|
-
$[14] =
|
|
50
|
-
$[15] =
|
|
51
|
-
$[16] =
|
|
52
|
-
$[17] =
|
|
45
|
+
$[8] = onCancelOrder;
|
|
46
|
+
$[9] = onDismiss;
|
|
47
|
+
$[10] = onHelp;
|
|
48
|
+
$[11] = onRestartFlow;
|
|
49
|
+
$[12] = onResubmit;
|
|
50
|
+
$[13] = orderCancellationStep;
|
|
51
|
+
$[14] = result;
|
|
52
|
+
$[15] = swapSide;
|
|
53
|
+
$[16] = toAmount;
|
|
54
|
+
$[17] = toToken;
|
|
55
|
+
$[18] = tradeFlowType;
|
|
56
|
+
$[19] = t1;
|
|
53
57
|
} else {
|
|
54
|
-
t1 = $[
|
|
58
|
+
t1 = $[19];
|
|
55
59
|
}
|
|
56
60
|
return t1;
|
|
57
61
|
}
|
|
58
62
|
function MarketSwapTradeOverviewFlow(t0) {
|
|
59
|
-
const $ = distExports.c(
|
|
63
|
+
const $ = distExports.c(42);
|
|
60
64
|
const {
|
|
61
65
|
orderProps,
|
|
62
66
|
marketPrice,
|
|
@@ -87,7 +91,10 @@ function MarketSwapTradeOverviewFlow(t0) {
|
|
|
87
91
|
submittedSwapRequest,
|
|
88
92
|
error,
|
|
89
93
|
erroredStep,
|
|
90
|
-
tradeFlowType
|
|
94
|
+
tradeFlowType,
|
|
95
|
+
isSwapTxCancellable,
|
|
96
|
+
swapTxCancellationStep,
|
|
97
|
+
cancelSwapTx
|
|
91
98
|
} = useMarketSwapStep(t1);
|
|
92
99
|
let t2;
|
|
93
100
|
if ($[2] !== isNonFlowStep || $[3] !== startMarketSwap) {
|
|
@@ -180,9 +187,10 @@ function MarketSwapTradeOverviewFlow(t0) {
|
|
|
180
187
|
t7 = $[22];
|
|
181
188
|
}
|
|
182
189
|
const onDismiss = t7;
|
|
190
|
+
const onCancelOrder = isSwapTxCancellable ? cancelSwapTx : void 0;
|
|
183
191
|
let t8;
|
|
184
|
-
if ($[23] !== amountsAndSide.destAmount || $[24] !== amountsAndSide.srcAmount || $[25] !== amountsAndSide.swapSide || $[26] !== cancelFlow || $[27] !== error || $[28] !== erroredStep || $[29] !== explorerLink || $[30] !== goToBeforeSwap || $[31] !== isFlowCancellable || $[32] !==
|
|
185
|
-
t8 = /* @__PURE__ */ jsx(MarketSwapTradeOverview, { fromToken: orderProps.fromToken, toToken: orderProps.toToken, fromAmount: amountsAndSide.srcAmount, toAmount: amountsAndSide.destAmount, swapSide: amountsAndSide.swapSide, onDismiss, onCancelFlow: cancelFlow, onResubmit: goToBeforeSwap, onRestartFlow: retryFlow, activeStep: step, isFlowCancellable, explorerLink, result, error, erroredStep, tradeFlowType });
|
|
192
|
+
if ($[23] !== amountsAndSide.destAmount || $[24] !== amountsAndSide.srcAmount || $[25] !== amountsAndSide.swapSide || $[26] !== cancelFlow || $[27] !== error || $[28] !== erroredStep || $[29] !== explorerLink || $[30] !== goToBeforeSwap || $[31] !== isFlowCancellable || $[32] !== onCancelOrder || $[33] !== onDismiss || $[34] !== orderProps.fromToken || $[35] !== orderProps.toToken || $[36] !== result || $[37] !== retryFlow || $[38] !== step || $[39] !== swapTxCancellationStep || $[40] !== tradeFlowType) {
|
|
193
|
+
t8 = /* @__PURE__ */ jsx(MarketSwapTradeOverview, { fromToken: orderProps.fromToken, toToken: orderProps.toToken, fromAmount: amountsAndSide.srcAmount, toAmount: amountsAndSide.destAmount, swapSide: amountsAndSide.swapSide, onDismiss, onCancelFlow: cancelFlow, onResubmit: goToBeforeSwap, onRestartFlow: retryFlow, onCancelOrder, orderCancellationStep: swapTxCancellationStep, activeStep: step, isFlowCancellable, explorerLink, result, error, erroredStep, tradeFlowType });
|
|
186
194
|
$[23] = amountsAndSide.destAmount;
|
|
187
195
|
$[24] = amountsAndSide.srcAmount;
|
|
188
196
|
$[25] = amountsAndSide.swapSide;
|
|
@@ -192,16 +200,18 @@ function MarketSwapTradeOverviewFlow(t0) {
|
|
|
192
200
|
$[29] = explorerLink;
|
|
193
201
|
$[30] = goToBeforeSwap;
|
|
194
202
|
$[31] = isFlowCancellable;
|
|
195
|
-
$[32] =
|
|
196
|
-
$[33] =
|
|
197
|
-
$[34] = orderProps.
|
|
198
|
-
$[35] =
|
|
199
|
-
$[36] =
|
|
200
|
-
$[37] =
|
|
201
|
-
$[38] =
|
|
202
|
-
$[39] =
|
|
203
|
+
$[32] = onCancelOrder;
|
|
204
|
+
$[33] = onDismiss;
|
|
205
|
+
$[34] = orderProps.fromToken;
|
|
206
|
+
$[35] = orderProps.toToken;
|
|
207
|
+
$[36] = result;
|
|
208
|
+
$[37] = retryFlow;
|
|
209
|
+
$[38] = step;
|
|
210
|
+
$[39] = swapTxCancellationStep;
|
|
211
|
+
$[40] = tradeFlowType;
|
|
212
|
+
$[41] = t8;
|
|
203
213
|
} else {
|
|
204
|
-
t8 = $[
|
|
214
|
+
t8 = $[41];
|
|
205
215
|
}
|
|
206
216
|
return t8;
|
|
207
217
|
}
|