@rango-dev/ui 0.1.10-next.102

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 (367) hide show
  1. package/README.md +181 -0
  2. package/dist/components/Alert/Alert.d.ts +7 -0
  3. package/dist/components/Alert/Alert.stories.d.ts +5 -0
  4. package/dist/components/Alert/LoadingFailedAlert.d.ts +2 -0
  5. package/dist/components/Alert/NotFoundAlert.d.ts +7 -0
  6. package/dist/components/Alert/index.d.ts +2 -0
  7. package/dist/components/BestRoute/BestRoute.d.ts +12 -0
  8. package/dist/components/BestRoute/BestRoute.stories.d.ts +8 -0
  9. package/dist/components/BestRoute/index.d.ts +1 -0
  10. package/dist/components/BestRoute/mock.d.ts +4 -0
  11. package/dist/components/BlockchainSelector/BlockchainSelector.d.ts +17 -0
  12. package/dist/components/BlockchainSelector/BlockchainSelector.stories.d.ts +5 -0
  13. package/dist/components/BlockchainSelector/index.d.ts +1 -0
  14. package/dist/components/BlockchainsList/BlockchainsList.d.ts +10 -0
  15. package/dist/components/BlockchainsList/BlockchainsList.stories.d.ts +5 -0
  16. package/dist/components/BlockchainsList/index.d.ts +1 -0
  17. package/dist/components/BlockchainsList/mockData.d.ts +2 -0
  18. package/dist/components/Button/Button.d.ts +17 -0
  19. package/dist/components/Button/Button.stories.d.ts +8 -0
  20. package/dist/components/Button/index.d.ts +1 -0
  21. package/dist/components/Checkbox/Checkbox.d.ts +11 -0
  22. package/dist/components/Checkbox/Checkbox.stories.d.ts +5 -0
  23. package/dist/components/Checkbox/index.d.ts +1 -0
  24. package/dist/components/Chip/Chip.d.ts +12 -0
  25. package/dist/components/Chip/Chip.stories.d.ts +7 -0
  26. package/dist/components/Chip/index.d.ts +1 -0
  27. package/dist/components/ColorPicker/ColorPicker.d.ts +9 -0
  28. package/dist/components/ColorPicker/ColorPicker.stories.d.ts +5 -0
  29. package/dist/components/ColorPicker/index.d.ts +1 -0
  30. package/dist/components/ConnectWalletsModal/ConnectWallets.stories.d.ts +5 -0
  31. package/dist/components/ConnectWalletsModal/ConnectWalletsModal.d.ts +11 -0
  32. package/dist/components/ConnectWalletsModal/index.d.ts +1 -0
  33. package/dist/components/ConnectWalletsModal/mockData.d.ts +2 -0
  34. package/dist/components/Divider/Divider.d.ts +6 -0
  35. package/dist/components/Divider/index.d.ts +1 -0
  36. package/dist/components/Drawer/Drawer.d.ts +13 -0
  37. package/dist/components/Drawer/Drawer.stories.d.ts +8 -0
  38. package/dist/components/Drawer/index.d.ts +1 -0
  39. package/dist/components/Header/Header.d.ts +9 -0
  40. package/dist/components/Header/index.d.ts +1 -0
  41. package/dist/components/Icon/AddCircleIcon.d.ts +3 -0
  42. package/dist/components/Icon/AddIcon.d.ts +3 -0
  43. package/dist/components/Icon/AddWalletIcon.d.ts +3 -0
  44. package/dist/components/Icon/AngleDownIcon.d.ts +3 -0
  45. package/dist/components/Icon/AngleLeftIcon.d.ts +3 -0
  46. package/dist/components/Icon/AngleRightIcon.d.ts +3 -0
  47. package/dist/components/Icon/AngleUpIcon.d.ts +3 -0
  48. package/dist/components/Icon/ArrowRightIcon.d.ts +3 -0
  49. package/dist/components/Icon/BagIcon.d.ts +3 -0
  50. package/dist/components/Icon/BanIcon.d.ts +3 -0
  51. package/dist/components/Icon/CheckCircleIcon.d.ts +3 -0
  52. package/dist/components/Icon/CheckIcon.d.ts +3 -0
  53. package/dist/components/Icon/CheckSquareIcon.d.ts +3 -0
  54. package/dist/components/Icon/CheckWalletIcon.d.ts +3 -0
  55. package/dist/components/Icon/ChevronRightIcon.d.ts +3 -0
  56. package/dist/components/Icon/CloseIcon.d.ts +1 -0
  57. package/dist/components/Icon/CopyIcon.d.ts +3 -0
  58. package/dist/components/Icon/DeleteCircleIcon.d.ts +3 -0
  59. package/dist/components/Icon/DeleteWalletIcon.d.ts +3 -0
  60. package/dist/components/Icon/DisconnectIcon.d.ts +3 -0
  61. package/dist/components/Icon/DownloadIcon.d.ts +3 -0
  62. package/dist/components/Icon/GasIcon.d.ts +3 -0
  63. package/dist/components/Icon/HistoryIcon.d.ts +3 -0
  64. package/dist/components/Icon/HorizontalSwapIcon.d.ts +3 -0
  65. package/dist/components/Icon/Icons.stories.d.ts +5 -0
  66. package/dist/components/Icon/InfoCircleIcon.d.ts +3 -0
  67. package/dist/components/Icon/MinusCircleIcon.d.ts +3 -0
  68. package/dist/components/Icon/RetryIcon.d.ts +3 -0
  69. package/dist/components/Icon/RetryLeftIcon.d.ts +3 -0
  70. package/dist/components/Icon/RetryRightIcon.d.ts +3 -0
  71. package/dist/components/Icon/SearchIcon.d.ts +3 -0
  72. package/dist/components/Icon/SearchMinusIcon.d.ts +3 -0
  73. package/dist/components/Icon/SettingIcon.d.ts +3 -0
  74. package/dist/components/Icon/SignatureIcon.d.ts +3 -0
  75. package/dist/components/Icon/SwapWalletIcon.d.ts +3 -0
  76. package/dist/components/Icon/TimeIcon.d.ts +3 -0
  77. package/dist/components/Icon/TrashIcon.d.ts +3 -0
  78. package/dist/components/Icon/TryAgainIcon.d.ts +3 -0
  79. package/dist/components/Icon/VerticalSwapIcon.d.ts +3 -0
  80. package/dist/components/Icon/WalletIconIcon.d.ts +3 -0
  81. package/dist/components/Icon/WarningIcon.d.ts +3 -0
  82. package/dist/components/Icon/common.d.ts +2 -0
  83. package/dist/components/Icon/index.d.ts +40 -0
  84. package/dist/components/Icon/types.d.ts +6 -0
  85. package/dist/components/LiquiditySourceList/LiquiditySource.stories.d.ts +5 -0
  86. package/dist/components/LiquiditySourceList/LiquiditySourceList.d.ts +11 -0
  87. package/dist/components/LiquiditySourceList/index.d.ts +1 -0
  88. package/dist/components/LiquiditySourceList/mockData.d.ts +2 -0
  89. package/dist/components/LiquiditySourcesSelector/LiquiditySourcesSelector.d.ts +13 -0
  90. package/dist/components/LiquiditySourcesSelector/LiquiditySourcesSelector.stories.d.ts +5 -0
  91. package/dist/components/LiquiditySourcesSelector/index.d.ts +1 -0
  92. package/dist/components/Modal/Modal.d.ts +12 -0
  93. package/dist/components/Modal/Modal.stories.d.ts +5 -0
  94. package/dist/components/Modal/index.d.ts +1 -0
  95. package/dist/components/Radio/Radio.d.ts +13 -0
  96. package/dist/components/Radio/Radio.stories.d.ts +5 -0
  97. package/dist/components/Radio/index.d.ts +1 -0
  98. package/dist/components/SecondaryPage/SecondaryPage.d.ts +16 -0
  99. package/dist/components/SecondaryPage/SecondaryPage.stories.d.ts +2 -0
  100. package/dist/components/SecondaryPage/index.d.ts +1 -0
  101. package/dist/components/SelectableWalletList/SelectableWalletList.d.ts +7 -0
  102. package/dist/components/SelectableWalletList/SelectableWalletList.stories.d.ts +5 -0
  103. package/dist/components/SelectableWalletList/index.d.ts +1 -0
  104. package/dist/components/SelectableWalletList/mock.d.ts +2 -0
  105. package/dist/components/Settings/Settings.d.ts +23 -0
  106. package/dist/components/Settings/Settings.stories.d.ts +5 -0
  107. package/dist/components/Settings/index.d.ts +1 -0
  108. package/dist/components/Skeleton/Skeleton.d.ts +6 -0
  109. package/dist/components/Skeleton/Skeleton.stories.d.ts +5 -0
  110. package/dist/components/Skeleton/index.d.ts +1 -0
  111. package/dist/components/Spacer/Spacer.d.ts +6 -0
  112. package/dist/components/Spacer/Spacer.stories.d.ts +5 -0
  113. package/dist/components/Spacer/index.d.ts +1 -0
  114. package/dist/components/Spinner/Spinner.d.ts +6 -0
  115. package/dist/components/Spinner/Spinner.stories.d.ts +5 -0
  116. package/dist/components/Spinner/index.d.ts +1 -0
  117. package/dist/components/StatusDrawer/StatusDrawer.d.ts +11 -0
  118. package/dist/components/StatusDrawer/StatusDrawer.stories.d.ts +5 -0
  119. package/dist/components/StatusDrawer/index.d.ts +1 -0
  120. package/dist/components/StepDetail/StepDetail.d.ts +10 -0
  121. package/dist/components/StepDetail/StepDetail.stories.d.ts +5 -0
  122. package/dist/components/StepDetail/index.d.ts +1 -0
  123. package/dist/components/SwapContainer/SwapContainer.d.ts +7 -0
  124. package/dist/components/SwapContainer/SwapContainer.stories.d.ts +5 -0
  125. package/dist/components/SwapContainer/index.d.ts +1 -0
  126. package/dist/components/SwapDetail/SwapDetail.d.ts +8 -0
  127. package/dist/components/SwapDetail/SwapDetail.stories.d.ts +5 -0
  128. package/dist/components/SwapDetail/Token.d.ts +16 -0
  129. package/dist/components/SwapDetail/index.d.ts +1 -0
  130. package/dist/components/SwapDetail/mock.d.ts +2 -0
  131. package/dist/components/Switch/Switch.d.ts +6 -0
  132. package/dist/components/Switch/Switch.stories.d.ts +5 -0
  133. package/dist/components/Switch/index.d.ts +1 -0
  134. package/dist/components/TextField/TextField.d.ts +10 -0
  135. package/dist/components/TextField/TextField.stories.d.ts +7 -0
  136. package/dist/components/TextField/index.d.ts +1 -0
  137. package/dist/components/TokenList/TokenItem.d.ts +11 -0
  138. package/dist/components/TokenList/TokenList.d.ts +17 -0
  139. package/dist/components/TokenList/TokenList.stories.d.ts +5 -0
  140. package/dist/components/TokenList/index.d.ts +1 -0
  141. package/dist/components/TokenList/mockData.d.ts +2 -0
  142. package/dist/components/TokenSelector/TokenSelector.d.ts +16 -0
  143. package/dist/components/TokenSelector/TokenSelector.stories.d.ts +5 -0
  144. package/dist/components/TokenSelector/index.d.ts +1 -0
  145. package/dist/components/Tooltip/Tooltip.d.ts +7 -0
  146. package/dist/components/Tooltip/Tooltip.stories.d.ts +5 -0
  147. package/dist/components/Tooltip/index.d.ts +1 -0
  148. package/dist/components/Typography/Typography.d.ts +18 -0
  149. package/dist/components/Typography/Typography.stories.d.ts +5 -0
  150. package/dist/components/Typography/index.d.ts +1 -0
  151. package/dist/components/VirtualizedList/VirtualizedList.d.ts +17 -0
  152. package/dist/components/Wallet/State.d.ts +7 -0
  153. package/dist/components/Wallet/Wallet.d.ts +7 -0
  154. package/dist/components/Wallet/Wallet.stories.d.ts +5 -0
  155. package/dist/components/Wallet/index.d.ts +1 -0
  156. package/dist/components/common/FilledCircle.d.ts +1 -0
  157. package/dist/components/common/index.d.ts +1 -0
  158. package/dist/components/index.d.ts +31 -0
  159. package/dist/containers/ConfirmSwap/ConfirmSwap.d.ts +20 -0
  160. package/dist/containers/ConfirmSwap/ConfirmSwap.stories.d.ts +6 -0
  161. package/dist/containers/ConfirmSwap/index.d.ts +1 -0
  162. package/dist/containers/ConfirmSwap/mock.d.ts +5 -0
  163. package/dist/containers/History/History.d.ts +13 -0
  164. package/dist/containers/History/History.stories.d.ts +5 -0
  165. package/dist/containers/History/index.d.ts +1 -0
  166. package/dist/containers/History/mock.d.ts +2 -0
  167. package/dist/containers/History/types.d.ts +39 -0
  168. package/dist/containers/SwapHistory/SwapHistory.d.ts +24 -0
  169. package/dist/containers/SwapHistory/SwapHistory.stories.d.ts +5 -0
  170. package/dist/containers/SwapHistory/SwapMessages.d.ts +17 -0
  171. package/dist/containers/SwapHistory/index.d.ts +1 -0
  172. package/dist/containers/SwapHistory/mock.d.ts +2 -0
  173. package/dist/containers/index.d.ts +3 -0
  174. package/dist/helper/index.d.ts +2 -0
  175. package/dist/index.d.ts +4 -0
  176. package/dist/index.js +8 -0
  177. package/dist/theme.d.ts +8 -0
  178. package/dist/types/index.d.ts +2 -0
  179. package/dist/types/meta.d.ts +23 -0
  180. package/dist/types/swaps.d.ts +29 -0
  181. package/dist/types/wallet.d.ts +23 -0
  182. package/dist/ui.cjs.development.js +4956 -0
  183. package/dist/ui.cjs.development.js.map +1 -0
  184. package/dist/ui.cjs.production.min.js +2 -0
  185. package/dist/ui.cjs.production.min.js.map +1 -0
  186. package/dist/ui.esm.js +4870 -0
  187. package/dist/ui.esm.js.map +1 -0
  188. package/package.json +88 -0
  189. package/src/components/Alert/Alert.stories.tsx +22 -0
  190. package/src/components/Alert/Alert.tsx +102 -0
  191. package/src/components/Alert/LoadingFailedAlert.tsx +11 -0
  192. package/src/components/Alert/NotFoundAlert.tsx +19 -0
  193. package/src/components/Alert/index.ts +2 -0
  194. package/src/components/BestRoute/BestRoute.stories.tsx +31 -0
  195. package/src/components/BestRoute/BestRoute.tsx +232 -0
  196. package/src/components/BestRoute/index.ts +1 -0
  197. package/src/components/BestRoute/mock.ts +554 -0
  198. package/src/components/BlockchainSelector/BlockchainSelector.stories.tsx +25 -0
  199. package/src/components/BlockchainSelector/BlockchainSelector.tsx +93 -0
  200. package/src/components/BlockchainSelector/index.ts +1 -0
  201. package/src/components/BlockchainsList/BlockchainsList.stories.tsx +25 -0
  202. package/src/components/BlockchainsList/BlockchainsList.tsx +70 -0
  203. package/src/components/BlockchainsList/index.ts +1 -0
  204. package/src/components/BlockchainsList/mockData.ts +2972 -0
  205. package/src/components/Button/Button.stories.tsx +59 -0
  206. package/src/components/Button/Button.tsx +421 -0
  207. package/src/components/Button/index.ts +1 -0
  208. package/src/components/Checkbox/Checkbox.stories.tsx +22 -0
  209. package/src/components/Checkbox/Checkbox.tsx +56 -0
  210. package/src/components/Checkbox/index.ts +1 -0
  211. package/src/components/Chip/Chip.stories.tsx +37 -0
  212. package/src/components/Chip/Chip.tsx +48 -0
  213. package/src/components/Chip/index.ts +1 -0
  214. package/src/components/ColorPicker/ColorPicker.stories.tsx +36 -0
  215. package/src/components/ColorPicker/ColorPicker.tsx +85 -0
  216. package/src/components/ColorPicker/index.ts +1 -0
  217. package/src/components/ConnectWalletsModal/ConnectWallets.stories.tsx +13 -0
  218. package/src/components/ConnectWalletsModal/ConnectWalletsModal.tsx +42 -0
  219. package/src/components/ConnectWalletsModal/index.ts +1 -0
  220. package/src/components/ConnectWalletsModal/mockData.ts +134 -0
  221. package/src/components/Divider/Divider.tsx +41 -0
  222. package/src/components/Divider/index.ts +1 -0
  223. package/src/components/Drawer/Drawer.stories.tsx +86 -0
  224. package/src/components/Drawer/Drawer.tsx +124 -0
  225. package/src/components/Drawer/index.ts +1 -0
  226. package/src/components/Header/Header.tsx +39 -0
  227. package/src/components/Header/index.ts +1 -0
  228. package/src/components/Icon/AddCircleIcon.tsx +31 -0
  229. package/src/components/Icon/AddIcon.tsx +31 -0
  230. package/src/components/Icon/AddWalletIcon.tsx +50 -0
  231. package/src/components/Icon/AngleDownIcon.tsx +30 -0
  232. package/src/components/Icon/AngleLeftIcon.tsx +33 -0
  233. package/src/components/Icon/AngleRightIcon.tsx +32 -0
  234. package/src/components/Icon/AngleUpIcon.tsx +32 -0
  235. package/src/components/Icon/ArrowRightIcon.tsx +31 -0
  236. package/src/components/Icon/BagIcon.tsx +39 -0
  237. package/src/components/Icon/BanIcon.tsx +32 -0
  238. package/src/components/Icon/CheckCircleIcon.tsx +39 -0
  239. package/src/components/Icon/CheckIcon.tsx +30 -0
  240. package/src/components/Icon/CheckSquareIcon.tsx +37 -0
  241. package/src/components/Icon/CheckWalletIcon.tsx +45 -0
  242. package/src/components/Icon/ChevronRightIcon.tsx +29 -0
  243. package/src/components/Icon/CloseIcon.tsx +9 -0
  244. package/src/components/Icon/CopyIcon.tsx +59 -0
  245. package/src/components/Icon/DeleteCircleIcon.tsx +31 -0
  246. package/src/components/Icon/DeleteWalletIcon.tsx +50 -0
  247. package/src/components/Icon/DisconnectIcon.tsx +31 -0
  248. package/src/components/Icon/DownloadIcon.tsx +37 -0
  249. package/src/components/Icon/GasIcon.tsx +37 -0
  250. package/src/components/Icon/HistoryIcon.tsx +34 -0
  251. package/src/components/Icon/HorizontalSwapIcon.tsx +38 -0
  252. package/src/components/Icon/Icons.stories.tsx +44 -0
  253. package/src/components/Icon/InfoCircleIcon.tsx +39 -0
  254. package/src/components/Icon/MinusCircleIcon.tsx +31 -0
  255. package/src/components/Icon/RetryIcon.tsx +30 -0
  256. package/src/components/Icon/RetryLeftIcon.tsx +31 -0
  257. package/src/components/Icon/RetryRightIcon.tsx +31 -0
  258. package/src/components/Icon/SearchIcon.tsx +31 -0
  259. package/src/components/Icon/SearchMinusIcon.tsx +31 -0
  260. package/src/components/Icon/SettingIcon.tsx +31 -0
  261. package/src/components/Icon/SignatureIcon.tsx +32 -0
  262. package/src/components/Icon/SwapWalletIcon.tsx +50 -0
  263. package/src/components/Icon/TimeIcon.tsx +29 -0
  264. package/src/components/Icon/TrashIcon.tsx +31 -0
  265. package/src/components/Icon/TryAgainIcon.tsx +31 -0
  266. package/src/components/Icon/VerticalSwapIcon.tsx +38 -0
  267. package/src/components/Icon/WalletIconIcon.tsx +40 -0
  268. package/src/components/Icon/WarningIcon.tsx +37 -0
  269. package/src/components/Icon/common.ts +69 -0
  270. package/src/components/Icon/index.ts +48 -0
  271. package/src/components/Icon/types.tsx +45 -0
  272. package/src/components/LiquiditySourceList/LiquiditySource.stories.tsx +13 -0
  273. package/src/components/LiquiditySourceList/LiquiditySourceList.tsx +195 -0
  274. package/src/components/LiquiditySourceList/index.ts +1 -0
  275. package/src/components/LiquiditySourceList/mockData.ts +316 -0
  276. package/src/components/LiquiditySourcesSelector/LiquiditySourcesSelector.stories.tsx +16 -0
  277. package/src/components/LiquiditySourcesSelector/LiquiditySourcesSelector.tsx +61 -0
  278. package/src/components/LiquiditySourcesSelector/index.ts +1 -0
  279. package/src/components/Modal/Modal.stories.tsx +22 -0
  280. package/src/components/Modal/Modal.tsx +93 -0
  281. package/src/components/Modal/index.ts +1 -0
  282. package/src/components/Radio/Radio.stories.tsx +23 -0
  283. package/src/components/Radio/Radio.tsx +100 -0
  284. package/src/components/Radio/index.ts +1 -0
  285. package/src/components/SecondaryPage/SecondaryPage.stories.tsx +7 -0
  286. package/src/components/SecondaryPage/SecondaryPage.tsx +68 -0
  287. package/src/components/SecondaryPage/index.ts +1 -0
  288. package/src/components/SelectableWalletList/SelectableWalletList.stories.tsx +14 -0
  289. package/src/components/SelectableWalletList/SelectableWalletList.tsx +118 -0
  290. package/src/components/SelectableWalletList/index.ts +1 -0
  291. package/src/components/SelectableWalletList/mock.ts +13 -0
  292. package/src/components/Settings/Settings.stories.tsx +34 -0
  293. package/src/components/Settings/Settings.tsx +208 -0
  294. package/src/components/Settings/index.ts +1 -0
  295. package/src/components/Skeleton/Skeleton.stories.tsx +24 -0
  296. package/src/components/Skeleton/Skeleton.tsx +66 -0
  297. package/src/components/Skeleton/index.ts +1 -0
  298. package/src/components/Spacer/Spacer.stories.tsx +31 -0
  299. package/src/components/Spacer/Spacer.tsx +128 -0
  300. package/src/components/Spacer/index.ts +1 -0
  301. package/src/components/Spinner/Spinner.stories.tsx +25 -0
  302. package/src/components/Spinner/Spinner.tsx +61 -0
  303. package/src/components/Spinner/index.ts +1 -0
  304. package/src/components/StatusDrawer/StatusDrawer.stories.tsx +38 -0
  305. package/src/components/StatusDrawer/StatusDrawer.tsx +82 -0
  306. package/src/components/StatusDrawer/index.ts +1 -0
  307. package/src/components/StepDetail/StepDetail.stories.tsx +37 -0
  308. package/src/components/StepDetail/StepDetail.tsx +109 -0
  309. package/src/components/StepDetail/index.ts +1 -0
  310. package/src/components/SwapContainer/SwapContainer.stories.tsx +13 -0
  311. package/src/components/SwapContainer/SwapContainer.tsx +43 -0
  312. package/src/components/SwapContainer/index.ts +1 -0
  313. package/src/components/SwapDetail/SwapDetail.stories.tsx +19 -0
  314. package/src/components/SwapDetail/SwapDetail.tsx +112 -0
  315. package/src/components/SwapDetail/Token.tsx +68 -0
  316. package/src/components/SwapDetail/index.ts +1 -0
  317. package/src/components/SwapDetail/mock.ts +276 -0
  318. package/src/components/Switch/Switch.stories.tsx +9 -0
  319. package/src/components/Switch/Switch.tsx +55 -0
  320. package/src/components/Switch/index.ts +1 -0
  321. package/src/components/TextField/TextField.stories.tsx +31 -0
  322. package/src/components/TextField/TextField.tsx +141 -0
  323. package/src/components/TextField/index.ts +1 -0
  324. package/src/components/TokenList/TokenItem.tsx +73 -0
  325. package/src/components/TokenList/TokenList.stories.tsx +18 -0
  326. package/src/components/TokenList/TokenList.tsx +95 -0
  327. package/src/components/TokenList/index.ts +1 -0
  328. package/src/components/TokenList/mockData.ts +1721 -0
  329. package/src/components/TokenSelector/TokenSelector.stories.tsx +18 -0
  330. package/src/components/TokenSelector/TokenSelector.tsx +95 -0
  331. package/src/components/TokenSelector/index.ts +1 -0
  332. package/src/components/Tooltip/Tooltip.stories.tsx +52 -0
  333. package/src/components/Tooltip/Tooltip.tsx +116 -0
  334. package/src/components/Tooltip/index.ts +1 -0
  335. package/src/components/Typography/Typography.stories.tsx +72 -0
  336. package/src/components/Typography/Typography.tsx +216 -0
  337. package/src/components/Typography/index.ts +1 -0
  338. package/src/components/VirtualizedList/VirtualizedList.tsx +62 -0
  339. package/src/components/Wallet/State.tsx +34 -0
  340. package/src/components/Wallet/Wallet.stories.tsx +36 -0
  341. package/src/components/Wallet/Wallet.tsx +69 -0
  342. package/src/components/Wallet/index.ts +1 -0
  343. package/src/components/common/FilledCircle.tsx +8 -0
  344. package/src/components/common/index.ts +1 -0
  345. package/src/components/index.ts +31 -0
  346. package/src/containers/ConfirmSwap/ConfirmSwap.stories.tsx +22 -0
  347. package/src/containers/ConfirmSwap/ConfirmSwap.tsx +180 -0
  348. package/src/containers/ConfirmSwap/index.ts +1 -0
  349. package/src/containers/ConfirmSwap/mock.ts +223 -0
  350. package/src/containers/History/History.stories.tsx +14 -0
  351. package/src/containers/History/History.tsx +115 -0
  352. package/src/containers/History/index.ts +1 -0
  353. package/src/containers/History/mock.ts +826 -0
  354. package/src/containers/History/types.tsx +47 -0
  355. package/src/containers/SwapHistory/SwapHistory.stories.tsx +13 -0
  356. package/src/containers/SwapHistory/SwapHistory.tsx +442 -0
  357. package/src/containers/SwapHistory/SwapMessages.tsx +116 -0
  358. package/src/containers/SwapHistory/index.ts +1 -0
  359. package/src/containers/SwapHistory/mock.ts +276 -0
  360. package/src/containers/index.ts +3 -0
  361. package/src/helper/index.ts +16 -0
  362. package/src/index.ts +4 -0
  363. package/src/theme.ts +163 -0
  364. package/src/types/index.ts +3 -0
  365. package/src/types/meta.ts +22 -0
  366. package/src/types/swaps.ts +44 -0
  367. package/src/types/wallet.ts +30 -0
