@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,12 +1,11 @@
|
|
|
1
|
-
import { useAppKitAccount } from "@reown/appkit/react";
|
|
2
|
-
import { useQuery } from "@tanstack/react-query";
|
|
3
|
-
import { useMemo } from "react";
|
|
4
|
-
import { getQueryClient } from "../context/queryClient.mjs";
|
|
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";
|
|
5
4
|
import "yup";
|
|
6
5
|
import "@multiversx/sdk-dapp-utils/out/helpers/parseAmount";
|
|
7
6
|
import "bignumber.js";
|
|
8
7
|
import "wagmi";
|
|
9
|
-
import { useBalances } from "../hooks/useBalances.mjs";
|
|
8
|
+
import { useBalances as d } from "../hooks/useBalances.mjs";
|
|
10
9
|
import "formik";
|
|
11
10
|
import "axios";
|
|
12
11
|
import "../context/Web3AppProvider.mjs";
|
|
@@ -14,68 +13,61 @@ import "../constants/index.mjs";
|
|
|
14
13
|
import "@reown/appkit-adapter-solana/react";
|
|
15
14
|
import "@solana/web3.js";
|
|
16
15
|
import "@reown/appkit-controllers";
|
|
17
|
-
const
|
|
18
|
-
tokens,
|
|
19
|
-
chainId
|
|
16
|
+
const A = ({
|
|
17
|
+
tokens: e,
|
|
18
|
+
chainId: o
|
|
20
19
|
}) => {
|
|
21
|
-
const { address } =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
() => tokens.map((token) => token.address),
|
|
25
|
-
[tokens]
|
|
20
|
+
const { address: s } = c(), { getBalances: a } = d(), i = p(
|
|
21
|
+
() => e.map((r) => r.address),
|
|
22
|
+
[e]
|
|
26
23
|
);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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;
|
|
31
48
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const foundToken = tokens.find(
|
|
41
|
-
(token) => token.address.toLowerCase() === asset.tokenId.toLowerCase()
|
|
42
|
-
);
|
|
43
|
-
if (!foundToken) {
|
|
44
|
-
throw new Error("Token not found");
|
|
45
|
-
}
|
|
46
|
-
return {
|
|
47
|
-
...foundToken,
|
|
48
|
-
balance: asset.balance.toString()
|
|
49
|
-
};
|
|
50
|
-
});
|
|
51
|
-
} catch (error) {
|
|
52
|
-
throw error;
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
const retry = (_failureCount, error) => {
|
|
56
|
-
var _a;
|
|
57
|
-
return ((_a = error.response) == null ? void 0 : _a.status) === 404;
|
|
58
|
-
};
|
|
59
|
-
return useQuery({
|
|
60
|
-
queryKey: ["non-mvx-tokens-balances", address, chainId, identifiers],
|
|
61
|
-
queryFn,
|
|
62
|
-
retry,
|
|
63
|
-
enabled: Boolean(address) && Boolean(chainId),
|
|
64
|
-
refetchOnWindowFocus: false,
|
|
65
|
-
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,
|
|
66
57
|
refetchInterval: 2e4,
|
|
67
58
|
refetchOnReconnect: "always",
|
|
68
59
|
gcTime: 0
|
|
69
60
|
});
|
|
70
61
|
};
|
|
71
|
-
function
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
62
|
+
function L() {
|
|
63
|
+
const e = l();
|
|
64
|
+
return f(() => {
|
|
65
|
+
e.invalidateQueries({
|
|
66
|
+
queryKey: ["non-mvx-tokens-balances"]
|
|
67
|
+
});
|
|
68
|
+
}, [e]);
|
|
77
69
|
}
|
|
78
70
|
export {
|
|
79
|
-
|
|
80
|
-
|
|
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
|
@@ -1,24 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const formatAmount$1 = require("@multiversx/sdk-dapp-utils/out/helpers/formatAmount");
|
|
5
|
-
const stringIsInteger = require("@multiversx/sdk-dapp-utils/out/helpers/stringIsInteger");
|
|
6
|
-
const reactjs_utils_roundAmount = require("./roundAmount.js");
|
|
7
|
-
const formatAmount = ({
|
|
8
|
-
amount = "0",
|
|
9
|
-
decimals = 0,
|
|
10
|
-
addCommas = false,
|
|
11
|
-
digits = 4,
|
|
12
|
-
showLastNonZeroDecimal = true
|
|
13
|
-
}) => {
|
|
14
|
-
if (amount == null || amount === "0" || !stringIsInteger.stringIsInteger(amount, false)) {
|
|
15
|
-
return "0";
|
|
16
|
-
}
|
|
17
|
-
const formattedAmount = formatAmount$1.formatAmount({
|
|
18
|
-
decimals,
|
|
19
|
-
input: amount,
|
|
20
|
-
showLastNonZeroDecimal
|
|
21
|
-
});
|
|
22
|
-
return reactjs_utils_roundAmount.roundAmount(formattedAmount, digits, addCommas);
|
|
23
|
-
};
|
|
24
|
-
exports.formatAmount = formatAmount;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@multiversx/sdk-dapp-utils/out/helpers/formatAmount"),i=require("@multiversx/sdk-dapp-utils/out/helpers/stringIsInteger"),m=require("./roundAmount.js"),f=({amount:t="0",decimals:r=0,addCommas:e=!1,digits:n=4,showLastNonZeroDecimal:o=!0})=>{if(t==null||t==="0"||!i.stringIsInteger(t,!1))return"0";const u=s.formatAmount({decimals:r,input:t,showLastNonZeroDecimal:o});return m.roundAmount(u,n,e)};exports.formatAmount=f;
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { formatAmount as
|
|
2
|
-
import { stringIsInteger } from "@multiversx/sdk-dapp-utils/out/helpers/stringIsInteger";
|
|
3
|
-
import { roundAmount } from "./roundAmount.mjs";
|
|
4
|
-
const
|
|
5
|
-
amount = "0",
|
|
6
|
-
decimals = 0,
|
|
7
|
-
addCommas =
|
|
8
|
-
digits = 4,
|
|
9
|
-
showLastNonZeroDecimal =
|
|
1
|
+
import { formatAmount as e } from "@multiversx/sdk-dapp-utils/out/helpers/formatAmount";
|
|
2
|
+
import { stringIsInteger as u } from "@multiversx/sdk-dapp-utils/out/helpers/stringIsInteger";
|
|
3
|
+
import { roundAmount as s } from "./roundAmount.mjs";
|
|
4
|
+
const a = ({
|
|
5
|
+
amount: r = "0",
|
|
6
|
+
decimals: t = 0,
|
|
7
|
+
addCommas: o = !1,
|
|
8
|
+
digits: m = 4,
|
|
9
|
+
showLastNonZeroDecimal: n = !0
|
|
10
10
|
}) => {
|
|
11
|
-
if (
|
|
11
|
+
if (r == null || r === "0" || !u(r, !1))
|
|
12
12
|
return "0";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
showLastNonZeroDecimal
|
|
13
|
+
const f = e({
|
|
14
|
+
decimals: t,
|
|
15
|
+
input: r,
|
|
16
|
+
showLastNonZeroDecimal: n
|
|
18
17
|
});
|
|
19
|
-
return
|
|
18
|
+
return s(f, m, o);
|
|
20
19
|
};
|
|
21
20
|
export {
|
|
22
|
-
formatAmount
|
|
21
|
+
a as formatAmount
|
|
23
22
|
};
|
|
@@ -1,12 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const BigNumber = require("bignumber.js");
|
|
5
|
-
const reactjs_utils_removeCommas = require("./removeCommas.js");
|
|
6
|
-
const getCleanStringAmount = (amount) => {
|
|
7
|
-
const amountWithoutCommas = reactjs_utils_removeCommas.removeCommas(amount);
|
|
8
|
-
const validFloatString = new BigNumber(amountWithoutCommas).toString(10);
|
|
9
|
-
const parts = validFloatString.split(".");
|
|
10
|
-
return { amountWithoutCommas, parts };
|
|
11
|
-
};
|
|
12
|
-
exports.getCleanStringAmount = getCleanStringAmount;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("bignumber.js"),r=require("./removeCommas.js"),i=e=>{const t=r.removeCommas(e),n=new o(t).toString(10).split(".");return{amountWithoutCommas:t,parts:n}};exports.getCleanStringAmount=i;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { removeCommas } from "./removeCommas.mjs";
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const parts = validFloatString.split(".");
|
|
7
|
-
return { amountWithoutCommas, parts };
|
|
1
|
+
import n from "bignumber.js";
|
|
2
|
+
import { removeCommas as m } from "./removeCommas.mjs";
|
|
3
|
+
const s = (o) => {
|
|
4
|
+
const t = m(o), r = new n(t).toString(10).split(".");
|
|
5
|
+
return { amountWithoutCommas: t, parts: r };
|
|
8
6
|
};
|
|
9
7
|
export {
|
|
10
|
-
getCleanStringAmount
|
|
8
|
+
s as getCleanStringAmount
|
|
11
9
|
};
|
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const reactjs_constants_index = require("../constants/index.js");
|
|
5
|
-
const getCompletePathname = () => `${reactjs_constants_index.safeWindow.location.pathname}${reactjs_constants_index.safeWindow.location.search}`;
|
|
6
|
-
exports.getCompletePathname = getCompletePathname;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../constants/index.js"),t=()=>`${e.safeWindow.location.pathname}${e.safeWindow.location.search}`;exports.getCompletePathname=t;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { safeWindow } from "../constants/index.mjs";
|
|
2
|
-
const
|
|
1
|
+
import { safeWindow as o } from "../constants/index.mjs";
|
|
2
|
+
const a = () => `${o.location.pathname}${o.location.search}`;
|
|
3
3
|
export {
|
|
4
|
-
getCompletePathname
|
|
4
|
+
a as getCompletePathname
|
|
5
5
|
};
|
|
@@ -1,13 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const reactjs_constants_index = require("../constants/index.js");
|
|
5
|
-
const getInitialTokens = (initialTokens) => {
|
|
6
|
-
const urlParams = new URLSearchParams(reactjs_constants_index.safeWindow.location.search);
|
|
7
|
-
const { firstToken, secondToken } = Object.fromEntries(urlParams);
|
|
8
|
-
return {
|
|
9
|
-
firstTokenId: (initialTokens == null ? void 0 : initialTokens.firstTokenId) || firstToken,
|
|
10
|
-
secondTokenId: (initialTokens == null ? void 0 : initialTokens.secondTokenId) || secondToken
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
exports.getInitialTokens = getInitialTokens;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../constants/index.js"),s=e=>{const r=new URLSearchParams(t.safeWindow.location.search),{firstToken:o,secondToken:c}=Object.fromEntries(r);return{firstTokenId:(e==null?void 0:e.firstTokenId)||o,secondTokenId:(e==null?void 0:e.secondTokenId)||c}};exports.getInitialTokens=s;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { safeWindow } from "../constants/index.mjs";
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const { firstToken, secondToken } = Object.fromEntries(urlParams);
|
|
1
|
+
import { safeWindow as d } from "../constants/index.mjs";
|
|
2
|
+
const s = (r) => {
|
|
3
|
+
const o = new URLSearchParams(d.location.search), { firstToken: c, secondToken: e } = Object.fromEntries(o);
|
|
5
4
|
return {
|
|
6
|
-
firstTokenId: (
|
|
7
|
-
secondTokenId: (
|
|
5
|
+
firstTokenId: (r == null ? void 0 : r.firstTokenId) || c,
|
|
6
|
+
secondTokenId: (r == null ? void 0 : r.secondTokenId) || e
|
|
8
7
|
};
|
|
9
8
|
};
|
|
10
9
|
export {
|
|
11
|
-
getInitialTokens
|
|
10
|
+
s as getInitialTokens
|
|
12
11
|
};
|
|
@@ -1,20 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const parseAmount = require("@multiversx/sdk-dapp-utils/out/helpers/parseAmount");
|
|
5
|
-
const BigNumber = require("bignumber.js");
|
|
6
|
-
const reactjs_utils_testNumber = require("./testNumber.js");
|
|
7
|
-
function hasEnoughFunds({
|
|
8
|
-
balance,
|
|
9
|
-
amount,
|
|
10
|
-
decimals
|
|
11
|
-
}) {
|
|
12
|
-
const isNumber = reactjs_utils_testNumber.testNumber(amount);
|
|
13
|
-
const bnBalance = new BigNumber(balance);
|
|
14
|
-
const bnAmount = new BigNumber(
|
|
15
|
-
parseAmount.parseAmount(isNumber ? amount : "0", decimals)
|
|
16
|
-
);
|
|
17
|
-
const notEnough = !bnBalance.isNegative() && bnBalance.lt(bnAmount);
|
|
18
|
-
return !notEnough;
|
|
19
|
-
}
|
|
20
|
-
exports.hasEnoughFunds = hasEnoughFunds;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@multiversx/sdk-dapp-utils/out/helpers/parseAmount"),t=require("bignumber.js"),c=require("./testNumber.js");function a({balance:s,amount:e,decimals:u}){const o=c.testNumber(e),n=new t(s),r=new t(i.parseAmount(o?e:"0",u));return!(!n.isNegative()&&n.lt(r))}exports.hasEnoughFunds=a;
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import { parseAmount } from "@multiversx/sdk-dapp-utils/out/helpers/parseAmount";
|
|
2
|
-
import
|
|
3
|
-
import { testNumber } from "./testNumber.mjs";
|
|
4
|
-
function
|
|
5
|
-
balance,
|
|
6
|
-
amount,
|
|
7
|
-
decimals
|
|
1
|
+
import { parseAmount as u } from "@multiversx/sdk-dapp-utils/out/helpers/parseAmount";
|
|
2
|
+
import t from "bignumber.js";
|
|
3
|
+
import { testNumber as i } from "./testNumber.mjs";
|
|
4
|
+
function a({
|
|
5
|
+
balance: r,
|
|
6
|
+
amount: n,
|
|
7
|
+
decimals: e
|
|
8
8
|
}) {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const bnAmount = new BigNumber(
|
|
12
|
-
parseAmount(isNumber ? amount : "0", decimals)
|
|
9
|
+
const m = i(n), o = new t(r), s = new t(
|
|
10
|
+
u(m ? n : "0", e)
|
|
13
11
|
);
|
|
14
|
-
|
|
15
|
-
return !notEnough;
|
|
12
|
+
return !(!o.isNegative() && o.lt(s));
|
|
16
13
|
}
|
|
17
14
|
export {
|
|
18
|
-
hasEnoughFunds
|
|
15
|
+
a as hasEnoughFunds
|
|
19
16
|
};
|
package/reactjs/utils/index.js
CHANGED
|
@@ -1,27 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const reactjs_utils_delay = require("./delay.js");
|
|
5
|
-
const reactjs_utils_formatAmount = require("./formatAmount.js");
|
|
6
|
-
const reactjs_utils_getCleanStringAmount = require("./getCleanStringAmount.js");
|
|
7
|
-
const reactjs_utils_getCompletePathname = require("./getCompletePathname.js");
|
|
8
|
-
const reactjs_utils_getInitialTokens = require("./getInitialTokens.js");
|
|
9
|
-
const reactjs_utils_hasEnoughFunds = require("./hasEnoughFunds.js");
|
|
10
|
-
const reactjs_utils_isStringFloat = require("./isStringFloat.js");
|
|
11
|
-
const reactjs_utils_mxClsx = require("./mxClsx.js");
|
|
12
|
-
const reactjs_utils_pipe = require("./pipe.js");
|
|
13
|
-
const reactjs_utils_removeCommas = require("./removeCommas.js");
|
|
14
|
-
const reactjs_utils_roundAmount = require("./roundAmount.js");
|
|
15
|
-
const reactjs_utils_testNumber = require("./testNumber.js");
|
|
16
|
-
exports.delay = reactjs_utils_delay.delay;
|
|
17
|
-
exports.formatAmount = reactjs_utils_formatAmount.formatAmount;
|
|
18
|
-
exports.getCleanStringAmount = reactjs_utils_getCleanStringAmount.getCleanStringAmount;
|
|
19
|
-
exports.getCompletePathname = reactjs_utils_getCompletePathname.getCompletePathname;
|
|
20
|
-
exports.getInitialTokens = reactjs_utils_getInitialTokens.getInitialTokens;
|
|
21
|
-
exports.hasEnoughFunds = reactjs_utils_hasEnoughFunds.hasEnoughFunds;
|
|
22
|
-
exports.isStringFloat = reactjs_utils_isStringFloat.isStringFloat;
|
|
23
|
-
exports.mxClsx = reactjs_utils_mxClsx.mxClsx;
|
|
24
|
-
exports.pipe = reactjs_utils_pipe.pipe;
|
|
25
|
-
exports.removeCommas = reactjs_utils_removeCommas.removeCommas;
|
|
26
|
-
exports.roundAmount = reactjs_utils_roundAmount.roundAmount;
|
|
27
|
-
exports.testNumber = reactjs_utils_testNumber.testNumber;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./delay.js"),t=require("./formatAmount.js"),s=require("./getCleanStringAmount.js"),r=require("./getCompletePathname.js"),n=require("./getInitialTokens.js"),o=require("./hasEnoughFunds.js"),u=require("./isStringFloat.js"),i=require("./mxClsx.js"),a=require("./pipe.js"),m=require("./removeCommas.js"),l=require("./roundAmount.js"),c=require("./testNumber.js");exports.delay=e.delay;exports.formatAmount=t.formatAmount;exports.getCleanStringAmount=s.getCleanStringAmount;exports.getCompletePathname=r.getCompletePathname;exports.getInitialTokens=n.getInitialTokens;exports.hasEnoughFunds=o.hasEnoughFunds;exports.isStringFloat=u.isStringFloat;exports.mxClsx=i.mxClsx;exports.pipe=a.pipe;exports.removeCommas=m.removeCommas;exports.roundAmount=l.roundAmount;exports.testNumber=c.testNumber;
|
package/reactjs/utils/index.mjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { delay } from "./delay.mjs";
|
|
2
|
-
import { formatAmount } from "./formatAmount.mjs";
|
|
3
|
-
import { getCleanStringAmount } from "./getCleanStringAmount.mjs";
|
|
4
|
-
import { getCompletePathname } from "./getCompletePathname.mjs";
|
|
5
|
-
import { getInitialTokens } from "./getInitialTokens.mjs";
|
|
6
|
-
import { hasEnoughFunds } from "./hasEnoughFunds.mjs";
|
|
7
|
-
import { isStringFloat } from "./isStringFloat.mjs";
|
|
8
|
-
import { mxClsx } from "./mxClsx.mjs";
|
|
9
|
-
import { pipe } from "./pipe.mjs";
|
|
10
|
-
import { removeCommas } from "./removeCommas.mjs";
|
|
11
|
-
import { roundAmount } from "./roundAmount.mjs";
|
|
12
|
-
import { testNumber } from "./testNumber.mjs";
|
|
1
|
+
import { delay as t } from "./delay.mjs";
|
|
2
|
+
import { formatAmount as m } from "./formatAmount.mjs";
|
|
3
|
+
import { getCleanStringAmount as x } from "./getCleanStringAmount.mjs";
|
|
4
|
+
import { getCompletePathname as n } from "./getCompletePathname.mjs";
|
|
5
|
+
import { getInitialTokens as s } from "./getInitialTokens.mjs";
|
|
6
|
+
import { hasEnoughFunds as g } from "./hasEnoughFunds.mjs";
|
|
7
|
+
import { isStringFloat as l } from "./isStringFloat.mjs";
|
|
8
|
+
import { mxClsx as d } from "./mxClsx.mjs";
|
|
9
|
+
import { pipe as A } from "./pipe.mjs";
|
|
10
|
+
import { removeCommas as S } from "./removeCommas.mjs";
|
|
11
|
+
import { roundAmount as k } from "./roundAmount.mjs";
|
|
12
|
+
import { testNumber as y } from "./testNumber.mjs";
|
|
13
13
|
export {
|
|
14
|
-
delay,
|
|
15
|
-
formatAmount,
|
|
16
|
-
getCleanStringAmount,
|
|
17
|
-
getCompletePathname,
|
|
18
|
-
getInitialTokens,
|
|
19
|
-
hasEnoughFunds,
|
|
20
|
-
isStringFloat,
|
|
21
|
-
mxClsx,
|
|
22
|
-
pipe,
|
|
23
|
-
removeCommas,
|
|
24
|
-
roundAmount,
|
|
25
|
-
testNumber
|
|
14
|
+
t as delay,
|
|
15
|
+
m as formatAmount,
|
|
16
|
+
x as getCleanStringAmount,
|
|
17
|
+
n as getCompletePathname,
|
|
18
|
+
s as getInitialTokens,
|
|
19
|
+
g as hasEnoughFunds,
|
|
20
|
+
l as isStringFloat,
|
|
21
|
+
d as mxClsx,
|
|
22
|
+
A as pipe,
|
|
23
|
+
S as removeCommas,
|
|
24
|
+
k as roundAmount,
|
|
25
|
+
y as testNumber
|
|
26
26
|
};
|
|
@@ -1,22 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const BigNumber = require("bignumber.js");
|
|
5
|
-
const isStringFloat = (amount) => {
|
|
6
|
-
if (amount.match(/^-*[0-9]*\.?[0-9]*$/) === null) {
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
|
-
if (isNaN(parseFloat(amount))) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
let [wholes, decimals] = amount.split(".");
|
|
13
|
-
if (decimals) {
|
|
14
|
-
while (decimals.charAt(decimals.length - 1) === "0") {
|
|
15
|
-
decimals = decimals.slice(0, -1);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
const number = decimals ? [wholes, decimals].join(".") : wholes;
|
|
19
|
-
const bNparsed = new BigNumber(number);
|
|
20
|
-
return bNparsed.toFixed() === number;
|
|
21
|
-
};
|
|
22
|
-
exports.isStringFloat = isStringFloat;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("bignumber.js"),l=t=>{if(t.match(/^-*[0-9]*\.?[0-9]*$/)===null||isNaN(parseFloat(t)))return!1;let[r,e]=t.split(".");if(e)for(;e.charAt(e.length-1)==="0";)e=e.slice(0,-1);const i=e?[r,e].join("."):r;return new s(i).toFixed()===i};exports.isStringFloat=l;
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
if (
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
if (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
while (decimals.charAt(decimals.length - 1) === "0") {
|
|
12
|
-
decimals = decimals.slice(0, -1);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
const number = decimals ? [wholes, decimals].join(".") : wholes;
|
|
16
|
-
const bNparsed = new BigNumber(number);
|
|
17
|
-
return bNparsed.toFixed() === number;
|
|
1
|
+
import s from "bignumber.js";
|
|
2
|
+
const a = (r) => {
|
|
3
|
+
if (r.match(/^-*[0-9]*\.?[0-9]*$/) === null || isNaN(parseFloat(r)))
|
|
4
|
+
return !1;
|
|
5
|
+
let [t, e] = r.split(".");
|
|
6
|
+
if (e)
|
|
7
|
+
for (; e.charAt(e.length - 1) === "0"; )
|
|
8
|
+
e = e.slice(0, -1);
|
|
9
|
+
const i = e ? [t, e].join(".") : t;
|
|
10
|
+
return new s(i).toFixed() === i;
|
|
18
11
|
};
|
|
19
12
|
export {
|
|
20
|
-
isStringFloat
|
|
13
|
+
a as isStringFloat
|
|
21
14
|
};
|