@multiversx/sdk-dapp-liquidity 2.0.0 → 2.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/all-networks--dfVLHLJ.js +2 -0
  2. package/all-networks-Czd8zS1n.mjs +4 -0
  3. package/api/checkAccount.js +1 -21
  4. package/api/checkAccount.mjs +13 -13
  5. package/api/confirmRate.js +1 -29
  6. package/api/confirmRate.mjs +17 -22
  7. package/api/getChains.js +1 -17
  8. package/api/getChains.mjs +10 -10
  9. package/api/getRate.js +1 -27
  10. package/api/getRate.mjs +17 -20
  11. package/api/getTokens.js +1 -22
  12. package/api/getTokens.mjs +14 -15
  13. package/api/getTokensBalances.js +1 -21
  14. package/api/getTokensBalances.mjs +13 -13
  15. package/api/getTransactions.js +1 -38
  16. package/api/getTransactions.mjs +25 -31
  17. package/api/index.js +1 -18
  18. package/api/index.mjs +16 -16
  19. package/api/sendTransactions.js +1 -32
  20. package/api/sendTransactions.mjs +19 -19
  21. package/api/tests/confirmRate.spec.js +1 -130
  22. package/api/tests/confirmRate.spec.mjs +44 -58
  23. package/api/tests/getChains.spec.js +1 -43
  24. package/api/tests/getChains.spec.mjs +15 -18
  25. package/api/tests/getRate.spec.js +1 -87
  26. package/api/tests/getRate.spec.mjs +35 -49
  27. package/api/tests/getTokens.spec.js +1 -68
  28. package/api/tests/getTokens.spec.mjs +23 -29
  29. package/api/tests/getTransactions.spec.js +1 -94
  30. package/api/tests/getTransactions.spec.mjs +35 -51
  31. package/api/tests/sendTransactions.spec.js +1 -96
  32. package/api/tests/sendTransactions.spec.mjs +44 -52
  33. package/constants/index.js +1 -4
  34. package/constants/index.mjs +2 -2
  35. package/default-D0Jk5ROI.mjs +4 -0
  36. package/default-DbU6vPaB.js +2 -0
  37. package/helpers/assertRateConfirmationMatchesIntent.d.ts +8 -0
  38. package/helpers/assertRateConfirmationMatchesIntent.js +2 -0
  39. package/helpers/assertRateConfirmationMatchesIntent.mjs +20 -0
  40. package/helpers/base64Utils.js +1 -31
  41. package/helpers/base64Utils.mjs +14 -24
  42. package/helpers/decodeLoginToken.js +1 -27
  43. package/helpers/decodeLoginToken.mjs +13 -18
  44. package/helpers/decodeToken.js +1 -39
  45. package/helpers/decodeToken.mjs +20 -31
  46. package/helpers/getApiURL.js +1 -7
  47. package/helpers/getApiURL.mjs +3 -5
  48. package/helpers/getBridgeURL.js +1 -7
  49. package/helpers/getBridgeURL.mjs +3 -5
  50. package/helpers/getDisplayName.js +1 -11
  51. package/helpers/getDisplayName.mjs +3 -8
  52. package/helpers/getMvxApiURL.js +1 -7
  53. package/helpers/getMvxApiURL.mjs +3 -5
  54. package/helpers/getMvxChainId.js +1 -7
  55. package/helpers/getMvxChainId.mjs +3 -5
  56. package/helpers/getMvxExplorerAddress.js +1 -7
  57. package/helpers/getMvxExplorerAddress.mjs +3 -5
  58. package/helpers/index.d.ts +2 -0
  59. package/helpers/index.js +1 -22
  60. package/helpers/index.mjs +24 -20
  61. package/helpers/safeImageUrl.d.ts +1 -0
  62. package/helpers/safeImageUrl.js +2 -0
  63. package/helpers/safeImageUrl.mjs +13 -0
  64. package/helpers/serializeTransaction.js +1 -8
  65. package/helpers/serializeTransaction.mjs +3 -5
  66. package/helpers/tests/assertRateConfirmationMatchesIntent.spec.d.ts +1 -0
  67. package/helpers/tests/assertRateConfirmationMatchesIntent.spec.js +2 -0
  68. package/helpers/tests/assertRateConfirmationMatchesIntent.spec.mjs +52 -0
  69. package/helpers/tests/base64Utils.spec.js +1 -29
  70. package/helpers/tests/base64Utils.spec.mjs +11 -24
  71. package/helpers/tests/decodeLoginToken.spec.js +1 -34
  72. package/helpers/tests/decodeLoginToken.spec.mjs +13 -24
  73. package/helpers/tests/decodeToken.spec.js +1 -27
  74. package/helpers/tests/decodeToken.spec.mjs +7 -12
  75. package/helpers/tests/safeImageUrl.spec.d.ts +1 -0
  76. package/helpers/tests/safeImageUrl.spec.js +2 -0
  77. package/helpers/tests/safeImageUrl.spec.mjs +32 -0
  78. package/helpers/tests/serializeTransaction.spec.d.ts +1 -0
  79. package/helpers/tests/serializeTransaction.spec.js +2 -0
  80. package/helpers/tests/serializeTransaction.spec.mjs +24 -0
  81. package/index.js +1 -228
  82. package/index.mjs +196 -192
  83. package/package.json +14 -9
  84. package/react.esm-B0AMOHxa.js +73 -0
  85. package/react.esm-BxvJJ86Q.mjs +9949 -0
  86. package/reactjs/adapters/SuiAdapter.d.ts +14 -0
  87. package/reactjs/adapters/SuiAdapter.js +1 -349
  88. package/reactjs/adapters/SuiAdapter.mjs +171 -199
  89. package/reactjs/components/AccountAddress/AccountAddress.js +1 -31
  90. package/reactjs/components/AccountAddress/AccountAddress.mjs +16 -16
  91. package/reactjs/components/AccountAddress/index.js +1 -4
  92. package/reactjs/components/AccountAddress/index.mjs +2 -2
  93. package/reactjs/components/AmountCard/AmountCard.js +1 -33
  94. package/reactjs/components/AmountCard/AmountCard.mjs +19 -21
  95. package/reactjs/components/AmountCard/index.js +1 -4
  96. package/reactjs/components/AmountCard/index.mjs +2 -2
  97. package/reactjs/components/AmountInput/AmountInput.js +1 -71
  98. package/reactjs/components/AmountInput/AmountInput.mjs +42 -46
  99. package/reactjs/components/AmountInput/index.js +1 -4
  100. package/reactjs/components/AmountInput/index.mjs +2 -2
  101. package/reactjs/components/BridgeForm/BridgeForm.d.ts +9 -0
  102. package/reactjs/components/BridgeForm/BridgeForm.js +1 -89
  103. package/reactjs/components/BridgeForm/BridgeForm.mjs +72 -79
  104. package/reactjs/components/BridgeForm/Deposit.js +1 -673
  105. package/reactjs/components/BridgeForm/Deposit.mjs +381 -503
  106. package/reactjs/components/BridgeForm/Transfer.js +1 -559
  107. package/reactjs/components/BridgeForm/Transfer.mjs +316 -427
  108. package/reactjs/components/BridgeForm/hooks/useBridgeAmounts.js +1 -78
  109. package/reactjs/components/BridgeForm/hooks/useBridgeAmounts.mjs +47 -70
  110. package/reactjs/components/BridgeForm/hooks/useBridgeRateFetching.js +1 -58
  111. package/reactjs/components/BridgeForm/hooks/useBridgeRateFetching.mjs +36 -47
  112. package/reactjs/components/BridgeForm/hooks/useBridgeTokenSelection.js +1 -266
  113. package/reactjs/components/BridgeForm/hooks/useBridgeTokenSelection.mjs +163 -231
  114. package/reactjs/components/BridgeForm/index.js +1 -4
  115. package/reactjs/components/BridgeForm/index.mjs +2 -2
  116. package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.js +1 -76
  117. package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.mjs +35 -65
  118. package/reactjs/components/BridgeHistory/BridgeHistory.js +1 -367
  119. package/reactjs/components/BridgeHistory/BridgeHistory.mjs +177 -193
  120. package/reactjs/components/BridgeHistory/index.js +1 -4
  121. package/reactjs/components/BridgeHistory/index.mjs +2 -2
  122. package/reactjs/components/Connect/BridgeAccountDisplay.js +1 -150
  123. package/reactjs/components/Connect/BridgeAccountDisplay.mjs +99 -115
  124. package/reactjs/components/Connect/BridgeConnectButton.js +1 -34
  125. package/reactjs/components/Connect/BridgeConnectButton.mjs +20 -19
  126. package/reactjs/components/Connect/ChainSelectConnect.js +1 -144
  127. package/reactjs/components/Connect/ChainSelectConnect.mjs +70 -83
  128. package/reactjs/components/Connect/CustomConnectButton.js +1 -40
  129. package/reactjs/components/Connect/CustomConnectButton.mjs +24 -30
  130. package/reactjs/components/Connect/MvxAccountDisplay.js +1 -97
  131. package/reactjs/components/Connect/MvxAccountDisplay.mjs +47 -50
  132. package/reactjs/components/Connect/MvxConnectButton.js +1 -43
  133. package/reactjs/components/Connect/MvxConnectButton.mjs +35 -40
  134. package/reactjs/components/Connect/SwitchChainButton.js +1 -29
  135. package/reactjs/components/Connect/SwitchChainButton.mjs +15 -18
  136. package/reactjs/components/Connect/index.js +1 -16
  137. package/reactjs/components/Connect/index.mjs +14 -14
  138. package/reactjs/components/CopyButton/CopyButton.js +1 -46
  139. package/reactjs/components/CopyButton/CopyButton.mjs +33 -36
  140. package/reactjs/components/CopyButton/index.js +1 -4
  141. package/reactjs/components/CopyButton/index.mjs +2 -2
  142. package/reactjs/components/CopyButton/utils/copyToClipboard.js +1 -38
  143. package/reactjs/components/CopyButton/utils/copyToClipboard.mjs +20 -32
  144. package/reactjs/components/CopyButton/utils/index.js +1 -4
  145. package/reactjs/components/CopyButton/utils/index.mjs +2 -2
  146. package/reactjs/components/DisplayAmount/DisplayAmount.js +1 -90
  147. package/reactjs/components/DisplayAmount/DisplayAmount.mjs +68 -75
  148. package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.js +1 -39
  149. package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.mjs +26 -33
  150. package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.js +1 -61
  151. package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.mjs +38 -46
  152. package/reactjs/components/DisplayAmount/index.js +1 -4
  153. package/reactjs/components/DisplayAmount/index.mjs +2 -2
  154. package/reactjs/components/DisplayAmount/utils/index.js +1 -4
  155. package/reactjs/components/DisplayAmount/utils/index.mjs +2 -2
  156. package/reactjs/components/DisplayAmount/utils/truncateAmount.js +1 -21
  157. package/reactjs/components/DisplayAmount/utils/truncateAmount.mjs +9 -13
  158. package/reactjs/components/Error/Error.js +1 -66
  159. package/reactjs/components/Error/Error.mjs +29 -29
  160. package/reactjs/components/Error/index.js +1 -4
  161. package/reactjs/components/Error/index.mjs +2 -2
  162. package/reactjs/components/SmallLoader/SmallLoader.js +1 -21
  163. package/reactjs/components/SmallLoader/SmallLoader.mjs +13 -18
  164. package/reactjs/components/SmallLoader/index.js +1 -4
  165. package/reactjs/components/SmallLoader/index.mjs +2 -2
  166. package/reactjs/components/ToggleDirection/ToggleDirection.js +1 -30
  167. package/reactjs/components/ToggleDirection/ToggleDirection.mjs +22 -28
  168. package/reactjs/components/TokenSelector/TokenSelector.js +1 -172
  169. package/reactjs/components/TokenSelector/TokenSelector.mjs +98 -118
  170. package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.js +1 -94
  171. package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.mjs +48 -57
  172. package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.js +1 -51
  173. package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.mjs +45 -44
  174. package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.js +1 -18
  175. package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.mjs +9 -14
  176. package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.js +1 -6
  177. package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.mjs +2 -4
  178. package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.js +1 -39
  179. package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.mjs +22 -18
  180. package/reactjs/components/TokenSelector/components/SelectContainer.js +1 -40
  181. package/reactjs/components/TokenSelector/components/SelectContainer.mjs +36 -38
  182. package/reactjs/components/TokenSelector/components/SelectContent.js +1 -136
  183. package/reactjs/components/TokenSelector/components/SelectContent.mjs +79 -103
  184. package/reactjs/components/TokenSelector/components/SelectedOption.js +1 -28
  185. package/reactjs/components/TokenSelector/components/SelectedOption.mjs +22 -24
  186. package/reactjs/components/TokenSelector/components/TokenIcon.js +1 -81
  187. package/reactjs/components/TokenSelector/components/TokenIcon.mjs +52 -57
  188. package/reactjs/components/TokenSelector/components/TokenItem.js +1 -80
  189. package/reactjs/components/TokenSelector/components/TokenItem.mjs +41 -54
  190. package/reactjs/components/TokenSelector/components/TokenList.js +1 -23
  191. package/reactjs/components/TokenSelector/components/TokenList.mjs +19 -21
  192. package/reactjs/components/TokenSelector/components/TokenSymbol.js +1 -25
  193. package/reactjs/components/TokenSelector/components/TokenSymbol.mjs +14 -15
  194. package/reactjs/components/TokenSelector/index.js +1 -4
  195. package/reactjs/components/TokenSelector/index.mjs +2 -2
  196. package/reactjs/components/TransactionToast/TransactionToast.js +1 -53
  197. package/reactjs/components/TransactionToast/TransactionToast.mjs +27 -28
  198. package/reactjs/components/TransactionToast/TransactionToastContainer.js +1 -20
  199. package/reactjs/components/TransactionToast/TransactionToastContainer.mjs +16 -18
  200. package/reactjs/components/TransactionToast/index.js +1 -6
  201. package/reactjs/components/TransactionToast/index.mjs +4 -4
  202. package/reactjs/components/TrimAddress/TrimAddress.js +1 -27
  203. package/reactjs/components/TrimAddress/TrimAddress.mjs +19 -24
  204. package/reactjs/components/TrimAddress/index.js +1 -4
  205. package/reactjs/components/TrimAddress/index.mjs +2 -2
  206. package/reactjs/components/base/MxButton/MxButton.js +1 -71
  207. package/reactjs/components/base/MxButton/MxButton.mjs +46 -46
  208. package/reactjs/components/base/MxButton/index.js +1 -4
  209. package/reactjs/components/base/MxButton/index.mjs +2 -2
  210. package/reactjs/components/base/MxCard/MxCard.js +1 -54
  211. package/reactjs/components/base/MxCard/MxCard.mjs +34 -34
  212. package/reactjs/components/base/MxCard/index.js +1 -4
  213. package/reactjs/components/base/MxCard/index.mjs +2 -2
  214. package/reactjs/components/base/MxCircleLoader/MxCircleLoader.js +1 -28
  215. package/reactjs/components/base/MxCircleLoader/MxCircleLoader.mjs +24 -26
  216. package/reactjs/components/base/MxCircleLoader/index.js +1 -4
  217. package/reactjs/components/base/MxCircleLoader/index.mjs +2 -2
  218. package/reactjs/components/base/MxLink/MxLink.js +1 -70
  219. package/reactjs/components/base/MxLink/MxLink.mjs +44 -46
  220. package/reactjs/components/base/MxLink/index.js +1 -4
  221. package/reactjs/components/base/MxLink/index.mjs +2 -2
  222. package/reactjs/components/base/MxSearch/MxSearch.js +1 -69
  223. package/reactjs/components/base/MxSearch/MxSearch.mjs +37 -41
  224. package/reactjs/components/base/MxSearch/index.js +1 -4
  225. package/reactjs/components/base/MxSearch/index.mjs +2 -2
  226. package/reactjs/components/base/MxSlideover/MxSlideover.js +1 -78
  227. package/reactjs/components/base/MxSlideover/MxSlideover.mjs +72 -74
  228. package/reactjs/components/base/MxSlideover/index.js +1 -4
  229. package/reactjs/components/base/MxSlideover/index.mjs +2 -2
  230. package/reactjs/components/base/MxTooltip/MxTooltip.js +1 -163
  231. package/reactjs/components/base/MxTooltip/MxTooltip.mjs +92 -135
  232. package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.js +1 -33
  233. package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.mjs +29 -31
  234. package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.js +1 -4
  235. package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.mjs +2 -2
  236. package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.js +1 -27
  237. package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.mjs +23 -25
  238. package/reactjs/components/base/MxTooltip/components/TooltipContent/index.js +1 -4
  239. package/reactjs/components/base/MxTooltip/components/TooltipContent/index.mjs +2 -2
  240. package/reactjs/components/base/MxTooltip/components/index.js +1 -6
  241. package/reactjs/components/base/MxTooltip/components/index.mjs +4 -4
  242. package/reactjs/components/base/MxTooltip/index.js +1 -4
  243. package/reactjs/components/base/MxTooltip/index.mjs +2 -2
  244. package/reactjs/components/base/index.js +1 -14
  245. package/reactjs/components/base/index.mjs +12 -12
  246. package/reactjs/components/index.js +1 -54
  247. package/reactjs/components/index.mjs +52 -52
  248. package/reactjs/constants/chains.js +1 -54
  249. package/reactjs/constants/chains.mjs +33 -52
  250. package/reactjs/constants/index.js +1 -13
  251. package/reactjs/constants/index.mjs +9 -10
  252. package/reactjs/context/Web3AppProvider.js +1 -40
  253. package/reactjs/context/Web3AppProvider.mjs +34 -34
  254. package/reactjs/context/queryClient.js +1 -11
  255. package/reactjs/context/queryClient.mjs +5 -8
  256. package/reactjs/context/useWeb3App.js +1 -12
  257. package/reactjs/context/useWeb3App.mjs +7 -8
  258. package/reactjs/helpers/index.js +1 -6
  259. package/reactjs/helpers/index.mjs +4 -4
  260. package/reactjs/helpers/resolveBridgeApiChainId.js +1 -40
  261. package/reactjs/helpers/resolveBridgeApiChainId.mjs +21 -34
  262. package/reactjs/hooks/index.js +1 -35
  263. package/reactjs/hooks/index.mjs +33 -33
  264. package/reactjs/hooks/tests/useGenericSignMessage.spec.d.ts +1 -0
  265. package/reactjs/hooks/tests/useGenericSignMessage.spec.js +2 -0
  266. package/reactjs/hooks/tests/useGenericSignMessage.spec.mjs +52 -0
  267. package/reactjs/hooks/tests/useSignTransaction.spec.d.ts +1 -0
  268. package/reactjs/hooks/tests/useSignTransaction.spec.js +2 -0
  269. package/reactjs/hooks/tests/useSignTransaction.spec.mjs +156 -0
  270. package/reactjs/hooks/useAccount.js +1 -13
  271. package/reactjs/hooks/useAccount.mjs +7 -8
  272. package/reactjs/hooks/useBalances.js +1 -53
  273. package/reactjs/hooks/useBalances.mjs +28 -40
  274. package/reactjs/hooks/useBridgeApiChainId.js +1 -13
  275. package/reactjs/hooks/useBridgeApiChainId.mjs +9 -9
  276. package/reactjs/hooks/useBridgeFormik.js +1 -162
  277. package/reactjs/hooks/useBridgeFormik.mjs +110 -150
  278. package/reactjs/hooks/useDebounce.js +1 -13
  279. package/reactjs/hooks/useDebounce.mjs +8 -10
  280. package/reactjs/hooks/useFetchBridgeData.js +1 -45
  281. package/reactjs/hooks/useFetchBridgeData.mjs +37 -38
  282. package/reactjs/hooks/useFetchTokens.js +1 -113
  283. package/reactjs/hooks/useFetchTokens.mjs +80 -106
  284. package/reactjs/hooks/useGenericSignMessage.js +1 -55
  285. package/reactjs/hooks/useGenericSignMessage.mjs +47 -47
  286. package/reactjs/hooks/useGetChainId.js +1 -11
  287. package/reactjs/hooks/useGetChainId.mjs +7 -8
  288. package/reactjs/hooks/useResolveTokenChain.js +1 -20
  289. package/reactjs/hooks/useResolveTokenChain.mjs +11 -14
  290. package/reactjs/hooks/useSendTransactions.js +1 -25
  291. package/reactjs/hooks/useSendTransactions.mjs +19 -23
  292. package/reactjs/hooks/useSignTransaction.js +1 -86
  293. package/reactjs/hooks/useSignTransaction.mjs +59 -59
  294. package/reactjs/hooks/useSuiConnect.js +1 -86
  295. package/reactjs/hooks/useSuiConnect.mjs +52 -70
  296. package/reactjs/hooks/validation/index.js +1 -10
  297. package/reactjs/hooks/validation/index.mjs +8 -8
  298. package/reactjs/hooks/validation/useAmountSchema.js +1 -32
  299. package/reactjs/hooks/validation/useAmountSchema.mjs +8 -11
  300. package/reactjs/hooks/validation/useSecondAmountSchema.js +1 -26
  301. package/reactjs/hooks/validation/useSecondAmountSchema.mjs +5 -6
  302. package/reactjs/hooks/validation/useTestHasEnoughFunds.js +1 -37
  303. package/reactjs/hooks/validation/useTestHasEnoughFunds.mjs +20 -29
  304. package/reactjs/hooks/validation/useTestIsConnected.js +1 -27
  305. package/reactjs/hooks/validation/useTestIsConnected.mjs +13 -19
  306. package/reactjs/index.js +1 -190
  307. package/reactjs/index.mjs +154 -154
  308. package/reactjs/init/index.js +1 -5
  309. package/reactjs/init/index.mjs +3 -3
  310. package/reactjs/init/init.d.ts +1 -0
  311. package/reactjs/init/init.js +1 -139
  312. package/reactjs/init/init.mjs +59 -72
  313. package/reactjs/queries/index.js +1 -17
  314. package/reactjs/queries/index.mjs +15 -15
  315. package/reactjs/queries/useCheckAccount.query.js +1 -39
  316. package/reactjs/queries/useCheckAccount.query.mjs +29 -33
  317. package/reactjs/queries/useGetAllTokens.query.js +1 -35
  318. package/reactjs/queries/useGetAllTokens.query.mjs +26 -30
  319. package/reactjs/queries/useGetChains.query.js +1 -34
  320. package/reactjs/queries/useGetChains.query.mjs +26 -28
  321. package/reactjs/queries/useGetHistory.query.d.ts +1 -1
  322. package/reactjs/queries/useGetHistory.query.js +1 -68
  323. package/reactjs/queries/useGetHistory.query.mjs +55 -58
  324. package/reactjs/queries/useGetMvxTokensBalances.query.d.ts +1 -1
  325. package/reactjs/queries/useGetMvxTokensBalances.query.js +1 -71
  326. package/reactjs/queries/useGetMvxTokensBalances.query.mjs +40 -53
  327. package/reactjs/queries/useGetNonMvxTokensBalances.query.d.ts +1 -1
  328. package/reactjs/queries/useGetNonMvxTokensBalances.query.js +1 -81
  329. package/reactjs/queries/useGetNonMvxTokensBalances.query.mjs +51 -59
  330. package/reactjs/queries/useGetRate.mutation.js +1 -18
  331. package/reactjs/queries/useGetRate.mutation.mjs +12 -15
  332. package/reactjs/reexports.js +1 -48
  333. package/reactjs/reexports.mjs +13 -13
  334. package/reactjs/utils/delay.js +1 -6
  335. package/reactjs/utils/delay.mjs +3 -3
  336. package/reactjs/utils/formatAmount.js +1 -23
  337. package/reactjs/utils/formatAmount.mjs +16 -17
  338. package/reactjs/utils/getCleanStringAmount.js +1 -11
  339. package/reactjs/utils/getCleanStringAmount.mjs +6 -8
  340. package/reactjs/utils/getCompletePathname.js +1 -5
  341. package/reactjs/utils/getCompletePathname.mjs +3 -3
  342. package/reactjs/utils/getInitialTokens.js +1 -12
  343. package/reactjs/utils/getInitialTokens.mjs +6 -7
  344. package/reactjs/utils/hasEnoughFunds.js +1 -19
  345. package/reactjs/utils/hasEnoughFunds.mjs +11 -14
  346. package/reactjs/utils/index.js +1 -26
  347. package/reactjs/utils/index.mjs +24 -24
  348. package/reactjs/utils/isStringFloat.js +1 -21
  349. package/reactjs/utils/isStringFloat.mjs +11 -18
  350. package/reactjs/utils/mxClsx.js +1 -8
  351. package/reactjs/utils/mxClsx.mjs +4 -6
  352. package/reactjs/utils/pipe.js +1 -25
  353. package/reactjs/utils/pipe.mjs +13 -17
  354. package/reactjs/utils/removeCommas.js +1 -6
  355. package/reactjs/utils/removeCommas.mjs +2 -4
  356. package/reactjs/utils/roundAmount.js +1 -40
  357. package/reactjs/utils/roundAmount.mjs +16 -36
  358. package/reactjs/utils/testNumber.js +1 -4
  359. package/reactjs/utils/testNumber.mjs +2 -2
  360. package/store/inMemoryStore.js +1 -39
  361. package/store/inMemoryStore.mjs +17 -21
  362. package/style.css +1 -2274
  363. package/types/chainType.js +1 -11
  364. package/types/chainType.mjs +2 -9
  365. package/types/errors.d.ts +3 -0
  366. package/types/errors.js +2 -0
  367. package/types/errors.mjs +8 -0
  368. package/types/providerType.js +1 -9
  369. package/types/providerType.mjs +2 -7
  370. package/types/transaction.d.ts +2 -0
  371. package/all-networks-EJIVYZ_i.mjs +0 -4
  372. package/all-networks-NYACMyeN.js +0 -4
  373. package/default-BYtXv70Z.mjs +0 -4
  374. package/default-H3AbmzFV.js +0 -4
  375. package/reactjs/hooks/useSignTransaction.d.ts +0 -511
