@lifi/sdk 3.0.0-alpha.1 → 3.0.0-alpha.11

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 (349) hide show
  1. package/dist/cjs/LiFi.js +222 -261
  2. package/dist/cjs/LiFi.js.map +1 -0
  3. package/dist/cjs/allowance/getAllowance.js +13 -16
  4. package/dist/cjs/allowance/getAllowance.js.map +1 -0
  5. package/dist/cjs/allowance/index.js +5 -17
  6. package/dist/cjs/allowance/index.js.map +1 -0
  7. package/dist/cjs/allowance/setAllowance.js +33 -18
  8. package/dist/cjs/allowance/setAllowance.js.map +1 -0
  9. package/dist/cjs/allowance/types.js +1 -0
  10. package/dist/cjs/allowance/types.js.map +1 -0
  11. package/dist/cjs/balance/getBalance.js +14 -14
  12. package/dist/cjs/balance/getBalance.js.map +1 -0
  13. package/dist/cjs/balance/getTokenBalance.js +3 -3
  14. package/dist/cjs/balance/getTokenBalance.js.map +1 -0
  15. package/dist/cjs/balance/index.js +4 -16
  16. package/dist/cjs/balance/index.js.map +1 -0
  17. package/dist/cjs/connectors.js +7 -35
  18. package/dist/cjs/connectors.js.map +1 -0
  19. package/dist/cjs/constants.js +2 -4
  20. package/dist/cjs/constants.js.map +1 -0
  21. package/dist/cjs/execution/BaseStepExecutor.js +54 -0
  22. package/dist/cjs/execution/BaseStepExecutor.js.map +1 -0
  23. package/dist/cjs/execution/EVMStepExecutor.js +271 -0
  24. package/dist/cjs/execution/EVMStepExecutor.js.map +1 -0
  25. package/dist/cjs/execution/RouteExecutionManager.js +196 -179
  26. package/dist/cjs/execution/RouteExecutionManager.js.map +1 -0
  27. package/dist/cjs/execution/StatusManager.js +142 -135
  28. package/dist/cjs/execution/StatusManager.js.map +1 -0
  29. package/dist/cjs/execution/StepExecutionManager.js +223 -229
  30. package/dist/cjs/execution/StepExecutionManager.js.map +1 -0
  31. package/dist/cjs/execution/checkAllowance.js +9 -10
  32. package/dist/cjs/execution/checkAllowance.js.map +1 -0
  33. package/dist/cjs/execution/checkBalance.js +5 -5
  34. package/dist/cjs/execution/checkBalance.js.map +1 -0
  35. package/dist/cjs/execution/index.js +4 -15
  36. package/dist/cjs/execution/index.js.map +1 -0
  37. package/dist/cjs/execution/multisig.js +6 -8
  38. package/dist/cjs/execution/multisig.js.map +1 -0
  39. package/dist/cjs/execution/prepareRestart.js +2 -44
  40. package/dist/cjs/execution/prepareRestart.js.map +1 -0
  41. package/dist/cjs/execution/stepComparison.js +5 -17
  42. package/dist/cjs/execution/stepComparison.js.map +1 -0
  43. package/dist/cjs/execution/switchChain.js +4 -21
  44. package/dist/cjs/execution/switchChain.js.map +1 -0
  45. package/dist/cjs/{types/internal.types.js → execution/types.js} +1 -0
  46. package/dist/cjs/execution/types.js.map +1 -0
  47. package/dist/cjs/execution/utils.js +1 -9
  48. package/dist/cjs/execution/utils.js.map +1 -0
  49. package/dist/cjs/execution/waitForReceivingTransaction.js +9 -11
  50. package/dist/cjs/execution/waitForReceivingTransaction.js.map +1 -0
  51. package/dist/cjs/helpers.js +11 -25
  52. package/dist/cjs/helpers.js.map +1 -0
  53. package/dist/cjs/index.js +16 -22
  54. package/dist/cjs/index.js.map +1 -0
  55. package/dist/cjs/package.json +1 -0
  56. package/dist/cjs/providers/EVM.js +35 -0
  57. package/dist/cjs/providers/EVM.js.map +1 -0
  58. package/dist/cjs/providers/Solana.js +38 -0
  59. package/dist/cjs/providers/Solana.js.map +1 -0
  60. package/dist/cjs/providers/index.js +5 -0
  61. package/dist/cjs/providers/index.js.map +1 -0
  62. package/dist/cjs/providers/types.js +9 -0
  63. package/dist/cjs/providers/types.js.map +1 -0
  64. package/dist/cjs/request.js +19 -16
  65. package/dist/cjs/request.js.map +1 -0
  66. package/dist/cjs/services/ApiService.js +72 -90
  67. package/dist/cjs/services/ApiService.js.map +1 -0
  68. package/dist/cjs/services/ChainsService.js +19 -9
  69. package/dist/cjs/services/ChainsService.js.map +1 -0
  70. package/dist/cjs/services/ConfigService.js +94 -65
  71. package/dist/cjs/services/ConfigService.js.map +1 -0
  72. package/dist/cjs/typeguards.js +1 -0
  73. package/dist/cjs/typeguards.js.map +1 -0
  74. package/dist/cjs/types/abi.js +1 -0
  75. package/dist/cjs/types/abi.js.map +1 -0
  76. package/dist/cjs/types/index.js +4 -20
  77. package/dist/cjs/types/index.js.map +1 -0
  78. package/dist/cjs/types/internal.js +3 -0
  79. package/dist/cjs/types/internal.js.map +1 -0
  80. package/dist/cjs/utils/errors.js +25 -3
  81. package/dist/cjs/utils/errors.js.map +1 -0
  82. package/dist/cjs/utils/getMaxPriorityFeePerGas.js +3 -2
  83. package/dist/cjs/utils/getMaxPriorityFeePerGas.js.map +1 -0
  84. package/dist/cjs/utils/index.js +7 -19
  85. package/dist/cjs/utils/index.js.map +1 -0
  86. package/dist/cjs/utils/median.js +1 -0
  87. package/dist/cjs/utils/median.js.map +1 -0
  88. package/dist/cjs/utils/parseError.js +39 -79
  89. package/dist/cjs/utils/parseError.js.map +1 -0
  90. package/dist/cjs/utils/utils.js +5 -11
  91. package/dist/cjs/utils/utils.js.map +1 -0
  92. package/dist/cjs/version.js +2 -1
  93. package/dist/cjs/version.js.map +1 -0
  94. package/dist/esm/LiFi.js +375 -0
  95. package/dist/esm/LiFi.js.map +1 -0
  96. package/dist/{allowance → esm/allowance}/getAllowance.js +5 -4
  97. package/dist/esm/allowance/getAllowance.js.map +1 -0
  98. package/dist/esm/allowance/index.js +4 -0
  99. package/dist/esm/allowance/index.js.map +1 -0
  100. package/dist/{allowance → esm/allowance}/setAllowance.js +28 -11
  101. package/dist/esm/allowance/setAllowance.js.map +1 -0
  102. package/dist/esm/allowance/types.js +2 -0
  103. package/dist/esm/allowance/types.js.map +1 -0
  104. package/dist/{balance → esm/balance}/getBalance.js +5 -5
  105. package/dist/esm/balance/getBalance.js.map +1 -0
  106. package/dist/{balance → esm/balance}/getTokenBalance.js +2 -1
  107. package/dist/esm/balance/getTokenBalance.js.map +1 -0
  108. package/dist/esm/balance/index.js +3 -0
  109. package/dist/esm/balance/index.js.map +1 -0
  110. package/dist/{connectors.js → esm/connectors.js} +3 -2
  111. package/dist/esm/connectors.js.map +1 -0
  112. package/dist/{constants.js → esm/constants.js} +1 -0
  113. package/dist/esm/constants.js.map +1 -0
  114. package/dist/esm/execution/BaseStepExecutor.js +51 -0
  115. package/dist/esm/execution/BaseStepExecutor.js.map +1 -0
  116. package/dist/esm/execution/EVMStepExecutor.js +299 -0
  117. package/dist/esm/execution/EVMStepExecutor.js.map +1 -0
  118. package/dist/esm/execution/RouteExecutionManager.js +268 -0
  119. package/dist/esm/execution/RouteExecutionManager.js.map +1 -0
  120. package/dist/esm/execution/StatusManager.js +216 -0
  121. package/dist/esm/execution/StatusManager.js.map +1 -0
  122. package/dist/esm/execution/StepExecutionManager.js +280 -0
  123. package/dist/esm/execution/StepExecutionManager.js.map +1 -0
  124. package/dist/{execution → esm/execution}/checkAllowance.js +5 -4
  125. package/dist/esm/execution/checkAllowance.js.map +1 -0
  126. package/dist/{execution → esm/execution}/checkBalance.js +3 -2
  127. package/dist/esm/execution/checkBalance.js.map +1 -0
  128. package/dist/esm/execution/index.js +3 -0
  129. package/dist/esm/execution/index.js.map +1 -0
  130. package/dist/{execution → esm/execution}/multisig.js +3 -2
  131. package/dist/esm/execution/multisig.js.map +1 -0
  132. package/dist/esm/execution/prepareRestart.js +64 -0
  133. package/dist/esm/execution/prepareRestart.js.map +1 -0
  134. package/dist/{execution → esm/execution}/stepComparison.js +4 -3
  135. package/dist/esm/execution/stepComparison.js.map +1 -0
  136. package/dist/{execution → esm/execution}/switchChain.js +3 -1
  137. package/dist/esm/execution/switchChain.js.map +1 -0
  138. package/dist/esm/execution/types.js +2 -0
  139. package/dist/esm/execution/types.js.map +1 -0
  140. package/dist/{execution → esm/execution}/utils.js +1 -0
  141. package/dist/esm/execution/utils.js.map +1 -0
  142. package/dist/{execution → esm/execution}/waitForReceivingTransaction.js +5 -4
  143. package/dist/esm/execution/waitForReceivingTransaction.js.map +1 -0
  144. package/dist/{helpers.js → esm/helpers.js} +4 -3
  145. package/dist/esm/helpers.js.map +1 -0
  146. package/dist/esm/index.js +10 -0
  147. package/dist/esm/index.js.map +1 -0
  148. package/dist/esm/package.json +1 -0
  149. package/dist/esm/providers/EVM.js +30 -0
  150. package/dist/esm/providers/EVM.js.map +1 -0
  151. package/dist/esm/providers/Solana.js +34 -0
  152. package/dist/esm/providers/Solana.js.map +1 -0
  153. package/dist/esm/providers/index.js +2 -0
  154. package/dist/esm/providers/index.js.map +1 -0
  155. package/dist/esm/providers/types.js +6 -0
  156. package/dist/esm/providers/types.js.map +1 -0
  157. package/dist/{request.js → esm/request.js} +16 -9
  158. package/dist/esm/request.js.map +1 -0
  159. package/dist/{services → esm/services}/ApiService.js +29 -28
  160. package/dist/esm/services/ApiService.js.map +1 -0
  161. package/dist/{services → esm/services}/ChainsService.js +16 -4
  162. package/dist/esm/services/ChainsService.js.map +1 -0
  163. package/dist/esm/services/ConfigService.js +143 -0
  164. package/dist/esm/services/ConfigService.js.map +1 -0
  165. package/dist/{typeguards.js → esm/typeguards.js} +1 -0
  166. package/dist/esm/typeguards.js.map +1 -0
  167. package/dist/{types → esm/types}/abi.js +1 -0
  168. package/dist/esm/types/abi.js.map +1 -0
  169. package/dist/esm/types/index.js +3 -0
  170. package/dist/esm/types/index.js.map +1 -0
  171. package/dist/esm/types/internal.js +2 -0
  172. package/dist/esm/types/internal.js.map +1 -0
  173. package/dist/{utils → esm/utils}/errors.js +25 -0
  174. package/dist/esm/utils/errors.js.map +1 -0
  175. package/dist/{utils → esm/utils}/getMaxPriorityFeePerGas.js +2 -1
  176. package/dist/esm/utils/getMaxPriorityFeePerGas.js.map +1 -0
  177. package/dist/esm/utils/index.js +6 -0
  178. package/dist/esm/utils/index.js.map +1 -0
  179. package/dist/{utils → esm/utils}/median.js +1 -0
  180. package/dist/esm/utils/median.js.map +1 -0
  181. package/dist/{utils → esm/utils}/parseError.js +4 -3
  182. package/dist/esm/utils/parseError.js.map +1 -0
  183. package/dist/{utils → esm/utils}/utils.js +2 -1
  184. package/dist/esm/utils/utils.js.map +1 -0
  185. package/dist/esm/version.js +3 -0
  186. package/dist/esm/version.js.map +1 -0
  187. package/dist/{LiFi.d.ts → types/LiFi.d.ts} +29 -21
  188. package/dist/types/LiFi.d.ts.map +1 -0
  189. package/dist/{cjs → types}/allowance/getAllowance.d.ts +2 -1
  190. package/dist/types/allowance/getAllowance.d.ts.map +1 -0
  191. package/dist/types/allowance/index.d.ts +4 -0
  192. package/dist/types/allowance/index.d.ts.map +1 -0
  193. package/dist/types/allowance/setAllowance.d.ts +7 -0
  194. package/dist/types/allowance/setAllowance.d.ts.map +1 -0
  195. package/dist/{allowance → types/allowance}/types.d.ts +1 -0
  196. package/dist/types/allowance/types.d.ts.map +1 -0
  197. package/dist/{balance → types/balance}/getBalance.d.ts +1 -0
  198. package/dist/types/balance/getBalance.d.ts.map +1 -0
  199. package/dist/{balance → types/balance}/getTokenBalance.d.ts +1 -0
  200. package/dist/types/balance/getTokenBalance.d.ts.map +1 -0
  201. package/dist/types/balance/index.d.ts +3 -0
  202. package/dist/types/balance/index.d.ts.map +1 -0
  203. package/dist/{cjs → types}/connectors.d.ts +2 -1
  204. package/dist/types/connectors.d.ts.map +1 -0
  205. package/dist/{cjs → types}/constants.d.ts +1 -0
  206. package/dist/types/constants.d.ts.map +1 -0
  207. package/dist/types/execution/BaseStepExecutor.d.ts +13 -0
  208. package/dist/types/execution/BaseStepExecutor.d.ts.map +1 -0
  209. package/dist/types/execution/EVMStepExecutor.d.ts +14 -0
  210. package/dist/types/execution/EVMStepExecutor.d.ts.map +1 -0
  211. package/dist/{cjs → types}/execution/RouteExecutionManager.d.ts +10 -8
  212. package/dist/types/execution/RouteExecutionManager.d.ts.map +1 -0
  213. package/dist/{execution → types/execution}/StatusManager.d.ts +9 -7
  214. package/dist/types/execution/StatusManager.d.ts.map +1 -0
  215. package/dist/{execution → types/execution}/StepExecutionManager.d.ts +4 -3
  216. package/dist/types/execution/StepExecutionManager.d.ts.map +1 -0
  217. package/dist/types/execution/checkAllowance.d.ts +6 -0
  218. package/dist/types/execution/checkAllowance.d.ts.map +1 -0
  219. package/dist/types/execution/checkBalance.d.ts +3 -0
  220. package/dist/types/execution/checkBalance.d.ts.map +1 -0
  221. package/dist/types/execution/index.d.ts +3 -0
  222. package/dist/types/execution/index.d.ts.map +1 -0
  223. package/dist/types/execution/multisig.d.ts +5 -0
  224. package/dist/types/execution/multisig.d.ts.map +1 -0
  225. package/dist/types/execution/prepareRestart.d.ts +3 -0
  226. package/dist/types/execution/prepareRestart.d.ts.map +1 -0
  227. package/dist/{cjs → types}/execution/stepComparison.d.ts +6 -4
  228. package/dist/types/execution/stepComparison.d.ts.map +1 -0
  229. package/dist/{cjs → types}/execution/switchChain.d.ts +6 -4
  230. package/dist/types/execution/switchChain.d.ts.map +1 -0
  231. package/dist/types/{internal.types.d.ts → execution/types.d.ts} +38 -98
  232. package/dist/types/execution/types.d.ts.map +1 -0
  233. package/dist/{execution → types/execution}/utils.d.ts +3 -2
  234. package/dist/types/execution/utils.d.ts.map +1 -0
  235. package/dist/types/execution/waitForReceivingTransaction.d.ts +4 -0
  236. package/dist/types/execution/waitForReceivingTransaction.d.ts.map +1 -0
  237. package/dist/{helpers.d.ts → types/helpers.d.ts} +4 -3
  238. package/dist/types/helpers.d.ts.map +1 -0
  239. package/dist/types/index.d.ts +9 -3
  240. package/dist/types/index.d.ts.map +1 -0
  241. package/dist/types/providers/EVM.d.ts +11 -0
  242. package/dist/types/providers/EVM.d.ts.map +1 -0
  243. package/dist/types/providers/Solana.d.ts +10 -0
  244. package/dist/types/providers/Solana.d.ts.map +1 -0
  245. package/dist/types/providers/index.d.ts +2 -0
  246. package/dist/types/providers/index.d.ts.map +1 -0
  247. package/dist/types/providers/types.d.ts +13 -0
  248. package/dist/types/providers/types.d.ts.map +1 -0
  249. package/dist/{request.d.ts → types/request.d.ts} +1 -0
  250. package/dist/types/request.d.ts.map +1 -0
  251. package/dist/{services → types/services}/ApiService.d.ts +5 -5
  252. package/dist/types/services/ApiService.d.ts.map +1 -0
  253. package/dist/{cjs → types}/services/ChainsService.d.ts +2 -1
  254. package/dist/types/services/ChainsService.d.ts.map +1 -0
  255. package/dist/{services → types/services}/ConfigService.d.ts +10 -6
  256. package/dist/types/services/ConfigService.d.ts.map +1 -0
  257. package/dist/{cjs → types}/typeguards.d.ts +3 -2
  258. package/dist/types/typeguards.d.ts.map +1 -0
  259. package/dist/{cjs → types}/types/abi.d.ts +1 -0
  260. package/dist/types/types/abi.d.ts.map +1 -0
  261. package/dist/types/types/index.d.ts +3 -0
  262. package/dist/types/types/index.d.ts.map +1 -0
  263. package/dist/types/types/internal.d.ts +61 -0
  264. package/dist/types/types/internal.d.ts.map +1 -0
  265. package/dist/{cjs → types}/utils/errors.d.ts +1 -0
  266. package/dist/types/utils/errors.d.ts.map +1 -0
  267. package/dist/{cjs → types}/utils/getMaxPriorityFeePerGas.d.ts +1 -0
  268. package/dist/types/utils/getMaxPriorityFeePerGas.d.ts.map +1 -0
  269. package/dist/types/utils/index.d.ts +6 -0
  270. package/dist/types/utils/index.d.ts.map +1 -0
  271. package/dist/{cjs → types}/utils/median.d.ts +1 -0
  272. package/dist/types/utils/median.d.ts.map +1 -0
  273. package/dist/{cjs → types}/utils/parseError.d.ts +6 -5
  274. package/dist/types/utils/parseError.d.ts.map +1 -0
  275. package/dist/{cjs → types}/utils/utils.d.ts +1 -0
  276. package/dist/types/utils/utils.d.ts.map +1 -0
  277. package/dist/types/version.d.ts +3 -0
  278. package/dist/types/version.d.ts.map +1 -0
  279. package/package.json +37 -96
  280. package/dist/LiFi.js +0 -246
  281. package/dist/allowance/getAllowance.d.ts +0 -6
  282. package/dist/allowance/index.d.ts +0 -3
  283. package/dist/allowance/index.js +0 -3
  284. package/dist/allowance/setAllowance.d.ts +0 -5
  285. package/dist/allowance/types.js +0 -1
  286. package/dist/balance/index.d.ts +0 -2
  287. package/dist/balance/index.js +0 -2
  288. package/dist/cjs/LiFi.d.ts +0 -171
  289. package/dist/cjs/allowance/index.d.ts +0 -3
  290. package/dist/cjs/allowance/setAllowance.d.ts +0 -5
  291. package/dist/cjs/allowance/types.d.ts +0 -27
  292. package/dist/cjs/balance/getBalance.d.ts +0 -2
  293. package/dist/cjs/balance/getTokenBalance.d.ts +0 -8
  294. package/dist/cjs/balance/index.d.ts +0 -2
  295. package/dist/cjs/execution/StatusManager.d.ts +0 -67
  296. package/dist/cjs/execution/StepExecutionManager.d.ts +0 -7
  297. package/dist/cjs/execution/StepExecutor.d.ts +0 -15
  298. package/dist/cjs/execution/StepExecutor.js +0 -62
  299. package/dist/cjs/execution/checkAllowance.d.ts +0 -4
  300. package/dist/cjs/execution/checkBalance.d.ts +0 -2
  301. package/dist/cjs/execution/index.d.ts +0 -1
  302. package/dist/cjs/execution/multisig.d.ts +0 -4
  303. package/dist/cjs/execution/prepareRestart.d.ts +0 -3
  304. package/dist/cjs/execution/utils.d.ts +0 -12
  305. package/dist/cjs/execution/waitForReceivingTransaction.d.ts +0 -3
  306. package/dist/cjs/helpers.d.ts +0 -18
  307. package/dist/cjs/index.d.ts +0 -5
  308. package/dist/cjs/request.d.ts +0 -9
  309. package/dist/cjs/services/ApiService.d.ts +0 -17
  310. package/dist/cjs/services/ConfigService.d.ts +0 -23
  311. package/dist/cjs/types/index.d.ts +0 -4
  312. package/dist/cjs/types/internal.types.d.ts +0 -143
  313. package/dist/cjs/utils/index.d.ts +0 -5
  314. package/dist/cjs/version.d.ts +0 -2
  315. package/dist/connectors.d.ts +0 -8
  316. package/dist/constants.d.ts +0 -6
  317. package/dist/execution/RouteExecutionManager.d.ts +0 -59
  318. package/dist/execution/RouteExecutionManager.js +0 -195
  319. package/dist/execution/StatusManager.js +0 -167
  320. package/dist/execution/StepExecutionManager.js +0 -260
  321. package/dist/execution/StepExecutor.d.ts +0 -15
  322. package/dist/execution/StepExecutor.js +0 -58
  323. package/dist/execution/checkAllowance.d.ts +0 -4
  324. package/dist/execution/checkBalance.d.ts +0 -2
  325. package/dist/execution/index.d.ts +0 -1
  326. package/dist/execution/index.js +0 -1
  327. package/dist/execution/multisig.d.ts +0 -4
  328. package/dist/execution/prepareRestart.d.ts +0 -3
  329. package/dist/execution/prepareRestart.js +0 -61
  330. package/dist/execution/stepComparison.d.ts +0 -14
  331. package/dist/execution/switchChain.d.ts +0 -21
  332. package/dist/execution/waitForReceivingTransaction.d.ts +0 -3
  333. package/dist/index.d.ts +0 -5
  334. package/dist/index.js +0 -6
  335. package/dist/services/ChainsService.d.ts +0 -11
  336. package/dist/services/ConfigService.js +0 -99
  337. package/dist/typeguards.d.ts +0 -4
  338. package/dist/types/abi.d.ts +0 -5
  339. package/dist/types/index.js +0 -4
  340. package/dist/types/internal.types.js +0 -1
  341. package/dist/utils/errors.d.ts +0 -107
  342. package/dist/utils/getMaxPriorityFeePerGas.d.ts +0 -2
  343. package/dist/utils/index.d.ts +0 -5
  344. package/dist/utils/index.js +0 -5
  345. package/dist/utils/median.d.ts +0 -1
  346. package/dist/utils/parseError.d.ts +0 -37
  347. package/dist/utils/utils.d.ts +0 -10
  348. package/dist/version.d.ts +0 -2
  349. package/dist/version.js +0 -2
