@dodoex/widgets 3.0.0-beta.31 → 3.0.0-beta.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/e2e/connect.test.d.ts +6 -0
- package/dist/cjs/e2e/constants.d.ts +87 -0
- package/dist/cjs/e2e/default.test.d.ts +6 -0
- package/dist/cjs/e2e/setup.d.ts +4 -0
- package/dist/cjs/helper-DL8TMEkQ.cjs +1 -0
- package/dist/cjs/helper-DNaeIBQY.cjs +1 -0
- package/dist/cjs/index-BZtt1iuv.cjs +12 -0
- package/dist/cjs/index-BwnUmGDp.cjs +53 -0
- package/dist/cjs/index-CULtuKOC.cjs +78 -0
- package/dist/cjs/index-DUQ8hOW2.cjs +78 -0
- package/dist/cjs/index-DWLX0NSs.cjs +53 -0
- package/dist/cjs/index-DsNlidLA.cjs +12 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/lottie-4VzKv4A8.cjs +1 -0
- package/dist/cjs/lottie-TilCy8UF.cjs +1 -0
- package/dist/cjs/src/components/Bridge/BridgeRouteShortCard.d.ts +6 -0
- package/dist/cjs/src/components/Bridge/BridgeSummaryDialog/BridgeSummaryDetail.d.ts +5 -0
- package/dist/cjs/src/components/Bridge/BridgeSummaryDialog/index.d.ts +18 -0
- package/dist/cjs/src/components/Bridge/BridgeSummaryDialog/orderInfoModal/CrossStep.d.ts +16 -0
- package/dist/cjs/src/components/Bridge/BridgeSummaryDialog/orderInfoModal/EtherscanLinkButton.d.ts +6 -0
- package/dist/cjs/src/components/Bridge/BridgeSummaryDialog/orderInfoModal/RouteSteps.d.ts +6 -0
- package/dist/cjs/src/components/Bridge/BridgeSummaryDialog/orderInfoModal/SwapStep.d.ts +14 -0
- package/dist/cjs/src/components/Bridge/SelectBridgeDialog/BridgeLogo.d.ts +10 -0
- package/dist/cjs/src/components/Bridge/SelectBridgeDialog/DirectionLine.d.ts +4 -0
- package/dist/cjs/src/components/Bridge/SelectBridgeDialog/RouteCard.d.ts +21 -0
- package/dist/cjs/src/components/Bridge/SelectBridgeDialog/RouteTagList.d.ts +12 -0
- package/dist/cjs/src/components/Bridge/SelectBridgeDialog/TokenWithChain.d.ts +11 -0
- package/dist/cjs/src/components/Bridge/SelectBridgeDialog/index.d.ts +9 -0
- package/dist/cjs/src/components/Bridge/SelectBridgeDialog/productList.d.ts +8 -0
- package/dist/cjs/src/components/ErrorMessageDialog.d.ts +5 -0
- package/dist/cjs/src/components/Swap/components/ConnectWallet/ConnectWalletDialog.d.ts +5 -0
- package/dist/cjs/src/components/Swap/components/ConnectWallet/index.d.ts +9 -0
- package/dist/cjs/src/components/Swap/components/Dialog.d.ts +14 -0
- package/dist/cjs/src/components/Swap/components/ReviewDialog.d.ts +22 -0
- package/dist/cjs/src/components/Swap/components/SettingsDialog/NumberInput.d.ts +8 -0
- package/dist/cjs/src/components/Swap/components/SettingsDialog/index.d.ts +7 -0
- package/dist/cjs/src/components/Swap/components/SwitchBox.d.ts +5 -0
- package/dist/cjs/src/components/Swap/components/TokenCard/BalanceText.d.ts +9 -0
- package/dist/cjs/src/components/Swap/components/TokenCard/NumberInput.d.ts +13 -0
- package/dist/cjs/src/components/Swap/components/TokenCard/TokenLogoCollapse.d.ts +7 -0
- package/dist/cjs/src/components/Swap/components/TokenCard/TokenPickerDialog.d.ts +13 -0
- package/dist/cjs/src/components/Swap/components/TokenCard/index.d.ts +23 -0
- package/dist/cjs/src/components/Swap/components/TokenPairPriceWithToggle.d.ts +10 -0
- package/dist/cjs/src/components/Swap/index.d.ts +9 -0
- package/dist/cjs/src/components/SwitchChainDialog/index.d.ts +7 -0
- package/dist/cjs/src/components/TokenLogo.d.ts +16 -0
- package/dist/cjs/src/components/TokenPicker/PopularToken.d.ts +7 -0
- package/dist/cjs/src/components/TokenPicker/SelectChainItem.d.ts +7 -0
- package/dist/cjs/src/components/TokenPicker/TokenItem.d.ts +8 -0
- package/dist/cjs/src/components/TokenPicker/index.d.ts +19 -0
- package/dist/cjs/src/components/Tooltip/QuestionTooltip.d.ts +3 -0
- package/dist/cjs/src/components/Tooltip/index.d.ts +1 -0
- package/dist/cjs/src/components/Widget/i18n.d.ts +9 -0
- package/dist/cjs/src/components/Widget/index.d.ts +34 -0
- package/dist/cjs/src/components/WithExecutionDialog/index.d.ts +5 -0
- package/dist/cjs/src/constants/address.d.ts +1 -0
- package/dist/cjs/src/constants/api.d.ts +16 -0
- package/dist/cjs/src/constants/chainList.d.ts +9 -0
- package/dist/cjs/src/constants/chains.d.ts +42 -0
- package/dist/cjs/src/constants/locales.d.ts +3 -0
- package/dist/cjs/src/constants/localstorage.d.ts +12 -0
- package/dist/cjs/src/constants/swap.d.ts +7 -0
- package/dist/cjs/src/constants/testId.d.ts +10 -0
- package/dist/cjs/src/constants/token.d.ts +2 -0
- package/dist/cjs/src/constants/tokenList.d.ts +18 -0
- package/dist/cjs/src/constants/wallet.d.ts +23 -0
- package/dist/cjs/src/hooks/Bridge/createBridgeOrder.d.ts +28 -0
- package/dist/cjs/src/hooks/Bridge/index.d.ts +4 -0
- package/dist/cjs/src/hooks/Bridge/useExecuteBridgeRoute.d.ts +6 -0
- package/dist/cjs/src/hooks/Bridge/useFetchRoutePriceBridge.d.ts +113 -0
- package/dist/cjs/src/hooks/Bridge/useFetchRoutePriceBridge.test.d.ts +1 -0
- package/dist/cjs/src/hooks/Bridge/useSendRoute.d.ts +16 -0
- package/dist/cjs/src/hooks/Bridge/useSwitchBridgeOrSwapSlippage.d.ts +1 -0
- package/dist/cjs/src/hooks/ConnectWallet/Connectors/JsonRpcConnector.d.ts +9 -0
- package/dist/cjs/src/hooks/ConnectWallet/TonConnect/index.d.ts +26 -0
- package/dist/cjs/src/hooks/ConnectWallet/index.d.ts +3 -0
- package/dist/cjs/src/hooks/ConnectWallet/useCurrentChainId.d.ts +2 -0
- package/dist/cjs/src/hooks/ConnectWallet/useSwitchChain.d.ts +10 -0
- package/dist/cjs/src/hooks/ConnectWallet/useWalletState.d.ts +24 -0
- package/dist/cjs/src/hooks/ConnectWallet/useWeb3Connectors.d.ts +17 -0
- package/dist/cjs/src/hooks/ConnectWallet/web3.d.ts +10 -0
- package/dist/cjs/src/hooks/Submission/getExecutionErrorMsg.d.ts +2 -0
- package/dist/cjs/src/hooks/Submission/index.d.ts +10 -0
- package/dist/cjs/src/hooks/Submission/spec.d.ts +56 -0
- package/dist/cjs/src/hooks/Submission/types.d.ts +50 -0
- package/dist/cjs/src/hooks/Submission/useExecution.d.ts +31 -0
- package/dist/cjs/src/hooks/Submission/useInflights.d.ts +5 -0
- package/dist/cjs/src/hooks/Swap/index.d.ts +5 -0
- package/dist/cjs/src/hooks/Swap/useExecuteSwap.d.ts +12 -0
- package/dist/cjs/src/hooks/Swap/useFetchFiatPrice.d.ts +13 -0
- package/dist/cjs/src/hooks/Swap/useFetchFiatPrice.test.d.ts +1 -0
- package/dist/cjs/src/hooks/Swap/useFetchRoutePrice.d.ts +37 -0
- package/dist/cjs/src/hooks/Swap/useFetchRoutePrice.test.d.ts +1 -0
- package/dist/cjs/src/hooks/Swap/useInitDefaultToken.d.ts +10 -0
- package/dist/cjs/src/hooks/Swap/useMarginAmount.d.ts +8 -0
- package/dist/cjs/src/hooks/Swap/useMarginAmount.test.d.ts +1 -0
- package/dist/cjs/src/hooks/Swap/usePriceTimer.d.ts +5 -0
- package/dist/cjs/src/hooks/Swap/useSlippageLimit.d.ts +2 -0
- package/dist/cjs/src/hooks/Token/index.d.ts +4 -0
- package/dist/cjs/src/hooks/Token/type.d.ts +26 -0
- package/dist/cjs/src/hooks/Token/useDisabledTokenSwitch.d.ts +5 -0
- package/dist/cjs/src/hooks/Token/useFetchTokenAllowance.d.ts +13 -0
- package/dist/cjs/src/hooks/Token/useFindTokenByAddress.d.ts +1 -0
- package/dist/cjs/src/hooks/Token/useFindTokenByAddress.test.d.ts +1 -0
- package/dist/cjs/src/hooks/Token/useGetAllowance.d.ts +3 -0
- package/dist/cjs/src/hooks/Token/useGetAllowance.test.d.ts +1 -0
- package/dist/cjs/src/hooks/Token/useGetBalance.d.ts +2 -0
- package/dist/cjs/src/hooks/Token/useGetBalance.test.d.ts +1 -0
- package/dist/cjs/src/hooks/Token/useGetCGTokenList.d.ts +15 -0
- package/dist/cjs/src/hooks/Token/useGetTokenStatus.d.ts +13 -0
- package/dist/cjs/src/hooks/Token/useGetTokenStatus.test.d.ts +1 -0
- package/dist/cjs/src/hooks/Token/useInitTokenList.d.ts +8 -0
- package/dist/cjs/src/hooks/Token/useSelectChainList.d.ts +7 -0
- package/dist/cjs/src/hooks/Token/useSelectChainList.test.d.ts +1 -0
- package/dist/cjs/src/hooks/Token/useTokenList.d.ts +30 -0
- package/dist/cjs/src/hooks/Token/useTokenList.test.d.ts +1 -0
- package/dist/cjs/src/hooks/Token/useTokenListFetchBalance.d.ts +9 -0
- package/dist/cjs/src/hooks/Widget/useInitPropsToRedux.d.ts +2 -0
- package/dist/cjs/src/hooks/contract/abis/OrbiterV3ABI.d.ts +85 -0
- package/dist/cjs/src/hooks/contract/abis/erc20ABI.d.ts +30 -0
- package/dist/cjs/src/hooks/contract/abis/erc20Helper.d.ts +16 -0
- package/dist/cjs/src/hooks/contract/abis/multicallABI.d.ts +34 -0
- package/dist/cjs/src/hooks/contract/batch.d.ts +18 -0
- package/dist/cjs/src/hooks/contract/contractConfig.d.ts +9 -0
- package/dist/cjs/src/hooks/contract/index.d.ts +5 -0
- package/dist/cjs/src/hooks/contract/orbiter/constants.d.ts +3 -0
- package/dist/cjs/src/hooks/contract/orbiter/encodeOrbiterBridge.d.ts +12 -0
- package/dist/cjs/src/hooks/contract/orbiter/useOrbiterContractMap.d.ts +5 -0
- package/dist/cjs/src/hooks/contract/orbiter/useOrbiterRouters.d.ts +21 -0
- package/dist/cjs/src/hooks/contract/provider.d.ts +2 -0
- package/dist/cjs/src/hooks/contract/token.d.ts +10 -0
- package/dist/cjs/src/hooks/contract/useFetchBlockNumber.d.ts +3 -0
- package/dist/cjs/src/hooks/contract/useFetchETHBalance.d.ts +1 -0
- package/dist/cjs/src/hooks/contract/useFetchTokens.d.ts +19 -0
- package/dist/cjs/src/hooks/contract/useMultiContract.d.ts +14 -0
- package/dist/cjs/src/hooks/contract/wallet.d.ts +16 -0
- package/dist/cjs/src/hooks/setting/useDefaultSlippage.d.ts +4 -0
- package/dist/cjs/src/hooks/setting/useGetAPIService.d.ts +2 -0
- package/dist/cjs/src/hooks/setting/useSetAutoSlippage.d.ts +13 -0
- package/dist/cjs/src/index.d.ts +6 -0
- package/dist/cjs/src/store/actions/globals.d.ts +9 -0
- package/dist/cjs/src/store/actions/index.d.ts +4 -0
- package/dist/cjs/src/store/actions/settings.d.ts +6 -0
- package/dist/cjs/src/store/actions/token.d.ts +15 -0
- package/dist/cjs/src/store/actions/wallet.d.ts +5 -0
- package/dist/cjs/src/store/index.d.ts +6 -0
- package/dist/cjs/src/store/reducers/globals.d.ts +23 -0
- package/dist/cjs/src/store/reducers/index.d.ts +17 -0
- package/dist/cjs/src/store/reducers/settings.d.ts +13 -0
- package/dist/cjs/src/store/reducers/token.d.ts +31 -0
- package/dist/cjs/src/store/reducers/wallet.d.ts +10 -0
- package/dist/cjs/src/store/selectors/globals.d.ts +7 -0
- package/dist/cjs/src/store/selectors/settings.d.ts +4 -0
- package/dist/cjs/src/store/selectors/token.d.ts +19 -0
- package/dist/cjs/src/store/selectors/wallet.d.ts +4 -0
- package/dist/cjs/src/utils/address.d.ts +15 -0
- package/dist/cjs/src/utils/address.test.d.ts +1 -0
- package/dist/cjs/src/utils/chains.d.ts +2 -0
- package/dist/cjs/src/utils/chains.test.d.ts +1 -0
- package/dist/cjs/src/utils/formatter.d.ts +25 -0
- package/dist/cjs/src/utils/formatter.test.d.ts +1 -0
- package/dist/cjs/src/utils/index.d.ts +5 -0
- package/dist/cjs/src/utils/time.d.ts +9 -0
- package/dist/cjs/src/utils/time.test.d.ts +1 -0
- package/dist/cjs/src/utils/token.d.ts +9 -0
- package/dist/cjs/src/utils/token.test.d.ts +1 -0
- package/dist/cjs/src/utils/wallet.d.ts +8 -0
- package/dist/cjs/src/utils/wallet.test.d.ts +1 -0
- package/dist/e2e/connect.test.d.ts +6 -0
- package/dist/e2e/constants.d.ts +87 -0
- package/dist/e2e/default.test.d.ts +6 -0
- package/dist/e2e/setup.d.ts +4 -0
- package/dist/helper-CHqZavUq.js +1 -0
- package/dist/helper-D1mp2p4F.js +1 -0
- package/dist/index-0IX6JBNg.js +12 -0
- package/dist/index-BgcusTMt.js +78 -0
- package/dist/index-CE6izMXy.js +12 -0
- package/dist/index-CEwSZbo5.js +53 -0
- package/dist/index-CTxzesqs.js +53 -0
- package/dist/index-Duga8SDh.js +78 -0
- package/dist/index.js +1 -1
- package/dist/lottie-B77ifW0u.js +1 -0
- package/dist/lottie-DMZ5X1eY.js +1 -0
- package/dist/src/components/Bridge/BridgeRouteShortCard.d.ts +6 -0
- package/dist/src/components/Bridge/BridgeSummaryDialog/BridgeSummaryDetail.d.ts +5 -0
- package/dist/src/components/Bridge/BridgeSummaryDialog/index.d.ts +18 -0
- package/dist/src/components/Bridge/BridgeSummaryDialog/orderInfoModal/CrossStep.d.ts +16 -0
- package/dist/src/components/Bridge/BridgeSummaryDialog/orderInfoModal/EtherscanLinkButton.d.ts +6 -0
- package/dist/src/components/Bridge/BridgeSummaryDialog/orderInfoModal/RouteSteps.d.ts +6 -0
- package/dist/src/components/Bridge/BridgeSummaryDialog/orderInfoModal/SwapStep.d.ts +14 -0
- package/dist/src/components/Bridge/SelectBridgeDialog/BridgeLogo.d.ts +10 -0
- package/dist/src/components/Bridge/SelectBridgeDialog/DirectionLine.d.ts +4 -0
- package/dist/src/components/Bridge/SelectBridgeDialog/RouteCard.d.ts +21 -0
- package/dist/src/components/Bridge/SelectBridgeDialog/RouteTagList.d.ts +12 -0
- package/dist/src/components/Bridge/SelectBridgeDialog/TokenWithChain.d.ts +11 -0
- package/dist/src/components/Bridge/SelectBridgeDialog/index.d.ts +9 -0
- package/dist/src/components/Bridge/SelectBridgeDialog/productList.d.ts +8 -0
- package/dist/src/components/ErrorMessageDialog.d.ts +5 -0
- package/dist/src/components/Swap/components/ConnectWallet/ConnectWalletDialog.d.ts +5 -0
- package/dist/src/components/Swap/components/ConnectWallet/index.d.ts +9 -0
- package/dist/src/components/Swap/components/Dialog.d.ts +14 -0
- package/dist/src/components/Swap/components/ReviewDialog.d.ts +22 -0
- package/dist/src/components/Swap/components/SettingsDialog/NumberInput.d.ts +8 -0
- package/dist/src/components/Swap/components/SettingsDialog/index.d.ts +7 -0
- package/dist/src/components/Swap/components/SwitchBox.d.ts +5 -0
- package/dist/src/components/Swap/components/TokenCard/BalanceText.d.ts +9 -0
- package/dist/src/components/Swap/components/TokenCard/NumberInput.d.ts +13 -0
- package/dist/src/components/Swap/components/TokenCard/TokenLogoCollapse.d.ts +7 -0
- package/dist/src/components/Swap/components/TokenCard/TokenPickerDialog.d.ts +13 -0
- package/dist/src/components/Swap/components/TokenCard/index.d.ts +23 -0
- package/dist/src/components/Swap/components/TokenPairPriceWithToggle.d.ts +10 -0
- package/dist/src/components/Swap/index.d.ts +9 -0
- package/dist/src/components/SwitchChainDialog/index.d.ts +7 -0
- package/dist/src/components/TokenLogo.d.ts +16 -0
- package/dist/src/components/TokenPicker/PopularToken.d.ts +7 -0
- package/dist/src/components/TokenPicker/SelectChainItem.d.ts +7 -0
- package/dist/src/components/TokenPicker/TokenItem.d.ts +8 -0
- package/dist/src/components/TokenPicker/index.d.ts +19 -0
- package/dist/src/components/Tooltip/QuestionTooltip.d.ts +3 -0
- package/dist/src/components/Tooltip/index.d.ts +1 -0
- package/dist/src/components/Widget/i18n.d.ts +9 -0
- package/dist/src/components/Widget/index.d.ts +34 -0
- package/dist/src/components/WithExecutionDialog/index.d.ts +5 -0
- package/dist/src/constants/address.d.ts +1 -0
- package/dist/src/constants/api.d.ts +16 -0
- package/dist/src/constants/chainList.d.ts +9 -0
- package/dist/src/constants/chains.d.ts +42 -0
- package/dist/src/constants/locales.d.ts +3 -0
- package/dist/src/constants/localstorage.d.ts +12 -0
- package/dist/src/constants/swap.d.ts +7 -0
- package/dist/src/constants/testId.d.ts +10 -0
- package/dist/src/constants/token.d.ts +2 -0
- package/dist/src/constants/tokenList.d.ts +18 -0
- package/dist/src/constants/wallet.d.ts +23 -0
- package/dist/src/hooks/Bridge/createBridgeOrder.d.ts +28 -0
- package/dist/src/hooks/Bridge/index.d.ts +4 -0
- package/dist/src/hooks/Bridge/useExecuteBridgeRoute.d.ts +6 -0
- package/dist/src/hooks/Bridge/useFetchRoutePriceBridge.d.ts +113 -0
- package/dist/src/hooks/Bridge/useFetchRoutePriceBridge.test.d.ts +1 -0
- package/dist/src/hooks/Bridge/useSendRoute.d.ts +16 -0
- package/dist/src/hooks/Bridge/useSwitchBridgeOrSwapSlippage.d.ts +1 -0
- package/dist/src/hooks/ConnectWallet/Connectors/JsonRpcConnector.d.ts +9 -0
- package/dist/src/hooks/ConnectWallet/TonConnect/index.d.ts +26 -0
- package/dist/src/hooks/ConnectWallet/index.d.ts +3 -0
- package/dist/src/hooks/ConnectWallet/useCurrentChainId.d.ts +2 -0
- package/dist/src/hooks/ConnectWallet/useSwitchChain.d.ts +10 -0
- package/dist/src/hooks/ConnectWallet/useWalletState.d.ts +24 -0
- package/dist/src/hooks/ConnectWallet/useWeb3Connectors.d.ts +17 -0
- package/dist/src/hooks/ConnectWallet/web3.d.ts +10 -0
- package/dist/src/hooks/Submission/getExecutionErrorMsg.d.ts +2 -0
- package/dist/src/hooks/Submission/index.d.ts +10 -0
- package/dist/src/hooks/Submission/spec.d.ts +56 -0
- package/dist/src/hooks/Submission/types.d.ts +50 -0
- package/dist/src/hooks/Submission/useExecution.d.ts +31 -0
- package/dist/src/hooks/Submission/useInflights.d.ts +5 -0
- package/dist/src/hooks/Swap/index.d.ts +5 -0
- package/dist/src/hooks/Swap/useExecuteSwap.d.ts +12 -0
- package/dist/src/hooks/Swap/useFetchFiatPrice.d.ts +13 -0
- package/dist/src/hooks/Swap/useFetchFiatPrice.test.d.ts +1 -0
- package/dist/src/hooks/Swap/useFetchRoutePrice.d.ts +37 -0
- package/dist/src/hooks/Swap/useFetchRoutePrice.test.d.ts +1 -0
- package/dist/src/hooks/Swap/useInitDefaultToken.d.ts +10 -0
- package/dist/src/hooks/Swap/useMarginAmount.d.ts +8 -0
- package/dist/src/hooks/Swap/useMarginAmount.test.d.ts +1 -0
- package/dist/src/hooks/Swap/usePriceTimer.d.ts +5 -0
- package/dist/src/hooks/Swap/useSlippageLimit.d.ts +2 -0
- package/dist/src/hooks/Token/index.d.ts +4 -0
- package/dist/src/hooks/Token/type.d.ts +26 -0
- package/dist/src/hooks/Token/useDisabledTokenSwitch.d.ts +5 -0
- package/dist/src/hooks/Token/useFetchTokenAllowance.d.ts +13 -0
- package/dist/src/hooks/Token/useFindTokenByAddress.d.ts +1 -0
- package/dist/src/hooks/Token/useFindTokenByAddress.test.d.ts +1 -0
- package/dist/src/hooks/Token/useGetAllowance.d.ts +3 -0
- package/dist/src/hooks/Token/useGetAllowance.test.d.ts +1 -0
- package/dist/src/hooks/Token/useGetBalance.d.ts +2 -0
- package/dist/src/hooks/Token/useGetBalance.test.d.ts +1 -0
- package/dist/src/hooks/Token/useGetCGTokenList.d.ts +15 -0
- package/dist/src/hooks/Token/useGetTokenStatus.d.ts +13 -0
- package/dist/src/hooks/Token/useGetTokenStatus.test.d.ts +1 -0
- package/dist/src/hooks/Token/useInitTokenList.d.ts +8 -0
- package/dist/src/hooks/Token/useSelectChainList.d.ts +7 -0
- package/dist/src/hooks/Token/useSelectChainList.test.d.ts +1 -0
- package/dist/src/hooks/Token/useTokenList.d.ts +30 -0
- package/dist/src/hooks/Token/useTokenList.test.d.ts +1 -0
- package/dist/src/hooks/Token/useTokenListFetchBalance.d.ts +9 -0
- package/dist/src/hooks/Widget/useInitPropsToRedux.d.ts +2 -0
- package/dist/src/hooks/contract/abis/OrbiterV3ABI.d.ts +85 -0
- package/dist/src/hooks/contract/abis/erc20ABI.d.ts +30 -0
- package/dist/src/hooks/contract/abis/erc20Helper.d.ts +16 -0
- package/dist/src/hooks/contract/abis/multicallABI.d.ts +34 -0
- package/dist/src/hooks/contract/batch.d.ts +18 -0
- package/dist/src/hooks/contract/contractConfig.d.ts +9 -0
- package/dist/src/hooks/contract/index.d.ts +5 -0
- package/dist/src/hooks/contract/orbiter/constants.d.ts +3 -0
- package/dist/src/hooks/contract/orbiter/encodeOrbiterBridge.d.ts +12 -0
- package/dist/src/hooks/contract/orbiter/useOrbiterContractMap.d.ts +5 -0
- package/dist/src/hooks/contract/orbiter/useOrbiterRouters.d.ts +21 -0
- package/dist/src/hooks/contract/provider.d.ts +2 -0
- package/dist/src/hooks/contract/token.d.ts +10 -0
- package/dist/src/hooks/contract/useFetchBlockNumber.d.ts +3 -0
- package/dist/src/hooks/contract/useFetchETHBalance.d.ts +1 -0
- package/dist/src/hooks/contract/useFetchTokens.d.ts +19 -0
- package/dist/src/hooks/contract/useMultiContract.d.ts +14 -0
- package/dist/src/hooks/contract/wallet.d.ts +16 -0
- package/dist/src/hooks/setting/useDefaultSlippage.d.ts +4 -0
- package/dist/src/hooks/setting/useGetAPIService.d.ts +2 -0
- package/dist/src/hooks/setting/useSetAutoSlippage.d.ts +13 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/store/actions/globals.d.ts +9 -0
- package/dist/src/store/actions/index.d.ts +4 -0
- package/dist/src/store/actions/settings.d.ts +6 -0
- package/dist/src/store/actions/token.d.ts +15 -0
- package/dist/src/store/actions/wallet.d.ts +5 -0
- package/dist/src/store/index.d.ts +6 -0
- package/dist/src/store/reducers/globals.d.ts +23 -0
- package/dist/src/store/reducers/index.d.ts +17 -0
- package/dist/src/store/reducers/settings.d.ts +13 -0
- package/dist/src/store/reducers/token.d.ts +31 -0
- package/dist/src/store/reducers/wallet.d.ts +10 -0
- package/dist/src/store/selectors/globals.d.ts +7 -0
- package/dist/src/store/selectors/settings.d.ts +4 -0
- package/dist/src/store/selectors/token.d.ts +19 -0
- package/dist/src/store/selectors/wallet.d.ts +4 -0
- package/dist/src/utils/address.d.ts +15 -0
- package/dist/src/utils/address.test.d.ts +1 -0
- package/dist/src/utils/chains.d.ts +2 -0
- package/dist/src/utils/chains.test.d.ts +1 -0
- package/dist/src/utils/formatter.d.ts +25 -0
- package/dist/src/utils/formatter.test.d.ts +1 -0
- package/dist/src/utils/index.d.ts +5 -0
- package/dist/src/utils/time.d.ts +9 -0
- package/dist/src/utils/time.test.d.ts +1 -0
- package/dist/src/utils/token.d.ts +9 -0
- package/dist/src/utils/token.test.d.ts +1 -0
- package/dist/src/utils/wallet.d.ts +8 -0
- package/dist/src/utils/wallet.test.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TokenList } from './type';
|
|
2
|
+
export declare enum FetchStatus {
|
|
3
|
+
Initial = "Initial",
|
|
4
|
+
Loading = "Loading",
|
|
5
|
+
Failed = "Failed",
|
|
6
|
+
Success = "Success"
|
|
7
|
+
}
|
|
8
|
+
export declare function useGetCGTokenList({ chainId, skip, }: {
|
|
9
|
+
chainId: number;
|
|
10
|
+
skip?: boolean;
|
|
11
|
+
}): {
|
|
12
|
+
cgTokenList: TokenList;
|
|
13
|
+
loading: boolean;
|
|
14
|
+
refetch: () => Promise<void>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { TokenInfo, ApprovalState } from './type';
|
|
3
|
+
export declare const useGetTokenStatus: ({ account, chainId, offset, contractAddress, }: {
|
|
4
|
+
account?: string | undefined;
|
|
5
|
+
chainId: number | undefined;
|
|
6
|
+
offset?: BigNumber | undefined;
|
|
7
|
+
contractAddress?: string | undefined;
|
|
8
|
+
}) => {
|
|
9
|
+
getApprovalState: (token: TokenInfo | null, value: string | number | BigNumber, overrideBalance?: BigNumber) => ApprovalState;
|
|
10
|
+
getPendingRest: (token?: TokenInfo | null) => boolean;
|
|
11
|
+
getMaxBalance: (token: TokenInfo | null) => string;
|
|
12
|
+
submitApprove: (token: TokenInfo | null, isReset?: boolean) => Promise<void>;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TokenList, TokenListType } from './type';
|
|
2
|
+
export interface InitTokenListProps {
|
|
3
|
+
tokenList?: TokenList | TokenListType;
|
|
4
|
+
popularTokenList?: TokenList;
|
|
5
|
+
}
|
|
6
|
+
export default function useInitTokenList({ tokenList, popularTokenList, isTon, }: InitTokenListProps & {
|
|
7
|
+
isTon: boolean;
|
|
8
|
+
}): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ChainListItem } from '../../constants/chainList';
|
|
3
|
+
export declare function useSelectChainList(side?: 'from' | 'to'): {
|
|
4
|
+
chainList: ChainListItem[];
|
|
5
|
+
selectChainId: number | undefined;
|
|
6
|
+
setSelectChainId: import("react").Dispatch<import("react").SetStateAction<number | undefined>>;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TokenInfo, TokenList } from './type';
|
|
3
|
+
import { ChainId } from '../../constants/chains';
|
|
4
|
+
export declare const getFuzzySearchTokenSort: (token: TokenInfo, search: string, { matchAddress, }?: {
|
|
5
|
+
matchAddress?: boolean | undefined;
|
|
6
|
+
}) => number;
|
|
7
|
+
export default function useTokenList({ value, onChange, occupiedAddrs, occupiedChainId, hiddenAddrs, showAddrs, side, chainId: chainIdProps, visible, defaultLoadBalance, }: {
|
|
8
|
+
value?: TokenInfo | null;
|
|
9
|
+
onChange: (token: TokenInfo, isOccupied: boolean) => void;
|
|
10
|
+
/** token pair usage */
|
|
11
|
+
occupiedAddrs?: string[];
|
|
12
|
+
/** token pair usage */
|
|
13
|
+
occupiedChainId?: ChainId;
|
|
14
|
+
/** hide props */
|
|
15
|
+
hiddenAddrs?: string[];
|
|
16
|
+
/** only show props */
|
|
17
|
+
showAddrs?: string[];
|
|
18
|
+
/** token field control */
|
|
19
|
+
side?: 'from' | 'to';
|
|
20
|
+
chainId?: number;
|
|
21
|
+
/** Token Picker visible */
|
|
22
|
+
visible?: boolean;
|
|
23
|
+
defaultLoadBalance?: boolean;
|
|
24
|
+
}): {
|
|
25
|
+
filter: string;
|
|
26
|
+
setFilter: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
27
|
+
showTokenList: TokenList;
|
|
28
|
+
onSelectToken: (token: TokenInfo) => void;
|
|
29
|
+
popularTokenList: TokenInfo[];
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TokenInfo, TokenList } from './type';
|
|
2
|
+
export default function useTokenListFetchBalance({ chainId, value, tokenList, popularTokenList, visible, defaultLoadBalance, }: {
|
|
3
|
+
chainId: number;
|
|
4
|
+
value?: TokenInfo | null;
|
|
5
|
+
tokenList: TokenList;
|
|
6
|
+
popularTokenList?: TokenList;
|
|
7
|
+
visible?: boolean;
|
|
8
|
+
defaultLoadBalance?: boolean;
|
|
9
|
+
}): void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { WidgetProps } from '../../components/Widget/';
|
|
2
|
+
export declare function useInitPropsToRedux({ width, height, feeRate, rebateTo, colorMode, apikey, defaultChainId, defaultToToken, defaultFromToken, jsonRpcUrlMap, swapSlippage, bridgeSlippage, apiServices, crossChain, noPowerBy, tonConnect, }: WidgetProps): void;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
declare const Orbiter_V3_ABI_EVM: ({
|
|
2
|
+
anonymous: boolean;
|
|
3
|
+
inputs: {
|
|
4
|
+
indexed: boolean;
|
|
5
|
+
internalType: string;
|
|
6
|
+
name: string;
|
|
7
|
+
type: string;
|
|
8
|
+
}[];
|
|
9
|
+
name: string;
|
|
10
|
+
type: string;
|
|
11
|
+
outputs?: undefined;
|
|
12
|
+
stateMutability?: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
inputs: {
|
|
15
|
+
internalType: string;
|
|
16
|
+
name: string;
|
|
17
|
+
type: string;
|
|
18
|
+
}[];
|
|
19
|
+
name: string;
|
|
20
|
+
outputs: never[];
|
|
21
|
+
stateMutability: string;
|
|
22
|
+
type: string;
|
|
23
|
+
anonymous?: undefined;
|
|
24
|
+
})[];
|
|
25
|
+
declare const Orbiter_V3_ABI_STARKNET_GOERLI: ({
|
|
26
|
+
members: {
|
|
27
|
+
name: string;
|
|
28
|
+
offset: number;
|
|
29
|
+
type: string;
|
|
30
|
+
}[];
|
|
31
|
+
name: string;
|
|
32
|
+
size: number;
|
|
33
|
+
type: string;
|
|
34
|
+
inputs?: undefined;
|
|
35
|
+
outputs?: undefined;
|
|
36
|
+
} | {
|
|
37
|
+
inputs: {
|
|
38
|
+
name: string;
|
|
39
|
+
type: string;
|
|
40
|
+
}[];
|
|
41
|
+
name: string;
|
|
42
|
+
outputs: never[];
|
|
43
|
+
type: string;
|
|
44
|
+
members?: undefined;
|
|
45
|
+
size?: undefined;
|
|
46
|
+
})[];
|
|
47
|
+
declare const Orbiter_V3_ABI_STARKNET: ({
|
|
48
|
+
members: {
|
|
49
|
+
name: string;
|
|
50
|
+
offset: number;
|
|
51
|
+
type: string;
|
|
52
|
+
}[];
|
|
53
|
+
name: string;
|
|
54
|
+
size: number;
|
|
55
|
+
type: string;
|
|
56
|
+
data?: undefined;
|
|
57
|
+
keys?: undefined;
|
|
58
|
+
inputs?: undefined;
|
|
59
|
+
outputs?: undefined;
|
|
60
|
+
} | {
|
|
61
|
+
data: {
|
|
62
|
+
name: string;
|
|
63
|
+
type: string;
|
|
64
|
+
}[];
|
|
65
|
+
keys: never[];
|
|
66
|
+
name: string;
|
|
67
|
+
type: string;
|
|
68
|
+
members?: undefined;
|
|
69
|
+
size?: undefined;
|
|
70
|
+
inputs?: undefined;
|
|
71
|
+
outputs?: undefined;
|
|
72
|
+
} | {
|
|
73
|
+
inputs: {
|
|
74
|
+
name: string;
|
|
75
|
+
type: string;
|
|
76
|
+
}[];
|
|
77
|
+
name: string;
|
|
78
|
+
outputs: never[];
|
|
79
|
+
type: string;
|
|
80
|
+
members?: undefined;
|
|
81
|
+
size?: undefined;
|
|
82
|
+
data?: undefined;
|
|
83
|
+
keys?: undefined;
|
|
84
|
+
})[];
|
|
85
|
+
export { Orbiter_V3_ABI_EVM, Orbiter_V3_ABI_STARKNET, Orbiter_V3_ABI_STARKNET_GOERLI, };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
declare const _default: ({
|
|
2
|
+
constant: boolean;
|
|
3
|
+
inputs: {
|
|
4
|
+
name: string;
|
|
5
|
+
type: string;
|
|
6
|
+
}[];
|
|
7
|
+
name: string;
|
|
8
|
+
outputs: {
|
|
9
|
+
name: string;
|
|
10
|
+
type: string;
|
|
11
|
+
}[];
|
|
12
|
+
payable: boolean;
|
|
13
|
+
stateMutability: "nonpayable";
|
|
14
|
+
type: "function";
|
|
15
|
+
} | {
|
|
16
|
+
constant: boolean;
|
|
17
|
+
inputs: {
|
|
18
|
+
name: string;
|
|
19
|
+
type: string;
|
|
20
|
+
}[];
|
|
21
|
+
name: string;
|
|
22
|
+
outputs: {
|
|
23
|
+
name: string;
|
|
24
|
+
type: string;
|
|
25
|
+
}[];
|
|
26
|
+
payable: boolean;
|
|
27
|
+
stateMutability: "view";
|
|
28
|
+
type: "function";
|
|
29
|
+
})[];
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
inputs: {
|
|
3
|
+
internalType: string;
|
|
4
|
+
name: string;
|
|
5
|
+
type: string;
|
|
6
|
+
}[];
|
|
7
|
+
name: string;
|
|
8
|
+
outputs: {
|
|
9
|
+
internalType: string;
|
|
10
|
+
name: string;
|
|
11
|
+
type: string;
|
|
12
|
+
}[];
|
|
13
|
+
stateMutability: string;
|
|
14
|
+
type: string;
|
|
15
|
+
}[];
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
declare const _default: ({
|
|
2
|
+
constant: boolean;
|
|
3
|
+
inputs: {
|
|
4
|
+
components: {
|
|
5
|
+
name: string;
|
|
6
|
+
type: string;
|
|
7
|
+
}[];
|
|
8
|
+
name: string;
|
|
9
|
+
type: string;
|
|
10
|
+
}[];
|
|
11
|
+
name: string;
|
|
12
|
+
outputs: {
|
|
13
|
+
name: string;
|
|
14
|
+
type: string;
|
|
15
|
+
}[];
|
|
16
|
+
payable: boolean;
|
|
17
|
+
stateMutability: string;
|
|
18
|
+
type: string;
|
|
19
|
+
} | {
|
|
20
|
+
constant: boolean;
|
|
21
|
+
inputs: {
|
|
22
|
+
name: string;
|
|
23
|
+
type: string;
|
|
24
|
+
}[];
|
|
25
|
+
name: string;
|
|
26
|
+
outputs: {
|
|
27
|
+
name: string;
|
|
28
|
+
type: string;
|
|
29
|
+
}[];
|
|
30
|
+
payable: boolean;
|
|
31
|
+
stateMutability: string;
|
|
32
|
+
type: string;
|
|
33
|
+
})[];
|
|
34
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Contract } from '@ethersproject/contracts';
|
|
2
|
+
interface Web3CallData {
|
|
3
|
+
to: string;
|
|
4
|
+
data: string;
|
|
5
|
+
}
|
|
6
|
+
interface RequestThunk<T> {
|
|
7
|
+
callData: Web3CallData | null;
|
|
8
|
+
processor: (_: any, index: number) => T;
|
|
9
|
+
}
|
|
10
|
+
export declare type BatchThunk<T> = RequestThunk<T>[];
|
|
11
|
+
declare type BatchThunkAll<Ts extends any[]> = {
|
|
12
|
+
[Tidx in keyof Ts]: Ts[Tidx] extends Ts[number] ? BatchThunk<Ts[Tidx]> : never;
|
|
13
|
+
};
|
|
14
|
+
declare type BatchThunkAllResult<Ts extends any[]> = {
|
|
15
|
+
[Tidx in keyof Ts]: Ts[Tidx] extends Ts[number] ? Array<Ts[Tidx]> : never;
|
|
16
|
+
};
|
|
17
|
+
export declare function runAll<Ts extends any[]>(contract: Contract, contractAddress: string, ...batches: BatchThunkAll<Ts>): Promise<BatchThunkAllResult<Ts>>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as useMultiContract, getContract } from './useMultiContract';
|
|
2
|
+
export { default as useFetchTokens } from './useFetchTokens';
|
|
3
|
+
export { default as useFetchETHBalance } from './useFetchETHBalance';
|
|
4
|
+
export { default as useFetchBlockNumber } from './useFetchBlockNumber';
|
|
5
|
+
export * from './token';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { BridgeRouteI } from '../../Bridge';
|
|
3
|
+
import { TokenInfo } from '../../Token';
|
|
4
|
+
import { useOrbiterRouters } from './useOrbiterRouters';
|
|
5
|
+
export declare function encodeOrbiterBridge({ route, fromAddress, toAddress, fromAmount, fromToken, contractAddress, }: {
|
|
6
|
+
route: Exclude<ReturnType<typeof useOrbiterRouters>['data'], undefined>[0];
|
|
7
|
+
fromAddress: string;
|
|
8
|
+
toAddress: string;
|
|
9
|
+
fromAmount: BigNumber;
|
|
10
|
+
fromToken: TokenInfo;
|
|
11
|
+
contractAddress: string;
|
|
12
|
+
}): Exclude<BridgeRouteI['encodeResultData'], undefined>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ChainId } from '../../../constants/chains';
|
|
2
|
+
interface OrbiterRoute {
|
|
3
|
+
key: string;
|
|
4
|
+
id: string;
|
|
5
|
+
fromChainId: ChainId;
|
|
6
|
+
toChainId: ChainId;
|
|
7
|
+
fromTokenAddress: string;
|
|
8
|
+
toTokenAddress: string;
|
|
9
|
+
product: string;
|
|
10
|
+
endpoint: string;
|
|
11
|
+
minAmt: string;
|
|
12
|
+
maxAmt: string;
|
|
13
|
+
withholdingFee: string;
|
|
14
|
+
tradeFee: string;
|
|
15
|
+
spentTime: string;
|
|
16
|
+
vc: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function useOrbiterRouters({ skip }?: {
|
|
19
|
+
skip?: boolean;
|
|
20
|
+
}): import("@tanstack/react-query/build/legacy/types").UseQueryResult<OrbiterRoute[], Error>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JsonRpcProvider } from '@ethersproject/providers';
|
|
2
|
+
import BigNumber from 'bignumber.js';
|
|
3
|
+
export declare function fetchTokenAllowance({ account, tokenAddress, tokenDecimals, chainId, approveAddress, provider, }: {
|
|
4
|
+
account?: string;
|
|
5
|
+
tokenAddress: string;
|
|
6
|
+
tokenDecimals: number;
|
|
7
|
+
chainId: number;
|
|
8
|
+
approveAddress?: string;
|
|
9
|
+
provider: JsonRpcProvider;
|
|
10
|
+
}): Promise<BigNumber | undefined>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useFetchETHBalance(chainId?: number): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { TokenList } from '../Token';
|
|
3
|
+
declare type TokenResult = {
|
|
4
|
+
address: string;
|
|
5
|
+
balance: BigNumber;
|
|
6
|
+
allowance: BigNumber;
|
|
7
|
+
decimals?: number;
|
|
8
|
+
symbol?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
};
|
|
11
|
+
export default function useFetchTokens({ tokenList, blockNumber, chainId, skip, }: {
|
|
12
|
+
tokenList?: TokenList;
|
|
13
|
+
blockNumber?: number;
|
|
14
|
+
chainId?: number;
|
|
15
|
+
skip?: boolean;
|
|
16
|
+
}): {
|
|
17
|
+
data: TokenResult[] | undefined;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Contract } from '@ethersproject/contracts';
|
|
2
|
+
import { JsonRpcProvider } from '@ethersproject/providers';
|
|
3
|
+
import { BatchThunk } from './batch';
|
|
4
|
+
export declare function getContract(address: string, ABI: any, provider: JsonRpcProvider, account?: string): Contract;
|
|
5
|
+
export default function useMultiContract(chainIdProps?: number): {
|
|
6
|
+
getContract: (contractAddress: string, ABI: any) => Contract | undefined;
|
|
7
|
+
contractConfig: {
|
|
8
|
+
MULTI_CALL: string;
|
|
9
|
+
DODO_APPROVE: string;
|
|
10
|
+
ERC20_HELPER: string;
|
|
11
|
+
};
|
|
12
|
+
call: <T>(thunk: BatchThunk<T>) => Promise<unknown[] | undefined> | undefined;
|
|
13
|
+
loading: boolean;
|
|
14
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { JsonRpcProvider } from '@ethersproject/providers';
|
|
2
|
+
import type { TransactionRequest } from '@ethersproject/abstract-provider';
|
|
3
|
+
import { BigNumber as EthersBigNumber } from '@ethersproject/bignumber';
|
|
4
|
+
import BigNumber from 'bignumber.js';
|
|
5
|
+
export declare type Deferrable<T> = {
|
|
6
|
+
[K in keyof T]: T[K] | Promise<T[K]>;
|
|
7
|
+
};
|
|
8
|
+
export declare enum WatchResult {
|
|
9
|
+
Failed = 0,
|
|
10
|
+
Success = 1,
|
|
11
|
+
Warning = 2
|
|
12
|
+
}
|
|
13
|
+
export declare const getEstimateGas: (params: any, provider: JsonRpcProvider) => Promise<EthersBigNumber | null>;
|
|
14
|
+
export declare const getGasPrice: (provider: JsonRpcProvider) => Promise<EthersBigNumber | null>;
|
|
15
|
+
export declare const sendTransaction: (params: Deferrable<TransactionRequest>, provider: JsonRpcProvider) => Promise<import("@ethersproject/abstract-provider").TransactionResponse>;
|
|
16
|
+
export declare const approve: (tokenAddress: string, accountAddress: string, contractAddress: string, allowance: BigNumber, provider: JsonRpcProvider, account?: string) => Promise<import("@ethersproject/abstract-provider").TransactionResponse>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TokenInfo } from '../Token';
|
|
2
|
+
export declare type GetAutoSlippage = (options: {
|
|
3
|
+
fromToken: TokenInfo | null;
|
|
4
|
+
toToken: TokenInfo | null;
|
|
5
|
+
}) => Promise<number | undefined> | number | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Sets the slippage based on the incoming getAutoSlippage method. If there is an interface error or no data is returned, the default data with a lower priority will be used.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useSetAutoSlippage({ fromToken, toToken, getAutoSlippage, }: {
|
|
10
|
+
fromToken: TokenInfo | null;
|
|
11
|
+
toToken: TokenInfo | null;
|
|
12
|
+
getAutoSlippage?: GetAutoSlippage;
|
|
13
|
+
}): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WidgetProps } from './components/Widget';
|
|
3
|
+
export declare type SwapWidgetProps = WidgetProps;
|
|
4
|
+
export type { TokenInfo } from './hooks/Token/type';
|
|
5
|
+
export declare function SwapWidget(props: SwapWidgetProps): JSX.Element;
|
|
6
|
+
export declare function InitSwapWidget(props: SwapWidgetProps): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AppThunkAction } from '.';
|
|
2
|
+
import { State } from '../reducers/globals';
|
|
3
|
+
export declare const setGlobalProps: (globalProps: Partial<State>) => AppThunkAction;
|
|
4
|
+
export declare const setAutoConnectLoading: (loading: boolean) => AppThunkAction;
|
|
5
|
+
export declare const setAutoSlippage: (autoSlippage: {
|
|
6
|
+
loading: boolean;
|
|
7
|
+
value: number | null;
|
|
8
|
+
}) => AppThunkAction;
|
|
9
|
+
export declare const setAutoSlippageLoading: (loading: boolean) => AppThunkAction;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Action, ThunkAction, ThunkDispatch } from '@reduxjs/toolkit';
|
|
2
|
+
import { RootState } from '../reducers';
|
|
3
|
+
export declare type AppThunkAction<Ret = void> = ThunkAction<Ret, RootState, unknown, Action<string>>;
|
|
4
|
+
export declare type AppThunkDispatch = ThunkDispatch<RootState, unknown, Action<string>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AppThunkAction } from '.';
|
|
2
|
+
import { Slippage, TxDdl } from '../reducers/settings';
|
|
3
|
+
import { ColorMode } from '../reducers/settings';
|
|
4
|
+
export declare const setColorMode: (colorMode: ColorMode) => AppThunkAction;
|
|
5
|
+
export declare const setSlippage: (slippage: Slippage) => AppThunkAction;
|
|
6
|
+
export declare const setTxDdl: (ddl: TxDdl) => AppThunkAction;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { AppThunkAction } from '.';
|
|
3
|
+
import { TokenList, TokenInfo } from '../../hooks/Token';
|
|
4
|
+
import { AccountBalances, SlippageWithToken } from '../reducers/token';
|
|
5
|
+
export declare const setTokenList: (tokenList: TokenList) => AppThunkAction;
|
|
6
|
+
export declare const setPopularTokenList: (popularTokenList: TokenList) => AppThunkAction;
|
|
7
|
+
export declare const setSlippageWithTokens: (slippageWithTokens: SlippageWithToken[]) => AppThunkAction;
|
|
8
|
+
export declare const setDefaultFromToken: (token: TokenInfo) => AppThunkAction;
|
|
9
|
+
export declare const setDefaultToToken: (token: TokenInfo) => AppThunkAction;
|
|
10
|
+
export declare const setEthBalance: (chainId: number, balance: BigNumber) => AppThunkAction;
|
|
11
|
+
export declare const setTokenBalances: (accountBalances: AccountBalances) => AppThunkAction;
|
|
12
|
+
export declare const setTokenAllowances: (allowance: BigNumber) => AppThunkAction;
|
|
13
|
+
export declare const setBalanceLoadings: (balanceLoadings: {
|
|
14
|
+
[x: string]: boolean;
|
|
15
|
+
}) => AppThunkAction;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AppThunkAction } from '.';
|
|
2
|
+
import { ChainId } from '../../constants/chains';
|
|
3
|
+
export declare const setDefaultChainId: (chainId: ChainId) => AppThunkAction;
|
|
4
|
+
export declare const setFromTokenChainId: (chainId: ChainId | undefined) => AppThunkAction;
|
|
5
|
+
export declare const setBlockNumber: (blockNumber: number) => AppThunkAction;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const store: import("@reduxjs/toolkit").EnhancedStore<import("redux").CombinedState<{
|
|
2
|
+
settings: import("./reducers/settings").State;
|
|
3
|
+
wallet: import("./reducers/wallet").State;
|
|
4
|
+
token: import("./reducers/token").State;
|
|
5
|
+
globals: import("./reducers/globals").State;
|
|
6
|
+
}>, import("redux").AnyAction, any>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AnyAction } from 'redux';
|
|
2
|
+
import { SwapWidgetProps } from '../..';
|
|
3
|
+
export declare enum ContractStatus {
|
|
4
|
+
Initial = "Initial",
|
|
5
|
+
Pending = "Pending",
|
|
6
|
+
ApproveSuccess = "ApproveSuccess",
|
|
7
|
+
TxSuccess = "TxSuccess",
|
|
8
|
+
Failed = "Failed"
|
|
9
|
+
}
|
|
10
|
+
export interface State extends SwapWidgetProps {
|
|
11
|
+
isReverseRouting?: boolean;
|
|
12
|
+
contractStatus?: ContractStatus;
|
|
13
|
+
autoConnectLoading?: boolean;
|
|
14
|
+
showCoingecko?: boolean;
|
|
15
|
+
/** source: props.getAutoSlippage */
|
|
16
|
+
autoSlippage?: {
|
|
17
|
+
loading: boolean;
|
|
18
|
+
value: number | null;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export declare const initialState: State;
|
|
22
|
+
declare const _default: (state: State | undefined, action: AnyAction) => State;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { State as settingsState } from './settings';
|
|
2
|
+
import { State as walletState } from './wallet';
|
|
3
|
+
import { State as tokenState } from './token';
|
|
4
|
+
import { State as globalState } from './globals';
|
|
5
|
+
export interface RootState {
|
|
6
|
+
settings: settingsState;
|
|
7
|
+
wallet: walletState;
|
|
8
|
+
token: tokenState;
|
|
9
|
+
globals: globalState;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: () => import("redux").Reducer<import("redux").CombinedState<{
|
|
12
|
+
settings: settingsState;
|
|
13
|
+
wallet: walletState;
|
|
14
|
+
token: tokenState;
|
|
15
|
+
globals: globalState;
|
|
16
|
+
}>, import("redux").AnyAction>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AnyAction } from 'redux';
|
|
2
|
+
import { PaletteMode } from '@dodoex/components';
|
|
3
|
+
export declare type ColorMode = PaletteMode | 'system';
|
|
4
|
+
export declare type Slippage = string | null;
|
|
5
|
+
export declare type TxDdl = number | '';
|
|
6
|
+
export declare type State = {
|
|
7
|
+
colorMode: ColorMode;
|
|
8
|
+
slippage: Slippage;
|
|
9
|
+
ddl: TxDdl;
|
|
10
|
+
};
|
|
11
|
+
export declare const initialState: State;
|
|
12
|
+
declare const _default: (state: State | undefined, action: AnyAction) => State;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { AnyAction } from 'redux';
|
|
3
|
+
import type { TokenList, DefaultTokenInfo } from '../../hooks/Token';
|
|
4
|
+
export declare type AccountBalance = {
|
|
5
|
+
tokenBalances?: BigNumber;
|
|
6
|
+
tokenAllowances?: BigNumber;
|
|
7
|
+
};
|
|
8
|
+
export declare type AccountBalances = {
|
|
9
|
+
[key in string]: AccountBalance;
|
|
10
|
+
};
|
|
11
|
+
export declare type SlippageWithToken = {
|
|
12
|
+
slippage: string;
|
|
13
|
+
tokens: string[];
|
|
14
|
+
};
|
|
15
|
+
export declare type State = {
|
|
16
|
+
tokenList: TokenList;
|
|
17
|
+
popularTokenList: TokenList;
|
|
18
|
+
ethBalance: {
|
|
19
|
+
[key: number]: BigNumber;
|
|
20
|
+
};
|
|
21
|
+
accountBalances: AccountBalances;
|
|
22
|
+
balanceLoadings: {
|
|
23
|
+
[key in string]: boolean;
|
|
24
|
+
};
|
|
25
|
+
slippageWithTokens: SlippageWithToken[];
|
|
26
|
+
defaultFromToken?: DefaultTokenInfo;
|
|
27
|
+
defaultToToken?: DefaultTokenInfo;
|
|
28
|
+
};
|
|
29
|
+
export declare const initialState: State;
|
|
30
|
+
declare const _default: (state: State | undefined, action: AnyAction) => State;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AnyAction } from 'redux';
|
|
2
|
+
import { ChainId } from '../../constants/chains';
|
|
3
|
+
export declare type State = {
|
|
4
|
+
chainId: ChainId;
|
|
5
|
+
fromTokenChainId?: ChainId;
|
|
6
|
+
latestBlockNumber: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const initialState: State;
|
|
9
|
+
declare const _default: (state: State | undefined, action: AnyAction) => State;
|
|
10
|
+
export default _default;
|