@lifi/sdk 3.3.0-beta.0 → 3.3.0-beta.2

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 (377) hide show
  1. package/README.md +2 -2
  2. package/package.json +5 -4
  3. package/src/_cjs/config.js +3 -1
  4. package/src/_cjs/config.js.map +1 -1
  5. package/src/_cjs/core/EVM/EVM.js +1 -1
  6. package/src/_cjs/core/EVM/EVMStepExecutor.js +4 -4
  7. package/src/_cjs/core/EVM/EVMStepExecutor.js.map +1 -1
  8. package/src/_cjs/core/EVM/getAllowance.js +3 -3
  9. package/src/_cjs/core/EVM/getAllowance.js.map +1 -1
  10. package/src/_cjs/core/EVM/getEVMBalance.js +4 -6
  11. package/src/_cjs/core/EVM/getEVMBalance.js.map +1 -1
  12. package/src/_cjs/core/EVM/parseEVMErrors.js +3 -3
  13. package/src/_cjs/core/EVM/parseEVMErrors.js.map +1 -1
  14. package/src/_cjs/core/EVM/switchChain.js.map +1 -1
  15. package/src/_cjs/core/EVM/utils.js +4 -1
  16. package/src/_cjs/core/EVM/utils.js.map +1 -1
  17. package/src/_cjs/core/EVM/waitForTransactionReceipt.js +5 -4
  18. package/src/_cjs/core/EVM/waitForTransactionReceipt.js.map +1 -1
  19. package/src/_cjs/core/Solana/Solana.js +1 -1
  20. package/src/_cjs/core/Solana/SolanaStepExecutor.js +4 -4
  21. package/src/_cjs/core/Solana/SolanaStepExecutor.js.map +1 -1
  22. package/src/_cjs/core/Solana/connection.js +1 -3
  23. package/src/_cjs/core/Solana/connection.js.map +1 -1
  24. package/src/_cjs/core/Solana/getSolanaBalance.js +3 -3
  25. package/src/_cjs/core/Solana/getSolanaBalance.js.map +1 -1
  26. package/src/_cjs/core/Solana/isSVMAddress.js +1 -1
  27. package/src/_cjs/core/Solana/isSVMAddress.js.map +1 -1
  28. package/src/_cjs/core/Solana/parseSolanaErrors.js +1 -1
  29. package/src/_cjs/core/Solana/parseSolanaErrors.js.map +1 -1
  30. package/src/_cjs/core/StatusManager.js +2 -2
  31. package/src/_cjs/core/StatusManager.js.map +1 -1
  32. package/src/_cjs/core/UTXO/UTXO.js +1 -1
  33. package/src/_cjs/core/UTXO/UTXOStepExecutor.js +4 -4
  34. package/src/_cjs/core/UTXO/UTXOStepExecutor.js.map +1 -1
  35. package/src/_cjs/core/UTXO/getUTXOBalance.js +3 -3
  36. package/src/_cjs/core/UTXO/getUTXOBalance.js.map +1 -1
  37. package/src/_cjs/core/UTXO/isUTXOAddress.js +7 -7
  38. package/src/_cjs/core/UTXO/isUTXOAddress.js.map +1 -1
  39. package/src/_cjs/core/UTXO/parseUTXOErrors.js +1 -1
  40. package/src/_cjs/core/UTXO/parseUTXOErrors.js.map +1 -1
  41. package/src/_cjs/core/UTXO/utxo-stack/actions/getBlock.js +1 -1
  42. package/src/_cjs/core/UTXO/utxo-stack/actions/getBlock.js.map +1 -1
  43. package/src/_cjs/core/UTXO/utxo-stack/actions/getBlockStats.js +1 -1
  44. package/src/_cjs/core/UTXO/utxo-stack/actions/getBlockStats.js.map +1 -1
  45. package/src/_cjs/core/UTXO/utxo-stack/actions/getUTXOTransaction.js +1 -1
  46. package/src/_cjs/core/UTXO/utxo-stack/actions/getUTXOTransaction.js.map +1 -1
  47. package/src/_cjs/core/UTXO/utxo-stack/actions/waitForTransaction.js +5 -5
  48. package/src/_cjs/core/UTXO/utxo-stack/actions/waitForTransaction.js.map +1 -1
  49. package/src/_cjs/core/UTXO/utxo-stack/decorators/UTXOAPIActions.js.map +1 -1
  50. package/src/_cjs/core/UTXO/utxo-stack/utils/poll.js +3 -1
  51. package/src/_cjs/core/UTXO/utxo-stack/utils/poll.js.map +1 -1
  52. package/src/_cjs/core/checkBalance.js +2 -7
  53. package/src/_cjs/core/checkBalance.js.map +1 -1
  54. package/src/_cjs/core/execution.js.map +1 -1
  55. package/src/_cjs/core/stepComparison.js +1 -1
  56. package/src/_cjs/core/waitForReceivingTransaction.js +36 -41
  57. package/src/_cjs/core/waitForReceivingTransaction.js.map +1 -1
  58. package/src/_cjs/createConfig.js.map +1 -1
  59. package/src/_cjs/errors/baseError.js +1 -1
  60. package/src/_cjs/errors/baseError.js.map +1 -1
  61. package/src/_cjs/errors/errors.js +1 -1
  62. package/src/_cjs/errors/errors.js.map +1 -1
  63. package/src/_cjs/errors/httpError.js +1 -1
  64. package/src/_cjs/errors/httpError.js.map +1 -1
  65. package/src/_cjs/helpers.js +3 -3
  66. package/src/_cjs/helpers.js.map +1 -1
  67. package/src/_cjs/index.js +67 -11
  68. package/src/_cjs/index.js.map +1 -1
  69. package/src/_cjs/request.js +1 -1
  70. package/src/_cjs/request.js.map +1 -1
  71. package/src/_cjs/services/api.js +29 -17
  72. package/src/_cjs/services/api.js.map +1 -1
  73. package/src/_cjs/services/balance.js +6 -6
  74. package/src/_cjs/services/balance.js.map +1 -1
  75. package/src/_cjs/utils/getTransactionMessage.js +3 -4
  76. package/src/_cjs/utils/getTransactionMessage.js.map +1 -1
  77. package/src/_cjs/utils/withDedupe.js.map +1 -1
  78. package/src/_cjs/version.js +1 -1
  79. package/src/_esm/config.js +3 -1
  80. package/src/_esm/config.js.map +1 -1
  81. package/src/_esm/core/EVM/EVM.js +1 -1
  82. package/src/_esm/core/EVM/EVMStepExecutor.js +3 -3
  83. package/src/_esm/core/EVM/EVMStepExecutor.js.map +1 -1
  84. package/src/_esm/core/EVM/getAllowance.js +3 -3
  85. package/src/_esm/core/EVM/getAllowance.js.map +1 -1
  86. package/src/_esm/core/EVM/getEVMBalance.js +4 -6
  87. package/src/_esm/core/EVM/getEVMBalance.js.map +1 -1
  88. package/src/_esm/core/EVM/parseEVMErrors.js +2 -3
  89. package/src/_esm/core/EVM/parseEVMErrors.js.map +1 -1
  90. package/src/_esm/core/EVM/publicClient.js +1 -1
  91. package/src/_esm/core/EVM/publicClient.js.map +1 -1
  92. package/src/_esm/core/EVM/switchChain.js.map +1 -1
  93. package/src/_esm/core/EVM/types.js +0 -1
  94. package/src/_esm/core/EVM/types.js.map +1 -1
  95. package/src/_esm/core/EVM/utils.js +4 -2
  96. package/src/_esm/core/EVM/utils.js.map +1 -1
  97. package/src/_esm/core/EVM/waitForTransactionReceipt.js +3 -2
  98. package/src/_esm/core/EVM/waitForTransactionReceipt.js.map +1 -1
  99. package/src/_esm/core/Solana/Solana.js +1 -1
  100. package/src/_esm/core/Solana/SolanaStepExecutor.js +3 -4
  101. package/src/_esm/core/Solana/SolanaStepExecutor.js.map +1 -1
  102. package/src/_esm/core/Solana/connection.js +1 -3
  103. package/src/_esm/core/Solana/connection.js.map +1 -1
  104. package/src/_esm/core/Solana/getSolanaBalance.js +3 -3
  105. package/src/_esm/core/Solana/getSolanaBalance.js.map +1 -1
  106. package/src/_esm/core/Solana/isSVMAddress.js +1 -1
  107. package/src/_esm/core/Solana/isSVMAddress.js.map +1 -1
  108. package/src/_esm/core/Solana/parseSolanaErrors.js +1 -1
  109. package/src/_esm/core/Solana/parseSolanaErrors.js.map +1 -1
  110. package/src/_esm/core/Solana/types.js +0 -1
  111. package/src/_esm/core/Solana/types.js.map +1 -1
  112. package/src/_esm/core/StatusManager.js +2 -2
  113. package/src/_esm/core/StatusManager.js.map +1 -1
  114. package/src/_esm/core/UTXO/UTXO.js +1 -1
  115. package/src/_esm/core/UTXO/UTXOStepExecutor.js +4 -4
  116. package/src/_esm/core/UTXO/UTXOStepExecutor.js.map +1 -1
  117. package/src/_esm/core/UTXO/getUTXOAPIPublicClient.js.map +1 -1
  118. package/src/_esm/core/UTXO/getUTXOBalance.js +3 -3
  119. package/src/_esm/core/UTXO/getUTXOBalance.js.map +1 -1
  120. package/src/_esm/core/UTXO/getUTXOPublicClient.js +1 -1
  121. package/src/_esm/core/UTXO/getUTXOPublicClient.js.map +1 -1
  122. package/src/_esm/core/UTXO/isUTXOAddress.js +7 -7
  123. package/src/_esm/core/UTXO/isUTXOAddress.js.map +1 -1
  124. package/src/_esm/core/UTXO/parseUTXOErrors.js +1 -1
  125. package/src/_esm/core/UTXO/parseUTXOErrors.js.map +1 -1
  126. package/src/_esm/core/UTXO/types.js +0 -1
  127. package/src/_esm/core/UTXO/types.js.map +1 -1
  128. package/src/_esm/core/UTXO/utxo-stack/actions/getBalance.js +0 -1
  129. package/src/_esm/core/UTXO/utxo-stack/actions/getBalance.js.map +1 -1
  130. package/src/_esm/core/UTXO/utxo-stack/actions/getBlock.js +1 -1
  131. package/src/_esm/core/UTXO/utxo-stack/actions/getBlock.js.map +1 -1
  132. package/src/_esm/core/UTXO/utxo-stack/actions/getBlockCount.js +0 -1
  133. package/src/_esm/core/UTXO/utxo-stack/actions/getBlockCount.js.map +1 -1
  134. package/src/_esm/core/UTXO/utxo-stack/actions/getBlockStats.js +1 -1
  135. package/src/_esm/core/UTXO/utxo-stack/actions/getBlockStats.js.map +1 -1
  136. package/src/_esm/core/UTXO/utxo-stack/actions/getUTXOTransaction.js +1 -1
  137. package/src/_esm/core/UTXO/utxo-stack/actions/getUTXOTransaction.js.map +1 -1
  138. package/src/_esm/core/UTXO/utxo-stack/actions/sendUTXOTransaction.js +0 -1
  139. package/src/_esm/core/UTXO/utxo-stack/actions/sendUTXOTransaction.js.map +1 -1
  140. package/src/_esm/core/UTXO/utxo-stack/actions/signPsbt.js +0 -1
  141. package/src/_esm/core/UTXO/utxo-stack/actions/signPsbt.js.map +1 -1
  142. package/src/_esm/core/UTXO/utxo-stack/actions/waitForTransaction.js +7 -7
  143. package/src/_esm/core/UTXO/utxo-stack/actions/waitForTransaction.js.map +1 -1
  144. package/src/_esm/core/UTXO/utxo-stack/actions/watchBlockNumber.js.map +1 -1
  145. package/src/_esm/core/UTXO/utxo-stack/decorators/UTXOAPIActions.js.map +1 -1
  146. package/src/_esm/core/UTXO/utxo-stack/decorators/UTXOActions.js.map +1 -1
  147. package/src/_esm/core/UTXO/utxo-stack/transports/utxo/getHttpRpcClient.js +1 -1
  148. package/src/_esm/core/UTXO/utxo-stack/transports/utxo/getHttpRpcClient.js.map +1 -1
  149. package/src/_esm/core/UTXO/utxo-stack/transports/utxo/utxo.js +1 -1
  150. package/src/_esm/core/UTXO/utxo-stack/transports/utxo/utxo.js.map +1 -1
  151. package/src/_esm/core/UTXO/utxo-stack/utils/cancelTransaction.js +1 -1
  152. package/src/_esm/core/UTXO/utxo-stack/utils/cancelTransaction.js.map +1 -1
  153. package/src/_esm/core/UTXO/utxo-stack/utils/modifyFee.js +1 -1
  154. package/src/_esm/core/UTXO/utxo-stack/utils/modifyFee.js.map +1 -1
  155. package/src/_esm/core/UTXO/utxo-stack/utils/poll.js +3 -1
  156. package/src/_esm/core/UTXO/utxo-stack/utils/poll.js.map +1 -1
  157. package/src/_esm/core/checkBalance.js +2 -7
  158. package/src/_esm/core/checkBalance.js.map +1 -1
  159. package/src/_esm/core/execution.js.map +1 -1
  160. package/src/_esm/core/processMessages.js +0 -1
  161. package/src/_esm/core/processMessages.js.map +1 -1
  162. package/src/_esm/core/rpc.js +0 -1
  163. package/src/_esm/core/rpc.js.map +1 -1
  164. package/src/_esm/core/stepComparison.js +1 -1
  165. package/src/_esm/core/utils.js +0 -1
  166. package/src/_esm/core/utils.js.map +1 -1
  167. package/src/_esm/core/waitForReceivingTransaction.js +36 -41
  168. package/src/_esm/core/waitForReceivingTransaction.js.map +1 -1
  169. package/src/_esm/createConfig.js +0 -1
  170. package/src/_esm/createConfig.js.map +1 -1
  171. package/src/_esm/errors/SDKError.js +0 -1
  172. package/src/_esm/errors/SDKError.js.map +1 -1
  173. package/src/_esm/errors/baseError.js +2 -2
  174. package/src/_esm/errors/baseError.js.map +1 -1
  175. package/src/_esm/errors/errors.js +1 -1
  176. package/src/_esm/errors/errors.js.map +1 -1
  177. package/src/_esm/errors/httpError.js +2 -2
  178. package/src/_esm/errors/httpError.js.map +1 -1
  179. package/src/_esm/helpers.js +4 -6
  180. package/src/_esm/helpers.js.map +1 -1
  181. package/src/_esm/index.js +13 -9
  182. package/src/_esm/index.js.map +1 -1
  183. package/src/_esm/request.js +1 -1
  184. package/src/_esm/request.js.map +1 -1
  185. package/src/_esm/services/api.js +29 -18
  186. package/src/_esm/services/api.js.map +1 -1
  187. package/src/_esm/services/balance.js +6 -6
  188. package/src/_esm/services/balance.js.map +1 -1
  189. package/src/_esm/utils/getTransactionMessage.js +3 -4
  190. package/src/_esm/utils/getTransactionMessage.js.map +1 -1
  191. package/src/_esm/utils/withDedupe.js +0 -1
  192. package/src/_esm/utils/withDedupe.js.map +1 -1
  193. package/src/_esm/version.js +1 -1
  194. package/src/_types/config.d.ts.map +1 -1
  195. package/src/_types/core/EVM/getEVMBalance.d.ts.map +1 -1
  196. package/src/_types/core/EVM/parseEVMErrors.d.ts +1 -1
  197. package/src/_types/core/EVM/parseEVMErrors.d.ts.map +1 -1
  198. package/src/_types/core/EVM/types.d.ts +1 -1
  199. package/src/_types/core/EVM/types.d.ts.map +1 -1
  200. package/src/_types/core/EVM/utils.d.ts +1 -1
  201. package/src/_types/core/EVM/utils.d.ts.map +1 -1
  202. package/src/_types/core/EVM/waitForTransactionReceipt.d.ts.map +1 -1
  203. package/src/_types/core/Solana/SolanaStepExecutor.d.ts +1 -1
  204. package/src/_types/core/Solana/SolanaStepExecutor.d.ts.map +1 -1
  205. package/src/_types/core/Solana/connection.d.ts.map +1 -1
  206. package/src/_types/core/Solana/parseSolanaErrors.d.ts.map +1 -1
  207. package/src/_types/core/Solana/types.d.ts +1 -1
  208. package/src/_types/core/Solana/types.d.ts.map +1 -1
  209. package/src/_types/core/StatusManager.d.ts.map +1 -1
  210. package/src/_types/core/UTXO/UTXOStepExecutor.d.ts.map +1 -1
  211. package/src/_types/core/UTXO/getUTXOAPIPublicClient.d.ts.map +1 -1
  212. package/src/_types/core/UTXO/getUTXOBalance.d.ts.map +1 -1
  213. package/src/_types/core/UTXO/getUTXOPublicClient.d.ts.map +1 -1
  214. package/src/_types/core/UTXO/isUTXOAddress.d.ts.map +1 -1
  215. package/src/_types/core/UTXO/parseUTXOErrors.d.ts.map +1 -1
  216. package/src/_types/core/UTXO/types.d.ts +1 -1
  217. package/src/_types/core/UTXO/types.d.ts.map +1 -1
  218. package/src/_types/core/UTXO/utxo-stack/actions/getBalance.d.ts +1 -1
  219. package/src/_types/core/UTXO/utxo-stack/actions/getBalance.d.ts.map +1 -1
  220. package/src/_types/core/UTXO/utxo-stack/actions/getBlock.d.ts.map +1 -1
  221. package/src/_types/core/UTXO/utxo-stack/actions/getBlockCount.d.ts +1 -1
  222. package/src/_types/core/UTXO/utxo-stack/actions/getBlockCount.d.ts.map +1 -1
  223. package/src/_types/core/UTXO/utxo-stack/actions/getBlockStats.d.ts.map +1 -1
  224. package/src/_types/core/UTXO/utxo-stack/actions/getUTXOTransaction.d.ts.map +1 -1
  225. package/src/_types/core/UTXO/utxo-stack/actions/sendUTXOTransaction.d.ts +1 -1
  226. package/src/_types/core/UTXO/utxo-stack/actions/sendUTXOTransaction.d.ts.map +1 -1
  227. package/src/_types/core/UTXO/utxo-stack/actions/signPsbt.d.ts +1 -1
  228. package/src/_types/core/UTXO/utxo-stack/actions/signPsbt.d.ts.map +1 -1
  229. package/src/_types/core/UTXO/utxo-stack/actions/waitForTransaction.d.ts.map +1 -1
  230. package/src/_types/core/UTXO/utxo-stack/actions/watchBlockNumber.d.ts.map +1 -1
  231. package/src/_types/core/UTXO/utxo-stack/decorators/UTXOAPIActions.d.ts.map +1 -1
  232. package/src/_types/core/UTXO/utxo-stack/decorators/UTXOActions.d.ts.map +1 -1
  233. package/src/_types/core/UTXO/utxo-stack/transports/utxo/utxo.d.ts.map +1 -1
  234. package/src/_types/core/UTXO/utxo-stack/utils/cancelTransaction.d.ts.map +1 -1
  235. package/src/_types/core/UTXO/utxo-stack/utils/modifyFee.d.ts.map +1 -1
  236. package/src/_types/core/UTXO/utxo-stack/utils/poll.d.ts +2 -2
  237. package/src/_types/core/UTXO/utxo-stack/utils/poll.d.ts.map +1 -1
  238. package/src/_types/core/checkBalance.d.ts.map +1 -1
  239. package/src/_types/core/execution.d.ts.map +1 -1
  240. package/src/_types/core/processMessages.d.ts +1 -1
  241. package/src/_types/core/processMessages.d.ts.map +1 -1
  242. package/src/_types/core/rpc.d.ts +1 -1
  243. package/src/_types/core/rpc.d.ts.map +1 -1
  244. package/src/_types/core/utils.d.ts +1 -1
  245. package/src/_types/core/utils.d.ts.map +1 -1
  246. package/src/_types/core/waitForReceivingTransaction.d.ts.map +1 -1
  247. package/src/_types/createConfig.d.ts +1 -1
  248. package/src/_types/createConfig.d.ts.map +1 -1
  249. package/src/_types/errors/SDKError.d.ts +1 -1
  250. package/src/_types/errors/SDKError.d.ts.map +1 -1
  251. package/src/_types/errors/errors.d.ts +1 -1
  252. package/src/_types/errors/errors.d.ts.map +1 -1
  253. package/src/_types/errors/httpError.d.ts +1 -1
  254. package/src/_types/errors/httpError.d.ts.map +1 -1
  255. package/src/_types/helpers.d.ts +1 -1
  256. package/src/_types/helpers.d.ts.map +1 -1
  257. package/src/_types/index.d.ts +15 -9
  258. package/src/_types/index.d.ts.map +1 -1
  259. package/src/_types/services/api.d.ts.map +1 -1
  260. package/src/_types/types/internal.d.ts +0 -39
  261. package/src/_types/types/internal.d.ts.map +1 -1
  262. package/src/_types/utils/getTransactionMessage.d.ts.map +1 -1
  263. package/src/_types/utils/withDedupe.d.ts.map +1 -1
  264. package/src/_types/version.d.ts +1 -1
  265. package/src/config.ts +3 -1
  266. package/src/core/EVM/EVM.ts +1 -1
  267. package/src/core/EVM/EVMStepExecutor.ts +3 -3
  268. package/src/core/EVM/getAllowance.ts +3 -3
  269. package/src/core/EVM/getEVMBalance.ts +4 -5
  270. package/src/core/EVM/parseEVMErrors.ts +3 -3
  271. package/src/core/EVM/publicClient.ts +2 -2
  272. package/src/core/EVM/switchChain.ts +1 -1
  273. package/src/core/EVM/types.ts +2 -2
  274. package/src/core/EVM/utils.ts +5 -5
  275. package/src/core/EVM/waitForTransactionReceipt.ts +3 -2
  276. package/src/core/Solana/Solana.ts +1 -1
  277. package/src/core/Solana/SolanaStepExecutor.ts +5 -5
  278. package/src/core/Solana/connection.ts +1 -2
  279. package/src/core/Solana/getSolanaBalance.ts +3 -3
  280. package/src/core/Solana/isSVMAddress.ts +1 -1
  281. package/src/core/Solana/parseSolanaErrors.ts +1 -1
  282. package/src/core/Solana/types.ts +1 -1
  283. package/src/core/StatusManager.ts +2 -6
  284. package/src/core/UTXO/UTXO.ts +1 -1
  285. package/src/core/UTXO/UTXOStepExecutor.ts +6 -6
  286. package/src/core/UTXO/getUTXOAPIPublicClient.ts +3 -3
  287. package/src/core/UTXO/getUTXOBalance.ts +3 -4
  288. package/src/core/UTXO/getUTXOPublicClient.ts +3 -3
  289. package/src/core/UTXO/isUTXOAddress.ts +10 -11
  290. package/src/core/UTXO/parseUTXOErrors.ts +1 -1
  291. package/src/core/UTXO/types.ts +1 -1
  292. package/src/core/UTXO/utxo-stack/actions/getBalance.ts +1 -1
  293. package/src/core/UTXO/utxo-stack/actions/getBlock.ts +2 -2
  294. package/src/core/UTXO/utxo-stack/actions/getBlockCount.ts +1 -1
  295. package/src/core/UTXO/utxo-stack/actions/getBlockStats.ts +2 -2
  296. package/src/core/UTXO/utxo-stack/actions/getUTXOTransaction.ts +2 -2
  297. package/src/core/UTXO/utxo-stack/actions/sendUTXOTransaction.ts +1 -1
  298. package/src/core/UTXO/utxo-stack/actions/signPsbt.ts +1 -1
  299. package/src/core/UTXO/utxo-stack/actions/waitForTransaction.ts +10 -10
  300. package/src/core/UTXO/utxo-stack/actions/watchBlockNumber.ts +2 -2
  301. package/src/core/UTXO/utxo-stack/decorators/UTXOAPIActions.ts +1 -2
  302. package/src/core/UTXO/utxo-stack/decorators/UTXOActions.ts +3 -3
  303. package/src/core/UTXO/utxo-stack/transports/utxo/getHttpRpcClient.ts +1 -1
  304. package/src/core/UTXO/utxo-stack/transports/utxo/utxo.ts +3 -3
  305. package/src/core/UTXO/utxo-stack/utils/cancelTransaction.ts +1 -1
  306. package/src/core/UTXO/utxo-stack/utils/modifyFee.ts +1 -1
  307. package/src/core/UTXO/utxo-stack/utils/poll.ts +6 -4
  308. package/src/core/checkBalance.ts +2 -8
  309. package/src/core/execution.ts +0 -1
  310. package/src/core/processMessages.ts +5 -5
  311. package/src/core/rpc.ts +1 -1
  312. package/src/core/stepComparison.ts +1 -1
  313. package/src/core/utils.ts +1 -1
  314. package/src/core/waitForReceivingTransaction.ts +42 -46
  315. package/src/createConfig.ts +1 -2
  316. package/src/errors/SDKError.ts +1 -1
  317. package/src/errors/baseError.ts +2 -2
  318. package/src/errors/errors.ts +1 -1
  319. package/src/errors/httpError.ts +3 -3
  320. package/src/helpers.ts +4 -5
  321. package/src/index.ts +84 -9
  322. package/src/request.ts +1 -1
  323. package/src/services/api.ts +28 -32
  324. package/src/services/balance.ts +6 -6
  325. package/src/types/internal.ts +0 -40
  326. package/src/utils/getTransactionMessage.ts +3 -4
  327. package/src/utils/withDedupe.ts +0 -1
  328. package/src/version.ts +1 -1
  329. package/src/_cjs/core/UTXO/blockchairApi.js +0 -169
  330. package/src/_cjs/core/UTXO/blockchairApi.js.map +0 -1
  331. package/src/_cjs/core/UTXO/blockchairApiTypes.js +0 -26
  332. package/src/_cjs/core/UTXO/blockchairApiTypes.js.map +0 -1
  333. package/src/_cjs/core/UTXO/requestClient.js +0 -63
  334. package/src/_cjs/core/UTXO/requestClient.js.map +0 -1
  335. package/src/_cjs/core/index.js +0 -7
  336. package/src/_cjs/core/index.js.map +0 -1
  337. package/src/_cjs/errors/index.js +0 -11
  338. package/src/_cjs/errors/index.js.map +0 -1
  339. package/src/_cjs/types/index.js +0 -5
  340. package/src/_cjs/types/index.js.map +0 -1
  341. package/src/_cjs/utils/index.js +0 -8
  342. package/src/_cjs/utils/index.js.map +0 -1
  343. package/src/_esm/core/UTXO/blockchairApi.js +0 -167
  344. package/src/_esm/core/UTXO/blockchairApi.js.map +0 -1
  345. package/src/_esm/core/UTXO/blockchairApiTypes.js +0 -23
  346. package/src/_esm/core/UTXO/blockchairApiTypes.js.map +0 -1
  347. package/src/_esm/core/UTXO/requestClient.js +0 -59
  348. package/src/_esm/core/UTXO/requestClient.js.map +0 -1
  349. package/src/_esm/core/index.js +0 -4
  350. package/src/_esm/core/index.js.map +0 -1
  351. package/src/_esm/errors/index.js +0 -8
  352. package/src/_esm/errors/index.js.map +0 -1
  353. package/src/_esm/types/index.js +0 -2
  354. package/src/_esm/types/index.js.map +0 -1
  355. package/src/_esm/utils/index.js +0 -5
  356. package/src/_esm/utils/index.js.map +0 -1
  357. package/src/_types/core/UTXO/blockchairApi.d.ts +0 -37
  358. package/src/_types/core/UTXO/blockchairApi.d.ts.map +0 -1
  359. package/src/_types/core/UTXO/blockchairApiTypes.d.ts +0 -229
  360. package/src/_types/core/UTXO/blockchairApiTypes.d.ts.map +0 -1
  361. package/src/_types/core/UTXO/requestClient.d.ts +0 -22
  362. package/src/_types/core/UTXO/requestClient.d.ts.map +0 -1
  363. package/src/_types/core/index.d.ts +0 -4
  364. package/src/_types/core/index.d.ts.map +0 -1
  365. package/src/_types/errors/index.d.ts +0 -8
  366. package/src/_types/errors/index.d.ts.map +0 -1
  367. package/src/_types/types/index.d.ts +0 -2
  368. package/src/_types/types/index.d.ts.map +0 -1
  369. package/src/_types/utils/index.d.ts +0 -5
  370. package/src/_types/utils/index.d.ts.map +0 -1
  371. package/src/core/UTXO/blockchairApi.ts +0 -273
  372. package/src/core/UTXO/blockchairApiTypes.ts +0 -253
  373. package/src/core/UTXO/requestClient.ts +0 -84
  374. package/src/core/index.ts +0 -3
  375. package/src/errors/index.ts +0 -7
  376. package/src/types/index.ts +0 -1
  377. package/src/utils/index.ts +0 -4
