@multiversx/sdk-dapp-liquidity 0.2.0-alpha.1
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/README.md +186 -0
- package/all-networks-EJIVYZ_i.mjs +4 -0
- package/all-networks-NYACMyeN.js +4 -0
- package/api/confirmRate.d.ts +11 -0
- package/api/confirmRate.js +30 -0
- package/api/confirmRate.mjs +29 -0
- package/api/getChains.d.ts +6 -0
- package/api/getChains.js +12 -0
- package/api/getChains.mjs +11 -0
- package/api/getRate.d.ts +10 -0
- package/api/getRate.js +28 -0
- package/api/getRate.mjs +27 -0
- package/api/getTokens.d.ts +7 -0
- package/api/getTokens.js +14 -0
- package/api/getTokens.mjs +13 -0
- package/api/getTokensBalances.d.ts +8 -0
- package/api/getTokensBalances.js +17 -0
- package/api/getTokensBalances.mjs +16 -0
- package/api/getTransactions.d.ts +7 -0
- package/api/getTransactions.js +14 -0
- package/api/getTransactions.mjs +13 -0
- package/api/index.d.ts +7 -0
- package/api/index.js +17 -0
- package/api/index.mjs +16 -0
- package/api/sendTransactions.d.ts +11 -0
- package/api/sendTransactions.js +29 -0
- package/api/sendTransactions.mjs +28 -0
- package/api/tests/confirmRate.spec.d.ts +1 -0
- package/api/tests/confirmRate.spec.js +124 -0
- package/api/tests/confirmRate.spec.mjs +122 -0
- package/api/tests/getChains.spec.d.ts +1 -0
- package/api/tests/getChains.spec.js +37 -0
- package/api/tests/getChains.spec.mjs +35 -0
- package/api/tests/getRate.spec.d.ts +1 -0
- package/api/tests/getRate.spec.js +83 -0
- package/api/tests/getRate.spec.mjs +81 -0
- package/api/tests/getTokens.spec.d.ts +1 -0
- package/api/tests/getTokens.spec.js +60 -0
- package/api/tests/getTokens.spec.mjs +58 -0
- package/api/tests/getTransactions.spec.d.ts +1 -0
- package/api/tests/getTransactions.spec.js +89 -0
- package/api/tests/getTransactions.spec.mjs +87 -0
- package/api/tests/sendTransactions.spec.d.ts +1 -0
- package/api/tests/sendTransactions.spec.js +83 -0
- package/api/tests/sendTransactions.spec.mjs +81 -0
- package/bignumber-B8vjg9qn.js +1334 -0
- package/bignumber-CKZkoo0g.mjs +1334 -0
- package/constants/index.d.ts +1 -0
- package/constants/index.js +5 -0
- package/constants/index.mjs +4 -0
- package/default-BYtXv70Z.mjs +4 -0
- package/default-H3AbmzFV.js +4 -0
- package/dto/Chain.dto.d.ts +16 -0
- package/dto/Chain.dto.js +2 -0
- package/dto/Chain.dto.mjs +1 -0
- package/dto/ConfirmRate.dto.d.ts +11 -0
- package/dto/ConfirmRate.dto.js +2 -0
- package/dto/ConfirmRate.dto.mjs +1 -0
- package/dto/Token.dto.d.ts +14 -0
- package/dto/Token.dto.js +2 -0
- package/dto/Token.dto.mjs +1 -0
- package/dto/TokenBalance.dto.d.ts +4 -0
- package/dto/TokenBalance.dto.js +2 -0
- package/dto/TokenBalance.dto.mjs +1 -0
- package/dto/Transaction.dto.d.ts +14 -0
- package/dto/Transaction.dto.js +2 -0
- package/dto/Transaction.dto.mjs +1 -0
- package/dto/index.d.ts +5 -0
- package/dto/index.js +2 -0
- package/dto/index.mjs +1 -0
- package/helpers/base64Utils.d.ts +3 -0
- package/helpers/base64Utils.js +32 -0
- package/helpers/base64Utils.mjs +31 -0
- package/helpers/decodeLoginToken.d.ts +9 -0
- package/helpers/decodeLoginToken.js +28 -0
- package/helpers/decodeLoginToken.mjs +27 -0
- package/helpers/decodeToken.d.ts +11 -0
- package/helpers/decodeToken.js +40 -0
- package/helpers/decodeToken.mjs +39 -0
- package/helpers/getApiURL.d.ts +1 -0
- package/helpers/getApiURL.js +8 -0
- package/helpers/getApiURL.mjs +7 -0
- package/helpers/getBridgeURL.d.ts +1 -0
- package/helpers/getBridgeURL.js +8 -0
- package/helpers/getBridgeURL.mjs +7 -0
- package/helpers/getMvxApiURL.d.ts +1 -0
- package/helpers/getMvxApiURL.js +8 -0
- package/helpers/getMvxApiURL.mjs +7 -0
- package/helpers/getMvxChainId.d.ts +1 -0
- package/helpers/getMvxChainId.js +8 -0
- package/helpers/getMvxChainId.mjs +7 -0
- package/helpers/getMvxExplorerAddress.d.ts +1 -0
- package/helpers/getMvxExplorerAddress.js +8 -0
- package/helpers/getMvxExplorerAddress.mjs +7 -0
- package/helpers/index.d.ts +9 -0
- package/helpers/index.js +23 -0
- package/helpers/index.mjs +22 -0
- package/helpers/serializeTransaction.d.ts +3 -0
- package/helpers/serializeTransaction.js +9 -0
- package/helpers/serializeTransaction.mjs +8 -0
- package/helpers/tests/base64Utils.spec.d.ts +1 -0
- package/helpers/tests/base64Utils.spec.js +30 -0
- package/helpers/tests/base64Utils.spec.mjs +28 -0
- package/helpers/tests/decodeLoginToken.spec.d.ts +1 -0
- package/helpers/tests/decodeLoginToken.spec.js +35 -0
- package/helpers/tests/decodeLoginToken.spec.mjs +33 -0
- package/helpers/tests/decodeToken.spec.d.ts +1 -0
- package/helpers/tests/decodeToken.spec.js +28 -0
- package/helpers/tests/decodeToken.spec.mjs +26 -0
- package/index-B9WqxUXM.mjs +91 -0
- package/index-BXwpbIDQ.mjs +107 -0
- package/index-CnudU77V.js +329 -0
- package/index-DSnomXRI.mjs +68025 -0
- package/index-DZHiA1sX.js +107 -0
- package/index-cvy2-uZ_.js +67946 -0
- package/index.d.ts +6 -0
- package/index.js +189 -0
- package/index.mjs +185 -0
- package/package.json +107 -0
- package/react-B9sQBOh0.mjs +3040 -0
- package/react-BaXyw3AO.js +3040 -0
- package/react-CNXJSTCv.js +38 -0
- package/react-CSQpf1zk.mjs +38 -0
- package/reactjs/components/AccountAddress/AccountAddress.d.ts +6 -0
- package/reactjs/components/AccountAddress/AccountAddress.js +25 -0
- package/reactjs/components/AccountAddress/AccountAddress.mjs +24 -0
- package/reactjs/components/AccountAddress/index.d.ts +1 -0
- package/reactjs/components/AccountAddress/index.js +5 -0
- package/reactjs/components/AccountAddress/index.mjs +4 -0
- package/reactjs/components/AmountCard/AmountCard.d.ts +6 -0
- package/reactjs/components/AmountCard/AmountCard.js +33 -0
- package/reactjs/components/AmountCard/AmountCard.mjs +32 -0
- package/reactjs/components/AmountCard/index.d.ts +1 -0
- package/reactjs/components/AmountCard/index.js +5 -0
- package/reactjs/components/AmountCard/index.mjs +4 -0
- package/reactjs/components/AmountInput/AmountInput.d.ts +13 -0
- package/reactjs/components/AmountInput/AmountInput.js +61 -0
- package/reactjs/components/AmountInput/AmountInput.mjs +60 -0
- package/reactjs/components/AmountInput/index.d.ts +1 -0
- package/reactjs/components/AmountInput/index.js +5 -0
- package/reactjs/components/AmountInput/index.mjs +4 -0
- package/reactjs/components/BridgeForm/BridgeForm.d.ts +16 -0
- package/reactjs/components/BridgeForm/BridgeForm.js +680 -0
- package/reactjs/components/BridgeForm/BridgeForm.mjs +679 -0
- package/reactjs/components/BridgeForm/index.d.ts +1 -0
- package/reactjs/components/BridgeForm/index.js +5 -0
- package/reactjs/components/BridgeForm/index.mjs +4 -0
- package/reactjs/components/BridgeHistory/BridgeHistory.d.ts +4 -0
- package/reactjs/components/BridgeHistory/BridgeHistory.js +233 -0
- package/reactjs/components/BridgeHistory/BridgeHistory.mjs +232 -0
- package/reactjs/components/BridgeHistory/index.d.ts +1 -0
- package/reactjs/components/BridgeHistory/index.js +5 -0
- package/reactjs/components/BridgeHistory/index.mjs +4 -0
- package/reactjs/components/Connect/BridgeAccountDisplay.d.ts +6 -0
- package/reactjs/components/Connect/BridgeAccountDisplay.js +85 -0
- package/reactjs/components/Connect/BridgeAccountDisplay.mjs +84 -0
- package/reactjs/components/Connect/BridgeConnectButton.d.ts +7 -0
- package/reactjs/components/Connect/BridgeConnectButton.js +26 -0
- package/reactjs/components/Connect/BridgeConnectButton.mjs +25 -0
- package/reactjs/components/Connect/CustomConnectButton.d.ts +7 -0
- package/reactjs/components/Connect/CustomConnectButton.js +42 -0
- package/reactjs/components/Connect/CustomConnectButton.mjs +41 -0
- package/reactjs/components/Connect/MvxAccountDisplay.d.ts +9 -0
- package/reactjs/components/Connect/MvxAccountDisplay.js +75 -0
- package/reactjs/components/Connect/MvxAccountDisplay.mjs +74 -0
- package/reactjs/components/Connect/MvxConnectButton.d.ts +11 -0
- package/reactjs/components/Connect/MvxConnectButton.js +43 -0
- package/reactjs/components/Connect/MvxConnectButton.mjs +42 -0
- package/reactjs/components/Connect/SwitchChainButton.d.ts +7 -0
- package/reactjs/components/Connect/SwitchChainButton.js +33 -0
- package/reactjs/components/Connect/SwitchChainButton.mjs +32 -0
- package/reactjs/components/Connect/index.d.ts +6 -0
- package/reactjs/components/Connect/index.js +15 -0
- package/reactjs/components/Connect/index.mjs +14 -0
- package/reactjs/components/CopyButton/CopyButton.d.ts +6 -0
- package/reactjs/components/CopyButton/CopyButton.js +42 -0
- package/reactjs/components/CopyButton/CopyButton.mjs +41 -0
- package/reactjs/components/CopyButton/index.d.ts +1 -0
- package/reactjs/components/CopyButton/index.js +5 -0
- package/reactjs/components/CopyButton/index.mjs +4 -0
- package/reactjs/components/CopyButton/utils/copyToClipboard.d.ts +1 -0
- package/reactjs/components/CopyButton/utils/copyToClipboard.js +38 -0
- package/reactjs/components/CopyButton/utils/copyToClipboard.mjs +37 -0
- package/reactjs/components/CopyButton/utils/index.d.ts +1 -0
- package/reactjs/components/CopyButton/utils/index.js +5 -0
- package/reactjs/components/CopyButton/utils/index.mjs +4 -0
- package/reactjs/components/DisplayAmount/DisplayAmount.d.ts +21 -0
- package/reactjs/components/DisplayAmount/DisplayAmount.js +91 -0
- package/reactjs/components/DisplayAmount/DisplayAmount.mjs +90 -0
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.d.ts +7 -0
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.js +40 -0
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.mjs +39 -0
- package/reactjs/components/DisplayAmount/components/AnimateNumber/index.d.ts +0 -0
- package/reactjs/components/DisplayAmount/components/AnimateNumber/index.js +2 -0
- package/reactjs/components/DisplayAmount/components/AnimateNumber/index.mjs +1 -0
- package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.d.ts +14 -0
- package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.js +62 -0
- package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.mjs +61 -0
- package/reactjs/components/DisplayAmount/components/index.d.ts +0 -0
- package/reactjs/components/DisplayAmount/components/index.js +2 -0
- package/reactjs/components/DisplayAmount/components/index.mjs +1 -0
- package/reactjs/components/DisplayAmount/index.d.ts +1 -0
- package/reactjs/components/DisplayAmount/index.js +5 -0
- package/reactjs/components/DisplayAmount/index.mjs +4 -0
- package/reactjs/components/DisplayAmount/utils/index.d.ts +1 -0
- package/reactjs/components/DisplayAmount/utils/index.js +5 -0
- package/reactjs/components/DisplayAmount/utils/index.mjs +4 -0
- package/reactjs/components/DisplayAmount/utils/truncateAmount.d.ts +1 -0
- package/reactjs/components/DisplayAmount/utils/truncateAmount.js +22 -0
- package/reactjs/components/DisplayAmount/utils/truncateAmount.mjs +21 -0
- package/reactjs/components/SmallLoader/SmallLoader.d.ts +4 -0
- package/reactjs/components/SmallLoader/SmallLoader.js +22 -0
- package/reactjs/components/SmallLoader/SmallLoader.mjs +21 -0
- package/reactjs/components/SmallLoader/index.d.ts +1 -0
- package/reactjs/components/SmallLoader/index.js +5 -0
- package/reactjs/components/SmallLoader/index.mjs +4 -0
- package/reactjs/components/TokenSelector/TokenSelector.d.ts +16 -0
- package/reactjs/components/TokenSelector/TokenSelector.js +158 -0
- package/reactjs/components/TokenSelector/TokenSelector.mjs +157 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.d.ts +8 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.js +86 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.mjs +85 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.d.ts +11 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.js +45 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.mjs +44 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.d.ts +6 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.js +19 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.mjs +18 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.d.ts +3 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.js +7 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.mjs +6 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.d.ts +4 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.js +33 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.mjs +32 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/types/chainSelectOption.d.ts +10 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/types/chainSelectOption.js +2 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/types/chainSelectOption.mjs +1 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/types/partialChainOption.d.ts +10 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/types/partialChainOption.js +2 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/types/partialChainOption.mjs +1 -0
- package/reactjs/components/TokenSelector/components/SelectContainer.d.ts +7 -0
- package/reactjs/components/TokenSelector/components/SelectContainer.js +41 -0
- package/reactjs/components/TokenSelector/components/SelectContainer.mjs +40 -0
- package/reactjs/components/TokenSelector/components/SelectContent.d.ts +10 -0
- package/reactjs/components/TokenSelector/components/SelectContent.js +93 -0
- package/reactjs/components/TokenSelector/components/SelectContent.mjs +92 -0
- package/reactjs/components/TokenSelector/components/SelectedOption.d.ts +5 -0
- package/reactjs/components/TokenSelector/components/SelectedOption.js +29 -0
- package/reactjs/components/TokenSelector/components/SelectedOption.mjs +28 -0
- package/reactjs/components/TokenSelector/components/TokenIcon.d.ts +8 -0
- package/reactjs/components/TokenSelector/components/TokenIcon.js +82 -0
- package/reactjs/components/TokenSelector/components/TokenIcon.mjs +81 -0
- package/reactjs/components/TokenSelector/components/TokenItem.d.ts +7 -0
- package/reactjs/components/TokenSelector/components/TokenItem.js +69 -0
- package/reactjs/components/TokenSelector/components/TokenItem.mjs +68 -0
- package/reactjs/components/TokenSelector/components/TokenList.d.ts +7 -0
- package/reactjs/components/TokenSelector/components/TokenList.js +21 -0
- package/reactjs/components/TokenSelector/components/TokenList.mjs +20 -0
- package/reactjs/components/TokenSelector/components/TokenSymbol.d.ts +9 -0
- package/reactjs/components/TokenSelector/components/TokenSymbol.js +26 -0
- package/reactjs/components/TokenSelector/components/TokenSymbol.mjs +25 -0
- package/reactjs/components/TokenSelector/index.d.ts +1 -0
- package/reactjs/components/TokenSelector/index.js +5 -0
- package/reactjs/components/TokenSelector/index.mjs +4 -0
- package/reactjs/components/TransactionToast/TransactionToast.d.ts +9 -0
- package/reactjs/components/TransactionToast/TransactionToast.js +54 -0
- package/reactjs/components/TransactionToast/TransactionToast.mjs +53 -0
- package/reactjs/components/TransactionToast/TransactionToastContainer.d.ts +3 -0
- package/reactjs/components/TransactionToast/TransactionToastContainer.js +21 -0
- package/reactjs/components/TransactionToast/TransactionToastContainer.mjs +20 -0
- package/reactjs/components/TransactionToast/index.d.ts +2 -0
- package/reactjs/components/TransactionToast/index.js +7 -0
- package/reactjs/components/TransactionToast/index.mjs +6 -0
- package/reactjs/components/TrimAddress/TrimAddress.d.ts +8 -0
- package/reactjs/components/TrimAddress/TrimAddress.js +26 -0
- package/reactjs/components/TrimAddress/TrimAddress.mjs +25 -0
- package/reactjs/components/TrimAddress/index.d.ts +1 -0
- package/reactjs/components/TrimAddress/index.js +5 -0
- package/reactjs/components/TrimAddress/index.mjs +4 -0
- package/reactjs/components/base/MxButton/MxButton.d.ts +13 -0
- package/reactjs/components/base/MxButton/MxButton.js +72 -0
- package/reactjs/components/base/MxButton/MxButton.mjs +71 -0
- package/reactjs/components/base/MxButton/index.d.ts +1 -0
- package/reactjs/components/base/MxButton/index.js +5 -0
- package/reactjs/components/base/MxButton/index.mjs +4 -0
- package/reactjs/components/base/MxCard/MxCard.d.ts +10 -0
- package/reactjs/components/base/MxCard/MxCard.js +55 -0
- package/reactjs/components/base/MxCard/MxCard.mjs +54 -0
- package/reactjs/components/base/MxCard/index.d.ts +1 -0
- package/reactjs/components/base/MxCard/index.js +5 -0
- package/reactjs/components/base/MxCard/index.mjs +4 -0
- package/reactjs/components/base/MxLink/MxLink.d.ts +10 -0
- package/reactjs/components/base/MxLink/MxLink.js +71 -0
- package/reactjs/components/base/MxLink/MxLink.mjs +70 -0
- package/reactjs/components/base/MxLink/index.d.ts +1 -0
- package/reactjs/components/base/MxLink/index.js +5 -0
- package/reactjs/components/base/MxLink/index.mjs +4 -0
- package/reactjs/components/base/MxSearch/MxSearch.d.ts +10 -0
- package/reactjs/components/base/MxSearch/MxSearch.js +70 -0
- package/reactjs/components/base/MxSearch/MxSearch.mjs +69 -0
- package/reactjs/components/base/MxSearch/index.d.ts +1 -0
- package/reactjs/components/base/MxSearch/index.js +5 -0
- package/reactjs/components/base/MxSearch/index.mjs +4 -0
- package/reactjs/components/base/MxSlideover/MxSlideover.d.ts +10 -0
- package/reactjs/components/base/MxSlideover/MxSlideover.js +79 -0
- package/reactjs/components/base/MxSlideover/MxSlideover.mjs +78 -0
- package/reactjs/components/base/MxSlideover/index.d.ts +1 -0
- package/reactjs/components/base/MxSlideover/index.js +5 -0
- package/reactjs/components/base/MxSlideover/index.mjs +4 -0
- package/reactjs/components/base/MxTooltip/MxTooltip.d.ts +23 -0
- package/reactjs/components/base/MxTooltip/MxTooltip.js +163 -0
- package/reactjs/components/base/MxTooltip/MxTooltip.mjs +162 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.d.ts +11 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.js +34 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.mjs +33 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.d.ts +1 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.js +5 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.mjs +4 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.d.ts +13 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.js +28 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.mjs +27 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContent/index.d.ts +1 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContent/index.js +5 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContent/index.mjs +4 -0
- package/reactjs/components/base/MxTooltip/components/index.d.ts +2 -0
- package/reactjs/components/base/MxTooltip/components/index.js +7 -0
- package/reactjs/components/base/MxTooltip/components/index.mjs +6 -0
- package/reactjs/components/base/MxTooltip/index.d.ts +1 -0
- package/reactjs/components/base/MxTooltip/index.js +5 -0
- package/reactjs/components/base/MxTooltip/index.mjs +4 -0
- package/reactjs/components/base/index.d.ts +6 -0
- package/reactjs/components/base/index.js +15 -0
- package/reactjs/components/base/index.mjs +14 -0
- package/reactjs/components/index.d.ts +13 -0
- package/reactjs/components/index.js +51 -0
- package/reactjs/components/index.mjs +50 -0
- package/reactjs/constants/chains.d.ts +35 -0
- package/reactjs/constants/chains.js +38 -0
- package/reactjs/constants/chains.mjs +37 -0
- package/reactjs/constants/index.d.ts +3 -0
- package/reactjs/constants/index.js +12 -0
- package/reactjs/constants/index.mjs +11 -0
- package/reactjs/context/Web3AppProvider.d.ts +12 -0
- package/reactjs/context/Web3AppProvider.js +29 -0
- package/reactjs/context/Web3AppProvider.mjs +28 -0
- package/reactjs/context/queryClient.d.ts +3 -0
- package/reactjs/context/queryClient.js +12 -0
- package/reactjs/context/queryClient.mjs +11 -0
- package/reactjs/context/useWeb3App.d.ts +1 -0
- package/reactjs/context/useWeb3App.js +13 -0
- package/reactjs/context/useWeb3App.mjs +12 -0
- package/reactjs/hooks/index.d.ts +11 -0
- package/reactjs/hooks/index.js +32 -0
- package/reactjs/hooks/index.mjs +31 -0
- package/reactjs/hooks/useAccount.d.ts +77 -0
- package/reactjs/hooks/useAccount.js +18 -0
- package/reactjs/hooks/useAccount.mjs +17 -0
- package/reactjs/hooks/useBalances.d.ts +10 -0
- package/reactjs/hooks/useBalances.js +7 -0
- package/reactjs/hooks/useBalances.mjs +6 -0
- package/reactjs/hooks/useBridgeFormik.d.ts +98 -0
- package/reactjs/hooks/useBridgeFormik.js +182 -0
- package/reactjs/hooks/useBridgeFormik.mjs +181 -0
- package/reactjs/hooks/useDebounce.d.ts +1 -0
- package/reactjs/hooks/useDebounce.js +14 -0
- package/reactjs/hooks/useDebounce.mjs +13 -0
- package/reactjs/hooks/useFetchBridgeData.d.ts +45 -0
- package/reactjs/hooks/useFetchBridgeData.js +44 -0
- package/reactjs/hooks/useFetchBridgeData.mjs +43 -0
- package/reactjs/hooks/useFetchTokens.d.ts +42 -0
- package/reactjs/hooks/useFetchTokens.js +105 -0
- package/reactjs/hooks/useFetchTokens.mjs +104 -0
- package/reactjs/hooks/useGetChainId.d.ts +1 -0
- package/reactjs/hooks/useGetChainId.js +12 -0
- package/reactjs/hooks/useGetChainId.mjs +11 -0
- package/reactjs/hooks/useResolveTokenChain.d.ts +9 -0
- package/reactjs/hooks/useResolveTokenChain.js +21 -0
- package/reactjs/hooks/useResolveTokenChain.mjs +20 -0
- package/reactjs/hooks/useSendTransactions.d.ts +3 -0
- package/reactjs/hooks/useSendTransactions.js +19 -0
- package/reactjs/hooks/useSendTransactions.mjs +18 -0
- package/reactjs/hooks/useSignTransaction.d.ts +69 -0
- package/reactjs/hooks/useSignTransaction.js +17 -0
- package/reactjs/hooks/useSignTransaction.mjs +16 -0
- package/reactjs/hooks/validation/index.d.ts +4 -0
- package/reactjs/hooks/validation/index.js +11 -0
- package/reactjs/hooks/validation/index.mjs +10 -0
- package/reactjs/hooks/validation/useAmountSchema.d.ts +2 -0
- package/reactjs/hooks/validation/useAmountSchema.js +31 -0
- package/reactjs/hooks/validation/useAmountSchema.mjs +13 -0
- package/reactjs/hooks/validation/useSecondAmountSchema.d.ts +2 -0
- package/reactjs/hooks/validation/useSecondAmountSchema.js +27 -0
- package/reactjs/hooks/validation/useSecondAmountSchema.mjs +9 -0
- package/reactjs/hooks/validation/useTestHasEnoughFunds.d.ts +3 -0
- package/reactjs/hooks/validation/useTestHasEnoughFunds.js +38 -0
- package/reactjs/hooks/validation/useTestHasEnoughFunds.mjs +37 -0
- package/reactjs/hooks/validation/useTestIsConnected.d.ts +3 -0
- package/reactjs/hooks/validation/useTestIsConnected.js +21 -0
- package/reactjs/hooks/validation/useTestIsConnected.mjs +20 -0
- package/reactjs/index.d.ts +10 -0
- package/reactjs/index.js +153 -0
- package/reactjs/index.mjs +149 -0
- package/reactjs/init/index.d.ts +1 -0
- package/reactjs/init/index.js +5 -0
- package/reactjs/init/index.mjs +4 -0
- package/reactjs/init/init.d.ts +48 -0
- package/reactjs/init/init.js +53 -0
- package/reactjs/init/init.mjs +35 -0
- package/reactjs/init/tests/init.spec.d.ts +1 -0
- package/reactjs/init/tests/init.spec.js +108 -0
- package/reactjs/init/tests/init.spec.mjs +106 -0
- package/reactjs/queries/index.d.ts +7 -0
- package/reactjs/queries/index.js +20 -0
- package/reactjs/queries/index.mjs +19 -0
- package/reactjs/queries/useGetAllTokens.query.d.ts +3 -0
- package/reactjs/queries/useGetAllTokens.query.js +31 -0
- package/reactjs/queries/useGetAllTokens.query.mjs +30 -0
- package/reactjs/queries/useGetChains.query.d.ts +3 -0
- package/reactjs/queries/useGetChains.query.js +31 -0
- package/reactjs/queries/useGetChains.query.mjs +30 -0
- package/reactjs/queries/useGetEvmTokensBalances.query.d.ts +22 -0
- package/reactjs/queries/useGetEvmTokensBalances.query.js +78 -0
- package/reactjs/queries/useGetEvmTokensBalances.query.mjs +77 -0
- package/reactjs/queries/useGetHistory.query.d.ts +4 -0
- package/reactjs/queries/useGetHistory.query.js +47 -0
- package/reactjs/queries/useGetHistory.query.mjs +46 -0
- package/reactjs/queries/useGetMvxTokensBalances.query.d.ts +23 -0
- package/reactjs/queries/useGetMvxTokensBalances.query.js +60 -0
- package/reactjs/queries/useGetMvxTokensBalances.query.mjs +59 -0
- package/reactjs/queries/useGetRate.mutation.d.ts +6 -0
- package/reactjs/queries/useGetRate.mutation.js +19 -0
- package/reactjs/queries/useGetRate.mutation.mjs +18 -0
- package/reactjs/queries/useGetTokens.query.d.ts +3 -0
- package/reactjs/queries/useGetTokens.query.js +34 -0
- package/reactjs/queries/useGetTokens.query.mjs +33 -0
- package/reactjs/reexports.d.ts +6 -0
- package/reactjs/reexports.js +21 -0
- package/reactjs/reexports.mjs +17 -0
- package/reactjs/utils/delay.d.ts +1 -0
- package/reactjs/utils/delay.js +7 -0
- package/reactjs/utils/delay.mjs +6 -0
- package/reactjs/utils/formatAmount.d.ts +7 -0
- package/reactjs/utils/formatAmount.js +24 -0
- package/reactjs/utils/formatAmount.mjs +23 -0
- package/reactjs/utils/getCleanStringAmount.d.ts +4 -0
- package/reactjs/utils/getCleanStringAmount.js +12 -0
- package/reactjs/utils/getCleanStringAmount.mjs +11 -0
- package/reactjs/utils/getCompletePathname.d.ts +1 -0
- package/reactjs/utils/getCompletePathname.js +6 -0
- package/reactjs/utils/getCompletePathname.mjs +5 -0
- package/reactjs/utils/getInitialTokens.d.ts +8 -0
- package/reactjs/utils/getInitialTokens.js +13 -0
- package/reactjs/utils/getInitialTokens.mjs +12 -0
- package/reactjs/utils/hasEnoughFunds.d.ts +5 -0
- package/reactjs/utils/hasEnoughFunds.js +20 -0
- package/reactjs/utils/hasEnoughFunds.mjs +19 -0
- package/reactjs/utils/index.d.ts +12 -0
- package/reactjs/utils/index.js +27 -0
- package/reactjs/utils/index.mjs +26 -0
- package/reactjs/utils/isStringFloat.d.ts +1 -0
- package/reactjs/utils/isStringFloat.js +22 -0
- package/reactjs/utils/isStringFloat.mjs +21 -0
- package/reactjs/utils/mxClsx.d.ts +3 -0
- package/reactjs/utils/mxClsx.js +21 -0
- package/reactjs/utils/mxClsx.mjs +20 -0
- package/reactjs/utils/pipe.d.ts +7 -0
- package/reactjs/utils/pipe.js +26 -0
- package/reactjs/utils/pipe.mjs +25 -0
- package/reactjs/utils/removeCommas.d.ts +1 -0
- package/reactjs/utils/removeCommas.js +7 -0
- package/reactjs/utils/removeCommas.mjs +6 -0
- package/reactjs/utils/roundAmount.d.ts +1 -0
- package/reactjs/utils/roundAmount.js +41 -0
- package/reactjs/utils/roundAmount.mjs +40 -0
- package/reactjs/utils/testNumber.d.ts +1 -0
- package/reactjs/utils/testNumber.js +5 -0
- package/reactjs/utils/testNumber.mjs +4 -0
- package/store/inMemoryStore.d.ts +12 -0
- package/store/inMemoryStore.js +40 -0
- package/store/inMemoryStore.mjs +39 -0
- package/types/batchTransactions.d.ts +6 -0
- package/types/batchTransactions.js +2 -0
- package/types/batchTransactions.mjs +1 -0
- package/types/index.d.ts +4 -0
- package/types/index.js +2 -0
- package/types/index.mjs +1 -0
- package/types/rate.d.ts +11 -0
- package/types/rate.js +2 -0
- package/types/rate.mjs +1 -0
- package/types/token.d.ts +12 -0
- package/types/token.js +2 -0
- package/types/token.mjs +1 -0
- package/types/transaction.d.ts +14 -0
- package/types/transaction.js +2 -0
- package/types/transaction.mjs +1 -0
- package/useBalances-Bxtc4GNK.js +199 -0
- package/useBalances-DA3zEruz.mjs +199 -0
- package/w3m-modal-DCcF1qEB.js +356 -0
- package/w3m-modal-DK3G5GJp.mjs +356 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useWeb3App(): import('./Web3AppProvider').Web3AppContextProps;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const require$$0 = require("react");
|
|
5
|
+
const reactjs_context_Web3AppProvider = require("./Web3AppProvider.js");
|
|
6
|
+
function useWeb3App() {
|
|
7
|
+
const context = require$$0.useContext(reactjs_context_Web3AppProvider.Web3AppContext);
|
|
8
|
+
if (context == null) {
|
|
9
|
+
throw new Error("Web3AppContext must be used within a Web3AppProvider");
|
|
10
|
+
}
|
|
11
|
+
return context;
|
|
12
|
+
}
|
|
13
|
+
exports.useWeb3App = useWeb3App;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { Web3AppContext } from "./Web3AppProvider.mjs";
|
|
3
|
+
function useWeb3App() {
|
|
4
|
+
const context = useContext(Web3AppContext);
|
|
5
|
+
if (context == null) {
|
|
6
|
+
throw new Error("Web3AppContext must be used within a Web3AppProvider");
|
|
7
|
+
}
|
|
8
|
+
return context;
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
useWeb3App
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './validation';
|
|
2
|
+
export * from './useAccount';
|
|
3
|
+
export * from './useBalances';
|
|
4
|
+
export * from './useBridgeFormik';
|
|
5
|
+
export * from './useDebounce';
|
|
6
|
+
export * from './useFetchBridgeData';
|
|
7
|
+
export * from './useFetchTokens';
|
|
8
|
+
export * from './useGetChainId';
|
|
9
|
+
export * from './useResolveTokenChain';
|
|
10
|
+
export * from './useSendTransactions';
|
|
11
|
+
export * from './useSignTransaction';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const reactjs_hooks_validation_useAmountSchema = require("./validation/useAmountSchema.js");
|
|
5
|
+
const reactjs_hooks_validation_useSecondAmountSchema = require("./validation/useSecondAmountSchema.js");
|
|
6
|
+
const reactjs_hooks_validation_useTestHasEnoughFunds = require("./validation/useTestHasEnoughFunds.js");
|
|
7
|
+
const reactjs_hooks_validation_useTestIsConnected = require("./validation/useTestIsConnected.js");
|
|
8
|
+
const reactjs_hooks_useAccount = require("./useAccount.js");
|
|
9
|
+
const reactjs_hooks_useBalances = require("../../useBalances-Bxtc4GNK.js");
|
|
10
|
+
const reactjs_hooks_useBridgeFormik = require("./useBridgeFormik.js");
|
|
11
|
+
const reactjs_hooks_useDebounce = require("./useDebounce.js");
|
|
12
|
+
const reactjs_hooks_useFetchBridgeData = require("./useFetchBridgeData.js");
|
|
13
|
+
const reactjs_hooks_useFetchTokens = require("./useFetchTokens.js");
|
|
14
|
+
const reactjs_hooks_useGetChainId = require("./useGetChainId.js");
|
|
15
|
+
const reactjs_hooks_useResolveTokenChain = require("./useResolveTokenChain.js");
|
|
16
|
+
const reactjs_hooks_useSendTransactions = require("./useSendTransactions.js");
|
|
17
|
+
const reactjs_hooks_useSignTransaction = require("./useSignTransaction.js");
|
|
18
|
+
exports.useAmountSchema = reactjs_hooks_validation_useAmountSchema.useAmountSchema;
|
|
19
|
+
exports.useSecondAmountSchema = reactjs_hooks_validation_useSecondAmountSchema.useSecondAmountSchema;
|
|
20
|
+
exports.useTestHasEnoughFunds = reactjs_hooks_validation_useTestHasEnoughFunds.useTestHasEnoughFunds;
|
|
21
|
+
exports.useTestIsConnected = reactjs_hooks_validation_useTestIsConnected.useTestIsConnected;
|
|
22
|
+
exports.useAccount = reactjs_hooks_useAccount.useAccount;
|
|
23
|
+
exports.useBalances = reactjs_hooks_useBalances.useBalances;
|
|
24
|
+
exports.BridgeFormikValuesEnum = reactjs_hooks_useBridgeFormik.BridgeFormikValuesEnum;
|
|
25
|
+
exports.useBridgeFormik = reactjs_hooks_useBridgeFormik.useBridgeFormik;
|
|
26
|
+
exports.useDebounce = reactjs_hooks_useDebounce.useDebounce;
|
|
27
|
+
exports.useFetchBridgeData = reactjs_hooks_useFetchBridgeData.useFetchBridgeData;
|
|
28
|
+
exports.useFetchTokens = reactjs_hooks_useFetchTokens.useFetchTokens;
|
|
29
|
+
exports.useGetChainId = reactjs_hooks_useGetChainId.useGetChainId;
|
|
30
|
+
exports.useResolveTokenChain = reactjs_hooks_useResolveTokenChain.useResolveTokenChain;
|
|
31
|
+
exports.useSendTransactions = reactjs_hooks_useSendTransactions.useSendTransactions;
|
|
32
|
+
exports.useSignTransaction = reactjs_hooks_useSignTransaction.useSignTransaction;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useAmountSchema } from "./validation/useAmountSchema.mjs";
|
|
2
|
+
import { useSecondAmountSchema } from "./validation/useSecondAmountSchema.mjs";
|
|
3
|
+
import { useTestHasEnoughFunds } from "./validation/useTestHasEnoughFunds.mjs";
|
|
4
|
+
import { useTestIsConnected } from "./validation/useTestIsConnected.mjs";
|
|
5
|
+
import { useAccount } from "./useAccount.mjs";
|
|
6
|
+
import { u } from "../../useBalances-DA3zEruz.mjs";
|
|
7
|
+
import { BridgeFormikValuesEnum, useBridgeFormik } from "./useBridgeFormik.mjs";
|
|
8
|
+
import { useDebounce } from "./useDebounce.mjs";
|
|
9
|
+
import { useFetchBridgeData } from "./useFetchBridgeData.mjs";
|
|
10
|
+
import { useFetchTokens } from "./useFetchTokens.mjs";
|
|
11
|
+
import { useGetChainId } from "./useGetChainId.mjs";
|
|
12
|
+
import { useResolveTokenChain } from "./useResolveTokenChain.mjs";
|
|
13
|
+
import { useSendTransactions } from "./useSendTransactions.mjs";
|
|
14
|
+
import { useSignTransaction } from "./useSignTransaction.mjs";
|
|
15
|
+
export {
|
|
16
|
+
BridgeFormikValuesEnum,
|
|
17
|
+
useAccount,
|
|
18
|
+
useAmountSchema,
|
|
19
|
+
u as useBalances,
|
|
20
|
+
useBridgeFormik,
|
|
21
|
+
useDebounce,
|
|
22
|
+
useFetchBridgeData,
|
|
23
|
+
useFetchTokens,
|
|
24
|
+
useGetChainId,
|
|
25
|
+
useResolveTokenChain,
|
|
26
|
+
useSecondAmountSchema,
|
|
27
|
+
useSendTransactions,
|
|
28
|
+
useSignTransaction,
|
|
29
|
+
useTestHasEnoughFunds,
|
|
30
|
+
useTestIsConnected
|
|
31
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export declare const useAccount: () => {
|
|
2
|
+
allAccounts: import('@reown/appkit/react').AccountType[];
|
|
3
|
+
caipAddress: import('@reown/appkit/react').CaipAddress | undefined;
|
|
4
|
+
address: string | undefined;
|
|
5
|
+
isConnected: boolean;
|
|
6
|
+
embeddedWalletInfo?: {
|
|
7
|
+
user: import('@reown/appkit/react').AccountControllerState["user"];
|
|
8
|
+
authProvider: import('@reown/appkit/react').AccountControllerState["socialProvider"] | "email";
|
|
9
|
+
accountType: import("@reown/appkit-wallet").W3mFrameTypes.AccountType | undefined;
|
|
10
|
+
isSmartAccountDeployed: boolean;
|
|
11
|
+
};
|
|
12
|
+
status: import('@reown/appkit/react').AccountControllerState["status"];
|
|
13
|
+
addresses: undefined;
|
|
14
|
+
chain: undefined;
|
|
15
|
+
chainId: undefined;
|
|
16
|
+
connector: undefined;
|
|
17
|
+
isReconnecting: false;
|
|
18
|
+
isConnecting: false;
|
|
19
|
+
isDisconnected: true;
|
|
20
|
+
} | {
|
|
21
|
+
allAccounts: import('@reown/appkit/react').AccountType[];
|
|
22
|
+
caipAddress: import('@reown/appkit/react').CaipAddress | undefined;
|
|
23
|
+
address: string | undefined;
|
|
24
|
+
isConnected: boolean;
|
|
25
|
+
embeddedWalletInfo?: {
|
|
26
|
+
user: import('@reown/appkit/react').AccountControllerState["user"];
|
|
27
|
+
authProvider: import('@reown/appkit/react').AccountControllerState["socialProvider"] | "email";
|
|
28
|
+
accountType: import("@reown/appkit-wallet").W3mFrameTypes.AccountType | undefined;
|
|
29
|
+
isSmartAccountDeployed: boolean;
|
|
30
|
+
};
|
|
31
|
+
status: import('@reown/appkit/react').AccountControllerState["status"];
|
|
32
|
+
addresses: readonly [import('abitype').Address, ...import('abitype').Address[]];
|
|
33
|
+
chain: import('viem').Chain | undefined;
|
|
34
|
+
chainId: number;
|
|
35
|
+
connector: import('wagmi').Connector;
|
|
36
|
+
isConnecting: false;
|
|
37
|
+
isDisconnected: false;
|
|
38
|
+
isReconnecting: false;
|
|
39
|
+
} | {
|
|
40
|
+
allAccounts: import('@reown/appkit/react').AccountType[];
|
|
41
|
+
caipAddress: import('@reown/appkit/react').CaipAddress | undefined;
|
|
42
|
+
address: string | undefined;
|
|
43
|
+
isConnected: boolean;
|
|
44
|
+
embeddedWalletInfo?: {
|
|
45
|
+
user: import('@reown/appkit/react').AccountControllerState["user"];
|
|
46
|
+
authProvider: import('@reown/appkit/react').AccountControllerState["socialProvider"] | "email";
|
|
47
|
+
accountType: import("@reown/appkit-wallet").W3mFrameTypes.AccountType | undefined;
|
|
48
|
+
isSmartAccountDeployed: boolean;
|
|
49
|
+
};
|
|
50
|
+
status: import('@reown/appkit/react').AccountControllerState["status"];
|
|
51
|
+
addresses: readonly import('abitype').Address[] | undefined;
|
|
52
|
+
chain: import('viem').Chain | undefined;
|
|
53
|
+
chainId: number | undefined;
|
|
54
|
+
connector: import('wagmi').Connector | undefined;
|
|
55
|
+
isConnecting: false;
|
|
56
|
+
isDisconnected: false;
|
|
57
|
+
isReconnecting: true;
|
|
58
|
+
} | {
|
|
59
|
+
allAccounts: import('@reown/appkit/react').AccountType[];
|
|
60
|
+
caipAddress: import('@reown/appkit/react').CaipAddress | undefined;
|
|
61
|
+
address: string | undefined;
|
|
62
|
+
isConnected: boolean;
|
|
63
|
+
embeddedWalletInfo?: {
|
|
64
|
+
user: import('@reown/appkit/react').AccountControllerState["user"];
|
|
65
|
+
authProvider: import('@reown/appkit/react').AccountControllerState["socialProvider"] | "email";
|
|
66
|
+
accountType: import("@reown/appkit-wallet").W3mFrameTypes.AccountType | undefined;
|
|
67
|
+
isSmartAccountDeployed: boolean;
|
|
68
|
+
};
|
|
69
|
+
status: import('@reown/appkit/react').AccountControllerState["status"];
|
|
70
|
+
addresses: readonly import('abitype').Address[] | undefined;
|
|
71
|
+
chain: import('viem').Chain | undefined;
|
|
72
|
+
chainId: number | undefined;
|
|
73
|
+
connector: import('wagmi').Connector | undefined;
|
|
74
|
+
isReconnecting: false;
|
|
75
|
+
isConnecting: true;
|
|
76
|
+
isDisconnected: false;
|
|
77
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
require("../../index-cvy2-uZ_.js");
|
|
5
|
+
const react = require("../../react-CNXJSTCv.js");
|
|
6
|
+
require("viem");
|
|
7
|
+
require("viem/chains");
|
|
8
|
+
require("react");
|
|
9
|
+
const wagmi = require("wagmi");
|
|
10
|
+
const useAccount = () => {
|
|
11
|
+
const appkitAccount = react.useAppKitAccount();
|
|
12
|
+
const wagmiAccount = wagmi.useAccount();
|
|
13
|
+
return {
|
|
14
|
+
...wagmiAccount,
|
|
15
|
+
...appkitAccount
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
exports.useAccount = useAccount;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "../../index-DSnomXRI.mjs";
|
|
2
|
+
import { u as useAppKitAccount } from "../../react-CSQpf1zk.mjs";
|
|
3
|
+
import "viem";
|
|
4
|
+
import "viem/chains";
|
|
5
|
+
import "react";
|
|
6
|
+
import { useAccount as useAccount$1 } from "wagmi";
|
|
7
|
+
const useAccount = () => {
|
|
8
|
+
const appkitAccount = useAppKitAccount();
|
|
9
|
+
const wagmiAccount = useAccount$1();
|
|
10
|
+
return {
|
|
11
|
+
...wagmiAccount,
|
|
12
|
+
...appkitAccount
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
useAccount
|
|
17
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
require("react");
|
|
5
|
+
require("../context/useWeb3App.js");
|
|
6
|
+
const reactjs_hooks_useBalances = require("../../useBalances-Bxtc4GNK.js");
|
|
7
|
+
exports.useBalances = reactjs_hooks_useBalances.useBalances;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { ServerTransaction } from '../../types/transaction';
|
|
2
|
+
import { TokenType } from '../../types/token';
|
|
3
|
+
|
|
4
|
+
export declare enum BridgeFormikValuesEnum {
|
|
5
|
+
firstToken = "firstToken",
|
|
6
|
+
firstAmount = "firstAmount",
|
|
7
|
+
secondToken = "secondToken",
|
|
8
|
+
secondAmount = "secondAmount",
|
|
9
|
+
fromChainId = "fromChainId",
|
|
10
|
+
toChainId = "toChainId"
|
|
11
|
+
}
|
|
12
|
+
export interface TradeFormikValuesType {
|
|
13
|
+
firstAmount?: string;
|
|
14
|
+
secondAmount?: string;
|
|
15
|
+
firstToken?: TokenType;
|
|
16
|
+
secondToken?: TokenType;
|
|
17
|
+
fromChainId?: string;
|
|
18
|
+
toChainId?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const useBridgeFormik: ({ nativeAuthToken, mvxAccountAddress, firstToken, firstAmount, secondToken, secondAmount, fromChainId, toChainId, fee, onSubmit }: {
|
|
21
|
+
mvxAccountAddress?: string;
|
|
22
|
+
nativeAuthToken?: string;
|
|
23
|
+
firstAmount?: string;
|
|
24
|
+
secondAmount?: string;
|
|
25
|
+
fromChainId?: string;
|
|
26
|
+
toChainId?: string;
|
|
27
|
+
firstToken?: TokenType;
|
|
28
|
+
secondToken?: TokenType;
|
|
29
|
+
fee?: string;
|
|
30
|
+
onSubmit: (transactions: ServerTransaction[]) => void;
|
|
31
|
+
}) => {
|
|
32
|
+
formik: {
|
|
33
|
+
initialValues: TradeFormikValuesType;
|
|
34
|
+
initialErrors: import('formik').FormikErrors<unknown>;
|
|
35
|
+
initialTouched: import('formik').FormikTouched<unknown>;
|
|
36
|
+
initialStatus: any;
|
|
37
|
+
handleBlur: {
|
|
38
|
+
(e: React.FocusEvent<any, Element>): void;
|
|
39
|
+
<T = any>(fieldOrEvent: T): T extends string ? (e: any) => void : void;
|
|
40
|
+
};
|
|
41
|
+
handleChange: {
|
|
42
|
+
(e: React.ChangeEvent<any>): void;
|
|
43
|
+
<T_1 = string | React.ChangeEvent<any>>(field: T_1): T_1 extends React.ChangeEvent<any> ? void : (e: string | React.ChangeEvent<any>) => void;
|
|
44
|
+
};
|
|
45
|
+
handleReset: (e: any) => void;
|
|
46
|
+
handleSubmit: (e?: React.FormEvent<HTMLFormElement>) => void;
|
|
47
|
+
resetForm: (nextState?: Partial<import('formik').FormikState<TradeFormikValuesType>> | undefined) => void;
|
|
48
|
+
setErrors: (errors: import('formik').FormikErrors<TradeFormikValuesType>) => void;
|
|
49
|
+
setFormikState: (stateOrCb: import('formik').FormikState<TradeFormikValuesType> | ((state: import('formik').FormikState<TradeFormikValuesType>) => import('formik').FormikState<TradeFormikValuesType>)) => void;
|
|
50
|
+
setFieldTouched: (field: string, touched?: boolean, shouldValidate?: boolean) => Promise<void> | Promise<import('formik').FormikErrors<TradeFormikValuesType>>;
|
|
51
|
+
setFieldValue: (field: string, value: any, shouldValidate?: boolean) => Promise<void> | Promise<import('formik').FormikErrors<TradeFormikValuesType>>;
|
|
52
|
+
setFieldError: (field: string, value: string | undefined) => void;
|
|
53
|
+
setStatus: (status: any) => void;
|
|
54
|
+
setSubmitting: (isSubmitting: boolean) => void;
|
|
55
|
+
setTouched: (touched: import('formik').FormikTouched<TradeFormikValuesType>, shouldValidate?: boolean) => Promise<void> | Promise<import('formik').FormikErrors<TradeFormikValuesType>>;
|
|
56
|
+
setValues: (values: import('react').SetStateAction<TradeFormikValuesType>, shouldValidate?: boolean) => Promise<void> | Promise<import('formik').FormikErrors<TradeFormikValuesType>>;
|
|
57
|
+
submitForm: () => Promise<any>;
|
|
58
|
+
validateForm: (values?: TradeFormikValuesType | undefined) => Promise<import('formik').FormikErrors<TradeFormikValuesType>>;
|
|
59
|
+
validateField: (name: string) => Promise<void> | Promise<string | undefined>;
|
|
60
|
+
isValid: boolean;
|
|
61
|
+
dirty: boolean;
|
|
62
|
+
unregisterField: (name: string) => void;
|
|
63
|
+
registerField: (name: string, { validate }: any) => void;
|
|
64
|
+
getFieldProps: (nameOrOptions: string | import('formik').FieldConfig<any>) => import('formik').FieldInputProps<any>;
|
|
65
|
+
getFieldMeta: (name: string) => import('formik').FieldMetaProps<any>;
|
|
66
|
+
getFieldHelpers: (name: string) => import('formik').FieldHelperProps<any>;
|
|
67
|
+
validateOnBlur: boolean;
|
|
68
|
+
validateOnChange: boolean;
|
|
69
|
+
validateOnMount: boolean;
|
|
70
|
+
values: TradeFormikValuesType;
|
|
71
|
+
errors: import('formik').FormikErrors<TradeFormikValuesType>;
|
|
72
|
+
touched: import('formik').FormikTouched<TradeFormikValuesType>;
|
|
73
|
+
isSubmitting: boolean;
|
|
74
|
+
isValidating: boolean;
|
|
75
|
+
status?: any;
|
|
76
|
+
submitCount: number;
|
|
77
|
+
};
|
|
78
|
+
errors: import('formik').FormikErrors<TradeFormikValuesType>;
|
|
79
|
+
touched: import('formik').FormikTouched<TradeFormikValuesType>;
|
|
80
|
+
firstToken: TokenType | undefined;
|
|
81
|
+
secondToken: TokenType | undefined;
|
|
82
|
+
firstAmountError: string | undefined;
|
|
83
|
+
secondAmountError: string | undefined;
|
|
84
|
+
fromChainError: string | undefined;
|
|
85
|
+
handleBlur: {
|
|
86
|
+
(e: React.FocusEvent<any, Element>): void;
|
|
87
|
+
<T = any>(fieldOrEvent: T): T extends string ? (e: any) => void : void;
|
|
88
|
+
};
|
|
89
|
+
handleChange: {
|
|
90
|
+
(e: React.ChangeEvent<any>): void;
|
|
91
|
+
<T_1 = string | import('react').ChangeEvent<any>>(field: T_1): T_1 extends React.ChangeEvent<any> ? void : (e: string | React.ChangeEvent<any>) => void;
|
|
92
|
+
};
|
|
93
|
+
handleSubmit: (e?: React.FormEvent<HTMLFormElement>) => void;
|
|
94
|
+
setFieldValue: (field: string, value: any, shouldValidate?: boolean) => Promise<void> | Promise<import('formik').FormikErrors<TradeFormikValuesType>>;
|
|
95
|
+
resetSwapForm: () => void;
|
|
96
|
+
setFieldTouched: (field: string, touched?: boolean, shouldValidate?: boolean) => Promise<void> | Promise<import('formik').FormikErrors<TradeFormikValuesType>>;
|
|
97
|
+
setLastChangedField: import('react').Dispatch<import('react').SetStateAction<BridgeFormikValuesEnum.firstAmount | BridgeFormikValuesEnum.secondAmount | null>>;
|
|
98
|
+
};
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const formik = require("formik");
|
|
5
|
+
const require$$0 = require("react");
|
|
6
|
+
const wagmi = require("wagmi");
|
|
7
|
+
const yup = require("yup");
|
|
8
|
+
const reactjs_hooks_useAccount = require("./useAccount.js");
|
|
9
|
+
const reactjs_hooks_validation_useAmountSchema = require("./validation/useAmountSchema.js");
|
|
10
|
+
const reactjs_hooks_validation_useSecondAmountSchema = require("./validation/useSecondAmountSchema.js");
|
|
11
|
+
const api_confirmRate = require("../../api/confirmRate.js");
|
|
12
|
+
const helpers_getApiURL = require("../../helpers/getApiURL.js");
|
|
13
|
+
var BridgeFormikValuesEnum = /* @__PURE__ */ ((BridgeFormikValuesEnum2) => {
|
|
14
|
+
BridgeFormikValuesEnum2["firstToken"] = "firstToken";
|
|
15
|
+
BridgeFormikValuesEnum2["firstAmount"] = "firstAmount";
|
|
16
|
+
BridgeFormikValuesEnum2["secondToken"] = "secondToken";
|
|
17
|
+
BridgeFormikValuesEnum2["secondAmount"] = "secondAmount";
|
|
18
|
+
BridgeFormikValuesEnum2["fromChainId"] = "fromChainId";
|
|
19
|
+
BridgeFormikValuesEnum2["toChainId"] = "toChainId";
|
|
20
|
+
return BridgeFormikValuesEnum2;
|
|
21
|
+
})(BridgeFormikValuesEnum || {});
|
|
22
|
+
const useBridgeFormik = ({
|
|
23
|
+
nativeAuthToken,
|
|
24
|
+
mvxAccountAddress,
|
|
25
|
+
firstToken,
|
|
26
|
+
firstAmount,
|
|
27
|
+
secondToken,
|
|
28
|
+
secondAmount,
|
|
29
|
+
fromChainId,
|
|
30
|
+
toChainId,
|
|
31
|
+
fee = "0",
|
|
32
|
+
onSubmit
|
|
33
|
+
}) => {
|
|
34
|
+
const [lastChangedField, setLastChangedField] = require$$0.useState(null);
|
|
35
|
+
const pendingSigningRef = require$$0.useRef();
|
|
36
|
+
const account = reactjs_hooks_useAccount.useAccount();
|
|
37
|
+
const { switchChainAsync } = wagmi.useSwitchChain();
|
|
38
|
+
const initialValues = {
|
|
39
|
+
firstAmount: "",
|
|
40
|
+
secondAmount: "",
|
|
41
|
+
fromChainId: fromChainId ?? "",
|
|
42
|
+
toChainId: toChainId ?? ""
|
|
43
|
+
};
|
|
44
|
+
const resetSwapForm = () => {
|
|
45
|
+
formik$1.setTouched({}, false);
|
|
46
|
+
formik$1.setErrors({});
|
|
47
|
+
setFieldValue("firstAmount", "");
|
|
48
|
+
setFieldValue("secondAmount", "");
|
|
49
|
+
};
|
|
50
|
+
const onSubmitFormik = async (values2) => {
|
|
51
|
+
var _a, _b;
|
|
52
|
+
if (values2.fromChainId) {
|
|
53
|
+
await switchChainAsync({
|
|
54
|
+
chainId: Number(values2.fromChainId)
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
if (pendingSigningRef.current) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
pendingSigningRef.current = true;
|
|
61
|
+
const { data } = await api_confirmRate.confirmRate({
|
|
62
|
+
url: helpers_getApiURL.getApiURL(),
|
|
63
|
+
nativeAuthToken: nativeAuthToken ?? "",
|
|
64
|
+
body: {
|
|
65
|
+
tokenIn: ((_a = values2.firstToken) == null ? void 0 : _a.address) ?? "",
|
|
66
|
+
amountIn: (firstAmount == null ? void 0 : firstAmount.toString()) ?? "",
|
|
67
|
+
fromChainId: values2.fromChainId ?? "",
|
|
68
|
+
tokenOut: ((_b = values2.secondToken) == null ? void 0 : _b.address) ?? "",
|
|
69
|
+
toChainId: values2.toChainId ?? "",
|
|
70
|
+
fee: fee ?? "0",
|
|
71
|
+
amountOut: (secondAmount == null ? void 0 : secondAmount.toString()) ?? "",
|
|
72
|
+
sender: account.address ?? "",
|
|
73
|
+
receiver: mvxAccountAddress ?? ""
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
const transactions = data;
|
|
77
|
+
if (!transactions || transactions.length === 0) {
|
|
78
|
+
pendingSigningRef.current = false;
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
resetSwapForm();
|
|
82
|
+
onSubmit(transactions);
|
|
83
|
+
pendingSigningRef.current = false;
|
|
84
|
+
};
|
|
85
|
+
const formik$1 = formik.useFormik({
|
|
86
|
+
initialValues,
|
|
87
|
+
validationSchema: yup.object().shape({
|
|
88
|
+
[
|
|
89
|
+
"firstAmount"
|
|
90
|
+
/* firstAmount */
|
|
91
|
+
]: reactjs_hooks_validation_useAmountSchema.useAmountSchema(),
|
|
92
|
+
[
|
|
93
|
+
"firstToken"
|
|
94
|
+
/* firstToken */
|
|
95
|
+
]: yup.object().required(),
|
|
96
|
+
[
|
|
97
|
+
"secondAmount"
|
|
98
|
+
/* secondAmount */
|
|
99
|
+
]: reactjs_hooks_validation_useSecondAmountSchema.useSecondAmountSchema(),
|
|
100
|
+
[
|
|
101
|
+
"secondToken"
|
|
102
|
+
/* secondToken */
|
|
103
|
+
]: yup.object().required(),
|
|
104
|
+
[
|
|
105
|
+
"fromChainId"
|
|
106
|
+
/* fromChainId */
|
|
107
|
+
]: yup.string().required(),
|
|
108
|
+
[
|
|
109
|
+
"toChainId"
|
|
110
|
+
/* toChainId */
|
|
111
|
+
]: yup.string().required()
|
|
112
|
+
}),
|
|
113
|
+
onSubmit: onSubmitFormik
|
|
114
|
+
});
|
|
115
|
+
const {
|
|
116
|
+
values,
|
|
117
|
+
errors,
|
|
118
|
+
touched,
|
|
119
|
+
handleBlur,
|
|
120
|
+
handleSubmit,
|
|
121
|
+
handleChange,
|
|
122
|
+
setFieldValue,
|
|
123
|
+
setFieldTouched
|
|
124
|
+
} = formik$1;
|
|
125
|
+
require$$0.useEffect(() => {
|
|
126
|
+
if (!values.firstAmount && touched.firstAmount) {
|
|
127
|
+
setFieldValue("secondAmount", 0, true);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (lastChangedField === "firstAmount" && values.firstAmount && values.firstAmount !== "") {
|
|
131
|
+
const calculatedSecondAmount = parseFloat(values.firstAmount) - Number(fee);
|
|
132
|
+
setFieldValue(
|
|
133
|
+
"secondAmount",
|
|
134
|
+
calculatedSecondAmount > 0 ? calculatedSecondAmount : "0"
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
}, [values.firstAmount, fee, lastChangedField, touched.firstAmount]);
|
|
138
|
+
require$$0.useEffect(() => {
|
|
139
|
+
if (!values.secondAmount && touched.secondAmount) {
|
|
140
|
+
setFieldValue("firstAmount", 0, true);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (lastChangedField === "secondAmount" && values.secondAmount && values.secondAmount !== "") {
|
|
144
|
+
const calculatedFirstAmount = parseFloat(values.secondAmount) + Number(fee);
|
|
145
|
+
setFieldValue("firstAmount", calculatedFirstAmount);
|
|
146
|
+
}
|
|
147
|
+
}, [values.secondAmount, fee, lastChangedField, touched.secondAmount]);
|
|
148
|
+
require$$0.useEffect(() => {
|
|
149
|
+
setFieldValue("firstToken", firstToken, true);
|
|
150
|
+
}, [firstToken]);
|
|
151
|
+
require$$0.useEffect(() => {
|
|
152
|
+
setFieldValue("secondToken", secondToken, true);
|
|
153
|
+
}, [secondToken]);
|
|
154
|
+
require$$0.useEffect(() => {
|
|
155
|
+
setFieldValue("fromChainId", fromChainId, true);
|
|
156
|
+
}, [fromChainId]);
|
|
157
|
+
require$$0.useEffect(() => {
|
|
158
|
+
setFieldValue("toChainId", toChainId, true);
|
|
159
|
+
}, [toChainId]);
|
|
160
|
+
const secondAmountError = "secondAmount" in errors && "secondAmount" in touched ? errors.secondAmount : void 0;
|
|
161
|
+
const firstAmountError = "firstAmount" in errors && "firstAmount" in touched ? errors.firstAmount : void 0;
|
|
162
|
+
const fromChainError = "fromChainId" in errors && "fromChainId" in touched ? errors.fromChainId : void 0;
|
|
163
|
+
return {
|
|
164
|
+
formik: formik$1,
|
|
165
|
+
errors,
|
|
166
|
+
touched,
|
|
167
|
+
firstToken,
|
|
168
|
+
secondToken,
|
|
169
|
+
firstAmountError,
|
|
170
|
+
secondAmountError,
|
|
171
|
+
fromChainError,
|
|
172
|
+
handleBlur,
|
|
173
|
+
handleChange,
|
|
174
|
+
handleSubmit,
|
|
175
|
+
setFieldValue,
|
|
176
|
+
resetSwapForm,
|
|
177
|
+
setFieldTouched,
|
|
178
|
+
setLastChangedField
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
exports.BridgeFormikValuesEnum = BridgeFormikValuesEnum;
|
|
182
|
+
exports.useBridgeFormik = useBridgeFormik;
|