@rango-dev/widget-embedded 0.17.1-next.3 → 0.17.1-next.30

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 (312) hide show
  1. package/dist/QueueManager.d.ts +5 -2
  2. package/dist/QueueManager.d.ts.map +1 -1
  3. package/dist/components/AppRouter.d.ts +0 -2
  4. package/dist/components/AppRouter.d.ts.map +1 -1
  5. package/dist/components/AppRoutes.d.ts +1 -6
  6. package/dist/components/AppRoutes.d.ts.map +1 -1
  7. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +56 -56
  8. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
  9. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts +0 -2
  10. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts.map +1 -1
  11. package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
  12. package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts +1 -4
  13. package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts.map +1 -1
  14. package/dist/components/HeaderButtons/HomeButtons.d.ts.map +1 -1
  15. package/dist/components/Layout/Layout.d.ts.map +1 -1
  16. package/dist/components/Layout/Layout.types.d.ts +2 -2
  17. package/dist/components/Layout/Layout.types.d.ts.map +1 -1
  18. package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -1
  19. package/dist/components/Quote/Quote.d.ts.map +1 -1
  20. package/dist/components/Quote/Quote.styles.d.ts +159 -0
  21. package/dist/components/Quote/Quote.styles.d.ts.map +1 -1
  22. package/dist/components/Quote/Quote.types.d.ts +0 -1
  23. package/dist/components/Quote/Quote.types.d.ts.map +1 -1
  24. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts.map +1 -1
  25. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts.map +1 -1
  26. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +1 -1
  27. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts +1 -0
  28. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts.map +1 -1
  29. package/dist/components/Slippage/Slippage.d.ts.map +1 -1
  30. package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -1
  31. package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
  32. package/dist/components/SwapDetails/SwapDetails.helpers.d.ts +1 -1
  33. package/dist/components/SwapDetails/SwapDetails.helpers.d.ts.map +1 -1
  34. package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts.map +1 -1
  35. package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts +1 -1
  36. package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts.map +1 -1
  37. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +1 -1
  38. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -1
  39. package/dist/components/SwapsGroup/SwapsGroup.d.ts.map +1 -1
  40. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -1
  41. package/dist/components/TokenList/TokenList.d.ts.map +1 -1
  42. package/dist/components/TokenList/TokenList.helpers.d.ts +2 -2
  43. package/dist/components/TokenList/TokenList.helpers.d.ts.map +1 -1
  44. package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
  45. package/dist/components/TokenList/TokenList.types.d.ts +3 -9
  46. package/dist/components/TokenList/TokenList.types.d.ts.map +1 -1
  47. package/dist/components/TokenList/index.d.ts +0 -1
  48. package/dist/components/TokenList/index.d.ts.map +1 -1
  49. package/dist/components/UpdateUrl.d.ts +1 -6
  50. package/dist/components/UpdateUrl.d.ts.map +1 -1
  51. package/dist/components/WidgetEvents.d.ts.map +1 -1
  52. package/dist/constants/errors.d.ts.map +1 -1
  53. package/dist/constants/index.d.ts +1 -0
  54. package/dist/constants/index.d.ts.map +1 -1
  55. package/dist/constants/navigationRoutes.d.ts +1 -2
  56. package/dist/constants/navigationRoutes.d.ts.map +1 -1
  57. package/dist/constants/searchParams.d.ts +2 -1
  58. package/dist/constants/searchParams.d.ts.map +1 -1
  59. package/dist/containers/App/App.d.ts +3 -0
  60. package/dist/containers/App/App.d.ts.map +1 -0
  61. package/dist/containers/App/App.styles.d.ts +158 -0
  62. package/dist/containers/App/App.styles.d.ts.map +1 -0
  63. package/dist/containers/App/index.d.ts +2 -0
  64. package/dist/containers/App/index.d.ts.map +1 -0
  65. package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
  66. package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +316 -0
  67. package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +1 -1
  68. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +3 -0
  69. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
  70. package/dist/containers/Wallets/Wallets.d.ts +6 -0
  71. package/dist/containers/Wallets/Wallets.d.ts.map +1 -0
  72. package/dist/containers/Wallets/Wallets.types.d.ts +11 -0
  73. package/dist/containers/Wallets/Wallets.types.d.ts.map +1 -0
  74. package/dist/containers/Wallets/index.d.ts +2 -0
  75. package/dist/containers/Wallets/index.d.ts.map +1 -0
  76. package/dist/containers/Widget/Widget.d.ts +5 -0
  77. package/dist/containers/Widget/Widget.d.ts.map +1 -0
  78. package/dist/containers/Widget/Widget.types.d.ts +5 -0
  79. package/dist/containers/Widget/Widget.types.d.ts.map +1 -0
  80. package/dist/containers/Widget/index.d.ts +3 -0
  81. package/dist/containers/Widget/index.d.ts.map +1 -0
  82. package/dist/containers/WidgetInfo/WidgetInfo.d.ts +6 -0
  83. package/dist/containers/WidgetInfo/WidgetInfo.d.ts.map +1 -0
  84. package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts +20 -0
  85. package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts.map +1 -0
  86. package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts +21 -0
  87. package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts.map +1 -0
  88. package/dist/containers/WidgetInfo/index.d.ts +2 -0
  89. package/dist/containers/WidgetInfo/index.d.ts.map +1 -0
  90. package/dist/containers/WidgetProvider/WidgetProvider.d.ts +5 -0
  91. package/dist/containers/WidgetProvider/WidgetProvider.d.ts.map +1 -0
  92. package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts +7 -0
  93. package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts.map +1 -0
  94. package/dist/containers/WidgetProvider/index.d.ts +2 -0
  95. package/dist/containers/WidgetProvider/index.d.ts.map +1 -0
  96. package/dist/hooks/useConfirmSwap/useConfirmSwap.d.ts.map +1 -1
  97. package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts +6 -3
  98. package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts.map +1 -1
  99. package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts +1 -1
  100. package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts.map +1 -1
  101. package/dist/hooks/useForceAutoConnect.d.ts +2 -0
  102. package/dist/hooks/useForceAutoConnect.d.ts.map +1 -0
  103. package/dist/hooks/useLanguage.d.ts +1 -1
  104. package/dist/hooks/useLanguage.d.ts.map +1 -1
  105. package/dist/hooks/useNavigateBack.d.ts +1 -3
  106. package/dist/hooks/useNavigateBack.d.ts.map +1 -1
  107. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.d.ts +1 -1
  108. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts +2 -2
  109. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts.map +1 -1
  110. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts +3 -5
  111. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts.map +1 -1
  112. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts +1 -0
  113. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts.map +1 -1
  114. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts +5 -1
  115. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts.map +1 -1
  116. package/dist/hooks/useSwapInput.d.ts.map +1 -1
  117. package/dist/hooks/useSyncStoresWithConfig.d.ts +1 -2
  118. package/dist/hooks/useSyncStoresWithConfig.d.ts.map +1 -1
  119. package/dist/hooks/useTheme.d.ts +1 -1
  120. package/dist/hooks/useTheme.d.ts.map +1 -1
  121. package/dist/hooks/useWalletList.d.ts.map +1 -1
  122. package/dist/index.d.ts +20 -8
  123. package/dist/index.d.ts.map +1 -1
  124. package/dist/index.js +1 -1
  125. package/dist/index.js.map +4 -4
  126. package/dist/pages/ConfirmSwapPage.d.ts +1 -6
  127. package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
  128. package/dist/pages/HistoryPage.d.ts.map +1 -1
  129. package/dist/pages/Home.d.ts.map +1 -1
  130. package/dist/pages/LanguagePage.d.ts.map +1 -1
  131. package/dist/pages/LiquiditySourcePage.d.ts +1 -2
  132. package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
  133. package/dist/pages/SelectBlockchainPage.d.ts.map +1 -1
  134. package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -1
  135. package/dist/pages/SettingsPage.d.ts +1 -6
  136. package/dist/pages/SettingsPage.d.ts.map +1 -1
  137. package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
  138. package/dist/pages/ThemePage.d.ts.map +1 -1
  139. package/dist/pages/WalletsPage.d.ts +1 -8
  140. package/dist/pages/WalletsPage.d.ts.map +1 -1
  141. package/dist/store/AppStore.d.ts +47 -0
  142. package/dist/store/AppStore.d.ts.map +1 -0
  143. package/dist/store/app.d.ts +41 -22
  144. package/dist/store/app.d.ts.map +1 -1
  145. package/dist/store/notification.d.ts +4 -3
  146. package/dist/store/notification.d.ts.map +1 -1
  147. package/dist/store/quote.d.ts +23 -16
  148. package/dist/store/quote.d.ts.map +1 -1
  149. package/dist/store/slices/config.d.ts +3 -2
  150. package/dist/store/slices/config.d.ts.map +1 -1
  151. package/dist/store/slices/data.d.ts +3 -0
  152. package/dist/store/slices/data.d.ts.map +1 -1
  153. package/dist/store/slices/settings.d.ts +39 -0
  154. package/dist/store/slices/settings.d.ts.map +1 -0
  155. package/dist/store/ui.d.ts +2 -1
  156. package/dist/store/ui.d.ts.map +1 -1
  157. package/dist/store/wallets.d.ts +14 -9
  158. package/dist/store/wallets.d.ts.map +1 -1
  159. package/dist/types/config.d.ts +38 -5
  160. package/dist/types/config.d.ts.map +1 -1
  161. package/dist/types/swap.d.ts +4 -14
  162. package/dist/types/swap.d.ts.map +1 -1
  163. package/dist/types/wallets.d.ts +15 -1
  164. package/dist/types/wallets.d.ts.map +1 -1
  165. package/dist/utils/colors.d.ts.map +1 -1
  166. package/dist/utils/configs.d.ts +1 -0
  167. package/dist/utils/configs.d.ts.map +1 -1
  168. package/dist/utils/meta.d.ts +2 -1
  169. package/dist/utils/meta.d.ts.map +1 -1
  170. package/dist/utils/providers.d.ts +2 -2
  171. package/dist/utils/providers.d.ts.map +1 -1
  172. package/dist/utils/queue.d.ts +2 -2
  173. package/dist/utils/queue.d.ts.map +1 -1
  174. package/dist/utils/quote.d.ts +1 -1
  175. package/dist/utils/quote.d.ts.map +1 -1
  176. package/dist/utils/settings.d.ts +6 -2
  177. package/dist/utils/settings.d.ts.map +1 -1
  178. package/dist/utils/swap.d.ts +16 -7
  179. package/dist/utils/swap.d.ts.map +1 -1
  180. package/dist/utils/time.d.ts +1 -1
  181. package/dist/utils/time.d.ts.map +1 -1
  182. package/dist/utils/wallets.d.ts +7 -9
  183. package/dist/utils/wallets.d.ts.map +1 -1
  184. package/package.json +12 -10
  185. package/src/QueueManager.tsx +18 -17
  186. package/src/components/AppRouter.tsx +8 -32
  187. package/src/components/AppRoutes.tsx +57 -69
  188. package/src/components/BlockchainList/BlockchainList.tsx +4 -4
  189. package/src/components/BlockchainsSection/BlockchainsSection.tsx +4 -4
  190. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +16 -19
  191. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.types.ts +0 -2
  192. package/src/components/ConfirmWalletsModal/WalletList.tsx +6 -5
  193. package/src/components/ConfirmWalletsModal/WalletList.type.ts +1 -4
  194. package/src/components/HeaderButtons/HomeButtons.tsx +28 -18
  195. package/src/components/Layout/Layout.tsx +20 -7
  196. package/src/components/Layout/Layout.types.ts +2 -2
  197. package/src/components/NoResult/NoResult.helpers.ts +12 -12
  198. package/src/components/NoResult/NoResult.tsx +6 -6
  199. package/src/components/NotificationContent/NotificationContent.tsx +5 -3
  200. package/src/components/Quote/Quote.styles.ts +28 -1
  201. package/src/components/Quote/Quote.tsx +100 -34
  202. package/src/components/Quote/Quote.types.ts +0 -1
  203. package/src/components/Quote/QuoteSkeleton.tsx +1 -1
  204. package/src/components/QuoteWarningsAndErrors/QuoteErrorsModalItem.tsx +1 -1
  205. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.ts +11 -4
  206. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.ts +8 -1
  207. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.tsx +13 -13
  208. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.ts +1 -0
  209. package/src/components/QuoteWarningsAndErrors/SlippageWariningModal.tsx +3 -3
  210. package/src/components/Slippage/Slippage.tsx +3 -5
  211. package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +0 -4
  212. package/src/components/SwapDetails/SwapDetails.helpers.tsx +1 -1
  213. package/src/components/SwapDetails/SwapDetails.tsx +19 -39
  214. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.tsx +1 -1
  215. package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +4 -3
  216. package/src/components/SwapDetailsModal/SwapDetailsModal.Cancel.tsx +2 -2
  217. package/src/components/SwapDetailsModal/SwapDetailsModal.helpers.tsx +1 -1
  218. package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +1 -1
  219. package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +1 -1
  220. package/src/components/SwapsGroup/SwapsGroup.styles.ts +8 -1
  221. package/src/components/SwapsGroup/SwapsGroup.tsx +0 -2
  222. package/src/components/TokenList/TokenList.helpers.ts +2 -2
  223. package/src/components/TokenList/TokenList.styles.ts +14 -2
  224. package/src/components/TokenList/TokenList.tsx +16 -19
  225. package/src/components/TokenList/TokenList.types.ts +3 -10
  226. package/src/components/TokenList/index.ts +0 -1
  227. package/src/components/UpdateUrl.tsx +23 -18
  228. package/src/components/WidgetEvents.tsx +4 -2
  229. package/src/constants/errors.ts +9 -5
  230. package/src/constants/index.ts +1 -0
  231. package/src/constants/navigationRoutes.ts +7 -8
  232. package/src/constants/searchParams.ts +1 -0
  233. package/src/containers/App/App.styles.ts +18 -0
  234. package/src/containers/App/App.tsx +52 -0
  235. package/src/containers/App/index.ts +1 -0
  236. package/src/containers/QuoteInfo/QuoteInfo.styles.ts +17 -1
  237. package/src/containers/QuoteInfo/QuoteInfo.tsx +44 -43
  238. package/src/containers/QuoteInfo/QuoteInfo.types.ts +3 -0
  239. package/src/{Wallets.tsx → containers/Wallets/Wallets.tsx} +48 -34
  240. package/src/containers/Wallets/Wallets.types.ts +12 -0
  241. package/src/containers/Wallets/index.ts +1 -0
  242. package/src/containers/Widget/Widget.tsx +19 -0
  243. package/src/containers/Widget/Widget.types.ts +5 -0
  244. package/src/containers/Widget/index.ts +2 -0
  245. package/src/containers/WidgetInfo/WidgetInfo.helpers.ts +64 -0
  246. package/src/containers/WidgetInfo/WidgetInfo.tsx +62 -0
  247. package/src/containers/WidgetInfo/WidgetInfo.types.ts +21 -0
  248. package/src/containers/WidgetInfo/index.ts +1 -0
  249. package/src/containers/WidgetProvider/WidgetProvider.tsx +28 -0
  250. package/src/containers/WidgetProvider/WidgetProvider.types.ts +7 -0
  251. package/src/containers/WidgetProvider/index.ts +1 -0
  252. package/src/hooks/useConfirmSwap/useConfirmSwap.helpers.ts +15 -11
  253. package/src/hooks/useConfirmSwap/useConfirmSwap.ts +25 -24
  254. package/src/hooks/useConfirmSwap/useConfirmSwap.types.ts +1 -1
  255. package/src/hooks/useForceAutoConnect.ts +27 -0
  256. package/src/hooks/useLanguage.ts +4 -5
  257. package/src/hooks/useNavigateBack.ts +3 -52
  258. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.ts +1 -1
  259. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.ts +37 -7
  260. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.ts +60 -0
  261. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.test.ts +78 -3
  262. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.ts +15 -6
  263. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.ts +6 -1
  264. package/src/hooks/useSwapInput.ts +89 -30
  265. package/src/hooks/useSyncStoresWithConfig.ts +38 -22
  266. package/src/hooks/useTheme.ts +4 -5
  267. package/src/hooks/useWalletList.ts +3 -5
  268. package/src/index.ts +53 -5
  269. package/src/pages/ConfirmSwapPage.tsx +39 -24
  270. package/src/pages/HistoryPage.tsx +2 -7
  271. package/src/pages/Home.tsx +58 -88
  272. package/src/pages/LanguagePage.tsx +0 -5
  273. package/src/pages/LiquiditySourcePage.tsx +24 -37
  274. package/src/pages/SelectBlockchainPage.tsx +28 -21
  275. package/src/pages/SelectSwapItemsPage.tsx +10 -27
  276. package/src/pages/SettingsPage.tsx +28 -24
  277. package/src/pages/SwapDetailsPage.tsx +6 -7
  278. package/src/pages/ThemePage.tsx +2 -7
  279. package/src/pages/WalletsPage.tsx +4 -15
  280. package/src/services/httpService.ts +1 -1
  281. package/src/store/AppStore.tsx +41 -0
  282. package/src/store/app.ts +44 -6
  283. package/src/store/quote.ts +29 -26
  284. package/src/store/slices/config.ts +25 -15
  285. package/src/store/slices/data.ts +64 -29
  286. package/src/store/slices/settings.ts +168 -0
  287. package/src/store/wallets.ts +68 -37
  288. package/src/types/config.ts +50 -5
  289. package/src/types/swap.ts +4 -13
  290. package/src/types/wallets.ts +18 -1
  291. package/src/utils/colors.ts +2 -1
  292. package/src/utils/configs.ts +2 -1
  293. package/src/utils/date.ts +1 -1
  294. package/src/utils/meta.ts +8 -1
  295. package/src/utils/providers.ts +8 -5
  296. package/src/utils/queue.ts +2 -2
  297. package/src/utils/quote.ts +7 -7
  298. package/src/utils/settings.ts +17 -10
  299. package/src/utils/swap.ts +59 -55
  300. package/src/utils/time.ts +1 -1
  301. package/src/utils/wallets.ts +107 -149
  302. package/dist/Wallets.d.ts +0 -17
  303. package/dist/Wallets.d.ts.map +0 -1
  304. package/dist/Widget.d.ts +0 -9
  305. package/dist/Widget.d.ts.map +0 -1
  306. package/dist/store/meta.d.ts +0 -23
  307. package/dist/store/meta.d.ts.map +0 -1
  308. package/dist/store/settings.d.ts +0 -81
  309. package/dist/store/settings.d.ts.map +0 -1
  310. package/src/Widget.tsx +0 -119
  311. package/src/store/meta.ts +0 -39
  312. package/src/store/settings.ts +0 -158
