@dodoex/widgets 3.16.0 → 3.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/219f8611c6c9e6e2.svg +6 -0
- package/dist/34acf2e58b457195.svg +9 -0
- package/dist/44df077bd19df476.svg +10 -0
- package/dist/5c5d298f247819e1.svg +10 -0
- package/dist/assets/bundle-BBymdwHN.css +65 -0
- package/dist/cjs/locales/en-US.js +1 -1
- package/dist/cjs/locales/zh-CN.js +1 -1
- package/dist/helper-C1OYS4SC.cjs +1 -0
- package/dist/helper-DUWFcWe6.js +1 -0
- package/dist/index-BGe7caLE.js +12 -0
- package/dist/index-BdB2BCQe.cjs +78 -0
- package/dist/index-CQl4nYsF.cjs +12 -0
- package/dist/index-Cm0O00ow.cjs +14 -0
- package/dist/index-XzRE8z_c.js +78 -0
- package/dist/index-ZV1FQySp.js +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/Bridge/BridgeRouteShortCard.d.ts +4 -2
- package/dist/types/components/Bridge/BridgeSummaryDialog/index.d.ts +2 -2
- package/dist/types/components/CardWidgets.d.ts +2 -11
- package/dist/types/components/ConnectWallet/ConnectWalletDialog.d.ts +4 -0
- package/dist/types/components/ConnectWallet/NeedConnectButton.d.ts +1 -1
- package/dist/types/components/ConnectWallet/OpenConnectWalletInfo.d.ts +2 -0
- package/dist/types/components/ErrorMessageDialog.d.ts +1 -2
- package/dist/types/components/HowItWorks.d.ts +5 -5
- package/dist/types/components/Message/index.d.ts +1 -1
- package/dist/types/components/SelectChain.d.ts +2 -1
- package/dist/types/components/SubmittedDialog.d.ts +7 -0
- package/dist/types/components/Swap/SwapOrderHistory/index.d.ts +5 -6
- package/dist/types/components/Swap/components/ConnectWallet/index.d.ts +5 -0
- package/dist/types/components/Swap/components/Dialog.d.ts +1 -1
- package/dist/types/components/Swap/components/ReviewDialog.d.ts +1 -2
- package/dist/types/components/Swap/components/SettingsDialog/index.d.ts +1 -2
- package/dist/types/components/Swap/components/SwapPreviewInfoCard.d.ts +7 -0
- package/dist/types/components/Swap/components/SwapSettingsDialog/SlippageSetting.d.ts +2 -1
- package/dist/types/components/Swap/components/SwapSettingsDialog/SlippageWarning.d.ts +3 -1
- package/dist/types/components/Swap/components/SwapSettingsDialog/index.d.ts +2 -3
- package/dist/types/components/Swap/components/TokenCard/TokenPickerDialog.d.ts +0 -2
- package/dist/types/components/Swap/components/TokenPairPriceWithToggle.d.ts +2 -3
- package/dist/types/components/Swap/index.d.ts +4 -2
- package/dist/types/components/SwitchChainDialog/index.d.ts +6 -0
- package/dist/types/components/TokenPicker/ImportToken.d.ts +6 -0
- package/dist/types/components/TokenPicker/TokenDetailInfo.d.ts +6 -0
- package/dist/types/components/TokenPicker/TokenItem.d.ts +4 -3
- package/dist/types/components/TokenPicker/index.d.ts +3 -3
- package/dist/types/components/Widget/index.d.ts +15 -13
- package/dist/types/components/WithExecutionDialog/index.d.ts +2 -1
- package/dist/types/constants/address.d.ts +0 -6
- package/dist/types/constants/api.d.ts +4 -96
- package/dist/types/constants/chainList.d.ts +0 -10
- package/dist/types/constants/chains.d.ts +1 -17
- package/dist/types/constants/sessionStorage.d.ts +0 -1
- package/dist/types/constants/swap.d.ts +0 -1
- package/dist/types/constants/tokenList.d.ts +9 -8
- package/dist/types/hooks/Bridge/createBridgeOrder.d.ts +24 -4
- package/dist/types/hooks/Bridge/useExecuteBridgeRoute.d.ts +2 -1
- package/dist/types/hooks/Bridge/useFetchRoutePriceBridge.d.ts +48 -138
- package/dist/types/hooks/Bridge/useSendRoute.d.ts +2 -1
- package/dist/types/hooks/Bridge/useSwitchBridgeOrSwapSlippage.d.ts +1 -4
- package/dist/types/hooks/ConnectWallet/Connectors/JsonRpcConnector.d.ts +9 -0
- package/dist/types/hooks/ConnectWallet/index.d.ts +2 -0
- package/dist/types/hooks/ConnectWallet/useSwitchChain.d.ts +12 -1
- package/dist/types/hooks/ConnectWallet/useWalletInfo.d.ts +8 -0
- package/dist/types/hooks/ConnectWallet/useWeb3Connectors.d.ts +17 -0
- package/dist/types/hooks/ConnectWallet/web3.d.ts +10 -0
- package/dist/types/hooks/Submission/types.d.ts +1 -29
- package/dist/types/hooks/Submission/useExecution.d.ts +1 -1
- package/dist/types/hooks/Swap/useExecuteSwap.d.ts +1 -2
- package/dist/types/hooks/Swap/useFetchRoutePrice.d.ts +4 -2
- package/dist/types/hooks/Swap/useForecastSlippageList.d.ts +6 -0
- package/dist/types/hooks/Swap/useSlippageLimit.d.ts +2 -2
- package/dist/types/hooks/Swap/useSwapSettingStore.d.ts +5 -3
- package/dist/types/hooks/Swap/useSwapSlippage.d.ts +6 -0
- package/dist/types/hooks/Swap/useTradeSwapOrderList.d.ts +133 -34
- package/dist/types/hooks/Token/type.d.ts +2 -3
- package/dist/types/hooks/Token/useFindTokenByAddress.test.d.ts +1 -0
- package/dist/types/hooks/Token/useInitTokenList.d.ts +2 -2
- package/dist/types/hooks/Token/useSelectChainList.d.ts +5 -5
- package/dist/types/hooks/Token/useSelectChainList.test.d.ts +1 -0
- package/dist/types/hooks/Token/useTokenList.d.ts +8 -4
- package/dist/types/hooks/Token/useTokenList.test.d.ts +1 -0
- package/dist/types/hooks/Token/useTokenListDefaultToken.d.ts +2 -2
- package/dist/types/hooks/Token/useTokenListFetchBalance.d.ts +4 -1
- package/dist/types/hooks/Token/useTokenStatus.d.ts +2 -28
- package/dist/types/hooks/Token/useTokenStatus.test.d.ts +1 -0
- package/dist/types/hooks/contract/useFetchETHBalance.d.ts +1 -2
- package/dist/types/hooks/contract/useFetchTokens.d.ts +4 -9
- package/dist/types/hooks/useGlobalState.d.ts +0 -2
- package/dist/types/hooks/useGraphQLRequests.d.ts +1 -0
- package/dist/types/hooks/useMessageState.d.ts +1 -2
- package/dist/types/hooks/useRouteVisionData.d.ts +1 -17
- package/dist/types/hooks/useTokenState.d.ts +18 -3
- package/dist/types/index.d.ts +35 -27
- package/dist/types/locales/en-US.d.ts +1 -0
- package/dist/types/providers/i18n.d.ts +1 -1
- package/dist/types/router/types.d.ts +0 -5
- package/dist/types/utils/address.d.ts +1 -1
- package/dist/types/utils/index.d.ts +2 -2
- package/dist/types/utils/token.d.ts +1 -1
- package/dist/types/utils/wallet.d.ts +0 -2
- package/dist/types/widgets/MiningWidget/MiningCreate/hooks/useCreateMining.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/hooks/usePrevious.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/hooks/useRewardListAmount.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV2Create/Ratio.d.ts +4 -1
- package/dist/types/widgets/PoolWidget/AMMV3/AddLiquidityV3.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/hooks.d.ts +1 -3
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/index.d.ts +1 -3
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/usePrevious.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/TokenPairSelect.d.ts +1 -3
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/usePoolTickData.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/useV3DerivedMintInfo.d.ts +1 -4
- package/dist/types/widgets/PoolWidget/AMMV3/reducer.d.ts +1 -4
- package/dist/types/widgets/PoolWidget/PoolCreate/components/BaseInfoCardList.d.ts +3 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/FeeRateCard.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/LqRatioSet.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/LqSettingsShow.d.ts +3 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/PriceModeCard.d.ts +3 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/VersionChartExample.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/widgets.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/hooks/useDefaultTokens.d.ts +2 -2
- package/dist/types/widgets/PoolWidget/PoolCreate/hooks/usePriceInit.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/hooks/useVersionList.d.ts +4 -4
- package/dist/types/widgets/PoolWidget/PoolCreate/index.d.ts +3 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/operate-widgets/InitPriceSetting.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/operate-widgets/PriceModeSetting.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/operate-widgets/VersionSelect.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/utils.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolDetail/components/MoreDetail/ParametersTable.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolDetail/components/MoreDetail/index.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolDetail/components/Overview.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolDetail/components/TotalLiquidity.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolDetail/hooks/useLiquidityProviders.d.ts +6 -0
- package/dist/types/widgets/PoolWidget/PoolDetail/hooks/usePoolDashboard.d.ts +6 -0
- package/dist/types/widgets/PoolWidget/PoolDetail/hooks/usePoolDayData.d.ts +6 -0
- package/dist/types/widgets/PoolWidget/PoolDetail/hooks/usePoolSwapList.d.ts +6 -0
- package/dist/types/widgets/PoolWidget/PoolDetail/index.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolList/AddLiquidity.d.ts +5 -7
- package/dist/types/widgets/PoolWidget/PoolList/MyCreated.d.ts +7 -2
- package/dist/types/widgets/PoolWidget/PoolList/MyLiquidity.d.ts +5 -7
- package/dist/types/widgets/PoolWidget/PoolList/components/GoPoolDetailBtn.d.ts +1 -3
- package/dist/types/widgets/PoolWidget/PoolList/components/OnlyV3Toggle.d.ts +7 -0
- package/dist/types/widgets/PoolWidget/PoolList/hooks/usePoolListTabs.d.ts +6 -14
- package/dist/types/widgets/PoolWidget/PoolList/index.d.ts +7 -8
- package/dist/types/widgets/PoolWidget/PoolModify/index.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/AddPoolOperate.d.ts +6 -2
- package/dist/types/widgets/PoolWidget/PoolOperate/PoolOperateInner.d.ts +4 -2
- package/dist/types/widgets/PoolWidget/PoolOperate/RemovePoolOperate.d.ts +4 -2
- package/dist/types/widgets/PoolWidget/PoolOperate/components/OperateBtn.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/components/Ratio.d.ts +5 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/components/SlippageSetting.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/hooks/useRemoveLiquidityTokenStatus.d.ts +2 -49
- package/dist/types/widgets/PoolWidget/PoolOperate/index.d.ts +6 -2
- package/dist/types/widgets/PoolWidget/PoolOperate/types.d.ts +12 -0
- package/dist/types/widgets/PoolWidget/hooks/contract/useModifyDppPool.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/hooks/useAMMV2AddLiquidity.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/hooks/useAMMV2RemoveLiquidity.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/hooks/usePoolDetail.d.ts +6 -0
- package/dist/types/widgets/PoolWidget/hooks/usePoolListMyLiquidity.d.ts +15 -0
- package/dist/types/widgets/PoolWidget/hooks/useUniV2Pairs.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/utils.d.ts +0 -4
- package/package.json +1 -1
- package/dist/helper-Dry2KYfh.js +0 -1
- package/dist/helper-iRd-4sp4.cjs +0 -1
- package/dist/index-BRTABuMK.cjs +0 -12
- package/dist/index-Ca_h9Yxg.js +0 -34
- package/dist/index-DDwPtr_I.js +0 -12
- package/dist/index-DHfQEIuw.cjs +0 -78
- package/dist/index-DsQIchnJ.js +0 -78
- package/dist/index-vyWzevj_.cjs +0 -34
- package/dist/types/components/Bridge/CompareRoute.d.ts +0 -4
- package/dist/types/components/Bridge/RouteVision.d.ts +0 -7
- package/dist/types/components/Bridge/RouteVisionModal.d.ts +0 -5
- package/dist/types/components/SquaredGoBack.d.ts +0 -5
- package/dist/types/components/Swap/SwapOrderHistory/CrossChainOrderList.d.ts +0 -4
- package/dist/types/components/Swap/SwapOrderHistory/CrossOrderCard.d.ts +0 -8
- package/dist/types/components/Swap/SwapOrderHistory/RefundModal.d.ts +0 -9
- package/dist/types/components/Swap/SwapOrderHistory/SameChainOrderList.d.ts +0 -3
- package/dist/types/components/Swap/components/FiatEntryAndGasRefuel.d.ts +0 -1
- package/dist/types/components/Swap/components/ReceiveAddressInputModal.d.ts +0 -10
- package/dist/types/components/Swap/components/RouteVisionModal.d.ts +0 -7
- package/dist/types/components/Swap/components/SwapSettingsDialog/SupplierSelect.d.ts +0 -5
- package/dist/types/components/Swap/components/TokenCard/TokenCardSwap.d.ts +0 -48
- package/dist/types/components/Swap/components/TokenCard/WalletConnectBtn.d.ts +0 -11
- package/dist/types/hooks/Bridge/useFeeList.d.ts +0 -9
- package/dist/types/hooks/Bridge/utils.d.ts +0 -6
- package/dist/types/hooks/ConnectWallet/useBTCWalletStore.d.ts +0 -1
- package/dist/types/hooks/Swap/useBridgeSlippage.d.ts +0 -3
- package/dist/types/hooks/Swap/useCrossSwapOrderList.d.ts +0 -215
- package/dist/types/hooks/Swap/usePrivacySwapStatus.d.ts +0 -10
- package/dist/types/hooks/Swap/useSwitchToSupplierChain.d.ts +0 -13
- package/dist/types/hooks/contract/useFetchMultiTokensForSingleChain.d.ts +0 -20
- package/dist/types/hooks/useAddressValidation.d.ts +0 -2
- package/dist/types/utils/CaipNetworksUtil.d.ts +0 -5
- package/dist/types/utils/btc.d.ts +0 -42
- package/dist/types/utils/constants.d.ts +0 -2
- package/dist/types/utils/reown-types.d.ts +0 -28
- package/dist/types/utils/solana.d.ts +0 -7
- package/dist/types/utils/ton.d.ts +0 -3
- package/dist/types/utils/zetachain_btc_test.d.ts +0 -5
- package/dist/types/widgets/PoolWidget/AMMV2Create/Setting.d.ts +0 -16
- package/dist/types/widgets/PoolWidget/AMMV3/components/RangeSetList.d.ts +0 -4
- package/dist/types/widgets/PoolWidget/PoolList/components/FilterGroup.d.ts +0 -11
- package/dist/types/widgets/PoolWidget/PoolList/components/SortButtonGroup.d.ts +0 -11
- package/dist/types/widgets/PoolWidget/PoolList/components/TableSortButton.d.ts +0 -6
- package/dist/types/widgets/PoolWidget/PoolList/components/tags.d.ts +0 -11
- package/dist/types/widgets/PoolWidget/curve/Add.d.ts +0 -5
- package/dist/types/widgets/PoolWidget/curve/AddOrRemove.d.ts +0 -7
- package/dist/types/widgets/PoolWidget/curve/AllPools.d.ts +0 -13
- package/dist/types/widgets/PoolWidget/curve/CurvePoolDetail.d.ts +0 -5
- package/dist/types/widgets/PoolWidget/curve/OperateDialog.d.ts +0 -7
- package/dist/types/widgets/PoolWidget/curve/Remove.d.ts +0 -5
- package/dist/types/widgets/PoolWidget/curve/components/ApyTooltip.d.ts +0 -7
- package/dist/types/widgets/PoolWidget/curve/components/CoinReservePieChart.d.ts +0 -6
- package/dist/types/widgets/PoolWidget/curve/components/CoinsLogoList.d.ts +0 -7
- package/dist/types/widgets/PoolWidget/curve/components/FilterAddressTags.d.ts +0 -7
- package/dist/types/widgets/PoolWidget/curve/components/LiquidityProvidersTable.d.ts +0 -6
- package/dist/types/widgets/PoolWidget/curve/components/OperateButtonContainer.d.ts +0 -3
- package/dist/types/widgets/PoolWidget/curve/components/ParametersTable.d.ts +0 -5
- package/dist/types/widgets/PoolWidget/curve/components/PoolTitle.d.ts +0 -5
- package/dist/types/widgets/PoolWidget/curve/components/PoolTotalStats.d.ts +0 -5
- package/dist/types/widgets/PoolWidget/curve/components/SlippageBonus.d.ts +0 -3
- package/dist/types/widgets/PoolWidget/curve/components/SwapsTable.d.ts +0 -6
- package/dist/types/widgets/PoolWidget/curve/components/TokenListPoolItem.d.ts +0 -5
- package/dist/types/widgets/PoolWidget/curve/hooks/useLiquidityProviders.d.ts +0 -166
- package/dist/types/widgets/PoolWidget/curve/hooks/useLpTokenBalances.d.ts +0 -11
- package/dist/types/widgets/PoolWidget/curve/hooks/usePoolDetail.d.ts +0 -10
- package/dist/types/widgets/PoolWidget/curve/hooks/usePoolListFilterTokenAndPool.d.ts +0 -9
- package/dist/types/widgets/PoolWidget/curve/hooks/usePoolSwapList.d.ts +0 -166
- package/dist/types/widgets/PoolWidget/curve/types.d.ts +0 -44
- package/dist/types/widgets/PoolWidget/curve/utils.d.ts +0 -4
- /package/dist/types/hooks/{useAddressValidation.test.d.ts → Bridge/useFetchRoutePriceBridge.test.d.ts} +0 -0
- /package/dist/types/{tests/1-get-account-state.d.ts → hooks/Chain/useChainList.test.d.ts} +0 -0
- /package/dist/types/{tests/1-send-ton.d.ts → hooks/Swap/useFetchFiatPrice.test.d.ts} +0 -0
- /package/dist/types/{utils/sui_test.d.ts → hooks/Swap/useFetchRoutePrice.test.d.ts} +0 -0
- /package/dist/types/{utils/ton_test.d.ts → hooks/Swap/useMarginAmount.test.d.ts} +0 -0
- /package/dist/types/{hooks → widgets/MiningWidget/hooks}/useRefetch.d.ts +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
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})]})]});
|