@@ -8,7 +8,8 @@ import type {
8
8
  TransactionReceipt,
9
9
  } from 'viem'
10
10
  import { waitForTransactionReceipt as waitForTransactionReceiptInternal } from 'viem/actions'
11
- import { LiFiErrorCode, TransactionError } from '../../utils/index.js'
11
+ import { LiFiErrorCode } from '../../errors/constants.js'
12
+ import { TransactionError } from '../../errors/errors.js'
12
13
  import { getPublicClient } from './publicClient.js'
13
14
  import { retryCount, retryDelay } from './utils.js'
14
15
 
@@ -75,7 +76,7 @@ async function waitForReceipt(
75
76
  retryCount,
76
77
  retryDelay,
77
78
  })
78
- } catch (error) {
79
+ } catch {
79
80
  // We can ignore errors from waitForTransactionReceipt as we have a status check fallback
80
81
  }
81
82
 
@@ -19,7 +19,7 @@ export function Solana(options?: SolanaProviderOptions): SolanaProvider {
19
19
  options: StepExecutorOptions
20
20
  ): Promise<SolanaStepExecutor> {
21
21
  if (!_options.getWalletAdapter) {
22
- throw new Error(`getWalletAdapter is not provided.`)
22
+ throw new Error('getWalletAdapter is not provided.')
23
23
  }
24
24
 
25
25
  const walletAdapter = await _options.getWalletAdapter()
@@ -1,9 +1,9 @@
1
1
  import type { ExtendedTransactionInfo, FullStatusData } from '@lifi/types'
2
- import { type SignerWalletAdapter } from '@solana/wallet-adapter-base'
2
+ import type { SignerWalletAdapter } from '@solana/wallet-adapter-base'
3
3
  import {
4
- VersionedTransaction,
5
4
  type SendOptions,
6
5
  type SignatureResult,
6
+ VersionedTransaction,
7
7
  } from '@solana/web3.js'
8
8
  import bs58 from 'bs58'
9
9
  import { withTimeout } from 'viem'
@@ -12,7 +12,7 @@ import { LiFiErrorCode } from '../../errors/constants.js'
12
12
  import { TransactionError } from '../../errors/errors.js'
13
13
  import { getStepTransaction } from '../../services/api.js'
14
14
  import { base64ToUint8Array } from '../../utils/base64ToUint8Array.js'
15
- import { getTransactionFailedMessage } from '../../utils/index.js'
15
+ import { getTransactionFailedMessage } from '../../utils/getTransactionMessage.js'
16
16
  import { sleep } from '../../utils/sleep.js'
17
17
  import { BaseStepExecutor } from '../BaseStepExecutor.js'
18
18
  import { checkBalance } from '../checkBalance.js'
@@ -88,10 +88,10 @@ export class SolanaStepExecutor extends BaseStepExecutor {
88
88
  this.allowUserInteraction,
89
89
  this.executionOptions
90
90
  )
91
- step = {
91
+ Object.assign(step, {
92
92
  ...comparedStep,
93
93
  execution: step.execution,
94
- }
94
+ })
95
95
  }
