@btc-vision/bitcoin 6.5.5 → 7.0.0-alpha.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 (457) hide show
  1. package/AUDIT/README.md +9 -0
  2. package/HOW_TO_WRITE_GOOD_CODE.md +2436 -0
  3. package/SECURITY.md +27 -0
  4. package/benchmark/psbt-2000-inputs.bench.ts +178 -0
  5. package/benchmark/signing.bench.ts +147 -0
  6. package/browser/address.d.ts +56 -9
  7. package/browser/address.d.ts.map +1 -0
  8. package/browser/bech32utils.d.ts +9 -1
  9. package/browser/bech32utils.d.ts.map +1 -0
  10. package/browser/bip66.d.ts +11 -6
  11. package/browser/bip66.d.ts.map +1 -0
  12. package/browser/block.d.ts +117 -11
  13. package/browser/block.d.ts.map +1 -0
  14. package/browser/branded.d.ts +20 -0
  15. package/browser/branded.d.ts.map +1 -0
  16. package/browser/crypto/crypto.d.ts +1 -0
  17. package/browser/crypto/crypto.d.ts.map +1 -0
  18. package/browser/crypto.d.ts +46 -7
  19. package/browser/crypto.d.ts.map +1 -0
  20. package/browser/ecc/context.d.ts +129 -0
  21. package/browser/ecc/context.d.ts.map +1 -0
  22. package/browser/ecc/index.d.ts +11 -0
  23. package/browser/ecc/index.d.ts.map +1 -0
  24. package/browser/ecc/types.d.ts +128 -0
  25. package/browser/ecc/types.d.ts.map +1 -0
  26. package/browser/ecpair.d.ts +99 -0
  27. package/browser/errors.d.ts +124 -0
  28. package/browser/errors.d.ts.map +1 -0
  29. package/browser/index.d.ts +32 -5
  30. package/browser/index.d.ts.map +1 -0
  31. package/browser/index.js +12482 -101
  32. package/browser/io/BinaryReader.d.ts +276 -0
  33. package/browser/io/BinaryReader.d.ts.map +1 -0
  34. package/browser/io/BinaryWriter.d.ts +391 -0
  35. package/browser/io/BinaryWriter.d.ts.map +1 -0
  36. package/browser/io/MemoryPool.d.ts +220 -0
  37. package/browser/io/MemoryPool.d.ts.map +1 -0
  38. package/browser/io/base64.d.ts +13 -0
  39. package/browser/io/base64.d.ts.map +1 -0
  40. package/browser/io/hex.d.ts +67 -0
  41. package/browser/io/hex.d.ts.map +1 -0
  42. package/browser/io/index.d.ts +17 -0
  43. package/browser/io/index.d.ts.map +1 -0
  44. package/browser/io/utils.d.ts +199 -0
  45. package/browser/io/utils.d.ts.map +1 -0
  46. package/browser/merkle.d.ts +10 -1
  47. package/browser/merkle.d.ts.map +1 -0
  48. package/browser/networks.d.ts +70 -9
  49. package/browser/networks.d.ts.map +1 -0
  50. package/browser/opcodes.d.ts +1 -0
  51. package/browser/opcodes.d.ts.map +1 -0
  52. package/browser/payments/bip341.d.ts +35 -9
  53. package/browser/payments/bip341.d.ts.map +1 -0
  54. package/browser/payments/embed.d.ts +112 -1
  55. package/browser/payments/embed.d.ts.map +1 -0
  56. package/browser/payments/index.d.ts +17 -10
  57. package/browser/payments/index.d.ts.map +1 -0
  58. package/browser/payments/p2ms.d.ts +150 -0
  59. package/browser/payments/p2ms.d.ts.map +1 -0
  60. package/browser/payments/p2op.d.ts +150 -24
  61. package/browser/payments/p2op.d.ts.map +1 -0
  62. package/browser/payments/p2pk.d.ts +154 -1
  63. package/browser/payments/p2pk.d.ts.map +1 -0
  64. package/browser/payments/p2pkh.d.ts +176 -1
  65. package/browser/payments/p2pkh.d.ts.map +1 -0
  66. package/browser/payments/p2sh.d.ts +150 -1
  67. package/browser/payments/p2sh.d.ts.map +1 -0
  68. package/browser/payments/p2tr.d.ts +185 -1
  69. package/browser/payments/p2tr.d.ts.map +1 -0
  70. package/browser/payments/p2wpkh.d.ts +161 -1
  71. package/browser/payments/p2wpkh.d.ts.map +1 -0
  72. package/browser/payments/p2wsh.d.ts +146 -1
  73. package/browser/payments/p2wsh.d.ts.map +1 -0
  74. package/browser/payments/types.d.ts +94 -64
  75. package/browser/payments/types.d.ts.map +1 -0
  76. package/browser/psbt/bip371.d.ts +34 -8
  77. package/browser/psbt/bip371.d.ts.map +1 -0
  78. package/browser/psbt/psbtutils.d.ts +56 -16
  79. package/browser/psbt/psbtutils.d.ts.map +1 -0
  80. package/browser/psbt/types.d.ts +245 -0
  81. package/browser/psbt/types.d.ts.map +1 -0
  82. package/browser/psbt/utils.d.ts +64 -0
  83. package/browser/psbt/utils.d.ts.map +1 -0
  84. package/browser/psbt/validation.d.ts +84 -0
  85. package/browser/psbt/validation.d.ts.map +1 -0
  86. package/browser/psbt.d.ts +82 -118
  87. package/browser/psbt.d.ts.map +1 -0
  88. package/browser/pubkey.d.ts +27 -6
  89. package/browser/pubkey.d.ts.map +1 -0
  90. package/browser/push_data.d.ts +24 -2
  91. package/browser/push_data.d.ts.map +1 -0
  92. package/browser/script.d.ts +33 -8
  93. package/browser/script.d.ts.map +1 -0
  94. package/browser/script_number.d.ts +17 -0
  95. package/browser/script_number.d.ts.map +1 -0
  96. package/browser/script_signature.d.ts +23 -5
  97. package/browser/script_signature.d.ts.map +1 -0
  98. package/browser/transaction.d.ts +160 -18
  99. package/browser/transaction.d.ts.map +1 -0
  100. package/browser/types.d.ts +36 -38
  101. package/browser/types.d.ts.map +1 -0
  102. package/browser/workers/WorkerSigningPool.d.ts +143 -0
  103. package/browser/workers/WorkerSigningPool.d.ts.map +1 -0
  104. package/browser/workers/WorkerSigningPool.node.d.ts +116 -0
  105. package/browser/workers/WorkerSigningPool.node.d.ts.map +1 -0
  106. package/browser/workers/ecc-bundle.d.ts +25 -0
  107. package/browser/workers/ecc-bundle.d.ts.map +1 -0
  108. package/browser/workers/index.d.ts +91 -0
  109. package/browser/workers/index.d.ts.map +1 -0
  110. package/browser/workers/psbt-parallel.d.ts +88 -0
  111. package/browser/workers/psbt-parallel.d.ts.map +1 -0
  112. package/browser/workers/signing-worker.d.ts +37 -0
  113. package/browser/workers/signing-worker.d.ts.map +1 -0
  114. package/browser/workers/types.d.ts +365 -0
  115. package/browser/workers/types.d.ts.map +1 -0
  116. package/build/address.d.ts +57 -10
  117. package/build/address.d.ts.map +1 -0
  118. package/build/address.js +80 -24
  119. package/build/address.js.map +1 -0
  120. package/build/bech32utils.d.ts +9 -1
  121. package/build/bech32utils.d.ts.map +1 -0
  122. package/build/bech32utils.js +10 -2
  123. package/build/bech32utils.js.map +1 -0
  124. package/build/bip66.d.ts +11 -6
  125. package/build/bip66.d.ts.map +1 -0
  126. package/build/bip66.js +32 -3
  127. package/build/bip66.js.map +1 -0
  128. package/build/block.d.ts +117 -11
  129. package/build/block.d.ts.map +1 -0
  130. package/build/block.js +204 -72
  131. package/build/block.js.map +1 -0
  132. package/build/branded.d.ts +20 -0
  133. package/build/branded.d.ts.map +1 -0
  134. package/build/branded.js +7 -0
  135. package/build/branded.js.map +1 -0
  136. package/build/crypto/crypto.d.ts +1 -0
  137. package/build/crypto/crypto.d.ts.map +1 -0
  138. package/build/crypto/crypto.js +1 -0
  139. package/build/crypto/crypto.js.map +1 -0
  140. package/build/crypto.d.ts +46 -7
  141. package/build/crypto.d.ts.map +1 -0
  142. package/build/crypto.js +65 -20
  143. package/build/crypto.js.map +1 -0
  144. package/build/ecc/context.d.ts +135 -0
  145. package/build/ecc/context.d.ts.map +1 -0
  146. package/build/ecc/context.js +232 -0
  147. package/build/ecc/context.js.map +1 -0
  148. package/build/ecc/index.d.ts +11 -0
  149. package/build/ecc/index.d.ts.map +1 -0
  150. package/build/ecc/index.js +11 -0
  151. package/build/ecc/index.js.map +1 -0
  152. package/build/ecc/types.d.ts +134 -0
  153. package/build/ecc/types.d.ts.map +1 -0
  154. package/build/ecc/types.js +8 -0
  155. package/build/ecc/types.js.map +1 -0
  156. package/build/errors.d.ts +124 -0
  157. package/build/errors.d.ts.map +1 -0
  158. package/build/errors.js +155 -0
  159. package/build/errors.js.map +1 -0
  160. package/build/index.d.ts +32 -5
  161. package/build/index.d.ts.map +1 -0
  162. package/build/index.js +26 -3
  163. package/build/index.js.map +1 -0
  164. package/build/io/BinaryReader.d.ts +276 -0
  165. package/build/io/BinaryReader.d.ts.map +1 -0
  166. package/build/io/BinaryReader.js +425 -0
  167. package/build/io/BinaryReader.js.map +1 -0
  168. package/build/io/BinaryWriter.d.ts +391 -0
  169. package/build/io/BinaryWriter.d.ts.map +1 -0
  170. package/build/io/BinaryWriter.js +611 -0
  171. package/build/io/BinaryWriter.js.map +1 -0
  172. package/build/io/MemoryPool.d.ts +220 -0
  173. package/build/io/MemoryPool.d.ts.map +1 -0
  174. package/build/io/MemoryPool.js +309 -0
  175. package/build/io/MemoryPool.js.map +1 -0
  176. package/build/io/base64.d.ts +13 -0
  177. package/build/io/base64.d.ts.map +1 -0
  178. package/build/io/base64.js +20 -0
  179. package/build/io/base64.js.map +1 -0
  180. package/build/io/hex.d.ts +67 -0
  181. package/build/io/hex.d.ts.map +1 -0
  182. package/build/io/hex.js +138 -0
  183. package/build/io/hex.js.map +1 -0
  184. package/build/io/index.d.ts +17 -0
  185. package/build/io/index.d.ts.map +1 -0
  186. package/build/io/index.js +23 -0
  187. package/build/io/index.js.map +1 -0
  188. package/build/io/utils.d.ts +199 -0
  189. package/build/io/utils.d.ts.map +1 -0
  190. package/build/io/utils.js +271 -0
  191. package/build/io/utils.js.map +1 -0
  192. package/build/merkle.d.ts +10 -1
  193. package/build/merkle.d.ts.map +1 -0
  194. package/build/merkle.js +12 -1
  195. package/build/merkle.js.map +1 -0
  196. package/build/networks.d.ts +70 -9
  197. package/build/networks.d.ts.map +1 -0
  198. package/build/networks.js +90 -4
  199. package/build/networks.js.map +1 -0
  200. package/build/opcodes.d.ts +1 -0
  201. package/build/opcodes.d.ts.map +1 -0
  202. package/build/opcodes.js +1 -0
  203. package/build/opcodes.js.map +1 -0
  204. package/build/payments/bip341.d.ts +36 -9
  205. package/build/payments/bip341.d.ts.map +1 -0
  206. package/build/payments/bip341.js +35 -15
  207. package/build/payments/bip341.js.map +1 -0
  208. package/build/payments/embed.d.ts +120 -1
  209. package/build/payments/embed.d.ts.map +1 -0
  210. package/build/payments/embed.js +215 -34
  211. package/build/payments/embed.js.map +1 -0
  212. package/build/payments/index.d.ts +17 -10
  213. package/build/payments/index.d.ts.map +1 -0
  214. package/build/payments/index.js +20 -10
  215. package/build/payments/index.js.map +1 -0
  216. package/build/payments/p2ms.d.ts +159 -1
  217. package/build/payments/p2ms.d.ts.map +1 -0
  218. package/build/payments/p2ms.js +427 -108
  219. package/build/payments/p2ms.js.map +1 -0
  220. package/build/payments/p2op.d.ts +158 -24
  221. package/build/payments/p2op.d.ts.map +1 -0
  222. package/build/payments/p2op.js +379 -93
  223. package/build/payments/p2op.js.map +1 -0
  224. package/build/payments/p2pk.d.ts +162 -1
  225. package/build/payments/p2pk.d.ts.map +1 -0
  226. package/build/payments/p2pk.js +327 -58
  227. package/build/payments/p2pk.js.map +1 -0
  228. package/build/payments/p2pkh.d.ts +185 -1
  229. package/build/payments/p2pkh.d.ts.map +1 -0
  230. package/build/payments/p2pkh.js +467 -114
  231. package/build/payments/p2pkh.js.map +1 -0
  232. package/build/payments/p2sh.d.ts +159 -1
  233. package/build/payments/p2sh.d.ts.map +1 -0
  234. package/build/payments/p2sh.js +500 -152
  235. package/build/payments/p2sh.js.map +1 -0
  236. package/build/payments/p2tr.d.ts +193 -1
  237. package/build/payments/p2tr.d.ts.map +1 -0
  238. package/build/payments/p2tr.js +592 -174
  239. package/build/payments/p2tr.js.map +1 -0
  240. package/build/payments/p2wpkh.d.ts +170 -1
  241. package/build/payments/p2wpkh.d.ts.map +1 -0
  242. package/build/payments/p2wpkh.js +429 -104
  243. package/build/payments/p2wpkh.js.map +1 -0
  244. package/build/payments/p2wsh.d.ts +155 -1
  245. package/build/payments/p2wsh.d.ts.map +1 -0
  246. package/build/payments/p2wsh.js +466 -144
  247. package/build/payments/p2wsh.js.map +1 -0
  248. package/build/payments/types.d.ts +98 -64
  249. package/build/payments/types.d.ts.map +1 -0
  250. package/build/payments/types.js +17 -13
  251. package/build/payments/types.js.map +1 -0
  252. package/build/psbt/bip371.d.ts +35 -9
  253. package/build/psbt/bip371.d.ts.map +1 -0
  254. package/build/psbt/bip371.js +113 -28
  255. package/build/psbt/bip371.js.map +1 -0
  256. package/build/psbt/psbtutils.d.ts +56 -16
  257. package/build/psbt/psbtutils.d.ts.map +1 -0
  258. package/build/psbt/psbtutils.js +71 -16
  259. package/build/psbt/psbtutils.js.map +1 -0
  260. package/build/psbt/types.d.ts +249 -0
  261. package/build/psbt/types.d.ts.map +1 -0
  262. package/build/psbt/types.js +6 -0
  263. package/build/psbt/types.js.map +1 -0
  264. package/build/psbt/utils.d.ts +68 -0
  265. package/build/psbt/utils.d.ts.map +1 -0
  266. package/build/psbt/utils.js +171 -0
  267. package/build/psbt/utils.js.map +1 -0
  268. package/build/psbt/validation.d.ts +88 -0
  269. package/build/psbt/validation.d.ts.map +1 -0
  270. package/build/psbt/validation.js +149 -0
  271. package/build/psbt/validation.js.map +1 -0
  272. package/build/psbt.d.ts +84 -120
  273. package/build/psbt.d.ts.map +1 -0
  274. package/build/psbt.js +411 -412
  275. package/build/psbt.js.map +1 -0
  276. package/build/pubkey.d.ts +27 -6
  277. package/build/pubkey.d.ts.map +1 -0
  278. package/build/pubkey.js +37 -13
  279. package/build/pubkey.js.map +1 -0
  280. package/build/push_data.d.ts +24 -2
  281. package/build/push_data.d.ts.map +1 -0
  282. package/build/push_data.js +44 -12
  283. package/build/push_data.js.map +1 -0
  284. package/build/script.d.ts +33 -8
  285. package/build/script.d.ts.map +1 -0
  286. package/build/script.js +100 -36
  287. package/build/script.js.map +1 -0
  288. package/build/script_number.d.ts +17 -0
  289. package/build/script_number.d.ts.map +1 -0
  290. package/build/script_number.js +19 -0
  291. package/build/script_number.js.map +1 -0
  292. package/build/script_signature.d.ts +23 -5
  293. package/build/script_signature.d.ts.map +1 -0
  294. package/build/script_signature.js +48 -15
  295. package/build/script_signature.js.map +1 -0
  296. package/build/transaction.d.ts +160 -18
  297. package/build/transaction.d.ts.map +1 -0
  298. package/build/transaction.js +443 -176
  299. package/build/transaction.js.map +1 -0
  300. package/build/tsconfig.build.tsbuildinfo +1 -0
  301. package/build/types.d.ts +36 -38
  302. package/build/types.d.ts.map +1 -0
  303. package/build/types.js +175 -57
  304. package/build/types.js.map +1 -0
  305. package/build/workers/WorkerSigningPool.d.ts +174 -0
  306. package/build/workers/WorkerSigningPool.d.ts.map +1 -0
  307. package/build/workers/WorkerSigningPool.js +553 -0
  308. package/build/workers/WorkerSigningPool.js.map +1 -0
  309. package/build/workers/WorkerSigningPool.node.d.ts +124 -0
  310. package/build/workers/WorkerSigningPool.node.d.ts.map +1 -0
  311. package/build/workers/WorkerSigningPool.node.js +753 -0
  312. package/build/workers/WorkerSigningPool.node.js.map +1 -0
  313. package/build/workers/ecc-bundle.d.ts +25 -0
  314. package/build/workers/ecc-bundle.d.ts.map +1 -0
  315. package/build/workers/ecc-bundle.js +25 -0
  316. package/build/workers/ecc-bundle.js.map +1 -0
  317. package/build/workers/index.d.ts +91 -0
  318. package/build/workers/index.d.ts.map +1 -0
  319. package/build/workers/index.js +114 -0
  320. package/build/workers/index.js.map +1 -0
  321. package/build/workers/psbt-parallel.d.ts +117 -0
  322. package/build/workers/psbt-parallel.d.ts.map +1 -0
  323. package/build/workers/psbt-parallel.js +233 -0
  324. package/build/workers/psbt-parallel.js.map +1 -0
  325. package/build/workers/signing-worker.d.ts +37 -0
  326. package/build/workers/signing-worker.d.ts.map +1 -0
  327. package/build/workers/signing-worker.js +350 -0
  328. package/build/workers/signing-worker.js.map +1 -0
  329. package/build/workers/types.d.ts +365 -0
  330. package/build/workers/types.d.ts.map +1 -0
  331. package/build/workers/types.js +60 -0
  332. package/build/workers/types.js.map +1 -0
  333. package/package.json +83 -25
  334. package/scripts/bundle-ecc.ts +111 -0
  335. package/src/address.ts +81 -44
  336. package/src/bech32utils.ts +3 -3
  337. package/src/bip66.ts +34 -24
  338. package/src/block.ts +196 -84
  339. package/src/branded.ts +18 -0
  340. package/src/crypto.ts +64 -26
  341. package/src/ecc/context.ts +277 -0
  342. package/src/ecc/index.ts +14 -0
  343. package/src/ecc/types.ts +154 -0
  344. package/src/ecpair.d.ts +99 -0
  345. package/src/errors.ts +163 -0
  346. package/src/index.ts +113 -9
  347. package/src/io/BinaryReader.ts +461 -0
  348. package/src/io/BinaryWriter.ts +696 -0
  349. package/src/io/MemoryPool.ts +343 -0
  350. package/src/io/base64.ts +20 -0
  351. package/src/io/hex.ts +155 -0
  352. package/src/io/index.ts +41 -0
  353. package/src/io/utils.ts +283 -0
  354. package/src/merkle.ts +14 -9
  355. package/src/networks.ts +9 -9
  356. package/src/payments/bip341.ts +34 -33
  357. package/src/payments/embed.ts +244 -41
  358. package/src/payments/index.ts +12 -10
  359. package/src/payments/p2ms.ts +490 -118
  360. package/src/payments/p2op.ts +431 -133
  361. package/src/payments/p2pk.ts +370 -72
  362. package/src/payments/p2pkh.ts +524 -130
  363. package/src/payments/p2sh.ts +572 -172
  364. package/src/payments/p2tr.ts +686 -194
  365. package/src/payments/p2wpkh.ts +484 -107
  366. package/src/payments/p2wsh.ts +526 -164
  367. package/src/payments/types.ts +80 -66
  368. package/src/psbt/bip371.ts +68 -51
  369. package/src/psbt/psbtutils.ts +39 -40
  370. package/src/psbt/types.ts +331 -0
  371. package/src/psbt/utils.ts +188 -0
  372. package/src/psbt/validation.ts +192 -0
  373. package/src/psbt.ts +566 -809
  374. package/src/pubkey.ts +24 -25
  375. package/src/push_data.ts +18 -16
  376. package/src/script.ts +82 -64
  377. package/src/script_number.ts +6 -6
  378. package/src/script_signature.ts +33 -36
  379. package/src/transaction.ts +458 -238
  380. package/src/types.ts +231 -100
  381. package/src/workers/WorkerSigningPool.node.ts +887 -0
  382. package/src/workers/WorkerSigningPool.ts +670 -0
  383. package/src/workers/ecc-bundle.ts +26 -0
  384. package/src/workers/index.ts +165 -0
  385. package/src/workers/psbt-parallel.ts +332 -0
  386. package/src/workers/signing-worker.ts +353 -0
  387. package/src/workers/types.ts +413 -0
  388. package/test/address.spec.ts +9 -6
  389. package/test/bitcoin.core.spec.ts +16 -17
  390. package/test/block.spec.ts +8 -7
  391. package/test/bufferutils.spec.ts +228 -214
  392. package/test/crypto.spec.ts +19 -11
  393. package/test/fixtures/p2pk.json +0 -8
  394. package/test/fixtures/p2pkh.json +1 -1
  395. package/test/fixtures/p2sh.json +1 -1
  396. package/test/fixtures/script.json +1 -1
  397. package/test/fixtures/transaction.json +2 -2
  398. package/test/integration/_regtest.ts +25 -0
  399. package/test/integration/addresses.spec.ts +4 -3
  400. package/test/integration/bip32.spec.ts +2 -1
  401. package/test/integration/blocks.spec.ts +1 -1
  402. package/test/integration/cltv.spec.ts +18 -16
  403. package/test/integration/csv.spec.ts +37 -64
  404. package/test/integration/payments.spec.ts +5 -3
  405. package/test/integration/taproot.spec.ts +76 -83
  406. package/test/integration/transactions.spec.ts +38 -35
  407. package/test/payments.spec.ts +35 -13
  408. package/test/payments.utils.ts +17 -16
  409. package/test/psbt.spec.ts +111 -100
  410. package/test/script.spec.ts +11 -10
  411. package/test/script_signature.spec.ts +9 -11
  412. package/test/taproot-cache.spec.ts +694 -0
  413. package/test/transaction.spec.ts +32 -40
  414. package/test/types.spec.ts +74 -29
  415. package/test/workers-pool.spec.ts +963 -0
  416. package/test/workers-signing.spec.ts +635 -0
  417. package/test/workers.spec.ts +1390 -0
  418. package/tsconfig.base.json +34 -18
  419. package/tsconfig.browser.json +15 -0
  420. package/tsconfig.build.json +5 -0
  421. package/tsconfig.json +5 -14
  422. package/vite.config.browser.ts +3 -42
  423. package/vitest.config.integration.ts +11 -0
  424. package/browser/bufferutils.d.ts +0 -34
  425. package/browser/chunks/crypto-BhCpKpek.js +0 -2033
  426. package/browser/chunks/payments-yjA0Evsv.js +0 -1089
  427. package/browser/chunks/psbt-URK2hBFc.js +0 -4039
  428. package/browser/chunks/script-DyPItFEl.js +0 -318
  429. package/browser/chunks/transaction-C_UbhMGn.js +0 -432
  430. package/browser/chunks/utils-DNZi-T5W.js +0 -761
  431. package/browser/ecc_lib.d.ts +0 -3
  432. package/browser/hooks/AdvancedSignatureManager.d.ts +0 -16
  433. package/browser/hooks/HookedSigner.d.ts +0 -4
  434. package/browser/hooks/SignatureManager.d.ts +0 -13
  435. package/browser/payments/lazy.d.ts +0 -2
  436. package/browser/typeforce.d.ts +0 -38
  437. package/build/bufferutils.d.ts +0 -34
  438. package/build/bufferutils.js +0 -141
  439. package/build/ecc_lib.d.ts +0 -3
  440. package/build/ecc_lib.js +0 -61
  441. package/build/hooks/AdvancedSignatureManager.d.ts +0 -16
  442. package/build/hooks/AdvancedSignatureManager.js +0 -52
  443. package/build/hooks/HookedSigner.d.ts +0 -4
  444. package/build/hooks/HookedSigner.js +0 -64
  445. package/build/hooks/SignatureManager.d.ts +0 -13
  446. package/build/hooks/SignatureManager.js +0 -45
  447. package/build/payments/lazy.d.ts +0 -2
  448. package/build/payments/lazy.js +0 -28
  449. package/build/tsconfig.tsbuildinfo +0 -1
  450. package/src/bufferutils.ts +0 -188
  451. package/src/ecc_lib.ts +0 -94
  452. package/src/hooks/AdvancedSignatureManager.ts +0 -104
  453. package/src/hooks/HookedSigner.ts +0 -108
  454. package/src/hooks/SignatureManager.ts +0 -84
  455. package/src/payments/lazy.ts +0 -28
  456. package/src/typeforce.d.ts +0 -38
  457. package/tsconfig.webpack.json +0 -18
