@bigmi/core 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (338) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +2 -2
  3. package/dist/cjs/actions/getBalance.d.ts +2 -2
  4. package/dist/cjs/actions/getBlock.d.ts +1 -5
  5. package/dist/cjs/actions/getBlockCount.d.ts +0 -1
  6. package/dist/cjs/actions/getBlockStats.d.ts +1 -6
  7. package/dist/cjs/actions/getTransactionFee.d.ts +1 -4
  8. package/dist/cjs/actions/getTransactions.d.ts +1 -7
  9. package/dist/cjs/actions/getUTXOTransaction.d.ts +4 -6
  10. package/dist/cjs/actions/getUTXOs.d.ts +1 -5
  11. package/dist/cjs/actions/getXPubAddresses.d.ts +22 -22
  12. package/dist/cjs/actions/sendUTXOTransaction.d.ts +4 -6
  13. package/dist/cjs/actions/signPsbt.d.ts +0 -1
  14. package/dist/cjs/actions/waitForTransaction.d.ts +43 -49
  15. package/dist/cjs/actions/waitForTransaction.js.map +1 -1
  16. package/dist/cjs/actions/watchBlockNumber.d.ts +14 -16
  17. package/dist/cjs/actions/watchBlockNumber.js.map +1 -1
  18. package/dist/cjs/chains/bitcoin.d.ts +0 -1
  19. package/dist/cjs/chains/bitcoin.js.map +1 -1
  20. package/dist/cjs/chains/defineChain.d.ts +0 -1
  21. package/dist/cjs/chains/signet.d.ts +0 -1
  22. package/dist/cjs/chains/signet.js.map +1 -1
  23. package/dist/cjs/clients/decorators/public.d.ts +0 -1
  24. package/dist/cjs/clients/decorators/wallet.d.ts +2 -3
  25. package/dist/cjs/errors/address.d.ts +1 -4
  26. package/dist/cjs/errors/base.js.map +1 -1
  27. package/dist/cjs/errors/block.d.ts +1 -5
  28. package/dist/cjs/errors/provider.d.ts +0 -1
  29. package/dist/cjs/errors/request.d.ts +5 -28
  30. package/dist/cjs/errors/request.js.map +1 -1
  31. package/dist/cjs/errors/rpc.d.ts +23 -24
  32. package/dist/cjs/errors/transaction.d.ts +3 -14
  33. package/dist/cjs/errors/transport.d.ts +2 -10
  34. package/dist/cjs/errors/transport.js.map +1 -1
  35. package/dist/cjs/errors/utils.d.ts +0 -1
  36. package/dist/cjs/errors/utxo.d.ts +1 -6
  37. package/dist/cjs/factories/createClient.d.ts +49 -30
  38. package/dist/cjs/factories/createTransport.d.ts +3 -13
  39. package/dist/cjs/transports/ankr/ankr.d.ts +0 -1
  40. package/dist/cjs/transports/ankr/getBalance.d.ts +0 -1
  41. package/dist/cjs/transports/ankr/getTransactionFee.d.ts +0 -1
  42. package/dist/cjs/transports/ankr/getTransactions.d.ts +0 -1
  43. package/dist/cjs/transports/ankr/methods.d.ts +0 -1
  44. package/dist/cjs/transports/ankr/utils.d.ts +0 -1
  45. package/dist/cjs/transports/blockchair/blockchair.d.ts +0 -1
  46. package/dist/cjs/transports/blockchair/getBalance.d.ts +0 -1
  47. package/dist/cjs/transports/blockchair/getTransactionFee.d.ts +0 -1
  48. package/dist/cjs/transports/blockchair/getTransactionFee.js.map +1 -1
  49. package/dist/cjs/transports/blockchair/getUTXOs.d.ts +0 -1
  50. package/dist/cjs/transports/blockchair/getUTXOs.js.map +1 -1
  51. package/dist/cjs/transports/blockchair/getXPubAddresses.d.ts +0 -1
  52. package/dist/cjs/transports/blockchair/getXPubAddresses.js.map +1 -1
  53. package/dist/cjs/transports/blockchair/methods.d.ts +0 -1
  54. package/dist/cjs/transports/blockcypher/blockcypher.d.ts +0 -1
  55. package/dist/cjs/transports/blockcypher/getBalance.d.ts +0 -1
  56. package/dist/cjs/transports/blockcypher/getTransactionFee.d.ts +0 -1
  57. package/dist/cjs/transports/blockcypher/getUTXOs.d.ts +0 -1
  58. package/dist/cjs/transports/blockcypher/getUTXOs.js.map +1 -1
  59. package/dist/cjs/transports/blockcypher/methods.d.ts +0 -1
  60. package/dist/cjs/transports/blockcypher/utils.d.ts +0 -1
  61. package/dist/cjs/transports/blockcypher/utils.js.map +1 -1
  62. package/dist/cjs/transports/custom.d.ts +11 -7
  63. package/dist/cjs/transports/fallback.d.ts +32 -36
  64. package/dist/cjs/transports/fallback.js.map +1 -1
  65. package/dist/cjs/transports/getHttpRpcClient.d.ts +17 -9
  66. package/dist/cjs/transports/getHttpRpcClient.js.map +1 -1
  67. package/dist/cjs/transports/getRpcProviderMethods.d.ts +0 -1
  68. package/dist/cjs/transports/http.d.ts +31 -20
  69. package/dist/cjs/transports/mempool/getBalance.d.ts +0 -1
  70. package/dist/cjs/transports/mempool/getTransactionFee.d.ts +0 -1
  71. package/dist/cjs/transports/mempool/getTransactions.d.ts +0 -1
  72. package/dist/cjs/transports/mempool/getTransactions.js.map +1 -1
  73. package/dist/cjs/transports/mempool/mempool.d.ts +0 -1
  74. package/dist/cjs/transports/mempool/methods.d.ts +0 -1
  75. package/dist/cjs/transports/mempool/utils.d.ts +0 -1
  76. package/dist/cjs/transports/types.d.ts +17 -15
  77. package/dist/cjs/transports/utxo.d.ts +0 -1
  78. package/dist/cjs/transports/utxo.js.map +1 -1
  79. package/dist/cjs/types/account.d.ts +0 -1
  80. package/dist/cjs/types/address.d.ts +0 -1
  81. package/dist/cjs/types/block.d.ts +17 -17
  82. package/dist/cjs/types/chain.d.ts +20 -9
  83. package/dist/cjs/types/client.d.ts +40 -25
  84. package/dist/cjs/types/request.d.ts +12 -8
  85. package/dist/cjs/types/transport.d.ts +16 -11
  86. package/dist/cjs/types/utils.d.ts +31 -31
  87. package/dist/cjs/types/xpub.d.ts +0 -1
  88. package/dist/cjs/utils/buildRequest.d.ts +0 -1
  89. package/dist/cjs/utils/cancelTransaction.d.ts +0 -1
  90. package/dist/cjs/utils/converter.js.map +1 -1
  91. package/dist/cjs/utils/createBatchScheduler.d.ts +1 -8
  92. package/dist/cjs/utils/createBatchScheduler.js.map +1 -1
  93. package/dist/cjs/utils/deepEqual.js.map +1 -1
  94. package/dist/cjs/utils/getAction.d.ts +6 -7
  95. package/dist/cjs/utils/getAddressInfo.d.ts +0 -1
  96. package/dist/cjs/utils/getAddressInfo.js.map +1 -1
  97. package/dist/cjs/utils/isAddress.d.ts +0 -1
  98. package/dist/cjs/utils/lru.d.ts +4 -4
  99. package/dist/cjs/utils/lru.js.map +1 -1
  100. package/dist/cjs/utils/modifyFee.d.ts +0 -1
  101. package/dist/cjs/utils/modifyFee.js.map +1 -1
  102. package/dist/cjs/utils/observe.d.ts +4 -5
  103. package/dist/cjs/utils/observe.js.map +1 -1
  104. package/dist/cjs/utils/parseAccount.d.ts +0 -1
  105. package/dist/cjs/utils/poll.d.ts +4 -10
  106. package/dist/cjs/utils/retryUntil.d.ts +17 -15
  107. package/dist/cjs/utils/retryUntil.js.map +1 -1
  108. package/dist/cjs/utils/stringify.d.ts +0 -1
  109. package/dist/cjs/utils/uid.js.map +1 -1
  110. package/dist/cjs/utils/url.js.map +1 -1
  111. package/dist/cjs/utils/withDedupe.d.ts +1 -5
  112. package/dist/cjs/utils/withDedupe.js.map +1 -1
  113. package/dist/cjs/utils/withRetry.d.ts +2 -10
  114. package/dist/cjs/utils/withTimeout.d.ts +2 -9
  115. package/dist/cjs/utils/withTimeout.js.map +1 -1
  116. package/dist/cjs/version.d.ts +1 -1
  117. package/dist/cjs/version.js +1 -1
  118. package/dist/cjs/version.js.map +1 -1
  119. package/dist/esm/actions/getBalance.d.ts +2 -2
  120. package/dist/esm/actions/getBalance.d.ts.map +1 -1
  121. package/dist/esm/actions/getBlock.d.ts +1 -5
  122. package/dist/esm/actions/getBlock.d.ts.map +1 -1
  123. package/dist/esm/actions/getBlockCount.d.ts +0 -1
  124. package/dist/esm/actions/getBlockCount.d.ts.map +1 -1
  125. package/dist/esm/actions/getBlockStats.d.ts +1 -6
  126. package/dist/esm/actions/getBlockStats.d.ts.map +1 -1
  127. package/dist/esm/actions/getTransactionFee.d.ts +1 -4
  128. package/dist/esm/actions/getTransactionFee.d.ts.map +1 -1
  129. package/dist/esm/actions/getTransactions.d.ts +1 -7
  130. package/dist/esm/actions/getTransactions.d.ts.map +1 -1
  131. package/dist/esm/actions/getUTXOTransaction.d.ts +4 -6
  132. package/dist/esm/actions/getUTXOTransaction.d.ts.map +1 -1
  133. package/dist/esm/actions/getUTXOs.d.ts +1 -5
  134. package/dist/esm/actions/getUTXOs.d.ts.map +1 -1
  135. package/dist/esm/actions/getXPubAddresses.d.ts +22 -22
  136. package/dist/esm/actions/getXPubAddresses.d.ts.map +1 -1
  137. package/dist/esm/actions/sendUTXOTransaction.d.ts +4 -6
  138. package/dist/esm/actions/sendUTXOTransaction.d.ts.map +1 -1
  139. package/dist/esm/actions/signPsbt.d.ts +0 -1
  140. package/dist/esm/actions/signPsbt.d.ts.map +1 -1
  141. package/dist/esm/actions/waitForTransaction.d.ts +43 -49
  142. package/dist/esm/actions/waitForTransaction.d.ts.map +1 -1
  143. package/dist/esm/actions/waitForTransaction.js.map +1 -1
  144. package/dist/esm/actions/watchBlockNumber.d.ts +14 -16
  145. package/dist/esm/actions/watchBlockNumber.d.ts.map +1 -1
  146. package/dist/esm/actions/watchBlockNumber.js.map +1 -1
  147. package/dist/esm/chains/bitcoin.d.ts +0 -1
  148. package/dist/esm/chains/bitcoin.d.ts.map +1 -1
  149. package/dist/esm/chains/defineChain.d.ts +0 -1
  150. package/dist/esm/chains/defineChain.d.ts.map +1 -1
  151. package/dist/esm/chains/signet.d.ts +0 -1
  152. package/dist/esm/chains/signet.d.ts.map +1 -1
  153. package/dist/esm/clients/decorators/public.d.ts +0 -1
  154. package/dist/esm/clients/decorators/public.d.ts.map +1 -1
  155. package/dist/esm/clients/decorators/wallet.d.ts +2 -3
  156. package/dist/esm/clients/decorators/wallet.d.ts.map +1 -1
  157. package/dist/esm/errors/address.d.ts +1 -4
  158. package/dist/esm/errors/address.d.ts.map +1 -1
  159. package/dist/esm/errors/base.d.ts.map +1 -1
  160. package/dist/esm/errors/base.js.map +1 -1
  161. package/dist/esm/errors/block.d.ts +1 -5
  162. package/dist/esm/errors/block.d.ts.map +1 -1
  163. package/dist/esm/errors/provider.d.ts +0 -1
  164. package/dist/esm/errors/provider.d.ts.map +1 -1
  165. package/dist/esm/errors/request.d.ts +5 -28
  166. package/dist/esm/errors/request.d.ts.map +1 -1
  167. package/dist/esm/errors/request.js.map +1 -1
  168. package/dist/esm/errors/rpc.d.ts +23 -24
  169. package/dist/esm/errors/rpc.d.ts.map +1 -1
  170. package/dist/esm/errors/transaction.d.ts +3 -14
  171. package/dist/esm/errors/transaction.d.ts.map +1 -1
  172. package/dist/esm/errors/transport.d.ts +2 -10
  173. package/dist/esm/errors/transport.d.ts.map +1 -1
  174. package/dist/esm/errors/transport.js.map +1 -1
  175. package/dist/esm/errors/utils.d.ts +0 -1
  176. package/dist/esm/errors/utils.d.ts.map +1 -1
  177. package/dist/esm/errors/utxo.d.ts +1 -6
  178. package/dist/esm/errors/utxo.d.ts.map +1 -1
  179. package/dist/esm/factories/createClient.d.ts +49 -30
  180. package/dist/esm/factories/createClient.d.ts.map +1 -1
  181. package/dist/esm/factories/createTransport.d.ts +3 -13
  182. package/dist/esm/factories/createTransport.d.ts.map +1 -1
  183. package/dist/esm/test/utils.d.ts.map +1 -1
  184. package/dist/esm/transports/ankr/ankr.d.ts +0 -1
  185. package/dist/esm/transports/ankr/ankr.d.ts.map +1 -1
  186. package/dist/esm/transports/ankr/ankr.types.d.ts.map +1 -1
  187. package/dist/esm/transports/ankr/getBalance.d.ts +0 -1
  188. package/dist/esm/transports/ankr/getBalance.d.ts.map +1 -1
  189. package/dist/esm/transports/ankr/getTransactionFee.d.ts +0 -1
  190. package/dist/esm/transports/ankr/getTransactionFee.d.ts.map +1 -1
  191. package/dist/esm/transports/ankr/getTransactions.d.ts +0 -1
  192. package/dist/esm/transports/ankr/getTransactions.d.ts.map +1 -1
  193. package/dist/esm/transports/ankr/methods.d.ts +0 -1
  194. package/dist/esm/transports/ankr/methods.d.ts.map +1 -1
  195. package/dist/esm/transports/ankr/utils.d.ts +0 -1
  196. package/dist/esm/transports/ankr/utils.d.ts.map +1 -1
  197. package/dist/esm/transports/blockchair/blockchair.d.ts +0 -1
  198. package/dist/esm/transports/blockchair/blockchair.d.ts.map +1 -1
  199. package/dist/esm/transports/blockchair/blockchair.types.d.ts.map +1 -1
  200. package/dist/esm/transports/blockchair/getBalance.d.ts +0 -1
  201. package/dist/esm/transports/blockchair/getBalance.d.ts.map +1 -1
  202. package/dist/esm/transports/blockchair/getTransactionFee.d.ts +0 -1
  203. package/dist/esm/transports/blockchair/getTransactionFee.d.ts.map +1 -1
  204. package/dist/esm/transports/blockchair/getTransactionFee.js.map +1 -1
  205. package/dist/esm/transports/blockchair/getUTXOs.d.ts +0 -1
  206. package/dist/esm/transports/blockchair/getUTXOs.d.ts.map +1 -1
  207. package/dist/esm/transports/blockchair/getUTXOs.js.map +1 -1
  208. package/dist/esm/transports/blockchair/getXPubAddresses.d.ts +0 -1
  209. package/dist/esm/transports/blockchair/getXPubAddresses.d.ts.map +1 -1
  210. package/dist/esm/transports/blockchair/getXPubAddresses.js.map +1 -1
  211. package/dist/esm/transports/blockchair/methods.d.ts +0 -1
  212. package/dist/esm/transports/blockchair/methods.d.ts.map +1 -1
  213. package/dist/esm/transports/blockcypher/blockcypher.d.ts +0 -1
  214. package/dist/esm/transports/blockcypher/blockcypher.d.ts.map +1 -1
  215. package/dist/esm/transports/blockcypher/blockcypher.types.d.ts.map +1 -1
  216. package/dist/esm/transports/blockcypher/getBalance.d.ts +0 -1
  217. package/dist/esm/transports/blockcypher/getBalance.d.ts.map +1 -1
  218. package/dist/esm/transports/blockcypher/getTransactionFee.d.ts +0 -1
  219. package/dist/esm/transports/blockcypher/getTransactionFee.d.ts.map +1 -1
  220. package/dist/esm/transports/blockcypher/getUTXOs.d.ts +0 -1
  221. package/dist/esm/transports/blockcypher/getUTXOs.d.ts.map +1 -1
  222. package/dist/esm/transports/blockcypher/getUTXOs.js.map +1 -1
  223. package/dist/esm/transports/blockcypher/methods.d.ts +0 -1
  224. package/dist/esm/transports/blockcypher/methods.d.ts.map +1 -1
  225. package/dist/esm/transports/blockcypher/utils.d.ts +0 -1
  226. package/dist/esm/transports/blockcypher/utils.d.ts.map +1 -1
  227. package/dist/esm/transports/blockcypher/utils.js.map +1 -1
  228. package/dist/esm/transports/custom.d.ts +11 -7
  229. package/dist/esm/transports/custom.d.ts.map +1 -1
  230. package/dist/esm/transports/fallback.d.ts +32 -36
  231. package/dist/esm/transports/fallback.d.ts.map +1 -1
  232. package/dist/esm/transports/fallback.js.map +1 -1
  233. package/dist/esm/transports/getHttpRpcClient.d.ts +17 -9
  234. package/dist/esm/transports/getHttpRpcClient.d.ts.map +1 -1
  235. package/dist/esm/transports/getHttpRpcClient.js.map +1 -1
  236. package/dist/esm/transports/getRpcProviderMethods.d.ts +0 -1
  237. package/dist/esm/transports/getRpcProviderMethods.d.ts.map +1 -1
  238. package/dist/esm/transports/http.d.ts +31 -20
  239. package/dist/esm/transports/http.d.ts.map +1 -1
  240. package/dist/esm/transports/mempool/getBalance.d.ts +0 -1
  241. package/dist/esm/transports/mempool/getBalance.d.ts.map +1 -1
  242. package/dist/esm/transports/mempool/getTransactionFee.d.ts +0 -1
  243. package/dist/esm/transports/mempool/getTransactionFee.d.ts.map +1 -1
  244. package/dist/esm/transports/mempool/getTransactions.d.ts +0 -1
  245. package/dist/esm/transports/mempool/getTransactions.d.ts.map +1 -1
  246. package/dist/esm/transports/mempool/getTransactions.js.map +1 -1
  247. package/dist/esm/transports/mempool/mempool.d.ts +0 -1
  248. package/dist/esm/transports/mempool/mempool.d.ts.map +1 -1
  249. package/dist/esm/transports/mempool/mempool.types.d.ts.map +1 -1
  250. package/dist/esm/transports/mempool/methods.d.ts +0 -1
  251. package/dist/esm/transports/mempool/methods.d.ts.map +1 -1
  252. package/dist/esm/transports/mempool/utils.d.ts +0 -1
  253. package/dist/esm/transports/mempool/utils.d.ts.map +1 -1
  254. package/dist/esm/transports/types.d.ts +17 -15
  255. package/dist/esm/transports/types.d.ts.map +1 -1
  256. package/dist/esm/transports/utxo.d.ts +0 -1
  257. package/dist/esm/transports/utxo.d.ts.map +1 -1
  258. package/dist/esm/transports/utxo.js.map +1 -1
  259. package/dist/esm/types/account.d.ts +0 -1
  260. package/dist/esm/types/account.d.ts.map +1 -1
  261. package/dist/esm/types/address.d.ts +0 -1
  262. package/dist/esm/types/address.d.ts.map +1 -1
  263. package/dist/esm/types/block.d.ts +17 -17
  264. package/dist/esm/types/block.d.ts.map +1 -1
  265. package/dist/esm/types/blockStats.d.ts.map +1 -1
  266. package/dist/esm/types/chain.d.ts +20 -9
  267. package/dist/esm/types/chain.d.ts.map +1 -1
  268. package/dist/esm/types/client.d.ts +40 -25
  269. package/dist/esm/types/client.d.ts.map +1 -1
  270. package/dist/esm/types/hash.d.ts.map +1 -1
  271. package/dist/esm/types/request.d.ts +12 -8
  272. package/dist/esm/types/request.d.ts.map +1 -1
  273. package/dist/esm/types/rpc.d.ts.map +1 -1
  274. package/dist/esm/types/transaction.d.ts.map +1 -1
  275. package/dist/esm/types/transport.d.ts +16 -11
  276. package/dist/esm/types/transport.d.ts.map +1 -1
  277. package/dist/esm/types/utils.d.ts +31 -31
  278. package/dist/esm/types/utils.d.ts.map +1 -1
  279. package/dist/esm/types/xpub.d.ts +0 -1
  280. package/dist/esm/types/xpub.d.ts.map +1 -1
  281. package/dist/esm/utils/buildRequest.d.ts +0 -1
  282. package/dist/esm/utils/buildRequest.d.ts.map +1 -1
  283. package/dist/esm/utils/cancelTransaction.d.ts +0 -1
  284. package/dist/esm/utils/cancelTransaction.d.ts.map +1 -1
  285. package/dist/esm/utils/converter.d.ts.map +1 -1
  286. package/dist/esm/utils/converter.js.map +1 -1
  287. package/dist/esm/utils/createBatchScheduler.d.ts +1 -8
  288. package/dist/esm/utils/createBatchScheduler.d.ts.map +1 -1
  289. package/dist/esm/utils/createBatchScheduler.js.map +1 -1
  290. package/dist/esm/utils/deepEqual.d.ts.map +1 -1
  291. package/dist/esm/utils/deepEqual.js.map +1 -1
  292. package/dist/esm/utils/getAction.d.ts +6 -7
  293. package/dist/esm/utils/getAction.d.ts.map +1 -1
  294. package/dist/esm/utils/getAddressInfo.d.ts +0 -1
  295. package/dist/esm/utils/getAddressInfo.d.ts.map +1 -1
  296. package/dist/esm/utils/getAddressInfo.js.map +1 -1
  297. package/dist/esm/utils/idCache.d.ts.map +1 -1
  298. package/dist/esm/utils/isAddress.d.ts +0 -1
  299. package/dist/esm/utils/isAddress.d.ts.map +1 -1
  300. package/dist/esm/utils/lru.d.ts +4 -4
  301. package/dist/esm/utils/lru.d.ts.map +1 -1
  302. package/dist/esm/utils/lru.js.map +1 -1
  303. package/dist/esm/utils/modifyFee.d.ts +0 -1
  304. package/dist/esm/utils/modifyFee.d.ts.map +1 -1
  305. package/dist/esm/utils/modifyFee.js.map +1 -1
  306. package/dist/esm/utils/observe.d.ts +4 -5
  307. package/dist/esm/utils/observe.d.ts.map +1 -1
  308. package/dist/esm/utils/observe.js.map +1 -1
  309. package/dist/esm/utils/parseAccount.d.ts +0 -1
  310. package/dist/esm/utils/parseAccount.d.ts.map +1 -1
  311. package/dist/esm/utils/poll.d.ts +4 -10
  312. package/dist/esm/utils/poll.d.ts.map +1 -1
  313. package/dist/esm/utils/retryUntil.d.ts +17 -15
  314. package/dist/esm/utils/retryUntil.d.ts.map +1 -1
  315. package/dist/esm/utils/retryUntil.js.map +1 -1
  316. package/dist/esm/utils/sleep.d.ts.map +1 -1
  317. package/dist/esm/utils/stringify.d.ts +0 -1
  318. package/dist/esm/utils/stringify.d.ts.map +1 -1
  319. package/dist/esm/utils/uid.d.ts.map +1 -1
  320. package/dist/esm/utils/uid.js.map +1 -1
  321. package/dist/esm/utils/url.d.ts.map +1 -1
  322. package/dist/esm/utils/url.js.map +1 -1
  323. package/dist/esm/utils/wait.d.ts.map +1 -1
  324. package/dist/esm/utils/withDedupe.d.ts +1 -5
  325. package/dist/esm/utils/withDedupe.d.ts.map +1 -1
  326. package/dist/esm/utils/withDedupe.js.map +1 -1
  327. package/dist/esm/utils/withResolvers.d.ts.map +1 -1
  328. package/dist/esm/utils/withRetry.d.ts +2 -10
  329. package/dist/esm/utils/withRetry.d.ts.map +1 -1
  330. package/dist/esm/utils/withTimeout.d.ts +2 -9
  331. package/dist/esm/utils/withTimeout.d.ts.map +1 -1
  332. package/dist/esm/utils/withTimeout.js.map +1 -1
  333. package/dist/esm/version.d.ts +1 -1
  334. package/dist/esm/version.d.ts.map +1 -1
  335. package/dist/esm/version.js +1 -1
  336. package/dist/esm/version.js.map +1 -1
  337. package/package.json +1 -1
  338. package/src/version.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @bigmi/core
