@dodoex/widgets 3.0.1-solana.5 → 3.0.1-solana.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{bundle-007ZFocI.css → bundle-D7APNfvA.css} +0 -298
- package/dist/cjs/locales/en-US.js +1 -1
- package/dist/cjs/locales/zh-CN.js +1 -1
- package/dist/index.cjs +23 -1
- package/dist/index.js +23 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/types/components/ConnectWallet/NeedConnectButton.d.ts +1 -1
- package/dist/types/components/SpaceBetweenItem.d.ts +5 -0
- package/dist/types/components/Swap/SwapOrderHistory/RoutingCard.d.ts +1 -1
- package/dist/types/components/Swap/components/ReviewDialog.d.ts +1 -2
- package/dist/types/components/Swap/components/SwapSettingsDialog/SlippageSetting.d.ts +1 -1
- package/dist/types/components/Swap/components/SwitchBox.d.ts +3 -2
- package/dist/types/components/Swap/components/TokenCard/index.d.ts +3 -3
- package/dist/types/components/TokenLogo.d.ts +1 -1
- package/dist/types/components/TokenPairStatusButton.d.ts +6 -0
- package/dist/types/components/TokenPicker/TokenItem.d.ts +1 -1
- package/dist/types/components/TokenSelect.d.ts +21 -0
- package/dist/types/components/Widget/index.d.ts +10 -9
- package/dist/types/components/WidgetContainer.d.ts +1 -1
- package/dist/types/constants/api.d.ts +5 -7
- package/dist/types/constants/chains.d.ts +1 -1
- package/dist/types/constants/pool.d.ts +2 -0
- package/dist/types/constants/testId.d.ts +1 -0
- package/dist/types/hooks/Bridge/useExecuteBridgeRoute.d.ts +1 -1
- package/dist/types/hooks/ConnectWallet/useCurrentChainId.d.ts +1 -1
- package/dist/types/hooks/ConnectWallet/useWalletInfo.d.ts +7 -4
- package/dist/types/hooks/Submission/types.d.ts +7 -20
- package/dist/types/hooks/Submission/useExecution.d.ts +1 -1
- package/dist/types/hooks/Swap/index.d.ts +1 -2
- package/dist/types/hooks/Swap/useFetchRoutePrice.d.ts +3 -31
- package/dist/types/hooks/Swap/useTradeSwapOrderList.d.ts +22 -99
- package/dist/types/hooks/Token/useSelectChainList.d.ts +3 -2
- package/dist/types/hooks/Token/useTokenStatus.d.ts +2 -1
- package/dist/types/hooks/contract/useFetchETHBalance.d.ts +1 -112
- package/dist/types/hooks/contract/wallet.d.ts +1 -3
- package/dist/types/hooks/raydium-sdk-V2/RaydiumSDKContext.d.ts +6 -0
- package/dist/types/hooks/raydium-sdk-V2/common/programId.d.ts +25 -0
- package/dist/types/hooks/raydium-sdk-V2/config.d.ts +10 -0
- package/dist/types/hooks/raydium-sdk-V2/useRaydiumSDK.d.ts +2 -0
- package/dist/types/hooks/solana/useFetchSolanaRoutePrice.d.ts +76 -8
- package/dist/types/hooks/solana/useSolanaConnection.d.ts +9 -1
- package/dist/types/hooks/useGraphQLRequests.d.ts +0 -1
- package/dist/types/index.d.ts +6 -29
- package/dist/types/providers/SolanaReactProvider.d.ts +0 -1
- package/dist/types/providers/useInitContractRequest.d.ts +1 -0
- package/dist/types/router/types.d.ts +9 -1
- package/dist/types/utils/address.d.ts +8 -6
- package/dist/types/widgets/MiningWidget/MiningList/hooks/useDepositOrWithdrawOrClaim.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/MiningList/hooks/useStatusAndStartBlockNumber.d.ts +1 -2
- package/dist/types/widgets/MiningWidget/OperateArea/index.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/helper.d.ts +1 -2
- package/dist/types/widgets/MiningWidget/hooks/helper.d.ts +2 -2
- package/dist/types/widgets/MiningWidget/hooks/useClaimMiningSubmit.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/hooks/useMiningItem.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/hooks/useMiningList.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/hooks/useMyCreatedMiningList.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/hooks/useReviewRewardToken.d.ts +2 -2
- package/dist/types/widgets/MiningWidget/hooks/useRewardListAmount.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/hooks/useStakeMiningSubmit.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/hooks/useStatusAndStartBlockNumber.d.ts +2 -8
- package/dist/types/widgets/MiningWidget/hooks/useUnstakeMiningSubmit.d.ts +1 -1
- package/dist/types/widgets/MiningWidget/hooks/utils.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV2Create/ConfirmDialog.d.ts +18 -0
- package/dist/types/widgets/PoolWidget/AMMV2Create/CreateItem.d.ts +5 -0
- package/dist/types/widgets/PoolWidget/AMMV2Create/FeeEdit.d.ts +13 -0
- package/dist/types/widgets/PoolWidget/AMMV2Create/MyLiqidity.d.ts +14 -0
- package/dist/types/widgets/PoolWidget/AMMV2Create/Ratio.d.ts +18 -0
- package/dist/types/widgets/PoolWidget/AMMV2Create/Setting.d.ts +16 -0
- package/dist/types/widgets/PoolWidget/AMMV2Create/index.d.ts +1 -0
- package/dist/types/widgets/PoolWidget/AMMV3/AMMV3PositionManage.d.ts +12 -0
- package/dist/types/widgets/PoolWidget/AMMV3/AMMV3PositionsView.d.ts +16 -0
- package/dist/types/widgets/PoolWidget/AMMV3/AddLiquidityV3.d.ts +9 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/Badge/AMMV3.d.ts +5 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/Badge/RangeBadge.d.ts +4 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/Buttons.d.ts +13 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/ClaimButton.d.ts +8 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/CurrencyInputPanel.d.ts +11 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/FeeSelector.d.ts +8 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/InRangeDot.d.ts +4 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/InputStepCounter.d.ts +18 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/Area.d.ts +10 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/AxisBottom.d.ts +6 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/Brush.d.ts +13 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/Chart.d.ts +2 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/Line.d.ts +6 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/Zoom.d.ts +12 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/hooks.d.ts +12 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/index.d.ts +18 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/svg.d.ts +22 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/types.d.ts +50 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/usePrevious.d.ts +1 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/utils.d.ts +14 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/PositionAmountPreview.d.ts +6 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/PositionPreview.d.ts +10 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/PositionSelectedRangePreview.d.ts +9 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/PositionViewCard.d.ts +17 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/RangeSelector.d.ts +20 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/RateToggle.d.ts +9 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/RemoveButton.d.ts +10 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/ReviewModal.d.ts +13 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/TokenPairSelect.d.ts +8 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/shared.d.ts +4 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/widgets.d.ts +55 -0
- package/dist/types/widgets/PoolWidget/AMMV3/constants/misc.d.ts +17 -0
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/useContract.d.ts +2 -0
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/useDerivedPositionInfo.d.ts +7 -0
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/useDerivedV3BurnInfo.d.ts +20 -0
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/useIsTickAtLimit.d.ts +5 -0
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/usePool.d.ts +10 -0
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/usePoolTickData.d.ts +16 -0
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/useRangeHopCallbacks.d.ts +15 -0
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/useSwapTaxes.d.ts +4 -0
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/useTokenBalance.d.ts +6 -0
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/useTokenInfo.d.ts +7 -0
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/useV3DerivedMintInfo.d.ts +48 -0
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/useV3MintActionHandlers.d.ts +10 -0
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/useV3PositionFees.d.ts +8 -0
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/useV3Positions.d.ts +13 -0
- package/dist/types/widgets/PoolWidget/AMMV3/reducer.d.ts +66 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/addresses.d.ts +12 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/chains.d.ts +3 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/constants.d.ts +12 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/entities/baseCurrency.d.ts +49 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/entities/currency.d.ts +3 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/entities/fractions/currencyAmount.d.ts +32 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/entities/fractions/fraction.d.ts +24 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/entities/fractions/index.d.ts +4 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/entities/fractions/percent.d.ts +14 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/entities/fractions/price.d.ts +38 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/entities/index.d.ts +4 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/entities/nativeCurrency.d.ts +16 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/entities/nativeCurrencyClass.d.ts +8 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/entities/token.d.ts +48 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/index.d.ts +5 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/utils/computePriceImpact.d.ts +8 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/utils/index.d.ts +4 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/utils/sortedInsert.d.ts +1 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/utils/sqrt.d.ts +7 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/utils/validateAndParseAddress.d.ts +10 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/constants.d.ts +12 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/entities/index.d.ts +7 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/entities/pool.d.ts +81 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/entities/position.d.ts +131 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/entities/route.d.ts +26 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/entities/tick.d.ts +13 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/entities/tickDataProvider.d.ts +31 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/entities/tickListDataProvider.d.ts +15 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/entities/trade.d.ts +220 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/index.d.ts +10 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/internalConstants.d.ts +6 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/multicall.d.ts +10 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/nonfungiblePositionManager.d.ts +159 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/payments.d.ts +24 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/quoter.d.ts +37 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/selfPermit.d.ts +25 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/staker.d.ts +101 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/swapRouter.d.ts +51 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/utils/calldata.d.ts +20 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/utils/computePoolAddress.d.ts +17 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/utils/encodeRouteToPath.d.ts +8 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/utils/encodeSqrtRatioX96.d.ts +9 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/utils/fullMath.d.ts +8 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/utils/index.d.ts +18 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/utils/isSorted.d.ts +7 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/utils/liquidityMath.d.ts +8 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/utils/maxLiquidityForAmounts.d.ts +14 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/utils/mostSignificantBit.d.ts +2 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/utils/nearestUsableTick.d.ts +6 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/utils/position.d.ts +8 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/utils/priceTickConversions.d.ts +15 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/utils/sqrtPriceMath.d.ts +13 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/utils/swapMath.d.ts +9 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/utils/tickLibrary.d.ts +14 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/utils/tickList.d.ts +23 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/utils/tickMath.d.ts +34 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/utils/v3swap.d.ts +8 -0
- package/dist/types/widgets/PoolWidget/AMMV3/types.d.ts +46 -0
- package/dist/types/widgets/PoolWidget/AMMV3/utils/computeSurroundingTicks.d.ts +4 -0
- package/dist/types/widgets/PoolWidget/AMMV3/utils/formatTickPrice.d.ts +9 -0
- package/dist/types/widgets/PoolWidget/AMMV3/utils/maxAmountSpend.d.ts +6 -0
- package/dist/types/widgets/PoolWidget/AMMV3/utils/priceToTick.d.ts +7 -0
- package/dist/types/widgets/PoolWidget/AMMV3/utils/slippage.d.ts +2 -0
- package/dist/types/widgets/PoolWidget/AMMV3/utils/tickToPrice.d.ts +6 -0
- package/dist/types/widgets/PoolWidget/AMMV3/utils/tryParseCurrencyAmount.d.ts +8 -0
- package/dist/types/widgets/PoolWidget/AMMV3/utils.d.ts +9 -0
- package/dist/types/widgets/PoolWidget/PoolCreate/hooks/useCreatePmm.d.ts +2 -2
- package/dist/types/widgets/PoolWidget/PoolList/components/CreatePoolBtn.d.ts +3 -0
- package/dist/types/widgets/PoolWidget/PoolList/components/GoPoolDetailBtn.d.ts +4 -0
- package/dist/types/widgets/PoolWidget/PoolList/components/OnlyV3Toggle.d.ts +7 -0
- package/dist/types/widgets/PoolWidget/PoolList/hooks/usePoolListFilterTokenAndPool.d.ts +2 -0
- package/dist/types/widgets/PoolWidget/PoolOperate/AddPoolOperate.d.ts +1 -4
- package/dist/types/widgets/PoolWidget/PoolOperate/PoolOperateInner.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/PoolOperate/RemovePoolOperate.d.ts +1 -4
- package/dist/types/widgets/PoolWidget/PoolOperate/components/LiquidityInfo.d.ts +2 -4
- package/dist/types/widgets/PoolWidget/PoolOperate/components/Ratio.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/components/SlippageSetting.d.ts +7 -3
- package/dist/types/widgets/PoolWidget/PoolOperate/hooks/usePercentageRemove.d.ts +3 -3
- package/dist/types/widgets/PoolWidget/PoolOperate/hooks/useRemoveLiquidityTokenStatus.d.ts +4 -2
- package/dist/types/widgets/PoolWidget/PoolOperate/index.d.ts +6 -8
- package/dist/types/widgets/PoolWidget/PoolOperate/types.d.ts +5 -1
- package/dist/types/widgets/PoolWidget/hooks/contract/useModifyDppPool.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/hooks/useAMMV2AddLiquidity.d.ts +14 -0
- package/dist/types/widgets/PoolWidget/hooks/useAMMV2Balance.d.ts +13 -0
- package/dist/types/widgets/PoolWidget/hooks/useAMMV2RemoveLiquidity.d.ts +9 -0
- package/dist/types/widgets/PoolWidget/hooks/usePoolBalanceInfo.d.ts +10 -10
- package/dist/types/widgets/PoolWidget/hooks/useUniV2CreatePairs.d.ts +29 -0
- package/dist/types/widgets/PoolWidget/utils.d.ts +13 -6
- package/package.json +17 -6
- package/dist/28442382d977858a.svg +0 -9
- package/dist/ed726d76d93d4899.svg +0 -10
- package/dist/helper-B57dDnaI.cjs +0 -1
- package/dist/helper-Darn0QJb.js +0 -1
- package/dist/index-A6qmUreY.cjs +0 -12
- package/dist/index-BC99bNlf.cjs +0 -31
- package/dist/index-Bchn6BWj.js +0 -12
- package/dist/index-BwlM86Tc.js +0 -78
- package/dist/index-CRfoDSZE.js +0 -31
- package/dist/index-DIDEQvpO.cjs +0 -78
- package/dist/types/hooks/Chain/useChainList.test.d.ts +0 -1
- package/dist/types/hooks/Swap/useFetchRoutePrice.test.d.ts +0 -1
- package/dist/types/hooks/Token/useFindTokenByAddress.test.d.ts +0 -1
- package/dist/types/hooks/Token/useSelectChainList.test.d.ts +0 -1
- package/dist/types/hooks/Token/useTokenList.test.d.ts +0 -1
- package/dist/types/hooks/Token/useTokenStatus.test.d.ts +0 -1
- package/dist/types/utils/token.test.d.ts +0 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/hooks/useLiquidityOperateAmount.d.ts +0 -47
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Bound } from '../../types';
|
|
2
|
+
export interface ChartEntry {
|
|
3
|
+
activeLiquidity: number;
|
|
4
|
+
price0: number;
|
|
5
|
+
}
|
|
6
|
+
interface Dimensions {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
}
|
|
10
|
+
interface Margins {
|
|
11
|
+
top: number;
|
|
12
|
+
right: number;
|
|
13
|
+
bottom: number;
|
|
14
|
+
left: number;
|
|
15
|
+
}
|
|
16
|
+
export interface ZoomLevels {
|
|
17
|
+
initialMin: number;
|
|
18
|
+
initialMax: number;
|
|
19
|
+
min: number;
|
|
20
|
+
max: number;
|
|
21
|
+
}
|
|
22
|
+
export interface LiquidityChartRangeInputProps {
|
|
23
|
+
id?: string;
|
|
24
|
+
data: {
|
|
25
|
+
series: ChartEntry[];
|
|
26
|
+
current: number;
|
|
27
|
+
};
|
|
28
|
+
ticksAtLimit: {
|
|
29
|
+
[bound in Bound]?: boolean | undefined;
|
|
30
|
+
};
|
|
31
|
+
styles: {
|
|
32
|
+
area: {
|
|
33
|
+
selection: string;
|
|
34
|
+
};
|
|
35
|
+
brush: {
|
|
36
|
+
handle: {
|
|
37
|
+
west: string;
|
|
38
|
+
east: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
dimensions: Dimensions;
|
|
43
|
+
margins: Margins;
|
|
44
|
+
interactive?: boolean;
|
|
45
|
+
brushLabels: (d: 'w' | 'e', x: number) => string;
|
|
46
|
+
brushDomain?: [number, number];
|
|
47
|
+
onBrushDomainChange: (domain: [number, number], mode: string | undefined) => void;
|
|
48
|
+
zoomLevels: ZoomLevels;
|
|
49
|
+
}
|
|
50
|
+
export {};
|
package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/usePrevious.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function usePrevious<T>(value: T): T | undefined;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PositionI } from '../types';
|
|
3
|
+
export declare const PositionPreview: ({ position, title, inRange, ticksAtLimit, }: {
|
|
4
|
+
position: PositionI;
|
|
5
|
+
title?: ReactNode;
|
|
6
|
+
inRange: boolean;
|
|
7
|
+
ticksAtLimit: {
|
|
8
|
+
[bound: string]: boolean | undefined;
|
|
9
|
+
};
|
|
10
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PositionI } from '../types';
|
|
3
|
+
export declare const PositionSelectedRangePreview: ({ position, title, ticksAtLimit, }: {
|
|
4
|
+
position: PositionI;
|
|
5
|
+
title?: ReactNode;
|
|
6
|
+
ticksAtLimit: {
|
|
7
|
+
[bound: string]: boolean | undefined;
|
|
8
|
+
};
|
|
9
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Currency, Price } from '../sdks/sdk-core';
|
|
2
|
+
import { Position as V3Position } from '../sdks/v3-sdk';
|
|
3
|
+
import { PositionDetails } from '../types';
|
|
4
|
+
export interface PriceOrdering {
|
|
5
|
+
priceLower?: Price<Currency, Currency>;
|
|
6
|
+
priceUpper?: Price<Currency, Currency>;
|
|
7
|
+
quote?: Currency;
|
|
8
|
+
base?: Currency;
|
|
9
|
+
}
|
|
10
|
+
export declare function getPriceOrderingFromPositionForUI(position?: V3Position): PriceOrdering;
|
|
11
|
+
export interface PositionViewCardProps {
|
|
12
|
+
p: PositionDetails;
|
|
13
|
+
currency0: Currency | undefined;
|
|
14
|
+
currency1: Currency | undefined;
|
|
15
|
+
onClickManage: () => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const PositionViewCard: ({ p, currency0, currency1, onClickManage, }: PositionViewCardProps) => JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { TokenInfo } from '../../../../hooks/Token';
|
|
3
|
+
import { Bound } from '../types';
|
|
4
|
+
export interface RangeSelectorProps {
|
|
5
|
+
priceLower: BigNumber | undefined;
|
|
6
|
+
priceUpper: BigNumber | undefined;
|
|
7
|
+
getDecrementLower: () => string;
|
|
8
|
+
getIncrementLower: () => string;
|
|
9
|
+
getDecrementUpper: () => string;
|
|
10
|
+
getIncrementUpper: () => string;
|
|
11
|
+
onLeftRangeInput: (typedValue: string) => void;
|
|
12
|
+
onRightRangeInput: (typedValue: string) => void;
|
|
13
|
+
mint1: Maybe<TokenInfo>;
|
|
14
|
+
mint2: Maybe<TokenInfo>;
|
|
15
|
+
feeAmount?: number;
|
|
16
|
+
ticksAtLimit: {
|
|
17
|
+
[bound in Bound]?: boolean | undefined;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export declare const RangeSelector: ({ priceLower, priceUpper, onLeftRangeInput, onRightRangeInput, getDecrementLower, getIncrementLower, getDecrementUpper, getIncrementUpper, mint1, mint2, feeAmount, ticksAtLimit, }: RangeSelectorProps) => JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BoxProps } from '@dodoex/components';
|
|
2
|
+
import { TokenInfo } from '../../../../hooks/Token/type';
|
|
3
|
+
export interface RateToggleProps {
|
|
4
|
+
mintA: TokenInfo;
|
|
5
|
+
mintB: TokenInfo;
|
|
6
|
+
handleRateToggle: () => void;
|
|
7
|
+
sx?: BoxProps['sx'];
|
|
8
|
+
}
|
|
9
|
+
export declare const RateToggle: ({ mintA, mintB, handleRateToggle, sx, }: RateToggleProps) => JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ChainId } from '@dodoex/api';
|
|
2
|
+
export interface ButtonsProps {
|
|
3
|
+
chainId: ChainId;
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
removed: boolean | undefined;
|
|
6
|
+
isLoading: boolean;
|
|
7
|
+
error: React.ReactNode;
|
|
8
|
+
onConfirm: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const RemoveButton: ({ chainId, disabled, removed, isLoading, error, onConfirm, }: ButtonsProps) => JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Bound, PositionI } from '../types';
|
|
2
|
+
export interface ReviewModalProps {
|
|
3
|
+
position?: PositionI;
|
|
4
|
+
outOfRange: boolean;
|
|
5
|
+
ticksAtLimit: {
|
|
6
|
+
[bound in Bound]?: boolean | undefined;
|
|
7
|
+
};
|
|
8
|
+
on: boolean;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
onConfirm: () => void;
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const ReviewModal: ({ position, outOfRange, ticksAtLimit, on, onClose, onConfirm, loading, }: ReviewModalProps) => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TokenInfo } from '../../../../hooks/Token';
|
|
2
|
+
import { Actions } from '../reducer';
|
|
3
|
+
export interface TokenPairSelectProps {
|
|
4
|
+
mint1: Maybe<TokenInfo>;
|
|
5
|
+
mint2: Maybe<TokenInfo>;
|
|
6
|
+
dispatch: React.Dispatch<Actions>;
|
|
7
|
+
}
|
|
8
|
+
export declare const TokenPairSelect: ({ mint1, mint2, dispatch, }: TokenPairSelectProps) => JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { BoxProps } from '@dodoex/components';
|
|
2
|
+
declare const gapValues: {
|
|
3
|
+
xs: string;
|
|
4
|
+
sm: string;
|
|
5
|
+
md: string;
|
|
6
|
+
lg: string;
|
|
7
|
+
xl: string;
|
|
8
|
+
};
|
|
9
|
+
export type Gap = keyof typeof gapValues;
|
|
10
|
+
export interface YellowCardProps {
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare const Card: ({ children, sx, }: {
|
|
14
|
+
sx?: BoxProps["sx"];
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
}) => JSX.Element;
|
|
17
|
+
export declare const LightCard: ({ children, sx, }: {
|
|
18
|
+
sx?: BoxProps["sx"];
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
}) => JSX.Element;
|
|
21
|
+
export declare const YellowCard: ({ children }: YellowCardProps) => JSX.Element;
|
|
22
|
+
export declare function ColumnCenter({ gap, flex, children, style, }: {
|
|
23
|
+
gap?: Gap | string;
|
|
24
|
+
flex?: string;
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
style?: BoxProps['sx'];
|
|
27
|
+
}): JSX.Element;
|
|
28
|
+
export declare function AutoColumn({ gap, justify, grow, children, style, }: {
|
|
29
|
+
gap?: Gap | string;
|
|
30
|
+
justify?: 'stretch' | 'center' | 'start' | 'end' | 'flex-start' | 'flex-end' | 'space-between';
|
|
31
|
+
grow?: true;
|
|
32
|
+
children: React.ReactNode;
|
|
33
|
+
style?: BoxProps['sx'];
|
|
34
|
+
}): JSX.Element;
|
|
35
|
+
export declare function Row({ gap, children, sx, }: {
|
|
36
|
+
gap?: Gap | string;
|
|
37
|
+
children: React.ReactNode;
|
|
38
|
+
sx?: BoxProps['sx'];
|
|
39
|
+
}): JSX.Element;
|
|
40
|
+
export declare function RowBetween({ children, style, }: {
|
|
41
|
+
children: React.ReactNode;
|
|
42
|
+
style?: BoxProps['sx'];
|
|
43
|
+
}): JSX.Element;
|
|
44
|
+
export declare function RowFixed({ gap, justify, children, sx, }: {
|
|
45
|
+
gap?: string;
|
|
46
|
+
justify?: string;
|
|
47
|
+
children: React.ReactNode;
|
|
48
|
+
sx?: BoxProps['sx'];
|
|
49
|
+
}): JSX.Element;
|
|
50
|
+
export declare function DynamicSection({ children, disabled, sx, }: {
|
|
51
|
+
children: React.ReactNode;
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
sx?: BoxProps['sx'];
|
|
54
|
+
}): JSX.Element;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import JSBI from 'jsbi';
|
|
2
|
+
import { Percent } from '../sdks/sdk-core';
|
|
3
|
+
export declare const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
4
|
+
export declare const DEFAULT_DEADLINE_FROM_NOW: number;
|
|
5
|
+
export declare const L2_DEADLINE_FROM_NOW: number;
|
|
6
|
+
export declare const DEFAULT_TXN_DISMISS_MS = 10000;
|
|
7
|
+
export declare const L2_TXN_DISMISS_MS = 5000;
|
|
8
|
+
export declare const BIG_INT_ZERO: JSBI;
|
|
9
|
+
export declare const BIPS_BASE = 10000;
|
|
10
|
+
export declare const ONE_BIPS: Percent;
|
|
11
|
+
export declare const ALLOWED_PRICE_IMPACT_LOW: Percent;
|
|
12
|
+
export declare const ALLOWED_PRICE_IMPACT_MEDIUM: Percent;
|
|
13
|
+
export declare const ALLOWED_PRICE_IMPACT_HIGH: Percent;
|
|
14
|
+
export declare const PRICE_IMPACT_WITHOUT_FEE_CONFIRM_MIN: Percent;
|
|
15
|
+
export declare const BLOCKED_PRICE_IMPACT_NON_EXPERT: Percent;
|
|
16
|
+
export declare const ZERO_PERCENT: Percent;
|
|
17
|
+
export declare const ONE_HUNDRED_PERCENT: Percent;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TokenInfo } from '../../../../hooks/Token';
|
|
2
|
+
import { Pool, Position as V3Position } from '../sdks/v3-sdk';
|
|
3
|
+
import { PositionDetails } from '../types';
|
|
4
|
+
export declare function useDerivedPositionInfo(positionDetails: PositionDetails | undefined, baseToken: TokenInfo, quoteToken: TokenInfo): {
|
|
5
|
+
position?: V3Position;
|
|
6
|
+
pool?: Pool;
|
|
7
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Currency, CurrencyAmount, Percent } from '../sdks/sdk-core';
|
|
3
|
+
import { Position } from '../sdks/v3-sdk';
|
|
4
|
+
import { PositionDetails } from '../types';
|
|
5
|
+
export declare function useDerivedV3BurnInfo({ percent, position, asWETH, baseToken, quoteToken, }: {
|
|
6
|
+
percent: number;
|
|
7
|
+
position?: PositionDetails;
|
|
8
|
+
asWETH?: boolean;
|
|
9
|
+
baseToken: Maybe<Currency>;
|
|
10
|
+
quoteToken: Maybe<Currency>;
|
|
11
|
+
}): {
|
|
12
|
+
position?: Position;
|
|
13
|
+
liquidityPercentage?: Percent;
|
|
14
|
+
liquidityValue0?: CurrencyAmount<Currency>;
|
|
15
|
+
liquidityValue1?: CurrencyAmount<Currency>;
|
|
16
|
+
feeValue0?: CurrencyAmount<Currency>;
|
|
17
|
+
feeValue1?: CurrencyAmount<Currency>;
|
|
18
|
+
outOfRange: boolean;
|
|
19
|
+
error?: ReactNode;
|
|
20
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ChainId } from '@dodoex/api';
|
|
2
|
+
import { FeeAmount } from '../sdks/v3-sdk';
|
|
3
|
+
import { PoolInfoT } from '../types';
|
|
4
|
+
export declare enum PoolState {
|
|
5
|
+
LOADING = 0,
|
|
6
|
+
NOT_EXISTS = 1,
|
|
7
|
+
EXISTS = 2,
|
|
8
|
+
INVALID = 3
|
|
9
|
+
}
|
|
10
|
+
export declare function usePool(mint1Address: string | undefined, mint2Address: string | undefined, feeAmount: FeeAmount | undefined, chainId: ChainId): [PoolState, PoolInfoT | null, string | null];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ChainId } from '@dodoex/api';
|
|
2
|
+
import BigNumber from 'bignumber.js';
|
|
3
|
+
import { TokenInfo } from '../../../../hooks/Token/type';
|
|
4
|
+
import { FeeAmount } from '../sdks/v3-sdk';
|
|
5
|
+
export interface TickProcessed {
|
|
6
|
+
tick: number;
|
|
7
|
+
liquidityActive: number;
|
|
8
|
+
liquidityNet: number;
|
|
9
|
+
price0: string;
|
|
10
|
+
sdkPrice: BigNumber | undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare function usePoolActiveLiquidity(mint1: Maybe<TokenInfo>, mint2: Maybe<TokenInfo>, feeAmount: FeeAmount | undefined, chainId?: ChainId): {
|
|
13
|
+
isLoading: boolean;
|
|
14
|
+
error: any;
|
|
15
|
+
data?: TickProcessed[];
|
|
16
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Actions, StateProps } from '../reducer';
|
|
2
|
+
import { PoolInfoI } from '../types';
|
|
3
|
+
export declare function useRangeHopCallbacks({ tickLower, tickUpper, poolInfo, state, dispatch, }: {
|
|
4
|
+
tickLower: number | undefined;
|
|
5
|
+
tickUpper: number | undefined;
|
|
6
|
+
poolInfo: PoolInfoI | undefined;
|
|
7
|
+
state: StateProps;
|
|
8
|
+
dispatch: React.Dispatch<Actions>;
|
|
9
|
+
}): {
|
|
10
|
+
getDecrementLower: () => string;
|
|
11
|
+
getIncrementLower: () => string;
|
|
12
|
+
getDecrementUpper: () => string;
|
|
13
|
+
getIncrementUpper: () => string;
|
|
14
|
+
getSetFullRange: () => void;
|
|
15
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ChainId } from '@dodoex/api';
|
|
2
|
+
import { PublicKey } from '@solana/web3.js';
|
|
3
|
+
export declare function useTokenInfo({ mint, chainId, symbol, }: {
|
|
4
|
+
mint: string | PublicKey | undefined;
|
|
5
|
+
chainId: ChainId;
|
|
6
|
+
symbol?: string;
|
|
7
|
+
}): import("../../../..").TokenInfo | undefined;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { TokenInfo } from '../../../../hooks/Token/type';
|
|
4
|
+
import { StateProps } from '../reducer';
|
|
5
|
+
import { Bound, Field, PoolInfoI, PositionI } from '../types';
|
|
6
|
+
import { PoolState } from './usePool';
|
|
7
|
+
export declare function useV3DerivedMintInfo({ state, existingPosition, }: {
|
|
8
|
+
state: StateProps;
|
|
9
|
+
existingPosition?: PositionI;
|
|
10
|
+
}): {
|
|
11
|
+
mintA: TokenInfo | undefined;
|
|
12
|
+
mintB: TokenInfo | undefined;
|
|
13
|
+
poolInfo: PoolInfoI | undefined;
|
|
14
|
+
poolState: PoolState;
|
|
15
|
+
ticks: {
|
|
16
|
+
[bound in Bound]?: number | undefined;
|
|
17
|
+
};
|
|
18
|
+
price: BigNumber | undefined;
|
|
19
|
+
pricesAtTicks: {
|
|
20
|
+
[bound in Bound]?: BigNumber | undefined;
|
|
21
|
+
};
|
|
22
|
+
pricesAtLimit: {
|
|
23
|
+
[bound in Bound]?: BigNumber | undefined;
|
|
24
|
+
};
|
|
25
|
+
mints: {
|
|
26
|
+
[field in Field]?: Maybe<TokenInfo>;
|
|
27
|
+
};
|
|
28
|
+
mintBalances: {
|
|
29
|
+
[field in Field]?: BigNumber | undefined;
|
|
30
|
+
};
|
|
31
|
+
dependentField: Field;
|
|
32
|
+
parsedAmounts: {
|
|
33
|
+
[field in Field]?: BigNumber | undefined;
|
|
34
|
+
};
|
|
35
|
+
position?: PositionI;
|
|
36
|
+
noLiquidity?: boolean;
|
|
37
|
+
errorMessage?: ReactNode;
|
|
38
|
+
invalidPool: boolean;
|
|
39
|
+
outOfRange: boolean;
|
|
40
|
+
invalidRange: boolean;
|
|
41
|
+
depositADisabled: boolean;
|
|
42
|
+
depositBDisabled: boolean;
|
|
43
|
+
invertPrice: boolean;
|
|
44
|
+
ticksAtLimit: {
|
|
45
|
+
[bound in Bound]?: boolean | undefined;
|
|
46
|
+
};
|
|
47
|
+
isTaxed: boolean;
|
|
48
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Actions } from '../reducer';
|
|
2
|
+
export declare function useV3MintActionHandlers({ dispatch, }: {
|
|
3
|
+
dispatch: React.Dispatch<Actions>;
|
|
4
|
+
}): {
|
|
5
|
+
onField1Input: (typedValue: string) => void;
|
|
6
|
+
onField2Input: (typedValue: string) => void;
|
|
7
|
+
onLeftRangeInput: (typedValue: string) => void;
|
|
8
|
+
onRightRangeInput: (typedValue: string) => void;
|
|
9
|
+
onStartPriceInput: (typedValue: string) => void;
|
|
10
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChainId, Currency, CurrencyAmount } from '../sdks/sdk-core';
|
|
2
|
+
import { Pool } from '../sdks/v3-sdk';
|
|
3
|
+
export declare function useV3PositionFees({ chainId, pool, tokenId, asWETH, }: {
|
|
4
|
+
chainId: ChainId;
|
|
5
|
+
pool?: Pool;
|
|
6
|
+
tokenId: string;
|
|
7
|
+
asWETH: boolean;
|
|
8
|
+
}): [CurrencyAmount<Currency>, CurrencyAmount<Currency>] | [undefined, undefined];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ChainId } from '@dodoex/api';
|
|
2
|
+
import { PositionDetails } from '../types';
|
|
3
|
+
interface UseV3PositionsResults {
|
|
4
|
+
loading: boolean;
|
|
5
|
+
positions?: PositionDetails[];
|
|
6
|
+
}
|
|
7
|
+
interface UseV3PositionResults {
|
|
8
|
+
loading: boolean;
|
|
9
|
+
position?: PositionDetails;
|
|
10
|
+
}
|
|
11
|
+
export declare function useV3PositionFromTokenId(tokenId: string | undefined, chainId: ChainId): UseV3PositionResults;
|
|
12
|
+
export declare function useV3Positions(account: string | null | undefined, chainId: ChainId): UseV3PositionsResults;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { TokenInfo } from '../../../hooks/Token/type';
|
|
2
|
+
import { FeeAmount } from './sdks/v3-sdk';
|
|
3
|
+
import { Field, FullRange } from './types';
|
|
4
|
+
export interface StateProps {
|
|
5
|
+
/**
|
|
6
|
+
* 代币对中第一个代币,与顺序无关
|
|
7
|
+
*
|
|
8
|
+
* mint1-mint2 和 mint-2-mint1 创建出来的 clmm 是同一个池子。最终 clmm 中 mintA 和 mintB 是按照从小到大排序的
|
|
9
|
+
*
|
|
10
|
+
* 最终创建完的 clmm 中的 mintA 和 mintB 的顺序可能和 mint1 和 mint2 的顺序相反
|
|
11
|
+
*/
|
|
12
|
+
mint1: TokenInfo | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* 代币对中第二个代币,与顺序无关;最终创建完的 clmm 中的 mintA 和 mintB 的顺序可能和 mint1 和 mint2 的顺序相反;
|
|
15
|
+
*/
|
|
16
|
+
mint2: TokenInfo | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* 手续费率;
|
|
19
|
+
*/
|
|
20
|
+
feeAmount: FeeAmount | undefined;
|
|
21
|
+
readonly independentField: Field;
|
|
22
|
+
readonly typedValue: string;
|
|
23
|
+
readonly startPriceTypedValue: string;
|
|
24
|
+
readonly leftRangeTypedValue: string | FullRange;
|
|
25
|
+
readonly rightRangeTypedValue: string | FullRange;
|
|
26
|
+
}
|
|
27
|
+
export declare enum Types {
|
|
28
|
+
UpdateMint1 = 0,
|
|
29
|
+
UpdateMint2 = 1,
|
|
30
|
+
UpdateDefaultMint1 = 2,
|
|
31
|
+
UpdateDefaultMint2 = 3,
|
|
32
|
+
UpdateMint1AndClearMint2 = 4,
|
|
33
|
+
UpdateFeeAmount = 5,
|
|
34
|
+
ToggleRate = 6,
|
|
35
|
+
setFullRange = 7,
|
|
36
|
+
typeStartPriceInput = 8,
|
|
37
|
+
typeLeftRangeInput = 9,
|
|
38
|
+
typeRightRangeInput = 10,
|
|
39
|
+
typeInput = 11
|
|
40
|
+
}
|
|
41
|
+
type Payload = {
|
|
42
|
+
[Types.UpdateMint1]: TokenInfo;
|
|
43
|
+
[Types.UpdateDefaultMint1]: TokenInfo;
|
|
44
|
+
[Types.UpdateMint2]: TokenInfo;
|
|
45
|
+
[Types.UpdateDefaultMint2]: TokenInfo;
|
|
46
|
+
[Types.UpdateMint1AndClearMint2]: TokenInfo;
|
|
47
|
+
[Types.UpdateFeeAmount]: FeeAmount;
|
|
48
|
+
[Types.ToggleRate]: void;
|
|
49
|
+
[Types.setFullRange]: void;
|
|
50
|
+
[Types.typeStartPriceInput]: {
|
|
51
|
+
typedValue: string;
|
|
52
|
+
};
|
|
53
|
+
[Types.typeLeftRangeInput]: {
|
|
54
|
+
typedValue: string;
|
|
55
|
+
};
|
|
56
|
+
[Types.typeRightRangeInput]: {
|
|
57
|
+
typedValue: string;
|
|
58
|
+
};
|
|
59
|
+
[Types.typeInput]: {
|
|
60
|
+
field: Field;
|
|
61
|
+
typedValue: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export type Actions = ActionMap<Payload>[keyof ActionMap<Payload>];
|
|
65
|
+
export declare function reducer(state: StateProps, action: Actions): StateProps;
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SupportedChainsType } from './chains';
|
|
2
|
+
type AddressMap = {
|
|
3
|
+
[chainId: number]: string;
|
|
4
|
+
};
|
|
5
|
+
type ChainAddresses = {
|
|
6
|
+
v3CoreFactoryAddress: string;
|
|
7
|
+
nonfungiblePositionManagerAddress?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const CHAIN_TO_ADDRESSES_MAP: Record<SupportedChainsType, ChainAddresses>;
|
|
10
|
+
export declare const V3_CORE_FACTORY_ADDRESSES: AddressMap;
|
|
11
|
+
export declare const NONFUNGIBLE_POSITION_MANAGER_ADDRESSES: AddressMap;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import JSBI from 'jsbi';
|
|
2
|
+
export type BigintIsh = JSBI | string | number;
|
|
3
|
+
export declare enum TradeType {
|
|
4
|
+
EXACT_INPUT = 0,
|
|
5
|
+
EXACT_OUTPUT = 1
|
|
6
|
+
}
|
|
7
|
+
export declare enum Rounding {
|
|
8
|
+
ROUND_DOWN = 0,
|
|
9
|
+
ROUND_HALF_UP = 1,
|
|
10
|
+
ROUND_UP = 2
|
|
11
|
+
}
|
|
12
|
+
export declare const MaxUint256: JSBI;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Currency } from './currency';
|
|
2
|
+
import { Token } from './token';
|
|
3
|
+
/**
|
|
4
|
+
* A currency is any fungible financial instrument, including Ether, all ERC20 tokens, and other chain-native currencies
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class BaseCurrency {
|
|
7
|
+
/**
|
|
8
|
+
* Returns whether the currency is native to the chain and must be wrapped (e.g. Ether)
|
|
9
|
+
*/
|
|
10
|
+
abstract readonly isNative: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Returns whether the currency is a token that is usable in Uniswap without wrapping
|
|
13
|
+
*/
|
|
14
|
+
abstract readonly isToken: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The chain ID on which this currency resides
|
|
17
|
+
*/
|
|
18
|
+
readonly chainId: number;
|
|
19
|
+
/**
|
|
20
|
+
* The decimals used in representing currency amounts
|
|
21
|
+
*/
|
|
22
|
+
readonly decimals: number;
|
|
23
|
+
/**
|
|
24
|
+
* The symbol of the currency, i.e. a short textual non-unique identifier
|
|
25
|
+
*/
|
|
26
|
+
readonly symbol?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The name of the currency, i.e. a descriptive textual non-unique identifier
|
|
29
|
+
*/
|
|
30
|
+
readonly name?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Constructs an instance of the base class `BaseCurrency`.
|
|
33
|
+
* @param chainId the chain ID on which this currency resides
|
|
34
|
+
* @param decimals decimals of the currency
|
|
35
|
+
* @param symbol symbol of the currency
|
|
36
|
+
* @param name of the currency
|
|
37
|
+
*/
|
|
38
|
+
protected constructor(chainId: number, decimals: number, symbol?: string, name?: string);
|
|
39
|
+
/**
|
|
40
|
+
* Returns whether this currency is functionally equivalent to the other currency
|
|
41
|
+
* @param other the other currency
|
|
42
|
+
*/
|
|
43
|
+
abstract equals(other: Currency): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Return the wrapped version of this currency that can be used with the Uniswap contracts. Currencies must
|
|
46
|
+
* implement this to be used in Uniswap
|
|
47
|
+
*/
|
|
48
|
+
abstract get wrapped(): Token;
|
|
49
|
+
}
|
package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/entities/fractions/currencyAmount.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import JSBI from 'jsbi';
|
|
2
|
+
import { Currency } from '../currency';
|
|
3
|
+
import { Token } from '../token';
|
|
4
|
+
import { Fraction } from './fraction';
|
|
5
|
+
import BigNumber from 'bignumber.js';
|
|
6
|
+
import { BigintIsh, Rounding } from '../../constants';
|
|
7
|
+
export declare class CurrencyAmount<T extends Currency> extends Fraction {
|
|
8
|
+
readonly currency: T;
|
|
9
|
+
readonly decimalScale: JSBI;
|
|
10
|
+
/**
|
|
11
|
+
* Returns a new currency amount instance from the unitless amount of token, i.e. the raw amount
|
|
12
|
+
* @param currency the currency in the amount
|
|
13
|
+
* @param rawAmount the raw token or ether amount
|
|
14
|
+
*/
|
|
15
|
+
static fromRawAmount<T extends Currency>(currency: T, rawAmount: BigintIsh): CurrencyAmount<T>;
|
|
16
|
+
/**
|
|
17
|
+
* Construct a currency amount with a denominator that is not equal to 1
|
|
18
|
+
* @param currency the currency
|
|
19
|
+
* @param numerator the numerator of the fractional token amount
|
|
20
|
+
* @param denominator the denominator of the fractional token amount
|
|
21
|
+
*/
|
|
22
|
+
static fromFractionalAmount<T extends Currency>(currency: T, numerator: BigintIsh, denominator: BigintIsh): CurrencyAmount<T>;
|
|
23
|
+
protected constructor(currency: T, numerator: BigintIsh, denominator?: BigintIsh);
|
|
24
|
+
add(other: CurrencyAmount<T>): CurrencyAmount<T>;
|
|
25
|
+
subtract(other: CurrencyAmount<T>): CurrencyAmount<T>;
|
|
26
|
+
multiply(other: Fraction | BigintIsh): CurrencyAmount<T>;
|
|
27
|
+
divide(other: Fraction | BigintIsh): CurrencyAmount<T>;
|
|
28
|
+
toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string;
|
|
29
|
+
toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string;
|
|
30
|
+
toExact(): BigNumber;
|
|
31
|
+
get wrapped(): CurrencyAmount<Token>;
|
|
32
|
+
}
|