@@ -1,69 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";
3
- const axios = require("axios");
4
- const api_getTokens = require("../getTokens.js");
5
- jest.mock("axios");
6
- const mockedAxios = axios;
7
- describe("getTokens", () => {
8
- const url = "https://api.example.com";
9
- it("fetches tokens successfully without chainId", async () => {
10
- const response = [
11
- {
12
- chainId: "1",
13
- address: "0x123",
14
- name: "Token One",
15
- symbol: "T1",
16
- decimals: 18,
17
- crosschain: true,
18
- pngUrl: "https://example.com/logo.png",
19
- svgUrl: "https://example.com/logo.svg",
20
- metadata: {
21
- minBridgeAmount: "1",
22
- maxBridgeAmount: "100"
23
- }
24
- }
25
- ];
26
- mockedAxios.get.mockResolvedValue({ data: response });
27
- const result = await api_getTokens.getTokens({
28
- url,
29
- nativeAuthToken: "",
30
- bridgeOnly: false
31
- });
32
- expect(mockedAxios.get).toHaveBeenCalled();
33
- expect(result.data).toEqual(response);
34
- });
35
- it("fetches tokens successfully with chainId", async () => {
36
- const chainId = 1;
37
- const response = [
38
- {
39
- chainId: "1",
40
- address: "0x123",
41
- name: "Token One",
42
- symbol: "T1",
43
- decimals: 18,
44
- crosschain: true,
45
- pngUrl: "https://example.com/logo.png",
46
- svgUrl: "https://example.com/logo.svg",
47
- metadata: {
48
- minBridgeAmount: "1",
49
- maxBridgeAmount: "100"
50
- }
51
- }
52
- ];
53
- mockedAxios.get.mockResolvedValue({ data: response });
54
- const result = await api_getTokens.getTokens({
55
- url,
56
- chainId,
57
- nativeAuthToken: "",
58
- bridgeOnly: false
59
- });
60
- expect(mockedAxios.get).toHaveBeenCalled();
61
- expect(result.data).toEqual(response);
62
- });
63
- it("handles error when fetching tokens", async () => {
64
- mockedAxios.get.mockRejectedValue(new Error("Network Error"));
65
- await expect(
66
- api_getTokens.getTokens({ url, nativeAuthToken: "", bridgeOnly: false })
67
- ).rejects.toThrow("Network Error");
68
- });
69
- });
2
+ "use strict";const c=require("axios"),a=require("../getTokens.js");jest.mock("axios");const e=c;describe("getTokens",()=>{const s="https://api.example.com";it("fetches tokens successfully without chainId",async()=>{const o=[{chainId:"1",address:"0x123",name:"Token One",symbol:"T1",decimals:18,crosschain:!0,pngUrl:"https://example.com/logo.png",svgUrl:"https://example.com/logo.svg",metadata:{minBridgeAmount:"1",maxBridgeAmount:"100"}}];e.get.mockResolvedValue({data:o});const t=await a.getTokens({url:s,nativeAuthToken:"",bridgeOnly:!1});expect(e.get).toHaveBeenCalled(),expect(t.data).toEqual(o)}),it("fetches tokens successfully with chainId",async()=>{const t=[{chainId:"1",address:"0x123",name:"Token One",symbol:"T1",decimals:18,crosschain:!0,pngUrl:"https://example.com/logo.png",svgUrl:"https://example.com/logo.svg",metadata:{minBridgeAmount:"1",maxBridgeAmount:"100"}}];e.get.mockResolvedValue({data:t});const n=await a.getTokens({url:s,chainId:1,nativeAuthToken:"",bridgeOnly:!1});expect(e.get).toHaveBeenCalled(),expect(n.data).toEqual(t)}),it("handles error when fetching tokens",async()=>{e.get.mockRejectedValue(new Error("Network Error")),await expect(a.getTokens({url:s,nativeAuthToken:"",bridgeOnly:!1})).rejects.toThrow("Network Error")})});
@@ -1,18 +1,18 @@
1
- import axios from "axios";
2
- import { getTokens } from "../getTokens.mjs";
1
+ import c from "axios";
2
+ import { getTokens as s } from "../getTokens.mjs";
3
3
  jest.mock("axios");
