@multiversx/sdk-dapp-liquidity 2.3.0 → 2.4.0-alpha.0
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/BridgeHistory-BU-L_w0l.js +2 -0
- package/BridgeHistory-CInRkJ6T.mjs +275 -0
- package/ToggleDirection-BLDXxUlN.mjs +16 -0
- package/ToggleDirection-CZ9-ZD7Y.js +2 -0
- package/all-networks-De_MBUh1.js +2 -0
- package/all-networks-hdZt5Hcc.mjs +4 -0
- package/api/checkAccount.d.ts +1 -2
- package/api/checkAccount.js +1 -1
- package/api/checkAccount.mjs +10 -20
- package/api/confirmRate.d.ts +2 -3
- package/api/confirmRate.js +1 -1
- package/api/confirmRate.mjs +16 -23
- package/api/getChains.d.ts +1 -2
- package/api/getChains.js +1 -1
- package/api/getChains.mjs +10 -16
- package/api/getRate.d.ts +1 -2
- package/api/getRate.js +1 -1
- package/api/getRate.mjs +16 -23
- package/api/getTokens.d.ts +1 -2
- package/api/getTokens.js +1 -1
- package/api/getTokens.mjs +10 -20
- package/api/getTokensBalances.d.ts +1 -2
- package/api/getTokensBalances.js +1 -1
- package/api/getTokensBalances.mjs +10 -20
- package/api/getTransactions.d.ts +2 -3
- package/api/getTransactions.js +1 -1
- package/api/getTransactions.mjs +19 -31
- package/api/index.js +1 -1
- package/api/index.mjs +9 -18
- package/api/sendTransactions.d.ts +3 -4
- package/api/sendTransactions.js +1 -1
- package/api/sendTransactions.mjs +19 -31
- package/api/tests/confirmRate.spec.js +1 -1
- package/api/tests/confirmRate.spec.mjs +98 -112
- package/api/tests/getChains.spec.js +1 -1
- package/api/tests/getChains.spec.mjs +38 -36
- package/api/tests/getRate.spec.js +1 -1
- package/api/tests/getRate.spec.mjs +73 -69
- package/api/tests/getTokens.spec.js +1 -1
- package/api/tests/getTokens.spec.mjs +58 -58
- package/api/tests/getTransactions.spec.js +1 -1
- package/api/tests/getTransactions.spec.mjs +84 -74
- package/api/tests/sendTransactions.spec.js +1 -1
- package/api/tests/sendTransactions.spec.mjs +74 -84
- package/chains-Bmeag21l.js +2 -0
- package/chains-DQACurVn.mjs +33 -0
- package/chunk-oiTVcehM.js +2 -0
- package/constants/index.js +1 -1
- package/constants/index.mjs +8 -4
- package/default-CqGeN438.js +2 -0
- package/default-DuNFRYAj.mjs +4 -0
- package/dto/Chain.dto.d.ts +0 -1
- package/dto/Chain.dto.js +0 -1
- package/dto/Chain.dto.mjs +0 -1
- package/dto/CheckAccount.dto.js +0 -1
- package/dto/CheckAccount.dto.mjs +0 -1
- package/dto/ConfirmRate.dto.d.ts +0 -1
- package/dto/ConfirmRate.dto.js +0 -1
- package/dto/ConfirmRate.dto.mjs +0 -1
- package/dto/Token.dto.js +0 -1
- package/dto/Token.dto.mjs +0 -1
- package/dto/TokenBalance.dto.js +0 -1
- package/dto/TokenBalance.dto.mjs +0 -1
- package/dto/Transaction.dto.d.ts +0 -1
- package/dto/Transaction.dto.js +0 -1
- package/dto/Transaction.dto.mjs +0 -1
- package/dto/index.js +0 -1
- package/dto/index.mjs +0 -1
- package/helpers/assertConfirmRateData.js +1 -1
- package/helpers/assertConfirmRateData.mjs +11 -28
- package/helpers/assertRateConfirmationMatchesIntent.d.ts +0 -1
- package/helpers/assertRateConfirmationMatchesIntent.js +1 -1
- package/helpers/assertRateConfirmationMatchesIntent.mjs +9 -18
- package/helpers/base64Utils.js +1 -1
- package/helpers/base64Utils.mjs +15 -18
- package/helpers/decodeLoginToken.js +1 -1
- package/helpers/decodeLoginToken.mjs +19 -21
- package/helpers/decodeToken.js +1 -1
- package/helpers/decodeToken.mjs +22 -27
- package/helpers/getApiURL.js +1 -1
- package/helpers/getApiURL.mjs +5 -5
- package/helpers/getBridgeURL.js +1 -1
- package/helpers/getBridgeURL.mjs +4 -4
- package/helpers/getDisplayName.d.ts +0 -1
- package/helpers/getDisplayName.js +1 -1
- package/helpers/getDisplayName.mjs +5 -5
- package/helpers/getMvxApiURL.js +1 -1
- package/helpers/getMvxApiURL.mjs +5 -5
- package/helpers/getMvxChainId.js +1 -1
- package/helpers/getMvxChainId.mjs +5 -5
- package/helpers/getMvxExplorerAddress.js +1 -1
- package/helpers/getMvxExplorerAddress.mjs +4 -4
- package/helpers/index.js +1 -1
- package/helpers/index.mjs +12 -27
- package/helpers/isValidAddressForChainType.d.ts +0 -1
- package/helpers/isValidAddressForChainType.js +1 -1
- package/helpers/isValidAddressForChainType.mjs +37 -48
- package/helpers/safeImageUrl.js +1 -1
- package/helpers/safeImageUrl.mjs +14 -12
- package/helpers/serializeTransaction.d.ts +0 -1
- package/helpers/serializeTransaction.js +1 -1
- package/helpers/serializeTransaction.mjs +5 -5
- package/helpers/tests/assertConfirmRateData.spec.js +1 -1
- package/helpers/tests/assertConfirmRateData.spec.mjs +86 -74
- package/helpers/tests/assertRateConfirmationMatchesIntent.spec.js +1 -1
- package/helpers/tests/assertRateConfirmationMatchesIntent.spec.mjs +61 -49
- package/helpers/tests/base64Utils.spec.js +1 -1
- package/helpers/tests/base64Utils.spec.mjs +15 -13
- package/helpers/tests/decodeLoginToken.spec.js +1 -1
- package/helpers/tests/decodeLoginToken.spec.mjs +20 -19
- package/helpers/tests/decodeToken.spec.js +1 -1
- package/helpers/tests/decodeToken.spec.mjs +18 -19
- package/helpers/tests/isValidAddressForChainType.spec.js +1 -1
- package/helpers/tests/isValidAddressForChainType.spec.mjs +59 -134
- package/helpers/tests/safeImageUrl.spec.js +1 -1
- package/helpers/tests/safeImageUrl.spec.mjs +30 -30
- package/helpers/tests/serializeTransaction.spec.js +1 -1
- package/helpers/tests/serializeTransaction.spec.mjs +35 -21
- package/index.js +1 -1
- package/index.mjs +91 -200
- package/package.json +23 -32
- package/react.esm-JNqTldrP.mjs +8927 -0
- package/react.esm-kvI07ZPd.js +59 -0
- package/reactjs/adapters/SuiAdapter.d.ts +2 -2
- package/reactjs/adapters/SuiAdapter.js +1 -1
- package/reactjs/adapters/SuiAdapter.mjs +254 -323
- package/reactjs/components/AccountAddress/AccountAddress.d.ts +1 -1
- package/reactjs/components/AccountAddress/AccountAddress.js +1 -1
- package/reactjs/components/AccountAddress/AccountAddress.mjs +20 -30
- package/reactjs/components/AccountAddress/index.js +1 -1
- package/reactjs/components/AccountAddress/index.mjs +2 -4
- package/reactjs/components/AmountCard/AmountCard.d.ts +1 -2
- package/reactjs/components/AmountCard/AmountCard.js +1 -1
- package/reactjs/components/AmountCard/AmountCard.mjs +13 -31
- package/reactjs/components/AmountCard/index.js +1 -1
- package/reactjs/components/AmountCard/index.mjs +2 -4
- package/reactjs/components/AmountInput/AmountInput.d.ts +1 -2
- package/reactjs/components/AmountInput/AmountInput.js +1 -1
- package/reactjs/components/AmountInput/AmountInput.mjs +48 -66
- package/reactjs/components/AmountInput/index.js +1 -1
- package/reactjs/components/AmountInput/index.mjs +2 -4
- package/reactjs/components/BridgeForm/BridgeForm.d.ts +1 -1
- package/reactjs/components/BridgeForm/BridgeForm.js +1 -1
- package/reactjs/components/BridgeForm/BridgeForm.mjs +53 -81
- package/reactjs/components/BridgeForm/Deposit.d.ts +1 -1
- package/reactjs/components/BridgeForm/Deposit.js +1 -1
- package/reactjs/components/BridgeForm/Deposit.mjs +457 -573
- package/reactjs/components/BridgeForm/Transfer.d.ts +1 -1
- package/reactjs/components/BridgeForm/Transfer.js +1 -1
- package/reactjs/components/BridgeForm/Transfer.mjs +358 -470
- package/reactjs/components/BridgeForm/hooks/useBridgeAmounts.d.ts +0 -1
- package/reactjs/components/BridgeForm/hooks/useBridgeAmounts.js +1 -1
- package/reactjs/components/BridgeForm/hooks/useBridgeAmounts.mjs +52 -54
- package/reactjs/components/BridgeForm/hooks/useBridgeRateFetching.d.ts +0 -1
- package/reactjs/components/BridgeForm/hooks/useBridgeRateFetching.js +1 -1
- package/reactjs/components/BridgeForm/hooks/useBridgeRateFetching.mjs +35 -46
- package/reactjs/components/BridgeForm/hooks/useBridgeTokenSelection.d.ts +1 -2
- package/reactjs/components/BridgeForm/hooks/useBridgeTokenSelection.js +1 -1
- package/reactjs/components/BridgeForm/hooks/useBridgeTokenSelection.mjs +131 -197
- package/reactjs/components/BridgeForm/index.js +1 -1
- package/reactjs/components/BridgeForm/index.mjs +1 -3
- package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.d.ts +3 -4
- package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.js +1 -1
- package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.mjs +26 -43
- package/reactjs/components/BridgeHistory/BridgeHistory.d.ts +1 -1
- package/reactjs/components/BridgeHistory/BridgeHistory.js +1 -1
- package/reactjs/components/BridgeHistory/BridgeHistory.mjs +2 -353
- package/reactjs/components/BridgeHistory/index.js +1 -1
- package/reactjs/components/BridgeHistory/index.mjs +2 -4
- package/reactjs/components/Connect/BridgeAccountDisplay.d.ts +1 -2
- package/reactjs/components/Connect/BridgeAccountDisplay.js +1 -1
- package/reactjs/components/Connect/BridgeAccountDisplay.mjs +125 -134
- package/reactjs/components/Connect/BridgeConnectButton.d.ts +1 -2
- package/reactjs/components/Connect/BridgeConnectButton.js +1 -1
- package/reactjs/components/Connect/BridgeConnectButton.mjs +42 -44
- package/reactjs/components/Connect/ChainSelectConnect.d.ts +1 -2
- package/reactjs/components/Connect/ChainSelectConnect.js +1 -1
- package/reactjs/components/Connect/ChainSelectConnect.mjs +100 -129
- package/reactjs/components/Connect/CustomConnectButton.d.ts +2 -3
- package/reactjs/components/Connect/CustomConnectButton.js +1 -1
- package/reactjs/components/Connect/CustomConnectButton.mjs +23 -35
- package/reactjs/components/Connect/MvxAccountDisplay.d.ts +1 -1
- package/reactjs/components/Connect/MvxAccountDisplay.js +1 -1
- package/reactjs/components/Connect/MvxAccountDisplay.mjs +74 -94
- package/reactjs/components/Connect/MvxConnectButton.d.ts +1 -1
- package/reactjs/components/Connect/MvxConnectButton.js +1 -1
- package/reactjs/components/Connect/MvxConnectButton.mjs +27 -38
- package/reactjs/components/Connect/SwitchChainButton.d.ts +2 -3
- package/reactjs/components/Connect/SwitchChainButton.js +1 -1
- package/reactjs/components/Connect/SwitchChainButton.mjs +20 -30
- package/reactjs/components/Connect/index.js +1 -1
- package/reactjs/components/Connect/index.mjs +6 -14
- package/reactjs/components/CopyButton/CopyButton.d.ts +2 -1
- package/reactjs/components/CopyButton/CopyButton.js +1 -1
- package/reactjs/components/CopyButton/CopyButton.mjs +35 -42
- package/reactjs/components/CopyButton/index.js +1 -1
- package/reactjs/components/CopyButton/index.mjs +2 -4
- package/reactjs/components/CopyButton/utils/copyToClipboard.js +1 -1
- package/reactjs/components/CopyButton/utils/copyToClipboard.mjs +20 -24
- package/reactjs/components/CopyButton/utils/index.js +1 -1
- package/reactjs/components/CopyButton/utils/index.mjs +2 -4
- package/reactjs/components/DisplayAmount/DisplayAmount.d.ts +2 -3
- package/reactjs/components/DisplayAmount/DisplayAmount.js +1 -1
- package/reactjs/components/DisplayAmount/DisplayAmount.mjs +74 -82
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.d.ts +1 -1
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.js +1 -1
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.mjs +22 -31
- package/reactjs/components/DisplayAmount/components/AnimateNumber/index.js +0 -1
- package/reactjs/components/DisplayAmount/components/AnimateNumber/index.mjs +0 -1
- package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.d.ts +1 -2
- package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.js +1 -1
- package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.mjs +46 -52
- package/reactjs/components/DisplayAmount/components/index.js +0 -1
- package/reactjs/components/DisplayAmount/components/index.mjs +0 -1
- package/reactjs/components/DisplayAmount/index.js +1 -1
- package/reactjs/components/DisplayAmount/index.mjs +2 -4
- package/reactjs/components/DisplayAmount/utils/index.js +1 -1
- package/reactjs/components/DisplayAmount/utils/index.mjs +2 -4
- package/reactjs/components/DisplayAmount/utils/truncateAmount.js +1 -1
- package/reactjs/components/DisplayAmount/utils/truncateAmount.mjs +14 -16
- package/reactjs/components/Error/Error.d.ts +1 -2
- package/reactjs/components/Error/Error.js +1 -1
- package/reactjs/components/Error/Error.mjs +44 -66
- package/reactjs/components/Error/index.js +1 -1
- package/reactjs/components/Error/index.mjs +1 -3
- package/reactjs/components/SmallLoader/SmallLoader.d.ts +1 -1
- package/reactjs/components/SmallLoader/SmallLoader.js +1 -1
- package/reactjs/components/SmallLoader/SmallLoader.mjs +12 -15
- package/reactjs/components/SmallLoader/index.js +1 -1
- package/reactjs/components/SmallLoader/index.mjs +2 -4
- package/reactjs/components/ToggleDirection/ToggleDirection.d.ts +1 -1
- package/reactjs/components/ToggleDirection/ToggleDirection.js +1 -1
- package/reactjs/components/ToggleDirection/ToggleDirection.mjs +2 -24
- package/reactjs/components/TokenSelector/TokenSelector.d.ts +1 -2
- package/reactjs/components/TokenSelector/TokenSelector.js +1 -1
- package/reactjs/components/TokenSelector/TokenSelector.mjs +94 -151
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.d.ts +1 -2
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.js +1 -1
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.mjs +75 -83
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.d.ts +1 -1
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.js +1 -1
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.mjs +40 -51
- package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.d.ts +2 -3
- package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.js +1 -1
- package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.mjs +16 -12
- package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.js +1 -1
- package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.mjs +4 -4
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.d.ts +2 -3
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.js +1 -1
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.mjs +29 -41
- package/reactjs/components/TokenSelector/components/ChainSelect/types/chainSelectOption.js +0 -1
- package/reactjs/components/TokenSelector/components/ChainSelect/types/chainSelectOption.mjs +0 -1
- package/reactjs/components/TokenSelector/components/ChainSelect/types/partialChainOption.js +0 -1
- package/reactjs/components/TokenSelector/components/ChainSelect/types/partialChainOption.mjs +0 -1
- package/reactjs/components/TokenSelector/components/SelectContainer.d.ts +1 -2
- package/reactjs/components/TokenSelector/components/SelectContainer.js +1 -1
- package/reactjs/components/TokenSelector/components/SelectContainer.mjs +32 -37
- package/reactjs/components/TokenSelector/components/SelectContent.d.ts +2 -3
- package/reactjs/components/TokenSelector/components/SelectContent.js +1 -1
- package/reactjs/components/TokenSelector/components/SelectContent.mjs +78 -110
- package/reactjs/components/TokenSelector/components/SelectedOption.d.ts +1 -2
- package/reactjs/components/TokenSelector/components/SelectedOption.js +1 -1
- package/reactjs/components/TokenSelector/components/SelectedOption.mjs +26 -26
- package/reactjs/components/TokenSelector/components/TokenIcon.d.ts +1 -2
- package/reactjs/components/TokenSelector/components/TokenIcon.js +1 -1
- package/reactjs/components/TokenSelector/components/TokenIcon.mjs +54 -74
- package/reactjs/components/TokenSelector/components/TokenItem.d.ts +1 -2
- package/reactjs/components/TokenSelector/components/TokenItem.js +1 -1
- package/reactjs/components/TokenSelector/components/TokenItem.mjs +53 -66
- package/reactjs/components/TokenSelector/components/TokenList.d.ts +1 -2
- package/reactjs/components/TokenSelector/components/TokenList.js +1 -1
- package/reactjs/components/TokenSelector/components/TokenList.mjs +13 -21
- package/reactjs/components/TokenSelector/components/TokenSymbol.d.ts +1 -2
- package/reactjs/components/TokenSelector/components/TokenSymbol.js +1 -1
- package/reactjs/components/TokenSelector/components/TokenSymbol.mjs +15 -23
- package/reactjs/components/TokenSelector/index.js +1 -1
- package/reactjs/components/TokenSelector/index.mjs +2 -4
- package/reactjs/components/TransactionToast/TransactionToast.d.ts +1 -2
- package/reactjs/components/TransactionToast/TransactionToast.js +1 -1
- package/reactjs/components/TransactionToast/TransactionToast.mjs +43 -51
- package/reactjs/components/TransactionToast/TransactionToastContainer.d.ts +1 -2
- package/reactjs/components/TransactionToast/TransactionToastContainer.js +1 -1
- package/reactjs/components/TransactionToast/TransactionToastContainer.mjs +15 -18
- package/reactjs/components/TransactionToast/index.js +1 -1
- package/reactjs/components/TransactionToast/index.mjs +3 -6
- package/reactjs/components/TrimAddress/TrimAddress.d.ts +1 -1
- package/reactjs/components/TrimAddress/TrimAddress.js +1 -1
- package/reactjs/components/TrimAddress/TrimAddress.mjs +13 -22
- package/reactjs/components/TrimAddress/index.js +1 -1
- package/reactjs/components/TrimAddress/index.mjs +1 -3
- package/reactjs/components/base/MxButton/MxButton.d.ts +1 -2
- package/reactjs/components/base/MxButton/MxButton.js +1 -1
- package/reactjs/components/base/MxButton/MxButton.mjs +43 -70
- package/reactjs/components/base/MxButton/index.js +1 -1
- package/reactjs/components/base/MxButton/index.mjs +2 -4
- package/reactjs/components/base/MxCard/MxCard.d.ts +0 -1
- package/reactjs/components/base/MxCard/MxCard.js +1 -1
- package/reactjs/components/base/MxCard/MxCard.mjs +33 -54
- package/reactjs/components/base/MxCard/index.js +1 -1
- package/reactjs/components/base/MxCard/index.mjs +2 -4
- package/reactjs/components/base/MxCircleLoader/MxCircleLoader.d.ts +1 -1
- package/reactjs/components/base/MxCircleLoader/MxCircleLoader.js +1 -1
- package/reactjs/components/base/MxCircleLoader/MxCircleLoader.mjs +9 -26
- package/reactjs/components/base/MxCircleLoader/index.js +1 -1
- package/reactjs/components/base/MxCircleLoader/index.mjs +2 -4
- package/reactjs/components/base/MxLink/MxLink.d.ts +0 -1
- package/reactjs/components/base/MxLink/MxLink.js +1 -1
- package/reactjs/components/base/MxLink/MxLink.mjs +42 -68
- package/reactjs/components/base/MxLink/index.js +1 -1
- package/reactjs/components/base/MxLink/index.mjs +2 -4
- package/reactjs/components/base/MxSearch/MxSearch.js +1 -1
- package/reactjs/components/base/MxSearch/MxSearch.mjs +35 -65
- package/reactjs/components/base/MxSearch/index.js +1 -1
- package/reactjs/components/base/MxSearch/index.mjs +2 -4
- package/reactjs/components/base/MxSlideover/MxSlideover.d.ts +1 -2
- package/reactjs/components/base/MxSlideover/MxSlideover.js +1 -1
- package/reactjs/components/base/MxSlideover/MxSlideover.mjs +70 -76
- package/reactjs/components/base/MxSlideover/index.js +1 -1
- package/reactjs/components/base/MxSlideover/index.mjs +2 -4
- package/reactjs/components/base/MxTooltip/MxTooltip.d.ts +2 -3
- package/reactjs/components/base/MxTooltip/MxTooltip.js +1 -1
- package/reactjs/components/base/MxTooltip/MxTooltip.mjs +79 -119
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.d.ts +0 -1
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.js +1 -1
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.mjs +23 -31
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.js +1 -1
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.mjs +2 -4
- package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.d.ts +1 -2
- package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.js +1 -1
- package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.mjs +13 -25
- package/reactjs/components/base/MxTooltip/components/TooltipContent/index.js +1 -1
- package/reactjs/components/base/MxTooltip/components/TooltipContent/index.mjs +1 -3
- package/reactjs/components/base/MxTooltip/components/index.js +1 -1
- package/reactjs/components/base/MxTooltip/components/index.mjs +5 -6
- package/reactjs/components/base/MxTooltip/index.js +1 -1
- package/reactjs/components/base/MxTooltip/index.mjs +2 -4
- package/reactjs/components/base/index.js +1 -1
- package/reactjs/components/base/index.mjs +12 -13
- package/reactjs/components/index.js +1 -1
- package/reactjs/components/index.mjs +40 -53
- package/reactjs/constants/chains.js +1 -1
- package/reactjs/constants/chains.mjs +2 -35
- package/reactjs/constants/index.js +1 -1
- package/reactjs/constants/index.mjs +5 -12
- package/reactjs/context/Web3AppProvider.d.ts +6 -7
- package/reactjs/context/Web3AppProvider.js +1 -1
- package/reactjs/context/Web3AppProvider.mjs +41 -40
- package/reactjs/context/queryClient.d.ts +0 -1
- package/reactjs/context/queryClient.js +1 -1
- package/reactjs/context/queryClient.mjs +6 -6
- package/reactjs/context/useWeb3App.js +1 -1
- package/reactjs/context/useWeb3App.mjs +9 -10
- package/reactjs/helpers/index.js +1 -1
- package/reactjs/helpers/index.mjs +2 -6
- package/reactjs/helpers/resolveBridgeApiChainId.js +1 -1
- package/reactjs/helpers/resolveBridgeApiChainId.mjs +22 -23
- package/reactjs/hooks/index.js +1 -1
- package/reactjs/hooks/index.mjs +16 -35
- package/reactjs/hooks/tests/useGenericSignMessage.spec.js +1 -1
- package/reactjs/hooks/tests/useGenericSignMessage.spec.mjs +43 -50
- package/reactjs/hooks/tests/useSignTransaction.spec.js +1 -1
- package/reactjs/hooks/tests/useSignTransaction.spec.mjs +123 -150
- package/reactjs/hooks/useAccount.js +1 -1
- package/reactjs/hooks/useAccount.mjs +11 -11
- package/reactjs/hooks/useBalances.d.ts +0 -1
- package/reactjs/hooks/useBalances.js +1 -1
- package/reactjs/hooks/useBalances.mjs +31 -39
- package/reactjs/hooks/useBridgeApiChainId.js +1 -1
- package/reactjs/hooks/useBridgeApiChainId.mjs +8 -11
- package/reactjs/hooks/useBridgeFormik.d.ts +4 -5
- package/reactjs/hooks/useBridgeFormik.js +1 -1
- package/reactjs/hooks/useBridgeFormik.mjs +117 -143
- package/reactjs/hooks/useDebounce.js +1 -1
- package/reactjs/hooks/useDebounce.mjs +10 -10
- package/reactjs/hooks/useDisconnectOnChainTypeChange.d.ts +0 -1
- package/reactjs/hooks/useDisconnectOnChainTypeChange.js +1 -1
- package/reactjs/hooks/useDisconnectOnChainTypeChange.mjs +12 -12
- package/reactjs/hooks/useFetchBridgeData.d.ts +2 -2
- package/reactjs/hooks/useFetchBridgeData.js +1 -1
- package/reactjs/hooks/useFetchBridgeData.mjs +2 -44
- package/reactjs/hooks/useFetchTokens.d.ts +1 -1
- package/reactjs/hooks/useFetchTokens.js +1 -1
- package/reactjs/hooks/useFetchTokens.mjs +2 -92
- package/reactjs/hooks/useGenericSignMessage.js +1 -1
- package/reactjs/hooks/useGenericSignMessage.mjs +37 -54
- package/reactjs/hooks/useGetChainId.js +1 -1
- package/reactjs/hooks/useGetChainId.mjs +9 -9
- package/reactjs/hooks/useNamespaceAddress.d.ts +0 -1
- package/reactjs/hooks/useNamespaceAddress.js +1 -1
- package/reactjs/hooks/useNamespaceAddress.mjs +12 -15
- package/reactjs/hooks/useResolveTokenChain.d.ts +0 -1
- package/reactjs/hooks/useResolveTokenChain.js +1 -1
- package/reactjs/hooks/useResolveTokenChain.mjs +13 -15
- package/reactjs/hooks/useSendTransactions.d.ts +0 -1
- package/reactjs/hooks/useSendTransactions.js +1 -1
- package/reactjs/hooks/useSendTransactions.mjs +11 -20
- package/reactjs/hooks/useSignTransaction.d.ts +509 -0
- package/reactjs/hooks/useSignTransaction.js +1 -1
- package/reactjs/hooks/useSignTransaction.mjs +59 -85
- package/reactjs/hooks/useSuiConnect.js +1 -1
- package/reactjs/hooks/useSuiConnect.mjs +68 -67
- package/reactjs/hooks/validation/index.js +1 -1
- package/reactjs/hooks/validation/index.mjs +5 -10
- package/reactjs/hooks/validation/useAmountSchema.js +1 -1
- package/reactjs/hooks/validation/useAmountSchema.mjs +9 -11
- package/reactjs/hooks/validation/useSecondAmountSchema.js +1 -1
- package/reactjs/hooks/validation/useSecondAmountSchema.mjs +5 -8
- package/reactjs/hooks/validation/useTestHasEnoughFunds.d.ts +0 -1
- package/reactjs/hooks/validation/useTestHasEnoughFunds.js +1 -1
- package/reactjs/hooks/validation/useTestHasEnoughFunds.mjs +20 -27
- package/reactjs/hooks/validation/useTestIsConnected.d.ts +0 -1
- package/reactjs/hooks/validation/useTestIsConnected.js +1 -1
- package/reactjs/hooks/validation/useTestIsConnected.mjs +15 -20
- package/reactjs/index.d.ts +0 -1
- package/reactjs/index.js +1 -1
- package/reactjs/index.mjs +70 -157
- package/reactjs/init/index.js +1 -1
- package/reactjs/init/index.mjs +2 -5
- package/reactjs/init/init.d.ts +2 -3
- package/reactjs/init/init.js +1 -1
- package/reactjs/init/init.mjs +113 -112
- package/reactjs/init/isMobileInjectedDappBrowser.js +1 -1
- package/reactjs/init/isMobileInjectedDappBrowser.mjs +6 -7
- package/reactjs/queries/index.js +1 -1
- package/reactjs/queries/index.mjs +7 -17
- package/reactjs/queries/useCheckAccount.query.d.ts +1 -2
- package/reactjs/queries/useCheckAccount.query.js +1 -1
- package/reactjs/queries/useCheckAccount.query.mjs +35 -34
- package/reactjs/queries/useGetAllTokens.query.d.ts +1 -2
- package/reactjs/queries/useGetAllTokens.query.js +1 -1
- package/reactjs/queries/useGetAllTokens.query.mjs +24 -30
- package/reactjs/queries/useGetChains.query.d.ts +1 -2
- package/reactjs/queries/useGetChains.query.js +1 -1
- package/reactjs/queries/useGetChains.query.mjs +28 -31
- package/reactjs/queries/useGetHistory.query.d.ts +2 -3
- package/reactjs/queries/useGetHistory.query.js +1 -1
- package/reactjs/queries/useGetHistory.query.mjs +50 -64
- package/reactjs/queries/useGetMvxTokensBalances.query.d.ts +3 -4
- package/reactjs/queries/useGetMvxTokensBalances.query.js +1 -1
- package/reactjs/queries/useGetMvxTokensBalances.query.mjs +44 -56
- package/reactjs/queries/useGetNonMvxTokensBalances.query.d.ts +3 -4
- package/reactjs/queries/useGetNonMvxTokensBalances.query.js +1 -1
- package/reactjs/queries/useGetNonMvxTokensBalances.query.mjs +2 -75
- package/reactjs/queries/useGetRate.mutation.d.ts +0 -1
- package/reactjs/queries/useGetRate.mutation.js +1 -1
- package/reactjs/queries/useGetRate.mutation.mjs +12 -14
- package/reactjs/reexports.d.ts +2 -3
- package/reactjs/reexports.js +1 -1
- package/reactjs/reexports.mjs +3 -15
- package/reactjs/utils/delay.js +1 -1
- package/reactjs/utils/delay.mjs +5 -5
- package/reactjs/utils/formatAmount.js +1 -1
- package/reactjs/utils/formatAmount.mjs +11 -22
- package/reactjs/utils/getCleanStringAmount.js +1 -1
- package/reactjs/utils/getCleanStringAmount.mjs +11 -8
- package/reactjs/utils/getCompletePathname.js +1 -1
- package/reactjs/utils/getCompletePathname.mjs +5 -5
- package/reactjs/utils/getInitialTokens.js +1 -1
- package/reactjs/utils/getInitialTokens.mjs +10 -10
- package/reactjs/utils/hasEnoughFunds.js +1 -1
- package/reactjs/utils/hasEnoughFunds.mjs +9 -15
- package/reactjs/utils/index.js +1 -1
- package/reactjs/utils/index.mjs +12 -25
- package/reactjs/utils/isStringFloat.js +1 -1
- package/reactjs/utils/isStringFloat.mjs +10 -13
- package/reactjs/utils/mxClsx.d.ts +0 -1
- package/reactjs/utils/mxClsx.js +1 -1
- package/reactjs/utils/mxClsx.mjs +5 -5
- package/reactjs/utils/pipe.js +1 -1
- package/reactjs/utils/pipe.mjs +13 -20
- package/reactjs/utils/removeCommas.js +1 -1
- package/reactjs/utils/removeCommas.mjs +4 -4
- package/reactjs/utils/roundAmount.js +1 -1
- package/reactjs/utils/roundAmount.mjs +15 -19
- package/reactjs/utils/testNumber.js +1 -1
- package/reactjs/utils/testNumber.mjs +4 -4
- package/store/inMemoryStore.js +1 -1
- package/store/inMemoryStore.mjs +30 -34
- package/style.css +2 -1
- package/types/batchTransactions.d.ts +0 -1
- package/types/batchTransactions.js +0 -1
- package/types/batchTransactions.mjs +0 -1
- package/types/chainType.js +1 -1
- package/types/chainType.mjs +6 -4
- package/types/errors.js +1 -1
- package/types/errors.mjs +15 -19
- package/types/index.js +0 -1
- package/types/index.mjs +0 -1
- package/types/providerType.js +1 -1
- package/types/providerType.mjs +6 -4
- package/types/rate.d.ts +0 -1
- package/types/rate.js +0 -1
- package/types/rate.mjs +0 -1
- package/types/token.d.ts +0 -1
- package/types/token.js +0 -1
- package/types/token.mjs +0 -1
- package/types/transaction.d.ts +3 -4
- package/types/transaction.js +0 -1
- package/types/transaction.mjs +0 -1
- package/types/utxo.js +0 -1
- package/types/utxo.mjs +0 -1
- package/useFetchBridgeData-B5xt9GbW.js +2 -0
- package/useFetchBridgeData-C_hZjzd_.mjs +142 -0
- package/all-networks--dfVLHLJ.js +0 -2
- package/all-networks-Czd8zS1n.mjs +0 -4
- package/default-D0Jk5ROI.mjs +0 -4
- package/default-DbU6vPaB.js +0 -2
- package/react.esm-B0AMOHxa.js +0 -73
- package/react.esm-BxvJJ86Q.mjs +0 -9949
|
@@ -1,31 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"div",
|
|
20
|
-
{
|
|
21
|
-
className: "liq-truncate liq-text-left liq-text-neutral-100 uppercase",
|
|
22
|
-
"data-testid": "mx-address",
|
|
23
|
-
children: i
|
|
24
|
-
}
|
|
25
|
-
) : /* @__PURE__ */ e(o, { address: t, "data-testid": "mx-address" })
|
|
26
|
-
}
|
|
27
|
-
);
|
|
28
|
-
};
|
|
29
|
-
export {
|
|
30
|
-
c as AccountAddress
|
|
1
|
+
import { mxClsx as e } from "../../utils/mxClsx.mjs";
|
|
2
|
+
import { TrimAddress as t } from "../TrimAddress/TrimAddress.mjs";
|
|
3
|
+
import "../TrimAddress/index.mjs";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
//#region src/reactjs/components/AccountAddress/AccountAddress.tsx
|
|
6
|
+
var r = ({ address: r, username: i, showTag: a = !0, className: o = "" }) => {
|
|
7
|
+
let s = i ? `@${i.replace(".elrond", "")}` : void 0;
|
|
8
|
+
return /* @__PURE__ */ n("div", {
|
|
9
|
+
className: e("liq-flex liq-min-w-0 liq-flex-grow liq-overflow-hidden liq-leading-none liq-max-w-[10rem]", o),
|
|
10
|
+
children: s && a ? /* @__PURE__ */ n("div", {
|
|
11
|
+
className: "liq-truncate liq-text-left liq-text-neutral-100 uppercase",
|
|
12
|
+
"data-testid": "mx-address",
|
|
13
|
+
children: s
|
|
14
|
+
}) : /* @__PURE__ */ n(t, {
|
|
15
|
+
address: r,
|
|
16
|
+
"data-testid": "mx-address"
|
|
17
|
+
})
|
|
18
|
+
});
|
|
31
19
|
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { r as AccountAddress };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./AccountAddress.js");exports.AccountAddress=e.AccountAddress;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../utils/mxClsx.js"),t=require("../base/MxCard/MxCard.js");require("../base/index.js");let n=require("react/jsx-runtime");var r=({className:r,children:i})=>(0,n.jsx)(t.MxCard,{cardSize:`lg`,variant:`neutral-750`,className:e.mxClsx(`liq-flex liq-flex-col liq-gap-4 liq-outline liq-outline-transparent`,r),children:i});exports.AmountCard=r;
|
|
@@ -1,31 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const g = ({
|
|
15
|
-
className: r,
|
|
16
|
-
children: t
|
|
17
|
-
}) => /* @__PURE__ */ i(
|
|
18
|
-
m,
|
|
19
|
-
{
|
|
20
|
-
cardSize: "lg",
|
|
21
|
-
variant: "neutral-750",
|
|
22
|
-
className: o(
|
|
23
|
-
"liq-flex liq-flex-col liq-gap-4 liq-outline liq-outline-transparent",
|
|
24
|
-
r
|
|
25
|
-
),
|
|
26
|
-
children: t
|
|
27
|
-
}
|
|
28
|
-
);
|
|
29
|
-
export {
|
|
30
|
-
g as AmountCard
|
|
31
|
-
};
|
|
1
|
+
import { mxClsx as e } from "../../utils/mxClsx.mjs";
|
|
2
|
+
import { MxCard as t } from "../base/MxCard/MxCard.mjs";
|
|
3
|
+
import "../base/index.mjs";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
//#region src/reactjs/components/AmountCard/AmountCard.tsx
|
|
6
|
+
var r = ({ className: r, children: i }) => /* @__PURE__ */ n(t, {
|
|
7
|
+
cardSize: "lg",
|
|
8
|
+
variant: "neutral-750",
|
|
9
|
+
className: e("liq-flex liq-flex-col liq-gap-4 liq-outline liq-outline-transparent", r),
|
|
10
|
+
children: i
|
|
11
|
+
});
|
|
12
|
+
//#endregion
|
|
13
|
+
export { r as AmountCard };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./AmountCard.js");exports.AmountCard=e.AmountCard;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ChangeEvent, FocusEvent } from 'react';
|
|
2
|
-
|
|
3
2
|
export declare const AmountInput: ({ inputName, inputValue, disabled, amountError, omitDisableClass, className, onBlur, onInputDebounceChange, onInputChange }: {
|
|
4
3
|
inputName: string;
|
|
5
4
|
inputValue?: string;
|
|
@@ -10,4 +9,4 @@ export declare const AmountInput: ({ inputName, inputValue, disabled, amountErro
|
|
|
10
9
|
onBlur?: (e: FocusEvent<HTMLElement>) => void;
|
|
11
10
|
onInputDebounceChange?: (amount: string) => void;
|
|
12
11
|
onInputChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
13
|
-
}) => import("react
|
|
12
|
+
}) => import("react").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../utils/mxClsx.js");let t=require("react/jsx-runtime"),n=require("react-number-format");var r=({inputName:r,inputValue:i,disabled:a,amountError:o,omitDisableClass:s=!1,className:c,onBlur:l,onInputDebounceChange:u,onInputChange:d})=>{let f=e=>{e.stopPropagation();let{value:t}=e.target,n=t.replace(/,/g,``);d?.({...e,target:{name:r,value:n}})},p=e=>{e.key===`Enter`&&e.preventDefault()};return(0,t.jsxs)(`div`,{className:`liq-flex liq-w-full liq-flex-col liq-justify-between`,children:[(0,t.jsx)(`div`,{className:e.mxClsx(`liq-flex liq-text-base liq-max-w-none liq-w-full liq-bg-transparent liq-relative`,{"liq-disabled liq-animate-loader":a}),children:(0,t.jsx)(n.NumericFormat,{name:r,value:i,placeholder:`0`,allowLeadingZeros:!0,thousandSeparator:`,`,allowNegative:!1,disabled:a,className:e.mxClsx(`liq-text-3xl liq-leading-9 liq-min-h-12 liq-py-0 liq-w-full liq-h-full liq-border-none liq-font-medium liq-px-0 liq-outline-0 liq-bg-transparent focus-visible:liq-outline-none`,{"liq-disabled liq-animate-pulse":a&&!s},c),onChange:f,onValueChange:async({value:e})=>{u?.(e)},onBlur:l,onKeyDown:e=>p(e)})}),o&&(0,t.jsx)(`div`,{className:`liq-flex liq-min-h-[2rem] liq-items-end`,children:(0,t.jsx)(`div`,{className:`liq-text-danger liq-text-xs`,children:o})})]})};exports.AmountInput=r;
|
|
@@ -1,67 +1,49 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
{
|
|
48
|
-
"liq-disabled liq-animate-pulse": e && !o
|
|
49
|
-
},
|
|
50
|
-
n
|
|
51
|
-
),
|
|
52
|
-
onChange: d,
|
|
53
|
-
onValueChange: async ({ value: l }) => {
|
|
54
|
-
a == null || a(l);
|
|
55
|
-
},
|
|
56
|
-
onBlur: c,
|
|
57
|
-
onKeyDown: (l) => f(l)
|
|
58
|
-
}
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
),
|
|
62
|
-
r && /* @__PURE__ */ i("div", { className: "liq-flex liq-min-h-[2rem] liq-items-end", children: /* @__PURE__ */ i("div", { className: "liq-text-danger liq-text-xs", children: r }) })
|
|
63
|
-
] });
|
|
64
|
-
};
|
|
65
|
-
export {
|
|
66
|
-
N as AmountInput
|
|
1
|
+
import { mxClsx as e } from "../../utils/mxClsx.mjs";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import { NumericFormat as r } from "react-number-format";
|
|
4
|
+
//#region src/reactjs/components/AmountInput/AmountInput.tsx
|
|
5
|
+
var i = ({ inputName: i, inputValue: a, disabled: o, amountError: s, omitDisableClass: c = !1, className: l, onBlur: u, onInputDebounceChange: d, onInputChange: f }) => {
|
|
6
|
+
let p = (e) => {
|
|
7
|
+
e.stopPropagation();
|
|
8
|
+
let { value: t } = e.target, n = t.replace(/,/g, "");
|
|
9
|
+
f?.({
|
|
10
|
+
...e,
|
|
11
|
+
target: {
|
|
12
|
+
name: i,
|
|
13
|
+
value: n
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}, m = (e) => {
|
|
17
|
+
e.key === "Enter" && e.preventDefault();
|
|
18
|
+
};
|
|
19
|
+
return /* @__PURE__ */ n("div", {
|
|
20
|
+
className: "liq-flex liq-w-full liq-flex-col liq-justify-between",
|
|
21
|
+
children: [/* @__PURE__ */ t("div", {
|
|
22
|
+
className: e("liq-flex liq-text-base liq-max-w-none liq-w-full liq-bg-transparent liq-relative", { "liq-disabled liq-animate-loader": o }),
|
|
23
|
+
children: /* @__PURE__ */ t(r, {
|
|
24
|
+
name: i,
|
|
25
|
+
value: a,
|
|
26
|
+
placeholder: "0",
|
|
27
|
+
allowLeadingZeros: !0,
|
|
28
|
+
thousandSeparator: ",",
|
|
29
|
+
allowNegative: !1,
|
|
30
|
+
disabled: o,
|
|
31
|
+
className: e("liq-text-3xl liq-leading-9 liq-min-h-12 liq-py-0 liq-w-full liq-h-full liq-border-none liq-font-medium liq-px-0 liq-outline-0 liq-bg-transparent focus-visible:liq-outline-none", { "liq-disabled liq-animate-pulse": o && !c }, l),
|
|
32
|
+
onChange: p,
|
|
33
|
+
onValueChange: async ({ value: e }) => {
|
|
34
|
+
d?.(e);
|
|
35
|
+
},
|
|
36
|
+
onBlur: u,
|
|
37
|
+
onKeyDown: (e) => m(e)
|
|
38
|
+
})
|
|
39
|
+
}), s && /* @__PURE__ */ t("div", {
|
|
40
|
+
className: "liq-flex liq-min-h-[2rem] liq-items-end",
|
|
41
|
+
children: /* @__PURE__ */ t("div", {
|
|
42
|
+
className: "liq-text-danger liq-text-xs",
|
|
43
|
+
children: s
|
|
44
|
+
})
|
|
45
|
+
})]
|
|
46
|
+
});
|
|
67
47
|
};
|
|
48
|
+
//#endregion
|
|
49
|
+
export { i as AmountInput };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./AmountInput.js");exports.AmountInput=e.AmountInput;
|
|
@@ -28,5 +28,5 @@ interface BridgeFormProps {
|
|
|
28
28
|
*/
|
|
29
29
|
onNavigate?: (url: string, options?: object) => void;
|
|
30
30
|
}
|
|
31
|
-
export declare const BridgeForm: ({ mvxChainId, mvxAddress, username, callbackRoute, firstTokenIdentifier, secondTokenIdentifier, firstTokenAmount, secondTokenAmount, refetchTrigger, showHistory, forcedDestinationTokenSymbol, onSuccessfullySentTransaction, onSuccessfullySentMvxTransaction, onFailedSentMvxTransaction, onFailedSentTransaction, onMvxConnect, onMvxDisconnect, onHistoryClose, onNavigate }: BridgeFormProps) => import("react
|
|
31
|
+
export declare const BridgeForm: ({ mvxChainId, mvxAddress, username, callbackRoute, firstTokenIdentifier, secondTokenIdentifier, firstTokenAmount, secondTokenAmount, refetchTrigger, showHistory, forcedDestinationTokenSymbol, onSuccessfullySentTransaction, onSuccessfullySentMvxTransaction, onFailedSentMvxTransaction, onFailedSentTransaction, onMvxConnect, onMvxDisconnect, onHistoryClose, onNavigate }: BridgeFormProps) => import("react").JSX.Element;
|
|
32
32
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../context/useWeb3App.js"),t=require("./Deposit.js"),n=require("./Transfer.js");let r=require("react/jsx-runtime"),i=require("react");var a=({mvxChainId:a,mvxAddress:o,username:s,callbackRoute:c=`/`,firstTokenIdentifier:l,secondTokenIdentifier:u,firstTokenAmount:d,secondTokenAmount:f,refetchTrigger:p,showHistory:m,forcedDestinationTokenSymbol:h,onSuccessfullySentTransaction:g,onSuccessfullySentMvxTransaction:_,onFailedSentMvxTransaction:v,onFailedSentTransaction:y,onMvxConnect:b,onMvxDisconnect:x,onHistoryClose:S,onNavigate:C})=>{let{bridgeOnly:w}=e.useWeb3App(),[T,E]=(0,i.useState)(`deposit`),D=()=>{w!==!1&&E(e=>e===`deposit`?`withdraw`:`deposit`)};return T===`deposit`?(0,r.jsx)(t.Deposit,{mvxChainId:a,mvxAddress:o,username:s,callbackRoute:c,firstTokenIdentifier:l,secondTokenIdentifier:u,firstTokenAmount:d,secondTokenAmount:f,refetchTrigger:p,showHistory:m,forcedDestinationTokenSymbol:h,direction:T,onChangeDirection:D,onSuccessfullySentTransaction:g,onFailedSentTransaction:y,onHistoryClose:S,onMvxConnect:b,onMvxDisconnect:x,onNavigate:C}):(0,r.jsx)(n.Transfer,{mvxChainId:a,mvxAddress:o,username:s,callbackRoute:c,firstTokenIdentifier:l,secondTokenIdentifier:u,firstTokenAmount:d,secondTokenAmount:f,refetchTrigger:p,showHistory:m,forcedDestinationTokenSymbol:h,direction:T,onChangeDirection:D,onSuccessfullySentTransaction:_,onFailedSentTransaction:v,onHistoryClose:S,onMvxConnect:b,onMvxDisconnect:x,onNavigate:C})};exports.BridgeForm=a;
|
|
@@ -1,82 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
onMvxDisconnect: l,
|
|
53
|
-
onNavigate: D
|
|
54
|
-
}
|
|
55
|
-
) : /* @__PURE__ */ h(
|
|
56
|
-
z,
|
|
57
|
-
{
|
|
58
|
-
mvxChainId: t,
|
|
59
|
-
mvxAddress: i,
|
|
60
|
-
username: p,
|
|
61
|
-
callbackRoute: o,
|
|
62
|
-
firstTokenIdentifier: e,
|
|
63
|
-
secondTokenIdentifier: s,
|
|
64
|
-
firstTokenAmount: a,
|
|
65
|
-
secondTokenAmount: m,
|
|
66
|
-
refetchTrigger: n,
|
|
67
|
-
showHistory: c,
|
|
68
|
-
forcedDestinationTokenSymbol: f,
|
|
69
|
-
direction: r,
|
|
70
|
-
onChangeDirection: g,
|
|
71
|
-
onSuccessfullySentTransaction: j,
|
|
72
|
-
onFailedSentTransaction: w,
|
|
73
|
-
onHistoryClose: u,
|
|
74
|
-
onMvxConnect: d,
|
|
75
|
-
onMvxDisconnect: l,
|
|
76
|
-
onNavigate: D
|
|
77
|
-
}
|
|
78
|
-
);
|
|
79
|
-
};
|
|
80
|
-
export {
|
|
81
|
-
P as BridgeForm
|
|
1
|
+
import { useWeb3App as e } from "../../context/useWeb3App.mjs";
|
|
2
|
+
import { Deposit as t } from "./Deposit.mjs";
|
|
3
|
+
import { Transfer as n } from "./Transfer.mjs";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
import { useState as i } from "react";
|
|
6
|
+
//#region src/reactjs/components/BridgeForm/BridgeForm.tsx
|
|
7
|
+
var a = ({ mvxChainId: a, mvxAddress: o, username: s, callbackRoute: c = "/", firstTokenIdentifier: l, secondTokenIdentifier: u, firstTokenAmount: d, secondTokenAmount: f, refetchTrigger: p, showHistory: m, forcedDestinationTokenSymbol: h, onSuccessfullySentTransaction: g, onSuccessfullySentMvxTransaction: _, onFailedSentMvxTransaction: v, onFailedSentTransaction: y, onMvxConnect: b, onMvxDisconnect: x, onHistoryClose: S, onNavigate: C }) => {
|
|
8
|
+
let { bridgeOnly: w } = e(), [T, E] = i("deposit"), D = () => {
|
|
9
|
+
w !== !1 && E((e) => e === "deposit" ? "withdraw" : "deposit");
|
|
10
|
+
};
|
|
11
|
+
return T === "deposit" ? /* @__PURE__ */ r(t, {
|
|
12
|
+
mvxChainId: a,
|
|
13
|
+
mvxAddress: o,
|
|
14
|
+
username: s,
|
|
15
|
+
callbackRoute: c,
|
|
16
|
+
firstTokenIdentifier: l,
|
|
17
|
+
secondTokenIdentifier: u,
|
|
18
|
+
firstTokenAmount: d,
|
|
19
|
+
secondTokenAmount: f,
|
|
20
|
+
refetchTrigger: p,
|
|
21
|
+
showHistory: m,
|
|
22
|
+
forcedDestinationTokenSymbol: h,
|
|
23
|
+
direction: T,
|
|
24
|
+
onChangeDirection: D,
|
|
25
|
+
onSuccessfullySentTransaction: g,
|
|
26
|
+
onFailedSentTransaction: y,
|
|
27
|
+
onHistoryClose: S,
|
|
28
|
+
onMvxConnect: b,
|
|
29
|
+
onMvxDisconnect: x,
|
|
30
|
+
onNavigate: C
|
|
31
|
+
}) : /* @__PURE__ */ r(n, {
|
|
32
|
+
mvxChainId: a,
|
|
33
|
+
mvxAddress: o,
|
|
34
|
+
username: s,
|
|
35
|
+
callbackRoute: c,
|
|
36
|
+
firstTokenIdentifier: l,
|
|
37
|
+
secondTokenIdentifier: u,
|
|
38
|
+
firstTokenAmount: d,
|
|
39
|
+
secondTokenAmount: f,
|
|
40
|
+
refetchTrigger: p,
|
|
41
|
+
showHistory: m,
|
|
42
|
+
forcedDestinationTokenSymbol: h,
|
|
43
|
+
direction: T,
|
|
44
|
+
onChangeDirection: D,
|
|
45
|
+
onSuccessfullySentTransaction: _,
|
|
46
|
+
onFailedSentTransaction: v,
|
|
47
|
+
onHistoryClose: S,
|
|
48
|
+
onMvxConnect: b,
|
|
49
|
+
onMvxDisconnect: x,
|
|
50
|
+
onNavigate: C
|
|
51
|
+
});
|
|
82
52
|
};
|
|
53
|
+
//#endregion
|
|
54
|
+
export { a as BridgeForm };
|
|
@@ -19,5 +19,5 @@ interface BridgeFormProps {
|
|
|
19
19
|
onNavigate?: (url: string, options?: object) => void;
|
|
20
20
|
onChangeDirection: () => void;
|
|
21
21
|
}
|
|
22
|
-
export declare const Deposit: ({ mvxChainId, mvxAddress, username, callbackRoute, firstTokenIdentifier, secondTokenIdentifier, firstTokenAmount, secondTokenAmount, refetchTrigger, showHistory, forcedDestinationTokenSymbol, onSuccessfullySentTransaction, onFailedSentTransaction, onHistoryClose, onMvxConnect, onMvxDisconnect, onNavigate, onChangeDirection }: BridgeFormProps) => import("react
|
|
22
|
+
export declare const Deposit: ({ mvxChainId, mvxAddress, username, callbackRoute, firstTokenIdentifier, secondTokenIdentifier, firstTokenAmount, secondTokenAmount, refetchTrigger, showHistory, forcedDestinationTokenSymbol, onSuccessfullySentTransaction, onFailedSentTransaction, onHistoryClose, onMvxConnect, onMvxDisconnect, onNavigate, onChangeDirection }: BridgeFormProps) => import("react").JSX.Element;
|
|
23
23
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),Bs=require("@fortawesome/free-solid-svg-icons/faSpinner"),ys=require("@fortawesome/react-fontawesome"),As=require("@multiversx/sdk-dapp-utils/out/helpers/formatAmount"),ks=require("@reown/appkit/react"),Ns=require("@wagmi/core"),Ss=require("lodash/debounce"),t=require("react"),N=require("react-toastify"),ws=require("./hooks/useBridgeTokenSelection.js"),Ds=require("./utils/bridgeFormHelpers.js"),Me=require("../../../constants/index.js"),Ms=require("../../../helpers/getApiURL.js");require("../../constants/index.js");const O=require("../../../helpers/safeImageUrl.js");require("@solana/web3.js");require("bitcoinjs-lib");require("viem");const S=require("../../../types/chainType.js"),Es=require("../../context/useWeb3App.js"),G=require("../../helpers/resolveBridgeApiChainId.js"),Rs=require("../../hooks/useAccount.js"),Fs=require("../../hooks/useBridgeApiChainId.js"),w=require("../../hooks/useBridgeFormik.js"),Vs=require("../../hooks/useDisconnectOnChainTypeChange.js"),Ps=require("../../hooks/useFetchBridgeData.js"),Us=require("../../hooks/useGetChainId.js"),Hs=require("../../hooks/useNamespaceAddress.js"),Ls=require("../../hooks/useSendTransactions.js"),Ts=require("../../hooks/useSignTransaction.js"),Os=require("../../queries/useGetHistory.query.js"),Gs=require("../../queries/useGetRate.mutation.js"),Ee=require("../../utils/mxClsx.js"),Re=require("../AmountCard/AmountCard.js"),Fe=require("../AmountInput/AmountInput.js"),Ws=require("../base/MxButton/MxButton.js");require("../base/MxCard/MxCard.js");require("../base/MxLink/MxLink.js");require("../base/MxSearch/MxSearch.js");require("@fortawesome/free-solid-svg-icons/faClose");require("@headlessui/react");require("react-dom");require("react-popper");require("../base/MxTooltip/components/TooltipContainer/TooltipContainer.js");const Xs=require("../BridgeHistory/BridgeHistory.js"),zs=require("../Connect/BridgeConnectButton.js");require("wagmi");const Qs=require("../Connect/MvxConnectButton.js"),$s=require("../Connect/BridgeAccountDisplay.js"),Ks=require("../Connect/MvxAccountDisplay.js");require("@reown/appkit-controllers");const Ys=require("../ToggleDirection/ToggleDirection.js"),Ve=require("../TokenSelector/TokenSelector.js");let W;const Js=({mvxChainId:D,mvxAddress:l,username:Pe,callbackRoute:Ue="/",firstTokenIdentifier:He,secondTokenIdentifier:Le,firstTokenAmount:M,secondTokenAmount:j,refetchTrigger:Te,showHistory:Oe,forcedDestinationTokenSymbol:Ge,onSuccessfullySentTransaction:E,onFailedSentTransaction:b,onHistoryClose:R,onMvxConnect:ce,onMvxDisconnect:We,onNavigate:Xe,onChangeDirection:ze})=>{var Be,ye;const Qe=t.useRef(null),le=t.useRef(void 0),[X,$e]=t.useState(!1),[F,I]=t.useState(!1),[Ke,Ye]=t.useState(1),[z,Q]=t.useState(0),Je=Rs.useAccount(),{switchNetwork:ue}=ks.useAppKitNetwork(),de=Os.useInvalidateHistoryQuery(),{config:me,options:he,supportedChains:C,nativeAuthToken:V,bridgeOnly:Ze}=Es.useWeb3App(),$=Us.useGetChainId(),ge=Fs.useBridgeApiChainId(),{evmTokensWithBalances:es,mvxTokensWithBalances:ss,isTokensLoading:ts,isLoadingEvmTokensBalances:ns,isLoadingMvxTokensBalances:is,chains:v=[],isChainsLoading:rs}=Ps.useFetchBridgeData({refetchTrigger:Te,mvxAddress:l,mvxApiURL:he.mvxApiURL}),K=ts||ns||is||rs,as=t.useMemo(()=>C.find(n=>G.sameBridgeApiChainId(n.id,$)),[$,C]),c=t.useMemo(()=>v.find(n=>n.chainId.toString()===D.toString()),[$,v]),{evm:qe,solana:pe,bitcoin:xe,sui:be}=Ts.useSignTransaction(),fe=Ls.useSendTransactions(),{mutate:_e,data:d,isPending:B,error:f}=Gs.useGetRateMutation(),y=((Be=f==null?void 0:f.response)==null?void 0:Be.status)===400?(ye=f==null?void 0:f.response)==null?void 0:ye.data.message:void 0,os=t.useCallback(n=>{const x=C.find(u=>G.sameBridgeApiChainId(u.id,n.id));x&&ue(x)},[C,ue]),{firstToken:e,secondToken:a,fromOptions:A,toOptions:cs,selectedChainOption:r,onChangeFirstSelect:Y,onChangeSecondSelect:ls,handleChangeDirection:us}=ws.useBridgeTokenSelection({chains:v,activeChain:as,sdkChains:C,switchNetwork:os,fromTokens:es,toTokens:ss,firstTokenIdentifier:He,secondTokenIdentifier:Le,forcedDestinationTokenSymbol:Ge,isTokensLoading:K,callbackRoute:Ue,onNavigate:Xe}),ds=t.useMemo(()=>e?Me.MVX_CHAIN_IDS.includes(e.chainId.toString()):!1,[e==null?void 0:e.chainId]),ms=t.useMemo(()=>a?Me.MVX_CHAIN_IDS.includes(a.chainId.toString()):!1,[a==null?void 0:a.chainId]),[m,hs]=t.useState(M??""),[P,U]=t.useState(j??""),o=t.useMemo(()=>e?v.find(n=>G.sameBridgeApiChainId(n.chainId,e.chainId))??r:r,[e==null?void 0:e.chainId,v,r]),H=t.useMemo(()=>G.toBridgeApiChainId(e==null?void 0:e.chainId)??ge,[e==null?void 0:e.chainId,ge]);Vs.useDisconnectOnChainTypeChange(o==null?void 0:o.chainType);const q=Hs.useNamespaceAddress(o==null?void 0:o.chainType),je=q,Ie=Je.isConnected&&!!q,J=m!==""&&P!=="",Z=t.useCallback(Ss(async n=>{!n||!Number(n)||!q||!(e!=null&&e.address)||!(a!=null&&a.address)||!r||!H||_e({nativeAuthToken:V??"",body:{tokenIn:e.address,amountIn:n,fromChainId:H,tokenOut:a.address,toChainId:D}})},500),[q,H,e==null?void 0:e.address,a==null?void 0:a.address,r,D,V,_e]),h=t.useCallback(n=>{hs(()=>n)},[]),_=t.useCallback(n=>{U(()=>n)},[]),gs=t.useCallback(()=>{R==null||R()},[R]),qs=t.useCallback(()=>{const n=As.formatAmount({decimals:e==null?void 0:e.decimals,input:(e==null?void 0:e.balance)??"0",addCommas:!1,digits:4});p.setFieldValue("firstAmount",n),h(n)},[e==null?void 0:e.balance,e==null?void 0:e.decimals,h]),Ce=t.useCallback(async n=>{h(""),_(""),de(),de(),E==null||E(n)},[h,_,E]),ps=()=>{us(),ze()};t.useEffect(()=>{const n=le.current;if(le.current=r==null?void 0:r.chainId,!!n&&(r==null?void 0:r.chainId)!==(e==null?void 0:e.chainId)){const x=A==null?void 0:A.find(u=>u.chainId.toString()===(r==null?void 0:r.chainId));if(!x)return;Y(x)}},[r==null?void 0:r.chainId,e==null?void 0:e.chainId,A,Y]);const xs=t.useCallback(async({transactions:n,provider:x})=>{var Ae,ke,Ne;const u=[];I(!0),Q(()=>n.length);try{let k=-1;for(const i of n){++k;try{switch(Ds.resolveSigningChainType(i,o)){case S.ChainType.evm:{const g=await qe.signTransaction({...i,value:BigInt(i.value),gas:BigInt(i.gasLimit),account:je});if(!g||(u.push({...i,txHash:g}),k===n.length-1||!g))break;const T=await Ns.waitForTransactionReceipt(me,{confirmations:1,hash:g});console.info({transactionReceipt:T,hash:g});break}case S.ChainType.sol:if(!i.instructions||!i.feePayer)break;const oe=await pe.signTransaction({feePayer:i.feePayer,instructions:i.instructions,recentBlockhash:i.recentBlockhash});if(!oe)break;u.push({...i,txHash:oe});break;case S.ChainType.btc:if(!i.bitcoinParams){console.error("No bitcoin params");break}const vs=await xe.signTransaction(i.bitcoinParams);u.push({...i,txHash:vs});break;case S.ChainType.sui:{const g=(Ae=i.suiParams)==null?void 0:Ae.transactionBytes,T=(ke=i.suiParams)==null?void 0:ke.sender;if(!g||!T){console.error("No Sui transaction bytes or sender address");break}const De=await be.signTransaction({transaction:g,address:T});if(!De)break;u.push({...i,suiParams:{...i.suiParams,signature:De}});break}default:N.toast.error("Provider not supported"),I(!1);return}Q(()=>n.length-1-k)}catch{N.toast.dismiss(),N.toast.error("Transaction aborted"),b==null||b("Transaction aborted"),I(!1);return}}const{data:ae}=await fe({transactions:u,provider:x,url:Ms.getApiURL()??"",token:V??""}),Se=((Ne=ae.transactions)==null?void 0:Ne.map(i=>i.txHash).filter(i=>!!i))??[],we=u.map(i=>i.txHash).filter(i=>!!i),Cs=Se.length>0?Se:we.length>0?we:ae.batchId?[ae.batchId]:[];Ce(Cs),I(!1)}catch(k){console.error(k),N.toast.dismiss(),N.toast.error("Transaction cancelled"),b==null||b("Transaction cancelled"),I(!1),Q(0),fs(),h(""),_("")}},[o,je,me,h,_,V,Ce,fe,xe.signTransaction,qe.signTransaction,pe.signTransaction,be.signTransaction]),{formik:p,firstAmountError:ee,secondAmountError:se,fromChainError:te,senderAddressError:ne,receiverAddressError:ie,confirmRateError:re,handleBlur:L,handleChange:ve,handleSubmit:bs,resetSwapForm:fs}=w.useBridgeFormik({isMvxConnected:!!l,rate:d,sender:q??"",receiver:l??"",firstToken:e,firstAmount:m,fromChainId:H,toChainId:D,secondToken:a,secondAmount:P,setForceRefetchRate:Ye,senderChainType:o==null?void 0:o.chainType,receiverChainType:S.ChainType.mvx,onSubmit:xs}),_s=!!(ee||se||te||y||ne||ie||re),js=t.useMemo(()=>m!==""?y??ee:void 0,[ee,m,y]),Is=t.useMemo(()=>P!==""?te??se:void 0,[te,se,P]);return t.useEffect(()=>(m||U(""),Z(m),W&&clearInterval(W),W=setInterval(()=>{Z(m)},50*1e3),()=>clearInterval(W)),[m,Ke,Z]),t.useEffect(()=>{d!=null&&d.amountOut&&(p.setFieldValue(w.BridgeFormikValuesEnum.secondAmount,d.amountOut),U(d.amountOut))},[d==null?void 0:d.amountOut]),t.useEffect(()=>{y&&(p.setFieldValue(w.BridgeFormikValuesEnum.secondAmount,"0"),U("0"))},[y]),t.useEffect(()=>{M&&(p.setFieldValue(w.BridgeFormikValuesEnum.firstAmount,M),h(M))},[]),t.useEffect(()=>{j&&(p.setFieldValue(w.BridgeFormikValuesEnum.secondAmount,j),_(j))},[j]),s.jsx(s.Fragment,{children:s.jsxs("form",{ref:Qe,noValidate:!0,className:"liq-flex liq-flex-col liq-gap-1 liq-relative",autoComplete:"off",onSubmit:bs,children:[Oe&&s.jsx(Xs.BridgeHistory,{mvxAddress:l,onClose:gs}),s.jsxs(Re.AmountCard,{className:Ee.mxClsx("liq-pb-8 liq-pt-6 hover:liq-bg-neutral-700/50 sm:liq-pb-6",{"liq-pointer-events-none":X,"focus-within:liq-outline-neutral-700/75 hover:liq-outline-neutral-700/55 hover:focus-within:liq-outline-neutral-700/80":!X}),children:[s.jsxs("div",{className:"liq-flex liq-items-center liq-gap-1",children:[s.jsx("span",{children:"From"}),s.jsx($s.BridgeAccountDisplay,{disabled:B,activeChain:o})]}),ne&&s.jsx("div",{className:"liq-text-red-400 liq-text-xs liq-mt-1",children:ne}),s.jsxs("div",{className:"liq-flex liq-justify-between liq-gap-1",children:[s.jsx(Fe.AmountInput,{inputName:"firstAmount",inputValue:p.values.firstAmount,amountError:js,disabled:!1,onInputDebounceChange:h,onInputChange:ve,onBlur:L}),s.jsx(Ve.TokenSelector,{name:"firstToken",disabled:B,options:A,areOptionsLoading:K,isMvxSelector:ds,isDestination:!1,color:"neutral-850",onChange:Y,onBlur:L,onMaxBtnClick:qs,selectedOption:e,onTokenSelectorDisplay:n=>$e(n)})]})]}),s.jsx("div",{className:"liq-absolute liq-left-[6%] liq-top-[40%] -liq-mt-1 liq-z-10",children:Ze&&s.jsx(Ys.ToggleDirection,{onChangeDirection:ps})}),s.jsxs(Re.AmountCard,{className:Ee.mxClsx("liq-pb-8 liq-pt-6 hover:liq-bg-neutral-700/50 sm:liq-pb-6",{"liq-pointer-events-none":X}),children:[s.jsxs("div",{className:"liq-flex liq-items-center liq-gap-1",children:[s.jsx("span",{children:"To"}),s.jsx(Ks.MvxAccountDisplay,{accountAddress:l,chainIcon:O.safeImageUrl(c==null?void 0:c.pngUrl),username:Pe,accountExplorerUrl:`${he.mvxExplorerAddress}/accounts/${l}`,showTag:!0,onDisconnect:We,onConnect:ce})]}),ie&&s.jsx("div",{className:"liq-text-red-400 liq-text-xs liq-mt-1",children:ie}),re&&s.jsx("div",{className:"liq-text-red-400 liq-text-xs liq-mt-1",children:re}),s.jsxs("div",{className:"liq-flex liq-justify-between liq-gap-1",children:[s.jsx(Fe.AmountInput,{inputName:"secondAmount",inputValue:p.values.secondAmount,amountError:Is,disabled:!1,onInputDebounceChange:_,onInputChange:ve,onBlur:L}),s.jsx(Ve.TokenSelector,{name:"secondToken",disabled:B,omitDisableClass:!0,options:cs,areOptionsLoading:K,isMvxSelector:ms,color:"neutral-850",onChange:ls,onBlur:L,selectedOption:a})]})]}),s.jsxs("div",{className:"liq-flex liq-items-center liq-justify-center",children:[!l&&s.jsx(Qs.MvxConnectButton,{mvxAccountAddress:l,icon:O.safeImageUrl(c==null?void 0:c.pngUrl),onClick:ce}),l&&!Ie&&s.jsx(zs.BridgeConnectButton,{className:"liq-w-full liq-rounded-xl liq-bg-neutral-850/50 liq-px-8 liq-py-3 liq-font-semibold liq-text-primary-200 liq-transition-colors liq-duration-200 hover:enabled:liq-bg-primary-700/80 disabled:liq-opacity-50",disabled:B,activeChain:o}),l&&Ie&&s.jsxs(Ws.MxButton,{type:"submit",variant:"neutral-850",className:"liq-w-full disabled:liq-bg-neutral-850/50 liq-py-3 hover:enabled:liq-bg-primary !liq-text-primary-200",disabled:!J||B||!l||!q||_s||F,children:[J&&!F&&s.jsxs("div",{className:"liq-flex liq-justify-center liq-items-center liq-gap-2",children:[s.jsx("div",{children:"Deposit on "}),s.jsx("img",{src:O.safeImageUrl(c==null?void 0:c.pngUrl),alt:"",className:"liq-h-[1.5rem] liq-w-[1.5rem] liq-rounded-lg"}),s.jsx("div",{children:"MultiversX"})]}),!J&&!F&&s.jsx("span",{className:"liq-text-neutral-100",children:"Enter amount"}),F&&s.jsxs("div",{className:"liq-flex liq-justify-center liq-items-center liq-gap-2",children:[s.jsx(ys.FontAwesomeIcon,{icon:Bs.faSpinner,spin:!0,className:"liq-mx-1 liq-flex liq-items-center"}),s.jsx("div",{children:"Depositing on"}),s.jsx("img",{src:O.safeImageUrl(c==null?void 0:c.pngUrl),alt:"",className:"liq-h-[1.5rem] liq-w-[1.5rem] liq-rounded-lg"}),s.jsx("div",{children:"MultiversX"})]})]})]}),q&&z>0&&s.jsx("div",{className:"liq-flex liq-items-center liq-justify-center liq-text-neutral-300 liq-text-sm",children:s.jsxs("div",{children:["You will be asked to sign ",z," ",z>1?"transactions":"transaction"," ","on your wallet"]})})]})})};exports.Deposit=Js;
|
|
2
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunk-oiTVcehM.js"),t=require("../../../constants/index.js"),n=require("../../../helpers/getApiURL.js"),r=require("../../../helpers/safeImageUrl.js"),i=require("../../../types/chainType.js");require("../../../helpers/index.js");const a=require("../../utils/mxClsx.js"),o=require("../base/MxButton/MxButton.js");require("../base/index.js");const s=require("../AmountCard/AmountCard.js");require("../AmountCard/index.js");const c=require("../AmountInput/AmountInput.js");require("../AmountInput/index.js");const l=require("../../helpers/resolveBridgeApiChainId.js"),ee=require("./utils/bridgeFormHelpers.js"),te=require("./hooks/useBridgeTokenSelection.js"),ne=require("../../context/useWeb3App.js"),re=require("../../hooks/useAccount.js"),ie=require("../../hooks/useBridgeApiChainId.js"),u=require("../../hooks/useBridgeFormik.js"),ae=require("../../hooks/useDisconnectOnChainTypeChange.js"),oe=require("../../hooks/useGetChainId.js"),se=require("../../hooks/useSendTransactions.js"),ce=require("../../hooks/useSignTransaction.js"),le=require("../../../useFetchBridgeData-B5xt9GbW.js"),ue=require("../../hooks/useNamespaceAddress.js"),de=require("../../queries/useGetHistory.query.js"),fe=require("../../queries/useGetRate.mutation.js"),pe=require("../../../BridgeHistory-BU-L_w0l.js");require("../BridgeHistory/index.js");const me=require("../Connect/BridgeConnectButton.js"),he=require("../Connect/MvxConnectButton.js"),ge=require("../Connect/BridgeAccountDisplay.js"),_e=require("../Connect/MvxAccountDisplay.js");require("../Connect/index.js");const ve=require("../../../ToggleDirection-CZ9-ZD7Y.js"),ye=require("../TokenSelector/TokenSelector.js");require("../TokenSelector/index.js");let d=require("react/jsx-runtime"),f=require("react"),be=require("@fortawesome/react-fontawesome"),xe=require("@fortawesome/free-solid-svg-icons/faSpinner"),Se=require("@multiversx/sdk-dapp-utils/out/helpers/formatAmount"),Ce=require("@reown/appkit/react"),we=require("@wagmi/core"),p=require("lodash/debounce");p=e.n(p);let m=require("react-toastify");var h,g=({mvxChainId:e,mvxAddress:g,username:Te,callbackRoute:Ee=`/`,firstTokenIdentifier:De,secondTokenIdentifier:Oe,firstTokenAmount:_,secondTokenAmount:v,refetchTrigger:ke,showHistory:Ae,forcedDestinationTokenSymbol:je,onSuccessfullySentTransaction:Me,onFailedSentTransaction:Ne,onHistoryClose:Pe,onMvxConnect:Fe,onMvxDisconnect:Ie,onNavigate:Le,onChangeDirection:Re})=>{let ze=(0,f.useRef)(null),Be=(0,f.useRef)(void 0),[y,Ve]=(0,f.useState)(!1),[b,x]=(0,f.useState)(!1),[He,Ue]=(0,f.useState)(1),[S,C]=(0,f.useState)(0),We=re.useAccount(),{switchNetwork:Ge}=(0,Ce.useAppKitNetwork)(),Ke=de.useInvalidateHistoryQuery(),{config:qe,options:Je,supportedChains:w,nativeAuthToken:T,bridgeOnly:Ye}=ne.useWeb3App(),E=oe.useGetChainId(),Xe=ie.useBridgeApiChainId(),{evmTokensWithBalances:Ze,mvxTokensWithBalances:Qe,isTokensLoading:$e,isLoadingEvmTokensBalances:et,isLoadingMvxTokensBalances:tt,chains:D=[],isChainsLoading:nt}=le.t({refetchTrigger:ke,mvxAddress:g,mvxApiURL:Je.mvxApiURL}),O=$e||et||tt||nt,rt=(0,f.useMemo)(()=>w.find(e=>l.sameBridgeApiChainId(e.id,E)),[E,w]),k=(0,f.useMemo)(()=>D.find(t=>t.chainId.toString()===e.toString()),[E,D]),{evm:it,solana:at,bitcoin:ot,sui:st}=ce.useSignTransaction(),ct=se.useSendTransactions(),{mutate:lt,data:A,isPending:j,error:ut}=fe.useGetRateMutation(),M=ut?.response?.status===400?ut?.response?.data.message:void 0,{firstToken:N,secondToken:P,fromOptions:F,toOptions:dt,selectedChainOption:I,onChangeFirstSelect:L,onChangeSecondSelect:ft,handleChangeDirection:pt}=te.useBridgeTokenSelection({chains:D,activeChain:rt,sdkChains:w,switchNetwork:(0,f.useCallback)(e=>{let t=w.find(t=>l.sameBridgeApiChainId(t.id,e.id));t&&Ge(t)},[w,Ge]),fromTokens:Ze,toTokens:Qe,firstTokenIdentifier:De,secondTokenIdentifier:Oe,forcedDestinationTokenSymbol:je,isTokensLoading:O,callbackRoute:Ee,onNavigate:Le}),mt=(0,f.useMemo)(()=>N?t.MVX_CHAIN_IDS.includes(N.chainId.toString()):!1,[N?.chainId]),ht=(0,f.useMemo)(()=>P?t.MVX_CHAIN_IDS.includes(P.chainId.toString()):!1,[P?.chainId]),[R,gt]=(0,f.useState)(_??``),[z,B]=(0,f.useState)(v??``),V=(0,f.useMemo)(()=>N?D.find(e=>l.sameBridgeApiChainId(e.chainId,N.chainId))??I:I,[N?.chainId,D,I]),H=(0,f.useMemo)(()=>l.toBridgeApiChainId(N?.chainId)??Xe,[N?.chainId,Xe]);ae.useDisconnectOnChainTypeChange(V?.chainType);let U=ue.useNamespaceAddress(V?.chainType),_t=U,vt=We.isConnected&&!!U,W=R!==``&&z!==``,G=(0,f.useCallback)((0,p.default)(async t=>{!t||!Number(t)||!U||!N?.address||!P?.address||!I||!H||lt({nativeAuthToken:T??``,body:{tokenIn:N.address,amountIn:t,fromChainId:H,tokenOut:P.address,toChainId:e}})},500),[U,H,N?.address,P?.address,I,e,T,lt]),K=(0,f.useCallback)(e=>{gt(()=>e)},[]),q=(0,f.useCallback)(e=>{B(()=>e)},[]),yt=(0,f.useCallback)(()=>{Pe?.()},[Pe]),bt=(0,f.useCallback)(()=>{let e=(0,Se.formatAmount)({decimals:N?.decimals,input:N?.balance??`0`,addCommas:!1,digits:4});J.setFieldValue(`firstAmount`,e),K(e)},[N?.balance,N?.decimals,K]),xt=(0,f.useCallback)(async e=>{K(``),q(``),Ke(),Ke(),Me?.(e)},[K,q,Me]),St=()=>{pt(),Re()};(0,f.useEffect)(()=>{let e=Be.current;if(Be.current=I?.chainId,e&&I?.chainId!==N?.chainId){let e=F?.find(e=>e.chainId.toString()===I?.chainId);if(!e)return;L(e)}},[I?.chainId,N?.chainId,F,L]);let Ct=(0,f.useCallback)(async({transactions:e,provider:t})=>{let r=[];x(!0),C(()=>e.length);try{let a=-1;for(let t of e){++a;try{switch(ee.resolveSigningChainType(t,V)){case i.ChainType.evm:{let n=await it.signTransaction({...t,value:BigInt(t.value),gas:BigInt(t.gasLimit),account:_t});if(!n||(r.push({...t,txHash:n}),a===e.length-1||!n))break;let i=await(0,we.waitForTransactionReceipt)(qe,{confirmations:1,hash:n});console.info({transactionReceipt:i,hash:n});break}case i.ChainType.sol:if(!t.instructions||!t.feePayer)break;let n=await at.signTransaction({feePayer:t.feePayer,instructions:t.instructions,recentBlockhash:t.recentBlockhash});if(!n)break;r.push({...t,txHash:n});break;case i.ChainType.btc:if(!t.bitcoinParams){console.error(`No bitcoin params`);break}let o=await ot.signTransaction(t.bitcoinParams);r.push({...t,txHash:o});break;case i.ChainType.sui:{let e=t.suiParams?.transactionBytes,n=t.suiParams?.sender;if(!e||!n){console.error(`No Sui transaction bytes or sender address`);break}let i=await st.signTransaction({transaction:e,address:n});if(!i)break;r.push({...t,suiParams:{...t.suiParams,signature:i}});break}default:m.toast.error(`Provider not supported`),x(!1);return}C(()=>e.length-1-a)}catch{m.toast.dismiss(),m.toast.error(`Transaction aborted`),Ne?.(`Transaction aborted`),x(!1);return}}let{data:o}=await ct({transactions:r,provider:t,url:n.getApiURL()??``,token:T??``}),s=o.transactions?.map(e=>e.txHash).filter(e=>!!e)??[],c=r.map(e=>e.txHash).filter(e=>!!e);xt(s.length>0?s:c.length>0?c:o.batchId?[o.batchId]:[]),x(!1)}catch(e){console.error(e),m.toast.dismiss(),m.toast.error(`Transaction cancelled`),Ne?.(`Transaction cancelled`),x(!1),C(0),Ot(),K(``),q(``)}},[V,_t,qe,K,q,T,xt,ct,ot.signTransaction,it.signTransaction,at.signTransaction,st.signTransaction]),{formik:J,firstAmountError:Y,secondAmountError:X,fromChainError:Z,senderAddressError:Q,receiverAddressError:wt,confirmRateError:Tt,handleBlur:$,handleChange:Et,handleSubmit:Dt,resetSwapForm:Ot}=u.useBridgeFormik({isMvxConnected:!!g,rate:A,sender:U??``,receiver:g??``,firstToken:N,firstAmount:R,fromChainId:H,toChainId:e,secondToken:P,secondAmount:z,setForceRefetchRate:Ue,senderChainType:V?.chainType,receiverChainType:i.ChainType.mvx,onSubmit:Ct}),kt=!!(Y||X||Z||M||Q||wt||Tt),At=(0,f.useMemo)(()=>R===``?void 0:M??Y,[Y,R,M]),jt=(0,f.useMemo)(()=>z===``?void 0:Z??X,[Z,X,z]);return(0,f.useEffect)(()=>(R||B(``),G(R),h&&clearInterval(h),h=setInterval(()=>{G(R)},50*1e3),()=>clearInterval(h)),[R,He,G]),(0,f.useEffect)(()=>{A?.amountOut&&(J.setFieldValue(u.BridgeFormikValuesEnum.secondAmount,A.amountOut),B(A.amountOut))},[A?.amountOut]),(0,f.useEffect)(()=>{M&&(J.setFieldValue(u.BridgeFormikValuesEnum.secondAmount,`0`),B(`0`))},[M]),(0,f.useEffect)(()=>{_&&(J.setFieldValue(u.BridgeFormikValuesEnum.firstAmount,_),K(_))},[]),(0,f.useEffect)(()=>{v&&(J.setFieldValue(u.BridgeFormikValuesEnum.secondAmount,v),q(v))},[v]),(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(`form`,{ref:ze,noValidate:!0,className:`liq-flex liq-flex-col liq-gap-1 liq-relative`,autoComplete:`off`,onSubmit:Dt,children:[Ae&&(0,d.jsx)(pe.t,{mvxAddress:g,onClose:yt}),(0,d.jsxs)(s.AmountCard,{className:a.mxClsx(`liq-pb-8 liq-pt-6 hover:liq-bg-neutral-700/50 sm:liq-pb-6`,{"liq-pointer-events-none":y,"focus-within:liq-outline-neutral-700/75 hover:liq-outline-neutral-700/55 hover:focus-within:liq-outline-neutral-700/80":!y}),children:[(0,d.jsxs)(`div`,{className:`liq-flex liq-items-center liq-gap-1`,children:[(0,d.jsx)(`span`,{children:`From`}),(0,d.jsx)(ge.BridgeAccountDisplay,{disabled:j,activeChain:V})]}),Q&&(0,d.jsx)(`div`,{className:`liq-text-red-400 liq-text-xs liq-mt-1`,children:Q}),(0,d.jsxs)(`div`,{className:`liq-flex liq-justify-between liq-gap-1`,children:[(0,d.jsx)(c.AmountInput,{inputName:`firstAmount`,inputValue:J.values.firstAmount,amountError:At,disabled:!1,onInputDebounceChange:K,onInputChange:Et,onBlur:$}),(0,d.jsx)(ye.TokenSelector,{name:`firstToken`,disabled:j,options:F,areOptionsLoading:O,isMvxSelector:mt,isDestination:!1,color:`neutral-850`,onChange:L,onBlur:$,onMaxBtnClick:bt,selectedOption:N,onTokenSelectorDisplay:e=>Ve(e)})]})]}),(0,d.jsx)(`div`,{className:`liq-absolute liq-left-[6%] liq-top-[40%] -liq-mt-1 liq-z-10`,children:Ye&&(0,d.jsx)(ve.t,{onChangeDirection:St})}),(0,d.jsxs)(s.AmountCard,{className:a.mxClsx(`liq-pb-8 liq-pt-6 hover:liq-bg-neutral-700/50 sm:liq-pb-6`,{"liq-pointer-events-none":y}),children:[(0,d.jsxs)(`div`,{className:`liq-flex liq-items-center liq-gap-1`,children:[(0,d.jsx)(`span`,{children:`To`}),(0,d.jsx)(_e.MvxAccountDisplay,{accountAddress:g,chainIcon:r.safeImageUrl(k?.pngUrl),username:Te,accountExplorerUrl:`${Je.mvxExplorerAddress}/accounts/${g}`,showTag:!0,onDisconnect:Ie,onConnect:Fe})]}),wt&&(0,d.jsx)(`div`,{className:`liq-text-red-400 liq-text-xs liq-mt-1`,children:wt}),Tt&&(0,d.jsx)(`div`,{className:`liq-text-red-400 liq-text-xs liq-mt-1`,children:Tt}),(0,d.jsxs)(`div`,{className:`liq-flex liq-justify-between liq-gap-1`,children:[(0,d.jsx)(c.AmountInput,{inputName:`secondAmount`,inputValue:J.values.secondAmount,amountError:jt,disabled:!1,onInputDebounceChange:q,onInputChange:Et,onBlur:$}),(0,d.jsx)(ye.TokenSelector,{name:`secondToken`,disabled:j,omitDisableClass:!0,options:dt,areOptionsLoading:O,isMvxSelector:ht,color:`neutral-850`,onChange:ft,onBlur:$,selectedOption:P})]})]}),(0,d.jsxs)(`div`,{className:`liq-flex liq-items-center liq-justify-center`,children:[!g&&(0,d.jsx)(he.MvxConnectButton,{mvxAccountAddress:g,icon:r.safeImageUrl(k?.pngUrl),onClick:Fe}),g&&!vt&&(0,d.jsx)(me.BridgeConnectButton,{className:`liq-w-full liq-rounded-xl liq-bg-neutral-850/50 liq-px-8 liq-py-3 liq-font-semibold liq-text-primary-200 liq-transition-colors liq-duration-200 hover:enabled:liq-bg-primary-700/80 disabled:liq-opacity-50`,disabled:j,activeChain:V}),g&&vt&&(0,d.jsxs)(o.MxButton,{type:`submit`,variant:`neutral-850`,className:`liq-w-full disabled:liq-bg-neutral-850/50 liq-py-3 hover:enabled:liq-bg-primary !liq-text-primary-200`,disabled:!W||j||!g||!U||kt||b,children:[W&&!b&&(0,d.jsxs)(`div`,{className:`liq-flex liq-justify-center liq-items-center liq-gap-2`,children:[(0,d.jsx)(`div`,{children:`Deposit on `}),(0,d.jsx)(`img`,{src:r.safeImageUrl(k?.pngUrl),alt:``,className:`liq-h-[1.5rem] liq-w-[1.5rem] liq-rounded-lg`}),(0,d.jsx)(`div`,{children:`MultiversX`})]}),!W&&!b&&(0,d.jsx)(`span`,{className:`liq-text-neutral-100`,children:`Enter amount`}),b&&(0,d.jsxs)(`div`,{className:`liq-flex liq-justify-center liq-items-center liq-gap-2`,children:[(0,d.jsx)(be.FontAwesomeIcon,{icon:xe.faSpinner,spin:!0,className:`liq-mx-1 liq-flex liq-items-center`}),(0,d.jsx)(`div`,{children:`Depositing on`}),(0,d.jsx)(`img`,{src:r.safeImageUrl(k?.pngUrl),alt:``,className:`liq-h-[1.5rem] liq-w-[1.5rem] liq-rounded-lg`}),(0,d.jsx)(`div`,{children:`MultiversX`})]})]})]}),U&&S>0&&(0,d.jsx)(`div`,{className:`liq-flex liq-items-center liq-justify-center liq-text-neutral-300 liq-text-sm`,children:(0,d.jsxs)(`div`,{children:[`You will be asked to sign `,S,` `,S>1?`transactions`:`transaction`,` `,`on your wallet`]})})]})})};exports.Deposit=g;
|