96
96
 
97
97
  if (!step.transactionRequest?.data) {
@@ -13,7 +13,6 @@ export const getSolanaConnection = async (): Promise<Connection> => {
13
13
  const rpcUrl = await getRpcUrl(ChainId.SOL)
14
14
  connection = new Connection(rpcUrl)
15
15
  return connection
16
- } else {
17
- return connection
18
16
  }
17
+ return connection
19
18
  }
@@ -12,11 +12,11 @@ export const getSolanaBalance = async (
12
12
  return []
13
13
  }
14
14
  const { chainId } = tokens[0]
15
- tokens.forEach((token) => {
15
+ for (const token of tokens) {
16
16
  if (token.chainId !== chainId) {
17
- console.warn(`Requested tokens have to be on the same chain.`)
17
+ console.warn('Requested tokens have to be on the same chain.')
18
18
  }
19
- })
19
+ }
20
20
 
21
21
  return getSolanaBalanceDefault(chainId, tokens, walletAddress)
22
22
  }
@@ -4,7 +4,7 @@ export function isSVMAddress(address: string): boolean {
4
4
  try {
5
5
  new PublicKey(address)
6
6
  return true
7
- } catch (error) {
7
+ } catch (_error) {
8
8
  return false
9
9
  }
10
10
  }
