@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,32 +1,34 @@
|
|
|
1
|
-
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { faSpinner } from "@fortawesome/free-solid-svg-icons/faSpinner";
|
|
3
|
-
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
4
|
-
import { formatAmount } from "@multiversx/sdk-dapp-utils/out/helpers/formatAmount";
|
|
5
|
-
import { useAppKitNetwork } from "@reown/appkit/react";
|
|
6
|
-
import { waitForTransactionReceipt } from "@wagmi/core";
|
|
7
|
-
import
|
|
8
|
-
import { useRef, useState, useMemo, useCallback, useEffect } from "react";
|
|
9
|
-
import { toast } from "react-toastify";
|
|
10
|
-
import { useBridgeTokenSelection } from "./hooks/useBridgeTokenSelection.mjs";
|
|
11
|
-
import { resolveSigningChainType } from "./utils/bridgeFormHelpers.mjs";
|
|
12
|
-
import { MVX_CHAIN_IDS } from "../../../constants/index.mjs";
|
|
13
|
-
import { getApiURL } from "../../../helpers/getApiURL.mjs";
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
1
|
+
import { jsx as n, Fragment as Ni, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { faSpinner as Ai } from "@fortawesome/free-solid-svg-icons/faSpinner";
|
|
3
|
+
import { FontAwesomeIcon as Di } from "@fortawesome/react-fontawesome";
|
|
4
|
+
import { formatAmount as Si } from "@multiversx/sdk-dapp-utils/out/helpers/formatAmount";
|
|
5
|
+
import { useAppKitNetwork as ki } from "@reown/appkit/react";
|
|
6
|
+
import { waitForTransactionReceipt as Ri } from "@wagmi/core";
|
|
7
|
+
import Mi from "lodash/debounce";
|
|
8
|
+
import { useRef as Pe, useState as x, useMemo as h, useCallback as g, useEffect as y } from "react";
|
|
9
|
+
import { toast as M } from "react-toastify";
|
|
10
|
+
import { useBridgeTokenSelection as Pi } from "./hooks/useBridgeTokenSelection.mjs";
|
|
11
|
+
import { resolveSigningChainType as Vi } from "./utils/bridgeFormHelpers.mjs";
|
|
12
|
+
import { MVX_CHAIN_IDS as Ve } from "../../../constants/index.mjs";
|
|
13
|
+
import { getApiURL as Ei } from "../../../helpers/getApiURL.mjs";
|
|
14
|
+
import "../../constants/index.mjs";
|
|
15
|
+
import { safeImageUrl as X } from "../../../helpers/safeImageUrl.mjs";
|
|
16
|
+
import { ChainType as z } from "../../../types/chainType.mjs";
|
|
17
|
+
import { useWeb3App as Fi } from "../../context/useWeb3App.mjs";
|
|
18
|
+
import { sameBridgeApiChainId as le, toBridgeApiChainId as Li } from "../../helpers/resolveBridgeApiChainId.mjs";
|
|
19
|
+
import { useAccount as Ui } from "../../hooks/useAccount.mjs";
|
|
20
|
+
import { useBridgeApiChainId as ji } from "../../hooks/useBridgeApiChainId.mjs";
|
|
21
|
+
import { useBridgeFormik as Hi, BridgeFormikValuesEnum as G } from "../../hooks/useBridgeFormik.mjs";
|
|
22
|
+
import { useFetchBridgeData as Oi } from "../../hooks/useFetchBridgeData.mjs";
|
|
23
|
+
import { useGetChainId as Wi } from "../../hooks/useGetChainId.mjs";
|
|
24
|
+
import { useSendTransactions as Xi } from "../../hooks/useSendTransactions.mjs";
|
|
25
|
+
import { useSignTransaction as zi } from "../../hooks/useSignTransaction.mjs";
|
|
26
|
+
import { useInvalidateHistoryQuery as Gi } from "../../queries/useGetHistory.query.mjs";
|
|
27
|
+
import { useGetRateMutation as Qi } from "../../queries/useGetRate.mutation.mjs";
|
|
28
|
+
import { mxClsx as Ee } from "../../utils/mxClsx.mjs";
|
|
29
|
+
import { AmountCard as Fe } from "../AmountCard/AmountCard.mjs";
|
|
30
|
+
import { AmountInput as Le } from "../AmountInput/AmountInput.mjs";
|
|
31
|
+
import { MxButton as _i } from "../base/MxButton/MxButton.mjs";
|
|
30
32
|
import "../base/MxCard/MxCard.mjs";
|
|
31
33
|
import "../base/MxLink/MxLink.mjs";
|
|
32
34
|
import "../base/MxSearch/MxSearch.mjs";
|
|
@@ -35,632 +37,508 @@ import "@headlessui/react";
|
|
|
35
37
|
import "react-dom";
|
|
36
38
|
import "react-popper";
|
|
37
39
|
import "../base/MxTooltip/components/TooltipContainer/TooltipContainer.mjs";
|
|
38
|
-
import "
|
|
39
|
-
import {
|
|
40
|
-
import { BridgeConnectButton } from "../Connect/BridgeConnectButton.mjs";
|
|
40
|
+
import { BridgeHistory as $i } from "../BridgeHistory/BridgeHistory.mjs";
|
|
41
|
+
import { BridgeConnectButton as Ki } from "../Connect/BridgeConnectButton.mjs";
|
|
41
42
|
import "wagmi";
|
|
42
|
-
import { MvxConnectButton } from "../Connect/MvxConnectButton.mjs";
|
|
43
|
-
import { BridgeAccountDisplay } from "../Connect/BridgeAccountDisplay.mjs";
|
|
44
|
-
import { MvxAccountDisplay } from "../Connect/MvxAccountDisplay.mjs";
|
|
43
|
+
import { MvxConnectButton as Yi } from "../Connect/MvxConnectButton.mjs";
|
|
44
|
+
import { BridgeAccountDisplay as Ji } from "../Connect/BridgeAccountDisplay.mjs";
|
|
45
|
+
import { MvxAccountDisplay as Zi } from "../Connect/MvxAccountDisplay.mjs";
|
|
45
46
|
import "@reown/appkit-controllers";
|
|
46
|
-
import { ToggleDirection } from "../ToggleDirection/ToggleDirection.mjs";
|
|
47
|
-
import { TokenSelector } from "../TokenSelector/TokenSelector.mjs";
|
|
48
|
-
let
|
|
49
|
-
const
|
|
50
|
-
mvxChainId,
|
|
51
|
-
mvxAddress,
|
|
52
|
-
username,
|
|
53
|
-
callbackRoute = "/",
|
|
54
|
-
firstTokenIdentifier,
|
|
55
|
-
secondTokenIdentifier,
|
|
56
|
-
firstTokenAmount,
|
|
57
|
-
secondTokenAmount,
|
|
58
|
-
refetchTrigger,
|
|
59
|
-
showHistory,
|
|
60
|
-
forcedDestinationTokenSymbol,
|
|
61
|
-
onSuccessfullySentTransaction,
|
|
62
|
-
onFailedSentTransaction,
|
|
63
|
-
onHistoryClose,
|
|
64
|
-
onMvxConnect,
|
|
65
|
-
onMvxDisconnect,
|
|
66
|
-
onNavigate,
|
|
67
|
-
onChangeDirection
|
|
47
|
+
import { ToggleDirection as Ti } from "../ToggleDirection/ToggleDirection.mjs";
|
|
48
|
+
import { TokenSelector as Ue } from "../TokenSelector/TokenSelector.mjs";
|
|
49
|
+
let Q;
|
|
50
|
+
const $t = ({
|
|
51
|
+
mvxChainId: _,
|
|
52
|
+
mvxAddress: l,
|
|
53
|
+
username: je,
|
|
54
|
+
callbackRoute: He = "/",
|
|
55
|
+
firstTokenIdentifier: Oe,
|
|
56
|
+
secondTokenIdentifier: We,
|
|
57
|
+
firstTokenAmount: P,
|
|
58
|
+
secondTokenAmount: w,
|
|
59
|
+
refetchTrigger: Xe,
|
|
60
|
+
showHistory: ze,
|
|
61
|
+
forcedDestinationTokenSymbol: Ge,
|
|
62
|
+
onSuccessfullySentTransaction: V,
|
|
63
|
+
onFailedSentTransaction: I,
|
|
64
|
+
onHistoryClose: E,
|
|
65
|
+
onMvxConnect: ce,
|
|
66
|
+
onMvxDisconnect: Qe,
|
|
67
|
+
onNavigate: _e,
|
|
68
|
+
onChangeDirection: $e
|
|
68
69
|
}) => {
|
|
69
|
-
var
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const isTokensLoading = tokensLoading || isLoadingEvmTokensBalances || isLoadingMvxTokensBalances || isChainsLoading;
|
|
100
|
-
const activeChain = useMemo(() => {
|
|
101
|
-
return sdkChains.find((chain) => sameBridgeApiChainId(chain.id, chainId));
|
|
102
|
-
}, [chainId, sdkChains]);
|
|
103
|
-
const mvxChain = useMemo(() => {
|
|
104
|
-
return chains.find(
|
|
105
|
-
(chain) => chain.chainId.toString() === mvxChainId.toString()
|
|
106
|
-
);
|
|
107
|
-
}, [chainId, chains]);
|
|
108
|
-
const { evm, solana, bitcoin, sui } = useSignTransaction();
|
|
109
|
-
const sendTransactions = useSendTransactions();
|
|
110
|
-
const {
|
|
111
|
-
mutate: getRate,
|
|
112
|
-
data: rate,
|
|
113
|
-
isPending: isPendingRate,
|
|
114
|
-
error: rateError
|
|
115
|
-
} = useGetRateMutation();
|
|
116
|
-
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;
|
|
117
|
-
const handleSwitchNetwork = useCallback(
|
|
118
|
-
(chain) => {
|
|
119
|
-
const sdkChain = sdkChains.find(
|
|
120
|
-
(c) => sameBridgeApiChainId(c.id, chain.id)
|
|
70
|
+
var we, Ne;
|
|
71
|
+
const Ke = Pe(null), de = Pe(void 0), [$, Ye] = x(!1), [F, N] = x(!1), [Je, Ze] = x(1), [K, Y] = x(0), f = Ui(), { switchNetwork: me } = ki(), ue = Gi(), {
|
|
72
|
+
config: pe,
|
|
73
|
+
options: he,
|
|
74
|
+
supportedChains: A,
|
|
75
|
+
nativeAuthToken: J,
|
|
76
|
+
bridgeOnly: Te
|
|
77
|
+
} = Fi(), Z = Wi(), ge = ji(), {
|
|
78
|
+
evmTokensWithBalances: ei,
|
|
79
|
+
mvxTokensWithBalances: ii,
|
|
80
|
+
isTokensLoading: ti,
|
|
81
|
+
isLoadingEvmTokensBalances: ni,
|
|
82
|
+
isLoadingMvxTokensBalances: ri,
|
|
83
|
+
chains: D = [],
|
|
84
|
+
isChainsLoading: oi
|
|
85
|
+
} = Oi({
|
|
86
|
+
refetchTrigger: Xe,
|
|
87
|
+
mvxAddress: l,
|
|
88
|
+
mvxApiURL: he.mvxApiURL
|
|
89
|
+
}), T = ti || ni || ri || oi, ai = h(() => A.find((i) => le(i.id, Z)), [Z, A]), a = h(() => D.find(
|
|
90
|
+
(i) => i.chainId.toString() === _.toString()
|
|
91
|
+
), [Z, D]), { evm: fe, solana: qe, bitcoin: be, sui: Ie } = zi(), ve = Xi(), {
|
|
92
|
+
mutate: si,
|
|
93
|
+
data: d,
|
|
94
|
+
isPending: S,
|
|
95
|
+
error: v
|
|
96
|
+
} = Qi(), k = ((we = v == null ? void 0 : v.response) == null ? void 0 : we.status) === 400 ? (Ne = v == null ? void 0 : v.response) == null ? void 0 : Ne.data.message : void 0, li = g(
|
|
97
|
+
(i) => {
|
|
98
|
+
const b = A.find(
|
|
99
|
+
(c) => le(c.id, i.id)
|
|
121
100
|
);
|
|
122
|
-
|
|
123
|
-
switchNetwork(sdkChain);
|
|
124
|
-
}
|
|
101
|
+
b && me(b);
|
|
125
102
|
},
|
|
126
|
-
[
|
|
127
|
-
)
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
const [secondAmount, setSecondAmount] = useState(secondTokenAmount ?? "");
|
|
159
|
-
const firstTokenChain = useMemo(() => {
|
|
160
|
-
if (!firstToken) {
|
|
161
|
-
return selectedChainOption;
|
|
162
|
-
}
|
|
163
|
-
return chains.find(
|
|
164
|
-
(chain) => sameBridgeApiChainId(chain.chainId, firstToken.chainId)
|
|
165
|
-
) ?? selectedChainOption;
|
|
166
|
-
}, [firstToken == null ? void 0 : firstToken.chainId, chains, selectedChainOption]);
|
|
167
|
-
const bridgeFromChainId = useMemo(
|
|
168
|
-
() => toBridgeApiChainId(firstToken == null ? void 0 : firstToken.chainId) ?? bridgeApiChainId,
|
|
169
|
-
[firstToken == null ? void 0 : firstToken.chainId, bridgeApiChainId]
|
|
170
|
-
);
|
|
171
|
-
const bridgeAddress = account.address;
|
|
172
|
-
const isAuthenticated = account.isConnected && Boolean(bridgeAddress);
|
|
173
|
-
const hasAmounts = firstAmount !== "" && secondAmount !== "";
|
|
174
|
-
const fetchRateDebounced = useCallback(
|
|
175
|
-
debounce(async (amount) => {
|
|
176
|
-
if (!amount || !Number(amount) || !account.address || !(firstToken == null ? void 0 : firstToken.address) || !(secondToken == null ? void 0 : secondToken.address) || !selectedChainOption || !bridgeFromChainId) {
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
getRate({
|
|
180
|
-
nativeAuthToken: nativeAuthToken ?? "",
|
|
103
|
+
[A, me]
|
|
104
|
+
), {
|
|
105
|
+
firstToken: e,
|
|
106
|
+
secondToken: o,
|
|
107
|
+
fromOptions: L,
|
|
108
|
+
toOptions: ci,
|
|
109
|
+
selectedChainOption: r,
|
|
110
|
+
onChangeFirstSelect: Be,
|
|
111
|
+
onChangeSecondSelect: di,
|
|
112
|
+
handleChangeDirection: mi
|
|
113
|
+
} = Pi({
|
|
114
|
+
chains: D,
|
|
115
|
+
activeChain: ai,
|
|
116
|
+
sdkChains: A,
|
|
117
|
+
switchNetwork: li,
|
|
118
|
+
fromTokens: ei,
|
|
119
|
+
toTokens: ii,
|
|
120
|
+
firstTokenIdentifier: Oe,
|
|
121
|
+
secondTokenIdentifier: We,
|
|
122
|
+
forcedDestinationTokenSymbol: Ge,
|
|
123
|
+
isTokensLoading: T,
|
|
124
|
+
callbackRoute: He,
|
|
125
|
+
onNavigate: _e
|
|
126
|
+
}), ui = h(() => e ? Ve.includes(e.chainId.toString()) : !1, [e == null ? void 0 : e.chainId]), pi = h(() => o ? Ve.includes(o.chainId.toString()) : !1, [o == null ? void 0 : o.chainId]), [m, hi] = x(P ?? ""), [U, j] = x(w ?? ""), B = h(() => e ? D.find(
|
|
127
|
+
(i) => le(i.chainId, e.chainId)
|
|
128
|
+
) ?? r : r, [e == null ? void 0 : e.chainId, D, r]), H = h(
|
|
129
|
+
() => Li(e == null ? void 0 : e.chainId) ?? ge,
|
|
130
|
+
[e == null ? void 0 : e.chainId, ge]
|
|
131
|
+
), ee = f.address, Ce = f.isConnected && !!ee, ie = m !== "" && U !== "", te = g(
|
|
132
|
+
Mi(async (i) => {
|
|
133
|
+
!i || !Number(i) || !f.address || !(e != null && e.address) || !(o != null && o.address) || !r || !H || si({
|
|
134
|
+
nativeAuthToken: J ?? "",
|
|
181
135
|
body: {
|
|
182
|
-
tokenIn:
|
|
183
|
-
amountIn:
|
|
184
|
-
fromChainId:
|
|
185
|
-
tokenOut:
|
|
186
|
-
toChainId:
|
|
136
|
+
tokenIn: e.address,
|
|
137
|
+
amountIn: i,
|
|
138
|
+
fromChainId: H,
|
|
139
|
+
tokenOut: o.address,
|
|
140
|
+
toChainId: _
|
|
187
141
|
}
|
|
188
142
|
});
|
|
189
143
|
}, 500),
|
|
190
144
|
[
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
145
|
+
f.address,
|
|
146
|
+
H,
|
|
147
|
+
e == null ? void 0 : e.address,
|
|
148
|
+
o == null ? void 0 : o.address,
|
|
149
|
+
r
|
|
196
150
|
]
|
|
197
|
-
)
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}, [])
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
const formattedBalance = formatAmount({
|
|
209
|
-
decimals: firstToken == null ? void 0 : firstToken.decimals,
|
|
210
|
-
input: (firstToken == null ? void 0 : firstToken.balance) ?? "0",
|
|
211
|
-
addCommas: false,
|
|
151
|
+
), u = g((i) => {
|
|
152
|
+
hi(() => i);
|
|
153
|
+
}, []), C = g((i) => {
|
|
154
|
+
j(() => i);
|
|
155
|
+
}, []), gi = g(() => {
|
|
156
|
+
E == null || E();
|
|
157
|
+
}, [E]), fi = g(() => {
|
|
158
|
+
const i = Si({
|
|
159
|
+
decimals: e == null ? void 0 : e.decimals,
|
|
160
|
+
input: (e == null ? void 0 : e.balance) ?? "0",
|
|
161
|
+
addCommas: !1,
|
|
212
162
|
digits: 4
|
|
213
163
|
});
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
async (txHashes) => {
|
|
219
|
-
handleOnChangeFirstAmount("");
|
|
220
|
-
handleOnChangeSecondAmount("");
|
|
221
|
-
invalidateHistoryQuery();
|
|
222
|
-
invalidateHistoryQuery();
|
|
223
|
-
onSuccessfullySentTransaction == null ? void 0 : onSuccessfullySentTransaction(txHashes);
|
|
164
|
+
q.setFieldValue("firstAmount", i), u(i);
|
|
165
|
+
}, [e == null ? void 0 : e.balance, e == null ? void 0 : e.decimals, u]), xe = g(
|
|
166
|
+
async (i) => {
|
|
167
|
+
u(""), C(""), ue(), ue(), V == null || V(i);
|
|
224
168
|
},
|
|
225
169
|
[
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
170
|
+
u,
|
|
171
|
+
C,
|
|
172
|
+
V
|
|
229
173
|
]
|
|
230
|
-
)
|
|
231
|
-
|
|
232
|
-
handleTokenChangeDirection();
|
|
233
|
-
onChangeDirection();
|
|
174
|
+
), qi = () => {
|
|
175
|
+
mi(), $e();
|
|
234
176
|
};
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
177
|
+
y(() => {
|
|
178
|
+
const i = de.current;
|
|
179
|
+
if (de.current = r == null ? void 0 : r.chainId, !!i && (r == null ? void 0 : r.chainId) !== (e == null ? void 0 : e.chainId)) {
|
|
180
|
+
const b = L == null ? void 0 : L.find(
|
|
181
|
+
(c) => c.chainId.toString() === (r == null ? void 0 : r.chainId)
|
|
239
182
|
);
|
|
240
|
-
if (!
|
|
183
|
+
if (!b)
|
|
241
184
|
return;
|
|
242
|
-
|
|
243
|
-
onChangeFirstSelect(selectedOption);
|
|
185
|
+
Be(b);
|
|
244
186
|
}
|
|
245
|
-
}, [
|
|
246
|
-
const
|
|
187
|
+
}, [r == null ? void 0 : r.chainId]);
|
|
188
|
+
const bi = g(
|
|
247
189
|
async ({
|
|
248
|
-
transactions,
|
|
249
|
-
provider
|
|
190
|
+
transactions: i,
|
|
191
|
+
provider: b
|
|
250
192
|
}) => {
|
|
251
|
-
var
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
setSigningTransactionsCount(() => transactions.length);
|
|
193
|
+
var Ae, De, Se;
|
|
194
|
+
const c = [];
|
|
195
|
+
N(!0), Y(() => i.length);
|
|
255
196
|
try {
|
|
256
|
-
let
|
|
257
|
-
for (const
|
|
258
|
-
++
|
|
197
|
+
let R = -1;
|
|
198
|
+
for (const t of i) {
|
|
199
|
+
++R;
|
|
259
200
|
try {
|
|
260
|
-
switch (
|
|
261
|
-
case
|
|
262
|
-
const
|
|
263
|
-
...
|
|
264
|
-
value: BigInt(
|
|
265
|
-
gas: BigInt(
|
|
266
|
-
account:
|
|
201
|
+
switch (Vi(t, B)) {
|
|
202
|
+
case z.evm: {
|
|
203
|
+
const p = await fe.signTransaction({
|
|
204
|
+
...t,
|
|
205
|
+
value: BigInt(t.value),
|
|
206
|
+
gas: BigInt(t.gasLimit),
|
|
207
|
+
account: ee
|
|
267
208
|
});
|
|
268
|
-
if (!
|
|
209
|
+
if (!p || (c.push({
|
|
210
|
+
...t,
|
|
211
|
+
txHash: p
|
|
212
|
+
}), R === i.length - 1 || !p))
|
|
269
213
|
break;
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
...transaction,
|
|
273
|
-
txHash: hash
|
|
274
|
-
});
|
|
275
|
-
if (txIndex === transactions.length - 1 || !hash) {
|
|
276
|
-
break;
|
|
277
|
-
}
|
|
278
|
-
const transactionReceipt = await waitForTransactionReceipt(
|
|
279
|
-
config,
|
|
214
|
+
const W = await Ri(
|
|
215
|
+
pe,
|
|
280
216
|
{
|
|
281
217
|
confirmations: 1,
|
|
282
|
-
hash
|
|
218
|
+
hash: p
|
|
283
219
|
}
|
|
284
220
|
);
|
|
285
221
|
console.info({
|
|
286
|
-
transactionReceipt,
|
|
287
|
-
hash
|
|
222
|
+
transactionReceipt: W,
|
|
223
|
+
hash: p
|
|
288
224
|
});
|
|
289
225
|
break;
|
|
290
226
|
}
|
|
291
|
-
case
|
|
292
|
-
if (!
|
|
227
|
+
case z.sol:
|
|
228
|
+
if (!t.instructions || !t.feePayer)
|
|
293
229
|
break;
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
recentBlockhash: transaction.recentBlockhash
|
|
230
|
+
const se = await qe.signTransaction({
|
|
231
|
+
feePayer: t.feePayer,
|
|
232
|
+
instructions: t.instructions,
|
|
233
|
+
recentBlockhash: t.recentBlockhash
|
|
299
234
|
});
|
|
300
|
-
if (!
|
|
235
|
+
if (!se)
|
|
301
236
|
break;
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
txHash
|
|
237
|
+
c.push({
|
|
238
|
+
...t,
|
|
239
|
+
txHash: se
|
|
306
240
|
});
|
|
307
241
|
break;
|
|
308
|
-
case
|
|
309
|
-
if (!
|
|
242
|
+
case z.btc:
|
|
243
|
+
if (!t.bitcoinParams) {
|
|
310
244
|
console.error("No bitcoin params");
|
|
311
245
|
break;
|
|
312
246
|
}
|
|
313
|
-
const
|
|
314
|
-
|
|
247
|
+
const wi = await be.signTransaction(
|
|
248
|
+
t.bitcoinParams
|
|
315
249
|
);
|
|
316
|
-
|
|
317
|
-
...
|
|
318
|
-
txHash:
|
|
250
|
+
c.push({
|
|
251
|
+
...t,
|
|
252
|
+
txHash: wi
|
|
319
253
|
});
|
|
320
254
|
break;
|
|
321
|
-
case
|
|
322
|
-
const
|
|
323
|
-
|
|
324
|
-
if (!serializedTx || !sender) {
|
|
255
|
+
case z.sui: {
|
|
256
|
+
const p = (Ae = t.suiParams) == null ? void 0 : Ae.transactionBytes, W = (De = t.suiParams) == null ? void 0 : De.sender;
|
|
257
|
+
if (!p || !W) {
|
|
325
258
|
console.error("No Sui transaction bytes or sender address");
|
|
326
259
|
break;
|
|
327
260
|
}
|
|
328
|
-
const
|
|
329
|
-
transaction:
|
|
330
|
-
address:
|
|
261
|
+
const Me = await Ie.signTransaction({
|
|
262
|
+
transaction: p,
|
|
263
|
+
address: W
|
|
331
264
|
});
|
|
332
|
-
if (!
|
|
265
|
+
if (!Me)
|
|
333
266
|
break;
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
...transaction,
|
|
267
|
+
c.push({
|
|
268
|
+
...t,
|
|
337
269
|
suiParams: {
|
|
338
|
-
...
|
|
339
|
-
signature
|
|
270
|
+
...t.suiParams,
|
|
271
|
+
signature: Me
|
|
340
272
|
}
|
|
341
273
|
});
|
|
342
274
|
break;
|
|
343
275
|
}
|
|
344
276
|
default:
|
|
345
|
-
|
|
346
|
-
setPendingSigning(false);
|
|
277
|
+
M.error("Provider not supported"), N(!1);
|
|
347
278
|
return;
|
|
348
279
|
}
|
|
349
|
-
|
|
350
|
-
() =>
|
|
280
|
+
Y(
|
|
281
|
+
() => i.length - 1 - R
|
|
351
282
|
);
|
|
352
|
-
} catch
|
|
353
|
-
|
|
354
|
-
toast.error("Transaction aborted");
|
|
355
|
-
onFailedSentTransaction == null ? void 0 : onFailedSentTransaction("Transaction aborted");
|
|
356
|
-
setPendingSigning(false);
|
|
283
|
+
} catch {
|
|
284
|
+
M.dismiss(), M.error("Transaction aborted"), I == null || I("Transaction aborted"), N(!1);
|
|
357
285
|
return;
|
|
358
286
|
}
|
|
359
287
|
}
|
|
360
|
-
const { data:
|
|
361
|
-
transactions:
|
|
362
|
-
provider,
|
|
363
|
-
url:
|
|
364
|
-
token:
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
onSuccess(txHashes);
|
|
370
|
-
setPendingSigning(false);
|
|
371
|
-
} catch (e) {
|
|
372
|
-
console.error(e);
|
|
373
|
-
toast.dismiss();
|
|
374
|
-
toast.error("Transaction cancelled");
|
|
375
|
-
onFailedSentTransaction == null ? void 0 : onFailedSentTransaction("Transaction cancelled");
|
|
376
|
-
setPendingSigning(false);
|
|
377
|
-
setSigningTransactionsCount(0);
|
|
378
|
-
resetSwapForm();
|
|
379
|
-
handleOnChangeFirstAmount("");
|
|
380
|
-
handleOnChangeSecondAmount("");
|
|
288
|
+
const { data: ae } = await ve({
|
|
289
|
+
transactions: c,
|
|
290
|
+
provider: b,
|
|
291
|
+
url: Ei() ?? "",
|
|
292
|
+
token: J ?? ""
|
|
293
|
+
}), ke = ((Se = ae.transactions) == null ? void 0 : Se.map((t) => t.txHash).filter((t) => !!t)) ?? [], Re = c.map((t) => t.txHash).filter((t) => !!t), yi = ke.length > 0 ? ke : Re.length > 0 ? Re : ae.batchId ? [ae.batchId] : [];
|
|
294
|
+
xe(yi), N(!1);
|
|
295
|
+
} catch (R) {
|
|
296
|
+
console.error(R), M.dismiss(), M.error("Transaction cancelled"), I == null || I("Transaction cancelled"), N(!1), Y(0), vi(), u(""), C("");
|
|
381
297
|
}
|
|
382
298
|
},
|
|
383
299
|
[
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
300
|
+
B == null ? void 0 : B.chainType,
|
|
301
|
+
ee,
|
|
302
|
+
pe,
|
|
303
|
+
u,
|
|
304
|
+
C,
|
|
305
|
+
J,
|
|
306
|
+
xe,
|
|
307
|
+
ve,
|
|
308
|
+
be.signTransaction,
|
|
309
|
+
fe.signTransaction,
|
|
310
|
+
qe.signTransaction,
|
|
311
|
+
Ie.signTransaction
|
|
396
312
|
]
|
|
397
|
-
)
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
}, [
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
}
|
|
438
|
-
fetchRateInterval = setInterval(() => {
|
|
439
|
-
fetchRateDebounced(firstAmount);
|
|
440
|
-
}, 50 * 1e3);
|
|
441
|
-
return () => clearInterval(fetchRateInterval);
|
|
442
|
-
}, [firstAmount, forceRefetchRate, fetchRateDebounced]);
|
|
443
|
-
useEffect(() => {
|
|
444
|
-
if (!(rate == null ? void 0 : rate.amountOut)) {
|
|
445
|
-
return;
|
|
446
|
-
}
|
|
447
|
-
formik.setFieldValue(BridgeFormikValuesEnum.secondAmount, rate.amountOut);
|
|
448
|
-
setSecondAmount(rate.amountOut);
|
|
449
|
-
}, [rate == null ? void 0 : rate.amountOut]);
|
|
450
|
-
useEffect(() => {
|
|
451
|
-
if (rateValidationError) {
|
|
452
|
-
formik.setFieldValue(BridgeFormikValuesEnum.secondAmount, "0");
|
|
453
|
-
setSecondAmount("0");
|
|
454
|
-
}
|
|
455
|
-
}, [rateValidationError]);
|
|
456
|
-
useEffect(() => {
|
|
457
|
-
if (firstTokenAmount) {
|
|
458
|
-
formik.setFieldValue(
|
|
459
|
-
BridgeFormikValuesEnum.firstAmount,
|
|
460
|
-
firstTokenAmount
|
|
461
|
-
);
|
|
462
|
-
handleOnChangeFirstAmount(firstTokenAmount);
|
|
463
|
-
}
|
|
464
|
-
}, []);
|
|
465
|
-
useEffect(() => {
|
|
466
|
-
if (secondTokenAmount) {
|
|
467
|
-
formik.setFieldValue(
|
|
468
|
-
BridgeFormikValuesEnum.secondAmount,
|
|
469
|
-
secondTokenAmount
|
|
470
|
-
);
|
|
471
|
-
handleOnChangeSecondAmount(secondTokenAmount);
|
|
472
|
-
}
|
|
473
|
-
}, [secondTokenAmount]);
|
|
474
|
-
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
313
|
+
), {
|
|
314
|
+
formik: q,
|
|
315
|
+
firstAmountError: ne,
|
|
316
|
+
secondAmountError: re,
|
|
317
|
+
fromChainError: oe,
|
|
318
|
+
handleBlur: O,
|
|
319
|
+
handleChange: ye,
|
|
320
|
+
handleSubmit: Ii,
|
|
321
|
+
resetSwapForm: vi
|
|
322
|
+
} = Hi({
|
|
323
|
+
isMvxConnected: !!l,
|
|
324
|
+
rate: d,
|
|
325
|
+
sender: f.address ?? "",
|
|
326
|
+
receiver: l ?? "",
|
|
327
|
+
firstToken: e,
|
|
328
|
+
firstAmount: m,
|
|
329
|
+
fromChainId: H,
|
|
330
|
+
toChainId: _,
|
|
331
|
+
secondToken: o,
|
|
332
|
+
secondAmount: U,
|
|
333
|
+
setForceRefetchRate: Ze,
|
|
334
|
+
onSubmit: bi
|
|
335
|
+
}), Bi = !!(ne || re || oe || k), Ci = h(() => m !== "" ? k ?? ne : void 0, [ne, m, k]), xi = h(() => U !== "" ? oe ?? re : void 0, [oe, re, U]);
|
|
336
|
+
return y(() => (m || j(""), te(m), Q && clearInterval(Q), Q = setInterval(() => {
|
|
337
|
+
te(m);
|
|
338
|
+
}, 50 * 1e3), () => clearInterval(Q)), [m, Je, te]), y(() => {
|
|
339
|
+
d != null && d.amountOut && (q.setFieldValue(G.secondAmount, d.amountOut), j(d.amountOut));
|
|
340
|
+
}, [d == null ? void 0 : d.amountOut]), y(() => {
|
|
341
|
+
k && (q.setFieldValue(G.secondAmount, "0"), j("0"));
|
|
342
|
+
}, [k]), y(() => {
|
|
343
|
+
P && (q.setFieldValue(
|
|
344
|
+
G.firstAmount,
|
|
345
|
+
P
|
|
346
|
+
), u(P));
|
|
347
|
+
}, []), y(() => {
|
|
348
|
+
w && (q.setFieldValue(
|
|
349
|
+
G.secondAmount,
|
|
350
|
+
w
|
|
351
|
+
), C(w));
|
|
352
|
+
}, [w]), /* @__PURE__ */ n(Ni, { children: /* @__PURE__ */ s(
|
|
475
353
|
"form",
|
|
476
354
|
{
|
|
477
|
-
ref,
|
|
478
|
-
noValidate:
|
|
355
|
+
ref: Ke,
|
|
356
|
+
noValidate: !0,
|
|
479
357
|
className: "liq-flex liq-flex-col liq-gap-1 liq-relative",
|
|
480
358
|
autoComplete: "off",
|
|
481
|
-
onSubmit:
|
|
359
|
+
onSubmit: Ii,
|
|
482
360
|
children: [
|
|
483
|
-
|
|
484
|
-
/* @__PURE__ */
|
|
485
|
-
|
|
361
|
+
ze && /* @__PURE__ */ n($i, { mvxAddress: l, onClose: gi }),
|
|
362
|
+
/* @__PURE__ */ s(
|
|
363
|
+
Fe,
|
|
486
364
|
{
|
|
487
|
-
className:
|
|
365
|
+
className: Ee(
|
|
488
366
|
"liq-pb-8 liq-pt-6 hover:liq-bg-neutral-700/50 sm:liq-pb-6",
|
|
489
367
|
{
|
|
490
|
-
"liq-pointer-events-none":
|
|
491
|
-
"focus-within:liq-outline-neutral-700/75 hover:liq-outline-neutral-700/55 hover:focus-within:liq-outline-neutral-700/80":
|
|
368
|
+
"liq-pointer-events-none": $,
|
|
369
|
+
"focus-within:liq-outline-neutral-700/75 hover:liq-outline-neutral-700/55 hover:focus-within:liq-outline-neutral-700/80": !$
|
|
492
370
|
}
|
|
493
371
|
),
|
|
494
372
|
children: [
|
|
495
|
-
/* @__PURE__ */
|
|
496
|
-
/* @__PURE__ */
|
|
497
|
-
/* @__PURE__ */
|
|
498
|
-
|
|
373
|
+
/* @__PURE__ */ s("div", { className: "liq-flex liq-items-center liq-gap-1", children: [
|
|
374
|
+
/* @__PURE__ */ n("span", { children: "From" }),
|
|
375
|
+
/* @__PURE__ */ n(
|
|
376
|
+
Ji,
|
|
499
377
|
{
|
|
500
|
-
disabled:
|
|
501
|
-
activeChain:
|
|
378
|
+
disabled: S,
|
|
379
|
+
activeChain: B
|
|
502
380
|
}
|
|
503
381
|
)
|
|
504
382
|
] }),
|
|
505
|
-
/* @__PURE__ */
|
|
506
|
-
/* @__PURE__ */
|
|
507
|
-
|
|
383
|
+
/* @__PURE__ */ s("div", { className: "liq-flex liq-justify-between liq-gap-1", children: [
|
|
384
|
+
/* @__PURE__ */ n(
|
|
385
|
+
Le,
|
|
508
386
|
{
|
|
509
387
|
inputName: "firstAmount",
|
|
510
|
-
inputValue:
|
|
511
|
-
amountError:
|
|
512
|
-
disabled:
|
|
513
|
-
onInputDebounceChange:
|
|
514
|
-
onInputChange:
|
|
515
|
-
onBlur:
|
|
388
|
+
inputValue: q.values.firstAmount,
|
|
389
|
+
amountError: Ci,
|
|
390
|
+
disabled: !1,
|
|
391
|
+
onInputDebounceChange: u,
|
|
392
|
+
onInputChange: ye,
|
|
393
|
+
onBlur: O
|
|
516
394
|
}
|
|
517
395
|
),
|
|
518
|
-
/* @__PURE__ */
|
|
519
|
-
|
|
396
|
+
/* @__PURE__ */ n(
|
|
397
|
+
Ue,
|
|
520
398
|
{
|
|
521
399
|
name: "firstToken",
|
|
522
|
-
disabled:
|
|
523
|
-
options:
|
|
524
|
-
areOptionsLoading:
|
|
525
|
-
isMvxSelector:
|
|
526
|
-
isDestination:
|
|
400
|
+
disabled: S,
|
|
401
|
+
options: L,
|
|
402
|
+
areOptionsLoading: T,
|
|
403
|
+
isMvxSelector: ui,
|
|
404
|
+
isDestination: !1,
|
|
527
405
|
color: "neutral-850",
|
|
528
|
-
onChange:
|
|
529
|
-
onBlur:
|
|
530
|
-
onMaxBtnClick:
|
|
531
|
-
selectedOption:
|
|
532
|
-
onTokenSelectorDisplay: (
|
|
406
|
+
onChange: Be,
|
|
407
|
+
onBlur: O,
|
|
408
|
+
onMaxBtnClick: fi,
|
|
409
|
+
selectedOption: e,
|
|
410
|
+
onTokenSelectorDisplay: (i) => Ye(i)
|
|
533
411
|
}
|
|
534
412
|
)
|
|
535
413
|
] })
|
|
536
414
|
]
|
|
537
415
|
}
|
|
538
416
|
),
|
|
539
|
-
/* @__PURE__ */
|
|
540
|
-
/* @__PURE__ */
|
|
541
|
-
|
|
417
|
+
/* @__PURE__ */ n("div", { className: "liq-absolute liq-left-[6%] liq-top-[40%] -liq-mt-1 liq-z-10", children: Te && /* @__PURE__ */ n(Ti, { onChangeDirection: qi }) }),
|
|
418
|
+
/* @__PURE__ */ s(
|
|
419
|
+
Fe,
|
|
542
420
|
{
|
|
543
|
-
className:
|
|
421
|
+
className: Ee(
|
|
544
422
|
"liq-pb-8 liq-pt-6 hover:liq-bg-neutral-700/50 sm:liq-pb-6",
|
|
545
423
|
{
|
|
546
|
-
"liq-pointer-events-none":
|
|
424
|
+
"liq-pointer-events-none": $
|
|
547
425
|
}
|
|
548
426
|
),
|
|
549
427
|
children: [
|
|
550
|
-
/* @__PURE__ */
|
|
551
|
-
/* @__PURE__ */
|
|
552
|
-
/* @__PURE__ */
|
|
553
|
-
|
|
428
|
+
/* @__PURE__ */ s("div", { className: "liq-flex liq-items-center liq-gap-1", children: [
|
|
429
|
+
/* @__PURE__ */ n("span", { children: "To" }),
|
|
430
|
+
/* @__PURE__ */ n(
|
|
431
|
+
Zi,
|
|
554
432
|
{
|
|
555
|
-
accountAddress:
|
|
556
|
-
chainIcon: (
|
|
557
|
-
username,
|
|
558
|
-
accountExplorerUrl: `${
|
|
559
|
-
showTag:
|
|
560
|
-
onDisconnect:
|
|
561
|
-
onConnect:
|
|
433
|
+
accountAddress: l,
|
|
434
|
+
chainIcon: X(a == null ? void 0 : a.pngUrl),
|
|
435
|
+
username: je,
|
|
436
|
+
accountExplorerUrl: `${he.mvxExplorerAddress}/accounts/${l}`,
|
|
437
|
+
showTag: !0,
|
|
438
|
+
onDisconnect: Qe,
|
|
439
|
+
onConnect: ce
|
|
562
440
|
}
|
|
563
441
|
)
|
|
564
442
|
] }),
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
-
/* @__PURE__ */
|
|
567
|
-
|
|
443
|
+
/* @__PURE__ */ s("div", { className: "liq-flex liq-justify-between liq-gap-1", children: [
|
|
444
|
+
/* @__PURE__ */ n(
|
|
445
|
+
Le,
|
|
568
446
|
{
|
|
569
447
|
inputName: "secondAmount",
|
|
570
|
-
inputValue:
|
|
571
|
-
amountError:
|
|
572
|
-
disabled:
|
|
573
|
-
onInputDebounceChange:
|
|
574
|
-
onInputChange:
|
|
575
|
-
onBlur:
|
|
448
|
+
inputValue: q.values.secondAmount,
|
|
449
|
+
amountError: xi,
|
|
450
|
+
disabled: !1,
|
|
451
|
+
onInputDebounceChange: C,
|
|
452
|
+
onInputChange: ye,
|
|
453
|
+
onBlur: O
|
|
576
454
|
}
|
|
577
455
|
),
|
|
578
|
-
/* @__PURE__ */
|
|
579
|
-
|
|
456
|
+
/* @__PURE__ */ n(
|
|
457
|
+
Ue,
|
|
580
458
|
{
|
|
581
459
|
name: "secondToken",
|
|
582
|
-
disabled:
|
|
583
|
-
omitDisableClass:
|
|
584
|
-
options:
|
|
585
|
-
areOptionsLoading:
|
|
586
|
-
isMvxSelector:
|
|
460
|
+
disabled: S,
|
|
461
|
+
omitDisableClass: !0,
|
|
462
|
+
options: ci,
|
|
463
|
+
areOptionsLoading: T,
|
|
464
|
+
isMvxSelector: pi,
|
|
587
465
|
color: "neutral-850",
|
|
588
|
-
onChange:
|
|
589
|
-
onBlur:
|
|
590
|
-
selectedOption:
|
|
466
|
+
onChange: di,
|
|
467
|
+
onBlur: O,
|
|
468
|
+
selectedOption: o
|
|
591
469
|
}
|
|
592
470
|
)
|
|
593
471
|
] })
|
|
594
472
|
]
|
|
595
473
|
}
|
|
596
474
|
),
|
|
597
|
-
/* @__PURE__ */
|
|
598
|
-
!
|
|
599
|
-
|
|
475
|
+
/* @__PURE__ */ s("div", { className: "liq-flex liq-items-center liq-justify-center", children: [
|
|
476
|
+
!l && /* @__PURE__ */ n(
|
|
477
|
+
Yi,
|
|
600
478
|
{
|
|
601
|
-
mvxAccountAddress:
|
|
602
|
-
icon: (
|
|
603
|
-
onClick:
|
|
479
|
+
mvxAccountAddress: l,
|
|
480
|
+
icon: X(a == null ? void 0 : a.pngUrl),
|
|
481
|
+
onClick: ce
|
|
604
482
|
}
|
|
605
483
|
),
|
|
606
|
-
|
|
607
|
-
|
|
484
|
+
l && !Ce && /* @__PURE__ */ n(
|
|
485
|
+
Ki,
|
|
608
486
|
{
|
|
609
487
|
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",
|
|
610
|
-
disabled:
|
|
611
|
-
activeChain:
|
|
488
|
+
disabled: S,
|
|
489
|
+
activeChain: B
|
|
612
490
|
}
|
|
613
491
|
),
|
|
614
|
-
|
|
615
|
-
|
|
492
|
+
l && Ce && /* @__PURE__ */ s(
|
|
493
|
+
_i,
|
|
616
494
|
{
|
|
617
495
|
type: "submit",
|
|
618
496
|
variant: "neutral-850",
|
|
619
497
|
className: "liq-w-full disabled:liq-bg-neutral-850/50 liq-py-3 hover:enabled:liq-bg-primary !liq-text-primary-200",
|
|
620
|
-
disabled: !
|
|
498
|
+
disabled: !ie || S || !l || !f.address || Bi || F,
|
|
621
499
|
children: [
|
|
622
|
-
|
|
623
|
-
/* @__PURE__ */
|
|
624
|
-
/* @__PURE__ */
|
|
500
|
+
ie && !F && /* @__PURE__ */ s("div", { className: "liq-flex liq-justify-center liq-items-center liq-gap-2", children: [
|
|
501
|
+
/* @__PURE__ */ n("div", { children: "Deposit on " }),
|
|
502
|
+
/* @__PURE__ */ n(
|
|
625
503
|
"img",
|
|
626
504
|
{
|
|
627
|
-
src: (
|
|
505
|
+
src: X(a == null ? void 0 : a.pngUrl),
|
|
628
506
|
alt: "",
|
|
629
507
|
className: "liq-h-[1.5rem] liq-w-[1.5rem] liq-rounded-lg"
|
|
630
508
|
}
|
|
631
509
|
),
|
|
632
|
-
/* @__PURE__ */
|
|
510
|
+
/* @__PURE__ */ n("div", { children: "MultiversX" })
|
|
633
511
|
] }),
|
|
634
|
-
!
|
|
635
|
-
|
|
636
|
-
/* @__PURE__ */
|
|
637
|
-
|
|
512
|
+
!ie && !F && /* @__PURE__ */ n("span", { className: "liq-text-neutral-100", children: "Enter amount" }),
|
|
513
|
+
F && /* @__PURE__ */ s("div", { className: "liq-flex liq-justify-center liq-items-center liq-gap-2", children: [
|
|
514
|
+
/* @__PURE__ */ n(
|
|
515
|
+
Di,
|
|
638
516
|
{
|
|
639
|
-
icon:
|
|
640
|
-
spin:
|
|
517
|
+
icon: Ai,
|
|
518
|
+
spin: !0,
|
|
641
519
|
className: "liq-mx-1 liq-flex liq-items-center"
|
|
642
520
|
}
|
|
643
521
|
),
|
|
644
|
-
/* @__PURE__ */
|
|
645
|
-
/* @__PURE__ */
|
|
522
|
+
/* @__PURE__ */ n("div", { children: "Depositing on" }),
|
|
523
|
+
/* @__PURE__ */ n(
|
|
646
524
|
"img",
|
|
647
525
|
{
|
|
648
|
-
src: (
|
|
526
|
+
src: X(a == null ? void 0 : a.pngUrl),
|
|
649
527
|
alt: "",
|
|
650
528
|
className: "liq-h-[1.5rem] liq-w-[1.5rem] liq-rounded-lg"
|
|
651
529
|
}
|
|
652
530
|
),
|
|
653
|
-
/* @__PURE__ */
|
|
531
|
+
/* @__PURE__ */ n("div", { children: "MultiversX" })
|
|
654
532
|
] })
|
|
655
533
|
]
|
|
656
534
|
}
|
|
657
535
|
)
|
|
658
536
|
] }),
|
|
659
|
-
|
|
537
|
+
f.address && K > 0 && /* @__PURE__ */ n("div", { className: "liq-flex liq-items-center liq-justify-center liq-text-neutral-300 liq-text-sm", children: /* @__PURE__ */ s("div", { children: [
|
|
660
538
|
"You will be asked to sign ",
|
|
661
|
-
|
|
539
|
+
K,
|
|
662
540
|
" ",
|
|
663
|
-
|
|
541
|
+
K > 1 ? "transactions" : "transaction",
|
|
664
542
|
" ",
|
|
665
543
|
"on your wallet"
|
|
666
544
|
] }) })
|
|
@@ -669,5 +547,5 @@ const Deposit = ({
|
|
|
669
547
|
) });
|
|
670
548
|
};
|
|
671
549
|
export {
|
|
672
|
-
Deposit
|
|
550
|
+
$t as Deposit
|
|
673
551
|
};
|