@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/init/init.js
CHANGED
|
@@ -1,140 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const networks = require("@reown/appkit/networks");
|
|
5
|
-
const react = require("@reown/appkit/react");
|
|
6
|
-
const appkitAdapterWagmi = require("@reown/appkit-adapter-wagmi");
|
|
7
|
-
const viemNetworks = require("viem/chains");
|
|
8
|
-
const constants_index = require("../../constants/index.js");
|
|
9
|
-
const store_inMemoryStore = require("../../store/inMemoryStore.js");
|
|
10
|
-
const reactjs_adapters_SuiAdapter = require("../adapters/SuiAdapter.js");
|
|
11
|
-
function _interopNamespaceDefault(e) {
|
|
12
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
13
|
-
if (e) {
|
|
14
|
-
for (const k in e) {
|
|
15
|
-
if (k !== "default") {
|
|
16
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
17
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: () => e[k]
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
n.default = e;
|
|
25
|
-
return Object.freeze(n);
|
|
26
|
-
}
|
|
27
|
-
const viemNetworks__namespace = /* @__PURE__ */ _interopNamespaceDefault(viemNetworks);
|
|
28
|
-
const suiMainnet = networks.defineChain({
|
|
29
|
-
id: "mainnet",
|
|
30
|
-
name: "SUI Mainnet",
|
|
31
|
-
nativeCurrency: { name: "SUI", symbol: "SUI", decimals: 9 },
|
|
32
|
-
rpcUrls: {
|
|
33
|
-
default: { http: ["https://fullnode.mainnet.sui.io:443"] }
|
|
34
|
-
},
|
|
35
|
-
blockExplorers: {
|
|
36
|
-
default: { name: "SUI Explorer", url: "https://explorer.sui.io/" }
|
|
37
|
-
},
|
|
38
|
-
chainNamespace: "sui",
|
|
39
|
-
caipNetworkId: "sui:mainnet"
|
|
40
|
-
});
|
|
41
|
-
const suiTestnet = networks.defineChain({
|
|
42
|
-
id: "testnet",
|
|
43
|
-
name: "SUI Testnet",
|
|
44
|
-
nativeCurrency: { name: "SUI", symbol: "SUI", decimals: 9 },
|
|
45
|
-
rpcUrls: {
|
|
46
|
-
default: { http: ["https://fullnode.testnet.sui.io:443"] }
|
|
47
|
-
},
|
|
48
|
-
blockExplorers: {
|
|
49
|
-
default: {
|
|
50
|
-
name: "SUI Explorer",
|
|
51
|
-
url: "https://explorer.sui.io/?network=testnet"
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
chainNamespace: "sui",
|
|
55
|
-
caipNetworkId: "sui:testnet"
|
|
56
|
-
});
|
|
57
|
-
const suiDevnet = networks.defineChain({
|
|
58
|
-
id: "devnet",
|
|
59
|
-
name: "SUI Devnet",
|
|
60
|
-
nativeCurrency: { name: "SUI", symbol: "SUI", decimals: 9 },
|
|
61
|
-
rpcUrls: {
|
|
62
|
-
default: { http: ["https://fullnode.devnet.sui.io:443"] }
|
|
63
|
-
},
|
|
64
|
-
blockExplorers: {
|
|
65
|
-
default: {
|
|
66
|
-
name: "SUI Explorer",
|
|
67
|
-
url: "https://explorer.sui.io/?network=devnet"
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
chainNamespace: "sui",
|
|
71
|
-
caipNetworkId: "sui:devnet"
|
|
72
|
-
});
|
|
73
|
-
const suiNetworkDefinitions = {
|
|
74
|
-
mainnet: suiMainnet,
|
|
75
|
-
testnet: suiTestnet,
|
|
76
|
-
devnet: suiDevnet
|
|
77
|
-
};
|
|
78
|
-
var SuiMethods = /* @__PURE__ */ ((SuiMethods2) => {
|
|
79
|
-
SuiMethods2["SIGN_TRANSACTION"] = "sui_signTransaction";
|
|
80
|
-
SuiMethods2["SIGN_AND_EXECUTE_TRANSACTION"] = "sui_signAndExecuteTransaction";
|
|
81
|
-
SuiMethods2["SIGN_PERSONAL_MESSAGE"] = "sui_signPersonalMessage";
|
|
82
|
-
return SuiMethods2;
|
|
83
|
-
})(SuiMethods || {});
|
|
84
|
-
async function init(options) {
|
|
85
|
-
var _a, _b, _c, _d;
|
|
86
|
-
const store = store_inMemoryStore.InMemoryStore.getInstance();
|
|
87
|
-
store.setItem("apiURL", options.apiURL);
|
|
88
|
-
store.setItem("bridgeURL", options.bridgeURL);
|
|
89
|
-
store.setItem("mvxApiURL", options.mvxApiURL);
|
|
90
|
-
store.setItem("mvxExplorerAddress", options.mvxExplorerAddress);
|
|
91
|
-
store.setItem("mvxChainId", options.mvxChainId);
|
|
92
|
-
const networks$1 = { ...viemNetworks__namespace };
|
|
93
|
-
const acceptedNetworks = Object.values(networks$1).filter(
|
|
94
|
-
(chain) => options.acceptedChainIDs.includes(chain.id.toString()) && !constants_index.MVX_CHAIN_IDS.includes(chain.id.toString())
|
|
95
|
-
).map((network) => network);
|
|
96
|
-
const supportedChains = [
|
|
97
|
-
networks.mainnet,
|
|
98
|
-
networks.bsc,
|
|
99
|
-
networks.bscTestnet,
|
|
100
|
-
...acceptedNetworks
|
|
101
|
-
];
|
|
102
|
-
const allNetworks = [...supportedChains];
|
|
103
|
-
if (options.suiEnvironment) {
|
|
104
|
-
const suiNetwork = suiNetworkDefinitions[options.suiEnvironment];
|
|
105
|
-
allNetworks.push(suiNetwork);
|
|
106
|
-
}
|
|
107
|
-
const wagmiAdapter = new appkitAdapterWagmi.WagmiAdapter({
|
|
108
|
-
...options.adapterConfig,
|
|
109
|
-
ssr: options.adapterConfig.ssr ?? true,
|
|
110
|
-
projectId: options.appKitOptions.projectId,
|
|
111
|
-
networks: supportedChains
|
|
112
|
-
});
|
|
113
|
-
const adapters = [wagmiAdapter];
|
|
114
|
-
if (options.suiEnvironment) {
|
|
115
|
-
const suiNetwork = suiNetworkDefinitions[options.suiEnvironment];
|
|
116
|
-
const explicitSuiCaip = suiNetwork.caipNetworkId ?? `sui:${suiNetwork.id}`;
|
|
117
|
-
adapters.push(new reactjs_adapters_SuiAdapter.SuiAdapter({ explicitCaipChains: [explicitSuiCaip] }));
|
|
118
|
-
}
|
|
119
|
-
const appKit = react.createAppKit({
|
|
120
|
-
...options.appKitOptions,
|
|
121
|
-
adapters,
|
|
122
|
-
networks: [allNetworks[0], ...allNetworks.slice(1)]
|
|
123
|
-
});
|
|
124
|
-
await appKit.ready();
|
|
125
|
-
if (options.suiEnvironment) {
|
|
126
|
-
const wc = await appKit.getUniversalProvider();
|
|
127
|
-
const suiNs = (_b = (_a = wc == null ? void 0 : wc.session) == null ? void 0 : _a.namespaces) == null ? void 0 : _b["sui"];
|
|
128
|
-
if (((_c = suiNs == null ? void 0 : suiNs.accounts) == null ? void 0 : _c.length) && !appKit.getCaipAddress("sui")) {
|
|
129
|
-
await ((_d = appKit.syncWalletConnectAccount) == null ? void 0 : _d.call(appKit));
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
return {
|
|
133
|
-
config: wagmiAdapter.wagmiConfig,
|
|
134
|
-
appKit,
|
|
135
|
-
options,
|
|
136
|
-
supportedChains: allNetworks
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
exports.SuiMethods = SuiMethods;
|
|
140
|
-
exports.init = init;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@reown/appkit/networks"),x=require("@reown/appkit/react"),w=require("@reown/appkit-adapter-wagmi"),N=require("viem/chains"),C=require("../../constants/index.js"),U=require("../../store/inMemoryStore.js"),h=require("../adapters/SuiAdapter.js");function k(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const c=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,c.get?c:{enumerable:!0,get:()=>e[i]})}}return n.default=e,Object.freeze(n)}const b=k(N),E=a.defineChain({id:"mainnet",name:"SUI Mainnet",nativeCurrency:{name:"SUI",symbol:"SUI",decimals:9},rpcUrls:{default:{http:["https://fullnode.mainnet.sui.io:443"]}},blockExplorers:{default:{name:"SUI Explorer",url:"https://explorer.sui.io/"}},chainNamespace:"sui",caipNetworkId:"sui:mainnet"}),_=a.defineChain({id:"testnet",name:"SUI Testnet",nativeCurrency:{name:"SUI",symbol:"SUI",decimals:9},rpcUrls:{default:{http:["https://fullnode.testnet.sui.io:443"]}},blockExplorers:{default:{name:"SUI Explorer",url:"https://explorer.sui.io/?network=testnet"}},chainNamespace:"sui",caipNetworkId:"sui:testnet"}),y=a.defineChain({id:"devnet",name:"SUI Devnet",nativeCurrency:{name:"SUI",symbol:"SUI",decimals:9},rpcUrls:{default:{http:["https://fullnode.devnet.sui.io:443"]}},blockExplorers:{default:{name:"SUI Explorer",url:"https://explorer.sui.io/?network=devnet"}},chainNamespace:"sui",caipNetworkId:"sui:devnet"}),v={mainnet:E,testnet:_,devnet:y};var g=(e=>(e.SIGN_TRANSACTION="sui_signTransaction",e.SIGN_AND_EXECUTE_TRANSACTION="sui_signAndExecuteTransaction",e.SIGN_PERSONAL_MESSAGE="sui_signPersonalMessage",e))(g||{});async function O(e){var p,m,S,f,I;const n=U.InMemoryStore.getInstance();n.setItem("apiURL",e.apiURL),n.setItem("bridgeURL",e.bridgeURL),n.setItem("mvxApiURL",e.mvxApiURL),n.setItem("mvxExplorerAddress",e.mvxExplorerAddress),n.setItem("mvxChainId",e.mvxChainId);const i={...b},c=Object.values(i).filter(t=>e.acceptedChainIDs.includes(t.id.toString())&&!C.MVX_CHAIN_IDS.includes(t.id.toString())).map(t=>t),o=[a.mainnet,a.bsc,a.bscTestnet,...c],u=[...o];if(e.suiEnvironment){const t=v[e.suiEnvironment];u.push(t)}const d=new w.WagmiAdapter({...e.adapterConfig,ssr:e.adapterConfig.ssr??!0,projectId:e.appKitOptions.projectId,networks:o}),l=[d];if(e.suiEnvironment){const t=v[e.suiEnvironment],r=t.caipNetworkId??`sui:${t.id}`;l.push(new h.SuiAdapter({explicitCaipChains:[r],expectedSuiAddress:e.expectedSuiAddress}))}const s=x.createAppKit({...e.appKitOptions,adapters:l,networks:[u[0],...u.slice(1)]});if(await s.ready(),e.suiEnvironment){const t=await s.getUniversalProvider(),r=(m=(p=t==null?void 0:t.session)==null?void 0:p.namespaces)==null?void 0:m.sui;if((S=r==null?void 0:r.accounts)!=null&&S.length&&!s.getCaipAddress("sui")){const A=(f=r.accounts[0])==null?void 0:f.split(":").pop();(!e.expectedSuiAddress||A===e.expectedSuiAddress)&&await((I=s.syncWalletConnectAccount)==null?void 0:I.call(s))}}return{config:d.wagmiConfig,appKit:s,options:e,supportedChains:u}}exports.SuiMethods=g;exports.init=O;
|
package/reactjs/init/init.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineChain, mainnet, bsc, bscTestnet } from "@reown/appkit/networks";
|
|
2
|
-
import { createAppKit } from "@reown/appkit/react";
|
|
3
|
-
import { WagmiAdapter } from "@reown/appkit-adapter-wagmi";
|
|
4
|
-
import * as
|
|
5
|
-
import { MVX_CHAIN_IDS } from "../../constants/index.mjs";
|
|
6
|
-
import { InMemoryStore } from "../../store/inMemoryStore.mjs";
|
|
7
|
-
import { SuiAdapter } from "../adapters/SuiAdapter.mjs";
|
|
8
|
-
const
|
|
1
|
+
import { defineChain as a, mainnet as A, bsc as U, bscTestnet as N } from "@reown/appkit/networks";
|
|
2
|
+
import { createAppKit as w } from "@reown/appkit/react";
|
|
3
|
+
import { WagmiAdapter as C } from "@reown/appkit-adapter-wagmi";
|
|
4
|
+
import * as E from "viem/chains";
|
|
5
|
+
import { MVX_CHAIN_IDS as g } from "../../constants/index.mjs";
|
|
6
|
+
import { InMemoryStore as h } from "../../store/inMemoryStore.mjs";
|
|
7
|
+
import { SuiAdapter as k } from "../adapters/SuiAdapter.mjs";
|
|
8
|
+
const b = a({
|
|
9
9
|
id: "mainnet",
|
|
10
10
|
name: "SUI Mainnet",
|
|
11
11
|
nativeCurrency: { name: "SUI", symbol: "SUI", decimals: 9 },
|
|
@@ -17,8 +17,7 @@ const suiMainnet = defineChain({
|
|
|
17
17
|
},
|
|
18
18
|
chainNamespace: "sui",
|
|
19
19
|
caipNetworkId: "sui:mainnet"
|
|
20
|
-
})
|
|
21
|
-
const suiTestnet = defineChain({
|
|
20
|
+
}), _ = a({
|
|
22
21
|
id: "testnet",
|
|
23
22
|
name: "SUI Testnet",
|
|
24
23
|
nativeCurrency: { name: "SUI", symbol: "SUI", decimals: 9 },
|
|
@@ -33,8 +32,7 @@ const suiTestnet = defineChain({
|
|
|
33
32
|
},
|
|
34
33
|
chainNamespace: "sui",
|
|
35
34
|
caipNetworkId: "sui:testnet"
|
|
36
|
-
})
|
|
37
|
-
const suiDevnet = defineChain({
|
|
35
|
+
}), y = a({
|
|
38
36
|
id: "devnet",
|
|
39
37
|
name: "SUI Devnet",
|
|
40
38
|
nativeCurrency: { name: "SUI", symbol: "SUI", decimals: 9 },
|
|
@@ -49,74 +47,63 @@ const suiDevnet = defineChain({
|
|
|
49
47
|
},
|
|
50
48
|
chainNamespace: "sui",
|
|
51
49
|
caipNetworkId: "sui:devnet"
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
devnet: suiDevnet
|
|
50
|
+
}), f = {
|
|
51
|
+
mainnet: b,
|
|
52
|
+
testnet: _,
|
|
53
|
+
devnet: y
|
|
57
54
|
};
|
|
58
|
-
var
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
(chain) => options.acceptedChainIDs.includes(chain.id.toString()) && !MVX_CHAIN_IDS.includes(chain.id.toString())
|
|
75
|
-
).map((network) => network);
|
|
76
|
-
const supportedChains = [
|
|
77
|
-
mainnet,
|
|
78
|
-
bsc,
|
|
79
|
-
bscTestnet,
|
|
80
|
-
...acceptedNetworks
|
|
81
|
-
];
|
|
82
|
-
const allNetworks = [...supportedChains];
|
|
83
|
-
if (options.suiEnvironment) {
|
|
84
|
-
const suiNetwork = suiNetworkDefinitions[options.suiEnvironment];
|
|
85
|
-
allNetworks.push(suiNetwork);
|
|
55
|
+
var T = /* @__PURE__ */ ((e) => (e.SIGN_TRANSACTION = "sui_signTransaction", e.SIGN_AND_EXECUTE_TRANSACTION = "sui_signAndExecuteTransaction", e.SIGN_PERSONAL_MESSAGE = "sui_signPersonalMessage", e))(T || {});
|
|
56
|
+
async function j(e) {
|
|
57
|
+
var u, m, p, l, I;
|
|
58
|
+
const n = h.getInstance();
|
|
59
|
+
n.setItem("apiURL", e.apiURL), n.setItem("bridgeURL", e.bridgeURL), n.setItem("mvxApiURL", e.mvxApiURL), n.setItem("mvxExplorerAddress", e.mvxExplorerAddress), n.setItem("mvxChainId", e.mvxChainId);
|
|
60
|
+
const S = { ...E }, v = Object.values(S).filter(
|
|
61
|
+
(t) => e.acceptedChainIDs.includes(t.id.toString()) && !g.includes(t.id.toString())
|
|
62
|
+
).map((t) => t), c = [
|
|
63
|
+
A,
|
|
64
|
+
U,
|
|
65
|
+
N,
|
|
66
|
+
...v
|
|
67
|
+
], r = [...c];
|
|
68
|
+
if (e.suiEnvironment) {
|
|
69
|
+
const t = f[e.suiEnvironment];
|
|
70
|
+
r.push(t);
|
|
86
71
|
}
|
|
87
|
-
const
|
|
88
|
-
...
|
|
89
|
-
ssr:
|
|
90
|
-
projectId:
|
|
91
|
-
networks:
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
72
|
+
const o = new C({
|
|
73
|
+
...e.adapterConfig,
|
|
74
|
+
ssr: e.adapterConfig.ssr ?? !0,
|
|
75
|
+
projectId: e.appKitOptions.projectId,
|
|
76
|
+
networks: c
|
|
77
|
+
}), d = [o];
|
|
78
|
+
if (e.suiEnvironment) {
|
|
79
|
+
const t = f[e.suiEnvironment], i = t.caipNetworkId ?? `sui:${t.id}`;
|
|
80
|
+
d.push(
|
|
81
|
+
new k({
|
|
82
|
+
explicitCaipChains: [i],
|
|
83
|
+
expectedSuiAddress: e.expectedSuiAddress
|
|
84
|
+
})
|
|
85
|
+
);
|
|
98
86
|
}
|
|
99
|
-
const
|
|
100
|
-
...
|
|
101
|
-
adapters,
|
|
102
|
-
networks: [
|
|
87
|
+
const s = w({
|
|
88
|
+
...e.appKitOptions,
|
|
89
|
+
adapters: d,
|
|
90
|
+
networks: [r[0], ...r.slice(1)]
|
|
103
91
|
});
|
|
104
|
-
await
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
await ((_d = appKit.syncWalletConnectAccount) == null ? void 0 : _d.call(appKit));
|
|
92
|
+
if (await s.ready(), e.suiEnvironment) {
|
|
93
|
+
const t = await s.getUniversalProvider(), i = (m = (u = t == null ? void 0 : t.session) == null ? void 0 : u.namespaces) == null ? void 0 : m.sui;
|
|
94
|
+
if ((p = i == null ? void 0 : i.accounts) != null && p.length && !s.getCaipAddress("sui")) {
|
|
95
|
+
const x = (l = i.accounts[0]) == null ? void 0 : l.split(":").pop();
|
|
96
|
+
(!e.expectedSuiAddress || x === e.expectedSuiAddress) && await ((I = s.syncWalletConnectAccount) == null ? void 0 : I.call(s));
|
|
110
97
|
}
|
|
111
98
|
}
|
|
112
99
|
return {
|
|
113
|
-
config:
|
|
114
|
-
appKit,
|
|
115
|
-
options,
|
|
116
|
-
supportedChains:
|
|
100
|
+
config: o.wagmiConfig,
|
|
101
|
+
appKit: s,
|
|
102
|
+
options: e,
|
|
103
|
+
supportedChains: r
|
|
117
104
|
};
|
|
118
105
|
}
|
|
119
106
|
export {
|
|
120
|
-
SuiMethods,
|
|
121
|
-
init
|
|
107
|
+
T as SuiMethods,
|
|
108
|
+
j as init
|
|
122
109
|
};
|
package/reactjs/queries/index.js
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const reactjs_queries_useGetAllTokens_query = require("./useGetAllTokens.query.js");
|
|
5
|
-
const reactjs_queries_useGetChains_query = require("./useGetChains.query.js");
|
|
6
|
-
const reactjs_queries_useGetNonMvxTokensBalances_query = require("./useGetNonMvxTokensBalances.query.js");
|
|
7
|
-
const reactjs_queries_useGetHistory_query = require("./useGetHistory.query.js");
|
|
8
|
-
const reactjs_queries_useGetMvxTokensBalances_query = require("./useGetMvxTokensBalances.query.js");
|
|
9
|
-
const reactjs_queries_useGetRate_mutation = require("./useGetRate.mutation.js");
|
|
10
|
-
exports.useGetAllTokensQuery = reactjs_queries_useGetAllTokens_query.useGetAllTokensQuery;
|
|
11
|
-
exports.useGetChainsQuery = reactjs_queries_useGetChains_query.useGetChainsQuery;
|
|
12
|
-
exports.invalidateEvmTokensBalances = reactjs_queries_useGetNonMvxTokensBalances_query.invalidateEvmTokensBalances;
|
|
13
|
-
exports.useGetNonMvxTokensBalancesQuery = reactjs_queries_useGetNonMvxTokensBalances_query.useGetNonMvxTokensBalancesQuery;
|
|
14
|
-
exports.invalidateHistoryQuery = reactjs_queries_useGetHistory_query.invalidateHistoryQuery;
|
|
15
|
-
exports.useGetHistoryQuery = reactjs_queries_useGetHistory_query.useGetHistoryQuery;
|
|
16
|
-
exports.invalidateMvxTokensBalancesQuery = reactjs_queries_useGetMvxTokensBalances_query.invalidateMvxTokensBalancesQuery;
|
|
17
|
-
exports.useGetMvxTokensBalancesQuery = reactjs_queries_useGetMvxTokensBalances_query.useGetMvxTokensBalancesQuery;
|
|
18
|
-
exports.useGetRateMutation = reactjs_queries_useGetRate_mutation.useGetRateMutation;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./useGetAllTokens.query.js"),r=require("./useGetChains.query.js"),e=require("./useGetNonMvxTokensBalances.query.js"),s=require("./useGetHistory.query.js"),u=require("./useGetMvxTokensBalances.query.js"),a=require("./useGetRate.mutation.js");exports.useGetAllTokensQuery=t.useGetAllTokensQuery;exports.useGetChainsQuery=r.useGetChainsQuery;exports.useGetNonMvxTokensBalancesQuery=e.useGetNonMvxTokensBalancesQuery;exports.useInvalidateEvmTokensBalances=e.useInvalidateEvmTokensBalances;exports.useGetHistoryQuery=s.useGetHistoryQuery;exports.useInvalidateHistoryQuery=s.useInvalidateHistoryQuery;exports.useGetMvxTokensBalancesQuery=u.useGetMvxTokensBalancesQuery;exports.useInvalidateMvxTokensBalancesQuery=u.useInvalidateMvxTokensBalancesQuery;exports.useGetRateMutation=a.useGetRateMutation;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { useGetAllTokensQuery } from "./useGetAllTokens.query.mjs";
|
|
2
|
-
import { useGetChainsQuery } from "./useGetChains.query.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useGetRateMutation } from "./useGetRate.mutation.mjs";
|
|
1
|
+
import { useGetAllTokensQuery as r } from "./useGetAllTokens.query.mjs";
|
|
2
|
+
import { useGetChainsQuery as t } from "./useGetChains.query.mjs";
|
|
3
|
+
import { useGetNonMvxTokensBalancesQuery as u, useInvalidateEvmTokensBalances as n } from "./useGetNonMvxTokensBalances.query.mjs";
|
|
4
|
+
import { useGetHistoryQuery as x, useInvalidateHistoryQuery as y } from "./useGetHistory.query.mjs";
|
|
5
|
+
import { useGetMvxTokensBalancesQuery as m, useInvalidateMvxTokensBalancesQuery as v } from "./useGetMvxTokensBalances.query.mjs";
|
|
6
|
+
import { useGetRateMutation as f } from "./useGetRate.mutation.mjs";
|
|
7
7
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
r as useGetAllTokensQuery,
|
|
9
|
+
t as useGetChainsQuery,
|
|
10
|
+
x as useGetHistoryQuery,
|
|
11
|
+
m as useGetMvxTokensBalancesQuery,
|
|
12
|
+
u as useGetNonMvxTokensBalancesQuery,
|
|
13
|
+
f as useGetRateMutation,
|
|
14
|
+
n as useInvalidateEvmTokensBalances,
|
|
15
|
+
y as useInvalidateHistoryQuery,
|
|
16
|
+
v as useInvalidateMvxTokensBalancesQuery
|
|
17
17
|
};
|
|
@@ -1,40 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const react = require("@reown/appkit/react");
|
|
5
|
-
const reactQuery = require("@tanstack/react-query");
|
|
6
|
-
const api_checkAccount = require("../../api/checkAccount.js");
|
|
7
|
-
const helpers_getApiURL = require("../../helpers/getApiURL.js");
|
|
8
|
-
const reactjs_context_useWeb3App = require("../context/useWeb3App.js");
|
|
9
|
-
const reactjs_hooks_useBridgeApiChainId = require("../hooks/useBridgeApiChainId.js");
|
|
10
|
-
const useCheckAccountQuery = () => {
|
|
11
|
-
const { address } = react.useAppKitAccount();
|
|
12
|
-
const bridgeApiChainId = reactjs_hooks_useBridgeApiChainId.useBridgeApiChainId();
|
|
13
|
-
const { nativeAuthToken } = reactjs_context_useWeb3App.useWeb3App();
|
|
14
|
-
const queryFn = async () => {
|
|
15
|
-
try {
|
|
16
|
-
const { data } = await api_checkAccount.checkAccount({
|
|
17
|
-
url: helpers_getApiURL.getApiURL(),
|
|
18
|
-
walletAddress: address ?? "",
|
|
19
|
-
chainId: bridgeApiChainId ?? "",
|
|
20
|
-
nativeAuthToken
|
|
21
|
-
});
|
|
22
|
-
return data;
|
|
23
|
-
} catch (error) {
|
|
24
|
-
throw error;
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
const retry = (_failureCount, error) => {
|
|
28
|
-
var _a;
|
|
29
|
-
return ((_a = error.response) == null ? void 0 : _a.status) === 404;
|
|
30
|
-
};
|
|
31
|
-
return reactQuery.useQuery({
|
|
32
|
-
queryKey: ["check-account", address, bridgeApiChainId, nativeAuthToken],
|
|
33
|
-
queryFn,
|
|
34
|
-
retry,
|
|
35
|
-
refetchOnWindowFocus: false,
|
|
36
|
-
gcTime: 5 * 60 * 1e3,
|
|
37
|
-
staleTime: 0
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
exports.useCheckAccountQuery = useCheckAccountQuery;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@reown/appkit/react"),a=require("@tanstack/react-query"),d=require("../../api/checkAccount.js"),h=require("../../helpers/getApiURL.js"),p=require("../context/useWeb3App.js"),A=require("../hooks/useBridgeApiChainId.js"),y=()=>{const{address:t}=i.useAppKitAccount(),r=A.useBridgeApiChainId(),{nativeAuthToken:n}=p.useWeb3App(),s=async()=>{try{const{data:e}=await d.checkAccount({url:h.getApiURL(),walletAddress:t??"",chainId:r??"",nativeAuthToken:n});return e}catch(e){throw e}},u=(e,o)=>{var c;return((c=o.response)==null?void 0:c.status)===404};return a.useQuery({queryKey:["check-account",t,r],queryFn:s,retry:u,refetchOnWindowFocus:!1,gcTime:5*60*1e3,staleTime:0})};exports.useCheckAccountQuery=y;
|
|
@@ -1,39 +1,35 @@
|
|
|
1
|
-
import { useAppKitAccount } from "@reown/appkit/react";
|
|
2
|
-
import { useQuery } from "@tanstack/react-query";
|
|
3
|
-
import { checkAccount } from "../../api/checkAccount.mjs";
|
|
4
|
-
import { getApiURL } from "../../helpers/getApiURL.mjs";
|
|
5
|
-
import { useWeb3App } from "../context/useWeb3App.mjs";
|
|
6
|
-
import { useBridgeApiChainId } from "../hooks/useBridgeApiChainId.mjs";
|
|
7
|
-
const
|
|
8
|
-
const { address } =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
queryKey: ["check-account", address, bridgeApiChainId, nativeAuthToken],
|
|
30
|
-
queryFn,
|
|
31
|
-
retry,
|
|
32
|
-
refetchOnWindowFocus: false,
|
|
1
|
+
import { useAppKitAccount as s } from "@reown/appkit/react";
|
|
2
|
+
import { useQuery as u } from "@tanstack/react-query";
|
|
3
|
+
import { checkAccount as i } from "../../api/checkAccount.mjs";
|
|
4
|
+
import { getApiURL as a } from "../../helpers/getApiURL.mjs";
|
|
5
|
+
import { useWeb3App as p } from "../context/useWeb3App.mjs";
|
|
6
|
+
import { useBridgeApiChainId as m } from "../hooks/useBridgeApiChainId.mjs";
|
|
7
|
+
const w = () => {
|
|
8
|
+
const { address: e } = s(), t = m(), { nativeAuthToken: c } = p();
|
|
9
|
+
return u({
|
|
10
|
+
queryKey: ["check-account", e, t],
|
|
11
|
+
queryFn: async () => {
|
|
12
|
+
try {
|
|
13
|
+
const { data: r } = await i({
|
|
14
|
+
url: a(),
|
|
15
|
+
walletAddress: e ?? "",
|
|
16
|
+
chainId: t ?? "",
|
|
17
|
+
nativeAuthToken: c
|
|
18
|
+
});
|
|
19
|
+
return r;
|
|
20
|
+
} catch (r) {
|
|
21
|
+
throw r;
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
retry: (r, n) => {
|
|
25
|
+
var o;
|
|
26
|
+
return ((o = n.response) == null ? void 0 : o.status) === 404;
|
|
27
|
+
},
|
|
28
|
+
refetchOnWindowFocus: !1,
|
|
33
29
|
gcTime: 5 * 60 * 1e3,
|
|
34
30
|
staleTime: 0
|
|
35
31
|
});
|
|
36
32
|
};
|
|
37
33
|
export {
|
|
38
|
-
useCheckAccountQuery
|
|
34
|
+
w as useCheckAccountQuery
|
|
39
35
|
};
|
|
@@ -1,36 +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_getTokens = require("../../api/getTokens.js");
|
|
6
|
-
const helpers_getApiURL = require("../../helpers/getApiURL.js");
|
|
7
|
-
const useGetAllTokensQuery = ({
|
|
8
|
-
nativeAuthToken,
|
|
9
|
-
bridgeOnly = true
|
|
10
|
-
}) => {
|
|
11
|
-
const queryFn = async () => {
|
|
12
|
-
try {
|
|
13
|
-
const { data } = await api_getTokens.getTokens({
|
|
14
|
-
url: helpers_getApiURL.getApiURL(),
|
|
15
|
-
nativeAuthToken: nativeAuthToken ?? "",
|
|
16
|
-
bridgeOnly: Boolean(bridgeOnly)
|
|
17
|
-
});
|
|
18
|
-
return data;
|
|
19
|
-
} catch (error) {
|
|
20
|
-
throw error;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
const retry = (_failureCount, error) => {
|
|
24
|
-
var _a;
|
|
25
|
-
return ((_a = error.response) == null ? void 0 : _a.status) === 404;
|
|
26
|
-
};
|
|
27
|
-
return reactQuery.useQuery({
|
|
28
|
-
queryKey: ["all-tokens", nativeAuthToken],
|
|
29
|
-
queryFn,
|
|
30
|
-
retry,
|
|
31
|
-
refetchOnWindowFocus: false,
|
|
32
|
-
gcTime: 5 * 60 * 1e3,
|
|
33
|
-
staleTime: 0
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
exports.useGetAllTokensQuery = useGetAllTokensQuery;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@tanstack/react-query"),c=require("../../api/getTokens.js"),i=require("../../helpers/getApiURL.js"),l=({nativeAuthToken:n,bridgeOnly:t=!0})=>{const s=async()=>{try{const{data:e}=await c.getTokens({url:i.getApiURL(),nativeAuthToken:n??"",bridgeOnly:!!t});return e}catch(e){throw e}},o=(e,u)=>{var r;return((r=u.response)==null?void 0:r.status)===404};return a.useQuery({queryKey:["all-tokens",t],queryFn:s,retry:o,refetchOnWindowFocus:!1,gcTime:5*60*1e3,staleTime:0})};exports.useGetAllTokensQuery=l;
|
|
@@ -1,35 +1,31 @@
|
|
|
1
|
-
import { useQuery } from "@tanstack/react-query";
|
|
2
|
-
import { getTokens } from "../../api/getTokens.mjs";
|
|
3
|
-
import { getApiURL } from "../../helpers/getApiURL.mjs";
|
|
4
|
-
const
|
|
5
|
-
nativeAuthToken,
|
|
6
|
-
bridgeOnly =
|
|
7
|
-
}) => {
|
|
8
|
-
|
|
1
|
+
import { useQuery as s } from "@tanstack/react-query";
|
|
2
|
+
import { getTokens as u } from "../../api/getTokens.mjs";
|
|
3
|
+
import { getApiURL as a } from "../../helpers/getApiURL.mjs";
|
|
4
|
+
const f = ({
|
|
5
|
+
nativeAuthToken: o,
|
|
6
|
+
bridgeOnly: r = !0
|
|
7
|
+
}) => s({
|
|
8
|
+
queryKey: ["all-tokens", r],
|
|
9
|
+
queryFn: async () => {
|
|
9
10
|
try {
|
|
10
|
-
const { data } = await
|
|
11
|
-
url:
|
|
12
|
-
nativeAuthToken:
|
|
13
|
-
bridgeOnly:
|
|
11
|
+
const { data: e } = await u({
|
|
12
|
+
url: a(),
|
|
13
|
+
nativeAuthToken: o ?? "",
|
|
14
|
+
bridgeOnly: !!r
|
|
14
15
|
});
|
|
15
|
-
return
|
|
16
|
-
} catch (
|
|
17
|
-
throw
|
|
16
|
+
return e;
|
|
17
|
+
} catch (e) {
|
|
18
|
+
throw e;
|
|
18
19
|
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
return ((
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
refetchOnWindowFocus: false,
|
|
29
|
-
gcTime: 5 * 60 * 1e3,
|
|
30
|
-
staleTime: 0
|
|
31
|
-
});
|
|
32
|
-
};
|
|
20
|
+
},
|
|
21
|
+
retry: (e, n) => {
|
|
22
|
+
var t;
|
|
23
|
+
return ((t = n.response) == null ? void 0 : t.status) === 404;
|
|
24
|
+
},
|
|
25
|
+
refetchOnWindowFocus: !1,
|
|
26
|
+
gcTime: 5 * 60 * 1e3,
|
|
27
|
+
staleTime: 0
|
|
28
|
+
});
|
|
33
29
|
export {
|
|
34
|
-
useGetAllTokensQuery
|
|
30
|
+
f as useGetAllTokensQuery
|
|
35
31
|
};
|
|
@@ -1,35 +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 reactjs_context_useWeb3App = require("../context/useWeb3App.js");
|
|
6
|
-
const api_getChains = require("../../api/getChains.js");
|
|
7
|
-
const helpers_getApiURL = require("../../helpers/getApiURL.js");
|
|
8
|
-
const useGetChainsQuery = () => {
|
|
9
|
-
const { nativeAuthToken, bridgeOnly } = reactjs_context_useWeb3App.useWeb3App();
|
|
10
|
-
const queryFn = async () => {
|
|
11
|
-
try {
|
|
12
|
-
const { data } = await api_getChains.getChains({
|
|
13
|
-
url: helpers_getApiURL.getApiURL(),
|
|
14
|
-
nativeAuthToken,
|
|
15
|
-
bridgeOnly: Boolean(bridgeOnly)
|
|
16
|
-
});
|
|
17
|
-
return data;
|
|
18
|
-
} catch (error) {
|
|
19
|
-
throw error;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
const retry = (_failureCount, error) => {
|
|
23
|
-
var _a;
|
|
24
|
-
return ((_a = error.response) == null ? void 0 : _a.status) === 404;
|
|
25
|
-
};
|
|
26
|
-
return reactQuery.useQuery({
|
|
27
|
-
queryKey: ["chains", nativeAuthToken],
|
|
28
|
-
queryFn,
|
|
29
|
-
retry,
|
|
30
|
-
refetchOnWindowFocus: false,
|
|
31
|
-
gcTime: 5 * 60 * 1e3,
|
|
32
|
-
staleTime: 0
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
exports.useGetChainsQuery = useGetChainsQuery;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@tanstack/react-query"),a=require("../context/useWeb3App.js"),c=require("../../api/getChains.js"),y=require("../../helpers/getApiURL.js"),l=()=>{const{nativeAuthToken:n,bridgeOnly:r}=a.useWeb3App(),s=async()=>{try{const{data:e}=await c.getChains({url:y.getApiURL(),nativeAuthToken:n,bridgeOnly:!!r});return e}catch(e){throw e}},u=(e,i)=>{var t;return((t=i.response)==null?void 0:t.status)===404};return o.useQuery({queryKey:["chains",r],queryFn:s,retry:u,refetchOnWindowFocus:!1,gcTime:5*60*1e3,staleTime:0})};exports.useGetChainsQuery=l;
|