@lifi/sdk 3.0.0-alpha.2 → 3.0.0-alpha.21

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 (446) hide show
  1. package/dist/_cjs/config.js +48 -0
  2. package/dist/_cjs/config.js.map +1 -0
  3. package/dist/{cjs → _cjs}/constants.js +2 -4
  4. package/dist/_cjs/constants.js.map +1 -0
  5. package/dist/_cjs/core/BaseStepExecutor.js +55 -0
  6. package/dist/_cjs/core/BaseStepExecutor.js.map +1 -0
  7. package/dist/_cjs/core/EVM/EVM.js +46 -0
  8. package/dist/_cjs/core/EVM/EVM.js.map +1 -0
  9. package/dist/_cjs/core/EVM/EVMStepExecutor.js +276 -0
  10. package/dist/_cjs/core/EVM/EVMStepExecutor.js.map +1 -0
  11. package/dist/{cjs/types → _cjs/core/EVM}/abi.js +1 -0
  12. package/dist/_cjs/core/EVM/abi.js.map +1 -0
  13. package/dist/{cjs/execution → _cjs/core/EVM}/checkAllowance.js +12 -12
  14. package/dist/_cjs/core/EVM/checkAllowance.js.map +1 -0
  15. package/dist/{cjs/allowance → _cjs/core/EVM}/getAllowance.js +15 -17
  16. package/dist/_cjs/core/EVM/getAllowance.js.map +1 -0
  17. package/dist/{cjs/balance/getBalance.js → _cjs/core/EVM/getEVMBalance.js} +22 -22
  18. package/dist/_cjs/core/EVM/getEVMBalance.js.map +1 -0
  19. package/dist/{cjs/execution → _cjs/core/EVM}/multisig.js +7 -11
  20. package/dist/_cjs/core/EVM/multisig.js.map +1 -0
  21. package/dist/_cjs/core/EVM/publicClient.js +35 -0
  22. package/dist/_cjs/core/EVM/publicClient.js.map +1 -0
  23. package/dist/_cjs/core/EVM/setAllowance.js +71 -0
  24. package/dist/_cjs/core/EVM/setAllowance.js.map +1 -0
  25. package/dist/_cjs/core/EVM/switchChain.js +37 -0
  26. package/dist/_cjs/core/EVM/switchChain.js.map +1 -0
  27. package/dist/_cjs/core/EVM/types.js +9 -0
  28. package/dist/_cjs/core/EVM/types.js.map +1 -0
  29. package/dist/{cjs/utils/getMaxPriorityFeePerGas.js → _cjs/core/EVM/utils.js} +11 -3
  30. package/dist/_cjs/core/EVM/utils.js.map +1 -0
  31. package/dist/_cjs/core/Solana/Solana.js +44 -0
  32. package/dist/_cjs/core/Solana/Solana.js.map +1 -0
  33. package/dist/_cjs/core/Solana/SolanaStepExecutor.js +157 -0
  34. package/dist/_cjs/core/Solana/SolanaStepExecutor.js.map +1 -0
  35. package/dist/_cjs/core/Solana/connection.js +18 -0
  36. package/dist/_cjs/core/Solana/connection.js.map +1 -0
  37. package/dist/_cjs/core/Solana/getSolanaBalance.js +50 -0
  38. package/dist/_cjs/core/Solana/getSolanaBalance.js.map +1 -0
  39. package/dist/_cjs/core/Solana/types.js +10 -0
  40. package/dist/_cjs/core/Solana/types.js.map +1 -0
  41. package/dist/_cjs/core/StatusManager.js +167 -0
  42. package/dist/_cjs/core/StatusManager.js.map +1 -0
  43. package/dist/{cjs/execution → _cjs/core}/checkBalance.js +5 -5
  44. package/dist/_cjs/core/checkBalance.js.map +1 -0
  45. package/dist/_cjs/core/execution.js +134 -0
  46. package/dist/_cjs/core/execution.js.map +1 -0
  47. package/dist/_cjs/core/executionState.js +23 -0
  48. package/dist/_cjs/core/executionState.js.map +1 -0
  49. package/dist/_cjs/core/index.js +7 -0
  50. package/dist/_cjs/core/index.js.map +1 -0
  51. package/dist/_cjs/core/prepareRestart.js +23 -0
  52. package/dist/_cjs/core/prepareRestart.js.map +1 -0
  53. package/dist/_cjs/core/provider.js +15 -0
  54. package/dist/_cjs/core/provider.js.map +1 -0
  55. package/dist/_cjs/core/stepComparison.js +25 -0
  56. package/dist/_cjs/core/stepComparison.js.map +1 -0
  57. package/dist/{cjs/allowance → _cjs/core}/types.js +1 -0
  58. package/dist/_cjs/core/types.js.map +1 -0
  59. package/dist/{cjs/execution → _cjs/core}/utils.js +16 -10
  60. package/dist/_cjs/core/utils.js.map +1 -0
  61. package/dist/{cjs/execution → _cjs/core}/waitForReceivingTransaction.js +10 -12
  62. package/dist/_cjs/core/waitForReceivingTransaction.js.map +1 -0
  63. package/dist/_cjs/createConfig.js +48 -0
  64. package/dist/_cjs/createConfig.js.map +1 -0
  65. package/dist/{cjs → _cjs}/helpers.js +11 -25
  66. package/dist/_cjs/helpers.js.map +1 -0
  67. package/dist/_cjs/index.js +20 -0
  68. package/dist/_cjs/index.js.map +1 -0
  69. package/dist/_cjs/package.json +1 -0
  70. package/dist/{cjs → _cjs}/request.js +22 -16
  71. package/dist/_cjs/request.js.map +1 -0
  72. package/dist/_cjs/services/api.js +284 -0
  73. package/dist/_cjs/services/api.js.map +1 -0
  74. package/dist/_cjs/services/balance.js +49 -0
  75. package/dist/_cjs/services/balance.js.map +1 -0
  76. package/dist/{cjs → _cjs}/typeguards.js +1 -0
  77. package/dist/_cjs/typeguards.js.map +1 -0
  78. package/dist/_cjs/types/index.js +5 -0
  79. package/dist/_cjs/types/index.js.map +1 -0
  80. package/dist/{cjs/types/internal.types.js → _cjs/types/internal.js} +1 -0
  81. package/dist/_cjs/types/internal.js.map +1 -0
  82. package/dist/{cjs → _cjs}/utils/errors.js +25 -3
  83. package/dist/_cjs/utils/errors.js.map +1 -0
  84. package/dist/_cjs/utils/getTransactionMessage.js +31 -0
  85. package/dist/_cjs/utils/getTransactionMessage.js.map +1 -0
  86. package/dist/_cjs/utils/index.js +9 -0
  87. package/dist/_cjs/utils/index.js.map +1 -0
  88. package/dist/{cjs → _cjs}/utils/median.js +1 -0
  89. package/dist/_cjs/utils/median.js.map +1 -0
  90. package/dist/_cjs/utils/parseBackendError.js +27 -0
  91. package/dist/_cjs/utils/parseBackendError.js.map +1 -0
  92. package/dist/_cjs/utils/parseError.js +67 -0
  93. package/dist/_cjs/utils/parseError.js.map +1 -0
  94. package/dist/{cjs → _cjs}/utils/utils.js +5 -11
  95. package/dist/_cjs/utils/utils.js.map +1 -0
  96. package/dist/{cjs → _cjs}/version.js +2 -1
  97. package/dist/_cjs/version.js.map +1 -0
  98. package/dist/_esm/config.js +45 -0
  99. package/dist/_esm/config.js.map +1 -0
  100. package/dist/{constants.js → _esm/constants.js} +1 -0
  101. package/dist/_esm/constants.js.map +1 -0
  102. package/dist/_esm/core/BaseStepExecutor.js +52 -0
  103. package/dist/_esm/core/BaseStepExecutor.js.map +1 -0
  104. package/dist/_esm/core/EVM/EVM.js +42 -0
  105. package/dist/_esm/core/EVM/EVM.js.map +1 -0
  106. package/dist/_esm/core/EVM/EVMStepExecutor.js +304 -0
  107. package/dist/_esm/core/EVM/EVMStepExecutor.js.map +1 -0
  108. package/dist/{types → _esm/core/EVM}/abi.js +1 -0
  109. package/dist/_esm/core/EVM/abi.js.map +1 -0
  110. package/dist/{execution → _esm/core/EVM}/checkAllowance.js +8 -6
  111. package/dist/_esm/core/EVM/checkAllowance.js.map +1 -0
  112. package/dist/{allowance → _esm/core/EVM}/getAllowance.js +20 -5
  113. package/dist/_esm/core/EVM/getAllowance.js.map +1 -0
  114. package/dist/{balance/getBalance.js → _esm/core/EVM/getEVMBalance.js} +11 -11
  115. package/dist/_esm/core/EVM/getEVMBalance.js.map +1 -0
  116. package/dist/{execution → _esm/core/EVM}/multisig.js +5 -6
  117. package/dist/_esm/core/EVM/multisig.js.map +1 -0
  118. package/dist/_esm/core/EVM/publicClient.js +37 -0
  119. package/dist/_esm/core/EVM/publicClient.js.map +1 -0
  120. package/dist/{allowance → _esm/core/EVM}/setAllowance.js +46 -11
  121. package/dist/_esm/core/EVM/setAllowance.js.map +1 -0
  122. package/dist/{execution → _esm/core/EVM}/switchChain.js +5 -3
  123. package/dist/_esm/core/EVM/switchChain.js.map +1 -0
  124. package/dist/_esm/core/EVM/types.js +6 -0
  125. package/dist/_esm/core/EVM/types.js.map +1 -0
  126. package/dist/{utils/getMaxPriorityFeePerGas.js → _esm/core/EVM/utils.js} +9 -1
  127. package/dist/_esm/core/EVM/utils.js.map +1 -0
  128. package/dist/_esm/core/Solana/Solana.js +40 -0
  129. package/dist/_esm/core/Solana/Solana.js.map +1 -0
  130. package/dist/_esm/core/Solana/SolanaStepExecutor.js +158 -0
  131. package/dist/_esm/core/Solana/SolanaStepExecutor.js.map +1 -0
  132. package/dist/_esm/core/Solana/connection.js +19 -0
  133. package/dist/_esm/core/Solana/connection.js.map +1 -0
  134. package/dist/_esm/core/Solana/getSolanaBalance.js +46 -0
  135. package/dist/_esm/core/Solana/getSolanaBalance.js.map +1 -0
  136. package/dist/_esm/core/Solana/types.js +7 -0
  137. package/dist/_esm/core/Solana/types.js.map +1 -0
  138. package/dist/_esm/core/StatusManager.js +203 -0
  139. package/dist/_esm/core/StatusManager.js.map +1 -0
  140. package/dist/{execution → _esm/core}/checkBalance.js +3 -2
  141. package/dist/_esm/core/checkBalance.js.map +1 -0
  142. package/dist/_esm/core/execution.js +173 -0
  143. package/dist/_esm/core/execution.js.map +1 -0
  144. package/dist/_esm/core/executionState.js +20 -0
  145. package/dist/_esm/core/executionState.js.map +1 -0
  146. package/dist/_esm/core/index.js +4 -0
  147. package/dist/_esm/core/index.js.map +1 -0
  148. package/dist/_esm/core/prepareRestart.js +64 -0
  149. package/dist/_esm/core/prepareRestart.js.map +1 -0
  150. package/dist/_esm/core/provider.js +11 -0
  151. package/dist/_esm/core/provider.js.map +1 -0
  152. package/dist/{execution → _esm/core}/stepComparison.js +7 -5
  153. package/dist/_esm/core/stepComparison.js.map +1 -0
  154. package/dist/_esm/core/types.js +2 -0
  155. package/dist/_esm/core/types.js.map +1 -0
  156. package/dist/{execution → _esm/core}/utils.js +14 -0
  157. package/dist/_esm/core/utils.js.map +1 -0
  158. package/dist/{execution → _esm/core}/waitForReceivingTransaction.js +8 -7
  159. package/dist/_esm/core/waitForReceivingTransaction.js.map +1 -0
  160. package/dist/_esm/createConfig.js +45 -0
  161. package/dist/_esm/createConfig.js.map +1 -0
  162. package/dist/{helpers.js → _esm/helpers.js} +4 -3
  163. package/dist/_esm/helpers.js.map +1 -0
  164. package/dist/_esm/index.js +12 -0
  165. package/dist/_esm/index.js.map +1 -0
  166. package/dist/_esm/package.json +1 -0
  167. package/dist/{request.js → _esm/request.js} +19 -9
  168. package/dist/_esm/request.js.map +1 -0
  169. package/dist/_esm/services/api.js +353 -0
  170. package/dist/_esm/services/api.js.map +1 -0
  171. package/dist/_esm/services/balance.js +65 -0
  172. package/dist/_esm/services/balance.js.map +1 -0
  173. package/dist/{typeguards.js → _esm/typeguards.js} +1 -0
  174. package/dist/_esm/typeguards.js.map +1 -0
  175. package/dist/_esm/types/index.js +2 -0
  176. package/dist/_esm/types/index.js.map +1 -0
  177. package/dist/_esm/types/internal.js +2 -0
  178. package/dist/_esm/types/internal.js.map +1 -0
  179. package/dist/{utils → _esm/utils}/errors.js +25 -0
  180. package/dist/_esm/utils/errors.js.map +1 -0
  181. package/dist/_esm/utils/getTransactionMessage.js +28 -0
  182. package/dist/_esm/utils/getTransactionMessage.js.map +1 -0
  183. package/dist/_esm/utils/index.js +6 -0
  184. package/dist/_esm/utils/index.js.map +1 -0
  185. package/dist/{utils → _esm/utils}/median.js +1 -0
  186. package/dist/_esm/utils/median.js.map +1 -0
  187. package/dist/_esm/utils/parseBackendError.js +24 -0
  188. package/dist/_esm/utils/parseBackendError.js.map +1 -0
  189. package/dist/{utils → _esm/utils}/parseError.js +4 -53
  190. package/dist/_esm/utils/parseError.js.map +1 -0
  191. package/dist/{utils → _esm/utils}/utils.js +2 -1
  192. package/dist/_esm/utils/utils.js.map +1 -0
  193. package/dist/_esm/version.js +3 -0
  194. package/dist/_esm/version.js.map +1 -0
  195. package/dist/_types/config.d.ts +11 -0
  196. package/dist/_types/config.d.ts.map +1 -0
  197. package/dist/{cjs → _types}/constants.d.ts +1 -0
  198. package/dist/_types/constants.d.ts.map +1 -0
  199. package/dist/_types/core/BaseStepExecutor.d.ts +13 -0
  200. package/dist/_types/core/BaseStepExecutor.d.ts.map +1 -0
  201. package/dist/_types/core/EVM/EVM.d.ts +3 -0
  202. package/dist/_types/core/EVM/EVM.d.ts.map +1 -0
  203. package/dist/_types/core/EVM/EVMStepExecutor.d.ts +17 -0
  204. package/dist/_types/core/EVM/EVMStepExecutor.d.ts.map +1 -0
  205. package/dist/{cjs/types → _types/core/EVM}/abi.d.ts +1 -0
  206. package/dist/_types/core/EVM/abi.d.ts.map +1 -0
  207. package/dist/_types/core/EVM/checkAllowance.d.ts +6 -0
  208. package/dist/_types/core/EVM/checkAllowance.d.ts.map +1 -0
  209. package/dist/{cjs/allowance → _types/core/EVM}/getAllowance.d.ts +15 -1
  210. package/dist/_types/core/EVM/getAllowance.d.ts.map +1 -0
  211. package/dist/_types/core/EVM/getEVMBalance.d.ts +3 -0
  212. package/dist/_types/core/EVM/getEVMBalance.d.ts.map +1 -0
  213. package/dist/_types/core/EVM/multisig.d.ts +6 -0
  214. package/dist/_types/core/EVM/multisig.d.ts.map +1 -0
  215. package/dist/_types/core/EVM/publicClient.d.ts +8 -0
  216. package/dist/_types/core/EVM/publicClient.d.ts.map +1 -0
  217. package/dist/_types/core/EVM/setAllowance.d.ts +25 -0
  218. package/dist/_types/core/EVM/setAllowance.d.ts.map +1 -0
  219. package/dist/{execution → _types/core/EVM}/switchChain.d.ts +6 -4
  220. package/dist/_types/core/EVM/switchChain.d.ts.map +1 -0
  221. package/dist/_types/core/EVM/types.d.ts +57 -0
  222. package/dist/_types/core/EVM/types.d.ts.map +1 -0
  223. package/dist/_types/core/EVM/utils.d.ts +5 -0
  224. package/dist/_types/core/EVM/utils.d.ts.map +1 -0
  225. package/dist/_types/core/Solana/Solana.d.ts +3 -0
  226. package/dist/_types/core/Solana/Solana.d.ts.map +1 -0
  227. package/dist/_types/core/Solana/SolanaStepExecutor.d.ts +13 -0
  228. package/dist/_types/core/Solana/SolanaStepExecutor.d.ts.map +1 -0
  229. package/dist/_types/core/Solana/connection.d.ts +8 -0
  230. package/dist/_types/core/Solana/connection.d.ts.map +1 -0
  231. package/dist/_types/core/Solana/getSolanaBalance.d.ts +3 -0
  232. package/dist/_types/core/Solana/getSolanaBalance.d.ts.map +1 -0
  233. package/dist/_types/core/Solana/types.d.ts +13 -0
  234. package/dist/_types/core/Solana/types.d.ts.map +1 -0
  235. package/dist/{cjs/execution → _types/core}/StatusManager.d.ts +12 -16
  236. package/dist/_types/core/StatusManager.d.ts.map +1 -0
  237. package/dist/_types/core/checkBalance.d.ts +3 -0
  238. package/dist/_types/core/checkBalance.d.ts.map +1 -0
  239. package/dist/_types/core/execution.d.ts +42 -0
  240. package/dist/_types/core/execution.d.ts.map +1 -0
  241. package/dist/_types/core/executionState.d.ts +16 -0
  242. package/dist/_types/core/executionState.d.ts.map +1 -0
  243. package/dist/_types/core/index.d.ts +4 -0
  244. package/dist/_types/core/index.d.ts.map +1 -0
  245. package/dist/_types/core/prepareRestart.d.ts +3 -0
  246. package/dist/_types/core/prepareRestart.d.ts.map +1 -0
  247. package/dist/_types/core/provider.d.ts +3 -0
  248. package/dist/_types/core/provider.d.ts.map +1 -0
  249. package/dist/{execution → _types/core}/stepComparison.d.ts +7 -4
  250. package/dist/_types/core/stepComparison.d.ts.map +1 -0
  251. package/dist/_types/core/types.d.ts +71 -0
  252. package/dist/_types/core/types.d.ts.map +1 -0
  253. package/dist/{execution → _types/core}/utils.d.ts +5 -2
  254. package/dist/_types/core/utils.d.ts.map +1 -0
  255. package/dist/_types/core/waitForReceivingTransaction.d.ts +4 -0
  256. package/dist/_types/core/waitForReceivingTransaction.d.ts.map +1 -0
  257. package/dist/_types/createConfig.d.ts +7 -0
  258. package/dist/_types/createConfig.d.ts.map +1 -0
  259. package/dist/{helpers.d.ts → _types/helpers.d.ts} +4 -3
  260. package/dist/_types/helpers.d.ts.map +1 -0
  261. package/dist/_types/index.d.ts +12 -0
  262. package/dist/_types/index.d.ts.map +1 -0
  263. package/dist/{request.d.ts → _types/request.d.ts} +1 -0
  264. package/dist/_types/request.d.ts.map +1 -0
  265. package/dist/_types/services/api.d.ts +87 -0
  266. package/dist/_types/services/api.d.ts.map +1 -0
  267. package/dist/_types/services/balance.d.ts +30 -0
  268. package/dist/_types/services/balance.d.ts.map +1 -0
  269. package/dist/{cjs → _types}/typeguards.d.ts +3 -2
  270. package/dist/_types/typeguards.d.ts.map +1 -0
  271. package/dist/_types/types/index.d.ts +2 -0
  272. package/dist/_types/types/index.d.ts.map +1 -0
  273. package/dist/_types/types/internal.d.ts +56 -0
  274. package/dist/_types/types/internal.d.ts.map +1 -0
  275. package/dist/{utils → _types/utils}/errors.d.ts +1 -0
  276. package/dist/_types/utils/errors.d.ts.map +1 -0
  277. package/dist/_types/utils/getTransactionMessage.d.ts +4 -0
  278. package/dist/_types/utils/getTransactionMessage.d.ts.map +1 -0
  279. package/dist/_types/utils/index.d.ts +6 -0
  280. package/dist/_types/utils/index.d.ts.map +1 -0
  281. package/dist/{cjs → _types}/utils/median.d.ts +1 -0
  282. package/dist/_types/utils/median.d.ts.map +1 -0
  283. package/dist/_types/utils/parseBackendError.d.ts +3 -0
  284. package/dist/_types/utils/parseBackendError.d.ts.map +1 -0
  285. package/dist/{utils → _types/utils}/parseError.d.ts +4 -6
  286. package/dist/_types/utils/parseError.d.ts.map +1 -0
  287. package/dist/{utils → _types/utils}/utils.d.ts +1 -0
  288. package/dist/_types/utils/utils.d.ts.map +1 -0
  289. package/dist/_types/version.d.ts +3 -0
  290. package/dist/_types/version.d.ts.map +1 -0
  291. package/dist/config.ts +47 -0
  292. package/dist/constants.ts +7 -0
  293. package/dist/core/BaseStepExecutor.ts +40 -0
  294. package/dist/core/EVM/EVM.ts +50 -0
  295. package/dist/core/EVM/EVMStepExecutor.ts +472 -0
  296. package/dist/core/EVM/abi.ts +47 -0
  297. package/dist/core/EVM/checkAllowance.ts +152 -0
  298. package/dist/core/EVM/getAllowance.ts +146 -0
  299. package/dist/core/EVM/getEVMBalance.ts +120 -0
  300. package/dist/core/EVM/multisig.ts +53 -0
  301. package/dist/core/EVM/publicClient.ts +46 -0
  302. package/dist/core/EVM/setAllowance.ts +144 -0
  303. package/dist/core/EVM/switchChain.ts +77 -0
  304. package/dist/core/EVM/types.ts +75 -0
  305. package/dist/core/EVM/utils.ts +43 -0
  306. package/dist/core/Solana/Solana.ts +46 -0
  307. package/dist/core/Solana/SolanaStepExecutor.ts +253 -0
  308. package/dist/core/Solana/connection.ts +19 -0
  309. package/dist/core/Solana/getSolanaBalance.ts +62 -0
  310. package/dist/core/Solana/types.ts +18 -0
  311. package/dist/core/StatusManager.ts +238 -0
  312. package/dist/core/checkBalance.ts +48 -0
  313. package/dist/core/execution.ts +218 -0
  314. package/dist/core/executionState.ts +40 -0
  315. package/dist/core/index.ts +3 -0
  316. package/dist/core/prepareRestart.ts +81 -0
  317. package/dist/core/provider.ts +12 -0
  318. package/dist/core/stepComparison.ts +51 -0
  319. package/dist/core/types.ts +103 -0
  320. package/dist/core/utils.ts +122 -0
  321. package/dist/core/waitForReceivingTransaction.ts +73 -0
  322. package/dist/createConfig.ts +54 -0
  323. package/dist/helpers.ts +97 -0
  324. package/dist/index.ts +11 -0
  325. package/dist/request.ts +79 -0
  326. package/dist/services/api.ts +472 -0
  327. package/dist/services/balance.ts +93 -0
  328. package/dist/typeguards.ts +89 -0
  329. package/dist/types/index.ts +1 -0
  330. package/dist/types/internal.ts +58 -0
  331. package/dist/utils/errors.ts +231 -0
  332. package/dist/utils/getTransactionMessage.ts +46 -0
  333. package/dist/utils/index.ts +5 -0
  334. package/dist/utils/median.ts +11 -0
  335. package/dist/utils/parseBackendError.ts +50 -0
  336. package/dist/utils/parseError.ts +204 -0
  337. package/dist/utils/utils.ts +48 -0
  338. package/dist/version.ts +2 -0
  339. package/package.json +27 -86
  340. package/dist/LiFi.d.ts +0 -171
  341. package/dist/LiFi.js +0 -246
  342. package/dist/allowance/getAllowance.d.ts +0 -6
  343. package/dist/allowance/index.d.ts +0 -3
  344. package/dist/allowance/index.js +0 -3
  345. package/dist/allowance/setAllowance.d.ts +0 -5
  346. package/dist/allowance/types.d.ts +0 -27
  347. package/dist/allowance/types.js +0 -1
  348. package/dist/balance/getBalance.d.ts +0 -2
  349. package/dist/balance/getTokenBalance.d.ts +0 -8
  350. package/dist/balance/getTokenBalance.js +0 -27
  351. package/dist/balance/index.d.ts +0 -2
  352. package/dist/balance/index.js +0 -2
  353. package/dist/cjs/LiFi.d.ts +0 -171
  354. package/dist/cjs/LiFi.js +0 -276
  355. package/dist/cjs/allowance/index.d.ts +0 -3
  356. package/dist/cjs/allowance/index.js +0 -19
  357. package/dist/cjs/allowance/setAllowance.d.ts +0 -5
  358. package/dist/cjs/allowance/setAllowance.js +0 -56
  359. package/dist/cjs/allowance/types.d.ts +0 -27
  360. package/dist/cjs/balance/getBalance.d.ts +0 -2
  361. package/dist/cjs/balance/getTokenBalance.d.ts +0 -8
  362. package/dist/cjs/balance/getTokenBalance.js +0 -33
  363. package/dist/cjs/balance/index.d.ts +0 -2
  364. package/dist/cjs/balance/index.js +0 -18
  365. package/dist/cjs/connectors.d.ts +0 -8
  366. package/dist/cjs/connectors.js +0 -75
  367. package/dist/cjs/execution/RouteExecutionManager.d.ts +0 -59
  368. package/dist/cjs/execution/RouteExecutionManager.js +0 -202
  369. package/dist/cjs/execution/StatusManager.js +0 -171
  370. package/dist/cjs/execution/StepExecutionManager.d.ts +0 -7
  371. package/dist/cjs/execution/StepExecutionManager.js +0 -267
  372. package/dist/cjs/execution/StepExecutor.d.ts +0 -15
  373. package/dist/cjs/execution/StepExecutor.js +0 -62
  374. package/dist/cjs/execution/checkAllowance.d.ts +0 -4
  375. package/dist/cjs/execution/checkBalance.d.ts +0 -2
  376. package/dist/cjs/execution/index.d.ts +0 -1
  377. package/dist/cjs/execution/index.js +0 -17
  378. package/dist/cjs/execution/multisig.d.ts +0 -4
  379. package/dist/cjs/execution/prepareRestart.d.ts +0 -3
  380. package/dist/cjs/execution/prepareRestart.js +0 -65
  381. package/dist/cjs/execution/stepComparison.d.ts +0 -14
  382. package/dist/cjs/execution/stepComparison.js +0 -37
  383. package/dist/cjs/execution/switchChain.d.ts +0 -21
  384. package/dist/cjs/execution/switchChain.js +0 -54
  385. package/dist/cjs/execution/utils.d.ts +0 -12
  386. package/dist/cjs/execution/waitForReceivingTransaction.d.ts +0 -3
  387. package/dist/cjs/helpers.d.ts +0 -18
  388. package/dist/cjs/index.d.ts +0 -5
  389. package/dist/cjs/index.js +0 -24
  390. package/dist/cjs/request.d.ts +0 -9
  391. package/dist/cjs/services/ApiService.d.ts +0 -17
  392. package/dist/cjs/services/ApiService.js +0 -326
  393. package/dist/cjs/services/ChainsService.d.ts +0 -11
  394. package/dist/cjs/services/ChainsService.js +0 -39
  395. package/dist/cjs/services/ConfigService.d.ts +0 -23
  396. package/dist/cjs/services/ConfigService.js +0 -101
  397. package/dist/cjs/types/index.d.ts +0 -4
  398. package/dist/cjs/types/index.js +0 -22
  399. package/dist/cjs/types/internal.types.d.ts +0 -142
  400. package/dist/cjs/utils/errors.d.ts +0 -107
  401. package/dist/cjs/utils/getMaxPriorityFeePerGas.d.ts +0 -2
  402. package/dist/cjs/utils/index.d.ts +0 -5
  403. package/dist/cjs/utils/index.js +0 -21
  404. package/dist/cjs/utils/parseError.d.ts +0 -37
  405. package/dist/cjs/utils/parseError.js +0 -157
  406. package/dist/cjs/utils/utils.d.ts +0 -10
  407. package/dist/cjs/version.d.ts +0 -2
  408. package/dist/connectors.d.ts +0 -8
  409. package/dist/connectors.js +0 -41
  410. package/dist/constants.d.ts +0 -6
  411. package/dist/execution/RouteExecutionManager.d.ts +0 -59
  412. package/dist/execution/RouteExecutionManager.js +0 -195
  413. package/dist/execution/StatusManager.d.ts +0 -67
  414. package/dist/execution/StatusManager.js +0 -167
  415. package/dist/execution/StepExecutionManager.d.ts +0 -7
  416. package/dist/execution/StepExecutionManager.js +0 -260
  417. package/dist/execution/StepExecutor.d.ts +0 -15
  418. package/dist/execution/StepExecutor.js +0 -58
  419. package/dist/execution/checkAllowance.d.ts +0 -4
  420. package/dist/execution/checkBalance.d.ts +0 -2
  421. package/dist/execution/index.d.ts +0 -1
  422. package/dist/execution/index.js +0 -1
  423. package/dist/execution/multisig.d.ts +0 -4
  424. package/dist/execution/prepareRestart.d.ts +0 -3
  425. package/dist/execution/prepareRestart.js +0 -61
  426. package/dist/execution/waitForReceivingTransaction.d.ts +0 -3
  427. package/dist/index.d.ts +0 -5
  428. package/dist/index.js +0 -6
  429. package/dist/services/ApiService.d.ts +0 -17
  430. package/dist/services/ApiService.js +0 -321
  431. package/dist/services/ChainsService.d.ts +0 -11
  432. package/dist/services/ChainsService.js +0 -33
  433. package/dist/services/ConfigService.d.ts +0 -23
  434. package/dist/services/ConfigService.js +0 -99
  435. package/dist/typeguards.d.ts +0 -4
  436. package/dist/types/abi.d.ts +0 -5
  437. package/dist/types/index.d.ts +0 -4
  438. package/dist/types/index.js +0 -4
  439. package/dist/types/internal.types.d.ts +0 -142
  440. package/dist/types/internal.types.js +0 -1
  441. package/dist/utils/getMaxPriorityFeePerGas.d.ts +0 -2
  442. package/dist/utils/index.d.ts +0 -5
  443. package/dist/utils/index.js +0 -5
  444. package/dist/utils/median.d.ts +0 -1
  445. package/dist/version.d.ts +0 -2
  446. package/dist/version.js +0 -2
