@multiversx/sdk-dapp-liquidity 1.1.1-alpha.5 → 1.1.2-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/.eslintrc +77 -0
- package/.github/workflows/publish.yaml +63 -0
- package/.prettierignore +4 -0
- package/.prettierrc +8 -0
- package/CHANGELOG.md +26 -0
- package/jest.config.ts +43 -0
- package/package.json +18 -11
- package/postcss.config.js +8 -0
- package/src/api/checkAccount.ts +26 -0
- package/src/api/confirmRate.ts +38 -0
- package/src/api/getChains.ts +21 -0
- package/src/api/getRate.ts +34 -0
- package/src/api/getTokens.ts +28 -0
- package/src/api/getTokensBalances.ts +26 -0
- package/src/api/getTransactions.ts +52 -0
- package/src/api/linkAccount.ts +39 -0
- package/src/api/sendTransactions.ts +42 -0
- package/src/api/tests/confirmRate.spec.ts +146 -0
- package/src/api/tests/getChains.spec.ts +52 -0
- package/src/api/tests/getRate.spec.ts +102 -0
- package/src/api/tests/getTokens.spec.ts +78 -0
- package/src/api/tests/getTransactions.spec.ts +116 -0
- package/src/api/tests/sendTransactions.spec.ts +106 -0
- package/src/constants/index.ts +1 -0
- package/src/dto/Chain.dto.ts +19 -0
- package/src/dto/CheckAccount.dto.ts +4 -0
- package/src/dto/ConfirmRate.dto.ts +12 -0
- package/src/dto/Token.dto.ts +20 -0
- package/src/dto/TokenBalance.dto.ts +4 -0
- package/src/dto/Transaction.dto.ts +18 -0
- package/src/global.d.ts +2 -0
- package/{helpers/base64Utils.mjs → src/helpers/base64Utils.ts} +16 -11
- package/{helpers/decodeLoginToken.mjs → src/helpers/decodeLoginToken.ts} +18 -6
- package/{helpers/decodeToken.mjs → src/helpers/decodeToken.ts} +14 -10
- package/src/helpers/getApiURL.ts +5 -0
- package/src/helpers/getBridgeURL.ts +5 -0
- package/src/helpers/getMvxApiURL.ts +5 -0
- package/src/helpers/getMvxChainId.ts +5 -0
- package/src/helpers/getMvxExplorerAddress.ts +5 -0
- package/src/helpers/serializeTransaction.ts +7 -0
- package/src/helpers/tests/base64Utils.spec.ts +33 -0
- package/src/helpers/tests/decodeLoginToken.spec.ts +41 -0
- package/src/helpers/tests/decodeToken.spec.ts +32 -0
- package/src/reactjs/assets/all-networks.svg +24 -0
- package/src/reactjs/assets/arrow-up-right.svg +3 -0
- package/src/reactjs/assets/base.svg +4 -0
- package/src/reactjs/assets/bsc.svg +4 -0
- package/src/reactjs/assets/default.svg +4 -0
- package/src/reactjs/assets/ethereum.svg +17 -0
- package/src/reactjs/assets/hug.svg +7 -0
- package/src/reactjs/assets/msx.svg +11 -0
- package/src/reactjs/assets/polygon.svg +12 -0
- package/src/reactjs/components/AccountAddress/AccountAddress.tsx +33 -0
- package/src/reactjs/components/AmountCard/AmountCard.tsx +24 -0
- package/src/reactjs/components/AmountInput/AmountInput.tsx +84 -0
- package/src/reactjs/components/BridgeForm/BridgeForm.tsx +110 -0
- package/src/reactjs/components/BridgeForm/Deposit.tsx +732 -0
- package/src/reactjs/components/BridgeForm/Transfer.tsx +626 -0
- package/src/reactjs/components/BridgeForm/hooks/useBridgeAmounts.ts +99 -0
- package/src/reactjs/components/BridgeForm/hooks/useBridgeRateFetching.ts +93 -0
- package/src/reactjs/components/BridgeForm/hooks/useBridgeTokenSelection.ts +341 -0
- package/src/reactjs/components/BridgeForm/utils/bridgeFormHelpers.ts +91 -0
- package/src/reactjs/components/BridgeHistory/BridgeHistory.tsx +363 -0
- package/src/reactjs/components/Connect/BridgeAccountDisplay.tsx +134 -0
- package/src/reactjs/components/Connect/BridgeConnectButton.tsx +39 -0
- package/src/reactjs/components/Connect/CustomConnectButton.tsx +44 -0
- package/src/reactjs/components/Connect/MvxAccountDisplay.tsx +83 -0
- package/src/reactjs/components/Connect/MvxConnectButton.tsx +45 -0
- package/src/reactjs/components/Connect/SwitchChainButton.tsx +34 -0
- package/src/reactjs/components/CopyButton/CopyButton.tsx +51 -0
- package/{reactjs/components/CopyButton/utils/copyToClipboard.mjs → src/reactjs/components/CopyButton/utils/copyToClipboard.ts} +16 -11
- package/src/reactjs/components/DisplayAmount/DisplayAmount.tsx +139 -0
- package/src/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.tsx +51 -0
- package/src/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.tsx +76 -0
- package/src/reactjs/components/DisplayAmount/utils/truncateAmount.ts +22 -0
- package/src/reactjs/components/Error/Error.tsx +54 -0
- package/src/reactjs/components/Error/index.ts +1 -0
- package/src/reactjs/components/SmallLoader/SmallLoader.tsx +23 -0
- package/src/reactjs/components/ToggleDirection/ToggleDirection.tsx +25 -0
- package/src/reactjs/components/TokenSelector/TokenSelector.tsx +196 -0
- package/src/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.tsx +105 -0
- package/src/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.tsx +62 -0
- package/src/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.tsx +27 -0
- package/src/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.tsx +3 -0
- package/src/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.tsx +33 -0
- package/src/reactjs/components/TokenSelector/components/ChainSelect/types/chainSelectOption.ts +11 -0
- package/src/reactjs/components/TokenSelector/components/ChainSelect/types/partialChainOption.ts +11 -0
- package/src/reactjs/components/TokenSelector/components/SelectContainer.tsx +43 -0
- package/src/reactjs/components/TokenSelector/components/SelectContent.tsx +155 -0
- package/src/reactjs/components/TokenSelector/components/SelectedOption.tsx +29 -0
- package/src/reactjs/components/TokenSelector/components/TokenIcon.tsx +103 -0
- package/src/reactjs/components/TokenSelector/components/TokenItem.tsx +76 -0
- package/src/reactjs/components/TokenSelector/components/TokenList.tsx +25 -0
- package/src/reactjs/components/TokenSelector/components/TokenSymbol.tsx +31 -0
- package/src/reactjs/components/TransactionToast/TransactionToast.tsx +55 -0
- package/src/reactjs/components/TransactionToast/TransactionToastContainer.tsx +16 -0
- package/src/reactjs/components/TrimAddress/TrimAddress.tsx +27 -0
- package/src/reactjs/components/base/MxButton/MxButton.tsx +127 -0
- package/src/reactjs/components/base/MxCard/MxCard.tsx +71 -0
- package/src/reactjs/components/base/MxCircleLoader/MxCircleLoader.tsx +25 -0
- package/src/reactjs/components/base/MxCircleLoader/index.ts +1 -0
- package/src/reactjs/components/base/MxLink/MxLink.tsx +111 -0
- package/src/reactjs/components/base/MxSearch/MxSearch.tsx +72 -0
- package/src/reactjs/components/base/MxSlideover/MxSlideover.tsx +87 -0
- package/src/reactjs/components/base/MxTooltip/MxTooltip.tsx +194 -0
- package/src/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.tsx +48 -0
- package/src/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.tsx +35 -0
- package/src/reactjs/constants/chains.ts +50 -0
- package/src/reactjs/constants/index.ts +7 -0
- package/src/reactjs/context/Web3AppProvider.tsx +68 -0
- package/src/reactjs/context/queryClient.ts +11 -0
- package/src/reactjs/context/useWeb3App.ts +12 -0
- package/src/reactjs/hooks/useAccount.ts +12 -0
- package/{reactjs/hooks/useBalances.mjs → src/reactjs/hooks/useBalances.ts} +25 -15
- package/src/reactjs/hooks/useBridgeFormik.ts +198 -0
- package/{reactjs/hooks/useDebounce.mjs → src/reactjs/hooks/useDebounce.ts} +6 -5
- package/{reactjs/hooks/useFetchBridgeData.mjs → src/reactjs/hooks/useFetchBridgeData.ts} +10 -6
- package/{reactjs/hooks/useFetchTokens.mjs → src/reactjs/hooks/useFetchTokens.ts} +55 -26
- package/src/reactjs/hooks/useGenericSignMessage.ts +47 -0
- package/src/reactjs/hooks/useGetChainId.ts +10 -0
- package/src/reactjs/hooks/useResolveTokenChain.ts +23 -0
- package/{reactjs/hooks/useSendTransactions.mjs → src/reactjs/hooks/useSendTransactions.ts} +8 -7
- package/{reactjs/hooks/useSignTransaction.mjs → src/reactjs/hooks/useSignTransaction.ts} +46 -13
- package/src/reactjs/hooks/validation/useAmountSchema.ts +19 -0
- package/src/reactjs/hooks/validation/useSecondAmountSchema.ts +12 -0
- package/src/reactjs/hooks/validation/useTestHasEnoughFunds.ts +43 -0
- package/src/reactjs/hooks/validation/useTestIsConnected.ts +21 -0
- package/src/reactjs/index.css +122 -0
- package/{reactjs/index.d.ts → src/reactjs/index.ts} +1 -1
- package/src/reactjs/init/init.ts +120 -0
- package/src/reactjs/queries/useCheckAccount.query.ts +40 -0
- package/src/reactjs/queries/useGetAllTokens.query.ts +38 -0
- package/src/reactjs/queries/useGetChains.query.ts +35 -0
- package/{reactjs/queries/useGetHistory.query.mjs → src/reactjs/queries/useGetHistory.query.ts} +28 -18
- package/{reactjs/queries/useGetMvxTokensBalances.query.mjs → src/reactjs/queries/useGetMvxTokensBalances.query.ts} +33 -24
- package/src/reactjs/queries/useGetNonMvxTokensBalances.query.ts +80 -0
- package/src/reactjs/queries/useGetRate.mutation.ts +22 -0
- package/src/reactjs/queries/useLinkAccount.mutation.ts +22 -0
- package/src/reactjs/reexports.ts +32 -0
- package/{reactjs/utils/delay.mjs → src/reactjs/utils/delay.ts} +1 -4
- package/src/reactjs/utils/formatAmount.ts +29 -0
- package/src/reactjs/utils/getCleanStringAmount.ts +14 -0
- package/src/reactjs/utils/getCompletePathname.ts +4 -0
- package/src/reactjs/utils/getInitialTokens.ts +19 -0
- package/src/reactjs/utils/hasEnoughFunds.ts +24 -0
- package/src/reactjs/utils/isStringFloat.ts +28 -0
- package/src/reactjs/utils/mxClsx.ts +6 -0
- package/src/reactjs/utils/pipe.ts +26 -0
- package/src/reactjs/utils/removeCommas.ts +3 -0
- package/{reactjs/utils/roundAmount.mjs → src/reactjs/utils/roundAmount.ts} +30 -13
- package/src/reactjs/utils/testNumber.ts +2 -0
- package/src/store/inMemoryStore.ts +44 -0
- package/{types/batchTransactions.d.ts → src/types/batchTransactions.ts} +2 -2
- package/src/types/chainType.ts +6 -0
- package/src/types/linkAccount.ts +6 -0
- package/src/types/providerType.ts +5 -0
- package/src/types/rate.ts +17 -0
- package/src/types/token.ts +13 -0
- package/src/types/transaction.ts +36 -0
- package/src/types/utxo.ts +11 -0
- package/src/vite-env.d.ts +1 -0
- package/tailwind.config.js +82 -0
- package/test-config/setupJest.ts +5 -0
- package/test-config/setupTests.ts +41 -0
- package/tsconfig.json +33 -0
- package/vite.config.mts +75 -0
- package/all-networks-EJIVYZ_i.mjs +0 -4
- package/all-networks-NYACMyeN.js +0 -4
- package/api/checkAccount.d.ts +0 -9
- package/api/checkAccount.js +0 -22
- package/api/checkAccount.mjs +0 -21
- package/api/confirmFiatRate.d.ts +0 -19
- package/api/confirmFiatRate.js +0 -34
- package/api/confirmFiatRate.mjs +0 -33
- package/api/confirmRate.d.ts +0 -11
- package/api/confirmRate.js +0 -30
- package/api/confirmRate.mjs +0 -29
- package/api/getChains.d.ts +0 -8
- package/api/getChains.js +0 -18
- package/api/getChains.mjs +0 -17
- package/api/getRate.d.ts +0 -10
- package/api/getRate.js +0 -28
- package/api/getRate.mjs +0 -27
- package/api/getTokens.d.ts +0 -9
- package/api/getTokens.js +0 -23
- package/api/getTokens.mjs +0 -22
- package/api/getTokensBalances.d.ts +0 -9
- package/api/getTokensBalances.js +0 -22
- package/api/getTokensBalances.mjs +0 -21
- package/api/getTransactions.d.ts +0 -14
- package/api/getTransactions.js +0 -39
- package/api/getTransactions.mjs +0 -38
- package/api/index.js +0 -21
- package/api/index.mjs +0 -20
- package/api/linkAccount.d.ts +0 -10
- package/api/linkAccount.js +0 -32
- package/api/linkAccount.mjs +0 -31
- package/api/sendTransactions.d.ts +0 -13
- package/api/sendTransactions.js +0 -33
- package/api/sendTransactions.mjs +0 -32
- package/api/tests/confirmRate.spec.d.ts +0 -1
- package/api/tests/confirmRate.spec.js +0 -131
- package/api/tests/confirmRate.spec.mjs +0 -129
- package/api/tests/getChains.spec.d.ts +0 -1
- package/api/tests/getChains.spec.js +0 -44
- package/api/tests/getChains.spec.mjs +0 -42
- package/api/tests/getRate.spec.d.ts +0 -1
- package/api/tests/getRate.spec.js +0 -88
- package/api/tests/getRate.spec.mjs +0 -86
- package/api/tests/getTokens.spec.d.ts +0 -1
- package/api/tests/getTokens.spec.js +0 -71
- package/api/tests/getTokens.spec.mjs +0 -69
- package/api/tests/getTransactions.spec.d.ts +0 -1
- package/api/tests/getTransactions.spec.js +0 -109
- package/api/tests/getTransactions.spec.mjs +0 -107
- package/api/tests/sendTransactions.spec.d.ts +0 -1
- package/api/tests/sendTransactions.spec.js +0 -97
- package/api/tests/sendTransactions.spec.mjs +0 -95
- package/bignumber-B8vjg9qn.js +0 -1334
- package/bignumber-CKZkoo0g.mjs +0 -1334
- package/constants/index.d.ts +0 -1
- package/constants/index.js +0 -5
- package/constants/index.mjs +0 -4
- package/default-BYtXv70Z.mjs +0 -4
- package/default-H3AbmzFV.js +0 -4
- package/dto/Chain.dto.d.ts +0 -19
- package/dto/Chain.dto.js +0 -2
- package/dto/Chain.dto.mjs +0 -1
- package/dto/CheckAccount.dto.d.ts +0 -4
- package/dto/CheckAccount.dto.js +0 -2
- package/dto/CheckAccount.dto.mjs +0 -1
- package/dto/ConfirmRate.dto.d.ts +0 -12
- package/dto/ConfirmRate.dto.js +0 -2
- package/dto/ConfirmRate.dto.mjs +0 -1
- package/dto/Token.dto.d.ts +0 -20
- package/dto/Token.dto.js +0 -2
- package/dto/Token.dto.mjs +0 -1
- package/dto/TokenBalance.dto.d.ts +0 -4
- package/dto/TokenBalance.dto.js +0 -2
- package/dto/TokenBalance.dto.mjs +0 -1
- package/dto/Transaction.dto.d.ts +0 -18
- package/dto/Transaction.dto.js +0 -2
- package/dto/Transaction.dto.mjs +0 -1
- package/dto/index.js +0 -2
- package/dto/index.mjs +0 -1
- package/getConnections-BBxOUh4c.mjs +0 -50
- package/getConnections-DufiP2Qa.js +0 -50
- package/helpers/base64Utils.d.ts +0 -3
- package/helpers/base64Utils.js +0 -32
- package/helpers/decodeLoginToken.d.ts +0 -9
- package/helpers/decodeLoginToken.js +0 -28
- package/helpers/decodeToken.d.ts +0 -11
- package/helpers/decodeToken.js +0 -40
- package/helpers/getApiURL.d.ts +0 -1
- package/helpers/getApiURL.js +0 -8
- package/helpers/getApiURL.mjs +0 -7
- package/helpers/getBridgeURL.d.ts +0 -1
- package/helpers/getBridgeURL.js +0 -8
- package/helpers/getBridgeURL.mjs +0 -7
- package/helpers/getMvxApiURL.d.ts +0 -1
- package/helpers/getMvxApiURL.js +0 -8
- package/helpers/getMvxApiURL.mjs +0 -7
- package/helpers/getMvxChainId.d.ts +0 -1
- package/helpers/getMvxChainId.js +0 -8
- package/helpers/getMvxChainId.mjs +0 -7
- package/helpers/getMvxExplorerAddress.d.ts +0 -1
- package/helpers/getMvxExplorerAddress.js +0 -8
- package/helpers/getMvxExplorerAddress.mjs +0 -7
- package/helpers/index.js +0 -23
- package/helpers/index.mjs +0 -22
- package/helpers/serializeTransaction.d.ts +0 -3
- package/helpers/serializeTransaction.js +0 -9
- package/helpers/serializeTransaction.mjs +0 -8
- package/helpers/tests/base64Utils.spec.d.ts +0 -1
- package/helpers/tests/base64Utils.spec.js +0 -30
- package/helpers/tests/base64Utils.spec.mjs +0 -28
- package/helpers/tests/decodeLoginToken.spec.d.ts +0 -1
- package/helpers/tests/decodeLoginToken.spec.js +0 -35
- package/helpers/tests/decodeLoginToken.spec.mjs +0 -33
- package/helpers/tests/decodeToken.spec.d.ts +0 -1
- package/helpers/tests/decodeToken.spec.js +0 -28
- package/helpers/tests/decodeToken.spec.mjs +0 -26
- package/index.js +0 -223
- package/index.mjs +0 -189
- package/reactjs/components/AccountAddress/AccountAddress.d.ts +0 -6
- package/reactjs/components/AccountAddress/AccountAddress.js +0 -25
- package/reactjs/components/AccountAddress/AccountAddress.mjs +0 -24
- package/reactjs/components/AccountAddress/index.js +0 -5
- package/reactjs/components/AccountAddress/index.mjs +0 -4
- package/reactjs/components/AmountCard/AmountCard.d.ts +0 -6
- package/reactjs/components/AmountCard/AmountCard.js +0 -34
- package/reactjs/components/AmountCard/AmountCard.mjs +0 -33
- package/reactjs/components/AmountCard/index.js +0 -5
- package/reactjs/components/AmountCard/index.mjs +0 -4
- package/reactjs/components/AmountInput/AmountInput.d.ts +0 -13
- package/reactjs/components/AmountInput/AmountInput.js +0 -72
- package/reactjs/components/AmountInput/AmountInput.mjs +0 -71
- package/reactjs/components/AmountInput/index.js +0 -5
- package/reactjs/components/AmountInput/index.mjs +0 -4
- package/reactjs/components/BridgeForm/BridgeForm.d.ts +0 -23
- package/reactjs/components/BridgeForm/BridgeForm.js +0 -83
- package/reactjs/components/BridgeForm/BridgeForm.mjs +0 -82
- package/reactjs/components/BridgeForm/Deposit.d.ts +0 -23
- package/reactjs/components/BridgeForm/Deposit.js +0 -848
- package/reactjs/components/BridgeForm/Deposit.mjs +0 -847
- package/reactjs/components/BridgeForm/Transfer.d.ts +0 -23
- package/reactjs/components/BridgeForm/Transfer.js +0 -740
- package/reactjs/components/BridgeForm/Transfer.mjs +0 -739
- package/reactjs/components/BridgeForm/index.js +0 -5
- package/reactjs/components/BridgeForm/index.mjs +0 -4
- package/reactjs/components/BridgeHistory/BridgeHistory.d.ts +0 -4
- package/reactjs/components/BridgeHistory/BridgeHistory.js +0 -340
- package/reactjs/components/BridgeHistory/BridgeHistory.mjs +0 -339
- package/reactjs/components/BridgeHistory/index.js +0 -5
- package/reactjs/components/BridgeHistory/index.mjs +0 -4
- package/reactjs/components/Connect/BridgeAccountDisplay.d.ts +0 -6
- package/reactjs/components/Connect/BridgeAccountDisplay.js +0 -138
- package/reactjs/components/Connect/BridgeAccountDisplay.mjs +0 -137
- package/reactjs/components/Connect/BridgeConnectButton.d.ts +0 -7
- package/reactjs/components/Connect/BridgeConnectButton.js +0 -26
- package/reactjs/components/Connect/BridgeConnectButton.mjs +0 -25
- package/reactjs/components/Connect/CustomConnectButton.d.ts +0 -7
- package/reactjs/components/Connect/CustomConnectButton.js +0 -39
- package/reactjs/components/Connect/CustomConnectButton.mjs +0 -38
- package/reactjs/components/Connect/MvxAccountDisplay.d.ts +0 -9
- package/reactjs/components/Connect/MvxAccountDisplay.js +0 -75
- package/reactjs/components/Connect/MvxAccountDisplay.mjs +0 -74
- package/reactjs/components/Connect/MvxConnectButton.d.ts +0 -9
- package/reactjs/components/Connect/MvxConnectButton.js +0 -43
- package/reactjs/components/Connect/MvxConnectButton.mjs +0 -42
- package/reactjs/components/Connect/SwitchChainButton.d.ts +0 -7
- package/reactjs/components/Connect/SwitchChainButton.js +0 -29
- package/reactjs/components/Connect/SwitchChainButton.mjs +0 -28
- package/reactjs/components/Connect/index.js +0 -15
- package/reactjs/components/Connect/index.mjs +0 -14
- package/reactjs/components/CopyButton/CopyButton.d.ts +0 -6
- package/reactjs/components/CopyButton/CopyButton.js +0 -42
- package/reactjs/components/CopyButton/CopyButton.mjs +0 -41
- package/reactjs/components/CopyButton/index.js +0 -5
- package/reactjs/components/CopyButton/index.mjs +0 -4
- package/reactjs/components/CopyButton/utils/copyToClipboard.d.ts +0 -1
- package/reactjs/components/CopyButton/utils/copyToClipboard.js +0 -39
- package/reactjs/components/CopyButton/utils/index.js +0 -5
- package/reactjs/components/CopyButton/utils/index.mjs +0 -4
- package/reactjs/components/DisplayAmount/DisplayAmount.d.ts +0 -21
- package/reactjs/components/DisplayAmount/DisplayAmount.js +0 -91
- package/reactjs/components/DisplayAmount/DisplayAmount.mjs +0 -90
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.d.ts +0 -7
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.js +0 -40
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.mjs +0 -39
- package/reactjs/components/DisplayAmount/components/AnimateNumber/index.js +0 -2
- package/reactjs/components/DisplayAmount/components/AnimateNumber/index.mjs +0 -1
- package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.d.ts +0 -14
- package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.js +0 -62
- package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.mjs +0 -61
- package/reactjs/components/DisplayAmount/components/index.js +0 -2
- package/reactjs/components/DisplayAmount/components/index.mjs +0 -1
- package/reactjs/components/DisplayAmount/index.js +0 -5
- package/reactjs/components/DisplayAmount/index.mjs +0 -4
- package/reactjs/components/DisplayAmount/utils/index.js +0 -5
- package/reactjs/components/DisplayAmount/utils/index.mjs +0 -4
- package/reactjs/components/DisplayAmount/utils/truncateAmount.d.ts +0 -1
- package/reactjs/components/DisplayAmount/utils/truncateAmount.js +0 -22
- package/reactjs/components/DisplayAmount/utils/truncateAmount.mjs +0 -21
- package/reactjs/components/Error/Error.d.ts +0 -6
- package/reactjs/components/Error/Error.js +0 -67
- package/reactjs/components/Error/Error.mjs +0 -66
- package/reactjs/components/Error/index.d.ts +0 -1
- package/reactjs/components/Error/index.js +0 -5
- package/reactjs/components/Error/index.mjs +0 -4
- package/reactjs/components/SmallLoader/SmallLoader.d.ts +0 -4
- package/reactjs/components/SmallLoader/SmallLoader.js +0 -22
- package/reactjs/components/SmallLoader/SmallLoader.mjs +0 -21
- package/reactjs/components/SmallLoader/index.js +0 -5
- package/reactjs/components/SmallLoader/index.mjs +0 -4
- package/reactjs/components/ToggleDirection/ToggleDirection.d.ts +0 -3
- package/reactjs/components/ToggleDirection/ToggleDirection.js +0 -23
- package/reactjs/components/ToggleDirection/ToggleDirection.mjs +0 -22
- package/reactjs/components/TokenSelector/TokenSelector.d.ts +0 -17
- package/reactjs/components/TokenSelector/TokenSelector.js +0 -166
- package/reactjs/components/TokenSelector/TokenSelector.mjs +0 -165
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.d.ts +0 -9
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.js +0 -94
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.mjs +0 -93
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.d.ts +0 -12
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.js +0 -45
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.mjs +0 -44
- package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.d.ts +0 -6
- package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.js +0 -19
- package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.mjs +0 -18
- package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.d.ts +0 -3
- package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.js +0 -7
- package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.mjs +0 -6
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.d.ts +0 -4
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.js +0 -33
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.mjs +0 -32
- package/reactjs/components/TokenSelector/components/ChainSelect/types/chainSelectOption.d.ts +0 -11
- package/reactjs/components/TokenSelector/components/ChainSelect/types/chainSelectOption.js +0 -2
- package/reactjs/components/TokenSelector/components/ChainSelect/types/chainSelectOption.mjs +0 -1
- package/reactjs/components/TokenSelector/components/ChainSelect/types/partialChainOption.d.ts +0 -11
- package/reactjs/components/TokenSelector/components/ChainSelect/types/partialChainOption.js +0 -2
- package/reactjs/components/TokenSelector/components/ChainSelect/types/partialChainOption.mjs +0 -1
- package/reactjs/components/TokenSelector/components/SelectContainer.d.ts +0 -7
- package/reactjs/components/TokenSelector/components/SelectContainer.js +0 -41
- package/reactjs/components/TokenSelector/components/SelectContainer.mjs +0 -40
- package/reactjs/components/TokenSelector/components/SelectContent.d.ts +0 -11
- package/reactjs/components/TokenSelector/components/SelectContent.js +0 -98
- package/reactjs/components/TokenSelector/components/SelectContent.mjs +0 -97
- package/reactjs/components/TokenSelector/components/SelectedOption.d.ts +0 -5
- package/reactjs/components/TokenSelector/components/SelectedOption.js +0 -29
- package/reactjs/components/TokenSelector/components/SelectedOption.mjs +0 -28
- package/reactjs/components/TokenSelector/components/TokenIcon.d.ts +0 -8
- package/reactjs/components/TokenSelector/components/TokenIcon.js +0 -82
- package/reactjs/components/TokenSelector/components/TokenIcon.mjs +0 -81
- package/reactjs/components/TokenSelector/components/TokenItem.d.ts +0 -7
- package/reactjs/components/TokenSelector/components/TokenItem.js +0 -69
- package/reactjs/components/TokenSelector/components/TokenItem.mjs +0 -68
- package/reactjs/components/TokenSelector/components/TokenList.d.ts +0 -7
- package/reactjs/components/TokenSelector/components/TokenList.js +0 -21
- package/reactjs/components/TokenSelector/components/TokenList.mjs +0 -20
- package/reactjs/components/TokenSelector/components/TokenSymbol.d.ts +0 -9
- package/reactjs/components/TokenSelector/components/TokenSymbol.js +0 -26
- package/reactjs/components/TokenSelector/components/TokenSymbol.mjs +0 -25
- package/reactjs/components/TokenSelector/index.js +0 -5
- package/reactjs/components/TokenSelector/index.mjs +0 -4
- package/reactjs/components/TransactionToast/TransactionToast.d.ts +0 -9
- package/reactjs/components/TransactionToast/TransactionToast.js +0 -54
- package/reactjs/components/TransactionToast/TransactionToast.mjs +0 -53
- package/reactjs/components/TransactionToast/TransactionToastContainer.d.ts +0 -3
- package/reactjs/components/TransactionToast/TransactionToastContainer.js +0 -21
- package/reactjs/components/TransactionToast/TransactionToastContainer.mjs +0 -20
- package/reactjs/components/TransactionToast/index.js +0 -7
- package/reactjs/components/TransactionToast/index.mjs +0 -6
- package/reactjs/components/TrimAddress/TrimAddress.d.ts +0 -8
- package/reactjs/components/TrimAddress/TrimAddress.js +0 -26
- package/reactjs/components/TrimAddress/TrimAddress.mjs +0 -25
- package/reactjs/components/TrimAddress/index.js +0 -5
- package/reactjs/components/TrimAddress/index.mjs +0 -4
- package/reactjs/components/base/MxButton/MxButton.d.ts +0 -13
- package/reactjs/components/base/MxButton/MxButton.js +0 -72
- package/reactjs/components/base/MxButton/MxButton.mjs +0 -71
- package/reactjs/components/base/MxButton/index.js +0 -5
- package/reactjs/components/base/MxButton/index.mjs +0 -4
- package/reactjs/components/base/MxCard/MxCard.d.ts +0 -10
- package/reactjs/components/base/MxCard/MxCard.js +0 -55
- package/reactjs/components/base/MxCard/MxCard.mjs +0 -54
- package/reactjs/components/base/MxCard/index.js +0 -5
- package/reactjs/components/base/MxCard/index.mjs +0 -4
- package/reactjs/components/base/MxCircleLoader/MxCircleLoader.d.ts +0 -4
- package/reactjs/components/base/MxCircleLoader/MxCircleLoader.js +0 -29
- package/reactjs/components/base/MxCircleLoader/MxCircleLoader.mjs +0 -28
- package/reactjs/components/base/MxCircleLoader/index.d.ts +0 -1
- package/reactjs/components/base/MxCircleLoader/index.js +0 -5
- package/reactjs/components/base/MxCircleLoader/index.mjs +0 -4
- package/reactjs/components/base/MxLink/MxLink.d.ts +0 -14
- package/reactjs/components/base/MxLink/MxLink.js +0 -71
- package/reactjs/components/base/MxLink/MxLink.mjs +0 -70
- package/reactjs/components/base/MxLink/index.js +0 -5
- package/reactjs/components/base/MxLink/index.mjs +0 -4
- package/reactjs/components/base/MxSearch/MxSearch.d.ts +0 -10
- package/reactjs/components/base/MxSearch/MxSearch.js +0 -70
- package/reactjs/components/base/MxSearch/MxSearch.mjs +0 -69
- package/reactjs/components/base/MxSearch/index.js +0 -5
- package/reactjs/components/base/MxSearch/index.mjs +0 -4
- package/reactjs/components/base/MxSlideover/MxSlideover.d.ts +0 -10
- package/reactjs/components/base/MxSlideover/MxSlideover.js +0 -79
- package/reactjs/components/base/MxSlideover/MxSlideover.mjs +0 -78
- package/reactjs/components/base/MxSlideover/index.js +0 -5
- package/reactjs/components/base/MxSlideover/index.mjs +0 -4
- package/reactjs/components/base/MxTooltip/MxTooltip.d.ts +0 -23
- package/reactjs/components/base/MxTooltip/MxTooltip.js +0 -164
- package/reactjs/components/base/MxTooltip/MxTooltip.mjs +0 -163
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.d.ts +0 -11
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.js +0 -34
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.mjs +0 -33
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.js +0 -5
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.mjs +0 -4
- package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.d.ts +0 -13
- package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.js +0 -28
- package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.mjs +0 -27
- package/reactjs/components/base/MxTooltip/components/TooltipContent/index.js +0 -5
- package/reactjs/components/base/MxTooltip/components/TooltipContent/index.mjs +0 -4
- package/reactjs/components/base/MxTooltip/components/index.js +0 -7
- package/reactjs/components/base/MxTooltip/components/index.mjs +0 -6
- package/reactjs/components/base/MxTooltip/index.js +0 -5
- package/reactjs/components/base/MxTooltip/index.mjs +0 -4
- package/reactjs/components/base/index.js +0 -15
- package/reactjs/components/base/index.mjs +0 -14
- package/reactjs/components/index.js +0 -53
- package/reactjs/components/index.mjs +0 -52
- package/reactjs/constants/chains.d.ts +0 -36
- package/reactjs/constants/chains.js +0 -40
- package/reactjs/constants/chains.mjs +0 -39
- package/reactjs/constants/index.d.ts +0 -3
- package/reactjs/constants/index.js +0 -13
- package/reactjs/constants/index.mjs +0 -12
- package/reactjs/context/Web3AppProvider.d.ts +0 -23
- package/reactjs/context/Web3AppProvider.js +0 -41
- package/reactjs/context/Web3AppProvider.mjs +0 -40
- package/reactjs/context/queryClient.d.ts +0 -3
- package/reactjs/context/queryClient.js +0 -12
- package/reactjs/context/queryClient.mjs +0 -11
- package/reactjs/context/useWeb3App.d.ts +0 -1
- package/reactjs/context/useWeb3App.js +0 -13
- package/reactjs/context/useWeb3App.mjs +0 -12
- package/reactjs/hooks/index.js +0 -32
- package/reactjs/hooks/index.mjs +0 -31
- package/reactjs/hooks/useAccount.d.ts +0 -77
- package/reactjs/hooks/useAccount.js +0 -14
- package/reactjs/hooks/useAccount.mjs +0 -13
- package/reactjs/hooks/useBalances.d.ts +0 -11
- package/reactjs/hooks/useBalances.js +0 -54
- package/reactjs/hooks/useBridgeFormik.d.ts +0 -103
- package/reactjs/hooks/useBridgeFormik.js +0 -162
- package/reactjs/hooks/useBridgeFormik.mjs +0 -161
- package/reactjs/hooks/useDebounce.d.ts +0 -1
- package/reactjs/hooks/useDebounce.js +0 -14
- package/reactjs/hooks/useFetchBridgeData.d.ts +0 -58
- package/reactjs/hooks/useFetchBridgeData.js +0 -46
- package/reactjs/hooks/useFetchTokens.d.ts +0 -55
- package/reactjs/hooks/useFetchTokens.js +0 -114
- package/reactjs/hooks/useGenericSignMessage.d.ts +0 -3
- package/reactjs/hooks/useGenericSignMessage.js +0 -42
- package/reactjs/hooks/useGenericSignMessage.mjs +0 -41
- package/reactjs/hooks/useGetChainId.d.ts +0 -1
- package/reactjs/hooks/useGetChainId.js +0 -12
- package/reactjs/hooks/useGetChainId.mjs +0 -11
- package/reactjs/hooks/useResolveTokenChain.d.ts +0 -9
- package/reactjs/hooks/useResolveTokenChain.js +0 -21
- package/reactjs/hooks/useResolveTokenChain.mjs +0 -20
- package/reactjs/hooks/useSendTransactions.d.ts +0 -3
- package/reactjs/hooks/useSendTransactions.js +0 -26
- package/reactjs/hooks/useSignTransaction.d.ts +0 -96
- package/reactjs/hooks/useSignTransaction.js +0 -59
- package/reactjs/hooks/validation/index.js +0 -11
- package/reactjs/hooks/validation/index.mjs +0 -10
- package/reactjs/hooks/validation/useAmountSchema.d.ts +0 -2
- package/reactjs/hooks/validation/useAmountSchema.js +0 -31
- package/reactjs/hooks/validation/useAmountSchema.mjs +0 -13
- package/reactjs/hooks/validation/useSecondAmountSchema.d.ts +0 -2
- package/reactjs/hooks/validation/useSecondAmountSchema.js +0 -27
- package/reactjs/hooks/validation/useSecondAmountSchema.mjs +0 -9
- package/reactjs/hooks/validation/useTestHasEnoughFunds.d.ts +0 -3
- package/reactjs/hooks/validation/useTestHasEnoughFunds.js +0 -38
- package/reactjs/hooks/validation/useTestHasEnoughFunds.mjs +0 -37
- package/reactjs/hooks/validation/useTestIsConnected.d.ts +0 -3
- package/reactjs/hooks/validation/useTestIsConnected.js +0 -21
- package/reactjs/hooks/validation/useTestIsConnected.mjs +0 -20
- package/reactjs/index.js +0 -183
- package/reactjs/index.mjs +0 -149
- package/reactjs/init/index.js +0 -5
- package/reactjs/init/index.mjs +0 -4
- package/reactjs/init/init.d.ts +0 -266
- package/reactjs/init/init.js +0 -77
- package/reactjs/init/init.mjs +0 -59
- package/reactjs/init/tests/init.spec.d.ts +0 -1
- package/reactjs/init/tests/init.spec.js +0 -107
- package/reactjs/init/tests/init.spec.mjs +0 -105
- package/reactjs/queries/index.js +0 -18
- package/reactjs/queries/index.mjs +0 -17
- package/reactjs/queries/useCheckAccount.query.d.ts +0 -3
- package/reactjs/queries/useCheckAccount.query.js +0 -50
- package/reactjs/queries/useCheckAccount.query.mjs +0 -49
- package/reactjs/queries/useGetAllTokens.query.d.ts +0 -6
- package/reactjs/queries/useGetAllTokens.query.js +0 -36
- package/reactjs/queries/useGetAllTokens.query.mjs +0 -35
- package/reactjs/queries/useGetChains.query.d.ts +0 -3
- package/reactjs/queries/useGetChains.query.js +0 -35
- package/reactjs/queries/useGetChains.query.mjs +0 -34
- package/reactjs/queries/useGetHistory.query.d.ts +0 -12
- package/reactjs/queries/useGetHistory.query.js +0 -69
- package/reactjs/queries/useGetMvxTokensBalances.query.d.ts +0 -29
- package/reactjs/queries/useGetMvxTokensBalances.query.js +0 -72
- package/reactjs/queries/useGetNonMvxTokensBalances.query.d.ts +0 -28
- package/reactjs/queries/useGetNonMvxTokensBalances.query.js +0 -81
- package/reactjs/queries/useGetNonMvxTokensBalances.query.mjs +0 -80
- package/reactjs/queries/useGetRate.mutation.d.ts +0 -6
- package/reactjs/queries/useGetRate.mutation.js +0 -19
- package/reactjs/queries/useGetRate.mutation.mjs +0 -18
- package/reactjs/queries/useLinkAccount.mutation.d.ts +0 -6
- package/reactjs/queries/useLinkAccount.mutation.js +0 -19
- package/reactjs/queries/useLinkAccount.mutation.mjs +0 -18
- package/reactjs/reexports.d.ts +0 -6
- package/reactjs/reexports.js +0 -49
- package/reactjs/reexports.mjs +0 -15
- package/reactjs/utils/delay.d.ts +0 -1
- package/reactjs/utils/delay.js +0 -7
- package/reactjs/utils/formatAmount.d.ts +0 -7
- package/reactjs/utils/formatAmount.js +0 -24
- package/reactjs/utils/formatAmount.mjs +0 -23
- package/reactjs/utils/getCleanStringAmount.d.ts +0 -4
- package/reactjs/utils/getCleanStringAmount.js +0 -12
- package/reactjs/utils/getCleanStringAmount.mjs +0 -11
- package/reactjs/utils/getCompletePathname.d.ts +0 -1
- package/reactjs/utils/getCompletePathname.js +0 -6
- package/reactjs/utils/getCompletePathname.mjs +0 -5
- package/reactjs/utils/getInitialTokens.d.ts +0 -11
- package/reactjs/utils/getInitialTokens.js +0 -13
- package/reactjs/utils/getInitialTokens.mjs +0 -12
- package/reactjs/utils/hasEnoughFunds.d.ts +0 -5
- package/reactjs/utils/hasEnoughFunds.js +0 -20
- package/reactjs/utils/hasEnoughFunds.mjs +0 -19
- package/reactjs/utils/index.js +0 -27
- package/reactjs/utils/index.mjs +0 -26
- package/reactjs/utils/isStringFloat.d.ts +0 -1
- package/reactjs/utils/isStringFloat.js +0 -22
- package/reactjs/utils/isStringFloat.mjs +0 -21
- package/reactjs/utils/mxClsx.d.ts +0 -3
- package/reactjs/utils/mxClsx.js +0 -21
- package/reactjs/utils/mxClsx.mjs +0 -20
- package/reactjs/utils/pipe.d.ts +0 -7
- package/reactjs/utils/pipe.js +0 -26
- package/reactjs/utils/pipe.mjs +0 -25
- package/reactjs/utils/removeCommas.d.ts +0 -1
- package/reactjs/utils/removeCommas.js +0 -7
- package/reactjs/utils/removeCommas.mjs +0 -6
- package/reactjs/utils/roundAmount.d.ts +0 -1
- package/reactjs/utils/roundAmount.js +0 -41
- package/reactjs/utils/testNumber.d.ts +0 -1
- package/reactjs/utils/testNumber.js +0 -5
- package/reactjs/utils/testNumber.mjs +0 -4
- package/store/inMemoryStore.d.ts +0 -12
- package/store/inMemoryStore.js +0 -40
- package/store/inMemoryStore.mjs +0 -39
- package/style.css +0 -2232
- package/types/batchTransactions.js +0 -2
- package/types/batchTransactions.mjs +0 -1
- package/types/chainType.d.ts +0 -6
- package/types/chainType.js +0 -11
- package/types/chainType.mjs +0 -10
- package/types/index.js +0 -2
- package/types/index.mjs +0 -1
- package/types/linkAccount.d.ts +0 -6
- package/types/linkAccount.js +0 -2
- package/types/linkAccount.mjs +0 -1
- package/types/providerType.d.ts +0 -5
- package/types/providerType.js +0 -10
- package/types/providerType.mjs +0 -9
- package/types/rate.d.ts +0 -16
- package/types/rate.js +0 -2
- package/types/rate.mjs +0 -1
- package/types/token.d.ts +0 -12
- package/types/token.js +0 -2
- package/types/token.mjs +0 -1
- package/types/transaction.d.ts +0 -30
- package/types/transaction.js +0 -2
- package/types/transaction.mjs +0 -1
- package/types/utxo.d.ts +0 -11
- package/types/utxo.js +0 -2
- package/types/utxo.mjs +0 -1
- /package/{api/index.d.ts → src/api/index.ts} +0 -0
- /package/{dto/index.d.ts → src/dto/index.ts} +0 -0
- /package/{helpers/index.d.ts → src/helpers/index.ts} +0 -0
- /package/{index.d.ts → src/index.ts} +0 -0
- /package/{reactjs/components/AccountAddress/index.d.ts → src/reactjs/components/AccountAddress/index.ts} +0 -0
- /package/{reactjs/components/AmountCard/index.d.ts → src/reactjs/components/AmountCard/index.ts} +0 -0
- /package/{reactjs/components/AmountInput/index.d.ts → src/reactjs/components/AmountInput/index.ts} +0 -0
- /package/{reactjs/components/BridgeForm/index.d.ts → src/reactjs/components/BridgeForm/index.ts} +0 -0
- /package/{reactjs/components/BridgeHistory/index.d.ts → src/reactjs/components/BridgeHistory/index.ts} +0 -0
- /package/{reactjs/components/Connect/index.d.ts → src/reactjs/components/Connect/index.ts} +0 -0
- /package/{reactjs/components/CopyButton/index.d.ts → src/reactjs/components/CopyButton/index.ts} +0 -0
- /package/{reactjs/components/CopyButton/utils/index.d.ts → src/reactjs/components/CopyButton/utils/index.ts} +0 -0
- /package/{reactjs/components/DisplayAmount/components/AnimateNumber/index.d.ts → src/reactjs/components/DisplayAmount/components/AnimateNumber/index.ts} +0 -0
- /package/{reactjs/components/DisplayAmount/components/index.d.ts → src/reactjs/components/DisplayAmount/components/index.ts} +0 -0
- /package/{reactjs/components/DisplayAmount/index.d.ts → src/reactjs/components/DisplayAmount/index.ts} +0 -0
- /package/{reactjs/components/DisplayAmount/utils/index.d.ts → src/reactjs/components/DisplayAmount/utils/index.ts} +0 -0
- /package/{reactjs/components/SmallLoader/index.d.ts → src/reactjs/components/SmallLoader/index.ts} +0 -0
- /package/{reactjs/components/TokenSelector/index.d.ts → src/reactjs/components/TokenSelector/index.ts} +0 -0
- /package/{reactjs/components/TransactionToast/index.d.ts → src/reactjs/components/TransactionToast/index.ts} +0 -0
- /package/{reactjs/components/TrimAddress/index.d.ts → src/reactjs/components/TrimAddress/index.ts} +0 -0
- /package/{reactjs/components/base/MxButton/index.d.ts → src/reactjs/components/base/MxButton/index.ts} +0 -0
- /package/{reactjs/components/base/MxCard/index.d.ts → src/reactjs/components/base/MxCard/index.ts} +0 -0
- /package/{reactjs/components/base/MxLink/index.d.ts → src/reactjs/components/base/MxLink/index.ts} +0 -0
- /package/{reactjs/components/base/MxSearch/index.d.ts → src/reactjs/components/base/MxSearch/index.ts} +0 -0
- /package/{reactjs/components/base/MxSlideover/index.d.ts → src/reactjs/components/base/MxSlideover/index.ts} +0 -0
- /package/{reactjs/components/base/MxTooltip/components/TooltipContainer/index.d.ts → src/reactjs/components/base/MxTooltip/components/TooltipContainer/index.ts} +0 -0
- /package/{reactjs/components/base/MxTooltip/components/TooltipContent/index.d.ts → src/reactjs/components/base/MxTooltip/components/TooltipContent/index.ts} +0 -0
- /package/{reactjs/components/base/MxTooltip/components/index.d.ts → src/reactjs/components/base/MxTooltip/components/index.ts} +0 -0
- /package/{reactjs/components/base/MxTooltip/index.d.ts → src/reactjs/components/base/MxTooltip/index.ts} +0 -0
- /package/{reactjs/components/base/index.d.ts → src/reactjs/components/base/index.ts} +0 -0
- /package/{reactjs/components/index.d.ts → src/reactjs/components/index.ts} +0 -0
- /package/{reactjs/hooks/index.d.ts → src/reactjs/hooks/index.ts} +0 -0
- /package/{reactjs/hooks/validation/index.d.ts → src/reactjs/hooks/validation/index.ts} +0 -0
- /package/{reactjs/init/index.d.ts → src/reactjs/init/index.ts} +0 -0
- /package/{reactjs/queries/index.d.ts → src/reactjs/queries/index.ts} +0 -0
- /package/{reactjs/utils/index.d.ts → src/reactjs/utils/index.ts} +0 -0
- /package/{types/index.d.ts → src/types/index.ts} +0 -0
package/.eslintrc
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root":true,
|
|
3
|
+
"extends": [
|
|
4
|
+
"plugin:@typescript-eslint/recommended",
|
|
5
|
+
"prettier",
|
|
6
|
+
"plugin:prettier/recommended",
|
|
7
|
+
"plugin:jest/recommended"
|
|
8
|
+
],
|
|
9
|
+
"parser": "@typescript-eslint/parser",
|
|
10
|
+
"plugins":[
|
|
11
|
+
"@typescript-eslint",
|
|
12
|
+
"import",
|
|
13
|
+
"prettier"
|
|
14
|
+
],
|
|
15
|
+
"env": {
|
|
16
|
+
"es2021": true,
|
|
17
|
+
"node": true,
|
|
18
|
+
"jest/globals": true
|
|
19
|
+
},
|
|
20
|
+
"settings": {
|
|
21
|
+
"parserOptions": {
|
|
22
|
+
"ecmaFeatures": { "jsx": true }
|
|
23
|
+
},
|
|
24
|
+
"import/parsers": {
|
|
25
|
+
"@typescript-eslint/parser": [".ts", ".tsx"]
|
|
26
|
+
},
|
|
27
|
+
"import/resolver": {
|
|
28
|
+
"node": {
|
|
29
|
+
"extensions": [".js", ".jsx", ".ts", ".tsx"],
|
|
30
|
+
"moduleDirectory": ["node_modules", "src/"]
|
|
31
|
+
},
|
|
32
|
+
"typescript": {
|
|
33
|
+
"alwaysTryTypes": true
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"overrides": [
|
|
38
|
+
{
|
|
39
|
+
"files": ["src/localConstants.ts"],
|
|
40
|
+
"env": {
|
|
41
|
+
"browser": true,
|
|
42
|
+
"node": false
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"rules": {
|
|
47
|
+
"no-multiple-empty-lines":"error",
|
|
48
|
+
"@typescript-eslint/no-unused-vars":"error",
|
|
49
|
+
"promise/always-return": 0,
|
|
50
|
+
"no-shadow": "off",
|
|
51
|
+
"no-undef": "warn",
|
|
52
|
+
"curly": ["error", "all"],
|
|
53
|
+
"no-catch-shadow": "error",
|
|
54
|
+
"no-confusing-arrow": [
|
|
55
|
+
"warn",
|
|
56
|
+
{
|
|
57
|
+
"allowParens": true
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"@typescript-eslint/no-shadow": "error",
|
|
61
|
+
"@typescript-eslint/no-var-requires": "off",
|
|
62
|
+
"@typescript-eslint/indent": "off",
|
|
63
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
64
|
+
"import/order": [
|
|
65
|
+
"warn",
|
|
66
|
+
{
|
|
67
|
+
"groups": ["builtin", "external", "internal"],
|
|
68
|
+
"newlines-between": "ignore",
|
|
69
|
+
"alphabetize": {
|
|
70
|
+
"order": "asc",
|
|
71
|
+
"caseInsensitive": true
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"radix":"off"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
name: Publish sdk-dapp-liquidity
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
|
|
6
|
+
permissions:
|
|
7
|
+
contents: write
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
publish-npm:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
contents: write
|
|
14
|
+
packages: write
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
with:
|
|
18
|
+
ref: ${{ github.ref }}
|
|
19
|
+
clean: true
|
|
20
|
+
- name: Set up Node.js
|
|
21
|
+
uses: actions/setup-node@v4
|
|
22
|
+
with:
|
|
23
|
+
node-version: 20
|
|
24
|
+
registry-url: 'https://registry.npmjs.org'
|
|
25
|
+
- name: Setup pnpm
|
|
26
|
+
run: npm install -g pnpm
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: pnpm install --frozen-lockfile
|
|
30
|
+
|
|
31
|
+
- name: Run tests
|
|
32
|
+
run: pnpm test
|
|
33
|
+
|
|
34
|
+
- name: Build project
|
|
35
|
+
run: pnpm build
|
|
36
|
+
|
|
37
|
+
- name: Get package info
|
|
38
|
+
id: package
|
|
39
|
+
uses: andreigiura/action-nodejs-package-info@v1.0.2
|
|
40
|
+
|
|
41
|
+
- name: Publish to npmjs alpha version
|
|
42
|
+
env:
|
|
43
|
+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
|
44
|
+
if: ${{ contains(steps.package.outputs.version, 'alpha') }}
|
|
45
|
+
run: echo "Publishing alpha version" && npm publish --tag alpha
|
|
46
|
+
|
|
47
|
+
- name: Publish to npmjs beta version
|
|
48
|
+
env:
|
|
49
|
+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
|
50
|
+
if: ${{ contains(steps.package.outputs.version, 'beta') }}
|
|
51
|
+
run: echo "Publishing beta version" && npm publish --tag beta
|
|
52
|
+
|
|
53
|
+
- name: Publish to npmjs next version
|
|
54
|
+
env:
|
|
55
|
+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
|
56
|
+
if: ${{ steps.package.outputs.is-release-candidate == 'true'}}
|
|
57
|
+
run: echo "Publishing release candidate" && npm publish --tag next
|
|
58
|
+
|
|
59
|
+
- name: Publish to npmjs
|
|
60
|
+
env:
|
|
61
|
+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
|
62
|
+
if: ${{ steps.package.outputs.is-prerelease == 'false' }}
|
|
63
|
+
run: npm publish
|
package/.prettierignore
ADDED
package/.prettierrc
ADDED
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [[v1.0.11](https://github.com/multiversx/mx-sdk-dapp-liquidity/pull/17)] - 2025-03-11
|
|
11
|
+
|
|
12
|
+
## [[v1.0.10](https://github.com/multiversx/mx-sdk-dapp-liquidity/pull/16)] - 2025-03-10
|
|
13
|
+
|
|
14
|
+
## [[v1.0.9](https://github.com/multiversx/mx-sdk-dapp-liquidity/pull/15)] - 2025-03-06
|
|
15
|
+
|
|
16
|
+
## [[v1.0.8](https://github.com/multiversx/mx-sdk-dapp-liquidity/pull/14)] - 2025-03-06
|
|
17
|
+
|
|
18
|
+
## [[v1.0.7](https://github.com/multiversx/mx-sdk-dapp-liquidity/pull/12)] - 2025-03-05
|
|
19
|
+
|
|
20
|
+
## [[v1.0.5](https://github.com/multiversx/mx-sdk-dapp-liquidity/pull/11)] - 2025-03-04
|
|
21
|
+
|
|
22
|
+
## [[v1.0.4](https://github.com/multiversx/mx-sdk-dapp-liquidity/pull/10)] - 2025-03-03
|
|
23
|
+
|
|
24
|
+
## [[v1.0.1](https://github.com/multiversx/mx-sdk-dapp-liquidity/pull/9)] - 2025-02-21
|
|
25
|
+
|
|
26
|
+
## [[v0.0.0](https://github.com/multiversx/mx-sdk-dapp-liquidity)] - 2024-11-01
|
package/jest.config.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
roots: ['<rootDir>/src'],
|
|
3
|
+
collectCoverageFrom: [
|
|
4
|
+
'src/**/tests/*.{test.ts,test.tsx,spec.tsx,spec.ts,bgTest.ts}',
|
|
5
|
+
'!src/**/*.d.ts',
|
|
6
|
+
'!src/__mocks__/**'
|
|
7
|
+
],
|
|
8
|
+
coveragePathIgnorePatterns: [],
|
|
9
|
+
setupFiles: ['./test-config/setupJest.ts'],
|
|
10
|
+
setupFilesAfterEnv: ['./test-config/setupTests.ts'],
|
|
11
|
+
testEnvironment: 'jsdom',
|
|
12
|
+
modulePaths: ['<rootDir>/src'],
|
|
13
|
+
transform: {
|
|
14
|
+
'^.+\\.(ts|js|tsx|jsx)$': ['@swc/jest']
|
|
15
|
+
},
|
|
16
|
+
transformIgnorePatterns: ['node_modules/(^.+\\\\.(ts|js|tsx|jsx)$)'],
|
|
17
|
+
testMatch: [
|
|
18
|
+
'**/__tests__/**/*.[jt]s?(x)',
|
|
19
|
+
'**/?(*.)+(spec|test|bgTest).[jt]s?(x)'
|
|
20
|
+
],
|
|
21
|
+
moduleNameMapper: {
|
|
22
|
+
'\\.(css|sass|scss)$': 'identity-obj-proxy'
|
|
23
|
+
},
|
|
24
|
+
moduleFileExtensions: [
|
|
25
|
+
// Place tsx and ts to beginning as suggestion from Jest team
|
|
26
|
+
// https://jestjs.io/docs/configuration#modulefileextensions-arraystring
|
|
27
|
+
'tsx',
|
|
28
|
+
'ts',
|
|
29
|
+
'web.js',
|
|
30
|
+
'js',
|
|
31
|
+
'web.ts',
|
|
32
|
+
'web.tsx',
|
|
33
|
+
'json',
|
|
34
|
+
'node'
|
|
35
|
+
],
|
|
36
|
+
watchPlugins: [
|
|
37
|
+
'jest-watch-typeahead/filename',
|
|
38
|
+
'jest-watch-typeahead/testname'
|
|
39
|
+
],
|
|
40
|
+
moduleDirectories: ['node_modules', 'src'],
|
|
41
|
+
workerIdleMemoryLimit: 0.33,
|
|
42
|
+
bail: 1
|
|
43
|
+
};
|
package/package.json
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/multiversx/mx-sdk-dapp-liquidity#readme",
|
|
30
30
|
"license": "MIT",
|
|
31
|
-
"version": "1.1.
|
|
31
|
+
"version": "1.1.2-alpha.1",
|
|
32
32
|
"main": "index.js",
|
|
33
33
|
"module": "index.mjs",
|
|
34
34
|
"types": "index.d.ts",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"publish-package": "yarn build && cd dist && npm publish",
|
|
40
40
|
"publish-package-next": "yarn build && cd dist && npm publish --tag next",
|
|
41
41
|
"publish-yalc": "yarn build && cd dist && yalc publish --push",
|
|
42
|
+
"publish-verdaccio": "yarn run build && cd dist && npm publish --registry http://localhost:4873/",
|
|
42
43
|
"start": "vite",
|
|
43
44
|
"test": "jest",
|
|
44
45
|
"lint": "eslint src --ext .ts,.js"
|
|
@@ -50,16 +51,18 @@
|
|
|
50
51
|
"@fortawesome/free-solid-svg-icons": "6.5.1",
|
|
51
52
|
"@fortawesome/react-fontawesome": "0.2.0",
|
|
52
53
|
"@headlessui/react": "2.2.0",
|
|
53
|
-
"@multiversx/sdk-dapp-utils": "
|
|
54
|
+
"@multiversx/sdk-dapp-utils": "3.0.2",
|
|
54
55
|
"@popperjs/core": "2.11.8",
|
|
55
|
-
"@reown/appkit": "1.
|
|
56
|
-
"@
|
|
57
|
-
"@reown/appkit-
|
|
58
|
-
"@reown/appkit-adapter-
|
|
59
|
-
"@solana
|
|
56
|
+
"@reown/appkit": "1.8.13",
|
|
57
|
+
"@wagmi/core": "2.22.1",
|
|
58
|
+
"@reown/appkit-common": "1.8.13",
|
|
59
|
+
"@reown/appkit-adapter-bitcoin": "1.8.13",
|
|
60
|
+
"@reown/appkit-adapter-solana": "1.8.13",
|
|
61
|
+
"@reown/appkit-adapter-wagmi": "1.8.13",
|
|
62
|
+
"@solana/web3.js": "1.98.4",
|
|
60
63
|
"@tanstack/react-query": "5.71.3",
|
|
61
64
|
"animated-number-react": "0.1.2",
|
|
62
|
-
"axios": "1.7.
|
|
65
|
+
"axios": "1.7.4",
|
|
63
66
|
"formik": "2.4.6",
|
|
64
67
|
"lodash": "4.17.21",
|
|
65
68
|
"numeral": "2.0.6",
|
|
@@ -74,13 +77,17 @@
|
|
|
74
77
|
"yup": "1.4.0"
|
|
75
78
|
},
|
|
76
79
|
"peerDependencies": {
|
|
77
|
-
"@multiversx/sdk-core": ">=
|
|
80
|
+
"@multiversx/sdk-core": ">= 15.x",
|
|
78
81
|
"react": ">= 18",
|
|
79
82
|
"react-dom": ">= 18",
|
|
80
|
-
"tailwindcss": ">= 3"
|
|
83
|
+
"tailwindcss": ">= 3",
|
|
84
|
+
"bignumber.js": ">= 9.x",
|
|
85
|
+
"clsx": ">= 2.x"
|
|
81
86
|
},
|
|
82
87
|
"devDependencies": {
|
|
83
|
-
"
|
|
88
|
+
"clsx": "2.0.0",
|
|
89
|
+
"bignumber.js": "9.0.1",
|
|
90
|
+
"@multiversx/sdk-core": "15.3.0",
|
|
84
91
|
"@rollup/plugin-node-resolve": "15.2.3",
|
|
85
92
|
"@swc-node/jest": "1.6.6",
|
|
86
93
|
"@swc/core": "1.5.24",
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
+
import { CheckAccountDto } from '../dto/CheckAccount.dto';
|
|
3
|
+
|
|
4
|
+
export async function checkAccount({
|
|
5
|
+
url,
|
|
6
|
+
walletAddress,
|
|
7
|
+
chainId,
|
|
8
|
+
nativeAuthToken
|
|
9
|
+
}: {
|
|
10
|
+
url: string;
|
|
11
|
+
walletAddress: string;
|
|
12
|
+
chainId: string;
|
|
13
|
+
nativeAuthToken: string;
|
|
14
|
+
}): Promise<AxiosResponse<CheckAccountDto>> {
|
|
15
|
+
const config: AxiosRequestConfig = {
|
|
16
|
+
baseURL: url,
|
|
17
|
+
headers: {
|
|
18
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return await axios.get<CheckAccountDto>(
|
|
23
|
+
`/user/checkAccount?walletAddress=${walletAddress}&chainId=${chainId}`,
|
|
24
|
+
config
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import axios, { AxiosHeaders, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
+
import { decodeToken } from 'helpers/decodeToken';
|
|
3
|
+
import { ConfirmRateDto } from '../dto/ConfirmRate.dto';
|
|
4
|
+
import { ServerTransaction } from '../types/transaction';
|
|
5
|
+
|
|
6
|
+
type ConfirmRateProps = {
|
|
7
|
+
url: string;
|
|
8
|
+
nativeAuthToken: string;
|
|
9
|
+
body: ConfirmRateDto;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export async function confirmRate({
|
|
13
|
+
url,
|
|
14
|
+
nativeAuthToken,
|
|
15
|
+
body
|
|
16
|
+
}: ConfirmRateProps): Promise<AxiosResponse<ServerTransaction[]>> {
|
|
17
|
+
const config: AxiosRequestConfig = {
|
|
18
|
+
baseURL: url,
|
|
19
|
+
headers: {
|
|
20
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
if (!nativeAuthToken) {
|
|
25
|
+
delete config.headers?.Authorization;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const decodedToken = await decodeToken(nativeAuthToken);
|
|
29
|
+
|
|
30
|
+
if ((config.headers as AxiosHeaders).set) {
|
|
31
|
+
(config.headers as AxiosHeaders).set({
|
|
32
|
+
...config.headers,
|
|
33
|
+
origin: decodedToken?.origin ?? ''
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return await axios.post<ServerTransaction[]>(`/rate/confirm`, body, config);
|
|
38
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
+
import { ChainDTO } from '../dto/Chain.dto';
|
|
3
|
+
|
|
4
|
+
export async function getChains({
|
|
5
|
+
url,
|
|
6
|
+
nativeAuthToken,
|
|
7
|
+
bridgeOnly
|
|
8
|
+
}: {
|
|
9
|
+
url: string;
|
|
10
|
+
nativeAuthToken: string;
|
|
11
|
+
bridgeOnly: boolean;
|
|
12
|
+
}): Promise<AxiosResponse<ChainDTO[]>> {
|
|
13
|
+
const config: AxiosRequestConfig = {
|
|
14
|
+
baseURL: url,
|
|
15
|
+
headers: {
|
|
16
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return await axios.get<ChainDTO[]>(`/chains?isBridge=${bridgeOnly}`, config);
|
|
21
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
+
import { decodeToken } from 'helpers/decodeToken';
|
|
3
|
+
import { RateRequestBody, RateRequestResponse } from 'types/rate';
|
|
4
|
+
|
|
5
|
+
interface RateProps {
|
|
6
|
+
url: string;
|
|
7
|
+
nativeAuthToken: string;
|
|
8
|
+
body: RateRequestBody;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export async function getRate({
|
|
12
|
+
url,
|
|
13
|
+
nativeAuthToken,
|
|
14
|
+
body
|
|
15
|
+
}: RateProps): Promise<AxiosResponse<RateRequestResponse>> {
|
|
16
|
+
const config: AxiosRequestConfig = {
|
|
17
|
+
baseURL: url,
|
|
18
|
+
headers: {
|
|
19
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
if (!nativeAuthToken) {
|
|
24
|
+
delete config.headers?.Authorization;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const decodedToken = await decodeToken(nativeAuthToken);
|
|
28
|
+
config.headers = {
|
|
29
|
+
...config.headers,
|
|
30
|
+
origin: decodedToken?.origin
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return await axios.post<RateRequestResponse>(`/rate`, body, config);
|
|
34
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
+
import { TokenType } from '../types/token';
|
|
3
|
+
|
|
4
|
+
export async function getTokens({
|
|
5
|
+
url,
|
|
6
|
+
chainId,
|
|
7
|
+
nativeAuthToken,
|
|
8
|
+
bridgeOnly
|
|
9
|
+
}: {
|
|
10
|
+
url: string;
|
|
11
|
+
chainId?: number;
|
|
12
|
+
nativeAuthToken: string;
|
|
13
|
+
bridgeOnly: boolean;
|
|
14
|
+
}): Promise<AxiosResponse<TokenType[]>> {
|
|
15
|
+
const config: AxiosRequestConfig = {
|
|
16
|
+
baseURL: url,
|
|
17
|
+
headers: {
|
|
18
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const endpoint = chainId ? `/tokens/${chainId}` : '/tokens';
|
|
23
|
+
|
|
24
|
+
return await axios.get<TokenType[]>(
|
|
25
|
+
`${endpoint}?isBridge=${bridgeOnly}`,
|
|
26
|
+
config
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
+
import { TokenBalanceDTO } from '../dto/TokenBalance.dto';
|
|
3
|
+
|
|
4
|
+
export async function getTokensBalances({
|
|
5
|
+
url,
|
|
6
|
+
userAddress,
|
|
7
|
+
chainId,
|
|
8
|
+
nativeAuthToken
|
|
9
|
+
}: {
|
|
10
|
+
url: string;
|
|
11
|
+
userAddress: string;
|
|
12
|
+
chainId: string;
|
|
13
|
+
nativeAuthToken: string;
|
|
14
|
+
}): Promise<AxiosResponse<TokenBalanceDTO[]>> {
|
|
15
|
+
const config: AxiosRequestConfig = {
|
|
16
|
+
baseURL: url,
|
|
17
|
+
headers: {
|
|
18
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return await axios.get<TokenBalanceDTO[]>(
|
|
23
|
+
`/tokens/balances/${userAddress}/${chainId}`,
|
|
24
|
+
config
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
+
import { TransactionDTO } from 'dto/Transaction.dto';
|
|
3
|
+
import { ProviderType } from 'types/providerType';
|
|
4
|
+
|
|
5
|
+
export async function getTransactions({
|
|
6
|
+
url,
|
|
7
|
+
address,
|
|
8
|
+
sender,
|
|
9
|
+
provider,
|
|
10
|
+
status,
|
|
11
|
+
tokenIn,
|
|
12
|
+
tokenOut,
|
|
13
|
+
nativeAuthToken
|
|
14
|
+
}: {
|
|
15
|
+
url: string;
|
|
16
|
+
address: string;
|
|
17
|
+
sender?: string;
|
|
18
|
+
provider?: ProviderType;
|
|
19
|
+
status?: string;
|
|
20
|
+
tokenIn?: string;
|
|
21
|
+
tokenOut?: string;
|
|
22
|
+
nativeAuthToken: string;
|
|
23
|
+
}): Promise<AxiosResponse<TransactionDTO[]>> {
|
|
24
|
+
const queryParams = new URLSearchParams({
|
|
25
|
+
receiver: address || '',
|
|
26
|
+
sender: sender || '',
|
|
27
|
+
provider: provider || '',
|
|
28
|
+
status: status || '',
|
|
29
|
+
tokenIn: tokenIn || '',
|
|
30
|
+
tokenOut: tokenOut || ''
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const params = Object.entries(Object.fromEntries(queryParams.entries()));
|
|
34
|
+
|
|
35
|
+
for (const [key, value] of params) {
|
|
36
|
+
if (value === '') {
|
|
37
|
+
queryParams.delete(key);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const queryString = queryParams.toString();
|
|
42
|
+
const endpointWithParams = `/transactions?${queryString}`;
|
|
43
|
+
|
|
44
|
+
const config: AxiosRequestConfig = {
|
|
45
|
+
baseURL: url,
|
|
46
|
+
headers: {
|
|
47
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return await axios.get<TransactionDTO[]>(endpointWithParams, config);
|
|
52
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
+
import { decodeToken } from 'helpers/decodeToken';
|
|
3
|
+
import { RateRequestResponse } from 'types/rate';
|
|
4
|
+
import { LinkAccountRequestBody } from '../types/linkAccount';
|
|
5
|
+
|
|
6
|
+
interface LinkAccountProps {
|
|
7
|
+
url: string;
|
|
8
|
+
nativeAuthToken: string;
|
|
9
|
+
body: LinkAccountRequestBody;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export async function linkAccount({
|
|
13
|
+
url,
|
|
14
|
+
nativeAuthToken,
|
|
15
|
+
body
|
|
16
|
+
}: LinkAccountProps): Promise<AxiosResponse> {
|
|
17
|
+
const config: AxiosRequestConfig = {
|
|
18
|
+
baseURL: url,
|
|
19
|
+
headers: {
|
|
20
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
if (!nativeAuthToken) {
|
|
25
|
+
delete config.headers?.Authorization;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const decodedToken = await decodeToken(nativeAuthToken);
|
|
29
|
+
config.headers = {
|
|
30
|
+
...config.headers,
|
|
31
|
+
origin: decodedToken?.origin
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return await axios.post<RateRequestResponse>(
|
|
35
|
+
`/user/linkAccount`,
|
|
36
|
+
body,
|
|
37
|
+
config
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
+
import { serializeTransaction } from '../helpers/serializeTransaction';
|
|
3
|
+
import { BatchTransactions } from '../types/batchTransactions';
|
|
4
|
+
import { ProviderType } from '../types/providerType';
|
|
5
|
+
import { ServerTransaction } from '../types/transaction';
|
|
6
|
+
|
|
7
|
+
export type SendTransactionsType = {
|
|
8
|
+
transactions: ServerTransaction[];
|
|
9
|
+
provider: ProviderType;
|
|
10
|
+
url: string;
|
|
11
|
+
token: string;
|
|
12
|
+
axiosConfig?: AxiosRequestConfig;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const sendTransactions = async ({
|
|
16
|
+
transactions,
|
|
17
|
+
provider,
|
|
18
|
+
url,
|
|
19
|
+
token,
|
|
20
|
+
axiosConfig
|
|
21
|
+
}: SendTransactionsType): Promise<AxiosResponse<BatchTransactions>> => {
|
|
22
|
+
const config: AxiosRequestConfig = {
|
|
23
|
+
baseURL: url,
|
|
24
|
+
headers: {
|
|
25
|
+
'Content-Type': 'application/json',
|
|
26
|
+
Accept: 'application/json',
|
|
27
|
+
Authorization: `Bearer ${token}`
|
|
28
|
+
},
|
|
29
|
+
...axiosConfig
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return axios.post<BatchTransactions>(
|
|
33
|
+
`/transactions`,
|
|
34
|
+
{
|
|
35
|
+
transactions: transactions.map((transaction) =>
|
|
36
|
+
JSON.parse(serializeTransaction(transaction))
|
|
37
|
+
),
|
|
38
|
+
provider
|
|
39
|
+
},
|
|
40
|
+
config
|
|
41
|
+
);
|
|
42
|
+
};
|