@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,23 @@
|
|
|
1
|
+
import { formatAmount as formatAmount$1 } from "@multiversx/sdk-dapp-utils/out/helpers/formatAmount";
|
|
2
|
+
import { stringIsInteger } from "@multiversx/sdk-dapp-utils/out/helpers/stringIsInteger";
|
|
3
|
+
import { roundAmount } from "./roundAmount.mjs";
|
|
4
|
+
const formatAmount = ({
|
|
5
|
+
amount = "0",
|
|
6
|
+
decimals = 0,
|
|
7
|
+
addCommas = false,
|
|
8
|
+
digits = 4,
|
|
9
|
+
showLastNonZeroDecimal = true
|
|
10
|
+
}) => {
|
|
11
|
+
if (amount == null || amount === "0" || !stringIsInteger(amount, false)) {
|
|
12
|
+
return "0";
|
|
13
|
+
}
|
|
14
|
+
const formattedAmount = formatAmount$1({
|
|
15
|
+
decimals,
|
|
16
|
+
input: amount,
|
|
17
|
+
showLastNonZeroDecimal
|
|
18
|
+
});
|
|
19
|
+
return roundAmount(formattedAmount, digits, addCommas);
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
formatAmount
|
|
23
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const bignumber = require("../../bignumber-B8vjg9qn.js");
|
|
5
|
+
const reactjs_utils_removeCommas = require("./removeCommas.js");
|
|
6
|
+
const getCleanStringAmount = (amount) => {
|
|
7
|
+
const amountWithoutCommas = reactjs_utils_removeCommas.removeCommas(amount);
|
|
8
|
+
const validFloatString = new bignumber.BigNumber(amountWithoutCommas).toString(10);
|
|
9
|
+
const parts = validFloatString.split(".");
|
|
10
|
+
return { amountWithoutCommas, parts };
|
|
11
|
+
};
|
|
12
|
+
exports.getCleanStringAmount = getCleanStringAmount;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { B as BigNumber } from "../../bignumber-CKZkoo0g.mjs";
|
|
2
|
+
import { removeCommas } from "./removeCommas.mjs";
|
|
3
|
+
const getCleanStringAmount = (amount) => {
|
|
4
|
+
const amountWithoutCommas = removeCommas(amount);
|
|
5
|
+
const validFloatString = new BigNumber(amountWithoutCommas).toString(10);
|
|
6
|
+
const parts = validFloatString.split(".");
|
|
7
|
+
return { amountWithoutCommas, parts };
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
getCleanStringAmount
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getCompletePathname: () => string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const reactjs_constants_index = require("../constants/index.js");
|
|
5
|
+
const getCompletePathname = () => `${reactjs_constants_index.safeWindow.location.pathname}${reactjs_constants_index.safeWindow.location.search}`;
|
|
6
|
+
exports.getCompletePathname = getCompletePathname;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const reactjs_constants_index = require("../constants/index.js");
|
|
5
|
+
const getInitialTokens = () => {
|
|
6
|
+
const urlParams = new URLSearchParams(reactjs_constants_index.safeWindow.location.search);
|
|
7
|
+
const { firstToken, secondToken } = Object.fromEntries(urlParams);
|
|
8
|
+
return {
|
|
9
|
+
firstTokenId: firstToken,
|
|
10
|
+
secondTokenId: secondToken
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
exports.getInitialTokens = getInitialTokens;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { safeWindow } from "../constants/index.mjs";
|
|
2
|
+
const getInitialTokens = () => {
|
|
3
|
+
const urlParams = new URLSearchParams(safeWindow.location.search);
|
|
4
|
+
const { firstToken, secondToken } = Object.fromEntries(urlParams);
|
|
5
|
+
return {
|
|
6
|
+
firstTokenId: firstToken,
|
|
7
|
+
secondTokenId: secondToken
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
getInitialTokens
|
|
12
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const parseAmount = require("@multiversx/sdk-dapp-utils/out/helpers/parseAmount");
|
|
5
|
+
const bignumber = require("../../bignumber-B8vjg9qn.js");
|
|
6
|
+
const reactjs_utils_testNumber = require("./testNumber.js");
|
|
7
|
+
function hasEnoughFunds({
|
|
8
|
+
balance,
|
|
9
|
+
amount,
|
|
10
|
+
decimals
|
|
11
|
+
}) {
|
|
12
|
+
const isNumber = reactjs_utils_testNumber.testNumber(amount);
|
|
13
|
+
const bnBalance = new bignumber.BigNumber(balance);
|
|
14
|
+
const bnAmount = new bignumber.BigNumber(
|
|
15
|
+
parseAmount.parseAmount(isNumber ? amount : "0", decimals)
|
|
16
|
+
);
|
|
17
|
+
const notEnough = !bnBalance.isNegative() && bnBalance.lt(bnAmount);
|
|
18
|
+
return !notEnough;
|
|
19
|
+
}
|
|
20
|
+
exports.hasEnoughFunds = hasEnoughFunds;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { parseAmount } from "@multiversx/sdk-dapp-utils/out/helpers/parseAmount";
|
|
2
|
+
import { B as BigNumber } from "../../bignumber-CKZkoo0g.mjs";
|
|
3
|
+
import { testNumber } from "./testNumber.mjs";
|
|
4
|
+
function hasEnoughFunds({
|
|
5
|
+
balance,
|
|
6
|
+
amount,
|
|
7
|
+
decimals
|
|
8
|
+
}) {
|
|
9
|
+
const isNumber = testNumber(amount);
|
|
10
|
+
const bnBalance = new BigNumber(balance);
|
|
11
|
+
const bnAmount = new BigNumber(
|
|
12
|
+
parseAmount(isNumber ? amount : "0", decimals)
|
|
13
|
+
);
|
|
14
|
+
const notEnough = !bnBalance.isNegative() && bnBalance.lt(bnAmount);
|
|
15
|
+
return !notEnough;
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
hasEnoughFunds
|
|
19
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './delay';
|
|
2
|
+
export * from './formatAmount';
|
|
3
|
+
export * from './getCleanStringAmount';
|
|
4
|
+
export * from './getCompletePathname';
|
|
5
|
+
export * from './getInitialTokens';
|
|
6
|
+
export * from './hasEnoughFunds';
|
|
7
|
+
export * from './isStringFloat';
|
|
8
|
+
export * from './mxClsx';
|
|
9
|
+
export * from './pipe';
|
|
10
|
+
export * from './removeCommas';
|
|
11
|
+
export * from './roundAmount';
|
|
12
|
+
export * from './testNumber';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const reactjs_utils_delay = require("./delay.js");
|
|
5
|
+
const reactjs_utils_formatAmount = require("./formatAmount.js");
|
|
6
|
+
const reactjs_utils_getCleanStringAmount = require("./getCleanStringAmount.js");
|
|
7
|
+
const reactjs_utils_getCompletePathname = require("./getCompletePathname.js");
|
|
8
|
+
const reactjs_utils_getInitialTokens = require("./getInitialTokens.js");
|
|
9
|
+
const reactjs_utils_hasEnoughFunds = require("./hasEnoughFunds.js");
|
|
10
|
+
const reactjs_utils_isStringFloat = require("./isStringFloat.js");
|
|
11
|
+
const reactjs_utils_mxClsx = require("./mxClsx.js");
|
|
12
|
+
const reactjs_utils_pipe = require("./pipe.js");
|
|
13
|
+
const reactjs_utils_removeCommas = require("./removeCommas.js");
|
|
14
|
+
const reactjs_utils_roundAmount = require("./roundAmount.js");
|
|
15
|
+
const reactjs_utils_testNumber = require("./testNumber.js");
|
|
16
|
+
exports.delay = reactjs_utils_delay.delay;
|
|
17
|
+
exports.formatAmount = reactjs_utils_formatAmount.formatAmount;
|
|
18
|
+
exports.getCleanStringAmount = reactjs_utils_getCleanStringAmount.getCleanStringAmount;
|
|
19
|
+
exports.getCompletePathname = reactjs_utils_getCompletePathname.getCompletePathname;
|
|
20
|
+
exports.getInitialTokens = reactjs_utils_getInitialTokens.getInitialTokens;
|
|
21
|
+
exports.hasEnoughFunds = reactjs_utils_hasEnoughFunds.hasEnoughFunds;
|
|
22
|
+
exports.isStringFloat = reactjs_utils_isStringFloat.isStringFloat;
|
|
23
|
+
exports.mxClsx = reactjs_utils_mxClsx.mxClsx;
|
|
24
|
+
exports.pipe = reactjs_utils_pipe.pipe;
|
|
25
|
+
exports.removeCommas = reactjs_utils_removeCommas.removeCommas;
|
|
26
|
+
exports.roundAmount = reactjs_utils_roundAmount.roundAmount;
|
|
27
|
+
exports.testNumber = reactjs_utils_testNumber.testNumber;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { delay } from "./delay.mjs";
|
|
2
|
+
import { formatAmount } from "./formatAmount.mjs";
|
|
3
|
+
import { getCleanStringAmount } from "./getCleanStringAmount.mjs";
|
|
4
|
+
import { getCompletePathname } from "./getCompletePathname.mjs";
|
|
5
|
+
import { getInitialTokens } from "./getInitialTokens.mjs";
|
|
6
|
+
import { hasEnoughFunds } from "./hasEnoughFunds.mjs";
|
|
7
|
+
import { isStringFloat } from "./isStringFloat.mjs";
|
|
8
|
+
import { mxClsx } from "./mxClsx.mjs";
|
|
9
|
+
import { pipe } from "./pipe.mjs";
|
|
10
|
+
import { removeCommas } from "./removeCommas.mjs";
|
|
11
|
+
import { roundAmount } from "./roundAmount.mjs";
|
|
12
|
+
import { testNumber } from "./testNumber.mjs";
|
|
13
|
+
export {
|
|
14
|
+
delay,
|
|
15
|
+
formatAmount,
|
|
16
|
+
getCleanStringAmount,
|
|
17
|
+
getCompletePathname,
|
|
18
|
+
getInitialTokens,
|
|
19
|
+
hasEnoughFunds,
|
|
20
|
+
isStringFloat,
|
|
21
|
+
mxClsx,
|
|
22
|
+
pipe,
|
|
23
|
+
removeCommas,
|
|
24
|
+
roundAmount,
|
|
25
|
+
testNumber
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isStringFloat: (amount: string) => boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const bignumber = require("../../bignumber-B8vjg9qn.js");
|
|
5
|
+
const isStringFloat = (amount) => {
|
|
6
|
+
if (amount.match(/^-*[0-9]*\.?[0-9]*$/) === null) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
if (isNaN(parseFloat(amount))) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
let [wholes, decimals] = amount.split(".");
|
|
13
|
+
if (decimals) {
|
|
14
|
+
while (decimals.charAt(decimals.length - 1) === "0") {
|
|
15
|
+
decimals = decimals.slice(0, -1);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const number = decimals ? [wholes, decimals].join(".") : wholes;
|
|
19
|
+
const bNparsed = new bignumber.BigNumber(number);
|
|
20
|
+
return bNparsed.toFixed() === number;
|
|
21
|
+
};
|
|
22
|
+
exports.isStringFloat = isStringFloat;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { B as BigNumber } from "../../bignumber-CKZkoo0g.mjs";
|
|
2
|
+
const isStringFloat = (amount) => {
|
|
3
|
+
if (amount.match(/^-*[0-9]*\.?[0-9]*$/) === null) {
|
|
4
|
+
return false;
|
|
5
|
+
}
|
|
6
|
+
if (isNaN(parseFloat(amount))) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
let [wholes, decimals] = amount.split(".");
|
|
10
|
+
if (decimals) {
|
|
11
|
+
while (decimals.charAt(decimals.length - 1) === "0") {
|
|
12
|
+
decimals = decimals.slice(0, -1);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
const number = decimals ? [wholes, decimals].join(".") : wholes;
|
|
16
|
+
const bNparsed = new BigNumber(number);
|
|
17
|
+
return bNparsed.toFixed() === number;
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
isStringFloat
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const tailwindMerge = require("tailwind-merge");
|
|
5
|
+
function r(e) {
|
|
6
|
+
var t, f, n = "";
|
|
7
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
8
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
9
|
+
var o = e.length;
|
|
10
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
11
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
12
|
+
return n;
|
|
13
|
+
}
|
|
14
|
+
function clsx() {
|
|
15
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
16
|
+
return n;
|
|
17
|
+
}
|
|
18
|
+
const mxClsx = (...inputs) => {
|
|
19
|
+
return tailwindMerge.twMerge(clsx(inputs));
|
|
20
|
+
};
|
|
21
|
+
exports.mxClsx = mxClsx;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { twMerge } from "tailwind-merge";
|
|
2
|
+
function r(e) {
|
|
3
|
+
var t, f, n = "";
|
|
4
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
5
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
6
|
+
var o = e.length;
|
|
7
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
8
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
9
|
+
return n;
|
|
10
|
+
}
|
|
11
|
+
function clsx() {
|
|
12
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
13
|
+
return n;
|
|
14
|
+
}
|
|
15
|
+
const mxClsx = (...inputs) => {
|
|
16
|
+
return twMerge(clsx(inputs));
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
mxClsx
|
|
20
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function pipe<ValueType>(previous: ValueType): {
|
|
2
|
+
if: (condition: boolean) => {
|
|
3
|
+
then: (newValue: ValueType | ((prop: ValueType) => ValueType)) => /*elided*/ any;
|
|
4
|
+
};
|
|
5
|
+
then: (newValue: ValueType | ((prop: ValueType) => ValueType)) => /*elided*/ any;
|
|
6
|
+
valueOf: () => ValueType;
|
|
7
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
function pipe(previous) {
|
|
5
|
+
return {
|
|
6
|
+
if: function(condition) {
|
|
7
|
+
if (condition) {
|
|
8
|
+
return {
|
|
9
|
+
then: (newValue) => (
|
|
10
|
+
// if a callback is passed, callback is executed with previous value
|
|
11
|
+
newValue instanceof Function ? pipe(newValue(previous)) : pipe(newValue)
|
|
12
|
+
)
|
|
13
|
+
};
|
|
14
|
+
} else {
|
|
15
|
+
return {
|
|
16
|
+
then: () => pipe(previous)
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
then: (newValue) => newValue instanceof Function ? pipe(newValue(previous)) : pipe(newValue),
|
|
21
|
+
valueOf: function() {
|
|
22
|
+
return previous;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
exports.pipe = pipe;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function pipe(previous) {
|
|
2
|
+
return {
|
|
3
|
+
if: function(condition) {
|
|
4
|
+
if (condition) {
|
|
5
|
+
return {
|
|
6
|
+
then: (newValue) => (
|
|
7
|
+
// if a callback is passed, callback is executed with previous value
|
|
8
|
+
newValue instanceof Function ? pipe(newValue(previous)) : pipe(newValue)
|
|
9
|
+
)
|
|
10
|
+
};
|
|
11
|
+
} else {
|
|
12
|
+
return {
|
|
13
|
+
then: () => pipe(previous)
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
then: (newValue) => newValue instanceof Function ? pipe(newValue(previous)) : pipe(newValue),
|
|
18
|
+
valueOf: function() {
|
|
19
|
+
return previous;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
pipe
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const removeCommas: (amount: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const roundAmount: (amount: string, digits?: number, addCommas?: boolean) => string;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const bignumber = require("../../bignumber-B8vjg9qn.js");
|
|
5
|
+
const reactjs_utils_isStringFloat = require("./isStringFloat.js");
|
|
6
|
+
const roundAmount = (amount, digits, addCommas) => {
|
|
7
|
+
const digitsToUse = digits ?? 4;
|
|
8
|
+
const cleanAmount = reactjs_utils_isStringFloat.isStringFloat(amount) ? amount : "0";
|
|
9
|
+
const bnAmount = new bignumber.BigNumber(cleanAmount);
|
|
10
|
+
if (bnAmount.isZero()) {
|
|
11
|
+
return "0";
|
|
12
|
+
}
|
|
13
|
+
if (bnAmount.isInteger()) {
|
|
14
|
+
return addCommas ? bnAmount.toFormat(digitsToUse, bignumber.BigNumber.ROUND_FLOOR) : bnAmount.toFixed(digitsToUse);
|
|
15
|
+
}
|
|
16
|
+
const numStr = bnAmount.toFixed();
|
|
17
|
+
const [intPart, decPart] = numStr.split(".");
|
|
18
|
+
if (!decPart) {
|
|
19
|
+
return intPart;
|
|
20
|
+
}
|
|
21
|
+
let nonZeroCount = 0;
|
|
22
|
+
let resultDecPart = "";
|
|
23
|
+
for (let i = 0; i < decPart.length; i++) {
|
|
24
|
+
if (digitsToUse === 0) {
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
resultDecPart += decPart[i];
|
|
28
|
+
if (decPart[i] !== "0" || nonZeroCount > 0) {
|
|
29
|
+
nonZeroCount++;
|
|
30
|
+
}
|
|
31
|
+
if (nonZeroCount === digitsToUse) {
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
let resultIntPart = intPart;
|
|
36
|
+
if (addCommas) {
|
|
37
|
+
resultIntPart = new bignumber.BigNumber(intPart).toFormat(0, bignumber.BigNumber.ROUND_FLOOR);
|
|
38
|
+
}
|
|
39
|
+
return resultIntPart + (resultDecPart ? "." + resultDecPart : "");
|
|
40
|
+
};
|
|
41
|
+
exports.roundAmount = roundAmount;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { B as BigNumber } from "../../bignumber-CKZkoo0g.mjs";
|
|
2
|
+
import { isStringFloat } from "./isStringFloat.mjs";
|
|
3
|
+
const roundAmount = (amount, digits, addCommas) => {
|
|
4
|
+
const digitsToUse = digits ?? 4;
|
|
5
|
+
const cleanAmount = isStringFloat(amount) ? amount : "0";
|
|
6
|
+
const bnAmount = new BigNumber(cleanAmount);
|
|
7
|
+
if (bnAmount.isZero()) {
|
|
8
|
+
return "0";
|
|
9
|
+
}
|
|
10
|
+
if (bnAmount.isInteger()) {
|
|
11
|
+
return addCommas ? bnAmount.toFormat(digitsToUse, BigNumber.ROUND_FLOOR) : bnAmount.toFixed(digitsToUse);
|
|
12
|
+
}
|
|
13
|
+
const numStr = bnAmount.toFixed();
|
|
14
|
+
const [intPart, decPart] = numStr.split(".");
|
|
15
|
+
if (!decPart) {
|
|
16
|
+
return intPart;
|
|
17
|
+
}
|
|
18
|
+
let nonZeroCount = 0;
|
|
19
|
+
let resultDecPart = "";
|
|
20
|
+
for (let i = 0; i < decPart.length; i++) {
|
|
21
|
+
if (digitsToUse === 0) {
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
resultDecPart += decPart[i];
|
|
25
|
+
if (decPart[i] !== "0" || nonZeroCount > 0) {
|
|
26
|
+
nonZeroCount++;
|
|
27
|
+
}
|
|
28
|
+
if (nonZeroCount === digitsToUse) {
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
let resultIntPart = intPart;
|
|
33
|
+
if (addCommas) {
|
|
34
|
+
resultIntPart = new BigNumber(intPart).toFormat(0, BigNumber.ROUND_FLOOR);
|
|
35
|
+
}
|
|
36
|
+
return resultIntPart + (resultDecPart ? "." + resultDecPart : "");
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
roundAmount
|
|
40
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const testNumber: (value?: string) => boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class InMemoryStore {
|
|
2
|
+
private static instance;
|
|
3
|
+
private store;
|
|
4
|
+
private constructor();
|
|
5
|
+
static getInstance(): InMemoryStore;
|
|
6
|
+
setItem(key: string, value: string): void;
|
|
7
|
+
getItem(key: string): string | null;
|
|
8
|
+
removeItem(key: string): void;
|
|
9
|
+
clear(): void;
|
|
10
|
+
get length(): number;
|
|
11
|
+
key(index: number): string | null;
|
|
12
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
|
+
const _InMemoryStore = class _InMemoryStore {
|
|
8
|
+
constructor() {
|
|
9
|
+
__publicField(this, "store");
|
|
10
|
+
this.store = {};
|
|
11
|
+
}
|
|
12
|
+
static getInstance() {
|
|
13
|
+
if (!_InMemoryStore.instance) {
|
|
14
|
+
_InMemoryStore.instance = new _InMemoryStore();
|
|
15
|
+
}
|
|
16
|
+
return _InMemoryStore.instance;
|
|
17
|
+
}
|
|
18
|
+
setItem(key, value) {
|
|
19
|
+
this.store[key] = value;
|
|
20
|
+
}
|
|
21
|
+
getItem(key) {
|
|
22
|
+
return this.store.hasOwnProperty(key) ? this.store[key] : null;
|
|
23
|
+
}
|
|
24
|
+
removeItem(key) {
|
|
25
|
+
delete this.store[key];
|
|
26
|
+
}
|
|
27
|
+
clear() {
|
|
28
|
+
this.store = {};
|
|
29
|
+
}
|
|
30
|
+
get length() {
|
|
31
|
+
return Object.keys(this.store).length;
|
|
32
|
+
}
|
|
33
|
+
key(index) {
|
|
34
|
+
const keys = Object.keys(this.store);
|
|
35
|
+
return keys[index] || null;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
__publicField(_InMemoryStore, "instance");
|
|
39
|
+
let InMemoryStore = _InMemoryStore;
|
|
40
|
+
exports.InMemoryStore = InMemoryStore;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
const _InMemoryStore = class _InMemoryStore {
|
|
5
|
+
constructor() {
|
|
6
|
+
__publicField(this, "store");
|
|
7
|
+
this.store = {};
|
|
8
|
+
}
|
|
9
|
+
static getInstance() {
|
|
10
|
+
if (!_InMemoryStore.instance) {
|
|
11
|
+
_InMemoryStore.instance = new _InMemoryStore();
|
|
12
|
+
}
|
|
13
|
+
return _InMemoryStore.instance;
|
|
14
|
+
}
|
|
15
|
+
setItem(key, value) {
|
|
16
|
+
this.store[key] = value;
|
|
17
|
+
}
|
|
18
|
+
getItem(key) {
|
|
19
|
+
return this.store.hasOwnProperty(key) ? this.store[key] : null;
|
|
20
|
+
}
|
|
21
|
+
removeItem(key) {
|
|
22
|
+
delete this.store[key];
|
|
23
|
+
}
|
|
24
|
+
clear() {
|
|
25
|
+
this.store = {};
|
|
26
|
+
}
|
|
27
|
+
get length() {
|
|
28
|
+
return Object.keys(this.store).length;
|
|
29
|
+
}
|
|
30
|
+
key(index) {
|
|
31
|
+
const keys = Object.keys(this.store);
|
|
32
|
+
return keys[index] || null;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
__publicField(_InMemoryStore, "instance");
|
|
36
|
+
let InMemoryStore = _InMemoryStore;
|
|
37
|
+
export {
|
|
38
|
+
InMemoryStore
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/types/index.d.ts
ADDED
package/types/index.js
ADDED
package/types/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/types/rate.d.ts
ADDED
package/types/rate.js
ADDED