@bigmi/core 0.9.0 → 0.9.1

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 (346) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/_virtual/_rolldown/runtime.js +1 -1
  3. package/dist/cjs/actions/getBalance.d.ts +3 -4
  4. package/dist/cjs/actions/getBlock.d.ts +3 -4
  5. package/dist/cjs/actions/getBlockCount.d.ts +2 -3
  6. package/dist/cjs/actions/getBlockStats.d.ts +3 -4
  7. package/dist/cjs/actions/getTransactionFee.d.ts +3 -4
  8. package/dist/cjs/actions/getTransactions.d.ts +3 -4
  9. package/dist/cjs/actions/getUTXOTransaction.d.ts +3 -4
  10. package/dist/cjs/actions/getUTXOs.d.ts +3 -4
  11. package/dist/cjs/actions/getXPubAddresses.d.ts +3 -4
  12. package/dist/cjs/actions/sendUTXOTransaction.d.ts +3 -4
  13. package/dist/cjs/actions/signPsbt.d.ts +1 -2
  14. package/dist/cjs/actions/waitForTransaction.d.ts +6 -7
  15. package/dist/cjs/actions/watchBlockNumber.d.ts +5 -6
  16. package/dist/cjs/actions/watchBlockNumber.js +3 -2
  17. package/dist/cjs/actions/watchBlockNumber.js.map +1 -1
  18. package/dist/cjs/chains/bitcoin.d.ts +1 -2
  19. package/dist/cjs/chains/defineChain.d.ts +1 -2
  20. package/dist/cjs/chains/signet.d.ts +1 -2
  21. package/dist/cjs/clients/decorators/public.d.ts +2 -3
  22. package/dist/cjs/clients/decorators/wallet.d.ts +2 -3
  23. package/dist/cjs/errors/address.d.ts +2 -3
  24. package/dist/cjs/errors/base.d.ts +3 -4
  25. package/dist/cjs/errors/base.js.map +1 -1
  26. package/dist/cjs/errors/block.d.ts +2 -3
  27. package/dist/cjs/errors/provider.d.ts +1 -2
  28. package/dist/cjs/errors/request.d.ts +10 -11
  29. package/dist/cjs/errors/rpc.d.ts +4 -5
  30. package/dist/cjs/errors/transaction.d.ts +6 -7
  31. package/dist/cjs/errors/transport.d.ts +6 -7
  32. package/dist/cjs/errors/utils.d.ts +3 -4
  33. package/dist/cjs/errors/utxo.d.ts +2 -3
  34. package/dist/cjs/factories/createClient.d.ts +6 -7
  35. package/dist/cjs/factories/createClient.js.map +1 -1
  36. package/dist/cjs/factories/createTransport.d.ts +1 -2
  37. package/dist/cjs/test/utils.d.ts +1 -2
  38. package/dist/cjs/transports/ankr/ankr.d.ts +1 -2
  39. package/dist/cjs/transports/ankr/ankr.types.d.ts +7 -8
  40. package/dist/cjs/transports/ankr/getBalance.d.ts +1 -2
  41. package/dist/cjs/transports/ankr/getTransactionFee.d.ts +1 -2
  42. package/dist/cjs/transports/ankr/getTransactions.d.ts +1 -2
  43. package/dist/cjs/transports/ankr/methods.d.ts +1 -2
  44. package/dist/cjs/transports/ankr/utils.d.ts +1 -2
  45. package/dist/cjs/transports/blockchair/blockchair.d.ts +1 -2
  46. package/dist/cjs/transports/blockchair/blockchair.types.d.ts +13 -14
  47. package/dist/cjs/transports/blockchair/getBalance.d.ts +1 -2
  48. package/dist/cjs/transports/blockchair/getTransactionFee.d.ts +1 -2
  49. package/dist/cjs/transports/blockchair/getUTXOs.d.ts +1 -2
  50. package/dist/cjs/transports/blockchair/getXPubAddresses.d.ts +1 -2
  51. package/dist/cjs/transports/blockchair/methods.d.ts +1 -2
  52. package/dist/cjs/transports/blockcypher/blockcypher.d.ts +1 -2
  53. package/dist/cjs/transports/blockcypher/blockcypher.types.d.ts +8 -9
  54. package/dist/cjs/transports/blockcypher/getBalance.d.ts +1 -2
  55. package/dist/cjs/transports/blockcypher/getTransactionFee.d.ts +1 -2
  56. package/dist/cjs/transports/blockcypher/getUTXOs.d.ts +1 -2
  57. package/dist/cjs/transports/blockcypher/methods.d.ts +1 -2
  58. package/dist/cjs/transports/blockcypher/utils.d.ts +1 -2
  59. package/dist/cjs/transports/custom.d.ts +4 -5
  60. package/dist/cjs/transports/fallback.d.ts +7 -8
  61. package/dist/cjs/transports/fallback.js.map +1 -1
  62. package/dist/cjs/transports/getHttpRpcClient.d.ts +6 -7
  63. package/dist/cjs/transports/getRpcProviderMethods.d.ts +1 -2
  64. package/dist/cjs/transports/http.d.ts +4 -5
  65. package/dist/cjs/transports/mempool/getBalance.d.ts +1 -2
  66. package/dist/cjs/transports/mempool/getTransactionFee.d.ts +1 -2
  67. package/dist/cjs/transports/mempool/getTransactions.d.ts +1 -2
  68. package/dist/cjs/transports/mempool/mempool.d.ts +1 -2
  69. package/dist/cjs/transports/mempool/mempool.types.d.ts +7 -8
  70. package/dist/cjs/transports/mempool/methods.d.ts +1 -2
  71. package/dist/cjs/transports/mempool/utils.d.ts +1 -2
  72. package/dist/cjs/transports/types.d.ts +12 -13
  73. package/dist/cjs/transports/utxo.d.ts +1 -2
  74. package/dist/cjs/types/account.d.ts +1 -2
  75. package/dist/cjs/types/address.d.ts +4 -5
  76. package/dist/cjs/types/block.d.ts +1 -2
  77. package/dist/cjs/types/blockStats.d.ts +2 -3
  78. package/dist/cjs/types/chain.d.ts +6 -7
  79. package/dist/cjs/types/client.d.ts +3 -4
  80. package/dist/cjs/types/hash.d.ts +1 -2
  81. package/dist/cjs/types/request.d.ts +5 -6
  82. package/dist/cjs/types/rpc.d.ts +4 -5
  83. package/dist/cjs/types/transaction.d.ts +2 -3
  84. package/dist/cjs/types/transport.d.ts +3 -4
  85. package/dist/cjs/types/utils.d.ts +19 -20
  86. package/dist/cjs/types/xpub.d.ts +1 -2
  87. package/dist/cjs/utils/buildRequest.d.ts +3 -4
  88. package/dist/cjs/utils/buildRequest.js +2 -1
  89. package/dist/cjs/utils/buildRequest.js.map +1 -1
  90. package/dist/cjs/utils/cancelTransaction.d.ts +1 -2
  91. package/dist/cjs/utils/converter.d.ts +5 -6
  92. package/dist/cjs/utils/createBatchScheduler.d.ts +2 -3
  93. package/dist/cjs/utils/deepEqual.d.ts +1 -2
  94. package/dist/cjs/utils/getAction.d.ts +1 -2
  95. package/dist/cjs/utils/getAddressInfo.d.ts +2 -3
  96. package/dist/cjs/utils/getAddressInfo.js +2 -1
  97. package/dist/cjs/utils/getAddressInfo.js.map +1 -1
  98. package/dist/cjs/utils/idCache.d.ts +1 -2
  99. package/dist/cjs/utils/isAddress.d.ts +1 -2
  100. package/dist/cjs/utils/lru.d.ts +1 -2
  101. package/dist/cjs/utils/modifyFee.d.ts +1 -2
  102. package/dist/cjs/utils/observe.d.ts +3 -4
  103. package/dist/cjs/utils/parseAccount.d.ts +2 -3
  104. package/dist/cjs/utils/poll.d.ts +1 -2
  105. package/dist/cjs/utils/poll.js +2 -1
  106. package/dist/cjs/utils/poll.js.map +1 -1
  107. package/dist/cjs/utils/retryUntil.d.ts +1 -2
  108. package/dist/cjs/utils/sleep.d.ts +1 -2
  109. package/dist/cjs/utils/stringify.d.ts +2 -3
  110. package/dist/cjs/utils/uid.d.ts +1 -2
  111. package/dist/cjs/utils/url.d.ts +1 -2
  112. package/dist/cjs/utils/wait.d.ts +1 -2
  113. package/dist/cjs/utils/withDedupe.d.ts +2 -3
  114. package/dist/cjs/utils/withResolvers.d.ts +2 -3
  115. package/dist/cjs/utils/withRetry.d.ts +3 -4
  116. package/dist/cjs/utils/withTimeout.d.ts +2 -3
  117. package/dist/cjs/version.d.ts +2 -3
  118. package/dist/cjs/version.js +1 -1
  119. package/dist/cjs/version.js.map +1 -1
  120. package/dist/cjs/vite-env.d.ts +1 -1
  121. package/dist/esm/actions/getBalance.d.ts +3 -4
  122. package/dist/esm/actions/getBalance.d.ts.map +1 -1
  123. package/dist/esm/actions/getBlock.d.ts +3 -4
  124. package/dist/esm/actions/getBlock.d.ts.map +1 -1
  125. package/dist/esm/actions/getBlockCount.d.ts +2 -3
  126. package/dist/esm/actions/getBlockCount.d.ts.map +1 -1
  127. package/dist/esm/actions/getBlockStats.d.ts +3 -4
  128. package/dist/esm/actions/getBlockStats.d.ts.map +1 -1
  129. package/dist/esm/actions/getTransactionFee.d.ts +3 -4
  130. package/dist/esm/actions/getTransactionFee.d.ts.map +1 -1
  131. package/dist/esm/actions/getTransactions.d.ts +3 -4
  132. package/dist/esm/actions/getTransactions.d.ts.map +1 -1
  133. package/dist/esm/actions/getUTXOTransaction.d.ts +3 -4
  134. package/dist/esm/actions/getUTXOTransaction.d.ts.map +1 -1
  135. package/dist/esm/actions/getUTXOs.d.ts +3 -4
  136. package/dist/esm/actions/getUTXOs.d.ts.map +1 -1
  137. package/dist/esm/actions/getXPubAddresses.d.ts +3 -4
  138. package/dist/esm/actions/getXPubAddresses.d.ts.map +1 -1
  139. package/dist/esm/actions/sendUTXOTransaction.d.ts +3 -4
  140. package/dist/esm/actions/sendUTXOTransaction.d.ts.map +1 -1
  141. package/dist/esm/actions/signPsbt.d.ts +1 -2
  142. package/dist/esm/actions/signPsbt.d.ts.map +1 -1
  143. package/dist/esm/actions/waitForTransaction.d.ts +6 -7
  144. package/dist/esm/actions/waitForTransaction.d.ts.map +1 -1
  145. package/dist/esm/actions/watchBlockNumber.d.ts +5 -6
  146. package/dist/esm/actions/watchBlockNumber.d.ts.map +1 -1
  147. package/dist/esm/actions/watchBlockNumber.js +3 -2
  148. package/dist/esm/actions/watchBlockNumber.js.map +1 -1
  149. package/dist/esm/chains/bitcoin.d.ts +1 -2
  150. package/dist/esm/chains/bitcoin.d.ts.map +1 -1
  151. package/dist/esm/chains/defineChain.d.ts +1 -2
  152. package/dist/esm/chains/defineChain.d.ts.map +1 -1
  153. package/dist/esm/chains/signet.d.ts +1 -2
  154. package/dist/esm/chains/signet.d.ts.map +1 -1
  155. package/dist/esm/clients/decorators/public.d.ts +2 -3
  156. package/dist/esm/clients/decorators/public.d.ts.map +1 -1
  157. package/dist/esm/clients/decorators/wallet.d.ts +2 -3
  158. package/dist/esm/clients/decorators/wallet.d.ts.map +1 -1
  159. package/dist/esm/errors/address.d.ts +2 -3
  160. package/dist/esm/errors/address.d.ts.map +1 -1
  161. package/dist/esm/errors/base.d.ts +3 -4
  162. package/dist/esm/errors/base.d.ts.map +1 -1
  163. package/dist/esm/errors/base.js.map +1 -1
  164. package/dist/esm/errors/block.d.ts +2 -3
  165. package/dist/esm/errors/block.d.ts.map +1 -1
  166. package/dist/esm/errors/provider.d.ts +1 -2
  167. package/dist/esm/errors/provider.d.ts.map +1 -1
  168. package/dist/esm/errors/request.d.ts +10 -11
  169. package/dist/esm/errors/request.d.ts.map +1 -1
  170. package/dist/esm/errors/rpc.d.ts +4 -5
  171. package/dist/esm/errors/rpc.d.ts.map +1 -1
  172. package/dist/esm/errors/transaction.d.ts +6 -7
  173. package/dist/esm/errors/transaction.d.ts.map +1 -1
  174. package/dist/esm/errors/transport.d.ts +6 -7
  175. package/dist/esm/errors/transport.d.ts.map +1 -1
  176. package/dist/esm/errors/utils.d.ts +3 -4
  177. package/dist/esm/errors/utils.d.ts.map +1 -1
  178. package/dist/esm/errors/utxo.d.ts +2 -3
  179. package/dist/esm/errors/utxo.d.ts.map +1 -1
  180. package/dist/esm/factories/createClient.d.ts +6 -7
  181. package/dist/esm/factories/createClient.d.ts.map +1 -1
  182. package/dist/esm/factories/createClient.js.map +1 -1
  183. package/dist/esm/factories/createTransport.d.ts +1 -2
  184. package/dist/esm/factories/createTransport.d.ts.map +1 -1
  185. package/dist/esm/test/utils.d.ts +1 -2
  186. package/dist/esm/test/utils.d.ts.map +1 -1
  187. package/dist/esm/transports/ankr/ankr.d.ts +1 -2
  188. package/dist/esm/transports/ankr/ankr.d.ts.map +1 -1
  189. package/dist/esm/transports/ankr/ankr.types.d.ts +7 -8
  190. package/dist/esm/transports/ankr/ankr.types.d.ts.map +1 -1
  191. package/dist/esm/transports/ankr/getBalance.d.ts +1 -2
  192. package/dist/esm/transports/ankr/getBalance.d.ts.map +1 -1
  193. package/dist/esm/transports/ankr/getTransactionFee.d.ts +1 -2
  194. package/dist/esm/transports/ankr/getTransactionFee.d.ts.map +1 -1
  195. package/dist/esm/transports/ankr/getTransactions.d.ts +1 -2
  196. package/dist/esm/transports/ankr/getTransactions.d.ts.map +1 -1
  197. package/dist/esm/transports/ankr/methods.d.ts +1 -2
  198. package/dist/esm/transports/ankr/methods.d.ts.map +1 -1
  199. package/dist/esm/transports/ankr/utils.d.ts +1 -2
  200. package/dist/esm/transports/ankr/utils.d.ts.map +1 -1
  201. package/dist/esm/transports/blockchair/blockchair.d.ts +1 -2
  202. package/dist/esm/transports/blockchair/blockchair.d.ts.map +1 -1
  203. package/dist/esm/transports/blockchair/blockchair.types.d.ts +13 -14
  204. package/dist/esm/transports/blockchair/blockchair.types.d.ts.map +1 -1
  205. package/dist/esm/transports/blockchair/getBalance.d.ts +1 -2
  206. package/dist/esm/transports/blockchair/getBalance.d.ts.map +1 -1
  207. package/dist/esm/transports/blockchair/getTransactionFee.d.ts +1 -2
  208. package/dist/esm/transports/blockchair/getTransactionFee.d.ts.map +1 -1
  209. package/dist/esm/transports/blockchair/getUTXOs.d.ts +1 -2
  210. package/dist/esm/transports/blockchair/getUTXOs.d.ts.map +1 -1
  211. package/dist/esm/transports/blockchair/getXPubAddresses.d.ts +1 -2
  212. package/dist/esm/transports/blockchair/getXPubAddresses.d.ts.map +1 -1
  213. package/dist/esm/transports/blockchair/methods.d.ts +1 -2
  214. package/dist/esm/transports/blockchair/methods.d.ts.map +1 -1
  215. package/dist/esm/transports/blockcypher/blockcypher.d.ts +1 -2
  216. package/dist/esm/transports/blockcypher/blockcypher.d.ts.map +1 -1
  217. package/dist/esm/transports/blockcypher/blockcypher.types.d.ts +8 -9
  218. package/dist/esm/transports/blockcypher/blockcypher.types.d.ts.map +1 -1
  219. package/dist/esm/transports/blockcypher/getBalance.d.ts +1 -2
  220. package/dist/esm/transports/blockcypher/getBalance.d.ts.map +1 -1
  221. package/dist/esm/transports/blockcypher/getTransactionFee.d.ts +1 -2
  222. package/dist/esm/transports/blockcypher/getTransactionFee.d.ts.map +1 -1
  223. package/dist/esm/transports/blockcypher/getUTXOs.d.ts +1 -2
  224. package/dist/esm/transports/blockcypher/getUTXOs.d.ts.map +1 -1
  225. package/dist/esm/transports/blockcypher/methods.d.ts +1 -2
  226. package/dist/esm/transports/blockcypher/methods.d.ts.map +1 -1
  227. package/dist/esm/transports/blockcypher/utils.d.ts +1 -2
  228. package/dist/esm/transports/blockcypher/utils.d.ts.map +1 -1
  229. package/dist/esm/transports/custom.d.ts +4 -5
  230. package/dist/esm/transports/custom.d.ts.map +1 -1
  231. package/dist/esm/transports/fallback.d.ts +7 -8
  232. package/dist/esm/transports/fallback.d.ts.map +1 -1
  233. package/dist/esm/transports/fallback.js.map +1 -1
  234. package/dist/esm/transports/getHttpRpcClient.d.ts +6 -7
  235. package/dist/esm/transports/getHttpRpcClient.d.ts.map +1 -1
  236. package/dist/esm/transports/getRpcProviderMethods.d.ts +1 -2
  237. package/dist/esm/transports/getRpcProviderMethods.d.ts.map +1 -1
  238. package/dist/esm/transports/http.d.ts +4 -5
  239. package/dist/esm/transports/http.d.ts.map +1 -1
  240. package/dist/esm/transports/mempool/getBalance.d.ts +1 -2
  241. package/dist/esm/transports/mempool/getBalance.d.ts.map +1 -1
  242. package/dist/esm/transports/mempool/getTransactionFee.d.ts +1 -2
  243. package/dist/esm/transports/mempool/getTransactionFee.d.ts.map +1 -1
  244. package/dist/esm/transports/mempool/getTransactions.d.ts +1 -2
  245. package/dist/esm/transports/mempool/getTransactions.d.ts.map +1 -1
  246. package/dist/esm/transports/mempool/mempool.d.ts +1 -2
  247. package/dist/esm/transports/mempool/mempool.d.ts.map +1 -1
  248. package/dist/esm/transports/mempool/mempool.types.d.ts +7 -8
  249. package/dist/esm/transports/mempool/mempool.types.d.ts.map +1 -1
  250. package/dist/esm/transports/mempool/methods.d.ts +1 -2
  251. package/dist/esm/transports/mempool/methods.d.ts.map +1 -1
  252. package/dist/esm/transports/mempool/utils.d.ts +1 -2
  253. package/dist/esm/transports/mempool/utils.d.ts.map +1 -1
  254. package/dist/esm/transports/types.d.ts +12 -13
  255. package/dist/esm/transports/types.d.ts.map +1 -1
  256. package/dist/esm/transports/utxo.d.ts +1 -2
  257. package/dist/esm/transports/utxo.d.ts.map +1 -1
  258. package/dist/esm/types/account.d.ts +1 -2
  259. package/dist/esm/types/account.d.ts.map +1 -1
  260. package/dist/esm/types/address.d.ts +4 -5
  261. package/dist/esm/types/address.d.ts.map +1 -1
  262. package/dist/esm/types/block.d.ts +1 -2
  263. package/dist/esm/types/block.d.ts.map +1 -1
  264. package/dist/esm/types/blockStats.d.ts +2 -3
  265. package/dist/esm/types/blockStats.d.ts.map +1 -1
  266. package/dist/esm/types/chain.d.ts +6 -7
  267. package/dist/esm/types/chain.d.ts.map +1 -1
  268. package/dist/esm/types/client.d.ts +3 -4
  269. package/dist/esm/types/client.d.ts.map +1 -1
  270. package/dist/esm/types/hash.d.ts +1 -2
  271. package/dist/esm/types/hash.d.ts.map +1 -1
  272. package/dist/esm/types/request.d.ts +5 -6
  273. package/dist/esm/types/request.d.ts.map +1 -1
  274. package/dist/esm/types/rpc.d.ts +4 -5
  275. package/dist/esm/types/rpc.d.ts.map +1 -1
  276. package/dist/esm/types/transaction.d.ts +2 -3
  277. package/dist/esm/types/transaction.d.ts.map +1 -1
  278. package/dist/esm/types/transport.d.ts +3 -4
  279. package/dist/esm/types/transport.d.ts.map +1 -1
  280. package/dist/esm/types/utils.d.ts +19 -20
  281. package/dist/esm/types/utils.d.ts.map +1 -1
  282. package/dist/esm/types/xpub.d.ts +1 -2
  283. package/dist/esm/types/xpub.d.ts.map +1 -1
  284. package/dist/esm/utils/buildRequest.d.ts +3 -4
  285. package/dist/esm/utils/buildRequest.d.ts.map +1 -1
  286. package/dist/esm/utils/buildRequest.js +2 -1
  287. package/dist/esm/utils/buildRequest.js.map +1 -1
  288. package/dist/esm/utils/cancelTransaction.d.ts +1 -2
  289. package/dist/esm/utils/cancelTransaction.d.ts.map +1 -1
  290. package/dist/esm/utils/converter.d.ts +5 -6
  291. package/dist/esm/utils/converter.d.ts.map +1 -1
  292. package/dist/esm/utils/createBatchScheduler.d.ts +2 -3
  293. package/dist/esm/utils/createBatchScheduler.d.ts.map +1 -1
  294. package/dist/esm/utils/deepEqual.d.ts +1 -2
  295. package/dist/esm/utils/deepEqual.d.ts.map +1 -1
  296. package/dist/esm/utils/getAction.d.ts +1 -2
  297. package/dist/esm/utils/getAction.d.ts.map +1 -1
  298. package/dist/esm/utils/getAddressInfo.d.ts +2 -3
  299. package/dist/esm/utils/getAddressInfo.d.ts.map +1 -1
  300. package/dist/esm/utils/getAddressInfo.js +2 -1
  301. package/dist/esm/utils/getAddressInfo.js.map +1 -1
  302. package/dist/esm/utils/idCache.d.ts +1 -2
  303. package/dist/esm/utils/idCache.d.ts.map +1 -1
  304. package/dist/esm/utils/isAddress.d.ts +1 -2
  305. package/dist/esm/utils/isAddress.d.ts.map +1 -1
  306. package/dist/esm/utils/lru.d.ts +1 -2
  307. package/dist/esm/utils/lru.d.ts.map +1 -1
  308. package/dist/esm/utils/modifyFee.d.ts +1 -2
  309. package/dist/esm/utils/modifyFee.d.ts.map +1 -1
  310. package/dist/esm/utils/observe.d.ts +3 -4
  311. package/dist/esm/utils/observe.d.ts.map +1 -1
  312. package/dist/esm/utils/parseAccount.d.ts +2 -3
  313. package/dist/esm/utils/parseAccount.d.ts.map +1 -1
  314. package/dist/esm/utils/poll.d.ts +1 -2
  315. package/dist/esm/utils/poll.d.ts.map +1 -1
  316. package/dist/esm/utils/poll.js +2 -1
  317. package/dist/esm/utils/poll.js.map +1 -1
  318. package/dist/esm/utils/retryUntil.d.ts +1 -2
  319. package/dist/esm/utils/retryUntil.d.ts.map +1 -1
  320. package/dist/esm/utils/sleep.d.ts +1 -2
  321. package/dist/esm/utils/sleep.d.ts.map +1 -1
  322. package/dist/esm/utils/stringify.d.ts +2 -3
  323. package/dist/esm/utils/stringify.d.ts.map +1 -1
  324. package/dist/esm/utils/uid.d.ts +1 -2
  325. package/dist/esm/utils/uid.d.ts.map +1 -1
  326. package/dist/esm/utils/url.d.ts +1 -2
  327. package/dist/esm/utils/url.d.ts.map +1 -1
  328. package/dist/esm/utils/wait.d.ts +1 -2
  329. package/dist/esm/utils/wait.d.ts.map +1 -1
  330. package/dist/esm/utils/withDedupe.d.ts +2 -3
  331. package/dist/esm/utils/withDedupe.d.ts.map +1 -1
  332. package/dist/esm/utils/withResolvers.d.ts +2 -3
  333. package/dist/esm/utils/withResolvers.d.ts.map +1 -1
  334. package/dist/esm/utils/withRetry.d.ts +3 -4
  335. package/dist/esm/utils/withRetry.d.ts.map +1 -1
  336. package/dist/esm/utils/withTimeout.d.ts +2 -3
  337. package/dist/esm/utils/withTimeout.d.ts.map +1 -1
  338. package/dist/esm/version.d.ts +2 -3
  339. package/dist/esm/version.d.ts.map +1 -1
  340. package/dist/esm/version.js +1 -1
  341. package/dist/esm/version.js.map +1 -1
  342. package/dist/esm/vite-env.d.ts +1 -1
  343. package/package.json +3 -3
  344. package/src/factories/createClient.ts +1 -2
  345. package/src/types/client.ts +1 -2
  346. package/src/version.ts +1 -1