2
2
 
3
+ ## 0.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#62](https://github.com/lifinance/bigmi/pull/62) [`3569fc2`](https://github.com/lifinance/bigmi/commit/3569fc295a7877daf5b47989edecde85b2c38ea8) Thanks [@chybisov](https://github.com/chybisov)! - chore: migrate the toolchain to TypeScript 7
8
+
9
+ Bump the `typescript` devDependency from `6.x` to `7.x` (the native compiler) across the workspace, and bump `tsdown` `0.22.3` → `0.22.7` so its peer range accepts `typescript@^7`.
10
+
11
+ This is a build-time-only change with **no integration impact**: `typescript` is a devDependency (never a peer/runtime dependency), so consumers' own TypeScript version is untouched, and `.d.ts`/`.js` emit is handled by tsdown (Rolldown + OXC isolated declarations), not `tsc`. `tsc --noEmit` type-checks cleanly on TS 7 with zero source changes, and the public type surface is semantically identical (a rebuild only reformats declaration whitespace/comments via the newer `rolldown-plugin-dts` printer). Safe to ship as a minor.
12
+
3
13
  ## 0.8.1
4
14
 
5
15
  ### Patch Changes
package/README.md CHANGED
@@ -110,12 +110,12 @@ Simple bigmi setup with a react app:
110
110
 
