@yaswap/wallet-core 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (563) hide show
  1. package/CHANGELOG.md +804 -0
  2. package/README.md +163 -0
  3. package/dist/package.json +76 -0
  4. package/dist/src/build.config.d.ts +46 -0
  5. package/dist/src/build.config.js +237 -0
  6. package/dist/src/build.config.js.map +1 -0
  7. package/dist/src/factory/client/clients.d.ts +11 -0
  8. package/dist/src/factory/client/clients.js +119 -0
  9. package/dist/src/factory/client/clients.js.map +1 -0
  10. package/dist/src/factory/client/evm.d.ts +6 -0
  11. package/dist/src/factory/client/evm.js +71 -0
  12. package/dist/src/factory/client/evm.js.map +1 -0
  13. package/dist/src/factory/client/index.d.ts +11 -0
  14. package/dist/src/factory/client/index.js +38 -0
  15. package/dist/src/factory/client/index.js.map +1 -0
  16. package/dist/src/factory/client/nft.d.ts +4 -0
  17. package/dist/src/factory/client/nft.js +26 -0
  18. package/dist/src/factory/client/nft.js.map +1 -0
  19. package/dist/src/factory/index.d.ts +3 -0
  20. package/dist/src/factory/index.js +7 -0
  21. package/dist/src/factory/index.js.map +1 -0
  22. package/dist/src/factory/settings.d.ts +4 -0
  23. package/dist/src/factory/settings.js +27 -0
  24. package/dist/src/factory/settings.js.map +1 -0
  25. package/dist/src/factory/swap/index.d.ts +4 -0
  26. package/dist/src/factory/swap/index.js +66 -0
  27. package/dist/src/factory/swap/index.js.map +1 -0
  28. package/dist/src/index.d.ts +1619 -0
  29. package/dist/src/index.js +38 -0
  30. package/dist/src/index.js.map +1 -0
  31. package/dist/src/index.test.d.ts +1 -0
  32. package/dist/src/index.test.js +187 -0
  33. package/dist/src/index.test.js.map +1 -0
  34. package/dist/src/nameResolvers/nameResolver.d.ts +7 -0
  35. package/dist/src/nameResolvers/nameResolver.js +3 -0
  36. package/dist/src/nameResolvers/nameResolver.js.map +1 -0
  37. package/dist/src/nameResolvers/uns.d.ts +12 -0
  38. package/dist/src/nameResolvers/uns.js +83 -0
  39. package/dist/src/nameResolvers/uns.js.map +1 -0
  40. package/dist/src/nameResolvers/uns.test.d.ts +1 -0
  41. package/dist/src/nameResolvers/uns.test.js +29 -0
  42. package/dist/src/nameResolvers/uns.test.js.map +1 -0
  43. package/dist/src/store/actions/acceptTermsAndConditions.d.ts +4 -0
  44. package/dist/src/store/actions/acceptTermsAndConditions.js +17 -0
  45. package/dist/src/store/actions/acceptTermsAndConditions.js.map +1 -0
  46. package/dist/src/store/actions/acceptTermsAndConditions.test.d.ts +1 -0
  47. package/dist/src/store/actions/acceptTermsAndConditions.test.js +22 -0
  48. package/dist/src/store/actions/acceptTermsAndConditions.test.js.map +1 -0
  49. package/dist/src/store/actions/accounts/createAccount.d.ts +7 -0
  50. package/dist/src/store/actions/accounts/createAccount.js +27 -0
  51. package/dist/src/store/actions/accounts/createAccount.js.map +1 -0
  52. package/dist/src/store/actions/accounts/createAccount.test.d.ts +1 -0
  53. package/dist/src/store/actions/accounts/createAccount.test.js +29 -0
  54. package/dist/src/store/actions/accounts/createAccount.test.js.map +1 -0
  55. package/dist/src/store/actions/accounts/index.d.ts +5 -0
  56. package/dist/src/store/actions/accounts/index.js +9 -0
  57. package/dist/src/store/actions/accounts/index.js.map +1 -0
  58. package/dist/src/store/actions/accounts/removeAccount.d.ts +7 -0
  59. package/dist/src/store/actions/accounts/removeAccount.js +12 -0
  60. package/dist/src/store/actions/accounts/removeAccount.js.map +1 -0
  61. package/dist/src/store/actions/accounts/removeAccount.test.d.ts +1 -0
  62. package/dist/src/store/actions/accounts/removeAccount.test.js +53 -0
  63. package/dist/src/store/actions/accounts/removeAccount.test.js.map +1 -0
  64. package/dist/src/store/actions/accounts/toggleAccount.d.ts +8 -0
  65. package/dist/src/store/actions/accounts/toggleAccount.js +19 -0
  66. package/dist/src/store/actions/accounts/toggleAccount.js.map +1 -0
  67. package/dist/src/store/actions/accounts/toggleAccount.test.d.ts +1 -0
  68. package/dist/src/store/actions/accounts/toggleAccount.test.js +44 -0
  69. package/dist/src/store/actions/accounts/toggleAccount.test.js.map +1 -0
  70. package/dist/src/store/actions/accounts/toggleBlockchain.d.ts +9 -0
  71. package/dist/src/store/actions/accounts/toggleBlockchain.js +14 -0
  72. package/dist/src/store/actions/accounts/toggleBlockchain.js.map +1 -0
  73. package/dist/src/store/actions/accounts/updateAccount.d.ts +26 -0
  74. package/dist/src/store/actions/accounts/updateAccount.js +14 -0
  75. package/dist/src/store/actions/accounts/updateAccount.js.map +1 -0
  76. package/dist/src/store/actions/addCustomToken.d.ts +12 -0
  77. package/dist/src/store/actions/addCustomToken.js +12 -0
  78. package/dist/src/store/actions/addCustomToken.js.map +1 -0
  79. package/dist/src/store/actions/addCustomToken.test.d.ts +1 -0
  80. package/dist/src/store/actions/addCustomToken.test.js +59 -0
  81. package/dist/src/store/actions/addCustomToken.test.js.map +1 -0
  82. package/dist/src/store/actions/addExternalConnection.d.ts +9 -0
  83. package/dist/src/store/actions/addExternalConnection.js +13 -0
  84. package/dist/src/store/actions/addExternalConnection.js.map +1 -0
  85. package/dist/src/store/actions/addExternalConnection.test.d.ts +1 -0
  86. package/dist/src/store/actions/addExternalConnection.test.js +100 -0
  87. package/dist/src/store/actions/addExternalConnection.test.js.map +1 -0
  88. package/dist/src/store/actions/analytics.d.ts +21 -0
  89. package/dist/src/store/actions/analytics.js +58 -0
  90. package/dist/src/store/actions/analytics.js.map +1 -0
  91. package/dist/src/store/actions/analytics.test.d.ts +1 -0
  92. package/dist/src/store/actions/analytics.test.js +33 -0
  93. package/dist/src/store/actions/analytics.test.js.map +1 -0
  94. package/dist/src/store/actions/changeActiveNetwork.d.ts +5 -0
  95. package/dist/src/store/actions/changeActiveNetwork.js +13 -0
  96. package/dist/src/store/actions/changeActiveNetwork.js.map +1 -0
  97. package/dist/src/store/actions/changeActiveWalletId.d.ts +5 -0
  98. package/dist/src/store/actions/changeActiveWalletId.js +11 -0
  99. package/dist/src/store/actions/changeActiveWalletId.js.map +1 -0
  100. package/dist/src/store/actions/changeActiveWalletId.test.d.ts +1 -0
  101. package/dist/src/store/actions/changeActiveWalletId.test.js +40 -0
  102. package/dist/src/store/actions/changeActiveWalletId.test.js.map +1 -0
  103. package/dist/src/store/actions/changePassword.d.ts +4 -0
  104. package/dist/src/store/actions/changePassword.js +13 -0
  105. package/dist/src/store/actions/changePassword.js.map +1 -0
  106. package/dist/src/store/actions/changePassword.test.d.ts +1 -0
  107. package/dist/src/store/actions/changePassword.test.js +22 -0
  108. package/dist/src/store/actions/changePassword.test.js.map +1 -0
  109. package/dist/src/store/actions/checkPendingActions.d.ts +5 -0
  110. package/dist/src/store/actions/checkPendingActions.js +25 -0
  111. package/dist/src/store/actions/checkPendingActions.js.map +1 -0
  112. package/dist/src/store/actions/clearErrorLog.d.ts +2 -0
  113. package/dist/src/store/actions/clearErrorLog.js +10 -0
  114. package/dist/src/store/actions/clearErrorLog.js.map +1 -0
  115. package/dist/src/store/actions/createWallet.d.ts +7 -0
  116. package/dist/src/store/actions/createWallet.js +90 -0
  117. package/dist/src/store/actions/createWallet.js.map +1 -0
  118. package/dist/src/store/actions/createWallet.test.d.ts +1 -0
  119. package/dist/src/store/actions/createWallet.test.js +41 -0
  120. package/dist/src/store/actions/createWallet.test.js.map +1 -0
  121. package/dist/src/store/actions/customChainSettings.d.ts +15 -0
  122. package/dist/src/store/actions/customChainSettings.js +37 -0
  123. package/dist/src/store/actions/customChainSettings.js.map +1 -0
  124. package/dist/src/store/actions/disableAssets.d.ts +7 -0
  125. package/dist/src/store/actions/disableAssets.js +28 -0
  126. package/dist/src/store/actions/disableAssets.js.map +1 -0
  127. package/dist/src/store/actions/disableEthereumInjection.d.ts +2 -0
  128. package/dist/src/store/actions/disableEthereumInjection.js +11 -0
  129. package/dist/src/store/actions/disableEthereumInjection.js.map +1 -0
  130. package/dist/src/store/actions/disableEthereumInjection.test.d.ts +1 -0
  131. package/dist/src/store/actions/disableEthereumInjection.test.js +24 -0
  132. package/dist/src/store/actions/disableEthereumInjection.test.js.map +1 -0
  133. package/dist/src/store/actions/enableAssets.d.ts +7 -0
  134. package/dist/src/store/actions/enableAssets.js +65 -0
  135. package/dist/src/store/actions/enableAssets.js.map +1 -0
  136. package/dist/src/store/actions/enableAssets.test.d.ts +1 -0
  137. package/dist/src/store/actions/enableAssets.test.js +37 -0
  138. package/dist/src/store/actions/enableAssets.test.js.map +1 -0
  139. package/dist/src/store/actions/enableDisableAssets.test.d.ts +1 -0
  140. package/dist/src/store/actions/enableDisableAssets.test.js +79 -0
  141. package/dist/src/store/actions/enableDisableAssets.test.js.map +1 -0
  142. package/dist/src/store/actions/enableEthereumInjection.d.ts +2 -0
  143. package/dist/src/store/actions/enableEthereumInjection.js +11 -0
  144. package/dist/src/store/actions/enableEthereumInjection.js.map +1 -0
  145. package/dist/src/store/actions/exportPrivateKey.d.ts +9 -0
  146. package/dist/src/store/actions/exportPrivateKey.js +12 -0
  147. package/dist/src/store/actions/exportPrivateKey.js.map +1 -0
  148. package/dist/src/store/actions/exportPrivateKey.test.d.ts +1 -0
  149. package/dist/src/store/actions/exportPrivateKey.test.js +36 -0
  150. package/dist/src/store/actions/exportPrivateKey.test.js.map +1 -0
  151. package/dist/src/store/actions/fetchTokenDetails.d.ts +11 -0
  152. package/dist/src/store/actions/fetchTokenDetails.js +22 -0
  153. package/dist/src/store/actions/fetchTokenDetails.js.map +1 -0
  154. package/dist/src/store/actions/forgetDappConnections.d.ts +2 -0
  155. package/dist/src/store/actions/forgetDappConnections.js +11 -0
  156. package/dist/src/store/actions/forgetDappConnections.js.map +1 -0
  157. package/dist/src/store/actions/getLockForAsset.d.ts +8 -0
  158. package/dist/src/store/actions/getLockForAsset.js +34 -0
  159. package/dist/src/store/actions/getLockForAsset.js.map +1 -0
  160. package/dist/src/store/actions/getQuotes.d.ts +13 -0
  161. package/dist/src/store/actions/getQuotes.js +70 -0
  162. package/dist/src/store/actions/getQuotes.js.map +1 -0
  163. package/dist/src/store/actions/getQuotes.test.d.ts +1 -0
  164. package/dist/src/store/actions/getQuotes.test.js +30 -0
  165. package/dist/src/store/actions/getQuotes.test.js.map +1 -0
  166. package/dist/src/store/actions/getUnusedAddresses.d.ts +8 -0
  167. package/dist/src/store/actions/getUnusedAddresses.js +51 -0
  168. package/dist/src/store/actions/getUnusedAddresses.js.map +1 -0
  169. package/dist/src/store/actions/hardware-wallet/getLedgerAccounts.d.ts +16 -0
  170. package/dist/src/store/actions/hardware-wallet/getLedgerAccounts.js +57 -0
  171. package/dist/src/store/actions/hardware-wallet/getLedgerAccounts.js.map +1 -0
  172. package/dist/src/store/actions/hardware-wallet/index.d.ts +1 -0
  173. package/dist/src/store/actions/hardware-wallet/index.js +5 -0
  174. package/dist/src/store/actions/hardware-wallet/index.js.map +1 -0
  175. package/dist/src/store/actions/index.d.ts +47 -0
  176. package/dist/src/store/actions/index.js +51 -0
  177. package/dist/src/store/actions/index.js.map +1 -0
  178. package/dist/src/store/actions/initializeAddresses.d.ts +6 -0
  179. package/dist/src/store/actions/initializeAddresses.js +26 -0
  180. package/dist/src/store/actions/initializeAddresses.js.map +1 -0
  181. package/dist/src/store/actions/initializeAddresses.test.d.ts +1 -0
  182. package/dist/src/store/actions/initializeAddresses.test.js +58 -0
  183. package/dist/src/store/actions/initializeAddresses.test.js.map +1 -0
  184. package/dist/src/store/actions/lockWallet.d.ts +2 -0
  185. package/dist/src/store/actions/lockWallet.js +11 -0
  186. package/dist/src/store/actions/lockWallet.js.map +1 -0
  187. package/dist/src/store/actions/lockWallet.test.d.ts +1 -0
  188. package/dist/src/store/actions/lockWallet.test.js +24 -0
  189. package/dist/src/store/actions/lockWallet.test.js.map +1 -0
  190. package/dist/src/store/actions/logError.d.ts +3 -0
  191. package/dist/src/store/actions/logError.js +10 -0
  192. package/dist/src/store/actions/logError.js.map +1 -0
  193. package/dist/src/store/actions/logError.test.d.ts +1 -0
  194. package/dist/src/store/actions/logError.test.js +27 -0
  195. package/dist/src/store/actions/logError.test.js.map +1 -0
  196. package/dist/src/store/actions/newSwap.d.ts +12 -0
  197. package/dist/src/store/actions/newSwap.js +34 -0
  198. package/dist/src/store/actions/newSwap.js.map +1 -0
  199. package/dist/src/store/actions/performNextAction/index.d.ts +7 -0
  200. package/dist/src/store/actions/performNextAction/index.js +65 -0
  201. package/dist/src/store/actions/performNextAction/index.js.map +1 -0
  202. package/dist/src/store/actions/performNextAction/send.d.ts +7 -0
  203. package/dist/src/store/actions/performNextAction/send.js +54 -0
  204. package/dist/src/store/actions/performNextAction/send.js.map +1 -0
  205. package/dist/src/store/actions/performNextAction/sendNFT.d.ts +7 -0
  206. package/dist/src/store/actions/performNextAction/sendNFT.js +50 -0
  207. package/dist/src/store/actions/performNextAction/sendNFT.js.map +1 -0
  208. package/dist/src/store/actions/performNextAction/utils.d.ts +11 -0
  209. package/dist/src/store/actions/performNextAction/utils.js +42 -0
  210. package/dist/src/store/actions/performNextAction/utils.js.map +1 -0
  211. package/dist/src/store/actions/proxyMutation.d.ts +5 -0
  212. package/dist/src/store/actions/proxyMutation.js +9 -0
  213. package/dist/src/store/actions/proxyMutation.js.map +1 -0
  214. package/dist/src/store/actions/removeCustomToken.d.ts +7 -0
  215. package/dist/src/store/actions/removeCustomToken.js +11 -0
  216. package/dist/src/store/actions/removeCustomToken.js.map +1 -0
  217. package/dist/src/store/actions/retrySwap.d.ts +5 -0
  218. package/dist/src/store/actions/retrySwap.js +23 -0
  219. package/dist/src/store/actions/retrySwap.js.map +1 -0
  220. package/dist/src/store/actions/sendNFTTransaction.d.ts +4 -0
  221. package/dist/src/store/actions/sendNFTTransaction.js +47 -0
  222. package/dist/src/store/actions/sendNFTTransaction.js.map +1 -0
  223. package/dist/src/store/actions/sendTransaction.d.ts +17 -0
  224. package/dist/src/store/actions/sendTransaction.js +51 -0
  225. package/dist/src/store/actions/sendTransaction.js.map +1 -0
  226. package/dist/src/store/actions/sendTransaction.test.d.ts +1 -0
  227. package/dist/src/store/actions/sendTransaction.test.js +80 -0
  228. package/dist/src/store/actions/sendTransaction.test.js.map +1 -0
  229. package/dist/src/store/actions/setEthereumInjectionChain.d.ts +5 -0
  230. package/dist/src/store/actions/setEthereumInjectionChain.js +11 -0
  231. package/dist/src/store/actions/setEthereumInjectionChain.js.map +1 -0
  232. package/dist/src/store/actions/setEthereumInjectionChain.test.d.ts +1 -0
  233. package/dist/src/store/actions/setEthereumInjectionChain.test.js +20 -0
  234. package/dist/src/store/actions/setEthereumInjectionChain.test.js.map +1 -0
  235. package/dist/src/store/actions/setWhatsNewModalVersion.d.ts +4 -0
  236. package/dist/src/store/actions/setWhatsNewModalVersion.js +10 -0
  237. package/dist/src/store/actions/setWhatsNewModalVersion.js.map +1 -0
  238. package/dist/src/store/actions/setWhatsNewModalVersion.test.d.ts +1 -0
  239. package/dist/src/store/actions/setWhatsNewModalVersion.test.js +24 -0
  240. package/dist/src/store/actions/setWhatsNewModalVersion.test.js.map +1 -0
  241. package/dist/src/store/actions/showNotification.d.ts +2 -0
  242. package/dist/src/store/actions/showNotification.js +10 -0
  243. package/dist/src/store/actions/showNotification.js.map +1 -0
  244. package/dist/src/store/actions/toggleExperiment.d.ts +5 -0
  245. package/dist/src/store/actions/toggleExperiment.js +10 -0
  246. package/dist/src/store/actions/toggleExperiment.js.map +1 -0
  247. package/dist/src/store/actions/toggleExperiment.test.d.ts +1 -0
  248. package/dist/src/store/actions/toggleExperiment.test.js +34 -0
  249. package/dist/src/store/actions/toggleExperiment.test.js.map +1 -0
  250. package/dist/src/store/actions/toggleNFTStarred.d.ts +8 -0
  251. package/dist/src/store/actions/toggleNFTStarred.js +10 -0
  252. package/dist/src/store/actions/toggleNFTStarred.js.map +1 -0
  253. package/dist/src/store/actions/unlockWallet.d.ts +4 -0
  254. package/dist/src/store/actions/unlockWallet.js +22 -0
  255. package/dist/src/store/actions/unlockWallet.js.map +1 -0
  256. package/dist/src/store/actions/updateAccountBalance.d.ts +7 -0
  257. package/dist/src/store/actions/updateAccountBalance.js +29 -0
  258. package/dist/src/store/actions/updateAccountBalance.js.map +1 -0
  259. package/dist/src/store/actions/updateBalances.d.ts +9 -0
  260. package/dist/src/store/actions/updateBalances.js +169 -0
  261. package/dist/src/store/actions/updateBalances.js.map +1 -0
  262. package/dist/src/store/actions/updateBalances.test.d.ts +1 -0
  263. package/dist/src/store/actions/updateBalances.test.js +43 -0
  264. package/dist/src/store/actions/updateBalances.test.js.map +1 -0
  265. package/dist/src/store/actions/updateCurrenciesInfo.d.ts +5 -0
  266. package/dist/src/store/actions/updateCurrenciesInfo.js +14 -0
  267. package/dist/src/store/actions/updateCurrenciesInfo.js.map +1 -0
  268. package/dist/src/store/actions/updateFees.d.ts +6 -0
  269. package/dist/src/store/actions/updateFees.js +16 -0
  270. package/dist/src/store/actions/updateFees.js.map +1 -0
  271. package/dist/src/store/actions/updateFees.test.d.ts +1 -0
  272. package/dist/src/store/actions/updateFees.test.js +86 -0
  273. package/dist/src/store/actions/updateFees.test.js.map +1 -0
  274. package/dist/src/store/actions/updateFiatRates.d.ts +5 -0
  275. package/dist/src/store/actions/updateFiatRates.js +15 -0
  276. package/dist/src/store/actions/updateFiatRates.js.map +1 -0
  277. package/dist/src/store/actions/updateFiatRates.test.d.ts +1 -0
  278. package/dist/src/store/actions/updateFiatRates.test.js +43 -0
  279. package/dist/src/store/actions/updateFiatRates.test.js.map +1 -0
  280. package/dist/src/store/actions/updateMarketData.d.ts +8 -0
  281. package/dist/src/store/actions/updateMarketData.js +28 -0
  282. package/dist/src/store/actions/updateMarketData.js.map +1 -0
  283. package/dist/src/store/actions/updateMarketData.test.d.ts +1 -0
  284. package/dist/src/store/actions/updateMarketData.test.js +49 -0
  285. package/dist/src/store/actions/updateMarketData.test.js.map +1 -0
  286. package/dist/src/store/actions/updateNFTs.d.ts +7 -0
  287. package/dist/src/store/actions/updateNFTs.js +39 -0
  288. package/dist/src/store/actions/updateNFTs.js.map +1 -0
  289. package/dist/src/store/actions/updateNFTs.test.d.ts +1 -0
  290. package/dist/src/store/actions/updateNFTs.test.js +32 -0
  291. package/dist/src/store/actions/updateNFTs.test.js.map +1 -0
  292. package/dist/src/store/actions/updateTransactionFee.d.ts +11 -0
  293. package/dist/src/store/actions/updateTransactionFee.js +81 -0
  294. package/dist/src/store/actions/updateTransactionFee.js.map +1 -0
  295. package/dist/src/store/broker/notification.d.ts +4 -0
  296. package/dist/src/store/broker/notification.js +84 -0
  297. package/dist/src/store/broker/notification.js.map +1 -0
  298. package/dist/src/store/getters.d.ts +59 -0
  299. package/dist/src/store/getters.js +350 -0
  300. package/dist/src/store/getters.js.map +1 -0
  301. package/dist/src/store/index.d.ts +3524 -0
  302. package/dist/src/store/index.js +24 -0
  303. package/dist/src/store/index.js.map +1 -0
  304. package/dist/src/store/migrations/10_analytics_settings.d.ts +4 -0
  305. package/dist/src/store/migrations/10_analytics_settings.js +19 -0
  306. package/dist/src/store/migrations/10_analytics_settings.js.map +1 -0
  307. package/dist/src/store/migrations/11_12_rsk_legacy_derivation_path.d.ts +8 -0
  308. package/dist/src/store/migrations/11_12_rsk_legacy_derivation_path.js +22 -0
  309. package/dist/src/store/migrations/11_12_rsk_legacy_derivation_path.js.map +1 -0
  310. package/dist/src/store/migrations/13_rsk_fish_token.d.ts +4 -0
  311. package/dist/src/store/migrations/13_rsk_fish_token.js +19 -0
  312. package/dist/src/store/migrations/13_rsk_fish_token.js.map +1 -0
  313. package/dist/src/store/migrations/14_account_set_derivation_path.d.ts +4 -0
  314. package/dist/src/store/migrations/14_account_set_derivation_path.js +56 -0
  315. package/dist/src/store/migrations/14_account_set_derivation_path.js.map +1 -0
  316. package/dist/src/store/migrations/15_accounts_chains_set_enabled.d.ts +4 -0
  317. package/dist/src/store/migrations/15_accounts_chains_set_enabled.js +25 -0
  318. package/dist/src/store/migrations/15_accounts_chains_set_enabled.js.map +1 -0
  319. package/dist/src/store/migrations/16_enable_terra_chain.d.ts +4 -0
  320. package/dist/src/store/migrations/16_enable_terra_chain.js +10 -0
  321. package/dist/src/store/migrations/16_enable_terra_chain.js.map +1 -0
  322. package/dist/src/store/migrations/17_remove_injection_enabled.d.ts +4 -0
  323. package/dist/src/store/migrations/17_remove_injection_enabled.js +12 -0
  324. package/dist/src/store/migrations/17_remove_injection_enabled.js.map +1 -0
  325. package/dist/src/store/migrations/18_enable_avalanche_chain.d.ts +4 -0
  326. package/dist/src/store/migrations/18_enable_avalanche_chain.js +10 -0
  327. package/dist/src/store/migrations/18_enable_avalanche_chain.js.map +1 -0
  328. package/dist/src/store/migrations/19_remove_existing_ledger_accounts.d.ts +4 -0
  329. package/dist/src/store/migrations/19_remove_existing_ledger_accounts.js +25 -0
  330. package/dist/src/store/migrations/19_remove_existing_ledger_accounts.js.map +1 -0
  331. package/dist/src/store/migrations/19_remove_existing_ledger_accounts.state.pre.json +1944 -0
  332. package/dist/src/store/migrations/19_remove_existing_ledger_accounts_test.d.ts +1 -0
  333. package/dist/src/store/migrations/19_remove_existing_ledger_accounts_test.js +7 -0
  334. package/dist/src/store/migrations/19_remove_existing_ledger_accounts_test.js.map +1 -0
  335. package/dist/src/store/migrations/1_first_migration.d.ts +4 -0
  336. package/dist/src/store/migrations/1_first_migration.js +11 -0
  337. package/dist/src/store/migrations/1_first_migration.js.map +1 -0
  338. package/dist/src/store/migrations/20_fix_accounts.d.ts +4 -0
  339. package/dist/src/store/migrations/20_fix_accounts.js +68 -0
  340. package/dist/src/store/migrations/20_fix_accounts.js.map +1 -0
  341. package/dist/src/store/migrations/21_enable_solana_chain.d.ts +4 -0
  342. package/dist/src/store/migrations/21_enable_solana_chain.js +10 -0
  343. package/dist/src/store/migrations/21_enable_solana_chain.js.map +1 -0
  344. package/dist/src/store/migrations/22_enable_optimism_chain.d.ts +4 -0
  345. package/dist/src/store/migrations/22_enable_optimism_chain.js +10 -0
  346. package/dist/src/store/migrations/22_enable_optimism_chain.js.map +1 -0
  347. package/dist/src/store/migrations/2_set_default_assets.d.ts +4 -0
  348. package/dist/src/store/migrations/2_set_default_assets.js +20 -0
  349. package/dist/src/store/migrations/2_set_default_assets.js.map +1 -0
  350. package/dist/src/store/migrations/3_add_network_custom_tokens.d.ts +4 -0
  351. package/dist/src/store/migrations/3_add_network_custom_tokens.js +21 -0
  352. package/dist/src/store/migrations/3_add_network_custom_tokens.js.map +1 -0
  353. package/dist/src/store/migrations/4_fix_rsk_token_injected_asset.d.ts +4 -0
  354. package/dist/src/store/migrations/4_fix_rsk_token_injected_asset.js +15 -0
  355. package/dist/src/store/migrations/4_fix_rsk_token_injected_asset.js.map +1 -0
  356. package/dist/src/store/migrations/5_multiple_account_support.d.ts +4 -0
  357. package/dist/src/store/migrations/5_multiple_account_support.js +96 -0
  358. package/dist/src/store/migrations/5_multiple_account_support.js.map +1 -0
  359. package/dist/src/store/migrations/6_use_ledger_live_default.d.ts +4 -0
  360. package/dist/src/store/migrations/6_use_ledger_live_default.js +11 -0
  361. package/dist/src/store/migrations/6_use_ledger_live_default.js.map +1 -0
  362. package/dist/src/store/migrations/7_multi_provider_swaps.d.ts +4 -0
  363. package/dist/src/store/migrations/7_multi_provider_swaps.js +27 -0
  364. package/dist/src/store/migrations/7_multi_provider_swaps.js.map +1 -0
  365. package/dist/src/store/migrations/8_remove_use_ledger_live.d.ts +4 -0
  366. package/dist/src/store/migrations/8_remove_use_ledger_live.js +12 -0
  367. package/dist/src/store/migrations/8_remove_use_ledger_live.js.map +1 -0
  368. package/dist/src/store/migrations/9_inject_ethereum_asset_chain.d.ts +4 -0
  369. package/dist/src/store/migrations/9_inject_ethereum_asset_chain.js +14 -0
  370. package/dist/src/store/migrations/9_inject_ethereum_asset_chain.js.map +1 -0
  371. package/dist/src/store/migrations/before_after_migration_script.test.d.ts +1 -0
  372. package/dist/src/store/migrations/before_after_migration_script.test.js +92 -0
  373. package/dist/src/store/migrations/before_after_migration_script.test.js.map +1 -0
  374. package/dist/src/store/migrations/enable_chain.d.ts +3 -0
  375. package/dist/src/store/migrations/enable_chain.js +71 -0
  376. package/dist/src/store/migrations/enable_chain.js.map +1 -0
  377. package/dist/src/store/migrations/index.d.ts +5 -0
  378. package/dist/src/store/migrations/index.js +78 -0
  379. package/dist/src/store/migrations/index.js.map +1 -0
  380. package/dist/src/store/migrations/migration_script.test.d.ts +1 -0
  381. package/dist/src/store/migrations/migration_script.test.js +59 -0
  382. package/dist/src/store/migrations/migration_script.test.js.map +1 -0
  383. package/dist/src/store/mutations.d.ts +209 -0
  384. package/dist/src/store/mutations.js +348 -0
  385. package/dist/src/store/mutations.js.map +1 -0
  386. package/dist/src/store/state.d.ts +3 -0
  387. package/dist/src/store/state.js +46 -0
  388. package/dist/src/store/state.js.map +1 -0
  389. package/dist/src/store/types.d.ts +249 -0
  390. package/dist/src/store/types.js +64 -0
  391. package/dist/src/store/types.js.map +1 -0
  392. package/dist/src/store/utils.d.ts +38 -0
  393. package/dist/src/store/utils.js +194 -0
  394. package/dist/src/store/utils.js.map +1 -0
  395. package/dist/src/swaps/EvmSwapProvider.d.ts +32 -0
  396. package/dist/src/swaps/EvmSwapProvider.js +118 -0
  397. package/dist/src/swaps/EvmSwapProvider.js.map +1 -0
  398. package/dist/src/swaps/SwapProvider.d.ts +35 -0
  399. package/dist/src/swaps/SwapProvider.js +89 -0
  400. package/dist/src/swaps/SwapProvider.js.map +1 -0
  401. package/dist/src/swaps/astroport/AstroportSwapProvider.d.ts +67 -0
  402. package/dist/src/swaps/astroport/AstroportSwapProvider.js +251 -0
  403. package/dist/src/swaps/astroport/AstroportSwapProvider.js.map +1 -0
  404. package/dist/src/swaps/astroport/info.json +7 -0
  405. package/dist/src/swaps/astroport/queries.d.ts +108 -0
  406. package/dist/src/swaps/astroport/queries.js +227 -0
  407. package/dist/src/swaps/astroport/queries.js.map +1 -0
  408. package/dist/src/swaps/debridge/DeBridgeSwapProvider.d.ts +98 -0
  409. package/dist/src/swaps/debridge/DeBridgeSwapProvider.js +553 -0
  410. package/dist/src/swaps/debridge/DeBridgeSwapProvider.js.map +1 -0
  411. package/dist/src/swaps/debridge/abi/DeBridgeGate.json +1958 -0
  412. package/dist/src/swaps/debridge/abi/SignatureVerifier.json +925 -0
  413. package/dist/src/swaps/debridge/info.json +13 -0
  414. package/dist/src/swaps/fastbtc/FastBTCDepositSwapProvider.d.ts +103 -0
  415. package/dist/src/swaps/fastbtc/FastBTCDepositSwapProvider.js +292 -0
  416. package/dist/src/swaps/fastbtc/FastBTCDepositSwapProvider.js.map +1 -0
  417. package/dist/src/swaps/fastbtc/FastBTCWithdrawSwapProvider.d.ts +108 -0
  418. package/dist/src/swaps/fastbtc/FastBTCWithdrawSwapProvider.js +306 -0
  419. package/dist/src/swaps/fastbtc/FastBTCWithdrawSwapProvider.js.map +1 -0
  420. package/dist/src/swaps/fastbtc/fastBtcBridgeContract.d.ts +19 -0
  421. package/dist/src/swaps/fastbtc/fastBtcBridgeContract.js +24 -0
  422. package/dist/src/swaps/fastbtc/fastBtcBridgeContract.js.map +1 -0
  423. package/dist/src/swaps/fastbtc/info.json +7 -0
  424. package/dist/src/swaps/hop/HopSwapProvider.d.ts +124 -0
  425. package/dist/src/swaps/hop/HopSwapProvider.js +479 -0
  426. package/dist/src/swaps/hop/HopSwapProvider.js.map +1 -0
  427. package/dist/src/swaps/hop/info.json +12 -0
  428. package/dist/src/swaps/hop/queries.d.ts +2 -0
  429. package/dist/src/swaps/hop/queries.js +61 -0
  430. package/dist/src/swaps/hop/queries.js.map +1 -0
  431. package/dist/src/swaps/jupiter/JupiterSwapProvider.d.ts +46 -0
  432. package/dist/src/swaps/jupiter/JupiterSwapProvider.js +189 -0
  433. package/dist/src/swaps/jupiter/JupiterSwapProvider.js.map +1 -0
  434. package/dist/src/swaps/jupiter/info.json +7 -0
  435. package/dist/src/swaps/lifi/LifiSwapProvider.d.ts +76 -0
  436. package/dist/src/swaps/lifi/LifiSwapProvider.js +313 -0
  437. package/dist/src/swaps/lifi/LifiSwapProvider.js.map +1 -0
  438. package/dist/src/swaps/lifi/info.json +7 -0
  439. package/dist/src/swaps/liquality/LiqualitySwapProvider.d.ts +104 -0
  440. package/dist/src/swaps/liquality/LiqualitySwapProvider.js +704 -0
  441. package/dist/src/swaps/liquality/LiqualitySwapProvider.js.map +1 -0
  442. package/dist/src/swaps/liquality/info.json +7 -0
  443. package/dist/src/swaps/liqualityboost/liqualityBoostERC20toNative/LiqualityBoostERC20toNative.d.ts +124 -0
  444. package/dist/src/swaps/liqualityboost/liqualityBoostERC20toNative/LiqualityBoostERC20toNative.js +239 -0
  445. package/dist/src/swaps/liqualityboost/liqualityBoostERC20toNative/LiqualityBoostERC20toNative.js.map +1 -0
  446. package/dist/src/swaps/liqualityboost/liqualityBoostERC20toNative/info.json +7 -0
  447. package/dist/src/swaps/liqualityboost/liqualityBoostNativeToERC20/LiqualityBoostNativeToERC20.d.ts +52 -0
  448. package/dist/src/swaps/liqualityboost/liqualityBoostNativeToERC20/LiqualityBoostNativeToERC20.js +213 -0
  449. package/dist/src/swaps/liqualityboost/liqualityBoostNativeToERC20/LiqualityBoostNativeToERC20.js.map +1 -0
  450. package/dist/src/swaps/liqualityboost/liqualityBoostNativeToERC20/info.json +7 -0
  451. package/dist/src/swaps/liqualityboost/types.d.ts +17 -0
  452. package/dist/src/swaps/liqualityboost/types.js +3 -0
  453. package/dist/src/swaps/liqualityboost/types.js.map +1 -0
  454. package/dist/src/swaps/oneinch/OneinchSwapProvider.d.ts +86 -0
  455. package/dist/src/swaps/oneinch/OneinchSwapProvider.js +369 -0
  456. package/dist/src/swaps/oneinch/OneinchSwapProvider.js.map +1 -0
  457. package/dist/src/swaps/oneinch/info.json +13 -0
  458. package/dist/src/swaps/sovryn/SovrynSwapProvider.d.ts +110 -0
  459. package/dist/src/swaps/sovryn/SovrynSwapProvider.js +369 -0
  460. package/dist/src/swaps/sovryn/SovrynSwapProvider.js.map +1 -0
  461. package/dist/src/swaps/sovryn/info.json +7 -0
  462. package/dist/src/swaps/teleswap/TeleSwapSwapProvider.d.ts +167 -0
  463. package/dist/src/swaps/teleswap/TeleSwapSwapProvider.js +874 -0
  464. package/dist/src/swaps/teleswap/TeleSwapSwapProvider.js.map +1 -0
  465. package/dist/src/swaps/teleswap/info.json +7 -0
  466. package/dist/src/swaps/thorchain/ThorchainSwapProvider.d.ts +194 -0
  467. package/dist/src/swaps/thorchain/ThorchainSwapProvider.js +534 -0
  468. package/dist/src/swaps/thorchain/ThorchainSwapProvider.js.map +1 -0
  469. package/dist/src/swaps/thorchain/info.json +7 -0
  470. package/dist/src/swaps/types.d.ts +87 -0
  471. package/dist/src/swaps/types.js +9 -0
  472. package/dist/src/swaps/types.js.map +1 -0
  473. package/dist/src/swaps/uniswap/UniswapSwapProvider.d.ts +117 -0
  474. package/dist/src/swaps/uniswap/UniswapSwapProvider.js +438 -0
  475. package/dist/src/swaps/uniswap/UniswapSwapProvider.js.map +1 -0
  476. package/dist/src/swaps/uniswap/info.json +7 -0
  477. package/dist/src/swaps/utils.d.ts +92 -0
  478. package/dist/src/swaps/utils.js +57 -0
  479. package/dist/src/swaps/utils.js.map +1 -0
  480. package/dist/src/tsconfig.json +30 -0
  481. package/dist/src/types.d.ts +29 -0
  482. package/dist/src/types.js +3 -0
  483. package/dist/src/types.js.map +1 -0
  484. package/dist/src/utils/accounts.d.ts +16 -0
  485. package/dist/src/utils/accounts.js +89 -0
  486. package/dist/src/utils/accounts.js.map +1 -0
  487. package/dist/src/utils/address.d.ts +8 -0
  488. package/dist/src/utils/address.js +17 -0
  489. package/dist/src/utils/address.js.map +1 -0
  490. package/dist/src/utils/address.test.d.ts +1 -0
  491. package/dist/src/utils/address.test.js +12 -0
  492. package/dist/src/utils/address.test.js.map +1 -0
  493. package/dist/src/utils/asset.d.ts +22 -0
  494. package/dist/src/utils/asset.js +198 -0
  495. package/dist/src/utils/asset.js.map +1 -0
  496. package/dist/src/utils/asset.test.d.ts +1 -0
  497. package/dist/src/utils/asset.test.js +42 -0
  498. package/dist/src/utils/asset.test.js.map +1 -0
  499. package/dist/src/utils/chainify.d.ts +3 -0
  500. package/dist/src/utils/chainify.js +41 -0
  501. package/dist/src/utils/chainify.js.map +1 -0
  502. package/dist/src/utils/coinFormatter.d.ts +13 -0
  503. package/dist/src/utils/coinFormatter.js +58 -0
  504. package/dist/src/utils/coinFormatter.js.map +1 -0
  505. package/dist/src/utils/crypto.d.ts +6 -0
  506. package/dist/src/utils/crypto.js +70 -0
  507. package/dist/src/utils/crypto.js.map +1 -0
  508. package/dist/src/utils/cryptoassets.d.ts +5 -0
  509. package/dist/src/utils/cryptoassets.js +26 -0
  510. package/dist/src/utils/cryptoassets.js.map +1 -0
  511. package/dist/src/utils/derivationPath.d.ts +6 -0
  512. package/dist/src/utils/derivationPath.js +75 -0
  513. package/dist/src/utils/derivationPath.js.map +1 -0
  514. package/dist/src/utils/derivationPath.spec.d.ts +1 -0
  515. package/dist/src/utils/derivationPath.spec.js +37 -0
  516. package/dist/src/utils/derivationPath.spec.js.map +1 -0
  517. package/dist/src/utils/export.d.ts +5 -0
  518. package/dist/src/utils/export.js +24 -0
  519. package/dist/src/utils/export.js.map +1 -0
  520. package/dist/src/utils/fees.d.ts +43 -0
  521. package/dist/src/utils/fees.js +222 -0
  522. package/dist/src/utils/fees.js.map +1 -0
  523. package/dist/src/utils/fees.test.d.ts +1 -0
  524. package/dist/src/utils/fees.test.js +40 -0
  525. package/dist/src/utils/fees.test.js.map +1 -0
  526. package/dist/src/utils/fetchTokenDetails.d.ts +1 -0
  527. package/dist/src/utils/fetchTokenDetails.js +19 -0
  528. package/dist/src/utils/fetchTokenDetails.js.map +1 -0
  529. package/dist/src/utils/history.d.ts +66 -0
  530. package/dist/src/utils/history.js +135 -0
  531. package/dist/src/utils/history.js.map +1 -0
  532. package/dist/src/utils/isTransactionNotFoundError.d.ts +1 -0
  533. package/dist/src/utils/isTransactionNotFoundError.js +16 -0
  534. package/dist/src/utils/isTransactionNotFoundError.js.map +1 -0
  535. package/dist/src/utils/ledger.d.ts +12 -0
  536. package/dist/src/utils/ledger.js +38 -0
  537. package/dist/src/utils/ledger.js.map +1 -0
  538. package/dist/src/utils/moment.d.ts +2 -0
  539. package/dist/src/utils/moment.js +8 -0
  540. package/dist/src/utils/moment.js.map +1 -0
  541. package/dist/src/utils/networks.d.ts +10 -0
  542. package/dist/src/utils/networks.js +43 -0
  543. package/dist/src/utils/networks.js.map +1 -0
  544. package/dist/src/utils/parseTokenTx.d.ts +2 -0
  545. package/dist/src/utils/parseTokenTx.js +10 -0
  546. package/dist/src/utils/parseTokenTx.js.map +1 -0
  547. package/dist/src/utils/quotes.d.ts +5 -0
  548. package/dist/src/utils/quotes.js +20 -0
  549. package/dist/src/utils/quotes.js.map +1 -0
  550. package/dist/src/utils/quotes.test.d.ts +1 -0
  551. package/dist/src/utils/quotes.test.js +85 -0
  552. package/dist/src/utils/quotes.test.js.map +1 -0
  553. package/dist/src/utils/timeline.d.ts +71 -0
  554. package/dist/src/utils/timeline.js +176 -0
  555. package/dist/src/utils/timeline.js.map +1 -0
  556. package/dist/src/walletOptions/defaultOptions.d.ts +3 -0
  557. package/dist/src/walletOptions/defaultOptions.js +36 -0
  558. package/dist/src/walletOptions/defaultOptions.js.map +1 -0
  559. package/dist/src/walletOptions/index.d.ts +7 -0
  560. package/dist/src/walletOptions/index.js +11 -0
  561. package/dist/src/walletOptions/index.js.map +1 -0
  562. package/dist/tsconfig.tsbuildinfo +1 -0
  563. package/package.json +76 -0
