@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,5 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const reactjs_components_CopyButton_utils_copyToClipboard = require("./copyToClipboard.js");
|
|
5
|
-
exports.copyTextToClipboard = reactjs_components_CopyButton_utils_copyToClipboard.copyTextToClipboard;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./copyToClipboard.js");exports.copyTextToClipboard=o.copyTextToClipboard;
|
|
@@ -1,91 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
-
const BigNumber = require("bignumber.js");
|
|
6
|
-
const isString = require("lodash/isString");
|
|
7
|
-
const reactjs_components_DisplayAmount_components_AnimateNumber_AnimateNumber = require("./components/AnimateNumber/AnimateNumber.js");
|
|
8
|
-
const reactjs_components_DisplayAmount_components_PrecisedAmount_PrecisedAmount = require("./components/PrecisedAmount/PrecisedAmount.js");
|
|
9
|
-
const reactjs_components_DisplayAmount_utils_truncateAmount = require("./utils/truncateAmount.js");
|
|
10
|
-
const reactjs_utils_formatAmount = require("../../utils/formatAmount.js");
|
|
11
|
-
const reactjs_utils_getCleanStringAmount = require("../../utils/getCleanStringAmount.js");
|
|
12
|
-
const reactjs_utils_isStringFloat = require("../../utils/isStringFloat.js");
|
|
13
|
-
const reactjs_utils_mxClsx = require("../../utils/mxClsx.js");
|
|
14
|
-
const reactjs_utils_roundAmount = require("../../utils/roundAmount.js");
|
|
15
|
-
const reactjs_components_base_MxTooltip_MxTooltip = require("../base/MxTooltip/MxTooltip.js");
|
|
16
|
-
const DisplayAmount = ({
|
|
17
|
-
amount,
|
|
18
|
-
decimals,
|
|
19
|
-
sufix = "",
|
|
20
|
-
prefix = "",
|
|
21
|
-
className = "",
|
|
22
|
-
tooltipThreshold = 0,
|
|
23
|
-
shouldAnimate = false,
|
|
24
|
-
shouldTruncate = false,
|
|
25
|
-
shouldBePrecised = true,
|
|
26
|
-
tooltipPlacement = "top",
|
|
27
|
-
showLastNonZeroDecimal = true,
|
|
28
|
-
digits = 4,
|
|
29
|
-
shouldShowTooltip = true,
|
|
30
|
-
...rest
|
|
31
|
-
}) => {
|
|
32
|
-
const stringAmount = isString(amount) ? reactjs_utils_getCleanStringAmount.getCleanStringAmount(amount).amountWithoutCommas : String(amount);
|
|
33
|
-
const isValidStringAmount = reactjs_utils_isStringFloat.isStringFloat(stringAmount);
|
|
34
|
-
const isZero = new BigNumber(
|
|
35
|
-
isValidStringAmount ? stringAmount : "0"
|
|
36
|
-
).isEqualTo(0);
|
|
37
|
-
if (!isValidStringAmount || isZero) {
|
|
38
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { ...rest, className: reactjs_utils_mxClsx.mxClsx(className), children: [
|
|
39
|
-
prefix,
|
|
40
|
-
amount,
|
|
41
|
-
sufix
|
|
42
|
-
] });
|
|
43
|
-
}
|
|
44
|
-
const formattedAmount = decimals ? reactjs_utils_formatAmount.formatAmount({
|
|
45
|
-
digits,
|
|
46
|
-
decimals,
|
|
47
|
-
addCommas: true,
|
|
48
|
-
amount: stringAmount,
|
|
49
|
-
showLastNonZeroDecimal
|
|
50
|
-
}) : reactjs_utils_roundAmount.roundAmount(stringAmount, digits, true);
|
|
51
|
-
const bnAmount = new BigNumber(formattedAmount);
|
|
52
|
-
const bnTooltipThreshold = new BigNumber(tooltipThreshold);
|
|
53
|
-
const tooltipThresholdReached = bnAmount.isLessThan(bnTooltipThreshold);
|
|
54
|
-
if (shouldBePrecised && new BigNumber(formattedAmount).isLessThan(1)) {
|
|
55
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
56
|
-
reactjs_components_DisplayAmount_components_PrecisedAmount_PrecisedAmount.PrecisedAmount,
|
|
57
|
-
{
|
|
58
|
-
...rest,
|
|
59
|
-
sufix,
|
|
60
|
-
prefix,
|
|
61
|
-
digits,
|
|
62
|
-
className,
|
|
63
|
-
amount: formattedAmount,
|
|
64
|
-
shouldShowTooltip
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
if (tooltipThresholdReached) {
|
|
69
|
-
const prefixWhenTooltip = prefix.includes("<") ? prefix : "< ";
|
|
70
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
71
|
-
reactjs_components_base_MxTooltip_MxTooltip.MxTooltip,
|
|
72
|
-
{
|
|
73
|
-
placement: tooltipPlacement,
|
|
74
|
-
buttonText: /* @__PURE__ */ jsxRuntime.jsxs("span", { ...rest, className: reactjs_utils_mxClsx.mxClsx("liq-max-w-fit", className), children: [
|
|
75
|
-
prefixWhenTooltip,
|
|
76
|
-
tooltipThreshold,
|
|
77
|
-
sufix
|
|
78
|
-
] }),
|
|
79
|
-
hideTooltip: !shouldShowTooltip,
|
|
80
|
-
children: formattedAmount
|
|
81
|
-
}
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
const truncatedAmount = shouldTruncate ? reactjs_components_DisplayAmount_utils_truncateAmount.truncateAmount(formattedAmount) : formattedAmount;
|
|
85
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { ...rest, className: reactjs_utils_mxClsx.mxClsx(className), children: [
|
|
86
|
-
prefix,
|
|
87
|
-
shouldAnimate && !shouldTruncate ? /* @__PURE__ */ jsxRuntime.jsx(reactjs_components_DisplayAmount_components_AnimateNumber_AnimateNumber.AnimateNumber, { ...rest, amount: formattedAmount }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: truncatedAmount }),
|
|
88
|
-
sufix
|
|
89
|
-
] });
|
|
90
|
-
};
|
|
91
|
-
exports.DisplayAmount = DisplayAmount;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("bignumber.js"),D=require("lodash/isString"),f=require("./components/AnimateNumber/AnimateNumber.js"),w=require("./components/PrecisedAmount/PrecisedAmount.js"),M=require("./utils/truncateAmount.js"),N=require("../../utils/formatAmount.js"),P=require("../../utils/getCleanStringAmount.js"),F=require("../../utils/isStringFloat.js"),a=require("../../utils/mxClsx.js"),v=require("../../utils/roundAmount.js"),L=require("../base/MxTooltip/MxTooltip.js"),R=({amount:s,decimals:l,sufix:r="",prefix:e="",className:u="",tooltipThreshold:_=0,shouldAnimate:d=!1,shouldTruncate:A=!1,shouldBePrecised:x=!0,tooltipPlacement:q="top",showLastNonZeroDecimal:g=!0,digits:m=4,shouldShowTooltip:p=!0,...o})=>{const i=D(s)?P.getCleanStringAmount(s).amountWithoutCommas:String(s),j=F.isStringFloat(i),b=new c(j?i:"0").isEqualTo(0);if(!j||b)return t.jsxs("span",{...o,className:a.mxClsx(u),children:[e,s,r]});const n=l?N.formatAmount({digits:m,decimals:l,addCommas:!0,amount:i,showLastNonZeroDecimal:g}):v.roundAmount(i,m,!0),h=new c(n),T=new c(_),C=h.isLessThan(T);if(x&&new c(n).isLessThan(1))return t.jsx(w.PrecisedAmount,{...o,sufix:r,prefix:e,digits:m,className:u,amount:n,shouldShowTooltip:p});if(C){const y=e.includes("<")?e:"< ";return t.jsx(L.MxTooltip,{placement:q,buttonText:t.jsxs("span",{...o,className:a.mxClsx("liq-max-w-fit",u),children:[y,_,r]}),hideTooltip:!p,children:n})}const S=A?M.truncateAmount(n):n;return t.jsxs("span",{...o,className:a.mxClsx(u),children:[e,d&&!A?t.jsx(f.AnimateNumber,{...o,amount:n}):t.jsx(t.Fragment,{children:S}),r]})};exports.DisplayAmount=R;
|
|
@@ -1,90 +1,83 @@
|
|
|
1
|
-
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { AnimateNumber } from "./components/AnimateNumber/AnimateNumber.mjs";
|
|
5
|
-
import { PrecisedAmount } from "./components/PrecisedAmount/PrecisedAmount.mjs";
|
|
6
|
-
import { truncateAmount } from "./utils/truncateAmount.mjs";
|
|
7
|
-
import { formatAmount } from "../../utils/formatAmount.mjs";
|
|
8
|
-
import { getCleanStringAmount } from "../../utils/getCleanStringAmount.mjs";
|
|
9
|
-
import { isStringFloat } from "../../utils/isStringFloat.mjs";
|
|
10
|
-
import { mxClsx } from "../../utils/mxClsx.mjs";
|
|
11
|
-
import { roundAmount } from "../../utils/roundAmount.mjs";
|
|
12
|
-
import { MxTooltip } from "../base/MxTooltip/MxTooltip.mjs";
|
|
13
|
-
const
|
|
14
|
-
amount,
|
|
15
|
-
decimals,
|
|
16
|
-
sufix = "",
|
|
17
|
-
prefix = "",
|
|
18
|
-
className = "",
|
|
19
|
-
tooltipThreshold = 0,
|
|
20
|
-
shouldAnimate =
|
|
21
|
-
shouldTruncate =
|
|
22
|
-
shouldBePrecised =
|
|
23
|
-
tooltipPlacement = "top",
|
|
24
|
-
showLastNonZeroDecimal =
|
|
25
|
-
digits = 4,
|
|
26
|
-
shouldShowTooltip =
|
|
27
|
-
...
|
|
1
|
+
import { jsxs as c, jsx as s, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import u from "bignumber.js";
|
|
3
|
+
import N from "lodash/isString";
|
|
4
|
+
import { AnimateNumber as W } from "./components/AnimateNumber/AnimateNumber.mjs";
|
|
5
|
+
import { PrecisedAmount as y } from "./components/PrecisedAmount/PrecisedAmount.mjs";
|
|
6
|
+
import { truncateAmount as B } from "./utils/truncateAmount.mjs";
|
|
7
|
+
import { formatAmount as D } from "../../utils/formatAmount.mjs";
|
|
8
|
+
import { getCleanStringAmount as E } from "../../utils/getCleanStringAmount.mjs";
|
|
9
|
+
import { isStringFloat as M } from "../../utils/isStringFloat.mjs";
|
|
10
|
+
import { mxClsx as p } from "../../utils/mxClsx.mjs";
|
|
11
|
+
import { roundAmount as P } from "../../utils/roundAmount.mjs";
|
|
12
|
+
import { MxTooltip as R } from "../base/MxTooltip/MxTooltip.mjs";
|
|
13
|
+
const U = ({
|
|
14
|
+
amount: r,
|
|
15
|
+
decimals: l,
|
|
16
|
+
sufix: m = "",
|
|
17
|
+
prefix: o = "",
|
|
18
|
+
className: e = "",
|
|
19
|
+
tooltipThreshold: f = 0,
|
|
20
|
+
shouldAnimate: g = !1,
|
|
21
|
+
shouldTruncate: A = !1,
|
|
22
|
+
shouldBePrecised: T = !0,
|
|
23
|
+
tooltipPlacement: b = "top",
|
|
24
|
+
showLastNonZeroDecimal: w = !0,
|
|
25
|
+
digits: a = 4,
|
|
26
|
+
shouldShowTooltip: d = !0,
|
|
27
|
+
...n
|
|
28
28
|
}) => {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
const isZero = new BigNumber(
|
|
32
|
-
isValidStringAmount ? stringAmount : "0"
|
|
29
|
+
const i = N(r) ? E(r).amountWithoutCommas : String(r), h = M(i), C = new u(
|
|
30
|
+
h ? i : "0"
|
|
33
31
|
).isEqualTo(0);
|
|
34
|
-
if (!
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
if (!h || C)
|
|
33
|
+
return /* @__PURE__ */ c("span", { ...n, className: p(e), children: [
|
|
34
|
+
o,
|
|
35
|
+
r,
|
|
36
|
+
m
|
|
39
37
|
] });
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const tooltipThresholdReached = bnAmount.isLessThan(bnTooltipThreshold);
|
|
51
|
-
if (shouldBePrecised && new BigNumber(formattedAmount).isLessThan(1)) {
|
|
52
|
-
return /* @__PURE__ */ jsx(
|
|
53
|
-
PrecisedAmount,
|
|
38
|
+
const t = l ? D({
|
|
39
|
+
digits: a,
|
|
40
|
+
decimals: l,
|
|
41
|
+
addCommas: !0,
|
|
42
|
+
amount: i,
|
|
43
|
+
showLastNonZeroDecimal: w
|
|
44
|
+
}) : P(i, a, !0), S = new u(t), j = new u(f), q = S.isLessThan(j);
|
|
45
|
+
if (T && new u(t).isLessThan(1))
|
|
46
|
+
return /* @__PURE__ */ s(
|
|
47
|
+
y,
|
|
54
48
|
{
|
|
55
|
-
...
|
|
56
|
-
sufix,
|
|
57
|
-
prefix,
|
|
58
|
-
digits,
|
|
59
|
-
className,
|
|
60
|
-
amount:
|
|
61
|
-
shouldShowTooltip
|
|
49
|
+
...n,
|
|
50
|
+
sufix: m,
|
|
51
|
+
prefix: o,
|
|
52
|
+
digits: a,
|
|
53
|
+
className: e,
|
|
54
|
+
amount: t,
|
|
55
|
+
shouldShowTooltip: d
|
|
62
56
|
}
|
|
63
57
|
);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
MxTooltip,
|
|
58
|
+
if (q) {
|
|
59
|
+
const F = o.includes("<") ? o : "< ";
|
|
60
|
+
return /* @__PURE__ */ s(
|
|
61
|
+
R,
|
|
69
62
|
{
|
|
70
|
-
placement:
|
|
71
|
-
buttonText: /* @__PURE__ */
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
63
|
+
placement: b,
|
|
64
|
+
buttonText: /* @__PURE__ */ c("span", { ...n, className: p("liq-max-w-fit", e), children: [
|
|
65
|
+
F,
|
|
66
|
+
f,
|
|
67
|
+
m
|
|
75
68
|
] }),
|
|
76
|
-
hideTooltip: !
|
|
77
|
-
children:
|
|
69
|
+
hideTooltip: !d,
|
|
70
|
+
children: t
|
|
78
71
|
}
|
|
79
72
|
);
|
|
80
73
|
}
|
|
81
|
-
const
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
74
|
+
const x = A ? B(t) : t;
|
|
75
|
+
return /* @__PURE__ */ c("span", { ...n, className: p(e), children: [
|
|
76
|
+
o,
|
|
77
|
+
g && !A ? /* @__PURE__ */ s(W, { ...n, amount: t }) : /* @__PURE__ */ s(L, { children: x }),
|
|
78
|
+
m
|
|
86
79
|
] });
|
|
87
80
|
};
|
|
88
81
|
export {
|
|
89
|
-
DisplayAmount
|
|
82
|
+
U as DisplayAmount
|
|
90
83
|
};
|
|
@@ -1,40 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
-
const AnimatedNumber = require("animated-number-react");
|
|
6
|
-
const React = require("react");
|
|
7
|
-
const reactjs_utils_getCleanStringAmount = require("../../../../utils/getCleanStringAmount.js");
|
|
8
|
-
const reactjs_utils_roundAmount = require("../../../../utils/roundAmount.js");
|
|
9
|
-
const AnimateNumber = ({
|
|
10
|
-
amount,
|
|
11
|
-
onClick,
|
|
12
|
-
...rest
|
|
13
|
-
}) => {
|
|
14
|
-
const [digits, setDigits] = React.useState(0);
|
|
15
|
-
const [updateCount, setUpdateCount] = React.useState(0);
|
|
16
|
-
const [valueToAnimate, setValueToAnimate] = React.useState();
|
|
17
|
-
React.useEffect(() => {
|
|
18
|
-
const { amountWithoutCommas, parts } = reactjs_utils_getCleanStringAmount.getCleanStringAmount(amount);
|
|
19
|
-
setUpdateCount((existing) => existing + 1);
|
|
20
|
-
setDigits(parts.length > 1 ? parts[1].length : 0);
|
|
21
|
-
const parsedAmount = parseFloat(amountWithoutCommas);
|
|
22
|
-
const isScientificNotation = parsedAmount.toString().includes("e");
|
|
23
|
-
setValueToAnimate(isScientificNotation ? void 0 : parsedAmount);
|
|
24
|
-
}, [amount]);
|
|
25
|
-
const formatValue = (val) => reactjs_utils_roundAmount.roundAmount(`${val}`, digits, true);
|
|
26
|
-
if (!valueToAnimate) {
|
|
27
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: amount });
|
|
28
|
-
}
|
|
29
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
30
|
-
AnimatedNumber,
|
|
31
|
-
{
|
|
32
|
-
value: valueToAnimate,
|
|
33
|
-
duration: updateCount > 1 ? 300 : 0,
|
|
34
|
-
formatValue,
|
|
35
|
-
onClick,
|
|
36
|
-
...rest
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
};
|
|
40
|
-
exports.AnimateNumber = AnimateNumber;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),f=require("animated-number-react"),t=require("react"),j=require("../../../../utils/getCleanStringAmount.js"),p=require("../../../../utils/roundAmount.js"),q=({amount:e,onClick:i,...a})=>{const[c,m]=t.useState(0),[l,d]=t.useState(0),[u,g]=t.useState();t.useEffect(()=>{const{amountWithoutCommas:n,parts:o}=j.getCleanStringAmount(e);d(b=>b+1),m(o.length>1?o[1].length:0);const r=parseFloat(n),S=r.toString().includes("e");g(S?void 0:r)},[e]);const A=n=>p.roundAmount(`${n}`,c,!0);return u?s.jsx(f,{value:u,duration:l>1?300:0,formatValue:A,onClick:i,...a}):s.jsx(s.Fragment,{children:e})};exports.AnimateNumber=q;
|
|
@@ -1,39 +1,32 @@
|
|
|
1
|
-
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { useState, useEffect } from "react";
|
|
4
|
-
import { getCleanStringAmount } from "../../../../utils/getCleanStringAmount.mjs";
|
|
5
|
-
import { roundAmount } from "../../../../utils/roundAmount.mjs";
|
|
6
|
-
const
|
|
7
|
-
amount,
|
|
8
|
-
onClick,
|
|
9
|
-
...
|
|
1
|
+
import { jsx as m, Fragment as h } from "react/jsx-runtime";
|
|
2
|
+
import C from "animated-number-react";
|
|
3
|
+
import { useState as e, useEffect as S } from "react";
|
|
4
|
+
import { getCleanStringAmount as v } from "../../../../utils/getCleanStringAmount.mjs";
|
|
5
|
+
import { roundAmount as N } from "../../../../utils/roundAmount.mjs";
|
|
6
|
+
const j = ({
|
|
7
|
+
amount: t,
|
|
8
|
+
onClick: s,
|
|
9
|
+
...a
|
|
10
10
|
}) => {
|
|
11
|
-
const [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}, [amount]);
|
|
22
|
-
const formatValue = (val) => roundAmount(`${val}`, digits, true);
|
|
23
|
-
if (!valueToAnimate) {
|
|
24
|
-
return /* @__PURE__ */ jsx(Fragment, { children: amount });
|
|
25
|
-
}
|
|
26
|
-
return /* @__PURE__ */ jsx(
|
|
27
|
-
AnimatedNumber,
|
|
11
|
+
const [u, c] = e(0), [p, d] = e(0), [n, f] = e();
|
|
12
|
+
S(() => {
|
|
13
|
+
const { amountWithoutCommas: o, parts: r } = v(t);
|
|
14
|
+
d((A) => A + 1), c(r.length > 1 ? r[1].length : 0);
|
|
15
|
+
const i = parseFloat(o), g = i.toString().includes("e");
|
|
16
|
+
f(g ? void 0 : i);
|
|
17
|
+
}, [t]);
|
|
18
|
+
const l = (o) => N(`${o}`, u, !0);
|
|
19
|
+
return n ? /* @__PURE__ */ m(
|
|
20
|
+
C,
|
|
28
21
|
{
|
|
29
|
-
value:
|
|
30
|
-
duration:
|
|
31
|
-
formatValue,
|
|
32
|
-
onClick,
|
|
33
|
-
...
|
|
22
|
+
value: n,
|
|
23
|
+
duration: p > 1 ? 300 : 0,
|
|
24
|
+
formatValue: l,
|
|
25
|
+
onClick: s,
|
|
26
|
+
...a
|
|
34
27
|
}
|
|
35
|
-
);
|
|
28
|
+
) : /* @__PURE__ */ m(h, { children: t });
|
|
36
29
|
};
|
|
37
30
|
export {
|
|
38
|
-
AnimateNumber
|
|
31
|
+
j as AnimateNumber
|
|
39
32
|
};
|
|
@@ -1,62 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
-
const reactjs_utils_mxClsx = require("../../../../utils/mxClsx.js");
|
|
6
|
-
const reactjs_components_base_MxTooltip_MxTooltip = require("../../../base/MxTooltip/MxTooltip.js");
|
|
7
|
-
const MAX_DISPLAY_ZERO_DECIMALS = 5;
|
|
8
|
-
const PrecisedAmount = ({
|
|
9
|
-
amount,
|
|
10
|
-
digits,
|
|
11
|
-
className,
|
|
12
|
-
prefix,
|
|
13
|
-
sufix,
|
|
14
|
-
tooltipPlacement,
|
|
15
|
-
shouldShowTooltip = true,
|
|
16
|
-
...rest
|
|
17
|
-
}) => {
|
|
18
|
-
var _a, _b;
|
|
19
|
-
const valueParts = (_a = String(amount)) == null ? void 0 : _a.split(".");
|
|
20
|
-
const decimalArray = ((_b = valueParts[1]) == null ? void 0 : _b.split("")) ?? [];
|
|
21
|
-
const areAllDigitsZeroes = decimalArray == null ? void 0 : decimalArray.every((digit) => digit === "0");
|
|
22
|
-
const firstNonZeroIndex = decimalArray == null ? void 0 : decimalArray.findIndex((digit) => digit !== "0");
|
|
23
|
-
const nonZeroDecimalsArr = [];
|
|
24
|
-
for (let i = firstNonZeroIndex; i <= (decimalArray == null ? void 0 : decimalArray.length) - 1; i++) {
|
|
25
|
-
if (nonZeroDecimalsArr.length < Math.max(digits, 2)) {
|
|
26
|
-
nonZeroDecimalsArr.push(decimalArray[i]);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
if (firstNonZeroIndex > MAX_DISPLAY_ZERO_DECIMALS) {
|
|
30
|
-
const nonZeroDecimals = nonZeroDecimalsArr == null ? void 0 : nonZeroDecimalsArr.join("");
|
|
31
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
32
|
-
reactjs_components_base_MxTooltip_MxTooltip.MxTooltip,
|
|
33
|
-
{
|
|
34
|
-
placement: tooltipPlacement,
|
|
35
|
-
buttonText: /* @__PURE__ */ jsxRuntime.jsxs("span", { ...rest, className: reactjs_utils_mxClsx.mxClsx(className), children: [
|
|
36
|
-
prefix,
|
|
37
|
-
valueParts[0],
|
|
38
|
-
".0",
|
|
39
|
-
/* @__PURE__ */ jsxRuntime.jsx("sub", { className: reactjs_utils_mxClsx.mxClsx(className, "liq-text-[60%]"), children: firstNonZeroIndex - 2 }),
|
|
40
|
-
"0",
|
|
41
|
-
nonZeroDecimals,
|
|
42
|
-
sufix
|
|
43
|
-
] }),
|
|
44
|
-
containerClassName: "leading-none",
|
|
45
|
-
hideTooltip: !shouldShowTooltip,
|
|
46
|
-
children: amount
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
const hasDecimals = valueParts[1] && !areAllDigitsZeroes;
|
|
51
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { ...rest, className: reactjs_utils_mxClsx.mxClsx(className), children: [
|
|
52
|
-
prefix,
|
|
53
|
-
valueParts[0],
|
|
54
|
-
hasDecimals && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
55
|
-
".",
|
|
56
|
-
valueParts[1]
|
|
57
|
-
] }),
|
|
58
|
-
sufix
|
|
59
|
-
] });
|
|
60
|
-
};
|
|
61
|
-
exports.MAX_DISPLAY_ZERO_DECIMALS = MAX_DISPLAY_ZERO_DECIMALS;
|
|
62
|
-
exports.PrecisedAmount = PrecisedAmount;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("../../../../utils/mxClsx.js"),C=require("../../../base/MxTooltip/MxTooltip.js"),p=5,S=({amount:r,digits:d,className:i,prefix:x,sufix:u,tooltipPlacement:j,shouldShowTooltip:m=!0,..._})=>{var a,h;const n=(a=String(r))==null?void 0:a.split("."),e=((h=n[1])==null?void 0:h.split(""))??[],M=e==null?void 0:e.every(s=>s==="0"),l=e==null?void 0:e.findIndex(s=>s!=="0"),o=[];for(let s=l;s<=(e==null?void 0:e.length)-1;s++)o.length<Math.max(d,2)&&o.push(e[s]);if(l>p){const s=o==null?void 0:o.join("");return t.jsx(C.MxTooltip,{placement:j,buttonText:t.jsxs("span",{..._,className:c.mxClsx(i),children:[x,n[0],".0",t.jsx("sub",{className:c.mxClsx(i,"liq-text-[60%]"),children:l-2}),"0",s,u]}),containerClassName:"leading-none",hideTooltip:!m,children:r})}const g=n[1]&&!M;return t.jsxs("span",{..._,className:c.mxClsx(i),children:[x,n[0],g&&t.jsxs(t.Fragment,{children:[".",n[1]]}),u]})};exports.MAX_DISPLAY_ZERO_DECIMALS=p;exports.PrecisedAmount=S;
|
|
@@ -1,61 +1,53 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { mxClsx } from "../../../../utils/mxClsx.mjs";
|
|
3
|
-
import { MxTooltip } from "../../../base/MxTooltip/MxTooltip.mjs";
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
...rest
|
|
1
|
+
import { jsx as d, jsxs as l, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import { mxClsx as c } from "../../../../utils/mxClsx.mjs";
|
|
3
|
+
import { MxTooltip as j } from "../../../base/MxTooltip/MxTooltip.mjs";
|
|
4
|
+
const C = 5, T = ({
|
|
5
|
+
amount: r,
|
|
6
|
+
digits: f,
|
|
7
|
+
className: s,
|
|
8
|
+
prefix: h,
|
|
9
|
+
sufix: p,
|
|
10
|
+
tooltipPlacement: g,
|
|
11
|
+
shouldShowTooltip: u = !0,
|
|
12
|
+
...x
|
|
14
13
|
}) => {
|
|
15
|
-
var
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
nonZeroDecimalsArr.push(decimalArray[i]);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
if (firstNonZeroIndex > MAX_DISPLAY_ZERO_DECIMALS) {
|
|
27
|
-
const nonZeroDecimals = nonZeroDecimalsArr == null ? void 0 : nonZeroDecimalsArr.join("");
|
|
28
|
-
return /* @__PURE__ */ jsx(
|
|
29
|
-
MxTooltip,
|
|
14
|
+
var m, a;
|
|
15
|
+
const e = (m = String(r)) == null ? void 0 : m.split("."), t = ((a = e[1]) == null ? void 0 : a.split("")) ?? [], D = t == null ? void 0 : t.every((n) => n === "0"), i = t == null ? void 0 : t.findIndex((n) => n !== "0"), o = [];
|
|
16
|
+
for (let n = i; n <= (t == null ? void 0 : t.length) - 1; n++)
|
|
17
|
+
o.length < Math.max(f, 2) && o.push(t[n]);
|
|
18
|
+
if (i > C) {
|
|
19
|
+
const n = o == null ? void 0 : o.join("");
|
|
20
|
+
return /* @__PURE__ */ d(
|
|
21
|
+
j,
|
|
30
22
|
{
|
|
31
|
-
placement:
|
|
32
|
-
buttonText: /* @__PURE__ */
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
placement: g,
|
|
24
|
+
buttonText: /* @__PURE__ */ l("span", { ...x, className: c(s), children: [
|
|
25
|
+
h,
|
|
26
|
+
e[0],
|
|
35
27
|
".0",
|
|
36
|
-
/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ d("sub", { className: c(s, "liq-text-[60%]"), children: i - 2 }),
|
|
37
29
|
"0",
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
n,
|
|
31
|
+
p
|
|
40
32
|
] }),
|
|
41
33
|
containerClassName: "leading-none",
|
|
42
|
-
hideTooltip: !
|
|
43
|
-
children:
|
|
34
|
+
hideTooltip: !u,
|
|
35
|
+
children: r
|
|
44
36
|
}
|
|
45
37
|
);
|
|
46
38
|
}
|
|
47
|
-
const
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
const I = e[1] && !D;
|
|
40
|
+
return /* @__PURE__ */ l("span", { ...x, className: c(s), children: [
|
|
41
|
+
h,
|
|
42
|
+
e[0],
|
|
43
|
+
I && /* @__PURE__ */ l(M, { children: [
|
|
52
44
|
".",
|
|
53
|
-
|
|
45
|
+
e[1]
|
|
54
46
|
] }),
|
|
55
|
-
|
|
47
|
+
p
|
|
56
48
|
] });
|
|
57
49
|
};
|
|
58
50
|
export {
|
|
59
|
-
MAX_DISPLAY_ZERO_DECIMALS,
|
|
60
|
-
PrecisedAmount
|
|
51
|
+
C as MAX_DISPLAY_ZERO_DECIMALS,
|
|
52
|
+
T as PrecisedAmount
|
|
61
53
|
};
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const reactjs_components_DisplayAmount_DisplayAmount = require("./DisplayAmount.js");
|
|
5
|
-
exports.DisplayAmount = reactjs_components_DisplayAmount_DisplayAmount.DisplayAmount;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./DisplayAmount.js");exports.DisplayAmount=e.DisplayAmount;
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const reactjs_components_DisplayAmount_utils_truncateAmount = require("./truncateAmount.js");
|
|
5
|
-
exports.truncateAmount = reactjs_components_DisplayAmount_utils_truncateAmount.truncateAmount;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./truncateAmount.js");exports.truncateAmount=t.truncateAmount;
|
|
@@ -1,22 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const numeral = require("numeral");
|
|
5
|
-
const reactjs_utils_removeCommas = require("../../../utils/removeCommas.js");
|
|
6
|
-
const truncateAmount = (formattedAmount) => {
|
|
7
|
-
const cleanFormattedAmount = reactjs_utils_removeCommas.removeCommas(formattedAmount);
|
|
8
|
-
const number = Number(cleanFormattedAmount);
|
|
9
|
-
const abbreviations = {
|
|
10
|
-
T: 1e12,
|
|
11
|
-
B: 1e9,
|
|
12
|
-
M: 1e6,
|
|
13
|
-
K: 1e3
|
|
14
|
-
};
|
|
15
|
-
for (const key in abbreviations) {
|
|
16
|
-
if (Math.abs(number) >= abbreviations[key]) {
|
|
17
|
-
return numeral(number / abbreviations[key]).format("0.[00]") + key;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return number;
|
|
21
|
-
};
|
|
22
|
-
exports.truncateAmount = truncateAmount;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("numeral"),s=require("../../../utils/removeCommas.js"),a=n=>{const o=s.removeCommas(n),e=Number(o),t={T:1e12,B:1e9,M:1e6,K:1e3};for(const r in t)if(Math.abs(e)>=t[r])return u(e/t[r]).format("0.[00]")+r;return e};exports.truncateAmount=a;
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { removeCommas } from "../../../utils/removeCommas.mjs";
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const number = Number(cleanFormattedAmount);
|
|
6
|
-
const abbreviations = {
|
|
1
|
+
import m from "numeral";
|
|
2
|
+
import { removeCommas as a } from "../../../utils/removeCommas.mjs";
|
|
3
|
+
const c = (e) => {
|
|
4
|
+
const n = a(e), t = Number(n), o = {
|
|
7
5
|
T: 1e12,
|
|
8
6
|
B: 1e9,
|
|
9
7
|
M: 1e6,
|
|
10
8
|
K: 1e3
|
|
11
9
|
};
|
|
12
|
-
for (const
|
|
13
|
-
if (Math.abs(
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
return number;
|
|
10
|
+
for (const r in o)
|
|
11
|
+
if (Math.abs(t) >= o[r])
|
|
12
|
+
return m(t / o[r]).format("0.[00]") + r;
|
|
13
|
+
return t;
|
|
18
14
|
};
|
|
19
15
|
export {
|
|
20
|
-
truncateAmount
|
|
16
|
+
c as truncateAmount
|
|
21
17
|
};
|