@@ -1,4 +1,4 @@
1
- import type { Execution, InternalExecutionSettings, LifiStep, Process, ProcessType, Route, Status, Token } from '../types';
1
+ import type { Execution, LiFiStep, Process, ProcessType, Status, Token } from '@lifi/types';
2
2
  interface Receipt {
3
3
  fromAmount?: string;
4
4
  toAmount?: string;
@@ -9,35 +9,30 @@ interface Receipt {
9
9
  gasAmount?: string;
10
10
  gasAmountUSD?: string;
11
11
  }
12
- type InternalUpdateRouteCallback = (route: Route) => void;
13
12
  type OptionalParameters = Partial<Pick<Process, 'doneAt' | 'failedAt' | 'txHash' | 'txLink' | 'error' | 'substatus' | 'substatusMessage' | 'multisigTxHash'>>;
14
13
  /**
15
14
  * Manages status updates of a route and provides various functions for tracking processes
16
- * @param {Route} route The route this StatusManger belongs to.
17
- * @param {InternalExecutionSettings} settings The ExecutionSettings for this route.
18
- * @param {InternalUpdateRouteCallback} internalUpdateRouteCallback Internal callback to propage route changes.
15
+ * @param {string} routeId The route dd this StatusManger belongs to.
19
16
  * @returns {StatusManager} An instance of StatusManager.
20
17
  */
21
18
  export declare class StatusManager {
22
- private readonly route;
23
- private readonly settings;
24
- private readonly internalUpdateRouteCallback;
19
+ private readonly routeId;
25
20
  private shouldUpdate;
26
- constructor(route: Route, settings: InternalExecutionSettings, internalUpdateRouteCallback: InternalUpdateRouteCallback);
21
+ constructor(routeId: string);
27
22
  /**
28
23
  * Initializes the execution object of a Step.
29
24
  * @param step The current step in execution
30
25
  * @returns The initialized execution object for this step and a function to update this step
31
26
  */
32
- initExecutionObject: (step: LifiStep) => Execution;
27
+ initExecutionObject: (step: LiFiStep) => Execution;
33
28
  /**
34
29
  * Updates the execution object of a Step.
35
30
  * @param step The current step in execution
36
31
  * @param status The status for the execution
37
32
  * @param receipt Optional. Information about received tokens
38
- * @returns The step with the updated execution object
33
+ * @returns The step with the updated execution object
39
34
  */
40
- updateExecution(step: LifiStep, status: Status, receipt?: Receipt): LifiStep;
35
+ updateExecution(step: LiFiStep, status: Status, receipt?: Receipt): LiFiStep;
41
36
  /**
42
37
  * Create and push a new process into the execution.
43
38
  * @param step The step that should contain the new process.
@@ -45,7 +40,7 @@ export declare class StatusManager {
45
40
  * @param status By default created procces is set to the STARTED status. We can override new process with the needed status.
46
41
  * @returns Returns process.
47
42
  */
48
- findOrCreateProcess: (step: LifiStep, type: ProcessType, status?: Status) => Process;
43
+ findOrCreateProcess: (step: LiFiStep, type: ProcessType, status?: Status) => Process;
49
44
  /**
50
45
  * Update a process object.
51
46
  * @param step The step where the process should be updated
@@ -54,14 +49,15 @@ export declare class StatusManager {
54
49
  * @param [params] Additional parameters to append to the process.
55
50
  * @returns The update process
56
51
  */
57
- updateProcess: (step: LifiStep, type: ProcessType, status: Status, params?: OptionalParameters) => Process;
52
+ updateProcess: (step: LiFiStep, type: ProcessType, status: Status, params?: OptionalParameters) => Process;
58
53
  /**
59
54
  * Remove a process from the execution
60
55
  * @param step The step where the process should be removed from
61
56
  * @param type The process type to remove
62
57
  */
63
- removeProcess: (step: LifiStep, type: ProcessType) => void;
64
- updateStepInRoute: (step: LifiStep) => LifiStep;
58
+ removeProcess: (step: LiFiStep, type: ProcessType) => void;
59
+ updateStepInRoute: (step: LiFiStep) => LiFiStep;
65
60
  allowUpdates(value: boolean): void;
66
61
  }
67
62
  export {};
63
+ //# sourceMappingURL=StatusManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatusManager.d.ts","sourceRoot":"./dist/","sources":["core/StatusManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,QAAQ,EACR,OAAO,EACP,WAAW,EACX,MAAM,EACN,KAAK,EACN,MAAM,aAAa,CAAA;AAKpB,UAAU,OAAO;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,KAAK,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,KAAK,kBAAkB,GAAG,OAAO,CAC/B,IAAI,CACF,OAAO,EACL,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,WAAW,GACX,kBAAkB,GAClB,gBAAgB,CACnB,CACF,CAAA;AAED;;;;GAIG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAQ;IAChC,OAAO,CAAC,YAAY,CAAO;gBAEf,OAAO,EAAE,MAAM;IAI3B;;;;OAIG;IACH,mBAAmB,SAAU,QAAQ,KAAG,SAAS,CAchD;IAED;;;;;;OAMG;IACH,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ;IAe5E;;;;;;OAMG;IACH,mBAAmB,SACX,QAAQ,QACR,WAAW,WACR,MAAM,KACd,OAAO,CAyBT;IAED;;;;;;;OAOG;IACH,aAAa,SACL,QAAQ,QACR,WAAW,UACT,MAAM,WACL,kBAAkB,KAC1B,OAAO,CAkDT;IAED;;;;OAIG;IACH,aAAa,SAAU,QAAQ,QAAQ,WAAW,KAAG,IAAI,CAOxD;IAED,iBAAiB,SAAU,QAAQ,KAAG,QAAQ,CAsB7C;IAED,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;CAGnC"}
@@ -0,0 +1,3 @@
1
+ import type { LiFiStep } from '@lifi/types';
2
+ export declare const checkBalance: (walletAddress: string, step: LiFiStep, depth?: number) => Promise<void>;
3
+ //# sourceMappingURL=checkBalance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkBalance.d.ts","sourceRoot":"./dist/","sources":["core/checkBalance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAK3C,eAAO,MAAM,YAAY,kBACR,MAAM,QACf,QAAQ,qBAEb,QAAQ,IAAI,CAsCd,CAAA"}
@@ -0,0 +1,42 @@
1
+ import type { Route } from '@lifi/types';
2
+ import type { ExecutionOptions } from './types.js';
3
+ /**
4
+ * Execute a route.
5
+ * @param route - The route that should be executed. Cannot be an active route.
6
+ * @param executionOptions - An object containing settings and callbacks.
7
+ * @returns The executed route.
8
+ * @throws {LiFiError} Throws a LiFiError if the execution fails.
9
+ */
10
+ export declare const executeRoute: (route: Route, executionOptions?: ExecutionOptions) => Promise<Route>;
11
+ /**
12
+ * Resume the execution of a route that has been stopped or had an error while executing.
13
+ * @param route - The route that is to be executed. Cannot be an active route.
14
+ * @param executionOptions - An object containing settings and callbacks.
15
+ * @returns The executed route.
16
+ * @throws {LiFiError} Throws a LiFiError if the execution fails.
17
+ */
18
+ export declare const resumeRoute: (route: Route, executionOptions?: ExecutionOptions) => Promise<Route>;
19
+ /**
20
+ * Updates route execution to background or foreground state.
21
+ * @param route - A route that is currently in execution.
22
+ * @param options - An object with execution settings.
23
+ */
24
+ export declare const updateRouteExecution: (route: Route, options: ExecutionOptions) => void;
25
+ /**
26
+ * Stops the execution of an active route.
27
+ * @param route - A route that is currently in execution.
28
+ * @returns The stopped route.
29
+ */
30
+ export declare const stopRouteExecution: (route: Route) => Route;
31
+ /**
32
+ * Get the list of active routes.
33
+ * @returns A list of routes.
34
+ */
35
+ export declare const getActiveRoutes: () => Route[];
36
+ /**
37
+ * Return the current route information for given route. The route has to be active.
38
+ * @param routeId - A route id.
39
+ * @returns The updated route.
40
+ */
41
+ export declare const getActiveRoute: (routeId: string) => Route | undefined;
42
+ //# sourceMappingURL=execution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution.d.ts","sourceRoot":"./dist/","sources":["core/execution.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAIxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,UAChB,KAAK,qBACO,gBAAgB,KAClC,QAAQ,KAAK,CAef,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,UACf,KAAK,qBACO,gBAAgB,KAClC,QAAQ,KAAK,CA6Bf,CAAA;AA4ED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,UACxB,KAAK,WACH,gBAAgB,KACxB,IAmBF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,UAAW,KAAK,KAAG,KAejD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAO,KAAK,EAIvC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,YAAa,MAAM,KAAG,KAAK,GAAG,SAExD,CAAA"}
@@ -0,0 +1,16 @@
1
+ import type { Route } from '@lifi/types';
2
+ import type { ExecutionOptions, StepExecutor } from './types.js';
3
+ export interface ExecutionData {
4
+ route: Route;
5
+ executors: StepExecutor[];
6
+ executionOptions?: ExecutionOptions;
7
+ promise?: Promise<Route>;
8
+ }
9
+ export interface ExecutionState {
10
+ state: Partial<Record<string, ExecutionData>>;
11
+ get(routeId: string): ExecutionData | undefined;
12
+ create(route: Route, executionOptions?: ExecutionOptions, promise?: Promise<Route>): ExecutionData;
13
+ delete(routeId: string): void;
14
+ }
15
+ export declare const executionState: ExecutionState;
16
+ //# sourceMappingURL=executionState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executionState.d.ts","sourceRoot":"./dist/","sources":["core/executionState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAEhE,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,KAAK,CAAA;IACZ,SAAS,EAAE,YAAY,EAAE,CAAA;IACzB,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAA;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAA;IAC7C,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAAA;IAC/C,MAAM,CACJ,KAAK,EAAE,KAAK,EACZ,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,OAAO,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,GACvB,aAAa,CAAA;IAChB,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B;AAED,eAAO,MAAM,cAAc,EAAE,cAkB5B,CAAA"}
@@ -0,0 +1,4 @@
1
+ export * from './StatusManager.js';
2
+ export * from './execution.js';
3
+ export * from './types.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"./dist/","sources":["core/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { Route } from '@lifi/types';
2
+ export declare const prepareRestart: (route: Route) => Promise<void>;
3
+ //# sourceMappingURL=prepareRestart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepareRestart.d.ts","sourceRoot":"./dist/","sources":["core/prepareRestart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,KAAK,EAAE,MAAM,aAAa,CAAA;AAElD,eAAO,MAAM,cAAc,UAAiB,KAAK,kBAWhD,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { ChainType } from '@lifi/types';
2
+ export declare const getProvider: <T>(type: ChainType) => T;
3
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"./dist/","sources":["core/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAG5C,eAAO,MAAM,WAAW,YAAa,SAAS,MAQ7C,CAAA"}
@@ -1,5 +1,6 @@
1
- import type { InternalExecutionSettings, LifiStep } from '../types';
2
- import type { StatusManager } from './StatusManager';
1
+ import type { LiFiStep } from '@lifi/types';
2
+ import type { StatusManager } from './StatusManager.js';
3
+ import type { ExecutionOptions } from './types.js';
3
4
  /**
4
5
  * This method checks whether the new and updated Step meets the required exchange rate conditions.
5
6
  * If yes it returns the updated Step.
@@ -9,6 +10,8 @@ import type { StatusManager } from './StatusManager';
9
10
  * @param newStep
10
11
  * @param settings
11
12
  * @param allowUserInteraction
12
- * @returns Return LifiStep
13
+ * @param executionOptions
14
+ * @returns Return LiFiStep
13
15
  */
14
- export declare const stepComparison: (statusManager: StatusManager, oldStep: LifiStep, newStep: LifiStep, settings: InternalExecutionSettings, allowUserInteraction: boolean) => Promise<LifiStep>;
16
+ export declare const stepComparison: (statusManager: StatusManager, oldStep: LiFiStep, newStep: LiFiStep, allowUserInteraction: boolean, executionOptions?: ExecutionOptions) => Promise<LiFiStep>;
17
+ //# sourceMappingURL=stepComparison.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stepComparison.d.ts","sourceRoot":"./dist/","sources":["core/stepComparison.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAGlD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,kBACV,aAAa,WACnB,QAAQ,WACR,QAAQ,wBACK,OAAO,qBACV,gBAAgB,KAClC,QAAQ,QAAQ,CA0BlB,CAAA"}
@@ -0,0 +1,71 @@
1
+ import type { ChainType, LiFiStep, Route, Token, TokenAmount } from '@lifi/types';
2
+ import type { WalletClient } from 'viem';
3
+ export interface SDKProvider {
4
+ readonly type: ChainType;
5
+ isAddress(address: string): boolean;
6
+ getStepExecutor(options: StepExecutorOptions): Promise<StepExecutor>;
7
+ getBalance(walletAddress: string, tokens: Token[]): Promise<TokenAmount[]>;
8
+ }
9
+ export interface StepExecutorOptions {
10
+ routeId: string;
11
+ executionOptions?: ExecutionOptions;
12
+ }
13
+ export interface InteractionSettings {
14
+ allowInteraction?: boolean;
15
+ allowUpdates?: boolean;
16
+ allowExecution?: boolean;
17
+ }
18
+ export interface StepExecutor {
19
+ allowUserInteraction: boolean;
20
+ allowExecution: boolean;
21
+ setInteraction(settings?: InteractionSettings): void;
22
+ executeStep(step: LiFiStep): Promise<LiFiStep>;
23
+ }
24
+ export type TransactionParameters = {
25
+ chainId?: number;
26
+ to?: string;
27
+ from?: string;
28
+ nonce?: number;
29
+ data?: string;
30
+ value?: bigint;
31
+ gas?: bigint;
32
+ gasPrice?: bigint;
33
+ maxFeePerGas?: bigint;
34
+ maxPriorityFeePerGas?: bigint;
35
+ };
36
+ export interface RouteExecutionData {
37
+ route: Route;
38
+ executors: StepExecutor[];
39
+ executionOptions?: ExecutionOptions;
40
+ }
41
+ export type RouteExecutionDataDictionary = Partial<Record<string, RouteExecutionData>>;
42
+ export type RouteExecutionDictionary = Partial<Record<string, Promise<Route>>>;
43
+ export type UpdateRouteHook = (updatedRoute: Route) => void;
44
+ export interface TransactionRequestParameters extends TransactionParameters {
45
+ requestType: 'approve' | 'transaction';
46
+ }
47
+ export type TransactionRequestUpdateHook = (updatedTxRequest: TransactionRequestParameters) => Promise<TransactionParameters>;
48
+ export type SwitchChainHook = (chainId: number) => Promise<WalletClient | undefined>;
49
+ export interface AcceptSlippageUpdateHookParams {
50
+ toToken: Token;
51
+ oldToAmount: string;
52
+ newToAmount: string;
53
+ oldSlippage: number;
54
+ newSlippage: number;
55
+ }
56
+ export type AcceptSlippageUpdateHook = (params: AcceptSlippageUpdateHookParams) => Promise<boolean | undefined>;
57
+ export interface ExchangeRateUpdateParams {
58
+ toToken: Token;
59
+ oldToAmount: string;
60
+ newToAmount: string;
61
+ }
62
+ export type AcceptExchangeRateUpdateHook = (params: ExchangeRateUpdateParams) => Promise<boolean | undefined>;
63
+ export interface ExecutionOptions {
64
+ acceptExchangeRateUpdateHook?: AcceptExchangeRateUpdateHook;
65
+ switchChainHook?: SwitchChainHook;
66
+ updateRouteHook?: UpdateRouteHook;
67
+ updateTransactionRequestHook?: TransactionRequestUpdateHook;
68
+ executeInBackground?: boolean;
69
+ infiniteApproval?: boolean;
70
+ }
71
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"./dist/","sources":["core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAA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MAAM,4BAA4B,GAAG,CACzC,MAAM,EAAE,wBAAwB,KAC7B,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAA;AAEjC,MAAM,WAAW,gBAAgB;IAC/B,4BAA4B,CAAC,EAAE,4BAA4B,CAAA;IAC3D,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,4BAA4B,CAAC,EAAE,4BAA4B,CAAA;IAC3D,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B"}
@@ -1,4 +1,6 @@
1
- import type { LifiStep, ProcessType, Status, StatusMessage, Substatus } from '@lifi/types';
1
+ import { type ChainId, type LiFiStep, type ProcessType, type Status, type StatusMessage, type Substatus } from '@lifi/types';
2
+ export declare const getRpcUrl: (chainId: ChainId) => Promise<string>;
3
+ export declare const getRpcUrls: (chainId: ChainId) => Promise<string[]>;
2
4
  export declare function getProcessMessage(type: ProcessType, status: Status): string | undefined;
3
5
  export declare function getSubstatusMessage(status: StatusMessage, substatus?: Substatus): string | undefined;
4
6
  /**
@@ -9,4 +11,5 @@ export declare function getSubstatusMessage(status: StatusMessage, substatus?: S
9
11
  * @param newStep
10
12
  * @returns Boolean
11
13
  */
12
- export declare function checkStepSlippageThreshold(oldStep: LifiStep, newStep: LifiStep): boolean;
14
+ export declare function checkStepSlippageThreshold(oldStep: LiFiStep, newStep: LiFiStep): boolean;
15
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"./dist/","sources":["core/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,aAAa,CAAA;AAGpB,eAAO,MAAM,SAAS,YAAmB,OAAO,KAAG,QAAQ,MAAM,CAGhE,CAAA;AAED,eAAO,MAAM,UAAU,YAAmB,OAAO,KAAG,QAAQ,MAAM,EAAE,CAMnE,CAAA;AAyDD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,MAAM,GACb,MAAM,GAAG,SAAS,CAGpB;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,aAAa,EACrB,SAAS,CAAC,EAAE,SAAS,GACpB,MAAM,GAAG,SAAS,CAMpB;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,QAAQ,GAChB,OAAO,CAaT"}
@@ -0,0 +1,4 @@
1
+ import type { LiFiStep, ProcessType, StatusResponse } from '@lifi/types';
2
+ import type { StatusManager } from './StatusManager.js';
3
+ export declare function waitForReceivingTransaction(txHash: string, statusManager: StatusManager, processType: ProcessType, step: LiFiStep): Promise<StatusResponse>;
4
+ //# sourceMappingURL=waitForReceivingTransaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waitForReceivingTransaction.d.ts","sourceRoot":"./dist/","sources":["core/waitForReceivingTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,QAAQ,EACR,WAAW,EACX,cAAc,EACf,MAAM,aAAa,CAAA;AAIpB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAKvD,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,QAAQ,GACb,OAAO,CAAC,cAAc,CAAC,CAqDzB"}
@@ -0,0 +1,7 @@
1
+ import type { SDKOptions } from './types/index.js';
2
+ export declare function createChainsConfig(): Promise<void>;
3
+ export declare function createConfig(options: SDKOptions): {
4
+ set: (options: SDKOptions) => import("./types/internal.js").SDKConfig;
5
+ get: () => import("./types/internal.js").SDKConfig;
6
+ };
7
+ //# sourceMappingURL=createConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createConfig.d.ts","sourceRoot":"./dist/","sources":["createConfig.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAalD,wBAAsB,kBAAkB,kBAyBvC;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,UAAU;;;EAO/C"}
@@ -1,5 +1,5 @@
1
- import type { LifiStep, Route } from '@lifi/types';
2
- import type { TenderlyResponse } from './types';
1
+ import type { LiFiStep, Route } from '@lifi/types';
2
+ import type { TenderlyResponse } from './types/index.js';
3
3
  /**
4
4
  * Returns a random number between min (inclusive) and max (inclusive)
5
5
  * @param min - minimum number.
@@ -14,5 +14,6 @@ export declare const checkPackageUpdates: (packageName?: string, packageVersion?
14
14
  * @returns - The route to be executed.
15
15
  * @throws {ValidationError} Throws a ValidationError if the step has missing values.
16
16
  */
17
- export declare const convertQuoteToRoute: (step: LifiStep) => Route;
17
+ export declare const convertQuoteToRoute: (step: LiFiStep) => Route;
18
18
  export declare const fetchTxErrorDetails: (txHash: string, chainId: number) => Promise<TenderlyResponse>;
19
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"./dist/","sources":["helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAElD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAIxD;;;;;GAKG;AACH,eAAO,MAAM,eAAe,QAAS,MAAM,OAAO,MAAM,KAAG,MAE1D,CAAA;AAgBD,eAAO,MAAM,mBAAmB,iBAChB,MAAM,mBACH,MAAM,iBACR,OAAO,kBAsBvB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,SAAU,QAAQ,KAAG,KAyBpD,CAAA;AAED,eAAO,MAAM,mBAAmB,WAAkB,MAAM,WAAW,MAAM,8BAMxE,CAAA"}
@@ -0,0 +1,12 @@
1
+ export * from '@lifi/types';
2
+ export { EVM } from './core/EVM/EVM.js';
3
+ export { Solana } from './core/Solana/Solana.js';
4
+ export * from './core/index.js';
5
+ export { createConfig } from './createConfig.js';
6
+ export * from './helpers.js';
7
+ export * from './services/api.js';
8
+ export * from './services/balance.js';
9
+ export * from './types/index.js';
10
+ export * from './utils/errors.js';
11
+ export { LiFiError, type ErrorCode } from './utils/errors.js';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"./dist/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAChD,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAA"}
@@ -7,3 +7,4 @@ interface ExtendedRequestInit extends RequestInit {
7
7
  }