4
- const mockedAxios = axios;
4
+ const e = c;
5
5
  describe("getTokens", () => {
6
- const url = "https://api.example.com";
6
+ const o = "https://api.example.com";
7
7
  it("fetches tokens successfully without chainId", async () => {
8
- const response = [
8
+ const a = [
9
9
  {
10
10
  chainId: "1",
11
11
  address: "0x123",
12
12
  name: "Token One",
13
13
  symbol: "T1",
14
14
  decimals: 18,
15
- crosschain: true,
15
+ crosschain: !0,
16
16
  pngUrl: "https://example.com/logo.png",
17
17
  svgUrl: "https://example.com/logo.svg",
18
18
  metadata: {
@@ -21,25 +21,22 @@ describe("getTokens", () => {
21
21
  }
22
22
  }
23
23
  ];
24
- mockedAxios.get.mockResolvedValue({ data: response });
25
- const result = await getTokens({
26
- url,
24
+ e.get.mockResolvedValue({ data: a });
25
+ const t = await s({
26
+ url: o,
27
27
  nativeAuthToken: "",
28
- bridgeOnly: false
28
+ bridgeOnly: !1
29
29
  });
30
- expect(mockedAxios.get).toHaveBeenCalled();
31
- expect(result.data).toEqual(response);
32
- });
33
- it("fetches tokens successfully with chainId", async () => {
34
- const chainId = 1;
35
- const response = [
30
+ expect(e.get).toHaveBeenCalled(), expect(t.data).toEqual(a);
31
+ }), it("fetches tokens successfully with chainId", async () => {
32
+ const t = [
36
33
  {
37
34
  chainId: "1",
38
35
  address: "0x123",
39
36
  name: "Token One",
40
37
  symbol: "T1",
41
38
  decimals: 18,
42
- crosschain: true,
39
+ crosschain: !0,
43
40
  pngUrl: "https://example.com/logo.png",
44
41
  svgUrl: "https://example.com/logo.svg",
45
42
  metadata: {
@@ -48,20 +45,17 @@ describe("getTokens", () => {
48
45
  }
49
46
  }
50
47
  ];
51
- mockedAxios.get.mockResolvedValue({ data: response });
52
- const result = await getTokens({
53
- url,
54
- chainId,
48
+ e.get.mockResolvedValue({ data: t });
49
+ const n = await s({
50
+ url: o,
51
+ chainId: 1,
55
52
  nativeAuthToken: "",
56
- bridgeOnly: false
53
+ bridgeOnly: !1
57
54
  });
58
- expect(mockedAxios.get).toHaveBeenCalled();
59
- expect(result.data).toEqual(response);
60
- });
61
- it("handles error when fetching tokens", async () => {
62
- mockedAxios.get.mockRejectedValue(new Error("Network Error"));
63
- await expect(
64
- getTokens({ url, nativeAuthToken: "", bridgeOnly: false })
55
+ expect(e.get).toHaveBeenCalled(), expect(n.data).toEqual(t);
56
+ }), it("handles error when fetching tokens", async () => {
57
+ e.get.mockRejectedValue(new Error("Network Error")), await expect(
58
+ s({ url: o, nativeAuthToken: "", bridgeOnly: !1 })
65
59
  ).rejects.toThrow("Network Error");
66
60
  });
67
61
  });
@@ -1,95 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";
3
- const axios = require("axios");
4
- const types_providerType = require("../../types/providerType.js");
5
- const api_getTransactions = require("../getTransactions.js");
6
- jest.mock("axios");
7
- const mockedAxios = axios;
8
- describe("getTransactions", () => {
9
- const url = "https://api.example.com";
10
- const mockResponse = [
11
- {
12
- fromChainId: "97",
13
- toChainId: "44",
14
- tokenIn: "0x063b637324e6115f8da67f761A99B7F00B7Fd908",
15
- tokenOut: "USDT-58d5d0",
16
- amountIn: "11000000",
17
- amountOut: "11000000",
18
- depositTimestamp: 1738054613,
19
- sender: "0x1009c2f59e03c383ca8f2766cfe305a1e79f4c8d",
20
- status: "success",
21
- receiver: "erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",
22
- txHash: "0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",
23
- fee: "0",
24
- provider: types_providerType.ProviderType.MultiversxBridge
25
- }
26
- ];
27
- beforeEach(() => {
28
- mockedAxios.get.mockClear();
29
- mockedAxios.get.mockResolvedValue({ data: mockResponse });
30
- });
31
- it("fetches transactions with only address parameter", async () => {
32
- const address = "0x123";
33
- const result = await api_getTransactions.getTransactions({ url, address, nativeAuthToken: "" });
34
- expect(mockedAxios.get).toHaveBeenCalled();
35
- expect(result.data).toEqual(mockResponse);
36
- });
37
- it("fetches transactions with empty address", async () => {
38
- const address = "";
39
- const result = await api_getTransactions.getTransactions({ url, address, nativeAuthToken: "" });
40
- expect(mockedAxios.get).toHaveBeenCalled();
41
- expect(result.data).toEqual(mockResponse);
42
- });
43
- it("includes all non-empty parameters in the query", async () => {
44
- const result = await api_getTransactions.getTransactions({
45
- url,
46
- address: "0x123",
47
- sender: "0xABC",
48
- provider: types_providerType.ProviderType.MultiversxBridge,
49
- status: "success",
50
- tokenIn: "0xTOKEN",
51
- tokenOut: "WEGLD-123456",
52
- nativeAuthToken: ""
53
- });
54
- expect(mockedAxios.get).toHaveBeenCalled();
55
- expect(result.data).toEqual(mockResponse);
56
- });
57
- it("excludes empty parameters from the query", async () => {
58
- const result = await api_getTransactions.getTransactions({
59
- url,
60
- address: "0x123",
61
- sender: "",
62
- provider: types_providerType.ProviderType.MultiversxBridge,
63
- status: "",
64
- tokenIn: "0xTOKEN",
65
- tokenOut: "",
66
- nativeAuthToken: ""
67
- });
68
- expect(mockedAxios.get).toHaveBeenCalled();
69
- expect(result.data).toEqual(mockResponse);
70
- });
71
- it("handles axios error", async () => {
72
- const error = new Error("Network error");
73
- mockedAxios.get.mockRejectedValueOnce(error);
74
- await expect(
75
- api_getTransactions.getTransactions({ url, address: "0x123", nativeAuthToken: "" })
76
- ).rejects.toThrow("Network error");
77
- expect(mockedAxios.get).toHaveBeenCalled();
78
- });
79
- it("passes through axios response", async () => {
80
- const axiosResponse = {
81
- data: mockResponse,
82
- status: 200,
83
- statusText: "OK",
84
- headers: {},
85
- config: {}
86
- };
87
- mockedAxios.get.mockResolvedValueOnce(axiosResponse);
88
- const result = await api_getTransactions.getTransactions({
89
- url,
90
- address: "0x123",
91
- nativeAuthToken: ""
92
- });
93
- expect(result).toEqual(axiosResponse);
94
- });
95
- });
2
+ "use strict";const c=require("axios"),o=require("../../types/providerType.js"),r=require("../getTransactions.js");jest.mock("axios");const t=c;describe("getTransactions",()=>{const s="https://api.example.com",a=[{fromChainId:"97",toChainId:"44",tokenIn:"0x063b637324e6115f8da67f761A99B7F00B7Fd908",tokenOut:"USDT-58d5d0",amountIn:"11000000",amountOut:"11000000",depositTimestamp:1738054613,sender:"0x1009c2f59e03c383ca8f2766cfe305a1e79f4c8d",status:"success",receiver:"erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",txHash:"0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",fee:"0",provider:o.ProviderType.MultiversxBridge}];beforeEach(()=>{t.get.mockClear(),t.get.mockResolvedValue({data:a})}),it("fetches transactions with only address parameter",async()=>{const n=await r.getTransactions({url:s,address:"0x123",nativeAuthToken:""});expect(t.get).toHaveBeenCalled(),expect(n.data).toEqual(a)}),it("fetches transactions with empty address",async()=>{const n=await r.getTransactions({url:s,address:"",nativeAuthToken:""});expect(t.get).toHaveBeenCalled(),expect(n.data).toEqual(a)}),it("includes all non-empty parameters in the query",async()=>{const e=await r.getTransactions({url:s,address:"0x123",sender:"0xABC",provider:o.ProviderType.MultiversxBridge,status:"success",tokenIn:"0xTOKEN",tokenOut:"WEGLD-123456",nativeAuthToken:""});expect(t.get).toHaveBeenCalled(),expect(e.data).toEqual(a)}),it("excludes empty parameters from the query",async()=>{const e=await r.getTransactions({url:s,address:"0x123",sender:"",provider:o.ProviderType.MultiversxBridge,status:"",tokenIn:"0xTOKEN",tokenOut:"",nativeAuthToken:""});expect(t.get).toHaveBeenCalled(),expect(e.data).toEqual(a)}),it("handles axios error",async()=>{const e=new Error("Network error");t.get.mockRejectedValueOnce(e),await expect(r.getTransactions({url:s,address:"0x123",nativeAuthToken:""})).rejects.toThrow("Network error"),expect(t.get).toHaveBeenCalled()}),it("passes through axios response",async()=>{const e={data:a,status:200,statusText:"OK",headers:{},config:{}};t.get.mockResolvedValueOnce(e);const n=await r.getTransactions({url:s,address:"0x123",nativeAuthToken:""});expect(n).toEqual(e)})});
@@ -1,11 +1,10 @@
1
- import axios from "axios";
2
- import { ProviderType } from "../../types/providerType.mjs";
3
- import { getTransactions } from "../getTransactions.mjs";
1
+ import c from "axios";
2
+ import { ProviderType as n } from "../../types/providerType.mjs";
3
+ import { getTransactions as o } from "../getTransactions.mjs";
4
4
  jest.mock("axios");
5
- const mockedAxios = axios;
5
+ const t = c;
6
6
  describe("getTransactions", () => {
7
- const url = "https://api.example.com";
8
- const mockResponse = [
7
+ const a = "https://api.example.com", s = [
9
8
  {
10
9
  fromChainId: "97",
11
10
  toChainId: "44",
@@ -19,75 +18,60 @@ describe("getTransactions", () => {
19
18
  receiver: "erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",
20
19
  txHash: "0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",
21
20
  fee: "0",
22
- provider: ProviderType.MultiversxBridge
21
+ provider: n.MultiversxBridge
23
22
  }
24
23
  ];
25
24
  beforeEach(() => {
26
- mockedAxios.get.mockClear();
27
- mockedAxios.get.mockResolvedValue({ data: mockResponse });
28
- });
29
- it("fetches transactions with only address parameter", async () => {
30
- const address = "0x123";
31
- const result = await getTransactions({ url, address, nativeAuthToken: "" });
32
- expect(mockedAxios.get).toHaveBeenCalled();
33
- expect(result.data).toEqual(mockResponse);
34
- });
35
- it("fetches transactions with empty address", async () => {
36
- const address = "";
37
- const result = await getTransactions({ url, address, nativeAuthToken: "" });
38
- expect(mockedAxios.get).toHaveBeenCalled();
39
- expect(result.data).toEqual(mockResponse);
40
- });
41
- it("includes all non-empty parameters in the query", async () => {
42
- const result = await getTransactions({
43
- url,
25
+ t.get.mockClear(), t.get.mockResolvedValue({ data: s });
26
+ }), it("fetches transactions with only address parameter", async () => {
27
+ const r = await o({ url: a, address: "0x123", nativeAuthToken: "" });
28
+ expect(t.get).toHaveBeenCalled(), expect(r.data).toEqual(s);
29
+ }), it("fetches transactions with empty address", async () => {
30
+ const r = await o({ url: a, address: "", nativeAuthToken: "" });
31
+ expect(t.get).toHaveBeenCalled(), expect(r.data).toEqual(s);
32
+ }), it("includes all non-empty parameters in the query", async () => {
33
+ const e = await o({
34
+ url: a,
44
35
  address: "0x123",
45
36
  sender: "0xABC",
46
- provider: ProviderType.MultiversxBridge,
37
+ provider: n.MultiversxBridge,
47
38
  status: "success",
48
39
  tokenIn: "0xTOKEN",
49
40
  tokenOut: "WEGLD-123456",
50
41
  nativeAuthToken: ""
51
42
  });
52
- expect(mockedAxios.get).toHaveBeenCalled();
53
- expect(result.data).toEqual(mockResponse);
54
- });
55
- it("excludes empty parameters from the query", async () => {
56
- const result = await getTransactions({
57
- url,
43
+ expect(t.get).toHaveBeenCalled(), expect(e.data).toEqual(s);
44
+ }), it("excludes empty parameters from the query", async () => {
45
+ const e = await o({
46
+ url: a,
58
47
  address: "0x123",
59
48
  sender: "",
60
- provider: ProviderType.MultiversxBridge,
49
+ provider: n.MultiversxBridge,
61
50
  status: "",
62
51
  tokenIn: "0xTOKEN",
63
52
  tokenOut: "",
64
53
  nativeAuthToken: ""
65
54
  });
66
- expect(mockedAxios.get).toHaveBeenCalled();
67
- expect(result.data).toEqual(mockResponse);
68
- });
69
- it("handles axios error", async () => {
70
- const error = new Error("Network error");
71
- mockedAxios.get.mockRejectedValueOnce(error);
72
- await expect(
73
- getTransactions({ url, address: "0x123", nativeAuthToken: "" })
74
- ).rejects.toThrow("Network error");
75
- expect(mockedAxios.get).toHaveBeenCalled();
76
- });
77
- it("passes through axios response", async () => {
78
- const axiosResponse = {
79
- data: mockResponse,
55
+ expect(t.get).toHaveBeenCalled(), expect(e.data).toEqual(s);
56
+ }), it("handles axios error", async () => {
57
+ const e = new Error("Network error");
58
+ t.get.mockRejectedValueOnce(e), await expect(
59
+ o({ url: a, address: "0x123", nativeAuthToken: "" })
60
+ ).rejects.toThrow("Network error"), expect(t.get).toHaveBeenCalled();
61
+ }), it("passes through axios response", async () => {
62
+ const e = {
63
+ data: s,
80
64
  status: 200,
81
65
  statusText: "OK",
82
66
  headers: {},
83
67
  config: {}
84
68
  };
85
- mockedAxios.get.mockResolvedValueOnce(axiosResponse);
86
- const result = await getTransactions({
87
- url,
69
+ t.get.mockResolvedValueOnce(e);
70
+ const r = await o({
71
+ url: a,
88
72
  address: "0x123",
89
73
  nativeAuthToken: ""
90
74
  });
91
- expect(result).toEqual(axiosResponse);
75
+ expect(r).toEqual(e);
92
76
  });
93
77
  });
@@ -1,97 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";
3
- const axios = require("axios");
4
- const api_sendTransactions = require("../sendTransactions.js");
5
- const helpers_serializeTransaction = require("../../helpers/serializeTransaction.js");
6
- const types_providerType = require("../../types/providerType.js");
7
- jest.mock("axios");
8
- const mockedAxios = axios;
9
- describe("sendTransactions", () => {
10
- const url = "https://api.example.com";
11
- const token = "someValidToken";
12
- const transactions = [
13
- {
14
- from: "0xAlice",
15
- to: "0xBob",
16
- type: "eip1559",
17
- gas: BigInt(1e5),
18
- gasPrice: BigInt(1e9),
19
- chainId: 1,
20
- hash: "0x1234",
21
- nonce: 1,
22
- value: BigInt(1e18)
23
- }
24
- ];
25
- it("POST sendTransactions successfully", async () => {
26
- const response = { data: { transactions, provider: types_providerType.ProviderType.None } };
27
- mockedAxios.post.mockResolvedValue(response);
28
- const result = await api_sendTransactions.sendTransactions({
29
- transactions,
30
- provider: types_providerType.ProviderType.None,
31
- url,
32
- token
33
- });
34
- expect(mockedAxios.post).toHaveBeenCalledWith(
35
- "/transactions",
36
- {
37
- transactions: transactions.map(
38
- (transaction) => JSON.parse(helpers_serializeTransaction.serializeTransaction(transaction))
39
- ),
40
- provider: types_providerType.ProviderType.None
41
- },
42
- {
43
- baseURL: url,
44
- headers: {
45
- "Content-Type": "application/json",
46
- Accept: "application/json",
47
- Authorization: `Bearer ${token}`
48
- }
49
- }
50
- );
51
- expect(result.data).toEqual(response.data);
52
- });
53
- it("POST sendTransactions with additional axiosConfig", async () => {
54
- const axiosConfig = { timeout: 1e3 };
55
- const response = { data: { transactions, provider: types_providerType.ProviderType.None } };
56
- mockedAxios.post.mockResolvedValue(response);
57
- const result = await api_sendTransactions.sendTransactions({
58
- transactions,
59
- provider: types_providerType.ProviderType.None,
60
- url,
61
- token,
62
- axiosConfig
63
- });
64
- expect(mockedAxios.post).toHaveBeenCalledWith(
65
- "/transactions",
66
- {
67
- transactions: transactions.map(
68
- (transaction) => JSON.parse(helpers_serializeTransaction.serializeTransaction(transaction))
69
- ),
70
- provider: types_providerType.ProviderType.None
71
- },
72
- {
73
- baseURL: url,
74
- headers: {
75
- "Content-Type": "application/json",
76
- Accept: "application/json",
77
- Authorization: `Bearer ${token}`
78
- },
79
- timeout: 1e3
80
- }
81
- );
82
- expect(result.data).toEqual(response.data);
83
- });
84
- it("handles error when sending transactions", async () => {
85
- mockedAxios.post.mockRejectedValue(new Error("Network Error"));
86
- await expect(
87
- api_sendTransactions.sendTransactions({
88
- transactions: transactions.map(
89
- (transaction) => JSON.parse(helpers_serializeTransaction.serializeTransaction(transaction))
90
- ),
91
- provider: types_providerType.ProviderType.None,
92
- url,
93
- token
94
- })
95
- ).rejects.toThrow("Network Error");
96
- });
97
- });
2
+ "use strict";const l=require("axios"),c=require("../sendTransactions.js"),p=require("../../helpers/serializeTransaction.js"),o=require("../../types/providerType.js");jest.mock("axios");const n=l;describe("sendTransactions",()=>{const s="https://api.example.com",t="someValidToken",e=[{from:"0xAlice",to:"0xBob",type:"eip1559",gas:BigInt(1e5),gasPrice:BigInt(1e9),chainId:1,hash:"0x1234",nonce:1,value:BigInt(1e18)}];it("POST sendTransactions successfully",async()=>{const a={data:{transactions:e,provider:o.ProviderType.None}};n.post.mockResolvedValue(a);const r=await c.sendTransactions({transactions:e,provider:o.ProviderType.None,url:s,token:t});expect(n.post).toHaveBeenCalledWith("/transactions",{transactions:e.map(i=>JSON.parse(p.serializeTransaction(i))),provider:o.ProviderType.None},{baseURL:s,headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${t}`}}),expect(r.data).toEqual(a.data)}),it("POST sendTransactions with additional axiosConfig",async()=>{const a={timeout:1e3},r={data:{transactions:e,provider:o.ProviderType.None}};n.post.mockResolvedValue(r);const i=await c.sendTransactions({transactions:e,provider:o.ProviderType.None,url:s,token:t,axiosConfig:a});expect(n.post).toHaveBeenCalledWith("/transactions",{transactions:e.map(d=>JSON.parse(p.serializeTransaction(d))),provider:o.ProviderType.None},{baseURL:s,headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${t}`},timeout:1e3}),expect(i.data).toEqual(r.data)}),it("handles error when sending transactions",async()=>{n.post.mockRejectedValue(new Error("Network Error")),await expect(c.sendTransactions({transactions:e.map(a=>JSON.parse(p.serializeTransaction(a))),provider:o.ProviderType.None,url:s,token:t})).rejects.toThrow("Network Error")})});
@@ -1,13 +1,11 @@
1
- import axios from "axios";
2
- import { sendTransactions } from "../sendTransactions.mjs";
3
- import { serializeTransaction } from "../../helpers/serializeTransaction.mjs";
4
- import { ProviderType } from "../../types/providerType.mjs";
1
+ import l from "axios";
2
+ import { sendTransactions as c } from "../sendTransactions.mjs";
3
+ import { serializeTransaction as p } from "../../helpers/serializeTransaction.mjs";
4
+ import { ProviderType as o } from "../../types/providerType.mjs";
5
5
  jest.mock("axios");
6
- const mockedAxios = axios;
6
+ const n = l;
7
7
  describe("sendTransactions", () => {
8
- const url = "https://api.example.com";
9
- const token = "someValidToken";
10
- const transactions = [
8
+ const a = "https://api.example.com", s = "someValidToken", e = [
11
9
  {
12
10
  from: "0xAlice",
13
11
  to: "0xBob",
@@ -21,74 +19,68 @@ describe("sendTransactions", () => {
21
19
  }
22
20
  ];
23
21
  it("POST sendTransactions successfully", async () => {
24
- const response = { data: { transactions, provider: ProviderType.None } };
25
- mockedAxios.post.mockResolvedValue(response);
26
- const result = await sendTransactions({
27
- transactions,
28
- provider: ProviderType.None,
29
- url,
30
- token
22
+ const t = { data: { transactions: e, provider: o.None } };
23
+ n.post.mockResolvedValue(t);
24
+ const r = await c({
25
+ transactions: e,
26
+ provider: o.None,
27
+ url: a,
28
+ token: s
31
29
  });
32
- expect(mockedAxios.post).toHaveBeenCalledWith(
30
+ expect(n.post).toHaveBeenCalledWith(
33
31
  "/transactions",
34
32
  {
35
- transactions: transactions.map(
36
- (transaction) => JSON.parse(serializeTransaction(transaction))
33
+ transactions: e.map(
34
+ (i) => JSON.parse(p(i))
37
35
  ),
38
- provider: ProviderType.None
36
+ provider: o.None
39
37
  },
40
38
  {
41
- baseURL: url,
39
+ baseURL: a,
42
40
  headers: {
43
41
  "Content-Type": "application/json",
44
42
  Accept: "application/json",
45
- Authorization: `Bearer ${token}`
43
+ Authorization: `Bearer ${s}`
46
44
  }
47
45
  }
48
- );
49
- expect(result.data).toEqual(response.data);
50
- });
51
- it("POST sendTransactions with additional axiosConfig", async () => {
52
- const axiosConfig = { timeout: 1e3 };
53
- const response = { data: { transactions, provider: ProviderType.None } };
54
- mockedAxios.post.mockResolvedValue(response);
55
- const result = await sendTransactions({
56
- transactions,
57
- provider: ProviderType.None,
58
- url,
59
- token,
60
- axiosConfig
46
+ ), expect(r.data).toEqual(t.data);
47
+ }), it("POST sendTransactions with additional axiosConfig", async () => {
48
+ const t = { timeout: 1e3 }, r = { data: { transactions: e, provider: o.None } };
49
+ n.post.mockResolvedValue(r);
50
+ const i = await c({
51
+ transactions: e,
52
+ provider: o.None,
53
+ url: a,
54
+ token: s,
55
+ axiosConfig: t
61
56
  });
62
- expect(mockedAxios.post).toHaveBeenCalledWith(
57
+ expect(n.post).toHaveBeenCalledWith(
63
58
  "/transactions",
64
59
  {
65
- transactions: transactions.map(
66
- (transaction) => JSON.parse(serializeTransaction(transaction))
60
+ transactions: e.map(
61
+ (d) => JSON.parse(p(d))
67
62
  ),
68
- provider: ProviderType.None
63
+ provider: o.None
69
64
  },
70
65
  {
71
- baseURL: url,
66
+ baseURL: a,
72
67
  headers: {
73
68
  "Content-Type": "application/json",
74
69
  Accept: "application/json",
75
- Authorization: `Bearer ${token}`
70
+ Authorization: `Bearer ${s}`
76
71
  },
77
72
  timeout: 1e3
78
73
  }
79
- );
80
- expect(result.data).toEqual(response.data);
81
- });
82
- it("handles error when sending transactions", async () => {
83
- mockedAxios.post.mockRejectedValue(new Error("Network Error"));
84
- await expect(
85
- sendTransactions({
86
- transactions: transactions.map(
87
- (transaction) => JSON.parse(serializeTransaction(transaction))
74
+ ), expect(i.data).toEqual(r.data);
75
+ }), it("handles error when sending transactions", async () => {
76
+ n.post.mockRejectedValue(new Error("Network Error")), await expect(
77
+ c({
78
+ transactions: e.map(
79
+ (t) => JSON.parse(p(t))
88
80
  ),
89
- provider: ProviderType.None,
90
- url,
91
- token
81
+ provider: o.None,
82
+ url: a,
83
+ token: s
92
84
  })
93
85
  ).rejects.toThrow("Network Error");
94
86
  });
@@ -1,5 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const MVX_CHAIN_IDS = ["31", "44", "54"];
5
- exports.MVX_CHAIN_IDS = MVX_CHAIN_IDS;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=["31","44","54"];exports.MVX_CHAIN_IDS=e;
@@ -1,4 +1,4 @@
1
- const MVX_CHAIN_IDS = ["31", "44", "54"];
1
+ const o = ["31", "44", "54"];
2
2
  export {
3
- MVX_CHAIN_IDS
3
+ o as MVX_CHAIN_IDS
4
4
  };
@@ -0,0 +1,4 @@
1
+ const L = "data:image/svg+xml,%3csvg%20width='256'%20height='256'%20viewBox='0%200%20256%20256'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M128.625%2063.3125C128.312%2063%20127.688%2063%20127.062%2063.3125L102.375%2072.6875L128%2082.375L153.312%2072.6875L128.625%2063.3125ZM95.5%20113.938L120.5%20123.312V95.5L95.5%2085.8125V113.938ZM135.5%20123.312L160.5%20113.938V85.8125L135.5%2095.5V123.312ZM128%20191.125L92.375%20206.75C88%20208.625%2082.6875%20208.625%2078.3125%20206.75L48.3125%20193.625C42.0625%20190.812%2038%20184.562%2038%20177.375V140.188C38%20133%2042.375%20126.438%2049.25%20123.938L79.25%20112.375C79.5625%20112.375%2079.875%20112.062%2080.5%20112.062V77.0625C80.5%2069.875%2084.875%2063.3125%2091.75%2060.8125L121.75%2049.25C125.5%2047.6875%20130.188%2047.6875%20133.938%2049.25L163.938%2060.8125C170.812%2063.3125%20175.5%2069.875%20175.5%2077.0625V112.062C175.812%20112.375%20176.125%20112.375%20176.438%20112.375L206.438%20123.938C213.312%20126.438%20218%20133%20218%20140.188V177.375C218%20184.562%20213.625%20190.812%20207.375%20193.625L177.375%20206.75C173%20208.625%20167.688%20208.625%20163.312%20206.75L128%20191.125ZM84.5625%20126.438L59.875%20135.812L85.5%20145.5L110.812%20135.812L86.125%20126.438C85.8125%20126.438%2085.1875%20126.438%2084.5625%20126.438ZM93%20158.625V190.188L118%20179.25V149.25L93%20158.625ZM78%20158.625L53%20149.25V177.375C53%20178.625%2053.3125%20179.25%2054.25%20179.875L78%20190.188V158.625ZM169.562%20126.438L144.875%20135.812L170.5%20145.5L195.812%20135.812L171.125%20126.438C170.812%20126.438%20170.188%20126.438%20169.562%20126.438ZM178%20190.188L201.438%20179.875C202.375%20179.25%20203%20178.312%20203%20177.375V149.25L178%20158.625V190.188ZM163%20158.625L138%20149.25V179.25L163%20190.188V158.625Z'%20fill='%239195A3'/%3e%3cpath%20opacity='0.4'%20d='M95.5%2085.8125L120.5%2095.5V123.312L95.5%20113.938V85.8125ZM160.5%20113.938L135.5%20123.312V95.5L160.5%2085.8125V113.938ZM118%20149.25V179.25L93%20190.188V158.625L118%20149.25ZM53%20149.25L78%20158.625V190.188L54.25%20179.875C53.3125%20179.25%2053%20178.625%2053%20177.375V149.25ZM178%20158.625L203%20149.25V177.375C203%20178.312%20202.375%20179.25%20201.438%20179.875L178%20190.188V158.625ZM163%20190.188L138%20179.25V149.25L163%20158.625V190.188Z'%20fill='%239195A3'/%3e%3c/svg%3e";
2
+ export {
3
+ L as D
4
+ };
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ "use strict";const L="data:image/svg+xml,%3csvg%20width='256'%20height='256'%20viewBox='0%200%20256%20256'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M128.625%2063.3125C128.312%2063%20127.688%2063%20127.062%2063.3125L102.375%2072.6875L128%2082.375L153.312%2072.6875L128.625%2063.3125ZM95.5%20113.938L120.5%20123.312V95.5L95.5%2085.8125V113.938ZM135.5%20123.312L160.5%20113.938V85.8125L135.5%2095.5V123.312ZM128%20191.125L92.375%20206.75C88%20208.625%2082.6875%20208.625%2078.3125%20206.75L48.3125%20193.625C42.0625%20190.812%2038%20184.562%2038%20177.375V140.188C38%20133%2042.375%20126.438%2049.25%20123.938L79.25%20112.375C79.5625%20112.375%2079.875%20112.062%2080.5%20112.062V77.0625C80.5%2069.875%2084.875%2063.3125%2091.75%2060.8125L121.75%2049.25C125.5%2047.6875%20130.188%2047.6875%20133.938%2049.25L163.938%2060.8125C170.812%2063.3125%20175.5%2069.875%20175.5%2077.0625V112.062C175.812%20112.375%20176.125%20112.375%20176.438%20112.375L206.438%20123.938C213.312%20126.438%20218%20133%20218%20140.188V177.375C218%20184.562%20213.625%20190.812%20207.375%20193.625L177.375%20206.75C173%20208.625%20167.688%20208.625%20163.312%20206.75L128%20191.125ZM84.5625%20126.438L59.875%20135.812L85.5%20145.5L110.812%20135.812L86.125%20126.438C85.8125%20126.438%2085.1875%20126.438%2084.5625%20126.438ZM93%20158.625V190.188L118%20179.25V149.25L93%20158.625ZM78%20158.625L53%20149.25V177.375C53%20178.625%2053.3125%20179.25%2054.25%20179.875L78%20190.188V158.625ZM169.562%20126.438L144.875%20135.812L170.5%20145.5L195.812%20135.812L171.125%20126.438C170.812%20126.438%20170.188%20126.438%20169.562%20126.438ZM178%20190.188L201.438%20179.875C202.375%20179.25%20203%20178.312%20203%20177.375V149.25L178%20158.625V190.188ZM163%20158.625L138%20149.25V179.25L163%20190.188V158.625Z'%20fill='%239195A3'/%3e%3cpath%20opacity='0.4'%20d='M95.5%2085.8125L120.5%2095.5V123.312L95.5%20113.938V85.8125ZM160.5%20113.938L135.5%20123.312V95.5L160.5%2085.8125V113.938ZM118%20149.25V179.25L93%20190.188V158.625L118%20149.25ZM53%20149.25L78%20158.625V190.188L54.25%20179.875C53.3125%20179.25%2053%20178.625%2053%20177.375V149.25ZM178%20158.625L203%20149.25V177.375C203%20178.312%20202.375%20179.25%20201.438%20179.875L178%20190.188V158.625ZM163%20190.188L138%20179.25V149.25L163%20158.625V190.188Z'%20fill='%239195A3'/%3e%3c/svg%3e";exports.DefaultIcon=L;