@@ -0,0 +1,534 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThorchainSwapProvider = exports.ThorchainTxTypes = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const client_1 = require("@yaswap/client");
6
+ const cryptoassets_1 = require("@yaswap/cryptoassets");
7
+ const error_parser_1 = require("@yaswap/error-parser");
8
+ const isTransactionNotFoundError_1 = require("../../utils/isTransactionNotFoundError");
9
+ const asgardex_util_1 = require("@thorchain/asgardex-util");
10
+ const ERC20_json_1 = tslib_1.__importDefault(require("@uniswap/v2-core/build/ERC20.json"));
11
+ const xchain_util_1 = require("@xchainjs/xchain-util");
12
+ const bignumber_js_1 = tslib_1.__importStar(require("bignumber.js"));
13
+ const ethers = tslib_1.__importStar(require("ethers"));
14
+ const lodash_1 = require("lodash");
15
+ const uuid_1 = require("uuid");
16
+ const build_config_1 = tslib_1.__importDefault(require("../../build.config"));
17
+ const store_1 = tslib_1.__importDefault(require("../../store"));
18
+ const utils_1 = require("../../store/actions/performNextAction/utils");
19
+ const asset_1 = require("../../utils/asset");
20
+ const coinFormatter_1 = require("../../utils/coinFormatter");
21
+ const cryptoassets_2 = tslib_1.__importDefault(require("../../utils/cryptoassets"));
22
+ const fees_1 = require("../../utils/fees");
23
+ const SwapProvider_1 = require("../SwapProvider");
24
+ const error_parser_2 = require("@yaswap/error-parser");
25
+ const THORCHAIN_DECIMAL = 8;
26
+ const SAFE_FEE_MULTIPLIER = 1.3;
27
+ const SUPPORTED_CHAINS = [cryptoassets_1.ChainId.Bitcoin, cryptoassets_1.ChainId.Ethereum];
28
+ const OUT_MEMO_TO_STATUS = {
29
+ OUT: 'SUCCESS',
30
+ REFUND: 'REFUNDED',
31
+ };
32
+ const toPoolBalance = (baseAmountString) => (0, xchain_util_1.baseAmount)(baseAmountString, THORCHAIN_DECIMAL);
33
+ const toThorchainAsset = (asset) => {
34
+ return (0, asset_1.isERC20)(asset) ? `ETH.${asset}-${cryptoassets_2.default[asset].contractAddress.toUpperCase()}` : `${asset}.${asset}`;
35
+ };
36
+ const convertBaseAmountDecimal = (amount, decimal) => {
37
+ const decimalDiff = decimal - amount.decimal;
38
+ const amountBN = decimalDiff < 0
39
+ ? amount
40
+ .amount()
41
+ .dividedBy(new bignumber_js_1.default(Math.pow(10, (decimalDiff * -1))))
42
+ .decimalPlaces(0, bignumber_js_1.default.ROUND_DOWN)
43
+ : amount.amount().multipliedBy(new bignumber_js_1.default(Math.pow(10, decimalDiff)));
44
+ return (0, xchain_util_1.baseAmount)(amountBN, decimal);
45
+ };
46
+ var ThorchainTxTypes;
47
+ (function (ThorchainTxTypes) {
48
+ ThorchainTxTypes["SWAP"] = "SWAP";
49
+ })(ThorchainTxTypes = exports.ThorchainTxTypes || (exports.ThorchainTxTypes = {}));
50
+ class ThorchainSwapProvider extends SwapProvider_1.SwapProvider {
51
+ constructor(config) {
52
+ super(config);
53
+ this.feeUnits = {
54
+ [ThorchainTxTypes.SWAP]: {
55
+ ETH: 200000,
56
+ BNB: 200000,
57
+ MATIC: 200000,
58
+ ERC20: 100000 + 200000,
59
+ },
60
+ };
61
+ this._httpClient = new client_1.HttpClient({ baseURL: this.config.thornode });
62
+ this.thorchainAPIErrorParser = (0, error_parser_1.getErrorParser)(error_parser_1.ThorchainAPIErrorParser);
63
+ }
64
+ getSupportedPairs() {
65
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
66
+ return [];
67
+ });
68
+ }
69
+ _getPools() {
70
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
71
+ return this.thorchainAPIErrorParser.wrapAsync(() => this._httpClient.nodeGet('/thorchain/pools'), {});
72
+ });
73
+ }
74
+ _getInboundAddresses() {
75
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
76
+ return this.thorchainAPIErrorParser.wrapAsync(() => this._httpClient.nodeGet('/thorchain/inbound_addresses'), {});
77
+ });
78
+ }
79
+ _getTransaction(hash) {
80
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
81
+ try {
82
+ const hasOx = hash.charAt(0) + hash.charAt(1) === '0x';
83
+ const transactionHash = hasOx ? hash.slice(2) : hash;
84
+ return yield this.thorchainAPIErrorParser.wrapAsync(() => this._httpClient.nodeGet(`/thorchain/tx/${transactionHash}`), {
85
+ txHash: transactionHash,
86
+ });
87
+ }
88
+ catch (e) {
89
+ return null;
90
+ }
91
+ });
92
+ }
93
+ getInboundAddress(chain) {
94
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
95
+ const inboundAddresses = yield this._getInboundAddresses();
96
+ const inboundAddress = inboundAddresses.find((inbound) => inbound.chain === chain);
97
+ if (!inboundAddress)
98
+ throw (0, error_parser_2.createInternalError)(error_parser_2.CUSTOM_ERRORS.NotFound.Thorchain.InboundAddress(chain));
99
+ return inboundAddress;
100
+ });
101
+ }
102
+ getRouterAddress(chain) {
103
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
104
+ const inboundAddress = yield this.getInboundAddress(chain);
105
+ const router = inboundAddress.router;
106
+ if (!router)
107
+ throw (0, error_parser_2.createInternalError)(error_parser_2.CUSTOM_ERRORS.NotFound.Thorchain.RouterAddress(chain));
108
+ return router;
109
+ });
110
+ }
111
+ getOutput({ from, to, fromAmountInUnit, slippage, network, }) {
112
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
113
+ const pools = yield this._getPools();
114
+ const fromPoolData = pools.find((pool) => pool.asset === toThorchainAsset(from));
115
+ const toPoolData = pools.find((pool) => pool.asset === toThorchainAsset(to));
116
+ if (!fromPoolData || !toPoolData)
117
+ return null;
118
+ if (fromPoolData.status.toLowerCase() !== 'available' || toPoolData.status.toLowerCase() !== 'available')
119
+ return null;
120
+ const getPool = (poolData) => {
121
+ return {
122
+ assetBalance: toPoolBalance(poolData.balance_asset),
123
+ runeBalance: toPoolBalance(poolData.balance_rune),
124
+ };
125
+ };
126
+ const fromPool = getPool(fromPoolData);
127
+ const toPool = getPool(toPoolData);
128
+ const baseInputAmount = (0, xchain_util_1.baseAmount)(fromAmountInUnit, cryptoassets_2.default[from].decimals);
129
+ const inputAmount = convertBaseAmountDecimal(baseInputAmount, 8);
130
+ const swapOutput = (0, asgardex_util_1.getDoubleSwapOutput)(inputAmount, fromPool, toPool);
131
+ const baseNetworkFee = yield this.networkFees(to, network);
132
+ if (!baseNetworkFee)
133
+ throw (0, error_parser_2.createInternalError)(error_parser_2.CUSTOM_ERRORS.NotFound.Thorchain.BaseNetworkFee);
134
+ let networkFee = convertBaseAmountDecimal(baseNetworkFee, 8);
135
+ if ((0, asset_1.isERC20)(to)) {
136
+ const poolData = pools.find((pool) => pool.asset === 'ETH.ETH');
137
+ if (!poolData) {
138
+ throw (0, error_parser_2.createInternalError)(error_parser_2.CUSTOM_ERRORS.NotFound.Thorchain.PoolData);
139
+ }
140
+ const ethPool = toThorchainAsset(from) !== 'ETH.ETH' ? getPool(poolData) : fromPool;
141
+ networkFee = (0, asgardex_util_1.getValueOfAsset1InAsset2)(networkFee, ethPool, toPool);
142
+ }
143
+ const receiveFeeInUnit = (0, cryptoassets_1.currencyToUnit)(cryptoassets_2.default[to], (0, xchain_util_1.baseToAsset)(networkFee).amount()).times(SAFE_FEE_MULTIPLIER);
144
+ const toAmountInUnit = (0, cryptoassets_1.currencyToUnit)(cryptoassets_2.default[to], (0, xchain_util_1.baseToAsset)(swapOutput).amount());
145
+ const baseOutputAmount = (0, xchain_util_1.baseAmount)(toAmountInUnit.minus(receiveFeeInUnit), cryptoassets_2.default[to].decimals);
146
+ const slippageCoefficient = new bignumber_js_1.default(1).minus(slippage);
147
+ const minimumOutput = baseOutputAmount.amount().multipliedBy(slippageCoefficient).dp(0);
148
+ return minimumOutput;
149
+ });
150
+ }
151
+ getQuote(quoteRequest) {
152
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
153
+ const { from, to, amount, network } = quoteRequest;
154
+ if (!SUPPORTED_CHAINS.includes(cryptoassets_2.default[from].chain) || !SUPPORTED_CHAINS.includes(cryptoassets_2.default[to].chain))
155
+ return null;
156
+ const min = yield this.getMin(quoteRequest);
157
+ const slippage = new bignumber_js_1.default(amount).gt(min.times(2)) ? 0.03 : 0.05;
158
+ const fromAmountInUnit = (0, cryptoassets_1.currencyToUnit)(cryptoassets_2.default[from], new bignumber_js_1.default(amount));
159
+ const toAmountInUnit = yield this.getOutput({ from, to, fromAmountInUnit, slippage, network });
160
+ if (!toAmountInUnit) {
161
+ return null;
162
+ }
163
+ return {
164
+ fromAmount: fromAmountInUnit.toFixed(),
165
+ toAmount: toAmountInUnit.toFixed(),
166
+ slippage: slippage * 1000,
167
+ };
168
+ });
169
+ }
170
+ networkFees(asset, network) {
171
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
172
+ const assetCode = (0, asset_1.isERC20)(asset)
173
+ ? (0, cryptoassets_1.getChain)(network, cryptoassets_2.default[asset].chain).nativeAsset[0].code
174
+ : cryptoassets_2.default[asset].code;
175
+ const gasRate = (yield this.getInboundAddress(assetCode)).gas_rate;
176
+ if ((0, asset_1.isERC20)(asset) && (0, cryptoassets_1.getChain)(network, cryptoassets_2.default[asset].chain).isEVM) {
177
+ return (0, xchain_util_1.baseAmount)(new bignumber_js_1.default(70000).times(gasRate).times(1000000000).times(3), 18);
178
+ }
179
+ if (assetCode === 'ETH') {
180
+ return (0, xchain_util_1.baseAmount)(new bignumber_js_1.default(38000).times(gasRate).times(1000000000).times(3), 18);
181
+ }
182
+ if (assetCode === 'BTC') {
183
+ return (0, xchain_util_1.baseAmount)(new bignumber_js_1.default(250).times(gasRate).times(3), 8);
184
+ }
185
+ });
186
+ }
187
+ approveTokens({ network, walletId, swap }) {
188
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
189
+ const fromChain = cryptoassets_2.default[swap.from].chain;
190
+ const chainNetwork = (0, cryptoassets_1.getChain)(network, fromChain).network;
191
+ const chainId = chainNetwork.chainId;
192
+ const api = new ethers.providers.InfuraProvider(chainId, build_config_1.default.infuraApiKey);
193
+ const erc20 = new ethers.Contract(cryptoassets_2.default[swap.from].contractAddress, ERC20_json_1.default.abi, api);
194
+ const fromThorchainAsset = (0, xchain_util_1.assetFromString)(toThorchainAsset(swap.from));
195
+ if (!fromThorchainAsset) {
196
+ throw (0, error_parser_2.createInternalError)(error_parser_2.CUSTOM_ERRORS.NotFound.Thorchain.Asset);
197
+ }
198
+ const routerAddress = this.getRouterAddress(fromThorchainAsset.chain);
199
+ const fromAddressRaw = yield this.getSwapAddress(network, walletId, swap.from, swap.toAccountId);
200
+ const fromAddress = (0, cryptoassets_1.getChain)(network, fromChain).formatAddress(fromAddressRaw);
201
+ const allowance = yield erc20.allowance(fromAddress, routerAddress);
202
+ const inputAmount = ethers.BigNumber.from(new bignumber_js_1.default(swap.fromAmount).toFixed());
203
+ if (allowance.gte(inputAmount)) {
204
+ ``;
205
+ return {
206
+ status: 'APPROVE_CONFIRMED',
207
+ };
208
+ }
209
+ const inputAmountHex = inputAmount.toHexString();
210
+ const encodedData = erc20.interface.encodeFunctionData('approve', [routerAddress, inputAmountHex]);
211
+ const client = this.getClient(network, walletId, swap.from, swap.fromAccountId);
212
+ const approveTx = yield client.wallet.sendTransaction({
213
+ to: cryptoassets_2.default[swap.from].contractAddress,
214
+ value: new bignumber_js_1.BigNumber(0),
215
+ data: encodedData,
216
+ fee: swap.fee,
217
+ });
218
+ return {
219
+ status: 'WAITING_FOR_APPROVE_CONFIRMATIONS',
220
+ approveTx,
221
+ approveTxHash: approveTx.hash,
222
+ };
223
+ });
224
+ }
225
+ sendBitcoinSwap({ quote, network, walletId, memo, }) {
226
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
227
+ yield this.sendLedgerNotification(quote.fromAccountId, 'Signing required to complete the swap.');
228
+ const fromThorchainAsset = (0, xchain_util_1.assetFromString)(toThorchainAsset(quote.from));
229
+ if (!fromThorchainAsset) {
230
+ throw (0, error_parser_2.createInternalError)(error_parser_2.CUSTOM_ERRORS.NotFound.Thorchain.Asset);
231
+ }
232
+ const to = (yield this.getInboundAddress(fromThorchainAsset.chain)).address;
233
+ const value = new bignumber_js_1.default(quote.fromAmount);
234
+ const encodedMemo = Buffer.from(memo, 'utf-8').toString('hex');
235
+ const client = this.getClient(network, walletId, quote.from, quote.fromAccountId);
236
+ const fromFundTx = yield client.wallet.sendTransaction({
237
+ to: to,
238
+ value,
239
+ data: encodedMemo,
240
+ fee: quote.fee,
241
+ });
242
+ return fromFundTx;
243
+ });
244
+ }
245
+ sendEthereumSwap({ quote, network, walletId, memo, }) {
246
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
247
+ yield this.sendLedgerNotification(quote.fromAccountId, 'Signing required to complete the swap.');
248
+ const fromThorchainAsset = (0, xchain_util_1.assetFromString)(toThorchainAsset(quote.from));
249
+ if (!fromThorchainAsset) {
250
+ throw (0, error_parser_2.createInternalError)(error_parser_2.CUSTOM_ERRORS.NotFound.Thorchain.Asset);
251
+ }
252
+ const routerAddress = yield this.getRouterAddress(fromThorchainAsset.chain);
253
+ const chainNetwork = (0, cryptoassets_1.getChain)(network, cryptoassets_2.default[quote.from].chain).network;
254
+ const chainId = chainNetwork.chainId;
255
+ const api = new ethers.providers.InfuraProvider(chainId, build_config_1.default.infuraApiKey);
256
+ const tokenAddress = (0, asset_1.isERC20)(quote.from)
257
+ ? cryptoassets_2.default[quote.from].contractAddress
258
+ : '0x0000000000000000000000000000000000000000';
259
+ const thorchainRouter = new ethers.Contract(routerAddress, ['function deposit(address payable vault, address asset, uint amount, string memory memo) external payable'], api);
260
+ const amountHex = ethers.BigNumber.from(new bignumber_js_1.default(quote.fromAmount).toFixed()).toHexString();
261
+ const to = (yield this.getInboundAddress(fromThorchainAsset.chain)).address;
262
+ const encodedData = thorchainRouter.interface.encodeFunctionData('deposit', [to, tokenAddress, amountHex, memo]);
263
+ const value = (0, asset_1.isERC20)(quote.from) ? new bignumber_js_1.BigNumber(0) : new bignumber_js_1.default(quote.fromAmount);
264
+ const client = this.getClient(network, walletId, quote.from, quote.fromAccountId);
265
+ const fromFundTx = yield client.wallet.sendTransaction({
266
+ to: routerAddress,
267
+ value,
268
+ data: encodedData,
269
+ fee: quote.fee,
270
+ });
271
+ return fromFundTx;
272
+ });
273
+ }
274
+ makeMemo({ network, walletId, swap }) {
275
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
276
+ const toChain = cryptoassets_2.default[swap.to].chain;
277
+ const toAddressRaw = yield this.getSwapAddress(network, walletId, swap.to, swap.toAccountId);
278
+ const toAddress = (0, cryptoassets_1.getChain)(network, toChain).formatAddress(toAddressRaw);
279
+ const limit = convertBaseAmountDecimal((0, xchain_util_1.baseAmount)(new bignumber_js_1.default(swap.toAmount), cryptoassets_2.default[swap.to].decimals), 8);
280
+ const thorchainAsset = (0, xchain_util_1.assetFromString)(toThorchainAsset(swap.to));
281
+ if (!thorchainAsset) {
282
+ throw (0, error_parser_2.createInternalError)(error_parser_2.CUSTOM_ERRORS.NotFound.Thorchain.Asset);
283
+ }
284
+ return (0, asgardex_util_1.getSwapMemo)({ asset: thorchainAsset, address: toAddress, limit });
285
+ });
286
+ }
287
+ sendSwap({ network, walletId, swap }) {
288
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
289
+ const memo = yield this.makeMemo({ network, walletId, swap });
290
+ let fromFundTx;
291
+ if (swap.from === 'BTC') {
292
+ fromFundTx = yield this.sendBitcoinSwap({
293
+ quote: swap,
294
+ network,
295
+ walletId,
296
+ memo,
297
+ });
298
+ }
299
+ else if (swap.from === 'ETH' || (0, asset_1.isERC20)(swap.from)) {
300
+ fromFundTx = yield this.sendEthereumSwap({
301
+ quote: swap,
302
+ network,
303
+ walletId,
304
+ memo,
305
+ });
306
+ }
307
+ if (!fromFundTx) {
308
+ throw (0, error_parser_2.createInternalError)(error_parser_2.CUSTOM_ERRORS.FailedAssert.SendTransaction);
309
+ }
310
+ return {
311
+ status: 'WAITING_FOR_SEND_CONFIRMATIONS',
312
+ fromFundTx,
313
+ fromFundHash: fromFundTx.hash,
314
+ };
315
+ });
316
+ }
317
+ newSwap({ network, walletId, quote }) {
318
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
319
+ const approvalRequired = (0, asset_1.isERC20)(quote.from);
320
+ const updates = approvalRequired
321
+ ? yield this.approveTokens({ network, walletId, swap: quote })
322
+ : yield this.sendSwap({ network, walletId, swap: quote });
323
+ return Object.assign({ id: (0, uuid_1.v4)(), fee: quote.fee }, updates);
324
+ });
325
+ }
326
+ estimateFees({ network, walletId, asset, txType, quote, feePrices, max, }) {
327
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
328
+ if (txType === this._txTypes().SWAP && asset === 'BTC') {
329
+ const client = this.getClient(network, walletId, asset, quote.fromAccountId);
330
+ const value = max ? undefined : new bignumber_js_1.default(quote.fromAmount);
331
+ const memo = yield this.makeMemo({ network, walletId, swap: quote });
332
+ const encodedMemo = Buffer.from(memo, 'utf-8').toString('hex');
333
+ const txs = feePrices.map((fee) => ({ to: '', value, data: encodedMemo, fee }));
334
+ const totalFees = yield client.wallet.getTotalFees(txs, max);
335
+ return (0, lodash_1.mapValues)(totalFees, (f) => (0, cryptoassets_1.unitToCurrency)(cryptoassets_2.default[asset], f));
336
+ }
337
+ if (txType in this.feeUnits) {
338
+ const fees = {};
339
+ for (const feePrice of feePrices) {
340
+ fees[feePrice] = (0, fees_1.getTxFee)(this.feeUnits[txType], asset, feePrice);
341
+ }
342
+ return fees;
343
+ }
344
+ return null;
345
+ });
346
+ }
347
+ getMin(quote) {
348
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
349
+ const fiatRates = store_1.default.state.fiatRates;
350
+ let min = new bignumber_js_1.default('0');
351
+ if (fiatRates && fiatRates[quote.from]) {
352
+ min = new bignumber_js_1.default((0, coinFormatter_1.fiatToCrypto)(200, fiatRates[quote.from]));
353
+ }
354
+ return min;
355
+ });
356
+ }
357
+ waitForApproveConfirmations({ swap, network, walletId }) {
358
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
359
+ const client = this.getClient(network, walletId, swap.from, swap.fromAccountId);
360
+ try {
361
+ const tx = yield client.chain.getTransactionByHash(swap.approveTxHash);
362
+ if (tx && tx.confirmations && tx.confirmations > 0) {
363
+ return {
364
+ endTime: Date.now(),
365
+ status: 'APPROVE_CONFIRMED',
366
+ };
367
+ }
368
+ }
369
+ catch (e) {
370
+ if ((0, isTransactionNotFoundError_1.isTransactionNotFoundError)(e))
371
+ console.warn(e);
372
+ else
373
+ throw e;
374
+ }
375
+ });
376
+ }
377
+ waitForSendConfirmations({ swap, network, walletId }) {
378
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
379
+ const client = this.getClient(network, walletId, swap.from, swap.fromAccountId);
380
+ try {
381
+ const tx = yield client.chain.getTransactionByHash(swap.fromFundHash);
382
+ if (tx && tx.confirmations && tx.confirmations > 0) {
383
+ return {
384
+ endTime: Date.now(),
385
+ status: 'WAITING_FOR_RECEIVE',
386
+ };
387
+ }
388
+ }
389
+ catch (e) {
390
+ if ((0, isTransactionNotFoundError_1.isTransactionNotFoundError)(e))
391
+ console.warn(e);
392
+ else
393
+ throw e;
394
+ }
395
+ });
396
+ }
397
+ waitForReceive({ swap, network, walletId }) {
398
+ var _a, _b, _c;
399
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
400
+ try {
401
+ const thorchainTx = yield this._getTransaction(swap.fromFundHash);
402
+ if (thorchainTx) {
403
+ const receiveHash = (_a = thorchainTx.observed_tx.out_hashes) === null || _a === void 0 ? void 0 : _a[0];
404
+ if (receiveHash) {
405
+ const thorchainReceiveTx = yield this._getTransaction(receiveHash);
406
+ if (thorchainReceiveTx) {
407
+ const memo = (_c = (_b = thorchainReceiveTx.observed_tx) === null || _b === void 0 ? void 0 : _b.tx) === null || _c === void 0 ? void 0 : _c.memo;
408
+ const memoAction = memo.split(':')[0];
409
+ let asset;
410
+ let accountId;
411
+ if (memoAction === 'OUT') {
412
+ asset = swap.to;
413
+ accountId = swap.toAccountId;
414
+ }
415
+ else if (memoAction === 'REFUND') {
416
+ asset = swap.from;
417
+ accountId = swap.fromAccountId;
418
+ }
419
+ else {
420
+ throw (0, error_parser_2.createInternalError)(error_parser_2.CUSTOM_ERRORS.Invalid.ThorchainMemoAction(memoAction));
421
+ }
422
+ const client = this.getClient(network, walletId, asset, accountId);
423
+ const receiveTx = yield client.chain.getTransactionByHash(receiveHash);
424
+ if (receiveTx && receiveTx.confirmations && receiveTx.confirmations > 0) {
425
+ this.updateBalances(network, walletId, [accountId]);
426
+ const status = OUT_MEMO_TO_STATUS[memoAction];
427
+ return {
428
+ receiveTxHash: receiveTx.hash,
429
+ receiveTx: receiveTx,
430
+ endTime: Date.now(),
431
+ status,
432
+ };
433
+ }
434
+ else {
435
+ return {
436
+ receiveTxHash: receiveTx.hash,
437
+ receiveTx: receiveTx,
438
+ };
439
+ }
440
+ }
441
+ }
442
+ }
443
+ }
444
+ catch (e) {
445
+ console.error(`Thorchain waiting for receive failed ${swap.fromFundHash}`, e);
446
+ }
447
+ });
448
+ }
449
+ performNextSwapAction(store, { network, walletId, swap }) {
450
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
451
+ switch (swap.status) {
452
+ case 'WAITING_FOR_APPROVE_CONFIRMATIONS':
453
+ return (0, utils_1.withInterval)(() => tslib_1.__awaiter(this, void 0, void 0, function* () { return this.waitForApproveConfirmations({ swap, network, walletId }); }));
454
+ case 'APPROVE_CONFIRMED':
455
+ return (0, utils_1.withLock)(store, { item: swap, network, walletId, asset: swap.from }, () => tslib_1.__awaiter(this, void 0, void 0, function* () { return this.sendSwap({ swap, network, walletId }); }));
456
+ case 'WAITING_FOR_SEND_CONFIRMATIONS':
457
+ return (0, utils_1.withInterval)(() => tslib_1.__awaiter(this, void 0, void 0, function* () { return this.waitForSendConfirmations({ swap, network, walletId }); }));
458
+ case 'WAITING_FOR_RECEIVE':
459
+ return (0, utils_1.withInterval)(() => tslib_1.__awaiter(this, void 0, void 0, function* () { return this.waitForReceive({ swap, network, walletId }); }));
460
+ }
461
+ });
462
+ }
463
+ _getStatuses() {
464
+ return {
465
+ WAITING_FOR_APPROVE_CONFIRMATIONS: {
466
+ step: 0,
467
+ label: 'Approving {from}',
468
+ filterStatus: 'PENDING',
469
+ notification(swap) {
470
+ return {
471
+ message: `Approving ${swap.from}`,
472
+ };
473
+ },
474
+ },
475
+ APPROVE_CONFIRMED: {
476
+ step: 1,
477
+ label: 'Swapping {from}',
478
+ filterStatus: 'PENDING',
479
+ },
480
+ WAITING_FOR_SEND_CONFIRMATIONS: {
481
+ step: 1,
482
+ label: 'Swapping {from}',
483
+ filterStatus: 'PENDING',
484
+ notification() {
485
+ return {
486
+ message: 'Swap initiated',
487
+ };
488
+ },
489
+ },
490
+ WAITING_FOR_RECEIVE: {
491
+ step: 2,
492
+ label: 'Swapping {from}',
493
+ filterStatus: 'PENDING',
494
+ },
495
+ SUCCESS: {
496
+ step: 3,
497
+ label: 'Completed',
498
+ filterStatus: 'COMPLETED',
499
+ notification(swap) {
500
+ return {
501
+ message: `Swap completed, ${(0, coinFormatter_1.prettyBalance)(swap.toAmount, swap.to)} ${swap.to} ready to use`,
502
+ };
503
+ },
504
+ },
505
+ REFUNDED: {
506
+ step: 3,
507
+ label: 'Refunded',
508
+ filterStatus: 'REFUNDED',
509
+ notification() {
510
+ return {
511
+ message: 'Swap refunded',
512
+ };
513
+ },
514
+ },
515
+ };
516
+ }
517
+ _txTypes() {
518
+ return ThorchainTxTypes;
519
+ }
520
+ _fromTxType() {
521
+ return this._txTypes().SWAP;
522
+ }
523
+ _toTxType() {
524
+ return null;
525
+ }
526
+ _timelineDiagramSteps() {
527
+ return ['APPROVE', 'INITIATION', 'RECEIVE'];
528
+ }
529
+ _totalSteps() {
530
+ return 4;
531
+ }
532
+ }
533
+ exports.ThorchainSwapProvider = ThorchainSwapProvider;
534
+ //# sourceMappingURL=ThorchainSwapProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThorchainSwapProvider.js","sourceRoot":"","sources":["../../../../src/swaps/thorchain/ThorchainSwapProvider.ts"],"names":[],"mappings":";;;;AACA,2CAAoD;AAEpD,uDAAyF;AACzF,uDAA+E;AAC/E,uFAAoF;AACpF,4DAAsG;AACtG,2FAAsD;AACtD,uDAA6F;AAC7F,qEAA6C;AAC7C,uDAAiC;AACjC,mCAAmC;AACnC,+BAAoC;AACpC,8EAA6C;AAC7C,gEAAmD;AACnD,uEAAqF;AAErF,6CAA4C;AAC5C,6DAAwE;AACxE,oFAAoD;AACpD,2CAA4C;AAC5C,kDAA+C;AAW/C,uDAA0E;AAG1E,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEhC,MAAM,gBAAgB,GAAG,CAAC,sBAAO,CAAC,OAAO,EAAE,sBAAO,CAAC,QAAQ,CAAC,CAA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,EAAE,CAAC;gBACP,KAAK,EAAE,iBAAiB;gBACxB,YAAY,EAAE,SAAS;aACxB;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,CAAC;gBACP,KAAK,EAAE,WAAW;gBAClB,YAAY,EAAE,WAAW;gBACzB,YAAY,CAAC,IAAS;oBACpB,OAAO;wBACL,OAAO,EAAE,mBAAmB,IAAA,6BAAa,EAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,EAAE,eAAe;qBAC5F,CAAC;gBACJ,CAAC;aACF;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,CAAC;gBACP,KAAK,EAAE,UAAU;gBACjB,YAAY,EAAE,UAAU;gBACxB,YAAY;oBACV,OAAO;wBACL,OAAO,EAAE,eAAe;qBACzB,CAAC;gBACJ,CAAC;aACF;SACF,CAAC;IACJ,CAAC;IAES,QAAQ;QAChB,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAES,WAAW;QACnB,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC;IAC9B,CAAC;IAES,SAAS;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAES,qBAAqB;QAC7B,OAAO,CAAC,SAAS,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;IAC9C,CAAC;IAES,WAAW;QACnB,OAAO,CAAC,CAAC;IACX,CAAC;CACF;AAEQ,sDAAqB"}
@@ -0,0 +1,7 @@
1
+ {
2
+ "title": "Thorchain AMM Swaps",
3
+ "description": "Swap tokens across blockchains through liquidity pools.",
4
+ "pros": ["Cross-chain", "High liquidity", "Native assets", "Fee on destination chain not required"],
5
+ "cons": ["Beta software (chaosnet)", "Swaps executed on intermediary blockchain", "Few pairs"],
6
+ "fees": ["Outbound Fee", "Slippage"]
7
+ }
@@ -0,0 +1,87 @@
1
+ import BigNumber from 'bignumber.js';
2
+ import { SwapProviderDefinition } from '../build.config';
3
+ import { AccountId, Asset, Network, SwapHistoryItem } from '../store/types';
4
+ export interface BaseSwapProviderConfig extends SwapProviderDefinition {
5
+ providerId: string;
6
+ }
7
+ export interface LiqualityBoostSwapProviderConfig extends BaseSwapProviderConfig {
8
+ network: Network;
9
+ supportedBridgeAssets: Asset[];
10
+ }
11
+ export interface GetQuoteResult {
12
+ fromAmount: string;
13
+ toAmount: string;
14
+ }
15
+ export interface SwapQuote extends GetQuoteResult {
16
+ from: Asset;
17
+ to: Asset;
18
+ provider: string;
19
+ fromAccountId: AccountId;
20
+ toAccountId: AccountId;
21
+ path?: string[] | null;
22
+ slippage?: number;
23
+ }
24
+ export declare type QuoteRequest = {
25
+ network: Network;
26
+ from: Asset;
27
+ to: Asset;
28
+ amount: BigNumber;
29
+ walletId?: string;
30
+ fromAccountId?: AccountId;
31
+ toAccountId?: AccountId;
32
+ };
33
+ export declare type GetQuotesRequest = {
34
+ network: Network;
35
+ from: Asset;
36
+ to: Asset;
37
+ fromAccountId: AccountId;
38
+ toAccountId: AccountId;
39
+ amount: string;
40
+ walletId?: string;
41
+ slowQuoteThreshold?: number;
42
+ };
43
+ export declare type SwapRequest<T = SwapHistoryItem> = {
44
+ network: Network;
45
+ walletId: string;
46
+ quote: T;
47
+ };
48
+ export declare type NextSwapActionRequest<T = SwapHistoryItem> = {
49
+ network: Network;
50
+ walletId: string;
51
+ swap: T;
52
+ };
53
+ export declare type EstimateFeeRequest<T = string, Q = SwapQuote> = {
54
+ network: Network;
55
+ walletId: string;
56
+ asset: Asset;
57
+ txType: T;
58
+ quote: Q;
59
+ feePrices: number[];
60
+ feePricesL1?: number[];
61
+ max: boolean;
62
+ };
63
+ export declare type EstimateFeeResponse = {
64
+ [price: number]: BigNumber;
65
+ };
66
+ export declare type SwapStatus = {
67
+ step: number;
68
+ label: string;
69
+ filterStatus: string;
70
+ notification?: (swap?: unknown) => {
71
+ message: string;
72
+ };
73
+ };
74
+ export declare type ActionStatus = {
75
+ endTime: number;
76
+ status: string;
77
+ };
78
+ export declare type SwapProviderError = {
79
+ code: SwapProviderErrorTypes;
80
+ message?: string;
81
+ min?: BigNumber;
82
+ max?: BigNumber;
83
+ };
84
+ export declare enum SwapProviderErrorTypes {
85
+ AMOUNT_TOO_LOW = "AMOUNT_TOO_LOW",
86
+ FEES_HIGHER_THAN_AMOUNT = "FEES_HIGHER_THAN_AMOUNT"
87
+ }