@@ -0,0 +1,554 @@
1
+ import { RoutingResultType } from 'rango-sdk';
2
+ import { BestRouteType } from '../../types/swaps';
3
+
4
+ // TODO: I used `internalSwaps: []` to fix ts error. fix it by using real data.
5
+
6
+ export const bestRoute: BestRouteType = {
7
+ from: { blockchain: 'BSC', symbol: 'BNB', address: null },
8
+ to: { blockchain: 'AVAX_CCHAIN', symbol: 'AVAX', address: null },
9
+ requestAmount: '0.3',
10
+ requestId: '228529e3-27d7-4fa9-ab84-bb2b90eade6f',
11
+ result: {
12
+ resultType: RoutingResultType.OK,
13
+ outputAmount: '5.685715974132648891',
14
+ swaps: [
15
+ {
16
+ // TODO: fix this and use real data
17
+ internalSwaps: [],
18
+ swapperId: 'AnySwap Aggregator',
19
+ swapperType: 'AGGREGATOR',
20
+ swapperLogo: 'https://api.rango.exchange/swappers/multichain.png',
21
+ maxRequiredSign: 1,
22
+ warnings: [],
23
+ from: {
24
+ symbol: 'BNB',
25
+ logo: 'https://api.rango.exchange/i/Y3v1KW',
26
+ blockchainLogo: 'https://api.rango.exchange/blockchains/binance.svg',
27
+
28
+ address: null,
29
+ blockchain: 'BSC',
30
+ decimals: 18,
31
+ usdPrice: 279.2738558274085,
32
+ },
33
+ to: {
34
+ symbol: 'WETH.E',
35
+ logo: 'https://api.rango.exchange/i/j9xgdC',
36
+ blockchainLogo:
37
+ 'https://api.rango.exchange/blockchains/avax_cchain.svg',
38
+
39
+ address: '0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab',
40
+ blockchain: 'AVAX_CCHAIN',
41
+ decimals: 18,
42
+ usdPrice: 1329.24,
43
+ },
44
+ fromAmount: '0.300000000000000000',
45
+ fromAmountPrecision: null,
46
+ fromAmountMinValue: '0.047579322466294684272760',
47
+ fromAmountMaxValue: '79302.26195302606417382090',
48
+ fromAmountRestrictionType: 'INCLUSIVE',
49
+ toAmount: '0.062064305934309070',
50
+ fee: [
51
+ {
52
+ asset: {
53
+ blockchain: 'BSC',
54
+ symbol: 'BNB',
55
+ address: null,
56
+ },
57
+ expenseType: 'FROM_SOURCE_WALLET',
58
+ amount: '0.001388002000000000',
59
+ name: 'Network Fee',
60
+ },
61
+ ],
62
+ estimatedTimeInSeconds: 300,
63
+ swapChainType: 'INTRA_CHAIN',
64
+ routes: null,
65
+ recommendedSlippage: null,
66
+ timeStat: { min: 162, avg: 260, max: 467 },
67
+ includesDestinationTx: false,
68
+ },
69
+ {
70
+ internalSwaps: [],
71
+ swapperId: 'PangolinSwap',
72
+ swapperLogo: 'https://api.rango.exchange/swappers/pangolin.png',
73
+ swapperType: 'DEX',
74
+ maxRequiredSign: 1,
75
+ warnings: [],
76
+ from: {
77
+ symbol: 'WETH.E',
78
+ logo: 'https://api.rango.exchange/i/j9xgdC',
79
+ address: '0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab',
80
+ blockchain: 'AVAX_CCHAIN',
81
+ decimals: 18,
82
+ usdPrice: 1329.24,
83
+ blockchainLogo:
84
+ 'https://api.rango.exchange/blockchains/avax_cchain.svg',
85
+ },
86
+ to: {
87
+ symbol: 'AVAX',
88
+ logo: 'https://api.rango.exchange/i/kX4edQ',
89
+ address: null,
90
+ blockchain: 'AVAX_CCHAIN',
91
+ decimals: 18,
92
+ usdPrice: 12.5,
93
+ blockchainLogo:
94
+ 'https://api.rango.exchange/blockchains/avax_cchain.svg',
95
+ },
96
+ fromAmount: '0.062064305934309070',
97
+ fromAmountPrecision: null,
98
+ fromAmountMinValue: null,
99
+ fromAmountMaxValue: null,
100
+ fromAmountRestrictionType: 'EXCLUSIVE',
101
+ toAmount: '5.685715974132648891',
102
+ fee: [
103
+ {
104
+ asset: {
105
+ blockchain: 'AVAX_CCHAIN',
106
+ symbol: 'WETH.E',
107
+ address: '0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab',
108
+ },
109
+ expenseType: 'DECREASE_FROM_OUTPUT',
110
+ name: 'Network Fee',
111
+ amount:
112
+ '0.00018619291780292721387591870688029381530892436558133340440690517425537109375',
113
+ },
114
+ {
115
+ asset: { blockchain: 'AVAX_CCHAIN', symbol: 'AVAX', address: null },
116
+ expenseType: 'FROM_SOURCE_WALLET',
117
+ name: 'Network Fee',
118
+ amount: '0.005370022532678750',
119
+ },
120
+ ],
121
+ estimatedTimeInSeconds: 45,
122
+ swapChainType: 'INTER_CHAIN',
123
+ routes: [
124
+ {
125
+ nodes: [
126
+ {
127
+ nodes: [
128
+ {
129
+ marketName: 'PangolinSwap',
130
+ marketId: 'PangolinSwap',
131
+ percent: 1.0,
132
+ },
133
+ ],
134
+ from: 'WETH.e',
135
+ fromLogo: '',
136
+ fromAddress: '0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab',
137
+ fromBlockchain: 'AVAX_CCHAIN',
138
+ to: 'WAVAX',
139
+ toLogo: '',
140
+ toAddress: '0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7',
141
+ toBlockchain: 'AVAX_CCHAIN',
142
+ },
143
+ ],
144
+ },
145
+ ],
146
+ recommendedSlippage: null,
147
+ timeStat: { min: 6, avg: 39, max: 317 },
148
+ includesDestinationTx: false,
149
+ },
150
+ ],
151
+ },
152
+ validationStatus: null,
153
+ missingBlockchains: [],
154
+ diagnosisMessages: [],
155
+ processingLimitReached: false,
156
+ walletNotSupportingFromBlockchain: false,
157
+ };
158
+ export const bestRouteExample2: BestRouteType = {
159
+ from: {
160
+ blockchain: 'BSC',
161
+ symbol: 'USDC',
162
+ address: '0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d',
163
+ },
164
+ to: { blockchain: 'AKASH', symbol: 'AKT', address: null },
165
+ requestAmount: '10',
166
+ requestId: '56a3f944-02ec-4011-b3c6-6c76c3ad049b',
167
+ result: {
168
+ resultType: RoutingResultType.OK,
169
+ outputAmount: '30.983906',
170
+ swaps: [
171
+ {
172
+ internalSwaps: [],
173
+ maxRequiredSign: 1,
174
+ warnings: [],
175
+ swapperId: 'ParaSwap Bsc',
176
+ swapperType: 'DEX',
177
+ swapperLogo: 'https://api.rango.exchange/swappers/para-swap.png',
178
+
179
+ from: {
180
+ symbol: 'USDC',
181
+ blockchainLogo: 'https://api.rango.exchange/blockchains/binance.svg',
182
+
183
+ logo: 'https://api.rango.exchange/i/toXKGV',
184
+ address: '0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d',
185
+ blockchain: 'BSC',
186
+ decimals: 18,
187
+ usdPrice: 1.0,
188
+ },
189
+ to: {
190
+ symbol: 'AXLUSDC',
191
+ blockchainLogo: 'https://api.rango.exchange/blockchains/binance.svg',
192
+ logo: 'https://api.rango.exchange/tokens/COSMOS/AXLUSDC.png',
193
+ address: '0x4268b8f0b87b6eae5d897996e6b845ddbd99adf3',
194
+ blockchain: 'BSC',
195
+ decimals: 6,
196
+ usdPrice: 1.0,
197
+ },
198
+ fromAmount: '10.000000000000000000',
199
+ fromAmountPrecision: null,
200
+ fromAmountMinValue: null,
201
+ fromAmountMaxValue: null,
202
+ fromAmountRestrictionType: 'EXCLUSIVE',
203
+ toAmount: '9.957577',
204
+ fee: [
205
+ {
206
+ asset: { blockchain: 'BSC', symbol: 'BNB', address: null },
207
+ expenseType: 'FROM_SOURCE_WALLET',
208
+ amount: '0.002179644500000000',
209
+ name: 'Network Fee',
210
+ },
211
+ {
212
+ asset: {
213
+ blockchain: 'BSC',
214
+ symbol: 'AXLUSDC',
215
+ address: '0x4268b8f0b87b6eae5d897996e6b845ddbd99adf3',
216
+ },
217
+ expenseType: 'DECREASE_FROM_OUTPUT',
218
+ amount: '0.004978',
219
+ name: 'Network Fee',
220
+ },
221
+ ],
222
+ estimatedTimeInSeconds: 60,
223
+ swapChainType: 'INTER_CHAIN',
224
+ routes: [
225
+ {
226
+ nodes: [
227
+ {
228
+ nodes: [
229
+ {
230
+ marketName: 'PancakeSwap',
231
+ marketId: 'PancakeSwap',
232
+ percent: 1.0,
233
+ },
234
+ ],
235
+ from: 'USDC',
236
+ fromLogo:
237
+ 'https://tokens.pancakeswap.finance/images/0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d.png',
238
+ fromAddress: '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d',
239
+ fromBlockchain: 'BSC',
240
+ to: 'BUSD',
241
+ toLogo:
242
+ 'https://tokens.pancakeswap.finance/images/0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56.png',
243
+ toAddress: '0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56',
244
+ toBlockchain: 'BSC',
245
+ },
246
+ {
247
+ nodes: [
248
+ {
249
+ marketName: 'Ellipsis',
250
+ marketId: 'Ellipsis',
251
+ percent: 1.0,
252
+ },
253
+ ],
254
+ from: 'BUSD',
255
+ fromLogo:
256
+ 'https://tokens.pancakeswap.finance/images/0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56.png',
257
+ fromAddress: '0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56',
258
+ fromBlockchain: 'BSC',
259
+ to: 'axlUSDC',
260
+ toLogo: 'https://api.rango.exchange/tokens/COSMOS/AXLUSDC.png',
261
+ toAddress: '0x4268b8f0b87b6eae5d897996e6b845ddbd99adf3',
262
+ toBlockchain: 'BSC',
263
+ },
264
+ ],
265
+ },
266
+ ],
267
+ recommendedSlippage: null,
268
+ timeStat: { min: 6, avg: 52, max: 183 },
269
+ includesDestinationTx: false,
270
+ },
271
+ {
272
+ internalSwaps: [],
273
+ maxRequiredSign: 1,
274
+ warnings: [],
275
+ swapperId: 'Satellite',
276
+ swapperType: 'BRIDGE',
277
+ swapperLogo: 'https://api.rango.exchange/swappers/satellite.png',
278
+ from: {
279
+ symbol: 'AXLUSDC',
280
+ blockchainLogo: 'https://api.rango.exchange/blockchains/binance.svg',
281
+ logo: 'https://api.rango.exchange/tokens/COSMOS/AXLUSDC.png',
282
+ address: '0x4268b8f0b87b6eae5d897996e6b845ddbd99adf3',
283
+ blockchain: 'BSC',
284
+ decimals: 6,
285
+ usdPrice: 1.0,
286
+ },
287
+ to: {
288
+ symbol: 'USDC',
289
+ blockchainLogo: 'https://api.rango.exchange/swappers/osmosis.png',
290
+ logo: 'https://api.rango.exchange/tokens/COSMOS/USDC.png',
291
+ address:
292
+ 'ibc/d189335c6e4a68b513c10ab227bf1c1d38c746766278ba3eeb4fb14124f1d858',
293
+ blockchain: 'OSMOSIS',
294
+ decimals: 6,
295
+ usdPrice: 1.0000000008037055,
296
+ },
297
+ fromAmount: '9.957577',
298
+ fromAmountPrecision: null,
299
+ fromAmountMinValue: null,
300
+ fromAmountMaxValue: null,
301
+ fromAmountRestrictionType: 'EXCLUSIVE',
302
+ toAmount: '8.357577',
303
+ fee: [
304
+ {
305
+ asset: { blockchain: 'BSC', symbol: 'BNB', address: null },
306
+ expenseType: 'FROM_SOURCE_WALLET',
307
+ amount:
308
+ '0.0003850000000000000239784127112452447212753714467226018314249813556671142578125000000000000',
309
+ name: 'Network Fee',
310
+ },
311
+ ],
312
+ estimatedTimeInSeconds: 360,
313
+ swapChainType: 'INTER_CHAIN',
314
+ routes: null,
315
+ recommendedSlippage: null,
316
+ timeStat: { min: 9, avg: 339, max: 1138 },
317
+ includesDestinationTx: false,
318
+ },
319
+ {
320
+ internalSwaps: [],
321
+ maxRequiredSign: 1,
322
+ warnings: [],
323
+ swapperId: 'Osmosis',
324
+ swapperType: 'DEX',
325
+ swapperLogo: 'https://api.rango.exchange/swappers/osmosis.png',
326
+ from: {
327
+ symbol: 'USDC',
328
+ logo: 'https://api.rango.exchange/tokens/COSMOS/USDC.png',
329
+ blockchainLogo: 'https://api.rango.exchange/swappers/osmosis.png',
330
+ address:
331
+ 'ibc/d189335c6e4a68b513c10ab227bf1c1d38c746766278ba3eeb4fb14124f1d858',
332
+ blockchain: 'OSMOSIS',
333
+ decimals: 6,
334
+ usdPrice: 1.0000000008037055,
335
+ },
336
+ to: {
337
+ symbol: 'AKT',
338
+ logo: 'https://api.rango.exchange/tokens/COSMOS/AKT.png',
339
+ blockchainLogo: 'https://api.rango.exchange/swappers/osmosis.png',
340
+ address:
341
+ 'ibc/1480b8fd20ad5fcae81ea87584d269547dd4d436843c1d20f15e00eb64743ef4',
342
+ blockchain: 'OSMOSIS',
343
+ decimals: 6,
344
+ usdPrice: 0.2688829083335616,
345
+ },
346
+ fromAmount: '8.357577',
347
+ fromAmountPrecision: null,
348
+ fromAmountMinValue: null,
349
+ fromAmountMaxValue: null,
350
+ fromAmountRestrictionType: 'EXCLUSIVE',
351
+ toAmount: '30.983906',
352
+ fee: [
353
+ {
354
+ asset: { blockchain: 'OSMOSIS', symbol: 'OSMO', address: null },
355
+ expenseType: 'FROM_SOURCE_WALLET',
356
+ amount: '0',
357
+ name: 'Network Fee',
358
+ },
359
+ ],
360
+ estimatedTimeInSeconds: 45,
361
+ swapChainType: 'INTRA_CHAIN',
362
+ routes: [
363
+ {
364
+ nodes: [
365
+ {
366
+ nodes: [
367
+ { marketName: 'pool#875', marketId: null, percent: 1.0 },
368
+ ],
369
+ from: 'USDC',
370
+ fromLogo: 'https://api.rango.exchange/tokens/COSMOS/USDC.png',
371
+ fromAddress:
372
+ 'ibc/d189335c6e4a68b513c10ab227bf1c1d38c746766278ba3eeb4fb14124f1d858',
373
+ fromBlockchain: 'OSMOSIS',
374
+ to: 'ACRE',
375
+ toLogo: 'https://api.rango.exchange/tokens/COSMOS/ACRE.png',
376
+ toAddress:
377
+ 'ibc/bb936517f7e5d77a63e0adb05217a6608b0c4cf8fba7ea2f4bae4107a7238f06',
378
+ toBlockchain: 'OSMOSIS',
379
+ },
380
+ {
381
+ nodes: [
382
+ { marketName: 'pool#858', marketId: null, percent: 1.0 },
383
+ ],
384
+ from: 'ACRE',
385
+ fromLogo: 'https://api.rango.exchange/tokens/COSMOS/ACRE.png',
386
+ fromAddress:
387
+ 'ibc/bb936517f7e5d77a63e0adb05217a6608b0c4cf8fba7ea2f4bae4107a7238f06',
388
+ fromBlockchain: 'OSMOSIS',
389
+ to: 'OSMO',
390
+ toLogo: 'https://api.rango.exchange/tokens/COSMOS/OSMO.png',
391
+ toAddress: null,
392
+ toBlockchain: 'OSMOSIS',
393
+ },
394
+ {
395
+ nodes: [{ marketName: 'pool#3', marketId: null, percent: 1.0 }],
396
+ from: 'OSMO',
397
+ fromLogo: 'https://api.rango.exchange/tokens/COSMOS/OSMO.png',
398
+ fromAddress: null,
399
+ fromBlockchain: 'OSMOSIS',
400
+ to: 'AKT',
401
+ toLogo: 'https://api.rango.exchange/tokens/COSMOS/AKT.png',
402
+ toAddress:
403
+ 'ibc/1480b8fd20ad5fcae81ea87584d269547dd4d436843c1d20f15e00eb64743ef4',
404
+ toBlockchain: 'OSMOSIS',
405
+ },
406
+ ],
407
+ },
408
+ ],
409
+ recommendedSlippage: null,
410
+ timeStat: { min: 7, avg: 38, max: 187 },
411
+ includesDestinationTx: false,
412
+ },
413
+ {
414
+ internalSwaps: [],
415
+ maxRequiredSign: 1,
416
+ warnings: [],
417
+ swapperId: 'Osmosis',
418
+ swapperType: 'BRIDGE',
419
+ swapperLogo: 'https://api.rango.exchange/swappers/osmosis.png',
420
+ from: {
421
+ symbol: 'AKT',
422
+ logo: 'https://api.rango.exchange/tokens/COSMOS/AKT.png',
423
+ blockchainLogo: 'https://api.rango.exchange/swappers/osmosis.png',
424
+ address:
425
+ 'ibc/1480b8fd20ad5fcae81ea87584d269547dd4d436843c1d20f15e00eb64743ef4',
426
+ blockchain: 'OSMOSIS',
427
+ decimals: 6,
428
+ usdPrice: 0.2688829083335616,
429
+ },
430
+ to: {
431
+ symbol: 'AKT',
432
+ logo: 'https://api.rango.exchange/i/3MAS1e',
433
+ blockchainLogo: 'https://api.rango.exchange/swappers/osmosis.png',
434
+ address: null,
435
+ blockchain: 'AKASH',
436
+ decimals: 6,
437
+ usdPrice: 0.2672300245136459,
438
+ },
439
+ fromAmount: '30.983906',
440
+ fromAmountPrecision: null,
441
+ fromAmountMinValue: null,
442
+ fromAmountMaxValue: null,
443
+ fromAmountRestrictionType: 'EXCLUSIVE',
444
+ toAmount: '30.983906',
445
+ fee: [
446
+ {
447
+ asset: { blockchain: 'OSMOSIS', symbol: 'OSMO', address: null },
448
+ expenseType: 'FROM_SOURCE_WALLET',
449
+ amount: '0.005000',
450
+ name: 'Network Fee',
451
+ },
452
+ ],
453
+ estimatedTimeInSeconds: 45,
454
+ swapChainType: 'INTRA_CHAIN',
455
+ routes: [
456
+ {
457
+ nodes: [
458
+ {
459
+ nodes: [
460
+ { marketName: 'Osmosis', marketId: null, percent: 1.0 },
461
+ ],
462
+ from: 'AKT',
463
+ fromLogo: 'https://api.rango.exchange/tokens/COSMOS/AKT.png',
464
+ fromAddress:
465
+ 'ibc/1480b8fd20ad5fcae81ea87584d269547dd4d436843c1d20f15e00eb64743ef4',
466
+ fromBlockchain: 'OSMOSIS',
467
+ to: 'AKT',
468
+ toLogo: 'https://api.rango.exchange/tokens/COSMOS/AKT.png',
469
+ toAddress: null,
470
+ toBlockchain: 'AKASH',
471
+ },
472
+ ],
473
+ },
474
+ ],
475
+ recommendedSlippage: null,
476
+ timeStat: { min: 7, avg: 38, max: 187 },
477
+ includesDestinationTx: false,
478
+ },
479
+ ],
480
+ },
481
+ validationStatus: null,
482
+ missingBlockchains: [],
483
+ diagnosisMessages: [],
484
+ processingLimitReached: false,
485
+ walletNotSupportingFromBlockchain: false,
486
+ };
487
+
488
+ export const bestRouteExample3: BestRouteType = {
489
+ from: { blockchain: 'BSC', symbol: 'BNB', address: null },
490
+ to: { blockchain: 'AVAX_CCHAIN', symbol: 'AVAX', address: null },
491
+ requestAmount: '0.3',
492
+ requestId: '228529e3-27d7-4fa9-ab84-bb2b90eade6f',
493
+ result: {
494
+ resultType: RoutingResultType.OK,
495
+ outputAmount: '5.685715974132648891',
496
+ swaps: [
497
+ {
498
+ internalSwaps: [],
499
+ maxRequiredSign: 1,
500
+ warnings: [],
501
+ swapperId: 'AnySwap Aggregator',
502
+ swapperType: 'AGGREGATOR',
503
+ swapperLogo: 'https://api.rango.exchange/swappers/multichain.png',
504
+
505
+ from: {
506
+ symbol: 'BNB',
507
+ logo: 'https://api.rango.exchange/i/Y3v1KW',
508
+ blockchainLogo: 'https://api.rango.exchange/blockchains/binance.svg',
509
+
510
+ address: null,
511
+ blockchain: 'BSC',
512
+ decimals: 18,
513
+ usdPrice: 279.2738558274085,
514
+ },
515
+ to: {
516
+ symbol: 'WETH.E',
517
+ logo: 'https://api.rango.exchange/i/j9xgdC',
518
+ blockchainLogo:
519
+ 'https://api.rango.exchange/blockchains/avax_cchain.svg',
520
+
521
+ address: '0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab',
522
+ blockchain: 'AVAX_CCHAIN',
523
+ decimals: 18,
524
+ usdPrice: 1329.24,
525
+ },
526
+ fromAmount: '0.300000000000000000',
527
+ fromAmountPrecision: null,
528
+ fromAmountMinValue: '0.047579322466294684272760',
529
+ fromAmountMaxValue: '79302.26195302606417382090',
530
+ fromAmountRestrictionType: 'INCLUSIVE',
531
+ toAmount: '0.062064305934309070',
532
+ fee: [
533
+ {
534
+ asset: { blockchain: 'BSC', symbol: 'BNB', address: null },
535
+ expenseType: 'FROM_SOURCE_WALLET',
536
+ amount: '0.001388002000000000',
537
+ name: 'Network Fee',
538
+ },
539
+ ],
540
+ estimatedTimeInSeconds: 300,
541
+ swapChainType: 'INTRA_CHAIN',
542
+ routes: null,
543
+ recommendedSlippage: null,
544
+ timeStat: { min: 162, avg: 260, max: 467 },
545
+ includesDestinationTx: false,
546
+ },
547
+ ],
548
+ },
549
+ validationStatus: null,
550
+ missingBlockchains: [],
551
+ diagnosisMessages: [],
552
+ processingLimitReached: false,
553
+ walletNotSupportingFromBlockchain: false,
554
+ };
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { ComponentMeta } from '@storybook/react';
3
+ import { BlockchainSelector, PropTypes } from './BlockchainSelector';
4
+ import { blockchainMeta } from '../BlockchainsList/mockData';
5
+ import { SwapContainer } from '../SwapContainer/SwapContainer';
6
+
7
+ export default {
8
+ title: 'Blockchain Selector',
9
+ component: BlockchainSelector,
10
+ argTypes: {
11
+ type: {
12
+ defaultValue: 'Source',
13
+ },
14
+ },
15
+ } as ComponentMeta<typeof BlockchainSelector>;
16
+
17
+ export const Main = (args: PropTypes) => (
18
+ <SwapContainer>
19
+ <BlockchainSelector
20
+ {...args}
21
+ list={blockchainMeta}
22
+ selected={blockchainMeta[0]}
23
+ />
24
+ </SwapContainer>
25
+ );
@@ -0,0 +1,93 @@
1
+ import React from 'react';
2
+ import { BlockchainMeta } from 'rango-sdk';
3
+ import { BlockchainsList } from '../BlockchainsList';
4
+ import { SecondaryPage } from '../SecondaryPage/SecondaryPage';
5
+ import { Spinner } from '../Spinner';
6
+ import { styled } from '../../theme';
7
+ import { CSSProperties } from '@stitches/react';
8
+ import { containsText } from '../../helper';
9
+ import { LoadingStatus } from '../../types/meta';
10
+ import { LoadingFailedAlert } from '../Alert/LoadingFailedAlert';
11
+ import { NotFoundAlert } from '../Alert/NotFoundAlert';
12
+ import { LoaderContainer } from '../TokenSelector/TokenSelector';
13
+
14
+ const ListContainer = styled('div', {
15
+ overflowY: 'auto',
16
+ });
17
+
18
+ const filterBlockchains = (list: BlockchainMeta[], searchedFor: string) =>
19
+ list.filter(
20
+ (blockchain) =>
21
+ containsText(blockchain.name, searchedFor) ||
22
+ containsText(blockchain.displayName, searchedFor)
23
+ );
24
+
25
+ export interface PropTypes {
26
+ type?: 'Source' | 'Destination';
27
+ list: BlockchainMeta[];
28
+ selected?: BlockchainMeta | null;
29
+ onChange: (blockchain: BlockchainMeta) => void;
30
+ onBack?: () => void;
31
+ loadingStatus: LoadingStatus;
32
+ hasHeader?: boolean;
33
+ listContainerStyle?: CSSProperties;
34
+ multiSelect?: boolean;
35
+ selectedList?: BlockchainMeta[] | 'all';
36
+ }
37
+
38
+ export function BlockchainSelector(props: PropTypes) {
39
+ const {
40
+ type,
41
+ list,
42
+ onChange,
43
+ selected,
44
+ onBack,
45
+ loadingStatus,
46
+ hasHeader,
47
+ listContainerStyle,
48
+ multiSelect,
49
+ selectedList,
50
+ } = props;
51
+
52
+ return (
53
+ <SecondaryPage
54
+ textField={true}
55
+ hasHeader={hasHeader}
56
+ textFieldPlaceholder="Search Blockchain By Name"
57
+ title={`Select ${type} Network`}
58
+ onBack={onBack}
59
+ >
60
+ {(searchedFor) => {
61
+ const filteredBlockchains = filterBlockchains(list, searchedFor);
62
+ return (
63
+ <ListContainer style={listContainerStyle} key="1">
64
+ {loadingStatus === 'loading' && (
65
+ <LoaderContainer>
66
+ <Spinner size={24} />
67
+ </LoaderContainer>
68
+ )}
69
+ {loadingStatus === 'failed' && <LoadingFailedAlert />}
70
+ {loadingStatus === 'success' && (
71
+ <>
72
+ {filteredBlockchains.length ? (
73
+ <BlockchainsList
74
+ list={filteredBlockchains}
75
+ selected={selected}
76
+ multiSelect={multiSelect}
77
+ selectedList={selectedList}
78
+ onChange={onChange}
79
+ />
80
+ ) : (
81
+ <NotFoundAlert
82
+ catergory="Blockchain"
83
+ searchedFor={searchedFor}
84
+ />
85
+ )}
86
+ </>
87
+ )}
88
+ </ListContainer>
89
+ );
90
+ }}
91
+ </SecondaryPage>
92
+ );
93
+ }
@@ -0,0 +1 @@
1
+ export { BlockchainSelector } from './BlockchainSelector';
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { ComponentMeta } from '@storybook/react';
3
+ import { BlockchainsList, PropTypes } from './BlockchainsList';
4
+ import { blockchainMeta } from './mockData';
5
+
6
+ export default {
7
+ title: 'Blockchains List',
8
+ component: BlockchainsList,
9
+ argTypes: {
10
+ searchedText: {
11
+ type: 'string',
12
+ defaultValue: '',
13
+ },
14
+ },
15
+ } as ComponentMeta<typeof BlockchainsList>;
16
+
17
+ export const Main = (args: PropTypes) => {
18
+ return (
19
+ <BlockchainsList
20
+ {...args}
21
+ list={blockchainMeta}
22
+ selected={blockchainMeta[0]}
23
+ />
24
+ );
25
+ };