@multiversx/sdk-dapp-liquidity 1.1.0-alpha.4 → 1.1.0-alpha.40
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 +7 -3
- package/api/checkAccount.d.ts +9 -0
- package/api/checkAccount.js +22 -0
- package/api/checkAccount.mjs +21 -0
- package/api/getChains.d.ts +2 -1
- package/api/getChains.js +9 -4
- package/api/getChains.mjs +9 -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 +9 -2
- package/api/getTransactions.js +29 -4
- package/api/getTransactions.mjs +29 -4
- 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 +6 -3
- package/api/tests/getChains.spec.mjs +6 -3
- package/api/tests/getTokens.spec.js +16 -5
- package/api/tests/getTokens.spec.mjs +16 -5
- package/api/tests/getTransactions.spec.js +85 -69
- package/api/tests/getTransactions.spec.mjs +85 -69
- 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/index.js +46 -16
- package/index.mjs +16 -16
- package/package.json +10 -6
- package/reactjs/components/BridgeForm/BridgeForm.d.ts +6 -2
- package/reactjs/components/BridgeForm/BridgeForm.js +236 -99
- package/reactjs/components/BridgeForm/BridgeForm.mjs +209 -72
- package/reactjs/components/BridgeHistory/BridgeHistory.js +79 -32
- package/reactjs/components/BridgeHistory/BridgeHistory.mjs +74 -27
- package/reactjs/components/Connect/BridgeAccountDisplay.js +66 -9
- package/reactjs/components/Connect/BridgeAccountDisplay.mjs +66 -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 +5 -1
- package/reactjs/context/Web3AppProvider.js +12 -6
- package/reactjs/context/Web3AppProvider.mjs +9 -3
- package/reactjs/context/useWeb3App.js +2 -2
- package/reactjs/hooks/index.js +1 -1
- package/reactjs/hooks/index.mjs +1 -1
- package/reactjs/hooks/useAccount.d.ts +4 -4
- package/reactjs/hooks/useAccount.js +1 -6
- package/reactjs/hooks/useAccount.mjs +1 -6
- package/reactjs/hooks/useBalances.d.ts +1 -3
- package/reactjs/hooks/useBalances.js +16 -1
- package/reactjs/hooks/useBalances.mjs +16 -1
- package/reactjs/hooks/useBridgeFormik.d.ts +1 -3
- package/reactjs/hooks/useBridgeFormik.js +14 -46
- package/reactjs/hooks/useBridgeFormik.mjs +9 -41
- 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 +8 -12
- package/reactjs/hooks/useFetchTokens.mjs +2 -6
- 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 +93 -67
- package/reactjs/hooks/useSignTransaction.js +53 -4
- package/reactjs/hooks/useSignTransaction.mjs +53 -4
- package/reactjs/hooks/validation/useTestHasEnoughFunds.js +3 -3
- package/reactjs/hooks/validation/useTestIsConnected.js +2 -2
- package/reactjs/index.js +42 -16
- package/reactjs/index.mjs +12 -16
- package/reactjs/init/init.d.ts +220 -1
- package/reactjs/init/init.js +34 -10
- package/reactjs/init/init.mjs +31 -7
- package/reactjs/init/tests/init.spec.js +5 -6
- package/reactjs/init/tests/init.spec.mjs +5 -6
- package/reactjs/queries/index.d.ts +0 -1
- package/reactjs/queries/index.js +0 -2
- package/reactjs/queries/index.mjs +1 -3
- 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.d.ts +1 -1
- package/reactjs/queries/useGetAllTokens.query.js +6 -2
- package/reactjs/queries/useGetAllTokens.query.mjs +6 -2
- package/reactjs/queries/useGetChains.query.js +5 -2
- package/reactjs/queries/useGetChains.query.mjs +5 -2
- package/reactjs/queries/useGetEvmTokensBalances.query.d.ts +6 -2
- package/reactjs/queries/useGetEvmTokensBalances.query.js +7 -10
- package/reactjs/queries/useGetEvmTokensBalances.query.mjs +7 -10
- package/reactjs/queries/useGetHistory.query.d.ts +9 -1
- package/reactjs/queries/useGetHistory.query.js +27 -5
- package/reactjs/queries/useGetHistory.query.mjs +27 -5
- 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/useLinkAccount.mutation.d.ts +6 -0
- package/{modules/fiat/queries/useGetRate.mutation.js → reactjs/queries/useLinkAccount.mutation.js} +5 -6
- package/{modules/fiat/queries/useGetRate.mutation.mjs → reactjs/queries/useLinkAccount.mutation.mjs} +5 -6
- 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 +3 -1756
- 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 +28 -0
- package/types/utxo.d.ts +11 -0
- package/types/utxo.js +2 -0
- package/types/utxo.mjs +1 -0
- package/{useBalances-rRug6Uza.mjs → useBalances-CtcrEcK2.mjs} +99 -14
- package/{useBalances-CMixgIRU.js → useBalances-ok4GNkJ5.js} +100 -15
- package/add-3BCUvSCt.mjs +0 -19
- package/add-DCeZeenO.js +0 -20
- package/all-wallets-BmgBKRug.js +0 -11
- package/all-wallets-FKmNZ66z.mjs +0 -10
- package/app-store-CbYWgqmd.mjs +0 -21
- package/app-store-D_5F0mR4.js +0 -22
- package/apple-8B_b8kAc.mjs +0 -22
- package/apple-BwYB0tMQ.js +0 -23
- package/arrow-bottom-3XtFygVb.mjs +0 -12
- package/arrow-bottom-B4l4HJCy.js +0 -13
- package/arrow-bottom-circle-BnvomGtz.mjs +0 -15
- package/arrow-bottom-circle-KobZJ_fK.js +0 -16
- package/arrow-left-CjiJwBax.js +0 -13
- package/arrow-left-DbIgXHar.mjs +0 -12
- package/arrow-right-Bhg8xM3d.mjs +0 -12
- package/arrow-right-xU29L0ax.js +0 -13
- package/arrow-top-CSBKtLZo.js +0 -13
- package/arrow-top-DZqppJV1.mjs +0 -12
- package/bank-DJAILbNs.js +0 -19
- package/bank-wBrvs4Uk.mjs +0 -18
- package/bitcoin-DsA7-exS.mjs +0 -3541
- package/bitcoin-ymxJHn-_.js +0 -3541
- package/browser-CMwRVF9i.mjs +0 -18
- package/browser-DN2v3wtx.js +0 -19
- package/card-DCJLvVxE.js +0 -19
- package/card-le6hOsaj.mjs +0 -18
- package/checkmark-Cp3aAXtY.js +0 -16
- package/checkmark-DrMAKEwB.mjs +0 -15
- package/checkmark-bold-Ck4iDbtx.mjs +0 -12
- package/checkmark-bold-Doo1m0AX.js +0 -13
- package/chevron-bottom-D7BdJX-N.mjs +0 -12
- package/chevron-bottom-njC8Ngo9.js +0 -13
- package/chevron-left-C276To1p.mjs +0 -12
- package/chevron-left-DFqStS4C.js +0 -13
- package/chevron-right-BEaNKTUI.js +0 -13
- package/chevron-right-BLKwojDw.mjs +0 -12
- package/chevron-top-B7MGJq4-.mjs +0 -12
- package/chevron-top-Cwq1_meI.js +0 -13
- package/chrome-store-C5TevyVh.mjs +0 -65
- package/chrome-store-CMNN4-HT.js +0 -66
- package/clock-DJj9e3f9.js +0 -13
- package/clock-DzimdgI_.mjs +0 -12
- package/close-B157dUQ4.mjs +0 -12
- package/close-BxR6tB8U.js +0 -13
- package/coinPlaceholder-BVW1uvlR.js +0 -13
- package/coinPlaceholder-HBSLiUFH.mjs +0 -12
- package/compass-BYgmipOo.js +0 -13
- package/compass-DjjI5p4A.mjs +0 -12
- package/copy-as55vt-p.mjs +0 -19
- package/copy-ePIIYpzl.js +0 -20
- package/cursor-CFB-aeND.mjs +0 -7
- package/cursor-WCsVGQ3k.js +0 -8
- package/cursor-transparent-BeW4FJeS.js +0 -17
- package/cursor-transparent-UnLsX6vO.mjs +0 -16
- package/desktop-CZVMMlzv.js +0 -14
- package/desktop-CjnJn_bw.mjs +0 -13
- package/disconnect-CCFuuni4.js +0 -13
- package/disconnect-DULDFd8b.mjs +0 -12
- package/discord-BqNqFTBk.mjs +0 -21
- package/discord-NuyHZRR6.js +0 -22
- package/email-DGaF-62q.mjs +0 -797
- package/email-hzM1YeAa.js +0 -793
- package/embedded-wallet-ChKT2Kqi.mjs +0 -550
- package/embedded-wallet-DqTVtI_b.js +0 -547
- package/etherscan-CEsSVAq2.mjs +0 -10
- package/etherscan-Ds9nq6I4.js +0 -11
- package/exclamation-triangle-CUPVSfox.js +0 -9
- package/exclamation-triangle-EcsUlgU6.mjs +0 -8
- package/extension-BR4NlDwD.js +0 -13
- package/extension-CLHZhCSN.mjs +0 -12
- package/external-link-CRYOg_me.mjs +0 -12
- package/external-link-CWIkl3WV.js +0 -13
- package/facebook-ACv8F_-T.js +0 -31
- package/facebook-Cu3fhUsY.mjs +0 -30
- package/farcaster-D5ZOGlcT.mjs +0 -16
- package/farcaster-DfNCB-wN.js +0 -17
- package/filters-CNI5jsrU.js +0 -13
- package/filters-CdM5otRV.mjs +0 -12
- package/github-BEf292I1.mjs +0 -22
- package/github-Do7sWgv8.js +0 -23
- package/google-BODDgJTL.mjs +0 -22
- package/google-Cj3O62wM.js +0 -23
- package/help-circle-Ci498tJe.js +0 -17
- package/help-circle-DBELxJch.mjs +0 -16
- package/id-Cqn2I8pT.mjs +0 -16
- package/id-DFT-uV99.js +0 -17
- package/if-defined-D2_GrpzG.mjs +0 -808
- package/if-defined-DCNi9_tU.js +0 -808
- package/image-BL7nQSxN.mjs +0 -8
- package/image-yi8kMU8J.js +0 -9
- package/index-B2Hy-NF2.js +0 -97
- package/index-BBplfur6.js +0 -258
- package/index-BQ73fcgT.mjs +0 -101
- package/index-BQwRt9K1.mjs +0 -276
- package/index-BUD5aDnu.js +0 -682
- package/index-BaXPSDqe.js +0 -273
- package/index-BnIkKri-.mjs +0 -82
- package/index-Bohb3kl3.mjs +0 -108
- package/index-BwuR3kQH.mjs +0 -680
- package/index-BxxcuVMn.js +0 -152
- package/index-BypiLvRj.mjs +0 -273
- package/index-BzKWxdW7.js +0 -178
- package/index-C9-3nLnD.js +0 -103
- package/index-CLYqnLiQ.mjs +0 -9536
- package/index-CNlRmIrd.mjs +0 -55
- package/index-CQGOi3YP.js +0 -108
- package/index-CQHTMX2w.js +0 -57
- package/index-CQjirRvY.js +0 -166
- package/index-CWq1hi6D.js +0 -144
- package/index-CgEo1493.mjs +0 -101
- package/index-Cjb3mozL.mjs +0 -344
- package/index-CkXs2_JU.js +0 -814
- package/index-CvB1dQL-.mjs +0 -259
- package/index-CznIs6Ri.js +0 -344
- package/index-D5y2sPuX.mjs +0 -145
- package/index-D6oVv_xe.mjs +0 -176
- package/index-D77dZTM-.js +0 -101
- package/index-D7Crgb92.mjs +0 -166
- package/index-D9IfhMQO.js +0 -72
- package/index-DAPHrvyl.mjs +0 -566
- package/index-DCUKGebw.mjs +0 -812
- package/index-DM3a8Cxg.js +0 -331
- package/index-DQTDWPkK.js +0 -566
- package/index-Dbvu7_7E.js +0 -59
- package/index-DjK2gI38.mjs +0 -329
- package/index-DjVDwKyw.js +0 -278
- package/index-Dl21qlpM.js +0 -84
- package/index-Dy1_qaPl.mjs +0 -62
- package/index-DzQCeKKr.mjs +0 -95
- package/index-GDRRLbhM.mjs +0 -150
- package/index-KbSTzPJK.mjs +0 -57
- package/index-NJGuA8Hd.js +0 -64
- package/index-TtX6sKdt.js +0 -2237
- package/index-iL3P2-q2.mjs +0 -70
- package/index-j6sdnIsO.js +0 -9510
- package/index-jtBCZMfH.mjs +0 -263
- package/index-miYE8X37.mjs +0 -2235
- package/index-tRphky_g.js +0 -265
- package/info-CyIx65VL.mjs +0 -7
- package/info-GFfmaB2U.js +0 -8
- package/info-circle-BJebXoVk.js +0 -17
- package/info-circle-DEoF1MBl.mjs +0 -16
- package/lightbulb-BPKMbZZM.js +0 -8
- package/lightbulb-Bmy3we8u.mjs +0 -7
- package/mail-CQyo-njh.mjs +0 -12
- package/mail-RqhzZO28.js +0 -13
- package/mobile--nS-soHG.mjs +0 -13
- package/mobile-CySJYCCl.js +0 -14
- package/modules/fiat/components/FiatForm/FiatForm.d.ts +0 -9
- package/modules/fiat/components/FiatForm/FiatForm.js +0 -335
- package/modules/fiat/components/FiatForm/FiatForm.mjs +0 -334
- package/modules/fiat/components/FiatForm/components/AmountInput/AmountInput.d.ts +0 -13
- package/modules/fiat/components/FiatForm/components/AmountInput/AmountInput.js +0 -120
- package/modules/fiat/components/FiatForm/components/AmountInput/AmountInput.mjs +0 -119
- package/modules/fiat/components/FiatForm/components/AmountInput/index.d.ts +0 -1
- package/modules/fiat/components/FiatForm/components/AmountInput/index.js +0 -5
- package/modules/fiat/components/FiatForm/components/AmountInput/index.mjs +0 -4
- package/modules/fiat/components/FiatForm/components/Payment/PaymentForm.d.ts +0 -6
- package/modules/fiat/components/FiatForm/components/Payment/PaymentForm.js +0 -167
- package/modules/fiat/components/FiatForm/components/Payment/PaymentForm.mjs +0 -166
- package/modules/fiat/components/FiatForm/components/Payment/PaymentFrame.d.ts +0 -7
- package/modules/fiat/components/FiatForm/components/Payment/PaymentFrame.js +0 -100
- package/modules/fiat/components/FiatForm/components/Payment/PaymentFrame.mjs +0 -99
- package/modules/fiat/components/FiatForm/components/RateReloading/RateReloading.d.ts +0 -7
- package/modules/fiat/components/FiatForm/components/RateReloading/RateReloading.js +0 -74
- package/modules/fiat/components/FiatForm/components/RateReloading/RateReloading.mjs +0 -73
- package/modules/fiat/components/FiatForm/components/TokenSelector/TokenSelector.d.ts +0 -14
- package/modules/fiat/components/FiatForm/components/TokenSelector/TokenSelector.js +0 -94
- package/modules/fiat/components/FiatForm/components/TokenSelector/TokenSelector.mjs +0 -93
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContainer.d.ts +0 -7
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContainer.js +0 -85
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContainer.mjs +0 -84
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContent.d.ts +0 -7
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContent.js +0 -94
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContent.mjs +0 -93
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectedOption.d.ts +0 -5
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectedOption.js +0 -30
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectedOption.mjs +0 -29
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenIcon.d.ts +0 -8
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenIcon.js +0 -106
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenIcon.mjs +0 -105
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenItem.d.ts +0 -7
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenItem.js +0 -33
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenItem.mjs +0 -32
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenList.d.ts +0 -7
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenList.js +0 -21
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenList.mjs +0 -20
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenSymbol.d.ts +0 -9
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenSymbol.js +0 -26
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenSymbol.mjs +0 -25
- package/modules/fiat/components/FiatForm/components/TokenSelector/index.d.ts +0 -1
- package/modules/fiat/components/FiatForm/components/TokenSelector/index.js +0 -5
- package/modules/fiat/components/FiatForm/components/TokenSelector/index.mjs +0 -4
- package/modules/fiat/components/FiatForm/index.d.ts +0 -1
- package/modules/fiat/components/FiatForm/index.js +0 -5
- package/modules/fiat/components/FiatForm/index.mjs +0 -4
- package/modules/fiat/components/index.d.ts +0 -1
- package/modules/fiat/components/index.js +0 -5
- package/modules/fiat/components/index.mjs +0 -4
- package/modules/fiat/context/FiatProvider.d.ts +0 -8
- package/modules/fiat/context/FiatProvider.js +0 -24
- package/modules/fiat/context/FiatProvider.mjs +0 -23
- package/modules/fiat/context/queryClient.d.ts +0 -3
- package/modules/fiat/context/queryClient.js +0 -12
- package/modules/fiat/context/queryClient.mjs +0 -11
- package/modules/fiat/context/useFiat.d.ts +0 -1
- package/modules/fiat/context/useFiat.js +0 -13
- package/modules/fiat/context/useFiat.mjs +0 -12
- package/modules/fiat/hooks/index.d.ts +0 -2
- package/modules/fiat/hooks/index.js +0 -7
- package/modules/fiat/hooks/index.mjs +0 -6
- package/modules/fiat/hooks/useFiatData.d.ts +0 -7
- package/modules/fiat/hooks/useFiatData.js +0 -78
- package/modules/fiat/hooks/useFiatData.mjs +0 -77
- package/modules/fiat/hooks/validation/index.d.ts +0 -1
- package/modules/fiat/hooks/validation/index.js +0 -5
- package/modules/fiat/hooks/validation/index.mjs +0 -4
- package/modules/fiat/hooks/validation/useAmountSchema.d.ts +0 -2
- package/modules/fiat/hooks/validation/useAmountSchema.js +0 -27
- package/modules/fiat/hooks/validation/useAmountSchema.mjs +0 -9
- package/modules/fiat/index.d.ts +0 -8
- package/modules/fiat/index.js +0 -22
- package/modules/fiat/index.mjs +0 -21
- package/modules/fiat/init/index.d.ts +0 -2
- package/modules/fiat/init/index.js +0 -5
- package/modules/fiat/init/index.mjs +0 -4
- package/modules/fiat/init/init.d.ts +0 -22
- package/modules/fiat/init/init.js +0 -15
- package/modules/fiat/init/init.mjs +0 -14
- package/modules/fiat/queries/index.d.ts +0 -2
- package/modules/fiat/queries/index.js +0 -7
- package/modules/fiat/queries/index.mjs +0 -6
- package/modules/fiat/queries/useGetRate.mutation.d.ts +0 -6
- package/modules/fiat/queries/useGetTokens.query.d.ts +0 -5
- package/modules/fiat/queries/useGetTokens.query.js +0 -33
- package/modules/fiat/queries/useGetTokens.query.mjs +0 -32
- package/more-CwWZDDBg.mjs +0 -15
- package/more-bZ0pd89b.js +0 -16
- package/network-placeholder-BHCmKrry.mjs +0 -18
- package/network-placeholder-aJGrqpCg.js +0 -19
- package/nftPlaceholder-CGLCdnta.js +0 -13
- package/nftPlaceholder-pidG99wt.mjs +0 -12
- package/off-DqIdiRvr.mjs +0 -12
- package/off-Dzc0O-PN.js +0 -13
- package/onramp-CU3WpHjP.mjs +0 -1593
- package/onramp-DpdybYx8.js +0 -1587
- package/play-store-C5Gl454J.mjs +0 -36
- package/play-store-CMtGhNVv.js +0 -37
- package/plus-BYok4L2w.js +0 -18
- package/plus-DcQZoixB.mjs +0 -17
- package/qr-code-D8jk7hh0.mjs +0 -10
- package/qr-code-wHRs9uHL.js +0 -11
- package/react-BT74Hcah.js +0 -6078
- package/react-C6QSQYzA.js +0 -254
- package/react-CrzHxs1H.mjs +0 -25357
- package/react-DmVF9JBF.mjs +0 -6078
- package/react-Dz0FNS2o.js +0 -25357
- package/react-ICzqG8J6.mjs +0 -254
- 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-Cf90xf32.mjs +0 -216
- package/receive-_Qf98a76.js +0 -216
- package/recycle-horizontal-DGj7Ya8u.js +0 -14
- package/recycle-horizontal-jbMIQBSA.mjs +0 -13
- package/refresh-C3z4X6Ra.mjs +0 -12
- package/refresh-D20w1bR5.js +0 -13
- package/reown-logo-BtryrZ0M.js +0 -17
- package/reown-logo-MOOHjLJG.mjs +0 -16
- package/search-C8qQ2OF_.js +0 -13
- package/search-CiVHywyX.mjs +0 -12
- package/send-C8kIbx5x.js +0 -1191
- package/send-CJ5uA96d.mjs +0 -19
- package/send-CSVxya54.js +0 -20
- package/send-CW2bf2qU.mjs +0 -1193
- package/socials-Bs3xjhwd.js +0 -723
- package/socials-CTeVPgpO.mjs +0 -725
- package/swapHorizontal-B1XnljWk.mjs +0 -12
- package/swapHorizontal-DoBOwYma.js +0 -13
- package/swapHorizontalBold-ChRdyrAc.js +0 -13
- package/swapHorizontalBold-ZOXPzU3l.mjs +0 -12
- package/swapHorizontalMedium-7Vh6jM1i.mjs +0 -20
- package/swapHorizontalMedium-KEiACy_f.js +0 -21
- package/swapHorizontalRoundedBold-BBvIWuGE.js +0 -13
- package/swapHorizontalRoundedBold-BGQ_C_tG.mjs +0 -12
- package/swapVertical-DdtnITSU.js +0 -13
- package/swapVertical-DyamFXFs.mjs +0 -12
- package/swaps-D-RYqPMm.js +0 -1906
- package/swaps-DkOwtcRc.mjs +0 -1908
- package/telegram-BtkXg1RW.js +0 -21
- package/telegram-f99qesxc.mjs +0 -20
- package/three-dots-BeUcfBGZ.js +0 -10
- package/three-dots-DKR049e7.mjs +0 -9
- package/transactions-BPLEtw2I.mjs +0 -37
- package/transactions-CuvH3fXr.js +0 -37
- package/twitch-9WJ7_BtK.mjs +0 -22
- package/twitch-SzeD1x5u.js +0 -23
- package/twitterIcon-BZ0-__04.js +0 -11
- package/twitterIcon-DOu4wRVw.mjs +0 -10
- package/verify-BBbz--_D.js +0 -13
- package/verify-CZlhDs-b.mjs +0 -12
- package/verify-filled-3kQkfAKY.mjs +0 -12
- package/verify-filled-D6lQnTMX.js +0 -13
- package/w3m-modal-B8pbabeE.js +0 -1208
- package/w3m-modal-D6o_n4pP.mjs +0 -1208
- package/wallet-CBn7xnZU.mjs +0 -12
- package/wallet-DSfjOp5r.js +0 -13
- package/wallet-placeholder-BhTS6W-G.js +0 -19
- package/wallet-placeholder-LgcirFmF.mjs +0 -18
- package/walletconnect-5VFb1-rC.js +0 -39
- package/walletconnect-Boo6bRXF.mjs +0 -38
- package/warning-circle-CDQm5SB6.mjs +0 -16
- package/warning-circle-CHLQICdy.js +0 -17
- package/x-B6ycL_Yp.js +0 -17
- package/x-DxSIKaVH.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) => {
|
|
@@ -183,4 +182,9 @@ const App = () => {
|
|
|
183
182
|
</Web3AppProvider>
|
|
184
183
|
)
|
|
185
184
|
}
|
|
186
|
-
```
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## Disclaimer
|
|
188
|
+
|
|
189
|
+
1. This package is in active development and is subject to change. We recommend to check the latest version and update your code accordingly.
|
|
190
|
+
2. This package is not fully supported on the Next.js framework. We are working on a solution to make it compatible with Next.js.
|
|
@@ -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,7 @@
|
|
|
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 }: {
|
|
5
5
|
url: string;
|
|
6
|
+
nativeAuthToken: string;
|
|
6
7
|
}): Promise<AxiosResponse<ChainDTO[]>>;
|
package/api/getChains.js
CHANGED
|
@@ -3,10 +3,15 @@
|
|
|
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
|
|
7
8
|
}) {
|
|
8
|
-
|
|
9
|
-
baseURL: url
|
|
10
|
-
|
|
9
|
+
const config = {
|
|
10
|
+
baseURL: url,
|
|
11
|
+
headers: {
|
|
12
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
return await axios.get("/chains", config);
|
|
11
16
|
}
|
|
12
17
|
exports.getChains = getChains;
|
package/api/getChains.mjs
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
async function getChains({
|
|
3
|
-
url
|
|
3
|
+
url,
|
|
4
|
+
nativeAuthToken
|
|
4
5
|
}) {
|
|
5
|
-
|
|
6
|
-
baseURL: url
|
|
7
|
-
|
|
6
|
+
const config = {
|
|
7
|
+
baseURL: url,
|
|
8
|
+
headers: {
|
|
9
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
return await axios.get("/chains", config);
|
|
8
13
|
}
|
|
9
14
|
export {
|
|
10
15
|
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
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import { ProviderType } from 'types/providerType';
|
|
1
2
|
import { TransactionDTO } from 'dto/Transaction.dto';
|
|
2
3
|
import { AxiosResponse } from 'axios';
|
|
3
4
|
|
|
4
|
-
export declare function getTransactions({ url,
|
|
5
|
+
export declare function getTransactions({ url, address, sender, provider, status, tokenIn, tokenOut, nativeAuthToken }: {
|
|
5
6
|
url: string;
|
|
6
|
-
|
|
7
|
+
address: string;
|
|
8
|
+
sender?: string;
|
|
9
|
+
provider?: ProviderType;
|
|
10
|
+
status?: string;
|
|
11
|
+
tokenIn?: string;
|
|
12
|
+
tokenOut?: string;
|
|
13
|
+
nativeAuthToken: string;
|
|
7
14
|
}): Promise<AxiosResponse<TransactionDTO[]>>;
|
package/api/getTransactions.js
CHANGED
|
@@ -4,11 +4,36 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
const axios = require("axios");
|
|
5
5
|
async function getTransactions({
|
|
6
6
|
url,
|
|
7
|
-
|
|
7
|
+
address,
|
|
8
|
+
sender,
|
|
9
|
+
provider,
|
|
10
|
+
status,
|
|
11
|
+
tokenIn,
|
|
12
|
+
tokenOut,
|
|
13
|
+
nativeAuthToken
|
|
8
14
|
}) {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
const queryParams = new URLSearchParams({
|
|
16
|
+
receiver: address || "",
|
|
17
|
+
sender: sender || "",
|
|
18
|
+
provider: provider || "",
|
|
19
|
+
status: status || "",
|
|
20
|
+
tokenIn: tokenIn || "",
|
|
21
|
+
tokenOut: tokenOut || ""
|
|
12
22
|
});
|
|
23
|
+
const params = Object.entries(Object.fromEntries(queryParams.entries()));
|
|
24
|
+
for (const [key, value] of params) {
|
|
25
|
+
if (value === "") {
|
|
26
|
+
queryParams.delete(key);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const queryString = queryParams.toString();
|
|
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);
|
|
13
38
|
}
|
|
14
39
|
exports.getTransactions = getTransactions;
|
package/api/getTransactions.mjs
CHANGED
|
@@ -1,12 +1,37 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
async function getTransactions({
|
|
3
3
|
url,
|
|
4
|
-
|
|
4
|
+
address,
|
|
5
|
+
sender,
|
|
6
|
+
provider,
|
|
7
|
+
status,
|
|
8
|
+
tokenIn,
|
|
9
|
+
tokenOut,
|
|
10
|
+
nativeAuthToken
|
|
5
11
|
}) {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
const queryParams = new URLSearchParams({
|
|
13
|
+
receiver: address || "",
|
|
14
|
+
sender: sender || "",
|
|
15
|
+
provider: provider || "",
|
|
16
|
+
status: status || "",
|
|
17
|
+
tokenIn: tokenIn || "",
|
|
18
|
+
tokenOut: tokenOut || ""
|
|
9
19
|
});
|
|
20
|
+
const params = Object.entries(Object.fromEntries(queryParams.entries()));
|
|
21
|
+
for (const [key, value] of params) {
|
|
22
|
+
if (value === "") {
|
|
23
|
+
queryParams.delete(key);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const queryString = queryParams.toString();
|
|
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);
|
|
10
35
|
}
|
|
11
36
|
export {
|
|
12
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,14 @@ describe("getChains", () => {
|
|
|
26
27
|
}
|
|
27
28
|
];
|
|
28
29
|
mockedAxios.get.mockResolvedValue({ data: response });
|
|
29
|
-
const result = await api_getChains.getChains({ url });
|
|
30
|
+
const result = await api_getChains.getChains({ url, nativeAuthToken: "ZKssadass" });
|
|
30
31
|
expect(mockedAxios.get).toHaveBeenCalledWith("/chains", { baseURL: url });
|
|
31
32
|
expect(result.data).toEqual(response);
|
|
32
33
|
});
|
|
33
34
|
it("handles error when fetching chains", async () => {
|
|
34
35
|
mockedAxios.get.mockRejectedValue(new Error("Network Error"));
|
|
35
|
-
await expect(
|
|
36
|
+
await expect(
|
|
37
|
+
api_getChains.getChains({ url, nativeAuthToken: "ZKssadass" })
|
|
38
|
+
).rejects.toThrow("Network Error");
|
|
36
39
|
});
|
|
37
40
|
});
|
|
@@ -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,14 @@ describe("getChains", () => {
|
|
|
24
25
|
}
|
|
25
26
|
];
|
|
26
27
|
mockedAxios.get.mockResolvedValue({ data: response });
|
|
27
|
-
const result = await getChains({ url });
|
|
28
|
+
const result = await getChains({ url, nativeAuthToken: "ZKssadass" });
|
|
28
29
|
expect(mockedAxios.get).toHaveBeenCalledWith("/chains", { baseURL: url });
|
|
29
30
|
expect(result.data).toEqual(response);
|
|
30
31
|
});
|
|
31
32
|
it("handles error when fetching chains", async () => {
|
|
32
33
|
mockedAxios.get.mockRejectedValue(new Error("Network Error"));
|
|
33
|
-
await expect(
|
|
34
|
+
await expect(
|
|
35
|
+
getChains({ url, nativeAuthToken: "ZKssadass" })
|
|
36
|
+
).rejects.toThrow("Network Error");
|
|
34
37
|
});
|
|
35
38
|
});
|
|
@@ -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
|
});
|