111
111
  import { bitcoin, http, createClient } from '@bigmi/core'
112
112
  import { BigmiProvider, createConfig } from '@bigmi/react'
113
- import { binance, xverse, phantom } from '@bigmi/client'
113
+ import { binance, xverse } from '@bigmi/client'
114
114
 
115
115
  // Create bigmi config object
116
116
  const config = createConfig({
117
117
  chains: [bitcoin],
118
- connectors: [binance(), xverse(), phantom()],
118
+ connectors: [binance(), xverse()],
119
119
  client: ({ chain }) => createClient({ chain, transport: http() }),
120
120
  ssr: true // If using Next.js or SSR
121
121
  })
@@ -3,10 +3,10 @@ import { UTXOSchema } from "../transports/types.js";
3
3
  import { Account } from "../types/account.js";
4
4
  import { Transport } from "../types/transport.js";
5
5
  import { Client } from "../types/client.js";
6
-
7
6
  //#region src/actions/getBalance.d.ts
8
7
  type GetBalanceParameters = {
9
- /** The address of the account. */address: string;
8
+ /** The address of the account. */
9
+ address: string;
10
10
  };
11
11
  type GetBalanceReturnType = bigint;
12
12
  declare function getBalance<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOSchema>, params: GetBalanceParameters): Promise<GetBalanceReturnType>;
@@ -4,7 +4,6 @@ import { Account } from "../types/account.js";
4
4
  import { Transport } from "../types/transport.js";
5
5
  import { Client } from "../types/client.js";
6
6
  import { Block } from "bitcoinjs-lib";
7
-
8
7
  //#region src/actions/getBlock.d.ts
9
8
  type GetBlockParameters = {
10
9
  blockHash: string;
@@ -14,10 +13,7 @@ type GetBlockParameters = {
14
13
  blockNumber: number;
15
14
  };
16
15
  type GetBlockReturnType = Block;
17
- declare function getBlock<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOSchema>, {
18
- blockHash,
19
- blockNumber
20
- }: GetBlockParameters): Promise<GetBlockReturnType>;
16
+ declare function getBlock<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOSchema>, { blockHash, blockNumber }: GetBlockParameters): Promise<GetBlockReturnType>;
21
17
  //#endregion
22
18
  export { GetBlockParameters, GetBlockReturnType, getBlock };
23
19
  //# sourceMappingURL=getBlock.d.ts.map
@@ -3,7 +3,6 @@ import { UTXOSchema } from "../transports/types.js";
3
3
  import { Account } from "../types/account.js";
4
4
  import { Transport } from "../types/transport.js";
5
5
  import { Client } from "../types/client.js";
6
-
7
6
  //#region src/actions/getBlockCount.d.ts
8
7
  type GetBlockCountReturnType = number;
9
8
  declare function getBlockCount<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOSchema>): Promise<GetBlockCountReturnType>;
@@ -4,7 +4,6 @@ import { UTXOSchema } from "../transports/types.js";
4
4
  import { Account } from "../types/account.js";
5
5
  import { Transport } from "../types/transport.js";
6
6
  import { Client } from "../types/client.js";
7
-
8
7
  //#region src/actions/getBlockStats.d.ts
9
8
  type GetBlockStatsParameters = ({
10
9
  blockHash: string;
@@ -16,11 +15,7 @@ type GetBlockStatsParameters = ({
16
15
  stats?: Array<BlockStatsKeys>;
17
16
  };
18
17
  type GetBlockStatsReturnType = BlockStats;
19
- declare function getBlockStats<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOSchema>, {
20
- blockHash,
21
- blockNumber,
22
- stats
23
- }: GetBlockStatsParameters): Promise<GetBlockStatsReturnType>;
18
+ declare function getBlockStats<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOSchema>, { blockHash, blockNumber, stats }: GetBlockStatsParameters): Promise<GetBlockStatsReturnType>;
24
19
  //#endregion
25
20
  export { GetBlockStatsParameters, GetBlockStatsReturnType, getBlockStats };
26
21
  //# sourceMappingURL=getBlockStats.d.ts.map
@@ -3,15 +3,12 @@ import { UTXOSchema } from "../transports/types.js";
3
3
  import { Account } from "../types/account.js";
4
4
  import { Transport } from "../types/transport.js";
5
5
  import { Client } from "../types/client.js";
6
-
7
6
  //#region src/actions/getTransactionFee.d.ts
8
7
  type GetTransactionFeeParameters = {
9
8
  txId: string;
10
9
  };
11
10
  type GetTransactionFeeReturnType = bigint;
12
- declare function getTransactionFee<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOSchema>, {
13
- txId
14
- }: GetTransactionFeeParameters): Promise<GetTransactionFeeReturnType>;
11
+ declare function getTransactionFee<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOSchema>, { txId }: GetTransactionFeeParameters): Promise<GetTransactionFeeReturnType>;
15
12
  //#endregion
16
13
  export { GetTransactionFeeParameters, GetTransactionFeeReturnType, getTransactionFee };
17
14
  //# sourceMappingURL=getTransactionFee.d.ts.map
@@ -4,7 +4,6 @@ import { UTXOSchema } from "../transports/types.js";
4
4
  import { Account } from "../types/account.js";
5
5
  import { Transport } from "../types/transport.js";
6
6
  import { Client } from "../types/client.js";
7
-
8
7
  //#region src/actions/getTransactions.d.ts
9
8
  type GetTransactionsParameters = {
10
9
  address: string;
@@ -18,12 +17,7 @@ type GetTransactionsReturnType = {
18
17
  total: number;
19
18
  hasMore?: boolean;
20
19
  };
21
- declare function getTransactions<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOSchema>, {
22
- address,
23
- offset,
24
- limit,
25
- lastBlock
26
- }: GetTransactionsParameters): Promise<GetTransactionsReturnType>;
20
+ declare function getTransactions<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOSchema>, { address, offset, limit, lastBlock }: GetTransactionsParameters): Promise<GetTransactionsReturnType>;
27
21
  //#endregion
28
22
  export { GetTransactionsParameters, GetTransactionsReturnType, getTransactions };
29
23
  //# sourceMappingURL=getTransactions.d.ts.map
@@ -4,17 +4,15 @@ import { UTXOSchema } from "../transports/types.js";
4
4
  import { Account } from "../types/account.js";
5
5
  import { Transport } from "../types/transport.js";
6
6
  import { Client } from "../types/client.js";
7
-
8
7
  //#region src/actions/getUTXOTransaction.d.ts