8
8
  export declare const request: <T = Response>(url: RequestInfo | URL, options?: ExtendedRequestInit) => Promise<T>;
9
9
  export {};
10
+ //# sourceMappingURL=request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.d.ts","sourceRoot":"./dist/","sources":["request.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe;;CAE3B,CAAA;AAED,UAAU,mBAAoB,SAAQ,WAAW;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B;AAED,eAAO,MAAM,OAAO,sBACb,WAAW,GAAG,GAAG,YACb,mBAAmB,eA8D7B,CAAA"}
@@ -0,0 +1,87 @@
1
+ import type { ChainId, ChainKey, ChainsRequest, ConnectionsRequest, ConnectionsResponse, ContractCallQuoteRequest, ExtendedChain, GasRecommendationRequest, GasRecommendationResponse, GetStatusRequest, LiFiStep, QuoteRequest, RequestOptions, RoutesRequest, RoutesResponse, StatusResponse, Token, TokensRequest, TokensResponse, ToolsRequest, ToolsResponse } from '@lifi/types';
2
+ /**
3
+ * Fetch information about a Token
4
+ * @param chain - Id or key of the chain that contains the token
5
+ * @param token - Address or symbol of the token on the requested chain
6
+ * @param options - Request options
7
+ * @throws {LiFiError} - Throws a LiFiError if request fails
8
+ * @returns Token information
9
+ */
10
+ export declare const getToken: (chain: ChainKey | ChainId, token: string, options?: RequestOptions) => Promise<Token>;
11
+ /**
12
+ * Get a quote for a token transfer
13
+ * @param params - The configuration of the requested quote
14
+ * @param options - Request options
15
+ * @throws {LiFiError} - Throws a LiFiError if request fails
16
+ * @returns Quote for a token transfer
17
+ */
18
+ export declare const getQuote: (params: QuoteRequest, options?: RequestOptions) => Promise<LiFiStep>;
19
+ /**
20
+ * Get a quote for a destination contract call
21
+ * @param params - The configuration of the requested destination call
22
+ * @param options - Request options
23
+ * @throws {LiFiError} - Throws a LiFiError if request fails
24
+ * @returns - Returns step.
25
+ */
26
+ export declare const getContractCallQuote: (params: ContractCallQuoteRequest, options?: RequestOptions) => Promise<LiFiStep>;
27
+ /**
28
+ * Check the status of a transfer. For cross chain transfers, the "bridge" parameter is required.
29
+ * @param params - Configuration of the requested status
30
+ * @param options - Request options.
31
+ * @throws {LiFiError} - Throws a LiFiError if request fails
32
+ * @returns Returns status response.
33
+ */
34
+ export declare const getStatus: (params: GetStatusRequest, options?: RequestOptions) => Promise<StatusResponse>;
35
+ /**
36
+ * Get all available chains
37
+ * @param params - The configuration of the requested chains
38
+ * @param options - Request options
39
+ * @returns A list of all available chains
40
+ * @throws {LiFiError} Throws a LiFiError if request fails.
41
+ */
42
+ export declare const getChains: (params?: ChainsRequest, options?: RequestOptions) => Promise<ExtendedChain[]>;
43
+ /**
44
+ * Get a set of routes for a request that describes a transfer of tokens.
45
+ * @param params - A description of the transfer.
46
+ * @param options - Request options
47
+ * @returns The resulting routes that can be used to realize the described transfer of tokens.
48
+ * @throws {LiFiError} Throws a LiFiError if request fails.
49
+ */
50
+ export declare const getRoutes: (params: RoutesRequest, options?: RequestOptions) => Promise<RoutesResponse>;
51
+ /**
52
+ * Get the transaction data for a single step of a route
53
+ * @param step - The step object.
54
+ * @param options - Request options
55
+ * @returns The step populated with the transaction data.
56
+ * @throws {LiFiError} Throws a LiFiError if request fails.
57
+ */
58
+ export declare const getStepTransaction: (step: LiFiStep, options?: RequestOptions) => Promise<LiFiStep>;
59
+ /**
60
+ * Get the available tools to bridge and swap tokens.
61
+ * @param params - The configuration of the requested tools
62
+ * @param options - Request options
63
+ * @returns The tools that are available on the requested chains
64
+ */
65
+ export declare const getTools: (params?: ToolsRequest, options?: RequestOptions) => Promise<ToolsResponse>;
66
+ /**
67
+ * Get all known tokens.
68
+ * @param params - The configuration of the requested tokens
69
+ * @param options - Request options
70
+ * @returns The tokens that are available on the requested chains
71
+ */
72
+ export declare const getTokens: (params?: TokensRequest, options?: RequestOptions) => Promise<TokensResponse>;
73
+ /**
74
+ * Get gas recommendation for a certain chain
75
+ * @param params - Configuration of the requested gas recommendation.
76
+ * @param options - Request options
77
+ * @throws {LiFiError} Throws a LiFiError if request fails.
78
+ * @returns Gas recommendation response.
79
+ */
80
+ export declare const getGasRecommendation: (params: GasRecommendationRequest, options?: RequestOptions) => Promise<GasRecommendationResponse>;
81
+ /**
82
+ * Get all the available connections for swap/bridging tokens
83
+ * @param connectionRequest ConnectionsRequest
84
+ * @returns ConnectionsResponse
85
+ */
86
+ export declare const getConnections: (connectionRequest: ConnectionsRequest) => Promise<ConnectionsResponse>;
87
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@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Aa,YACZ,cAAc,KACvB,QAAQ,cAAc,CAsBxB,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,WACvB,wBAAwB,YACtB,cAAc,KACvB,QAAQ,yBAAyB,CAqBnC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,sBACN,kBAAkB,KACpC,QAAQ,mBAAmB,CA0C7B,CAAA"}
@@ -0,0 +1,30 @@
1
+ import type { Token, TokenAmount } from '@lifi/types';
2
+ /**
3
+ * Returns the balances of a specific token a wallet holds across all aggregated chains.
4
+ * @param walletAddress - A wallet address.
5
+ * @param token - A Token object.
6
+ * @returns An object containing the token and the amounts on different chains.
7
+ * @throws {ValidationError} Throws a ValidationError if parameters are invalid.
8
+ */
9
+ export declare const getTokenBalance: (walletAddress: string, token: Token) => Promise<TokenAmount | null>;
10
+ /**
11
+ * Returns the balances for a list tokens a wallet holds across all aggregated chains.
12
+ * @param walletAddress - A wallet address.
13
+ * @param tokens - A list of Token objects.
14
+ * @returns A list of objects containing the tokens and the amounts on different chains.
15
+ * @throws {ValidationError} Throws a ValidationError if parameters are invalid.
16
+ */
17
+ export declare const getTokenBalances: (walletAddress: string, tokens: Token[]) => Promise<TokenAmount[]>;
18
+ /**
19
+ * This method queries the balances of tokens for a specific list of chains for a given wallet.
20
+ * @param walletAddress - A walletaddress.
21
+ * @param tokensByChain - A list of Token objects organized by chain ids.
22
+ * @returns A list of objects containing the tokens and the amounts on different chains organized by the chosen chains.
23
+ * @throws {ValidationError} Throws a ValidationError if parameters are invalid.
24
+ */
25
+ export declare const getTokenBalancesByChain: (walletAddress: string, tokensByChain: {
26
+ [chainId: number]: Token[];
27
+ }) => Promise<{
28
+ [chainId: number]: TokenAmount[];
29
+ }>;
30
+ //# sourceMappingURL=balance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balance.d.ts","sourceRoot":"./dist/","sources":["services/balance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAKrD;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,kBACX,MAAM,SACd,KAAK,KACX,QAAQ,WAAW,GAAG,IAAI,CAG5B,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,kBACZ,MAAM,UACb,KAAK,EAAE,KACd,QAAQ,WAAW,EAAE,CAkBvB,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,kBACnB,MAAM;;;;EAkCtB,CAAA"}
@@ -1,4 +1,5 @@
1
- import type { LifiStep, RoutesRequest, StaticToken } from './types';
1
+ import type { LiFiStep, RoutesRequest, StaticToken } from '@lifi/types';
2
2
  export declare const isRoutesRequest: (routesRequest: RoutesRequest) => routesRequest is RoutesRequest;
