@dodoex/widgets 3.0.1-solana.1 → 3.0.1-solana.11
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 +2 -3
- 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 +11 -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/solana.d.ts +1 -0
- package/dist/types/constants/testId.d.ts +1 -0
- package/dist/types/contract/solana/helper.d.ts +12 -0
- package/dist/types/contract/solana/transaction.d.ts +3 -0
- package/dist/types/hooks/Bridge/useExecuteBridgeRoute.d.ts +1 -1
- package/dist/types/hooks/ConnectWallet/useWalletInfo.d.ts +5 -3
- package/dist/types/hooks/Submission/types.d.ts +25 -14
- 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 -24
- 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 +84 -0
- package/dist/types/hooks/solana/useSolanaConnection.d.ts +16 -4
- package/dist/types/hooks/solana/useSolanaProgram.d.ts +2 -0
- package/dist/types/hooks/solana/useSolanaStablePoolProgram.d.ts +1 -0
- package/dist/types/hooks/useGraphQLRequests.d.ts +0 -1
- package/dist/types/index.d.ts +11 -32
- 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/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/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 +10 -0
- package/dist/types/widgets/PoolWidget/AMMV3/AMMV3PositionsView.d.ts +14 -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 +8 -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 +14 -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 +19 -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 +11 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/RangeSelector.d.ts +17 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/RateToggle.d.ts +10 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/RemoveButton.d.ts +9 -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 +18 -0
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/useDerivedV3BurnInfo.d.ts +19 -0
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/useIsTickAtLimit.d.ts +5 -0
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/useMintAAndMintB.d.ts +7 -0
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/usePool.d.ts +11 -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 +56 -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/useV3PositionFromNFTMint.d.ts +1495 -0
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/useV3Positions.d.ts +1490 -0
- package/dist/types/widgets/PoolWidget/AMMV3/reducer.d.ts +67 -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/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/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/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 +49 -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/getPriceAndTick.d.ts +18 -0
- package/dist/types/widgets/PoolWidget/AMMV3/utils/getTickPrice.d.ts +11 -0
- package/dist/types/widgets/PoolWidget/AMMV3/utils/maxAmountSpend.d.ts +6 -0
- package/dist/types/widgets/PoolWidget/AMMV3/utils/openPositionFromBase.d.ts +19 -0
- package/dist/types/widgets/PoolWidget/AMMV3/utils/slippage.d.ts +2 -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 +24 -11
- package/dist/28442382d977858a.svg +0 -9
- package/dist/ed726d76d93d4899.svg +0 -10
- package/dist/helper-BDlZKsz2.js +0 -1
- package/dist/helper-BfA94C0a.cjs +0 -1
- package/dist/index-0sFBVe24.js +0 -12
- package/dist/index-BNHn04Tl.cjs +0 -12
- package/dist/index-B_R2PMPy.js +0 -78
- package/dist/index-CIb0BonQ.js +0 -31
- package/dist/index-DpM5nfM0.cjs +0 -31
- package/dist/index-KTuHpQNP.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 @@
|
|
|
1
|
+
export declare function useSolanaStablePoolProgram(): import("@coral-xyz/anchor").Program<import("@coral-xyz/anchor").Idl> | undefined;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,37 +1,16 @@
|
|
|
1
|
-
import { SwapProps } from './components/Swap';
|
|
2
|
-
import { WidgetProps } from './components/Widget';
|
|
3
|
-
export { useRouterStore, PageType } from './router';
|
|
4
|
-
export type { Page } from './router';
|
|
5
|
-
export { WIDGET_CLASS_NAME } from './components/Widget';
|
|
6
|
-
export { MetadataFlag } from './hooks/Submission/types';
|
|
7
|
-
export { rpcServerMap, scanUrlDomainMap } from './constants/chains';
|
|
8
|
-
export { chainListMap } from './constants/chainList';
|
|
9
|
-
export { Widget, UnstyleWidget, Message } from './components/Widget';
|
|
10
|
-
export { WIDGET_MODULE_CLASS_NAME } from './components/WidgetContainer';
|
|
11
|
-
export type { WidgetProps } from './components/Widget';
|
|
1
|
+
import type { SwapProps } from './components/Swap';
|
|
2
|
+
import type { WidgetProps } from './components/Widget';
|
|
12
3
|
export type SwapWidgetProps = WidgetProps & SwapProps;
|
|
4
|
+
export type { WidgetProps } from './components/Widget';
|
|
13
5
|
export type { TokenInfo } from './hooks/Token/type';
|
|
14
|
-
export {
|
|
6
|
+
export type { Page } from './router';
|
|
15
7
|
export { Swap } from './components/Swap';
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
8
|
+
export { UnstyleWidget, Widget } from './components/Widget';
|
|
9
|
+
export { MetadataFlag } from './hooks/Submission/types';
|
|
10
|
+
export { PageType, useRouterStore } from './router';
|
|
18
11
|
export { Pool } from './widgets/PoolWidget';
|
|
12
|
+
export { default as AMMV2Create } from './widgets/PoolWidget/AMMV2Create';
|
|
19
13
|
export { default as PoolList } from './widgets/PoolWidget/PoolList';
|
|
20
|
-
export { default as
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export { default as PoolOperateDialog, PoolOperate, } from './widgets/PoolWidget/PoolOperate';
|
|
24
|
-
export type { PoolOperateProps } from './widgets/PoolWidget/PoolOperate';
|
|
25
|
-
export { usePoolBalanceInfo } from './widgets/PoolWidget/hooks/usePoolBalanceInfo';
|
|
26
|
-
export { MiningList } from './widgets/MiningWidget/MiningList';
|
|
27
|
-
export { MiningDetail } from './widgets/MiningWidget/MiningDetail';
|
|
28
|
-
export { MiningCreate } from './widgets/MiningWidget/MiningCreate';
|
|
29
|
-
export { TokenCard } from './components/Swap/components/TokenCard';
|
|
30
|
-
export { default as TokenLogo } from './components/TokenLogo';
|
|
31
|
-
export { FailedList } from './components/List/FailedList';
|
|
32
|
-
export { EmptyList } from './components/List/EmptyList';
|
|
33
|
-
export { getEtherscanPage } from './utils/address';
|
|
34
|
-
export { formatReadableNumber, formatTokenAmountNumber, formatShortNumber, formatPercentageNumber, } from './utils/formatter';
|
|
35
|
-
export declare function SwapWidget(props: SwapWidgetProps): JSX.Element;
|
|
36
|
-
export declare function PoolWidget(props: SwapWidgetProps): JSX.Element;
|
|
37
|
-
export declare function InitSwapWidget(props: SwapWidgetProps): void;
|
|
14
|
+
export { default as AddLiquidityV3 } from './widgets/PoolWidget/AMMV3/AddLiquidityV3';
|
|
15
|
+
export { AMMV3PositionManage } from './widgets/PoolWidget/AMMV3/AMMV3PositionManage';
|
|
16
|
+
export { AMMV3PositionsView } from './widgets/PoolWidget/AMMV3/AMMV3PositionsView';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useInitContractRequest(): void;
|
|
@@ -6,7 +6,9 @@ export declare enum PageType {
|
|
|
6
6
|
CreatePool = "createPool",
|
|
7
7
|
ModifyPool = "modifyPool",
|
|
8
8
|
MiningList = "miningList",
|
|
9
|
-
MiningDetail = "miningDetail"
|
|
9
|
+
MiningDetail = "miningDetail",
|
|
10
|
+
createPoolAMMV2 = "createPoolAMMV2",
|
|
11
|
+
createPoolAMMV3 = "createPoolAMMV3"
|
|
10
12
|
}
|
|
11
13
|
interface PageTypeParams {
|
|
12
14
|
[PageType.Pool]: {
|
|
@@ -32,6 +34,12 @@ interface PageTypeParams {
|
|
|
32
34
|
miningContractAddress: string | undefined;
|
|
33
35
|
stakeTokenAddress: string | undefined;
|
|
34
36
|
};
|
|
37
|
+
[PageType.createPoolAMMV2]: undefined;
|
|
38
|
+
[PageType.createPoolAMMV3]: {
|
|
39
|
+
mint1?: string;
|
|
40
|
+
mint2?: string;
|
|
41
|
+
fee?: string;
|
|
42
|
+
} | undefined;
|
|
35
43
|
}
|
|
36
44
|
export interface Page<T extends PageType = PageType> {
|
|
37
45
|
type: T;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { ChainId } from '@dodoex/api';
|
|
2
2
|
export declare const isSameAddress: (tokenAddress1: string, tokenAddress2: string) => boolean;
|
|
3
3
|
export declare function isAddress(value: any): boolean;
|
|
4
|
-
export declare function isETHAddress(addr: string): boolean;
|
|
5
4
|
/**
|
|
6
|
-
*
|
|
7
|
-
* @param
|
|
5
|
+
* 检查 Solana 地址是否为零地址
|
|
6
|
+
* @param address Solana 地址字符串
|
|
7
|
+
* @returns 如果是零地址则返回 true
|
|
8
8
|
*/
|
|
9
|
-
export default function isZero(
|
|
9
|
+
export default function isZero(address: string): boolean;
|
|
10
10
|
/**
|
|
11
|
-
* truncate
|
|
12
|
-
*
|
|
11
|
+
* truncate address:
|
|
12
|
+
* - Solana: HN7cABqLq46Es1jh92dQQisAq662SmxGkXPnB4LZFN3 => HN7c...ZFN3
|
|
13
|
+
* - EVM: 0xeBa959390016dd81419A189e5ef6F3B6720e5A90 => 0xeBa9...5A90
|
|
14
|
+
* @param address wallet or token address
|
|
13
15
|
*/
|
|
14
16
|
export declare function truncatePoolAddress(address: string): string;
|
|
15
17
|
export declare function sortsAddress(address0: string, address1: string): boolean;
|
|
@@ -11,7 +11,7 @@ export declare function useDepositOrWithdrawOrClaim({ version, miningContractAdd
|
|
|
11
11
|
unstakeSuccessCallback?: () => void;
|
|
12
12
|
claimSuccessCallback?: () => void;
|
|
13
13
|
} & Pick<TabMiningI, 'version' | 'stakeTokenAddress' | 'source' | 'id'>): {
|
|
14
|
-
depositOrWithdrawOrClaimMutation: import("@tanstack/react-query").UseMutationResult<
|
|
14
|
+
depositOrWithdrawOrClaimMutation: import("@tanstack/react-query").UseMutationResult<any, Error, {
|
|
15
15
|
amount: BigNumber;
|
|
16
16
|
withdrawAll?: boolean;
|
|
17
17
|
submitCallback?: () => void;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { TabMiningI } from '../../types';
|
|
2
|
-
import { MiningStatusE } from '@dodoex/api';
|
|
3
2
|
export declare function useStatusAndStartBlockNumber({ miningItem, }: {
|
|
4
3
|
miningItem: TabMiningI;
|
|
5
4
|
}): {
|
|
6
|
-
status:
|
|
5
|
+
status: any;
|
|
7
6
|
miningStatusList: {
|
|
8
7
|
status: MiningStatusE;
|
|
9
8
|
firstStartTime: import("bignumber.js").BigNumber | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FetchMiningListItem, OperateType } from '../types';
|
|
2
1
|
import { MiningStatusE } from '@dodoex/api';
|
|
3
2
|
import React from 'react';
|
|
3
|
+
import { FetchMiningListItem, OperateType } from '../types';
|
|
4
4
|
export default function OperateArea({ chainId, poolAddress, status, loading, operateType, setOperateType, miningItem, associatedMineSectionVisible, goLpLink, }: {
|
|
5
5
|
chainId: number;
|
|
6
6
|
poolAddress: string;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const miningApi: MiningApi;
|
|
1
|
+
export declare const miningApi: any;
|
|
@@ -2,4 +2,4 @@ import { FetchMiningListItem } from '../types';
|
|
|
2
2
|
export declare const useClaimMiningSubmit: ({ miningItem, successBack, }: {
|
|
3
3
|
miningItem: FetchMiningListItem;
|
|
4
4
|
successBack?: () => void;
|
|
5
|
-
}) => import("@tanstack/react-query").UseMutationResult<
|
|
5
|
+
}) => import("@tanstack/react-query").UseMutationResult<any, Error, void, unknown>;
|
|
@@ -7,5 +7,5 @@ export declare function useMiningItem({ miningContractAddress, poolAddress, acco
|
|
|
7
7
|
miningItem: import("../types").TabMiningI | undefined;
|
|
8
8
|
error: Error | null;
|
|
9
9
|
loading: boolean;
|
|
10
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
10
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<unknown, Error>>;
|
|
11
11
|
};
|
|
@@ -6,7 +6,7 @@ export declare function useMiningList({ isEnded, searchText, account, chainIds,
|
|
|
6
6
|
chainIds: Array<number> | null;
|
|
7
7
|
}): {
|
|
8
8
|
error: Error | null;
|
|
9
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<
|
|
9
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<unknown, Error>>;
|
|
10
10
|
loading: boolean;
|
|
11
11
|
miningList: TabMiningI[];
|
|
12
12
|
};
|
|
@@ -5,7 +5,7 @@ export declare function useMyCreatedMiningList({ searchText, account, chainIds,
|
|
|
5
5
|
chainIds: Array<number> | null;
|
|
6
6
|
}): {
|
|
7
7
|
error: Error | null;
|
|
8
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<
|
|
8
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<unknown, Error>>;
|
|
9
9
|
loading: boolean;
|
|
10
10
|
miningList: MyCreatedMiningI[];
|
|
11
11
|
};
|
|
@@ -6,4 +6,4 @@ export declare const useStakeMiningSubmit: ({ miningItem, amount, submittedBack,
|
|
|
6
6
|
submittedBack?: () => void;
|
|
7
7
|
successBack?: () => void;
|
|
8
8
|
logBalance?: BalanceData;
|
|
9
|
-
}) => import("@tanstack/react-query").UseMutationResult<
|
|
9
|
+
}) => import("@tanstack/react-query").UseMutationResult<any, Error, void, unknown>;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import { MiningStatusE } from '@dodoex/api';
|
|
2
1
|
import { FetchMiningListItem } from '../types';
|
|
3
2
|
export declare function useStatusAndStartBlockNumber({ miningItem, }: {
|
|
4
3
|
miningItem: FetchMiningListItem;
|
|
5
4
|
}): {
|
|
6
|
-
status:
|
|
7
|
-
miningStatusList:
|
|
8
|
-
status: import("@dodoex/api/dist/types/services/mining/utils").MiningStatusE;
|
|
9
|
-
firstStartTime: import("bignumber.js").BigNumber | undefined;
|
|
10
|
-
lastEndTime: import("bignumber.js").BigNumber | undefined;
|
|
11
|
-
currentTime: import("bignumber.js").BigNumber;
|
|
12
|
-
}[];
|
|
5
|
+
status: any;
|
|
6
|
+
miningStatusList: any[];
|
|
13
7
|
};
|
|
@@ -6,4 +6,4 @@ export declare const useUnstakeMiningSubmit: ({ miningItem, amount, submittedBac
|
|
|
6
6
|
submittedBack?: () => void;
|
|
7
7
|
successBack?: () => void;
|
|
8
8
|
logBalance?: BalanceData;
|
|
9
|
-
}) => import("@tanstack/react-query").UseMutationResult<
|
|
9
|
+
}) => import("@tanstack/react-query").UseMutationResult<any, Error, void, unknown>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { TokenInfo } from '../../../hooks/Token';
|
|
3
|
+
import { useAMMV2AddLiquidity } from '../hooks/useAMMV2AddLiquidity';
|
|
4
|
+
export default function ConfirmDialog({ open, onClose, slippage, baseToken, quoteToken, pairMintAAmount, pairMintBAmount, lpAmount, feeRate, price, lpBalancePercentage, pairAddress, createMutation, }: {
|
|
5
|
+
open: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
slippage: number;
|
|
8
|
+
baseToken?: TokenInfo;
|
|
9
|
+
quoteToken?: TokenInfo;
|
|
10
|
+
pairMintAAmount: string | undefined;
|
|
11
|
+
pairMintBAmount: string | undefined;
|
|
12
|
+
lpAmount: BigNumber | undefined;
|
|
13
|
+
feeRate: string | number | undefined;
|
|
14
|
+
price?: BigNumber | null;
|
|
15
|
+
lpBalancePercentage: BigNumber | number | undefined;
|
|
16
|
+
pairAddress?: string;
|
|
17
|
+
createMutation: ReturnType<typeof useAMMV2AddLiquidity>;
|
|
18
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default function FeeEdit({ disabled, feeIndex, onChange, feeList, }: {
|
|
2
|
+
disabled?: boolean;
|
|
3
|
+
feeIndex: number;
|
|
4
|
+
onChange: (v: number) => void;
|
|
5
|
+
feeList: {
|
|
6
|
+
id: string;
|
|
7
|
+
index: number;
|
|
8
|
+
protocolFeeRate: number;
|
|
9
|
+
tradeFeeRate: number;
|
|
10
|
+
fundFeeRate: number;
|
|
11
|
+
createPoolFee: string;
|
|
12
|
+
}[];
|
|
13
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BoxProps } from '@dodoex/components';
|
|
2
|
+
import { ApiV3PoolInfoStandardItemCpmm } from '@raydium-io/raydium-sdk-v2';
|
|
3
|
+
import BigNumber from 'bignumber.js';
|
|
4
|
+
export default function MyLiquidity({ isExists, poolInfo, poolInfoLoading, lpBalanceLoading, lpBalance, lpBalancePercentage, lpToAmountA, lpToAmountB, sx, }: {
|
|
5
|
+
isExists: boolean;
|
|
6
|
+
poolInfo?: ApiV3PoolInfoStandardItemCpmm;
|
|
7
|
+
poolInfoLoading: boolean;
|
|
8
|
+
lpBalanceLoading: boolean;
|
|
9
|
+
lpBalance: BigNumber | undefined;
|
|
10
|
+
lpBalancePercentage: BigNumber | undefined;
|
|
11
|
+
lpToAmountA: BigNumber | undefined;
|
|
12
|
+
lpToAmountB: BigNumber | undefined;
|
|
13
|
+
sx?: BoxProps['sx'];
|
|
14
|
+
}): JSX.Element | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BoxProps } from '@dodoex/components';
|
|
2
|
+
import BigNumber from 'bignumber.js';
|
|
3
|
+
import { TokenInfo } from '../../../hooks/Token';
|
|
4
|
+
export declare function RatioPrice({ baseToken, quoteToken, midPrice, loading, disabled, }: {
|
|
5
|
+
baseToken?: TokenInfo;
|
|
6
|
+
quoteToken?: TokenInfo;
|
|
7
|
+
midPrice?: BigNumber | null;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}): JSX.Element;
|
|
11
|
+
export default function Ratio({ baseToken, quoteToken, loading, midPrice, lpBalancePercentage, sx, }: {
|
|
12
|
+
baseToken?: TokenInfo;
|
|
13
|
+
quoteToken?: TokenInfo;
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
midPrice?: BigNumber | null;
|
|
16
|
+
lpBalancePercentage: BigNumber | number | undefined;
|
|
17
|
+
sx?: BoxProps['sx'];
|
|
18
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BoxProps } from '@dodoex/components';
|
|
2
|
+
import { AUTO_SWAP_SLIPPAGE_PROTECTION } from '../../../constants/pool';
|
|
3
|
+
export declare const useSlipper: ({ address }: {
|
|
4
|
+
address?: string;
|
|
5
|
+
}) => {
|
|
6
|
+
slipper: number | "auto";
|
|
7
|
+
setSlipper: import("react").Dispatch<import("react").SetStateAction<number | "auto">>;
|
|
8
|
+
slipperValue: number;
|
|
9
|
+
resetSlipper: () => void;
|
|
10
|
+
};
|
|
11
|
+
export default function Setting({ sx, disabled, slippage, onChangeSlippage, }: {
|
|
12
|
+
sx?: BoxProps['sx'];
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
slippage: number | typeof AUTO_SWAP_SLIPPAGE_PROTECTION;
|
|
15
|
+
onChangeSlippage: (val: number | typeof AUTO_SWAP_SLIPPAGE_PROTECTION) => void;
|
|
16
|
+
}): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function AMMV2Create(): JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FeeAmount } from './sdks/v3-sdk/constants';
|
|
2
|
+
export interface AMMV3PositionManageProps {
|
|
3
|
+
mint1Address: string;
|
|
4
|
+
mint2Address: string;
|
|
5
|
+
feeAmount: FeeAmount;
|
|
6
|
+
poolId: string;
|
|
7
|
+
nftMint: string;
|
|
8
|
+
onClose: (() => void) | undefined;
|
|
9
|
+
}
|
|
10
|
+
export declare const AMMV3PositionManage: ({ mint1Address, mint2Address, feeAmount, poolId, nftMint, onClose, }: AMMV3PositionManageProps) => JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FeeAmount } from './sdks/v3-sdk/constants';
|
|
2
|
+
export interface AMMV3PositionsViewProps {
|
|
3
|
+
mint1Address: string;
|
|
4
|
+
mint2Address: string;
|
|
5
|
+
feeAmount: FeeAmount;
|
|
6
|
+
poolId: string;
|
|
7
|
+
onClose: (() => void) | undefined;
|
|
8
|
+
handleGoToAddLiquidityV3: (params: {
|
|
9
|
+
mint1?: string;
|
|
10
|
+
mint2?: string;
|
|
11
|
+
fee?: string;
|
|
12
|
+
}) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const AMMV3PositionsView: ({ mint1Address, mint2Address, feeAmount, poolId, onClose, handleGoToAddLiquidityV3, }: AMMV3PositionsViewProps) => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChainId } from '@dodoex/api';
|
|
2
|
+
export interface ButtonsProps {
|
|
3
|
+
chainId: ChainId;
|
|
4
|
+
isValid: boolean;
|
|
5
|
+
errorMessage: React.ReactNode;
|
|
6
|
+
setShowConfirm: React.Dispatch<React.SetStateAction<boolean>>;
|
|
7
|
+
}
|
|
8
|
+
export declare const Buttons: ({ chainId, isValid, errorMessage, setShowConfirm, }: ButtonsProps) => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChainId } from '@dodoex/api';
|
|
2
|
+
export interface ClaimButtonProps {
|
|
3
|
+
chainId: ChainId;
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
onConfirm: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const ClaimButton: ({ chainId, disabled, isLoading, onConfirm, }: ClaimButtonProps) => JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { TokenInfo } from '../../../../hooks/Token/type';
|
|
3
|
+
export interface CurrencyInputPanelProps {
|
|
4
|
+
value: string;
|
|
5
|
+
onUserInput: (value: string) => void;
|
|
6
|
+
maxAmount: BigNumber | undefined;
|
|
7
|
+
balance: BigNumber | undefined;
|
|
8
|
+
mint?: TokenInfo | null;
|
|
9
|
+
locked?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const CurrencyInputPanel: ({ value, onUserInput, maxAmount, balance, mint, locked, }: CurrencyInputPanelProps) => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Actions } from '../reducer';
|
|
2
|
+
import { FeeAmount } from '../sdks/v3-sdk/constants';
|
|
3
|
+
export interface FeeSelectorProps {
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
feeAmount?: FeeAmount;
|
|
6
|
+
dispatch: React.Dispatch<Actions>;
|
|
7
|
+
}
|
|
8
|
+
export declare const FeeSelector: ({ disabled, feeAmount, dispatch, }: FeeSelectorProps) => JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface StepCounterProps {
|
|
3
|
+
value: string;
|
|
4
|
+
onUserInput: (value: string) => void;
|
|
5
|
+
decrement: () => string;
|
|
6
|
+
increment: () => string;
|
|
7
|
+
decrementDisabled?: boolean;
|
|
8
|
+
incrementDisabled?: boolean;
|
|
9
|
+
locked?: boolean;
|
|
10
|
+
title: ReactNode;
|
|
11
|
+
perPriceText: string;
|
|
12
|
+
}
|
|
13
|
+
declare const StepCounter: ({ value, decrement, increment, decrementDisabled, incrementDisabled, locked, onUserInput, title, perPriceText, }: StepCounterProps) => JSX.Element;
|
|
14
|
+
export default StepCounter;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ScaleLinear } from 'd3';
|
|
2
|
+
import { ChartEntry } from './types';
|
|
3
|
+
export declare const Area: ({ series, xScale, yScale, xValue, yValue, fill, }: {
|
|
4
|
+
series: ChartEntry[];
|
|
5
|
+
xScale: ScaleLinear<number, number>;
|
|
6
|
+
yScale: ScaleLinear<number, number>;
|
|
7
|
+
xValue: (d: ChartEntry) => number;
|
|
8
|
+
yValue: (d: ChartEntry) => number;
|
|
9
|
+
fill?: string;
|
|
10
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ScaleLinear } from 'd3';
|
|
2
|
+
export declare const Brush: ({ id, xScale, interactive, brushLabelValue, brushExtent, setBrushExtent, innerWidth, innerHeight, westHandleColor, eastHandleColor, }: {
|
|
3
|
+
id: string;
|
|
4
|
+
xScale: ScaleLinear<number, number>;
|
|
5
|
+
interactive: boolean;
|
|
6
|
+
brushLabelValue: (d: "w" | "e", x: number) => string;
|
|
7
|
+
brushExtent: [number, number];
|
|
8
|
+
setBrushExtent: (extent: [number, number], mode: string | undefined) => void;
|
|
9
|
+
innerWidth: number;
|
|
10
|
+
innerHeight: number;
|
|
11
|
+
westHandleColor: string;
|
|
12
|
+
eastHandleColor: string;
|
|
13
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { LiquidityChartRangeInputProps } from './types';
|
|
2
|
+
export declare function Chart({ id, data: { series, current }, ticksAtLimit, styles, dimensions: { width, height }, margins, interactive, brushDomain, brushLabels, onBrushDomainChange, zoomLevels, }: LiquidityChartRangeInputProps): JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ScaleLinear, ZoomTransform } from 'd3';
|
|
2
|
+
import { ZoomLevels } from './types';
|
|
3
|
+
export default function Zoom({ svg, xScale, setZoom, width, height, resetBrush, showResetButton, zoomLevels, }: {
|
|
4
|
+
svg: SVGElement | null;
|
|
5
|
+
xScale: ScaleLinear<number, number>;
|
|
6
|
+
setZoom: (transform: ZoomTransform) => void;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
resetBrush: () => void;
|
|
10
|
+
showResetButton: boolean;
|
|
11
|
+
zoomLevels: ZoomLevels;
|
|
12
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TokenInfo } from '../../../../../hooks/Token/type';
|
|
2
|
+
import { FeeAmount } from '../../sdks/v3-sdk/constants';
|
|
3
|
+
import { ChartEntry } from './types';
|
|
4
|
+
export declare function useDensityChartData({ mint1, mint2, feeAmount, }: {
|
|
5
|
+
mint1: Maybe<TokenInfo>;
|
|
6
|
+
mint2: Maybe<TokenInfo>;
|
|
7
|
+
feeAmount?: FeeAmount;
|
|
8
|
+
}): {
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
error: any;
|
|
11
|
+
formattedData: ChartEntry[] | undefined;
|
|
12
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { TokenInfo } from '../../../../../hooks/Token/type';
|
|
3
|
+
import { FeeAmount } from '../../sdks/v3-sdk/constants';
|
|
4
|
+
import { Bound } from '../../types';
|
|
5
|
+
export default function LiquidityChartRangeInput({ mint1, mint2, feeAmount, ticksAtLimit, price, priceLower, priceUpper, onLeftRangeInput, onRightRangeInput, interactive, }: {
|
|
6
|
+
mint1?: Maybe<TokenInfo>;
|
|
7
|
+
mint2?: Maybe<TokenInfo>;
|
|
8
|
+
feeAmount?: FeeAmount;
|
|
9
|
+
ticksAtLimit: {
|
|
10
|
+
[bound in Bound]?: boolean | undefined;
|
|
11
|
+
};
|
|
12
|
+
price: number | undefined;
|
|
13
|
+
priceLower: BigNumber | undefined;
|
|
14
|
+
priceUpper: BigNumber | undefined;
|
|
15
|
+
onLeftRangeInput: (typedValue: string) => void;
|
|
16
|
+
onRightRangeInput: (typedValue: string) => void;
|
|
17
|
+
interactive: boolean;
|
|
18
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates an SVG path for the east brush handle.
|
|
3
|
+
* Apply `scale(-1, 1)` to generate west brush handle.
|
|
4
|
+
*
|
|
5
|
+
* |```````\
|
|
6
|
+
* | | | |
|
|
7
|
+
* |______/
|
|
8
|
+
* |
|
|
9
|
+
* |
|
|
10
|
+
* |
|
|
11
|
+
* |
|
|
12
|
+
* |
|
|
13
|
+
*
|
|
14
|
+
* https://medium.com/@dennismphil/one-side-rounded-rectangle-using-svg-fb31cf318d90
|
|
15
|
+
*/
|
|
16
|
+
export declare const brushHandlePath: (height: number) => string;
|
|
17
|
+
export declare const brushHandleAccentPath: () => string;
|
|
18
|
+
export declare const OffScreenHandle: ({ color, size, margin, }: {
|
|
19
|
+
color: string;
|
|
20
|
+
size?: number;
|
|
21
|
+
margin?: number;
|
|
22
|
+
}) => JSX.Element;
|
|
@@ -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;
|