@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
package/reactjs/utils/mxClsx.js
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const clsx = require("clsx");
|
|
5
|
-
const tailwindMerge = require("tailwind-merge");
|
|
6
|
-
const mxClsx = (...inputs) => {
|
|
7
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
8
|
-
};
|
|
9
|
-
exports.mxClsx = mxClsx;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("clsx"),t=require("tailwind-merge"),n=(...e)=>t.twMerge(r.clsx(e));exports.mxClsx=n;
|
package/reactjs/utils/mxClsx.mjs
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { clsx } from "clsx";
|
|
2
|
-
import { twMerge } from "tailwind-merge";
|
|
3
|
-
const
|
|
4
|
-
return twMerge(clsx(inputs));
|
|
5
|
-
};
|
|
1
|
+
import { clsx as o } from "clsx";
|
|
2
|
+
import { twMerge as t } from "tailwind-merge";
|
|
3
|
+
const x = (...r) => t(o(r));
|
|
6
4
|
export {
|
|
7
|
-
mxClsx
|
|
5
|
+
x as mxClsx
|
|
8
6
|
};
|
package/reactjs/utils/pipe.js
CHANGED
|
@@ -1,26 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
function pipe(previous) {
|
|
5
|
-
return {
|
|
6
|
-
if: function(condition) {
|
|
7
|
-
if (condition) {
|
|
8
|
-
return {
|
|
9
|
-
then: (newValue) => (
|
|
10
|
-
// if a callback is passed, callback is executed with previous value
|
|
11
|
-
newValue instanceof Function ? pipe(newValue(previous)) : pipe(newValue)
|
|
12
|
-
)
|
|
13
|
-
};
|
|
14
|
-
} else {
|
|
15
|
-
return {
|
|
16
|
-
then: () => pipe(previous)
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
then: (newValue) => newValue instanceof Function ? pipe(newValue(previous)) : pipe(newValue),
|
|
21
|
-
valueOf: function() {
|
|
22
|
-
return previous;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
exports.pipe = pipe;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(e){return{if:function(t){return t?{then:i=>i instanceof Function?n(i(e)):n(i)}:{then:()=>n(e)}},then:t=>t instanceof Function?n(t(e)):n(t),valueOf:function(){return e}}}exports.pipe=n;
|
package/reactjs/utils/pipe.mjs
CHANGED
|
@@ -1,25 +1,21 @@
|
|
|
1
|
-
function
|
|
1
|
+
function t(f) {
|
|
2
2
|
return {
|
|
3
|
-
if: function(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
return {
|
|
13
|
-
then: () => pipe(previous)
|
|
14
|
-
};
|
|
15
|
-
}
|
|
3
|
+
if: function(n) {
|
|
4
|
+
return n ? {
|
|
5
|
+
then: (c) => (
|
|
6
|
+
// if a callback is passed, callback is executed with previous value
|
|
7
|
+
c instanceof Function ? t(c(f)) : t(c)
|
|
8
|
+
)
|
|
9
|
+
} : {
|
|
10
|
+
then: () => t(f)
|
|
11
|
+
};
|
|
16
12
|
},
|
|
17
|
-
then: (
|
|
13
|
+
then: (n) => n instanceof Function ? t(n(f)) : t(n),
|
|
18
14
|
valueOf: function() {
|
|
19
|
-
return
|
|
15
|
+
return f;
|
|
20
16
|
}
|
|
21
17
|
};
|
|
22
18
|
}
|
|
23
19
|
export {
|
|
24
|
-
pipe
|
|
20
|
+
t as pipe
|
|
25
21
|
};
|
|
@@ -1,7 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const removeCommas = (amount) => {
|
|
5
|
-
return amount.replace(/,/g, "");
|
|
6
|
-
};
|
|
7
|
-
exports.removeCommas = removeCommas;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=e=>e.replace(/,/g,"");exports.removeCommas=o;
|
|
@@ -1,41 +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_isStringFloat = require("./isStringFloat.js");
|
|
6
|
-
const roundAmount = (amount, digits, addCommas) => {
|
|
7
|
-
const digitsToUse = digits ?? 4;
|
|
8
|
-
const cleanAmount = reactjs_utils_isStringFloat.isStringFloat(amount) ? amount : "0";
|
|
9
|
-
const bnAmount = new BigNumber(cleanAmount);
|
|
10
|
-
if (bnAmount.isZero()) {
|
|
11
|
-
return "0";
|
|
12
|
-
}
|
|
13
|
-
if (bnAmount.isInteger()) {
|
|
14
|
-
return addCommas ? bnAmount.toFormat(digitsToUse, BigNumber.ROUND_FLOOR) : bnAmount.toFixed(digitsToUse);
|
|
15
|
-
}
|
|
16
|
-
const numStr = bnAmount.toFixed();
|
|
17
|
-
const [intPart, decPart] = numStr.split(".");
|
|
18
|
-
if (!decPart) {
|
|
19
|
-
return intPart;
|
|
20
|
-
}
|
|
21
|
-
let nonZeroCount = 0;
|
|
22
|
-
let resultDecPart = "";
|
|
23
|
-
for (let i = 0; i < decPart.length; i++) {
|
|
24
|
-
if (digitsToUse === 0) {
|
|
25
|
-
break;
|
|
26
|
-
}
|
|
27
|
-
resultDecPart += decPart[i];
|
|
28
|
-
if (decPart[i] !== "0" || nonZeroCount > 0) {
|
|
29
|
-
nonZeroCount++;
|
|
30
|
-
}
|
|
31
|
-
if (nonZeroCount === digitsToUse) {
|
|
32
|
-
break;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
let resultIntPart = intPart;
|
|
36
|
-
if (addCommas) {
|
|
37
|
-
resultIntPart = new BigNumber(intPart).toFormat(0, BigNumber.ROUND_FLOOR);
|
|
38
|
-
}
|
|
39
|
-
return resultIntPart + (resultDecPart ? "." + resultDecPart : "");
|
|
40
|
-
};
|
|
41
|
-
exports.roundAmount = roundAmount;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("bignumber.js"),b=require("./isStringFloat.js"),d=(l,f,c)=>{const e=f??4,g=b.isStringFloat(l)?l:"0",t=new o(g);if(t.isZero())return"0";if(t.isInteger())return c?t.toFormat(e,o.ROUND_FLOOR):t.toFixed(e);const F=t.toFixed(),[i,r]=F.split(".");if(!r)return i;let s=0,u="";for(let n=0;n<r.length&&!(e===0||(u+=r[n],(r[n]!=="0"||s>0)&&s++,s===e));n++);let a=i;return c&&(a=new o(i).toFormat(0,o.ROUND_FLOOR)),a+(u?"."+u:"")};exports.roundAmount=d;
|
|
@@ -1,40 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { isStringFloat } from "./isStringFloat.mjs";
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const bnAmount = new BigNumber(cleanAmount);
|
|
7
|
-
if (bnAmount.isZero()) {
|
|
1
|
+
import o from "bignumber.js";
|
|
2
|
+
import { isStringFloat as O } from "./isStringFloat.mjs";
|
|
3
|
+
const p = (f, m, l) => {
|
|
4
|
+
const r = m ?? 4, a = O(f) ? f : "0", t = new o(a);
|
|
5
|
+
if (t.isZero())
|
|
8
6
|
return "0";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
let resultDecPart = "";
|
|
20
|
-
for (let i = 0; i < decPart.length; i++) {
|
|
21
|
-
if (digitsToUse === 0) {
|
|
22
|
-
break;
|
|
23
|
-
}
|
|
24
|
-
resultDecPart += decPart[i];
|
|
25
|
-
if (decPart[i] !== "0" || nonZeroCount > 0) {
|
|
26
|
-
nonZeroCount++;
|
|
27
|
-
}
|
|
28
|
-
if (nonZeroCount === digitsToUse) {
|
|
29
|
-
break;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
let resultIntPart = intPart;
|
|
33
|
-
if (addCommas) {
|
|
34
|
-
resultIntPart = new BigNumber(intPart).toFormat(0, BigNumber.ROUND_FLOOR);
|
|
35
|
-
}
|
|
36
|
-
return resultIntPart + (resultDecPart ? "." + resultDecPart : "");
|
|
7
|
+
if (t.isInteger())
|
|
8
|
+
return l ? t.toFormat(r, o.ROUND_FLOOR) : t.toFixed(r);
|
|
9
|
+
const F = t.toFixed(), [i, e] = F.split(".");
|
|
10
|
+
if (!e)
|
|
11
|
+
return i;
|
|
12
|
+
let s = 0, u = "";
|
|
13
|
+
for (let n = 0; n < e.length && !(r === 0 || (u += e[n], (e[n] !== "0" || s > 0) && s++, s === r)); n++)
|
|
14
|
+
;
|
|
15
|
+
let c = i;
|
|
16
|
+
return l && (c = new o(i).toFormat(0, o.ROUND_FLOOR)), c + (u ? "." + u : "");
|
|
37
17
|
};
|
|
38
18
|
export {
|
|
39
|
-
roundAmount
|
|
19
|
+
p as roundAmount
|
|
40
20
|
};
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const testNumber = (value) => /^[+-]?\d+(\.\d+)?$/.test(value ?? "");
|
|
5
|
-
exports.testNumber = testNumber;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=e=>/^[+-]?\d+(\.\d+)?$/.test(e??"");exports.testNumber=t;
|
package/store/inMemoryStore.js
CHANGED
|
@@ -1,40 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
|
-
const _InMemoryStore = class _InMemoryStore {
|
|
8
|
-
constructor() {
|
|
9
|
-
__publicField(this, "store");
|
|
10
|
-
this.store = {};
|
|
11
|
-
}
|
|
12
|
-
static getInstance() {
|
|
13
|
-
if (!_InMemoryStore.instance) {
|
|
14
|
-
_InMemoryStore.instance = new _InMemoryStore();
|
|
15
|
-
}
|
|
16
|
-
return _InMemoryStore.instance;
|
|
17
|
-
}
|
|
18
|
-
setItem(key, value) {
|
|
19
|
-
this.store[key] = value;
|
|
20
|
-
}
|
|
21
|
-
getItem(key) {
|
|
22
|
-
return this.store.hasOwnProperty(key) ? this.store[key] : null;
|
|
23
|
-
}
|
|
24
|
-
removeItem(key) {
|
|
25
|
-
delete this.store[key];
|
|
26
|
-
}
|
|
27
|
-
clear() {
|
|
28
|
-
this.store = {};
|
|
29
|
-
}
|
|
30
|
-
get length() {
|
|
31
|
-
return Object.keys(this.store).length;
|
|
32
|
-
}
|
|
33
|
-
key(index) {
|
|
34
|
-
const keys = Object.keys(this.store);
|
|
35
|
-
return keys[index] || null;
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
__publicField(_InMemoryStore, "instance");
|
|
39
|
-
let InMemoryStore = _InMemoryStore;
|
|
40
|
-
exports.InMemoryStore = InMemoryStore;
|
|
2
|
+
"use strict";var o=Object.defineProperty;var c=(n,t,e)=>t in n?o(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var r=(n,t,e)=>c(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=class s{constructor(){r(this,"store");this.store={}}static getInstance(){return s.instance||(s.instance=new s),s.instance}setItem(t,e){this.store[t]=e}getItem(t){return this.store.hasOwnProperty(t)?this.store[t]:null}removeItem(t){delete this.store[t]}clear(){this.store={}}get length(){return Object.keys(this.store).length}key(t){return Object.keys(this.store)[t]||null}};r(s,"instance");let i=s;exports.InMemoryStore=i;
|
package/store/inMemoryStore.mjs
CHANGED
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var h = (n, t, e) => t in n ? c(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var r = (n, t, e) => h(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
const s = class s {
|
|
5
5
|
constructor() {
|
|
6
|
-
|
|
6
|
+
r(this, "store");
|
|
7
7
|
this.store = {};
|
|
8
8
|
}
|
|
9
9
|
static getInstance() {
|
|
10
|
-
|
|
11
|
-
_InMemoryStore.instance = new _InMemoryStore();
|
|
12
|
-
}
|
|
13
|
-
return _InMemoryStore.instance;
|
|
10
|
+
return s.instance || (s.instance = new s()), s.instance;
|
|
14
11
|
}
|
|
15
|
-
setItem(
|
|
16
|
-
this.store[
|
|
12
|
+
setItem(t, e) {
|
|
13
|
+
this.store[t] = e;
|
|
17
14
|
}
|
|
18
|
-
getItem(
|
|
19
|
-
return this.store.hasOwnProperty(
|
|
15
|
+
getItem(t) {
|
|
16
|
+
return this.store.hasOwnProperty(t) ? this.store[t] : null;
|
|
20
17
|
}
|
|
21
|
-
removeItem(
|
|
22
|
-
delete this.store[
|
|
18
|
+
removeItem(t) {
|
|
19
|
+
delete this.store[t];
|
|
23
20
|
}
|
|
24
21
|
clear() {
|
|
25
22
|
this.store = {};
|
|
@@ -27,13 +24,12 @@ const _InMemoryStore = class _InMemoryStore {
|
|
|
27
24
|
get length() {
|
|
28
25
|
return Object.keys(this.store).length;
|
|
29
26
|
}
|
|
30
|
-
key(
|
|
31
|
-
|
|
32
|
-
return keys[index] || null;
|
|
27
|
+
key(t) {
|
|
28
|
+
return Object.keys(this.store)[t] || null;
|
|
33
29
|
}
|
|
34
30
|
};
|
|
35
|
-
|
|
36
|
-
let
|
|
31
|
+
r(s, "instance");
|
|
32
|
+
let i = s;
|
|
37
33
|
export {
|
|
38
|
-
InMemoryStore
|
|
34
|
+
i as InMemoryStore
|
|
39
35
|
};
|