3
- export declare const isStep: (step: LifiStep) => step is LifiStep;
3
+ export declare const isStep: (step: LiFiStep) => step is LiFiStep;
4
4
  export declare const isToken: (token: StaticToken) => token is StaticToken;
5
+ //# sourceMappingURL=typeguards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeguards.d.ts","sourceRoot":"./dist/","sources":["typeguards.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,QAAQ,EAER,aAAa,EACb,WAAW,EACZ,MAAM,aAAa,CAAA;AAEpB,eAAO,MAAM,eAAe,kBACX,aAAa,mCAsB7B,CAAA;AAOD,eAAO,MAAM,MAAM,SAAU,QAAQ,qBAUpC,CAAA;AA+BD,eAAO,MAAM,OAAO,UAAW,WAAW,yBAQzC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './internal.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"./dist/","sources":["types/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
@@ -0,0 +1,56 @@
1
+ import type { ChainId, RouteOptions } from '@lifi/types';
2
+ import type { SDKProvider } from '../core/types.js';
3
+ export interface SDKConfig {
4
+ integrator: string;
5
+ apiUrl: string;
6
+ apiKey?: string;
7
+ userId?: string;
8
+ disableVersionCheck?: boolean;
9
+ widgetVersion?: string;
10
+ routeOptions?: RouteOptions;
11
+ providers?: SDKProvider[];
12
+ rpcUrls: Partial<Record<ChainId, string[]>>;
13
+ }
14
+ export interface SDKOptions extends Partial<Omit<SDKConfig, 'integrator'>> {
15
+ integrator: string;
16
+ }
17
+ export interface TenderlyResponse {
18
+ hash: string;
19
+ block_hash: string;
20
+ block_number: number;
21
+ from: string;
22
+ gas: number;
23
+ gas_price: number;
24
+ gas_fee_cap: number;
25
+ gas_tip_cap: number;
26
+ cumulative_gas_used: number;
27
+ gas_used: number;
28
+ effective_gas_price: number;
29
+ input: string;
30
+ nonce: number;
31
+ to: string;
32
+ index: number;
33
+ value: string;
34
+ access_list: unknown;
35
+ status: boolean;
36
+ addresses: string[];
37
+ contract_ids: string[];
38
+ network_id: string;
39
+ timestamp: string;
40
+ function_selector: string;
41
+ l1_block_number: number;
42
+ l1_timestamp: number;
43
+ deposit_tx: boolean;
44
+ system_tx: boolean;
45
+ mint: number;
46
+ sig: {
47
+ v: string;
48
+ r: string;
49
+ s: string;
50
+ };
51
+ error_message: string;
52
+ method: string;
53
+ decoded_input: unknown;
54
+ call_trace: unknown;
55
+ }
56
+ //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"./dist/","sources":["types/internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,mBAAmB,CAAC,EAAE,OAA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EAAE;QACH,CAAC,EAAE,MAAM,CAAA;QACT,CAAC,EAAE,MAAM,CAAA;QACT,CAAC,EAAE,MAAM,CAAA;KACV,CAAA;IACD,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,OAAO,CAAA;IACtB,UAAU,EAAE,OAAO,CAAA;CACpB"}
@@ -105,3 +105,4 @@ export declare class HTTPError extends Error {
105
105
  constructor(response: Response);
106
106
  }