@@ -4,7 +4,7 @@ import { UTXOMethod } from "../transports/types.js";
4
4
  import { ErrorType } from "../errors/utils.js";
5
5
  import { BtcRpcRequestFn, RpcSchema } from "./request.js";
6
6
  //#region src/types/transport.d.ts
7
- type TransportConfig<type extends string = string, rpcRequestFn extends BtcRpcRequestFn = BtcRpcRequestFn> = {
7
+ export type TransportConfig<type extends string = string, rpcRequestFn extends BtcRpcRequestFn = BtcRpcRequestFn> = {
8
8
  /** The name of the transport. */
9
9
  name: string;
10
10
  /** The key of the transport. */
@@ -26,7 +26,7 @@ type TransportConfig<type extends string = string, rpcRequestFn extends BtcRpcRe
26
26
  /** The type of the transport. */
27
27
  type: type;
28
28
  };
29
- type Transport<type extends string = string, rpcAttributes = Record<string, any>, rpcRequestFn extends BtcRpcRequestFn = BtcRpcRequestFn<RpcSchema>> = <chain extends Chain | undefined = Chain>({ chain }: {
29
+ export type Transport<type extends string = string, rpcAttributes = Record<string, any>, rpcRequestFn extends BtcRpcRequestFn = BtcRpcRequestFn<RpcSchema>> = <chain extends Chain | undefined = Chain>({ chain }: {
30
30
  chain?: chain | undefined;
31
31
  pollingInterval?: number | undefined;
32
32
  retryCount?: TransportConfig["retryCount"] | undefined;
@@ -36,7 +36,6 @@ type Transport<type extends string = string, rpcAttributes = Record<string, any>
36
36
  request: rpcRequestFn;
37
37
  value?: rpcAttributes | undefined;
38
38
  };
39
- type CreateTransportErrorType = ErrorType;
39
+ export type CreateTransportErrorType = ErrorType;
40
40
  //#endregion
41
- export { CreateTransportErrorType, Transport, TransportConfig };
42
41
  //# sourceMappingURL=transport.d.ts.map
@@ -1,42 +1,42 @@
1
1
  //#region src/types/utils.d.ts
2
2
  /** Combines members of an intersection into a readable type. */
3
- type Compute<type> = { [key in keyof type]: type[key]; } & unknown;
3
+ export type Compute<type> = { [key in keyof type]: type[key]; } & unknown;
4
4
  /**
5
5
  * Makes all properties of an object optional.
6
6
  *
7
7
  * Compatible with [`exactOptionalPropertyTypes`](https://www.typescriptlang.org/tsconfig#exactOptionalPropertyTypes).
8
8
  */
9
- type ExactPartial<type> = { [key in keyof type]?: type[key] | undefined; };
9
+ export type ExactPartial<type> = { [key in keyof type]?: type[key] | undefined; };
10
10
  /** Checks if {@link type} can be narrowed further than {@link type2} */
11
- type IsNarrowable<type, type2> = IsUnknown<type> extends true ? false : undefined extends type ? false : IsNever<(type extends type2 ? true : false) & (type2 extends type ? false : true)> extends true ? false : true;
11
+ export type IsNarrowable<type, type2> = IsUnknown<type> extends true ? false : undefined extends type ? false : IsNever<(type extends type2 ? true : false) & (type2 extends type ? false : true)> extends true ? false : true;
12
12
  /**
13
13
  * @internal
14
14
  * Checks if {@link type} is `never`
15
15
  */
16
- type IsNever<type> = [type] extends [never] ? true : false;
16
+ export type IsNever<type> = [type] extends [never] ? true : false;
17
17
  /**
18
18
  * @internal
19
19
  * Checks if {@link type} is `unknown`
20
20
  */
21
- type IsUnknown<type> = unknown extends type ? true : false;
21
+ export type IsUnknown<type> = unknown extends type ? true : false;
22
22
  /** Merges two object types into new type */
23
- type Merge<obj1, obj2> = Compute<LooseOmit<obj1, keyof obj2 extends (infer key extends string) ? key : never> & obj2>;
23
+ export type Merge<obj1, obj2> = Compute<LooseOmit<obj1, keyof obj2 extends (infer key extends string) ? key : never> & obj2>;
24
24
  /** Removes `readonly` from all properties of an object. */
25
- type Mutable<type extends object> = { -readonly [key in keyof type]: type[key]; };
25
+ export type Mutable<type extends object> = { -readonly [key in keyof type]: type[key]; };
26
26
  /** Strict version of built-in Omit type */
27
- type StrictOmit<type, keys extends keyof type> = Pick<type, Exclude<keyof type, keys>>;
27
+ export type StrictOmit<type, keys extends keyof type> = Pick<type, Exclude<keyof type, keys>>;
28
28
  /** Makes objects destructurable. */
29
- type OneOf<union extends object, keys extends KeyofUnion<union> = KeyofUnion<union>> = union extends (infer Item) ? Compute<Item & { [K in Exclude<keys, keyof Item>]?: undefined; }> : never;
29
+ export type OneOf<union extends object, keys extends KeyofUnion<union> = KeyofUnion<union>> = union extends (infer Item) ? Compute<Item & { [K in Exclude<keys, keyof Item>]?: undefined; }> : never;
30
30
  type KeyofUnion<type> = type extends type ? keyof type : never;
31
31
  /** Makes {@link key} optional in {@link type} while preserving type inference. */
32
- type PartialBy<type, key extends keyof type> = ExactPartial<Pick<type, key>> & StrictOmit<type, key>;
33
- type RemoveUndefined<type> = { [key in keyof type]: NonNullable<type[key]>; };
32
+ export type PartialBy<type, key extends keyof type> = ExactPartial<Pick<type, key>> & StrictOmit<type, key>;
33
+ export type RemoveUndefined<type> = { [key in keyof type]: NonNullable<type[key]>; };
34
34
  /** Loose version of {@link StrictOmit} */
35
- type LooseOmit<type, keys extends string> = Pick<type, Exclude<keyof type, keys>>;
36
- type UnionCompute<type> = type extends object ? Compute<type> : type;
37
- type UnionLooseOmit<type, keys extends string> = type extends any ? LooseOmit<type, keys> : never;
38
- type UnionStrictOmit<type, keys extends keyof type> = type extends any ? StrictOmit<type, keys> : never;
39
- type UnionExactPartial<type> = type extends object ? ExactPartial<type> : type;
35
+ export type LooseOmit<type, keys extends string> = Pick<type, Exclude<keyof type, keys>>;
36
+ export type UnionCompute<type> = type extends object ? Compute<type> : type;
37
+ export type UnionLooseOmit<type, keys extends string> = type extends any ? LooseOmit<type, keys> : never;
38
+ export type UnionStrictOmit<type, keys extends keyof type> = type extends any ? StrictOmit<type, keys> : never;
39
+ export type UnionExactPartial<type> = type extends object ? ExactPartial<type> : type;
40
40
  /**
41
41
  * @description Combines members of an intersection into a readable type.
42
42
  *
@@ -45,7 +45,7 @@ type UnionExactPartial<type> = type extends object ? ExactPartial<type> : type;
45
45
  * Prettify<{ a: string } & { b: string } & { c: number, d: bigint }>
46
46
  * => { a: string, b: string, c: number, d: bigint }
47
47
  */
48
- type Prettify<T> = { [K in keyof T]: T[K]; } & {};
48
+ export type Prettify<T> = { [K in keyof T]: T[K]; } & {};
49
49
  /**
50
50
  * @description Assigns the properties of U onto T.
51
51
  *
@@ -53,9 +53,8 @@ type Prettify<T> = { [K in keyof T]: T[K]; } & {};
53
53
  * Assign<{ a: string, b: number }, { a: undefined, c: boolean }>
54
54
  * => { a: undefined, b: number, c: boolean }
55
55
  */
56
- type Assign<T, U> = Assign_<T, U> & U;
56
+ export type Assign<T, U> = Assign_<T, U> & U;
57
57
  type Assign_<T, U> = { [K in keyof T as K extends keyof U ? U[K] extends void ? never : K : K]: K extends keyof U ? U[K] : T[K]; };
58
- type MaybePromise<T> = T | Promise<T>;
58
+ export type MaybePromise<T> = T | Promise<T>;
59
59
  //#endregion
60
- export { Assign, Compute, ExactPartial, IsNarrowable, IsNever, IsUnknown, LooseOmit, MaybePromise, Merge, Mutable, OneOf, PartialBy, Prettify, RemoveUndefined, StrictOmit, UnionCompute, UnionExactPartial, UnionLooseOmit, UnionStrictOmit };
61
60
  //# sourceMappingURL=utils.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { Address } from "./address.js";
2
2
  //#region src/types/xpub.d.ts
3
- type xPubAccount = {
3
+ export type xPubAccount = {
4
4
  balance: bigint;
5
5
  addresses: Array<{
6
6
  address: Address;
@@ -10,5 +10,4 @@ type xPubAccount = {
10
10
  }>;
11
11
  };
12
12
  //#endregion
13
- export { xPubAccount };
14
13
  //# sourceMappingURL=xpub.d.ts.map
@@ -1,10 +1,9 @@
1
1
  import { ErrorType } from "../errors/utils.js";
2
2
  import { BtcRpcRequestFn, BtcRpcRequestOptions, RpcSchema } from "../types/request.js";
3
3
  //#region src/utils/buildRequest.d.ts
4
- type RequestErrorType = ErrorType;
5
- declare function buildRequest<request extends BtcRpcRequestFn<RpcSchema>>(request: request, options?: BtcRpcRequestOptions): BtcRpcRequestFn;
4
+ export type RequestErrorType = ErrorType;
5
+ export declare function buildRequest<request extends BtcRpcRequestFn<RpcSchema>>(request: request, options?: BtcRpcRequestOptions): BtcRpcRequestFn;
6
6
  /** @internal */
7
- declare function shouldRetry(error: Error): boolean;
7
+ export declare function shouldRetry(error: Error): boolean;
8
8
  //#endregion
9
- export { RequestErrorType, buildRequest, shouldRetry };
10
9
  //# sourceMappingURL=buildRequest.d.ts.map
@@ -16,6 +16,7 @@ function buildRequest(request, options = {}) {
16
16
  const { method } = args;
17
17
  if (methods?.exclude?.includes(method)) throw new require_errors_rpc.MethodNotSupportedRpcError(method);
18
18
  if (methods?.include && !methods.include.includes(method)) throw new require_errors_rpc.MethodNotSupportedRpcError(method);
19
+ const requestId = dedupe ? require_utils_converter.stringToHex(`${uid}.${require_utils_stringify.stringify(args)}`) : void 0;
19
20
  return require_utils_withDedupe.withDedupe(() => require_utils_withRetry.withRetry(async () => {
20
21
  try {
21
22
  return await request(args);
@@ -42,7 +43,7 @@ function buildRequest(request, options = {}) {
42
43
  shouldRetry: ({ error }) => shouldRetry(error)
43
44
  }), {
44
45
  enabled: dedupe,
45
- id: dedupe ? require_utils_converter.stringToHex(`${uid}.${require_utils_stringify.stringify(args)}`) : void 0
46
+ id: requestId
46
47
  });
47
48
  };
48
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"buildRequest.js","names":["MethodNotSupportedRpcError","withDedupe","withRetry","UserRejectedRequestError","BaseError","HttpRequestError","stringToHex","stringify"],"sources":["../../../src/utils/buildRequest.ts"],"sourcesContent":["import { BaseError } from '../errors/base.js'\nimport { HttpRequestError } from '../errors/request.js'\nimport {\n MethodNotSupportedRpcError,\n RpcErrorCode,\n UserRejectedRequestError,\n} from '../errors/rpc.js'\nimport type { ErrorType } from '../errors/utils.js'\nimport type {\n BtcRpcRequestFn,\n BtcRpcRequestOptions,\n RpcSchema,\n} from '../types/request.js'\nimport { stringToHex } from './converter.js'\nimport { stringify } from './stringify.js'\nimport { withDedupe } from './withDedupe.js'\nimport { withRetry } from './withRetry.js'\n\nexport type RequestErrorType = ErrorType\n\nexport function buildRequest<request extends BtcRpcRequestFn<RpcSchema>>(\n request: request,\n options: BtcRpcRequestOptions = {}\n): BtcRpcRequestFn {\n return async (args, overrideOptions = {}) => {\n const {\n dedupe = false,\n methods,\n retryDelay = 150,\n retryCount = 3,\n uid,\n } = {\n ...options,\n ...overrideOptions,\n }\n\n const { method } = args\n if (methods?.exclude?.includes(method)) {\n throw new MethodNotSupportedRpcError(method)\n }\n if (methods?.include && !methods.include.includes(method)) {\n throw new MethodNotSupportedRpcError(method)\n }\n\n const requestId = dedupe\n ? stringToHex(`${uid}.${stringify(args)}`)\n : undefined\n return withDedupe(\n () =>\n withRetry(\n async () => {\n try {\n return await request(args)\n } catch (err_) {\n const err = err_ as unknown as BaseError\n switch (err.code) {\n case RpcErrorCode.METHOD_NOT_SUPPORTED:\n throw new MethodNotSupportedRpcError(method)\n\n case RpcErrorCode.USER_REJECTION:\n throw new UserRejectedRequestError(err.message)\n\n // CAIP-25: User Rejected Error\n // https://docs.walletconnect.com/2.0/specs/clients/sign/error-codes#rejected-caip-25\n case 5000:\n throw new UserRejectedRequestError(err.message)\n\n default:\n if (err_ instanceof BaseError) {\n throw err_\n }\n throw new BaseError('Unknown Error', { cause: err_ as Error })\n }\n }\n },\n {\n delay: ({ count, error }) => {\n // If we find a Retry-After header, let's retry after the given time.\n if (error && error instanceof HttpRequestError) {\n const retryAfter = error?.headers?.get('Retry-After')\n if (retryAfter?.match(/\\d/)) {\n return Number.parseInt(retryAfter, 10) * 1000\n }\n }\n\n // Otherwise, let's retry with an exponential backoff.\n return ~~(1 << count) * retryDelay\n },\n retryCount,\n shouldRetry: ({ error }) => shouldRetry(error),\n }\n ),\n { enabled: dedupe, id: requestId }\n )\n }\n}\n\n/** @internal */\nexport function shouldRetry(error: Error): boolean {\n if ('code' in error && typeof error.code === 'number') {\n if (error.code === -1) {\n return true // Unknown error\n }\n if (error.code === RpcErrorCode.INTERNAL_ERROR) {\n return true\n }\n return false\n }\n if (error instanceof HttpRequestError && error.status) {\n // Forbidden\n if (error.status === 403) {\n return true\n }\n // Request Timeout\n if (error.status === 408) {\n return true\n }\n // Request Entity Too Large\n if (error.status === 413) {\n return true\n }\n // Too Many Requests\n if (error.status === 429) {\n return true\n }\n // Internal Server Error\n if (error.status === 500) {\n return true\n }\n // Bad Gateway\n if (error.status === 502) {\n return true\n }\n // Service Unavailable\n if (error.status === 503) {\n return true\n }\n // Gateway Timeout\n if (error.status === 504) {\n return true\n }\n return false\n }\n return true\n}\n"],"mappings":";;;;;;;;;AAoBA,SAAgB,aACd,SACA,UAAgC,CAAC,GAChB;CACjB,OAAO,OAAO,MAAM,kBAAkB,CAAC,MAAM;EAC3C,MAAM,EACJ,SAAS,OACT,SACA,aAAa,KACb,aAAa,GACb,QACE;GACF,GAAG;GACH,GAAG;EACL;EAEA,MAAM,EAAE,WAAW;EACnB,IAAI,SAAS,SAAS,SAAS,MAAM,GACnC,MAAM,IAAIA,mBAAAA,2BAA2B,MAAM;EAE7C,IAAI,SAAS,WAAW,CAAC,QAAQ,QAAQ,SAAS,MAAM,GACtD,MAAM,IAAIA,mBAAAA,2BAA2B,MAAM;EAM7C,OAAOC,yBAAAA,iBAEHC,wBAAAA,UACE,YAAY;GACV,IAAI;IACF,OAAO,MAAM,QAAQ,IAAI;GAC3B,SAAS,MAAM;IACb,MAAM,MAAM;IACZ,QAAQ,IAAI,MAAZ;KACE,KAAA,QACE,MAAM,IAAIF,mBAAAA,2BAA2B,MAAM;KAE7C,KAAA,OACE,MAAM,IAAIG,mBAAAA,yBAAyB,IAAI,OAAO;KAIhD,KAAK,KACH,MAAM,IAAIA,mBAAAA,yBAAyB,IAAI,OAAO;KAEhD;MACE,IAAI,gBAAgBC,oBAAAA,WAClB,MAAM;MAER,MAAM,IAAIA,oBAAAA,UAAU,iBAAiB,EAAE,OAAO,KAAc,CAAC;IACjE;GACF;EACF,GACA;GACE,QAAQ,EAAE,OAAO,YAAY;IAE3B,IAAI,SAAS,iBAAiBC,uBAAAA,kBAAkB;KAC9C,MAAM,aAAa,OAAO,SAAS,IAAI,aAAa;KACpD,IAAI,YAAY,MAAM,IAAI,GACxB,OAAO,OAAO,SAAS,YAAY,EAAE,IAAI;IAE7C;IAGA,OAAO,CAAC,EAAE,KAAK,SAAS;GAC1B;GACA;GACA,cAAc,EAAE,YAAY,YAAY,KAAK;EAC/C,CACF,GACF;GAAE,SAAS;GAAQ,IAhDH,SACdC,wBAAAA,YAAY,GAAG,IAAI,GAAGC,wBAAAA,UAAU,IAAI,GAAG,IACvC,KAAA;EA8C+B,CACnC;CACF;AACF;;AAGA,SAAgB,YAAY,OAAuB;CACjD,IAAI,UAAU,SAAS,OAAO,MAAM,SAAS,UAAU;EACrD,IAAI,MAAM,SAAS,IACjB,OAAO;EAET,IAAI,MAAM,SAAA,QACR,OAAO;EAET,OAAO;CACT;CACA,IAAI,iBAAiBF,uBAAAA,oBAAoB,MAAM,QAAQ;EAErD,IAAI,MAAM,WAAW,KACnB,OAAO;EAGT,IAAI,MAAM,WAAW,KACnB,OAAO;EAGT,IAAI,MAAM,WAAW,KACnB,OAAO;EAGT,IAAI,MAAM,WAAW,KACnB,OAAO;EAGT,IAAI,MAAM,WAAW,KACnB,OAAO;EAGT,IAAI,MAAM,WAAW,KACnB,OAAO;EAGT,IAAI,MAAM,WAAW,KACnB,OAAO;EAGT,IAAI,MAAM,WAAW,KACnB,OAAO;EAET,OAAO;CACT;CACA,OAAO;AACT"}
1
+ {"version":3,"file":"buildRequest.js","names":["MethodNotSupportedRpcError","stringToHex","stringify","withDedupe","withRetry","UserRejectedRequestError","BaseError","HttpRequestError"],"sources":["../../../src/utils/buildRequest.ts"],"sourcesContent":["import { BaseError } from '../errors/base.js'\nimport { HttpRequestError } from '../errors/request.js'\nimport {\n MethodNotSupportedRpcError,\n RpcErrorCode,\n UserRejectedRequestError,\n} from '../errors/rpc.js'\nimport type { ErrorType } from '../errors/utils.js'\nimport type {\n BtcRpcRequestFn,\n BtcRpcRequestOptions,\n RpcSchema,\n} from '../types/request.js'\nimport { stringToHex } from './converter.js'\nimport { stringify } from './stringify.js'\nimport { withDedupe } from './withDedupe.js'\nimport { withRetry } from './withRetry.js'\n\nexport type RequestErrorType = ErrorType\n\nexport function buildRequest<request extends BtcRpcRequestFn<RpcSchema>>(\n request: request,\n options: BtcRpcRequestOptions = {}\n): BtcRpcRequestFn {\n return async (args, overrideOptions = {}) => {\n const {\n dedupe = false,\n methods,\n retryDelay = 150,\n retryCount = 3,\n uid,\n } = {\n ...options,\n ...overrideOptions,\n }\n\n const { method } = args\n if (methods?.exclude?.includes(method)) {\n throw new MethodNotSupportedRpcError(method)\n }\n if (methods?.include && !methods.include.includes(method)) {\n throw new MethodNotSupportedRpcError(method)\n }\n\n const requestId = dedupe\n ? stringToHex(`${uid}.${stringify(args)}`)\n : undefined\n return withDedupe(\n () =>\n withRetry(\n async () => {\n try {\n return await request(args)\n } catch (err_) {\n const err = err_ as unknown as BaseError\n switch (err.code) {\n case RpcErrorCode.METHOD_NOT_SUPPORTED:\n throw new MethodNotSupportedRpcError(method)\n\n case RpcErrorCode.USER_REJECTION:\n throw new UserRejectedRequestError(err.message)\n\n // CAIP-25: User Rejected Error\n // https://docs.walletconnect.com/2.0/specs/clients/sign/error-codes#rejected-caip-25\n case 5000:\n throw new UserRejectedRequestError(err.message)\n\n default:\n if (err_ instanceof BaseError) {\n throw err_\n }\n throw new BaseError('Unknown Error', { cause: err_ as Error })\n }\n }\n },\n {\n delay: ({ count, error }) => {\n // If we find a Retry-After header, let's retry after the given time.\n if (error && error instanceof HttpRequestError) {\n const retryAfter = error?.headers?.get('Retry-After')\n if (retryAfter?.match(/\\d/)) {\n return Number.parseInt(retryAfter, 10) * 1000\n }\n }\n\n // Otherwise, let's retry with an exponential backoff.\n return ~~(1 << count) * retryDelay\n },\n retryCount,\n shouldRetry: ({ error }) => shouldRetry(error),\n }\n ),\n { enabled: dedupe, id: requestId }\n )\n }\n}\n\n/** @internal */\nexport function shouldRetry(error: Error): boolean {\n if ('code' in error && typeof error.code === 'number') {\n if (error.code === -1) {\n return true // Unknown error\n }\n if (error.code === RpcErrorCode.INTERNAL_ERROR) {\n return true\n }\n return false\n }\n if (error instanceof HttpRequestError && error.status) {\n // Forbidden\n if (error.status === 403) {\n return true\n }\n // Request Timeout\n if (error.status === 408) {\n return true\n }\n // Request Entity Too Large\n if (error.status === 413) {\n return true\n }\n // Too Many Requests\n if (error.status === 429) {\n return true\n }\n // Internal Server Error\n if (error.status === 500) {\n return true\n }\n // Bad Gateway\n if (error.status === 502) {\n return true\n }\n // Service Unavailable\n if (error.status === 503) {\n return true\n }\n // Gateway Timeout\n if (error.status === 504) {\n return true\n }\n return false\n }\n return true\n}\n"],"mappings":";;;;;;;;;AAoBA,SAAgB,aACd,SACA,UAAgC,CAAC,GAChB;CACjB,OAAO,OAAO,MAAM,kBAAkB,CAAC,MAAM;EAC3C,MAAM,EACJ,SAAS,OACT,SACA,aAAa,KACb,aAAa,GACb,QACE;GACF,GAAG;GACH,GAAG;EACL;EAEA,MAAM,EAAE,WAAW;EACnB,IAAI,SAAS,SAAS,SAAS,MAAM,GACnC,MAAM,IAAIA,mBAAAA,2BAA2B,MAAM;EAE7C,IAAI,SAAS,WAAW,CAAC,QAAQ,QAAQ,SAAS,MAAM,GACtD,MAAM,IAAIA,mBAAAA,2BAA2B,MAAM;EAG7C,MAAM,YAAY,SACdC,wBAAAA,YAAY,GAAG,IAAI,GAAGC,wBAAAA,UAAU,IAAI,GAAG,IACvC,KAAA;EACJ,OAAOC,yBAAAA,iBAEHC,wBAAAA,UACE,YAAY;GACV,IAAI;IACF,OAAO,MAAM,QAAQ,IAAI;GAC3B,SAAS,MAAM;IACb,MAAM,MAAM;IACZ,QAAQ,IAAI,MAAZ;KACE,KAAA,QACE,MAAM,IAAIJ,mBAAAA,2BAA2B,MAAM;KAE7C,KAAA,OACE,MAAM,IAAIK,mBAAAA,yBAAyB,IAAI,OAAO;KAIhD,KAAK,KACH,MAAM,IAAIA,mBAAAA,yBAAyB,IAAI,OAAO;KAEhD;MACE,IAAI,gBAAgBC,oBAAAA,WAClB,MAAM;MAER,MAAM,IAAIA,oBAAAA,UAAU,iBAAiB,EAAE,OAAO,KAAc,CAAC;IACjE;GACF;EACF,GACA;GACE,QAAQ,EAAE,OAAO,YAAY;IAE3B,IAAI,SAAS,iBAAiBC,uBAAAA,kBAAkB;KAC9C,MAAM,aAAa,OAAO,SAAS,IAAI,aAAa;KACpD,IAAI,YAAY,MAAM,IAAI,GACxB,OAAO,OAAO,SAAS,YAAY,EAAE,IAAI;IAE7C;IAGA,OAAO,CAAC,EAAE,KAAK,SAAS;GAC1B;GACA;GACA,cAAc,EAAE,YAAY,YAAY,KAAK;EAC/C,CACF,GACF;GAAE,SAAS;GAAQ,IAAI;EAAU,CACnC;CACF;AACF;;AAGA,SAAgB,YAAY,OAAuB;CACjD,IAAI,UAAU,SAAS,OAAO,MAAM,SAAS,UAAU;EACrD,IAAI,MAAM,SAAS,IACjB,OAAO;EAET,IAAI,MAAM,SAAA,QACR,OAAO;EAET,OAAO;CACT;CACA,IAAI,iBAAiBA,uBAAAA,oBAAoB,MAAM,QAAQ;EAErD,IAAI,MAAM,WAAW,KACnB,OAAO;EAGT,IAAI,MAAM,WAAW,KACnB,OAAO;EAGT,IAAI,MAAM,WAAW,KACnB,OAAO;EAGT,IAAI,MAAM,WAAW,KACnB,OAAO;EAGT,IAAI,MAAM,WAAW,KACnB,OAAO;EAGT,IAAI,MAAM,WAAW,KACnB,OAAO;EAGT,IAAI,MAAM,WAAW,KACnB,OAAO;EAGT,IAAI,MAAM,WAAW,KACnB,OAAO;EAET,OAAO;CACT;CACA,OAAO;AACT"}
@@ -1,6 +1,5 @@
1
1
  import { Psbt } from "bitcoinjs-lib";
2
2
  //#region src/utils/cancelTransaction.d.ts
3
- declare function cancelTransaction(psbt: Psbt, accountAddress: string): Psbt;
3
+ export declare function cancelTransaction(psbt: Psbt, accountAddress: string): Psbt;
4
4
  //#endregion
5
- export { cancelTransaction };
6
5
  //# sourceMappingURL=cancelTransaction.d.ts.map
@@ -1,9 +1,8 @@
1
1
  //#region src/utils/converter.d.ts
2
- declare function hexToBase64(hex: string): string;
3
- declare function base64ToHex(base64: string): string;
4
- declare function base64urlEncode(str: string): string;
5
- declare function stringToHex(value: string): string;
6
- declare function hexToUnit8Array(value: string): Uint8Array;
2
+ export declare function hexToBase64(hex: string): string;
3
+ export declare function base64ToHex(base64: string): string;
4
+ export declare function base64urlEncode(str: string): string;
5
+ export declare function stringToHex(value: string): string;
6
+ export declare function hexToUnit8Array(value: string): Uint8Array;
7
7
  //#endregion
8
- export { base64ToHex, base64urlEncode, hexToBase64, hexToUnit8Array, stringToHex };
9
8
  //# sourceMappingURL=converter.d.ts.map
@@ -13,9 +13,8 @@ type CreateBatchSchedulerReturnType<parameters = unknown, returnType extends rea
13
13
  flush: () => void;
14
14
  schedule: parameters extends undefined ? (args?: parameters | undefined) => Promise<Resolved<returnType>> : (args: parameters) => Promise<Resolved<returnType>>;
15
15
  };
16
- type CreateBatchSchedulerErrorType = ErrorType;
16
+ export type CreateBatchSchedulerErrorType = ErrorType;
17
17
  /** @internal */
18
- declare function createBatchScheduler<parameters, returnType extends readonly unknown[]>({ fn, id, shouldSplitBatch, wait, sort }: CreateBatchSchedulerArguments<parameters, returnType>): CreateBatchSchedulerReturnType<parameters, returnType>;
18
+ export declare function createBatchScheduler<parameters, returnType extends readonly unknown[]>({ fn, id, shouldSplitBatch, wait, sort }: CreateBatchSchedulerArguments<parameters, returnType>): CreateBatchSchedulerReturnType<parameters, returnType>;
19
19
  //#endregion
20
- export { CreateBatchSchedulerErrorType, createBatchScheduler };
21
20
  //# sourceMappingURL=createBatchScheduler.d.ts.map
@@ -1,6 +1,5 @@
1
1
  //#region src/utils/deepEqual.d.ts
2
2
  /** Forked from https://github.com/epoberezkin/fast-deep-equal */
3
- declare function deepEqual(a: any, b: any): boolean;
3
+ export declare function deepEqual(a: any, b: any): boolean;
4
4
  //#endregion
5
- export { deepEqual };
6
5
  //# sourceMappingURL=deepEqual.d.ts.map
@@ -13,9 +13,8 @@ import { WalletActions } from "../clients/decorators/wallet.js";
13
13
  * Useful for extracting overridden actions from a client (ie. if a consumer
14
14
  * wants to override the `sendTransaction` implementation).
15
15
  */
16
- declare function getAction<transport extends Transport, chain extends Chain | undefined, account extends Account | undefined, rpcSchema extends UTXOSchema | undefined, extended extends {
16
+ export declare function getAction<transport extends Transport, chain extends Chain | undefined, account extends Account | undefined, rpcSchema extends UTXOSchema | undefined, extended extends {
17
17
  [key: string]: unknown;
18
18
  }, client extends Client<transport, chain, account, rpcSchema, extended>, parameters, returnType>(client: client, actionFn: (_: any, parameters: parameters) => returnType, name: keyof PublicActions | keyof WalletActions | (string & {})): (parameters: parameters) => returnType;
19
19
  //#endregion
20
- export { getAction };
21
20
  //# sourceMappingURL=getAction.d.ts.map
@@ -1,8 +1,7 @@
1
1
  import { ChainId } from "../types/chain.js";
2
2
  import { Address, AddressInfo } from "../types/address.js";
3
3
  //#region src/utils/getAddressInfo.d.ts
4
- declare const getAddressInfo: (address: Address) => AddressInfo;
5
- declare const getAddressChainId: (address: Address) => ChainId;
4
+ export declare const getAddressInfo: (address: Address) => AddressInfo;
5
+ export declare const getAddressChainId: (address: Address) => ChainId;
6
6
  //#endregion
7
- export { getAddressChainId, getAddressInfo };
8
7
  //# sourceMappingURL=getAddressInfo.d.ts.map
@@ -68,7 +68,8 @@ const getAddressInfo = (address) => {
68
68
  if (length !== 25) throw new Error("Invalid address");
69
69
  const version = decoded[0];
70
70
  const checksum = decoded.slice(length - 4, length);
71
- const expectedChecksum = (0, _noble_hashes_sha256.sha256)((0, _noble_hashes_sha256.sha256)(decoded.slice(0, length - 4))).slice(0, 4);
71
+ const body = decoded.slice(0, length - 4);
72
+ const expectedChecksum = (0, _noble_hashes_sha256.sha256)((0, _noble_hashes_sha256.sha256)(body)).slice(0, 4);
72
73
  if (checksum.some((value, index) => value !== expectedChecksum[index])) throw new Error("Invalid address");
73
74
  if (!Object.keys(addressTypes).map(Number).includes(version)) throw new Error("Invalid address");
74
75
  const addressType = addressTypes[version];
@@ -1 +1 @@
1
- {"version":3,"file":"getAddressInfo.js","names":["bech32m"],"sources":["../../../src/utils/getAddressInfo.ts"],"sourcesContent":["import { sha256 } from '@noble/hashes/sha256'\nimport { bech32, bech32m, type Decoded } from 'bech32'\nimport bs58 from 'bs58'\n\nimport {\n type Address,\n type AddressInfo,\n type AddressPurpose,\n AddressType,\n} from '../types/address.js'\nimport { ChainId, Network } from '../types/chain.js'\n\nconst addressTypes: {\n [key: number]: { type: AddressType; network: Network }\n} = {\n 0: {\n type: AddressType.p2pkh,\n network: Network.Mainnet,\n },\n 111: {\n type: AddressType.p2pkh,\n network: Network.Testnet,\n },\n 5: {\n type: AddressType.p2sh,\n network: Network.Mainnet,\n },\n 196: {\n type: AddressType.p2sh,\n network: Network.Testnet,\n },\n}\n\nconst parseBech32 = (address: Address): AddressInfo => {\n let decoded: Decoded\n\n try {\n if (\n address.startsWith('bc1p') ||\n address.startsWith('tb1p') ||\n address.startsWith('bcrt1p')\n ) {\n decoded = bech32m.decode(address)\n } else {\n decoded = bech32.decode(address)\n }\n } catch (_error) {\n throw new Error('Invalid address')\n }\n\n const mapPrefixToNetwork: { [key: string]: Network } = {\n bc: Network.Mainnet,\n tb: Network.Testnet,\n bcrt: Network.Regtest,\n }\n\n const network: Network = mapPrefixToNetwork[decoded.prefix]\n\n if (network === undefined) {\n throw new Error('Invalid address')\n }\n\n const witnessVersion = decoded.words[0]\n\n if (witnessVersion < 0 || witnessVersion > 16) {\n throw new Error('Invalid address')\n }\n const data = bech32.fromWords(decoded.words.slice(1))\n\n let type: AddressType\n if (data.length === 20) {\n type = AddressType.p2wpkh\n } else if (witnessVersion === 1) {\n type = AddressType.p2tr\n } else {\n type = AddressType.p2wsh\n }\n\n const purpose = getAddressPurpose(type)\n\n return {\n bech32: true,\n network,\n address,\n type,\n purpose,\n }\n}\n\nexport const getAddressInfo = (address: Address): AddressInfo => {\n let decoded: Uint8Array\n const prefix = address.substring(0, 2).toLowerCase()\n\n if (prefix === 'bc' || prefix === 'tb') {\n return parseBech32(address)\n }\n\n try {\n decoded = bs58.decode(address)\n } catch (_error) {\n throw new Error('Invalid address')\n }\n\n const { length } = decoded\n\n if (length !== 25) {\n throw new Error('Invalid address')\n }\n\n const version = decoded[0]\n\n const checksum = decoded.slice(length - 4, length)\n const body = decoded.slice(0, length - 4)\n\n const expectedChecksum = sha256(sha256(body)).slice(0, 4)\n\n if (\n checksum.some(\n (value: number, index: number) => value !== expectedChecksum[index]\n )\n ) {\n throw new Error('Invalid address')\n }\n\n const validVersions = Object.keys(addressTypes).map(Number)\n\n if (!validVersions.includes(version)) {\n throw new Error('Invalid address')\n }\n\n const addressType = addressTypes[version]\n\n return {\n ...addressType,\n address,\n bech32: false,\n purpose: getAddressPurpose(addressType.type),\n }\n}\n\nconst getAddressPurpose = (type: AddressType): AddressPurpose => {\n switch (type) {\n case AddressType.p2tr:\n return 'ordinals'\n case AddressType.p2wsh:\n return 'stacks'\n case AddressType.p2wpkh:\n case AddressType.p2sh:\n case AddressType.p2pkh:\n return 'payment'\n default:\n throw new Error('Invalid address type')\n }\n}\n\nexport const getAddressChainId = (address: Address): ChainId => {\n const addressInfo = getAddressInfo(address)\n\n switch (addressInfo.network) {\n case Network.Mainnet:\n return ChainId.BITCOIN_MAINNET\n case Network.Testnet:\n return ChainId.BITCOIN_TESTNET\n case Network.Regtest:\n return ChainId.BITCOIN_SIGNET\n default:\n return ChainId.BITCOIN_MAINNET\n }\n}\n"],"mappings":";;;;;;;;;AAYA,MAAM,eAEF;CACF,GAAG;EACD,MAAA;EACA,SAAA;CACF;CACA,KAAK;EACH,MAAA;EACA,SAAA;CACF;CACA,GAAG;EACD,MAAA;EACA,SAAA;CACF;CACA,KAAK;EACH,MAAA;EACA,SAAA;CACF;AACF;AAEA,MAAM,eAAe,YAAkC;CACrD,IAAI;CAEJ,IAAI;EACF,IACE,QAAQ,WAAW,MAAM,KACzB,QAAQ,WAAW,MAAM,KACzB,QAAQ,WAAW,QAAQ,GAE3B,UAAUA,OAAAA,QAAQ,OAAO,OAAO;OAEhC,UAAU,OAAA,OAAO,OAAO,OAAO;CAEnC,SAAS,QAAQ;EACf,MAAM,IAAI,MAAM,iBAAiB;CACnC;CAQA,MAAM,UAAmB;EALvB,IAAA;EACA,IAAA;EACA,MAAA;CAGwC,EAAE,QAAQ;CAEpD,IAAI,YAAY,KAAA,GACd,MAAM,IAAI,MAAM,iBAAiB;CAGnC,MAAM,iBAAiB,QAAQ,MAAM;CAErC,IAAI,iBAAiB,KAAK,iBAAiB,IACzC,MAAM,IAAI,MAAM,iBAAiB;CAEnC,MAAM,OAAO,OAAA,OAAO,UAAU,QAAQ,MAAM,MAAM,CAAC,CAAC;CAEpD,IAAI;CACJ,IAAI,KAAK,WAAW,IAClB,OAAA;MACK,IAAI,mBAAmB,GAC5B,OAAA;MAEA,OAAA;CAGF,MAAM,UAAU,kBAAkB,IAAI;CAEtC,OAAO;EACL,QAAQ;EACR;EACA;EACA;EACA;CACF;AACF;AAEA,MAAa,kBAAkB,YAAkC;CAC/D,IAAI;CACJ,MAAM,SAAS,QAAQ,UAAU,GAAG,CAAC,CAAC,CAAC,YAAY;CAEnD,IAAI,WAAW,QAAQ,WAAW,MAChC,OAAO,YAAY,OAAO;CAG5B,IAAI;EACF,UAAU,KAAA,QAAK,OAAO,OAAO;CAC/B,SAAS,QAAQ;EACf,MAAM,IAAI,MAAM,iBAAiB;CACnC;CAEA,MAAM,EAAE,WAAW;CAEnB,IAAI,WAAW,IACb,MAAM,IAAI,MAAM,iBAAiB;CAGnC,MAAM,UAAU,QAAQ;CAExB,MAAM,WAAW,QAAQ,MAAM,SAAS,GAAG,MAAM;CAGjD,MAAM,oBAAA,GAAA,qBAAA,OAAA,EAAA,GAAA,qBAAA,OAAA,CAFO,QAAQ,MAAM,GAAG,SAAS,CAEG,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC;CAExD,IACE,SAAS,MACN,OAAe,UAAkB,UAAU,iBAAiB,MAC/D,GAEA,MAAM,IAAI,MAAM,iBAAiB;CAKnC,IAAI,CAFkB,OAAO,KAAK,YAAY,CAAC,CAAC,IAAI,MAEnC,CAAC,CAAC,SAAS,OAAO,GACjC,MAAM,IAAI,MAAM,iBAAiB;CAGnC,MAAM,cAAc,aAAa;CAEjC,OAAO;EACL,GAAG;EACH;EACA,QAAQ;EACR,SAAS,kBAAkB,YAAY,IAAI;CAC7C;AACF;AAEA,MAAM,qBAAqB,SAAsC;CAC/D,QAAQ,MAAR;EACE,KAAA,QACE,OAAO;EACT,KAAA,SACE,OAAO;EACT,KAAA;EACA,KAAA;EACA,KAAA,SACE,OAAO;EACT,SACE,MAAM,IAAI,MAAM,sBAAsB;CAC1C;AACF;AAEA,MAAa,qBAAqB,YAA8B;CAG9D,QAFoB,eAAe,OAEjB,CAAC,CAAC,SAApB;EACE,KAAA,WACE,OAAA;EACF,KAAA,WACE,OAAA;EACF,KAAA,WACE,OAAA;EACF,SACE,OAAA;CACJ;AACF"}
1
+ {"version":3,"file":"getAddressInfo.js","names":["bech32m","sha256"],"sources":["../../../src/utils/getAddressInfo.ts"],"sourcesContent":["import { sha256 } from '@noble/hashes/sha256'\nimport { bech32, bech32m, type Decoded } from 'bech32'\nimport bs58 from 'bs58'\n\nimport {\n type Address,\n type AddressInfo,\n type AddressPurpose,\n AddressType,\n} from '../types/address.js'\nimport { ChainId, Network } from '../types/chain.js'\n\nconst addressTypes: {\n [key: number]: { type: AddressType; network: Network }\n} = {\n 0: {\n type: AddressType.p2pkh,\n network: Network.Mainnet,\n },\n 111: {\n type: AddressType.p2pkh,\n network: Network.Testnet,\n },\n 5: {\n type: AddressType.p2sh,\n network: Network.Mainnet,\n },\n 196: {\n type: AddressType.p2sh,\n network: Network.Testnet,\n },\n}\n\nconst parseBech32 = (address: Address): AddressInfo => {\n let decoded: Decoded\n\n try {\n if (\n address.startsWith('bc1p') ||\n address.startsWith('tb1p') ||\n address.startsWith('bcrt1p')\n ) {\n decoded = bech32m.decode(address)\n } else {\n decoded = bech32.decode(address)\n }\n } catch (_error) {\n throw new Error('Invalid address')\n }\n\n const mapPrefixToNetwork: { [key: string]: Network } = {\n bc: Network.Mainnet,\n tb: Network.Testnet,\n bcrt: Network.Regtest,\n }\n\n const network: Network = mapPrefixToNetwork[decoded.prefix]\n\n if (network === undefined) {\n throw new Error('Invalid address')\n }\n\n const witnessVersion = decoded.words[0]\n\n if (witnessVersion < 0 || witnessVersion > 16) {\n throw new Error('Invalid address')\n }\n const data = bech32.fromWords(decoded.words.slice(1))\n\n let type: AddressType\n if (data.length === 20) {\n type = AddressType.p2wpkh\n } else if (witnessVersion === 1) {\n type = AddressType.p2tr\n } else {\n type = AddressType.p2wsh\n }\n\n const purpose = getAddressPurpose(type)\n\n return {\n bech32: true,\n network,\n address,\n type,\n purpose,\n }\n}\n\nexport const getAddressInfo = (address: Address): AddressInfo => {\n let decoded: Uint8Array\n const prefix = address.substring(0, 2).toLowerCase()\n\n if (prefix === 'bc' || prefix === 'tb') {\n return parseBech32(address)\n }\n\n try {\n decoded = bs58.decode(address)\n } catch (_error) {\n throw new Error('Invalid address')\n }\n\n const { length } = decoded\n\n if (length !== 25) {\n throw new Error('Invalid address')\n }\n\n const version = decoded[0]\n\n const checksum = decoded.slice(length - 4, length)\n const body = decoded.slice(0, length - 4)\n\n const expectedChecksum = sha256(sha256(body)).slice(0, 4)\n\n if (\n checksum.some(\n (value: number, index: number) => value !== expectedChecksum[index]\n )\n ) {\n throw new Error('Invalid address')\n }\n\n const validVersions = Object.keys(addressTypes).map(Number)\n\n if (!validVersions.includes(version)) {\n throw new Error('Invalid address')\n }\n\n const addressType = addressTypes[version]\n\n return {\n ...addressType,\n address,\n bech32: false,\n purpose: getAddressPurpose(addressType.type),\n }\n}\n\nconst getAddressPurpose = (type: AddressType): AddressPurpose => {\n switch (type) {\n case AddressType.p2tr:\n return 'ordinals'\n case AddressType.p2wsh:\n return 'stacks'\n case AddressType.p2wpkh:\n case AddressType.p2sh:\n case AddressType.p2pkh:\n return 'payment'\n default:\n throw new Error('Invalid address type')\n }\n}\n\nexport const getAddressChainId = (address: Address): ChainId => {\n const addressInfo = getAddressInfo(address)\n\n switch (addressInfo.network) {\n case Network.Mainnet:\n return ChainId.BITCOIN_MAINNET\n case Network.Testnet:\n return ChainId.BITCOIN_TESTNET\n case Network.Regtest:\n return ChainId.BITCOIN_SIGNET\n default:\n return ChainId.BITCOIN_MAINNET\n }\n}\n"],"mappings":";;;;;;;;;AAYA,MAAM,eAEF;CACF,GAAG;EACD,MAAA;EACA,SAAA;CACF;CACA,KAAK;EACH,MAAA;EACA,SAAA;CACF;CACA,GAAG;EACD,MAAA;EACA,SAAA;CACF;CACA,KAAK;EACH,MAAA;EACA,SAAA;CACF;AACF;AAEA,MAAM,eAAe,YAAkC;CACrD,IAAI;CAEJ,IAAI;EACF,IACE,QAAQ,WAAW,MAAM,KACzB,QAAQ,WAAW,MAAM,KACzB,QAAQ,WAAW,QAAQ,GAE3B,UAAUA,OAAAA,QAAQ,OAAO,OAAO;OAEhC,UAAU,OAAA,OAAO,OAAO,OAAO;CAEnC,SAAS,QAAQ;EACf,MAAM,IAAI,MAAM,iBAAiB;CACnC;CAQA,MAAM,UAAmB;EALvB,IAAA;EACA,IAAA;EACA,MAAA;CAGwC,EAAE,QAAQ;CAEpD,IAAI,YAAY,KAAA,GACd,MAAM,IAAI,MAAM,iBAAiB;CAGnC,MAAM,iBAAiB,QAAQ,MAAM;CAErC,IAAI,iBAAiB,KAAK,iBAAiB,IACzC,MAAM,IAAI,MAAM,iBAAiB;CAEnC,MAAM,OAAO,OAAA,OAAO,UAAU,QAAQ,MAAM,MAAM,CAAC,CAAC;CAEpD,IAAI;CACJ,IAAI,KAAK,WAAW,IAClB,OAAA;MACK,IAAI,mBAAmB,GAC5B,OAAA;MAEA,OAAA;CAGF,MAAM,UAAU,kBAAkB,IAAI;CAEtC,OAAO;EACL,QAAQ;EACR;EACA;EACA;EACA;CACF;AACF;AAEA,MAAa,kBAAkB,YAAkC;CAC/D,IAAI;CACJ,MAAM,SAAS,QAAQ,UAAU,GAAG,CAAC,CAAC,CAAC,YAAY;CAEnD,IAAI,WAAW,QAAQ,WAAW,MAChC,OAAO,YAAY,OAAO;CAG5B,IAAI;EACF,UAAU,KAAA,QAAK,OAAO,OAAO;CAC/B,SAAS,QAAQ;EACf,MAAM,IAAI,MAAM,iBAAiB;CACnC;CAEA,MAAM,EAAE,WAAW;CAEnB,IAAI,WAAW,IACb,MAAM,IAAI,MAAM,iBAAiB;CAGnC,MAAM,UAAU,QAAQ;CAExB,MAAM,WAAW,QAAQ,MAAM,SAAS,GAAG,MAAM;CACjD,MAAM,OAAO,QAAQ,MAAM,GAAG,SAAS,CAAC;CAExC,MAAM,oBAAA,GAAmBC,qBAAAA,OAAAA,EAAAA,GAAOA,qBAAAA,OAAAA,CAAO,IAAI,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC;CAExD,IACE,SAAS,MACN,OAAe,UAAkB,UAAU,iBAAiB,MAC/D,GAEA,MAAM,IAAI,MAAM,iBAAiB;CAKnC,IAAI,CAFkB,OAAO,KAAK,YAAY,CAAC,CAAC,IAAI,MAEnC,CAAC,CAAC,SAAS,OAAO,GACjC,MAAM,IAAI,MAAM,iBAAiB;CAGnC,MAAM,cAAc,aAAa;CAEjC,OAAO;EACL,GAAG;EACH;EACA,QAAQ;EACR,SAAS,kBAAkB,YAAY,IAAI;CAC7C;AACF;AAEA,MAAM,qBAAqB,SAAsC;CAC/D,QAAQ,MAAR;EACE,KAAA,QACE,OAAO;EACT,KAAA,SACE,OAAO;EACT,KAAA;EACA,KAAA;EACA,KAAA,SACE,OAAO;EACT,SACE,MAAM,IAAI,MAAM,sBAAsB;CAC1C;AACF;AAEA,MAAa,qBAAqB,YAA8B;CAG9D,QAFoB,eAAe,OAEjB,CAAC,CAAC,SAApB;EACE,KAAA,WACE,OAAA;EACF,KAAA,WACE,OAAA;EACF,KAAA,WACE,OAAA;EACF,SACE,OAAA;CACJ;AACF"}
@@ -1,9 +1,8 @@
1
1
  //#region src/utils/idCache.d.ts
2
- declare const idCache: {
2
+ export declare const idCache: {
3
3
  current: number;
4
4
  take(): number;
5
5
  reset(): void;
6
6
  };
7
7
  //#endregion
8
- export { idCache };
9
8
  //# sourceMappingURL=idCache.d.ts.map
@@ -1,6 +1,5 @@
1
1
  import { Network } from "../types/chain.js";
2
2
  //#region src/utils/isAddress.d.ts
3
- declare const isAddress: (address: string, network?: Network) => boolean;
3
+ export declare const isAddress: (address: string, network?: Network) => boolean;
4
4
  //#endregion
5
- export { isAddress };
6
5
  //# sourceMappingURL=isAddress.d.ts.map
@@ -4,12 +4,11 @@
4
4
  *
5
5
  * @link https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU
6
6
  */
7
- declare class LruMap<value = unknown> extends Map<string, value> {
7
+ export declare class LruMap<value = unknown> extends Map<string, value> {
8
8
  maxSize: number;
9
9
  constructor(size: number);
10
10
  override get(key: string): value | undefined;
11
11
  override set(key: string, value: value): this;
12
12
  }
13
13
  //#endregion
14
- export { LruMap };
15
14
  //# sourceMappingURL=lru.d.ts.map
@@ -1,6 +1,5 @@
1
1
  import { Psbt } from "bitcoinjs-lib";
2
2
  //#region src/utils/modifyFee.d.ts
3
- declare function modifyFee(psbt: Psbt, newFee: bigint, accountAddress: string): Psbt;
3
+ export declare function modifyFee(psbt: Psbt, newFee: bigint, accountAddress: string): Psbt;
4
4
  //#endregion
5
- export { modifyFee };
6
5
  //# sourceMappingURL=modifyFee.d.ts.map
@@ -3,19 +3,18 @@ import { MaybePromise } from "../types/utils.js";
3
3
  type Callback = ((...args: any[]) => any) | undefined;
4
4
  type Callbacks = Record<string, Callback>;
5
5
  /** @internal */
6
- declare const listenersCache: Map<string, {
6
+ export declare const listenersCache: Map<string, {
7
7
  id: number;
8
8
  fns: Callbacks;
9
9
  }[]>;
10
10
  /** @internal */
11
- declare const cleanupCache: Map<string, () => void>;
11
+ export declare const cleanupCache: Map<string, () => void>;
12
12
  type EmitFunction<callbacks extends Callbacks> = (emit: callbacks) => MaybePromise<void | (() => void)>;
13
13
  /**
14
14
  * @description Sets up an observer for a given function. If another function
15
15
  * is set up under the same observer id, the function will only be called once
16
16
  * for both instances of the observer.
17
17
  */
18
- declare function observe<callbacks extends Callbacks>(observerId: string, callbacks: callbacks, fn: EmitFunction<callbacks>): () => void;
18
+ export declare function observe<callbacks extends Callbacks>(observerId: string, callbacks: callbacks, fn: EmitFunction<callbacks>): () => void;
19
19
  //#endregion
20
- export { cleanupCache, listenersCache, observe };
21
20
  //# sourceMappingURL=observe.d.ts.map
@@ -2,8 +2,7 @@ import { Address } from "../types/address.js";
2
2
  import { Account } from "../types/account.js";
3
3
  import { ErrorType } from "../errors/utils.js";
4
4
  //#region src/utils/parseAccount.d.ts
5
- type ParseAccountErrorType = ErrorType;
6
- declare function parseAccount<accountOrAddress extends Address | Account>(account: accountOrAddress): accountOrAddress extends Address ? Account : accountOrAddress;
5
+ export type ParseAccountErrorType = ErrorType;
6
+ export declare function parseAccount<accountOrAddress extends Address | Account>(account: accountOrAddress): accountOrAddress extends Address ? Account : accountOrAddress;
7
7
  //#endregion
8
- export { ParseAccountErrorType, parseAccount };
9
8
  //# sourceMappingURL=parseAccount.d.ts.map
@@ -7,9 +7,8 @@ type PollOptions<T> = {
7
7
  /**
8
8
  * @description Polls a function at a specified interval.
9
9
  */
10
- declare function poll<T>(fn: ({ unpoll }: {
10
+ export declare function poll<T>(fn: ({ unpoll }: {
11
11
  unpoll: () => void;
12
12
  }) => Promise<T | undefined>, { emitOnBegin, initialWaitTime, interval }: PollOptions<T>): () => void;
13
13
  //#endregion
14
- export { poll };
15
14
  //# sourceMappingURL=poll.d.ts.map
@@ -12,7 +12,8 @@ function poll(fn, { emitOnBegin, initialWaitTime, interval }) {
12
12
  const watch = async () => {
13
13
  let data;
14
14
  if (emitOnBegin) data = await fn({ unpoll: unwatch });
15
- await require_utils_sleep.sleep(await initialWaitTime?.(data) ?? interval);
15
+ const initialWait = await initialWaitTime?.(data) ?? interval;
16
+ await require_utils_sleep.sleep(initialWait);
16
17
  const poll = async () => {
17
18
  if (!active) return;
18
19
  await fn({ unpoll: unwatch });
@@ -1 +1 @@
1
- {"version":3,"file":"poll.js","names":["sleep"],"sources":["../../../src/utils/poll.ts"],"sourcesContent":["import { sleep } from './sleep.js'\n\ntype PollOptions<T> = {\n // Whether or not to emit when the polling starts.\n emitOnBegin?: boolean | undefined\n // The initial wait time (in ms) before polling.\n initialWaitTime?: ((data: T | undefined) => Promise<number>) | undefined\n // The interval (in ms).\n interval: number\n}\n\n/**\n * @description Polls a function at a specified interval.\n */\nexport function poll<T>(\n fn: ({ unpoll }: { unpoll: () => void }) => Promise<T | undefined>,\n { emitOnBegin, initialWaitTime, interval }: PollOptions<T>\n): () => void {\n let active = true\n\n const unwatch = () => {\n active = false\n }\n\n const watch = async () => {\n let data: T | undefined\n if (emitOnBegin) {\n data = await fn({ unpoll: unwatch })\n }\n\n const initialWait = (await initialWaitTime?.(data)) ?? interval\n await sleep(initialWait)\n\n const poll = async () => {\n if (!active) {\n return\n }\n await fn({ unpoll: unwatch })\n await sleep(interval)\n poll()\n }\n\n poll()\n }\n watch()\n\n return unwatch\n}\n"],"mappings":";;;;;;AAcA,SAAgB,KACd,IACA,EAAE,aAAa,iBAAiB,YACpB;CACZ,IAAI,SAAS;CAEb,MAAM,gBAAgB;EACpB,SAAS;CACX;CAEA,MAAM,QAAQ,YAAY;EACxB,IAAI;EACJ,IAAI,aACF,OAAO,MAAM,GAAG,EAAE,QAAQ,QAAQ,CAAC;EAIrC,MAAMA,oBAAAA,MADe,MAAM,kBAAkB,IAAI,KAAM,QAChC;EAEvB,MAAM,OAAO,YAAY;GACvB,IAAI,CAAC,QACH;GAEF,MAAM,GAAG,EAAE,QAAQ,QAAQ,CAAC;GAC5B,MAAMA,oBAAAA,MAAM,QAAQ;GACpB,KAAK;EACP;EAEA,KAAK;CACP;CACA,MAAM;CAEN,OAAO;AACT"}
1
+ {"version":3,"file":"poll.js","names":["sleep"],"sources":["../../../src/utils/poll.ts"],"sourcesContent":["import { sleep } from './sleep.js'\n\ntype PollOptions<T> = {\n // Whether or not to emit when the polling starts.\n emitOnBegin?: boolean | undefined\n // The initial wait time (in ms) before polling.\n initialWaitTime?: ((data: T | undefined) => Promise<number>) | undefined\n // The interval (in ms).\n interval: number\n}\n\n/**\n * @description Polls a function at a specified interval.\n */\nexport function poll<T>(\n fn: ({ unpoll }: { unpoll: () => void }) => Promise<T | undefined>,\n { emitOnBegin, initialWaitTime, interval }: PollOptions<T>\n): () => void {\n let active = true\n\n const unwatch = () => {\n active = false\n }\n\n const watch = async () => {\n let data: T | undefined\n if (emitOnBegin) {\n data = await fn({ unpoll: unwatch })\n }\n\n const initialWait = (await initialWaitTime?.(data)) ?? interval\n await sleep(initialWait)\n\n const poll = async () => {\n if (!active) {\n return\n }\n await fn({ unpoll: unwatch })\n await sleep(interval)\n poll()\n }\n\n poll()\n }\n watch()\n\n return unwatch\n}\n"],"mappings":";;;;;;AAcA,SAAgB,KACd,IACA,EAAE,aAAa,iBAAiB,YACpB;CACZ,IAAI,SAAS;CAEb,MAAM,gBAAgB;EACpB,SAAS;CACX;CAEA,MAAM,QAAQ,YAAY;EACxB,IAAI;EACJ,IAAI,aACF,OAAO,MAAM,GAAG,EAAE,QAAQ,QAAQ,CAAC;EAGrC,MAAM,cAAe,MAAM,kBAAkB,IAAI,KAAM;EACvD,MAAMA,oBAAAA,MAAM,WAAW;EAEvB,MAAM,OAAO,YAAY;GACvB,IAAI,CAAC,QACH;GAEF,MAAM,GAAG,EAAE,QAAQ,QAAQ,CAAC;GAC5B,MAAMA,oBAAAA,MAAM,QAAQ;GACpB,KAAK;EACP;EAEA,KAAK;CACP;CACA,MAAM;CAEN,OAAO;AACT"}
@@ -14,12 +14,11 @@
14
14
  * { timeout: 5000, interval: 100 }
15
15
  * )
16
16
  */
17
- declare function retryUntil<T>(condition: () => Promise<T | undefined | null | false>, options?: {
17
+ export declare function retryUntil<T>(condition: () => Promise<T | undefined | null | false>, options?: {
18
18
  /** Maximum time to wait in milliseconds (default: 5000ms) */
19
19
  timeout?: number;
20
20
  /** Interval between checks in milliseconds (default: 100ms) */
21
21
  interval?: number;
22
22
  }): Promise<T | undefined>;
23
23
  //#endregion
24
- export { retryUntil };
25
24
  //# sourceMappingURL=retryUntil.d.ts.map
@@ -1,5 +1,4 @@
1
1
  //#region src/utils/sleep.d.ts
2
- declare function sleep(ms: number): Promise<null>;
2
+ export declare function sleep(ms: number): Promise<null>;
3
3
  //#endregion
4
- export { sleep };
5
4
  //# sourceMappingURL=sleep.d.ts.map
@@ -1,7 +1,6 @@
1
1
  import { ErrorType } from "../errors/utils.js";
2
2
  //#region src/utils/stringify.d.ts
3
- type StringifyErrorType = ErrorType;
4
- declare const stringify: typeof JSON.stringify;
3
+ export type StringifyErrorType = ErrorType;
4
+ export declare const stringify: typeof JSON.stringify;
5
5
  //#endregion
6
- export { StringifyErrorType, stringify };
7
6
  //# sourceMappingURL=stringify.d.ts.map
@@ -1,5 +1,4 @@
1
1
  //#region src/utils/uid.d.ts
2
- declare function uid(length?: number): string;
2
+ export declare function uid(length?: number): string;
3
3
  //#endregion
4
- export { uid };
5
4
  //# sourceMappingURL=uid.d.ts.map
@@ -1,5 +1,4 @@
1
1
  //#region src/utils/url.d.ts
2
- declare const urlWithParams: (url: string, params: Record<string, string | number | undefined>) => string;
2
+ export declare const urlWithParams: (url: string, params: Record<string, string | number | undefined>) => string;
3
3
  //#endregion
4
- export { urlWithParams };
5
4
  //# sourceMappingURL=url.d.ts.map
@@ -1,5 +1,4 @@
1
1
  //#region src/utils/wait.d.ts
2
- declare function wait(time: number): Promise<void>;
2
+ export declare function wait(time: number): Promise<void>;
3
3
  //#endregion
4
- export { wait };
5
4
  //# sourceMappingURL=wait.d.ts.map
@@ -1,13 +1,12 @@
1
1
  import { LruMap } from "./lru.js";
2
2
  //#region src/utils/withDedupe.d.ts
3
3
  /** @internal */
4
- declare const promiseCache: LruMap<Promise<any>>;
4
+ export declare const promiseCache: LruMap<Promise<any>>;
5
5
  type WithDedupeOptions = {
6
6
  enabled?: boolean | undefined;
7
7
  id?: string | undefined;
8
8
  };
9
9
  /** Deduplicates in-flight promises. */
10
- declare function withDedupe<data>(fn: () => Promise<data>, { enabled, id }: WithDedupeOptions): Promise<data>;
10
+ export declare function withDedupe<data>(fn: () => Promise<data>, { enabled, id }: WithDedupeOptions): Promise<data>;
11
11
  //#endregion
12
- export { promiseCache, withDedupe };
13
12
  //# sourceMappingURL=withDedupe.d.ts.map
@@ -1,12 +1,11 @@
1
1
  //#region src/utils/withResolvers.d.ts
2
2
  /** @internal */
3
- type PromiseWithResolvers<type> = {
3
+ export type PromiseWithResolvers<type> = {
4
4
  promise: Promise<type>;
5
5
  resolve: (value: type | PromiseLike<type>) => void;
6
6
  reject: (reason?: unknown) => void;
7
7
  };
8
8
  /** @internal */
9
- declare function withResolvers<type>(): PromiseWithResolvers<type>;
9
+ export declare function withResolvers<type>(): PromiseWithResolvers<type>;
10
10
  //#endregion
11
- export { PromiseWithResolvers, withResolvers };
12
11
  //# sourceMappingURL=withResolvers.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { ErrorType } from "../errors/utils.js";
2
2
  //#region src/utils/withRetry.d.ts
3
- type WithRetryParameters = {
3
+ export type WithRetryParameters = {
4
4
  delay?: ((config: {
5
5
  count: number;
6
6
  error: Error;
@@ -11,8 +11,7 @@ type WithRetryParameters = {
11
11
  error: Error;
12
12
  }) => Promise<boolean> | boolean) | undefined;
13
13
  };
14
- type WithRetryErrorType = ErrorType;
15
- declare function withRetry<data>(fn: () => Promise<data>, { delay: delay_, retryCount, shouldRetry }?: WithRetryParameters): Promise<data>;
14
+ export type WithRetryErrorType = ErrorType;
15
+ export declare function withRetry<data>(fn: () => Promise<data>, { delay: delay_, retryCount, shouldRetry }?: WithRetryParameters): Promise<data>;
16
16
  //#endregion
17
- export { WithRetryErrorType, WithRetryParameters, withRetry };
18
17
  //# sourceMappingURL=withRetry.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { ErrorType } from "../errors/utils.js";
2
2
  //#region src/utils/withTimeout.d.ts
3
- type WithTimeoutErrorType = ErrorType;
4
- declare function withTimeout<data>(fn: ({ signal }: {
3
+ export type WithTimeoutErrorType = ErrorType;
4
+ export declare function withTimeout<data>(fn: ({ signal }: {
5
5
  signal: AbortController["signal"] | null;
6
6
  }) => Promise<data>, { errorInstance, timeout, signal }: {
7
7
  errorInstance?: Error | undefined;
@@ -9,5 +9,4 @@ declare function withTimeout<data>(fn: ({ signal }: {
9
9
  signal?: boolean | undefined;
10
10
  }): Promise<data>;
11
11
  //#endregion
12
- export { WithTimeoutErrorType, withTimeout };
13
12
  //# sourceMappingURL=withTimeout.d.ts.map
@@ -1,6 +1,5 @@
1
1
  //#region src/version.d.ts
2
- declare const name = "@bigmi/core";
3
- declare const version = "0.9.0";
2
+ export declare const name = "@bigmi/core";
3
+ export declare const version = "0.9.1";
4
4
  //#endregion
5
- export { name, version };
6
5
  //# sourceMappingURL=version.d.ts.map
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  //#region src/version.ts
3
3
  const name = "@bigmi/core";
4
- const version = "0.9.0";
4
+ const version = "0.9.1";
5
5
  //#endregion
6
6
  exports.name = name;
7
7
  exports.version = version;
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","names":[],"sources":["../../src/version.ts"],"sourcesContent":["export const name = '@bigmi/core'\nexport const version = '0.9.0'\n"],"mappings":";;AAAA,MAAa,OAAO;AACpB,MAAa,UAAU"}
1
+ {"version":3,"file":"version.js","names":[],"sources":["../../src/version.ts"],"sourcesContent":["export const name = '@bigmi/core'\nexport const version = '0.9.1'\n"],"mappings":";;AAAA,MAAa,OAAO;AACpB,MAAa,UAAU"}
@@ -1 +1 @@
1
- export { };
1
+ export {}
@@ -4,12 +4,11 @@ import { Account } from "../types/account.js";
4
4
  import { Transport } from "../types/transport.js";
5
5
  import { Client } from "../types/client.js";
6
6
  //#region src/actions/getBalance.d.ts
7
- type GetBalanceParameters = {
7
+ export type GetBalanceParameters = {
8
8
  /** The address of the account. */
9
9
  address: string;
10
10
  };
11
- type GetBalanceReturnType = bigint;
12
- declare function getBalance<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOSchema>, params: GetBalanceParameters): Promise<GetBalanceReturnType>;
11
+ export type GetBalanceReturnType = bigint;
12
+ export declare function getBalance<C extends Chain | undefined, A extends Account | undefined = Account | undefined>(client: Client<Transport, C, A, UTXOSchema>, params: GetBalanceParameters): Promise<GetBalanceReturnType>;
13
13
  //#endregion
14
- export { GetBalanceParameters, GetBalanceReturnType, getBalance };
15
14
  //# sourceMappingURL=getBalance.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getBalance.d.ts","names":[],"sources":["../../../src/actions/getBalance.ts"],"mappings":";;;;;;KAMY;;EAEV;;KAGU;iBAEU,WACpB,UAAU,mBACV,UAAU,sBAAsB,qBAEhC,QAAQ,OAAO,WAAW,GAAG,GAAG,aAChC,QAAQ,uBACP,QAAQ"}
1
+ {"version":3,"file":"getBalance.d.ts","names":[],"sources":["../../../src/actions/getBalance.ts"],"mappings":";;;;;;YAMY;;EAEV;;YAGU;wBAEU,WACpB,UAAU,mBACV,UAAU,sBAAsB,qBAEhC,QAAQ,OAAO,WAAW,GAAG,GAAG,aAChC,QAAQ,uBACP,QAAQ"}