@@ -0,0 +1 @@
1
+ {"version":3,"file":"p2tr.d.ts","sourceRoot":"","sources":["../../src/payments/p2tr.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,EAA8B,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE1E,OAAO,EAGH,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,KAAK,cAAc,EACtB,MAAM,aAAa,CAAC;AAWrB,OAAO,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAMhG;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,IAAI;;IAEb,MAAM,CAAC,QAAQ,CAAC,IAAI,SAAoB;IAoDxC;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AAI,OAAO,IAAI,UAAU,EAAE,GAAG,SAAS,CAMtC;IAID;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,kBAAkB,CACrB,cAAc,EAAE,cAAc,EAC9B,UAAU,CAAC,EAAE,OAAO,EACpB,OAAO,CAAC,EAAE,OAAO,GAClB,IAAI;IAIP;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI;IAI5D;;;;;;OAMG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI;IAI9D;;;;;;;OAOG;IACH,MAAM,CAAC,aAAa,CAChB,SAAS,EAAE,gBAAgB,EAC3B,cAAc,CAAC,EAAE,cAAc,EAC/B,OAAO,CAAC,EAAE,OAAO,GAClB,IAAI;IA+WP;;;;OAIG;IACH,SAAS,IAAI,WAAW;CAgB3B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,WAAW,CA8BlF"}
@@ -1,2 +1,162 @@
1
- import { P2WPKHPayment, PaymentOpts } from './types.js';
1
+ import { Network } from '../networks.js';
2
+ import { Bytes20, PublicKey, Script, Signature } from '../types.js';
3
+ import { PaymentType, P2WPKHPayment, PaymentOpts } from './types.js';
4
+ /**
5
+ * Pay-to-Witness-Public-Key-Hash (P2WPKH) payment class.
6
+ *
7
+ * Creates locking scripts of the form: `OP_0 {hash160(pubkey)}`
8
+ * Spending witness: `[{signature}, {pubkey}]`
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * import { P2WPKH } from '@btc-vision/bitcoin';
13
+ *
14
+ * // Create from public key
15
+ * const payment = P2WPKH.fromPubkey(pubkey);
16
+ * console.log(payment.address); // bc1q... bech32 address
17
+ * console.log(payment.output); // scriptPubKey
18
+ *
19
+ * // Create from bech32 address
20
+ * const fromAddr = P2WPKH.fromAddress('bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4');
21
+ * console.log(fromAddr.hash); // 20-byte witness program
22
+ * ```
23
+ */
24
+ export declare class P2WPKH {
25
+ #private;
26
+ static readonly NAME: "p2wpkh";
27
+ /**
28
+ * Creates a new P2WPKH payment instance.
29
+ *
30
+ * @param params - Payment parameters
31
+ * @param params.address - Bech32 encoded address
32
+ * @param params.hash - 20-byte witness program (pubkey hash)
33
+ * @param params.pubkey - The public key (must be 33 bytes compressed)
34
+ * @param params.signature - DER-encoded signature
35
+ * @param params.output - The scriptPubKey
36
+ * @param params.witness - The witness stack [signature, pubkey]
37
+ * @param params.network - Network parameters (defaults to mainnet)
38
+ * @param opts - Payment options
39
+ * @param opts.validate - Whether to validate inputs (default: true)
40
+ *
41
+ * @throws {TypeError} If validation is enabled and data is invalid
42
+ */
43
+ constructor(params: {
44
+ address?: string | undefined;
45
+ hash?: Uint8Array | undefined;
46
+ pubkey?: Uint8Array | undefined;
47
+ signature?: Uint8Array | undefined;
48
+ output?: Uint8Array | undefined;
49
+ witness?: Uint8Array[] | undefined;
50
+ network?: Network | undefined;
51
+ }, opts?: PaymentOpts);
52
+ /**
53
+ * Payment type discriminant.
54
+ */
55
+ get name(): typeof PaymentType.P2WPKH;
56
+ /**
57
+ * Network parameters.
58
+ */
59
+ get network(): Network;
60
+ /**
61
+ * Bech32 encoded address (bc1q... for mainnet).
62
+ */
63
+ get address(): string | undefined;
64
+ /**
65
+ * 20-byte witness program (RIPEMD160(SHA256(pubkey))).
66
+ */
67
+ get hash(): Bytes20 | undefined;
68
+ /**
69
+ * The public key (33 bytes compressed).
70
+ */
71
+ get pubkey(): PublicKey | undefined;
72
+ /**
73
+ * The DER-encoded signature.
74
+ */
75
+ get signature(): Signature | undefined;
76
+ /**
77
+ * The scriptPubKey: `OP_0 {20-byte hash}`
78
+ */
79
+ get output(): Script | undefined;
80
+ /**
81
+ * The scriptSig (always empty for native SegWit).
82
+ */
83
+ get input(): Script | undefined;
84
+ /**
85
+ * Witness stack: `[signature, pubkey]`
86
+ */
87
+ get witness(): Uint8Array[] | undefined;
88
+ /**
89
+ * Creates a P2WPKH payment from a compressed public key.
90
+ *
91
+ * @param pubkey - The public key (must be 33 bytes compressed)
92
+ * @param network - Network parameters (defaults to mainnet)
93
+ * @returns A new P2WPKH payment instance
94
+ *
95
+ * @example
96
+ * ```typescript
97
+ * const payment = P2WPKH.fromPubkey(pubkey);
98
+ * const address = payment.address; // bc1q...
99
+ * ```
100
+ */
101
+ static fromPubkey(pubkey: PublicKey, network?: Network): P2WPKH;
102
+ /**
103
+ * Creates a P2WPKH payment from a bech32 address.
104
+ *
105
+ * @param address - Bech32 encoded address
106
+ * @param network - Network parameters (defaults to mainnet)
107
+ * @returns A new P2WPKH payment instance
108
+ *
109
+ * @example
110
+ * ```typescript
111
+ * const payment = P2WPKH.fromAddress('bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4');
112
+ * const hash = payment.hash;
113
+ * ```
114
+ */
115
+ static fromAddress(address: string, network?: Network): P2WPKH;
116
+ /**
117
+ * Creates a P2WPKH payment from a 20-byte witness program.
118
+ *
119
+ * @param hash - 20-byte witness program (pubkey hash)
120
+ * @param network - Network parameters (defaults to mainnet)
121
+ * @returns A new P2WPKH payment instance
122
+ */
123
+ static fromHash(hash: Bytes20, network?: Network): P2WPKH;
124
+ /**
125
+ * Creates a P2WPKH payment from a scriptPubKey.
126
+ *
127
+ * @param output - The scriptPubKey
128
+ * @param network - Network parameters (defaults to mainnet)
129
+ * @returns A new P2WPKH payment instance
130
+ */
131
+ static fromOutput(output: Uint8Array, network?: Network): P2WPKH;
132
+ /**
133
+ * Converts to a plain P2WPKHPayment object for backwards compatibility.
134
+ *
135
+ * @returns A P2WPKHPayment object
136
+ */
137
+ toPayment(): P2WPKHPayment;
138
+ }
139
+ /**
140
+ * Creates a Pay-to-Witness-Public-Key-Hash (P2WPKH) payment object.
141
+ *
142
+ * This is the legacy factory function for backwards compatibility.
143
+ * For new code, prefer using the P2WPKH class directly.
144
+ *
145
+ * @param a - The payment object containing the necessary data
146
+ * @param opts - Optional payment options
147
+ * @returns The P2WPKH payment object
148
+ * @throws {TypeError} If the required data is not provided or if the data is invalid
149
+ *
150
+ * @example
151
+ * ```typescript
152
+ * import { p2wpkh } from '@btc-vision/bitcoin';
153
+ *
154
+ * // Create from public key
155
+ * const payment = p2wpkh({ pubkey });
156
+ *
157
+ * // Create from address
158
+ * const fromAddr = p2wpkh({ address: 'bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4' });
159
+ * ```
160
+ */
2
161
  export declare function p2wpkh(a: Omit<P2WPKHPayment, 'name'>, opts?: PaymentOpts): P2WPKHPayment;
162
+ //# sourceMappingURL=p2wpkh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"p2wpkh.d.ts","sourceRoot":"","sources":["../../src/payments/p2wpkh.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAA8B,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG1E,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAK/E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,MAAM;;IAEf,MAAM,CAAC,QAAQ,CAAC,IAAI,WAAsB;IAoC1C;;;;;;;;;;;;;;;OAeG;gBAEC,MAAM,EAAE;QACJ,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC7B,IAAI,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;QAC9B,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;QAChC,SAAS,CAAC,EAAE,UAAU,GA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CAa7B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,aAAa,CAoBxF"}
@@ -1,2 +1,147 @@
1
- import { P2WSHPayment, PaymentOpts } from './types.js';
1
+ import { Network } from '../networks.js';
2
+ import { Bytes32, Script } from '../types.js';
3
+ import { P2WSHPayment, PaymentOpts, ScriptRedeem } from './types.js';
4
+ /**
5
+ * Pay-to-Witness-Script-Hash (P2WSH) payment class.
6
+ *
7
+ * Creates locking scripts of the form: `OP_0 {sha256(redeemScript)}`
8
+ * Spending witness: `[{redeemScriptSig...}, {redeemScript}]`
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * import { P2WSH, P2MS } from '@btc-vision/bitcoin';
13
+ *
14
+ * // Wrap a multisig in P2WSH
15
+ * const multisig = P2MS.fromPubkeys(2, [pubkey1, pubkey2, pubkey3]);
16
+ * const p2wsh = P2WSH.fromRedeem({ output: multisig.output });
17
+ * console.log(p2wsh.address); // bc1q... bech32 address
18
+ *
19
+ * // Decode an existing output
20
+ * const decoded = P2WSH.fromOutput(scriptPubKey);
21
+ * console.log(decoded.hash); // 32-byte witness program
22
+ * ```
23
+ */
24
+ export declare class P2WSH {
25
+ #private;
26
+ static readonly NAME: "p2wsh";
27
+ /**
28
+ * Creates a new P2WSH payment instance.
29
+ *
30
+ * @param params - Payment parameters
31
+ * @param params.address - Bech32 encoded address
32
+ * @param params.hash - 32-byte witness program (SHA256 of script)
33
+ * @param params.output - The scriptPubKey
34
+ * @param params.redeem - The redeem script information
35
+ * @param params.witness - The witness stack
36
+ * @param params.network - Network parameters (defaults to mainnet)
37
+ * @param opts - Payment options
38
+ * @param opts.validate - Whether to validate inputs (default: true)
39
+ *
40
+ * @throws {TypeError} If validation is enabled and data is invalid
41
+ */
42
+ constructor(params: {
43
+ address?: string | undefined;
44
+ hash?: Uint8Array | undefined;
45
+ output?: Uint8Array | undefined;
46
+ redeem?: ScriptRedeem | undefined;
47
+ witness?: Uint8Array[] | undefined;
48
+ network?: Network | undefined;
49
+ }, opts?: PaymentOpts);
50
+ /**
51
+ * Payment type discriminant.
52
+ */
53
+ get name(): string;
54
+ /**
55
+ * Network parameters.
56
+ */
57
+ get network(): Network;
58
+ /**
59
+ * Bech32 encoded address (bc1q... for mainnet).
60
+ */
61
+ get address(): string | undefined;
62
+ /**
63
+ * 32-byte witness program (SHA256 of redeem script).
64
+ */
65
+ get hash(): Bytes32 | undefined;
66
+ /**
67
+ * The scriptPubKey: `OP_0 {32-byte hash}`
68
+ */
69
+ get output(): Script | undefined;
70
+ /**
71
+ * The scriptSig (always empty for native SegWit).
72
+ */
73
+ get input(): Script | undefined;
74
+ /**
75
+ * The redeem script information.
76
+ */
77
+ get redeem(): ScriptRedeem | undefined;
78
+ /**
79
+ * Witness stack: `[{scriptSig...}, {redeemScript}]`
80
+ */
81
+ get witness(): Uint8Array[] | undefined;
82
+ /**
83
+ * Creates a P2WSH payment from a redeem script.
84
+ *
85
+ * @param redeem - The redeem script information
86
+ * @param network - Network parameters (defaults to mainnet)
87
+ * @returns A new P2WSH payment instance
88
+ *
89
+ * @example
90
+ * ```typescript
91
+ * const p2wsh = P2WSH.fromRedeem({ output: redeemScript });
92
+ * ```
93
+ */
94
+ static fromRedeem(redeem: ScriptRedeem, network?: Network): P2WSH;
95
+ /**
96
+ * Creates a P2WSH payment from a bech32 address.
97
+ *
98
+ * @param address - Bech32 encoded address
99
+ * @param network - Network parameters (defaults to mainnet)
100
+ * @returns A new P2WSH payment instance
101
+ */
102
+ static fromAddress(address: string, network?: Network): P2WSH;
103
+ /**
104
+ * Creates a P2WSH payment from a 32-byte witness program.
105
+ *
106
+ * @param hash - 32-byte witness program (SHA256 of script)
107
+ * @param network - Network parameters (defaults to mainnet)
108
+ * @returns A new P2WSH payment instance
109
+ */
110
+ static fromHash(hash: Bytes32, network?: Network): P2WSH;
111
+ /**
112
+ * Creates a P2WSH payment from a scriptPubKey.
113
+ *
114
+ * @param output - The scriptPubKey
115
+ * @param network - Network parameters (defaults to mainnet)
116
+ * @returns A new P2WSH payment instance
117
+ */
118
+ static fromOutput(output: Uint8Array, network?: Network): P2WSH;
119
+ /**
120
+ * Converts to a plain P2WSHPayment object for backwards compatibility.
121
+ *
122
+ * @returns A P2WSHPayment object
123
+ */
124
+ toPayment(): P2WSHPayment;
125
+ }
126
+ /**
127
+ * Creates a Pay-to-Witness-Script-Hash (P2WSH) payment object.
128
+ *
129
+ * This is the legacy factory function for backwards compatibility.
130
+ * For new code, prefer using the P2WSH class directly.
131
+ *
132
+ * @param a - The payment object containing the necessary data
133
+ * @param opts - Optional payment options
134
+ * @returns The P2WSH payment object
135
+ * @throws {TypeError} If the required data is not provided or if the data is invalid
136
+ *
137
+ * @example
138
+ * ```typescript
139
+ * import { p2wsh, p2ms } from '@btc-vision/bitcoin';
140
+ *
141
+ * // Wrap a multisig in P2WSH
142
+ * const multisig = p2ms({ m: 2, pubkeys: [pk1, pk2, pk3] });
143
+ * const payment = p2wsh({ redeem: multisig });
144
+ * ```
145
+ */
2
146
  export declare function p2wsh(a: Omit<P2WSHPayment, 'name'>, opts?: PaymentOpts): P2WSHPayment;
147
+ //# sourceMappingURL=p2wsh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"p2wsh.d.ts","sourceRoot":"","sources":["../../src/payments/p2wsh.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAA8B,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG1E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAe,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAejG;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,KAAK;;IAEd,MAAM,CAAC,QAAQ,C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AAU,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,KAAK;IAuP/D;;;;OAIG;IACH,SAAS,IAAI,YAAY;CAe5B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,YAAY,CAqBrF"}
@@ -1,93 +1,123 @@
1
1
  import { Network } from '../networks.js';
2
- import { Taptree } from '../types.js';
3
- export declare enum PaymentType {
4
- P2PK = "p2pk",
5
- P2PKH = "p2pkh",
6
- P2SH = "p2sh",
7
- P2MS = "p2ms",
8
- P2WPKH = "p2wpkh",
9
- P2WSH = "p2wsh",
10
- P2TR = "p2tr",
11
- P2OP = "p2op",
12
- Embed = "embed",
13
- ScriptRedeem = "scriptRedeem"
14
- }
2
+ import { Bytes20, Bytes32, PublicKey, Script, Signature, SchnorrSignature, Taptree, XOnlyPublicKey } from '../types.js';
3
+ export declare const PaymentType: {
4
+ readonly P2PK: "p2pk";
5
+ readonly P2PKH: "p2pkh";
6
+ readonly P2SH: "p2sh";
7
+ readonly P2MS: "p2ms";
8
+ readonly P2WPKH: "p2wpkh";
9
+ readonly P2WSH: "p2wsh";
10
+ readonly P2TR: "p2tr";
11
+ readonly P2OP: "p2op";
12
+ readonly Embed: "embed";
13
+ readonly ScriptRedeem: "scriptRedeem";
14
+ };
15
+ export type PaymentType = (typeof PaymentType)[keyof typeof PaymentType];
15
16
  export interface BasePayment {
16
- name?: PaymentType;
17
- network?: Network;
18
- output?: Buffer;
19
- input?: Buffer;
20
- address?: string;
21
- witness?: Buffer[];
22
- redeem?: ScriptRedeem;
23
- useHybrid?: boolean;
24
- useUncompressed?: boolean;
17
+ /** Convenience label, also the discriminant for the union. Can be dynamic for nested types. */
18
+ readonly name?: string | undefined;
19
+ /** Network parameters (mainnet if omitted). */
20
+ readonly network?: Network | undefined;
21
+ /** Fully-assembled scriptPubKey (if already known). */
22
+ readonly output?: Script | undefined;
23
+ /** Raw scriptSig (legacy script types only). */
24
+ readonly input?: Script | undefined;
25
+ /** Human-readable address (if already known). */
26
+ readonly address?: string | undefined;
27
+ /** Segwit stack (empty for legacy). */
28
+ readonly witness?: Uint8Array[] | undefined;
29
+ /** Script template for P2SH, P2WSH, P2TR, etc. */
30
+ readonly redeem?: ScriptRedeem | undefined;
31
+ /** Non-standard options used by some wallets. */
32
+ readonly useHybrid?: boolean | undefined;
33
+ readonly useUncompressed?: boolean | undefined;
25
34
  }
35
+ /** Helper used by redeeming script-template outputs (P2SH, P2WSH). */
26
36
  export interface ScriptRedeem extends BasePayment {
27
- output?: Buffer;
28
- redeemVersion?: number;
29
- network?: Network;
37
+ readonly output?: Script | undefined;
38
+ readonly redeemVersion?: number | undefined;
39
+ readonly network?: Network | undefined;
30
40
  }
31
41
  export interface P2PKPayment extends BasePayment {
32
- name: PaymentType.P2PK;
33
- pubkey?: Buffer;
34
- signature?: Buffer;
42
+ readonly name: typeof PaymentType.P2PK;
43
+ readonly pubkey?: PublicKey | undefined;
44
+ /** DER-encoded sig – empty until signed. */
45
+ readonly signature?: Signature | undefined;
35
46
  }
36
47
  export interface P2PKHPayment extends BasePayment {
37
- name: PaymentType.P2PKH;
38
- hash?: Buffer;
39
- pubkey?: Buffer;
40
- signature?: Buffer;
48
+ readonly name: typeof PaymentType.P2PKH;
49
+ /** RIPEMD-160(SHA-256(pubkey)) – 20 bytes. */
50
+ readonly hash?: Bytes20 | undefined;
51
+ readonly pubkey?: PublicKey | undefined;
52
+ readonly signature?: Signature | undefined;
41
53
  }
42
54
  export interface P2SHPayment extends BasePayment {
43
- name: PaymentType.P2SH;
44
- hash?: Buffer;
45
- signatures?: Buffer[];
55
+ /** Dynamic name like 'p2sh' or 'p2sh-p2wpkh' for nested types */
56
+ readonly name: string;
57
+ /** Hash160 of a redeem script. */
58
+ readonly hash?: Bytes20 | undefined;
59
+ /** The entire signature stack when spending a P2SH (non-segwit). */
60
+ readonly signatures?: Uint8Array[] | undefined;
46
61
  }
47
62
  export interface P2MSPayment extends BasePayment {
48
- name: PaymentType.P2MS;
49
- m?: number;
50
- n?: number;
51
- pubkeys?: Buffer[];
52
- signatures?: Buffer[];
63
+ /** Dynamic name like 'p2ms' or 'p2ms(2 of 3)' with M-of-N parameters */
64
+ readonly name: string;
65
+ /** M-of-N parameters. */
66
+ readonly m?: number | undefined;
67
+ readonly n?: number | undefined;
68
+ readonly pubkeys?: PublicKey[] | undefined;
69
+ readonly signatures?: Signature[] | undefined;
53
70
  }
54
71
  export interface P2WPKHPayment extends BasePayment {
55
- name: PaymentType.P2WPKH;
56
- hash?: Buffer;
57
- pubkey?: Buffer;
58
- signature?: Buffer;
72
+ readonly name: typeof PaymentType.P2WPKH;
73
+ /** 20-byte witness program. */
74
+ readonly hash?: Bytes20 | undefined;
75
+ readonly pubkey?: PublicKey | undefined;
76
+ readonly signature?: Signature | undefined;
59
77
  }
60
78
  export interface P2WSHPayment extends BasePayment {
61
- name: PaymentType.P2WSH;
62
- hash?: Buffer;
63
- redeem?: ScriptRedeem;
79
+ /** Dynamic name like 'p2wsh' or 'p2wsh-p2pk' for nested types */
80
+ readonly name: string;
81
+ /** 32-byte witness program. */
82
+ readonly hash?: Bytes32 | undefined;
83
+ readonly redeem?: ScriptRedeem | undefined;
64
84
  }
65
85
  export interface P2TRPayment extends BasePayment {
66
- name: PaymentType.P2TR;
67
- pubkey?: Buffer;
68
- internalPubkey?: Buffer;
69
- hash?: Buffer;
70
- scriptTree?: Taptree;
71
- signature?: Buffer;
72
- redeemVersion?: number;
73
- redeem?: ScriptRedeem;
86
+ readonly name: typeof PaymentType.P2TR;
87
+ /** x-only pubkey that commits to the tree. */
88
+ readonly pubkey?: XOnlyPublicKey | undefined;
89
+ /** Internal (untweaked) x-only pubkey. */
90
+ readonly internalPubkey?: XOnlyPublicKey | undefined;
91
+ /** Merkle-root tweak, present when a script path exists. */
92
+ readonly hash?: Bytes32 | undefined;
93
+ /** Full taptree description (optional, dev-side). */
94
+ readonly scriptTree?: Taptree | undefined;
95
+ /** Key-path sig or leading stack elem. */
96
+ readonly signature?: SchnorrSignature | undefined;
97
+ readonly redeemVersion?: number | undefined;
98
+ readonly redeem?: ScriptRedeem | undefined;
74
99
  }
75
100
  export interface P2OPPayment extends BasePayment {
76
- name: PaymentType.P2OP;
77
- program?: Buffer;
78
- deploymentVersion: number | undefined;
79
- hash160?: Buffer;
101
+ readonly name: typeof PaymentType.P2OP;
102
+ /** <deploymentVersion || HASH160(payload)> (2–40 bytes). */
103
+ readonly program?: Uint8Array | undefined;
104
+ readonly deploymentVersion?: number | undefined;
105
+ /** Convenience slice of `program` (20 bytes for current spec). */
106
+ readonly hash160?: Bytes20 | undefined;
80
107
  }
81
108
  export interface P2OPPaymentParams extends Omit<P2OPPayment, 'name' | 'deploymentVersion'> {
82
- deploymentVersion?: number;
109
+ readonly deploymentVersion?: number | undefined;
83
110
  }
111
+ /** OP_RETURN data-carrying output */
84
112
  export interface EmbedPayment extends BasePayment {
85
- name: PaymentType.Embed;
86
- data: Buffer[];
113
+ readonly name: typeof PaymentType.Embed;
114
+ /** Raw pushed chunks after OP_RETURN. */
115
+ readonly data: Uint8Array[];
87
116
  }
88
117
  export type Payment = P2PKPayment | P2PKHPayment | P2SHPayment | P2MSPayment | P2WPKHPayment | P2WSHPayment | P2TRPayment | P2OPPayment | EmbedPayment | ScriptRedeem;
89
118
  export type PaymentCreator = <T extends BasePayment>(a: T, opts?: PaymentOpts) => T;
90
119
  export interface PaymentOpts {
91
- validate?: boolean;
92
- allowIncomplete?: boolean;
120
+ readonly validate?: boolean;
121
+ readonly allowIncomplete?: boolean;
93
122
  }
123
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/payments/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MA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,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChD,kEAAkE;IAClE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC1C;AAED,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,mBAAmB,CAAC;IACtF,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACnD;AAED,qCAAqC;AACrC,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,EAAE,OAAO,WAAW,CAAC,KAAK,CAAC;IACxC,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC;CAE/B;AAED,MAAM,MAAM,OAAO,GACb,WAAW,GACX,YAAY,GACZ,WAAW,GACX,WAAW,GACX,aAAa,GACb,YAAY,GACZ,WAAW,GACX,WAAW,GACX,YAAY,GACZ,YAAY,CAAC;AAEnB,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,CAAC,CAAC;AAEpF,MAAM,WAAW,WAAW;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CACtC"}
@@ -1,19 +1,45 @@
1
- import { PsbtInput, PsbtOutput, TapLeaf } from 'bip174/src/lib/interfaces.js';
1
+ import { PsbtInput, PsbtOutput, TapLeaf } from 'bip174';
2
2
  import { Taptree } from '../types.js';
3
3
  interface PsbtOutputWithScript extends PsbtOutput {
4
- script?: Buffer;
4
+ script?: Uint8Array;
5
5
  }
6
- export declare function tapScriptFinalizer(inputIndex: number, input: PsbtInput, tapLeafHashToFinalize?: Buffer): {
7
- finalScriptWitness: Buffer | undefined;
6
+ /**
7
+ * Default tapscript finalizer. It searches for the `tapLeafHashToFinalize` if provided.
8
+ * Otherwise it will search for the tapleaf that has at least one signature and has the shortest path.
9
+ * @param inputIndex the position of the PSBT input.
10
+ * @param input the PSBT input.
11
+ * @param tapLeafHashToFinalize optional, if provided the finalizer will search for a tapleaf that has this hash
12
+ * and will try to build the finalScriptWitness.
13
+ * @returns the finalScriptWitness or throws an exception if no tapleaf found.
14
+ */
15
+ export declare function tapScriptFinalizer(inputIndex: number, input: PsbtInput, tapLeafHashToFinalize?: Uint8Array): {
16
+ finalScriptWitness: Uint8Array | undefined;
8
17
  };
9
- export declare function serializeTaprootSignature(sig: Buffer, sighashType?: number): Buffer;
18
+ export declare function serializeTaprootSignature(sig: Uint8Array, sighashType?: number): Uint8Array;
10
19
  export declare function isTaprootInput(input: PsbtInput): boolean;
11
- export declare function isTaprootOutput(output: PsbtOutput, script?: Buffer): boolean;
20
+ export declare function isTaprootOutput(output: PsbtOutput, script?: Uint8Array): boolean;
12
21
  export declare function checkTaprootInputFields(inputData: PsbtInput, newInputData: PsbtInput, action: string): void;
13
22
  export declare function checkTaprootOutputFields(outputData: PsbtOutputWithScript, newOutputData: PsbtOutput, action: string): void;
14
- export declare function tweakInternalPubKey(inputIndex: number, input: PsbtInput): Buffer;
23
+ export declare function tweakInternalPubKey(inputIndex: number, input: PsbtInput): Uint8Array;
24
+ /**
25
+ * Convert a binary tree to a BIP371 type list. Each element of the list is (according to BIP371):
26
+ * One or more tuples representing the depth, leaf version, and script for a leaf in the Taproot tree,
27
+ * allowing the entire tree to be reconstructed. The tuples must be in depth first search order so that
28
+ * the tree is correctly reconstructed.
29
+ * @param tree the binary tap tree
30
+ * @returns a list of BIP 371 tapleaves
31
+ */
15
32
  export declare function tapTreeToList(tree: Taptree): TapLeaf[];
33
+ /**
34
+ * Convert a BIP371 TapLeaf list to a TapTree (binary).
35
+ * @param leaves a list of tapleaves where each element of the list is (according to BIP371):
36
+ * One or more tuples representing the depth, leaf version, and script for a leaf in the Taproot tree,
37
+ * allowing the entire tree to be reconstructed. The tuples must be in depth first search order so that
38
+ * the tree is correctly reconstructed.
39
+ * @returns the corresponding taptree, or throws an exception if the tree cannot be reconstructed
40
+ */
16
41
  export declare function tapTreeFromList(leaves?: TapLeaf[]): Taptree;
17
42
  export declare function checkTaprootInputForSigs(input: PsbtInput, action: string): boolean;
18
- export declare function getTapKeySigFromWitness(finalScriptWitness?: Buffer): Buffer | undefined;
43
+ export declare function getTapKeySigFromWitness(finalScriptWitness?: Uint8Array): Uint8Array | undefined;
19
44
  export {};
45
+ //# sourceMappingURL=bip371.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bip371.d.ts","sourceRoot":"","sources":["../../src/psbt/bip371.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,SAAS,EACT,UAAU,EAEV,OAAO,EAIV,MAAM,QAAQ,CAAC;AAWhB,OAAO,KAAK,EAAW,OAAO,EAA2B,MAAM,aAAa,CAAC;AAS7E,UAAU,oBAAqB,SAAQ,UAAU;IAC7C,MAAM,CAAC,EAAE,UAAU,CAAC;CACvB;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAC9B,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,SAAS,EAChB,qBAAqB,CAAC,EAAE,UAAU,GACnC;IACC,kBAAkB,EAAE,UAAU,GAAG,SAAS,CAAC;CAC9C,CAYA;AAED,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,UAAU,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,CAI3F;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAWxD;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO,CAUhF;AAED,wBAAgB,uBAAuB,CACnC,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,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