9
8
  type GetUTXOTransactionParameters = {
10
- /** The Id of the transaction */txId: string; /** The block in which to look for the transaction */
9
+ /** The Id of the transaction */
10
+ txId: string;
11
+ /** The block in which to look for the transaction */
11
12
  blockHash?: string;
12
13
  };
13
14
  type GetUTXOTransactionReturnType = UTXOTransaction;
14
- declare function getUTXOTransaction<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOSchema>, {
15
- txId,
16
- blockHash
17
- }: GetUTXOTransactionParameters): Promise<GetUTXOTransactionReturnType>;
15
+ declare function getUTXOTransaction<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOSchema>, { txId, blockHash }: GetUTXOTransactionParameters): Promise<GetUTXOTransactionReturnType>;
18
16
  //#endregion
19
17
  export { GetUTXOTransactionParameters, GetUTXOTransactionReturnType, getUTXOTransaction };
20
18
  //# sourceMappingURL=getUTXOTransaction.d.ts.map
@@ -4,17 +4,13 @@ import { UTXOSchema } from "../transports/types.js";
4
4
  import { Account } from "../types/account.js";
5
5
  import { Transport } from "../types/transport.js";
6
6
  import { Client } from "../types/client.js";
7
-
8
7
  //#region src/actions/getUTXOs.d.ts
9
8
  type GetUTXOsParameters = {
10
9
  address: string;
11
10
  minValue?: number;
12
11
  };
13
12
  type GetUTXOsReturnType = Array<UTXO>;
14
- declare function getUTXOs<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOSchema>, {
15
- address,
16
- minValue
17
- }: GetUTXOsParameters): Promise<GetUTXOsReturnType>;
13
+ declare function getUTXOs<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOSchema>, { address, minValue }: GetUTXOsParameters): Promise<GetUTXOsReturnType>;
18
14
  //#endregion
19
15
  export { GetUTXOsParameters, GetUTXOsReturnType, getUTXOs };
20
16
  //# sourceMappingURL=getUTXOs.d.ts.map
@@ -4,33 +4,33 @@ import { UTXOSchema } from "../transports/types.js";
4
4
  import { Account } from "../types/account.js";
5
5
  import { Transport } from "../types/transport.js";
6
6
  import { Client } from "../types/client.js";
7
-
8
7
  //#region src/actions/getXPubAddresses.d.ts
9
8
  type GetXPubAddressesParameters = {
10
- /** The public key you're trying to get addresses of. */xPubKey: string;
9
+ /** The public key you're trying to get addresses of. */
10
+ xPubKey: string;
11
11
  };
12
12
  type GetXPubAddressesReturnType = xPubAccount;
