@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,42 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
const faCheck = require("@fortawesome/free-solid-svg-icons/faCheck");
|
|
6
|
+
const faCopy = require("@fortawesome/free-solid-svg-icons/faCopy");
|
|
7
|
+
const reactFontawesome = require("@fortawesome/react-fontawesome");
|
|
8
|
+
const require$$0 = require("react");
|
|
9
|
+
const reactjs_components_CopyButton_utils_copyToClipboard = require("./utils/copyToClipboard.js");
|
|
10
|
+
const reactjs_components_base_MxButton_MxButton = require("../base/MxButton/MxButton.js");
|
|
11
|
+
const CopyButton = ({ text, className = "" }) => {
|
|
12
|
+
const [copyResult, setCopyResut] = require$$0.useState({
|
|
13
|
+
default: true,
|
|
14
|
+
success: false
|
|
15
|
+
});
|
|
16
|
+
const handleOnClick = async (e) => {
|
|
17
|
+
e.preventDefault();
|
|
18
|
+
e.stopPropagation();
|
|
19
|
+
const noSpaces = text ? text.trim() : text;
|
|
20
|
+
setCopyResut({
|
|
21
|
+
default: false,
|
|
22
|
+
success: await reactjs_components_CopyButton_utils_copyToClipboard.copyTextToClipboard(noSpaces)
|
|
23
|
+
});
|
|
24
|
+
setTimeout(() => {
|
|
25
|
+
setCopyResut({
|
|
26
|
+
default: true,
|
|
27
|
+
success: false
|
|
28
|
+
});
|
|
29
|
+
}, 1e3);
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
32
|
+
reactjs_components_base_MxButton_MxButton.MxButton,
|
|
33
|
+
{
|
|
34
|
+
btnSize: "sm",
|
|
35
|
+
className,
|
|
36
|
+
variant: "link-neutral-500",
|
|
37
|
+
onClick: handleOnClick,
|
|
38
|
+
children: copyResult.default || !copyResult.success ? /* @__PURE__ */ jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, { icon: faCopy.faCopy }) : /* @__PURE__ */ jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, { icon: faCheck.faCheck })
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
exports.CopyButton = CopyButton;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { faCheck } from "@fortawesome/free-solid-svg-icons/faCheck";
|
|
3
|
+
import { faCopy } from "@fortawesome/free-solid-svg-icons/faCopy";
|
|
4
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
5
|
+
import require$$0 from "react";
|
|
6
|
+
import { copyTextToClipboard } from "./utils/copyToClipboard.mjs";
|
|
7
|
+
import { MxButton } from "../base/MxButton/MxButton.mjs";
|
|
8
|
+
const CopyButton = ({ text, className = "" }) => {
|
|
9
|
+
const [copyResult, setCopyResut] = require$$0.useState({
|
|
10
|
+
default: true,
|
|
11
|
+
success: false
|
|
12
|
+
});
|
|
13
|
+
const handleOnClick = async (e) => {
|
|
14
|
+
e.preventDefault();
|
|
15
|
+
e.stopPropagation();
|
|
16
|
+
const noSpaces = text ? text.trim() : text;
|
|
17
|
+
setCopyResut({
|
|
18
|
+
default: false,
|
|
19
|
+
success: await copyTextToClipboard(noSpaces)
|
|
20
|
+
});
|
|
21
|
+
setTimeout(() => {
|
|
22
|
+
setCopyResut({
|
|
23
|
+
default: true,
|
|
24
|
+
success: false
|
|
25
|
+
});
|
|
26
|
+
}, 1e3);
|
|
27
|
+
};
|
|
28
|
+
return /* @__PURE__ */ jsx(
|
|
29
|
+
MxButton,
|
|
30
|
+
{
|
|
31
|
+
btnSize: "sm",
|
|
32
|
+
className,
|
|
33
|
+
variant: "link-neutral-500",
|
|
34
|
+
onClick: handleOnClick,
|
|
35
|
+
children: copyResult.default || !copyResult.success ? /* @__PURE__ */ jsx(FontAwesomeIcon, { icon: faCopy }) : /* @__PURE__ */ jsx(FontAwesomeIcon, { icon: faCheck })
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
CopyButton
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CopyButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function copyTextToClipboard(text: string): Promise<boolean>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
function fallbackCopyTextToClipboard(text) {
|
|
5
|
+
let success = false;
|
|
6
|
+
const textArea = document.createElement("textarea");
|
|
7
|
+
textArea.value = text;
|
|
8
|
+
textArea.style.position = "fixed";
|
|
9
|
+
document.body.appendChild(textArea);
|
|
10
|
+
textArea.focus();
|
|
11
|
+
textArea.select();
|
|
12
|
+
try {
|
|
13
|
+
document.execCommand("copy");
|
|
14
|
+
success = true;
|
|
15
|
+
} catch (err) {
|
|
16
|
+
console.error("Fallback: Oops, unable to copy", err);
|
|
17
|
+
}
|
|
18
|
+
document.body.removeChild(textArea);
|
|
19
|
+
return success;
|
|
20
|
+
}
|
|
21
|
+
async function copyTextToClipboard(text) {
|
|
22
|
+
let success = false;
|
|
23
|
+
if (!navigator.clipboard) {
|
|
24
|
+
success = fallbackCopyTextToClipboard(text);
|
|
25
|
+
} else {
|
|
26
|
+
success = await navigator.clipboard.writeText(text).then(
|
|
27
|
+
function done() {
|
|
28
|
+
return true;
|
|
29
|
+
},
|
|
30
|
+
function error(err) {
|
|
31
|
+
console.error("Async: Could not copy text: ", err);
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
return success;
|
|
37
|
+
}
|
|
38
|
+
exports.copyTextToClipboard = copyTextToClipboard;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
function fallbackCopyTextToClipboard(text) {
|
|
2
|
+
let success = false;
|
|
3
|
+
const textArea = document.createElement("textarea");
|
|
4
|
+
textArea.value = text;
|
|
5
|
+
textArea.style.position = "fixed";
|
|
6
|
+
document.body.appendChild(textArea);
|
|
7
|
+
textArea.focus();
|
|
8
|
+
textArea.select();
|
|
9
|
+
try {
|
|
10
|
+
document.execCommand("copy");
|
|
11
|
+
success = true;
|
|
12
|
+
} catch (err) {
|
|
13
|
+
console.error("Fallback: Oops, unable to copy", err);
|
|
14
|
+
}
|
|
15
|
+
document.body.removeChild(textArea);
|
|
16
|
+
return success;
|
|
17
|
+
}
|
|
18
|
+
async function copyTextToClipboard(text) {
|
|
19
|
+
let success = false;
|
|
20
|
+
if (!navigator.clipboard) {
|
|
21
|
+
success = fallbackCopyTextToClipboard(text);
|
|
22
|
+
} else {
|
|
23
|
+
success = await navigator.clipboard.writeText(text).then(
|
|
24
|
+
function done() {
|
|
25
|
+
return true;
|
|
26
|
+
},
|
|
27
|
+
function error(err) {
|
|
28
|
+
console.error("Async: Could not copy text: ", err);
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
return success;
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
copyTextToClipboard
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './copyToClipboard';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const reactjs_components_CopyButton_utils_copyToClipboard = require("./copyToClipboard.js");
|
|
5
|
+
exports.copyTextToClipboard = reactjs_components_CopyButton_utils_copyToClipboard.copyTextToClipboard;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Placement } from 'react-joyride';
|
|
2
|
+
import { HTMLProps } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface DisplayAmountProps extends HTMLProps<HTMLSpanElement> {
|
|
5
|
+
sufix?: string;
|
|
6
|
+
prefix?: string;
|
|
7
|
+
digits?: number;
|
|
8
|
+
decimals?: number;
|
|
9
|
+
className?: string;
|
|
10
|
+
amount: string;
|
|
11
|
+
shouldAnimate?: boolean;
|
|
12
|
+
shouldTruncate?: boolean;
|
|
13
|
+
shouldBePrecised?: boolean;
|
|
14
|
+
tooltipThreshold?: number;
|
|
15
|
+
shouldShowTooltip?: boolean;
|
|
16
|
+
style?: React.CSSProperties;
|
|
17
|
+
tooltipPlacement?: Placement;
|
|
18
|
+
showLastNonZeroDecimal?: boolean;
|
|
19
|
+
onClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare const DisplayAmount: ({ amount, decimals, sufix, prefix, className, tooltipThreshold, shouldAnimate, shouldTruncate, shouldBePrecised, tooltipPlacement, showLastNonZeroDecimal, digits, shouldShowTooltip, ...rest }: DisplayAmountProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
const bignumber = require("../../../bignumber-B8vjg9qn.js");
|
|
6
|
+
const isString = require("lodash/isString");
|
|
7
|
+
const reactjs_components_DisplayAmount_components_AnimateNumber_AnimateNumber = require("./components/AnimateNumber/AnimateNumber.js");
|
|
8
|
+
const reactjs_components_DisplayAmount_components_PrecisedAmount_PrecisedAmount = require("./components/PrecisedAmount/PrecisedAmount.js");
|
|
9
|
+
const reactjs_components_DisplayAmount_utils_truncateAmount = require("./utils/truncateAmount.js");
|
|
10
|
+
const reactjs_utils_formatAmount = require("../../utils/formatAmount.js");
|
|
11
|
+
const reactjs_utils_getCleanStringAmount = require("../../utils/getCleanStringAmount.js");
|
|
12
|
+
const reactjs_utils_isStringFloat = require("../../utils/isStringFloat.js");
|
|
13
|
+
const reactjs_utils_mxClsx = require("../../utils/mxClsx.js");
|
|
14
|
+
const reactjs_utils_roundAmount = require("../../utils/roundAmount.js");
|
|
15
|
+
const reactjs_components_base_MxTooltip_MxTooltip = require("../base/MxTooltip/MxTooltip.js");
|
|
16
|
+
const DisplayAmount = ({
|
|
17
|
+
amount,
|
|
18
|
+
decimals,
|
|
19
|
+
sufix = "",
|
|
20
|
+
prefix = "",
|
|
21
|
+
className = "",
|
|
22
|
+
tooltipThreshold = 0,
|
|
23
|
+
shouldAnimate = false,
|
|
24
|
+
shouldTruncate = false,
|
|
25
|
+
shouldBePrecised = true,
|
|
26
|
+
tooltipPlacement = "top",
|
|
27
|
+
showLastNonZeroDecimal = true,
|
|
28
|
+
digits = 4,
|
|
29
|
+
shouldShowTooltip = true,
|
|
30
|
+
...rest
|
|
31
|
+
}) => {
|
|
32
|
+
const stringAmount = isString(amount) ? reactjs_utils_getCleanStringAmount.getCleanStringAmount(amount).amountWithoutCommas : String(amount);
|
|
33
|
+
const isValidStringAmount = reactjs_utils_isStringFloat.isStringFloat(stringAmount);
|
|
34
|
+
const isZero = new bignumber.BigNumber(
|
|
35
|
+
isValidStringAmount ? stringAmount : "0"
|
|
36
|
+
).isEqualTo(0);
|
|
37
|
+
if (!isValidStringAmount || isZero) {
|
|
38
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { ...rest, className: reactjs_utils_mxClsx.mxClsx(className), children: [
|
|
39
|
+
prefix,
|
|
40
|
+
amount,
|
|
41
|
+
sufix
|
|
42
|
+
] });
|
|
43
|
+
}
|
|
44
|
+
const formattedAmount = decimals ? reactjs_utils_formatAmount.formatAmount({
|
|
45
|
+
digits,
|
|
46
|
+
decimals,
|
|
47
|
+
addCommas: true,
|
|
48
|
+
amount: stringAmount,
|
|
49
|
+
showLastNonZeroDecimal
|
|
50
|
+
}) : reactjs_utils_roundAmount.roundAmount(stringAmount, digits, true);
|
|
51
|
+
const bnAmount = new bignumber.BigNumber(formattedAmount);
|
|
52
|
+
const bnTooltipThreshold = new bignumber.BigNumber(tooltipThreshold);
|
|
53
|
+
const tooltipThresholdReached = bnAmount.isLessThan(bnTooltipThreshold);
|
|
54
|
+
if (shouldBePrecised && new bignumber.BigNumber(formattedAmount).isLessThan(1)) {
|
|
55
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
56
|
+
reactjs_components_DisplayAmount_components_PrecisedAmount_PrecisedAmount.PrecisedAmount,
|
|
57
|
+
{
|
|
58
|
+
...rest,
|
|
59
|
+
sufix,
|
|
60
|
+
prefix,
|
|
61
|
+
digits,
|
|
62
|
+
className,
|
|
63
|
+
amount: formattedAmount,
|
|
64
|
+
shouldShowTooltip
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
if (tooltipThresholdReached) {
|
|
69
|
+
const prefixWhenTooltip = prefix.includes("<") ? prefix : "< ";
|
|
70
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
71
|
+
reactjs_components_base_MxTooltip_MxTooltip.MxTooltip,
|
|
72
|
+
{
|
|
73
|
+
placement: tooltipPlacement,
|
|
74
|
+
buttonText: /* @__PURE__ */ jsxRuntime.jsxs("span", { ...rest, className: reactjs_utils_mxClsx.mxClsx("liq-max-w-fit", className), children: [
|
|
75
|
+
prefixWhenTooltip,
|
|
76
|
+
tooltipThreshold,
|
|
77
|
+
sufix
|
|
78
|
+
] }),
|
|
79
|
+
hideTooltip: !shouldShowTooltip,
|
|
80
|
+
children: formattedAmount
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
const truncatedAmount = shouldTruncate ? reactjs_components_DisplayAmount_utils_truncateAmount.truncateAmount(formattedAmount) : formattedAmount;
|
|
85
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { ...rest, className: reactjs_utils_mxClsx.mxClsx(className), children: [
|
|
86
|
+
prefix,
|
|
87
|
+
shouldAnimate && !shouldTruncate ? /* @__PURE__ */ jsxRuntime.jsx(reactjs_components_DisplayAmount_components_AnimateNumber_AnimateNumber.AnimateNumber, { ...rest, amount: formattedAmount }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: truncatedAmount }),
|
|
88
|
+
sufix
|
|
89
|
+
] });
|
|
90
|
+
};
|
|
91
|
+
exports.DisplayAmount = DisplayAmount;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { B as BigNumber } from "../../../bignumber-CKZkoo0g.mjs";
|
|
3
|
+
import isString from "lodash/isString";
|
|
4
|
+
import { AnimateNumber } from "./components/AnimateNumber/AnimateNumber.mjs";
|
|
5
|
+
import { PrecisedAmount } from "./components/PrecisedAmount/PrecisedAmount.mjs";
|
|
6
|
+
import { truncateAmount } from "./utils/truncateAmount.mjs";
|
|
7
|
+
import { formatAmount } from "../../utils/formatAmount.mjs";
|
|
8
|
+
import { getCleanStringAmount } from "../../utils/getCleanStringAmount.mjs";
|
|
9
|
+
import { isStringFloat } from "../../utils/isStringFloat.mjs";
|
|
10
|
+
import { mxClsx } from "../../utils/mxClsx.mjs";
|
|
11
|
+
import { roundAmount } from "../../utils/roundAmount.mjs";
|
|
12
|
+
import { MxTooltip } from "../base/MxTooltip/MxTooltip.mjs";
|
|
13
|
+
const DisplayAmount = ({
|
|
14
|
+
amount,
|
|
15
|
+
decimals,
|
|
16
|
+
sufix = "",
|
|
17
|
+
prefix = "",
|
|
18
|
+
className = "",
|
|
19
|
+
tooltipThreshold = 0,
|
|
20
|
+
shouldAnimate = false,
|
|
21
|
+
shouldTruncate = false,
|
|
22
|
+
shouldBePrecised = true,
|
|
23
|
+
tooltipPlacement = "top",
|
|
24
|
+
showLastNonZeroDecimal = true,
|
|
25
|
+
digits = 4,
|
|
26
|
+
shouldShowTooltip = true,
|
|
27
|
+
...rest
|
|
28
|
+
}) => {
|
|
29
|
+
const stringAmount = isString(amount) ? getCleanStringAmount(amount).amountWithoutCommas : String(amount);
|
|
30
|
+
const isValidStringAmount = isStringFloat(stringAmount);
|
|
31
|
+
const isZero = new BigNumber(
|
|
32
|
+
isValidStringAmount ? stringAmount : "0"
|
|
33
|
+
).isEqualTo(0);
|
|
34
|
+
if (!isValidStringAmount || isZero) {
|
|
35
|
+
return /* @__PURE__ */ jsxs("span", { ...rest, className: mxClsx(className), children: [
|
|
36
|
+
prefix,
|
|
37
|
+
amount,
|
|
38
|
+
sufix
|
|
39
|
+
] });
|
|
40
|
+
}
|
|
41
|
+
const formattedAmount = decimals ? formatAmount({
|
|
42
|
+
digits,
|
|
43
|
+
decimals,
|
|
44
|
+
addCommas: true,
|
|
45
|
+
amount: stringAmount,
|
|
46
|
+
showLastNonZeroDecimal
|
|
47
|
+
}) : roundAmount(stringAmount, digits, true);
|
|
48
|
+
const bnAmount = new BigNumber(formattedAmount);
|
|
49
|
+
const bnTooltipThreshold = new BigNumber(tooltipThreshold);
|
|
50
|
+
const tooltipThresholdReached = bnAmount.isLessThan(bnTooltipThreshold);
|
|
51
|
+
if (shouldBePrecised && new BigNumber(formattedAmount).isLessThan(1)) {
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
53
|
+
PrecisedAmount,
|
|
54
|
+
{
|
|
55
|
+
...rest,
|
|
56
|
+
sufix,
|
|
57
|
+
prefix,
|
|
58
|
+
digits,
|
|
59
|
+
className,
|
|
60
|
+
amount: formattedAmount,
|
|
61
|
+
shouldShowTooltip
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
if (tooltipThresholdReached) {
|
|
66
|
+
const prefixWhenTooltip = prefix.includes("<") ? prefix : "< ";
|
|
67
|
+
return /* @__PURE__ */ jsx(
|
|
68
|
+
MxTooltip,
|
|
69
|
+
{
|
|
70
|
+
placement: tooltipPlacement,
|
|
71
|
+
buttonText: /* @__PURE__ */ jsxs("span", { ...rest, className: mxClsx("liq-max-w-fit", className), children: [
|
|
72
|
+
prefixWhenTooltip,
|
|
73
|
+
tooltipThreshold,
|
|
74
|
+
sufix
|
|
75
|
+
] }),
|
|
76
|
+
hideTooltip: !shouldShowTooltip,
|
|
77
|
+
children: formattedAmount
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
const truncatedAmount = shouldTruncate ? truncateAmount(formattedAmount) : formattedAmount;
|
|
82
|
+
return /* @__PURE__ */ jsxs("span", { ...rest, className: mxClsx(className), children: [
|
|
83
|
+
prefix,
|
|
84
|
+
shouldAnimate && !shouldTruncate ? /* @__PURE__ */ jsx(AnimateNumber, { ...rest, amount: formattedAmount }) : /* @__PURE__ */ jsx(Fragment, { children: truncatedAmount }),
|
|
85
|
+
sufix
|
|
86
|
+
] });
|
|
87
|
+
};
|
|
88
|
+
export {
|
|
89
|
+
DisplayAmount
|
|
90
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface AnimateNumberProps {
|
|
2
|
+
amount: string;
|
|
3
|
+
className?: string;
|
|
4
|
+
onClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const AnimateNumber: ({ amount, onClick, ...rest }: AnimateNumberProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
const AnimatedNumber = require("animated-number-react");
|
|
6
|
+
const require$$0 = require("react");
|
|
7
|
+
const reactjs_utils_getCleanStringAmount = require("../../../../utils/getCleanStringAmount.js");
|
|
8
|
+
const reactjs_utils_roundAmount = require("../../../../utils/roundAmount.js");
|
|
9
|
+
const AnimateNumber = ({
|
|
10
|
+
amount,
|
|
11
|
+
onClick,
|
|
12
|
+
...rest
|
|
13
|
+
}) => {
|
|
14
|
+
const [digits, setDigits] = require$$0.useState(0);
|
|
15
|
+
const [updateCount, setUpdateCount] = require$$0.useState(0);
|
|
16
|
+
const [valueToAnimate, setValueToAnimate] = require$$0.useState();
|
|
17
|
+
require$$0.useEffect(() => {
|
|
18
|
+
const { amountWithoutCommas, parts } = reactjs_utils_getCleanStringAmount.getCleanStringAmount(amount);
|
|
19
|
+
setUpdateCount((existing) => existing + 1);
|
|
20
|
+
setDigits(parts.length > 1 ? parts[1].length : 0);
|
|
21
|
+
const parsedAmount = parseFloat(amountWithoutCommas);
|
|
22
|
+
const isScientificNotation = parsedAmount.toString().includes("e");
|
|
23
|
+
setValueToAnimate(isScientificNotation ? void 0 : parsedAmount);
|
|
24
|
+
}, [amount]);
|
|
25
|
+
const formatValue = (val) => reactjs_utils_roundAmount.roundAmount(`${val}`, digits, true);
|
|
26
|
+
if (!valueToAnimate) {
|
|
27
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: amount });
|
|
28
|
+
}
|
|
29
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
30
|
+
AnimatedNumber,
|
|
31
|
+
{
|
|
32
|
+
value: valueToAnimate,
|
|
33
|
+
duration: updateCount > 1 ? 300 : 0,
|
|
34
|
+
formatValue,
|
|
35
|
+
onClick,
|
|
36
|
+
...rest
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
exports.AnimateNumber = AnimateNumber;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import AnimatedNumber from "animated-number-react";
|
|
3
|
+
import { useState, useEffect } from "react";
|
|
4
|
+
import { getCleanStringAmount } from "../../../../utils/getCleanStringAmount.mjs";
|
|
5
|
+
import { roundAmount } from "../../../../utils/roundAmount.mjs";
|
|
6
|
+
const AnimateNumber = ({
|
|
7
|
+
amount,
|
|
8
|
+
onClick,
|
|
9
|
+
...rest
|
|
10
|
+
}) => {
|
|
11
|
+
const [digits, setDigits] = useState(0);
|
|
12
|
+
const [updateCount, setUpdateCount] = useState(0);
|
|
13
|
+
const [valueToAnimate, setValueToAnimate] = useState();
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
const { amountWithoutCommas, parts } = getCleanStringAmount(amount);
|
|
16
|
+
setUpdateCount((existing) => existing + 1);
|
|
17
|
+
setDigits(parts.length > 1 ? parts[1].length : 0);
|
|
18
|
+
const parsedAmount = parseFloat(amountWithoutCommas);
|
|
19
|
+
const isScientificNotation = parsedAmount.toString().includes("e");
|
|
20
|
+
setValueToAnimate(isScientificNotation ? void 0 : parsedAmount);
|
|
21
|
+
}, [amount]);
|
|
22
|
+
const formatValue = (val) => roundAmount(`${val}`, digits, true);
|
|
23
|
+
if (!valueToAnimate) {
|
|
24
|
+
return /* @__PURE__ */ jsx(Fragment, { children: amount });
|
|
25
|
+
}
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
AnimatedNumber,
|
|
28
|
+
{
|
|
29
|
+
value: valueToAnimate,
|
|
30
|
+
duration: updateCount > 1 ? 300 : 0,
|
|
31
|
+
formatValue,
|
|
32
|
+
onClick,
|
|
33
|
+
...rest
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
AnimateNumber
|
|
39
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Placement } from 'react-joyride';
|
|
2
|
+
|
|
3
|
+
interface PrecisedAmountProps {
|
|
4
|
+
amount: string;
|
|
5
|
+
digits: number;
|
|
6
|
+
prefix: string;
|
|
7
|
+
sufix: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
shouldShowTooltip?: boolean;
|
|
10
|
+
tooltipPlacement?: Placement;
|
|
11
|
+
}
|
|
12
|
+
export declare const MAX_DISPLAY_ZERO_DECIMALS = 5;
|
|
13
|
+
export declare const PrecisedAmount: ({ amount, digits, className, prefix, sufix, tooltipPlacement, shouldShowTooltip, ...rest }: PrecisedAmountProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
const reactjs_utils_mxClsx = require("../../../../utils/mxClsx.js");
|
|
6
|
+
const reactjs_components_base_MxTooltip_MxTooltip = require("../../../base/MxTooltip/MxTooltip.js");
|
|
7
|
+
const MAX_DISPLAY_ZERO_DECIMALS = 5;
|
|
8
|
+
const PrecisedAmount = ({
|
|
9
|
+
amount,
|
|
10
|
+
digits,
|
|
11
|
+
className,
|
|
12
|
+
prefix,
|
|
13
|
+
sufix,
|
|
14
|
+
tooltipPlacement,
|
|
15
|
+
shouldShowTooltip = true,
|
|
16
|
+
...rest
|
|
17
|
+
}) => {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
const valueParts = (_a = String(amount)) == null ? void 0 : _a.split(".");
|
|
20
|
+
const decimalArray = ((_b = valueParts[1]) == null ? void 0 : _b.split("")) ?? [];
|
|
21
|
+
const areAllDigitsZeroes = decimalArray == null ? void 0 : decimalArray.every((digit) => digit === "0");
|
|
22
|
+
const firstNonZeroIndex = decimalArray == null ? void 0 : decimalArray.findIndex((digit) => digit !== "0");
|
|
23
|
+
const nonZeroDecimalsArr = [];
|
|
24
|
+
for (let i = firstNonZeroIndex; i <= (decimalArray == null ? void 0 : decimalArray.length) - 1; i++) {
|
|
25
|
+
if (nonZeroDecimalsArr.length < Math.max(digits, 2)) {
|
|
26
|
+
nonZeroDecimalsArr.push(decimalArray[i]);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (firstNonZeroIndex > MAX_DISPLAY_ZERO_DECIMALS) {
|
|
30
|
+
const nonZeroDecimals = nonZeroDecimalsArr == null ? void 0 : nonZeroDecimalsArr.join("");
|
|
31
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
32
|
+
reactjs_components_base_MxTooltip_MxTooltip.MxTooltip,
|
|
33
|
+
{
|
|
34
|
+
placement: tooltipPlacement,
|
|
35
|
+
buttonText: /* @__PURE__ */ jsxRuntime.jsxs("span", { ...rest, className: reactjs_utils_mxClsx.mxClsx(className), children: [
|
|
36
|
+
prefix,
|
|
37
|
+
valueParts[0],
|
|
38
|
+
".0",
|
|
39
|
+
/* @__PURE__ */ jsxRuntime.jsx("sub", { className: reactjs_utils_mxClsx.mxClsx(className, "liq-text-[60%]"), children: firstNonZeroIndex - 2 }),
|
|
40
|
+
"0",
|
|
41
|
+
nonZeroDecimals,
|
|
42
|
+
sufix
|
|
43
|
+
] }),
|
|
44
|
+
containerClassName: "leading-none",
|
|
45
|
+
hideTooltip: !shouldShowTooltip,
|
|
46
|
+
children: amount
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
const hasDecimals = valueParts[1] && !areAllDigitsZeroes;
|
|
51
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { ...rest, className: reactjs_utils_mxClsx.mxClsx(className), children: [
|
|
52
|
+
prefix,
|
|
53
|
+
valueParts[0],
|
|
54
|
+
hasDecimals && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
55
|
+
".",
|
|
56
|
+
valueParts[1]
|
|
57
|
+
] }),
|
|
58
|
+
sufix
|
|
59
|
+
] });
|
|
60
|
+
};
|
|
61
|
+
exports.MAX_DISPLAY_ZERO_DECIMALS = MAX_DISPLAY_ZERO_DECIMALS;
|
|
62
|
+
exports.PrecisedAmount = PrecisedAmount;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { mxClsx } from "../../../../utils/mxClsx.mjs";
|
|
3
|
+
import { MxTooltip } from "../../../base/MxTooltip/MxTooltip.mjs";
|
|
4
|
+
const MAX_DISPLAY_ZERO_DECIMALS = 5;
|
|
5
|
+
const PrecisedAmount = ({
|
|
6
|
+
amount,
|
|
7
|
+
digits,
|
|
8
|
+
className,
|
|
9
|
+
prefix,
|
|
10
|
+
sufix,
|
|
11
|
+
tooltipPlacement,
|
|
12
|
+
shouldShowTooltip = true,
|
|
13
|
+
...rest
|
|
14
|
+
}) => {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
const valueParts = (_a = String(amount)) == null ? void 0 : _a.split(".");
|
|
17
|
+
const decimalArray = ((_b = valueParts[1]) == null ? void 0 : _b.split("")) ?? [];
|
|
18
|
+
const areAllDigitsZeroes = decimalArray == null ? void 0 : decimalArray.every((digit) => digit === "0");
|
|
19
|
+
const firstNonZeroIndex = decimalArray == null ? void 0 : decimalArray.findIndex((digit) => digit !== "0");
|
|
20
|
+
const nonZeroDecimalsArr = [];
|
|
21
|
+
for (let i = firstNonZeroIndex; i <= (decimalArray == null ? void 0 : decimalArray.length) - 1; i++) {
|
|
22
|
+
if (nonZeroDecimalsArr.length < Math.max(digits, 2)) {
|
|
23
|
+
nonZeroDecimalsArr.push(decimalArray[i]);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (firstNonZeroIndex > MAX_DISPLAY_ZERO_DECIMALS) {
|
|
27
|
+
const nonZeroDecimals = nonZeroDecimalsArr == null ? void 0 : nonZeroDecimalsArr.join("");
|
|
28
|
+
return /* @__PURE__ */ jsx(
|
|
29
|
+
MxTooltip,
|
|
30
|
+
{
|
|
31
|
+
placement: tooltipPlacement,
|
|
32
|
+
buttonText: /* @__PURE__ */ jsxs("span", { ...rest, className: mxClsx(className), children: [
|
|
33
|
+
prefix,
|
|
34
|
+
valueParts[0],
|
|
35
|
+
".0",
|
|
36
|
+
/* @__PURE__ */ jsx("sub", { className: mxClsx(className, "liq-text-[60%]"), children: firstNonZeroIndex - 2 }),
|
|
37
|
+
"0",
|
|
38
|
+
nonZeroDecimals,
|
|
39
|
+
sufix
|
|
40
|
+
] }),
|
|
41
|
+
containerClassName: "leading-none",
|
|
42
|
+
hideTooltip: !shouldShowTooltip,
|
|
43
|
+
children: amount
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
const hasDecimals = valueParts[1] && !areAllDigitsZeroes;
|
|
48
|
+
return /* @__PURE__ */ jsxs("span", { ...rest, className: mxClsx(className), children: [
|
|
49
|
+
prefix,
|
|
50
|
+
valueParts[0],
|
|
51
|
+
hasDecimals && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
52
|
+
".",
|
|
53
|
+
valueParts[1]
|
|
54
|
+
] }),
|
|
55
|
+
sufix
|
|
56
|
+
] });
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
MAX_DISPLAY_ZERO_DECIMALS,
|
|
60
|
+
PrecisedAmount
|
|
61
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DisplayAmount';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const reactjs_components_DisplayAmount_DisplayAmount = require("./DisplayAmount.js");
|
|
5
|
+
exports.DisplayAmount = reactjs_components_DisplayAmount_DisplayAmount.DisplayAmount;
|