@dodoex/widgets 3.0.0-taiko.18 → 3.0.0-taiko.19
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/cjs/components/Swap/components/ReviewDialog.d.ts +2 -1
- package/dist/cjs/components/Swap/components/SwapSettingsDialog/MoreTradeSetting.d.ts +4 -0
- package/dist/cjs/components/Swap/components/SwapSettingsDialog/SlippageCurveChart/CurveChart.d.ts +9 -0
- package/dist/cjs/components/Swap/components/SwapSettingsDialog/SlippageCurveChart/SlippageSlider.d.ts +9 -0
- package/dist/cjs/components/Swap/components/SwapSettingsDialog/SlippageCurveChart/index.d.ts +12 -0
- package/dist/cjs/components/Swap/components/SwapSettingsDialog/SlippageCurveChart/useHoverSlider.d.ts +8 -0
- package/dist/cjs/components/Swap/components/SwapSettingsDialog/SlippageCurveChart/useSlippageSlider.d.ts +14 -0
- package/dist/cjs/components/Swap/components/SwapSettingsDialog/SlippageCurveChart/useSuccessRate.d.ts +10 -0
- package/dist/cjs/components/Swap/components/SwapSettingsDialog/SlippageSetting.d.ts +5 -0
- package/dist/cjs/components/Swap/components/SwapSettingsDialog/SlippageWarning.d.ts +6 -0
- package/dist/cjs/components/Swap/components/SwapSettingsDialog/index.d.ts +8 -0
- package/dist/cjs/components/TextSwitch.d.ts +12 -0
- package/dist/cjs/helper-B1e7EAcC.cjs +1 -0
- package/dist/cjs/helper-CO2FFr-I.cjs +1 -0
- package/dist/cjs/hooks/Swap/useCustomSlippage.d.ts +10 -0
- package/dist/cjs/hooks/Swap/useFetchRoutePrice.d.ts +3 -1
- package/dist/cjs/hooks/Swap/useForecastSlippageList.d.ts +172 -0
- package/dist/cjs/hooks/Swap/useSlippageLimit.d.ts +1 -1
- package/dist/cjs/hooks/Swap/useSwapSettingStore.d.ts +37 -0
- package/dist/cjs/hooks/Swap/useSwapSlippage.d.ts +174 -0
- package/dist/cjs/index-82KljTTB.cjs +78 -0
- package/dist/cjs/index-BoM8yxbn.cjs +78 -0
- package/dist/cjs/index-DDfsbCyD.cjs +31 -0
- package/dist/cjs/index-DX0xf1-_.cjs +12 -0
- package/dist/cjs/index-HDr3zYJA.cjs +31 -0
- package/dist/cjs/index-l2U5eEg1.cjs +12 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/locales/en-US.js +1 -1
- package/dist/cjs/locales/zh-CN.js +1 -1
- package/dist/cjs/store/actions/settings.d.ts +1 -2
- package/dist/cjs/store/reducers/settings.d.ts +0 -2
- package/dist/cjs/store/selectors/settings.d.ts +0 -1
- package/dist/cjs/utils/browser.d.ts +9 -0
- package/dist/components/Swap/components/ReviewDialog.d.ts +2 -1
- package/dist/components/Swap/components/SwapSettingsDialog/MoreTradeSetting.d.ts +4 -0
- package/dist/components/Swap/components/SwapSettingsDialog/SlippageCurveChart/CurveChart.d.ts +9 -0
- package/dist/components/Swap/components/SwapSettingsDialog/SlippageCurveChart/SlippageSlider.d.ts +9 -0
- package/dist/components/Swap/components/SwapSettingsDialog/SlippageCurveChart/index.d.ts +12 -0
- package/dist/components/Swap/components/SwapSettingsDialog/SlippageCurveChart/useHoverSlider.d.ts +8 -0
- package/dist/components/Swap/components/SwapSettingsDialog/SlippageCurveChart/useSlippageSlider.d.ts +14 -0
- package/dist/components/Swap/components/SwapSettingsDialog/SlippageCurveChart/useSuccessRate.d.ts +10 -0
- package/dist/components/Swap/components/SwapSettingsDialog/SlippageSetting.d.ts +5 -0
- package/dist/components/Swap/components/SwapSettingsDialog/SlippageWarning.d.ts +6 -0
- package/dist/components/Swap/components/SwapSettingsDialog/index.d.ts +8 -0
- package/dist/components/TextSwitch.d.ts +12 -0
- package/dist/helper-BItgWswq.js +1 -0
- package/dist/helper-CYVWxYX1.js +1 -0
- package/dist/hooks/Swap/useCustomSlippage.d.ts +10 -0
- package/dist/hooks/Swap/useFetchRoutePrice.d.ts +3 -1
- package/dist/hooks/Swap/useForecastSlippageList.d.ts +172 -0
- package/dist/hooks/Swap/useSlippageLimit.d.ts +1 -1
- package/dist/hooks/Swap/useSwapSettingStore.d.ts +37 -0
- package/dist/hooks/Swap/useSwapSlippage.d.ts +174 -0
- package/dist/index-B0CzOIAo.js +31 -0
- package/dist/index-BN91SFLE.js +78 -0
- package/dist/index-CBP5WJPy.js +31 -0
- package/dist/index-Wsd0Gbdn.js +78 -0
- package/dist/index-fV_uOg3U.js +12 -0
- package/dist/index-mfrkAOB7.js +12 -0
- package/dist/index.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/store/actions/settings.d.ts +1 -2
- package/dist/store/reducers/settings.d.ts +0 -2
- package/dist/store/selectors/settings.d.ts +0 -1
- package/dist/utils/browser.d.ts +9 -0
- package/package.json +3 -3
|
@@ -17,5 +17,6 @@ export interface ReviewDialogProps {
|
|
|
17
17
|
curFromFiatPrice: BigNumber | null;
|
|
18
18
|
pricePerFromToken: number | null;
|
|
19
19
|
loading: boolean;
|
|
20
|
+
slippage: string | number | null;
|
|
20
21
|
}
|
|
21
|
-
export declare function ReviewDialog({ open, execute, onClose, toToken, fromToken, fromAmount, toAmount, priceImpact, clearFromAmt, clearToAmt, baseFeeAmount, curToFiatPrice, curFromFiatPrice, pricePerFromToken, additionalFeeAmount, loading, }: ReviewDialogProps): JSX.Element;
|
|
22
|
+
export declare function ReviewDialog({ open, execute, onClose, toToken, fromToken, fromAmount, toAmount, priceImpact, clearFromAmt, clearToAmt, baseFeeAmount, curToFiatPrice, curFromFiatPrice, pricePerFromToken, additionalFeeAmount, loading, slippage, }: ReviewDialogProps): JSX.Element;
|
package/dist/cjs/components/Swap/components/SwapSettingsDialog/SlippageCurveChart/CurveChart.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ForecastSlippageListItem } from '../../../../../hooks/Swap/useForecastSlippageList';
|
|
3
|
+
export declare const dotClassName = "position-y-dot";
|
|
4
|
+
declare function CurveChart({ data, loading, }: {
|
|
5
|
+
data: ForecastSlippageListItem[];
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
}): JSX.Element;
|
|
8
|
+
declare const _default: React.MemoExoticComponent<typeof CurveChart>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SliderProps } from '@dodoex/components';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface Props {
|
|
4
|
+
formatValue: (value?: number) => string | React.ReactNode;
|
|
5
|
+
hoverValue: number | null;
|
|
6
|
+
getSliderYPosition: (value?: number) => number;
|
|
7
|
+
}
|
|
8
|
+
export default function SlippageSlider({ hoverValue, formatValue, getSliderYPosition, ...props }: SliderProps & Props): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BoxProps } from '@dodoex/components';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ForecastSlippageListItem } from '../../../../../hooks/Swap/useForecastSlippageList';
|
|
4
|
+
declare function SlippageCurveChart({ data, activeSlippage, loading, sx, handleChangeCustomSlippage, }: {
|
|
5
|
+
data?: ForecastSlippageListItem[];
|
|
6
|
+
activeSlippage?: number;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
sx?: BoxProps['sx'];
|
|
9
|
+
handleChangeCustomSlippage: (slippage: number) => void;
|
|
10
|
+
}): JSX.Element | null;
|
|
11
|
+
declare const _default: React.MemoExoticComponent<typeof SlippageCurveChart>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useSlippageSlider } from './useSlippageSlider';
|
|
3
|
+
export declare function useHoverSlider(ref: React.RefObject<HTMLDivElement>, { slippageSlider, }: {
|
|
4
|
+
slippageSlider: ReturnType<typeof useSlippageSlider>;
|
|
5
|
+
}): {
|
|
6
|
+
hoverValue: number | null;
|
|
7
|
+
setHoverValue: React.Dispatch<React.SetStateAction<number | null>>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ForecastSlippageListItem } from '../../../../../hooks/Swap/useForecastSlippageList';
|
|
2
|
+
export declare const useSlippageSlider: ({ activeSlippage, data, yPositions, }: {
|
|
3
|
+
activeSlippage?: number;
|
|
4
|
+
data?: ForecastSlippageListItem[];
|
|
5
|
+
yPositions: number[];
|
|
6
|
+
}) => {
|
|
7
|
+
min: number;
|
|
8
|
+
max: number;
|
|
9
|
+
value: number;
|
|
10
|
+
decimalConversion: number;
|
|
11
|
+
formatValue: (value?: number) => string;
|
|
12
|
+
getSliderYPosition: (value?: number) => number;
|
|
13
|
+
handleChangeValue: (newValue: number) => number;
|
|
14
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ForecastSlippageListItem } from '../../../../../hooks/Swap/useForecastSlippageList';
|
|
2
|
+
export declare function useSuccessRate({ data, activeSlippage, hoverValue, decimalConversion, }: {
|
|
3
|
+
data?: ForecastSlippageListItem[] | undefined;
|
|
4
|
+
activeSlippage: number | undefined;
|
|
5
|
+
hoverValue: number | null;
|
|
6
|
+
decimalConversion: number | undefined;
|
|
7
|
+
}): {
|
|
8
|
+
successRate: string;
|
|
9
|
+
hoverSuccessRate: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TokenInfo } from '../../../../hooks/Token';
|
|
2
|
+
export interface SwapSettingsDialogProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
fromToken?: TokenInfo | null;
|
|
6
|
+
toToken?: TokenInfo | null;
|
|
7
|
+
}
|
|
8
|
+
export declare function SwapSettingsDialog({ open, onClose, fromToken, toToken, }: SwapSettingsDialogProps): JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BoxProps } from '@dodoex/components';
|
|
2
|
+
/**
|
|
3
|
+
* Text type Switch button: supports On and Off states
|
|
4
|
+
* @param param0
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare function TextSwitch({ checked, onChange, sx, disabled, }: {
|
|
8
|
+
sx?: BoxProps['sx'];
|
|
9
|
+
checked: boolean;
|
|
10
|
+
onChange: (v: boolean) => void;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("@lingui/core"),t=require("bignumber.js"),i=require("./index-DDfsbCyD.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:"q+Q952",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:"q+Q952",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:"TaScUS",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:"F2vX4t",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:"YvXHDU",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),q=2*v,S=w.multipliedBy(10**B.multipliedBy(l).toNumber());let N=new t(Math.log(c.div(w).toNumber())/Math.log(10));N=t.minimum(q,N),N=t.maximum(0,N);const P=N.div(B),X=r({val:S,model:p,midPrice:c});if(X.vert.isNaN())return;const A=S.lt(c);let O=u-X.vert.div(M).toNumber();A||(O=u-X.vert.div(k).toNumber());const _=i.formatShortNumber(S),z=i.formatShortNumber(X.vert),D=S.minus(c).abs().div(c).multipliedBy(100).toFixed(2),$=P.toNumber(),H=e.findOne("#toolTipVertLine"),L=e.findOne("#toolTipHoriLine"),U=e.findOne("#joinCircle"),V=e.findOne("#toolTip"),W=e.findOne("#priceTextLabel"),Y=e.findOne("#slippageTextLabel");if(!V)return;V.x(l),V.y(O-5-6);const Z=V.getText(),I=V.getTag();let j="ask"===X.side?i.formatShortNumber(X.quote):i.formatShortNumber(X.base);const C=p.k.lte(0);C&&(j=z);const F=i.formatShortNumber(c),Q={amountText:z,baseTokenSymbol:d,oppositeAmountText:j,quoteTokenSymbol:h,priceText:C?F:_,slippageText:`${A?"-":"+"}${D}`};if(P.minus(4).lte(l)&&P.plus(2).gte(l)&&g)Z.text(b("depth-chart.tips.mid-price",{amountText:1,baseTokenSymbol:d,oppositeAmountText:F,quoteTokenSymbol:h})),V.x($),V.y(u/2),null==H||H.hide(),null==L||L.hide(),null==U||U.hide(),null==W||W.hide(),null==Y||Y.hide();else{Z.text(A?b("depth-chart.tips.buy",{amountText:j,baseTokenSymbol:d,oppositeAmountText:z,quoteTokenSymbol:h,priceText:C?F:_,slippageText:`${A?"-":"+"}${D}`}):b("depth-chart.tips.sell",Q));const e=y||(A?"#55f6db":"#ff4f73"),t=A?x||"#55f6db":T||"#ff4f73";Z.fill(e),V.width()/2>l?(I.pointerDirection("left"),I.pointerHeight(15),I.pointerWidth(8),V.offsetX(-11),V.offsetY(-11)):V.width()/2+l>s?(I.pointerDirection("right"),I.pointerHeight(15),I.pointerWidth(8),V.offsetX(11),V.offsetY(-11)):(I.pointerDirection("down"),I.pointerHeight(8),I.pointerWidth(15),V.offsetX(0),V.offsetY(0)),null==H||H.points([l,u,l,O]),null==H||H.stroke(t),null==L||L.points(A?[l,O,$,O]:[$,O,l,O]),null==L||L.stroke(t),null==U||U.x(l),null==U||U.y(O),null==U||U.fill(A?x||"rgb(86, 246, 218)":T||"#FF5072"),null==U||U.stroke(A?x?`rgba(${o(x)}, 0.4)`:"rgba(86, 246, 218, 0.3)":T?`rgba(${o(T)}, 0.4)`:"rgba(255, 80, 114, 0.3)"),W&&(W.x(l),W.y(u),W.offsetX(W.width()/2),W.x()-W.width()/2<0?W.x(W.width()/2):W.x()+W.width()/2>s?W.x(s-W.width()/2):W.x(l));const i=null==W?void 0:W.findOne("#priceTextLabel-text");i&&(i.fill(e),i.text(_)),Y&&(Y.x(A?l+($-l)/2:l-(l-$)/2),Y.y(O),Y.offsetY(Y.height()/2),Y.offsetX(Y.width()/2));const r=null==Y?void 0:Y.findOne("#slippageTextLabel-text");r&&(r.fill(e),r.text(`${A?"-":"+"}${D}%`)),null==H||H.show(),null==L||L.show(),null==U||U.show(),null==W||W.show(),null==Y||Y.show()}e.show()};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("@lingui/core"),t=require("bignumber.js"),i=require("./index-HDr3zYJA.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:"q+Q952",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:"q+Q952",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:"TaScUS",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:"F2vX4t",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:"YvXHDU",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),q=2*v,S=w.multipliedBy(10**B.multipliedBy(l).toNumber());let N=new t(Math.log(c.div(w).toNumber())/Math.log(10));N=t.minimum(q,N),N=t.maximum(0,N);const P=N.div(B),X=r({val:S,model:p,midPrice:c});if(X.vert.isNaN())return;const A=S.lt(c);let O=u-X.vert.div(M).toNumber();A||(O=u-X.vert.div(k).toNumber());const _=i.formatShortNumber(S),z=i.formatShortNumber(X.vert),D=S.minus(c).abs().div(c).multipliedBy(100).toFixed(2),$=P.toNumber(),H=e.findOne("#toolTipVertLine"),L=e.findOne("#toolTipHoriLine"),U=e.findOne("#joinCircle"),V=e.findOne("#toolTip"),W=e.findOne("#priceTextLabel"),Y=e.findOne("#slippageTextLabel");if(!V)return;V.x(l),V.y(O-5-6);const Z=V.getText(),I=V.getTag();let j="ask"===X.side?i.formatShortNumber(X.quote):i.formatShortNumber(X.base);const C=p.k.lte(0);C&&(j=z);const F=i.formatShortNumber(c),Q={amountText:z,baseTokenSymbol:d,oppositeAmountText:j,quoteTokenSymbol:h,priceText:C?F:_,slippageText:`${A?"-":"+"}${D}`};if(P.minus(4).lte(l)&&P.plus(2).gte(l)&&g)Z.text(b("depth-chart.tips.mid-price",{amountText:1,baseTokenSymbol:d,oppositeAmountText:F,quoteTokenSymbol:h})),V.x($),V.y(u/2),null==H||H.hide(),null==L||L.hide(),null==U||U.hide(),null==W||W.hide(),null==Y||Y.hide();else{Z.text(A?b("depth-chart.tips.buy",{amountText:j,baseTokenSymbol:d,oppositeAmountText:z,quoteTokenSymbol:h,priceText:C?F:_,slippageText:`${A?"-":"+"}${D}`}):b("depth-chart.tips.sell",Q));const e=y||(A?"#55f6db":"#ff4f73"),t=A?x||"#55f6db":T||"#ff4f73";Z.fill(e),V.width()/2>l?(I.pointerDirection("left"),I.pointerHeight(15),I.pointerWidth(8),V.offsetX(-11),V.offsetY(-11)):V.width()/2+l>s?(I.pointerDirection("right"),I.pointerHeight(15),I.pointerWidth(8),V.offsetX(11),V.offsetY(-11)):(I.pointerDirection("down"),I.pointerHeight(8),I.pointerWidth(15),V.offsetX(0),V.offsetY(0)),null==H||H.points([l,u,l,O]),null==H||H.stroke(t),null==L||L.points(A?[l,O,$,O]:[$,O,l,O]),null==L||L.stroke(t),null==U||U.x(l),null==U||U.y(O),null==U||U.fill(A?x||"rgb(86, 246, 218)":T||"#FF5072"),null==U||U.stroke(A?x?`rgba(${o(x)}, 0.4)`:"rgba(86, 246, 218, 0.3)":T?`rgba(${o(T)}, 0.4)`:"rgba(255, 80, 114, 0.3)"),W&&(W.x(l),W.y(u),W.offsetX(W.width()/2),W.x()-W.width()/2<0?W.x(W.width()/2):W.x()+W.width()/2>s?W.x(s-W.width()/2):W.x(l));const i=null==W?void 0:W.findOne("#priceTextLabel-text");i&&(i.fill(e),i.text(_)),Y&&(Y.x(A?l+($-l)/2:l-(l-$)/2),Y.y(O),Y.offsetY(Y.height()/2),Y.offsetX(Y.width()/2));const r=null==Y?void 0:Y.findOne("#slippageTextLabel-text");r&&(r.fill(e),r.text(`${A?"-":"+"}${D}%`)),null==H||H.show(),null==L||L.show(),null==U||U.show(),null==W||W.show(),null==Y||Y.show()}e.show()};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TokenInfo } from '../Token';
|
|
2
|
+
import { CustomSwapPairSlippage } from './useSwapSettingStore';
|
|
3
|
+
export declare function useCustomSlippage({ fromToken, toToken, }: {
|
|
4
|
+
fromToken?: TokenInfo | null;
|
|
5
|
+
toToken?: TokenInfo | null;
|
|
6
|
+
}): {
|
|
7
|
+
customSlippageNum: number;
|
|
8
|
+
customSlippage: string | undefined;
|
|
9
|
+
handleSlippageChange: (newItem: Pick<CustomSwapPairSlippage, "slippage" | "recommend" | "disabled" | "deleted">) => void;
|
|
10
|
+
};
|
|
@@ -14,6 +14,8 @@ export interface FetchRoutePrice {
|
|
|
14
14
|
toAmount: string;
|
|
15
15
|
estimateGas?: boolean;
|
|
16
16
|
isReverseRouting?: boolean;
|
|
17
|
+
slippage?: number;
|
|
18
|
+
slippageLoading?: boolean;
|
|
17
19
|
}
|
|
18
20
|
interface IRouteResponse {
|
|
19
21
|
resAmount: number;
|
|
@@ -28,7 +30,7 @@ interface IRouteResponse {
|
|
|
28
30
|
useSource: string;
|
|
29
31
|
duration: number;
|
|
30
32
|
}
|
|
31
|
-
export declare function useFetchRoutePrice({ toToken, fromToken, fromAmount, toAmount, marginAmount, estimateGas, isReverseRouting, }: FetchRoutePrice): {
|
|
33
|
+
export declare function useFetchRoutePrice({ toToken, fromToken, fromAmount, toAmount, marginAmount, estimateGas, isReverseRouting, slippage, slippageLoading, }: FetchRoutePrice): {
|
|
32
34
|
status: RoutePriceStatus;
|
|
33
35
|
rawBrief: IRouteResponse | null;
|
|
34
36
|
refetch: () => Promise<void>;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { TokenInfo } from '../Token';
|
|
2
|
+
export interface ForecastSlippageListItem {
|
|
3
|
+
forecastSlippage?: number;
|
|
4
|
+
forecastValue?: number;
|
|
5
|
+
confidenceRatio?: number;
|
|
6
|
+
confidenceIntervalUpper?: number;
|
|
7
|
+
confidenceIntervalLower?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function useForecastSlippageList({ fromToken, toToken, }: {
|
|
10
|
+
fromToken: TokenInfo | undefined | null;
|
|
11
|
+
toToken: TokenInfo | undefined | null;
|
|
12
|
+
}): {
|
|
13
|
+
data: import("@dodoex/api/dist/gql/graphql").FetchErc20ForecastSlippageQuery;
|
|
14
|
+
error: Error;
|
|
15
|
+
isError: true;
|
|
16
|
+
isPending: false;
|
|
17
|
+
isLoading: false;
|
|
18
|
+
isLoadingError: false;
|
|
19
|
+
isRefetchError: true;
|
|
20
|
+
isSuccess: false;
|
|
21
|
+
status: "error";
|
|
22
|
+
dataUpdatedAt: number;
|
|
23
|
+
errorUpdatedAt: number;
|
|
24
|
+
failureCount: number;
|
|
25
|
+
failureReason: Error | null;
|
|
26
|
+
errorUpdateCount: number;
|
|
27
|
+
isFetched: boolean;
|
|
28
|
+
isFetchedAfterMount: boolean;
|
|
29
|
+
isFetching: boolean;
|
|
30
|
+
isInitialLoading: boolean;
|
|
31
|
+
isPaused: boolean;
|
|
32
|
+
isPlaceholderData: boolean;
|
|
33
|
+
isRefetching: boolean;
|
|
34
|
+
isStale: boolean;
|
|
35
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@dodoex/api/dist/gql/graphql").FetchErc20ForecastSlippageQuery, Error>>;
|
|
36
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
37
|
+
slippageData: {
|
|
38
|
+
recommendSlippage?: undefined;
|
|
39
|
+
slippageList?: undefined;
|
|
40
|
+
} | {
|
|
41
|
+
recommendSlippage: ForecastSlippageListItem | undefined;
|
|
42
|
+
slippageList: ForecastSlippageListItem[];
|
|
43
|
+
};
|
|
44
|
+
} | {
|
|
45
|
+
data: import("@dodoex/api/dist/gql/graphql").FetchErc20ForecastSlippageQuery;
|
|
46
|
+
error: null;
|
|
47
|
+
isError: false;
|
|
48
|
+
isPending: false;
|
|
49
|
+
isLoading: false;
|
|
50
|
+
isLoadingError: false;
|
|
51
|
+
isRefetchError: false;
|
|
52
|
+
isSuccess: true;
|
|
53
|
+
status: "success";
|
|
54
|
+
dataUpdatedAt: number;
|
|
55
|
+
errorUpdatedAt: number;
|
|
56
|
+
failureCount: number;
|
|
57
|
+
failureReason: Error | null;
|
|
58
|
+
errorUpdateCount: number;
|
|
59
|
+
isFetched: boolean;
|
|
60
|
+
isFetchedAfterMount: boolean;
|
|
61
|
+
isFetching: boolean;
|
|
62
|
+
isInitialLoading: boolean;
|
|
63
|
+
isPaused: boolean;
|
|
64
|
+
isPlaceholderData: boolean;
|
|
65
|
+
isRefetching: boolean;
|
|
66
|
+
isStale: boolean;
|
|
67
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@dodoex/api/dist/gql/graphql").FetchErc20ForecastSlippageQuery, Error>>;
|
|
68
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
69
|
+
slippageData: {
|
|
70
|
+
recommendSlippage?: undefined;
|
|
71
|
+
slippageList?: undefined;
|
|
72
|
+
} | {
|
|
73
|
+
recommendSlippage: ForecastSlippageListItem | undefined;
|
|
74
|
+
slippageList: ForecastSlippageListItem[];
|
|
75
|
+
};
|
|
76
|
+
} | {
|
|
77
|
+
data: undefined;
|
|
78
|
+
error: Error;
|
|
79
|
+
isError: true;
|
|
80
|
+
isPending: false;
|
|
81
|
+
isLoading: false;
|
|
82
|
+
isLoadingError: true;
|
|
83
|
+
isRefetchError: false;
|
|
84
|
+
isSuccess: false;
|
|
85
|
+
status: "error";
|
|
86
|
+
dataUpdatedAt: number;
|
|
87
|
+
errorUpdatedAt: number;
|
|
88
|
+
failureCount: number;
|
|
89
|
+
failureReason: Error | null;
|
|
90
|
+
errorUpdateCount: number;
|
|
91
|
+
isFetched: boolean;
|
|
92
|
+
isFetchedAfterMount: boolean;
|
|
93
|
+
isFetching: boolean;
|
|
94
|
+
isInitialLoading: boolean;
|
|
95
|
+
isPaused: boolean;
|
|
96
|
+
isPlaceholderData: boolean;
|
|
97
|
+
isRefetching: boolean;
|
|
98
|
+
isStale: boolean;
|
|
99
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@dodoex/api/dist/gql/graphql").FetchErc20ForecastSlippageQuery, Error>>;
|
|
100
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
101
|
+
slippageData: {
|
|
102
|
+
recommendSlippage?: undefined;
|
|
103
|
+
slippageList?: undefined;
|
|
104
|
+
} | {
|
|
105
|
+
recommendSlippage: ForecastSlippageListItem | undefined;
|
|
106
|
+
slippageList: ForecastSlippageListItem[];
|
|
107
|
+
};
|
|
108
|
+
} | {
|
|
109
|
+
data: undefined;
|
|
110
|
+
error: null;
|
|
111
|
+
isError: false;
|
|
112
|
+
isPending: true;
|
|
113
|
+
isLoading: true;
|
|
114
|
+
isLoadingError: false;
|
|
115
|
+
isRefetchError: false;
|
|
116
|
+
isSuccess: false;
|
|
117
|
+
status: "pending";
|
|
118
|
+
dataUpdatedAt: number;
|
|
119
|
+
errorUpdatedAt: number;
|
|
120
|
+
failureCount: number;
|
|
121
|
+
failureReason: Error | null;
|
|
122
|
+
errorUpdateCount: number;
|
|
123
|
+
isFetched: boolean;
|
|
124
|
+
isFetchedAfterMount: boolean;
|
|
125
|
+
isFetching: boolean;
|
|
126
|
+
isInitialLoading: boolean;
|
|
127
|
+
isPaused: boolean;
|
|
128
|
+
isPlaceholderData: boolean;
|
|
129
|
+
isRefetching: boolean;
|
|
130
|
+
isStale: boolean;
|
|
131
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@dodoex/api/dist/gql/graphql").FetchErc20ForecastSlippageQuery, Error>>;
|
|
132
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
133
|
+
slippageData: {
|
|
134
|
+
recommendSlippage?: undefined;
|
|
135
|
+
slippageList?: undefined;
|
|
136
|
+
} | {
|
|
137
|
+
recommendSlippage: ForecastSlippageListItem | undefined;
|
|
138
|
+
slippageList: ForecastSlippageListItem[];
|
|
139
|
+
};
|
|
140
|
+
} | {
|
|
141
|
+
data: undefined;
|
|
142
|
+
error: null;
|
|
143
|
+
isError: false;
|
|
144
|
+
isPending: true;
|
|
145
|
+
isLoadingError: false;
|
|
146
|
+
isRefetchError: false;
|
|
147
|
+
isSuccess: false;
|
|
148
|
+
status: "pending";
|
|
149
|
+
dataUpdatedAt: number;
|
|
150
|
+
errorUpdatedAt: number;
|
|
151
|
+
failureCount: number;
|
|
152
|
+
failureReason: Error | null;
|
|
153
|
+
errorUpdateCount: number;
|
|
154
|
+
isFetched: boolean;
|
|
155
|
+
isFetchedAfterMount: boolean;
|
|
156
|
+
isFetching: boolean;
|
|
157
|
+
isLoading: boolean;
|
|
158
|
+
isInitialLoading: boolean;
|
|
159
|
+
isPaused: boolean;
|
|
160
|
+
isPlaceholderData: boolean;
|
|
161
|
+
isRefetching: boolean;
|
|
162
|
+
isStale: boolean;
|
|
163
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@dodoex/api/dist/gql/graphql").FetchErc20ForecastSlippageQuery, Error>>;
|
|
164
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
165
|
+
slippageData: {
|
|
166
|
+
recommendSlippage?: undefined;
|
|
167
|
+
slippageList?: undefined;
|
|
168
|
+
} | {
|
|
169
|
+
recommendSlippage: ForecastSlippageListItem | undefined;
|
|
170
|
+
slippageList: ForecastSlippageListItem[];
|
|
171
|
+
};
|
|
172
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const maxSlippageWarning = 5;
|
|
2
|
-
export declare const useSlippageLimit: (
|
|
2
|
+
export declare const useSlippageLimit: (slippageSwap?: number) => boolean;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface CustomSwapPairSlippage {
|
|
2
|
+
account: string;
|
|
3
|
+
from: string;
|
|
4
|
+
to: string;
|
|
5
|
+
/** Should be consistent with fromToken */
|
|
6
|
+
chainId: number;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/** Whether it has been deleted: not necessarily deleted */
|
|
9
|
+
deleted?: boolean;
|
|
10
|
+
slippage: string;
|
|
11
|
+
fromSymbol: string;
|
|
12
|
+
fromLogo: string | null;
|
|
13
|
+
toSymbol: string;
|
|
14
|
+
toLogo: string | null;
|
|
15
|
+
recommend: string;
|
|
16
|
+
}
|
|
17
|
+
interface SwapSettingState {
|
|
18
|
+
slippageAdvanced: boolean;
|
|
19
|
+
customSwapPairSlippages: Array<CustomSwapPairSlippage>;
|
|
20
|
+
notRemindAgainSlippageHigher: boolean;
|
|
21
|
+
notRemindAgainSlippageLower: boolean;
|
|
22
|
+
ddl: string;
|
|
23
|
+
expertMode: boolean;
|
|
24
|
+
disableIndirectRouting: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare const useSwapSettingStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SwapSettingState>, "persist"> & {
|
|
27
|
+
persist: {
|
|
28
|
+
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<SwapSettingState, SwapSettingState>>) => void;
|
|
29
|
+
clearStorage: () => void;
|
|
30
|
+
rehydrate: () => Promise<void> | void;
|
|
31
|
+
hasHydrated: () => boolean;
|
|
32
|
+
onHydrate: (fn: (state: SwapSettingState) => void) => () => void;
|
|
33
|
+
onFinishHydration: (fn: (state: SwapSettingState) => void) => () => void;
|
|
34
|
+
getOptions: () => Partial<import("zustand/middleware").PersistOptions<SwapSettingState, SwapSettingState>>;
|
|
35
|
+
};
|
|
36
|
+
}>;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { TokenInfo } from '../Token/type';
|
|
2
|
+
export declare function useSwapSlippage({ fromToken, toToken, }: {
|
|
3
|
+
fromToken?: TokenInfo | null;
|
|
4
|
+
toToken?: TokenInfo | null;
|
|
5
|
+
}): {
|
|
6
|
+
customSlippage: string | undefined;
|
|
7
|
+
customSlippageNum: number;
|
|
8
|
+
handleSlippageChange: (newItem: Pick<import("./useSwapSettingStore").CustomSwapPairSlippage, "slippage" | "recommend" | "disabled" | "deleted">) => void;
|
|
9
|
+
forecastSlippage: number | undefined;
|
|
10
|
+
forecastSlippageQuery: {
|
|
11
|
+
data: import("@dodoex/api/dist/gql/graphql").FetchErc20ForecastSlippageQuery;
|
|
12
|
+
error: Error;
|
|
13
|
+
isError: true;
|
|
14
|
+
isPending: false;
|
|
15
|
+
isLoading: false;
|
|
16
|
+
isLoadingError: false;
|
|
17
|
+
isRefetchError: true;
|
|
18
|
+
isSuccess: false;
|
|
19
|
+
status: "error";
|
|
20
|
+
dataUpdatedAt: number;
|
|
21
|
+
errorUpdatedAt: number;
|
|
22
|
+
failureCount: number;
|
|
23
|
+
failureReason: Error | null;
|
|
24
|
+
errorUpdateCount: number;
|
|
25
|
+
isFetched: boolean;
|
|
26
|
+
isFetchedAfterMount: boolean;
|
|
27
|
+
isFetching: boolean;
|
|
28
|
+
isInitialLoading: boolean;
|
|
29
|
+
isPaused: boolean;
|
|
30
|
+
isPlaceholderData: boolean;
|
|
31
|
+
isRefetching: boolean;
|
|
32
|
+
isStale: boolean;
|
|
33
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@dodoex/api/dist/gql/graphql").FetchErc20ForecastSlippageQuery, Error>>;
|
|
34
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
35
|
+
slippageData: {
|
|
36
|
+
recommendSlippage?: undefined;
|
|
37
|
+
slippageList?: undefined;
|
|
38
|
+
} | {
|
|
39
|
+
recommendSlippage: import("./useForecastSlippageList").ForecastSlippageListItem | undefined;
|
|
40
|
+
slippageList: import("./useForecastSlippageList").ForecastSlippageListItem[];
|
|
41
|
+
};
|
|
42
|
+
} | {
|
|
43
|
+
data: import("@dodoex/api/dist/gql/graphql").FetchErc20ForecastSlippageQuery;
|
|
44
|
+
error: null;
|
|
45
|
+
isError: false;
|
|
46
|
+
isPending: false;
|
|
47
|
+
isLoading: false;
|
|
48
|
+
isLoadingError: false;
|
|
49
|
+
isRefetchError: false;
|
|
50
|
+
isSuccess: true;
|
|
51
|
+
status: "success";
|
|
52
|
+
dataUpdatedAt: number;
|
|
53
|
+
errorUpdatedAt: number;
|
|
54
|
+
failureCount: number;
|
|
55
|
+
failureReason: Error | null;
|
|
56
|
+
errorUpdateCount: number;
|
|
57
|
+
isFetched: boolean;
|
|
58
|
+
isFetchedAfterMount: boolean;
|
|
59
|
+
isFetching: boolean;
|
|
60
|
+
isInitialLoading: boolean;
|
|
61
|
+
isPaused: boolean;
|
|
62
|
+
isPlaceholderData: boolean;
|
|
63
|
+
isRefetching: boolean;
|
|
64
|
+
isStale: boolean;
|
|
65
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@dodoex/api/dist/gql/graphql").FetchErc20ForecastSlippageQuery, Error>>;
|
|
66
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
67
|
+
slippageData: {
|
|
68
|
+
recommendSlippage?: undefined;
|
|
69
|
+
slippageList?: undefined;
|
|
70
|
+
} | {
|
|
71
|
+
recommendSlippage: import("./useForecastSlippageList").ForecastSlippageListItem | undefined;
|
|
72
|
+
slippageList: import("./useForecastSlippageList").ForecastSlippageListItem[];
|
|
73
|
+
};
|
|
74
|
+
} | {
|
|
75
|
+
data: undefined;
|
|
76
|
+
error: Error;
|
|
77
|
+
isError: true;
|
|
78
|
+
isPending: false;
|
|
79
|
+
isLoading: false;
|
|
80
|
+
isLoadingError: true;
|
|
81
|
+
isRefetchError: false;
|
|
82
|
+
isSuccess: false;
|
|
83
|
+
status: "error";
|
|
84
|
+
dataUpdatedAt: number;
|
|
85
|
+
errorUpdatedAt: number;
|
|
86
|
+
failureCount: number;
|
|
87
|
+
failureReason: Error | null;
|
|
88
|
+
errorUpdateCount: number;
|
|
89
|
+
isFetched: boolean;
|
|
90
|
+
isFetchedAfterMount: boolean;
|
|
91
|
+
isFetching: boolean;
|
|
92
|
+
isInitialLoading: boolean;
|
|
93
|
+
isPaused: boolean;
|
|
94
|
+
isPlaceholderData: boolean;
|
|
95
|
+
isRefetching: boolean;
|
|
96
|
+
isStale: boolean;
|
|
97
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@dodoex/api/dist/gql/graphql").FetchErc20ForecastSlippageQuery, Error>>;
|
|
98
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
99
|
+
slippageData: {
|
|
100
|
+
recommendSlippage?: undefined;
|
|
101
|
+
slippageList?: undefined;
|
|
102
|
+
} | {
|
|
103
|
+
recommendSlippage: import("./useForecastSlippageList").ForecastSlippageListItem | undefined;
|
|
104
|
+
slippageList: import("./useForecastSlippageList").ForecastSlippageListItem[];
|
|
105
|
+
};
|
|
106
|
+
} | {
|
|
107
|
+
data: undefined;
|
|
108
|
+
error: null;
|
|
109
|
+
isError: false;
|
|
110
|
+
isPending: true;
|
|
111
|
+
isLoading: true;
|
|
112
|
+
isLoadingError: false;
|
|
113
|
+
isRefetchError: false;
|
|
114
|
+
isSuccess: false;
|
|
115
|
+
status: "pending";
|
|
116
|
+
dataUpdatedAt: number;
|
|
117
|
+
errorUpdatedAt: number;
|
|
118
|
+
failureCount: number;
|
|
119
|
+
failureReason: Error | null;
|
|
120
|
+
errorUpdateCount: number;
|
|
121
|
+
isFetched: boolean;
|
|
122
|
+
isFetchedAfterMount: boolean;
|
|
123
|
+
isFetching: boolean;
|
|
124
|
+
isInitialLoading: boolean;
|
|
125
|
+
isPaused: boolean;
|
|
126
|
+
isPlaceholderData: boolean;
|
|
127
|
+
isRefetching: boolean;
|
|
128
|
+
isStale: boolean;
|
|
129
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@dodoex/api/dist/gql/graphql").FetchErc20ForecastSlippageQuery, Error>>;
|
|
130
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
131
|
+
slippageData: {
|
|
132
|
+
recommendSlippage?: undefined;
|
|
133
|
+
slippageList?: undefined;
|
|
134
|
+
} | {
|
|
135
|
+
recommendSlippage: import("./useForecastSlippageList").ForecastSlippageListItem | undefined;
|
|
136
|
+
slippageList: import("./useForecastSlippageList").ForecastSlippageListItem[];
|
|
137
|
+
};
|
|
138
|
+
} | {
|
|
139
|
+
data: undefined;
|
|
140
|
+
error: null;
|
|
141
|
+
isError: false;
|
|
142
|
+
isPending: true;
|
|
143
|
+
isLoadingError: false;
|
|
144
|
+
isRefetchError: false;
|
|
145
|
+
isSuccess: false;
|
|
146
|
+
status: "pending";
|
|
147
|
+
dataUpdatedAt: number;
|
|
148
|
+
errorUpdatedAt: number;
|
|
149
|
+
failureCount: number;
|
|
150
|
+
failureReason: Error | null;
|
|
151
|
+
errorUpdateCount: number;
|
|
152
|
+
isFetched: boolean;
|
|
153
|
+
isFetchedAfterMount: boolean;
|
|
154
|
+
isFetching: boolean;
|
|
155
|
+
isLoading: boolean;
|
|
156
|
+
isInitialLoading: boolean;
|
|
157
|
+
isPaused: boolean;
|
|
158
|
+
isPlaceholderData: boolean;
|
|
159
|
+
isRefetching: boolean;
|
|
160
|
+
isStale: boolean;
|
|
161
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@dodoex/api/dist/gql/graphql").FetchErc20ForecastSlippageQuery, Error>>;
|
|
162
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
163
|
+
slippageData: {
|
|
164
|
+
recommendSlippage?: undefined;
|
|
165
|
+
slippageList?: undefined;
|
|
166
|
+
} | {
|
|
167
|
+
recommendSlippage: import("./useForecastSlippageList").ForecastSlippageListItem | undefined;
|
|
168
|
+
slippageList: import("./useForecastSlippageList").ForecastSlippageListItem[];
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
recommendSlippage: number;
|
|
172
|
+
slippage: number;
|
|
173
|
+
slippageLoading: boolean;
|
|
174
|
+
};
|