@multiversx/sdk-dapp-liquidity 2.1.0-alpha.0 → 2.1.0-alpha.2
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.js +1 -23
- package/helpers/assertRateConfirmationMatchesIntent.mjs +13 -16
- 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.js +1 -26
- package/helpers/index.mjs +24 -24
- package/helpers/safeImageUrl.js +1 -23
- package/helpers/safeImageUrl.mjs +10 -20
- package/helpers/serializeTransaction.js +1 -8
- package/helpers/serializeTransaction.mjs +3 -5
- package/helpers/tests/assertRateConfirmationMatchesIntent.spec.js +1 -63
- package/helpers/tests/assertRateConfirmationMatchesIntent.spec.mjs +31 -41
- 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.js +1 -48
- package/helpers/tests/safeImageUrl.spec.mjs +28 -43
- package/helpers/tests/serializeTransaction.spec.js +1 -36
- package/helpers/tests/serializeTransaction.spec.mjs +13 -24
- package/index.js +1 -232
- package/index.mjs +196 -196
- package/package.json +5 -4
- package/react.esm-B0AMOHxa.js +73 -0
- package/react.esm-BxvJJ86Q.mjs +9949 -0
- package/reactjs/adapters/SuiAdapter.js +1 -378
- package/reactjs/adapters/SuiAdapter.mjs +160 -217
- 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 -675
- package/reactjs/components/BridgeForm/Deposit.mjs +380 -504
- package/reactjs/components/BridgeForm/Transfer.js +1 -561
- package/reactjs/components/BridgeForm/Transfer.mjs +315 -428
- 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 +33 -65
- package/reactjs/components/BridgeHistory/BridgeHistory.js +1 -381
- package/reactjs/components/BridgeHistory/BridgeHistory.mjs +170 -200
- 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 -35
- package/reactjs/components/Connect/BridgeConnectButton.mjs +20 -20
- 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 -55
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.mjs +45 -48
- 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 -43
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.mjs +21 -21
- 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 -82
- package/reactjs/components/TokenSelector/components/TokenIcon.mjs +52 -58
- 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 -42
- package/reactjs/context/Web3AppProvider.mjs +34 -36
- 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.js +1 -68
- package/reactjs/hooks/tests/useGenericSignMessage.spec.mjs +23 -38
- package/reactjs/hooks/tests/useSignTransaction.spec.js +1 -195
- package/reactjs/hooks/tests/useSignTransaction.spec.mjs +72 -110
- 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 -167
- package/reactjs/hooks/useBridgeFormik.mjs +110 -155
- 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 -115
- package/reactjs/hooks/useFetchTokens.mjs +80 -108
- package/reactjs/hooks/useGenericSignMessage.js +1 -75
- package/reactjs/hooks/useGenericSignMessage.mjs +44 -64
- 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 -112
- package/reactjs/hooks/useSignTransaction.mjs +50 -76
- 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.js +1 -147
- package/reactjs/init/init.mjs +57 -78
- 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.js +1 -69
- package/reactjs/queries/useGetHistory.query.mjs +53 -57
- package/reactjs/queries/useGetMvxTokensBalances.query.js +1 -66
- package/reactjs/queries/useGetMvxTokensBalances.query.mjs +38 -46
- package/reactjs/queries/useGetNonMvxTokensBalances.query.js +1 -81
- package/reactjs/queries/useGetNonMvxTokensBalances.query.mjs +49 -57
- 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.js +1 -9
- package/types/errors.mjs +4 -5
- 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/react.esm-7GsOwMPq.js +0 -11815
- package/react.esm-CU-Iqz8D.mjs +0 -11796
|
@@ -1,69 +1,65 @@
|
|
|
1
|
-
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
import { getTransactions } from "../../api/getTransactions.mjs";
|
|
4
|
-
import { getApiURL } from "../../helpers/getApiURL.mjs";
|
|
5
|
-
import { useWeb3App } from "../context/useWeb3App.mjs";
|
|
6
|
-
const
|
|
7
|
-
address,
|
|
8
|
-
sender,
|
|
9
|
-
provider,
|
|
10
|
-
status,
|
|
11
|
-
tokenIn,
|
|
12
|
-
tokenOut
|
|
1
|
+
import { useQuery as y, useQueryClient as l } from "@tanstack/react-query";
|
|
2
|
+
import { useCallback as f } from "react";
|
|
3
|
+
import { getTransactions as m } from "../../api/getTransactions.mjs";
|
|
4
|
+
import { getApiURL as h } from "../../helpers/getApiURL.mjs";
|
|
5
|
+
import { useWeb3App as p } from "../context/useWeb3App.mjs";
|
|
6
|
+
const A = ({
|
|
7
|
+
address: r,
|
|
8
|
+
sender: t,
|
|
9
|
+
provider: o,
|
|
10
|
+
status: n,
|
|
11
|
+
tokenIn: u,
|
|
12
|
+
tokenOut: i
|
|
13
13
|
} = {}) => {
|
|
14
|
-
const { nativeAuthToken } =
|
|
15
|
-
|
|
16
|
-
if (!address) {
|
|
17
|
-
throw new Error("User is not connected");
|
|
18
|
-
}
|
|
19
|
-
try {
|
|
20
|
-
const { data } = await getTransactions({
|
|
21
|
-
url: getApiURL(),
|
|
22
|
-
address,
|
|
23
|
-
sender,
|
|
24
|
-
provider,
|
|
25
|
-
status,
|
|
26
|
-
tokenIn,
|
|
27
|
-
tokenOut,
|
|
28
|
-
nativeAuthToken
|
|
29
|
-
});
|
|
30
|
-
return data;
|
|
31
|
-
} catch (error) {
|
|
32
|
-
throw error;
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
const retry = (_failureCount, error) => {
|
|
36
|
-
var _a;
|
|
37
|
-
return ((_a = error.response) == null ? void 0 : _a.status) === 404;
|
|
38
|
-
};
|
|
39
|
-
return useQuery({
|
|
14
|
+
const { nativeAuthToken: c } = p();
|
|
15
|
+
return y({
|
|
40
16
|
queryKey: [
|
|
41
17
|
"user-history",
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
18
|
+
r,
|
|
19
|
+
t,
|
|
20
|
+
o,
|
|
21
|
+
n,
|
|
22
|
+
u,
|
|
23
|
+
i
|
|
48
24
|
],
|
|
49
|
-
queryFn
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
25
|
+
queryFn: async () => {
|
|
26
|
+
if (!r)
|
|
27
|
+
throw new Error("User is not connected");
|
|
28
|
+
try {
|
|
29
|
+
const { data: e } = await m({
|
|
30
|
+
url: h(),
|
|
31
|
+
address: r,
|
|
32
|
+
sender: t,
|
|
33
|
+
provider: o,
|
|
34
|
+
status: n,
|
|
35
|
+
tokenIn: u,
|
|
36
|
+
tokenOut: i,
|
|
37
|
+
nativeAuthToken: c
|
|
38
|
+
});
|
|
39
|
+
return e;
|
|
40
|
+
} catch (e) {
|
|
41
|
+
throw e;
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
retry: (e, a) => {
|
|
45
|
+
var s;
|
|
46
|
+
return ((s = a.response) == null ? void 0 : s.status) === 404;
|
|
47
|
+
},
|
|
48
|
+
enabled: !!r,
|
|
49
|
+
refetchOnWindowFocus: !1,
|
|
50
|
+
refetchIntervalInBackground: !0,
|
|
54
51
|
refetchInterval: 1e4,
|
|
55
52
|
gcTime: 0
|
|
56
53
|
});
|
|
57
|
-
}
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
queryClient.invalidateQueries({
|
|
54
|
+
}, F = () => {
|
|
55
|
+
const r = l();
|
|
56
|
+
return f(() => {
|
|
57
|
+
r.invalidateQueries({
|
|
62
58
|
queryKey: ["user-history"]
|
|
63
59
|
});
|
|
64
|
-
}, [
|
|
60
|
+
}, [r]);
|
|
65
61
|
};
|
|
66
62
|
export {
|
|
67
|
-
useGetHistoryQuery,
|
|
68
|
-
useInvalidateHistoryQuery
|
|
63
|
+
A as useGetHistoryQuery,
|
|
64
|
+
F as useInvalidateHistoryQuery
|
|
69
65
|
};
|
|
@@ -1,67 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const reactQuery = require("@tanstack/react-query");
|
|
5
|
-
const axios = require("axios");
|
|
6
|
-
const React = require("react");
|
|
7
|
-
const reactjs_context_useWeb3App = require("../context/useWeb3App.js");
|
|
8
|
-
const useGetMvxTokensBalancesQuery = ({
|
|
9
|
-
tokens,
|
|
10
|
-
mvxAddress,
|
|
11
|
-
apiURL
|
|
12
|
-
}) => {
|
|
13
|
-
const { nativeAuthToken } = reactjs_context_useWeb3App.useWeb3App();
|
|
14
|
-
const tokenIdentifiers = React.useMemo(() => {
|
|
15
|
-
return tokens.map(({ address }) => address);
|
|
16
|
-
}, [tokens]);
|
|
17
|
-
const url = `${apiURL}/accounts/${mvxAddress}/tokens?identifiers=${tokenIdentifiers}`;
|
|
18
|
-
const config = {
|
|
19
|
-
headers: {
|
|
20
|
-
Authorization: `Bearer ${nativeAuthToken}`
|
|
21
|
-
},
|
|
22
|
-
timeout: 3e3
|
|
23
|
-
};
|
|
24
|
-
const queryFn = async () => {
|
|
25
|
-
const { data } = await axios.get(url, config);
|
|
26
|
-
return data.map((asset) => {
|
|
27
|
-
var _a;
|
|
28
|
-
const foundToken = tokens.find(
|
|
29
|
-
(token) => token.address.toLowerCase() === asset.identifier.toLowerCase()
|
|
30
|
-
);
|
|
31
|
-
if (!foundToken) {
|
|
32
|
-
throw new Error("Token not found");
|
|
33
|
-
}
|
|
34
|
-
return {
|
|
35
|
-
...foundToken,
|
|
36
|
-
balance: ((_a = asset.balance) == null ? void 0 : _a.toString()) ?? "0",
|
|
37
|
-
address: asset.identifier,
|
|
38
|
-
symbol: asset.ticker ?? foundToken.symbol
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
const retry = (_failureCount, error) => {
|
|
43
|
-
var _a;
|
|
44
|
-
return ((_a = error.response) == null ? void 0 : _a.status) === 404;
|
|
45
|
-
};
|
|
46
|
-
return reactQuery.useQuery({
|
|
47
|
-
queryKey: ["mvx-tokens-balances", mvxAddress, tokenIdentifiers.sort()],
|
|
48
|
-
queryFn,
|
|
49
|
-
retry,
|
|
50
|
-
enabled: Boolean(mvxAddress) && tokenIdentifiers.length > 0,
|
|
51
|
-
refetchOnWindowFocus: false,
|
|
52
|
-
refetchIntervalInBackground: true,
|
|
53
|
-
refetchInterval: 2e4,
|
|
54
|
-
refetchOnReconnect: "always",
|
|
55
|
-
gcTime: 0
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
function useInvalidateMvxTokensBalancesQuery() {
|
|
59
|
-
const queryClient = reactQuery.useQueryClient();
|
|
60
|
-
return React.useCallback(() => {
|
|
61
|
-
queryClient.invalidateQueries({
|
|
62
|
-
queryKey: ["mvx-tokens-balances"]
|
|
63
|
-
});
|
|
64
|
-
}, [queryClient]);
|
|
65
|
-
}
|
|
66
|
-
exports.useGetMvxTokensBalancesQuery = useGetMvxTokensBalancesQuery;
|
|
67
|
-
exports.useInvalidateMvxTokensBalancesQuery = useInvalidateMvxTokensBalancesQuery;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@tanstack/react-query"),v=require("axios"),c=require("react"),h=require("../context/useWeb3App.js"),T=({tokens:e,mvxAddress:o,apiURL:i})=>{const{nativeAuthToken:l}=h.useWeb3App(),a=c.useMemo(()=>e.map(({address:r})=>r),[e]),y=`${i}/accounts/${o}/tokens?identifiers=${a}`,d={headers:{Authorization:`Bearer ${l}`},timeout:3e3},f=async()=>{const{data:r}=await v.get(y,d);return r.map(n=>{var s;const t=e.find(k=>k.address.toLowerCase()===n.identifier.toLowerCase());if(!t)throw new Error("Token not found");return{...t,balance:((s=n.balance)==null?void 0:s.toString())??"0",address:n.identifier,symbol:n.ticker??t.symbol}})},b=(r,n)=>{var t;return((t=n.response)==null?void 0:t.status)===404};return u.useQuery({queryKey:["mvx-tokens-balances",o,a.sort()],queryFn:f,retry:b,enabled:!!o&&a.length>0,refetchOnWindowFocus:!1,refetchIntervalInBackground:!0,refetchInterval:2e4,refetchOnReconnect:"always",gcTime:0})};function g(){const e=u.useQueryClient();return c.useCallback(()=>{e.invalidateQueries({queryKey:["mvx-tokens-balances"]})},[e])}exports.useGetMvxTokensBalancesQuery=T;exports.useInvalidateMvxTokensBalancesQuery=g;
|
|
@@ -1,66 +1,58 @@
|
|
|
1
|
-
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
2
|
-
import
|
|
3
|
-
import { useMemo, useCallback } from "react";
|
|
4
|
-
import { useWeb3App } from "../context/useWeb3App.mjs";
|
|
5
|
-
const
|
|
6
|
-
tokens,
|
|
7
|
-
mvxAddress,
|
|
8
|
-
apiURL
|
|
1
|
+
import { useQuery as d, useQueryClient as k } from "@tanstack/react-query";
|
|
2
|
+
import p from "axios";
|
|
3
|
+
import { useMemo as b, useCallback as h } from "react";
|
|
4
|
+
import { useWeb3App as v } from "../context/useWeb3App.mjs";
|
|
5
|
+
const B = ({
|
|
6
|
+
tokens: e,
|
|
7
|
+
mvxAddress: o,
|
|
8
|
+
apiURL: i
|
|
9
9
|
}) => {
|
|
10
|
-
const { nativeAuthToken } =
|
|
11
|
-
const tokenIdentifiers = useMemo(() => {
|
|
12
|
-
return tokens.map(({ address }) => address);
|
|
13
|
-
}, [tokens]);
|
|
14
|
-
const url = `${apiURL}/accounts/${mvxAddress}/tokens?identifiers=${tokenIdentifiers}`;
|
|
15
|
-
const config = {
|
|
10
|
+
const { nativeAuthToken: u } = v(), a = b(() => e.map(({ address: r }) => r), [e]), c = `${i}/accounts/${o}/tokens?identifiers=${a}`, l = {
|
|
16
11
|
headers: {
|
|
17
|
-
Authorization: `Bearer ${
|
|
12
|
+
Authorization: `Bearer ${u}`
|
|
18
13
|
},
|
|
19
14
|
timeout: 3e3
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
(token) => token.address.toLowerCase() === asset.identifier.toLowerCase()
|
|
15
|
+
}, f = async () => {
|
|
16
|
+
const { data: r } = await p.get(c, l);
|
|
17
|
+
return r.map((n) => {
|
|
18
|
+
var s;
|
|
19
|
+
const t = e.find(
|
|
20
|
+
(y) => y.address.toLowerCase() === n.identifier.toLowerCase()
|
|
27
21
|
);
|
|
28
|
-
if (!
|
|
22
|
+
if (!t)
|
|
29
23
|
throw new Error("Token not found");
|
|
30
|
-
}
|
|
31
24
|
return {
|
|
32
|
-
...
|
|
33
|
-
balance: ((
|
|
34
|
-
address:
|
|
35
|
-
symbol:
|
|
25
|
+
...t,
|
|
26
|
+
balance: ((s = n.balance) == null ? void 0 : s.toString()) ?? "0",
|
|
27
|
+
address: n.identifier,
|
|
28
|
+
symbol: n.ticker ?? t.symbol
|
|
36
29
|
};
|
|
37
30
|
});
|
|
31
|
+
}, m = (r, n) => {
|
|
32
|
+
var t;
|
|
33
|
+
return ((t = n.response) == null ? void 0 : t.status) === 404;
|
|
38
34
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
retry,
|
|
47
|
-
enabled: Boolean(mvxAddress) && tokenIdentifiers.length > 0,
|
|
48
|
-
refetchOnWindowFocus: false,
|
|
49
|
-
refetchIntervalInBackground: true,
|
|
35
|
+
return d({
|
|
36
|
+
queryKey: ["mvx-tokens-balances", o, a.sort()],
|
|
37
|
+
queryFn: f,
|
|
38
|
+
retry: m,
|
|
39
|
+
enabled: !!o && a.length > 0,
|
|
40
|
+
refetchOnWindowFocus: !1,
|
|
41
|
+
refetchIntervalInBackground: !0,
|
|
50
42
|
refetchInterval: 2e4,
|
|
51
43
|
refetchOnReconnect: "always",
|
|
52
44
|
gcTime: 0
|
|
53
45
|
});
|
|
54
46
|
};
|
|
55
|
-
function
|
|
56
|
-
const
|
|
57
|
-
return
|
|
58
|
-
|
|
47
|
+
function I() {
|
|
48
|
+
const e = k();
|
|
49
|
+
return h(() => {
|
|
50
|
+
e.invalidateQueries({
|
|
59
51
|
queryKey: ["mvx-tokens-balances"]
|
|
60
52
|
});
|
|
61
|
-
}, [
|
|
53
|
+
}, [e]);
|
|
62
54
|
}
|
|
63
55
|
export {
|
|
64
|
-
useGetMvxTokensBalancesQuery,
|
|
65
|
-
useInvalidateMvxTokensBalancesQuery
|
|
56
|
+
B as useGetMvxTokensBalancesQuery,
|
|
57
|
+
I as useInvalidateMvxTokensBalancesQuery
|
|
66
58
|
};
|
|
@@ -1,82 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const react = require("@reown/appkit/react");
|
|
5
|
-
const reactQuery = require("@tanstack/react-query");
|
|
6
|
-
const React = require("react");
|
|
7
|
-
require("yup");
|
|
8
|
-
require("@multiversx/sdk-dapp-utils/out/helpers/parseAmount");
|
|
9
|
-
require("bignumber.js");
|
|
10
|
-
require("wagmi");
|
|
11
|
-
const reactjs_hooks_useBalances = require("../hooks/useBalances.js");
|
|
12
|
-
require("formik");
|
|
13
|
-
require("axios");
|
|
14
|
-
require("../context/Web3AppProvider.js");
|
|
15
|
-
require("../constants/index.js");
|
|
16
|
-
require("@reown/appkit-adapter-solana/react");
|
|
17
|
-
require("@solana/web3.js");
|
|
18
|
-
require("@reown/appkit-controllers");
|
|
19
|
-
const useGetNonMvxTokensBalancesQuery = ({
|
|
20
|
-
tokens,
|
|
21
|
-
chainId
|
|
22
|
-
}) => {
|
|
23
|
-
const { address } = react.useAppKitAccount();
|
|
24
|
-
const { getBalances } = reactjs_hooks_useBalances.useBalances();
|
|
25
|
-
const identifiers = React.useMemo(
|
|
26
|
-
() => tokens.map((token) => token.address),
|
|
27
|
-
[tokens]
|
|
28
|
-
);
|
|
29
|
-
const queryFn = async () => {
|
|
30
|
-
try {
|
|
31
|
-
if (!address) {
|
|
32
|
-
throw new Error("User address is required");
|
|
33
|
-
}
|
|
34
|
-
if (!chainId) {
|
|
35
|
-
throw new Error("Chain ID is required");
|
|
36
|
-
}
|
|
37
|
-
const assets = await getBalances({
|
|
38
|
-
tokens,
|
|
39
|
-
chainId
|
|
40
|
-
});
|
|
41
|
-
return assets.map((asset) => {
|
|
42
|
-
const foundToken = tokens.find(
|
|
43
|
-
(token) => token.address.toLowerCase() === asset.tokenId.toLowerCase()
|
|
44
|
-
);
|
|
45
|
-
if (!foundToken) {
|
|
46
|
-
throw new Error("Token not found");
|
|
47
|
-
}
|
|
48
|
-
return {
|
|
49
|
-
...foundToken,
|
|
50
|
-
balance: asset.balance.toString()
|
|
51
|
-
};
|
|
52
|
-
});
|
|
53
|
-
} catch (error) {
|
|
54
|
-
throw error;
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
const retry = (_failureCount, error) => {
|
|
58
|
-
var _a;
|
|
59
|
-
return ((_a = error.response) == null ? void 0 : _a.status) === 404;
|
|
60
|
-
};
|
|
61
|
-
return reactQuery.useQuery({
|
|
62
|
-
queryKey: ["non-mvx-tokens-balances", address, chainId, identifiers],
|
|
63
|
-
queryFn,
|
|
64
|
-
retry,
|
|
65
|
-
enabled: Boolean(address) && Boolean(chainId),
|
|
66
|
-
refetchOnWindowFocus: false,
|
|
67
|
-
refetchIntervalInBackground: true,
|
|
68
|
-
refetchInterval: 2e4,
|
|
69
|
-
refetchOnReconnect: "always",
|
|
70
|
-
gcTime: 0
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
function useInvalidateEvmTokensBalances() {
|
|
74
|
-
const queryClient = reactQuery.useQueryClient();
|
|
75
|
-
return React.useCallback(() => {
|
|
76
|
-
queryClient.invalidateQueries({
|
|
77
|
-
queryKey: ["non-mvx-tokens-balances"]
|
|
78
|
-
});
|
|
79
|
-
}, [queryClient]);
|
|
80
|
-
}
|
|
81
|
-
exports.useGetNonMvxTokensBalancesQuery = useGetNonMvxTokensBalancesQuery;
|
|
82
|
-
exports.useInvalidateEvmTokensBalances = useInvalidateEvmTokensBalances;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("@reown/appkit/react"),a=require("@tanstack/react-query"),u=require("react");require("yup");require("@multiversx/sdk-dapp-utils/out/helpers/parseAmount");require("bignumber.js");require("wagmi");const f=require("../hooks/useBalances.js");require("formik");require("axios");require("../context/Web3AppProvider.js");require("../constants/index.js");require("@reown/appkit-adapter-solana/react");require("@solana/web3.js");require("@reown/appkit-controllers");const v=({tokens:e,chainId:s})=>{const{address:o}=y.useAppKitAccount(),{getBalances:c}=f.useBalances(),i=u.useMemo(()=>e.map(r=>r.address),[e]),l=async()=>{try{if(!o)throw new Error("User address is required");if(!s)throw new Error("Chain ID is required");return(await c({tokens:e,chainId:s})).map(t=>{const n=e.find(q=>q.address.toLowerCase()===t.tokenId.toLowerCase());if(!n)throw new Error("Token not found");return{...n,balance:t.balance.toString()}})}catch(r){throw r}},d=(r,t)=>{var n;return((n=t.response)==null?void 0:n.status)===404};return a.useQuery({queryKey:["non-mvx-tokens-balances",o,s,i],queryFn:l,retry:d,enabled:!!o&&!!s,refetchOnWindowFocus:!1,refetchIntervalInBackground:!0,refetchInterval:2e4,refetchOnReconnect:"always",gcTime:0})};function w(){const e=a.useQueryClient();return u.useCallback(()=>{e.invalidateQueries({queryKey:["non-mvx-tokens-balances"]})},[e])}exports.useGetNonMvxTokensBalancesQuery=v;exports.useInvalidateEvmTokensBalances=w;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { useAppKitAccount } from "@reown/appkit/react";
|
|
2
|
-
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
3
|
-
import { useMemo, useCallback } from "react";
|
|
1
|
+
import { useAppKitAccount as c } from "@reown/appkit/react";
|
|
2
|
+
import { useQuery as m, useQueryClient as l } from "@tanstack/react-query";
|
|
3
|
+
import { useMemo as p, useCallback as f } from "react";
|
|
4
4
|
import "yup";
|
|
5
5
|
import "@multiversx/sdk-dapp-utils/out/helpers/parseAmount";
|
|
6
6
|
import "bignumber.js";
|
|
7
7
|
import "wagmi";
|
|
8
|
-
import { useBalances } from "../hooks/useBalances.mjs";
|
|
8
|
+
import { useBalances as d } from "../hooks/useBalances.mjs";
|
|
9
9
|
import "formik";
|
|
10
10
|
import "axios";
|
|
11
11
|
import "../context/Web3AppProvider.mjs";
|
|
@@ -13,69 +13,61 @@ import "../constants/index.mjs";
|
|
|
13
13
|
import "@reown/appkit-adapter-solana/react";
|
|
14
14
|
import "@solana/web3.js";
|
|
15
15
|
import "@reown/appkit-controllers";
|
|
16
|
-
const
|
|
17
|
-
tokens,
|
|
18
|
-
chainId
|
|
16
|
+
const A = ({
|
|
17
|
+
tokens: e,
|
|
18
|
+
chainId: o
|
|
19
19
|
}) => {
|
|
20
|
-
const { address } =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
() => tokens.map((token) => token.address),
|
|
24
|
-
[tokens]
|
|
20
|
+
const { address: s } = c(), { getBalances: a } = d(), i = p(
|
|
21
|
+
() => e.map((r) => r.address),
|
|
22
|
+
[e]
|
|
25
23
|
);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
return m({
|
|
25
|
+
queryKey: ["non-mvx-tokens-balances", s, o, i],
|
|
26
|
+
queryFn: async () => {
|
|
27
|
+
try {
|
|
28
|
+
if (!s)
|
|
29
|
+
throw new Error("User address is required");
|
|
30
|
+
if (!o)
|
|
31
|
+
throw new Error("Chain ID is required");
|
|
32
|
+
return (await a({
|
|
33
|
+
tokens: e,
|
|
34
|
+
chainId: o
|
|
35
|
+
})).map((n) => {
|
|
36
|
+
const t = e.find(
|
|
37
|
+
(u) => u.address.toLowerCase() === n.tokenId.toLowerCase()
|
|
38
|
+
);
|
|
39
|
+
if (!t)
|
|
40
|
+
throw new Error("Token not found");
|
|
41
|
+
return {
|
|
42
|
+
...t,
|
|
43
|
+
balance: n.balance.toString()
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
} catch (r) {
|
|
47
|
+
throw r;
|
|
30
48
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const foundToken = tokens.find(
|
|
40
|
-
(token) => token.address.toLowerCase() === asset.tokenId.toLowerCase()
|
|
41
|
-
);
|
|
42
|
-
if (!foundToken) {
|
|
43
|
-
throw new Error("Token not found");
|
|
44
|
-
}
|
|
45
|
-
return {
|
|
46
|
-
...foundToken,
|
|
47
|
-
balance: asset.balance.toString()
|
|
48
|
-
};
|
|
49
|
-
});
|
|
50
|
-
} catch (error) {
|
|
51
|
-
throw error;
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
const retry = (_failureCount, error) => {
|
|
55
|
-
var _a;
|
|
56
|
-
return ((_a = error.response) == null ? void 0 : _a.status) === 404;
|
|
57
|
-
};
|
|
58
|
-
return useQuery({
|
|
59
|
-
queryKey: ["non-mvx-tokens-balances", address, chainId, identifiers],
|
|
60
|
-
queryFn,
|
|
61
|
-
retry,
|
|
62
|
-
enabled: Boolean(address) && Boolean(chainId),
|
|
63
|
-
refetchOnWindowFocus: false,
|
|
64
|
-
refetchIntervalInBackground: true,
|
|
49
|
+
},
|
|
50
|
+
retry: (r, n) => {
|
|
51
|
+
var t;
|
|
52
|
+
return ((t = n.response) == null ? void 0 : t.status) === 404;
|
|
53
|
+
},
|
|
54
|
+
enabled: !!s && !!o,
|
|
55
|
+
refetchOnWindowFocus: !1,
|
|
56
|
+
refetchIntervalInBackground: !0,
|
|
65
57
|
refetchInterval: 2e4,
|
|
66
58
|
refetchOnReconnect: "always",
|
|
67
59
|
gcTime: 0
|
|
68
60
|
});
|
|
69
61
|
};
|
|
70
|
-
function
|
|
71
|
-
const
|
|
72
|
-
return
|
|
73
|
-
|
|
62
|
+
function L() {
|
|
63
|
+
const e = l();
|
|
64
|
+
return f(() => {
|
|
65
|
+
e.invalidateQueries({
|
|
74
66
|
queryKey: ["non-mvx-tokens-balances"]
|
|
75
67
|
});
|
|
76
|
-
}, [
|
|
68
|
+
}, [e]);
|
|
77
69
|
}
|
|
78
70
|
export {
|
|
79
|
-
useGetNonMvxTokensBalancesQuery,
|
|
80
|
-
useInvalidateEvmTokensBalances
|
|
71
|
+
A as useGetNonMvxTokensBalancesQuery,
|
|
72
|
+
L as useInvalidateEvmTokensBalances
|
|
81
73
|
};
|
|
@@ -1,19 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const reactQuery = require("@tanstack/react-query");
|
|
5
|
-
const api_getRate = require("../../api/getRate.js");
|
|
6
|
-
const helpers_getApiURL = require("../../helpers/getApiURL.js");
|
|
7
|
-
const useGetRateMutation = () => {
|
|
8
|
-
const mutationFn = async (params) => {
|
|
9
|
-
const { data } = await api_getRate.getRate({
|
|
10
|
-
url: helpers_getApiURL.getApiURL(),
|
|
11
|
-
...params
|
|
12
|
-
});
|
|
13
|
-
return data;
|
|
14
|
-
};
|
|
15
|
-
return reactQuery.useMutation({
|
|
16
|
-
mutationFn
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
exports.useGetRateMutation = useGetRateMutation;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@tanstack/react-query"),u=require("../../api/getRate.js"),a=require("../../helpers/getApiURL.js"),i=()=>{const t=async e=>{const{data:n}=await u.getRate({url:a.getApiURL(),...e});return n};return r.useMutation({mutationFn:t})};exports.useGetRateMutation=i;
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import { useMutation } from "@tanstack/react-query";
|
|
2
|
-
import { getRate } from "../../api/getRate.mjs";
|
|
3
|
-
import { getApiURL } from "../../helpers/getApiURL.mjs";
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const { data } = await
|
|
7
|
-
url:
|
|
8
|
-
...
|
|
1
|
+
import { useMutation as n } from "@tanstack/react-query";
|
|
2
|
+
import { getRate as r } from "../../api/getRate.mjs";
|
|
3
|
+
import { getApiURL as a } from "../../helpers/getApiURL.mjs";
|
|
4
|
+
const s = () => n({
|
|
5
|
+
mutationFn: async (t) => {
|
|
6
|
+
const { data: o } = await r({
|
|
7
|
+
url: a(),
|
|
8
|
+
...t
|
|
9
9
|
});
|
|
10
|
-
return
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
mutationFn
|
|
14
|
-
});
|
|
15
|
-
};
|
|
10
|
+
return o;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
16
13
|
export {
|
|
17
|
-
useGetRateMutation
|
|
14
|
+
s as useGetRateMutation
|
|
18
15
|
};
|
package/reactjs/reexports.js
CHANGED
|
@@ -1,49 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const react = require("@reown/appkit/react");
|
|
5
|
-
const wagmi = require("wagmi");
|
|
6
|
-
Object.defineProperty(exports, "useAppKit", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: () => react.useAppKit
|
|
9
|
-
});
|
|
10
|
-
Object.defineProperty(exports, "useAppKitAccount", {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: () => react.useAppKitAccount
|
|
13
|
-
});
|
|
14
|
-
Object.defineProperty(exports, "useAppKitEvents", {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: () => react.useAppKitEvents
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "useAppKitNetwork", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: () => react.useAppKitNetwork
|
|
21
|
-
});
|
|
22
|
-
Object.defineProperty(exports, "useAppKitNetworkCore", {
|
|
23
|
-
enumerable: true,
|
|
24
|
-
get: () => react.useAppKitNetworkCore
|
|
25
|
-
});
|
|
26
|
-
Object.defineProperty(exports, "useAppKitProvider", {
|
|
27
|
-
enumerable: true,
|
|
28
|
-
get: () => react.useAppKitProvider
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "useAppKitState", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: () => react.useAppKitState
|
|
33
|
-
});
|
|
34
|
-
Object.defineProperty(exports, "useAppKitTheme", {
|
|
35
|
-
enumerable: true,
|
|
36
|
-
get: () => react.useAppKitTheme
|
|
37
|
-
});
|
|
38
|
-
Object.defineProperty(exports, "useDisconnect", {
|
|
39
|
-
enumerable: true,
|
|
40
|
-
get: () => react.useDisconnect
|
|
41
|
-
});
|
|
42
|
-
Object.defineProperty(exports, "useWalletInfo", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: () => react.useWalletInfo
|
|
45
|
-
});
|
|
46
|
-
Object.defineProperty(exports, "useWaitForTransactionReceipt", {
|
|
47
|
-
enumerable: true,
|
|
48
|
-
get: () => wagmi.useWaitForTransactionReceipt
|
|
49
|
-
});
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@reown/appkit/react"),t=require("wagmi");Object.defineProperty(exports,"useAppKit",{enumerable:!0,get:()=>e.useAppKit});Object.defineProperty(exports,"useAppKitAccount",{enumerable:!0,get:()=>e.useAppKitAccount});Object.defineProperty(exports,"useAppKitEvents",{enumerable:!0,get:()=>e.useAppKitEvents});Object.defineProperty(exports,"useAppKitNetwork",{enumerable:!0,get:()=>e.useAppKitNetwork});Object.defineProperty(exports,"useAppKitNetworkCore",{enumerable:!0,get:()=>e.useAppKitNetworkCore});Object.defineProperty(exports,"useAppKitProvider",{enumerable:!0,get:()=>e.useAppKitProvider});Object.defineProperty(exports,"useAppKitState",{enumerable:!0,get:()=>e.useAppKitState});Object.defineProperty(exports,"useAppKitTheme",{enumerable:!0,get:()=>e.useAppKitTheme});Object.defineProperty(exports,"useDisconnect",{enumerable:!0,get:()=>e.useDisconnect});Object.defineProperty(exports,"useWalletInfo",{enumerable:!0,get:()=>e.useWalletInfo});Object.defineProperty(exports,"useWaitForTransactionReceipt",{enumerable:!0,get:()=>t.useWaitForTransactionReceipt});
|
package/reactjs/reexports.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { useAppKit, useAppKitAccount, useAppKitEvents, useAppKitNetwork, useAppKitNetworkCore, useAppKitProvider, useAppKitState, useAppKitTheme, useDisconnect, useWalletInfo } from "@reown/appkit/react";
|
|
2
|
-
import { useWaitForTransactionReceipt } from "wagmi";
|
|
1
|
+
import { useAppKit as p, useAppKitAccount as s, useAppKitEvents as i, useAppKitNetwork as o, useAppKitNetworkCore as u, useAppKitProvider as r, useAppKitState as A, useAppKitTheme as K, useDisconnect as n, useWalletInfo as c } from "@reown/appkit/react";
|
|
2
|
+
import { useWaitForTransactionReceipt as f } from "wagmi";
|
|
3
3
|
export {
|
|
4
|
-
useAppKit,
|
|
5
|
-
useAppKitAccount,
|
|
6
|
-
useAppKitEvents,
|
|
7
|
-
useAppKitNetwork,
|
|
8
|
-
useAppKitNetworkCore,
|
|
9
|
-
useAppKitProvider,
|
|
10
|
-
useAppKitState,
|
|
11
|
-
useAppKitTheme,
|
|
12
|
-
useDisconnect,
|
|
13
|
-
useWaitForTransactionReceipt,
|
|
14
|
-
useWalletInfo
|
|
4
|
+
p as useAppKit,
|
|
5
|
+
s as useAppKitAccount,
|
|
6
|
+
i as useAppKitEvents,
|
|
7
|
+
o as useAppKitNetwork,
|
|
8
|
+
u as useAppKitNetworkCore,
|
|
9
|
+
r as useAppKitProvider,
|
|
10
|
+
A as useAppKitState,
|
|
11
|
+
K as useAppKitTheme,
|
|
12
|
+
n as useDisconnect,
|
|
13
|
+
f as useWaitForTransactionReceipt,
|
|
14
|
+
c as useWalletInfo
|
|
15
15
|
};
|
package/reactjs/utils/delay.js
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
function delay(ms) {
|
|
5
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
6
|
-
}
|
|
7
|
-
exports.delay = delay;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(e){return new Promise(t=>setTimeout(t,e))}exports.delay=n;
|
package/reactjs/utils/delay.mjs
CHANGED