@multiversx/sdk-dapp-liquidity 1.1.0-alpha.8 → 1.1.1-alpha.0
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/README.md +1 -2
- package/api/checkAccount.d.ts +9 -0
- package/api/checkAccount.js +22 -0
- package/api/checkAccount.mjs +21 -0
- package/api/getChains.d.ts +3 -1
- package/api/getChains.js +10 -4
- package/api/getChains.mjs +10 -4
- package/api/getTokens.d.ts +3 -1
- package/api/getTokens.js +13 -4
- package/api/getTokens.mjs +13 -4
- package/api/getTokensBalances.d.ts +2 -1
- package/api/getTokensBalances.js +9 -4
- package/api/getTokensBalances.mjs +9 -4
- package/api/getTransactions.d.ts +2 -1
- package/api/getTransactions.js +13 -7
- package/api/getTransactions.mjs +13 -7
- package/api/index.d.ts +2 -0
- package/api/index.js +4 -0
- package/api/index.mjs +4 -0
- package/api/linkAccount.d.ts +10 -0
- package/api/linkAccount.js +32 -0
- package/api/linkAccount.mjs +31 -0
- package/api/tests/getChains.spec.js +10 -3
- package/api/tests/getChains.spec.mjs +10 -3
- package/api/tests/getTokens.spec.js +16 -5
- package/api/tests/getTokens.spec.mjs +16 -5
- package/api/tests/getTransactions.spec.js +86 -68
- package/api/tests/getTransactions.spec.mjs +86 -68
- package/constants/index.d.ts +1 -1
- package/constants/index.js +1 -1
- package/constants/index.mjs +1 -1
- package/dto/Chain.dto.d.ts +4 -1
- package/dto/CheckAccount.dto.d.ts +4 -0
- package/dto/CheckAccount.dto.js +2 -0
- package/dto/CheckAccount.dto.mjs +1 -0
- package/dto/Token.dto.d.ts +6 -2
- package/dto/Transaction.dto.d.ts +1 -0
- package/getConnections-BBxOUh4c.mjs +50 -0
- package/getConnections-DufiP2Qa.js +50 -0
- package/index.js +49 -19
- package/index.mjs +19 -19
- package/package.json +10 -6
- package/reactjs/components/AmountInput/AmountInput.d.ts +1 -1
- package/reactjs/components/BridgeForm/BridgeForm.d.ts +6 -2
- package/reactjs/components/BridgeForm/BridgeForm.js +58 -706
- package/reactjs/components/BridgeForm/BridgeForm.mjs +59 -707
- package/reactjs/components/BridgeForm/Deposit.d.ts +23 -0
- package/reactjs/components/BridgeForm/Deposit.js +857 -0
- package/reactjs/components/BridgeForm/Deposit.mjs +856 -0
- package/reactjs/components/BridgeForm/Transfer.d.ts +23 -0
- package/reactjs/components/BridgeForm/Transfer.js +712 -0
- package/reactjs/components/BridgeForm/Transfer.mjs +711 -0
- package/reactjs/components/BridgeHistory/BridgeHistory.js +22 -13
- package/reactjs/components/BridgeHistory/BridgeHistory.mjs +17 -8
- package/reactjs/components/Connect/BridgeAccountDisplay.js +60 -9
- package/reactjs/components/Connect/BridgeAccountDisplay.mjs +60 -9
- package/reactjs/components/Connect/BridgeConnectButton.js +1 -1
- package/reactjs/components/Connect/BridgeConnectButton.mjs +1 -1
- package/reactjs/components/Connect/CustomConnectButton.js +2 -6
- package/reactjs/components/Connect/CustomConnectButton.mjs +1 -5
- package/reactjs/components/Connect/MvxConnectButton.d.ts +2 -4
- package/reactjs/components/Connect/MvxConnectButton.js +2 -2
- package/reactjs/components/Connect/MvxConnectButton.mjs +2 -2
- package/reactjs/components/Connect/SwitchChainButton.js +2 -7
- package/reactjs/components/Connect/SwitchChainButton.mjs +1 -6
- package/reactjs/components/CopyButton/CopyButton.js +2 -2
- package/reactjs/components/CopyButton/CopyButton.mjs +2 -2
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.js +5 -5
- package/reactjs/components/TokenSelector/TokenSelector.d.ts +2 -1
- package/reactjs/components/TokenSelector/TokenSelector.js +17 -9
- package/reactjs/components/TokenSelector/TokenSelector.mjs +13 -5
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.d.ts +2 -1
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.js +11 -5
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.mjs +8 -2
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.d.ts +1 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.js +2 -2
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.mjs +2 -2
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.js +2 -2
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.mjs +2 -2
- package/reactjs/components/TokenSelector/components/ChainSelect/types/chainSelectOption.d.ts +1 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/types/partialChainOption.d.ts +1 -0
- package/reactjs/components/TokenSelector/components/SelectContent.d.ts +2 -1
- package/reactjs/components/TokenSelector/components/SelectContent.js +12 -9
- package/reactjs/components/TokenSelector/components/SelectContent.mjs +4 -1
- package/reactjs/components/TokenSelector/components/TokenIcon.js +5 -5
- package/reactjs/components/TokenSelector/components/TokenIcon.mjs +2 -2
- package/reactjs/components/TokenSelector/components/TokenItem.js +9 -9
- package/reactjs/components/TokenSelector/components/TokenItem.mjs +6 -6
- package/reactjs/components/TokenSelector/components/TokenList.js +1 -1
- package/reactjs/components/TokenSelector/components/TokenList.mjs +1 -1
- package/reactjs/components/base/MxCard/MxCard.js +2 -2
- package/reactjs/components/base/MxLink/MxLink.js +2 -2
- package/reactjs/components/base/MxSearch/MxSearch.js +4 -4
- package/reactjs/components/base/MxSlideover/MxSlideover.js +4 -4
- package/reactjs/components/base/MxTooltip/MxTooltip.js +9 -9
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.js +2 -2
- package/reactjs/context/Web3AppProvider.d.ts +8 -1
- package/reactjs/context/Web3AppProvider.js +14 -6
- package/reactjs/context/Web3AppProvider.mjs +11 -3
- package/reactjs/context/useWeb3App.js +2 -2
- package/reactjs/hooks/index.js +1 -1
- package/reactjs/hooks/index.mjs +2 -2
- package/reactjs/hooks/useAccount.js +1 -6
- package/reactjs/hooks/useAccount.mjs +1 -6
- package/reactjs/hooks/useBalances.d.ts +2 -3
- package/reactjs/hooks/useBalances.js +51 -4
- package/reactjs/hooks/useBalances.mjs +51 -4
- package/reactjs/hooks/useBridgeFormik.d.ts +4 -4
- package/reactjs/hooks/useBridgeFormik.js +44 -70
- package/reactjs/hooks/useBridgeFormik.mjs +39 -65
- package/reactjs/hooks/useDebounce.js +3 -3
- package/reactjs/hooks/useFetchBridgeData.d.ts +12 -5
- package/reactjs/hooks/useFetchBridgeData.js +0 -2
- package/reactjs/hooks/useFetchBridgeData.mjs +0 -2
- package/reactjs/hooks/useFetchTokens.d.ts +12 -5
- package/reactjs/hooks/useFetchTokens.js +20 -21
- package/reactjs/hooks/useFetchTokens.mjs +14 -15
- package/reactjs/hooks/useFiatData.d.ts +6 -2
- package/reactjs/hooks/useFiatData.js +6 -6
- package/reactjs/hooks/useFiatData.mjs +1 -1
- package/reactjs/hooks/useGenericSignMessage.d.ts +3 -0
- package/reactjs/hooks/useGenericSignMessage.js +42 -0
- package/reactjs/hooks/useGenericSignMessage.mjs +41 -0
- package/reactjs/hooks/useGetChainId.js +3 -3
- package/reactjs/hooks/useGetChainId.mjs +1 -1
- package/reactjs/hooks/useResolveTokenChain.js +3 -3
- package/reactjs/hooks/useResolveTokenChain.mjs +1 -1
- package/reactjs/hooks/useSendTransactions.js +2 -2
- package/reactjs/hooks/useSignTransaction.d.ts +94 -67
- package/reactjs/hooks/useSignTransaction.js +46 -4
- package/reactjs/hooks/useSignTransaction.mjs +46 -4
- package/reactjs/hooks/validation/useTestHasEnoughFunds.js +3 -3
- package/reactjs/hooks/validation/useTestIsConnected.js +2 -2
- package/reactjs/index.js +45 -19
- package/reactjs/index.mjs +15 -19
- package/reactjs/init/init.d.ts +220 -1
- package/reactjs/init/init.js +31 -20
- package/reactjs/init/init.mjs +23 -12
- package/reactjs/init/tests/init.spec.js +6 -7
- package/reactjs/init/tests/init.spec.mjs +5 -6
- package/reactjs/queries/index.d.ts +1 -2
- package/reactjs/queries/index.js +3 -5
- package/reactjs/queries/index.mjs +3 -5
- package/reactjs/queries/useCheckAccount.query.d.ts +3 -0
- package/reactjs/queries/useCheckAccount.query.js +50 -0
- package/reactjs/queries/useCheckAccount.query.mjs +49 -0
- package/reactjs/queries/useGetAllTokens.query.js +6 -2
- package/reactjs/queries/useGetAllTokens.query.mjs +6 -2
- package/reactjs/queries/useGetChains.query.js +6 -2
- package/reactjs/queries/useGetChains.query.mjs +6 -2
- package/reactjs/queries/useGetHistory.query.js +6 -2
- package/reactjs/queries/useGetHistory.query.mjs +6 -2
- package/reactjs/queries/useGetMvxTokensBalances.query.d.ts +6 -2
- package/reactjs/queries/useGetMvxTokensBalances.query.js +17 -6
- package/reactjs/queries/useGetMvxTokensBalances.query.mjs +15 -4
- package/reactjs/queries/{useGetEvmTokensBalances.query.d.ts → useGetNonMvxTokensBalances.query.d.ts} +7 -3
- package/reactjs/queries/{useGetEvmTokensBalances.query.js → useGetNonMvxTokensBalances.query.js} +18 -16
- package/reactjs/queries/{useGetEvmTokensBalances.query.mjs → useGetNonMvxTokensBalances.query.mjs} +18 -16
- package/reactjs/queries/useLinkAccount.mutation.d.ts +6 -0
- package/reactjs/queries/useLinkAccount.mutation.js +19 -0
- package/reactjs/queries/useLinkAccount.mutation.mjs +18 -0
- package/reactjs/reexports.d.ts +2 -1
- package/reactjs/reexports.js +41 -13
- package/reactjs/reexports.mjs +11 -13
- package/reactjs/utils/getInitialTokens.d.ts +4 -1
- package/reactjs/utils/getInitialTokens.js +3 -3
- package/reactjs/utils/getInitialTokens.mjs +3 -3
- package/style.css +4 -0
- package/types/chainType.d.ts +6 -0
- package/types/chainType.js +11 -0
- package/types/chainType.mjs +10 -0
- package/types/linkAccount.d.ts +6 -0
- package/types/linkAccount.js +2 -0
- package/types/linkAccount.mjs +1 -0
- package/types/providerType.d.ts +1 -1
- package/types/providerType.js +1 -1
- package/types/providerType.mjs +1 -1
- package/types/transaction.d.ts +17 -1
- package/types/utxo.d.ts +11 -0
- package/types/utxo.js +2 -0
- package/types/utxo.mjs +1 -0
- package/add-6Hktd7HI.mjs +0 -19
- package/add-juzQkMr_.js +0 -20
- package/all-wallets-CDBHcdBW.mjs +0 -10
- package/all-wallets-DWuLhbnN.js +0 -11
- package/app-store-2Caui3Hv.mjs +0 -21
- package/app-store-Cppxe4t5.js +0 -22
- package/apple-DKtoJZe9.mjs +0 -22
- package/apple-nexFyqTC.js +0 -23
- package/arrow-bottom-BVz7XUz-.js +0 -13
- package/arrow-bottom-C5NamQSq.mjs +0 -12
- package/arrow-bottom-circle-CvWQP3gd.js +0 -16
- package/arrow-bottom-circle-DZRlr5gZ.mjs +0 -15
- package/arrow-left-BjtUA8Tn.mjs +0 -12
- package/arrow-left-ywqF3CIm.js +0 -13
- package/arrow-right-BM5qYgEx.js +0 -13
- package/arrow-right-EfRPXJ8g.mjs +0 -12
- package/arrow-top-DIZLgKAv.mjs +0 -12
- package/arrow-top-MEfOCzpg.js +0 -13
- package/bank-B5GtM-iL.mjs +0 -18
- package/bank-dWinx5sN.js +0 -19
- package/bitcoin-1SWAuj8n.mjs +0 -3792
- package/bitcoin-DHwiZolS.js +0 -3792
- package/browser-BCJFo3OQ.mjs +0 -18
- package/browser-DbtgVP-h.js +0 -19
- package/card-Bgar5aKz.js +0 -19
- package/card-vGuo5IOR.mjs +0 -18
- package/checkmark-BKBFeuP5.mjs +0 -15
- package/checkmark-bold-BYb8CUZ8.js +0 -13
- package/checkmark-bold-BiFMlocx.mjs +0 -12
- package/checkmark-l8h3sm_g.js +0 -16
- package/chevron-bottom-DfebxTNv.js +0 -13
- package/chevron-bottom-qpBNc49E.mjs +0 -12
- package/chevron-left-Coi_nNKR.mjs +0 -12
- package/chevron-left-FnvKOdGV.js +0 -13
- package/chevron-right-Be3FE3hr.js +0 -13
- package/chevron-right-CRz3MalJ.mjs +0 -12
- package/chevron-top-C68v_E2c.mjs +0 -12
- package/chevron-top-COvCOnB2.js +0 -13
- package/chrome-store-CPJDJNPu.mjs +0 -65
- package/chrome-store-FqwxUZG7.js +0 -66
- package/clock-ByjZ4ilt.js +0 -13
- package/clock-DrLinnc4.mjs +0 -12
- package/close-CKfcXm4W.js +0 -13
- package/close-yanFPosb.mjs +0 -12
- package/coinPlaceholder-3S4HUg2d.js +0 -13
- package/coinPlaceholder-BIfIkMfn.mjs +0 -12
- package/compass-CV7Q0BRl.mjs +0 -12
- package/compass-Cbi2jkxk.js +0 -13
- package/copy-Ca63iQNd.mjs +0 -19
- package/copy-DwGrXa_8.js +0 -20
- package/cursor-BOhtgld_.mjs +0 -7
- package/cursor-CWmF-b84.js +0 -8
- package/cursor-transparent-BwVGzwtu.mjs +0 -16
- package/cursor-transparent-C1tHtAAt.js +0 -17
- package/desktop-332WWCVu.mjs +0 -13
- package/desktop-DFpoQ2XQ.js +0 -14
- package/disconnect-_clyltwg.js +0 -13
- package/disconnect-i16vASLo.mjs +0 -12
- package/discord-B3xzyS21.js +0 -22
- package/discord-Cmks8AXc.mjs +0 -21
- package/email-B4Qs8Wql.mjs +0 -797
- package/email-CSDaC3PV.js +0 -793
- package/embedded-wallet-Z38VX5nD.js +0 -547
- package/embedded-wallet-iJQprDOK.mjs +0 -550
- package/etherscan-DiQKb9JJ.mjs +0 -10
- package/etherscan-DiZfBzq1.js +0 -11
- package/exclamation-triangle-BzIxINm5.js +0 -9
- package/exclamation-triangle-DgSYWQO-.mjs +0 -8
- package/extension-BO0Cd6z8.mjs +0 -12
- package/extension-bF9Sb9iB.js +0 -13
- package/external-link-5DYOaT3U.js +0 -13
- package/external-link-C6tOSZPl.mjs +0 -12
- package/facebook-BNpFIEwz.js +0 -31
- package/facebook-BxE8Pfgx.mjs +0 -30
- package/farcaster-Cn4wtliN.js +0 -17
- package/farcaster-lOD2t_ep.mjs +0 -16
- package/filters-DIWesbdh.js +0 -13
- package/filters-DQYjZNck.mjs +0 -12
- package/github-BK40bIpw.js +0 -23
- package/github-DvTIEePs.mjs +0 -22
- package/google-BEZdehYk.js +0 -23
- package/google-BQODtHO9.mjs +0 -22
- package/help-circle-BoaBQK8j.mjs +0 -16
- package/help-circle-Dafpc2S0.js +0 -17
- package/id-D38R6u_z.js +0 -17
- package/id-Te72spgu.mjs +0 -16
- package/if-defined-Ckbxb_LZ.js +0 -808
- package/if-defined-DwE54thp.mjs +0 -808
- package/image-Dtdls2gL.js +0 -9
- package/image-pcAZlse8.mjs +0 -8
- package/index-B0-hXPyA.mjs +0 -276
- package/index-B5VBriCp.js +0 -166
- package/index-B6PAkUMD.mjs +0 -55
- package/index-BI3g_V6a.js +0 -258
- package/index-BMOzU0g_.mjs +0 -101
- package/index-BREDoavK.mjs +0 -62
- package/index-BieKpvUd.mjs +0 -166
- package/index-Bm64lTwT.mjs +0 -101
- package/index-BmdNakBG.mjs +0 -176
- package/index-BqWHWBPd.js +0 -2237
- package/index-BsSQctOn.mjs +0 -107
- package/index-CB8Xl3BI.mjs +0 -273
- package/index-CE-ThOUU.js +0 -682
- package/index-CJtYUGWk.js +0 -101
- package/index-CNBa_yb_.js +0 -273
- package/index-CNGSm-3v.js +0 -144
- package/index-CZ8svgH6.js +0 -566
- package/index-CgQUQyKy.mjs +0 -812
- package/index-CkqN9i4B.js +0 -103
- package/index-Cwx48WwC.js +0 -265
- package/index-CxbGh3dD.js +0 -59
- package/index-D-QW67ts.js +0 -57
- package/index-D09okGU-.mjs +0 -329
- package/index-D5JBvvTH.mjs +0 -82
- package/index-D97ZdUzy.mjs +0 -95
- package/index-D9W5rupt.js +0 -107
- package/index-DAAXziQn.mjs +0 -57
- package/index-DF_4TKAG.js +0 -344
- package/index-DFgTp8ma.mjs +0 -259
- package/index-DHQBI2q7.mjs +0 -9536
- package/index-DHd3241q.mjs +0 -2235
- package/index-DLv0901W.js +0 -9510
- package/index-DNH3d6sj.js +0 -97
- package/index-DTpnJ3r_.mjs +0 -344
- package/index-DahyraMD.js +0 -178
- package/index-Dp8ypte2.js +0 -84
- package/index-HSJrj1ec.mjs +0 -680
- package/index-Ksar04rg.js +0 -64
- package/index-Oc6Afuhx.mjs +0 -263
- package/index-Sl878vk4.mjs +0 -566
- package/index-Uj_cxq0b.js +0 -152
- package/index-VLLsIwhe.mjs +0 -70
- package/index-XZhf4PTD.js +0 -72
- package/index-f9NdzhLG.mjs +0 -145
- package/index-h3HYCin8.js +0 -331
- package/index-kH104rXk.js +0 -814
- package/index-o5mkLIxK.js +0 -278
- package/index-zw-X0o15.mjs +0 -150
- package/info-DIiGb1WG.mjs +0 -7
- package/info-_1FcljSX.js +0 -8
- package/info-circle-C0cfc1Ai.mjs +0 -16
- package/info-circle-DNrGAlaC.js +0 -17
- package/lightbulb-DAhFAQxe.mjs +0 -7
- package/lightbulb-xep8mw9e.js +0 -8
- package/mail-BP4O1jha.mjs +0 -12
- package/mail-DizrQGIr.js +0 -13
- package/mobile-DN0RkiUA.mjs +0 -13
- package/mobile-jaedeM4x.js +0 -14
- package/more-BwUSQJtS.mjs +0 -15
- package/more-Db1xellQ.js +0 -16
- package/network-placeholder-BFwoDmjz.mjs +0 -18
- package/network-placeholder-Bnr8tbL-.js +0 -19
- package/nftPlaceholder-B1JCCbzW.mjs +0 -12
- package/nftPlaceholder-BwnfvXxH.js +0 -13
- package/off-DgfbvVEQ.js +0 -13
- package/off-HoeLvIQv.mjs +0 -12
- package/onramp-D1g6Jbkc.js +0 -1587
- package/onramp-LOJyQFpR.mjs +0 -1593
- package/play-store-3rRSeyAn.js +0 -37
- package/play-store-BzzZjkgk.mjs +0 -36
- package/plus-DY8W7EOO.js +0 -18
- package/plus-wT-ccjDA.mjs +0 -17
- package/qr-code-BEaXe2LV.js +0 -11
- package/qr-code-BjTH6iOp.mjs +0 -10
- package/react-59f9mIHr.mjs +0 -25357
- package/react-DGsKaIEu.mjs +0 -6077
- package/react-dVsV8KsZ.js +0 -6077
- package/react-m2gZQZx4.js +0 -25357
- package/reactjs/queries/useGetTokens.query.d.ts +0 -3
- package/reactjs/queries/useGetTokens.query.js +0 -34
- package/reactjs/queries/useGetTokens.query.mjs +0 -33
- package/receive-Cs1s1gYM.mjs +0 -216
- package/receive-UwRW4C9x.js +0 -216
- package/recycle-horizontal-BNBaqSZz.js +0 -14
- package/recycle-horizontal-CeHfqJIc.mjs +0 -13
- package/refresh-BA2xhh9V.js +0 -13
- package/refresh-qhuKtgB7.mjs +0 -12
- package/reown-logo-CuHLfpEw.mjs +0 -16
- package/reown-logo-Tq7bFUT6.js +0 -17
- package/search-6n0Ff_dt.mjs +0 -12
- package/search-Cx4Blqfv.js +0 -13
- package/send-B657IEsU.mjs +0 -1193
- package/send-B8cwQAnQ.js +0 -1191
- package/send-D1dMQkPK.js +0 -20
- package/send-t0dgu5ob.mjs +0 -19
- package/socials-BxPH0UFz.js +0 -723
- package/socials-_cnavCl9.mjs +0 -725
- package/swapHorizontal-BVGXUTXy.js +0 -13
- package/swapHorizontal-CZDLEGAJ.mjs +0 -12
- package/swapHorizontalBold-CYGMAdYJ.mjs +0 -12
- package/swapHorizontalBold-CtYibkOJ.js +0 -13
- package/swapHorizontalMedium-BWtcSeVX.mjs +0 -20
- package/swapHorizontalMedium-CX8g5USa.js +0 -21
- package/swapHorizontalRoundedBold-D69LbTIY.js +0 -13
- package/swapHorizontalRoundedBold-DLqIi8XJ.mjs +0 -12
- package/swapVertical-Bygn2_8O.mjs +0 -12
- package/swapVertical-YEu2FTpl.js +0 -13
- package/swaps-BUgwNzkE.js +0 -1906
- package/swaps-CN6V4itg.mjs +0 -1908
- package/telegram-B3TsPPWG.mjs +0 -20
- package/telegram-BzZxoCON.js +0 -21
- package/three-dots-B9-WRm9o.mjs +0 -9
- package/three-dots-kGCFeW5_.js +0 -10
- package/transactions-C4LyMy2H.js +0 -37
- package/transactions-Cgbyv_T6.mjs +0 -37
- package/twitch-BBdiYoRQ.js +0 -23
- package/twitch-BNJQGRXy.mjs +0 -22
- package/twitterIcon-CR6NDfBD.js +0 -11
- package/twitterIcon-Onqp_sDr.mjs +0 -10
- package/useBalances-CMixgIRU.js +0 -196
- package/useBalances-rRug6Uza.mjs +0 -196
- package/verify-B99cyMD7.js +0 -13
- package/verify-Eoq8GSce.mjs +0 -12
- package/verify-filled-BQXXBU08.mjs +0 -12
- package/verify-filled-CiEDnETf.js +0 -13
- package/w3m-modal-B7NYvu08.js +0 -1208
- package/w3m-modal-Bu0ZSyML.mjs +0 -1208
- package/wallet-BcT8lNii.js +0 -13
- package/wallet-dOYVmmoC.mjs +0 -12
- package/wallet-placeholder-D_dKjqBq.mjs +0 -18
- package/wallet-placeholder-_pc2YkIy.js +0 -19
- package/walletconnect-CP6kDQcs.mjs +0 -38
- package/walletconnect-yIf5ci65.js +0 -39
- package/warning-circle-CKiBhLmZ.js +0 -17
- package/warning-circle-D0zgojhL.mjs +0 -16
- package/x-D4lyzn0g.js +0 -17
- package/x-DyfNtc-k.mjs +0 -16
package/README.md
CHANGED
|
@@ -161,12 +161,11 @@ const App = () => {
|
|
|
161
161
|
|
|
162
162
|
return (
|
|
163
163
|
// Wrap your app with Web3AppProvider to enable multi-chain connections
|
|
164
|
-
<Web3AppProvider appKit={provider.appKit} config={provider.config} options={provider.options}>
|
|
164
|
+
<Web3AppProvider appKit={provider.appKit} config={provider.config} options={provider.options} nativeAuthToken={nativeAuthToken}>
|
|
165
165
|
<BridgeForm
|
|
166
166
|
mvxChainId={"44"}
|
|
167
167
|
mvxAddress={mvxAccount?.address}
|
|
168
168
|
username={mvxAccount?.username}
|
|
169
|
-
nativeAuthToken={nativeAuthToken}
|
|
170
169
|
callbackRoute={"/deposit"}
|
|
171
170
|
showHistory={showHistory}
|
|
172
171
|
onSuccessfullySentTransaction={(txHashes) => {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CheckAccountDto } from '../dto/CheckAccount.dto';
|
|
2
|
+
import { AxiosResponse } from 'axios';
|
|
3
|
+
|
|
4
|
+
export declare function checkAccount({ url, walletAddress, chainId, nativeAuthToken }: {
|
|
5
|
+
url: string;
|
|
6
|
+
walletAddress: string;
|
|
7
|
+
chainId: string;
|
|
8
|
+
nativeAuthToken: string;
|
|
9
|
+
}): Promise<AxiosResponse<CheckAccountDto>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const axios = require("axios");
|
|
5
|
+
async function checkAccount({
|
|
6
|
+
url,
|
|
7
|
+
walletAddress,
|
|
8
|
+
chainId,
|
|
9
|
+
nativeAuthToken
|
|
10
|
+
}) {
|
|
11
|
+
const config = {
|
|
12
|
+
baseURL: url,
|
|
13
|
+
headers: {
|
|
14
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
return await axios.get(
|
|
18
|
+
`/user/checkAccount?walletAddress=${walletAddress}&chainId=${chainId}`,
|
|
19
|
+
config
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
exports.checkAccount = checkAccount;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
async function checkAccount({
|
|
3
|
+
url,
|
|
4
|
+
walletAddress,
|
|
5
|
+
chainId,
|
|
6
|
+
nativeAuthToken
|
|
7
|
+
}) {
|
|
8
|
+
const config = {
|
|
9
|
+
baseURL: url,
|
|
10
|
+
headers: {
|
|
11
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
return await axios.get(
|
|
15
|
+
`/user/checkAccount?walletAddress=${walletAddress}&chainId=${chainId}`,
|
|
16
|
+
config
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
checkAccount
|
|
21
|
+
};
|
package/api/getChains.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ChainDTO } from '../dto/Chain.dto';
|
|
2
2
|
import { AxiosResponse } from 'axios';
|
|
3
3
|
|
|
4
|
-
export declare function getChains({ url }: {
|
|
4
|
+
export declare function getChains({ url, nativeAuthToken, bridgeOnly }: {
|
|
5
5
|
url: string;
|
|
6
|
+
nativeAuthToken: string;
|
|
7
|
+
bridgeOnly: boolean;
|
|
6
8
|
}): Promise<AxiosResponse<ChainDTO[]>>;
|
package/api/getChains.js
CHANGED
|
@@ -3,10 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
const axios = require("axios");
|
|
5
5
|
async function getChains({
|
|
6
|
-
url
|
|
6
|
+
url,
|
|
7
|
+
nativeAuthToken,
|
|
8
|
+
bridgeOnly
|
|
7
9
|
}) {
|
|
8
|
-
|
|
9
|
-
baseURL: url
|
|
10
|
-
|
|
10
|
+
const config = {
|
|
11
|
+
baseURL: url,
|
|
12
|
+
headers: {
|
|
13
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
return await axios.get(`/chains?isBridge=${bridgeOnly}`, config);
|
|
11
17
|
}
|
|
12
18
|
exports.getChains = getChains;
|
package/api/getChains.mjs
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
async function getChains({
|
|
3
|
-
url
|
|
3
|
+
url,
|
|
4
|
+
nativeAuthToken,
|
|
5
|
+
bridgeOnly
|
|
4
6
|
}) {
|
|
5
|
-
|
|
6
|
-
baseURL: url
|
|
7
|
-
|
|
7
|
+
const config = {
|
|
8
|
+
baseURL: url,
|
|
9
|
+
headers: {
|
|
10
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
return await axios.get(`/chains?isBridge=${bridgeOnly}`, config);
|
|
8
14
|
}
|
|
9
15
|
export {
|
|
10
16
|
getChains
|
package/api/getTokens.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { TokenType } from '../types/token';
|
|
2
2
|
import { AxiosResponse } from 'axios';
|
|
3
3
|
|
|
4
|
-
export declare function getTokens({ url, chainId }: {
|
|
4
|
+
export declare function getTokens({ url, chainId, nativeAuthToken, bridgeOnly }: {
|
|
5
5
|
url: string;
|
|
6
6
|
chainId?: number;
|
|
7
|
+
nativeAuthToken: string;
|
|
8
|
+
bridgeOnly: boolean;
|
|
7
9
|
}): Promise<AxiosResponse<TokenType[]>>;
|
package/api/getTokens.js
CHANGED
|
@@ -4,11 +4,20 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
const axios = require("axios");
|
|
5
5
|
async function getTokens({
|
|
6
6
|
url,
|
|
7
|
-
chainId
|
|
7
|
+
chainId,
|
|
8
|
+
nativeAuthToken,
|
|
9
|
+
bridgeOnly
|
|
8
10
|
}) {
|
|
11
|
+
const config = {
|
|
12
|
+
baseURL: url,
|
|
13
|
+
headers: {
|
|
14
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
15
|
+
}
|
|
16
|
+
};
|
|
9
17
|
const endpoint = chainId ? `/tokens/${chainId}` : "/tokens";
|
|
10
|
-
return await axios.get(
|
|
11
|
-
|
|
12
|
-
|
|
18
|
+
return await axios.get(
|
|
19
|
+
`${endpoint}?isBridge=${bridgeOnly}`,
|
|
20
|
+
config
|
|
21
|
+
);
|
|
13
22
|
}
|
|
14
23
|
exports.getTokens = getTokens;
|
package/api/getTokens.mjs
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
async function getTokens({
|
|
3
3
|
url,
|
|
4
|
-
chainId
|
|
4
|
+
chainId,
|
|
5
|
+
nativeAuthToken,
|
|
6
|
+
bridgeOnly
|
|
5
7
|
}) {
|
|
8
|
+
const config = {
|
|
9
|
+
baseURL: url,
|
|
10
|
+
headers: {
|
|
11
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
12
|
+
}
|
|
13
|
+
};
|
|
6
14
|
const endpoint = chainId ? `/tokens/${chainId}` : "/tokens";
|
|
7
|
-
return await axios.get(
|
|
8
|
-
|
|
9
|
-
|
|
15
|
+
return await axios.get(
|
|
16
|
+
`${endpoint}?isBridge=${bridgeOnly}`,
|
|
17
|
+
config
|
|
18
|
+
);
|
|
10
19
|
}
|
|
11
20
|
export {
|
|
12
21
|
getTokens
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { TokenBalanceDTO } from '../dto/TokenBalance.dto';
|
|
2
2
|
import { AxiosResponse } from 'axios';
|
|
3
3
|
|
|
4
|
-
export declare function getTokensBalances({ url, userAddress, chainId }: {
|
|
4
|
+
export declare function getTokensBalances({ url, userAddress, chainId, nativeAuthToken }: {
|
|
5
5
|
url: string;
|
|
6
6
|
userAddress: string;
|
|
7
7
|
chainId: string;
|
|
8
|
+
nativeAuthToken: string;
|
|
8
9
|
}): Promise<AxiosResponse<TokenBalanceDTO[]>>;
|
package/api/getTokensBalances.js
CHANGED
|
@@ -5,13 +5,18 @@ const axios = require("axios");
|
|
|
5
5
|
async function getTokensBalances({
|
|
6
6
|
url,
|
|
7
7
|
userAddress,
|
|
8
|
-
chainId
|
|
8
|
+
chainId,
|
|
9
|
+
nativeAuthToken
|
|
9
10
|
}) {
|
|
11
|
+
const config = {
|
|
12
|
+
baseURL: url,
|
|
13
|
+
headers: {
|
|
14
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
15
|
+
}
|
|
16
|
+
};
|
|
10
17
|
return await axios.get(
|
|
11
18
|
`/tokens/balances/${userAddress}/${chainId}`,
|
|
12
|
-
|
|
13
|
-
baseURL: url
|
|
14
|
-
}
|
|
19
|
+
config
|
|
15
20
|
);
|
|
16
21
|
}
|
|
17
22
|
exports.getTokensBalances = getTokensBalances;
|
|
@@ -2,13 +2,18 @@ import axios from "axios";
|
|
|
2
2
|
async function getTokensBalances({
|
|
3
3
|
url,
|
|
4
4
|
userAddress,
|
|
5
|
-
chainId
|
|
5
|
+
chainId,
|
|
6
|
+
nativeAuthToken
|
|
6
7
|
}) {
|
|
8
|
+
const config = {
|
|
9
|
+
baseURL: url,
|
|
10
|
+
headers: {
|
|
11
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
12
|
+
}
|
|
13
|
+
};
|
|
7
14
|
return await axios.get(
|
|
8
15
|
`/tokens/balances/${userAddress}/${chainId}`,
|
|
9
|
-
|
|
10
|
-
baseURL: url
|
|
11
|
-
}
|
|
16
|
+
config
|
|
12
17
|
);
|
|
13
18
|
}
|
|
14
19
|
export {
|
package/api/getTransactions.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ProviderType } from 'types/providerType';
|
|
|
2
2
|
import { TransactionDTO } from 'dto/Transaction.dto';
|
|
3
3
|
import { AxiosResponse } from 'axios';
|
|
4
4
|
|
|
5
|
-
export declare function getTransactions({ url, address, sender, provider, status, tokenIn, tokenOut }: {
|
|
5
|
+
export declare function getTransactions({ url, address, sender, provider, status, tokenIn, tokenOut, nativeAuthToken }: {
|
|
6
6
|
url: string;
|
|
7
7
|
address: string;
|
|
8
8
|
sender?: string;
|
|
@@ -10,4 +10,5 @@ export declare function getTransactions({ url, address, sender, provider, status
|
|
|
10
10
|
status?: string;
|
|
11
11
|
tokenIn?: string;
|
|
12
12
|
tokenOut?: string;
|
|
13
|
+
nativeAuthToken: string;
|
|
13
14
|
}): Promise<AxiosResponse<TransactionDTO[]>>;
|
package/api/getTransactions.js
CHANGED
|
@@ -9,7 +9,8 @@ async function getTransactions({
|
|
|
9
9
|
provider,
|
|
10
10
|
status,
|
|
11
11
|
tokenIn,
|
|
12
|
-
tokenOut
|
|
12
|
+
tokenOut,
|
|
13
|
+
nativeAuthToken
|
|
13
14
|
}) {
|
|
14
15
|
const queryParams = new URLSearchParams({
|
|
15
16
|
receiver: address || "",
|
|
@@ -19,15 +20,20 @@ async function getTransactions({
|
|
|
19
20
|
tokenIn: tokenIn || "",
|
|
20
21
|
tokenOut: tokenOut || ""
|
|
21
22
|
});
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
const params = Object.entries(Object.fromEntries(queryParams.entries()));
|
|
24
|
+
for (const [key, value] of params) {
|
|
25
|
+
if (value === "") {
|
|
24
26
|
queryParams.delete(key);
|
|
25
27
|
}
|
|
26
28
|
}
|
|
27
29
|
const queryString = queryParams.toString();
|
|
28
|
-
const endpointWithParams = `/transactions
|
|
29
|
-
|
|
30
|
-
baseURL: url
|
|
31
|
-
|
|
30
|
+
const endpointWithParams = `/transactions?${queryString}`;
|
|
31
|
+
const config = {
|
|
32
|
+
baseURL: url,
|
|
33
|
+
headers: {
|
|
34
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
return await axios.get(endpointWithParams, config);
|
|
32
38
|
}
|
|
33
39
|
exports.getTransactions = getTransactions;
|
package/api/getTransactions.mjs
CHANGED
|
@@ -6,7 +6,8 @@ async function getTransactions({
|
|
|
6
6
|
provider,
|
|
7
7
|
status,
|
|
8
8
|
tokenIn,
|
|
9
|
-
tokenOut
|
|
9
|
+
tokenOut,
|
|
10
|
+
nativeAuthToken
|
|
10
11
|
}) {
|
|
11
12
|
const queryParams = new URLSearchParams({
|
|
12
13
|
receiver: address || "",
|
|
@@ -16,16 +17,21 @@ async function getTransactions({
|
|
|
16
17
|
tokenIn: tokenIn || "",
|
|
17
18
|
tokenOut: tokenOut || ""
|
|
18
19
|
});
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
const params = Object.entries(Object.fromEntries(queryParams.entries()));
|
|
21
|
+
for (const [key, value] of params) {
|
|
22
|
+
if (value === "") {
|
|
21
23
|
queryParams.delete(key);
|
|
22
24
|
}
|
|
23
25
|
}
|
|
24
26
|
const queryString = queryParams.toString();
|
|
25
|
-
const endpointWithParams = `/transactions
|
|
26
|
-
|
|
27
|
-
baseURL: url
|
|
28
|
-
|
|
27
|
+
const endpointWithParams = `/transactions?${queryString}`;
|
|
28
|
+
const config = {
|
|
29
|
+
baseURL: url,
|
|
30
|
+
headers: {
|
|
31
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
return await axios.get(endpointWithParams, config);
|
|
29
35
|
}
|
|
30
36
|
export {
|
|
31
37
|
getTransactions
|
package/api/index.d.ts
CHANGED
package/api/index.js
CHANGED
|
@@ -8,6 +8,8 @@ const api_getTokens = require("./getTokens.js");
|
|
|
8
8
|
const api_getTokensBalances = require("./getTokensBalances.js");
|
|
9
9
|
const api_getTransactions = require("./getTransactions.js");
|
|
10
10
|
const api_sendTransactions = require("./sendTransactions.js");
|
|
11
|
+
const api_checkAccount = require("./checkAccount.js");
|
|
12
|
+
const api_linkAccount = require("./linkAccount.js");
|
|
11
13
|
exports.confirmRate = api_confirmRate.confirmRate;
|
|
12
14
|
exports.getChains = api_getChains.getChains;
|
|
13
15
|
exports.getRate = api_getRate.getRate;
|
|
@@ -15,3 +17,5 @@ exports.getTokens = api_getTokens.getTokens;
|
|
|
15
17
|
exports.getTokensBalances = api_getTokensBalances.getTokensBalances;
|
|
16
18
|
exports.getTransactions = api_getTransactions.getTransactions;
|
|
17
19
|
exports.sendTransactions = api_sendTransactions.sendTransactions;
|
|
20
|
+
exports.checkAccount = api_checkAccount.checkAccount;
|
|
21
|
+
exports.linkAccount = api_linkAccount.linkAccount;
|
package/api/index.mjs
CHANGED
|
@@ -5,12 +5,16 @@ import { getTokens } from "./getTokens.mjs";
|
|
|
5
5
|
import { getTokensBalances } from "./getTokensBalances.mjs";
|
|
6
6
|
import { getTransactions } from "./getTransactions.mjs";
|
|
7
7
|
import { sendTransactions } from "./sendTransactions.mjs";
|
|
8
|
+
import { checkAccount } from "./checkAccount.mjs";
|
|
9
|
+
import { linkAccount } from "./linkAccount.mjs";
|
|
8
10
|
export {
|
|
11
|
+
checkAccount,
|
|
9
12
|
confirmRate,
|
|
10
13
|
getChains,
|
|
11
14
|
getRate,
|
|
12
15
|
getTokens,
|
|
13
16
|
getTokensBalances,
|
|
14
17
|
getTransactions,
|
|
18
|
+
linkAccount,
|
|
15
19
|
sendTransactions
|
|
16
20
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LinkAccountRequestBody } from '../types/linkAccount';
|
|
2
|
+
import { AxiosResponse } from 'axios';
|
|
3
|
+
|
|
4
|
+
interface LinkAccountProps {
|
|
5
|
+
url: string;
|
|
6
|
+
nativeAuthToken: string;
|
|
7
|
+
body: LinkAccountRequestBody;
|
|
8
|
+
}
|
|
9
|
+
export declare function linkAccount({ url, nativeAuthToken, body }: LinkAccountProps): Promise<AxiosResponse>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const axios = require("axios");
|
|
5
|
+
const helpers_decodeToken = require("../helpers/decodeToken.js");
|
|
6
|
+
async function linkAccount({
|
|
7
|
+
url,
|
|
8
|
+
nativeAuthToken,
|
|
9
|
+
body
|
|
10
|
+
}) {
|
|
11
|
+
var _a;
|
|
12
|
+
const config = {
|
|
13
|
+
baseURL: url,
|
|
14
|
+
headers: {
|
|
15
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
if (!nativeAuthToken) {
|
|
19
|
+
(_a = config.headers) == null ? true : delete _a.Authorization;
|
|
20
|
+
}
|
|
21
|
+
const decodedToken = await helpers_decodeToken.decodeToken(nativeAuthToken);
|
|
22
|
+
config.headers = {
|
|
23
|
+
...config.headers,
|
|
24
|
+
origin: decodedToken == null ? void 0 : decodedToken.origin
|
|
25
|
+
};
|
|
26
|
+
return await axios.post(
|
|
27
|
+
`/user/linkAccount`,
|
|
28
|
+
body,
|
|
29
|
+
config
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
exports.linkAccount = linkAccount;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { decodeToken } from "../helpers/decodeToken.mjs";
|
|
3
|
+
async function linkAccount({
|
|
4
|
+
url,
|
|
5
|
+
nativeAuthToken,
|
|
6
|
+
body
|
|
7
|
+
}) {
|
|
8
|
+
var _a;
|
|
9
|
+
const config = {
|
|
10
|
+
baseURL: url,
|
|
11
|
+
headers: {
|
|
12
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
if (!nativeAuthToken) {
|
|
16
|
+
(_a = config.headers) == null ? true : delete _a.Authorization;
|
|
17
|
+
}
|
|
18
|
+
const decodedToken = await decodeToken(nativeAuthToken);
|
|
19
|
+
config.headers = {
|
|
20
|
+
...config.headers,
|
|
21
|
+
origin: decodedToken == null ? void 0 : decodedToken.origin
|
|
22
|
+
};
|
|
23
|
+
return await axios.post(
|
|
24
|
+
`/user/linkAccount`,
|
|
25
|
+
body,
|
|
26
|
+
config
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
linkAccount
|
|
31
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
const axios = require("axios");
|
|
4
|
+
const types_chainType = require("../../types/chainType.js");
|
|
4
5
|
const api_getChains = require("../getChains.js");
|
|
5
6
|
jest.mock("axios");
|
|
6
7
|
const mockedAxios = axios;
|
|
@@ -13,7 +14,7 @@ describe("getChains", () => {
|
|
|
13
14
|
chainName: "msx",
|
|
14
15
|
pngUrl: "https://devnet-tools.multiversx.com/liquidity-sdk/ethereum/icon.png",
|
|
15
16
|
svgUrl: "https://devnet-tools.multiversx.com/liquidity-sdk/ethereum/icon.svg",
|
|
16
|
-
chainType:
|
|
17
|
+
chainType: types_chainType.ChainType.evm,
|
|
17
18
|
rpc: "rpc1",
|
|
18
19
|
blockExplorerUrls: ["explorer1"],
|
|
19
20
|
nativeCurrency: {
|
|
@@ -26,12 +27,18 @@ describe("getChains", () => {
|
|
|
26
27
|
}
|
|
27
28
|
];
|
|
28
29
|
mockedAxios.get.mockResolvedValue({ data: response });
|
|
29
|
-
const result = await api_getChains.getChains({
|
|
30
|
+
const result = await api_getChains.getChains({
|
|
31
|
+
url,
|
|
32
|
+
nativeAuthToken: "ZKssadass",
|
|
33
|
+
bridgeOnly: false
|
|
34
|
+
});
|
|
30
35
|
expect(mockedAxios.get).toHaveBeenCalledWith("/chains", { baseURL: url });
|
|
31
36
|
expect(result.data).toEqual(response);
|
|
32
37
|
});
|
|
33
38
|
it("handles error when fetching chains", async () => {
|
|
34
39
|
mockedAxios.get.mockRejectedValue(new Error("Network Error"));
|
|
35
|
-
await expect(
|
|
40
|
+
await expect(
|
|
41
|
+
api_getChains.getChains({ url, nativeAuthToken: "ZKssadass", bridgeOnly: false })
|
|
42
|
+
).rejects.toThrow("Network Error");
|
|
36
43
|
});
|
|
37
44
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
|
+
import { ChainType } from "../../types/chainType.mjs";
|
|
2
3
|
import { getChains } from "../getChains.mjs";
|
|
3
4
|
jest.mock("axios");
|
|
4
5
|
const mockedAxios = axios;
|
|
@@ -11,7 +12,7 @@ describe("getChains", () => {
|
|
|
11
12
|
chainName: "msx",
|
|
12
13
|
pngUrl: "https://devnet-tools.multiversx.com/liquidity-sdk/ethereum/icon.png",
|
|
13
14
|
svgUrl: "https://devnet-tools.multiversx.com/liquidity-sdk/ethereum/icon.svg",
|
|
14
|
-
chainType:
|
|
15
|
+
chainType: ChainType.evm,
|
|
15
16
|
rpc: "rpc1",
|
|
16
17
|
blockExplorerUrls: ["explorer1"],
|
|
17
18
|
nativeCurrency: {
|
|
@@ -24,12 +25,18 @@ describe("getChains", () => {
|
|
|
24
25
|
}
|
|
25
26
|
];
|
|
26
27
|
mockedAxios.get.mockResolvedValue({ data: response });
|
|
27
|
-
const result = await getChains({
|
|
28
|
+
const result = await getChains({
|
|
29
|
+
url,
|
|
30
|
+
nativeAuthToken: "ZKssadass",
|
|
31
|
+
bridgeOnly: false
|
|
32
|
+
});
|
|
28
33
|
expect(mockedAxios.get).toHaveBeenCalledWith("/chains", { baseURL: url });
|
|
29
34
|
expect(result.data).toEqual(response);
|
|
30
35
|
});
|
|
31
36
|
it("handles error when fetching chains", async () => {
|
|
32
37
|
mockedAxios.get.mockRejectedValue(new Error("Network Error"));
|
|
33
|
-
await expect(
|
|
38
|
+
await expect(
|
|
39
|
+
getChains({ url, nativeAuthToken: "ZKssadass", bridgeOnly: false })
|
|
40
|
+
).rejects.toThrow("Network Error");
|
|
34
41
|
});
|
|
35
42
|
});
|
|
@@ -9,7 +9,7 @@ describe("getTokens", () => {
|
|
|
9
9
|
it("fetches tokens successfully without chainId", async () => {
|
|
10
10
|
const response = [
|
|
11
11
|
{
|
|
12
|
-
chainId: 1,
|
|
12
|
+
chainId: "1",
|
|
13
13
|
address: "0x123",
|
|
14
14
|
name: "Token One",
|
|
15
15
|
symbol: "T1",
|
|
@@ -24,7 +24,11 @@ describe("getTokens", () => {
|
|
|
24
24
|
}
|
|
25
25
|
];
|
|
26
26
|
mockedAxios.get.mockResolvedValue({ data: response });
|
|
27
|
-
const result = await api_getTokens.getTokens({
|
|
27
|
+
const result = await api_getTokens.getTokens({
|
|
28
|
+
url,
|
|
29
|
+
nativeAuthToken: "",
|
|
30
|
+
bridgeOnly: false
|
|
31
|
+
});
|
|
28
32
|
expect(mockedAxios.get).toHaveBeenCalledWith("/tokens", { baseURL: url });
|
|
29
33
|
expect(result.data).toEqual(response);
|
|
30
34
|
});
|
|
@@ -32,7 +36,7 @@ describe("getTokens", () => {
|
|
|
32
36
|
const chainId = 1;
|
|
33
37
|
const response = [
|
|
34
38
|
{
|
|
35
|
-
chainId: 1,
|
|
39
|
+
chainId: "1",
|
|
36
40
|
address: "0x123",
|
|
37
41
|
name: "Token One",
|
|
38
42
|
symbol: "T1",
|
|
@@ -47,7 +51,12 @@ describe("getTokens", () => {
|
|
|
47
51
|
}
|
|
48
52
|
];
|
|
49
53
|
mockedAxios.get.mockResolvedValue({ data: response });
|
|
50
|
-
const result = await api_getTokens.getTokens({
|
|
54
|
+
const result = await api_getTokens.getTokens({
|
|
55
|
+
url,
|
|
56
|
+
chainId,
|
|
57
|
+
nativeAuthToken: "",
|
|
58
|
+
bridgeOnly: false
|
|
59
|
+
});
|
|
51
60
|
expect(mockedAxios.get).toHaveBeenCalledWith(`/tokens/${chainId}`, {
|
|
52
61
|
baseURL: url
|
|
53
62
|
});
|
|
@@ -55,6 +64,8 @@ describe("getTokens", () => {
|
|
|
55
64
|
});
|
|
56
65
|
it("handles error when fetching tokens", async () => {
|
|
57
66
|
mockedAxios.get.mockRejectedValue(new Error("Network Error"));
|
|
58
|
-
await expect(
|
|
67
|
+
await expect(
|
|
68
|
+
api_getTokens.getTokens({ url, nativeAuthToken: "", bridgeOnly: false })
|
|
69
|
+
).rejects.toThrow("Network Error");
|
|
59
70
|
});
|
|
60
71
|
});
|
|
@@ -7,7 +7,7 @@ describe("getTokens", () => {
|
|
|
7
7
|
it("fetches tokens successfully without chainId", async () => {
|
|
8
8
|
const response = [
|
|
9
9
|
{
|
|
10
|
-
chainId: 1,
|
|
10
|
+
chainId: "1",
|
|
11
11
|
address: "0x123",
|
|
12
12
|
name: "Token One",
|
|
13
13
|
symbol: "T1",
|
|
@@ -22,7 +22,11 @@ describe("getTokens", () => {
|
|
|
22
22
|
}
|
|
23
23
|
];
|
|
24
24
|
mockedAxios.get.mockResolvedValue({ data: response });
|
|
25
|
-
const result = await getTokens({
|
|
25
|
+
const result = await getTokens({
|
|
26
|
+
url,
|
|
27
|
+
nativeAuthToken: "",
|
|
28
|
+
bridgeOnly: false
|
|
29
|
+
});
|
|
26
30
|
expect(mockedAxios.get).toHaveBeenCalledWith("/tokens", { baseURL: url });
|
|
27
31
|
expect(result.data).toEqual(response);
|
|
28
32
|
});
|
|
@@ -30,7 +34,7 @@ describe("getTokens", () => {
|
|
|
30
34
|
const chainId = 1;
|
|
31
35
|
const response = [
|
|
32
36
|
{
|
|
33
|
-
chainId: 1,
|
|
37
|
+
chainId: "1",
|
|
34
38
|
address: "0x123",
|
|
35
39
|
name: "Token One",
|
|
36
40
|
symbol: "T1",
|
|
@@ -45,7 +49,12 @@ describe("getTokens", () => {
|
|
|
45
49
|
}
|
|
46
50
|
];
|
|
47
51
|
mockedAxios.get.mockResolvedValue({ data: response });
|
|
48
|
-
const result = await getTokens({
|
|
52
|
+
const result = await getTokens({
|
|
53
|
+
url,
|
|
54
|
+
chainId,
|
|
55
|
+
nativeAuthToken: "",
|
|
56
|
+
bridgeOnly: false
|
|
57
|
+
});
|
|
49
58
|
expect(mockedAxios.get).toHaveBeenCalledWith(`/tokens/${chainId}`, {
|
|
50
59
|
baseURL: url
|
|
51
60
|
});
|
|
@@ -53,6 +62,8 @@ describe("getTokens", () => {
|
|
|
53
62
|
});
|
|
54
63
|
it("handles error when fetching tokens", async () => {
|
|
55
64
|
mockedAxios.get.mockRejectedValue(new Error("Network Error"));
|
|
56
|
-
await expect(
|
|
65
|
+
await expect(
|
|
66
|
+
getTokens({ url, nativeAuthToken: "", bridgeOnly: false })
|
|
67
|
+
).rejects.toThrow("Network Error");
|
|
57
68
|
});
|
|
58
69
|
});
|