@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,6 +1,6 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { mxClsx } from "../../utils/mxClsx.mjs";
|
|
3
|
-
import { MxCard } from "../base/MxCard/MxCard.mjs";
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { mxClsx as o } from "../../utils/mxClsx.mjs";
|
|
3
|
+
import { MxCard as m } from "../base/MxCard/MxCard.mjs";
|
|
4
4
|
import "../base/MxLink/MxLink.mjs";
|
|
5
5
|
import "../base/MxSearch/MxSearch.mjs";
|
|
6
6
|
import "@fortawesome/free-solid-svg-icons/faClose";
|
|
@@ -11,23 +11,21 @@ import "react-dom";
|
|
|
11
11
|
import "react-popper";
|
|
12
12
|
import "../base/MxTooltip/components/TooltipContainer/TooltipContainer.mjs";
|
|
13
13
|
import "../../constants/index.mjs";
|
|
14
|
-
const
|
|
15
|
-
className,
|
|
16
|
-
children
|
|
17
|
-
}) =>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
);
|
|
30
|
-
};
|
|
14
|
+
const g = ({
|
|
15
|
+
className: r,
|
|
16
|
+
children: t
|
|
17
|
+
}) => /* @__PURE__ */ i(
|
|
18
|
+
m,
|
|
19
|
+
{
|
|
20
|
+
cardSize: "lg",
|
|
21
|
+
variant: "neutral-750",
|
|
22
|
+
className: o(
|
|
23
|
+
"liq-flex liq-flex-col liq-gap-4 liq-outline liq-outline-transparent",
|
|
24
|
+
r
|
|
25
|
+
),
|
|
26
|
+
children: t
|
|
27
|
+
}
|
|
28
|
+
);
|
|
31
29
|
export {
|
|
32
|
-
AmountCard
|
|
30
|
+
g as AmountCard
|
|
33
31
|
};
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const reactjs_components_AmountCard_AmountCard = require("./AmountCard.js");
|
|
5
|
-
exports.AmountCard = reactjs_components_AmountCard_AmountCard.AmountCard;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./AmountCard.js");exports.AmountCard=e.AmountCard;
|
|
@@ -1,72 +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 reactNumberFormat = require("react-number-format");
|
|
6
|
-
const reactjs_utils_mxClsx = require("../../utils/mxClsx.js");
|
|
7
|
-
const AmountInput = ({
|
|
8
|
-
inputName,
|
|
9
|
-
inputValue,
|
|
10
|
-
disabled,
|
|
11
|
-
amountError,
|
|
12
|
-
omitDisableClass = false,
|
|
13
|
-
className,
|
|
14
|
-
onBlur,
|
|
15
|
-
onInputDebounceChange,
|
|
16
|
-
onInputChange
|
|
17
|
-
}) => {
|
|
18
|
-
const handleAmountChange = (event) => {
|
|
19
|
-
event.stopPropagation();
|
|
20
|
-
const { value } = event.target;
|
|
21
|
-
const amount = value.replace(/,/g, "");
|
|
22
|
-
onInputChange == null ? void 0 : onInputChange({
|
|
23
|
-
...event,
|
|
24
|
-
target: { name: inputName, value: amount }
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
const checkKeyDown = (e) => {
|
|
28
|
-
if (e.key === "Enter") {
|
|
29
|
-
e.preventDefault();
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "liq-flex liq-w-full liq-flex-col liq-justify-between", children: [
|
|
33
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
34
|
-
"div",
|
|
35
|
-
{
|
|
36
|
-
className: reactjs_utils_mxClsx.mxClsx(
|
|
37
|
-
"liq-flex liq-text-base liq-max-w-none liq-w-full liq-bg-transparent liq-relative",
|
|
38
|
-
{
|
|
39
|
-
"liq-disabled liq-animate-loader": disabled
|
|
40
|
-
}
|
|
41
|
-
),
|
|
42
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
43
|
-
reactNumberFormat.NumericFormat,
|
|
44
|
-
{
|
|
45
|
-
name: inputName,
|
|
46
|
-
value: inputValue,
|
|
47
|
-
placeholder: "0",
|
|
48
|
-
allowLeadingZeros: true,
|
|
49
|
-
thousandSeparator: ",",
|
|
50
|
-
allowNegative: false,
|
|
51
|
-
disabled,
|
|
52
|
-
className: reactjs_utils_mxClsx.mxClsx(
|
|
53
|
-
"liq-text-3xl liq-leading-9 liq-min-h-12 liq-py-0 liq-w-full liq-h-full liq-border-none liq-font-medium liq-px-0 liq-outline-0 liq-bg-transparent focus-visible:liq-outline-none",
|
|
54
|
-
{
|
|
55
|
-
"liq-disabled liq-animate-pulse": disabled && !omitDisableClass
|
|
56
|
-
},
|
|
57
|
-
className
|
|
58
|
-
),
|
|
59
|
-
onChange: handleAmountChange,
|
|
60
|
-
onValueChange: async ({ value }) => {
|
|
61
|
-
onInputDebounceChange == null ? void 0 : onInputDebounceChange(value);
|
|
62
|
-
},
|
|
63
|
-
onBlur,
|
|
64
|
-
onKeyDown: (e) => checkKeyDown(e)
|
|
65
|
-
}
|
|
66
|
-
)
|
|
67
|
-
}
|
|
68
|
-
),
|
|
69
|
-
amountError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "liq-flex liq-min-h-[2rem] liq-items-end", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "liq-text-danger liq-text-xs", children: amountError }) })
|
|
70
|
-
] });
|
|
71
|
-
};
|
|
72
|
-
exports.AmountInput = AmountInput;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("react-number-format"),q=require("../../utils/mxClsx.js"),j=({inputName:s,inputValue:n,disabled:i,amountError:r,omitDisableClass:o=!1,className:m,onBlur:c,onInputDebounceChange:t,onInputChange:a})=>{const x=l=>{l.stopPropagation();const{value:u}=l.target,f=u.replace(/,/g,"");a==null||a({...l,target:{name:s,value:f}})},d=l=>{l.key==="Enter"&&l.preventDefault()};return e.jsxs("div",{className:"liq-flex liq-w-full liq-flex-col liq-justify-between",children:[e.jsx("div",{className:q.mxClsx("liq-flex liq-text-base liq-max-w-none liq-w-full liq-bg-transparent liq-relative",{"liq-disabled liq-animate-loader":i}),children:e.jsx(v.NumericFormat,{name:s,value:n,placeholder:"0",allowLeadingZeros:!0,thousandSeparator:",",allowNegative:!1,disabled:i,className:q.mxClsx("liq-text-3xl liq-leading-9 liq-min-h-12 liq-py-0 liq-w-full liq-h-full liq-border-none liq-font-medium liq-px-0 liq-outline-0 liq-bg-transparent focus-visible:liq-outline-none",{"liq-disabled liq-animate-pulse":i&&!o},m),onChange:x,onValueChange:async({value:l})=>{t==null||t(l)},onBlur:c,onKeyDown:l=>d(l)})}),r&&e.jsx("div",{className:"liq-flex liq-min-h-[2rem] liq-items-end",children:e.jsx("div",{className:"liq-text-danger liq-text-xs",children:r})})]})};exports.AmountInput=j;
|
|
@@ -1,71 +1,67 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { NumericFormat } from "react-number-format";
|
|
3
|
-
import { mxClsx } from "../../utils/mxClsx.mjs";
|
|
4
|
-
const
|
|
5
|
-
inputName,
|
|
6
|
-
inputValue,
|
|
7
|
-
disabled,
|
|
8
|
-
amountError,
|
|
9
|
-
omitDisableClass =
|
|
10
|
-
className,
|
|
11
|
-
onBlur,
|
|
12
|
-
onInputDebounceChange,
|
|
13
|
-
onInputChange
|
|
1
|
+
import { jsxs as v, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { NumericFormat as w } from "react-number-format";
|
|
3
|
+
import { mxClsx as q } from "../../utils/mxClsx.mjs";
|
|
4
|
+
const N = ({
|
|
5
|
+
inputName: s,
|
|
6
|
+
inputValue: m,
|
|
7
|
+
disabled: e,
|
|
8
|
+
amountError: r,
|
|
9
|
+
omitDisableClass: o = !1,
|
|
10
|
+
className: n,
|
|
11
|
+
onBlur: c,
|
|
12
|
+
onInputDebounceChange: a,
|
|
13
|
+
onInputChange: t
|
|
14
14
|
}) => {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
const { value } =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
target: { name: inputName, value: amount }
|
|
15
|
+
const d = (l) => {
|
|
16
|
+
l.stopPropagation();
|
|
17
|
+
const { value: x } = l.target, u = x.replace(/,/g, "");
|
|
18
|
+
t == null || t({
|
|
19
|
+
...l,
|
|
20
|
+
target: { name: s, value: u }
|
|
22
21
|
});
|
|
22
|
+
}, f = (l) => {
|
|
23
|
+
l.key === "Enter" && l.preventDefault();
|
|
23
24
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
e.preventDefault();
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
return /* @__PURE__ */ jsxs("div", { className: "liq-flex liq-w-full liq-flex-col liq-justify-between", children: [
|
|
30
|
-
/* @__PURE__ */ jsx(
|
|
25
|
+
return /* @__PURE__ */ v("div", { className: "liq-flex liq-w-full liq-flex-col liq-justify-between", children: [
|
|
26
|
+
/* @__PURE__ */ i(
|
|
31
27
|
"div",
|
|
32
28
|
{
|
|
33
|
-
className:
|
|
29
|
+
className: q(
|
|
34
30
|
"liq-flex liq-text-base liq-max-w-none liq-w-full liq-bg-transparent liq-relative",
|
|
35
31
|
{
|
|
36
|
-
"liq-disabled liq-animate-loader":
|
|
32
|
+
"liq-disabled liq-animate-loader": e
|
|
37
33
|
}
|
|
38
34
|
),
|
|
39
|
-
children: /* @__PURE__ */
|
|
40
|
-
|
|
35
|
+
children: /* @__PURE__ */ i(
|
|
36
|
+
w,
|
|
41
37
|
{
|
|
42
|
-
name:
|
|
43
|
-
value:
|
|
38
|
+
name: s,
|
|
39
|
+
value: m,
|
|
44
40
|
placeholder: "0",
|
|
45
|
-
allowLeadingZeros:
|
|
41
|
+
allowLeadingZeros: !0,
|
|
46
42
|
thousandSeparator: ",",
|
|
47
|
-
allowNegative:
|
|
48
|
-
disabled,
|
|
49
|
-
className:
|
|
43
|
+
allowNegative: !1,
|
|
44
|
+
disabled: e,
|
|
45
|
+
className: q(
|
|
50
46
|
"liq-text-3xl liq-leading-9 liq-min-h-12 liq-py-0 liq-w-full liq-h-full liq-border-none liq-font-medium liq-px-0 liq-outline-0 liq-bg-transparent focus-visible:liq-outline-none",
|
|
51
47
|
{
|
|
52
|
-
"liq-disabled liq-animate-pulse":
|
|
48
|
+
"liq-disabled liq-animate-pulse": e && !o
|
|
53
49
|
},
|
|
54
|
-
|
|
50
|
+
n
|
|
55
51
|
),
|
|
56
|
-
onChange:
|
|
57
|
-
onValueChange: async ({ value }) => {
|
|
58
|
-
|
|
52
|
+
onChange: d,
|
|
53
|
+
onValueChange: async ({ value: l }) => {
|
|
54
|
+
a == null || a(l);
|
|
59
55
|
},
|
|
60
|
-
onBlur,
|
|
61
|
-
onKeyDown: (
|
|
56
|
+
onBlur: c,
|
|
57
|
+
onKeyDown: (l) => f(l)
|
|
62
58
|
}
|
|
63
59
|
)
|
|
64
60
|
}
|
|
65
61
|
),
|
|
66
|
-
|
|
62
|
+
r && /* @__PURE__ */ i("div", { className: "liq-flex liq-min-h-[2rem] liq-items-end", children: /* @__PURE__ */ i("div", { className: "liq-text-danger liq-text-xs", children: r }) })
|
|
67
63
|
] });
|
|
68
64
|
};
|
|
69
65
|
export {
|
|
70
|
-
AmountInput
|
|
66
|
+
N as AmountInput
|
|
71
67
|
};
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const reactjs_components_AmountInput_AmountInput = require("./AmountInput.js");
|
|
5
|
-
exports.AmountInput = reactjs_components_AmountInput_AmountInput.AmountInput;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./AmountInput.js");exports.AmountInput=t.AmountInput;
|
|
@@ -17,6 +17,15 @@ interface BridgeFormProps {
|
|
|
17
17
|
onHistoryClose?: () => void;
|
|
18
18
|
onMvxConnect: () => void;
|
|
19
19
|
onMvxDisconnect?: () => void;
|
|
20
|
+
/**
|
|
21
|
+
* Called after the SDK updates the URL with token query params.
|
|
22
|
+
* The SDK always calls `history.replaceState` first, so the URL is already
|
|
23
|
+
* updated client-side. This callback is purely informational — pass a
|
|
24
|
+
* soft client-side router (e.g. Next.js `router.replace`) so your framework
|
|
25
|
+
* stays in sync. Do NOT use `window.location.assign` or any hard navigation:
|
|
26
|
+
* that will cause an infinite reload loop when an injected EVM provider
|
|
27
|
+
* (MetaMask, etc.) auto-connects on mount.
|
|
28
|
+
*/
|
|
20
29
|
onNavigate?: (url: string, options?: object) => void;
|
|
21
30
|
}
|
|
22
31
|
export declare const BridgeForm: ({ mvxChainId, mvxAddress, username, callbackRoute, firstTokenIdentifier, secondTokenIdentifier, firstTokenAmount, secondTokenAmount, refetchTrigger, showHistory, forcedDestinationTokenSymbol, onSuccessfullySentTransaction, onSuccessfullySentMvxTransaction, onFailedSentMvxTransaction, onFailedSentTransaction, onMvxConnect, onMvxDisconnect, onHistoryClose, onNavigate }: BridgeFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,90 +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 React = require("react");
|
|
6
|
-
const reactjs_components_BridgeForm_Deposit = require("./Deposit.js");
|
|
7
|
-
const reactjs_components_BridgeForm_Transfer = require("./Transfer.js");
|
|
8
|
-
const reactjs_context_useWeb3App = require("../../context/useWeb3App.js");
|
|
9
|
-
const BridgeForm = ({
|
|
10
|
-
mvxChainId,
|
|
11
|
-
mvxAddress,
|
|
12
|
-
username,
|
|
13
|
-
callbackRoute = "/",
|
|
14
|
-
firstTokenIdentifier,
|
|
15
|
-
secondTokenIdentifier,
|
|
16
|
-
firstTokenAmount,
|
|
17
|
-
secondTokenAmount,
|
|
18
|
-
refetchTrigger,
|
|
19
|
-
showHistory,
|
|
20
|
-
forcedDestinationTokenSymbol,
|
|
21
|
-
onSuccessfullySentTransaction,
|
|
22
|
-
onSuccessfullySentMvxTransaction,
|
|
23
|
-
onFailedSentMvxTransaction,
|
|
24
|
-
onFailedSentTransaction,
|
|
25
|
-
onMvxConnect,
|
|
26
|
-
onMvxDisconnect,
|
|
27
|
-
onHistoryClose,
|
|
28
|
-
onNavigate
|
|
29
|
-
}) => {
|
|
30
|
-
const { bridgeOnly } = reactjs_context_useWeb3App.useWeb3App();
|
|
31
|
-
const [direction, setDirection] = React.useState(
|
|
32
|
-
bridgeOnly === false ? "deposit" : "deposit"
|
|
33
|
-
);
|
|
34
|
-
const handleChangeDirection = () => {
|
|
35
|
-
if (bridgeOnly === false) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
setDirection((prevState) => {
|
|
39
|
-
return prevState === "deposit" ? "withdraw" : "deposit";
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
return direction === "deposit" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
43
|
-
reactjs_components_BridgeForm_Deposit.Deposit,
|
|
44
|
-
{
|
|
45
|
-
mvxChainId,
|
|
46
|
-
mvxAddress,
|
|
47
|
-
username,
|
|
48
|
-
callbackRoute,
|
|
49
|
-
firstTokenIdentifier,
|
|
50
|
-
secondTokenIdentifier,
|
|
51
|
-
firstTokenAmount,
|
|
52
|
-
secondTokenAmount,
|
|
53
|
-
refetchTrigger,
|
|
54
|
-
showHistory,
|
|
55
|
-
forcedDestinationTokenSymbol,
|
|
56
|
-
direction,
|
|
57
|
-
onChangeDirection: handleChangeDirection,
|
|
58
|
-
onSuccessfullySentTransaction,
|
|
59
|
-
onFailedSentTransaction,
|
|
60
|
-
onHistoryClose,
|
|
61
|
-
onMvxConnect,
|
|
62
|
-
onMvxDisconnect,
|
|
63
|
-
onNavigate
|
|
64
|
-
}
|
|
65
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
66
|
-
reactjs_components_BridgeForm_Transfer.Transfer,
|
|
67
|
-
{
|
|
68
|
-
mvxChainId,
|
|
69
|
-
mvxAddress,
|
|
70
|
-
username,
|
|
71
|
-
callbackRoute,
|
|
72
|
-
firstTokenIdentifier,
|
|
73
|
-
secondTokenIdentifier,
|
|
74
|
-
firstTokenAmount,
|
|
75
|
-
secondTokenAmount,
|
|
76
|
-
refetchTrigger,
|
|
77
|
-
showHistory,
|
|
78
|
-
forcedDestinationTokenSymbol,
|
|
79
|
-
direction,
|
|
80
|
-
onChangeDirection: handleChangeDirection,
|
|
81
|
-
onSuccessfullySentTransaction: onSuccessfullySentMvxTransaction,
|
|
82
|
-
onFailedSentTransaction: onFailedSentMvxTransaction,
|
|
83
|
-
onHistoryClose,
|
|
84
|
-
onMvxConnect,
|
|
85
|
-
onMvxDisconnect,
|
|
86
|
-
onNavigate
|
|
87
|
-
}
|
|
88
|
-
);
|
|
89
|
-
};
|
|
90
|
-
exports.BridgeForm = BridgeForm;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),W=require("react"),f=require("./Deposit.js"),w=require("./Transfer.js"),y=require("../../context/useWeb3App.js"),P=({mvxChainId:r,mvxAddress:t,username:s,callbackRoute:i="/",firstTokenIdentifier:n,secondTokenIdentifier:c,firstTokenAmount:o,secondTokenAmount:a,refetchTrigger:p,showHistory:u,forcedDestinationTokenSymbol:d,onSuccessfullySentTransaction:b,onSuccessfullySentMvxTransaction:B,onFailedSentMvxTransaction:D,onFailedSentTransaction:h,onMvxConnect:_,onMvxDisconnect:g,onHistoryClose:j,onNavigate:l})=>{const{bridgeOnly:q}=y.useWeb3App(),[e,m]=W.useState("deposit"),F=()=>{q!==!1&&m(O=>O==="deposit"?"withdraw":"deposit")};return e==="deposit"?S.jsx(f.Deposit,{mvxChainId:r,mvxAddress:t,username:s,callbackRoute:i,firstTokenIdentifier:n,secondTokenIdentifier:c,firstTokenAmount:o,secondTokenAmount:a,refetchTrigger:p,showHistory:u,forcedDestinationTokenSymbol:d,direction:e,onChangeDirection:F,onSuccessfullySentTransaction:b,onFailedSentTransaction:h,onHistoryClose:j,onMvxConnect:_,onMvxDisconnect:g,onNavigate:l}):S.jsx(w.Transfer,{mvxChainId:r,mvxAddress:t,username:s,callbackRoute:i,firstTokenIdentifier:n,secondTokenIdentifier:c,firstTokenAmount:o,secondTokenAmount:a,refetchTrigger:p,showHistory:u,forcedDestinationTokenSymbol:d,direction:e,onChangeDirection:F,onSuccessfullySentTransaction:B,onFailedSentTransaction:D,onHistoryClose:j,onMvxConnect:_,onMvxDisconnect:g,onNavigate:l})};exports.BridgeForm=P;
|
|
@@ -1,89 +1,82 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { Deposit } from "./Deposit.mjs";
|
|
4
|
-
import { Transfer } from "./Transfer.mjs";
|
|
5
|
-
import { useWeb3App } from "../../context/useWeb3App.mjs";
|
|
6
|
-
const
|
|
7
|
-
mvxChainId,
|
|
8
|
-
mvxAddress,
|
|
9
|
-
username,
|
|
10
|
-
callbackRoute = "/",
|
|
11
|
-
firstTokenIdentifier,
|
|
12
|
-
secondTokenIdentifier,
|
|
13
|
-
firstTokenAmount,
|
|
14
|
-
secondTokenAmount,
|
|
15
|
-
refetchTrigger,
|
|
16
|
-
showHistory,
|
|
17
|
-
forcedDestinationTokenSymbol,
|
|
18
|
-
onSuccessfullySentTransaction,
|
|
19
|
-
onSuccessfullySentMvxTransaction,
|
|
20
|
-
onFailedSentMvxTransaction,
|
|
21
|
-
onFailedSentTransaction,
|
|
22
|
-
onMvxConnect,
|
|
23
|
-
onMvxDisconnect,
|
|
24
|
-
onHistoryClose,
|
|
25
|
-
onNavigate
|
|
1
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
2
|
+
import { useState as b } from "react";
|
|
3
|
+
import { Deposit as q } from "./Deposit.mjs";
|
|
4
|
+
import { Transfer as z } from "./Transfer.mjs";
|
|
5
|
+
import { useWeb3App as C } from "../../context/useWeb3App.mjs";
|
|
6
|
+
const P = ({
|
|
7
|
+
mvxChainId: t,
|
|
8
|
+
mvxAddress: i,
|
|
9
|
+
username: p,
|
|
10
|
+
callbackRoute: o = "/",
|
|
11
|
+
firstTokenIdentifier: e,
|
|
12
|
+
secondTokenIdentifier: s,
|
|
13
|
+
firstTokenAmount: a,
|
|
14
|
+
secondTokenAmount: m,
|
|
15
|
+
refetchTrigger: n,
|
|
16
|
+
showHistory: c,
|
|
17
|
+
forcedDestinationTokenSymbol: f,
|
|
18
|
+
onSuccessfullySentTransaction: F,
|
|
19
|
+
onSuccessfullySentMvxTransaction: j,
|
|
20
|
+
onFailedSentMvxTransaction: w,
|
|
21
|
+
onFailedSentTransaction: B,
|
|
22
|
+
onMvxConnect: d,
|
|
23
|
+
onMvxDisconnect: l,
|
|
24
|
+
onHistoryClose: u,
|
|
25
|
+
onNavigate: D
|
|
26
26
|
}) => {
|
|
27
|
-
const { bridgeOnly } =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const handleChangeDirection = () => {
|
|
32
|
-
if (bridgeOnly === false) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
setDirection((prevState) => {
|
|
36
|
-
return prevState === "deposit" ? "withdraw" : "deposit";
|
|
37
|
-
});
|
|
27
|
+
const { bridgeOnly: S } = C(), [r, O] = b(
|
|
28
|
+
"deposit"
|
|
29
|
+
), g = () => {
|
|
30
|
+
S !== !1 && O((W) => W === "deposit" ? "withdraw" : "deposit");
|
|
38
31
|
};
|
|
39
|
-
return
|
|
40
|
-
|
|
32
|
+
return r === "deposit" ? /* @__PURE__ */ h(
|
|
33
|
+
q,
|
|
41
34
|
{
|
|
42
|
-
mvxChainId,
|
|
43
|
-
mvxAddress,
|
|
44
|
-
username,
|
|
45
|
-
callbackRoute,
|
|
46
|
-
firstTokenIdentifier,
|
|
47
|
-
secondTokenIdentifier,
|
|
48
|
-
firstTokenAmount,
|
|
49
|
-
secondTokenAmount,
|
|
50
|
-
refetchTrigger,
|
|
51
|
-
showHistory,
|
|
52
|
-
forcedDestinationTokenSymbol,
|
|
53
|
-
direction,
|
|
54
|
-
onChangeDirection:
|
|
55
|
-
onSuccessfullySentTransaction,
|
|
56
|
-
onFailedSentTransaction,
|
|
57
|
-
onHistoryClose,
|
|
58
|
-
onMvxConnect,
|
|
59
|
-
onMvxDisconnect,
|
|
60
|
-
onNavigate
|
|
35
|
+
mvxChainId: t,
|
|
36
|
+
mvxAddress: i,
|
|
37
|
+
username: p,
|
|
38
|
+
callbackRoute: o,
|
|
39
|
+
firstTokenIdentifier: e,
|
|
40
|
+
secondTokenIdentifier: s,
|
|
41
|
+
firstTokenAmount: a,
|
|
42
|
+
secondTokenAmount: m,
|
|
43
|
+
refetchTrigger: n,
|
|
44
|
+
showHistory: c,
|
|
45
|
+
forcedDestinationTokenSymbol: f,
|
|
46
|
+
direction: r,
|
|
47
|
+
onChangeDirection: g,
|
|
48
|
+
onSuccessfullySentTransaction: F,
|
|
49
|
+
onFailedSentTransaction: B,
|
|
50
|
+
onHistoryClose: u,
|
|
51
|
+
onMvxConnect: d,
|
|
52
|
+
onMvxDisconnect: l,
|
|
53
|
+
onNavigate: D
|
|
61
54
|
}
|
|
62
|
-
) : /* @__PURE__ */
|
|
63
|
-
|
|
55
|
+
) : /* @__PURE__ */ h(
|
|
56
|
+
z,
|
|
64
57
|
{
|
|
65
|
-
mvxChainId,
|
|
66
|
-
mvxAddress,
|
|
67
|
-
username,
|
|
68
|
-
callbackRoute,
|
|
69
|
-
firstTokenIdentifier,
|
|
70
|
-
secondTokenIdentifier,
|
|
71
|
-
firstTokenAmount,
|
|
72
|
-
secondTokenAmount,
|
|
73
|
-
refetchTrigger,
|
|
74
|
-
showHistory,
|
|
75
|
-
forcedDestinationTokenSymbol,
|
|
76
|
-
direction,
|
|
77
|
-
onChangeDirection:
|
|
78
|
-
onSuccessfullySentTransaction:
|
|
79
|
-
onFailedSentTransaction:
|
|
80
|
-
onHistoryClose,
|
|
81
|
-
onMvxConnect,
|
|
82
|
-
onMvxDisconnect,
|
|
83
|
-
onNavigate
|
|
58
|
+
mvxChainId: t,
|
|
59
|
+
mvxAddress: i,
|
|
60
|
+
username: p,
|
|
61
|
+
callbackRoute: o,
|
|
62
|
+
firstTokenIdentifier: e,
|
|
63
|
+
secondTokenIdentifier: s,
|
|
64
|
+
firstTokenAmount: a,
|
|
65
|
+
secondTokenAmount: m,
|
|
66
|
+
refetchTrigger: n,
|
|
67
|
+
showHistory: c,
|
|
68
|
+
forcedDestinationTokenSymbol: f,
|
|
69
|
+
direction: r,
|
|
70
|
+
onChangeDirection: g,
|
|
71
|
+
onSuccessfullySentTransaction: j,
|
|
72
|
+
onFailedSentTransaction: w,
|
|
73
|
+
onHistoryClose: u,
|
|
74
|
+
onMvxConnect: d,
|
|
75
|
+
onMvxDisconnect: l,
|
|
76
|
+
onNavigate: D
|
|
84
77
|
}
|
|
85
78
|
);
|
|
86
79
|
};
|
|
87
80
|
export {
|
|
88
|
-
BridgeForm
|
|
81
|
+
P as BridgeForm
|
|
89
82
|
};
|