@multiversx/sdk-dapp-liquidity 2.0.0 → 2.1.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/all-networks--dfVLHLJ.js +2 -0
- package/all-networks-Czd8zS1n.mjs +4 -0
- package/api/checkAccount.js +1 -21
- package/api/checkAccount.mjs +13 -13
- package/api/confirmRate.js +1 -29
- package/api/confirmRate.mjs +17 -22
- package/api/getChains.js +1 -17
- package/api/getChains.mjs +10 -10
- package/api/getRate.js +1 -27
- package/api/getRate.mjs +17 -20
- package/api/getTokens.js +1 -22
- package/api/getTokens.mjs +14 -15
- package/api/getTokensBalances.js +1 -21
- package/api/getTokensBalances.mjs +13 -13
- package/api/getTransactions.js +1 -38
- package/api/getTransactions.mjs +25 -31
- package/api/index.js +1 -18
- package/api/index.mjs +16 -16
- package/api/sendTransactions.js +1 -32
- package/api/sendTransactions.mjs +19 -19
- package/api/tests/confirmRate.spec.js +1 -130
- package/api/tests/confirmRate.spec.mjs +44 -58
- package/api/tests/getChains.spec.js +1 -43
- package/api/tests/getChains.spec.mjs +15 -18
- package/api/tests/getRate.spec.js +1 -87
- package/api/tests/getRate.spec.mjs +35 -49
- package/api/tests/getTokens.spec.js +1 -68
- package/api/tests/getTokens.spec.mjs +23 -29
- package/api/tests/getTransactions.spec.js +1 -94
- package/api/tests/getTransactions.spec.mjs +35 -51
- package/api/tests/sendTransactions.spec.js +1 -96
- package/api/tests/sendTransactions.spec.mjs +44 -52
- package/constants/index.js +1 -4
- package/constants/index.mjs +2 -2
- package/default-D0Jk5ROI.mjs +4 -0
- package/default-DbU6vPaB.js +2 -0
- package/helpers/assertRateConfirmationMatchesIntent.d.ts +8 -0
- package/helpers/assertRateConfirmationMatchesIntent.js +2 -0
- package/helpers/assertRateConfirmationMatchesIntent.mjs +20 -0
- package/helpers/base64Utils.js +1 -31
- package/helpers/base64Utils.mjs +14 -24
- package/helpers/decodeLoginToken.js +1 -27
- package/helpers/decodeLoginToken.mjs +13 -18
- package/helpers/decodeToken.js +1 -39
- package/helpers/decodeToken.mjs +20 -31
- package/helpers/getApiURL.js +1 -7
- package/helpers/getApiURL.mjs +3 -5
- package/helpers/getBridgeURL.js +1 -7
- package/helpers/getBridgeURL.mjs +3 -5
- package/helpers/getDisplayName.js +1 -11
- package/helpers/getDisplayName.mjs +3 -8
- package/helpers/getMvxApiURL.js +1 -7
- package/helpers/getMvxApiURL.mjs +3 -5
- package/helpers/getMvxChainId.js +1 -7
- package/helpers/getMvxChainId.mjs +3 -5
- package/helpers/getMvxExplorerAddress.js +1 -7
- package/helpers/getMvxExplorerAddress.mjs +3 -5
- package/helpers/index.d.ts +2 -0
- package/helpers/index.js +1 -22
- package/helpers/index.mjs +24 -20
- package/helpers/safeImageUrl.d.ts +1 -0
- package/helpers/safeImageUrl.js +2 -0
- package/helpers/safeImageUrl.mjs +13 -0
- package/helpers/serializeTransaction.js +1 -8
- package/helpers/serializeTransaction.mjs +3 -5
- package/helpers/tests/assertRateConfirmationMatchesIntent.spec.d.ts +1 -0
- package/helpers/tests/assertRateConfirmationMatchesIntent.spec.js +2 -0
- package/helpers/tests/assertRateConfirmationMatchesIntent.spec.mjs +52 -0
- package/helpers/tests/base64Utils.spec.js +1 -29
- package/helpers/tests/base64Utils.spec.mjs +11 -24
- package/helpers/tests/decodeLoginToken.spec.js +1 -34
- package/helpers/tests/decodeLoginToken.spec.mjs +13 -24
- package/helpers/tests/decodeToken.spec.js +1 -27
- package/helpers/tests/decodeToken.spec.mjs +7 -12
- package/helpers/tests/safeImageUrl.spec.d.ts +1 -0
- package/helpers/tests/safeImageUrl.spec.js +2 -0
- package/helpers/tests/safeImageUrl.spec.mjs +32 -0
- package/helpers/tests/serializeTransaction.spec.d.ts +1 -0
- package/helpers/tests/serializeTransaction.spec.js +2 -0
- package/helpers/tests/serializeTransaction.spec.mjs +24 -0
- package/index.js +1 -228
- package/index.mjs +196 -192
- package/package.json +14 -9
- package/react.esm-B0AMOHxa.js +73 -0
- package/react.esm-BxvJJ86Q.mjs +9949 -0
- package/reactjs/adapters/SuiAdapter.d.ts +14 -0
- package/reactjs/adapters/SuiAdapter.js +1 -349
- package/reactjs/adapters/SuiAdapter.mjs +171 -199
- package/reactjs/components/AccountAddress/AccountAddress.js +1 -31
- package/reactjs/components/AccountAddress/AccountAddress.mjs +16 -16
- package/reactjs/components/AccountAddress/index.js +1 -4
- package/reactjs/components/AccountAddress/index.mjs +2 -2
- package/reactjs/components/AmountCard/AmountCard.js +1 -33
- package/reactjs/components/AmountCard/AmountCard.mjs +19 -21
- package/reactjs/components/AmountCard/index.js +1 -4
- package/reactjs/components/AmountCard/index.mjs +2 -2
- package/reactjs/components/AmountInput/AmountInput.js +1 -71
- package/reactjs/components/AmountInput/AmountInput.mjs +42 -46
- package/reactjs/components/AmountInput/index.js +1 -4
- package/reactjs/components/AmountInput/index.mjs +2 -2
- package/reactjs/components/BridgeForm/BridgeForm.d.ts +9 -0
- package/reactjs/components/BridgeForm/BridgeForm.js +1 -89
- package/reactjs/components/BridgeForm/BridgeForm.mjs +72 -79
- package/reactjs/components/BridgeForm/Deposit.js +1 -673
- package/reactjs/components/BridgeForm/Deposit.mjs +381 -503
- package/reactjs/components/BridgeForm/Transfer.js +1 -559
- package/reactjs/components/BridgeForm/Transfer.mjs +316 -427
- package/reactjs/components/BridgeForm/hooks/useBridgeAmounts.js +1 -78
- package/reactjs/components/BridgeForm/hooks/useBridgeAmounts.mjs +47 -70
- package/reactjs/components/BridgeForm/hooks/useBridgeRateFetching.js +1 -58
- package/reactjs/components/BridgeForm/hooks/useBridgeRateFetching.mjs +36 -47
- package/reactjs/components/BridgeForm/hooks/useBridgeTokenSelection.js +1 -266
- package/reactjs/components/BridgeForm/hooks/useBridgeTokenSelection.mjs +163 -231
- package/reactjs/components/BridgeForm/index.js +1 -4
- package/reactjs/components/BridgeForm/index.mjs +2 -2
- package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.js +1 -76
- package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.mjs +35 -65
- package/reactjs/components/BridgeHistory/BridgeHistory.js +1 -367
- package/reactjs/components/BridgeHistory/BridgeHistory.mjs +177 -193
- package/reactjs/components/BridgeHistory/index.js +1 -4
- package/reactjs/components/BridgeHistory/index.mjs +2 -2
- package/reactjs/components/Connect/BridgeAccountDisplay.js +1 -150
- package/reactjs/components/Connect/BridgeAccountDisplay.mjs +99 -115
- package/reactjs/components/Connect/BridgeConnectButton.js +1 -34
- package/reactjs/components/Connect/BridgeConnectButton.mjs +20 -19
- package/reactjs/components/Connect/ChainSelectConnect.js +1 -144
- package/reactjs/components/Connect/ChainSelectConnect.mjs +70 -83
- package/reactjs/components/Connect/CustomConnectButton.js +1 -40
- package/reactjs/components/Connect/CustomConnectButton.mjs +24 -30
- package/reactjs/components/Connect/MvxAccountDisplay.js +1 -97
- package/reactjs/components/Connect/MvxAccountDisplay.mjs +47 -50
- package/reactjs/components/Connect/MvxConnectButton.js +1 -43
- package/reactjs/components/Connect/MvxConnectButton.mjs +35 -40
- package/reactjs/components/Connect/SwitchChainButton.js +1 -29
- package/reactjs/components/Connect/SwitchChainButton.mjs +15 -18
- package/reactjs/components/Connect/index.js +1 -16
- package/reactjs/components/Connect/index.mjs +14 -14
- package/reactjs/components/CopyButton/CopyButton.js +1 -46
- package/reactjs/components/CopyButton/CopyButton.mjs +33 -36
- package/reactjs/components/CopyButton/index.js +1 -4
- package/reactjs/components/CopyButton/index.mjs +2 -2
- package/reactjs/components/CopyButton/utils/copyToClipboard.js +1 -38
- package/reactjs/components/CopyButton/utils/copyToClipboard.mjs +20 -32
- package/reactjs/components/CopyButton/utils/index.js +1 -4
- package/reactjs/components/CopyButton/utils/index.mjs +2 -2
- package/reactjs/components/DisplayAmount/DisplayAmount.js +1 -90
- package/reactjs/components/DisplayAmount/DisplayAmount.mjs +68 -75
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.js +1 -39
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.mjs +26 -33
- package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.js +1 -61
- package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.mjs +38 -46
- package/reactjs/components/DisplayAmount/index.js +1 -4
- package/reactjs/components/DisplayAmount/index.mjs +2 -2
- package/reactjs/components/DisplayAmount/utils/index.js +1 -4
- package/reactjs/components/DisplayAmount/utils/index.mjs +2 -2
- package/reactjs/components/DisplayAmount/utils/truncateAmount.js +1 -21
- package/reactjs/components/DisplayAmount/utils/truncateAmount.mjs +9 -13
- package/reactjs/components/Error/Error.js +1 -66
- package/reactjs/components/Error/Error.mjs +29 -29
- package/reactjs/components/Error/index.js +1 -4
- package/reactjs/components/Error/index.mjs +2 -2
- package/reactjs/components/SmallLoader/SmallLoader.js +1 -21
- package/reactjs/components/SmallLoader/SmallLoader.mjs +13 -18
- package/reactjs/components/SmallLoader/index.js +1 -4
- package/reactjs/components/SmallLoader/index.mjs +2 -2
- package/reactjs/components/ToggleDirection/ToggleDirection.js +1 -30
- package/reactjs/components/ToggleDirection/ToggleDirection.mjs +22 -28
- package/reactjs/components/TokenSelector/TokenSelector.js +1 -172
- package/reactjs/components/TokenSelector/TokenSelector.mjs +98 -118
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.js +1 -94
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.mjs +48 -57
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.js +1 -51
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.mjs +45 -44
- package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.js +1 -18
- package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.mjs +9 -14
- package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.js +1 -6
- package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.mjs +2 -4
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.js +1 -39
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.mjs +22 -18
- package/reactjs/components/TokenSelector/components/SelectContainer.js +1 -40
- package/reactjs/components/TokenSelector/components/SelectContainer.mjs +36 -38
- package/reactjs/components/TokenSelector/components/SelectContent.js +1 -136
- package/reactjs/components/TokenSelector/components/SelectContent.mjs +79 -103
- package/reactjs/components/TokenSelector/components/SelectedOption.js +1 -28
- package/reactjs/components/TokenSelector/components/SelectedOption.mjs +22 -24
- package/reactjs/components/TokenSelector/components/TokenIcon.js +1 -81
- package/reactjs/components/TokenSelector/components/TokenIcon.mjs +52 -57
- package/reactjs/components/TokenSelector/components/TokenItem.js +1 -80
- package/reactjs/components/TokenSelector/components/TokenItem.mjs +41 -54
- package/reactjs/components/TokenSelector/components/TokenList.js +1 -23
- package/reactjs/components/TokenSelector/components/TokenList.mjs +19 -21
- package/reactjs/components/TokenSelector/components/TokenSymbol.js +1 -25
- package/reactjs/components/TokenSelector/components/TokenSymbol.mjs +14 -15
- package/reactjs/components/TokenSelector/index.js +1 -4
- package/reactjs/components/TokenSelector/index.mjs +2 -2
- package/reactjs/components/TransactionToast/TransactionToast.js +1 -53
- package/reactjs/components/TransactionToast/TransactionToast.mjs +27 -28
- package/reactjs/components/TransactionToast/TransactionToastContainer.js +1 -20
- package/reactjs/components/TransactionToast/TransactionToastContainer.mjs +16 -18
- package/reactjs/components/TransactionToast/index.js +1 -6
- package/reactjs/components/TransactionToast/index.mjs +4 -4
- package/reactjs/components/TrimAddress/TrimAddress.js +1 -27
- package/reactjs/components/TrimAddress/TrimAddress.mjs +19 -24
- package/reactjs/components/TrimAddress/index.js +1 -4
- package/reactjs/components/TrimAddress/index.mjs +2 -2
- package/reactjs/components/base/MxButton/MxButton.js +1 -71
- package/reactjs/components/base/MxButton/MxButton.mjs +46 -46
- package/reactjs/components/base/MxButton/index.js +1 -4
- package/reactjs/components/base/MxButton/index.mjs +2 -2
- package/reactjs/components/base/MxCard/MxCard.js +1 -54
- package/reactjs/components/base/MxCard/MxCard.mjs +34 -34
- package/reactjs/components/base/MxCard/index.js +1 -4
- package/reactjs/components/base/MxCard/index.mjs +2 -2
- package/reactjs/components/base/MxCircleLoader/MxCircleLoader.js +1 -28
- package/reactjs/components/base/MxCircleLoader/MxCircleLoader.mjs +24 -26
- package/reactjs/components/base/MxCircleLoader/index.js +1 -4
- package/reactjs/components/base/MxCircleLoader/index.mjs +2 -2
- package/reactjs/components/base/MxLink/MxLink.js +1 -70
- package/reactjs/components/base/MxLink/MxLink.mjs +44 -46
- package/reactjs/components/base/MxLink/index.js +1 -4
- package/reactjs/components/base/MxLink/index.mjs +2 -2
- package/reactjs/components/base/MxSearch/MxSearch.js +1 -69
- package/reactjs/components/base/MxSearch/MxSearch.mjs +37 -41
- package/reactjs/components/base/MxSearch/index.js +1 -4
- package/reactjs/components/base/MxSearch/index.mjs +2 -2
- package/reactjs/components/base/MxSlideover/MxSlideover.js +1 -78
- package/reactjs/components/base/MxSlideover/MxSlideover.mjs +72 -74
- package/reactjs/components/base/MxSlideover/index.js +1 -4
- package/reactjs/components/base/MxSlideover/index.mjs +2 -2
- package/reactjs/components/base/MxTooltip/MxTooltip.js +1 -163
- package/reactjs/components/base/MxTooltip/MxTooltip.mjs +92 -135
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.js +1 -33
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.mjs +29 -31
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.js +1 -4
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.mjs +2 -2
- package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.js +1 -27
- package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.mjs +23 -25
- package/reactjs/components/base/MxTooltip/components/TooltipContent/index.js +1 -4
- package/reactjs/components/base/MxTooltip/components/TooltipContent/index.mjs +2 -2
- package/reactjs/components/base/MxTooltip/components/index.js +1 -6
- package/reactjs/components/base/MxTooltip/components/index.mjs +4 -4
- package/reactjs/components/base/MxTooltip/index.js +1 -4
- package/reactjs/components/base/MxTooltip/index.mjs +2 -2
- package/reactjs/components/base/index.js +1 -14
- package/reactjs/components/base/index.mjs +12 -12
- package/reactjs/components/index.js +1 -54
- package/reactjs/components/index.mjs +52 -52
- package/reactjs/constants/chains.js +1 -54
- package/reactjs/constants/chains.mjs +33 -52
- package/reactjs/constants/index.js +1 -13
- package/reactjs/constants/index.mjs +9 -10
- package/reactjs/context/Web3AppProvider.js +1 -40
- package/reactjs/context/Web3AppProvider.mjs +34 -34
- package/reactjs/context/queryClient.js +1 -11
- package/reactjs/context/queryClient.mjs +5 -8
- package/reactjs/context/useWeb3App.js +1 -12
- package/reactjs/context/useWeb3App.mjs +7 -8
- package/reactjs/helpers/index.js +1 -6
- package/reactjs/helpers/index.mjs +4 -4
- package/reactjs/helpers/resolveBridgeApiChainId.js +1 -40
- package/reactjs/helpers/resolveBridgeApiChainId.mjs +21 -34
- package/reactjs/hooks/index.js +1 -35
- package/reactjs/hooks/index.mjs +33 -33
- package/reactjs/hooks/tests/useGenericSignMessage.spec.d.ts +1 -0
- package/reactjs/hooks/tests/useGenericSignMessage.spec.js +2 -0
- package/reactjs/hooks/tests/useGenericSignMessage.spec.mjs +52 -0
- package/reactjs/hooks/tests/useSignTransaction.spec.d.ts +1 -0
- package/reactjs/hooks/tests/useSignTransaction.spec.js +2 -0
- package/reactjs/hooks/tests/useSignTransaction.spec.mjs +156 -0
- package/reactjs/hooks/useAccount.js +1 -13
- package/reactjs/hooks/useAccount.mjs +7 -8
- package/reactjs/hooks/useBalances.js +1 -53
- package/reactjs/hooks/useBalances.mjs +28 -40
- package/reactjs/hooks/useBridgeApiChainId.js +1 -13
- package/reactjs/hooks/useBridgeApiChainId.mjs +9 -9
- package/reactjs/hooks/useBridgeFormik.js +1 -162
- package/reactjs/hooks/useBridgeFormik.mjs +110 -150
- package/reactjs/hooks/useDebounce.js +1 -13
- package/reactjs/hooks/useDebounce.mjs +8 -10
- package/reactjs/hooks/useFetchBridgeData.js +1 -45
- package/reactjs/hooks/useFetchBridgeData.mjs +37 -38
- package/reactjs/hooks/useFetchTokens.js +1 -113
- package/reactjs/hooks/useFetchTokens.mjs +80 -106
- package/reactjs/hooks/useGenericSignMessage.js +1 -55
- package/reactjs/hooks/useGenericSignMessage.mjs +47 -47
- package/reactjs/hooks/useGetChainId.js +1 -11
- package/reactjs/hooks/useGetChainId.mjs +7 -8
- package/reactjs/hooks/useResolveTokenChain.js +1 -20
- package/reactjs/hooks/useResolveTokenChain.mjs +11 -14
- package/reactjs/hooks/useSendTransactions.js +1 -25
- package/reactjs/hooks/useSendTransactions.mjs +19 -23
- package/reactjs/hooks/useSignTransaction.js +1 -86
- package/reactjs/hooks/useSignTransaction.mjs +59 -59
- package/reactjs/hooks/useSuiConnect.js +1 -86
- package/reactjs/hooks/useSuiConnect.mjs +52 -70
- package/reactjs/hooks/validation/index.js +1 -10
- package/reactjs/hooks/validation/index.mjs +8 -8
- package/reactjs/hooks/validation/useAmountSchema.js +1 -32
- package/reactjs/hooks/validation/useAmountSchema.mjs +8 -11
- package/reactjs/hooks/validation/useSecondAmountSchema.js +1 -26
- package/reactjs/hooks/validation/useSecondAmountSchema.mjs +5 -6
- package/reactjs/hooks/validation/useTestHasEnoughFunds.js +1 -37
- package/reactjs/hooks/validation/useTestHasEnoughFunds.mjs +20 -29
- package/reactjs/hooks/validation/useTestIsConnected.js +1 -27
- package/reactjs/hooks/validation/useTestIsConnected.mjs +13 -19
- package/reactjs/index.js +1 -190
- package/reactjs/index.mjs +154 -154
- package/reactjs/init/index.js +1 -5
- package/reactjs/init/index.mjs +3 -3
- package/reactjs/init/init.d.ts +1 -0
- package/reactjs/init/init.js +1 -139
- package/reactjs/init/init.mjs +59 -72
- package/reactjs/queries/index.js +1 -17
- package/reactjs/queries/index.mjs +15 -15
- package/reactjs/queries/useCheckAccount.query.js +1 -39
- package/reactjs/queries/useCheckAccount.query.mjs +29 -33
- package/reactjs/queries/useGetAllTokens.query.js +1 -35
- package/reactjs/queries/useGetAllTokens.query.mjs +26 -30
- package/reactjs/queries/useGetChains.query.js +1 -34
- package/reactjs/queries/useGetChains.query.mjs +26 -28
- package/reactjs/queries/useGetHistory.query.d.ts +1 -1
- package/reactjs/queries/useGetHistory.query.js +1 -68
- package/reactjs/queries/useGetHistory.query.mjs +55 -58
- package/reactjs/queries/useGetMvxTokensBalances.query.d.ts +1 -1
- package/reactjs/queries/useGetMvxTokensBalances.query.js +1 -71
- package/reactjs/queries/useGetMvxTokensBalances.query.mjs +40 -53
- package/reactjs/queries/useGetNonMvxTokensBalances.query.d.ts +1 -1
- package/reactjs/queries/useGetNonMvxTokensBalances.query.js +1 -81
- package/reactjs/queries/useGetNonMvxTokensBalances.query.mjs +51 -59
- package/reactjs/queries/useGetRate.mutation.js +1 -18
- package/reactjs/queries/useGetRate.mutation.mjs +12 -15
- package/reactjs/reexports.js +1 -48
- package/reactjs/reexports.mjs +13 -13
- package/reactjs/utils/delay.js +1 -6
- package/reactjs/utils/delay.mjs +3 -3
- package/reactjs/utils/formatAmount.js +1 -23
- package/reactjs/utils/formatAmount.mjs +16 -17
- package/reactjs/utils/getCleanStringAmount.js +1 -11
- package/reactjs/utils/getCleanStringAmount.mjs +6 -8
- package/reactjs/utils/getCompletePathname.js +1 -5
- package/reactjs/utils/getCompletePathname.mjs +3 -3
- package/reactjs/utils/getInitialTokens.js +1 -12
- package/reactjs/utils/getInitialTokens.mjs +6 -7
- package/reactjs/utils/hasEnoughFunds.js +1 -19
- package/reactjs/utils/hasEnoughFunds.mjs +11 -14
- package/reactjs/utils/index.js +1 -26
- package/reactjs/utils/index.mjs +24 -24
- package/reactjs/utils/isStringFloat.js +1 -21
- package/reactjs/utils/isStringFloat.mjs +11 -18
- package/reactjs/utils/mxClsx.js +1 -8
- package/reactjs/utils/mxClsx.mjs +4 -6
- package/reactjs/utils/pipe.js +1 -25
- package/reactjs/utils/pipe.mjs +13 -17
- package/reactjs/utils/removeCommas.js +1 -6
- package/reactjs/utils/removeCommas.mjs +2 -4
- package/reactjs/utils/roundAmount.js +1 -40
- package/reactjs/utils/roundAmount.mjs +16 -36
- package/reactjs/utils/testNumber.js +1 -4
- package/reactjs/utils/testNumber.mjs +2 -2
- package/store/inMemoryStore.js +1 -39
- package/store/inMemoryStore.mjs +17 -21
- package/style.css +1 -2274
- package/types/chainType.js +1 -11
- package/types/chainType.mjs +2 -9
- package/types/errors.d.ts +3 -0
- package/types/errors.js +2 -0
- package/types/errors.mjs +8 -0
- package/types/providerType.js +1 -9
- package/types/providerType.mjs +2 -7
- package/types/transaction.d.ts +2 -0
- package/all-networks-EJIVYZ_i.mjs +0 -4
- package/all-networks-NYACMyeN.js +0 -4
- package/default-BYtXv70Z.mjs +0 -4
- package/default-H3AbmzFV.js +0 -4
- package/reactjs/hooks/useSignTransaction.d.ts +0 -511
|
@@ -1,560 +1,2 @@
|
|
|
1
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 formatAmount = require("@multiversx/sdk-dapp-utils/out/helpers/formatAmount");
|
|
6
|
-
const react = require("@reown/appkit/react");
|
|
7
|
-
const debounce = require("lodash/debounce");
|
|
8
|
-
const React = require("react");
|
|
9
|
-
const reactToastify = require("react-toastify");
|
|
10
|
-
const reactjs_components_BridgeForm_hooks_useBridgeTokenSelection = require("./hooks/useBridgeTokenSelection.js");
|
|
11
|
-
const constants_index = require("../../../constants/index.js");
|
|
12
|
-
const helpers_getApiURL = require("../../../helpers/getApiURL.js");
|
|
13
|
-
const types_providerType = require("../../../types/providerType.js");
|
|
14
|
-
const reactjs_context_useWeb3App = require("../../context/useWeb3App.js");
|
|
15
|
-
const reactjs_helpers_resolveBridgeApiChainId = require("../../helpers/resolveBridgeApiChainId.js");
|
|
16
|
-
require("yup");
|
|
17
|
-
require("@multiversx/sdk-dapp-utils/out/helpers/parseAmount");
|
|
18
|
-
require("bignumber.js");
|
|
19
|
-
const reactjs_hooks_useAccount = require("../../hooks/useAccount.js");
|
|
20
|
-
require("axios");
|
|
21
|
-
const reactjs_hooks_useBridgeFormik = require("../../hooks/useBridgeFormik.js");
|
|
22
|
-
const reactjs_hooks_useFetchBridgeData = require("../../hooks/useFetchBridgeData.js");
|
|
23
|
-
const reactjs_hooks_useBridgeApiChainId = require("../../hooks/useBridgeApiChainId.js");
|
|
24
|
-
require("@tanstack/react-query");
|
|
25
|
-
const reactjs_hooks_useGetChainId = require("../../hooks/useGetChainId.js");
|
|
26
|
-
require("../../constants/index.js");
|
|
27
|
-
const reactjs_hooks_useSendTransactions = require("../../hooks/useSendTransactions.js");
|
|
28
|
-
require("@reown/appkit-adapter-solana/react");
|
|
29
|
-
require("@solana/web3.js");
|
|
30
|
-
require("wagmi");
|
|
31
|
-
require("@reown/appkit-controllers");
|
|
32
|
-
const reactjs_queries_useGetHistory_query = require("../../queries/useGetHistory.query.js");
|
|
33
|
-
const reactjs_queries_useGetRate_mutation = require("../../queries/useGetRate.mutation.js");
|
|
34
|
-
const reactjs_utils_mxClsx = require("../../utils/mxClsx.js");
|
|
35
|
-
const reactjs_components_AmountCard_AmountCard = require("../AmountCard/AmountCard.js");
|
|
36
|
-
const reactjs_components_AmountInput_AmountInput = require("../AmountInput/AmountInput.js");
|
|
37
|
-
const reactjs_components_base_MxButton_MxButton = require("../base/MxButton/MxButton.js");
|
|
38
|
-
require("../base/MxCard/MxCard.js");
|
|
39
|
-
require("../base/MxLink/MxLink.js");
|
|
40
|
-
require("../base/MxSearch/MxSearch.js");
|
|
41
|
-
require("@fortawesome/free-solid-svg-icons/faClose");
|
|
42
|
-
require("@fortawesome/react-fontawesome");
|
|
43
|
-
require("@headlessui/react");
|
|
44
|
-
require("react-dom");
|
|
45
|
-
require("react-popper");
|
|
46
|
-
require("../base/MxTooltip/components/TooltipContainer/TooltipContainer.js");
|
|
47
|
-
const reactjs_components_BridgeHistory_BridgeHistory = require("../BridgeHistory/BridgeHistory.js");
|
|
48
|
-
const reactjs_components_Connect_BridgeConnectButton = require("../Connect/BridgeConnectButton.js");
|
|
49
|
-
const reactjs_components_Connect_MvxConnectButton = require("../Connect/MvxConnectButton.js");
|
|
50
|
-
const reactjs_components_Connect_BridgeAccountDisplay = require("../Connect/BridgeAccountDisplay.js");
|
|
51
|
-
const reactjs_components_Connect_MvxAccountDisplay = require("../Connect/MvxAccountDisplay.js");
|
|
52
|
-
const reactjs_components_ToggleDirection_ToggleDirection = require("../ToggleDirection/ToggleDirection.js");
|
|
53
|
-
const reactjs_components_TokenSelector_TokenSelector = require("../TokenSelector/TokenSelector.js");
|
|
54
|
-
let fetchRateInterval;
|
|
55
|
-
const Transfer = ({
|
|
56
|
-
mvxChainId,
|
|
57
|
-
mvxAddress,
|
|
58
|
-
username,
|
|
59
|
-
callbackRoute = "/",
|
|
60
|
-
firstTokenIdentifier,
|
|
61
|
-
secondTokenIdentifier,
|
|
62
|
-
firstTokenAmount,
|
|
63
|
-
secondTokenAmount,
|
|
64
|
-
refetchTrigger,
|
|
65
|
-
showHistory,
|
|
66
|
-
forcedDestinationTokenSymbol,
|
|
67
|
-
onSuccessfullySentTransaction,
|
|
68
|
-
onFailedSentTransaction,
|
|
69
|
-
onHistoryClose,
|
|
70
|
-
onMvxConnect,
|
|
71
|
-
onMvxDisconnect,
|
|
72
|
-
onNavigate,
|
|
73
|
-
onChangeDirection
|
|
74
|
-
}) => {
|
|
75
|
-
var _a, _b;
|
|
76
|
-
const ref = React.useRef(null);
|
|
77
|
-
const [isTokenSelectorVisible, setIsTokenSelectorVisible] = React.useState(false);
|
|
78
|
-
const [forceRefetchRate, setForceRefetchRate] = React.useState(1);
|
|
79
|
-
const [siginingTransactionsCount, setSigningTransactionsCount] = React.useState(0);
|
|
80
|
-
const [latestTransactions, setLatestTransactions] = React.useState([]);
|
|
81
|
-
const account = reactjs_hooks_useAccount.useAccount();
|
|
82
|
-
const { switchNetwork } = react.useAppKitNetwork();
|
|
83
|
-
const {
|
|
84
|
-
options,
|
|
85
|
-
supportedChains: sdkChains,
|
|
86
|
-
nativeAuthToken,
|
|
87
|
-
bridgeOnly
|
|
88
|
-
} = reactjs_context_useWeb3App.useWeb3App();
|
|
89
|
-
const chainId = reactjs_hooks_useGetChainId.useGetChainId();
|
|
90
|
-
const bridgeApiChainId = reactjs_hooks_useBridgeApiChainId.useBridgeApiChainId();
|
|
91
|
-
const sendTransactions = reactjs_hooks_useSendTransactions.useSendTransactions();
|
|
92
|
-
const {
|
|
93
|
-
signMvxTransactions,
|
|
94
|
-
resetMvxTransactionHash,
|
|
95
|
-
latestMvxTransactionHash
|
|
96
|
-
} = reactjs_context_useWeb3App.useWeb3App();
|
|
97
|
-
const {
|
|
98
|
-
evmTokensWithBalances,
|
|
99
|
-
mvxTokensWithBalances,
|
|
100
|
-
isTokensLoading: tokensLoading,
|
|
101
|
-
isLoadingEvmTokensBalances,
|
|
102
|
-
isLoadingMvxTokensBalances,
|
|
103
|
-
chains = [],
|
|
104
|
-
isChainsLoading
|
|
105
|
-
} = reactjs_hooks_useFetchBridgeData.useFetchBridgeData({
|
|
106
|
-
refetchTrigger,
|
|
107
|
-
mvxAddress,
|
|
108
|
-
mvxApiURL: options.mvxApiURL
|
|
109
|
-
});
|
|
110
|
-
const isTokensLoading = tokensLoading || isLoadingEvmTokensBalances || isLoadingMvxTokensBalances || isChainsLoading;
|
|
111
|
-
const activeChain = React.useMemo(() => {
|
|
112
|
-
return sdkChains.find((chain) => reactjs_helpers_resolveBridgeApiChainId.sameBridgeApiChainId(chain.id, chainId));
|
|
113
|
-
}, [chainId, sdkChains]);
|
|
114
|
-
const mvxChain = React.useMemo(() => {
|
|
115
|
-
return chains.find(
|
|
116
|
-
(chain) => chain.chainId.toString() === mvxChainId.toString()
|
|
117
|
-
);
|
|
118
|
-
}, [chainId, chains]);
|
|
119
|
-
const {
|
|
120
|
-
mutate: getRate,
|
|
121
|
-
data: rate,
|
|
122
|
-
isPending: isPendingRate,
|
|
123
|
-
error: rateError
|
|
124
|
-
} = reactjs_queries_useGetRate_mutation.useGetRateMutation();
|
|
125
|
-
const rateValidationError = ((_a = rateError == null ? void 0 : rateError.response) == null ? void 0 : _a.status) === 400 ? (_b = rateError == null ? void 0 : rateError.response) == null ? void 0 : _b.data.message : void 0;
|
|
126
|
-
const handleSwitchNetwork = React.useCallback(
|
|
127
|
-
(chain) => {
|
|
128
|
-
const sdkChain = sdkChains.find(
|
|
129
|
-
(c) => reactjs_helpers_resolveBridgeApiChainId.sameBridgeApiChainId(c.id, chain.id)
|
|
130
|
-
);
|
|
131
|
-
if (sdkChain) {
|
|
132
|
-
switchNetwork(sdkChain);
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
[sdkChains, switchNetwork]
|
|
136
|
-
);
|
|
137
|
-
const {
|
|
138
|
-
firstToken,
|
|
139
|
-
secondToken,
|
|
140
|
-
fromOptions,
|
|
141
|
-
toOptions,
|
|
142
|
-
selectedChainOption,
|
|
143
|
-
onChangeFirstSelect,
|
|
144
|
-
onChangeSecondSelect,
|
|
145
|
-
handleChangeDirection: handleTokenChangeDirection
|
|
146
|
-
} = reactjs_components_BridgeForm_hooks_useBridgeTokenSelection.useBridgeTokenSelection({
|
|
147
|
-
chains,
|
|
148
|
-
activeChain,
|
|
149
|
-
sdkChains,
|
|
150
|
-
switchNetwork: handleSwitchNetwork,
|
|
151
|
-
fromTokens: mvxTokensWithBalances,
|
|
152
|
-
toTokens: evmTokensWithBalances,
|
|
153
|
-
firstTokenIdentifier,
|
|
154
|
-
secondTokenIdentifier,
|
|
155
|
-
forcedDestinationTokenSymbol,
|
|
156
|
-
isTokensLoading,
|
|
157
|
-
mvxChainId,
|
|
158
|
-
callbackRoute,
|
|
159
|
-
onNavigate
|
|
160
|
-
});
|
|
161
|
-
const handleChangeDirection = () => {
|
|
162
|
-
handleTokenChangeDirection();
|
|
163
|
-
onChangeDirection();
|
|
164
|
-
};
|
|
165
|
-
const [firstAmount, setFirstAmount] = React.useState(firstTokenAmount ?? "");
|
|
166
|
-
const [secondAmount, setSecondAmount] = React.useState(secondTokenAmount ?? "");
|
|
167
|
-
const isFirstTokenMvx = React.useMemo(() => {
|
|
168
|
-
return firstToken ? constants_index.MVX_CHAIN_IDS.includes(firstToken.chainId.toString()) : false;
|
|
169
|
-
}, [firstToken == null ? void 0 : firstToken.chainId]);
|
|
170
|
-
const isSecondTokenMvx = React.useMemo(() => {
|
|
171
|
-
return secondToken ? constants_index.MVX_CHAIN_IDS.includes(secondToken.chainId.toString()) : false;
|
|
172
|
-
}, [secondToken == null ? void 0 : secondToken.chainId]);
|
|
173
|
-
const secondTokenChain = React.useMemo(() => {
|
|
174
|
-
if (!secondToken) {
|
|
175
|
-
return selectedChainOption;
|
|
176
|
-
}
|
|
177
|
-
return chains.find(
|
|
178
|
-
(chain) => reactjs_helpers_resolveBridgeApiChainId.sameBridgeApiChainId(chain.chainId, secondToken.chainId)
|
|
179
|
-
) ?? selectedChainOption;
|
|
180
|
-
}, [secondToken == null ? void 0 : secondToken.chainId, chains, selectedChainOption]);
|
|
181
|
-
const bridgeToChainId = React.useMemo(
|
|
182
|
-
() => reactjs_helpers_resolveBridgeApiChainId.toBridgeApiChainId(secondToken == null ? void 0 : secondToken.chainId) ?? bridgeApiChainId,
|
|
183
|
-
[secondToken == null ? void 0 : secondToken.chainId, bridgeApiChainId]
|
|
184
|
-
);
|
|
185
|
-
const bridgeAddress = account.address;
|
|
186
|
-
const isAuthenticated = account.isConnected && Boolean(bridgeAddress);
|
|
187
|
-
const hasAmounts = firstAmount !== "" && secondAmount !== "";
|
|
188
|
-
const fetchRateDebounced = React.useCallback(
|
|
189
|
-
debounce(async (amount) => {
|
|
190
|
-
if (!amount || !Number(amount) || !account.address || !(firstToken == null ? void 0 : firstToken.address) || !(secondToken == null ? void 0 : secondToken.address) || !selectedChainOption || !bridgeToChainId) {
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
getRate({
|
|
194
|
-
nativeAuthToken: nativeAuthToken ?? "",
|
|
195
|
-
body: {
|
|
196
|
-
tokenIn: firstToken.address,
|
|
197
|
-
amountIn: amount,
|
|
198
|
-
fromChainId: mvxChainId,
|
|
199
|
-
tokenOut: secondToken.address,
|
|
200
|
-
toChainId: bridgeToChainId
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
}, 500),
|
|
204
|
-
[
|
|
205
|
-
account.address,
|
|
206
|
-
bridgeToChainId,
|
|
207
|
-
firstToken == null ? void 0 : firstToken.address,
|
|
208
|
-
secondToken == null ? void 0 : secondToken.address,
|
|
209
|
-
selectedChainOption
|
|
210
|
-
]
|
|
211
|
-
);
|
|
212
|
-
const handleOnChangeFirstAmount = React.useCallback((amount) => {
|
|
213
|
-
setFirstAmount(() => amount);
|
|
214
|
-
}, []);
|
|
215
|
-
const handleOnChangeSecondAmount = React.useCallback((amount) => {
|
|
216
|
-
setSecondAmount(() => amount);
|
|
217
|
-
}, []);
|
|
218
|
-
const handleHistoryClose = React.useCallback(() => {
|
|
219
|
-
onHistoryClose == null ? void 0 : onHistoryClose();
|
|
220
|
-
}, [onHistoryClose]);
|
|
221
|
-
const handleOnFirstMaxBtnChange = React.useCallback(() => {
|
|
222
|
-
const formattedBalance = formatAmount.formatAmount({
|
|
223
|
-
decimals: firstToken == null ? void 0 : firstToken.decimals,
|
|
224
|
-
input: (firstToken == null ? void 0 : firstToken.balance) ?? "0",
|
|
225
|
-
addCommas: false,
|
|
226
|
-
digits: 4
|
|
227
|
-
});
|
|
228
|
-
formik.setFieldValue("firstAmount", formattedBalance);
|
|
229
|
-
handleOnChangeFirstAmount(formattedBalance);
|
|
230
|
-
}, [firstToken == null ? void 0 : firstToken.balance, firstToken == null ? void 0 : firstToken.decimals, handleOnChangeFirstAmount]);
|
|
231
|
-
const onSuccess = React.useCallback(
|
|
232
|
-
async (txHashes) => {
|
|
233
|
-
handleOnChangeFirstAmount("");
|
|
234
|
-
handleOnChangeSecondAmount("");
|
|
235
|
-
reactjs_queries_useGetHistory_query.invalidateHistoryQuery();
|
|
236
|
-
reactjs_queries_useGetHistory_query.invalidateHistoryQuery();
|
|
237
|
-
onSuccessfullySentTransaction == null ? void 0 : onSuccessfullySentTransaction(txHashes);
|
|
238
|
-
},
|
|
239
|
-
[
|
|
240
|
-
handleOnChangeFirstAmount,
|
|
241
|
-
handleOnChangeSecondAmount,
|
|
242
|
-
onSuccessfullySentTransaction
|
|
243
|
-
]
|
|
244
|
-
);
|
|
245
|
-
const onSubmit = React.useCallback(
|
|
246
|
-
async ({ transactions }) => {
|
|
247
|
-
setSigningTransactionsCount(() => transactions.length);
|
|
248
|
-
try {
|
|
249
|
-
if (!signMvxTransactions) {
|
|
250
|
-
throw new Error("signMvxTransactions function is not provided");
|
|
251
|
-
}
|
|
252
|
-
await signMvxTransactions(transactions);
|
|
253
|
-
setLatestTransactions(transactions);
|
|
254
|
-
} catch (e) {
|
|
255
|
-
console.error(e);
|
|
256
|
-
reactToastify.toast.dismiss();
|
|
257
|
-
reactToastify.toast.error("Transaction cancelled");
|
|
258
|
-
onFailedSentTransaction == null ? void 0 : onFailedSentTransaction("Transaction cancelled");
|
|
259
|
-
setSigningTransactionsCount(0);
|
|
260
|
-
resetSwapForm();
|
|
261
|
-
handleOnChangeFirstAmount("");
|
|
262
|
-
handleOnChangeSecondAmount("");
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
|
-
[
|
|
266
|
-
bridgeAddress,
|
|
267
|
-
handleOnChangeFirstAmount,
|
|
268
|
-
handleOnChangeSecondAmount,
|
|
269
|
-
nativeAuthToken,
|
|
270
|
-
onSuccess,
|
|
271
|
-
signMvxTransactions
|
|
272
|
-
]
|
|
273
|
-
);
|
|
274
|
-
const {
|
|
275
|
-
formik,
|
|
276
|
-
firstAmountError,
|
|
277
|
-
secondAmountError,
|
|
278
|
-
fromChainError,
|
|
279
|
-
handleBlur,
|
|
280
|
-
handleChange,
|
|
281
|
-
handleSubmit,
|
|
282
|
-
resetSwapForm
|
|
283
|
-
} = reactjs_hooks_useBridgeFormik.useBridgeFormik({
|
|
284
|
-
isMvxConnected: Boolean(mvxAddress),
|
|
285
|
-
rate,
|
|
286
|
-
sender: mvxAddress ?? "",
|
|
287
|
-
receiver: account.address ?? "",
|
|
288
|
-
firstToken,
|
|
289
|
-
firstAmount,
|
|
290
|
-
fromChainId: mvxChainId,
|
|
291
|
-
toChainId: bridgeToChainId,
|
|
292
|
-
secondToken,
|
|
293
|
-
secondAmount,
|
|
294
|
-
setForceRefetchRate,
|
|
295
|
-
onSubmit
|
|
296
|
-
});
|
|
297
|
-
const hasError = Boolean(
|
|
298
|
-
firstAmountError || secondAmountError || fromChainError || rateValidationError
|
|
299
|
-
);
|
|
300
|
-
const amountErrorFirstInput = React.useMemo(() => {
|
|
301
|
-
return firstAmount !== "" ? rateValidationError ?? firstAmountError : void 0;
|
|
302
|
-
}, [firstAmountError, firstAmount, rateValidationError]);
|
|
303
|
-
const amountErrorSecondInput = React.useMemo(() => {
|
|
304
|
-
return secondAmount !== "" ? fromChainError ?? secondAmountError : void 0;
|
|
305
|
-
}, [fromChainError, secondAmountError, secondAmount]);
|
|
306
|
-
React.useEffect(() => {
|
|
307
|
-
if (!firstAmount) {
|
|
308
|
-
setSecondAmount("");
|
|
309
|
-
}
|
|
310
|
-
fetchRateDebounced(firstAmount);
|
|
311
|
-
if (fetchRateInterval) {
|
|
312
|
-
clearInterval(fetchRateInterval);
|
|
313
|
-
}
|
|
314
|
-
fetchRateInterval = setInterval(() => {
|
|
315
|
-
fetchRateDebounced(firstAmount);
|
|
316
|
-
}, 50 * 1e3);
|
|
317
|
-
return () => clearInterval(fetchRateInterval);
|
|
318
|
-
}, [firstAmount, forceRefetchRate, fetchRateDebounced]);
|
|
319
|
-
React.useEffect(() => {
|
|
320
|
-
if (!(rate == null ? void 0 : rate.amountOut)) {
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
323
|
-
formik.setFieldValue(reactjs_hooks_useBridgeFormik.BridgeFormikValuesEnum.secondAmount, rate.amountOut);
|
|
324
|
-
setSecondAmount(rate.amountOut);
|
|
325
|
-
}, [rate == null ? void 0 : rate.amountOut]);
|
|
326
|
-
React.useEffect(() => {
|
|
327
|
-
if (rateValidationError) {
|
|
328
|
-
formik.setFieldValue(reactjs_hooks_useBridgeFormik.BridgeFormikValuesEnum.secondAmount, "0");
|
|
329
|
-
setSecondAmount("0");
|
|
330
|
-
}
|
|
331
|
-
}, [rateValidationError]);
|
|
332
|
-
React.useEffect(() => {
|
|
333
|
-
if (firstTokenAmount) {
|
|
334
|
-
formik.setFieldValue(
|
|
335
|
-
reactjs_hooks_useBridgeFormik.BridgeFormikValuesEnum.firstAmount,
|
|
336
|
-
firstTokenAmount
|
|
337
|
-
);
|
|
338
|
-
handleOnChangeFirstAmount(firstTokenAmount);
|
|
339
|
-
}
|
|
340
|
-
}, []);
|
|
341
|
-
React.useEffect(() => {
|
|
342
|
-
if (secondTokenAmount) {
|
|
343
|
-
formik.setFieldValue(
|
|
344
|
-
reactjs_hooks_useBridgeFormik.BridgeFormikValuesEnum.secondAmount,
|
|
345
|
-
secondTokenAmount
|
|
346
|
-
);
|
|
347
|
-
handleOnChangeSecondAmount(secondTokenAmount);
|
|
348
|
-
}
|
|
349
|
-
}, [secondTokenAmount]);
|
|
350
|
-
React.useEffect(() => {
|
|
351
|
-
if (latestMvxTransactionHash) {
|
|
352
|
-
try {
|
|
353
|
-
const txHash = latestMvxTransactionHash;
|
|
354
|
-
sendTransactions({
|
|
355
|
-
transactions: latestTransactions.map((tx) => ({
|
|
356
|
-
...tx,
|
|
357
|
-
txHash,
|
|
358
|
-
receiver: account.address
|
|
359
|
-
})),
|
|
360
|
-
provider: (rate == null ? void 0 : rate.provider) ?? types_providerType.ProviderType.None,
|
|
361
|
-
url: helpers_getApiURL.getApiURL() ?? "",
|
|
362
|
-
token: nativeAuthToken ?? ""
|
|
363
|
-
});
|
|
364
|
-
onSuccessfullySentTransaction == null ? void 0 : onSuccessfullySentTransaction([txHash]);
|
|
365
|
-
} catch (err) {
|
|
366
|
-
console.error("Error while sending transactions:", err);
|
|
367
|
-
onFailedSentTransaction == null ? void 0 : onFailedSentTransaction(
|
|
368
|
-
"An error occurred while sending the transaction"
|
|
369
|
-
);
|
|
370
|
-
return;
|
|
371
|
-
} finally {
|
|
372
|
-
resetMvxTransactionHash == null ? void 0 : resetMvxTransactionHash();
|
|
373
|
-
setLatestTransactions([]);
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
}, [
|
|
377
|
-
latestMvxTransactionHash,
|
|
378
|
-
latestTransactions,
|
|
379
|
-
rate == null ? void 0 : rate.provider,
|
|
380
|
-
sendTransactions
|
|
381
|
-
]);
|
|
382
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
383
|
-
"form",
|
|
384
|
-
{
|
|
385
|
-
ref,
|
|
386
|
-
noValidate: true,
|
|
387
|
-
className: "liq-flex liq-flex-col liq-gap-1 liq-relative",
|
|
388
|
-
autoComplete: "off",
|
|
389
|
-
onSubmit: handleSubmit,
|
|
390
|
-
children: [
|
|
391
|
-
showHistory && /* @__PURE__ */ jsxRuntime.jsx(reactjs_components_BridgeHistory_BridgeHistory.BridgeHistory, { mvxAddress, onClose: handleHistoryClose }),
|
|
392
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
393
|
-
reactjs_components_AmountCard_AmountCard.AmountCard,
|
|
394
|
-
{
|
|
395
|
-
className: reactjs_utils_mxClsx.mxClsx(
|
|
396
|
-
"liq-pb-8 liq-pt-6 hover:liq-bg-neutral-700/50 sm:liq-pb-6",
|
|
397
|
-
{
|
|
398
|
-
"liq-pointer-events-none": isTokenSelectorVisible,
|
|
399
|
-
"focus-within:liq-outline-neutral-700/75 hover:liq-outline-neutral-700/55 hover:focus-within:liq-outline-neutral-700/80": !isTokenSelectorVisible
|
|
400
|
-
}
|
|
401
|
-
),
|
|
402
|
-
children: [
|
|
403
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "liq-flex liq-items-center liq-gap-1", children: [
|
|
404
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "From" }),
|
|
405
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
406
|
-
reactjs_components_Connect_MvxAccountDisplay.MvxAccountDisplay,
|
|
407
|
-
{
|
|
408
|
-
accountAddress: mvxAddress,
|
|
409
|
-
chainIcon: (mvxChain == null ? void 0 : mvxChain.pngUrl) ?? "",
|
|
410
|
-
username,
|
|
411
|
-
accountExplorerUrl: `${options.mvxExplorerAddress}/accounts/${mvxAddress}`,
|
|
412
|
-
showTag: true,
|
|
413
|
-
onDisconnect: onMvxDisconnect,
|
|
414
|
-
onConnect: onMvxConnect
|
|
415
|
-
}
|
|
416
|
-
)
|
|
417
|
-
] }),
|
|
418
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "liq-flex liq-justify-between liq-gap-1", children: [
|
|
419
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
420
|
-
reactjs_components_AmountInput_AmountInput.AmountInput,
|
|
421
|
-
{
|
|
422
|
-
inputName: "firstAmount",
|
|
423
|
-
inputValue: formik.values.firstAmount,
|
|
424
|
-
amountError: amountErrorFirstInput,
|
|
425
|
-
disabled: false,
|
|
426
|
-
onInputDebounceChange: handleOnChangeFirstAmount,
|
|
427
|
-
onInputChange: handleChange,
|
|
428
|
-
onBlur: handleBlur
|
|
429
|
-
}
|
|
430
|
-
),
|
|
431
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
432
|
-
reactjs_components_TokenSelector_TokenSelector.TokenSelector,
|
|
433
|
-
{
|
|
434
|
-
name: "firstToken",
|
|
435
|
-
disabled: isPendingRate,
|
|
436
|
-
options: fromOptions,
|
|
437
|
-
areOptionsLoading: isTokensLoading,
|
|
438
|
-
isMvxSelector: isFirstTokenMvx,
|
|
439
|
-
isDestination: false,
|
|
440
|
-
color: "neutral-850",
|
|
441
|
-
onChange: onChangeFirstSelect,
|
|
442
|
-
onBlur: handleBlur,
|
|
443
|
-
onMaxBtnClick: handleOnFirstMaxBtnChange,
|
|
444
|
-
selectedOption: firstToken,
|
|
445
|
-
onTokenSelectorDisplay: (visible) => setIsTokenSelectorVisible(visible)
|
|
446
|
-
}
|
|
447
|
-
)
|
|
448
|
-
] })
|
|
449
|
-
]
|
|
450
|
-
}
|
|
451
|
-
),
|
|
452
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "liq-absolute liq-left-[6%] liq-top-[40%] -liq-mt-1 liq-z-10", children: bridgeOnly && /* @__PURE__ */ jsxRuntime.jsx(reactjs_components_ToggleDirection_ToggleDirection.ToggleDirection, { onChangeDirection: handleChangeDirection }) }),
|
|
453
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
454
|
-
reactjs_components_AmountCard_AmountCard.AmountCard,
|
|
455
|
-
{
|
|
456
|
-
className: reactjs_utils_mxClsx.mxClsx(
|
|
457
|
-
"liq-pb-8 liq-pt-6 hover:liq-bg-neutral-700/50 sm:liq-pb-6",
|
|
458
|
-
{
|
|
459
|
-
"liq-pointer-events-none": isTokenSelectorVisible
|
|
460
|
-
}
|
|
461
|
-
),
|
|
462
|
-
children: [
|
|
463
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "liq-flex liq-items-center liq-gap-1", children: [
|
|
464
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "To" }),
|
|
465
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
466
|
-
reactjs_components_Connect_BridgeAccountDisplay.BridgeAccountDisplay,
|
|
467
|
-
{
|
|
468
|
-
disabled: isPendingRate,
|
|
469
|
-
activeChain: secondTokenChain
|
|
470
|
-
}
|
|
471
|
-
)
|
|
472
|
-
] }),
|
|
473
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "liq-flex liq-justify-between liq-gap-1", children: [
|
|
474
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
475
|
-
reactjs_components_AmountInput_AmountInput.AmountInput,
|
|
476
|
-
{
|
|
477
|
-
inputName: "secondAmount",
|
|
478
|
-
inputValue: formik.values.secondAmount,
|
|
479
|
-
amountError: amountErrorSecondInput,
|
|
480
|
-
disabled: false,
|
|
481
|
-
onInputDebounceChange: handleOnChangeSecondAmount,
|
|
482
|
-
onInputChange: handleChange,
|
|
483
|
-
onBlur: handleBlur
|
|
484
|
-
}
|
|
485
|
-
),
|
|
486
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
487
|
-
reactjs_components_TokenSelector_TokenSelector.TokenSelector,
|
|
488
|
-
{
|
|
489
|
-
name: "secondToken",
|
|
490
|
-
disabled: isPendingRate,
|
|
491
|
-
omitDisableClass: true,
|
|
492
|
-
options: toOptions,
|
|
493
|
-
areOptionsLoading: isTokensLoading,
|
|
494
|
-
isMvxSelector: isSecondTokenMvx,
|
|
495
|
-
color: "neutral-850",
|
|
496
|
-
onChange: onChangeSecondSelect,
|
|
497
|
-
onBlur: handleBlur,
|
|
498
|
-
selectedOption: secondToken
|
|
499
|
-
}
|
|
500
|
-
)
|
|
501
|
-
] })
|
|
502
|
-
]
|
|
503
|
-
}
|
|
504
|
-
),
|
|
505
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "liq-flex liq-items-center liq-justify-center", children: [
|
|
506
|
-
!mvxAddress && /* @__PURE__ */ jsxRuntime.jsx(
|
|
507
|
-
reactjs_components_Connect_MvxConnectButton.MvxConnectButton,
|
|
508
|
-
{
|
|
509
|
-
mvxAccountAddress: mvxAddress,
|
|
510
|
-
icon: (mvxChain == null ? void 0 : mvxChain.pngUrl) ?? "",
|
|
511
|
-
onClick: onMvxConnect
|
|
512
|
-
}
|
|
513
|
-
),
|
|
514
|
-
mvxAddress && !isAuthenticated && /* @__PURE__ */ jsxRuntime.jsx(
|
|
515
|
-
reactjs_components_Connect_BridgeConnectButton.BridgeConnectButton,
|
|
516
|
-
{
|
|
517
|
-
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",
|
|
518
|
-
disabled: isPendingRate,
|
|
519
|
-
activeChain: secondTokenChain
|
|
520
|
-
}
|
|
521
|
-
),
|
|
522
|
-
mvxAddress && isAuthenticated && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
523
|
-
reactjs_components_base_MxButton_MxButton.MxButton,
|
|
524
|
-
{
|
|
525
|
-
"data-testid": "submit-button",
|
|
526
|
-
type: "submit",
|
|
527
|
-
variant: "neutral-850",
|
|
528
|
-
className: "liq-w-full disabled:liq-bg-neutral-850/50 liq-py-3 hover:enabled:liq-bg-primary !liq-text-primary-200",
|
|
529
|
-
disabled: !hasAmounts || isPendingRate || !mvxAddress || !account.address || hasError,
|
|
530
|
-
children: [
|
|
531
|
-
hasAmounts && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "liq-flex liq-justify-center liq-items-center liq-gap-2", children: [
|
|
532
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { children: "Transfer to " }),
|
|
533
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
534
|
-
"img",
|
|
535
|
-
{
|
|
536
|
-
src: (secondTokenChain == null ? void 0 : secondTokenChain.pngUrl) ?? "",
|
|
537
|
-
alt: "",
|
|
538
|
-
className: "liq-h-[1.5rem] liq-w-[1.5rem] liq-rounded-lg"
|
|
539
|
-
}
|
|
540
|
-
),
|
|
541
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { children: secondTokenChain == null ? void 0 : secondTokenChain.networkName })
|
|
542
|
-
] }),
|
|
543
|
-
!hasAmounts && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "liq-text-neutral-100", children: "Enter amount" })
|
|
544
|
-
]
|
|
545
|
-
}
|
|
546
|
-
)
|
|
547
|
-
] }),
|
|
548
|
-
account.address && siginingTransactionsCount > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "liq-flex liq-items-center liq-justify-center liq-text-neutral-300 liq-text-sm", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
549
|
-
"You will be asked to sign ",
|
|
550
|
-
siginingTransactionsCount,
|
|
551
|
-
" ",
|
|
552
|
-
siginingTransactionsCount > 1 ? "transactions" : "transaction",
|
|
553
|
-
" ",
|
|
554
|
-
"on your wallet"
|
|
555
|
-
] }) })
|
|
556
|
-
]
|
|
557
|
-
}
|
|
558
|
-
) });
|
|
559
|
-
};
|
|
560
|
-
exports.Transfer = Transfer;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),nt=require("@multiversx/sdk-dapp-utils/out/helpers/formatAmount"),rt=require("@reown/appkit/react"),ot=require("lodash/debounce"),s=require("react"),ce=require("react-toastify"),at=require("./hooks/useBridgeTokenSelection.js"),le=require("../../../constants/index.js"),ct=require("../../../helpers/getApiURL.js");require("../../constants/index.js");const $=require("../../../helpers/safeImageUrl.js"),lt=require("../../../types/providerType.js"),ue=require("../../context/useWeb3App.js"),D=require("../../helpers/resolveBridgeApiChainId.js");require("yup");require("@multiversx/sdk-dapp-utils/out/helpers/parseAmount");require("bignumber.js");const ut=require("../../hooks/useAccount.js");require("axios");const I=require("../../hooks/useBridgeFormik.js"),dt=require("../../hooks/useFetchBridgeData.js"),mt=require("../../hooks/useBridgeApiChainId.js");require("@tanstack/react-query");const qt=require("../../hooks/useGetChainId.js"),ht=require("../../hooks/useSendTransactions.js");require("@reown/appkit-adapter-solana/react");require("@solana/web3.js");require("wagmi");require("@reown/appkit-controllers");const pt=require("../../queries/useGetHistory.query.js"),gt=require("../../queries/useGetRate.mutation.js"),de=require("../../utils/mxClsx.js"),me=require("../AmountCard/AmountCard.js"),qe=require("../AmountInput/AmountInput.js"),_t=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("@fortawesome/react-fontawesome");require("@headlessui/react");require("react-dom");require("react-popper");require("../base/MxTooltip/components/TooltipContainer/TooltipContainer.js");const ft=require("../BridgeHistory/BridgeHistory.js"),xt=require("../Connect/BridgeConnectButton.js"),bt=require("../Connect/MvxConnectButton.js"),Ct=require("../Connect/BridgeAccountDisplay.js"),jt=require("../Connect/MvxAccountDisplay.js"),vt=require("../ToggleDirection/ToggleDirection.js"),he=require("../TokenSelector/TokenSelector.js");let E;const It=({mvxChainId:B,mvxAddress:o,username:pe,callbackRoute:ge="/",firstTokenIdentifier:_e,secondTokenIdentifier:fe,firstTokenAmount:A,secondTokenAmount:f,refetchTrigger:xe,showHistory:be,forcedDestinationTokenSymbol:Ce,onSuccessfullySentTransaction:d,onFailedSentTransaction:q,onHistoryClose:y,onMvxConnect:z,onMvxDisconnect:je,onNavigate:ve,onChangeDirection:Ie})=>{var oe,ae;const Be=s.useRef(null),[O,Ae]=s.useState(!1),[ye,Me]=s.useState(1),[R,K]=s.useState(0),[Y,J]=s.useState([]),a=ut.useAccount(),{switchNetwork:Z}=rt.useAppKitNetwork(),T=pt.useInvalidateHistoryQuery(),{options:ee,supportedChains:x,nativeAuthToken:V,bridgeOnly:ke}=ue.useWeb3App(),F=qt.useGetChainId(),te=mt.useBridgeApiChainId(),se=ht.useSendTransactions(),{signMvxTransactions:L,resetMvxTransactionHash:S,latestMvxTransactionHash:U}=ue.useWeb3App(),{evmTokensWithBalances:Ne,mvxTokensWithBalances:we,isTokensLoading:De,isLoadingEvmTokensBalances:Ee,isLoadingMvxTokensBalances:Oe,chains:b=[],isChainsLoading:Re}=dt.useFetchBridgeData({refetchTrigger:xe,mvxAddress:o,mvxApiURL:ee.mvxApiURL}),G=De||Ee||Oe||Re,Ve=s.useMemo(()=>x.find(e=>D.sameBridgeApiChainId(e.id,F)),[F,x]),h=s.useMemo(()=>b.find(e=>e.chainId.toString()===B.toString()),[F,b]),{mutate:Fe,data:r,isPending:C,error:p}=gt.useGetRateMutation(),j=((oe=p==null?void 0:p.response)==null?void 0:oe.status)===400?(ae=p==null?void 0:p.response)==null?void 0:ae.data.message:void 0,Le=s.useCallback(e=>{const _=x.find(it=>D.sameBridgeApiChainId(it.id,e.id));_&&Z(_)},[x,Z]),{firstToken:i,secondToken:n,fromOptions:Se,toOptions:Ue,selectedChainOption:v,onChangeFirstSelect:Ge,onChangeSecondSelect:He,handleChangeDirection:We}=at.useBridgeTokenSelection({chains:b,activeChain:Ve,sdkChains:x,switchNetwork:Le,fromTokens:we,toTokens:Ne,firstTokenIdentifier:_e,secondTokenIdentifier:fe,forcedDestinationTokenSymbol:Ce,isTokensLoading:G,mvxChainId:B,callbackRoute:ge,onNavigate:ve}),Pe=()=>{We(),Ie()},[c,Qe]=s.useState(A??""),[M,k]=s.useState(f??""),Xe=s.useMemo(()=>i?le.MVX_CHAIN_IDS.includes(i.chainId.toString()):!1,[i==null?void 0:i.chainId]),$e=s.useMemo(()=>n?le.MVX_CHAIN_IDS.includes(n.chainId.toString()):!1,[n==null?void 0:n.chainId]),l=s.useMemo(()=>n?b.find(e=>D.sameBridgeApiChainId(e.chainId,n.chainId))??v:v,[n==null?void 0:n.chainId,b,v]),N=s.useMemo(()=>D.toBridgeApiChainId(n==null?void 0:n.chainId)??te,[n==null?void 0:n.chainId,te]),ie=a.address,ne=a.isConnected&&!!ie,H=c!==""&&M!=="",W=s.useCallback(ot(async e=>{!e||!Number(e)||!a.address||!(i!=null&&i.address)||!(n!=null&&n.address)||!v||!N||Fe({nativeAuthToken:V??"",body:{tokenIn:i.address,amountIn:e,fromChainId:B,tokenOut:n.address,toChainId:N}})},500),[a.address,N,i==null?void 0:i.address,n==null?void 0:n.address,v]),u=s.useCallback(e=>{Qe(()=>e)},[]),g=s.useCallback(e=>{k(()=>e)},[]),ze=s.useCallback(()=>{y==null||y()},[y]),Ke=s.useCallback(()=>{const e=nt.formatAmount({decimals:i==null?void 0:i.decimals,input:(i==null?void 0:i.balance)??"0",addCommas:!1,digits:4});m.setFieldValue("firstAmount",e),u(e)},[i==null?void 0:i.balance,i==null?void 0:i.decimals,u]),Ye=s.useCallback(async e=>{u(""),g(""),T(),T(),d==null||d(e)},[u,g,d]),Je=s.useCallback(async({transactions:e})=>{K(()=>e.length);try{if(!L)throw new Error("signMvxTransactions function is not provided");await L(e),J(e)}catch(_){console.error(_),ce.toast.dismiss(),ce.toast.error("Transaction cancelled"),q==null||q("Transaction cancelled"),K(0),Te(),u(""),g("")}},[ie,u,g,V,Ye,L]),{formik:m,firstAmountError:P,secondAmountError:Q,fromChainError:X,handleBlur:w,handleChange:re,handleSubmit:Ze,resetSwapForm:Te}=I.useBridgeFormik({isMvxConnected:!!o,rate:r,sender:o??"",receiver:a.address??"",firstToken:i,firstAmount:c,fromChainId:B,toChainId:N,secondToken:n,secondAmount:M,setForceRefetchRate:Me,onSubmit:Je}),et=!!(P||Q||X||j),tt=s.useMemo(()=>c!==""?j??P:void 0,[P,c,j]),st=s.useMemo(()=>M!==""?X??Q:void 0,[X,Q,M]);return s.useEffect(()=>(c||k(""),W(c),E&&clearInterval(E),E=setInterval(()=>{W(c)},50*1e3),()=>clearInterval(E)),[c,ye,W]),s.useEffect(()=>{r!=null&&r.amountOut&&(m.setFieldValue(I.BridgeFormikValuesEnum.secondAmount,r.amountOut),k(r.amountOut))},[r==null?void 0:r.amountOut]),s.useEffect(()=>{j&&(m.setFieldValue(I.BridgeFormikValuesEnum.secondAmount,"0"),k("0"))},[j]),s.useEffect(()=>{A&&(m.setFieldValue(I.BridgeFormikValuesEnum.firstAmount,A),u(A))},[]),s.useEffect(()=>{f&&(m.setFieldValue(I.BridgeFormikValuesEnum.secondAmount,f),g(f))},[f]),s.useEffect(()=>{if(U)try{const e=U;se({transactions:Y.map(_=>({..._,txHash:e,receiver:a.address})),provider:(r==null?void 0:r.provider)??lt.ProviderType.None,url:ct.getApiURL()??"",token:V??""}),d==null||d([e])}catch(e){console.error("Error while sending transactions:",e),q==null||q("An error occurred while sending the transaction");return}finally{S==null||S(),J([])}},[U,Y,r==null?void 0:r.provider,se]),t.jsx(t.Fragment,{children:t.jsxs("form",{ref:Be,noValidate:!0,className:"liq-flex liq-flex-col liq-gap-1 liq-relative",autoComplete:"off",onSubmit:Ze,children:[be&&t.jsx(ft.BridgeHistory,{mvxAddress:o,onClose:ze}),t.jsxs(me.AmountCard,{className:de.mxClsx("liq-pb-8 liq-pt-6 hover:liq-bg-neutral-700/50 sm:liq-pb-6",{"liq-pointer-events-none":O,"focus-within:liq-outline-neutral-700/75 hover:liq-outline-neutral-700/55 hover:focus-within:liq-outline-neutral-700/80":!O}),children:[t.jsxs("div",{className:"liq-flex liq-items-center liq-gap-1",children:[t.jsx("span",{children:"From"}),t.jsx(jt.MvxAccountDisplay,{accountAddress:o,chainIcon:$.safeImageUrl(h==null?void 0:h.pngUrl),username:pe,accountExplorerUrl:`${ee.mvxExplorerAddress}/accounts/${o}`,showTag:!0,onDisconnect:je,onConnect:z})]}),t.jsxs("div",{className:"liq-flex liq-justify-between liq-gap-1",children:[t.jsx(qe.AmountInput,{inputName:"firstAmount",inputValue:m.values.firstAmount,amountError:tt,disabled:!1,onInputDebounceChange:u,onInputChange:re,onBlur:w}),t.jsx(he.TokenSelector,{name:"firstToken",disabled:C,options:Se,areOptionsLoading:G,isMvxSelector:Xe,isDestination:!1,color:"neutral-850",onChange:Ge,onBlur:w,onMaxBtnClick:Ke,selectedOption:i,onTokenSelectorDisplay:e=>Ae(e)})]})]}),t.jsx("div",{className:"liq-absolute liq-left-[6%] liq-top-[40%] -liq-mt-1 liq-z-10",children:ke&&t.jsx(vt.ToggleDirection,{onChangeDirection:Pe})}),t.jsxs(me.AmountCard,{className:de.mxClsx("liq-pb-8 liq-pt-6 hover:liq-bg-neutral-700/50 sm:liq-pb-6",{"liq-pointer-events-none":O}),children:[t.jsxs("div",{className:"liq-flex liq-items-center liq-gap-1",children:[t.jsx("span",{children:"To"}),t.jsx(Ct.BridgeAccountDisplay,{disabled:C,activeChain:l})]}),t.jsxs("div",{className:"liq-flex liq-justify-between liq-gap-1",children:[t.jsx(qe.AmountInput,{inputName:"secondAmount",inputValue:m.values.secondAmount,amountError:st,disabled:!1,onInputDebounceChange:g,onInputChange:re,onBlur:w}),t.jsx(he.TokenSelector,{name:"secondToken",disabled:C,omitDisableClass:!0,options:Ue,areOptionsLoading:G,isMvxSelector:$e,color:"neutral-850",onChange:He,onBlur:w,selectedOption:n})]})]}),t.jsxs("div",{className:"liq-flex liq-items-center liq-justify-center",children:[!o&&t.jsx(bt.MvxConnectButton,{mvxAccountAddress:o,icon:$.safeImageUrl(h==null?void 0:h.pngUrl),onClick:z}),o&&!ne&&t.jsx(xt.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:C,activeChain:l}),o&&ne&&t.jsxs(_t.MxButton,{"data-testid":"submit-button",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:!H||C||!o||!a.address||et,children:[H&&t.jsxs("div",{className:"liq-flex liq-justify-center liq-items-center liq-gap-2",children:[t.jsx("div",{children:"Transfer to "}),t.jsx("img",{src:$.safeImageUrl(l==null?void 0:l.pngUrl),alt:"",className:"liq-h-[1.5rem] liq-w-[1.5rem] liq-rounded-lg"}),t.jsx("div",{children:l==null?void 0:l.networkName})]}),!H&&t.jsx("span",{className:"liq-text-neutral-100",children:"Enter amount"})]})]}),a.address&&R>0&&t.jsx("div",{className:"liq-flex liq-items-center liq-justify-center liq-text-neutral-300 liq-text-sm",children:t.jsxs("div",{children:["You will be asked to sign ",R," ",R>1?"transactions":"transaction"," ","on your wallet"]})})]})})};exports.Transfer=It;
|