@@ -1,5 +1,5 @@
1
- import { useMetaStore } from '../store/meta';
2
- import { useSettingsStore } from '../store/settings';
1
+ import type { Features } from '../types';
2
+ import type { SwapperMeta } from 'rango-sdk';
3
3
 
4
4
  import { removeDuplicateFrom } from './common';
5
5
 
@@ -14,11 +14,10 @@ export type UniqueSwappersGroupType = {
14
14
  };
15
15
 
16
16
  export function getUniqueSwappersGroups(
17
- supportedSwappers?: string[]
17
+ swappers: SwapperMeta[],
18
+ disabledLiquiditySources: string[]
18
19
  ): UniqueSwappersGroupType[] {
19
- const swappers = useMetaStore.use.meta().swappers;
20
- const disabledLiquiditySources =
21
- useSettingsStore.use.disabledLiquiditySources();
20
+ const supportedSwappers = swappers.map((swapper) => swapper.swapperGroup);
22
21
 
23
22
  const uniqueSupportedSwappersGroups: Array<UniqueSwappersGroupType> = [];
24
23
 
@@ -57,16 +56,24 @@ export function getUniqueSwappersGroups(
57
56
  }
58
57
 
59
58
  export function sortLiquiditySourcesByGroupTitle(
60
- a: UniqueSwappersGroupType,
61
- b: UniqueSwappersGroupType
59
+ a: SwapperMeta,
60
+ b: SwapperMeta
62
61
  ) {
63
- if (a.groupTitle < b.groupTitle) {
62
+ if (a.swapperGroup < b.swapperGroup) {
64
63
  return -1;
65
64
  }
66
65
 
67
- if (a.groupTitle > b.groupTitle) {
66
+ if (a.swapperGroup > b.swapperGroup) {
68
67
  return 1;
69
68
  }
70
69
 
71
70
  return 0;
72
71
  }
72
+
73
+ export function isFeatureHidden(feature: keyof Features, features?: Features) {
74
+ return features?.[feature] === 'hidden';
75
+ }
76
+
77
+ export function isFeatureEnabled(feature: keyof Features, features?: Features) {
78
+ return features?.[feature] === 'enabled';
79
+ }
package/src/utils/swap.ts CHANGED
@@ -1,16 +1,13 @@
1
1
  /* eslint-disable @typescript-eslint/no-magic-numbers */
2
- import type { LoadingStatus } from '../store/meta';
3
- import type { ConnectedWallet } from '../store/wallets';
2
+ import type { FetchStatus } from '../store/slices/data';
4
3
  import type {
5
4
  ConvertedToken,
5
+ QuoteError,
6
+ QuoteWarning,
6
7
  RecommendedSlippages,
7
8
  SwapButtonState,
8
9
  Wallet,
9
10
  } from '../types';
10
- import type {
11
- PendingSwap,
12
- PendingSwapStep,
13
- } from '@rango-dev/queue-manager-rango-preset';
14
11
  import type { WalletType } from '@rango-dev/wallets-shared';
15
12
  import type {
16
13
  BestRouteRequest,
@@ -20,10 +17,11 @@ import type {
20
17
  SwapResult,
21
18
  Token,
22
19
  } from 'rango-sdk';
20
+ import type { PendingSwap, PendingSwapStep } from 'rango-types';
23
21
 
24
22
  import { i18n } from '@lingui/core';
25
- import { PendingSwapNetworkStatus } from '@rango-dev/queue-manager-rango-preset';
26
23
  import BigNumber from 'bignumber.js';
24
+ import { PendingSwapNetworkStatus } from 'rango-types';
27
25
 
28
26
  import { isValidAddress } from '../components/ConfirmWalletsModal/ConfirmWallets.helpers';
29
27
  import { errorMessages } from '../constants/errors';
@@ -35,12 +33,11 @@ import {
35
33
  TOKEN_AMOUNT_MAX_DECIMALS,
36
34
  TOKEN_AMOUNT_MIN_DECIMALS,
37
35
  } from '../constants/routing';
38
- import { useMetaStore } from '../store/meta';
39
- import { ButtonState } from '../types';
40
36
 
41
37
  import { removeDuplicateFrom } from './common';
38
+ import { getBlockchainShortNameFor } from './meta';
42
39
  import { numberToString } from './numbers';
43
- import { getRequiredBalanceOfWallet } from './quote';
40
+ import { getPriceImpact, getRequiredBalanceOfWallet } from './quote';
44
41
  import { getRequiredChains } from './wallets';
45
42
 
46
43
  export function getOutputRatio(
@@ -180,63 +177,70 @@ export function getLimitErrorMessage(quote: BestRouteResponse): {
180
177
  return { swap, fromAmountRangeError, recommendation };
181
178
  }
182
179
 
183
- export function getSwapButtonState(
184
- loadingMetaStatus: LoadingStatus,
185
- connectedWallets: ConnectedWallet[],
186
- loading: boolean,
187
- quote: BestRouteResponse | null,
188
- hasLimitError: boolean,
189
- highValueLoss: boolean,
190
- priceImpactCanNotBeComputed: boolean,
191
- needsToWarnEthOnPath: boolean,
192
- inputAmount: string
193
- ): SwapButtonState {
194
- if (loadingMetaStatus !== 'success') {
180
+ export function getSwapButtonState(params: {
181
+ fetchMetaStatus: FetchStatus;
182
+ anyWalletConnected: boolean;
183
+ fetchingQuote: boolean;
184
+ inputAmount: string;
185
+ quote: BestRouteResponse | null;
186
+ warning: QuoteWarning | null;
187
+ error: QuoteError | null;
188
+ needsToWarnEthOnPath: boolean;
189
+ }): SwapButtonState {
190
+ const {
191
+ fetchMetaStatus,
192
+ anyWalletConnected,
193
+ fetchingQuote,
194
+ inputAmount,
195
+ quote,
196
+ warning,
197
+ error,
198
+ needsToWarnEthOnPath,
199
+ } = params;
200
+ if (fetchMetaStatus !== 'success') {
195
201
  return {
196
202
  title: swapButtonTitles().connectWallet,
197
- state: ButtonState.WAITFORCONNECTING,
203
+ action: 'connect-wallet',
198
204
  disabled: true,
199
205
  };
200
206
  }
201
- if (connectedWallets.length == 0) {
207
+ if (!anyWalletConnected) {
202
208
  return {
203
209
  title: swapButtonTitles().connectWallet,
204
- state: ButtonState.WAITFORCONNECTING,
210
+ action: 'connect-wallet',
205
211
  disabled: false,
206
212
  };
207
213
  }
208
214
  if (
209
- loading ||
215
+ fetchingQuote ||
210
216
  !quote ||
211
217
  !quote.result ||
212
- hasLimitError ||
218
+ error ||
213
219
  !inputAmount ||
214
220
  inputAmount === '0'
215
221
  ) {
216
222
  return {
217
223
  title: swapButtonTitles().swap,
224
+ action: 'confirm-swap',
218
225
  disabled: true,
219
- state: ButtonState.SWAP,
220
226
  };
221
- } else if (highValueLoss || priceImpactCanNotBeComputed) {
227
+ } else if (warning) {
222
228
  return {
223
229
  title: swapButtonTitles().swapAnyway,
230
+ action: 'confirm-warning',
224
231
  disabled: false,
225
- hasWarning: true,
226
- state: ButtonState.NEEDTOCONFIRM,
227
232
  };
228
233
  } else if (needsToWarnEthOnPath) {
229
234
  return {
230
235
  title: swapButtonTitles().ethWarning,
236
+ action: 'confirm-warning',
231
237
  disabled: false,
232
- hasWarning: true,
233
- state: ButtonState.WARNING,
234
238
  };
235
239
  }
236
240
  return {
237
241
  title: swapButtonTitles().swap,
242
+ action: 'confirm-swap',
238
243
  disabled: false,
239
- state: ButtonState.SWAP,
240
244
  };
241
245
  }
242
246
 
@@ -360,7 +364,7 @@ export function checkSlippageWarnings(
360
364
  quote.result?.swaps.forEach((swap, index) => {
361
365
  if (
362
366
  swap.recommendedSlippage?.slippage &&
363
- parseInt(swap.recommendedSlippage?.slippage) > userSlippage
367
+ parseFloat(swap.recommendedSlippage.slippage) > userSlippage
364
368
  ) {
365
369
  recommendedSlippages.set(index, swap.recommendedSlippage.slippage);
366
370
  }
@@ -441,6 +445,8 @@ export function createQuoteRequestBody(params: {
441
445
  inputAmount: string;
442
446
  wallets?: Wallet[];
443
447
  selectedWallets?: Wallet[];
448
+ liquiditySources?: string[];
449
+ excludeLiquiditySources?: boolean;
444
450
  disabledLiquiditySources: string[];
445
451
  slippage: number;
446
452
  affiliateRef: string | null;
@@ -456,6 +462,8 @@ export function createQuoteRequestBody(params: {
456
462
  wallets,
457
463
  selectedWallets,
458
464
  disabledLiquiditySources,
465
+ liquiditySources,
466
+ excludeLiquiditySources,
459
467
  slippage,
460
468
  affiliateRef,
461
469
  affiliatePercent,
@@ -531,13 +539,18 @@ export function createQuoteRequestBody(params: {
531
539
  selectedWallets: selectedWalletsMap ?? {},
532
540
  slippage: slippage.toString(),
533
541
  ...(destination && { destination: destination }),
534
- ...(disabledLiquiditySources.length > 0 && {
535
- swapperGroups: disabledLiquiditySources,
542
+ ...(excludeLiquiditySources && {
543
+ swapperGroups: disabledLiquiditySources.concat(liquiditySources ?? []),
536
544
  swappersGroupsExclude: true,
537
545
  }),
546
+ ...(!excludeLiquiditySources && {
547
+ swapperGroups: liquiditySources?.filter(
548
+ (liquiditySource) => !disabledLiquiditySources.includes(liquiditySource)
549
+ ),
550
+ swappersGroupsExclude: false,
551
+ }),
538
552
  ...(checkPrerequisites && { blockchains: filteredBlockchains }),
539
553
  };
540
-
541
554
  return requestBody;
542
555
  }
543
556
 
@@ -582,10 +595,7 @@ export function isOutputAmountChangedALot(
582
595
  if (!oldOutputAmount || !newOutputAmount) {
583
596
  return false;
584
597
  }
585
- const percentageChange = getPercentageChange(
586
- oldOutputAmount,
587
- newOutputAmount
588
- );
598
+ const percentageChange = getPriceImpact(oldOutputAmount, newOutputAmount);
589
599
  if (!percentageChange) {
590
600
  return true;
591
601
  }
@@ -593,9 +603,10 @@ export function isOutputAmountChangedALot(
593
603
  return percentageChange <= -1;
594
604
  }
595
605
 
596
- export function getBalanceWarnings(
606
+ export function generateBalanceWarnings(
597
607
  quote: BestRouteResponse,
598
- selectedWallets: Wallet[]
608
+ selectedWallets: Wallet[],
609
+ blockchains: BlockchainMeta[]
599
610
  ) {
600
611
  const fee = quote.validationStatus;
601
612
  const requiredWallets = getRequiredChains(quote);
@@ -640,7 +651,10 @@ export function getBalanceWarnings(
640
651
  symbol,
641
652
  reason,
642
653
  currentAmount,
643
- blockchain: asset.asset.blockchain,
654
+ blockchain: getBlockchainShortNameFor(
655
+ asset.asset.blockchain,
656
+ blockchains
657
+ ),
644
658
  },
645
659
  });
646
660
  return warningMessage;
@@ -744,16 +758,6 @@ export function shouldRetrySwap(pendingSwap: PendingSwap) {
744
758
  new Date().getTime() - parseInt(pendingSwap.finishTime) < 4 * 3600 * 1000
745
759
  );
746
760
  }
747
- export function isValidCustomDestination(
748
- blockchain: string,
749
- address: string
750
- ): boolean {
751
- const blockchains = useMetaStore.getState().meta.blockchains;
752
- const regex =
753
- blockchains.find((chain) => chain.name === blockchain)?.addressPatterns ||
754
- [];
755
- return regex.filter((r) => new RegExp(r).test(address)).length > 0;
756
- }
757
761
 
758
762
  export function confirmSwapDisabled(
759
763
  fetching: boolean,
package/src/utils/time.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { PendingSwap } from '@rango-dev/queue-manager-rango-preset';
1
+ import type { PendingSwap } from 'rango-types';
2
2
 
3
3
  import { i18n } from '@lingui/core';
4
4
 
@@ -1,8 +1,8 @@
1
- import type { TokenWithBalance } from '../components/TokenList';
2
1
  import type { ConnectedWallet, TokenBalance } from '../store/wallets';
3
- import type { Wallet } from '../types';
2
+ import type { Balance, TokenHash, TokensBalance, Wallet } from '../types';
4
3
  import type { WalletInfo as ModalWalletInfo } from '@rango-dev/ui';
5
4
  import type {
5
+ Asset,
6
6
  Network,
7
7
  WalletInfo,
8
8
  WalletState,
@@ -29,6 +29,12 @@ import BigNumber from 'bignumber.js';
29
29
  import { isCosmosBlockchain } from 'rango-types';
30
30
 
31
31
  import { ZERO } from '../constants/numbers';
32
+ import {
33
+ BALANCE_MAX_DECIMALS,
34
+ BALANCE_MIN_DECIMALS,
35
+ USD_VALUE_MAX_DECIMALS,
36
+ USD_VALUE_MIN_DECIMALS,
37
+ } from '../constants/routing';
32
38
  import { EXCLUDED_WALLETS } from '../constants/wallets';
33
39
 
34
40
  import { numberToString } from './numbers';
@@ -55,8 +61,11 @@ export function mapWalletTypesToWalletInfo(
55
61
  return list
56
62
  .filter((wallet) => !EXCLUDED_WALLETS.includes(wallet as WalletTypes))
57
63
  .filter((wallet) => {
58
- const { supportedChains, hideWhenNotInstalled } = getWalletInfo(wallet);
59
- if (hideWhenNotInstalled && !getState(wallet).installed) {
64
+ const { supportedChains, isContractWallet } = getWalletInfo(wallet);
65
+ const { installed, network } = getState(wallet);
66
+ const filterContractWallets =
67
+ isContractWallet && (!installed || (!!chain && network !== chain));
68
+ if (filterContractWallets) {
60
69
  return false;
61
70
  }
62
71
  if (chain) {
@@ -97,7 +106,8 @@ export function prepareAccountsForWalletStore(
97
106
  wallet: WalletType,
98
107
  accounts: string[],
99
108
  evmBasedChains: string[],
100
- supportedChainNames: Network[] | null
109
+ supportedChainNames: Network[] | null,
110
+ isContractWallet: boolean
101
111
  ): Wallet[] {
102
112
  const result: Wallet[] = [];
103
113
 
@@ -151,21 +161,29 @@ export function prepareAccountsForWalletStore(
151
161
 
152
162
  // If it's an evm network, we will add the address to all the evm chains.
153
163
  if (isEvmBasedChain || isUnknownAndEvmBased) {
154
- /*
155
- * all evm chains are not supported in wallets, so we are adding
156
- * only to those that are supported by wallet.
157
- */
158
- const evmChainsSupportedByWallet = supportedBlockchains.filter((chain) =>
159
- evmBasedChains.includes(chain)
160
- );
161
-
162
- evmChainsSupportedByWallet.forEach((network) => {
164
+ if (isContractWallet) {
163
165
  /*
164
- * EVM addresses are not case sensitive.
165
- * Some wallets like Binance-chain return some letters in uppercase which produces bugs in our wallet state.
166
+ * for contract wallets like Safe wallet, we should add only account for the
167
+ * current connected blockchain not all of the supported blockchains
166
168
  */
167
169
  addAccount(network, address.toLowerCase());
168
- });
170
+ } else {
171
+ /*
172
+ * all evm chains are not supported in wallets, so we are adding
173
+ * only to those that are supported by wallet.
174
+ */
175
+ const evmChainsSupportedByWallet = supportedBlockchains.filter(
176
+ (chain) => evmBasedChains.includes(chain)
177
+ );
178
+
179
+ evmChainsSupportedByWallet.forEach((network) => {
180
+ /*
181
+ * EVM addresses are not case sensitive.
182
+ * Some wallets like Binance-chain return some letters in uppercase which produces bugs in our wallet state.
183
+ */
184
+ addAccount(network, address.toLowerCase());
185
+ });
186
+ }
169
187
  } else {
170
188
  addAccount(network, address);
171
189
  }
@@ -206,43 +224,6 @@ export function getRequiredChains(quote: BestRouteResponse | null) {
206
224
 
207
225
  type Blockchain = { name: string; accounts: ConnectedWallet[] };
208
226
 
209
- export function getBalanceFromWallet(
210
- connectedWallets: ConnectedWallet[],
211
- chain: string,
212
- symbol: string,
213
- address: string | null
214
- ): TokenBalance | null {
215
- if (connectedWallets.length === 0) {
216
- return null;
217
- }
218
-
219
- const selectedChainWallets = connectedWallets.filter(
220
- (wallet) => wallet.chain === chain
221
- );
222
- if (selectedChainWallets.length === 0) {
223
- return null;
224
- }
225
-
226
- return (
227
- selectedChainWallets
228
- .map(
229
- (wallet) =>
230
- wallet.balances?.find(
231
- (balance) =>
232
- (address !== null && balance.address === address) ||
233
- (address === null &&
234
- balance.address === address &&
235
- balance.symbol === symbol)
236
- ) || null
237
- )
238
- .filter((balance) => balance !== null)
239
- .sort(
240
- (a, b) => parseFloat(b?.amount || '0') - parseFloat(a?.amount || '1')
241
- )
242
- .find(() => true) || null
243
- );
244
- }
245
-
246
227
  export function isAccountAndWalletMatched(
247
228
  account: Wallet,
248
229
  connectedWallet: ConnectedWallet
@@ -336,30 +317,6 @@ function numberWithThousandSeparator(number: string | number): string {
336
317
  return parts.join('.');
337
318
  }
338
319
 
339
- export const sortTokens = (tokens: TokenWithBalance[]): TokenWithBalance[] => {
340
- const walletConnected = !!tokens.some((token) => token.balance);
341
- if (!walletConnected) {
342
- return tokens
343
- .filter((token) => !token.address)
344
- .concat(
345
- tokens.filter((token) => token.address && !token.isSecondaryCoin),
346
- tokens.filter((token) => token.isSecondaryCoin)
347
- );
348
- }
349
-
350
- return tokens
351
- .filter((token) => !!token.balance)
352
- .sort(
353
- (tokenA, tokenB) =>
354
- parseFloat(tokenB.balance?.usdValue || '0') -
355
- parseFloat(tokenA.balance?.usdValue || '0')
356
- )
357
- .concat(
358
- tokens.filter((token) => !token.balance && !token.isSecondaryCoin),
359
- tokens.filter((token) => !token.balance && token.isSecondaryCoin)
360
- );
361
- };
362
-
363
320
  export const getUsdPrice = (
364
321
  blockchain: string,
365
322
  symbol: string,
@@ -403,98 +360,58 @@ export const getKeplrCompatibleConnectedWallets = (
403
360
  );
404
361
  };
405
362
 
406
- export function getTokensWithBalance(
407
- tokens: TokenWithBalance[],
408
- connectedWallets: ConnectedWallet[]
409
- ): TokenWithBalance[] {
410
- return tokens.map(({ balance, ...otherProps }) => {
411
- const tokenAmount = numberToString(
412
- new BigNumber(
413
- getBalanceFromWallet(
414
- connectedWallets,
415
- otherProps.blockchain,
416
- otherProps.symbol,
417
- otherProps.address
418
- )?.amount || ZERO
419
- )
420
- );
421
-
422
- let tokenUsdValue = '';
423
- if (otherProps.usdPrice) {
424
- tokenUsdValue = numberToString(
425
- new BigNumber(
426
- getBalanceFromWallet(
427
- connectedWallets,
428
- otherProps.blockchain,
429
- otherProps.symbol,
430
- otherProps.address
431
- )?.amount || ZERO
432
- ).multipliedBy(otherProps.usdPrice)
433
- );
434
- }
363
+ export function formatBalance(balance: Balance | null): Balance | null {
364
+ const formattedBalance: Balance | null = balance
365
+ ? {
366
+ ...balance,
367
+ amount: numberToString(
368
+ balance.amount,
369
+ BALANCE_MIN_DECIMALS,
370
+ BALANCE_MAX_DECIMALS
371
+ ),
372
+ usdValue: numberToString(
373
+ balance.usdValue,
374
+ USD_VALUE_MIN_DECIMALS,
375
+ USD_VALUE_MAX_DECIMALS
376
+ ),
377
+ }
378
+ : null;
435
379
 
436
- return {
437
- ...otherProps,
438
- ...(tokenAmount !== '0' && {
439
- balance: { amount: tokenAmount, usdValue: tokenUsdValue },
440
- }),
441
- };
442
- });
380
+ return formattedBalance;
443
381
  }
444
382
 
445
- export function getTokensBalanceFromWalletAndSort(
446
- tokens: TokenWithBalance[],
447
- connectedWallets: ConnectedWallet[]
383
+ export function sortTokensByBalance(
384
+ tokens: Token[],
385
+ getBalanceFor: (token: Token) => Balance | null
448
386
  ) {
449
- const list =
450
- connectedWallets.length > 0
451
- ? getTokensWithBalance(tokens, connectedWallets)
452
- : tokens;
453
- list.sort((tokenA, tokenB) => {
454
- if (tokenA.balance?.usdValue && tokenB.balance?.usdValue) {
387
+ tokens.sort((token1, token2) => {
388
+ const token1Balance = getBalanceFor(token1);
389
+ const token2Balance = getBalanceFor(token2);
390
+ if (token1Balance?.usdValue && token2Balance?.usdValue) {
455
391
  return (
456
- parseFloat(tokenB.balance.usdValue) -
457
- parseFloat(tokenA.balance.usdValue)
392
+ parseFloat(token2Balance.usdValue) - parseFloat(token1Balance.usdValue)
458
393
  );
459
394
  }
460
395
 
461
- if (!tokenA.balance?.usdValue && tokenB.balance?.usdValue) {
396
+ if (!token1Balance?.usdValue && token2Balance?.usdValue) {
462
397
  return 1;
463
398
  }
464
399
 
465
- if (tokenA.balance?.usdValue && !tokenB.balance?.usdValue) {
400
+ if (token1Balance?.usdValue && !token2Balance?.usdValue) {
466
401
  return -1;
467
402
  }
468
403
 
469
- if (!tokenA.balance?.usdValue && !tokenB.balance?.usdValue) {
404
+ if (!token1Balance?.usdValue && !token2Balance?.usdValue) {
470
405
  return (
471
- parseFloat(tokenB.balance?.amount || '0') -
472
- parseFloat(tokenA.balance?.amount || '0')
406
+ parseFloat(token2Balance?.amount || '0') -
407
+ parseFloat(token1Balance?.amount || '0')
473
408
  );
474
409
  }
475
410
 
476
411
  return 0;
477
412
  });
478
413
 
479
- return list;
480
- }
481
-
482
- export function getSortedTokens(
483
- chain: BlockchainMeta | null,
484
- tokens: Token[],
485
- connectedWallets: ConnectedWallet[],
486
- otherChainTokens: TokenWithBalance[]
487
- ): TokenWithBalance[] {
488
- const fromChainEqualsToToBlockchain =
489
- chain?.name === otherChainTokens[0]?.name;
490
- if (fromChainEqualsToToBlockchain) {
491
- return otherChainTokens;
492
- }
493
-
494
- const filteredTokens = tokens.filter(
495
- (token) => token.blockchain === chain?.name
496
- );
497
- return sortTokens(getTokensWithBalance(filteredTokens, connectedWallets));
414
+ return tokens;
498
415
  }
499
416
 
500
417
  export function tokensAreEqual(
@@ -556,3 +473,44 @@ export function getAddress({
556
473
  connectedWallet.chain === chain
557
474
  )?.address;
558
475
  }
476
+
477
+ export function createTokenHash(token: Asset): TokenHash {
478
+ return `${token.blockchain}-${token.symbol}-${token.address ?? ''}`;
479
+ }
480
+
481
+ export function makeTokensBalance(connectedWallets: ConnectedWallet[]) {
482
+ return connectedWallets
483
+ .flatMap((wallet) => wallet.balances)
484
+ .reduce((balances: TokensBalance, balance) => {
485
+ const currentBalance = {
486
+ amount: balance?.amount ?? '',
487
+ decimals: balance?.decimal ?? 0,
488
+ usdValue: balance?.usdPrice
489
+ ? new BigNumber(balance?.usdPrice ?? ZERO)
490
+ .multipliedBy(balance?.amount)
491
+ .toString()
492
+ : '',
493
+ };
494
+
495
+ const tokenHash = balance
496
+ ? createTokenHash({
497
+ symbol: balance.symbol,
498
+ blockchain: balance.chain,
499
+ address: balance.address,
500
+ })
501
+ : null;
502
+
503
+ const prevBalance = tokenHash ? balances[tokenHash] : null;
504
+
505
+ const shouldUpdateBalance =
506
+ tokenHash &&
507
+ (!prevBalance ||
508
+ (prevBalance && prevBalance.amount < currentBalance.amount));
509
+
510
+ if (shouldUpdateBalance) {
511
+ balances[tokenHash] = currentBalance;
512
+ }
513
+
514
+ return balances;
515
+ }, {});
516
+ }
package/dist/Wallets.d.ts DELETED
@@ -1,17 +0,0 @@
1
- import type { WidgetConfig } from './types';
2
- import type { ProvidersOptions } from './utils/providers';
3
- import type { EventHandler } from '@rango-dev/wallets-react';
4
- import type { PropsWithChildren } from 'react';
5
- import React from 'react';
6
- type OnConnectHandler = (key: string) => void;
7
- interface WidgetContextInterface {
8
- onConnectWallet(handler: OnConnectHandler): void;
9
- }
10
- export declare const WidgetContext: React.Context<WidgetContextInterface>;
11
- export declare function WidgetWallets(props: PropsWithChildren<{
12
- providers: WidgetConfig['wallets'];
13
- options?: ProvidersOptions;
14
- onUpdateState?: EventHandler;
15
- }>): React.JSX.Element;
16
- export {};
17
- //# sourceMappingURL=Wallets.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Wallets.d.ts","sourceRoot":"","sources":["../src/Wallets.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI/C,OAAO,KAAgC,MAAM,OAAO,CAAC;AAUrD,KAAK,gBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;AAC9C,UAAU,sBAAsB;IAC9B,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAClD;AAED,eAAO,MAAM,aAAa,uCAIxB,CAAC;AAEH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,iBAAiB,CAAC;IACvB,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,aAAa,CAAC,EAAE,YAAY,CAAC;CAC9B,CAAC,qBA+EH"}
package/dist/Widget.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import type { WidgetConfig } from './types';
2
- import type { PropsWithChildren } from 'react';
3
- import React from 'react';
4
- export type WidgetProps = {
5
- config?: WidgetConfig;
6
- };
7
- export declare function Main(props: PropsWithChildren<WidgetProps>): React.JSX.Element;
8
- export declare function Widget(props: PropsWithChildren<WidgetProps>): React.JSX.Element;
9
- //# sourceMappingURL=Widget.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Widget.d.ts","sourceRoot":"","sources":["../src/Widget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG/C,OAAO,KAAmD,MAAM,OAAO,CAAC;AAiCxE,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,wBAAgB,IAAI,CAAC,KAAK,EAAE,iBAAiB,CAAC,WAAW,CAAC,qBAoDzD;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,iBAAiB,CAAC,WAAW,CAAC,qBAsB3D"}