13
13
  /**
14
- * Retrieves all addresses and their balances associated with an extended public key (xPub).
15
- *
16
- * An extended public key (xPub) is a Bitcoin public key that can be used to derive multiple
17
- * child addresses. This action fetches all derived addresses along with their individual balances
18
- * and the total balance across all addresses.
19
- *
20
- * @param client - Client instance configured with UTXO transport
21
- * @param params - {@link GetXPubAddressesParameters}
22
- * @returns The xPub account data including total balance and all derived addresses. {@link GetXPubAddressesReturnType}
23
- *
24
- * @example
25
- * ```typescript
26
- * const result = await getXPubAddresses(client, {
27
- * xPubKey: 'xpub6CcGTthbwnbxsMRuEF3sb...'
28
- * })
29
- *
30
- * console.log(result.balance) // Total balance across all addresses
31
- * console.log(result.addresses) // Array of derived addresses with individual balances
32
- * ```
33
- */
14
+ * Retrieves all addresses and their balances associated with an extended public key (xPub).
15
+ *
16
+ * An extended public key (xPub) is a Bitcoin public key that can be used to derive multiple
17
+ * child addresses. This action fetches all derived addresses along with their individual balances
18
+ * and the total balance across all addresses.
19
+ *
20
+ * @param client - Client instance configured with UTXO transport
21
+ * @param params - {@link GetXPubAddressesParameters}
22
+ * @returns The xPub account data including total balance and all derived addresses. {@link GetXPubAddressesReturnType}
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * const result = await getXPubAddresses(client, {
27
+ * xPubKey: 'xpub6CcGTthbwnbxsMRuEF3sb...'
28
+ * })
29
+ *
30
+ * console.log(result.balance) // Total balance across all addresses
31
+ * console.log(result.addresses) // Array of derived addresses with individual balances
32
+ * ```
33
+ */
34
34
  declare function getXPubAddresses<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOSchema>, params: GetXPubAddressesParameters): Promise<GetXPubAddressesReturnType>;
35
35
  //#endregion
36
36
  export { GetXPubAddressesParameters, GetXPubAddressesReturnType, getXPubAddresses };
@@ -3,17 +3,15 @@ import { UTXOSchema } from "../transports/types.js";
3
3
  import { Account } from "../types/account.js";
4
4
  import { Transport } from "../types/transport.js";
5
5
  import { Client } from "../types/client.js";
6
-
7
6
  //#region src/actions/sendUTXOTransaction.d.ts
8
7
  type SendUTXOTransactionParameters = {
9
- /** The hex string of the raw transaction. */hex: string; /** Rejects transactions whose fee rate is higher than the specified value, expressed in BTC/kB. Set to 0 to accept any fee rate. Default = 0.10 */
8
+ /** The hex string of the raw transaction. */
9
+ hex: string;
10
+ /** Rejects transactions whose fee rate is higher than the specified value, expressed in BTC/kB. Set to 0 to accept any fee rate. Default = 0.10 */
10
11
  maxFeeRate?: number;
11
12
  };
12
13
  type SendUTXOTransactionReturnType = string;
13
- declare function sendUTXOTransaction<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOSchema>, {
14
- hex,
15
- maxFeeRate
16
- }: SendUTXOTransactionParameters): Promise<SendUTXOTransactionReturnType>;
14
+ declare function sendUTXOTransaction<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOSchema>, { hex, maxFeeRate }: SendUTXOTransactionParameters): Promise<SendUTXOTransactionReturnType>;
17
15
  //#endregion
18
16
  export { SendUTXOTransactionParameters, SendUTXOTransactionReturnType, sendUTXOTransaction };
19
17
  //# sourceMappingURL=sendUTXOTransaction.d.ts.map
@@ -3,7 +3,6 @@ import { SignPsbtParameters, SignPsbtReturnType, UTXOWalletSchema } from "../tra
3
3
  import { Account } from "../types/account.js";
4
4
  import { Transport } from "../types/transport.js";
5
5
  import { Client } from "../types/client.js";
6
-
7
6
  //#region src/actions/signPsbt.d.ts
8
7
  declare function signPsbt<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOWalletSchema>, params: SignPsbtParameters): Promise<SignPsbtReturnType>;
9
8
  //#endregion
@@ -3,7 +3,6 @@ import { Chain } from "../types/chain.js";
3
3
  import { Transport } from "../types/transport.js";
4
4
  import { Client } from "../types/client.js";
5
5
  import { Transaction } from "bitcoinjs-lib";
6
-
7
6
  //#region src/actions/waitForTransaction.d.ts
8
7
  type ReplacementReason = "cancelled" | "replaced" | "repriced";
9
8
  type ReplacementReturnType = {
@@ -20,68 +19,63 @@ type WithRetryParameters = {
20
19
  retryCount?: number | undefined;
21
20
  };
22
21
  type WaitForTransactionReceiptParameters = {
23
- /** The Id of the transaction. */txId: string; /** The hex string of the raw transaction. */
24
- txHex: string; /** The sender address of the transaction. */
22
+ /** The Id of the transaction. */
23
+ txId: string;
24
+ /** The hex string of the raw transaction. */
25
+ txHex: string;
26
+ /** The sender address of the transaction. */
25
27
  senderAddress?: string;
26
28
  /**
27
- * The number of confirmations (blocks that have passed) to wait before resolving.
28
- * @default 1
29
- */
30
- confirmations?: number | undefined; /** Optional callback to emit if the transaction has been replaced. */
29
+ * The number of confirmations (blocks that have passed) to wait before resolving.
30
+ * @default 1
31
+ */
32
+ confirmations?: number | undefined;
33
+ /** Optional callback to emit if the transaction has been replaced. */
31
34
  onReplaced?: ((response: ReplacementReturnType) => void) | undefined;
32
35
  /**
33
- * Polling frequency (in ms). Defaults to the client's pollingInterval config.
34
- * @default client.pollingInterval
35
- */
36
+ * Polling frequency (in ms). Defaults to the client's pollingInterval config.
37
+ * @default client.pollingInterval
38
+ */
36
39
  pollingInterval?: number | undefined;
37
40
  /**
38
- * Number of times to retry if the transaction or block is not found.
39
- * @default 6 (exponential backoff)
40
- */
41
+ * Number of times to retry if the transaction or block is not found.
42
+ * @default 6 (exponential backoff)
43
+ */
41
44
  retryCount?: number;
42
45
  /**
43
- * Time to wait (in ms) between retries.
44
- */
46
+ * Time to wait (in ms) between retries.
47
+ */
45
48
  retryDelay?: ((config: {
46
49
  count: number;
47
50
  error: Error;
48
- }) => number) | number; /** Optional timeout (in milliseconds) to wait before stopping polling. */
51
+ }) => number) | number;
52
+ /** Optional timeout (in milliseconds) to wait before stopping polling. */
49
53
  timeout?: number | undefined;
50
54
  };
51
55
  /**
52
- * Waits for the transaction to be included on a block (one confirmation), and then returns the transaction.
53
- * - JSON-RPC Methods:
54
- * - Polls getrawtransaction on each block until it has been processed.
55
- * - If a transaction has been replaced:
56
- * - Calls getblock and extracts the transactions
57
- * - Checks if one of the transactions is a replacement
58
- * - If so, calls getrawtransaction.
59
- *
60
- * The `waitForTransaction` action additionally supports replacement detection (e.g. RBF - transactions replaced-by-fee ).
61
- *
62
- * Transactions can be replaced when a user modifies their transaction in their wallet (to speed up or cancel).
63
- * https://bitcoinops.org/en/topics/replace-by-fee/
64
- *
65
- * There are 3 types of Transaction Replacement reasons:
66
- *
67
- * - `repriced`: The fee has been modified (e.g. same outputs, different amounts)
68
- * - `cancelled`: The Transaction has been cancelled (e.g. output is sender address)
69
- * - `replaced`: The Transaction has been replaced (e.g. different outputs)
70
- * @param client - Client to use
71
- * @param parameters - {@link WaitForTransactionReceiptParameters}
72
- * @returns The UTXO transaction. {@link WaitForTransactionReceiptReturnType}
73
- */
74
- declare function waitForTransaction<chain extends Chain | undefined>(client: Client<Transport, chain>, {
75
- confirmations,
76
- txId,
77
- txHex,
78
- senderAddress,
79
- onReplaced,
80
- pollingInterval,
81
- retryCount,
82
- retryDelay,
83
- timeout
84
- }: WaitForTransactionReceiptParameters): Promise<WaitForTransactionReceiptReturnType>;
56
+ * Waits for the transaction to be included on a block (one confirmation), and then returns the transaction.
57
+ * - JSON-RPC Methods:
58
+ * - Polls getrawtransaction on each block until it has been processed.
59
+ * - If a transaction has been replaced:
60
+ * - Calls getblock and extracts the transactions
61
+ * - Checks if one of the transactions is a replacement
62
+ * - If so, calls getrawtransaction.
63
+ *
64
+ * The `waitForTransaction` action additionally supports replacement detection (e.g. RBF - transactions replaced-by-fee ).
65
+ *
66
+ * Transactions can be replaced when a user modifies their transaction in their wallet (to speed up or cancel).
67
+ * https://bitcoinops.org/en/topics/replace-by-fee/
68
+ *
69
+ * There are 3 types of Transaction Replacement reasons:
70
+ *
71
+ * - `repriced`: The fee has been modified (e.g. same outputs, different amounts)
72
+ * - `cancelled`: The Transaction has been cancelled (e.g. output is sender address)
73
+ * - `replaced`: The Transaction has been replaced (e.g. different outputs)
74
+ * @param client - Client to use
75
+ * @param parameters - {@link WaitForTransactionReceiptParameters}
76
+ * @returns The UTXO transaction. {@link WaitForTransactionReceiptReturnType}
77
+ */
78
+ declare function waitForTransaction<chain extends Chain | undefined>(client: Client<Transport, chain>, { confirmations, txId, txHex, senderAddress, onReplaced, pollingInterval, retryCount, retryDelay, timeout }: WaitForTransactionReceiptParameters): Promise<WaitForTransactionReceiptReturnType>;
85
79
  //#endregion
86
80
  export { ReplacementReason, ReplacementReturnType, WaitForTransactionReceiptParameters, WaitForTransactionReceiptReturnType, WithRetryParameters, waitForTransaction };
87
81
  //# sourceMappingURL=waitForTransaction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"waitForTransaction.js","names":["stringify","WaitForTransactionReceiptTimeoutError","observe","getAction","watchBlockNumber","getBlockStats","withRetry","getUTXOTransaction","TransactionReceiptNotFoundError","TransactionNotFoundError","Transaction","getBlock","address"],"sources":["../../../src/actions/waitForTransaction.ts"],"sourcesContent":["import { address, Transaction } from 'bitcoinjs-lib'\nimport {\n TransactionNotFoundError,\n TransactionReceiptNotFoundError,\n WaitForTransactionReceiptTimeoutError,\n} from '../errors/transaction.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { UTXOTransaction } from '../types/transaction.js'\nimport type { Transport } from '../types/transport.js'\nimport { getAction } from '../utils/getAction.js'\nimport { observe } from '../utils/observe.js'\nimport { stringify } from '../utils/stringify.js'\nimport { withRetry } from '../utils/withRetry.js'\nimport { getBlock } from './getBlock.js'\nimport { getBlockStats } from './getBlockStats.js'\nimport { getUTXOTransaction } from './getUTXOTransaction.js'\nimport { watchBlockNumber } from './watchBlockNumber.js'\n\nexport type ReplacementReason = 'cancelled' | 'replaced' | 'repriced'\nexport type ReplacementReturnType = {\n reason: ReplacementReason\n replacedTransaction: Transaction\n transaction: UTXOTransaction\n}\n\nexport type WaitForTransactionReceiptReturnType = UTXOTransaction\n\nexport type WithRetryParameters = {\n // The delay (in ms) between retries.\n delay?:\n | ((config: { count: number; error: Error }) => number)\n | number\n | undefined\n // The max number of times to retry.\n retryCount?: number | undefined\n}\n\nexport type WaitForTransactionReceiptParameters = {\n /** The Id of the transaction. */\n txId: string\n /** The hex string of the raw transaction. */\n txHex: string\n /** The sender address of the transaction. */\n senderAddress?: string\n /**\n * The number of confirmations (blocks that have passed) to wait before resolving.\n * @default 1\n */\n confirmations?: number | undefined\n /** Optional callback to emit if the transaction has been replaced. */\n onReplaced?: ((response: ReplacementReturnType) => void) | undefined\n /**\n * Polling frequency (in ms). Defaults to the client's pollingInterval config.\n * @default client.pollingInterval\n */\n pollingInterval?: number | undefined\n /**\n * Number of times to retry if the transaction or block is not found.\n * @default 6 (exponential backoff)\n */\n retryCount?: number\n /**\n * Time to wait (in ms) between retries.\n */\n retryDelay?: ((config: { count: number; error: Error }) => number) | number\n /** Optional timeout (in milliseconds) to wait before stopping polling. */\n timeout?: number | undefined\n}\n\n/**\n * Waits for the transaction to be included on a block (one confirmation), and then returns the transaction.\n * - JSON-RPC Methods:\n * - Polls getrawtransaction on each block until it has been processed.\n * - If a transaction has been replaced:\n * - Calls getblock and extracts the transactions\n * - Checks if one of the transactions is a replacement\n * - If so, calls getrawtransaction.\n *\n * The `waitForTransaction` action additionally supports replacement detection (e.g. RBF - transactions replaced-by-fee ).\n *\n * Transactions can be replaced when a user modifies their transaction in their wallet (to speed up or cancel).\n * https://bitcoinops.org/en/topics/replace-by-fee/\n *\n * There are 3 types of Transaction Replacement reasons:\n *\n * - `repriced`: The fee has been modified (e.g. same outputs, different amounts)\n * - `cancelled`: The Transaction has been cancelled (e.g. output is sender address)\n * - `replaced`: The Transaction has been replaced (e.g. different outputs)\n * @param client - Client to use\n * @param parameters - {@link WaitForTransactionReceiptParameters}\n * @returns The UTXO transaction. {@link WaitForTransactionReceiptReturnType}\n */\nexport async function waitForTransaction<chain extends Chain | undefined>(\n client: Client<Transport, chain>,\n {\n confirmations = 1,\n txId,\n txHex,\n senderAddress,\n onReplaced,\n pollingInterval = client.pollingInterval,\n retryCount = 10,\n retryDelay = 3_000,\n timeout,\n }: WaitForTransactionReceiptParameters\n): Promise<WaitForTransactionReceiptReturnType> {\n const observerId = stringify(['waitForTransaction', client.uid, txId])\n\n let count = 0\n let transaction: UTXOTransaction | undefined\n let replacedTransaction: Transaction | undefined\n let retrying = false\n\n return new Promise((resolve, reject) => {\n if (timeout) {\n setTimeout(\n () =>\n reject(\n new WaitForTransactionReceiptTimeoutError({ hash: txId as never })\n ),\n timeout\n )\n }\n\n const _unobserve = observe(\n observerId,\n { onReplaced, resolve, reject },\n (emit) => {\n const _unwatch = getAction(\n client,\n watchBlockNumber,\n 'watchBlockNumber'\n )({\n emitMissed: true,\n emitOnBegin: true,\n pollingInterval,\n async onBlockNumber(blockNumber_) {\n const done = (fn: () => void) => {\n _unwatch()\n fn()\n _unobserve()\n }\n\n let blockNumber = blockNumber_\n\n if (retrying) {\n return\n }\n if (count > retryCount) {\n done(() =>\n emit.reject(\n new WaitForTransactionReceiptTimeoutError({\n hash: txId as never,\n })\n )\n )\n }\n\n try {\n // If we already have a valid receipt, let's check if we have enough\n // confirmations. If we do, then we can resolve.\n if (transaction?.blockhash) {\n const blockStats = await getAction(\n client,\n getBlockStats,\n 'getBlockStats'\n )({\n blockHash: transaction.blockhash,\n stats: ['height'],\n })\n if (\n confirmations > 1 &&\n (!blockStats.height ||\n blockNumber - blockStats.height + 1 < confirmations)\n ) {\n return\n }\n done(() => emit.resolve(transaction!))\n return\n }\n\n // Get the transaction to check if it's been replaced.\n // We need to retry as some RPC Providers may be slow to sync\n // up mined transactions.\n retrying = true\n transaction = await withRetry(\n () =>\n getAction(\n client,\n getUTXOTransaction,\n 'getUTXOTransaction'\n // If transaction exists it might be the replaced one with different txId\n )({ txId: transaction?.txid || txId }),\n {\n delay: retryDelay,\n retryCount,\n }\n )\n if (transaction.blockhash) {\n const blockStats = await getAction(\n client,\n getBlockStats,\n 'getBlockStats'\n )({\n blockHash: transaction.blockhash,\n stats: ['height'],\n })\n if (blockStats.height) {\n blockNumber = blockStats.height\n }\n }\n retrying = false\n\n // Check if transaction has been processed.\n if (!transaction?.confirmations) {\n throw new TransactionReceiptNotFoundError({\n hash: txId as never,\n })\n }\n\n // Check if we have enough confirmations. If not, continue polling.\n if (transaction.confirmations < confirmations) {\n return\n }\n\n done(() => emit.resolve(transaction!))\n } catch (err) {\n // If the receipt is not found, the transaction will be pending.\n // We need to check if it has potentially been replaced.\n if (\n err instanceof TransactionNotFoundError ||\n err instanceof TransactionReceiptNotFoundError\n ) {\n try {\n replacedTransaction = Transaction.fromHex(\n transaction?.hex || txHex\n )\n\n // Let's retrieve the transactions from the current block.\n // We need to retry as some RPC Providers may be slow to sync\n // up mined blocks.\n retrying = true\n const block = await withRetry(\n () =>\n getAction(\n client,\n getBlock,\n 'getBlock'\n )({\n blockNumber,\n }),\n {\n delay: retryDelay,\n retryCount,\n // shouldRetry: ({ error }) =>\n // error instanceof BlockNotFoundError,\n }\n )\n retrying = false\n\n // Create a set of input identifiers for mempool transaction\n const replacedTransactionInputs = new Set<string>()\n\n for (const input of replacedTransaction.ins) {\n const txid = Array.from(input.hash)\n .reverse()\n .map((byte) => `00${byte.toString(16)}`.slice(-2))\n .join('')\n const vout = input.index\n const inputId = `${txid}:${vout}`\n replacedTransactionInputs.add(inputId)\n }\n\n let replacementTransaction: Transaction | undefined\n\n for (const tx of block.transactions!) {\n if (tx.isCoinbase()) {\n continue\n }\n\n // Check if any input of this transaction matches an input of mempool transaction\n for (const input of tx.ins) {\n const txid = Array.from(input.hash)\n .reverse()\n .map((byte) => `00${byte.toString(16)}`.slice(-2))\n .join('')\n const vout = input.index\n const inputId = `${txid}:${vout}`\n if (replacedTransactionInputs.has(inputId)) {\n replacementTransaction = tx\n break\n }\n }\n if (replacementTransaction) {\n break\n }\n }\n\n // If we couldn't find a replacement transaction, continue polling.\n if (!replacementTransaction) {\n return\n }\n\n // If we found a replacement transaction, return it's receipt.\n transaction = await getAction(\n client,\n getUTXOTransaction,\n 'getUTXOTransaction'\n )({\n txId: replacementTransaction.getId(),\n })\n\n // Check if we have enough confirmations. If not, continue polling.\n if (\n transaction.confirmations &&\n transaction.confirmations < confirmations\n ) {\n return\n }\n\n let reason: ReplacementReason = 'replaced'\n\n // Function to get output addresses\n function getOutputAddresses(tx: Transaction): string[] {\n const addresses: string[] = []\n for (const output of tx.outs) {\n try {\n const outputAddress = address.fromOutputScript(\n output.script\n )\n addresses.push(outputAddress)\n } catch (_e) {\n // Handle non-standard scripts (e.g., OP_RETURN)\n }\n }\n return addresses\n }\n\n // Get the recipient addresses from the original transaction\n const originalOutputAddresses =\n getOutputAddresses(replacedTransaction)\n\n // Get the recipient addresses from the replacement transaction\n const replacementOutputAddresses = getOutputAddresses(\n replacementTransaction\n )\n\n if (\n originalOutputAddresses.length ===\n replacementOutputAddresses.length &&\n originalOutputAddresses.every((address) =>\n replacementOutputAddresses.includes(address)\n )\n ) {\n reason = 'repriced'\n } else if (\n senderAddress &&\n replacementOutputAddresses.length === 1 &&\n replacementOutputAddresses.includes(senderAddress)\n ) {\n reason = 'cancelled'\n }\n\n done(() => {\n emit.onReplaced?.({\n reason,\n replacedTransaction: replacedTransaction!,\n transaction: transaction!,\n })\n emit.resolve(transaction!)\n })\n } catch (err_) {\n done(() => emit.reject(err_))\n }\n } else {\n done(() => emit.reject(err))\n }\n } finally {\n count++\n }\n },\n })\n }\n )\n })\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"waitForTransaction.js","names":["stringify","WaitForTransactionReceiptTimeoutError","observe","getAction","watchBlockNumber","getBlockStats","withRetry","getUTXOTransaction","TransactionReceiptNotFoundError","TransactionNotFoundError","Transaction","getBlock","address"],"sources":["../../../src/actions/waitForTransaction.ts"],"sourcesContent":["import { address, Transaction } from 'bitcoinjs-lib'\nimport {\n TransactionNotFoundError,\n TransactionReceiptNotFoundError,\n WaitForTransactionReceiptTimeoutError,\n} from '../errors/transaction.js'\nimport type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { UTXOTransaction } from '../types/transaction.js'\nimport type { Transport } from '../types/transport.js'\nimport { getAction } from '../utils/getAction.js'\nimport { observe } from '../utils/observe.js'\nimport { stringify } from '../utils/stringify.js'\nimport { withRetry } from '../utils/withRetry.js'\nimport { getBlock } from './getBlock.js'\nimport { getBlockStats } from './getBlockStats.js'\nimport { getUTXOTransaction } from './getUTXOTransaction.js'\nimport { watchBlockNumber } from './watchBlockNumber.js'\n\nexport type ReplacementReason = 'cancelled' | 'replaced' | 'repriced'\nexport type ReplacementReturnType = {\n reason: ReplacementReason\n replacedTransaction: Transaction\n transaction: UTXOTransaction\n}\n\nexport type WaitForTransactionReceiptReturnType = UTXOTransaction\n\nexport type WithRetryParameters = {\n // The delay (in ms) between retries.\n delay?:\n | ((config: { count: number; error: Error }) => number)\n | number\n | undefined\n // The max number of times to retry.\n retryCount?: number | undefined\n}\n\nexport type WaitForTransactionReceiptParameters = {\n /** The Id of the transaction. */\n txId: string\n /** The hex string of the raw transaction. */\n txHex: string\n /** The sender address of the transaction. */\n senderAddress?: string\n /**\n * The number of confirmations (blocks that have passed) to wait before resolving.\n * @default 1\n */\n confirmations?: number | undefined\n /** Optional callback to emit if the transaction has been replaced. */\n onReplaced?: ((response: ReplacementReturnType) => void) | undefined\n /**\n * Polling frequency (in ms). Defaults to the client's pollingInterval config.\n * @default client.pollingInterval\n */\n pollingInterval?: number | undefined\n /**\n * Number of times to retry if the transaction or block is not found.\n * @default 6 (exponential backoff)\n */\n retryCount?: number\n /**\n * Time to wait (in ms) between retries.\n */\n retryDelay?: ((config: { count: number; error: Error }) => number) | number\n /** Optional timeout (in milliseconds) to wait before stopping polling. */\n timeout?: number | undefined\n}\n\n/**\n * Waits for the transaction to be included on a block (one confirmation), and then returns the transaction.\n * - JSON-RPC Methods:\n * - Polls getrawtransaction on each block until it has been processed.\n * - If a transaction has been replaced:\n * - Calls getblock and extracts the transactions\n * - Checks if one of the transactions is a replacement\n * - If so, calls getrawtransaction.\n *\n * The `waitForTransaction` action additionally supports replacement detection (e.g. RBF - transactions replaced-by-fee ).\n *\n * Transactions can be replaced when a user modifies their transaction in their wallet (to speed up or cancel).\n * https://bitcoinops.org/en/topics/replace-by-fee/\n *\n * There are 3 types of Transaction Replacement reasons:\n *\n * - `repriced`: The fee has been modified (e.g. same outputs, different amounts)\n * - `cancelled`: The Transaction has been cancelled (e.g. output is sender address)\n * - `replaced`: The Transaction has been replaced (e.g. different outputs)\n * @param client - Client to use\n * @param parameters - {@link WaitForTransactionReceiptParameters}\n * @returns The UTXO transaction. {@link WaitForTransactionReceiptReturnType}\n */\nexport async function waitForTransaction<chain extends Chain | undefined>(\n client: Client<Transport, chain>,\n {\n confirmations = 1,\n txId,\n txHex,\n senderAddress,\n onReplaced,\n pollingInterval = client.pollingInterval,\n retryCount = 10,\n retryDelay = 3_000,\n timeout,\n }: WaitForTransactionReceiptParameters\n): Promise<WaitForTransactionReceiptReturnType> {\n const observerId = stringify(['waitForTransaction', client.uid, txId])\n\n let count = 0\n let transaction: UTXOTransaction | undefined\n let replacedTransaction: Transaction | undefined\n let retrying = false\n\n return new Promise((resolve, reject) => {\n if (timeout) {\n setTimeout(\n () =>\n reject(\n new WaitForTransactionReceiptTimeoutError({ hash: txId as never })\n ),\n timeout\n )\n }\n\n const _unobserve = observe(\n observerId,\n { onReplaced, resolve, reject },\n (emit) => {\n const _unwatch = getAction(\n client,\n watchBlockNumber,\n 'watchBlockNumber'\n )({\n emitMissed: true,\n emitOnBegin: true,\n pollingInterval,\n async onBlockNumber(blockNumber_) {\n const done = (fn: () => void) => {\n _unwatch()\n fn()\n _unobserve()\n }\n\n let blockNumber = blockNumber_\n\n if (retrying) {\n return\n }\n if (count > retryCount) {\n done(() =>\n emit.reject(\n new WaitForTransactionReceiptTimeoutError({\n hash: txId as never,\n })\n )\n )\n }\n\n try {\n // If we already have a valid receipt, let's check if we have enough\n // confirmations. If we do, then we can resolve.\n if (transaction?.blockhash) {\n const blockStats = await getAction(\n client,\n getBlockStats,\n 'getBlockStats'\n )({\n blockHash: transaction.blockhash,\n stats: ['height'],\n })\n if (\n confirmations > 1 &&\n (!blockStats.height ||\n blockNumber - blockStats.height + 1 < confirmations)\n ) {\n return\n }\n done(() => emit.resolve(transaction!))\n return\n }\n\n // Get the transaction to check if it's been replaced.\n // We need to retry as some RPC Providers may be slow to sync\n // up mined transactions.\n retrying = true\n transaction = await withRetry(\n () =>\n getAction(\n client,\n getUTXOTransaction,\n 'getUTXOTransaction'\n // If transaction exists it might be the replaced one with different txId\n )({ txId: transaction?.txid || txId }),\n {\n delay: retryDelay,\n retryCount,\n }\n )\n if (transaction.blockhash) {\n const blockStats = await getAction(\n client,\n getBlockStats,\n 'getBlockStats'\n )({\n blockHash: transaction.blockhash,\n stats: ['height'],\n })\n if (blockStats.height) {\n blockNumber = blockStats.height\n }\n }\n retrying = false\n\n // Check if transaction has been processed.\n if (!transaction?.confirmations) {\n throw new TransactionReceiptNotFoundError({\n hash: txId as never,\n })\n }\n\n // Check if we have enough confirmations. If not, continue polling.\n if (transaction.confirmations < confirmations) {\n return\n }\n\n done(() => emit.resolve(transaction!))\n } catch (err) {\n // If the receipt is not found, the transaction will be pending.\n // We need to check if it has potentially been replaced.\n if (\n err instanceof TransactionNotFoundError ||\n err instanceof TransactionReceiptNotFoundError\n ) {\n try {\n replacedTransaction = Transaction.fromHex(\n transaction?.hex || txHex\n )\n\n // Let's retrieve the transactions from the current block.\n // We need to retry as some RPC Providers may be slow to sync\n // up mined blocks.\n retrying = true\n const block = await withRetry(\n () =>\n getAction(\n client,\n getBlock,\n 'getBlock'\n )({\n blockNumber,\n }),\n {\n delay: retryDelay,\n retryCount,\n // shouldRetry: ({ error }) =>\n // error instanceof BlockNotFoundError,\n }\n )\n retrying = false\n\n // Create a set of input identifiers for mempool transaction\n const replacedTransactionInputs = new Set<string>()\n\n for (const input of replacedTransaction.ins) {\n const txid = Array.from(input.hash)\n .reverse()\n .map((byte) => `00${byte.toString(16)}`.slice(-2))\n .join('')\n const vout = input.index\n const inputId = `${txid}:${vout}`\n replacedTransactionInputs.add(inputId)\n }\n\n let replacementTransaction: Transaction | undefined\n\n for (const tx of block.transactions!) {\n if (tx.isCoinbase()) {\n continue\n }\n\n // Check if any input of this transaction matches an input of mempool transaction\n for (const input of tx.ins) {\n const txid = Array.from(input.hash)\n .reverse()\n .map((byte) => `00${byte.toString(16)}`.slice(-2))\n .join('')\n const vout = input.index\n const inputId = `${txid}:${vout}`\n if (replacedTransactionInputs.has(inputId)) {\n replacementTransaction = tx\n break\n }\n }\n if (replacementTransaction) {\n break\n }\n }\n\n // If we couldn't find a replacement transaction, continue polling.\n if (!replacementTransaction) {\n return\n }\n\n // If we found a replacement transaction, return it's receipt.\n transaction = await getAction(\n client,\n getUTXOTransaction,\n 'getUTXOTransaction'\n )({\n txId: replacementTransaction.getId(),\n })\n\n // Check if we have enough confirmations. If not, continue polling.\n if (\n transaction.confirmations &&\n transaction.confirmations < confirmations\n ) {\n return\n }\n\n let reason: ReplacementReason = 'replaced'\n\n // Function to get output addresses\n function getOutputAddresses(tx: Transaction): string[] {\n const addresses: string[] = []\n for (const output of tx.outs) {\n try {\n const outputAddress = address.fromOutputScript(\n output.script\n )\n addresses.push(outputAddress)\n } catch (_e) {\n // Handle non-standard scripts (e.g., OP_RETURN)\n }\n }\n return addresses\n }\n\n // Get the recipient addresses from the original transaction\n const originalOutputAddresses =\n getOutputAddresses(replacedTransaction)\n\n // Get the recipient addresses from the replacement transaction\n const replacementOutputAddresses = getOutputAddresses(\n replacementTransaction\n )\n\n if (\n originalOutputAddresses.length ===\n replacementOutputAddresses.length &&\n originalOutputAddresses.every((address) =>\n replacementOutputAddresses.includes(address)\n )\n ) {\n reason = 'repriced'\n } else if (\n senderAddress &&\n replacementOutputAddresses.length === 1 &&\n replacementOutputAddresses.includes(senderAddress)\n ) {\n reason = 'cancelled'\n }\n\n done(() => {\n emit.onReplaced?.({\n reason,\n replacedTransaction: replacedTransaction!,\n transaction: transaction!,\n })\n emit.resolve(transaction!)\n })\n } catch (err_) {\n done(() => emit.reject(err_))\n }\n } else {\n done(() => emit.reject(err))\n }\n } finally {\n count++\n }\n },\n })\n }\n )\n })\n}\n"],"mappings":"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"}
@@ -2,32 +2,30 @@ import { Chain } from "../types/chain.js";
2
2
  import { Transport } from "../types/transport.js";
3
3
  import { Client } from "../types/client.js";
4
4
  import { GetBlockCountReturnType } from "./getBlockCount.js";
5
-
6
5
  //#region src/actions/watchBlockNumber.d.ts
7
6
  type OnBlockNumberParameter = GetBlockCountReturnType;
8
7
  type OnBlockNumberFn = (blockNumber: OnBlockNumberParameter, prevBlockNumber: OnBlockNumberParameter | undefined) => Promise<void>;
9
8
  type WatchBlockNumberParameters = {
10
- /** The callback to call when a new block number is received. */onBlockNumber: OnBlockNumberFn; /** The callback to call when an error occurred when trying to get for a new block. */
9
+ /** The callback to call when a new block number is received. */
10
+ onBlockNumber: OnBlockNumberFn;
11
+ /** The callback to call when an error occurred when trying to get for a new block. */
11
12
  onError?: ((error: Error) => void) | undefined;
12
13
  } & {
13
- /** Whether or not to emit the missed block numbers to the callback. */emitMissed?: boolean | undefined; /** Whether or not to emit the latest block number to the callback when the subscription opens. */
14
- emitOnBegin?: boolean | undefined; /** Polling frequency (in ms). Defaults to Client's pollingInterval config. */
14
+ /** Whether or not to emit the missed block numbers to the callback. */
15
+ emitMissed?: boolean | undefined;
16
+ /** Whether or not to emit the latest block number to the callback when the subscription opens. */
17
+ emitOnBegin?: boolean | undefined;
18
+ /** Polling frequency (in ms). Defaults to Client's pollingInterval config. */
15
19
  pollingInterval?: number | undefined;
16
20
  };
17
21
  type WatchBlockNumberReturnType = () => void;
18
22
  /**
19
- * Watches and returns incoming block numbers.
20
- * @param client - Client to use
21
- * @param parameters - {@link WatchBlockNumberParameters}
22
- * @returns A function that can be invoked to stop watching for new block numbers. {@link WatchBlockNumberReturnType}
23
- */
24
- declare function watchBlockNumber<chain extends Chain | undefined, transport extends Transport>(client: Client<transport, chain>, {
25
- emitOnBegin,
26
- emitMissed,
27
- onBlockNumber,
28
- onError,
29
- pollingInterval
30
- }: WatchBlockNumberParameters): WatchBlockNumberReturnType;
23
+ * Watches and returns incoming block numbers.
24
+ * @param client - Client to use
25
+ * @param parameters - {@link WatchBlockNumberParameters}
26
+ * @returns A function that can be invoked to stop watching for new block numbers. {@link WatchBlockNumberReturnType}
27
+ */
28
+ declare function watchBlockNumber<chain extends Chain | undefined, transport extends Transport>(client: Client<transport, chain>, { emitOnBegin, emitMissed, onBlockNumber, onError, pollingInterval }: WatchBlockNumberParameters): WatchBlockNumberReturnType;
31
29
  //#endregion
32
30
  export { OnBlockNumberFn, OnBlockNumberParameter, WatchBlockNumberParameters, WatchBlockNumberReturnType, watchBlockNumber };
33
31
  //# sourceMappingURL=watchBlockNumber.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"watchBlockNumber.js","names":["observe","stringify","poll","getAction","getBlockCount"],"sources":["../../../src/actions/watchBlockNumber.ts"],"sourcesContent":["import type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { Transport } from '../types/transport.js'\nimport { getAction } from '../utils/getAction.js'\nimport { observe } from '../utils/observe.js'\nimport { poll } from '../utils/poll.js'\nimport { stringify } from '../utils/stringify.js'\nimport { type GetBlockCountReturnType, getBlockCount } from './getBlockCount.js'\n\nexport type OnBlockNumberParameter = GetBlockCountReturnType\nexport type OnBlockNumberFn = (\n blockNumber: OnBlockNumberParameter,\n prevBlockNumber: OnBlockNumberParameter | undefined\n) => Promise<void>\n\nexport type WatchBlockNumberParameters = {\n /** The callback to call when a new block number is received. */\n onBlockNumber: OnBlockNumberFn\n /** The callback to call when an error occurred when trying to get for a new block. */\n onError?: ((error: Error) => void) | undefined\n} & {\n /** Whether or not to emit the missed block numbers to the callback. */\n emitMissed?: boolean | undefined\n /** Whether or not to emit the latest block number to the callback when the subscription opens. */\n emitOnBegin?: boolean | undefined\n /** Polling frequency (in ms). Defaults to Client's pollingInterval config. */\n pollingInterval?: number | undefined\n}\n\nexport type WatchBlockNumberReturnType = () => void\n\n/**\n * Watches and returns incoming block numbers.\n * @param client - Client to use\n * @param parameters - {@link WatchBlockNumberParameters}\n * @returns A function that can be invoked to stop watching for new block numbers. {@link WatchBlockNumberReturnType}\n */\nexport function watchBlockNumber<\n chain extends Chain | undefined,\n transport extends Transport,\n>(\n client: Client<transport, chain>,\n {\n emitOnBegin = false,\n emitMissed = false,\n onBlockNumber,\n onError,\n pollingInterval = client.pollingInterval,\n }: WatchBlockNumberParameters\n): WatchBlockNumberReturnType {\n let prevBlockNumber: GetBlockCountReturnType | undefined\n\n const observerId = stringify([\n 'watchBlockNumber',\n client.uid,\n emitOnBegin,\n emitMissed,\n pollingInterval,\n ])\n\n // TODO (edge cases):\n // 1) Stop iterating block numbers if we are happy with the result of one onBlockNumber execution but there is more in the queue.\n // 2) If we missed some time - user closed the page and came back when the block is already mined.\n // In this case we probably want to save the block when we send the transaction and track the currently checked blocks until we find the relevant one.\n return observe(observerId, { onBlockNumber, onError }, (emit) =>\n poll(\n async () => {\n try {\n const blockNumber = await getAction(\n client,\n getBlockCount,\n 'getBlockCount'\n )({ cacheTime: 0 })\n\n if (prevBlockNumber) {\n // If the current block number is the same as the previous,\n // we can skip.\n if (blockNumber === prevBlockNumber) {\n return\n }\n\n // If we have missed out on some previous blocks, and the\n // `emitMissed` flag is truthy, let's emit those blocks.\n if (blockNumber - prevBlockNumber > 1 && emitMissed) {\n for (let i = prevBlockNumber + 1; i < blockNumber; i++) {\n await emit.onBlockNumber(i, prevBlockNumber)\n prevBlockNumber = i\n }\n }\n }\n\n // If the next block number is greater than the previous,\n // it is not in the past, and we can emit the new block number.\n if (!prevBlockNumber || blockNumber > prevBlockNumber) {\n await emit.onBlockNumber(blockNumber, prevBlockNumber)\n prevBlockNumber = blockNumber\n }\n } catch (err) {\n emit.onError?.(err as Error)\n }\n },\n {\n emitOnBegin,\n interval: pollingInterval,\n }\n )\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAqCA,SAAgB,iBAId,QACA,EACE,cAAc,OACd,aAAa,OACb,eACA,SACA,kBAAkB,OAAO,mBAEC;CAC5B,IAAI;CAcJ,OAAOA,sBAAAA,QAZYC,wBAAAA,UAAU;EAC3B;EACA,OAAO;EACP;EACA;EACA;CACF,CAMwB,GAAG;EAAE;EAAe;CAAQ,IAAI,SACtDC,mBAAAA,KACE,YAAY;EACV,IAAI;GACF,MAAM,cAAc,MAAMC,wBAAAA,UACxB,QACAC,8BAAAA,eACA,eACF,EAAE,EAAE,WAAW,EAAE,CAAC;GAElB,IAAI,iBAAiB;IAGnB,IAAI,gBAAgB,iBAClB;IAKF,IAAI,cAAc,kBAAkB,KAAK,YACvC,KAAK,IAAI,IAAI,kBAAkB,GAAG,IAAI,aAAa,KAAK;KACtD,MAAM,KAAK,cAAc,GAAG,eAAe;KAC3C,kBAAkB;IACpB;GAEJ;GAIA,IAAI,CAAC,mBAAmB,cAAc,iBAAiB;IACrD,MAAM,KAAK,cAAc,aAAa,eAAe;IACrD,kBAAkB;GACpB;EACF,SAAS,KAAK;GACZ,KAAK,UAAU,GAAY;EAC7B;CACF,GACA;EACE;EACA,UAAU;CACZ,CACF,CACF;AACF"}
1
+ {"version":3,"file":"watchBlockNumber.js","names":["observe","stringify","poll","getAction","getBlockCount"],"sources":["../../../src/actions/watchBlockNumber.ts"],"sourcesContent":["import type { Chain } from '../types/chain.js'\nimport type { Client } from '../types/client.js'\nimport type { Transport } from '../types/transport.js'\nimport { getAction } from '../utils/getAction.js'\nimport { observe } from '../utils/observe.js'\nimport { poll } from '../utils/poll.js'\nimport { stringify } from '../utils/stringify.js'\nimport { type GetBlockCountReturnType, getBlockCount } from './getBlockCount.js'\n\nexport type OnBlockNumberParameter = GetBlockCountReturnType\nexport type OnBlockNumberFn = (\n blockNumber: OnBlockNumberParameter,\n prevBlockNumber: OnBlockNumberParameter | undefined\n) => Promise<void>\n\nexport type WatchBlockNumberParameters = {\n /** The callback to call when a new block number is received. */\n onBlockNumber: OnBlockNumberFn\n /** The callback to call when an error occurred when trying to get for a new block. */\n onError?: ((error: Error) => void) | undefined\n} & {\n /** Whether or not to emit the missed block numbers to the callback. */\n emitMissed?: boolean | undefined\n /** Whether or not to emit the latest block number to the callback when the subscription opens. */\n emitOnBegin?: boolean | undefined\n /** Polling frequency (in ms). Defaults to Client's pollingInterval config. */\n pollingInterval?: number | undefined\n}\n\nexport type WatchBlockNumberReturnType = () => void\n\n/**\n * Watches and returns incoming block numbers.\n * @param client - Client to use\n * @param parameters - {@link WatchBlockNumberParameters}\n * @returns A function that can be invoked to stop watching for new block numbers. {@link WatchBlockNumberReturnType}\n */\nexport function watchBlockNumber<\n chain extends Chain | undefined,\n transport extends Transport,\n>(\n client: Client<transport, chain>,\n {\n emitOnBegin = false,\n emitMissed = false,\n onBlockNumber,\n onError,\n pollingInterval = client.pollingInterval,\n }: WatchBlockNumberParameters\n): WatchBlockNumberReturnType {\n let prevBlockNumber: GetBlockCountReturnType | undefined\n\n const observerId = stringify([\n 'watchBlockNumber',\n client.uid,\n emitOnBegin,\n emitMissed,\n pollingInterval,\n ])\n\n // TODO (edge cases):\n // 1) Stop iterating block numbers if we are happy with the result of one onBlockNumber execution but there is more in the queue.\n // 2) If we missed some time - user closed the page and came back when the block is already mined.\n // In this case we probably want to save the block when we send the transaction and track the currently checked blocks until we find the relevant one.\n return observe(observerId, { onBlockNumber, onError }, (emit) =>\n poll(\n async () => {\n try {\n const blockNumber = await getAction(\n client,\n getBlockCount,\n 'getBlockCount'\n )({ cacheTime: 0 })\n\n if (prevBlockNumber) {\n // If the current block number is the same as the previous,\n // we can skip.\n if (blockNumber === prevBlockNumber) {\n return\n }\n\n // If we have missed out on some previous blocks, and the\n // `emitMissed` flag is truthy, let's emit those blocks.\n if (blockNumber - prevBlockNumber > 1 && emitMissed) {\n for (let i = prevBlockNumber + 1; i < blockNumber; i++) {\n await emit.onBlockNumber(i, prevBlockNumber)\n prevBlockNumber = i\n }\n }\n }\n\n // If the next block number is greater than the previous,\n // it is not in the past, and we can emit the new block number.\n if (!prevBlockNumber || blockNumber > prevBlockNumber) {\n await emit.onBlockNumber(blockNumber, prevBlockNumber)\n prevBlockNumber = blockNumber\n }\n } catch (err) {\n emit.onError?.(err as Error)\n }\n },\n {\n emitOnBegin,\n interval: pollingInterval,\n }\n )\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAqCA,SAAgB,iBAId,QACA,EACE,cAAc,OACd,aAAa,OACb,eACA,SACA,kBAAkB,OAAO,mBAEC;CAC5B,IAAI;CAcJ,OAAOA,sBAAAA,QAZYC,wBAAAA,UAAU;EAC3B;EACA,OAAO;EACP;EACA;EACA;CACF,CAMwB,GAAG;EAAE;EAAe;CAAQ,IAAI,SACtDC,mBAAAA,KACE,YAAY;EACV,IAAI;GACF,MAAM,cAAc,MAAMC,wBAAAA,UACxB,QACAC,8BAAAA,eACA,eACF,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;GAElB,IAAI,iBAAiB;IAGnB,IAAI,gBAAgB,iBAClB;IAKF,IAAI,cAAc,kBAAkB,KAAK,YACvC,KAAK,IAAI,IAAI,kBAAkB,GAAG,IAAI,aAAa,KAAK;KACtD,MAAM,KAAK,cAAc,GAAG,eAAe;KAC3C,kBAAkB;IACpB;GAEJ;GAIA,IAAI,CAAC,mBAAmB,cAAc,iBAAiB;IACrD,MAAM,KAAK,cAAc,aAAa,eAAe;IACrD,kBAAkB;GACpB;EACF,SAAS,KAAK;GACZ,KAAK,UAAU,GAAY;EAC7B;CACF,GACA;EACE;EACA,UAAU;CACZ,CACF,CACF;AACF"}
@@ -1,5 +1,4 @@
1
1
  import { Chain } from "../types/chain.js";
2
-
3
2
  //#region src/chains/bitcoin.d.ts
4
3
  declare const bitcoin: Chain;
5
4
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"bitcoin.js","names":[],"sources":["../../../src/chains/bitcoin.ts"],"sourcesContent":["import type { Chain } from '../types/chain.js'\nimport { ChainId } from '../types/chain.js'\nimport { defineChain } from './defineChain.js'\n\nexport const bitcoin: Chain = /*#__PURE__*/ defineChain({\n id: ChainId.BITCOIN_MAINNET,\n name: 'Bitcoin',\n nativeCurrency: { name: 'Bitcoin', symbol: 'BTC', decimals: 8 },\n rpcUrls: {\n default: {\n http: ['https://node-router.thorswap.net/bitcoin'],\n },\n },\n blockExplorers: {\n default: {\n name: 'Mempool',\n url: 'https://mempool.space/',\n },\n },\n})\n"],"mappings":";;;AAIA,MAAa,UAA+B,wCAAA,EAAA,YAAY;CACtD,IAAA;CACA,MAAM;CACN,gBAAgB;EAAE,MAAM;EAAW,QAAQ;EAAO,UAAU;CAAE;CAC9D,SAAS,EACP,SAAS,EACP,MAAM,CAAC,0CAA0C,EACnD,EACF;CACA,gBAAgB,EACd,SAAS;EACP,MAAM;EACN,KAAK;CACP,EACF;AACF,CAAC"}
1
+ {"version":3,"file":"bitcoin.js","names":[],"sources":["../../../src/chains/bitcoin.ts"],"sourcesContent":["import type { Chain } from '../types/chain.js'\nimport { ChainId } from '../types/chain.js'\nimport { defineChain } from './defineChain.js'\n\nexport const bitcoin: Chain = /*#__PURE__*/ defineChain({\n id: ChainId.BITCOIN_MAINNET,\n name: 'Bitcoin',\n nativeCurrency: { name: 'Bitcoin', symbol: 'BTC', decimals: 8 },\n rpcUrls: {\n default: {\n http: ['https://node-router.thorswap.net/bitcoin'],\n },\n },\n blockExplorers: {\n default: {\n name: 'Mempool',\n url: 'https://mempool.space/',\n },\n },\n})\n"],"mappings":";;;AAIA,MAAa,UAA+B,wCAAA,CAAA,CAAA,YAAY;CACtD,IAAA;CACA,MAAM;CACN,gBAAgB;EAAE,MAAM;EAAW,QAAQ;EAAO,UAAU;CAAE;CAC9D,SAAS,EACP,SAAS,EACP,MAAM,CAAC,0CAA0C,EACnD,EACF;CACA,gBAAgB,EACd,SAAS;EACP,MAAM;EACN,KAAK;CACP,EACF;AACF,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import { Chain, ChainFormatters } from "../types/chain.js";
2
2
  import { Assign, Prettify } from "../types/utils.js";
3
-
4
3
  //#region src/chains/defineChain.d.ts
5
4
  declare function defineChain<formatters extends ChainFormatters, const chain extends Chain<formatters>>(chain: chain): Prettify<Assign<Chain<undefined>, chain>>;
6
5
  //#endregion
@@ -1,5 +1,4 @@
1
1
  import { Chain } from "../types/chain.js";
2
-
3
2
  //#region src/chains/signet.d.ts
4
3
  declare const bitcoinSignet: Chain;
5
4
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"signet.js","names":[],"sources":["../../../src/chains/signet.ts"],"sourcesContent":["import type { Chain } from '../types/chain.js'\nimport { ChainId } from '../types/chain.js'\nimport { defineChain } from './defineChain.js'\n\nexport const bitcoinSignet: Chain = /*#__PURE__*/ defineChain({\n id: ChainId.BITCOIN_SIGNET,\n name: 'Bitcoin Signet',\n nativeCurrency: { name: 'Bitcoin', symbol: 'BTC', decimals: 8 },\n rpcUrls: {\n default: {\n http: [\n 'https://rpc.ankr.com/btc_signet/c58ee1c627c5ad7cd69197c352aa51bdcebd87b86e0363c1e5133d5735cb3c69',\n ],\n },\n },\n blockExplorers: {\n default: {\n name: 'Mempool',\n url: 'https://mempool.space/signet',\n },\n },\n testnet: true,\n})\n"],"mappings":";;;AAIA,MAAa,gBAAqC,wCAAA,EAAA,YAAY;CAC5D,IAAA;CACA,MAAM;CACN,gBAAgB;EAAE,MAAM;EAAW,QAAQ;EAAO,UAAU;CAAE;CAC9D,SAAS,EACP,SAAS,EACP,MAAM,CACJ,kGACF,EACF,EACF;CACA,gBAAgB,EACd,SAAS;EACP,MAAM;EACN,KAAK;CACP,EACF;CACA,SAAS;AACX,CAAC"}
1
+ {"version":3,"file":"signet.js","names":[],"sources":["../../../src/chains/signet.ts"],"sourcesContent":["import type { Chain } from '../types/chain.js'\nimport { ChainId } from '../types/chain.js'\nimport { defineChain } from './defineChain.js'\n\nexport const bitcoinSignet: Chain = /*#__PURE__*/ defineChain({\n id: ChainId.BITCOIN_SIGNET,\n name: 'Bitcoin Signet',\n nativeCurrency: { name: 'Bitcoin', symbol: 'BTC', decimals: 8 },\n rpcUrls: {\n default: {\n http: [\n 'https://rpc.ankr.com/btc_signet/c58ee1c627c5ad7cd69197c352aa51bdcebd87b86e0363c1e5133d5735cb3c69',\n ],\n },\n },\n blockExplorers: {\n default: {\n name: 'Mempool',\n url: 'https://mempool.space/signet',\n },\n },\n testnet: true,\n})\n"],"mappings":";;;AAIA,MAAa,gBAAqC,wCAAA,CAAA,CAAA,YAAY;CAC5D,IAAA;CACA,MAAM;CACN,gBAAgB;EAAE,MAAM;EAAW,QAAQ;EAAO,UAAU;CAAE;CAC9D,SAAS,EACP,SAAS,EACP,MAAM,CACJ,kGACF,EACF,EACF;CACA,gBAAgB,EACd,SAAS;EACP,MAAM;EACN,KAAK;CACP,EACF;CACA,SAAS;AACX,CAAC"}
@@ -11,7 +11,6 @@ import { GetTransactionsParameters, GetTransactionsReturnType } from "../../acti
11
11
  import { GetUTXOTransactionParameters, GetUTXOTransactionReturnType } from "../../actions/getUTXOTransaction.js";
12
12
  import { GetUTXOsParameters, GetUTXOsReturnType } from "../../actions/getUTXOs.js";
13
13
  import { Client } from "../../factories/createClient.js";
14
-
15
14
  //#region src/clients/decorators/public.d.ts
16
15
  type PublicActions = {
17
16
  getBalance: (args: GetBalanceParameters) => Promise<GetBalanceReturnType>;