@@ -1,17 +1,6 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
2
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./StatusManager"), exports);
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./StatusManager.js"), exports);
5
+ tslib_1.__exportStar(require("./types.js"), exports);
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/execution/index.ts"],"names":[],"mappings":";;;AAAA,6DAAkC;AAClC,qDAA0B"}
@@ -1,13 +1,10 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.updateMultisigRouteProcess = void 0;
7
- const ConfigService_1 = __importDefault(require("../services/ConfigService"));
8
- const errors_1 = require("../utils/errors");
4
+ const ConfigService_js_1 = require("../services/ConfigService.js");
5
+ const errors_js_1 = require("../utils/errors.js");
9
6
  const updateMultisigRouteProcess = async (internalTxHash, step, statusManager, processType, fromChain) => {
10
- const config = ConfigService_1.default.getInstance().getConfig();
7
+ const config = ConfigService_js_1.ConfigService.getInstance().getConfig();
11
8
  if (!config.multisig?.getMultisigTransactionDetails) {
12
9
  throw new Error('getMultisigTransactionDetails is missing in multisig config.');
13
10
  }
@@ -23,10 +20,11 @@ const updateMultisigRouteProcess = async (internalTxHash, step, statusManager, p
23
20
  });
24
21
  }
25
22
  if (multisigStatusResponse.status === 'FAILED') {
26
- throw new errors_1.TransactionError(errors_1.LiFiErrorCode.TransactionFailed, 'Multisig transaction failed.');
23
+ throw new errors_js_1.TransactionError(errors_js_1.LiFiErrorCode.TransactionFailed, 'Multisig transaction failed.');
27
24
  }