107
107
  export {};
108
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"./dist/","sources":["utils/errors.ts"],"names":[],"mappings":"AAAA,aAAK,SAAS;IACZ,QAAQ,aAAa;IACrB,aAAa,kBAAkB;IAC/B,WAAW,gBAAgB;IAC3B,gBAAgB,qBAAqB;IACrC,eAAe,oBAAoB;IACnC,aAAa,kBAAkB;IAC/B,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;CAChC;AAED,oBAAY,aAAa;IACvB,aAAa,OAAO;IACpB,eAAe,OAAO;IACtB,sBAAsB,OAAO;IAC7B,iBAAiB,OAAO;IACxB,OAAO,OAAO;IACd,mBAAmB,OAAO;IAC1B,QAAQ,OAAO;IACf,gBAAgB,OAAO;IACvB,qBAAqB,OAAO;IAC5B,aAAa,OAAO;IACpB,mBAAmB,OAAO;IAC1B,aAAa,OAAO;IACpB,iBAAiB,OAAO;IACxB,YAAY,OAAO;IACnB,iBAAiB,OAAO;IACxB,iBAAiB,OAAO;IACxB,0BAA0B,OAAO;CAClC;AAED,oBAAY,eAAe;IACzB,cAAc,oBAAoB;IAClC,aAAa,mBAAmB;IAChC,iBAAiB,uBAAuB;CACzC;AAED,oBAAY,kBAAkB;IAC5B,cAAc,6CAA6C;IAC3D,MAAM,0BAA0B;IAChC,QAAQ,eAAe;IACvB,WAAW,gBAAgB;IAC3B,iBAAiB,4BAA4B;CAC9C;AAED,oBAAY,YAAY;IACtB,YAAY,4BA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AE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;CASlE;AAED,qBAAa,gBAAiB,SAAQ,SAAS;gBAE3C,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,EACpB,KAAK,CAAC,EAAE,MAAM;CAIjB;AAED,qBAAa,aAAc,SAAQ,SAAS;gBAC9B,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;CASlE;AAED,qBAAa,YAAa,SAAQ,SAAS;gBAC7B,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;CASlE;AAED,qBAAa,aAAc,SAAQ,SAAS;gBAC9B,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;CASlE;AAED,qBAAa,YAAa,SAAQ,SAAS;gBAEvC,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,EACpB,KAAK,CAAC,EAAE,MAAM;CAIjB;AAED,qBAAa,SAAU,SAAQ,KAAK;IAC3B,QAAQ,EAAE,QAAQ,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;gBAET,QAAQ,EAAE,QAAQ;CAY/B"}
@@ -0,0 +1,4 @@
1
+ import type { LiFiStep, Process } from '@lifi/types';
2
+ export declare const getTransactionNotSentMessage: (step?: LiFiStep, process?: Process) => Promise<string>;
3
+ export declare const getTransactionFailedMessage: (step: LiFiStep, txLink?: string) => Promise<string>;
4
+ //# sourceMappingURL=getTransactionMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTransactionMessage.d.ts","sourceRoot":"./dist/","sources":["utils/getTransactionMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAIpD,eAAO,MAAM,4BAA4B,UAChC,QAAQ,YACL,OAAO,KAChB,QAAQ,MAAM,CAwBhB,CAAA;AAED,eAAO,MAAM,2BAA2B,SAChC,QAAQ,WACL,MAAM,KACd,QAAQ,MAAM,CAShB,CAAA"}