@multiversx/sdk-dapp-liquidity 0.2.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +186 -0
- package/all-networks-EJIVYZ_i.mjs +4 -0
- package/all-networks-NYACMyeN.js +4 -0
- package/api/confirmRate.d.ts +11 -0
- package/api/confirmRate.js +30 -0
- package/api/confirmRate.mjs +29 -0
- package/api/getChains.d.ts +6 -0
- package/api/getChains.js +12 -0
- package/api/getChains.mjs +11 -0
- package/api/getRate.d.ts +10 -0
- package/api/getRate.js +28 -0
- package/api/getRate.mjs +27 -0
- package/api/getTokens.d.ts +7 -0
- package/api/getTokens.js +14 -0
- package/api/getTokens.mjs +13 -0
- package/api/getTokensBalances.d.ts +8 -0
- package/api/getTokensBalances.js +17 -0
- package/api/getTokensBalances.mjs +16 -0
- package/api/getTransactions.d.ts +7 -0
- package/api/getTransactions.js +14 -0
- package/api/getTransactions.mjs +13 -0
- package/api/index.d.ts +7 -0
- package/api/index.js +17 -0
- package/api/index.mjs +16 -0
- package/api/sendTransactions.d.ts +11 -0
- package/api/sendTransactions.js +29 -0
- package/api/sendTransactions.mjs +28 -0
- package/api/tests/confirmRate.spec.d.ts +1 -0
- package/api/tests/confirmRate.spec.js +124 -0
- package/api/tests/confirmRate.spec.mjs +122 -0
- package/api/tests/getChains.spec.d.ts +1 -0
- package/api/tests/getChains.spec.js +37 -0
- package/api/tests/getChains.spec.mjs +35 -0
- package/api/tests/getRate.spec.d.ts +1 -0
- package/api/tests/getRate.spec.js +83 -0
- package/api/tests/getRate.spec.mjs +81 -0
- package/api/tests/getTokens.spec.d.ts +1 -0
- package/api/tests/getTokens.spec.js +60 -0
- package/api/tests/getTokens.spec.mjs +58 -0
- package/api/tests/getTransactions.spec.d.ts +1 -0
- package/api/tests/getTransactions.spec.js +89 -0
- package/api/tests/getTransactions.spec.mjs +87 -0
- package/api/tests/sendTransactions.spec.d.ts +1 -0
- package/api/tests/sendTransactions.spec.js +83 -0
- package/api/tests/sendTransactions.spec.mjs +81 -0
- package/bignumber-B8vjg9qn.js +1334 -0
- package/bignumber-CKZkoo0g.mjs +1334 -0
- package/constants/index.d.ts +1 -0
- package/constants/index.js +5 -0
- package/constants/index.mjs +4 -0
- package/default-BYtXv70Z.mjs +4 -0
- package/default-H3AbmzFV.js +4 -0
- package/dto/Chain.dto.d.ts +16 -0
- package/dto/Chain.dto.js +2 -0
- package/dto/Chain.dto.mjs +1 -0
- package/dto/ConfirmRate.dto.d.ts +11 -0
- package/dto/ConfirmRate.dto.js +2 -0
- package/dto/ConfirmRate.dto.mjs +1 -0
- package/dto/Token.dto.d.ts +14 -0
- package/dto/Token.dto.js +2 -0
- package/dto/Token.dto.mjs +1 -0
- package/dto/TokenBalance.dto.d.ts +4 -0
- package/dto/TokenBalance.dto.js +2 -0
- package/dto/TokenBalance.dto.mjs +1 -0
- package/dto/Transaction.dto.d.ts +14 -0
- package/dto/Transaction.dto.js +2 -0
- package/dto/Transaction.dto.mjs +1 -0
- package/dto/index.d.ts +5 -0
- package/dto/index.js +2 -0
- package/dto/index.mjs +1 -0
- package/helpers/base64Utils.d.ts +3 -0
- package/helpers/base64Utils.js +32 -0
- package/helpers/base64Utils.mjs +31 -0
- package/helpers/decodeLoginToken.d.ts +9 -0
- package/helpers/decodeLoginToken.js +28 -0
- package/helpers/decodeLoginToken.mjs +27 -0
- package/helpers/decodeToken.d.ts +11 -0
- package/helpers/decodeToken.js +40 -0
- package/helpers/decodeToken.mjs +39 -0
- package/helpers/getApiURL.d.ts +1 -0
- package/helpers/getApiURL.js +8 -0
- package/helpers/getApiURL.mjs +7 -0
- package/helpers/getBridgeURL.d.ts +1 -0
- package/helpers/getBridgeURL.js +8 -0
- package/helpers/getBridgeURL.mjs +7 -0
- package/helpers/getMvxApiURL.d.ts +1 -0
- package/helpers/getMvxApiURL.js +8 -0
- package/helpers/getMvxApiURL.mjs +7 -0
- package/helpers/getMvxChainId.d.ts +1 -0
- package/helpers/getMvxChainId.js +8 -0
- package/helpers/getMvxChainId.mjs +7 -0
- package/helpers/getMvxExplorerAddress.d.ts +1 -0
- package/helpers/getMvxExplorerAddress.js +8 -0
- package/helpers/getMvxExplorerAddress.mjs +7 -0
- package/helpers/index.d.ts +9 -0
- package/helpers/index.js +23 -0
- package/helpers/index.mjs +22 -0
- package/helpers/serializeTransaction.d.ts +3 -0
- package/helpers/serializeTransaction.js +9 -0
- package/helpers/serializeTransaction.mjs +8 -0
- package/helpers/tests/base64Utils.spec.d.ts +1 -0
- package/helpers/tests/base64Utils.spec.js +30 -0
- package/helpers/tests/base64Utils.spec.mjs +28 -0
- package/helpers/tests/decodeLoginToken.spec.d.ts +1 -0
- package/helpers/tests/decodeLoginToken.spec.js +35 -0
- package/helpers/tests/decodeLoginToken.spec.mjs +33 -0
- package/helpers/tests/decodeToken.spec.d.ts +1 -0
- package/helpers/tests/decodeToken.spec.js +28 -0
- package/helpers/tests/decodeToken.spec.mjs +26 -0
- package/index-B9WqxUXM.mjs +91 -0
- package/index-BXwpbIDQ.mjs +107 -0
- package/index-CnudU77V.js +329 -0
- package/index-DSnomXRI.mjs +68025 -0
- package/index-DZHiA1sX.js +107 -0
- package/index-cvy2-uZ_.js +67946 -0
- package/index.d.ts +6 -0
- package/index.js +189 -0
- package/index.mjs +185 -0
- package/package.json +107 -0
- package/react-B9sQBOh0.mjs +3040 -0
- package/react-BaXyw3AO.js +3040 -0
- package/react-CNXJSTCv.js +38 -0
- package/react-CSQpf1zk.mjs +38 -0
- package/reactjs/components/AccountAddress/AccountAddress.d.ts +6 -0
- package/reactjs/components/AccountAddress/AccountAddress.js +25 -0
- package/reactjs/components/AccountAddress/AccountAddress.mjs +24 -0
- package/reactjs/components/AccountAddress/index.d.ts +1 -0
- package/reactjs/components/AccountAddress/index.js +5 -0
- package/reactjs/components/AccountAddress/index.mjs +4 -0
- package/reactjs/components/AmountCard/AmountCard.d.ts +6 -0
- package/reactjs/components/AmountCard/AmountCard.js +33 -0
- package/reactjs/components/AmountCard/AmountCard.mjs +32 -0
- package/reactjs/components/AmountCard/index.d.ts +1 -0
- package/reactjs/components/AmountCard/index.js +5 -0
- package/reactjs/components/AmountCard/index.mjs +4 -0
- package/reactjs/components/AmountInput/AmountInput.d.ts +13 -0
- package/reactjs/components/AmountInput/AmountInput.js +61 -0
- package/reactjs/components/AmountInput/AmountInput.mjs +60 -0
- package/reactjs/components/AmountInput/index.d.ts +1 -0
- package/reactjs/components/AmountInput/index.js +5 -0
- package/reactjs/components/AmountInput/index.mjs +4 -0
- package/reactjs/components/BridgeForm/BridgeForm.d.ts +16 -0
- package/reactjs/components/BridgeForm/BridgeForm.js +680 -0
- package/reactjs/components/BridgeForm/BridgeForm.mjs +679 -0
- package/reactjs/components/BridgeForm/index.d.ts +1 -0
- package/reactjs/components/BridgeForm/index.js +5 -0
- package/reactjs/components/BridgeForm/index.mjs +4 -0
- package/reactjs/components/BridgeHistory/BridgeHistory.d.ts +4 -0
- package/reactjs/components/BridgeHistory/BridgeHistory.js +233 -0
- package/reactjs/components/BridgeHistory/BridgeHistory.mjs +232 -0
- package/reactjs/components/BridgeHistory/index.d.ts +1 -0
- package/reactjs/components/BridgeHistory/index.js +5 -0
- package/reactjs/components/BridgeHistory/index.mjs +4 -0
- package/reactjs/components/Connect/BridgeAccountDisplay.d.ts +6 -0
- package/reactjs/components/Connect/BridgeAccountDisplay.js +85 -0
- package/reactjs/components/Connect/BridgeAccountDisplay.mjs +84 -0
- package/reactjs/components/Connect/BridgeConnectButton.d.ts +7 -0
- package/reactjs/components/Connect/BridgeConnectButton.js +26 -0
- package/reactjs/components/Connect/BridgeConnectButton.mjs +25 -0
- package/reactjs/components/Connect/CustomConnectButton.d.ts +7 -0
- package/reactjs/components/Connect/CustomConnectButton.js +42 -0
- package/reactjs/components/Connect/CustomConnectButton.mjs +41 -0
- package/reactjs/components/Connect/MvxAccountDisplay.d.ts +9 -0
- package/reactjs/components/Connect/MvxAccountDisplay.js +75 -0
- package/reactjs/components/Connect/MvxAccountDisplay.mjs +74 -0
- package/reactjs/components/Connect/MvxConnectButton.d.ts +11 -0
- package/reactjs/components/Connect/MvxConnectButton.js +43 -0
- package/reactjs/components/Connect/MvxConnectButton.mjs +42 -0
- package/reactjs/components/Connect/SwitchChainButton.d.ts +7 -0
- package/reactjs/components/Connect/SwitchChainButton.js +33 -0
- package/reactjs/components/Connect/SwitchChainButton.mjs +32 -0
- package/reactjs/components/Connect/index.d.ts +6 -0
- package/reactjs/components/Connect/index.js +15 -0
- package/reactjs/components/Connect/index.mjs +14 -0
- package/reactjs/components/CopyButton/CopyButton.d.ts +6 -0
- package/reactjs/components/CopyButton/CopyButton.js +42 -0
- package/reactjs/components/CopyButton/CopyButton.mjs +41 -0
- package/reactjs/components/CopyButton/index.d.ts +1 -0
- package/reactjs/components/CopyButton/index.js +5 -0
- package/reactjs/components/CopyButton/index.mjs +4 -0
- package/reactjs/components/CopyButton/utils/copyToClipboard.d.ts +1 -0
- package/reactjs/components/CopyButton/utils/copyToClipboard.js +38 -0
- package/reactjs/components/CopyButton/utils/copyToClipboard.mjs +37 -0
- package/reactjs/components/CopyButton/utils/index.d.ts +1 -0
- package/reactjs/components/CopyButton/utils/index.js +5 -0
- package/reactjs/components/CopyButton/utils/index.mjs +4 -0
- package/reactjs/components/DisplayAmount/DisplayAmount.d.ts +21 -0
- package/reactjs/components/DisplayAmount/DisplayAmount.js +91 -0
- package/reactjs/components/DisplayAmount/DisplayAmount.mjs +90 -0
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.d.ts +7 -0
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.js +40 -0
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.mjs +39 -0
- package/reactjs/components/DisplayAmount/components/AnimateNumber/index.d.ts +0 -0
- package/reactjs/components/DisplayAmount/components/AnimateNumber/index.js +2 -0
- package/reactjs/components/DisplayAmount/components/AnimateNumber/index.mjs +1 -0
- package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.d.ts +14 -0
- package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.js +62 -0
- package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.mjs +61 -0
- package/reactjs/components/DisplayAmount/components/index.d.ts +0 -0
- package/reactjs/components/DisplayAmount/components/index.js +2 -0
- package/reactjs/components/DisplayAmount/components/index.mjs +1 -0
- package/reactjs/components/DisplayAmount/index.d.ts +1 -0
- package/reactjs/components/DisplayAmount/index.js +5 -0
- package/reactjs/components/DisplayAmount/index.mjs +4 -0
- package/reactjs/components/DisplayAmount/utils/index.d.ts +1 -0
- package/reactjs/components/DisplayAmount/utils/index.js +5 -0
- package/reactjs/components/DisplayAmount/utils/index.mjs +4 -0
- package/reactjs/components/DisplayAmount/utils/truncateAmount.d.ts +1 -0
- package/reactjs/components/DisplayAmount/utils/truncateAmount.js +22 -0
- package/reactjs/components/DisplayAmount/utils/truncateAmount.mjs +21 -0
- package/reactjs/components/SmallLoader/SmallLoader.d.ts +4 -0
- package/reactjs/components/SmallLoader/SmallLoader.js +22 -0
- package/reactjs/components/SmallLoader/SmallLoader.mjs +21 -0
- package/reactjs/components/SmallLoader/index.d.ts +1 -0
- package/reactjs/components/SmallLoader/index.js +5 -0
- package/reactjs/components/SmallLoader/index.mjs +4 -0
- package/reactjs/components/TokenSelector/TokenSelector.d.ts +16 -0
- package/reactjs/components/TokenSelector/TokenSelector.js +158 -0
- package/reactjs/components/TokenSelector/TokenSelector.mjs +157 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.d.ts +8 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.js +86 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.mjs +85 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.d.ts +11 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.js +45 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.mjs +44 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.d.ts +6 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.js +19 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.mjs +18 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.d.ts +3 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.js +7 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.mjs +6 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.d.ts +4 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.js +33 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.mjs +32 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/types/chainSelectOption.d.ts +10 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/types/chainSelectOption.js +2 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/types/chainSelectOption.mjs +1 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/types/partialChainOption.d.ts +10 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/types/partialChainOption.js +2 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/types/partialChainOption.mjs +1 -0
- package/reactjs/components/TokenSelector/components/SelectContainer.d.ts +7 -0
- package/reactjs/components/TokenSelector/components/SelectContainer.js +41 -0
- package/reactjs/components/TokenSelector/components/SelectContainer.mjs +40 -0
- package/reactjs/components/TokenSelector/components/SelectContent.d.ts +10 -0
- package/reactjs/components/TokenSelector/components/SelectContent.js +93 -0
- package/reactjs/components/TokenSelector/components/SelectContent.mjs +92 -0
- package/reactjs/components/TokenSelector/components/SelectedOption.d.ts +5 -0
- package/reactjs/components/TokenSelector/components/SelectedOption.js +29 -0
- package/reactjs/components/TokenSelector/components/SelectedOption.mjs +28 -0
- package/reactjs/components/TokenSelector/components/TokenIcon.d.ts +8 -0
- package/reactjs/components/TokenSelector/components/TokenIcon.js +82 -0
- package/reactjs/components/TokenSelector/components/TokenIcon.mjs +81 -0
- package/reactjs/components/TokenSelector/components/TokenItem.d.ts +7 -0
- package/reactjs/components/TokenSelector/components/TokenItem.js +69 -0
- package/reactjs/components/TokenSelector/components/TokenItem.mjs +68 -0
- package/reactjs/components/TokenSelector/components/TokenList.d.ts +7 -0
- package/reactjs/components/TokenSelector/components/TokenList.js +21 -0
- package/reactjs/components/TokenSelector/components/TokenList.mjs +20 -0
- package/reactjs/components/TokenSelector/components/TokenSymbol.d.ts +9 -0
- package/reactjs/components/TokenSelector/components/TokenSymbol.js +26 -0
- package/reactjs/components/TokenSelector/components/TokenSymbol.mjs +25 -0
- package/reactjs/components/TokenSelector/index.d.ts +1 -0
- package/reactjs/components/TokenSelector/index.js +5 -0
- package/reactjs/components/TokenSelector/index.mjs +4 -0
- package/reactjs/components/TransactionToast/TransactionToast.d.ts +9 -0
- package/reactjs/components/TransactionToast/TransactionToast.js +54 -0
- package/reactjs/components/TransactionToast/TransactionToast.mjs +53 -0
- package/reactjs/components/TransactionToast/TransactionToastContainer.d.ts +3 -0
- package/reactjs/components/TransactionToast/TransactionToastContainer.js +21 -0
- package/reactjs/components/TransactionToast/TransactionToastContainer.mjs +20 -0
- package/reactjs/components/TransactionToast/index.d.ts +2 -0
- package/reactjs/components/TransactionToast/index.js +7 -0
- package/reactjs/components/TransactionToast/index.mjs +6 -0
- package/reactjs/components/TrimAddress/TrimAddress.d.ts +8 -0
- package/reactjs/components/TrimAddress/TrimAddress.js +26 -0
- package/reactjs/components/TrimAddress/TrimAddress.mjs +25 -0
- package/reactjs/components/TrimAddress/index.d.ts +1 -0
- package/reactjs/components/TrimAddress/index.js +5 -0
- package/reactjs/components/TrimAddress/index.mjs +4 -0
- package/reactjs/components/base/MxButton/MxButton.d.ts +13 -0
- package/reactjs/components/base/MxButton/MxButton.js +72 -0
- package/reactjs/components/base/MxButton/MxButton.mjs +71 -0
- package/reactjs/components/base/MxButton/index.d.ts +1 -0
- package/reactjs/components/base/MxButton/index.js +5 -0
- package/reactjs/components/base/MxButton/index.mjs +4 -0
- package/reactjs/components/base/MxCard/MxCard.d.ts +10 -0
- package/reactjs/components/base/MxCard/MxCard.js +55 -0
- package/reactjs/components/base/MxCard/MxCard.mjs +54 -0
- package/reactjs/components/base/MxCard/index.d.ts +1 -0
- package/reactjs/components/base/MxCard/index.js +5 -0
- package/reactjs/components/base/MxCard/index.mjs +4 -0
- package/reactjs/components/base/MxLink/MxLink.d.ts +10 -0
- package/reactjs/components/base/MxLink/MxLink.js +71 -0
- package/reactjs/components/base/MxLink/MxLink.mjs +70 -0
- package/reactjs/components/base/MxLink/index.d.ts +1 -0
- package/reactjs/components/base/MxLink/index.js +5 -0
- package/reactjs/components/base/MxLink/index.mjs +4 -0
- package/reactjs/components/base/MxSearch/MxSearch.d.ts +10 -0
- package/reactjs/components/base/MxSearch/MxSearch.js +70 -0
- package/reactjs/components/base/MxSearch/MxSearch.mjs +69 -0
- package/reactjs/components/base/MxSearch/index.d.ts +1 -0
- package/reactjs/components/base/MxSearch/index.js +5 -0
- package/reactjs/components/base/MxSearch/index.mjs +4 -0
- package/reactjs/components/base/MxSlideover/MxSlideover.d.ts +10 -0
- package/reactjs/components/base/MxSlideover/MxSlideover.js +79 -0
- package/reactjs/components/base/MxSlideover/MxSlideover.mjs +78 -0
- package/reactjs/components/base/MxSlideover/index.d.ts +1 -0
- package/reactjs/components/base/MxSlideover/index.js +5 -0
- package/reactjs/components/base/MxSlideover/index.mjs +4 -0
- package/reactjs/components/base/MxTooltip/MxTooltip.d.ts +23 -0
- package/reactjs/components/base/MxTooltip/MxTooltip.js +163 -0
- package/reactjs/components/base/MxTooltip/MxTooltip.mjs +162 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.d.ts +11 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.js +34 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.mjs +33 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.d.ts +1 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.js +5 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.mjs +4 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.d.ts +13 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.js +28 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.mjs +27 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContent/index.d.ts +1 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContent/index.js +5 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContent/index.mjs +4 -0
- package/reactjs/components/base/MxTooltip/components/index.d.ts +2 -0
- package/reactjs/components/base/MxTooltip/components/index.js +7 -0
- package/reactjs/components/base/MxTooltip/components/index.mjs +6 -0
- package/reactjs/components/base/MxTooltip/index.d.ts +1 -0
- package/reactjs/components/base/MxTooltip/index.js +5 -0
- package/reactjs/components/base/MxTooltip/index.mjs +4 -0
- package/reactjs/components/base/index.d.ts +6 -0
- package/reactjs/components/base/index.js +15 -0
- package/reactjs/components/base/index.mjs +14 -0
- package/reactjs/components/index.d.ts +13 -0
- package/reactjs/components/index.js +51 -0
- package/reactjs/components/index.mjs +50 -0
- package/reactjs/constants/chains.d.ts +35 -0
- package/reactjs/constants/chains.js +38 -0
- package/reactjs/constants/chains.mjs +37 -0
- package/reactjs/constants/index.d.ts +3 -0
- package/reactjs/constants/index.js +12 -0
- package/reactjs/constants/index.mjs +11 -0
- package/reactjs/context/Web3AppProvider.d.ts +12 -0
- package/reactjs/context/Web3AppProvider.js +29 -0
- package/reactjs/context/Web3AppProvider.mjs +28 -0
- package/reactjs/context/queryClient.d.ts +3 -0
- package/reactjs/context/queryClient.js +12 -0
- package/reactjs/context/queryClient.mjs +11 -0
- package/reactjs/context/useWeb3App.d.ts +1 -0
- package/reactjs/context/useWeb3App.js +13 -0
- package/reactjs/context/useWeb3App.mjs +12 -0
- package/reactjs/hooks/index.d.ts +11 -0
- package/reactjs/hooks/index.js +32 -0
- package/reactjs/hooks/index.mjs +31 -0
- package/reactjs/hooks/useAccount.d.ts +77 -0
- package/reactjs/hooks/useAccount.js +18 -0
- package/reactjs/hooks/useAccount.mjs +17 -0
- package/reactjs/hooks/useBalances.d.ts +10 -0
- package/reactjs/hooks/useBalances.js +7 -0
- package/reactjs/hooks/useBalances.mjs +6 -0
- package/reactjs/hooks/useBridgeFormik.d.ts +98 -0
- package/reactjs/hooks/useBridgeFormik.js +182 -0
- package/reactjs/hooks/useBridgeFormik.mjs +181 -0
- package/reactjs/hooks/useDebounce.d.ts +1 -0
- package/reactjs/hooks/useDebounce.js +14 -0
- package/reactjs/hooks/useDebounce.mjs +13 -0
- package/reactjs/hooks/useFetchBridgeData.d.ts +45 -0
- package/reactjs/hooks/useFetchBridgeData.js +44 -0
- package/reactjs/hooks/useFetchBridgeData.mjs +43 -0
- package/reactjs/hooks/useFetchTokens.d.ts +42 -0
- package/reactjs/hooks/useFetchTokens.js +105 -0
- package/reactjs/hooks/useFetchTokens.mjs +104 -0
- package/reactjs/hooks/useGetChainId.d.ts +1 -0
- package/reactjs/hooks/useGetChainId.js +12 -0
- package/reactjs/hooks/useGetChainId.mjs +11 -0
- package/reactjs/hooks/useResolveTokenChain.d.ts +9 -0
- package/reactjs/hooks/useResolveTokenChain.js +21 -0
- package/reactjs/hooks/useResolveTokenChain.mjs +20 -0
- package/reactjs/hooks/useSendTransactions.d.ts +3 -0
- package/reactjs/hooks/useSendTransactions.js +19 -0
- package/reactjs/hooks/useSendTransactions.mjs +18 -0
- package/reactjs/hooks/useSignTransaction.d.ts +69 -0
- package/reactjs/hooks/useSignTransaction.js +17 -0
- package/reactjs/hooks/useSignTransaction.mjs +16 -0
- package/reactjs/hooks/validation/index.d.ts +4 -0
- package/reactjs/hooks/validation/index.js +11 -0
- package/reactjs/hooks/validation/index.mjs +10 -0
- package/reactjs/hooks/validation/useAmountSchema.d.ts +2 -0
- package/reactjs/hooks/validation/useAmountSchema.js +31 -0
- package/reactjs/hooks/validation/useAmountSchema.mjs +13 -0
- package/reactjs/hooks/validation/useSecondAmountSchema.d.ts +2 -0
- package/reactjs/hooks/validation/useSecondAmountSchema.js +27 -0
- package/reactjs/hooks/validation/useSecondAmountSchema.mjs +9 -0
- package/reactjs/hooks/validation/useTestHasEnoughFunds.d.ts +3 -0
- package/reactjs/hooks/validation/useTestHasEnoughFunds.js +38 -0
- package/reactjs/hooks/validation/useTestHasEnoughFunds.mjs +37 -0
- package/reactjs/hooks/validation/useTestIsConnected.d.ts +3 -0
- package/reactjs/hooks/validation/useTestIsConnected.js +21 -0
- package/reactjs/hooks/validation/useTestIsConnected.mjs +20 -0
- package/reactjs/index.d.ts +10 -0
- package/reactjs/index.js +153 -0
- package/reactjs/index.mjs +149 -0
- package/reactjs/init/index.d.ts +1 -0
- package/reactjs/init/index.js +5 -0
- package/reactjs/init/index.mjs +4 -0
- package/reactjs/init/init.d.ts +48 -0
- package/reactjs/init/init.js +53 -0
- package/reactjs/init/init.mjs +35 -0
- package/reactjs/init/tests/init.spec.d.ts +1 -0
- package/reactjs/init/tests/init.spec.js +108 -0
- package/reactjs/init/tests/init.spec.mjs +106 -0
- package/reactjs/queries/index.d.ts +7 -0
- package/reactjs/queries/index.js +20 -0
- package/reactjs/queries/index.mjs +19 -0
- package/reactjs/queries/useGetAllTokens.query.d.ts +3 -0
- package/reactjs/queries/useGetAllTokens.query.js +31 -0
- package/reactjs/queries/useGetAllTokens.query.mjs +30 -0
- package/reactjs/queries/useGetChains.query.d.ts +3 -0
- package/reactjs/queries/useGetChains.query.js +31 -0
- package/reactjs/queries/useGetChains.query.mjs +30 -0
- package/reactjs/queries/useGetEvmTokensBalances.query.d.ts +22 -0
- package/reactjs/queries/useGetEvmTokensBalances.query.js +78 -0
- package/reactjs/queries/useGetEvmTokensBalances.query.mjs +77 -0
- package/reactjs/queries/useGetHistory.query.d.ts +4 -0
- package/reactjs/queries/useGetHistory.query.js +47 -0
- package/reactjs/queries/useGetHistory.query.mjs +46 -0
- package/reactjs/queries/useGetMvxTokensBalances.query.d.ts +23 -0
- package/reactjs/queries/useGetMvxTokensBalances.query.js +60 -0
- package/reactjs/queries/useGetMvxTokensBalances.query.mjs +59 -0
- package/reactjs/queries/useGetRate.mutation.d.ts +6 -0
- package/reactjs/queries/useGetRate.mutation.js +19 -0
- package/reactjs/queries/useGetRate.mutation.mjs +18 -0
- package/reactjs/queries/useGetTokens.query.d.ts +3 -0
- package/reactjs/queries/useGetTokens.query.js +34 -0
- package/reactjs/queries/useGetTokens.query.mjs +33 -0
- package/reactjs/reexports.d.ts +6 -0
- package/reactjs/reexports.js +21 -0
- package/reactjs/reexports.mjs +17 -0
- package/reactjs/utils/delay.d.ts +1 -0
- package/reactjs/utils/delay.js +7 -0
- package/reactjs/utils/delay.mjs +6 -0
- package/reactjs/utils/formatAmount.d.ts +7 -0
- package/reactjs/utils/formatAmount.js +24 -0
- package/reactjs/utils/formatAmount.mjs +23 -0
- package/reactjs/utils/getCleanStringAmount.d.ts +4 -0
- package/reactjs/utils/getCleanStringAmount.js +12 -0
- package/reactjs/utils/getCleanStringAmount.mjs +11 -0
- package/reactjs/utils/getCompletePathname.d.ts +1 -0
- package/reactjs/utils/getCompletePathname.js +6 -0
- package/reactjs/utils/getCompletePathname.mjs +5 -0
- package/reactjs/utils/getInitialTokens.d.ts +8 -0
- package/reactjs/utils/getInitialTokens.js +13 -0
- package/reactjs/utils/getInitialTokens.mjs +12 -0
- package/reactjs/utils/hasEnoughFunds.d.ts +5 -0
- package/reactjs/utils/hasEnoughFunds.js +20 -0
- package/reactjs/utils/hasEnoughFunds.mjs +19 -0
- package/reactjs/utils/index.d.ts +12 -0
- package/reactjs/utils/index.js +27 -0
- package/reactjs/utils/index.mjs +26 -0
- package/reactjs/utils/isStringFloat.d.ts +1 -0
- package/reactjs/utils/isStringFloat.js +22 -0
- package/reactjs/utils/isStringFloat.mjs +21 -0
- package/reactjs/utils/mxClsx.d.ts +3 -0
- package/reactjs/utils/mxClsx.js +21 -0
- package/reactjs/utils/mxClsx.mjs +20 -0
- package/reactjs/utils/pipe.d.ts +7 -0
- package/reactjs/utils/pipe.js +26 -0
- package/reactjs/utils/pipe.mjs +25 -0
- package/reactjs/utils/removeCommas.d.ts +1 -0
- package/reactjs/utils/removeCommas.js +7 -0
- package/reactjs/utils/removeCommas.mjs +6 -0
- package/reactjs/utils/roundAmount.d.ts +1 -0
- package/reactjs/utils/roundAmount.js +41 -0
- package/reactjs/utils/roundAmount.mjs +40 -0
- package/reactjs/utils/testNumber.d.ts +1 -0
- package/reactjs/utils/testNumber.js +5 -0
- package/reactjs/utils/testNumber.mjs +4 -0
- package/store/inMemoryStore.d.ts +12 -0
- package/store/inMemoryStore.js +40 -0
- package/store/inMemoryStore.mjs +39 -0
- package/types/batchTransactions.d.ts +6 -0
- package/types/batchTransactions.js +2 -0
- package/types/batchTransactions.mjs +1 -0
- package/types/index.d.ts +4 -0
- package/types/index.js +2 -0
- package/types/index.mjs +1 -0
- package/types/rate.d.ts +11 -0
- package/types/rate.js +2 -0
- package/types/rate.mjs +1 -0
- package/types/token.d.ts +12 -0
- package/types/token.js +2 -0
- package/types/token.mjs +1 -0
- package/types/transaction.d.ts +14 -0
- package/types/transaction.js +2 -0
- package/types/transaction.mjs +1 -0
- package/useBalances-Bxtc4GNK.js +199 -0
- package/useBalances-DA3zEruz.mjs +199 -0
- package/w3m-modal-DCcF1qEB.js +356 -0
- package/w3m-modal-DK3G5GJp.mjs +356 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './truncateAmount';
|
|
@@ -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_utils_truncateAmount = require("./truncateAmount.js");
|
|
5
|
+
exports.truncateAmount = reactjs_components_DisplayAmount_utils_truncateAmount.truncateAmount;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const truncateAmount: (formattedAmount: string) => string | number;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const numeral = require("numeral");
|
|
5
|
+
const reactjs_utils_removeCommas = require("../../../utils/removeCommas.js");
|
|
6
|
+
const truncateAmount = (formattedAmount) => {
|
|
7
|
+
const cleanFormattedAmount = reactjs_utils_removeCommas.removeCommas(formattedAmount);
|
|
8
|
+
const number = Number(cleanFormattedAmount);
|
|
9
|
+
const abbreviations = {
|
|
10
|
+
T: 1e12,
|
|
11
|
+
B: 1e9,
|
|
12
|
+
M: 1e6,
|
|
13
|
+
K: 1e3
|
|
14
|
+
};
|
|
15
|
+
for (const key in abbreviations) {
|
|
16
|
+
if (Math.abs(number) >= abbreviations[key]) {
|
|
17
|
+
return numeral(number / abbreviations[key]).format("0.[00]") + key;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return number;
|
|
21
|
+
};
|
|
22
|
+
exports.truncateAmount = truncateAmount;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import numeral from "numeral";
|
|
2
|
+
import { removeCommas } from "../../../utils/removeCommas.mjs";
|
|
3
|
+
const truncateAmount = (formattedAmount) => {
|
|
4
|
+
const cleanFormattedAmount = removeCommas(formattedAmount);
|
|
5
|
+
const number = Number(cleanFormattedAmount);
|
|
6
|
+
const abbreviations = {
|
|
7
|
+
T: 1e12,
|
|
8
|
+
B: 1e9,
|
|
9
|
+
M: 1e6,
|
|
10
|
+
K: 1e3
|
|
11
|
+
};
|
|
12
|
+
for (const key in abbreviations) {
|
|
13
|
+
if (Math.abs(number) >= abbreviations[key]) {
|
|
14
|
+
return numeral(number / abbreviations[key]).format("0.[00]") + key;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return number;
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
truncateAmount
|
|
21
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
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 faSpinner = require("@fortawesome/free-solid-svg-icons/faSpinner");
|
|
6
|
+
const reactFontawesome = require("@fortawesome/react-fontawesome");
|
|
7
|
+
const SmallLoader = ({
|
|
8
|
+
show,
|
|
9
|
+
color
|
|
10
|
+
}) => {
|
|
11
|
+
if (!show) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "liq-d-flex", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15
|
+
reactFontawesome.FontAwesomeIcon,
|
|
16
|
+
{
|
|
17
|
+
icon: faSpinner.faSpinner,
|
|
18
|
+
className: `liq-fa-spin liq-fast-spin ${color ? color : "liq-text-primary"}`
|
|
19
|
+
}
|
|
20
|
+
) });
|
|
21
|
+
};
|
|
22
|
+
exports.SmallLoader = SmallLoader;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { faSpinner } from "@fortawesome/free-solid-svg-icons/faSpinner";
|
|
3
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
4
|
+
const SmallLoader = ({
|
|
5
|
+
show,
|
|
6
|
+
color
|
|
7
|
+
}) => {
|
|
8
|
+
if (!show) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return /* @__PURE__ */ jsx("div", { className: "liq-d-flex", children: /* @__PURE__ */ jsx(
|
|
12
|
+
FontAwesomeIcon,
|
|
13
|
+
{
|
|
14
|
+
icon: faSpinner,
|
|
15
|
+
className: `liq-fa-spin liq-fast-spin ${color ? color : "liq-text-primary"}`
|
|
16
|
+
}
|
|
17
|
+
) });
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
SmallLoader
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SmallLoader';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const reactjs_components_SmallLoader_SmallLoader = require("./SmallLoader.js");
|
|
5
|
+
exports.SmallLoader = reactjs_components_SmallLoader_SmallLoader.SmallLoader;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TokenType } from '../../../types/token';
|
|
2
|
+
|
|
3
|
+
export declare const TokenSelector: ({ name, options, selectedOption, areOptionsLoading, className, disabled, omitDisableClass, color, onBlur, onChange, onMaxBtnClick, onTokenSelectorDisplay }: {
|
|
4
|
+
name: string;
|
|
5
|
+
options: TokenType[];
|
|
6
|
+
selectedOption?: TokenType;
|
|
7
|
+
areOptionsLoading?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
omitDisableClass?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
color?: "neutral-750" | "neutral-850";
|
|
12
|
+
onChange: (option?: TokenType) => void;
|
|
13
|
+
onBlur: (e: React.FocusEvent<any, HTMLButtonElement>) => void;
|
|
14
|
+
onMaxBtnClick?: () => void;
|
|
15
|
+
onTokenSelectorDisplay?: (visible: boolean) => void;
|
|
16
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,158 @@
|
|
|
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 faChevronDown = require("@fortawesome/free-solid-svg-icons/faChevronDown");
|
|
6
|
+
const faWallet = require("@fortawesome/free-solid-svg-icons/faWallet");
|
|
7
|
+
const reactFontawesome = require("@fortawesome/react-fontawesome");
|
|
8
|
+
const require$$0 = require("react");
|
|
9
|
+
const reactjs_components_TokenSelector_components_SelectContainer = require("./components/SelectContainer.js");
|
|
10
|
+
const reactjs_components_TokenSelector_components_SelectContent = require("./components/SelectContent.js");
|
|
11
|
+
const reactjs_components_TokenSelector_components_SelectedOption = require("./components/SelectedOption.js");
|
|
12
|
+
const constants_index = require("../../../constants/index.js");
|
|
13
|
+
const reactjs_hooks_useResolveTokenChain = require("../../hooks/useResolveTokenChain.js");
|
|
14
|
+
const reactjs_queries_useGetChains_query = require("../../queries/useGetChains.query.js");
|
|
15
|
+
const reactjs_utils_mxClsx = require("../../utils/mxClsx.js");
|
|
16
|
+
const reactjs_components_base_MxButton_MxButton = require("../base/MxButton/MxButton.js");
|
|
17
|
+
const reactjs_components_DisplayAmount_DisplayAmount = require("../DisplayAmount/DisplayAmount.js");
|
|
18
|
+
const TokenSelector = ({
|
|
19
|
+
name,
|
|
20
|
+
options = [],
|
|
21
|
+
selectedOption,
|
|
22
|
+
areOptionsLoading = false,
|
|
23
|
+
className = "",
|
|
24
|
+
disabled = false,
|
|
25
|
+
omitDisableClass = false,
|
|
26
|
+
color = "neutral-750",
|
|
27
|
+
onBlur,
|
|
28
|
+
onChange,
|
|
29
|
+
onMaxBtnClick,
|
|
30
|
+
onTokenSelectorDisplay
|
|
31
|
+
}) => {
|
|
32
|
+
const [show, setShow] = require$$0.useState(false);
|
|
33
|
+
const { data, isLoading: areChainsLoading } = reactjs_queries_useGetChains_query.useGetChainsQuery();
|
|
34
|
+
const { chainIcon } = reactjs_hooks_useResolveTokenChain.useResolveTokenChain({
|
|
35
|
+
token: selectedOption
|
|
36
|
+
});
|
|
37
|
+
const chains = require$$0.useMemo(() => {
|
|
38
|
+
return (data == null ? void 0 : data.filter(
|
|
39
|
+
(chain) => !constants_index.MVX_CHAIN_IDS.includes(Number(chain.chainId.toString()))
|
|
40
|
+
)) ?? [];
|
|
41
|
+
}, [data]);
|
|
42
|
+
const handleOnClick = () => setShow(true);
|
|
43
|
+
require$$0.useEffect(() => {
|
|
44
|
+
onTokenSelectorDisplay == null ? void 0 : onTokenSelectorDisplay(show);
|
|
45
|
+
}, [show]);
|
|
46
|
+
if (areOptionsLoading || areChainsLoading) {
|
|
47
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
className: reactjs_utils_mxClsx.mxClsx(
|
|
51
|
+
"liq-h-12 liq-w-40 liq-animate-pulse",
|
|
52
|
+
{
|
|
53
|
+
"liq-rounded-xl": true,
|
|
54
|
+
"liq-rounded-e-lg liq-rounded-s-3xl": true
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"liq-bg-neutral-100 liq-bg-opacity-[0.1] hover:liq-bg-opacity-[0.25]": color === "neutral-750",
|
|
58
|
+
"liq-bg-neutral-100 liq-bg-opacity-[0.05] hover:liq-bg-opacity-[0.15]": color === "neutral-850"
|
|
59
|
+
},
|
|
60
|
+
className
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
66
|
+
show && /* @__PURE__ */ jsxRuntime.jsx(reactjs_components_TokenSelector_components_SelectContainer.SelectContainer, { onClose: () => setShow(false), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
67
|
+
reactjs_components_TokenSelector_components_SelectContent.SelectContent,
|
|
68
|
+
{
|
|
69
|
+
onSelect: (token) => {
|
|
70
|
+
onChange(token);
|
|
71
|
+
setShow(false);
|
|
72
|
+
},
|
|
73
|
+
tokens: options,
|
|
74
|
+
chains,
|
|
75
|
+
areChainsLoading,
|
|
76
|
+
selectedToken: selectedOption
|
|
77
|
+
}
|
|
78
|
+
) }),
|
|
79
|
+
!show && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "liq-flex liq-flex-col liq-items-end liq-justify-between liq-gap-4", children: [
|
|
80
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
81
|
+
"button",
|
|
82
|
+
{
|
|
83
|
+
name,
|
|
84
|
+
type: "button",
|
|
85
|
+
role: "combobox",
|
|
86
|
+
className: reactjs_utils_mxClsx.mxClsx(
|
|
87
|
+
"focus-primary liq-group liq-flex liq-cursor-pointer liq-items-center liq-gap-2 liq-transition-colors liq-duration-200 liq-relative",
|
|
88
|
+
{
|
|
89
|
+
"liq-rounded-e-lg liq-rounded-s-3xl liq-px-1 liq-py-1 liq-pr-3": true
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"liq-bg-neutral-750/50 hover:enabled:liq-bg-neutral-750": color === "neutral-750",
|
|
93
|
+
"liq-bg-neutral-900/50 liq-outline liq-outline-1 liq-outline-neutral-700/20 hover:enabled:liq-bg-neutral-600/50 hover:enabled:liq-outline-neutral-600": color === "neutral-850"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"disabled:!liq-opacity-70": disabled && !omitDisableClass
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"!liq-cursor-not-allowed !liq-bg-transparent !liq-outline-transparent": disabled
|
|
100
|
+
},
|
|
101
|
+
className
|
|
102
|
+
),
|
|
103
|
+
onBlur,
|
|
104
|
+
onClick: handleOnClick,
|
|
105
|
+
disabled,
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactjs_components_TokenSelector_components_SelectedOption.SelectedOption, { value: selectedOption }),
|
|
108
|
+
!disabled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
109
|
+
reactFontawesome.FontAwesomeIcon,
|
|
110
|
+
{
|
|
111
|
+
icon: faChevronDown.faChevronDown,
|
|
112
|
+
className: "liq-text-neutral-200 group-hover:liq-text-neutral-50"
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
chainIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
116
|
+
"img",
|
|
117
|
+
{
|
|
118
|
+
src: chainIcon,
|
|
119
|
+
alt: "",
|
|
120
|
+
className: "liq-absolute liq-left-6 liq-bottom-[2px] liq-chain-icon liq-sm liq-w-6 liq-h-6 liq-border-[3px] liq-border-neutral-850 liq-rounded-lg"
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "liq-flex liq-items-center liq-gap-3", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "liq-flex liq-items-center liq-gap-3", children: [
|
|
127
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "liq-flex liq-items-center liq-gap-1", children: [
|
|
128
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
129
|
+
reactFontawesome.FontAwesomeIcon,
|
|
130
|
+
{
|
|
131
|
+
icon: faWallet.faWallet,
|
|
132
|
+
className: "liq-text-neutral-300"
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
136
|
+
reactjs_components_DisplayAmount_DisplayAmount.DisplayAmount,
|
|
137
|
+
{
|
|
138
|
+
decimals: selectedOption == null ? void 0 : selectedOption.decimals,
|
|
139
|
+
amount: (selectedOption == null ? void 0 : selectedOption.balance) ?? "0",
|
|
140
|
+
className: "liq-font-medium liq-text-neutral-100"
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
] }),
|
|
144
|
+
onMaxBtnClick && /* @__PURE__ */ jsxRuntime.jsx(
|
|
145
|
+
reactjs_components_base_MxButton_MxButton.MxButton,
|
|
146
|
+
{
|
|
147
|
+
btnSize: "xs",
|
|
148
|
+
variant: "neutral-800",
|
|
149
|
+
disabled,
|
|
150
|
+
onClick: onMaxBtnClick,
|
|
151
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "liq-text-neutral-300", children: "MAX" })
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
] }) })
|
|
155
|
+
] })
|
|
156
|
+
] });
|
|
157
|
+
};
|
|
158
|
+
exports.TokenSelector = TokenSelector;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { faChevronDown } from "@fortawesome/free-solid-svg-icons/faChevronDown";
|
|
3
|
+
import { faWallet } from "@fortawesome/free-solid-svg-icons/faWallet";
|
|
4
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
5
|
+
import { useState, useMemo, useEffect } from "react";
|
|
6
|
+
import { SelectContainer } from "./components/SelectContainer.mjs";
|
|
7
|
+
import { SelectContent } from "./components/SelectContent.mjs";
|
|
8
|
+
import { SelectedOption } from "./components/SelectedOption.mjs";
|
|
9
|
+
import { MVX_CHAIN_IDS } from "../../../constants/index.mjs";
|
|
10
|
+
import { useResolveTokenChain } from "../../hooks/useResolveTokenChain.mjs";
|
|
11
|
+
import { useGetChainsQuery } from "../../queries/useGetChains.query.mjs";
|
|
12
|
+
import { mxClsx } from "../../utils/mxClsx.mjs";
|
|
13
|
+
import { MxButton } from "../base/MxButton/MxButton.mjs";
|
|
14
|
+
import { DisplayAmount } from "../DisplayAmount/DisplayAmount.mjs";
|
|
15
|
+
const TokenSelector = ({
|
|
16
|
+
name,
|
|
17
|
+
options = [],
|
|
18
|
+
selectedOption,
|
|
19
|
+
areOptionsLoading = false,
|
|
20
|
+
className = "",
|
|
21
|
+
disabled = false,
|
|
22
|
+
omitDisableClass = false,
|
|
23
|
+
color = "neutral-750",
|
|
24
|
+
onBlur,
|
|
25
|
+
onChange,
|
|
26
|
+
onMaxBtnClick,
|
|
27
|
+
onTokenSelectorDisplay
|
|
28
|
+
}) => {
|
|
29
|
+
const [show, setShow] = useState(false);
|
|
30
|
+
const { data, isLoading: areChainsLoading } = useGetChainsQuery();
|
|
31
|
+
const { chainIcon } = useResolveTokenChain({
|
|
32
|
+
token: selectedOption
|
|
33
|
+
});
|
|
34
|
+
const chains = useMemo(() => {
|
|
35
|
+
return (data == null ? void 0 : data.filter(
|
|
36
|
+
(chain) => !MVX_CHAIN_IDS.includes(Number(chain.chainId.toString()))
|
|
37
|
+
)) ?? [];
|
|
38
|
+
}, [data]);
|
|
39
|
+
const handleOnClick = () => setShow(true);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
onTokenSelectorDisplay == null ? void 0 : onTokenSelectorDisplay(show);
|
|
42
|
+
}, [show]);
|
|
43
|
+
if (areOptionsLoading || areChainsLoading) {
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
className: mxClsx(
|
|
48
|
+
"liq-h-12 liq-w-40 liq-animate-pulse",
|
|
49
|
+
{
|
|
50
|
+
"liq-rounded-xl": true,
|
|
51
|
+
"liq-rounded-e-lg liq-rounded-s-3xl": true
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"liq-bg-neutral-100 liq-bg-opacity-[0.1] hover:liq-bg-opacity-[0.25]": color === "neutral-750",
|
|
55
|
+
"liq-bg-neutral-100 liq-bg-opacity-[0.05] hover:liq-bg-opacity-[0.15]": color === "neutral-850"
|
|
56
|
+
},
|
|
57
|
+
className
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
63
|
+
show && /* @__PURE__ */ jsx(SelectContainer, { onClose: () => setShow(false), children: /* @__PURE__ */ jsx(
|
|
64
|
+
SelectContent,
|
|
65
|
+
{
|
|
66
|
+
onSelect: (token) => {
|
|
67
|
+
onChange(token);
|
|
68
|
+
setShow(false);
|
|
69
|
+
},
|
|
70
|
+
tokens: options,
|
|
71
|
+
chains,
|
|
72
|
+
areChainsLoading,
|
|
73
|
+
selectedToken: selectedOption
|
|
74
|
+
}
|
|
75
|
+
) }),
|
|
76
|
+
!show && /* @__PURE__ */ jsxs("div", { className: "liq-flex liq-flex-col liq-items-end liq-justify-between liq-gap-4", children: [
|
|
77
|
+
/* @__PURE__ */ jsxs(
|
|
78
|
+
"button",
|
|
79
|
+
{
|
|
80
|
+
name,
|
|
81
|
+
type: "button",
|
|
82
|
+
role: "combobox",
|
|
83
|
+
className: mxClsx(
|
|
84
|
+
"focus-primary liq-group liq-flex liq-cursor-pointer liq-items-center liq-gap-2 liq-transition-colors liq-duration-200 liq-relative",
|
|
85
|
+
{
|
|
86
|
+
"liq-rounded-e-lg liq-rounded-s-3xl liq-px-1 liq-py-1 liq-pr-3": true
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"liq-bg-neutral-750/50 hover:enabled:liq-bg-neutral-750": color === "neutral-750",
|
|
90
|
+
"liq-bg-neutral-900/50 liq-outline liq-outline-1 liq-outline-neutral-700/20 hover:enabled:liq-bg-neutral-600/50 hover:enabled:liq-outline-neutral-600": color === "neutral-850"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"disabled:!liq-opacity-70": disabled && !omitDisableClass
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"!liq-cursor-not-allowed !liq-bg-transparent !liq-outline-transparent": disabled
|
|
97
|
+
},
|
|
98
|
+
className
|
|
99
|
+
),
|
|
100
|
+
onBlur,
|
|
101
|
+
onClick: handleOnClick,
|
|
102
|
+
disabled,
|
|
103
|
+
children: [
|
|
104
|
+
/* @__PURE__ */ jsx(SelectedOption, { value: selectedOption }),
|
|
105
|
+
!disabled && /* @__PURE__ */ jsx(
|
|
106
|
+
FontAwesomeIcon,
|
|
107
|
+
{
|
|
108
|
+
icon: faChevronDown,
|
|
109
|
+
className: "liq-text-neutral-200 group-hover:liq-text-neutral-50"
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
chainIcon && /* @__PURE__ */ jsx(
|
|
113
|
+
"img",
|
|
114
|
+
{
|
|
115
|
+
src: chainIcon,
|
|
116
|
+
alt: "",
|
|
117
|
+
className: "liq-absolute liq-left-6 liq-bottom-[2px] liq-chain-icon liq-sm liq-w-6 liq-h-6 liq-border-[3px] liq-border-neutral-850 liq-rounded-lg"
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
),
|
|
123
|
+
/* @__PURE__ */ jsx("div", { className: "liq-flex liq-items-center liq-gap-3", children: /* @__PURE__ */ jsxs("div", { className: "liq-flex liq-items-center liq-gap-3", children: [
|
|
124
|
+
/* @__PURE__ */ jsxs("div", { className: "liq-flex liq-items-center liq-gap-1", children: [
|
|
125
|
+
/* @__PURE__ */ jsx(
|
|
126
|
+
FontAwesomeIcon,
|
|
127
|
+
{
|
|
128
|
+
icon: faWallet,
|
|
129
|
+
className: "liq-text-neutral-300"
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
/* @__PURE__ */ jsx(
|
|
133
|
+
DisplayAmount,
|
|
134
|
+
{
|
|
135
|
+
decimals: selectedOption == null ? void 0 : selectedOption.decimals,
|
|
136
|
+
amount: (selectedOption == null ? void 0 : selectedOption.balance) ?? "0",
|
|
137
|
+
className: "liq-font-medium liq-text-neutral-100"
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
] }),
|
|
141
|
+
onMaxBtnClick && /* @__PURE__ */ jsx(
|
|
142
|
+
MxButton,
|
|
143
|
+
{
|
|
144
|
+
btnSize: "xs",
|
|
145
|
+
variant: "neutral-800",
|
|
146
|
+
disabled,
|
|
147
|
+
onClick: onMaxBtnClick,
|
|
148
|
+
children: /* @__PURE__ */ jsx("span", { className: "liq-text-neutral-300", children: "MAX" })
|
|
149
|
+
}
|
|
150
|
+
)
|
|
151
|
+
] }) })
|
|
152
|
+
] })
|
|
153
|
+
] });
|
|
154
|
+
};
|
|
155
|
+
export {
|
|
156
|
+
TokenSelector
|
|
157
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChainDTO } from '../../../../../dto/Chain.dto';
|
|
2
|
+
|
|
3
|
+
export declare const ChainSelect: ({ isLoading, selectedChainId, onChange, chains }: {
|
|
4
|
+
isLoading?: boolean;
|
|
5
|
+
selectedChainId?: string;
|
|
6
|
+
onChange?: (chainId: string) => void;
|
|
7
|
+
chains: ChainDTO[];
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,86 @@
|
|
|
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 require$$0 = require("react");
|
|
6
|
+
const Select = require("react-select");
|
|
7
|
+
const reactjs_components_TokenSelector_components_ChainSelect_components_FormatChainOptionLabel = require("./components/FormatChainOptionLabel.js");
|
|
8
|
+
const reactjs_components_TokenSelector_components_ChainSelect_components_IndicatorSeparator = require("./components/IndicatorSeparator.js");
|
|
9
|
+
const reactjs_components_TokenSelector_components_ChainSelect_components_SelectedChainOption = require("./components/SelectedChainOption.js");
|
|
10
|
+
const ChainSelect = ({
|
|
11
|
+
isLoading,
|
|
12
|
+
selectedChainId,
|
|
13
|
+
onChange,
|
|
14
|
+
chains
|
|
15
|
+
}) => {
|
|
16
|
+
const chainOptions = require$$0.useMemo(() => {
|
|
17
|
+
const options = chains.map((chain) => ({
|
|
18
|
+
label: chain.networkName,
|
|
19
|
+
value: chain.chainId.toString(),
|
|
20
|
+
chain: {
|
|
21
|
+
id: chain.chainId.toString(),
|
|
22
|
+
name: chain.chainName,
|
|
23
|
+
networkName: chain.networkName,
|
|
24
|
+
svgUrl: chain.svgUrl
|
|
25
|
+
}
|
|
26
|
+
}));
|
|
27
|
+
options.unshift({
|
|
28
|
+
label: "All",
|
|
29
|
+
value: "0",
|
|
30
|
+
chain: {
|
|
31
|
+
id: "0",
|
|
32
|
+
name: "all",
|
|
33
|
+
networkName: "All",
|
|
34
|
+
svgUrl: "https://cdn.multiversx.com/liquidity-sdk/all-networks.svg"
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return options;
|
|
38
|
+
}, [chains]);
|
|
39
|
+
const selectedChain = require$$0.useMemo(() => {
|
|
40
|
+
return chainOptions.find(
|
|
41
|
+
(chainOption) => chainOption.value.toString() === (selectedChainId == null ? void 0 : selectedChainId.toString())
|
|
42
|
+
) ?? (chainOptions == null ? void 0 : chainOptions[0]);
|
|
43
|
+
}, [chainOptions, selectedChainId]);
|
|
44
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "styled-chain-select", "data-testid": "chainDropdown", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
45
|
+
Select,
|
|
46
|
+
{
|
|
47
|
+
className: "basic-single",
|
|
48
|
+
classNamePrefix: "styled-chain-select",
|
|
49
|
+
maxMenuHeight: 260,
|
|
50
|
+
value: selectedChain,
|
|
51
|
+
isLoading,
|
|
52
|
+
styles: {
|
|
53
|
+
indicatorSeparator: reactjs_components_TokenSelector_components_ChainSelect_components_IndicatorSeparator.IndicatorSeparator,
|
|
54
|
+
control: (css) => ({
|
|
55
|
+
...css,
|
|
56
|
+
width: "max-content",
|
|
57
|
+
minWidth: "100%",
|
|
58
|
+
maxWidth: "10rem"
|
|
59
|
+
}),
|
|
60
|
+
menu: (css) => ({
|
|
61
|
+
...css,
|
|
62
|
+
zIndex: 9999,
|
|
63
|
+
width: "max-content",
|
|
64
|
+
minWidth: "100%",
|
|
65
|
+
right: 0
|
|
66
|
+
})
|
|
67
|
+
},
|
|
68
|
+
isSearchable: true,
|
|
69
|
+
name: "chain",
|
|
70
|
+
options: chainOptions,
|
|
71
|
+
onChange: (selectedOption) => {
|
|
72
|
+
var _a, _b;
|
|
73
|
+
if ((_a = selectedOption == null ? void 0 : selectedOption.chain) == null ? void 0 : _a.id) {
|
|
74
|
+
onChange == null ? void 0 : onChange((_b = selectedOption.chain) == null ? void 0 : _b.id.toString());
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
isMulti: false,
|
|
78
|
+
formatOptionLabel: reactjs_components_TokenSelector_components_ChainSelect_components_FormatChainOptionLabel.FormatChainOptionLabel,
|
|
79
|
+
components: {
|
|
80
|
+
Input: () => null,
|
|
81
|
+
SingleValue: reactjs_components_TokenSelector_components_ChainSelect_components_SelectedChainOption.SelectedChainOption
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
) });
|
|
85
|
+
};
|
|
86
|
+
exports.ChainSelect = ChainSelect;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import Select from "react-select";
|
|
4
|
+
import { FormatChainOptionLabel } from "./components/FormatChainOptionLabel.mjs";
|
|
5
|
+
import { IndicatorSeparator } from "./components/IndicatorSeparator.mjs";
|
|
6
|
+
import { SelectedChainOption } from "./components/SelectedChainOption.mjs";
|
|
7
|
+
const ChainSelect = ({
|
|
8
|
+
isLoading,
|
|
9
|
+
selectedChainId,
|
|
10
|
+
onChange,
|
|
11
|
+
chains
|
|
12
|
+
}) => {
|
|
13
|
+
const chainOptions = useMemo(() => {
|
|
14
|
+
const options = chains.map((chain) => ({
|
|
15
|
+
label: chain.networkName,
|
|
16
|
+
value: chain.chainId.toString(),
|
|
17
|
+
chain: {
|
|
18
|
+
id: chain.chainId.toString(),
|
|
19
|
+
name: chain.chainName,
|
|
20
|
+
networkName: chain.networkName,
|
|
21
|
+
svgUrl: chain.svgUrl
|
|
22
|
+
}
|
|
23
|
+
}));
|
|
24
|
+
options.unshift({
|
|
25
|
+
label: "All",
|
|
26
|
+
value: "0",
|
|
27
|
+
chain: {
|
|
28
|
+
id: "0",
|
|
29
|
+
name: "all",
|
|
30
|
+
networkName: "All",
|
|
31
|
+
svgUrl: "https://cdn.multiversx.com/liquidity-sdk/all-networks.svg"
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return options;
|
|
35
|
+
}, [chains]);
|
|
36
|
+
const selectedChain = useMemo(() => {
|
|
37
|
+
return chainOptions.find(
|
|
38
|
+
(chainOption) => chainOption.value.toString() === (selectedChainId == null ? void 0 : selectedChainId.toString())
|
|
39
|
+
) ?? (chainOptions == null ? void 0 : chainOptions[0]);
|
|
40
|
+
}, [chainOptions, selectedChainId]);
|
|
41
|
+
return /* @__PURE__ */ jsx("div", { className: "styled-chain-select", "data-testid": "chainDropdown", children: /* @__PURE__ */ jsx(
|
|
42
|
+
Select,
|
|
43
|
+
{
|
|
44
|
+
className: "basic-single",
|
|
45
|
+
classNamePrefix: "styled-chain-select",
|
|
46
|
+
maxMenuHeight: 260,
|
|
47
|
+
value: selectedChain,
|
|
48
|
+
isLoading,
|
|
49
|
+
styles: {
|
|
50
|
+
indicatorSeparator: IndicatorSeparator,
|
|
51
|
+
control: (css) => ({
|
|
52
|
+
...css,
|
|
53
|
+
width: "max-content",
|
|
54
|
+
minWidth: "100%",
|
|
55
|
+
maxWidth: "10rem"
|
|
56
|
+
}),
|
|
57
|
+
menu: (css) => ({
|
|
58
|
+
...css,
|
|
59
|
+
zIndex: 9999,
|
|
60
|
+
width: "max-content",
|
|
61
|
+
minWidth: "100%",
|
|
62
|
+
right: 0
|
|
63
|
+
})
|
|
64
|
+
},
|
|
65
|
+
isSearchable: true,
|
|
66
|
+
name: "chain",
|
|
67
|
+
options: chainOptions,
|
|
68
|
+
onChange: (selectedOption) => {
|
|
69
|
+
var _a, _b;
|
|
70
|
+
if ((_a = selectedOption == null ? void 0 : selectedOption.chain) == null ? void 0 : _a.id) {
|
|
71
|
+
onChange == null ? void 0 : onChange((_b = selectedOption.chain) == null ? void 0 : _b.id.toString());
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
isMulti: false,
|
|
75
|
+
formatOptionLabel: FormatChainOptionLabel,
|
|
76
|
+
components: {
|
|
77
|
+
Input: () => null,
|
|
78
|
+
SingleValue: SelectedChainOption
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
) });
|
|
82
|
+
};
|
|
83
|
+
export {
|
|
84
|
+
ChainSelect
|
|
85
|
+
};
|
package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ChainOptionLabelType {
|
|
2
|
+
isDisabled?: boolean;
|
|
3
|
+
inDropdown?: boolean;
|
|
4
|
+
chain: {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
networkName: string;
|
|
8
|
+
svgUrl?: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare const ChainOptionLabel: ({ chain, inDropdown }: ChainOptionLabelType) => import("react/jsx-runtime").JSX.Element;
|