@dodoex/widgets 3.18.0 → 3.19.0-mint.2
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/LICENSE +674 -674
- package/README.md +70 -70
- package/dist/{34acf2e58b457195.svg → 28442382d977858a.svg} +9 -9
- package/dist/{219f8611c6c9e6e2.svg → 8de9a184d4ef0a11.svg} +6 -6
- package/dist/{44df077bd19df476.svg → b3f16b2626f03378.svg} +10 -10
- package/dist/cjs/locales/en-US.js +1 -1
- package/dist/cjs/locales/zh-CN.js +1 -1
- package/dist/{5c5d298f247819e1.svg → ed726d76d93d4899.svg} +10 -10
- package/dist/helper-CV5XZBS1.cjs +1 -0
- package/dist/helper-D3kq2qeV.js +1 -0
- package/dist/index-BzHqobnS.js +78 -0
- package/dist/index-CV2VWaQU.js +14 -0
- package/dist/index-CVTOL4CN.cjs +78 -0
- package/dist/index-CaHGdR5D.cjs +12 -0
- package/dist/index-CrNMhgS-.js +12 -0
- package/dist/index-EAur28N8.cjs +14 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/types/components/AddTokenToMetamask.d.ts +1 -1
- package/dist/types/components/AddressWithLinkAndCopy.d.ts +1 -1
- package/dist/types/components/AutoButton.d.ts +1 -1
- package/dist/types/components/Bridge/BridgeRouteShortCard.d.ts +1 -2
- package/dist/types/components/Bridge/BridgeSummaryDialog/BridgeSummaryDetail.d.ts +1 -1
- package/dist/types/components/Bridge/BridgeSummaryDialog/index.d.ts +1 -1
- package/dist/types/components/Bridge/BridgeSummaryDialog/orderInfoModal/CrossStep.d.ts +1 -1
- package/dist/types/components/Bridge/BridgeSummaryDialog/orderInfoModal/EtherscanLinkButton.d.ts +1 -1
- package/dist/types/components/Bridge/BridgeSummaryDialog/orderInfoModal/RouteSteps.d.ts +1 -1
- package/dist/types/components/Bridge/BridgeSummaryDialog/orderInfoModal/SwapStep.d.ts +1 -1
- package/dist/types/components/Bridge/SelectBridgeDialog/BridgeLogo.d.ts +1 -1
- package/dist/types/components/Bridge/SelectBridgeDialog/DirectionLine.d.ts +1 -1
- package/dist/types/components/Bridge/SelectBridgeDialog/RouteCard.d.ts +1 -1
- package/dist/types/components/Bridge/SelectBridgeDialog/RouteTagList.d.ts +1 -1
- package/dist/types/components/Bridge/SelectBridgeDialog/TokenWithChain.d.ts +1 -1
- package/dist/types/components/Bridge/SelectBridgeDialog/index.d.ts +1 -1
- package/dist/types/components/CardWidgets.d.ts +8 -8
- package/dist/types/components/Confirm.d.ts +1 -1
- package/dist/types/components/ConnectWallet/ConnectWalletDialog.d.ts +1 -1
- package/dist/types/components/ConnectWallet/NeedConnectButton.d.ts +1 -2
- package/dist/types/components/ConnectWallet/OpenConnectWalletInfo.d.ts +1 -2
- package/dist/types/components/CopyTooltipToast.d.ts +1 -1
- package/dist/types/components/DataCard/DataCardGroup.d.ts +1 -1
- package/dist/types/components/ErrorMessageDialog.d.ts +1 -1
- package/dist/types/components/GoBack.d.ts +1 -1
- package/dist/types/components/HowItWorks.d.ts +1 -1
- package/dist/types/components/LiquidityLpPartnerReward.d.ts +1 -1
- package/dist/types/components/List/EmptyList.d.ts +2 -2
- package/dist/types/components/List/FailedList.d.ts +1 -1
- package/dist/types/components/LoadMore.d.ts +1 -1
- package/dist/types/components/LoadingRotation.d.ts +1 -1
- package/dist/types/components/Message/Countdown.d.ts +1 -1
- package/dist/types/components/RiskDialog.d.ts +1 -1
- package/dist/types/components/Select.d.ts +1 -1
- package/dist/types/components/SelectChain.d.ts +1 -2
- package/dist/types/components/SpaceBetweenItem.d.ts +1 -1
- package/dist/types/components/SubmittedDialog.d.ts +1 -2
- package/dist/types/components/Swap/SwapOrderHistory/PriceWithToggle.d.ts +1 -1
- package/dist/types/components/Swap/SwapOrderHistory/RoutingCard.d.ts +1 -2
- package/dist/types/components/Swap/SwapOrderHistory/RoutingVision.d.ts +5 -6
- package/dist/types/components/Swap/SwapOrderHistory/SameOrderCard.d.ts +1 -2
- package/dist/types/components/Swap/SwapOrderHistory/index.d.ts +1 -2
- package/dist/types/components/Swap/components/ConnectWallet/index.d.ts +1 -1
- package/dist/types/components/Swap/components/Dialog.d.ts +1 -1
- package/dist/types/components/Swap/components/ReviewDialog.d.ts +1 -1
- package/dist/types/components/Swap/components/SettingsDialog/NumberInput.d.ts +1 -1
- package/dist/types/components/Swap/components/SettingsDialog/index.d.ts +1 -1
- package/dist/types/components/Swap/components/SwapPreviewInfoCard.d.ts +1 -1
- package/dist/types/components/Swap/components/SwapSettingsDialog/MoreTradeSetting.d.ts +1 -1
- package/dist/types/components/Swap/components/SwapSettingsDialog/SlippageCurveChart/CurveChart.d.ts +1 -1
- package/dist/types/components/Swap/components/SwapSettingsDialog/SlippageCurveChart/SlippageSlider.d.ts +1 -1
- package/dist/types/components/Swap/components/SwapSettingsDialog/SlippageCurveChart/index.d.ts +1 -1
- package/dist/types/components/Swap/components/SwapSettingsDialog/SlippageSetting.d.ts +1 -2
- package/dist/types/components/Swap/components/SwapSettingsDialog/SlippageWarning.d.ts +1 -1
- package/dist/types/components/Swap/components/SwapSettingsDialog/index.d.ts +1 -2
- package/dist/types/components/Swap/components/SwitchBox.d.ts +1 -1
- package/dist/types/components/Swap/components/TokenCard/BalanceText.d.ts +1 -1
- package/dist/types/components/Swap/components/TokenCard/PercentageSelectButtonGroup.d.ts +1 -1
- package/dist/types/components/Swap/components/TokenCard/TokenLogoCollapse.d.ts +1 -1
- package/dist/types/components/Swap/components/TokenCard/TokenPickerDialog.d.ts +1 -1
- package/dist/types/components/Swap/components/TokenCard/index.d.ts +3 -3
- package/dist/types/components/Swap/components/TokenPairPriceWithToggle.d.ts +1 -1
- package/dist/types/components/Swap/index.d.ts +1 -1
- package/dist/types/components/SwitchChainDialog/index.d.ts +1 -1
- package/dist/types/components/Table.d.ts +1 -1
- package/dist/types/components/TextSwitch.d.ts +1 -1
- package/dist/types/components/Token/TokenItem.d.ts +1 -1
- package/dist/types/components/TokenLogoPair.d.ts +1 -1
- package/dist/types/components/TokenLogoSimple.d.ts +1 -2
- package/dist/types/components/TokenPairStatusButton.d.ts +1 -1
- package/dist/types/components/TokenPicker/ImportToken.d.ts +1 -2
- package/dist/types/components/TokenPicker/PopularToken.d.ts +1 -1
- package/dist/types/components/TokenPicker/SelectChainItem.d.ts +1 -1
- package/dist/types/components/TokenPicker/TokenDetailInfo.d.ts +1 -2
- package/dist/types/components/TokenPicker/TokenItem.d.ts +1 -1
- package/dist/types/components/TokenPicker/TokenSearchLoadingSkelton.d.ts +1 -1
- package/dist/types/components/TokenPicker/index.d.ts +1 -2
- package/dist/types/components/TokenSelect.d.ts +1 -2
- package/dist/types/components/TokenStatusButton.d.ts +1 -1
- package/dist/types/components/Tooltip/QuestionTooltip.d.ts +1 -1
- package/dist/types/components/UserOptionsProvider.d.ts +1 -1
- package/dist/types/components/Widget/index.d.ts +2 -2
- package/dist/types/components/WidgetConfirm.d.ts +1 -1
- package/dist/types/components/WidgetContainer.d.ts +1 -1
- package/dist/types/components/WidgetDialog.d.ts +1 -1
- package/dist/types/components/WithExecutionDialog/index.d.ts +1 -1
- package/dist/types/components/chart/components/Display.d.ts +1 -1
- package/dist/types/components/chart/components/NumberInput.d.ts +1 -1
- package/dist/types/components/chart/components/TogglePriceIcon.d.ts +2 -2
- package/dist/types/components/chart/components/TokenLogo.d.ts +1 -1
- package/dist/types/components/chart/depth-chart/DepthChartKonva.d.ts +1 -1
- package/dist/types/components/chart/depth-chart-v2/index.d.ts +1 -1
- package/dist/types/components/chart/liquidity-chart/LiquidityChartKonva.d.ts +1 -1
- package/dist/types/components/chart/liquidity-chart/useGridLine.d.ts +1 -1
- package/dist/types/components/chart/liquidity-chart/useHorizontalLabel.d.ts +1 -1
- package/dist/types/components/chart/liquidity-chart/useLiquidityLine.d.ts +2 -2
- package/dist/types/components/chart/liquidity-chart/useMiddleLine.d.ts +1 -1
- package/dist/types/hooks/Submission/spec.d.ts +1 -0
- package/dist/types/hooks/Submission/types.d.ts +2 -1
- package/dist/types/hooks/Swap/useForecastSlippageList.d.ts +5 -49
- package/dist/types/hooks/Swap/useSwapSettingStore.d.ts +3 -5
- package/dist/types/hooks/Swap/useSwapSlippage.d.ts +5 -49
- package/dist/types/hooks/Swap/useTradeSwapOrderList.d.ts +5 -76
- package/dist/types/hooks/Token/useTokenListFetchBalance.d.ts +2 -2
- package/dist/types/hooks/contract/useFetchETHBalance.d.ts +4 -4
- package/dist/types/hooks/useTokenState.d.ts +3 -5
- package/dist/types/index.d.ts +2 -2
- package/dist/types/providers/i18n.d.ts +1 -1
- package/dist/types/utils/formatter.d.ts +1 -0
- package/dist/types/widgets/MiningWidget/LpTokenMiningOperate/index.d.ts +1 -2
- package/dist/types/widgets/MiningWidget/MiningCreate/components/PoolCard.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningCreate/components/PoolPicker.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningCreate/components/RewardDetailList.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningCreate/components/RewardTokenSelect.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningCreate/components/SectionTitle.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningCreate/components/StakingRules.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningCreate/components/StepTitle.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningCreate/hooks/useCreateMining.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningCreate/hooks/useDexList.d.ts +1 -2
- package/dist/types/widgets/MiningWidget/MiningCreate/hooks/useRewardsStatus.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningCreate/index.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningCreate/operate-widgets/BottomButtonGroup.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningCreate/operate-widgets/CreateMiningTypeSelect.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningCreate/operate-widgets/RewardForm.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningCreate/operate-widgets/SingleTokenSelect.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningCreate/operate-widgets/TokenPairSelect.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningDetail/MiningInfo.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningDetail/RewardCard.d.ts +1 -2
- package/dist/types/widgets/MiningWidget/MiningDetail/index.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningDetail/widgets.d.ts +4 -4
- package/dist/types/widgets/MiningWidget/MiningList/components/APRSection.d.ts +2 -2
- package/dist/types/widgets/MiningWidget/MiningList/components/CloseButton.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/components/GoBack.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/components/ManageButtonList.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/components/MiningCardLayout.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/components/MiningListEmpty.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/components/MiningListLoading.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/components/MiningStatusTabSelect.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/components/MiningTags.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/components/MiningTitle.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/components/MyStakedSection.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/components/OperateButtonList.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/components/RewardsSection.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/components/SearchComponents.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/components/ShareModeSelect.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/components/TVLSection.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/components/TokenAmountPopover.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/components/UnknownUSDPopover.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/components/UsersIcon.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/components/widgets.d.ts +5 -5
- package/dist/types/widgets/MiningWidget/MiningList/dom.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/hooks/useRewardTokenTrigger.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/hooks/useStatusAndStartBlockNumber.d.ts +3 -3
- package/dist/types/widgets/MiningWidget/MiningList/index.d.ts +1 -2
- package/dist/types/widgets/MiningWidget/MiningList/my-created/MyCreatedMining.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/my-created/OperateArea.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/my-created/RewardCard.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/my-created/index.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/operate-area/AssociatedMine.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/operate-area/ClaimButton.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/operate-area/ClaimTips.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/operate-area/GetLpLink.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/operate-area/InputArea.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/operate-area/PercentageSelectButtonGroup.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/operate-area/RewardListCard.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/operate-area/RewardTokenTable.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/operate-area/StakeButton.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/operate-area/StakeTokenSelect.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/operate-area/UnstakeButton.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/operate-area/index.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/OperateArea/AssociateMine.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/OperateArea/ClaimButton.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/OperateArea/GetLpLink.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/OperateArea/RewardListCard.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/OperateArea/StakeButton.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/OperateArea/UnstakeButton.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/OperateArea/Widgets.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/OperateArea/index.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/hooks/usePrevious.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/hooks/useStatusAndStartBlockNumber.d.ts +3 -3
- package/dist/types/widgets/PoolWidget/AMMV2Create/ConfirmDialog.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV2Create/CreateItem.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV2Create/FeeEdit.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/AMMV2Create/MyLiqidity.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV2Create/Ratio.d.ts +2 -2
- package/dist/types/widgets/PoolWidget/AMMV2Create/index.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/AMMV3/AMMV3PositionManage.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/AMMV3PositionsView.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/AddLiquidityV3.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/Badge/AMMV3.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/Badge/RangeBadge.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/Buttons.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/ClaimButton.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/CurrencyInputPanel.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/FeeSelector.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/InRangeDot.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/InputStepCounter.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/Area.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/AxisBottom.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/Brush.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/Chart.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/Line.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/Zoom.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/index.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/svg.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/usePrevious.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/PositionAmountPreview.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/PositionPreview.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/PositionSelectedRangePreview.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/PositionViewCard.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/RangeSelector.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/RateToggle.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/RemoveButton.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/ReviewModal.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/TokenPairSelect.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/widgets.d.ts +9 -9
- package/dist/types/widgets/PoolWidget/PoolCreate/components/BaseInfoCardList.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/DepthAndLiquidityChart.d.ts +2 -2
- package/dist/types/widgets/PoolWidget/PoolCreate/components/DepthChartWrapper.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/PoolCreate/components/EmptyChart.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/FeeRateCard.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/FixedInitPriceConfirm.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/GasWrapGasTokenError.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/LqRatioSet.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/LqSettingsShow.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/PriceModeCard.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/RadioButton.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/RadioButtonIcon.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/RadioButtonTag.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/SectionTitle.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/SelectAndInput.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/StepTitle.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/VersionChartExample.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/widgets.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/hooks/useCreatePmm.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/index.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/PoolCreate/operate-widgets/BottomButtonGroup.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/operate-widgets/FeeRateSetting.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/operate-widgets/InitPriceSetting.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/operate-widgets/PriceModeSetting.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/operate-widgets/RatioSetting.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/operate-widgets/SlippageCoefficientSetting.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/operate-widgets/TokenPairSelect.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/operate-widgets/VersionSelect.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/operate-widgets/widgets.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolDetail/components/BaseQuotePie.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolDetail/components/BifrostMint/BifrostMintDialog.d.ts +8 -0
- package/dist/types/widgets/PoolWidget/PoolDetail/components/BifrostMint/BifrostMintPanel.d.ts +6 -0
- package/dist/types/widgets/PoolWidget/PoolDetail/components/BifrostMint/config.d.ts +7 -0
- package/dist/types/widgets/PoolWidget/PoolDetail/components/BifrostMint/index.d.ts +3 -0
- package/dist/types/widgets/PoolWidget/PoolDetail/components/BifrostMint/types.d.ts +9 -0
- package/dist/types/widgets/PoolWidget/PoolDetail/components/BifrostMint/useBifrostApy.d.ts +11 -0
- package/dist/types/widgets/PoolWidget/PoolDetail/components/ChartInfo.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/PoolDetail/components/MoreDetail/LiquidityProvidersTable.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/PoolDetail/components/MoreDetail/ParametersTable.d.ts +2 -3
- package/dist/types/widgets/PoolWidget/PoolDetail/components/MoreDetail/SwapsTable.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/PoolDetail/components/MoreDetail/index.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/PoolDetail/components/Overview.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolDetail/components/StatBarChart.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/PoolDetail/components/TitleInfo.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/PoolDetail/components/TotalLiquidity.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolDetail/hooks/useLiquidityProviders.d.ts +5 -44
- package/dist/types/widgets/PoolWidget/PoolDetail/hooks/usePoolDashboard.d.ts +5 -79
- package/dist/types/widgets/PoolWidget/PoolDetail/hooks/usePoolDayData.d.ts +5 -49
- package/dist/types/widgets/PoolWidget/PoolDetail/hooks/usePoolSwapList.d.ts +5 -65
- package/dist/types/widgets/PoolWidget/PoolDetail/index.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/PoolList/AddLiquidity.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolList/MyCreated.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/PoolList/MyLiquidity.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/PoolList/components/AddingOrRemovingBtn.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolList/components/CreatePoolBtn.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/PoolList/components/FilterAddressTags.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolList/components/FilterTokenTags.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolList/components/GoPoolDetailBtn.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolList/components/LiquidityTable.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolList/components/LoadingCard.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolList/components/OnlyV3Toggle.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolList/components/PoolApyTooltip.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolList/components/SkeletonTable.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolList/components/TokenAndPoolFilter.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/PoolList/components/TokenListPoolItem.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolList/components/migationWidget.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolList/index.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolModify/SectionTitle.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolModify/index.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/PoolModify/operate-widgets/BottomButtonGroup.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/PoolModify/operate-widgets/FeeRateSetting.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/AddPoolOperate.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/PoolOperate/PoolOperateInner.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/RemovePoolOperate.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/PoolOperate/components/ComparePrice.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/PoolOperate/components/GSPPairRiskWarning.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/components/LiquidityInfo.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/components/OperateBtn.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/components/Ratio.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/components/SliderPercentageCard.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/components/SlippageSetting.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/components/TokenList.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/index.d.ts +2 -3
- package/dist/types/widgets/PoolWidget/hooks/usePoolBalanceInfo.d.ts +1 -0
- package/dist/types/widgets/PoolWidget/hooks/usePoolDetail.d.ts +5 -93
- package/dist/types/widgets/PoolWidget/hooks/useUniV2CreatePairs.d.ts +3 -3
- package/dist/types/widgets/PoolWidget/index.d.ts +1 -1
- package/package.json +162 -162
- package/dist/helper-C1OYS4SC.cjs +0 -1
- package/dist/helper-DUWFcWe6.js +0 -1
- package/dist/index-BGe7caLE.js +0 -12
- package/dist/index-BdB2BCQe.cjs +0 -78
- package/dist/index-CQl4nYsF.cjs +0 -12
- package/dist/index-Cm0O00ow.cjs +0 -14
- package/dist/index-XzRE8z_c.js +0 -78
- package/dist/index-ZV1FQySp.js +0 -14
package/package.json
CHANGED
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@dodoex/widgets",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "DODO Widgets",
|
|
5
|
-
"source": "src/index.tsx",
|
|
6
|
-
"types": "dist/types/index.d.ts",
|
|
7
|
-
"main": "dist/index.cjs",
|
|
8
|
-
"module": "dist/index.js",
|
|
9
|
-
"license": "GPL-3.0-or-later",
|
|
10
|
-
"homepage": "https://github.com/DODOEX/widgets#readme",
|
|
11
|
-
"repository": "https://github.com/DODOEX/widgets",
|
|
12
|
-
"files": [
|
|
13
|
-
"dist"
|
|
14
|
-
],
|
|
15
|
-
"scripts": {
|
|
16
|
-
"prepare": "yarn compile:i18n",
|
|
17
|
-
"extract:i18n": "lingui extract --clean",
|
|
18
|
-
"compile:i18n": "yarn extract:i18n && lingui compile",
|
|
19
|
-
"sync:i18n": "export $(cat .env | xargs) && env lingui extract --overwrite && lingui compile",
|
|
20
|
-
"watch": "yarn run rollup -c --watch",
|
|
21
|
-
"build": "yarn compile:i18n && rollup --config",
|
|
22
|
-
"prerelease": "yarn run build",
|
|
23
|
-
"release": "semantic-release",
|
|
24
|
-
"release:local": "np --any-branch --no-cleanup --no-tests",
|
|
25
|
-
"release.npm-publish": "npm publish --access public",
|
|
26
|
-
"release.npm-publish-beta": "yarn run prerelease && npm publish --tag beta",
|
|
27
|
-
"test": "jest src",
|
|
28
|
-
"test:e2e": "jest e2e"
|
|
29
|
-
},
|
|
30
|
-
"author": "",
|
|
31
|
-
"publishConfig": {
|
|
32
|
-
"access": "public",
|
|
33
|
-
"registry": "https://registry.npmjs.org"
|
|
34
|
-
},
|
|
35
|
-
"exports": {
|
|
36
|
-
".": {
|
|
37
|
-
"types": "./dist/types/index.d.ts",
|
|
38
|
-
"import": "./dist/index.js",
|
|
39
|
-
"require": "./dist/index.cjs"
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
"keywords": [
|
|
43
|
-
"dodo",
|
|
44
|
-
"widgets",
|
|
45
|
-
"interfaces"
|
|
46
|
-
],
|
|
47
|
-
"browserslist": {
|
|
48
|
-
"production": [
|
|
49
|
-
">0.2%",
|
|
50
|
-
"not dead",
|
|
51
|
-
"not op_mini all"
|
|
52
|
-
],
|
|
53
|
-
"development": [
|
|
54
|
-
"last 1 chrome version",
|
|
55
|
-
"last 1 firefox version",
|
|
56
|
-
"last 1 safari version"
|
|
57
|
-
]
|
|
58
|
-
},
|
|
59
|
-
"dependencies": {
|
|
60
|
-
"@babel/runtime": "^7.17.0",
|
|
61
|
-
"@dodoex/api": "^3.7.0",
|
|
62
|
-
"@dodoex/components": "^3.3.0",
|
|
63
|
-
"@dodoex/contract-request": "^1.3.0",
|
|
64
|
-
"@dodoex/dodo-contract-request": "
|
|
65
|
-
"@dodoex/icons": "^2.1.0",
|
|
66
|
-
"@emotion/react": "^11.10.0",
|
|
67
|
-
"@emotion/styled": "^11.10.0",
|
|
68
|
-
"@ethersproject/bignumber": "^5.6.2",
|
|
69
|
-
"@ethersproject/contracts": "^5.7.0",
|
|
70
|
-
"@lingui/core": "^5.7.0",
|
|
71
|
-
"@lingui/macro": "^5.7.0",
|
|
72
|
-
"@lingui/react": "^5.7.0",
|
|
73
|
-
"@reduxjs/toolkit": "^1.6.1",
|
|
74
|
-
"@semantic-release/changelog": "^6.0.1",
|
|
75
|
-
"@semantic-release/git": "^10.0.1",
|
|
76
|
-
"@tanstack/react-query": "^5.18.1",
|
|
77
|
-
"@uniswap/sdk-core": "^5.9.0",
|
|
78
|
-
"@uniswap/v2-sdk": "^4.6.2",
|
|
79
|
-
"@web3-react/core": "8.2.0",
|
|
80
|
-
"@web3-react/eip1193": "8.2.0",
|
|
81
|
-
"@web3-react/metamask": "8.2.1",
|
|
82
|
-
"@web3-react/types": "8.2.0",
|
|
83
|
-
"@web3-react/walletconnect-v2": "8.3.6",
|
|
84
|
-
"axios": "^0.27.2",
|
|
85
|
-
"bignumber.js": "^9.0.2",
|
|
86
|
-
"d3": "7.6.1",
|
|
87
|
-
"dayjs": "^1.11.11",
|
|
88
|
-
"identicon.js": "^2.3.3",
|
|
89
|
-
"jsbi": "^3.1.4",
|
|
90
|
-
"konva": "^9.3.15",
|
|
91
|
-
"lodash": "^4.17.21",
|
|
92
|
-
"make-plural": "^7.0.0",
|
|
93
|
-
"moment": "^2.29.4",
|
|
94
|
-
"react-datetime": "^3.3.0",
|
|
95
|
-
"react-icons": "^5.0.1",
|
|
96
|
-
"react-infinite-scroller": "^1.2.6",
|
|
97
|
-
"react-konva": "^19.0.0",
|
|
98
|
-
"react-transition-group": "^4.4.5",
|
|
99
|
-
"react-window": "^1.8.11",
|
|
100
|
-
"recharts": "^2.15.0",
|
|
101
|
-
"rmc-date-picker": "^6.0.10",
|
|
102
|
-
"tiny-invariant": "^1.1.0",
|
|
103
|
-
"zustand": "^5.0.0"
|
|
104
|
-
},
|
|
105
|
-
"peerDependencies": {
|
|
106
|
-
"@babel/runtime": ">=7.17.0",
|
|
107
|
-
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
108
|
-
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
109
|
-
},
|
|
110
|
-
"peerDependenciesMeta": {
|
|
111
|
-
"react-infinite-scroller": {
|
|
112
|
-
"optional": true
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
"devDependencies": {
|
|
116
|
-
"@babel/preset-env": "^7.16.11",
|
|
117
|
-
"@babel/preset-react": "^7.18.6",
|
|
118
|
-
"@babel/preset-typescript": "^7.16.7",
|
|
119
|
-
"@lingui/cli": "^5.7.0",
|
|
120
|
-
"@nomicfoundation/hardhat-network-helpers": "^1.0.6",
|
|
121
|
-
"@nomiclabs/hardhat-ethers": "^2.1.1",
|
|
122
|
-
"@rollup/plugin-babel": "^6.0.4",
|
|
123
|
-
"@rollup/plugin-commonjs": "^26.0.1",
|
|
124
|
-
"@rollup/plugin-json": "^6.1.0",
|
|
125
|
-
"@rollup/plugin-multi-entry": "^6.0.1",
|
|
126
|
-
"@rollup/plugin-replace": "^5.0.7",
|
|
127
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
128
|
-
"@rollup/plugin-typescript": "^12.1.1",
|
|
129
|
-
"@rollup/plugin-url": "^8.0.2",
|
|
130
|
-
"@svgr/rollup": "^6.2.1",
|
|
131
|
-
"@testing-library/jest-dom": "^6.5.0",
|
|
132
|
-
"@testing-library/react": "^16.0.1",
|
|
133
|
-
"@testing-library/react-hooks": "^8.0.1",
|
|
134
|
-
"@types/d3": "7.4.3",
|
|
135
|
-
"@types/identicon.js": "^2.3.1",
|
|
136
|
-
"@types/jest": "^29.0.3",
|
|
137
|
-
"@types/lodash": "^4.14.184",
|
|
138
|
-
"@types/react-infinite-scroller": "^1.2.5",
|
|
139
|
-
"@types/react-transition-group": "^4.4.11",
|
|
140
|
-
"@types/react-window": "^1.8.5",
|
|
141
|
-
"babel-plugin-macros": "^3.1.0",
|
|
142
|
-
"babel-runtime": "^6.26.0",
|
|
143
|
-
"dotenv": "^16.0.2",
|
|
144
|
-
"ethers": "^5.7.1",
|
|
145
|
-
"gettext-parser": "^8.0.0",
|
|
146
|
-
"hardhat": "^2.22.13",
|
|
147
|
-
"identity-obj-proxy": "^3.0.0",
|
|
148
|
-
"jest": "^29.0.3",
|
|
149
|
-
"jest-environment-hardhat": "^1.1.9",
|
|
150
|
-
"jest-environment-jsdom": "^29.0.3",
|
|
151
|
-
"np": "^7.6.1",
|
|
152
|
-
"rollup": "^4.18.0",
|
|
153
|
-
"rollup-plugin-clear": "^2.0.7",
|
|
154
|
-
"rollup-plugin-import-css": "^3.5.5",
|
|
155
|
-
"svg-jest": "^1.0.1",
|
|
156
|
-
"ts-jest": "^29.0.1",
|
|
157
|
-
"typescript": "^5.6.3"
|
|
158
|
-
},
|
|
159
|
-
"optionalDependencies": {
|
|
160
|
-
"pino-pretty": "^13.1.3"
|
|
161
|
-
}
|
|
162
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@dodoex/widgets",
|
|
3
|
+
"version": "3.19.0-mint.2",
|
|
4
|
+
"description": "DODO Widgets",
|
|
5
|
+
"source": "src/index.tsx",
|
|
6
|
+
"types": "dist/types/index.d.ts",
|
|
7
|
+
"main": "dist/index.cjs",
|
|
8
|
+
"module": "dist/index.js",
|
|
9
|
+
"license": "GPL-3.0-or-later",
|
|
10
|
+
"homepage": "https://github.com/DODOEX/widgets#readme",
|
|
11
|
+
"repository": "https://github.com/DODOEX/widgets",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"prepare": "yarn compile:i18n",
|
|
17
|
+
"extract:i18n": "lingui extract --clean",
|
|
18
|
+
"compile:i18n": "yarn extract:i18n && lingui compile",
|
|
19
|
+
"sync:i18n": "export $(cat .env | xargs) && env lingui extract --overwrite && lingui compile",
|
|
20
|
+
"watch": "yarn run rollup -c --watch",
|
|
21
|
+
"build": "yarn compile:i18n && rollup --config",
|
|
22
|
+
"prerelease": "yarn run build",
|
|
23
|
+
"release": "semantic-release",
|
|
24
|
+
"release:local": "np --any-branch --no-cleanup --no-tests",
|
|
25
|
+
"release.npm-publish": "npm publish --access public",
|
|
26
|
+
"release.npm-publish-beta": "yarn run prerelease && npm publish --tag beta",
|
|
27
|
+
"test": "jest src",
|
|
28
|
+
"test:e2e": "jest e2e"
|
|
29
|
+
},
|
|
30
|
+
"author": "",
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public",
|
|
33
|
+
"registry": "https://registry.npmjs.org"
|
|
34
|
+
},
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"types": "./dist/types/index.d.ts",
|
|
38
|
+
"import": "./dist/index.js",
|
|
39
|
+
"require": "./dist/index.cjs"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"keywords": [
|
|
43
|
+
"dodo",
|
|
44
|
+
"widgets",
|
|
45
|
+
"interfaces"
|
|
46
|
+
],
|
|
47
|
+
"browserslist": {
|
|
48
|
+
"production": [
|
|
49
|
+
">0.2%",
|
|
50
|
+
"not dead",
|
|
51
|
+
"not op_mini all"
|
|
52
|
+
],
|
|
53
|
+
"development": [
|
|
54
|
+
"last 1 chrome version",
|
|
55
|
+
"last 1 firefox version",
|
|
56
|
+
"last 1 safari version"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@babel/runtime": "^7.17.0",
|
|
61
|
+
"@dodoex/api": "^3.7.0",
|
|
62
|
+
"@dodoex/components": "^3.3.0",
|
|
63
|
+
"@dodoex/contract-request": "^1.3.0",
|
|
64
|
+
"@dodoex/dodo-contract-request": "1.35.0-alpha.1",
|
|
65
|
+
"@dodoex/icons": "^2.1.0",
|
|
66
|
+
"@emotion/react": "^11.10.0",
|
|
67
|
+
"@emotion/styled": "^11.10.0",
|
|
68
|
+
"@ethersproject/bignumber": "^5.6.2",
|
|
69
|
+
"@ethersproject/contracts": "^5.7.0",
|
|
70
|
+
"@lingui/core": "^5.7.0",
|
|
71
|
+
"@lingui/macro": "^5.7.0",
|
|
72
|
+
"@lingui/react": "^5.7.0",
|
|
73
|
+
"@reduxjs/toolkit": "^1.6.1",
|
|
74
|
+
"@semantic-release/changelog": "^6.0.1",
|
|
75
|
+
"@semantic-release/git": "^10.0.1",
|
|
76
|
+
"@tanstack/react-query": "^5.18.1",
|
|
77
|
+
"@uniswap/sdk-core": "^5.9.0",
|
|
78
|
+
"@uniswap/v2-sdk": "^4.6.2",
|
|
79
|
+
"@web3-react/core": "8.2.0",
|
|
80
|
+
"@web3-react/eip1193": "8.2.0",
|
|
81
|
+
"@web3-react/metamask": "8.2.1",
|
|
82
|
+
"@web3-react/types": "8.2.0",
|
|
83
|
+
"@web3-react/walletconnect-v2": "8.3.6",
|
|
84
|
+
"axios": "^0.27.2",
|
|
85
|
+
"bignumber.js": "^9.0.2",
|
|
86
|
+
"d3": "7.6.1",
|
|
87
|
+
"dayjs": "^1.11.11",
|
|
88
|
+
"identicon.js": "^2.3.3",
|
|
89
|
+
"jsbi": "^3.1.4",
|
|
90
|
+
"konva": "^9.3.15",
|
|
91
|
+
"lodash": "^4.17.21",
|
|
92
|
+
"make-plural": "^7.0.0",
|
|
93
|
+
"moment": "^2.29.4",
|
|
94
|
+
"react-datetime": "^3.3.0",
|
|
95
|
+
"react-icons": "^5.0.1",
|
|
96
|
+
"react-infinite-scroller": "^1.2.6",
|
|
97
|
+
"react-konva": "^19.0.0",
|
|
98
|
+
"react-transition-group": "^4.4.5",
|
|
99
|
+
"react-window": "^1.8.11",
|
|
100
|
+
"recharts": "^2.15.0",
|
|
101
|
+
"rmc-date-picker": "^6.0.10",
|
|
102
|
+
"tiny-invariant": "^1.1.0",
|
|
103
|
+
"zustand": "^5.0.0"
|
|
104
|
+
},
|
|
105
|
+
"peerDependencies": {
|
|
106
|
+
"@babel/runtime": ">=7.17.0",
|
|
107
|
+
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
108
|
+
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
109
|
+
},
|
|
110
|
+
"peerDependenciesMeta": {
|
|
111
|
+
"react-infinite-scroller": {
|
|
112
|
+
"optional": true
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"devDependencies": {
|
|
116
|
+
"@babel/preset-env": "^7.16.11",
|
|
117
|
+
"@babel/preset-react": "^7.18.6",
|
|
118
|
+
"@babel/preset-typescript": "^7.16.7",
|
|
119
|
+
"@lingui/cli": "^5.7.0",
|
|
120
|
+
"@nomicfoundation/hardhat-network-helpers": "^1.0.6",
|
|
121
|
+
"@nomiclabs/hardhat-ethers": "^2.1.1",
|
|
122
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
123
|
+
"@rollup/plugin-commonjs": "^26.0.1",
|
|
124
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
125
|
+
"@rollup/plugin-multi-entry": "^6.0.1",
|
|
126
|
+
"@rollup/plugin-replace": "^5.0.7",
|
|
127
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
128
|
+
"@rollup/plugin-typescript": "^12.1.1",
|
|
129
|
+
"@rollup/plugin-url": "^8.0.2",
|
|
130
|
+
"@svgr/rollup": "^6.2.1",
|
|
131
|
+
"@testing-library/jest-dom": "^6.5.0",
|
|
132
|
+
"@testing-library/react": "^16.0.1",
|
|
133
|
+
"@testing-library/react-hooks": "^8.0.1",
|
|
134
|
+
"@types/d3": "7.4.3",
|
|
135
|
+
"@types/identicon.js": "^2.3.1",
|
|
136
|
+
"@types/jest": "^29.0.3",
|
|
137
|
+
"@types/lodash": "^4.14.184",
|
|
138
|
+
"@types/react-infinite-scroller": "^1.2.5",
|
|
139
|
+
"@types/react-transition-group": "^4.4.11",
|
|
140
|
+
"@types/react-window": "^1.8.5",
|
|
141
|
+
"babel-plugin-macros": "^3.1.0",
|
|
142
|
+
"babel-runtime": "^6.26.0",
|
|
143
|
+
"dotenv": "^16.0.2",
|
|
144
|
+
"ethers": "^5.7.1",
|
|
145
|
+
"gettext-parser": "^8.0.0",
|
|
146
|
+
"hardhat": "^2.22.13",
|
|
147
|
+
"identity-obj-proxy": "^3.0.0",
|
|
148
|
+
"jest": "^29.0.3",
|
|
149
|
+
"jest-environment-hardhat": "^1.1.9",
|
|
150
|
+
"jest-environment-jsdom": "^29.0.3",
|
|
151
|
+
"np": "^7.6.1",
|
|
152
|
+
"rollup": "^4.18.0",
|
|
153
|
+
"rollup-plugin-clear": "^2.0.7",
|
|
154
|
+
"rollup-plugin-import-css": "^3.5.5",
|
|
155
|
+
"svg-jest": "^1.0.1",
|
|
156
|
+
"ts-jest": "^29.0.1",
|
|
157
|
+
"typescript": "^5.6.3"
|
|
158
|
+
},
|
|
159
|
+
"optionalDependencies": {
|
|
160
|
+
"pino-pretty": "^13.1.3"
|
|
161
|
+
}
|
|
162
|
+
}
|
package/dist/helper-C1OYS4SC.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@lingui/core"),t=require("bignumber.js"),i=require("./index-Cm0O00ow.cjs");function o(e){let t=e.toLowerCase();if(t&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)){if(4===t.length){let e="#";for(let i=1;i<4;i+=1)e+=t.slice(i,i+1).concat(t.slice(i,i+1));t=e}const e=[];for(let i=1;i<7;i+=2)e.push(parseInt(`0x${t.slice(i,i+2)}`));return e.join(",")}return t}function r({val:e,model:i}){let o=e;if(e.isNaN())return{side:"no-one",vert:new t(0),base:new t(0),quote:new t(0)};i.Q0.eq(0)&&e.lt(i.i)&&(o=i.i),i.B0.eq(0)&&e.gt(i.i)&&(o=i.i);const r=i.getPriceDepth(o),n=r.baseAmount,l=r.quoteAmount,{isBuy:s}=r;return{side:s?"ask":"bid",vert:s?n:l,base:n,quote:l}}function n(e,i=1){return new t(i).div(e/2)}exports.baseZoomMultiples=1,exports.beforePriceImpactEffect=function({currentBaseMinAndZoomMultiples:e,targetPrice:i,midPrice:o,width:r}){const{baseMin:n,zoomMultiples:l}=e,s=new t(Math.log10(n.div(o).toNumber())),u=s.plus(2*l),a=new t(o.multipliedBy(10**u.toNumber()));if(i.gte(n)&&i.lte(a)){return{isSkip:!0,targetX:new t(Math.log10(i.div(o).toNumber())).minus(s).div(2*l).multipliedBy(r).toNumber(),baseMin:new t(0),zoomMultiples:1}}const m=new t(o.multipliedBy(.1)),p=new t(o.multipliedBy(10));if(i.gte(m)&&i.lte(p)){return{isSkip:!1,targetX:new t(Math.log10(i.div(o).toNumber())).minus(-1).div(2).multipliedBy(r).toNumber(),baseMin:m,zoomMultiples:1}}return{isSkip:!1,targetX:-1,baseMin:new t(0),zoomMultiples:1}},exports.chartOffsetYBCToolTip=18,exports.chartT=function(t,i){switch(t){case"depth-chart.tips.buy":return e.i18n._({id:"Es4ccw",message:"Users pay {0} {1} and receive {2} {3}\nPrice {4} ({5}%)",values:{0:i.amountText,1:i.baseTokenSymbol,2:i.oppositeAmountText,3:i.quoteTokenSymbol,4:i.priceText,5:i.slippageText}});case"depth-chart.tips.mid-price":return e.i18n._({id:"cnbRVW",message:"Initial Price {0} {1} = {2} {3}",values:{0:i.amountText,1:i.baseTokenSymbol,2:i.oppositeAmountText,3:i.quoteTokenSymbol}});case"depth-chart.tips.sell":return e.i18n._({id:"Es4ccw",message:"Users pay {0} {1} and receive {2} {3}\nPrice {4} ({5}%)",values:{0:i.oppositeAmountText,1:i.quoteTokenSymbol,2:i.amountText,3:i.baseTokenSymbol,4:i.priceText,5:i.slippageText}});case"pool.chart.buy-amount":return e.i18n._({id:"NjQ1e3",message:"Users sell {0} amount: ",values:{0:i.symbol}});case"pool.chart.price-impact":return e.i18n._({id:"I0LXan",message:"Price Impact: {0}",values:{0:i.amount}});case"pool.chart.sell-amount":return e.i18n._({id:"WJ94b8",message:"Users buy {0} amount: ",values:{0:i.symbol}});case"pool.create.disabled-token-amount":return e.i18n._({id:"5QDjef",message:"The token amount is calculated by initial price."});case"pool.create.set-pool.emulator.title":return e.i18n._({id:"FQfStS",message:"Emulator"});case"pool.create.set-pool.emulator.title.question":return e.i18n._({id:"9D2g7k",message:"The liquidity of DODO is continuous, which is different from the discrete liquidity of UniV3. The ticks shown in the illustration are for demonstration purposes only."});case"pool.chart.liquidity-chart-tip":return e.i18n._({id:"GhrVog",message:"The area of the chart indicates the buy/sell volume of {0} that can be carried by the market when the current price changes to the hover price. ",values:{0:i.baseTokenSymbol}});case"pool.chart.liquidity-chart-buy":return e.i18n._({id:"TvH4Ym",message:"Bought {0} {1}, price in the pool decreased to {2}",values:{0:i.amount,1:i.symbol,2:i.price}});case"pool.chart.liquidity-chart-sell":return e.i18n._({id:"0O1wzf",message:"Traders sold {0} {1}, price in the pool increased to {2}",values:{0:i.amount,1:i.symbol,2:i.price}});default:throw new Error(`Unknown key ${t}`)}},exports.colorRgb=o,exports.computeBaseAfterZoom=function({midPrice:e,zoomMultiples:t}){return e.multipliedBy(10**-t)},exports.computeBaseMinByDistance=function({dragDistance:e,prevBaseMin:i,chartWidth:o,zoomMultiples:r}){const l=n(o,r);return e>0?i.multipliedBy(1-l.multipliedBy(e).toNumber()):i.multipliedBy(10**l.multipliedBy(new t(e).abs()).plus(0).toNumber())},exports.computeBaseVert=function({midPrice:e,q:i,q0:o,pmmModel:r}){let n=t.maximum(i,o,r.B.multipliedBy(e));return n.isNaN()&&(n=new t(10)),n.eq(0)&&(n=new t(1)),{buyBaseVert:n.multipliedBy(1.2),sellBaseVert:n.div(e).multipliedBy(1.2)}},exports.computeTargetXByTargetPrice=function({type:e,targetPrice:i,midPrice:o,width:r}){if("sell"===e){return{zoomMultiples:new t(Math.log10(i.div(o).toNumber())).minus(0).div(3/4).abs(),targetX:r/2*(3/4)+r/2}}const n=new t(Math.log10(i.div(o).toNumber()));return{zoomMultiples:new t(0).minus(n).div(3/4).abs(),targetX:r/2*(1/4)}},exports.computeXPortion=n,exports.computeZoomMultiplesWhenZoom=function({prevZoomMultiples:e,zoomIn:t}){return!t&&e<=.1?e:t?e+.1:e-.1},exports.evalPoint=r,exports.labelPadding=12,exports.updateTooltip=function({tooltip:e,x:l,chartWidth:s,chartHeight:u,buyBaseVert:a,sellBaseVert:m,pmmModel:p,midPrice:c,baseTokenSymbol:d,quoteTokenSymbol:h,t:b,baseMinAndZoomMultiples:f,isHover:g,color:y,leftColor:x,rightColor:T}){const{zoomMultiples:v,baseMin:w}=f,B=n(s,v),M=a.div(u),k=m.div(u),N=2*v,q=w.multipliedBy(10**B.multipliedBy(l).toNumber());let S=new t(Math.log(c.div(w).toNumber())/Math.log(10));S=t.minimum(N,S),S=t.maximum(0,S);const P=S.div(B),A=r({val:q,model:p});if(A.vert.isNaN())return;const X=q.lt(c);let O=u-A.vert.div(M).toNumber();X||(O=u-A.vert.div(k).toNumber());const _=i.formatShortNumber(q),z=i.formatShortNumber(A.vert),$=q.minus(c).abs().div(c).multipliedBy(100).toFixed(2),D=P.toNumber(),V=e.findOne("#toolTipVertLine"),L=e.findOne("#toolTipHoriLine"),W=e.findOne("#joinCircle"),H=e.findOne("#toolTip"),Z=e.findOne("#priceTextLabel"),j=e.findOne("#slippageTextLabel");if(!H)return;H.x(l),H.y(O-5-6);const I=H.getText(),U=H.getTag();let Y="ask"===A.side?i.formatShortNumber(A.quote):i.formatShortNumber(A.base);const C=p.k.lte(0);C&&(Y=z);const E=i.formatShortNumber(c),F={amountText:z,baseTokenSymbol:d,oppositeAmountText:Y,quoteTokenSymbol:h,priceText:C?E:_,slippageText:`${X?"-":"+"}${$}`};if(P.minus(4).lte(l)&&P.plus(2).gte(l)&&g)I.text(b("depth-chart.tips.mid-price",{amountText:1,baseTokenSymbol:d,oppositeAmountText:E,quoteTokenSymbol:h})),H.x(D),H.y(u/2),null==V||V.hide(),null==L||L.hide(),null==W||W.hide(),null==Z||Z.hide(),null==j||j.hide();else{I.text(X?b("depth-chart.tips.buy",{amountText:Y,baseTokenSymbol:d,oppositeAmountText:z,quoteTokenSymbol:h,priceText:C?E:_,slippageText:`${X?"-":"+"}${$}`}):b("depth-chart.tips.sell",F));const e=y||(X?"#55f6db":"#ff4f73"),t=X?x||"#55f6db":T||"#ff4f73";I.fill(e),H.width()/2>l?(U.pointerDirection("left"),U.pointerHeight(15),U.pointerWidth(8),H.offsetX(-11),H.offsetY(-11)):H.width()/2+l>s?(U.pointerDirection("right"),U.pointerHeight(15),U.pointerWidth(8),H.offsetX(11),H.offsetY(-11)):(U.pointerDirection("down"),U.pointerHeight(8),U.pointerWidth(15),H.offsetX(0),H.offsetY(0)),null==V||V.points([l,u,l,O]),null==V||V.stroke(t),null==L||L.points(X?[l,O,D,O]:[D,O,l,O]),null==L||L.stroke(t),null==W||W.x(l),null==W||W.y(O),null==W||W.fill(X?x||"rgb(86, 246, 218)":T||"#FF5072"),null==W||W.stroke(X?x?`rgba(${o(x)}, 0.4)`:"rgba(86, 246, 218, 0.3)":T?`rgba(${o(T)}, 0.4)`:"rgba(255, 80, 114, 0.3)"),Z&&(Z.x(l),Z.y(u),Z.offsetX(Z.width()/2),Z.x()-Z.width()/2<0?Z.x(Z.width()/2):Z.x()+Z.width()/2>s?Z.x(s-Z.width()/2):Z.x(l));const i=null==Z?void 0:Z.findOne("#priceTextLabel-text");i&&(i.fill(e),i.text(_)),j&&(j.x(X?l+(D-l)/2:l-(l-D)/2),j.y(O),j.offsetY(j.height()/2),j.offsetX(j.width()/2));const r=null==j?void 0:j.findOne("#slippageTextLabel-text");r&&(r.fill(e),r.text(`${X?"-":"+"}${$}%`)),null==V||V.show(),null==L||L.show(),null==W||W.show(),null==Z||Z.show(),null==j||j.show()}e.show()};
|
package/dist/helper-DUWFcWe6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i18n as e}from"@lingui/core";import t from"bignumber.js";import{f as i}from"./index-ZV1FQySp.js";function o(t,i){switch(t){case"depth-chart.tips.buy":return e._({id:"Es4ccw",message:"Users pay {0} {1} and receive {2} {3}\nPrice {4} ({5}%)",values:{0:i.amountText,1:i.baseTokenSymbol,2:i.oppositeAmountText,3:i.quoteTokenSymbol,4:i.priceText,5:i.slippageText}});case"depth-chart.tips.mid-price":return e._({id:"cnbRVW",message:"Initial Price {0} {1} = {2} {3}",values:{0:i.amountText,1:i.baseTokenSymbol,2:i.oppositeAmountText,3:i.quoteTokenSymbol}});case"depth-chart.tips.sell":return e._({id:"Es4ccw",message:"Users pay {0} {1} and receive {2} {3}\nPrice {4} ({5}%)",values:{0:i.oppositeAmountText,1:i.quoteTokenSymbol,2:i.amountText,3:i.baseTokenSymbol,4:i.priceText,5:i.slippageText}});case"pool.chart.buy-amount":return e._({id:"NjQ1e3",message:"Users sell {0} amount: ",values:{0:i.symbol}});case"pool.chart.price-impact":return e._({id:"I0LXan",message:"Price Impact: {0}",values:{0:i.amount}});case"pool.chart.sell-amount":return e._({id:"WJ94b8",message:"Users buy {0} amount: ",values:{0:i.symbol}});case"pool.create.disabled-token-amount":return e._({id:"5QDjef",message:"The token amount is calculated by initial price."});case"pool.create.set-pool.emulator.title":return e._({id:"FQfStS",message:"Emulator"});case"pool.create.set-pool.emulator.title.question":return e._({id:"9D2g7k",message:"The liquidity of DODO is continuous, which is different from the discrete liquidity of UniV3. The ticks shown in the illustration are for demonstration purposes only."});case"pool.chart.liquidity-chart-tip":return e._({id:"GhrVog",message:"The area of the chart indicates the buy/sell volume of {0} that can be carried by the market when the current price changes to the hover price. ",values:{0:i.baseTokenSymbol}});case"pool.chart.liquidity-chart-buy":return e._({id:"TvH4Ym",message:"Bought {0} {1}, price in the pool decreased to {2}",values:{0:i.amount,1:i.symbol,2:i.price}});case"pool.chart.liquidity-chart-sell":return e._({id:"0O1wzf",message:"Traders sold {0} {1}, price in the pool increased to {2}",values:{0:i.amount,1:i.symbol,2:i.price}});default:throw new Error(`Unknown key ${t}`)}}const l=12,n=18;function s(e){let t=e.toLowerCase();if(t&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)){if(4===t.length){let e="#";for(let i=1;i<4;i+=1)e+=t.slice(i,i+1).concat(t.slice(i,i+1));t=e}const e=[];for(let i=1;i<7;i+=2)e.push(parseInt(`0x${t.slice(i,i+2)}`));return e.join(",")}return t}function r({val:e,model:i}){let o=e;if(e.isNaN())return{side:"no-one",vert:new t(0),base:new t(0),quote:new t(0)};i.Q0.eq(0)&&e.lt(i.i)&&(o=i.i),i.B0.eq(0)&&e.gt(i.i)&&(o=i.i);const l=i.getPriceDepth(o),n=l.baseAmount,s=l.quoteAmount,{isBuy:r}=l;return{side:r?"ask":"bid",vert:r?n:s,base:n,quote:s}}function a({midPrice:e,q:i,q0:o,pmmModel:l}){let n=t.maximum(i,o,l.B.multipliedBy(e));return n.isNaN()&&(n=new t(10)),n.eq(0)&&(n=new t(1)),{buyBaseVert:n.multipliedBy(1.2),sellBaseVert:n.div(e).multipliedBy(1.2)}}function u(e,i=1){return new t(i).div(e/2)}function m({tooltip:e,x:o,chartWidth:l,chartHeight:n,buyBaseVert:a,sellBaseVert:m,pmmModel:p,midPrice:c,baseTokenSymbol:d,quoteTokenSymbol:h,t:b,baseMinAndZoomMultiples:f,isHover:g,color:y,leftColor:T,rightColor:x}){const{zoomMultiples:w,baseMin:v}=f,k=u(l,w),M=a.div(n),B=m.div(n),q=2*w,N=v.multipliedBy(10**k.multipliedBy(o).toNumber());let S=new t(Math.log(c.div(v).toNumber())/Math.log(10));S=t.minimum(q,S),S=t.maximum(0,S);const A=S.div(k),P=r({val:N,model:p});if(P.vert.isNaN())return;const _=N.lt(c);let z=n-P.vert.div(M).toNumber();_||(z=n-P.vert.div(B).toNumber());const O=i(N),X=i(P.vert),$=N.minus(c).abs().div(c).multipliedBy(100).toFixed(2),D=A.toNumber(),L=e.findOne("#toolTipVertLine"),V=e.findOne("#toolTipHoriLine"),j=e.findOne("#joinCircle"),H=e.findOne("#toolTip"),W=e.findOne("#priceTextLabel"),U=e.findOne("#slippageTextLabel");if(!H)return;H.x(o),H.y(z-5-6);const I=H.getText(),Y=H.getTag();let C="ask"===P.side?i(P.quote):i(P.base);const E=p.k.lte(0);E&&(C=X);const F=i(c),Q={amountText:X,baseTokenSymbol:d,oppositeAmountText:C,quoteTokenSymbol:h,priceText:E?F:O,slippageText:`${_?"-":"+"}${$}`};if(A.minus(4).lte(o)&&A.plus(2).gte(o)&&g)I.text(b("depth-chart.tips.mid-price",{amountText:1,baseTokenSymbol:d,oppositeAmountText:F,quoteTokenSymbol:h})),H.x(D),H.y(n/2),null==L||L.hide(),null==V||V.hide(),null==j||j.hide(),null==W||W.hide(),null==U||U.hide();else{I.text(_?b("depth-chart.tips.buy",{amountText:C,baseTokenSymbol:d,oppositeAmountText:X,quoteTokenSymbol:h,priceText:E?F:O,slippageText:`${_?"-":"+"}${$}`}):b("depth-chart.tips.sell",Q));const e=y||(_?"#55f6db":"#ff4f73"),t=_?T||"#55f6db":x||"#ff4f73";I.fill(e),H.width()/2>o?(Y.pointerDirection("left"),Y.pointerHeight(15),Y.pointerWidth(8),H.offsetX(-11),H.offsetY(-11)):H.width()/2+o>l?(Y.pointerDirection("right"),Y.pointerHeight(15),Y.pointerWidth(8),H.offsetX(11),H.offsetY(-11)):(Y.pointerDirection("down"),Y.pointerHeight(8),Y.pointerWidth(15),H.offsetX(0),H.offsetY(0)),null==L||L.points([o,n,o,z]),null==L||L.stroke(t),null==V||V.points(_?[o,z,D,z]:[D,z,o,z]),null==V||V.stroke(t),null==j||j.x(o),null==j||j.y(z),null==j||j.fill(_?T||"rgb(86, 246, 218)":x||"#FF5072"),null==j||j.stroke(_?T?`rgba(${s(T)}, 0.4)`:"rgba(86, 246, 218, 0.3)":x?`rgba(${s(x)}, 0.4)`:"rgba(255, 80, 114, 0.3)"),W&&(W.x(o),W.y(n),W.offsetX(W.width()/2),W.x()-W.width()/2<0?W.x(W.width()/2):W.x()+W.width()/2>l?W.x(l-W.width()/2):W.x(o));const i=null==W?void 0:W.findOne("#priceTextLabel-text");i&&(i.fill(e),i.text(O)),U&&(U.x(_?o+(D-o)/2:o-(o-D)/2),U.y(z),U.offsetY(U.height()/2),U.offsetX(U.width()/2));const r=null==U?void 0:U.findOne("#slippageTextLabel-text");r&&(r.fill(e),r.text(`${_?"-":"+"}${$}%`)),null==L||L.show(),null==V||V.show(),null==j||j.show(),null==W||W.show(),null==U||U.show()}e.show()}function p({dragDistance:e,prevBaseMin:i,chartWidth:o,zoomMultiples:l}){const n=u(o,l);return e>0?i.multipliedBy(1-n.multipliedBy(e).toNumber()):i.multipliedBy(10**n.multipliedBy(new t(e).abs()).plus(0).toNumber())}const c=1;function d({prevZoomMultiples:e,zoomIn:t}){return!t&&e<=.1?e:t?e+.1:e-.1}function h({type:e,targetPrice:i,midPrice:o,width:l}){if("sell"===e){return{zoomMultiples:new t(Math.log10(i.div(o).toNumber())).minus(0).div(3/4).abs(),targetX:l/2*(3/4)+l/2}}const n=new t(Math.log10(i.div(o).toNumber()));return{zoomMultiples:new t(0).minus(n).div(3/4).abs(),targetX:l/2*(1/4)}}function b({currentBaseMinAndZoomMultiples:e,targetPrice:i,midPrice:o,width:l}){const{baseMin:n,zoomMultiples:s}=e,r=new t(Math.log10(n.div(o).toNumber())),a=r.plus(2*s),u=new t(o.multipliedBy(10**a.toNumber()));if(i.gte(n)&&i.lte(u)){return{isSkip:!0,targetX:new t(Math.log10(i.div(o).toNumber())).minus(r).div(2*s).multipliedBy(l).toNumber(),baseMin:new t(0),zoomMultiples:1}}const m=new t(o.multipliedBy(.1)),p=new t(o.multipliedBy(10));if(i.gte(m)&&i.lte(p)){return{isSkip:!1,targetX:new t(Math.log10(i.div(o).toNumber())).minus(-1).div(2).multipliedBy(l).toNumber(),baseMin:m,zoomMultiples:1}}return{isSkip:!1,targetX:-1,baseMin:new t(0),zoomMultiples:1}}function f({midPrice:e,zoomMultiples:t}){return e.multipliedBy(10**-t)}export{a,p as b,u as c,d,r as e,f,n as g,o as h,c as i,b as j,h as k,l,s as m,m as u};
|
package/dist/index-BGe7caLE.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import t from"@emotion/styled";import{merge as e}from"lodash";import{useMemo as i,useRef as n}from"react";import{l as r,h as o,m as l}from"./helper-DUWFcWe6.js";import{Line as a,Text as s,Stage as d,Layer as m,Rect as p,Circle as g,Label as u,Tag as c}from"react-konva";import{f as h}from"./index-ZV1FQySp.js";import f from"bignumber.js";import{jsxs as x,Fragment as L,jsx as b}from"react/jsx-runtime";import{solveQuadraticFunctionForTarget as w,PMMState as A,PMMHelper as y}from"@dodoex/api";import"@lingui/core";import"@dodoex/components";import"@dodoex/dodo-contract-request";import"@babel/runtime/helpers/interopRequireDefault";import"@babel/runtime/helpers/defineProperty";import"@lingui/react";import"identicon.js";import"zustand";import"zustand/middleware";import"@web3-react/core";import"@web3-react/eip1193";import"@web3-react/walletconnect-v2";import"@web3-react/metamask";import"@web3-react/types";import"@tanstack/react-query";import"@ethersproject/bignumber";import"react-dom";import"react-window";import"dayjs";import"dayjs/plugin/duration";import"dayjs/plugin/localizedFormat";import"dayjs/plugin/utc";import"react-transition-group";import"react-is";import"@dodoex/contract-request";import"axios";import"recharts";import"react-dom/client";import"jsbi";import"tiny-invariant";import"@uniswap/sdk-core";import"@uniswap/v2-sdk";import"react-infinite-scroller";import"d3";import"rmc-date-picker";import"rmc-date-picker/assets/index.css";import"react-datetime/css/react-datetime.css";const P=t.div`
|
|
2
|
-
height: 100%;
|
|
3
|
-
position: relative;
|
|
4
|
-
`,N=t.div`
|
|
5
|
-
text-align: center;
|
|
6
|
-
margin-top: 17.1px;
|
|
7
|
-
margin-bottom: 88.41px;
|
|
8
|
-
color: #606066;
|
|
9
|
-
font-size: 12px;
|
|
10
|
-
line-height: 17px;
|
|
11
|
-
font-weight: 400;
|
|
12
|
-
`;function v({maxHeight:t,gridAreaHeight:e,value:i}){const n=new f(e).minus(36),r=n.div(t);return n.minus(i.multipliedBy(r)).plus(36).toNumber()}function H({targetPrice:t,areaPoints:e,isLeft:i}){for(let n=0;n<e.length;n++){const r=e[n],o=n<e.length-1?e[n+1]:null;if(!o)return{targetAreaStatPoint:r,targetAreaStatPoints:e};if(i){if(t.lte(r.middlePrice)&&t.gte(o.middlePrice))return{targetAreaStatPoint:r,targetAreaStatPoints:e.slice(0,n+1)}}else if(t.gte(r.middlePrice)&&t.lte(o.middlePrice))return{targetAreaStatPoint:r,targetAreaStatPoints:e.slice(0,n+1)}}return{targetAreaStatPoint:null,targetAreaStatPoints:[]}}function S({x:t,width:e,minXLN10:i,maxXLN10:n}){const r=new f(t).div(e).multipliedBy(n.minus(i)).plus(i);return new f(10**r.toNumber())}function k({width:t,targetLN10:e,minXLN10:i,maxXLN10:n}){return e.minus(i).div(n.minus(i)).multipliedBy(t).toNumber()}function X({target:t}){return new f(Math.log10(t.toNumber()))}const B="rgba(38, 39, 41, 0.3)";function C({width:t,height:P,params:N,baseTokenSymbol:C,quoteTokenSymbol:M,colorMap:W}){const{maxLeftHeight:F,maxRightHeight:T,leftStatAreaPoints:j,rightStatAreaPoints:q,minXLN10:J,maxXLN10:R}=function({params:t}){return i(()=>{const e=new f(t.b),i=new f(t.q);let n=new f(t.b0);const r=new f(t.q0),o=new f(t.i),l=new f(t.k),{R:a}=t;1===a&&n.eq(e)&&(n=w(e,i.minus(r),new f(1).div(o),l));const s=new A({i:o,K:l,B:e,Q:i,B0:n,Q0:r,R:a,mtFeeRate:new f(0),lpFeeRate:new f(0)}),d=new y,m=new f(s.B),p=[],g=[];let u=new f(0),c=new f(0);const h=d.GetMidPrice(s),x=i.gt(0)?e.div(i):new f(1);for(let t=0;t<=250;t++){let e=m.multipliedBy(t/100).multipliedBy(h.multipliedBy(x).multipliedBy(4));0===t&&(e=m.multipliedBy(1e-11));const i=null==d?void 0:d.QuerySellBase(e,s);if(!i.isNaN()&&i.gt(0)){const t=i.div(e);p.push({giveAmount:e,getAmount:i,price:t});continue}p.push({giveAmount:e,getAmount:new f(0),price:new f(0)})}for(let t=0;t<=250;t++){let e=m.multipliedBy(t/100).multipliedBy(h.multipliedBy(4));0===t&&(e=m.multipliedBy(1e-11));const i=null==d?void 0:d.QuerySellQuote(e,s);if(!i.isNaN()&&i.gt(0)){const t=e.dividedBy(i);g.push({giveAmount:e,getAmount:i,price:t});continue}g.push({giveAmount:e,getAmount:new f(0),price:new f(0)})}if(p.length<2&&g.length<2)return{leftStatAreaPoints:[],rightStatAreaPoints:[],maxLeftHeight:new f(10).multipliedBy(1.2),maxRightHeight:new f(10).multipliedBy(1.2),middlePriceLN10:new f(0),minXLN10:new f(-1),maxXLN10:new f(1)};const L=[];for(let t=1;t<p.length;t++){const e=p[t],{giveAmount:i,getAmount:n,price:r}=e,o=p[t-1];if(!r.isNaN()&&r.gt(0)&&o){const e=r.minus(o.price).abs(),l=i.minus(o.giveAmount).abs(),a=n.minus(o.getAmount).abs().multipliedBy(l);1===t&&L.push({area:n,price:r,middlePrice:r.plus(e.div(1.1)),rectangleHeight:a.plus(a.multipliedBy(.03))}),L.push({area:n,price:r,middlePrice:r.plus(e.div(2)),rectangleHeight:a}),u=f.max(a,u)}}const b=[];for(let t=1;t<g.length;t++){const e=g[t],{giveAmount:i,getAmount:n,price:r}=e,o=g[t-1],l=o.price,a=o.giveAmount,s=o.getAmount;if(!r.isNaN()&&r.gt(0)&&o){const e=r.minus(l).abs(),o=i.minus(a).abs(),d=n.minus(s).abs().multipliedBy(o);1===t&&b.push({area:n,price:r,middlePrice:r.minus(e.div(1.1)),rectangleHeight:d.plus(d.multipliedBy(.03))}),b.push({area:n,price:r,middlePrice:r.minus(e.div(2)),rectangleHeight:d}),c=f.max(d,c)}}const P=p.length>0?p[p.length-1]:g[0],N=g.length>0?g[0]:p[0],v=g.length>0?g[g.length-1]:p[0],H=P.price,S=v.price,k=N.price,X=new f(Math.log10(k.toNumber()));let B=H.gt(0)?new f(Math.log10(H.toNumber())):new f(-Math.log10(S.toNumber())),C=S.gt(0)?new f(Math.log10(S.toNumber())):new f(-Math.log10(H.toNumber()));const M=f.max(X.minus(B).abs(),C.minus(X).abs());return B=X.minus(M),C=X.plus(M),{leftStatAreaPoints:L,rightStatAreaPoints:b,maxLeftHeight:u.multipliedBy(1.2),maxRightHeight:c.multipliedBy(1.2),minXLN10:B,maxXLN10:C,middlePriceLN10:X}},[t])}({params:N}),O=P-30.13,z=n(null),D=e({grid:"#2A2A2D",midPriceLine:"#313335",leftBg:[0,B,1,"#31645d"],leftLine:"#55f6db",leftColor:"",rightBg:[0,B,1,"#67303d"],rightLine:"#ff4f73",rightColor:"",tooltipBg:"#121212",tooltipColor:void 0,textColor:"#606066"},W),G=e=>{var i;const{current:n}=z,r=e.target;if(r&&n){const e=null===(i=r.getStage())||void 0===i?void 0:i.getPointerPosition();if(e){const{x:i}=e,r=t/2;if(Math.abs(i-r)<=2)return;if(i<=2||t-i<=2)return;const a=S({x:i,width:t,minXLN10:J,maxXLN10:R});let s=null,d=[];const m=i<r;if(m){const t=H({areaPoints:j,targetPrice:a,isLeft:m});s=t.targetAreaStatPoint,d=t.targetAreaStatPoints}else{const t=H({areaPoints:q,targetPrice:a,isLeft:m});s=t.targetAreaStatPoint,d=t.targetAreaStatPoints}if(s){const e=X({target:s.middlePrice}),r=k({minXLN10:J,maxXLN10:R,width:t,targetLN10:e}),a=v({maxHeight:m?F:T,gridAreaHeight:O,value:s.rectangleHeight}),p=n.findOne("#tooltip"),g=n.findOne("#toolTipVertLine"),u=n.findOne("#joinCircle"),c=n.findOne("#tooltip-Text"),f=n.findOne("#tooltip-tag"),x=n.findOne("#priceTextLabel"),L=null==x?void 0:x.findOne("#priceTextLabel-text"),b=n.findOne("#area");null==p||p.position({x:r,y:a-5-6}),null==c||c.fill(D.tooltipColor||(m?"#00FAD9":"#FF5072")),null==c||c.text(m?o("pool.chart.liquidity-chart-buy",{amount:h(s.area),symbol:C,price:h(s.price)}):o("pool.chart.liquidity-chart-sell",{amount:h(s.area),symbol:M,price:h(s.price)})),p&&f&&(p.width()/2>i?(f.pointerDirection("left"),f.pointerHeight(15),f.pointerWidth(8),p.offsetX(-11),p.offsetY(-11)):p.width()/2+i>t?(f.pointerDirection("right"),f.pointerHeight(15),f.pointerWidth(8),p.offsetX(11),p.offsetY(-11)):(f.pointerDirection("down"),f.pointerHeight(8),f.pointerWidth(15),p.offsetX(0),p.offsetY(0))),null==g||g.points([r,O,r,a]),null==g||g.stroke(m?"#55f6db":"#ff4f73");let w=m?"rgb(86, 246, 218)":"#FF5072",A=m?"rgba(86, 246, 218, 0.3)":"rgba(255, 80, 114, 0.3)";D.leftLine&&D.rightLine&&(w=m?D.leftLine:D.rightLine,A=m?`rgba(${l(D.leftLine)}, 0.4)`:`rgba(${l(D.rightLine)}, 0.4)`),u&&(u.x(r),u.y(a),u.fill(w),u.stroke(A)),x&&(x.x(r),x.y(O+8.08+1),x.offsetX(x.width()/2),x.x()-x.width()/2<0?x.x(x.width()/2):x.x()+x.width()/2>t?x.x(t-x.width()/2):x.x(i)),L&&(L.fill(D.tooltipColor||(m?"#00FAD9":"#FF5072")),L.text(h(s.price)));const y=[];for(const e of d){const{middlePrice:i,rectangleHeight:n}=e,r=X({target:i}),o=k({minXLN10:J,maxXLN10:R,width:t,targetLN10:r}),l=v({maxHeight:m?F:T,gridAreaHeight:O,value:n});y.push(o,l+1)}const P=y.slice(),[N,H]=P;m?(P.push(r,a),P.push(r,O),P.push(N,O),P.push(N,H)):(P.unshift(N,O),P.unshift(r,O),P.unshift(r,a)),b&&(b.points(P),b.fill(m?D.leftLine||"#2c5b56":D.rightLine||"#7b3a48")),n.show()}}}},Q=function({gridAreaHeight:t,gridAreaWidth:e,horizontalLineCount:n,verticalLineCount:r,color:o="#2A2A2D"}){return i(()=>{const i=[],l=t/(n+1),s=[],d=e/(r+1);for(let t=0;t<n;t++){const n=l*(t+1);i.push([0,n,e,n])}for(let e=0;e<r;e++){const i=d*(e+1);s.push([i,0,i,t])}return x(L,{children:[i.map((t,e)=>b(a,{points:t,stroke:o,strokeWidth:1,lineCap:"round",lineJoin:"round",tension:1,listening:!1},e)),s.map((t,e)=>b(a,{points:t,stroke:o,strokeWidth:1,lineCap:"round",lineJoin:"round",tension:1,listening:!1},e))]})},[t,e,n,r,o])}({gridAreaHeight:O,gridAreaWidth:t,horizontalLineCount:9,verticalLineCount:7,color:D.grid}),E=function({minXLN10:t,maxXLN10:e,labelCount:n,gridAreaHeight:r,gridAreaWidth:o,color:l="#606066"}){return i(()=>{const i=o/(n+1),d=[],m=[];for(let l=0;l<n;l++){const n=i/2+i*l;d.push({x:n,y:r+10.08+1,text:h(S({x:i*(l+1),width:o,minXLN10:t,maxXLN10:e}))});const a=i*(l+1);m.push([a,r+1,a,r+4+1])}return x(L,{children:[d.map((t,e)=>b(s,{x:t.x,y:t.y,text:t.text,fontSize:14,fontFamily:"Manrope",fill:l,width:i,padding:0,align:"center",verticalAlign:"bottom",listening:!1},e)),m.map((t,e)=>b(a,{points:t,stroke:l,strokeWidth:1,lineCap:"butt",lineJoin:"miter",tension:1,listening:!1},e))]})},[t,e,r,o,n])}({gridAreaHeight:O,gridAreaWidth:t,labelCount:7,minXLN10:J,maxXLN10:R,color:D.textColor}),Y=function({gridAreaHeight:t,gridAreaWidth:e,color:n="#606066"}){return i(()=>{const i=e/2;return b(a,{points:[i,0,i,t-1],stroke:n,strokeWidth:1,lineCap:"round",lineJoin:"round",tension:1,listening:!1})},[t,e,n])}({gridAreaHeight:O,gridAreaWidth:t,color:D.midPriceLine}),{leftLine:V,rightLine:$}=function({leftStatAreaPoints:t,rightStatAreaPoints:e,minXLN10:n,maxXLN10:r,maxLeftHeight:o,maxRightHeight:l,gridAreaWidth:s,gridAreaHeight:d,colorMap:m}){return{leftLine:i(()=>{if(t.length<1)return b(L,{});const e=[];let i=d;for(const l of t){const{middlePrice:t,rectangleHeight:a}=l,m=X({target:t}),p=k({minXLN10:n,maxXLN10:r,width:s,targetLN10:m}),g=v({maxHeight:o,gridAreaHeight:d,value:a});e.push(p,g),g<i&&(i=g)}const l=e.slice(),[p,g]=l,u=l[l.length-1],c=l[l.length-2];return l.push(c,u),l.push(c,d),l.push(p,d),l.push(p,g),x(L,{children:[b(a,{points:l,closed:!0,listening:!1,lineCap:"round",lineJoin:"round",fillLinearGradientStartPoint:{x:0,y:d},fillLinearGradientEndPoint:{x:0,y:i},fillLinearGradientColorStops:m.leftBg}),b(a,{points:e,stroke:m.leftLine,strokeWidth:2,lineCap:"round",lineJoin:"round",listening:!1})]})},[t,s,n,r,d,o]),rightLine:i(()=>{if(e.length<1)return b(L,{});const t=[];let i=d;for(const o of e){const{middlePrice:e,rectangleHeight:a}=o,m=X({target:e}),p=k({minXLN10:n,maxXLN10:r,width:s,targetLN10:m}),g=v({maxHeight:l,gridAreaHeight:d,value:a});t.push(p,g),g<i&&(i=g)}const o=t.slice(),[p]=o;return o.unshift(p,d),o.unshift(s,d),x(L,{children:[b(a,{points:o,closed:!0,listening:!1,lineCap:"round",lineJoin:"round",fillLinearGradientStartPoint:{x:0,y:d},fillLinearGradientEndPoint:{x:0,y:i},fillLinearGradientColorStops:m.rightBg}),b(a,{points:t,stroke:m.rightLine,strokeWidth:2,lineCap:"round",lineJoin:"round",listening:!1})]})},[e,s,n,r,d,l])}}({leftStatAreaPoints:j,rightStatAreaPoints:q,minXLN10:J,maxXLN10:R,maxLeftHeight:F,maxRightHeight:T,gridAreaWidth:t,gridAreaHeight:O,colorMap:D});return x(d,{width:t,height:P,onMouseMove:G,onMouseOver:G,onMouseEnter:G,onMouseOut:()=>{const{current:t}=z;t&&t.hide()},children:[x(m,{children:[b(p,{x:0,y:0,width:t,height:O,stroke:D.grid,strokeWidth:1}),Q,E,V,$,Y]}),x(m,{ref:z,visible:!1,children:[b(a,{points:[],closed:!0,listening:!1,lineCap:"round",lineJoin:"round",id:"area"}),b(a,{points:[],strokeWidth:1,stroke:"#ff4f73",lineJoin:"round",lineCap:"round",dash:[4,6],id:"toolTipVertLine"}),b(g,{x:0,y:0,radius:5,fill:"#FF5072",stroke:"rgba(255, 80, 114, 0.3)",strokeWidth:12,id:"joinCircle"}),x(u,{listening:!1,x:0,y:0,id:"priceTextLabel",children:[b(c,{fill:D.tooltipBg,id:"priceTextLabel-tag"}),b(s,{text:"-",fontSize:14,fontFamily:"Manrope",padding:2,fill:"#FF5072",id:"priceTextLabel-text"})]}),x(u,{listening:!1,id:"tooltip",children:[b(c,{fill:D.tooltipBg,pointerDirection:"down",pointerWidth:15,pointerHeight:8,cornerRadius:8,lineJoin:"round",id:"tooltip-tag"}),b(s,{text:"",fontFamily:"Manrope",fontSize:12,lineHeight:17/12,padding:r,fill:"#FF5072",id:"tooltip-Text"})]})]})]})}const M=({width:t=834,height:e=462,baseTokenSymbol:i,quoteTokenSymbol:n,pmmModel:r,pmmParams:l,midPrice:a,notShowTipText:s,colorMap:d})=>x(P,{children:[void 0!==l&&void 0!==a&&void 0!==r&&void 0!==a&&b(C,{width:t,height:e,params:l,midPrice:a,pmmModel:r,baseTokenSymbol:i,quoteTokenSymbol:n,colorMap:d}),s?"":x(N,{children:["* ",o("pool.chart.liquidity-chart-tip",{baseTokenSymbol:i})]})]});export{M as default};
|
package/dist/index-BdB2BCQe.cjs
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("bignumber.js"),t=require("lodash"),i=require("react"),o=require("react-icons/bi"),r=require("@emotion/styled"),n=require("@emotion/react"),l=require("react-konva"),s=require("./helper-C1OYS4SC.cjs"),a=require("./index-Cm0O00ow.cjs"),u=require("react/jsx-runtime"),d=require("@dodoex/api");require("@lingui/core"),require("@dodoex/components"),require("@dodoex/dodo-contract-request"),require("@babel/runtime/helpers/interopRequireDefault"),require("@babel/runtime/helpers/defineProperty"),require("@lingui/react"),require("identicon.js"),require("zustand"),require("zustand/middleware"),require("@web3-react/core"),require("@web3-react/eip1193"),require("@web3-react/walletconnect-v2"),require("@web3-react/metamask"),require("@web3-react/types"),require("@tanstack/react-query"),require("@ethersproject/bignumber"),require("react-dom"),require("react-window"),require("dayjs"),require("dayjs/plugin/duration"),require("dayjs/plugin/localizedFormat"),require("dayjs/plugin/utc"),require("react-transition-group"),require("react-is"),require("@dodoex/contract-request"),require("axios"),require("recharts"),require("react-dom/client"),require("jsbi"),require("tiny-invariant"),require("@uniswap/sdk-core"),require("@uniswap/v2-sdk"),require("react-infinite-scroller"),require("d3"),require("rmc-date-picker"),require("rmc-date-picker/assets/index.css"),require("react-datetime/css/react-datetime.css");const c=r.input`
|
|
2
|
-
margin: 4px 10px 4px 6px;
|
|
3
|
-
border-radius: 10px;
|
|
4
|
-
border: 1px solid #373739;
|
|
5
|
-
padding: 4px 9px;
|
|
6
|
-
background-color: #1a1a1b;
|
|
7
|
-
color: #ffffff;
|
|
8
|
-
font-size: 14px;
|
|
9
|
-
font-weight: 400;
|
|
10
|
-
line-height: 20px;
|
|
11
|
-
outline: none;
|
|
12
|
-
width: 96px;
|
|
13
|
-
&:focus {
|
|
14
|
-
border-color: #fff;
|
|
15
|
-
|
|
16
|
-
${({error:e})=>e&&n.css`
|
|
17
|
-
border-color: red;
|
|
18
|
-
`}
|
|
19
|
-
}
|
|
20
|
-
`;const p="rgba(38, 39, 41, 0.3)";function m({width:o,height:r,midPrice:n,pmmModel:d,params:c,baseTokenSymbol:m,quoteTokenSymbol:g,baseMinAndZoomMultiples:h,colorMap:b,setBaseMinAndZoomMultiples:M}){const f=t.merge({grid:"#2A2A2D",midPriceLine:"#313335",leftBg:[0,p,1,"#31645d"],leftLine:"#55f6db",leftColor:"",rightBg:[0,p,1,"#67303d"],rightLine:"#ff4f73",rightColor:"",tooltipBg:"#121212",tooltipColor:void 0},b),x=o,P=r-18,v=x/7,{buyBaseVert:y,sellBaseVert:L}=s.computeBaseVert({midPrice:n,q:c.q,q0:c.q0,pmmModel:d}),q=y.div(P),B=L.div(P),z=i.useRef(null),j=i.useRef(null),{current:w}=z,T=i.useRef(0),k=i.useRef(),{horizontalGridLines:C,verticalGridLines:S}=function({chartHeight:e,chartWidth:t,horizontalLineCount:o,verticalLineCount:r}){return i.useMemo(()=>{const i=[],n=e/(o+1),l=[],s=t/r;for(let e=0;e<o;e++){const o=n*(e+1);i.push([0,o,t,o])}for(let t=0;t<r;t++){const i=s*t+s/2;l.push([i,0,i,e])}return{horizontalGridLines:i,verticalGridLines:l}},[e,t,o,r])}({chartHeight:P,chartWidth:x,horizontalLineCount:9,verticalLineCount:7}),{horizontalLabelTickPoints:A,horizontalLabelTextPoints:X}=function({chartHeight:e,chartWidth:t,xAxisPoints:o,oneXPx:r,baseMinAndZoomMultiples:n}){return i.useMemo(()=>{const i=s.computeXPortion(t,n.zoomMultiples),l=[],u=[];for(let t=0;t<o;t++){l.push([t*r+r/2,e,t*r+r/2,e+4]);const o=i.multipliedBy(t).multipliedBy(r).plus(i.multipliedBy(r/2)).toNumber(),s=n.baseMin.multipliedBy(10**o),d=t*r,c=e+2+4,p=a.formatShortNumber(s);u.push({x:d,y:c,text:p})}return{horizontalLabelTickPoints:l,horizontalLabelTextPoints:u}},[n.baseMin,n.zoomMultiples,e,t,r,o])}({chartHeight:P,chartWidth:x,xAxisPoints:7,oneXPx:v,baseMinAndZoomMultiples:h}),{quoteLinePoints:N,quoteLineAreaPoints:Z,quoteLineAreaLinearGradientEndPointY:W,baseLinePoints:F,baseLineAreaPoints:E,baseLineAreaLinearGradientEndPointY:G,midPriceLinePoints:H}=function({chartHeight:t,chartWidth:o,midPrice:r,xPoints:n,pmmModel:l,baseMinAndZoomMultiples:a,buyYPortion:u,sellYPortion:d}){return i.useMemo(()=>{const i=[],c=[],p=[],{baseMin:m,zoomMultiples:g}=a,h=s.computeXPortion(o,g),b=2*g,M=new e(b).div(n);let f=new e(Math.log(r.div(m).toNumber())/Math.log(10));f=e.minimum(b,f),f=e.maximum(0,f);for(let o=new e(0);o.lte(f);){const e=m.multipliedBy(10**o.toNumber()),r=s.evalPoint({val:e,model:l});if(!r.vert.isNaN()){const e=o.div(h).toNumber(),n=t-r.vert.div(u).toNumber();i.push(e,n)}o=o.plus(M)}for(let e=f;e.lte(b);){const i=m.multipliedBy(10**e.toNumber()),o=s.evalPoint({val:i,model:l});if(!o.vert.isNaN()){const i=e.div(h).toNumber(),r=t-o.vert.div(d).toNumber();c.push(i,r)}e=e.plus(M)}const x=f.div(h).toNumber(),[,P]=i,v=l.k.eq(0);v&&i.push(x,P||t),i.push(x,t),p.push(x,t,x,0);const y=s.evalPoint({val:m.multipliedBy(10**b),model:l});let L=t;const q=new e(b).div(h).toNumber();return y.vert.isNaN()||(L=t-y.vert.div(d).toNumber()),v&&c.length>=2&&(c.unshift(x,L),c.unshift(x,t)),c.push(q,L),f.lte(0)&&c.unshift(0,t),{quoteLinePoints:i,quoteLineAreaPoints:[0,t,0,P,...i],quoteLineAreaLinearGradientEndPointY:P,baseLinePoints:c,baseLineAreaPoints:[...c,q,t],baseLineAreaLinearGradientEndPointY:L,midPriceLinePoints:p}},[a,o,n,r,l,t,u,d])}({chartHeight:P,chartWidth:x,midPrice:n,xPoints:50,pmmModel:d,baseMinAndZoomMultiples:h,buyYPortion:q,sellYPortion:B}),D=e=>{var t;const i=e.target;if(i&&w){const e=null===(t=i.getStage())||void 0===t?void 0:t.getPointerPosition();if(e){const{x:t}=e;if(t>x)return void w.hide();s.updateTooltip({x:t,tooltip:w,buyBaseVert:y,sellBaseVert:L,chartWidth:x,chartHeight:P,midPrice:n,pmmModel:d,baseTokenSymbol:m,quoteTokenSymbol:g,baseMinAndZoomMultiples:h,t:s.chartT,isHover:!0,color:f.tooltipColor,leftColor:f.leftLine,rightColor:f.rightLine})}}},R=i.useMemo(()=>t.throttle(e=>{const{target:t}=e,i=t.getStage();if(i){i.container().style.cursor="grabbing";const e=null==i?void 0:i.getPointerPosition();if(e){const t=e.x-T.current;T.current=e.x,k.current=e.x,M(e=>void 0===e.baseMin?e:{baseMin:s.computeBaseMinByDistance({dragDistance:t,prevBaseMin:e.baseMin,chartWidth:x,zoomMultiples:e.zoomMultiples}),zoomMultiples:e.zoomMultiples,targetMarginPriceX:0})}}},100),[x,M]),Y=i.useMemo(()=>t.throttle(e=>{e.cancelBubble=!0,e.evt.preventDefault();const t=e.evt.deltaY<0;M(e=>{const i=s.computeZoomMultiplesWhenZoom({zoomIn:t,prevZoomMultiples:e.zoomMultiples});return{baseMin:s.computeBaseAfterZoom({midPrice:n,zoomMultiples:i}),zoomMultiples:i,targetMarginPriceX:e.targetMarginPriceX}})},100),[n,M]);return i.useEffect(()=>{h.targetMarginPriceX>0&&null!==w?s.updateTooltip({x:h.targetMarginPriceX,tooltip:w,buyBaseVert:y,sellBaseVert:L,chartWidth:x,chartHeight:P,midPrice:n,pmmModel:d,baseTokenSymbol:m,quoteTokenSymbol:g,baseMinAndZoomMultiples:h,t:s.chartT,color:f.tooltipColor,leftColor:f.leftLine,rightColor:f.rightLine}):void 0!==k.current&&null!==w&&s.updateTooltip({x:k.current,tooltip:w,buyBaseVert:y,sellBaseVert:L,chartWidth:x,chartHeight:P,midPrice:n,pmmModel:d,baseTokenSymbol:m,quoteTokenSymbol:g,baseMinAndZoomMultiples:h,t:s.chartT,isHover:!0,color:f.tooltipColor,leftColor:f.leftLine,rightColor:f.rightLine})},[h,m,y,P,x,f.leftLine,f.rightLine,f.tooltipColor,n,d,g,L,w]),u.jsxs(l.Stage,{ref:j,width:o,offsetY:-s.chartOffsetYBCToolTip,height:r+s.chartOffsetYBCToolTip,draggable:!0,dragBoundFunc:function(){return{x:this.absolutePosition().x,y:this.absolutePosition().y}},onMouseMove:D,onMouseOver:D,onMouseOut:()=>{w&&w.hide()},onDragStart:function(e){const{target:t}=e,i=t.getStage();if(i){const e=i.getPointerPosition();e&&(T.current=e.x)}},onDragMove:R,onDragEnd:e=>{const{target:t}=e,i=t.getStage();i&&(i.container().style.cursor="pointer")},onWheel:Y,children:[u.jsxs(l.Layer,{children:[u.jsx(l.Rect,{x:0,y:0,width:o,height:P,stroke:f.grid,strokeWidth:1}),C.map((e,t)=>u.jsx(l.Line,{points:e,stroke:f.grid,strokeWidth:1,lineCap:"round",lineJoin:"round",listening:!1},t)),S.map((e,t)=>u.jsx(l.Line,{points:e,stroke:f.grid,strokeWidth:1,lineCap:"round",lineJoin:"round",listening:!1},t)),A.map((e,t)=>u.jsx(l.Line,{points:e,stroke:"#9d9d9d",strokeWidth:1,lineCap:"round",lineJoin:"round",listening:!1},t)),X.map((e,t)=>u.jsx(l.Text,{x:e.x,y:e.y,text:e.text,fontFamily:"Manrope",fontSize:12,fill:"#9d9d9d",width:v,padding:0,align:"center",verticalAlign:"bottom",listening:!1},t)),u.jsx(l.Line,{points:Z,closed:!0,listening:!1,lineCap:"round",lineJoin:"round",fillLinearGradientStartPoint:{x:0,y:P},fillLinearGradientEndPoint:{x:0,y:W},fillLinearGradientColorStops:f.leftBg}),u.jsx(l.Line,{points:N,stroke:f.leftLine,strokeWidth:2,lineCap:"round",lineJoin:"round",listening:!1}),u.jsx(l.Line,{points:E,closed:!0,listening:!1,lineCap:"round",lineJoin:"round",fillLinearGradientStartPoint:{x:x,y:P},fillLinearGradientEndPoint:{x:x,y:G},fillLinearGradientColorStops:f.rightBg}),u.jsx(l.Line,{points:F,stroke:f.rightLine,strokeWidth:2,lineCap:"round",lineJoin:"round",listening:!1}),u.jsx(l.Line,{points:H,stroke:f.midPriceLine,strokeWidth:2,lineCap:"round",lineJoin:"round",listening:!1})]}),u.jsxs(l.Layer,{ref:z,visible:!1,listening:!1,children:[u.jsx(l.Line,{points:[],stroke:"#ff4f73",strokeWidth:1,lineCap:"round",lineJoin:"round",dash:[4,6],id:"toolTipVertLine"}),u.jsx(l.Line,{points:[],stroke:"ff4f73",strokeWidth:1,lineCap:"round",lineJoin:"round",dash:[4,6],id:"toolTipHoriLine"}),u.jsx(l.Circle,{x:0,y:0,radius:5,fill:"#FF5072",stroke:"rgba(255, 80, 114, 0.3)",strokeWidth:12,id:"joinCircle"}),u.jsxs(l.Label,{x:0,y:0,id:"priceTextLabel",children:[u.jsx(l.Tag,{fill:f.tooltipBg,id:"priceTextLabel-tag"}),u.jsx(l.Text,{text:"",fontSize:12,fontFamily:"Manrope",padding:4,fill:"#FF5072",id:"priceTextLabel-text"})]}),u.jsxs(l.Label,{x:0,y:0,id:"slippageTextLabel",children:[u.jsx(l.Tag,{fill:f.tooltipBg,id:"slippageTextLabel-tag"}),u.jsx(l.Text,{text:"",fontSize:12,fontFamily:"Manrope",padding:4,fill:"#FF5072",id:"slippageTextLabel-text"})]}),u.jsxs(l.Label,{x:0,y:0,id:"toolTip",children:[u.jsx(l.Tag,{fill:f.tooltipBg,pointerDirection:"down",pointerWidth:15,pointerHeight:8,cornerRadius:8,lineJoin:"round",id:"toolTip-tag"}),u.jsx(l.Text,{text:"-",fontSize:12,lineHeight:17/12,padding:s.labelPadding,fontFamily:"Manrope",fill:"#FFFFFF",id:"toolTip-text"})]})]})]})}const g=r.button`
|
|
21
|
-
margin: 0;
|
|
22
|
-
border: none;
|
|
23
|
-
padding: 0;
|
|
24
|
-
background: none;
|
|
25
|
-
|
|
26
|
-
&:focus {
|
|
27
|
-
outline: none;
|
|
28
|
-
}
|
|
29
|
-
&:active {
|
|
30
|
-
outline: none;
|
|
31
|
-
}
|
|
32
|
-
`,h=r.div`
|
|
33
|
-
height: 100%;
|
|
34
|
-
`,b=r.div`
|
|
35
|
-
display: flex;
|
|
36
|
-
align-items: center;
|
|
37
|
-
`,M=r.div`
|
|
38
|
-
border: 1px solid ${({borderColor:e})=>e||"#2a2a2d"};
|
|
39
|
-
flex: 1 0 50%;
|
|
40
|
-
|
|
41
|
-
display: flex;
|
|
42
|
-
align-items: center;
|
|
43
|
-
justify-content: center;
|
|
44
|
-
font-size: 12px;
|
|
45
|
-
font-weight: 400;
|
|
46
|
-
line-height: 17px;
|
|
47
|
-
color: #606066;
|
|
48
|
-
|
|
49
|
-
& + & {
|
|
50
|
-
border-left: none;
|
|
51
|
-
}
|
|
52
|
-
`,f=r.span`
|
|
53
|
-
color: #85858d;
|
|
54
|
-
`,x=r.div`
|
|
55
|
-
margin-top: 20px;
|
|
56
|
-
display: flex;
|
|
57
|
-
justify-content: center;
|
|
58
|
-
margin-bottom: 9px;
|
|
59
|
-
`,P=r(g)`
|
|
60
|
-
border-radius: 13px;
|
|
61
|
-
background-color: #373739;
|
|
62
|
-
width: 24px;
|
|
63
|
-
height: 24px;
|
|
64
|
-
font-size: 18px;
|
|
65
|
-
color: #85858d;
|
|
66
|
-
line-height: 0;
|
|
67
|
-
& + & {
|
|
68
|
-
margin-left: 10px;
|
|
69
|
-
}
|
|
70
|
-
&:first-child,
|
|
71
|
-
&:last-child {
|
|
72
|
-
font-size: 20px;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
&:hover {
|
|
76
|
-
color: #fff;
|
|
77
|
-
}
|
|
78
|
-
`;function v({params:t,target:i,isBuy:o=!0}){const r=new e(t.b),n=new e(t.q);let l=new e(t.b0);const s=new e(t.q0),a=new e(t.i),u=new e(t.k),{R:c}=t;1===c&&l.eq(r)&&(l=d.solveQuadraticFunctionForTarget(r,n.minus(s),new e(1).div(a),u));const p=o?r.plus(i):r.minus(i);if(p.lt(l)||r.eq(l)){let t=l.multipliedBy(l).div(p).div(p);return t=new e(1).minus(u).plus(u.multipliedBy(t)),a.multipliedBy(t)}const m=new d.PMMModel;m.RStatus=c,m.B=r,m.B0=l,m.Q=n,m.Q0=s,m.i=a,m.k=u,m.mtFeeRate=new e(0),m.lpFeeRate=new e(0);let g=new e(0);g=o?m.querySellBase(i):m.queryBuyBase(i);const h=o?n.minus(g):n.plus(g);let b=s.multipliedBy(s).div(h).div(h);return b=new e(1).minus(u).plus(u.multipliedBy(b)),a.div(b)}exports.default=({chartId:r,width:n=834,height:l=460,baseTokenSymbol:d,quoteTokenSymbol:p,pmmModel:g,pmmParams:y,midPrice:L=new e(0),colorMap:q,notShowAmountInput:B})=>{(({id:e})=>{i.useEffect(()=>{function t(e){e.preventDefault()}let i=!1;try{const e={get passive(){return i=!0,!1}};window.addEventListener("test",()=>{},e),window.removeEventListener("test",()=>{})}catch(e){i=!1}const o=document.getElementById(e),r=!!i&&{passive:!1};return null==o||o.addEventListener("wheel",t,r),()=>{null==o||o.removeEventListener("wheel",t)}},[e])})({id:r});const[z,j]=i.useState(""),[w,T]=i.useState(""),[k,C]=i.useState("-"),[S,A]=i.useState("-"),[X,N]=i.useState({baseMin:new e(0),zoomMultiples:s.baseZoomMultiples,targetMarginPriceX:0});i.useEffect(()=>{void 0!==L&&N(e=>({baseMin:s.computeBaseAfterZoom({midPrice:L,zoomMultiples:e.zoomMultiples}),zoomMultiples:e.zoomMultiples,targetMarginPriceX:e.targetMarginPriceX}))},[L]);const Z=i.useMemo(()=>t.debounce(({type:t,amount:i})=>{""===i&&L&&(N({baseMin:s.computeBaseAfterZoom({midPrice:L,zoomMultiples:s.baseZoomMultiples}),zoomMultiples:s.baseZoomMultiples,targetMarginPriceX:0}),"buy"===t?C("-"):A("-"));const o=new e(i);if(!o.lte(0)&&!o.isNaN()&&(null==y?void 0:y.b)&&!o.gte(y.b)&&L)if("buy"===t){const e=v({params:y,target:o});N(i=>{const o=s.beforePriceImpactEffect({currentBaseMinAndZoomMultiples:i,targetPrice:e,midPrice:L,width:n});if(o.isSkip)return{baseMin:i.baseMin,zoomMultiples:i.zoomMultiples,targetMarginPriceX:o.targetX};if(o.targetX>0)return{baseMin:o.baseMin,zoomMultiples:o.zoomMultiples,targetMarginPriceX:o.targetX};const r=s.computeTargetXByTargetPrice({midPrice:L,width:n,type:t,targetPrice:e}),l=r.zoomMultiples.dp(6).toNumber();return{baseMin:s.computeBaseAfterZoom({midPrice:L,zoomMultiples:l}),zoomMultiples:l,targetMarginPriceX:r.targetX}}),C(`${a.formatPercentageNumber({input:e.minus(L).div(L)})}`)}else{const e=function({params:e,target:t}){return v({params:e,target:t,isBuy:!1})}({params:y,target:o});N(i=>{const o=s.beforePriceImpactEffect({currentBaseMinAndZoomMultiples:i,targetPrice:e,midPrice:L,width:n});if(o.isSkip)return{baseMin:i.baseMin,zoomMultiples:i.zoomMultiples,targetMarginPriceX:o.targetX};if(o.targetX>0)return{baseMin:o.baseMin,zoomMultiples:o.zoomMultiples,targetMarginPriceX:o.targetX};const r=s.computeTargetXByTargetPrice({midPrice:L,width:n,type:t,targetPrice:e}),l=r.zoomMultiples.dp(6).toNumber();return{baseMin:s.computeBaseAfterZoom({midPrice:L,zoomMultiples:l}),zoomMultiples:l,targetMarginPriceX:r.targetX}}),A(`+${a.formatPercentageNumber({input:e.minus(L).div(L)})}`)}},300),[y,L,n]);i.useEffect(()=>{void 0!==z&&Z({type:"buy",amount:z})},[Z,z]),i.useEffect(()=>{void 0!==w&&Z({type:"sell",amount:w})},[Z,w]);const W=e=>{let t=0;t=e?-.1*n:.1*n,N(e=>void 0===e.baseMin?e:{baseMin:s.computeBaseMinByDistance({dragDistance:t,prevBaseMin:e.baseMin,chartWidth:n,zoomMultiples:e.zoomMultiples}),zoomMultiples:e.zoomMultiples,targetMarginPriceX:e.targetMarginPriceX})},F=e=>{N(t=>{const i=s.computeZoomMultiplesWhenZoom({zoomIn:null!=e&&e,prevZoomMultiples:t.zoomMultiples});return{baseMin:s.computeBaseAfterZoom({midPrice:L,zoomMultiples:i}),zoomMultiples:i,targetMarginPriceX:t.targetMarginPriceX}})},E=i.useMemo(()=>{if(""===z)return!1;const t=new e(z);return!(!t.lte(0)&&!t.isNaN()&&(null==y?void 0:y.b)&&!t.gte(y.b))},[z,y]),G=i.useMemo(()=>{if(""===w)return!1;const t=new e(w);return!(!t.lte(0)&&!t.isNaN()&&(null==y?void 0:y.b)&&!t.gte(y.b))},[w,y]);return u.jsxs(h,{id:r,children:[B?"":u.jsxs(b,{children:[u.jsxs(M,{borderColor:q&&q.grid,children:[s.chartT("pool.chart.buy-amount",{symbol:d}),u.jsx(c,{value:z,error:E,onChange:e=>{const t=a.fixedInputStringToFormattedNumber(e.target.value,2);null!==t&&j(t)}}),u.jsx(f,{children:s.chartT("pool.chart.price-impact",{amount:k})})]}),u.jsxs(M,{borderColor:q&&q.grid,children:[s.chartT("pool.chart.sell-amount",{symbol:d}),u.jsx(c,{value:w,error:G,onChange:e=>{const t=a.fixedInputStringToFormattedNumber(e.target.value,2);null!==t&&T(t)}}),u.jsx(f,{children:s.chartT("pool.chart.price-impact",{amount:S})})]})]}),void 0!==y&&void 0!==L&&void 0!==g&&void 0!==X.baseMin&&void 0!==L&&u.jsx(m,{width:n,height:l,params:y,midPrice:L,pmmModel:g,baseTokenSymbol:d,quoteTokenSymbol:p,baseMinAndZoomMultiples:X,colorMap:q,setBaseMinAndZoomMultiples:N}),u.jsxs(x,{className:"operate-btn-wrapper",children:[u.jsx(P,{onClick:()=>W(!0),children:u.jsx(o.BiChevronLeft,{})}),u.jsx(P,{onClick:()=>F(!1),children:u.jsx(o.BiMinus,{})}),u.jsx(P,{onClick:()=>F(!0),children:u.jsx(o.BiPlus,{})}),u.jsx(P,{onClick:()=>W(!1),children:u.jsx(o.BiChevronRight,{})})]})]})};
|
package/dist/index-CQl4nYsF.cjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@emotion/styled"),t=require("lodash"),i=require("react"),r=require("./helper-C1OYS4SC.cjs"),n=require("react-konva"),o=require("./index-Cm0O00ow.cjs"),a=require("bignumber.js"),l=require("react/jsx-runtime"),s=require("@dodoex/api");require("@lingui/core"),require("@dodoex/components"),require("@dodoex/dodo-contract-request"),require("@babel/runtime/helpers/interopRequireDefault"),require("@babel/runtime/helpers/defineProperty"),require("@lingui/react"),require("identicon.js"),require("zustand"),require("zustand/middleware"),require("@web3-react/core"),require("@web3-react/eip1193"),require("@web3-react/walletconnect-v2"),require("@web3-react/metamask"),require("@web3-react/types"),require("@tanstack/react-query"),require("@ethersproject/bignumber"),require("react-dom"),require("react-window"),require("dayjs"),require("dayjs/plugin/duration"),require("dayjs/plugin/localizedFormat"),require("dayjs/plugin/utc"),require("react-transition-group"),require("react-is"),require("@dodoex/contract-request"),require("axios"),require("recharts"),require("react-dom/client"),require("jsbi"),require("tiny-invariant"),require("@uniswap/sdk-core"),require("@uniswap/v2-sdk"),require("react-infinite-scroller"),require("d3"),require("rmc-date-picker"),require("rmc-date-picker/assets/index.css"),require("react-datetime/css/react-datetime.css");const u=e.div`
|
|
2
|
-
height: 100%;
|
|
3
|
-
position: relative;
|
|
4
|
-
`,d=e.div`
|
|
5
|
-
text-align: center;
|
|
6
|
-
margin-top: 17.1px;
|
|
7
|
-
margin-bottom: 88.41px;
|
|
8
|
-
color: #606066;
|
|
9
|
-
font-size: 12px;
|
|
10
|
-
line-height: 17px;
|
|
11
|
-
font-weight: 400;
|
|
12
|
-
`;function g({maxHeight:e,gridAreaHeight:t,value:i}){const r=new a(t).minus(36),n=r.div(e);return r.minus(i.multipliedBy(n)).plus(36).toNumber()}function c({targetPrice:e,areaPoints:t,isLeft:i}){for(let r=0;r<t.length;r++){const n=t[r],o=r<t.length-1?t[r+1]:null;if(!o)return{targetAreaStatPoint:n,targetAreaStatPoints:t};if(i){if(e.lte(n.middlePrice)&&e.gte(o.middlePrice))return{targetAreaStatPoint:n,targetAreaStatPoints:t.slice(0,r+1)}}else if(e.gte(n.middlePrice)&&e.lte(o.middlePrice))return{targetAreaStatPoint:n,targetAreaStatPoints:t.slice(0,r+1)}}return{targetAreaStatPoint:null,targetAreaStatPoints:[]}}function h({x:e,width:t,minXLN10:i,maxXLN10:r}){const n=new a(e).div(t).multipliedBy(r.minus(i)).plus(i);return new a(10**n.toNumber())}function m({width:e,targetLN10:t,minXLN10:i,maxXLN10:r}){return t.minus(i).div(r.minus(i)).multipliedBy(e).toNumber()}function p({target:e}){return new a(Math.log10(e.toNumber()))}const f="rgba(38, 39, 41, 0.3)";function x({width:e,height:u,params:d,baseTokenSymbol:x,quoteTokenSymbol:L,colorMap:b}){const{maxLeftHeight:w,maxRightHeight:A,leftStatAreaPoints:y,rightStatAreaPoints:N,minXLN10:q,maxXLN10:P}=function({params:e}){return i.useMemo(()=>{const t=new a(e.b),i=new a(e.q);let r=new a(e.b0);const n=new a(e.q0),o=new a(e.i),l=new a(e.k),{R:u}=e;1===u&&r.eq(t)&&(r=s.solveQuadraticFunctionForTarget(t,i.minus(n),new a(1).div(o),l));const d=new s.PMMState({i:o,K:l,B:t,Q:i,B0:r,Q0:n,R:u,mtFeeRate:new a(0),lpFeeRate:new a(0)}),g=new s.PMMHelper,c=new a(d.B),h=[],m=[];let p=new a(0),f=new a(0);const x=g.GetMidPrice(d),L=i.gt(0)?t.div(i):new a(1);for(let e=0;e<=250;e++){let t=c.multipliedBy(e/100).multipliedBy(x.multipliedBy(L).multipliedBy(4));0===e&&(t=c.multipliedBy(1e-11));const i=null==g?void 0:g.QuerySellBase(t,d);if(!i.isNaN()&&i.gt(0)){const e=i.div(t);h.push({giveAmount:t,getAmount:i,price:e});continue}h.push({giveAmount:t,getAmount:new a(0),price:new a(0)})}for(let e=0;e<=250;e++){let t=c.multipliedBy(e/100).multipliedBy(x.multipliedBy(4));0===e&&(t=c.multipliedBy(1e-11));const i=null==g?void 0:g.QuerySellQuote(t,d);if(!i.isNaN()&&i.gt(0)){const e=t.dividedBy(i);m.push({giveAmount:t,getAmount:i,price:e});continue}m.push({giveAmount:t,getAmount:new a(0),price:new a(0)})}if(h.length<2&&m.length<2)return{leftStatAreaPoints:[],rightStatAreaPoints:[],maxLeftHeight:new a(10).multipliedBy(1.2),maxRightHeight:new a(10).multipliedBy(1.2),middlePriceLN10:new a(0),minXLN10:new a(-1),maxXLN10:new a(1)};const b=[];for(let e=1;e<h.length;e++){const t=h[e],{giveAmount:i,getAmount:r,price:n}=t,o=h[e-1];if(!n.isNaN()&&n.gt(0)&&o){const t=n.minus(o.price).abs(),l=i.minus(o.giveAmount).abs(),s=r.minus(o.getAmount).abs().multipliedBy(l);1===e&&b.push({area:r,price:n,middlePrice:n.plus(t.div(1.1)),rectangleHeight:s.plus(s.multipliedBy(.03))}),b.push({area:r,price:n,middlePrice:n.plus(t.div(2)),rectangleHeight:s}),p=a.max(s,p)}}const w=[];for(let e=1;e<m.length;e++){const t=m[e],{giveAmount:i,getAmount:r,price:n}=t,o=m[e-1],l=o.price,s=o.giveAmount,u=o.getAmount;if(!n.isNaN()&&n.gt(0)&&o){const t=n.minus(l).abs(),o=i.minus(s).abs(),d=r.minus(u).abs().multipliedBy(o);1===e&&w.push({area:r,price:n,middlePrice:n.minus(t.div(1.1)),rectangleHeight:d.plus(d.multipliedBy(.03))}),w.push({area:r,price:n,middlePrice:n.minus(t.div(2)),rectangleHeight:d}),f=a.max(d,f)}}const A=h.length>0?h[h.length-1]:m[0],y=m.length>0?m[0]:h[0],N=m.length>0?m[m.length-1]:h[0],q=A.price,P=N.price,v=y.price,S=new a(Math.log10(v.toNumber()));let j=q.gt(0)?new a(Math.log10(q.toNumber())):new a(-Math.log10(P.toNumber())),H=P.gt(0)?new a(Math.log10(P.toNumber())):new a(-Math.log10(q.toNumber()));const k=a.max(S.minus(j).abs(),H.minus(S).abs());return j=S.minus(k),H=S.plus(k),{leftStatAreaPoints:b,rightStatAreaPoints:w,maxLeftHeight:p.multipliedBy(1.2),maxRightHeight:f.multipliedBy(1.2),minXLN10:j,maxXLN10:H,middlePriceLN10:S}},[e])}({params:d}),v=u-30.13,S=i.useRef(null),j=t.merge({grid:"#2A2A2D",midPriceLine:"#313335",leftBg:[0,f,1,"#31645d"],leftLine:"#55f6db",leftColor:"",rightBg:[0,f,1,"#67303d"],rightLine:"#ff4f73",rightColor:"",tooltipBg:"#121212",tooltipColor:void 0,textColor:"#606066"},b),H=t=>{var i;const{current:n}=S,a=t.target;if(a&&n){const t=null===(i=a.getStage())||void 0===i?void 0:i.getPointerPosition();if(t){const{x:i}=t,a=e/2;if(Math.abs(i-a)<=2)return;if(i<=2||e-i<=2)return;const l=h({x:i,width:e,minXLN10:q,maxXLN10:P});let s=null,u=[];const d=i<a;if(d){const e=c({areaPoints:y,targetPrice:l,isLeft:d});s=e.targetAreaStatPoint,u=e.targetAreaStatPoints}else{const e=c({areaPoints:N,targetPrice:l,isLeft:d});s=e.targetAreaStatPoint,u=e.targetAreaStatPoints}if(s){const t=p({target:s.middlePrice}),a=m({minXLN10:q,maxXLN10:P,width:e,targetLN10:t}),l=g({maxHeight:d?w:A,gridAreaHeight:v,value:s.rectangleHeight}),c=n.findOne("#tooltip"),h=n.findOne("#toolTipVertLine"),f=n.findOne("#joinCircle"),b=n.findOne("#tooltip-Text"),y=n.findOne("#tooltip-tag"),N=n.findOne("#priceTextLabel"),S=null==N?void 0:N.findOne("#priceTextLabel-text"),H=n.findOne("#area");null==c||c.position({x:a,y:l-5-6}),null==b||b.fill(j.tooltipColor||(d?"#00FAD9":"#FF5072")),null==b||b.text(d?r.chartT("pool.chart.liquidity-chart-buy",{amount:o.formatShortNumber(s.area),symbol:x,price:o.formatShortNumber(s.price)}):r.chartT("pool.chart.liquidity-chart-sell",{amount:o.formatShortNumber(s.area),symbol:L,price:o.formatShortNumber(s.price)})),c&&y&&(c.width()/2>i?(y.pointerDirection("left"),y.pointerHeight(15),y.pointerWidth(8),c.offsetX(-11),c.offsetY(-11)):c.width()/2+i>e?(y.pointerDirection("right"),y.pointerHeight(15),y.pointerWidth(8),c.offsetX(11),c.offsetY(-11)):(y.pointerDirection("down"),y.pointerHeight(8),y.pointerWidth(15),c.offsetX(0),c.offsetY(0))),null==h||h.points([a,v,a,l]),null==h||h.stroke(d?"#55f6db":"#ff4f73");let k=d?"rgb(86, 246, 218)":"#FF5072",X=d?"rgba(86, 246, 218, 0.3)":"rgba(255, 80, 114, 0.3)";j.leftLine&&j.rightLine&&(k=d?j.leftLine:j.rightLine,X=d?`rgba(${r.colorRgb(j.leftLine)}, 0.4)`:`rgba(${r.colorRgb(j.rightLine)}, 0.4)`),f&&(f.x(a),f.y(l),f.fill(k),f.stroke(X)),N&&(N.x(a),N.y(v+8.08+1),N.offsetX(N.width()/2),N.x()-N.width()/2<0?N.x(N.width()/2):N.x()+N.width()/2>e?N.x(e-N.width()/2):N.x(i)),S&&(S.fill(j.tooltipColor||(d?"#00FAD9":"#FF5072")),S.text(o.formatShortNumber(s.price)));const M=[];for(const t of u){const{middlePrice:i,rectangleHeight:r}=t,n=p({target:i}),o=m({minXLN10:q,maxXLN10:P,width:e,targetLN10:n}),a=g({maxHeight:d?w:A,gridAreaHeight:v,value:r});M.push(o,a+1)}const B=M.slice(),[C,F]=B;d?(B.push(a,l),B.push(a,v),B.push(C,v),B.push(C,F)):(B.unshift(C,v),B.unshift(a,v),B.unshift(a,l)),H&&(H.points(B),H.fill(d?j.leftLine||"#2c5b56":j.rightLine||"#7b3a48")),n.show()}}}},k=function({gridAreaHeight:e,gridAreaWidth:t,horizontalLineCount:r,verticalLineCount:o,color:a="#2A2A2D"}){return i.useMemo(()=>{const i=[],s=e/(r+1),u=[],d=t/(o+1);for(let e=0;e<r;e++){const r=s*(e+1);i.push([0,r,t,r])}for(let t=0;t<o;t++){const i=d*(t+1);u.push([i,0,i,e])}return l.jsxs(l.Fragment,{children:[i.map((e,t)=>l.jsx(n.Line,{points:e,stroke:a,strokeWidth:1,lineCap:"round",lineJoin:"round",tension:1,listening:!1},t)),u.map((e,t)=>l.jsx(n.Line,{points:e,stroke:a,strokeWidth:1,lineCap:"round",lineJoin:"round",tension:1,listening:!1},t))]})},[e,t,r,o,a])}({gridAreaHeight:v,gridAreaWidth:e,horizontalLineCount:9,verticalLineCount:7,color:j.grid}),X=function({minXLN10:e,maxXLN10:t,labelCount:r,gridAreaHeight:a,gridAreaWidth:s,color:u="#606066"}){return i.useMemo(()=>{const i=s/(r+1),d=[],g=[];for(let n=0;n<r;n++){const r=i/2+i*n;d.push({x:r,y:a+10.08+1,text:o.formatShortNumber(h({x:i*(n+1),width:s,minXLN10:e,maxXLN10:t}))});const l=i*(n+1);g.push([l,a+1,l,a+4+1])}return l.jsxs(l.Fragment,{children:[d.map((e,t)=>l.jsx(n.Text,{x:e.x,y:e.y,text:e.text,fontSize:14,fontFamily:"Manrope",fill:u,width:i,padding:0,align:"center",verticalAlign:"bottom",listening:!1},t)),g.map((e,t)=>l.jsx(n.Line,{points:e,stroke:u,strokeWidth:1,lineCap:"butt",lineJoin:"miter",tension:1,listening:!1},t))]})},[e,t,a,s,r])}({gridAreaHeight:v,gridAreaWidth:e,labelCount:7,minXLN10:q,maxXLN10:P,color:j.textColor}),M=function({gridAreaHeight:e,gridAreaWidth:t,color:r="#606066"}){return i.useMemo(()=>{const i=t/2;return l.jsx(n.Line,{points:[i,0,i,e-1],stroke:r,strokeWidth:1,lineCap:"round",lineJoin:"round",tension:1,listening:!1})},[e,t,r])}({gridAreaHeight:v,gridAreaWidth:e,color:j.midPriceLine}),{leftLine:B,rightLine:C}=function({leftStatAreaPoints:e,rightStatAreaPoints:t,minXLN10:r,maxXLN10:o,maxLeftHeight:a,maxRightHeight:s,gridAreaWidth:u,gridAreaHeight:d,colorMap:c}){return{leftLine:i.useMemo(()=>{if(e.length<1)return l.jsx(l.Fragment,{});const t=[];let i=d;for(const n of e){const{middlePrice:e,rectangleHeight:l}=n,s=p({target:e}),c=m({minXLN10:r,maxXLN10:o,width:u,targetLN10:s}),h=g({maxHeight:a,gridAreaHeight:d,value:l});t.push(c,h),h<i&&(i=h)}const s=t.slice(),[h,f]=s,x=s[s.length-1],L=s[s.length-2];return s.push(L,x),s.push(L,d),s.push(h,d),s.push(h,f),l.jsxs(l.Fragment,{children:[l.jsx(n.Line,{points:s,closed:!0,listening:!1,lineCap:"round",lineJoin:"round",fillLinearGradientStartPoint:{x:0,y:d},fillLinearGradientEndPoint:{x:0,y:i},fillLinearGradientColorStops:c.leftBg}),l.jsx(n.Line,{points:t,stroke:c.leftLine,strokeWidth:2,lineCap:"round",lineJoin:"round",listening:!1})]})},[e,u,r,o,d,a]),rightLine:i.useMemo(()=>{if(t.length<1)return l.jsx(l.Fragment,{});const e=[];let i=d;for(const n of t){const{middlePrice:t,rectangleHeight:a}=n,l=p({target:t}),c=m({minXLN10:r,maxXLN10:o,width:u,targetLN10:l}),h=g({maxHeight:s,gridAreaHeight:d,value:a});e.push(c,h),h<i&&(i=h)}const a=e.slice(),[h]=a;return a.unshift(h,d),a.unshift(u,d),l.jsxs(l.Fragment,{children:[l.jsx(n.Line,{points:a,closed:!0,listening:!1,lineCap:"round",lineJoin:"round",fillLinearGradientStartPoint:{x:0,y:d},fillLinearGradientEndPoint:{x:0,y:i},fillLinearGradientColorStops:c.rightBg}),l.jsx(n.Line,{points:e,stroke:c.rightLine,strokeWidth:2,lineCap:"round",lineJoin:"round",listening:!1})]})},[t,u,r,o,d,s])}}({leftStatAreaPoints:y,rightStatAreaPoints:N,minXLN10:q,maxXLN10:P,maxLeftHeight:w,maxRightHeight:A,gridAreaWidth:e,gridAreaHeight:v,colorMap:j});return l.jsxs(n.Stage,{width:e,height:u,onMouseMove:H,onMouseOver:H,onMouseEnter:H,onMouseOut:()=>{const{current:e}=S;e&&e.hide()},children:[l.jsxs(n.Layer,{children:[l.jsx(n.Rect,{x:0,y:0,width:e,height:v,stroke:j.grid,strokeWidth:1}),k,X,B,C,M]}),l.jsxs(n.Layer,{ref:S,visible:!1,children:[l.jsx(n.Line,{points:[],closed:!0,listening:!1,lineCap:"round",lineJoin:"round",id:"area"}),l.jsx(n.Line,{points:[],strokeWidth:1,stroke:"#ff4f73",lineJoin:"round",lineCap:"round",dash:[4,6],id:"toolTipVertLine"}),l.jsx(n.Circle,{x:0,y:0,radius:5,fill:"#FF5072",stroke:"rgba(255, 80, 114, 0.3)",strokeWidth:12,id:"joinCircle"}),l.jsxs(n.Label,{listening:!1,x:0,y:0,id:"priceTextLabel",children:[l.jsx(n.Tag,{fill:j.tooltipBg,id:"priceTextLabel-tag"}),l.jsx(n.Text,{text:"-",fontSize:14,fontFamily:"Manrope",padding:2,fill:"#FF5072",id:"priceTextLabel-text"})]}),l.jsxs(n.Label,{listening:!1,id:"tooltip",children:[l.jsx(n.Tag,{fill:j.tooltipBg,pointerDirection:"down",pointerWidth:15,pointerHeight:8,cornerRadius:8,lineJoin:"round",id:"tooltip-tag"}),l.jsx(n.Text,{text:"",fontFamily:"Manrope",fontSize:12,lineHeight:17/12,padding:r.labelPadding,fill:"#FF5072",id:"tooltip-Text"})]})]})]})}exports.default=({width:e=834,height:t=462,baseTokenSymbol:i,quoteTokenSymbol:n,pmmModel:o,pmmParams:a,midPrice:s,notShowTipText:g,colorMap:c})=>l.jsxs(u,{children:[void 0!==a&&void 0!==s&&void 0!==o&&void 0!==s&&l.jsx(x,{width:e,height:t,params:a,midPrice:s,pmmModel:o,baseTokenSymbol:i,quoteTokenSymbol:n,colorMap:c}),g?"":l.jsxs(d,{children:["* ",r.chartT("pool.chart.liquidity-chart-tip",{baseTokenSymbol:i})]})]});
|