@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,17 @@
|
|
|
1
|
+
import { ChainId } from '@dodoex/api';
|
|
2
|
+
import { PublicKey } from '@solana/web3.js';
|
|
3
|
+
import { FeeAmount } from '../constants';
|
|
4
|
+
/**
|
|
5
|
+
* Computes a pool address
|
|
6
|
+
* @param mint1 The first token of the pair, irrespective of sort order
|
|
7
|
+
* @param mint2 The second token of the pair, irrespective of sort order
|
|
8
|
+
* @param fee The fee tier of the pool
|
|
9
|
+
* @param chainId
|
|
10
|
+
* @returns The pool address
|
|
11
|
+
*/
|
|
12
|
+
export declare function computePoolAddress({ chainId, feeAmount, mint1Address, mint2Address, }: {
|
|
13
|
+
chainId: ChainId;
|
|
14
|
+
feeAmount: FeeAmount;
|
|
15
|
+
mint1Address: string;
|
|
16
|
+
mint2Address: string;
|
|
17
|
+
}): PublicKey;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Currency } from '../../sdk-core';
|
|
2
|
+
import { Route } from '../entities/route';
|
|
3
|
+
/**
|
|
4
|
+
* Converts a route to a hex encoded path
|
|
5
|
+
* @param route the v3 path to convert to an encoded path
|
|
6
|
+
* @param exactOutput whether the route should be encoded in reverse, for making exact output swaps
|
|
7
|
+
*/
|
|
8
|
+
export declare function encodeRouteToPath(route: Route<Currency, Currency>, exactOutput: boolean): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import JSBI from 'jsbi';
|
|
2
|
+
import { BigintIsh } from '../../sdk-core';
|
|
3
|
+
/**
|
|
4
|
+
* Returns the sqrt ratio as a Q64.96 corresponding to a given ratio of amount1 and amount0
|
|
5
|
+
* @param amount1 The numerator amount i.e., the amount of token1
|
|
6
|
+
* @param amount0 The denominator amount i.e., the amount of token0
|
|
7
|
+
* @returns The sqrt ratio
|
|
8
|
+
*/
|
|
9
|
+
export declare function encodeSqrtRatioX96(amount1: BigintIsh, amount0: BigintIsh): JSBI;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './calldata';
|
|
2
|
+
export * from './computePoolAddress';
|
|
3
|
+
export * from './encodeRouteToPath';
|
|
4
|
+
export * from './encodeSqrtRatioX96';
|
|
5
|
+
export * from './fullMath';
|
|
6
|
+
export * from './isSorted';
|
|
7
|
+
export * from './liquidityMath';
|
|
8
|
+
export * from './maxLiquidityForAmounts';
|
|
9
|
+
export * from './mostSignificantBit';
|
|
10
|
+
export * from './nearestUsableTick';
|
|
11
|
+
export * from './position';
|
|
12
|
+
export * from './priceTickConversions';
|
|
13
|
+
export * from './sqrtPriceMath';
|
|
14
|
+
export * from './v3swap';
|
|
15
|
+
export * from './swapMath';
|
|
16
|
+
export * from './tickLibrary';
|
|
17
|
+
export * from './tickList';
|
|
18
|
+
export * from './tickMath';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import JSBI from 'jsbi';
|
|
2
|
+
import { BigintIsh } from '../../sdk-core';
|
|
3
|
+
/**
|
|
4
|
+
* Computes the maximum amount of liquidity received for a given amount of token0, token1,
|
|
5
|
+
* and the prices at the tick boundaries.
|
|
6
|
+
* @param sqrtRatioCurrentX96 the current price
|
|
7
|
+
* @param sqrtRatioAX96 price at lower boundary
|
|
8
|
+
* @param sqrtRatioBX96 price at upper boundary
|
|
9
|
+
* @param amount0 token0 amount
|
|
10
|
+
* @param amount1 token1 amount
|
|
11
|
+
* @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate,
|
|
12
|
+
* not what core can theoretically support
|
|
13
|
+
*/
|
|
14
|
+
export declare function maxLiquidityForAmounts(sqrtRatioCurrentX96: JSBI, sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount0: BigintIsh, amount1: BigintIsh, useFullPrecision: boolean): JSBI;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the closest tick that is nearest a given tick and usable for the given tick spacing
|
|
3
|
+
* @param tick the target tick
|
|
4
|
+
* @param tickSpacing the spacing of the pool
|
|
5
|
+
*/
|
|
6
|
+
export declare function nearestUsableTick(tick: number, tickSpacing: number): number;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import JSBI from 'jsbi';
|
|
2
|
+
export declare abstract class PositionLibrary {
|
|
3
|
+
/**
|
|
4
|
+
* Cannot be constructed.
|
|
5
|
+
*/
|
|
6
|
+
private constructor();
|
|
7
|
+
static getTokensOwed(feeGrowthInside0LastX128: JSBI, feeGrowthInside1LastX128: JSBI, liquidity: JSBI, feeGrowthInside0X128: JSBI, feeGrowthInside1X128: JSBI): JSBI[];
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Price, Token } from '../../sdk-core';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a price object corresponding to the input tick and the base/quote token
|
|
4
|
+
* Inputs must be tokens because the address order is used to interpret the price represented by the tick
|
|
5
|
+
* @param baseToken the base token of the price
|
|
6
|
+
* @param quoteToken the quote token of the price
|
|
7
|
+
* @param tick the tick for which to return the price
|
|
8
|
+
*/
|
|
9
|
+
export declare function tickToPrice(baseToken: Token, quoteToken: Token, tick: number): Price<Token, Token>;
|
|
10
|
+
/**
|
|
11
|
+
* Returns the first tick for which the given price is greater than or equal to the tick price
|
|
12
|
+
* @param price for which to return the closest tick that represents a price less than or equal to the input price,
|
|
13
|
+
* i.e. the price of the returned tick is less than or equal to the input price
|
|
14
|
+
*/
|
|
15
|
+
export declare function priceToClosestTick(price: Price<Token, Token>): number;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import JSBI from 'jsbi';
|
|
2
|
+
export declare abstract class SqrtPriceMath {
|
|
3
|
+
/**
|
|
4
|
+
* Cannot be constructed.
|
|
5
|
+
*/
|
|
6
|
+
private constructor();
|
|
7
|
+
static getAmount0Delta(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, liquidity: JSBI, roundUp: boolean): JSBI;
|
|
8
|
+
static getAmount1Delta(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, liquidity: JSBI, roundUp: boolean): JSBI;
|
|
9
|
+
static getNextSqrtPriceFromInput(sqrtPX96: JSBI, liquidity: JSBI, amountIn: JSBI, zeroForOne: boolean): JSBI;
|
|
10
|
+
static getNextSqrtPriceFromOutput(sqrtPX96: JSBI, liquidity: JSBI, amountOut: JSBI, zeroForOne: boolean): JSBI;
|
|
11
|
+
private static getNextSqrtPriceFromAmount0RoundingUp;
|
|
12
|
+
private static getNextSqrtPriceFromAmount1RoundingDown;
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import JSBI from 'jsbi';
|
|
2
|
+
import { FeeAmount } from '../constants';
|
|
3
|
+
export declare abstract class SwapMath {
|
|
4
|
+
/**
|
|
5
|
+
* Cannot be constructed.
|
|
6
|
+
*/
|
|
7
|
+
private constructor();
|
|
8
|
+
static computeSwapStep(sqrtRatioCurrentX96: JSBI, sqrtRatioTargetX96: JSBI, liquidity: JSBI, amountRemaining: JSBI, feePips: JSBI | FeeAmount): [JSBI, JSBI, JSBI, JSBI];
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import JSBI from 'jsbi';
|
|
2
|
+
interface FeeGrowthOutside {
|
|
3
|
+
feeGrowthOutside0X128: JSBI;
|
|
4
|
+
feeGrowthOutside1X128: JSBI;
|
|
5
|
+
}
|
|
6
|
+
export declare function subIn256(x: JSBI, y: JSBI): JSBI;
|
|
7
|
+
export declare abstract class TickLibrary {
|
|
8
|
+
/**
|
|
9
|
+
* Cannot be constructed.
|
|
10
|
+
*/
|
|
11
|
+
private constructor();
|
|
12
|
+
static getFeeGrowthInside(feeGrowthOutsideLower: FeeGrowthOutside, feeGrowthOutsideUpper: FeeGrowthOutside, tickLower: number, tickUpper: number, tickCurrent: number, feeGrowthGlobal0X128: JSBI, feeGrowthGlobal1X128: JSBI): JSBI[];
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Tick } from '../entities/tick';
|
|
2
|
+
/**
|
|
3
|
+
* Utility methods for interacting with sorted lists of ticks
|
|
4
|
+
*/
|
|
5
|
+
export declare abstract class TickList {
|
|
6
|
+
/**
|
|
7
|
+
* Cannot be constructed
|
|
8
|
+
*/
|
|
9
|
+
private constructor();
|
|
10
|
+
static validateList(ticks: Tick[], tickSpacing: number): void;
|
|
11
|
+
static isBelowSmallest(ticks: readonly Tick[], tick: number): boolean;
|
|
12
|
+
static isAtOrAboveLargest(ticks: readonly Tick[], tick: number): boolean;
|
|
13
|
+
static getTick(ticks: readonly Tick[], index: number): Tick;
|
|
14
|
+
/**
|
|
15
|
+
* Finds the largest tick in the list of ticks that is less than or equal to tick
|
|
16
|
+
* @param ticks list of ticks
|
|
17
|
+
* @param tick tick to find the largest tick that is less than or equal to tick
|
|
18
|
+
* @private
|
|
19
|
+
*/
|
|
20
|
+
private static binarySearch;
|
|
21
|
+
static nextInitializedTick(ticks: readonly Tick[], tick: number, lte: boolean): Tick;
|
|
22
|
+
static nextInitializedTickWithinOneWord(ticks: readonly Tick[], tick: number, lte: boolean, tickSpacing: number): [number, boolean];
|
|
23
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import JSBI from 'jsbi';
|
|
2
|
+
export declare abstract class TickMath {
|
|
3
|
+
/**
|
|
4
|
+
* Cannot be constructed.
|
|
5
|
+
*/
|
|
6
|
+
private constructor();
|
|
7
|
+
/**
|
|
8
|
+
* The minimum tick that can be used on any pool.
|
|
9
|
+
*/
|
|
10
|
+
static MIN_TICK: number;
|
|
11
|
+
/**
|
|
12
|
+
* The maximum tick that can be used on any pool.
|
|
13
|
+
*/
|
|
14
|
+
static MAX_TICK: number;
|
|
15
|
+
/**
|
|
16
|
+
* The sqrt ratio corresponding to the minimum tick that could be used on any pool.
|
|
17
|
+
*/
|
|
18
|
+
static MIN_SQRT_RATIO: JSBI;
|
|
19
|
+
/**
|
|
20
|
+
* The sqrt ratio corresponding to the maximum tick that could be used on any pool.
|
|
21
|
+
*/
|
|
22
|
+
static MAX_SQRT_RATIO: JSBI;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the sqrt ratio as a Q64.96 for the given tick. The sqrt ratio is computed as sqrt(1.0001)^tick
|
|
25
|
+
* @param tick the tick for which to compute the sqrt ratio
|
|
26
|
+
*/
|
|
27
|
+
static getSqrtRatioAtTick(tick: number): JSBI;
|
|
28
|
+
/**
|
|
29
|
+
* Returns the tick corresponding to a given sqrt ratio, s.t. #getSqrtRatioAtTick(tick) <= sqrtRatioX96
|
|
30
|
+
* and #getSqrtRatioAtTick(tick + 1) > sqrtRatioX96
|
|
31
|
+
* @param sqrtRatioX96 the sqrt ratio as a Q64.96 for which to compute the tick
|
|
32
|
+
*/
|
|
33
|
+
static getTickAtSqrtRatio(sqrtRatioX96: JSBI): number;
|
|
34
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import JSBI from 'jsbi';
|
|
2
|
+
import { TickDataProvider } from '../entities/tickDataProvider';
|
|
3
|
+
export declare function v3Swap(fee: JSBI, sqrtRatioX96: JSBI, tickCurrent: number, liquidity: JSBI, tickSpacing: number, tickDataProvider: TickDataProvider, zeroForOne: boolean, amountSpecified: JSBI, sqrtPriceLimitX96?: JSBI): Promise<{
|
|
4
|
+
amountCalculated: JSBI;
|
|
5
|
+
sqrtRatioX96: JSBI;
|
|
6
|
+
liquidity: JSBI;
|
|
7
|
+
tickCurrent: number;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ApiV3PoolInfoConcentratedItem, Clmm } from '@raydium-io/raydium-sdk-v2';
|
|
2
|
+
import BigNumber from 'bignumber.js';
|
|
3
|
+
import { FeeAmount } from './sdks/v3-sdk';
|
|
4
|
+
export declare enum Field {
|
|
5
|
+
MINT_1 = "MINT_1",
|
|
6
|
+
MINT_2 = "MINT_2"
|
|
7
|
+
}
|
|
8
|
+
export declare enum Bound {
|
|
9
|
+
LOWER = "LOWER",
|
|
10
|
+
UPPER = "UPPER"
|
|
11
|
+
}
|
|
12
|
+
export type FullRange = true;
|
|
13
|
+
export type OperateType = null | 'stake' | 'unstake' | 'claim';
|
|
14
|
+
export interface PositionDetails {
|
|
15
|
+
nonce: string;
|
|
16
|
+
tokenId: string;
|
|
17
|
+
operator: string;
|
|
18
|
+
token0: string;
|
|
19
|
+
token1: string;
|
|
20
|
+
fee: FeeAmount;
|
|
21
|
+
tickLower: number;
|
|
22
|
+
tickUpper: number;
|
|
23
|
+
liquidity: string;
|
|
24
|
+
feeGrowthInside0LastX128: string;
|
|
25
|
+
feeGrowthInside1LastX128: string;
|
|
26
|
+
tokensOwed0: string;
|
|
27
|
+
tokensOwed1: string;
|
|
28
|
+
}
|
|
29
|
+
export declare enum PositionField {
|
|
30
|
+
TOKEN0 = "TOKEN0",
|
|
31
|
+
TOKEN1 = "TOKEN1"
|
|
32
|
+
}
|
|
33
|
+
export type PoolInfoT = Awaited<ReturnType<Clmm['getPoolInfoFromRpc']>>;
|
|
34
|
+
export interface PoolInfoI extends ApiV3PoolInfoConcentratedItem {
|
|
35
|
+
tickCurrent: PoolInfoT['computePoolInfo']['tickCurrent'];
|
|
36
|
+
}
|
|
37
|
+
export interface PositionI {
|
|
38
|
+
poolInfo: PoolInfoI;
|
|
39
|
+
tickUpper: number;
|
|
40
|
+
tickLower: number;
|
|
41
|
+
tickLowerPrice: BigNumber | undefined;
|
|
42
|
+
tickUpperPrice: BigNumber | undefined;
|
|
43
|
+
liquidity: BigNumber;
|
|
44
|
+
amountA: BigNumber;
|
|
45
|
+
amountB: BigNumber;
|
|
46
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Ticks } from '@dodoex/api';
|
|
2
|
+
import { TickProcessed } from '../hooks/usePoolTickData';
|
|
3
|
+
import { TokenInfo } from '../../../../hooks/Token';
|
|
4
|
+
export default function computeSurroundingTicks(mint1: TokenInfo, mint2: TokenInfo, activeTickProcessed: TickProcessed, sortedTickData: Ticks, pivot: number, ascending: boolean): TickProcessed[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { Bound } from '../types';
|
|
3
|
+
export declare function formatTickPrice({ price, atLimit, direction, }: {
|
|
4
|
+
price?: BigNumber | string;
|
|
5
|
+
atLimit: {
|
|
6
|
+
[bound in Bound]?: boolean | undefined;
|
|
7
|
+
};
|
|
8
|
+
direction: Bound;
|
|
9
|
+
}): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FeeAmount } from '../sdks/v3-sdk';
|
|
2
|
+
export declare function priceToTick({ decimalsA, decimalsB, price, feeAmount, }: {
|
|
3
|
+
decimalsA: number | undefined;
|
|
4
|
+
decimalsB: number | undefined;
|
|
5
|
+
price: string | undefined;
|
|
6
|
+
feeAmount: FeeAmount | undefined;
|
|
7
|
+
}): number | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Currency, CurrencyAmount } from '../sdks/sdk-core';
|
|
2
|
+
import BigNumber from 'bignumber.js';
|
|
3
|
+
/**
|
|
4
|
+
* Parses a CurrencyAmount from the passed string.
|
|
5
|
+
* Returns the CurrencyAmount, or undefined if parsing fails.
|
|
6
|
+
*/
|
|
7
|
+
export default function tryParseCurrencyAmount<T extends Currency>(value?: string, currency?: T): CurrencyAmount<T> | undefined;
|
|
8
|
+
export declare function transformStrToBN(raw: string): BigNumber | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ChainId } from '@dodoex/api';
|
|
2
|
+
import { TokenInfo } from '../../../hooks/Token';
|
|
3
|
+
import { Token } from './sdks/sdk-core';
|
|
4
|
+
import { NativeCurrency } from './sdks/sdk-core/entities/nativeCurrency';
|
|
5
|
+
export declare function getNativeAddress(chainId: ChainId): string;
|
|
6
|
+
export declare function areAddressesEqual(a1: Maybe<Address>, a2: Maybe<Address>): boolean;
|
|
7
|
+
export declare const isNativeCurrencyAddress: (chainId: ChainId, address: Maybe<Address>) => boolean;
|
|
8
|
+
export declare function buildCurrency(token: TokenInfo | null): Token | NativeCurrency | undefined;
|
|
9
|
+
export declare function convertBackToTokenInfo(currency: Token | NativeCurrency | undefined | null): TokenInfo | undefined;
|
|
@@ -21,6 +21,6 @@ export declare const useCreatePmm: ({ selectedVersion, baseAmount, quoteAmount,
|
|
|
21
21
|
q0: number;
|
|
22
22
|
R: number;
|
|
23
23
|
} | undefined;
|
|
24
|
-
pmmModel:
|
|
25
|
-
midPrice:
|
|
24
|
+
pmmModel: any;
|
|
25
|
+
midPrice: any;
|
|
26
26
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BoxProps } from '@dodoex/components';
|
|
2
|
+
export interface OnlyV3ToggleProps {
|
|
3
|
+
onlyV3: boolean;
|
|
4
|
+
setOnlyV3: React.Dispatch<React.SetStateAction<boolean>>;
|
|
5
|
+
sx?: BoxProps['sx'];
|
|
6
|
+
}
|
|
7
|
+
export declare const OnlyV3Toggle: ({ onlyV3, setOnlyV3, sx }: OnlyV3ToggleProps) => JSX.Element;
|
|
@@ -11,9 +11,11 @@ export declare function usePoolListFilterTokenAndPool(): {
|
|
|
11
11
|
chainId: number;
|
|
12
12
|
type: string;
|
|
13
13
|
lpFeeRate: any;
|
|
14
|
+
mtFeeRate: any;
|
|
14
15
|
creator: any;
|
|
15
16
|
tvl?: any | null;
|
|
16
17
|
miningAddress?: Array<string | null> | null;
|
|
18
|
+
volume24H?: any | null;
|
|
17
19
|
baseLpToken?: {
|
|
18
20
|
id: string;
|
|
19
21
|
} | null;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { OperatePool } from './types';
|
|
2
|
-
|
|
3
|
-
export declare function AddPoolOperate({ submittedBack: submittedBackProps, onlyShowSide, pool, balanceInfo, }: {
|
|
2
|
+
export declare function AddPoolOperate({ submittedBack: submittedBackProps, pool, }: {
|
|
4
3
|
submittedBack?: () => void;
|
|
5
|
-
onlyShowSide?: 'base' | 'quote';
|
|
6
4
|
pool?: OperatePool;
|
|
7
|
-
balanceInfo: ReturnType<typeof usePoolBalanceInfo>;
|
|
8
5
|
}): JSX.Element;
|
|
@@ -4,7 +4,6 @@ export interface PoolOperateInnerProps {
|
|
|
4
4
|
pool: OperatePool;
|
|
5
5
|
operate?: OperateTab;
|
|
6
6
|
hidePoolInfo?: boolean;
|
|
7
|
-
errorRefetch?: () => void;
|
|
8
7
|
submittedBack?: () => void;
|
|
9
8
|
}
|
|
10
|
-
export default function PoolOperateInner({ pool, operate, hidePoolInfo,
|
|
9
|
+
export default function PoolOperateInner({ pool, operate, hidePoolInfo, submittedBack, }: PoolOperateInnerProps): JSX.Element;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { OperatePool } from './types';
|
|
2
|
-
|
|
3
|
-
export declare function RemovePoolOperate({ submittedBack: submittedBackProps, onlyShowSide, pool, balanceInfo, }: {
|
|
2
|
+
export declare function RemovePoolOperate({ submittedBack: submittedBackProps, pool, }: {
|
|
4
3
|
submittedBack?: () => void;
|
|
5
|
-
onlyShowSide?: 'base' | 'quote';
|
|
6
4
|
pool?: OperatePool;
|
|
7
|
-
balanceInfo: ReturnType<typeof usePoolBalanceInfo>;
|
|
8
5
|
}): JSX.Element;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { usePoolBalanceInfo } from '../../hooks/usePoolBalanceInfo';
|
|
2
1
|
import { OperatePool } from '../types';
|
|
3
2
|
export interface LiquidityInfoProps {
|
|
4
|
-
loading?: boolean;
|
|
5
3
|
hidePoolInfo?: boolean;
|
|
6
4
|
pool: OperatePool;
|
|
7
|
-
|
|
5
|
+
children: React.ReactNode;
|
|
8
6
|
}
|
|
9
|
-
export default function LiquidityInfo({
|
|
7
|
+
export default function LiquidityInfo({ hidePoolInfo, pool, children, }: LiquidityInfoProps): JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
2
|
import { OperatePool } from '../types';
|
|
3
|
-
export default function Ratio({ pool, addPortion, midPrice, }: {
|
|
3
|
+
export default function Ratio({ pool, addPortion, midPrice, shareOfPool, }: {
|
|
4
4
|
pool?: OperatePool;
|
|
5
5
|
addPortion?: BigNumber;
|
|
6
6
|
midPrice?: BigNumber;
|
|
7
|
+
shareOfPool?: string;
|
|
7
8
|
}): JSX.Element;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
+
import { PoolType } from '@dodoex/api';
|
|
2
|
+
import { BoxProps } from '@dodoex/components';
|
|
1
3
|
import { AUTO_SWAP_SLIPPAGE_PROTECTION } from '../../../../constants/pool';
|
|
2
|
-
export declare const useSlipper: ({
|
|
3
|
-
|
|
4
|
+
export declare const useSlipper: ({ type }: {
|
|
5
|
+
type: PoolType;
|
|
4
6
|
}) => {
|
|
5
7
|
slipper: number | "auto";
|
|
6
8
|
setSlipper: import("react").Dispatch<import("react").SetStateAction<number | "auto">>;
|
|
7
9
|
slipperValue: number;
|
|
8
10
|
resetSlipper: () => void;
|
|
9
11
|
};
|
|
10
|
-
export default function SlippageSetting({ disabled, value, onChange, }: {
|
|
12
|
+
export default function SlippageSetting({ type, disabled, value, onChange, sx, }: {
|
|
13
|
+
type?: PoolType;
|
|
11
14
|
disabled?: boolean;
|
|
12
15
|
value: number | typeof AUTO_SWAP_SLIPPAGE_PROTECTION;
|
|
13
16
|
onChange: (val: number | typeof AUTO_SWAP_SLIPPAGE_PROTECTION) => void;
|
|
17
|
+
sx?: BoxProps['sx'];
|
|
14
18
|
}): JSX.Element;
|
|
@@ -10,9 +10,9 @@ export declare function usePercentageRemove({ isBase, pool, baseOverride, quoteO
|
|
|
10
10
|
pool: OperatePool | undefined;
|
|
11
11
|
baseOverride: BigNumber | undefined | null;
|
|
12
12
|
quoteOverride: BigNumber | undefined | null;
|
|
13
|
-
resetAmount
|
|
14
|
-
handleChangeBaseAmount
|
|
15
|
-
handleChangeQuoteAmount
|
|
13
|
+
resetAmount?: () => void;
|
|
14
|
+
handleChangeBaseAmount?: (val: string) => void;
|
|
15
|
+
handleChangeQuoteAmount?: (val: string) => void;
|
|
16
16
|
}): {
|
|
17
17
|
mode: RemoveMode;
|
|
18
18
|
modeOptions: {
|
|
@@ -7,10 +7,11 @@ export declare function useRemoveLiquidityTokenStatus({ pool, baseAmount, quoteA
|
|
|
7
7
|
balanceInfo: ReturnType<typeof usePoolBalanceInfo>;
|
|
8
8
|
}): {
|
|
9
9
|
baseTokenStatus: {
|
|
10
|
+
token: import("../../../..").TokenInfo | null | undefined;
|
|
10
11
|
isApproving: boolean;
|
|
11
12
|
isGetApproveLoading: boolean;
|
|
12
13
|
needApprove: boolean;
|
|
13
|
-
needReset:
|
|
14
|
+
needReset: false;
|
|
14
15
|
needShowTokenStatusButton: boolean;
|
|
15
16
|
insufficientBalance: boolean;
|
|
16
17
|
loading: boolean;
|
|
@@ -19,10 +20,11 @@ export declare function useRemoveLiquidityTokenStatus({ pool, baseAmount, quoteA
|
|
|
19
20
|
getMaxBalance: () => string;
|
|
20
21
|
};
|
|
21
22
|
quoteTokenStatus: {
|
|
23
|
+
token: import("../../../..").TokenInfo | null | undefined;
|
|
22
24
|
isApproving: boolean;
|
|
23
25
|
isGetApproveLoading: boolean;
|
|
24
26
|
needApprove: boolean;
|
|
25
|
-
needReset:
|
|
27
|
+
needReset: false;
|
|
26
28
|
needShowTokenStatusButton: boolean;
|
|
27
29
|
insufficientBalance: boolean;
|
|
28
30
|
loading: boolean;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { BoxProps } from '@dodoex/components';
|
|
2
2
|
import { PoolOperateInnerProps } from './PoolOperateInner';
|
|
3
3
|
export interface PoolOperateProps {
|
|
4
|
-
onClose
|
|
4
|
+
onClose: (() => void) | undefined;
|
|
5
5
|
account: string | undefined;
|
|
6
|
-
pool
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
hasMining?: boolean;
|
|
11
|
-
hidePoolInfo?: boolean;
|
|
6
|
+
pool: PoolOperateInnerProps['pool'];
|
|
7
|
+
operate: PoolOperateInnerProps['operate'];
|
|
8
|
+
hasMining: boolean;
|
|
9
|
+
hidePoolInfo: boolean;
|
|
12
10
|
sx?: BoxProps['sx'];
|
|
13
11
|
}
|
|
14
|
-
export declare function PoolOperate({ onClose, pool
|
|
12
|
+
export declare function PoolOperate({ onClose, pool, operate, hasMining, hidePoolInfo, sx, }: PoolOperateProps): JSX.Element;
|
|
15
13
|
export default function PoolOperateDialog({ modal, ...props }: PoolOperateProps & {
|
|
16
14
|
modal?: boolean;
|
|
17
15
|
}): JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { PoolType } from '@dodoex/api';
|
|
1
|
+
import { ExcludeNone, PoolType } from '@dodoex/api';
|
|
2
2
|
import { TokenInfo } from '../../../hooks/Token';
|
|
3
|
+
import { FetchMyLiquidityListLqList } from '../utils';
|
|
3
4
|
export type OperatePool = {
|
|
4
5
|
address: string;
|
|
5
6
|
chainId: number;
|
|
@@ -14,4 +15,7 @@ export type OperatePool = {
|
|
|
14
15
|
type: PoolType;
|
|
15
16
|
owner?: string;
|
|
16
17
|
creator: string;
|
|
18
|
+
lpFeeRate?: string;
|
|
19
|
+
mtFeeRate?: string;
|
|
20
|
+
liquidityPositions?: ExcludeNone<ExcludeNone<FetchMyLiquidityListLqList>[0]>['liquidityPositions'];
|
|
17
21
|
} | undefined;
|
|
@@ -9,7 +9,7 @@ export declare function useModifyDppPool({ pool, }: {
|
|
|
9
9
|
quoteToken: TokenInfo;
|
|
10
10
|
};
|
|
11
11
|
}): {
|
|
12
|
-
modifyDPPMutation: import("@tanstack/react-query").UseMutationResult<
|
|
12
|
+
modifyDPPMutation: import("@tanstack/react-query").UseMutationResult<any, Error, {
|
|
13
13
|
baseAmount: string;
|
|
14
14
|
quoteAmount: string;
|
|
15
15
|
isRemove?: boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ApiV3PoolInfoStandardItemCpmm, CpmmKeys } from '@raydium-io/raydium-sdk-v2';
|
|
2
|
+
import { TokenInfo } from '../../../hooks/Token';
|
|
3
|
+
export declare function useAMMV2AddLiquidity({ baseToken, quoteToken, pairMintAAmount, pairMintBAmount, slippage, isExists, poolInfo, poolKeys, successBack, submittedBack, }: {
|
|
4
|
+
baseToken: TokenInfo | undefined;
|
|
5
|
+
quoteToken: TokenInfo | undefined;
|
|
6
|
+
pairMintAAmount: string | undefined;
|
|
7
|
+
pairMintBAmount: string | undefined;
|
|
8
|
+
slippage: number;
|
|
9
|
+
isExists?: boolean;
|
|
10
|
+
poolInfo?: ApiV3PoolInfoStandardItemCpmm;
|
|
11
|
+
poolKeys?: CpmmKeys;
|
|
12
|
+
successBack?: () => void;
|
|
13
|
+
submittedBack?: () => void;
|
|
14
|
+
}): import("@tanstack/react-query").UseMutationResult<import("../../../hooks/Submission/types").ExecutionResult, Error, void, unknown>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Pair } from '@uniswap/v2-sdk';
|
|
2
|
+
import BigNumber from 'bignumber.js';
|
|
3
|
+
export declare function useAMMV2Balance({ pairAddress, pair, }: {
|
|
4
|
+
pairAddress?: string;
|
|
5
|
+
pair?: Pair | null;
|
|
6
|
+
}): {
|
|
7
|
+
isBalanceLoading: boolean;
|
|
8
|
+
isDepositedLoading: boolean;
|
|
9
|
+
balance: BigNumber | undefined;
|
|
10
|
+
poolTokenPercentage: BigNumber | undefined;
|
|
11
|
+
token0Deposited: BigNumber | undefined;
|
|
12
|
+
token1Deposited: BigNumber | undefined;
|
|
13
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ApiV3PoolInfoStandardItemCpmm, CpmmKeys } from '@raydium-io/raydium-sdk-v2';
|
|
2
|
+
import BigNumber from 'bignumber.js';
|
|
3
|
+
export declare function useAMMV2RemoveLiquidity({ liquidityAmount, slippage, poolInfo, poolKeys, submittedBack, }: {
|
|
4
|
+
liquidityAmount: BigNumber | undefined;
|
|
5
|
+
slippage: number;
|
|
6
|
+
poolInfo?: ApiV3PoolInfoStandardItemCpmm;
|
|
7
|
+
poolKeys?: CpmmKeys;
|
|
8
|
+
submittedBack?: () => void;
|
|
9
|
+
}): import("@tanstack/react-query").UseMutationResult<import("../../../hooks/Submission/types").ExecutionResult, Error, void, unknown>;
|