@@ -1,8 +1,8 @@
1
1
  import type { LiFiStep, Process } from '@lifi/types'
2
+ import { SDKError } from '../../errors/SDKError.js'
2
3
  import { BaseError } from '../../errors/baseError.js'
3
4
  import { ErrorMessage, LiFiErrorCode } from '../../errors/constants.js'
4
5
  import { TransactionError, UnknownError } from '../../errors/errors.js'
5
- import { SDKError } from '../../errors/SDKError.js'
6
6
 
7
7
  export const parseSolanaErrors = async (
8
8
  e: Error,
@@ -1,6 +1,6 @@
1
1
  import { ChainType } from '@lifi/types'
2
2
  import type { SignerWalletAdapter } from '@solana/wallet-adapter-base'
3
- import { type SDKProvider } from '../types.js'
3
+ import type { SDKProvider } from '../types.js'
4
4
 
5
5
  export interface SolanaProviderOptions {
6
6
  getWalletAdapter?: () => Promise<SignerWalletAdapter>
@@ -180,12 +180,8 @@ export class StatusManager {
180
180
  }
181
181
  // Sort processes, the ones with DONE status go first
182
182
  step.execution.process = [
183
- ...step?.execution?.process.filter(
184
- (process) => process.status === 'DONE'
185
- ),
186
- ...step?.execution?.process.filter(
187
- (process) => process.status !== 'DONE'
188
- ),
183
+ ...step.execution.process.filter((process) => process.status === 'DONE'),
184
+ ...step.execution.process.filter((process) => process.status !== 'DONE'),
189
185
  ]
190
186
  this.updateStepInRoute(step) // updates the step in the route
191
187
  return currentProcess
@@ -21,7 +21,7 @@ export function UTXO(options?: UTXOProviderOptions): UTXOProvider {
21
21
  options: StepExecutorOptions
22
22
  ): Promise<UTXOStepExecutor> {
23
23
  if (!_options.getWalletClient) {
24
- throw new Error(`Client is not provided.`)
24
+ throw new Error('Client is not provided.')
25
25
  }
26
26
 
27
27
  const walletClient = await _options.getWalletClient()
@@ -3,13 +3,13 @@ import {
3
3
  type ExtendedTransactionInfo,
4
4
  type FullStatusData,
5
5
  } from '@lifi/types'
6
- import { address, networks, Psbt } from 'bitcoinjs-lib'
7
- import { withTimeout, type Client } from 'viem'
6
+ import { Psbt, address, networks } from 'bitcoinjs-lib'
7
+ import { type Client, withTimeout } from 'viem'
8
8
  import { config } from '../../config.js'
9
9
  import { LiFiErrorCode } from '../../errors/constants.js'
10
10
  import { TransactionError } from '../../errors/errors.js'
11
11
  import { getStepTransaction } from '../../services/api.js'
12
- import { getTransactionFailedMessage } from '../../utils/index.js'
12
+ import { getTransactionFailedMessage } from '../../utils/getTransactionMessage.js'
13
13
  import { BaseStepExecutor } from '../BaseStepExecutor.js'
14
14
  import { checkBalance } from '../checkBalance.js'
15
15
  import { getSubstatusMessage } from '../processMessages.js'
@@ -24,8 +24,8 @@ import { getUTXOPublicClient } from './getUTXOPublicClient.js'
24
24
  import { parseUTXOErrors } from './parseUTXOErrors.js'
25
25
  import { signPsbt } from './utxo-stack/actions/signPsbt.js'
26
26
  import {
27
- waitForTransaction,
28
27
  type ReplacementReason,
28
+ waitForTransaction,
29
29
  } from './utxo-stack/actions/waitForTransaction.js'
30
30
 
31
31
  export interface UTXOStepExecutorOptions extends StepExecutorOptions {
@@ -101,10 +101,10 @@ export class UTXOStepExecutor extends BaseStepExecutor {
101
101
  this.allowUserInteraction,
102
102
  this.executionOptions
103
103
  )
104
- step = {
104
+ Object.assign(step, {
105
105
  ...comparedStep,
106
106
  execution: step.execution,
107
- }
107
+ })
108
108
  }
109
109
 
110
110
  if (!step.transactionRequest?.data) {
@@ -1,11 +1,11 @@
1
1
  import {
2
- createClient,
3
- fallback,
4
- rpcSchema,
5
2
  type Chain,
6
3
  type Client,
7
4
  type FallbackTransport,
8
5
  type HttpTransport,
6
+ createClient,
7
+ fallback,
8
+ rpcSchema,
9
9
  } from 'viem'
10
10
  import { config } from '../../config.js'
11
11
  import { UTXOAPIActions } from './utxo-stack/decorators/UTXOAPIActions.js'
@@ -10,12 +10,11 @@ export const getUTXOBalance = async (
10
10
  return []
11
11
  }
12
12
  const { chainId } = tokens[0]
13
- tokens.forEach((token) => {
13
+ for (const token of tokens) {
14
14
  if (token.chainId !== chainId) {
15
- console.warn(`Requested tokens have to be on the same chain.`)
15
+ console.warn('Requested tokens have to be on the same chain.')
16
16
  }
17
- })
18
-
17
+ }
19
18
  const apiClient = await getUTXOAPIPublicClient(ChainId.BTC)
20
19
  const client = await getUTXOPublicClient(ChainId.BTC)
21
20
  const [balance, blockCount] = await Promise.all([
@@ -1,12 +1,12 @@
1
1
  import {
2
- createClient,
3
- fallback,
4
2
  http,
5
- rpcSchema,
6
3
  type Chain,
7
4
  type Client,
8
5
  type FallbackTransport,
9
6
  type HttpTransport,
7
+ createClient,
8
+ fallback,
9
+ rpcSchema,
10
10
  } from 'viem'
11
11
  import { config } from '../../config.js'
12
12
  import { getRpcUrls } from '../rpc.js'
@@ -1,5 +1,5 @@
1
1
  import { sha256 } from '@noble/hashes/sha256'
2
- import { bech32, bech32m } from 'bech32'
2
+ import { type Decoded, bech32, bech32m } from 'bech32'
3
3
  import bs58 from 'bs58'
4
4
 
5
5
  export enum UTXONetwork {
@@ -26,26 +26,26 @@ export type UTXOAddress = {
26
26
  const addressTypes: {
27
27
  [key: number]: { type: UTXOAddressType; network: UTXONetwork }
28
28
  } = {
29
- 0x00: {
29
+ 0: {
30
30
  type: UTXOAddressType.p2pkh,
31
31
  network: UTXONetwork.Mainnet,
32
32
  },
33
- 0x6f: {
33
+ 111: {
34
34
  type: UTXOAddressType.p2pkh,
35
35
  network: UTXONetwork.Testnet,
36
36
  },
37
- 0x05: {
37
+ 5: {
38
38
  type: UTXOAddressType.p2sh,
39
39
  network: UTXONetwork.Mainnet,
40
40
  },
41
- 0xc4: {
41
+ 196: {
42
42
  type: UTXOAddressType.p2sh,
43
43
  network: UTXONetwork.Testnet,
44
44
  },
45
45
  }
46
46
 
47
47
  const parseBech32 = (address: string): UTXOAddress => {
48
- let decoded
48
+ let decoded: Decoded
49
49
 
50
50
  try {
51
51
  if (
@@ -57,7 +57,7 @@ const parseBech32 = (address: string): UTXOAddress => {
57
57
  } else {
58
58
  decoded = bech32.decode(address)
59
59
  }
60
- } catch (error) {
60
+ } catch (_error) {
61
61
  throw new Error('Invalid address')
62
62
  }
63
63
 
@@ -80,8 +80,7 @@ const parseBech32 = (address: string): UTXOAddress => {
80
80
  }
81
81
  const data = bech32.fromWords(decoded.words.slice(1))
82
82
 
83
- let type
84
-
83
+ let type: UTXOAddressType
85
84
  if (data.length === 20) {
86
85
  type = UTXOAddressType.p2wpkh
87
86
  } else if (witnessVersion === 1) {
@@ -108,7 +107,7 @@ export const getUTXOAddress = (address: string): UTXOAddress => {
108
107
 
109
108
  try {
110
109
  decoded = bs58.decode(address)
111
- } catch (error) {
110
+ } catch (_error) {
112
111
  throw new Error('Invalid address')
113
112
  }
114
113
 
@@ -160,7 +159,7 @@ export const isUTXOAddress = (
160
159
  }
161
160
 
162
161
  return true
163
- } catch (error) {
162
+ } catch (_error) {
164
163
  return false
165
164
  }
166
165
  }
@@ -1,8 +1,8 @@
1
1
  import type { LiFiStep, Process } from '@lifi/types'
2
+ import { SDKError } from '../../errors/SDKError.js'
2
3
  import { BaseError } from '../../errors/baseError.js'
3
4
  import { ErrorMessage, LiFiErrorCode } from '../../errors/constants.js'
4
5
  import { TransactionError, UnknownError } from '../../errors/errors.js'
5
- import { SDKError } from '../../errors/SDKError.js'
6
6
 
7
7
  export const parseUTXOErrors = async (
8
8
  e: Error,
@@ -1,6 +1,6 @@
1
1
  import { ChainType } from '@lifi/types'
2
2
  import type { Client } from 'viem'
3
- import { type SDKProvider } from '../types.js'
3
+ import type { SDKProvider } from '../types.js'
4
4
 
5
5
  export interface UTXOProviderOptions {
6
6
  getWalletClient?: () => Promise<Client>
@@ -1,4 +1,4 @@
1
- import { type Account, type Chain, type Client, type Transport } from 'viem'
1
+ import type { Account, Chain, Client, Transport } from 'viem'
2
2
  import type { UTXOAPISchema } from '../transports/utxo/types.js'
3
3
 
4
4
  export type GetBalanceParameters = {
@@ -1,7 +1,7 @@
1
1
  import { Block } from 'bitcoinjs-lib'
2
2
  import {
3
- BlockNotFoundError,
4
3
  type Account,
4
+ BlockNotFoundError,
5
5
  type Chain,
6
6
  type Client,
7
7
  type Transport,
@@ -48,7 +48,7 @@ export async function getBlock<
48
48
  { dedupe: true }
49
49
  )
50
50
  }
51
- } catch (error) {
51
+ } catch (_error) {
52
52
  throw new BlockNotFoundError({ blockHash, blockNumber } as never)
53
53
  }
54
54
  if (!blockHex) {
@@ -1,4 +1,4 @@
1
- import { type Account, type Chain, type Client, type Transport } from 'viem'
1
+ import type { Account, Chain, Client, Transport } from 'viem'
2
2
  import type { UTXOSchema } from '../transports/utxo/types.js'
3
3
 
4
4
  export type GetBlockCountReturnType = number
@@ -1,6 +1,6 @@
1
1
  import {
2
- BlockNotFoundError,
3
2
  type Account,
3
+ BlockNotFoundError,
4
4
  type Chain,
5
5
  type Client,
6
6
  type Transport,
@@ -49,7 +49,7 @@ export async function getBlockStats<
49
49
  { dedupe: true }
50
50
  )
51
51
  return data
52
- } catch (error) {
52
+ } catch (_error) {
53
53
  throw new BlockNotFoundError({ blockHash, blockNumber } as never)
54
54
  }
55
55
  }
@@ -1,8 +1,8 @@
1
1
  import {
2
- TransactionNotFoundError,
3
2
  type Account,
4
3
  type Chain,
5
4
  type Client,
5
+ TransactionNotFoundError,
6
6
  type Transport,
7
7
  } from 'viem'
8
8
  import type { UTXOSchema } from '../transports/utxo/types.js'
@@ -34,7 +34,7 @@ export async function getUTXOTransaction<
34
34
  params: params,
35
35
  })
36
36
  return data
37
- } catch (error) {
37
+ } catch (_error) {
38
38
  throw new TransactionNotFoundError({
39
39
  blockHash: blockHash as never,
40
40
  hash: txId as never,
@@ -1,4 +1,4 @@
1
- import { type Account, type Chain, type Client, type Transport } from 'viem'
1
+ import type { Account, Chain, Client, Transport } from 'viem'
2
2
  import type { UTXOSchema } from '../transports/utxo/types.js'
3
3
 
4
4
  export type SendUTXOTransactionParameters = {
@@ -1,4 +1,4 @@
1
- import { type Account, type Chain, type Client, type Transport } from 'viem'
1
+ import type { Account, Chain, Client, Transport } from 'viem'
2
2
  import type {
3
3
  SignPsbtParameters,
4
4
  SignPsbtReturnType,
@@ -1,13 +1,13 @@
1
- import { address, Transaction } from 'bitcoinjs-lib'
1
+ import { Transaction, address } from 'bitcoinjs-lib'
2
2
  import {
3
- stringify,
3
+ type Chain,
4
+ type Client,
4
5
  TransactionNotFoundError,
5
6
  TransactionReceiptNotFoundError,
7
+ type Transport,
6
8
  WaitForTransactionReceiptTimeoutError,
9
+ stringify,
7
10
  withRetry,
8
- type Chain,
9
- type Client,
10
- type Transport,
11
11
  } from 'viem'
12
12
  import { getAction } from 'viem/utils'
13
13
  import type { UTXOTransaction } from '../types/transaction.js'
@@ -262,15 +262,15 @@ export async function waitForTransaction<chain extends Chain | undefined>(
262
262
  // Create a set of input identifiers for mempool transaction
263
263
  const replacedTransactionInputs = new Set<string>()
264
264
 
265
- replacedTransaction.ins.forEach((input) => {
265
+ for (const input of replacedTransaction.ins) {
266
266
  const txid = Array.from(input.hash)
267
267
  .reverse()
268
- .map((byte) => ('00' + byte.toString(16)).slice(-2))
268
+ .map((byte) => `00${byte.toString(16)}`.slice(-2))
269
269
  .join('')
270
270
  const vout = input.index
271
271
  const inputId = `${txid}:${vout}`
272
272
  replacedTransactionInputs.add(inputId)
273
- })
273
+ }
274
274
 
275
275
  let replacementTransaction: Transaction | undefined
276
276
 
@@ -283,7 +283,7 @@ export async function waitForTransaction<chain extends Chain | undefined>(
283
283
  for (const input of tx.ins) {
284
284
  const txid = Array.from(input.hash)
285
285
  .reverse()
286
- .map((byte) => ('00' + byte.toString(16)).slice(-2))
286
+ .map((byte) => `00${byte.toString(16)}`.slice(-2))
287
287
  .join('')
288
288
  const vout = input.index
289
289
  const inputId = `${txid}:${vout}`
@@ -330,7 +330,7 @@ export async function waitForTransaction<chain extends Chain | undefined>(
330
330
  output.script
331
331
  )
332
332
  addresses.push(outputAddress)
333
- } catch (e) {
333
+ } catch (_e) {
334
334
  // Handle non-standard scripts (e.g., OP_RETURN)
335
335
  }
336
336
  }
@@ -1,8 +1,8 @@
1
- import { stringify, type Chain, type Client, type Transport } from 'viem'
1
+ import { type Chain, type Client, type Transport, stringify } from 'viem'
2
2
  import { getAction } from 'viem/utils'
3
3
  import { observe } from '../utils/observe.js'
4
4
  import { poll } from '../utils/poll.js'
5
- import { getBlockCount, type GetBlockCountReturnType } from './getBlockCount.js'
5
+ import { type GetBlockCountReturnType, getBlockCount } from './getBlockCount.js'
6
6
 
7
7
  export type OnBlockNumberParameter = GetBlockCountReturnType
8
8
  export type OnBlockNumberFn = (
@@ -1,9 +1,8 @@
1
- /* eslint-disable @typescript-eslint/no-unused-vars */
2
1
  import type { Account, Chain, Client, Transport } from 'viem'
3
2
  import {
4
- getBalance,
5
3
  type GetBalanceParameters,
6
4
  type GetBalanceReturnType,
5
+ getBalance,
7
6
  } from '../actions/getBalance.js'
8
7
 
9
8
  export type UTXOAPIActions = {
@@ -1,17 +1,17 @@
1
1
  import type { Account, Chain, Client, Transport } from 'viem'
2
2
  import {
3
- getBlockCount,
4
3
  type GetBlockCountReturnType,
4
+ getBlockCount,
5
5
  } from '../actions/getBlockCount.js'
6
6
  import {
7
- getUTXOTransaction,
8
7
  type GetUTXOTransactionParameters,
9
8
  type GetUTXOTransactionReturnType,
9
+ getUTXOTransaction,
10
10
  } from '../actions/getUTXOTransaction.js'
11
11
  import {
12
- sendUTXOTransaction,
13
12
  type SendUTXOTransactionParameters,
14
13
  type SendUTXOTransactionReturnType,
14
+ sendUTXOTransaction,
15
15
  } from '../actions/sendUTXOTransaction.js'
16
16
 
17
17
  export type UTXOActions = {
@@ -1,4 +1,4 @@
1
- import { HttpRequestError, stringify, TimeoutError, withTimeout } from 'viem'
1
+ import { HttpRequestError, TimeoutError, stringify, withTimeout } from 'viem'
2
2
  import type { HttpRequestReturnType, HttpRpcClientOptions } from 'viem/utils'
3
3
 
4
4
  export type RpcRequest = {
@@ -1,9 +1,9 @@
1
1
  import {
2
- createTransport,
3
- RpcRequestError,
4
- UrlRequiredError,
5
2
  type HttpTransport,
6
3
  type HttpTransportConfig,
4
+ RpcRequestError,
5
+ UrlRequiredError,
6
+ createTransport,
7
7
  } from 'viem'
8
8
  import { getHttpRpcClient } from './getHttpRpcClient.js'
9
9
  import { getRpcProviderMethods } from './getRpcProviderMethods.js'
@@ -1,4 +1,4 @@
1
- import { address, Psbt } from 'bitcoinjs-lib'
1
+ import { Psbt, address } from 'bitcoinjs-lib'
2
2
 
3
3
  interface InputData {
4
4
  hash: Uint8Array
@@ -1,4 +1,4 @@
1
- import { address, Psbt } from 'bitcoinjs-lib'
1
+ import { Psbt, address } from 'bitcoinjs-lib'
2
2
 
3
3
  interface InputData {
4
4
  hash: Uint8Array
@@ -4,7 +4,7 @@ type PollOptions<T> = {
4
4
  // Whether or not to emit when the polling starts.
5
5
  emitOnBegin?: boolean | undefined
6
6
  // The initial wait time (in ms) before polling.
7
- initialWaitTime?: ((data: T | void) => Promise<number>) | undefined
7
+ initialWaitTime?: ((data: T | undefined) => Promise<number>) | undefined
8
8
  // The interval (in ms).
9
9
  interval: number
10
10
  }
@@ -13,15 +13,17 @@ type PollOptions<T> = {
13
13
  * @description Polls a function at a specified interval.
14
14
  */
15
15
  export function poll<T>(
16
- fn: ({ unpoll }: { unpoll: () => void }) => Promise<T | void>,
16
+ fn: ({ unpoll }: { unpoll: () => void }) => Promise<T | undefined>,
17
17
  { emitOnBegin, initialWaitTime, interval }: PollOptions<T>
18
18
  ) {
19
19
  let active = true
20
20
 
21
- const unwatch = () => (active = false)
21
+ const unwatch = () => {
22
+ active = false
23
+ }
22
24
 
23
25
  const watch = async () => {
24
- let data: T | void = undefined
26
+ let data: T | undefined = undefined
25
27
  if (emitOnBegin) {
26
28
  data = await fn({ unpoll: unwatch })
27
29
  }
@@ -28,16 +28,10 @@ export const checkBalance = async (
28
28
  } else {
29
29
  const neeeded = formatUnits(neededBalance, token.decimals)
30
30
  const current = formatUnits(currentBalance, token.decimals)
31
- let errorMessage =
32
- `Your ${token.symbol} balance is too low, ` +
33
- `you try to transfer ${neeeded} ${token.symbol}, ` +
34
- `but your wallet only holds ${current} ${token.symbol}. ` +
35
- `No funds have been sent.`
31
+ let _errorMessage = `Your ${token.symbol} balance is too low, you try to transfer ${neeeded} ${token.symbol}, but your wallet only holds ${current} ${token.symbol}. No funds have been sent.`
36
32
 
37
33
  if (currentBalance !== 0n) {
38
- errorMessage +=
39
- `If the problem consists, please delete this transfer and ` +
40
- `start a new one with a maximum of ${current} ${token.symbol}.`
34
+ _errorMessage += `If the problem consists, please delete this transfer and start a new one with a maximum of ${current} ${token.symbol}.`
41
35
  }
42
36
 
43
37
  throw new BalanceError('The balance is too low.')
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-empty-function */
2
1
  import type { Route } from '@lifi/types'
3
2
  import { config } from '../config.js'
4
3
  import { executionState } from './executionState.js'
@@ -1,8 +1,8 @@
1
- import {
2
- type ProcessStatus,
3
- type ProcessType,
4
- type StatusMessage,
5
- type Substatus,
1
+ import type {
2
+ ProcessStatus,
3
+ ProcessType,
4
+ StatusMessage,
5
+ Substatus,
6
6
  } from '@lifi/types'
7
7
 
8
8
  const processMessages: Record<
package/src/core/rpc.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type ChainId } from '@lifi/types'
1
+ import type { ChainId } from '@lifi/types'
2
2
  import { config } from '../config.js'
3
3
 
4
4
  export const getRpcUrl = async (chainId: ChainId): Promise<string> => {
@@ -42,7 +42,7 @@ export const stepComparison = async (
42
42
  // The user declined the new exchange rate, so we are not going to proceed
43
43
  throw new TransactionError(
44
44
  LiFiErrorCode.ExchangeRateUpdateCanceled,
45
- `Exchange rate has changed!\nTransaction was not sent, your funds are still in your wallet.\nThe exchange rate has changed and the previous estimation can not be fulfilled due to value loss.`
45
+ 'Exchange rate has changed!\nTransaction was not sent, your funds are still in your wallet.\nThe exchange rate has changed and the previous estimation can not be fulfilled due to value loss.'
46
46
  )
47
47
  }
48
48
 
package/src/core/utils.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type LiFiStep } from '@lifi/types'
1
+ import type { LiFiStep } from '@lifi/types'
2
2
 
3
3
  /**
4
4
  * Used to check if changed exchange rate is in the range of slippage threshold.