28
25
  if (multisigStatusResponse.status === 'CANCELLED') {
29
- throw new errors_1.TransactionError(errors_1.LiFiErrorCode.SignatureRejected, 'Transaction was rejected by user.');
26
+ throw new errors_js_1.TransactionError(errors_js_1.LiFiErrorCode.SignatureRejected, 'Transaction was rejected by user.');
30
27
  }
31
28
  };
32
29
  exports.updateMultisigRouteProcess = updateMultisigRouteProcess;
30
+ //# sourceMappingURL=multisig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multisig.js","sourceRoot":"","sources":["../../../src/execution/multisig.ts"],"names":[],"mappings":";;;AAEA,mEAA4D;AAC5D,kDAAoE;AAI7D,MAAM,0BAA0B,GAAG,KAAK,EAC7C,cAAoB,EACpB,IAAc,EACd,aAA4B,EAC5B,WAAwB,EACxB,SAAwB,EACxB,EAAE;IACF,MAAM,MAAM,GAAG,gCAAa,CAAC,WAAW,EAAE,CAAC,SAAS,EAAE,CAAA;IAEtD,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,6BAA6B,EAAE;QACnD,MAAM,IAAI,KAAK,CACb,8DAA8D,CAC/D,CAAA;KACF;IAED,MAAM,gCAAgC,GAAG,GAAG,EAAE;QAC5C,aAAa,CAAC,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,CAAC,CAAA;IAC3D,CAAC,CAAA;IAED,MAAM,sBAAsB,GAC1B,MAAM,MAAM,CAAC,QAAQ,EAAE,6BAA6B,CAClD,cAAc,EACd,SAAS,CAAC,EAAE,EACZ,gCAAgC,CACjC,CAAA;IAEH,IAAI,sBAAsB,CAAC,MAAM,KAAK,MAAM,EAAE;QAC5C,aAAa,CAAC,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE;YACxD,MAAM,EAAE,sBAAsB,CAAC,MAAM;YACrC,cAAc,EAAE,SAAS;YACzB,MAAM,EAAE,GAAG,SAAS,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,MAAM,sBAAsB,CAAC,MAAM,EAAE;SACxF,CAAC,CAAA;KACH;IAED,IAAI,sBAAsB,CAAC,MAAM,KAAK,QAAQ,EAAE;QAC9C,MAAM,IAAI,4BAAgB,CACxB,yBAAa,CAAC,iBAAiB,EAC/B,8BAA8B,CAC/B,CAAA;KACF;IAED,IAAI,sBAAsB,CAAC,MAAM,KAAK,WAAW,EAAE;QACjD,MAAM,IAAI,4BAAgB,CACxB,yBAAa,CAAC,iBAAiB,EAC/B,mCAAmC,CACpC,CAAA;KACF;AACH,CAAC,CAAA;AA/CY,QAAA,0BAA0B,8BA+CtC"}
@@ -1,60 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.prepareRestart = void 0;
4
- const viem_1 = require("viem");
5
- const errors_1 = require("../utils/errors");
6
- const prepareRestart = async (route, walletClient) => {
4
+ const prepareRestart = async (route) => {
7
5
  for (let index = 0; index < route.steps.length; index++) {
8
6
  const step = route.steps[index];
9
7
  const stepHasFailed = step.execution?.status === 'FAILED';
10
8
  if (stepHasFailed) {
11
- await handleErrorType(walletClient, step);
12
9
  deleteFailedProcesses(step);
13
10
  deleteTransactionData(step);
14
11
  }
15
12
  }
16
13
  };
17
14
  exports.prepareRestart = prepareRestart;
18
- const handleErrorType = async (walletClient, step) => {
19
- const client = walletClient.extend(viem_1.publicActions);
20
- const isGasLimitError = step.execution?.process.some((p) => p.error?.code === errors_1.LiFiErrorCode.GasLimitError);
21
- const isGasPriceError = step.execution?.process.some((p) => p.error?.code === errors_1.LiFiErrorCode.TransactionUnderpriced);
22
- const { transactionRequest } = step;
23
- // if (isGasLimitError) {
24
- // if (transactionRequest) {
25
- // let gasLimit = transactionRequest.gasLimit
26
- // try {
27
- // gasLimit = await client.estimateGas(transactionRequest)
28
- // } catch (error) {}
29
- // if (gasLimit) {
30
- // transactionRequest.gasLimit = BigNumber.from(
31
- // `${(BigInt(gasLimit.toString()) * 125n) / 100n}`
32
- // )
33
- // }
34
- // }
35
- // step.estimate.gasCosts?.forEach(
36
- // (gasCost) =>
37
- // (gasCost.limit = `${Math.round(Number(gasCost.limit) * 1.25)}`)
38
- // )
39
- // }
40
- // if (isGasPriceError) {
41
- // if (transactionRequest) {
42
- // let gasPrice = transactionRequest.gasPrice
43
- // try {
44
- // gasPrice = await client.getGasPrice()
45
- // } catch (error) {}
46
- // if (gasPrice) {
47
- // transactionRequest.gasPrice = BigNumber.from(
48
- // `${(BigInt(gasPrice.toString()) * 125n) / 100n}`
49
- // )
50
- // }
51
- // }
52
- // step.estimate.gasCosts?.forEach(
53
- // (gasCost) =>
54
- // (gasCost.price = `${Math.round(Number(gasCost.price) * 1.25)}`)
55
- // )
56
- // }
57
- };
58
15
  const deleteFailedProcesses = (step) => {
59
16
  if (step.execution) {
60
17
  step.execution.process = step.execution.process.filter((process) => process.status === 'DONE');
@@ -63,3 +20,4 @@ const deleteFailedProcesses = (step) => {
63
20
  const deleteTransactionData = (step) => {
64
21
  step.transactionRequest = undefined;
65
22
  };
23
+ //# sourceMappingURL=prepareRestart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepareRestart.js","sourceRoot":"","sources":["../../../src/execution/prepareRestart.ts"],"names":[],"mappings":";;;AAEO,MAAM,cAAc,GAAG,KAAK,EAAE,KAAY,EAAE,EAAE;IACnD,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;QACvD,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QAC/B,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,KAAK,QAAQ,CAAA;QAEzD,IAAI,aAAa,EAAE;YAEjB,qBAAqB,CAAC,IAAI,CAAC,CAAA;YAC3B,qBAAqB,CAAC,IAAI,CAAC,CAAA;SAC5B;KACF;AACH,CAAC,CAAA;AAXY,QAAA,cAAc,kBAW1B;AAyDD,MAAM,qBAAqB,GAAG,CAAC,IAAc,EAAE,EAAE;IAC/C,IAAI,IAAI,CAAC,SAAS,EAAE;QAClB,IAAI,CAAC,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CACpD,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,KAAK,MAAM,CACvC,CAAA;KACF;AACH,CAAC,CAAA;AAED,MAAM,qBAAqB,GAAG,CAAC,IAAc,EAAE,EAAE;IAC/C,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAA;AACrC,CAAC,CAAA"}
@@ -1,22 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.stepComparison = void 0;
4
- const errors_1 = require("../utils/errors");
5
- const utils_1 = require("./utils");
6
- /**
7
- * This method checks whether the new and updated Step meets the required exchange rate conditions.
8
- * If yes it returns the updated Step.
9
- * If no and if user interaction is allowed it triggers the acceptExchangeRateUpdateHook. If no user interaction is allowed it aborts.
10
- * @param statusManager
11
- * @param oldStep
12
- * @param newStep
13
- * @param settings
14
- * @param allowUserInteraction
15
- * @returns Return LifiStep
16
- */
4
+ const errors_js_1 = require("../utils/errors.js");
5
+ const utils_js_1 = require("./utils.js");
17
6
  const stepComparison = async (statusManager, oldStep, newStep, settings, allowUserInteraction) => {
18
- // Check if changed exchange rate is in the range of slippage threshold
19
- if ((0, utils_1.checkStepSlippageThreshold)(oldStep, newStep)) {
7
+ if ((0, utils_js_1.checkStepSlippageThreshold)(oldStep, newStep)) {
20
8
  return statusManager.updateStepInRoute(newStep);
21
9
  }
22
10
  let allowStepUpdate;
@@ -28,10 +16,10 @@ const stepComparison = async (statusManager, oldStep, newStep, settings, allowUs
28
16
  });
29
17
  }
30
18
  if (!allowStepUpdate) {
31
- // The user declined the new exchange rate, so we are not going to proceed
32
- throw new errors_1.TransactionError(errors_1.LiFiErrorCode.ExchangeRateUpdateCanceled, 'Exchange rate has changed!', `Transaction was not sent, your funds are still in your wallet.
19
+ throw new errors_js_1.TransactionError(errors_js_1.LiFiErrorCode.ExchangeRateUpdateCanceled, 'Exchange rate has changed!', `Transaction was not sent, your funds are still in your wallet.
33
20
  The exchange rate has changed and the previous estimation can not be fulfilled due to value loss.`);
34
21
  }
35
22
  return statusManager.updateStepInRoute(newStep);
36
23
  };
37
24
  exports.stepComparison = stepComparison;
25
+ //# sourceMappingURL=stepComparison.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stepComparison.js","sourceRoot":"","sources":["../../../src/execution/stepComparison.ts"],"names":[],"mappings":";;;AACA,kDAAoE;AAGpE,yCAAuD;AAahD,MAAM,cAAc,GAAG,KAAK,EACjC,aAA4B,EAC5B,OAAiB,EACjB,OAAiB,EACjB,QAAmC,EACnC,oBAA6B,EACV,EAAE;IAErB,IAAI,IAAA,qCAA0B,EAAC,OAAO,EAAE,OAAO,CAAC,EAAE;QAChD,OAAO,aAAa,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAA;KAChD;IAED,IAAI,eAAoC,CAAA;IACxC,IAAI,oBAAoB,EAAE;QACxB,eAAe,GAAG,MAAM,QAAQ,CAAC,4BAA4B,CAAC;YAC5D,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC,QAAQ;YACtC,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC,QAAQ;YACtC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO;SAChC,CAAC,CAAA;KACH;IAED,IAAI,CAAC,eAAe,EAAE;QAEpB,MAAM,IAAI,4BAAgB,CACxB,yBAAa,CAAC,0BAA0B,EACxC,4BAA4B,EAC5B;wGACkG,CACnG,CAAA;KACF;IAED,OAAO,aAAa,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAA;AACjD,CAAC,CAAA;AAhCY,QAAA,cAAc,kBAgC1B"}
@@ -1,29 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.switchChain = void 0;
4
- const errors_1 = require("../utils/errors");
5
- /**
6
- * This method checks whether the wallet client is configured for the correct chain.
7
- * If yes it returns the wallet clien.
8
- * If no and if user interaction is allowed it triggers the switchChainHook. If no user interaction is allowed it aborts.
9
- *
10
- * Account Type: local -
11
- * We need to create and return a new WalletClient from the switchChainHook in order to continue execution on a new chain.
12
- *
13
- * Account Type: json-rpc -
14
- * We can switch chain and return existing WalletClient from the switchChainHook in order to continue execution on a new chain.
15
- * @param walletClient
16
- * @param statusManager
17
- * @param step
18
- * @param switchChainHook
19
- * @param allowUserInteraction
20
- */
4
+ const errors_js_1 = require("../utils/errors.js");
21
5
  const switchChain = async (walletClient, statusManager, step, switchChainHook, allowUserInteraction) => {
22
- // if we are already on the correct chain we can proceed directly
23
6
  if ((await walletClient.getChainId()) === step.action.fromChainId) {
24
7
  return walletClient;
25
8
  }
26
- // -> set status message
27
9
  step.execution = statusManager.initExecutionObject(step);
28
10
  statusManager.updateExecution(step, 'ACTION_REQUIRED');
29
11
  let switchProcess = statusManager.findOrCreateProcess(step, 'SWITCH_CHAIN', 'ACTION_REQUIRED');
@@ -34,7 +16,7 @@ const switchChain = async (walletClient, statusManager, step, switchChainHook, a
34
16
  const updatedWalletClient = await switchChainHook(step.action.fromChainId);
35
17
  const updatedChainId = await updatedWalletClient?.getChainId();
36
18
  if (updatedChainId !== step.action.fromChainId) {
37
- throw new errors_1.ProviderError(errors_1.LiFiErrorCode.ChainSwitchError, 'Chain switch required.');
19
+ throw new errors_js_1.ProviderError(errors_js_1.LiFiErrorCode.ChainSwitchError, 'Chain switch required.');
38
20
  }
39
21
  switchProcess = statusManager.updateProcess(step, switchProcess.type, 'DONE');
40
22
  statusManager.updateExecution(step, 'PENDING');
@@ -44,7 +26,7 @@ const switchChain = async (walletClient, statusManager, step, switchChainHook, a
44
26
  statusManager.updateProcess(step, switchProcess.type, 'FAILED', {
45
27
  error: {
46
28
  message: error.message,
47
- code: errors_1.LiFiErrorCode.ChainSwitchError,
29
+ code: errors_js_1.LiFiErrorCode.ChainSwitchError,
48
30
  },
49
31
  });
50
32
  statusManager.updateExecution(step, 'FAILED');
@@ -52,3 +34,4 @@ const switchChain = async (walletClient, statusManager, step, switchChainHook, a
52
34
  }
53
35
  };
54
36
  exports.switchChain = switchChain;
37
+ //# sourceMappingURL=switchChain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"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AK,CAAC,OAAO;gBACtB,IAAI,EAAE,yBAAa,CAAC,gBAAgB;aACrC;SACF,CAAC,CAAA;QACF,aAAa,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;QAC7C,MAAM,KAAK,CAAA;KACZ;AACH,CAAC,CAAA;AArDY,QAAA,WAAW,eAqDvB"}
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/execution/types.ts"],"names":[],"mappings":""}
@@ -60,20 +60,11 @@ function getSubstatusMessage(status, substatus) {
60
60
  return message;
61
61
  }
62
62
  exports.getSubstatusMessage = getSubstatusMessage;
63
- /**
64
- * Used to check if changed exchange rate is in the range of slippage threshold.
65
- * We use a slippage value as a threshold to trigger the rate change hook.
66
- * This can result in almost doubled slippage for the user and need to be revisited.
67
- * @param oldStep
68
- * @param newStep
69
- * @returns Boolean
70
- */
71
63
  function checkStepSlippageThreshold(oldStep, newStep) {
72
64
  const setSlippage = oldStep.action.slippage;
73
65
  const oldEstimatedToAmount = BigInt(oldStep.estimate.toAmountMin);
74
66
  const newEstimatedToAmount = BigInt(newStep.estimate.toAmountMin);
75
67
  const amountDifference = oldEstimatedToAmount - newEstimatedToAmount;
76
- // oldEstimatedToAmount can be 0 when we use conract calls
77
68
  let actualSlippage = 0;
78
69
  if (oldEstimatedToAmount > 0) {
79
70
  actualSlippage =
@@ -83,3 +74,4 @@ function checkStepSlippageThreshold(oldStep, newStep) {
83
74
  return actualSlippage <= setSlippage;
84
75
  }
85
76
  exports.checkStepSlippageThreshold = checkStepSlippageThreshold;
77
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/execution/utils.ts"],"names":[],"mappings":";;;AAQA,MAAM,eAAe,GAAyD;IAC5E,eAAe,EAAE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C,MAAM,CAAC,CAAC,SAAS,CAAC,CAAA;IACpD,OAAO,OAAO,CAAA;AAChB,CAAC;AATD,kDASC;AAUD,SAAgB,0BAA0B,CACxC,OAAiB,EACjB,OAAiB;IAEjB,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAA;IAC3C,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;IACjE,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;IACjE,MAAM,gBAAgB,GAAG,oBAAoB,GAAG,oBAAoB,CAAA;IAEpE,IAAI,cAAc,GAAG,CAAC,CAAA;IACtB,IAAI,oBAAoB,GAAG,CAAC,EAAE;QAC5B,cAAc;YACZ,MAAM,CAAC,CAAC,gBAAgB,GAAG,WAAc,CAAC,GAAG,oBAAoB,CAAC;gBAClE,UAAa,CAAA;KAChB;IACD,OAAO,cAAc,IAAI,WAAW,CAAA;AACtC,CAAC;AAhBD,gEAgBC"}
@@ -1,19 +1,16 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.waitForReceivingTransaction = void 0;
7
- const ApiService_1 = __importDefault(require("../services/ApiService"));
8
- const errors_1 = require("../utils/errors");
9
- const utils_1 = require("../utils/utils");
10
- const utils_2 = require("./utils");
4
+ const ApiService_js_1 = require("../services/ApiService.js");
5
+ const errors_js_1 = require("../utils/errors.js");
6
+ const utils_js_1 = require("../utils/utils.js");
7
+ const utils_js_2 = require("./utils.js");
11
8
  const TRANSACTION_HASH_OBSERVERS = {};
12
9
  async function waitForReceivingTransaction(txHash, statusManager, processType, step) {
13
10
  const getStatus = () => new Promise(async (resolve, reject) => {
14
11
  let statusResponse;
15
12
  try {
16
- statusResponse = await ApiService_1.default.getStatus({
13
+ statusResponse = await ApiService_js_1.default.getStatus({
17
14
  bridge: step.tool,
18
15
  fromChain: step.action.fromChainId,
19
16
  toChain: step.action.toChainId,
@@ -31,7 +28,7 @@ async function waitForReceivingTransaction(txHash, statusManager, processType, s
31
28
  statusManager?.updateProcess(step, processType, 'PENDING', {
32
29
  substatus: statusResponse.substatus,
33
30
  substatusMessage: statusResponse.substatusMessage ||
34
- (0, utils_2.getSubstatusMessage)(statusResponse.status, statusResponse.substatus),
31
+ (0, utils_js_2.getSubstatusMessage)(statusResponse.status, statusResponse.substatus),
35
32
  txLink: statusResponse.bridgeExplorerLink,
36
33
  });
37
34
  return resolve(undefined);
@@ -47,12 +44,13 @@ async function waitForReceivingTransaction(txHash, statusManager, processType, s
47
44
  status = await TRANSACTION_HASH_OBSERVERS[txHash];
48
45
  }
49
46
  else {
50
- TRANSACTION_HASH_OBSERVERS[txHash] = (0, utils_1.repeatUntilDone)(getStatus, 5000);
47
+ TRANSACTION_HASH_OBSERVERS[txHash] = (0, utils_js_1.repeatUntilDone)(getStatus, 5000);
51
48
  status = await TRANSACTION_HASH_OBSERVERS[txHash];
52
49
  }
53
50
  if (!status.receiving) {
54
- throw new errors_1.ServerError("Status doesn't contain receiving information.");
51
+ throw new errors_js_1.ServerError("Status doesn't contain receiving information.");
55
52
  }
56
53
  return status;
57
54
  }
58
55
  exports.waitForReceivingTransaction = waitForReceivingTransaction;
56
+ //# sourceMappingURL=waitForReceivingTransaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waitForReceivingTransaction.js","sourceRoot":"","sources":["../../../src/execution/waitForReceivingTransaction.ts"],"names":[],"mappings":";;;AAMA,6DAAkD;AAClD,kDAAgD;AAChD,gDAAmD;AAEnD,yCAAgD;AAEhD,MAAM,0BAA0B,GAA4C,EAAE,CAAA;AAEvE,KAAK,UAAU,2BAA2B,CAC/C,MAAc,EACd,aAA4B,EAC5B,WAAwB,EACxB,IAAc;IAEd,MAAM,SAAS,GAAG,GAAwC,EA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0BAAe,EAAC,SAAS,EAAE,IAAK,CAAC,CAAA;QACtE,MAAM,GAAG,MAAM,0BAA0B,CAAC,MAAM,CAAC,CAAA;KAClD;IAED,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;QACrB,MAAM,IAAI,uBAAW,CAAC,+CAA+C,CAAC,CAAA;KACvE;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AA1DD,kEA0DC"}
@@ -1,15 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fetchTxErrorDetails = exports.convertQuoteToRoute = exports.checkPackageUpdates = exports.getRandomNumber = void 0;
4
- const request_1 = require("./request");
5
- const errors_1 = require("./utils/errors");
6
- const version_1 = require("./version");
7
- /**
8
- * Returns a random number between min (inclusive) and max (inclusive)
9
- * @param min - minimum number.
10
- * @param max - maximum number.
11
- * @returns - random number.
12
- */
4
+ const request_js_1 = require("./request.js");
5
+ const errors_js_1 = require("./utils/errors.js");
6
+ const version_js_1 = require("./version.js");
13
7
  const getRandomNumber = (min, max) => {
14
8
  return Math.floor(Math.random() * (max - min + 1) + min);
15
9
  };
@@ -32,33 +26,24 @@ const checkPackageUpdates = async (packageName, packageVersion, disableCheck) =>
32
26
  return;
33
27
  }
34
28
  try {
35
- const pkgName = packageName ?? version_1.name;
36
- const response = await (0, request_1.request)(`https://registry.npmjs.org/${pkgName}/latest`, { skipTrackingHeaders: true });
29
+ const pkgName = packageName ?? version_js_1.name;
30
+ const response = await (0, request_js_1.request)(`https://registry.npmjs.org/${pkgName}/latest`, { skipTrackingHeaders: true });
37
31
  const latestVersion = response.version;
38
- const currentVersion = packageVersion ?? version_1.version;
32
+ const currentVersion = packageVersion ?? version_js_1.version;
39
33
  if (semverCompare(latestVersion, currentVersion)) {
40
- console.warn(
41
- // eslint-disable-next-line max-len
42
- `${pkgName}: new package version is available. Please update as soon as possible to enjoy the newest features. Current version: ${currentVersion}. Latest version: ${latestVersion}.`);
34
+ console.warn(`${pkgName}: new package version is available. Please update as soon as possible to enjoy the newest features. Current version: ${currentVersion}. Latest version: ${latestVersion}.`);
43
35
  }
44
36
  }
45
37
  catch (error) {
46
- // Cannot verify version, might be network error etc. We don't bother showing anything in that case
47
38
  }
48
39
  };
49
40
  exports.checkPackageUpdates = checkPackageUpdates;
50
- /**
51
- * Converts a quote to Route
52
- * @param step - Step returned from the quote endpoint.
53
- * @returns - The route to be executed.
54
- * @throws {ValidationError} Throws a ValidationError if the step has missing values.
55
- */
56
41
  const convertQuoteToRoute = (step) => {
57
42
  if (!step.estimate.fromAmountUSD) {
58
- throw new errors_1.ValidationError("Missing 'fromAmountUSD' in step estimate.");
43
+ throw new errors_js_1.ValidationError("Missing 'fromAmountUSD' in step estimate.");
59
44
  }
60
45
  if (!step.estimate.toAmountUSD) {
61
- throw new errors_1.ValidationError("Missing 'toAmountUSD' in step estimate.");
46
+ throw new errors_js_1.ValidationError("Missing 'toAmountUSD' in step estimate.");
62
47
  }
63
48
  const route = {
64
49
  fromToken: step.action.fromToken,
@@ -78,7 +63,8 @@ const convertQuoteToRoute = (step) => {
78
63
  };
79
64
  exports.convertQuoteToRoute = convertQuoteToRoute;
80
65
  const fetchTxErrorDetails = async (txHash, chainId) => {
81
- const response = await (0, request_1.request)(`https://api.tenderly.co/api/v1/public-contract/${chainId}/tx/${txHash}`);
66
+ const response = await (0, request_js_1.request)(`https://api.tenderly.co/api/v1/public-contract/${chainId}/tx/${txHash}`);
82
67
  return response;
83
68
  };
84
69
  exports.fetchTxErrorDetails = fetchTxErrorDetails;
70
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":";;;AACA,6CAAsC;AAEtC,iDAAmD;AACnD,6CAA4C;AAQrC,MAAM,eAAe,GAAG,CAAC,GAAW,EAAE,GAAW,EAAU,EAAE;IAClE,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EA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,24 +1,18 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
2
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.LiFi = void 0;
18
- // expose types and helpers
19
- __exportStar(require("./execution"), exports);
20
- __exportStar(require("./helpers"), exports);
21
- var LiFi_1 = require("./LiFi");
22
- Object.defineProperty(exports, "LiFi", { enumerable: true, get: function () { return LiFi_1.LiFi; } });
23
- __exportStar(require("./types"), exports);
24
- __exportStar(require("./utils/errors"), exports);
3
+ exports.LiFiError = exports.Solana = exports.EVM = exports.LiFi = void 0;
4
+ const tslib_1 = require("tslib");
5
+ tslib_1.__exportStar(require("@lifi/types"), exports);
6
+ var LiFi_js_1 = require("./LiFi.js");
7
+ Object.defineProperty(exports, "LiFi", { enumerable: true, get: function () { return LiFi_js_1.LiFi; } });
8
+ tslib_1.__exportStar(require("./execution/index.js"), exports);
9
+ tslib_1.__exportStar(require("./helpers.js"), exports);
10
+ var EVM_js_1 = require("./providers/EVM.js");
11
+ Object.defineProperty(exports, "EVM", { enumerable: true, get: function () { return EVM_js_1.EVM; } });
12
+ var Solana_js_1 = require("./providers/Solana.js");
13
+ Object.defineProperty(exports, "Solana", { enumerable: true, get: function () { return Solana_js_1.Solana; } });
14
+ tslib_1.__exportStar(require("./types/index.js"), exports);
15
+ tslib_1.__exportStar(require("./utils/errors.js"), exports);
16
+ var errors_js_1 = require("./utils/errors.js");
17
+ Object.defineProperty(exports, "LiFiError", { enumerable: true, get: function () { return errors_js_1.LiFiError; } });
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,sDAA2B;AAC3B,qCAAgC;AAAvB,+FAAA,IAAI,OAAA;AACb,+DAAoC;AACpC,uDAA4B;AAC5B,6CAAiE;AAAxD,6FAAA,GAAG,OAAA;AACZ,mDAA0E;AAAjE,mGAAA,MAAM,OAAA;AACf,2DAAgC;AAChC,4DAAiC;AACjC,+CAA6D;AAApD,sGAAA,SAAS,OAAA"}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isEVM = exports.EVM = void 0;
4
+ const viem_1 = require("viem");
5
+ const EVMStepExecutor_js_1 = require("../execution/EVMStepExecutor.js");
6
+ const types_js_1 = require("./types.js");
7
+ function EVM(options) {
8
+ let getWalletClient = options?.getWalletClient;
9
+ return {
10
+ get type() {
11
+ return types_js_1.ProviderType.EVM;
12
+ },
13
+ isProviderStep(step) {
14
+ const isProviderStep = (0, viem_1.isAddress)(step.action.fromAddress);
15
+ return isProviderStep;
16
+ },
17
+ async getStepExecutor(options) {
18
+ if (!getWalletClient) {
19
+ throw new Error(`getWalletClient is not provided.`);
20
+ }
21
+ const walletClient = await getWalletClient();
22
+ const executor = new EVMStepExecutor_js_1.EVMStepExecutor({ walletClient, ...options });
23
+ return executor;
24
+ },
25
+ setOptions(options) {
26
+ getWalletClient = options.getWalletClient;
27
+ },
28
+ };
29
+ }
30
+ exports.EVM = EVM;
31
+ function isEVM(provider) {
32
+ return provider.type === types_js_1.ProviderType.EVM;
33
+ }
34
+ exports.isEVM = isEVM;
35
+ //# sourceMappingURL=EVM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EVM.js","sourceRoot":"","sources":["../../../src/providers/EVM.ts"],"names":[],"mappings":";;;AACA,+BAAmD;AACnD,wEAAiE;AAGjE,yCAAyC;AAUzC,SAAgB,GAAG,CAAC,OAA4B;IAC9C,IAAI,eAAe,GAAG,OAAO,EAAE,eAAe,CAAA;IAC9C,OAAO;QACL,IAAI,IAAI;YACN,OAAO,uBAAY,CAAC,GAAG,CAAA;QACzB,CAAC;QACD,cAAc,CAAC,IAAc;YAC3B,MAAM,cAAc,GAAG,IAAA,gBAAS,EAAC,IAAI,CAAC,MAAM,CAAC,WAAY,CAAC,CAAA;YAC1D,OAAO,cAAc,CAAA;QACvB,CAAC;QACD,KAAK,CAAC,eAAe,CACnB,OAA4B;YAE5B,IAAI,CAAC,eAAe,EAAE;gBACpB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAA;aACpD;YAED,MAAM,YAAY,GAAG,MAAM,eAAe,EAAE,CAAA;YAE5C,MAAM,QAAQ,GAAG,IAAI,oCAAe,CAAC,EAAE,YAAY,EAAE,GAAG,OAAO,EAAE,CAAC,CAAA;YAElE,OAAO,QAAQ,CAAA;QACjB,CAAC;QACD,UAAU,CAAC,OAA2B;YACpC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAA;QAC3C,CAAC;KACF,CAAA;AACH,CAAC;AA3BD,kBA2BC;AAED,SAAgB,KAAK,CAAC,QAAqB;IACzC,OAAO,QAAQ,CAAC,IAAI,KAAK,uBAAY,CAAC,GAAG,CAAA;AAC3C,CAAC;AAFD,sBAEC"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isEVM = exports.Solana = void 0;
4
+ const web3_js_1 = require("@solana/web3.js");
5
+ const types_js_1 = require("./types.js");
6
+ function Solana(options) {
7
+ let getWalletClient = options?.getWalletClient;
8
+ return {
9
+ get type() {
10
+ return types_js_1.ProviderType.Solana;
11
+ },
12
+ isProviderStep(step) {
13
+ try {
14
+ const publickKey = new web3_js_1.PublicKey(step.action.fromAddress);
15
+ const isProviderStep = web3_js_1.PublicKey.isOnCurve(publickKey);
16
+ return isProviderStep;
17
+ }
18
+ catch (error) {
19
+ return false;
20
+ }
21
+ },
22
+ async getStepExecutor(_options) {
23
+ if (!getWalletClient) {
24
+ throw new Error(`getWalletClient is not provided.`);
25
+ }
26
+ return null;
27
+ },
28
+ setOptions(options) {
29
+ getWalletClient = options.getWalletClient;
30
+ },
31
+ };
32
+ }
33
+ exports.Solana = Solana;
34
+ function isEVM(provider) {
35
+ return provider.type === types_js_1.ProviderType.Solana;
36
+ }
37
+ exports.isEVM = isEVM;
38
+ //# sourceMappingURL=Solana.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Solana.js","sourceRoot":"","sources":["../../../src/providers/Solana.ts"],"names":[],"mappings":";;;AACA,6CAA2C;AAI3C,yCAAyC;AAUzC,SAAgB,MAAM,CAAC,OAA+B;IACpD,IAAI,eAAe,GAAG,OAAO,EAAE,eAAe,CAAA;IAC9C,OAAO;QACL,IAAI,IAAI;YACN,OAAO,uBAAY,CAAC,MAAM,CAAA;QAC5B,CAAC;QACD,cAAc,CAAC,IAAc;YAC3B,IAAI;gBACF,MAAM,UAAU,GAAG,IAAI,mBAAS,CAAC,IAAI,CAAC,MAAM,CAAC,WAAY,CAAC,CAAA;gBAC1D,MAAM,cAAc,GAAG,mBAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;gBACtD,OAAO,cAAc,CAAA;aACtB;YAAC,OAAO,KAAK,EAAE;gBACd,OAAO,KAAK,CAAA;aACb;QACH,CAAC;QACD,KAAK,CAAC,eAAe,CACnB,QAA6B;YAE7B,IAAI,CAAC,eAAe,EAAE;gBACpB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAA;aACpD;YAID,OAAO,IAAK,CAAA;QACd,CAAC;QACD,UAAU,CAAC,OAA8B;YACvC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAA;QAC3C,CAAC;KACF,CAAA;AACH,CAAC;AA9BD,wBA8BC;AAED,SAAgB,KAAK,CAAC,QAAqB;IACzC,OAAO,QAAQ,CAAC,IAAI,KAAK,uBAAY,CAAC,MAAM,CAAA;AAC9C,CAAC;AAFD,sBAEC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./types.js"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/providers/index.ts"],"names":[],"mappings":";;;AAAA,qDAA0B"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProviderType = void 0;
4
+ var ProviderType;
5
+ (function (ProviderType) {
6
+ ProviderType["EVM"] = "EVM";
7
+ ProviderType["Solana"] = "Solana";
8
+ })(ProviderType || (exports.ProviderType = ProviderType = {}));
9
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/providers/types.ts"],"names":[],"mappings":";;;AAUA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,2BAAW,CAAA;IACX,iCAAiB,CAAA;AACnB,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB"}