@btc-vision/transaction 1.8.0-beta.3 → 1.8.0-beta.5

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 (764) hide show
  1. package/browser/_version.d.ts +1 -0
  2. package/browser/_version.d.ts.map +1 -0
  3. package/browser/abi/ABICoder.d.ts +1 -1
  4. package/browser/abi/ABICoder.d.ts.map +1 -0
  5. package/browser/branded/Branded.d.ts +4 -0
  6. package/browser/branded/Branded.d.ts.map +1 -0
  7. package/browser/btc-vision-bitcoin.js +11999 -2647
  8. package/browser/buffer/BinaryReader.d.ts +120 -1
  9. package/browser/buffer/BinaryReader.d.ts.map +1 -0
  10. package/browser/buffer/BinaryWriter.d.ts +51 -1
  11. package/browser/buffer/BinaryWriter.d.ts.map +1 -0
  12. package/browser/bytecode/Compressor.d.ts +12 -0
  13. package/browser/bytecode/Compressor.d.ts.map +1 -0
  14. package/browser/chain/ChainData.d.ts +2 -2
  15. package/browser/chain/ChainData.d.ts.map +1 -0
  16. package/browser/consensus/Consensus.d.ts +11 -3
  17. package/browser/consensus/Consensus.d.ts.map +1 -0
  18. package/browser/consensus/ConsensusConfig.d.ts +1 -0
  19. package/browser/consensus/ConsensusConfig.d.ts.map +1 -0
  20. package/browser/consensus/IConsensusConfig.d.ts +1 -0
  21. package/browser/consensus/IConsensusConfig.d.ts.map +1 -0
  22. package/browser/consensus/metadata/RoswellConsensus.d.ts +1 -0
  23. package/browser/consensus/metadata/RoswellConsensus.d.ts.map +1 -0
  24. package/browser/crypto/crypto.d.ts +1 -0
  25. package/browser/crypto/crypto.d.ts.map +1 -0
  26. package/browser/deterministic/AddressMap.d.ts +6 -1
  27. package/browser/deterministic/AddressMap.d.ts.map +1 -0
  28. package/browser/deterministic/AddressSet.d.ts +3 -1
  29. package/browser/deterministic/AddressSet.d.ts.map +1 -0
  30. package/browser/deterministic/CustomMap.d.ts +3 -1
  31. package/browser/deterministic/CustomMap.d.ts.map +1 -0
  32. package/browser/deterministic/DeterministicMap.d.ts +3 -1
  33. package/browser/deterministic/DeterministicMap.d.ts.map +1 -0
  34. package/browser/deterministic/DeterministicSet.d.ts +3 -1
  35. package/browser/deterministic/DeterministicSet.d.ts.map +1 -0
  36. package/browser/deterministic/ExtendedAddressMap.d.ts +7 -1
  37. package/browser/deterministic/ExtendedAddressMap.d.ts.map +1 -0
  38. package/browser/deterministic/FastMap.d.ts +7 -1
  39. package/browser/deterministic/FastMap.d.ts.map +1 -0
  40. package/browser/ecc/backend.d.ts +13 -0
  41. package/browser/ecc/backend.d.ts.map +1 -0
  42. package/browser/epoch/ChallengeSolution.d.ts +33 -1
  43. package/browser/epoch/ChallengeSolution.d.ts.map +1 -0
  44. package/browser/epoch/interfaces/IChallengeSolution.d.ts +14 -13
  45. package/browser/epoch/interfaces/IChallengeSolution.d.ts.map +1 -0
  46. package/browser/epoch/validator/EpochValidator.d.ts +37 -7
  47. package/browser/epoch/validator/EpochValidator.d.ts.map +1 -0
  48. package/browser/event/NetEvent.d.ts +1 -0
  49. package/browser/event/NetEvent.d.ts.map +1 -0
  50. package/browser/generators/AddressGenerator.d.ts +4 -3
  51. package/browser/generators/AddressGenerator.d.ts.map +1 -0
  52. package/browser/generators/Features.d.ts +1 -0
  53. package/browser/generators/Features.d.ts.map +1 -0
  54. package/browser/generators/Generator.d.ts +46 -10
  55. package/browser/generators/Generator.d.ts.map +1 -0
  56. package/browser/generators/MLDSAData.d.ts +1 -0
  57. package/browser/generators/MLDSAData.d.ts.map +1 -0
  58. package/browser/generators/builders/CalldataGenerator.d.ts +25 -4
  59. package/browser/generators/builders/CalldataGenerator.d.ts.map +1 -0
  60. package/browser/generators/builders/CustomGenerator.d.ts +13 -3
  61. package/browser/generators/builders/CustomGenerator.d.ts.map +1 -0
  62. package/browser/generators/builders/DeploymentGenerator.d.ts +15 -4
  63. package/browser/generators/builders/DeploymentGenerator.d.ts.map +1 -0
  64. package/browser/generators/builders/HashCommitmentGenerator.d.ts +164 -12
  65. package/browser/generators/builders/HashCommitmentGenerator.d.ts.map +1 -0
  66. package/browser/generators/builders/LegacyCalldataGenerator.d.ts +26 -4
  67. package/browser/generators/builders/LegacyCalldataGenerator.d.ts.map +1 -0
  68. package/browser/generators/builders/MultiSignGenerator.d.ts +6 -1
  69. package/browser/generators/builders/MultiSignGenerator.d.ts.map +1 -0
  70. package/browser/generators/builders/P2WDAGenerator.d.ts +42 -4
  71. package/browser/generators/builders/P2WDAGenerator.d.ts.map +1 -0
  72. package/browser/index.d.ts +1 -0
  73. package/browser/index.d.ts.map +1 -0
  74. package/browser/index.js +3558 -3167
  75. package/browser/keypair/Address.d.ts +283 -13
  76. package/browser/keypair/Address.d.ts.map +1 -0
  77. package/browser/keypair/AddressVerificator.d.ts +7 -6
  78. package/browser/keypair/AddressVerificator.d.ts.map +1 -0
  79. package/browser/keypair/EcKeyPair.d.ts +183 -21
  80. package/browser/keypair/EcKeyPair.d.ts.map +1 -0
  81. package/browser/keypair/MessageSigner.d.ts +17 -16
  82. package/browser/keypair/MessageSigner.d.ts.map +1 -0
  83. package/browser/keypair/Secp256k1PointDeriver.d.ts +55 -0
  84. package/browser/keypair/Secp256k1PointDeriver.d.ts.map +1 -0
  85. package/browser/keypair/Wallet.d.ts +27 -13
  86. package/browser/keypair/Wallet.d.ts.map +1 -0
  87. package/browser/keypair/interfaces/IWallet.d.ts +19 -0
  88. package/browser/keypair/interfaces/IWallet.d.ts.map +1 -0
  89. package/browser/metadata/ContractBaseMetadata.d.ts +10 -2
  90. package/browser/metadata/ContractBaseMetadata.d.ts.map +1 -0
  91. package/browser/mnemonic/BIPStandard.d.ts +59 -0
  92. package/browser/mnemonic/BIPStandard.d.ts.map +1 -0
  93. package/browser/mnemonic/Mnemonic.d.ts +15 -3
  94. package/browser/mnemonic/Mnemonic.d.ts.map +1 -0
  95. package/browser/mnemonic/MnemonicStrength.d.ts +6 -0
  96. package/browser/mnemonic/MnemonicStrength.d.ts.map +1 -0
  97. package/browser/network/ChainId.d.ts +1 -0
  98. package/browser/network/ChainId.d.ts.map +1 -0
  99. package/browser/noble-curves.js +844 -2746
  100. package/browser/noble-hashes.js +1338 -2067
  101. package/browser/opnet.d.ts +22 -1
  102. package/browser/opnet.d.ts.map +1 -0
  103. package/browser/p2wda/P2WDADetector.d.ts +36 -9
  104. package/browser/p2wda/P2WDADetector.d.ts.map +1 -0
  105. package/browser/polyfill/disposable.d.ts +16 -0
  106. package/browser/polyfill/disposable.d.ts.map +1 -0
  107. package/browser/signer/AddressRotation.d.ts +36 -0
  108. package/browser/signer/AddressRotation.d.ts.map +1 -0
  109. package/browser/signer/IRotationSigner.d.ts +27 -3
  110. package/browser/signer/IRotationSigner.d.ts.map +1 -0
  111. package/browser/signer/ParallelSignerAdapter.d.ts +14 -0
  112. package/browser/signer/ParallelSignerAdapter.d.ts.map +1 -0
  113. package/browser/signer/SignerUtils.d.ts +11 -4
  114. package/browser/signer/SignerUtils.d.ts.map +1 -0
  115. package/browser/signer/TweakedSigner.d.ts +28 -4
  116. package/browser/signer/TweakedSigner.d.ts.map +1 -0
  117. package/browser/transaction/ContractAddress.d.ts +2 -2
  118. package/browser/transaction/ContractAddress.d.ts.map +1 -0
  119. package/browser/transaction/TransactionFactory.d.ts +140 -2
  120. package/browser/transaction/TransactionFactory.d.ts.map +1 -0
  121. package/browser/transaction/browser/BrowserSignerBase.d.ts +12 -6
  122. package/browser/transaction/browser/BrowserSignerBase.d.ts.map +1 -0
  123. package/browser/transaction/browser/WalletNetworks.d.ts +1 -0
  124. package/browser/transaction/browser/WalletNetworks.d.ts.map +1 -0
  125. package/browser/transaction/browser/Web3Provider.d.ts +27 -0
  126. package/browser/transaction/browser/Web3Provider.d.ts.map +1 -0
  127. package/browser/transaction/browser/extensions/UnisatSigner.d.ts +9 -7
  128. package/browser/transaction/browser/extensions/UnisatSigner.d.ts.map +1 -0
  129. package/browser/transaction/browser/extensions/XverseSigner.d.ts +9 -7
  130. package/browser/transaction/browser/extensions/XverseSigner.d.ts.map +1 -0
  131. package/browser/transaction/browser/types/OPWallet.d.ts +10 -0
  132. package/browser/transaction/browser/types/OPWallet.d.ts.map +1 -0
  133. package/browser/transaction/browser/types/Unisat.d.ts +1 -0
  134. package/browser/transaction/browser/types/Unisat.d.ts.map +1 -0
  135. package/browser/transaction/browser/types/Xverse.d.ts +1 -0
  136. package/browser/transaction/browser/types/Xverse.d.ts.map +1 -0
  137. package/browser/transaction/builders/CancelTransaction.d.ts +29 -4
  138. package/browser/transaction/builders/CancelTransaction.d.ts.map +1 -0
  139. package/browser/transaction/builders/ChallengeSolutionTransaction.d.ts +1 -0
  140. package/browser/transaction/builders/ChallengeSolutionTransaction.d.ts.map +1 -0
  141. package/browser/transaction/builders/ConsolidatedInteractionTransaction.d.ts +137 -10
  142. package/browser/transaction/builders/ConsolidatedInteractionTransaction.d.ts.map +1 -0
  143. package/browser/transaction/builders/CustomScriptTransaction.d.ts +106 -6
  144. package/browser/transaction/builders/CustomScriptTransaction.d.ts.map +1 -0
  145. package/browser/transaction/builders/DeploymentTransaction.d.ts +116 -5
  146. package/browser/transaction/builders/DeploymentTransaction.d.ts.map +1 -0
  147. package/browser/transaction/builders/FundingTransaction.d.ts +4 -3
  148. package/browser/transaction/builders/FundingTransaction.d.ts.map +1 -0
  149. package/browser/transaction/builders/InteractionTransaction.d.ts +12 -3
  150. package/browser/transaction/builders/InteractionTransaction.d.ts.map +1 -0
  151. package/browser/transaction/builders/InteractionTransactionP2WDA.d.ts +56 -5
  152. package/browser/transaction/builders/InteractionTransactionP2WDA.d.ts.map +1 -0
  153. package/browser/transaction/builders/MultiSignTransaction.d.ts +125 -16
  154. package/browser/transaction/builders/MultiSignTransaction.d.ts.map +1 -0
  155. package/browser/transaction/builders/SharedInteractionTransaction.d.ts +103 -15
  156. package/browser/transaction/builders/SharedInteractionTransaction.d.ts.map +1 -0
  157. package/browser/transaction/builders/TransactionBuilder.d.ts +243 -14
  158. package/browser/transaction/builders/TransactionBuilder.d.ts.map +1 -0
  159. package/browser/transaction/enums/TransactionType.d.ts +1 -0
  160. package/browser/transaction/enums/TransactionType.d.ts.map +1 -0
  161. package/browser/transaction/interfaces/ICancelTransactionParameters.d.ts +2 -1
  162. package/browser/transaction/interfaces/ICancelTransactionParameters.d.ts.map +1 -0
  163. package/browser/transaction/interfaces/IConsolidatedTransactionParameters.d.ts +46 -3
  164. package/browser/transaction/interfaces/IConsolidatedTransactionParameters.d.ts.map +1 -0
  165. package/browser/transaction/interfaces/ICustomTransactionParameters.d.ts +6 -4
  166. package/browser/transaction/interfaces/ICustomTransactionParameters.d.ts.map +1 -0
  167. package/browser/transaction/interfaces/ITransactionParameters.d.ts +22 -10
  168. package/browser/transaction/interfaces/ITransactionParameters.d.ts.map +1 -0
  169. package/browser/transaction/interfaces/ITransactionResponses.d.ts +1 -0
  170. package/browser/transaction/interfaces/ITransactionResponses.d.ts.map +1 -0
  171. package/browser/transaction/interfaces/ITweakedTransactionData.d.ts +17 -5
  172. package/browser/transaction/interfaces/ITweakedTransactionData.d.ts.map +1 -0
  173. package/browser/transaction/interfaces/IWeb3ProviderTypes.d.ts +26 -0
  174. package/browser/transaction/interfaces/IWeb3ProviderTypes.d.ts.map +1 -0
  175. package/browser/transaction/interfaces/Tap.d.ts +4 -3
  176. package/browser/transaction/interfaces/Tap.d.ts.map +1 -0
  177. package/browser/transaction/mineable/IP2WSHAddress.d.ts +2 -1
  178. package/browser/transaction/mineable/IP2WSHAddress.d.ts.map +1 -0
  179. package/browser/transaction/mineable/TimelockGenerator.d.ts +12 -3
  180. package/browser/transaction/mineable/TimelockGenerator.d.ts.map +1 -0
  181. package/browser/transaction/offline/OfflineTransactionManager.d.ts +190 -9
  182. package/browser/transaction/offline/OfflineTransactionManager.d.ts.map +1 -0
  183. package/browser/transaction/offline/TransactionReconstructor.d.ts +53 -3
  184. package/browser/transaction/offline/TransactionReconstructor.d.ts.map +1 -0
  185. package/browser/transaction/offline/TransactionSerializer.d.ts +53 -2
  186. package/browser/transaction/offline/TransactionSerializer.d.ts.map +1 -0
  187. package/browser/transaction/offline/TransactionStateCapture.d.ts +64 -5
  188. package/browser/transaction/offline/TransactionStateCapture.d.ts.map +1 -0
  189. package/browser/transaction/offline/interfaces/ISerializableState.d.ts +71 -0
  190. package/browser/transaction/offline/interfaces/ISerializableState.d.ts.map +1 -0
  191. package/browser/transaction/offline/interfaces/ITypeSpecificData.d.ts +76 -0
  192. package/browser/transaction/offline/interfaces/ITypeSpecificData.d.ts.map +1 -0
  193. package/browser/transaction/psbt/PSBTTypes.d.ts +1 -0
  194. package/browser/transaction/psbt/PSBTTypes.d.ts.map +1 -0
  195. package/browser/transaction/shared/P2TR_MS.d.ts +11 -2
  196. package/browser/transaction/shared/P2TR_MS.d.ts.map +1 -0
  197. package/browser/transaction/shared/TweakedTransaction.d.ts +274 -33
  198. package/browser/transaction/shared/TweakedTransaction.d.ts.map +1 -0
  199. package/browser/transaction/utils/WitnessUtils.d.ts +7 -1
  200. package/browser/transaction/utils/WitnessUtils.d.ts.map +1 -0
  201. package/browser/utils/BitcoinUtils.d.ts +19 -0
  202. package/browser/utils/BitcoinUtils.d.ts.map +1 -0
  203. package/browser/utils/BufferHelper.d.ts +1 -0
  204. package/browser/utils/BufferHelper.d.ts.map +1 -0
  205. package/browser/utils/StringToBuffer.d.ts +1 -0
  206. package/browser/utils/StringToBuffer.d.ts.map +1 -0
  207. package/browser/utils/lengths.d.ts +1 -0
  208. package/browser/utils/lengths.d.ts.map +1 -0
  209. package/browser/utils/types.d.ts +1 -0
  210. package/browser/utils/types.d.ts.map +1 -0
  211. package/browser/utxo/OPNetLimitedProvider.d.ts +37 -1
  212. package/browser/utxo/OPNetLimitedProvider.d.ts.map +1 -0
  213. package/browser/utxo/interfaces/BroadcastResponse.d.ts +1 -0
  214. package/browser/utxo/interfaces/BroadcastResponse.d.ts.map +1 -0
  215. package/browser/utxo/interfaces/IUTXO.d.ts +11 -5
  216. package/browser/utxo/interfaces/IUTXO.d.ts.map +1 -0
  217. package/browser/vendors.js +14351 -10031
  218. package/browser/verification/TapscriptVerificator.d.ts +10 -8
  219. package/browser/verification/TapscriptVerificator.d.ts.map +1 -0
  220. package/build/_version.d.ts +1 -0
  221. package/build/_version.d.ts.map +1 -0
  222. package/build/_version.js +1 -0
  223. package/build/_version.js.map +1 -0
  224. package/build/abi/ABICoder.d.ts +1 -1
  225. package/build/abi/ABICoder.d.ts.map +1 -0
  226. package/build/abi/ABICoder.js +9 -10
  227. package/build/abi/ABICoder.js.map +1 -0
  228. package/build/branded/Branded.d.ts +4 -0
  229. package/build/branded/Branded.d.ts.map +1 -0
  230. package/build/branded/Branded.js +2 -0
  231. package/build/branded/Branded.js.map +1 -0
  232. package/build/buffer/BinaryReader.d.ts +121 -2
  233. package/build/buffer/BinaryReader.d.ts.map +1 -0
  234. package/build/buffer/BinaryReader.js +129 -5
  235. package/build/buffer/BinaryReader.js.map +1 -0
  236. package/build/buffer/BinaryWriter.d.ts +52 -2
  237. package/build/buffer/BinaryWriter.d.ts.map +1 -0
  238. package/build/buffer/BinaryWriter.js +62 -2
  239. package/build/buffer/BinaryWriter.js.map +1 -0
  240. package/build/bytecode/Compressor.d.ts +12 -0
  241. package/build/bytecode/Compressor.d.ts.map +1 -0
  242. package/build/bytecode/Compressor.js +17 -5
  243. package/build/bytecode/Compressor.js.map +1 -0
  244. package/build/chain/ChainData.d.ts +2 -2
  245. package/build/chain/ChainData.d.ts.map +1 -0
  246. package/build/chain/ChainData.js +35 -17
  247. package/build/chain/ChainData.js.map +1 -0
  248. package/build/consensus/Consensus.d.ts +11 -3
  249. package/build/consensus/Consensus.d.ts.map +1 -0
  250. package/build/consensus/Consensus.js +8 -0
  251. package/build/consensus/Consensus.js.map +1 -0
  252. package/build/consensus/ConsensusConfig.d.ts +2 -1
  253. package/build/consensus/ConsensusConfig.d.ts.map +1 -0
  254. package/build/consensus/ConsensusConfig.js +1 -0
  255. package/build/consensus/ConsensusConfig.js.map +1 -0
  256. package/build/consensus/IConsensusConfig.d.ts +1 -0
  257. package/build/consensus/IConsensusConfig.d.ts.map +1 -0
  258. package/build/consensus/IConsensusConfig.js +2 -1
  259. package/build/consensus/IConsensusConfig.js.map +1 -0
  260. package/build/consensus/metadata/RoswellConsensus.d.ts +2 -1
  261. package/build/consensus/metadata/RoswellConsensus.d.ts.map +1 -0
  262. package/build/consensus/metadata/RoswellConsensus.js +2 -0
  263. package/build/consensus/metadata/RoswellConsensus.js.map +1 -0
  264. package/build/crypto/crypto.d.ts +1 -0
  265. package/build/crypto/crypto.d.ts.map +1 -0
  266. package/build/crypto/crypto.js +1 -0
  267. package/build/crypto/crypto.js.map +1 -0
  268. package/build/deterministic/AddressMap.d.ts +6 -1
  269. package/build/deterministic/AddressMap.d.ts.map +1 -0
  270. package/build/deterministic/AddressMap.js +8 -0
  271. package/build/deterministic/AddressMap.js.map +1 -0
  272. package/build/deterministic/AddressSet.d.ts +3 -1
  273. package/build/deterministic/AddressSet.d.ts.map +1 -0
  274. package/build/deterministic/AddressSet.js +7 -0
  275. package/build/deterministic/AddressSet.js.map +1 -0
  276. package/build/deterministic/CustomMap.d.ts +3 -1
  277. package/build/deterministic/CustomMap.d.ts.map +1 -0
  278. package/build/deterministic/CustomMap.js +65 -47
  279. package/build/deterministic/CustomMap.js.map +1 -0
  280. package/build/deterministic/DeterministicMap.d.ts +4 -2
  281. package/build/deterministic/DeterministicMap.d.ts.map +1 -0
  282. package/build/deterministic/DeterministicMap.js +24 -27
  283. package/build/deterministic/DeterministicMap.js.map +1 -0
  284. package/build/deterministic/DeterministicSet.d.ts +3 -1
  285. package/build/deterministic/DeterministicSet.d.ts.map +1 -0
  286. package/build/deterministic/DeterministicSet.js +6 -0
  287. package/build/deterministic/DeterministicSet.js.map +1 -0
  288. package/build/deterministic/ExtendedAddressMap.d.ts +7 -1
  289. package/build/deterministic/ExtendedAddressMap.d.ts.map +1 -0
  290. package/build/deterministic/ExtendedAddressMap.js +18 -2
  291. package/build/deterministic/ExtendedAddressMap.js.map +1 -0
  292. package/build/deterministic/FastMap.d.ts +7 -1
  293. package/build/deterministic/FastMap.d.ts.map +1 -0
  294. package/build/deterministic/FastMap.js +7 -2
  295. package/build/deterministic/FastMap.js.map +1 -0
  296. package/build/ecc/backend.d.ts +13 -0
  297. package/build/ecc/backend.d.ts.map +1 -0
  298. package/build/ecc/backend.js +15 -0
  299. package/build/ecc/backend.js.map +1 -0
  300. package/build/epoch/ChallengeSolution.d.ts +34 -2
  301. package/build/epoch/ChallengeSolution.d.ts.map +1 -0
  302. package/build/epoch/ChallengeSolution.js +52 -0
  303. package/build/epoch/ChallengeSolution.js.map +1 -0
  304. package/build/epoch/interfaces/IChallengeSolution.d.ts +14 -13
  305. package/build/epoch/interfaces/IChallengeSolution.d.ts.map +1 -0
  306. package/build/epoch/interfaces/IChallengeSolution.js +2 -1
  307. package/build/epoch/interfaces/IChallengeSolution.js.map +1 -0
  308. package/build/epoch/validator/EpochValidator.d.ts +38 -8
  309. package/build/epoch/validator/EpochValidator.d.ts.map +1 -0
  310. package/build/epoch/validator/EpochValidator.js +45 -19
  311. package/build/epoch/validator/EpochValidator.js.map +1 -0
  312. package/build/event/NetEvent.d.ts +1 -0
  313. package/build/event/NetEvent.d.ts.map +1 -0
  314. package/build/event/NetEvent.js +3 -0
  315. package/build/event/NetEvent.js.map +1 -0
  316. package/build/generators/AddressGenerator.d.ts +4 -3
  317. package/build/generators/AddressGenerator.d.ts.map +1 -0
  318. package/build/generators/AddressGenerator.js +9 -4
  319. package/build/generators/AddressGenerator.js.map +1 -0
  320. package/build/generators/Features.d.ts +4 -3
  321. package/build/generators/Features.d.ts.map +1 -0
  322. package/build/generators/Features.js +1 -0
  323. package/build/generators/Features.js.map +1 -0
  324. package/build/generators/Generator.d.ts +47 -11
  325. package/build/generators/Generator.d.ts.map +1 -0
  326. package/build/generators/Generator.js +48 -12
  327. package/build/generators/Generator.js.map +1 -0
  328. package/build/generators/MLDSAData.d.ts +1 -0
  329. package/build/generators/MLDSAData.d.ts.map +1 -0
  330. package/build/generators/MLDSAData.js +1 -0
  331. package/build/generators/MLDSAData.js.map +1 -0
  332. package/build/generators/builders/CalldataGenerator.d.ts +27 -6
  333. package/build/generators/builders/CalldataGenerator.d.ts.map +1 -0
  334. package/build/generators/builders/CalldataGenerator.js +33 -4
  335. package/build/generators/builders/CalldataGenerator.js.map +1 -0
  336. package/build/generators/builders/CustomGenerator.d.ts +13 -3
  337. package/build/generators/builders/CustomGenerator.d.ts.map +1 -0
  338. package/build/generators/builders/CustomGenerator.js +11 -0
  339. package/build/generators/builders/CustomGenerator.js.map +1 -0
  340. package/build/generators/builders/DeploymentGenerator.d.ts +17 -6
  341. package/build/generators/builders/DeploymentGenerator.d.ts.map +1 -0
  342. package/build/generators/builders/DeploymentGenerator.js +18 -2
  343. package/build/generators/builders/DeploymentGenerator.js.map +1 -0
  344. package/build/generators/builders/HashCommitmentGenerator.d.ts +166 -14
  345. package/build/generators/builders/HashCommitmentGenerator.d.ts.map +1 -0
  346. package/build/generators/builders/HashCommitmentGenerator.js +193 -27
  347. package/build/generators/builders/HashCommitmentGenerator.js.map +1 -0
  348. package/build/generators/builders/LegacyCalldataGenerator.d.ts +27 -5
  349. package/build/generators/builders/LegacyCalldataGenerator.d.ts.map +1 -0
  350. package/build/generators/builders/LegacyCalldataGenerator.js +35 -5
  351. package/build/generators/builders/LegacyCalldataGenerator.js.map +1 -0
  352. package/build/generators/builders/MultiSignGenerator.d.ts +6 -1
  353. package/build/generators/builders/MultiSignGenerator.d.ts.map +1 -0
  354. package/build/generators/builders/MultiSignGenerator.js +20 -10
  355. package/build/generators/builders/MultiSignGenerator.js.map +1 -0
  356. package/build/generators/builders/P2WDAGenerator.d.ts +44 -6
  357. package/build/generators/builders/P2WDAGenerator.d.ts.map +1 -0
  358. package/build/generators/builders/P2WDAGenerator.js +41 -2
  359. package/build/generators/builders/P2WDAGenerator.js.map +1 -0
  360. package/build/index.d.ts +1 -0
  361. package/build/index.d.ts.map +1 -0
  362. package/build/index.js +1 -0
  363. package/build/index.js.map +1 -0
  364. package/build/keypair/Address.d.ts +284 -14
  365. package/build/keypair/Address.d.ts.map +1 -0
  366. package/build/keypair/Address.js +446 -128
  367. package/build/keypair/Address.js.map +1 -0
  368. package/build/keypair/AddressVerificator.d.ts +7 -6
  369. package/build/keypair/AddressVerificator.d.ts.map +1 -0
  370. package/build/keypair/AddressVerificator.js +4 -5
  371. package/build/keypair/AddressVerificator.js.map +1 -0
  372. package/build/keypair/EcKeyPair.d.ts +185 -23
  373. package/build/keypair/EcKeyPair.d.ts.map +1 -0
  374. package/build/keypair/EcKeyPair.js +218 -50
  375. package/build/keypair/EcKeyPair.js.map +1 -0
  376. package/build/keypair/MessageSigner.d.ts +18 -17
  377. package/build/keypair/MessageSigner.d.ts.map +1 -0
  378. package/build/keypair/MessageSigner.js +34 -25
  379. package/build/keypair/MessageSigner.js.map +1 -0
  380. package/build/keypair/Secp256k1PointDeriver.d.ts +55 -0
  381. package/build/keypair/Secp256k1PointDeriver.d.ts.map +1 -0
  382. package/build/keypair/Secp256k1PointDeriver.js +66 -0
  383. package/build/keypair/Secp256k1PointDeriver.js.map +1 -0
  384. package/build/keypair/Wallet.d.ts +29 -15
  385. package/build/keypair/Wallet.d.ts.map +1 -0
  386. package/build/keypair/Wallet.js +46 -14
  387. package/build/keypair/Wallet.js.map +1 -0
  388. package/build/keypair/interfaces/IWallet.d.ts +19 -0
  389. package/build/keypair/interfaces/IWallet.d.ts.map +1 -0
  390. package/build/keypair/interfaces/IWallet.js +1 -0
  391. package/build/keypair/interfaces/IWallet.js.map +1 -0
  392. package/build/metadata/ContractBaseMetadata.d.ts +10 -2
  393. package/build/metadata/ContractBaseMetadata.d.ts.map +1 -0
  394. package/build/metadata/ContractBaseMetadata.js +10 -1
  395. package/build/metadata/ContractBaseMetadata.js.map +1 -0
  396. package/build/mnemonic/BIPStandard.d.ts +59 -0
  397. package/build/mnemonic/BIPStandard.d.ts.map +1 -0
  398. package/build/mnemonic/BIPStandard.js +59 -0
  399. package/build/mnemonic/BIPStandard.js.map +1 -0
  400. package/build/mnemonic/Mnemonic.d.ts +16 -4
  401. package/build/mnemonic/Mnemonic.d.ts.map +1 -0
  402. package/build/mnemonic/Mnemonic.js +35 -8
  403. package/build/mnemonic/Mnemonic.js.map +1 -0
  404. package/build/mnemonic/MnemonicStrength.d.ts +6 -0
  405. package/build/mnemonic/MnemonicStrength.d.ts.map +1 -0
  406. package/build/mnemonic/MnemonicStrength.js +6 -0
  407. package/build/mnemonic/MnemonicStrength.js.map +1 -0
  408. package/build/network/ChainId.d.ts +1 -0
  409. package/build/network/ChainId.d.ts.map +1 -0
  410. package/build/network/ChainId.js +1 -0
  411. package/build/network/ChainId.js.map +1 -0
  412. package/build/opnet.d.ts +26 -3
  413. package/build/opnet.d.ts.map +1 -0
  414. package/build/opnet.js +23 -0
  415. package/build/opnet.js.map +1 -0
  416. package/build/p2wda/P2WDADetector.d.ts +38 -11
  417. package/build/p2wda/P2WDADetector.d.ts.map +1 -0
  418. package/build/p2wda/P2WDADetector.js +43 -10
  419. package/build/p2wda/P2WDADetector.js.map +1 -0
  420. package/build/polyfill/disposable.d.ts +16 -0
  421. package/build/polyfill/disposable.d.ts.map +1 -0
  422. package/build/polyfill/disposable.js +23 -0
  423. package/build/polyfill/disposable.js.map +1 -0
  424. package/build/signer/AddressRotation.d.ts +37 -1
  425. package/build/signer/AddressRotation.d.ts.map +1 -0
  426. package/build/signer/AddressRotation.js +16 -0
  427. package/build/signer/AddressRotation.js.map +1 -0
  428. package/build/signer/IRotationSigner.d.ts +27 -3
  429. package/build/signer/IRotationSigner.d.ts.map +1 -0
  430. package/build/signer/IRotationSigner.js +2 -1
  431. package/build/signer/IRotationSigner.js.map +1 -0
  432. package/build/signer/ParallelSignerAdapter.d.ts +14 -0
  433. package/build/signer/ParallelSignerAdapter.d.ts.map +1 -0
  434. package/build/signer/ParallelSignerAdapter.js +51 -0
  435. package/build/signer/ParallelSignerAdapter.js.map +1 -0
  436. package/build/signer/SignerUtils.d.ts +11 -4
  437. package/build/signer/SignerUtils.d.ts.map +1 -0
  438. package/build/signer/SignerUtils.js +16 -0
  439. package/build/signer/SignerUtils.js.map +1 -0
  440. package/build/signer/TweakedSigner.d.ts +28 -4
  441. package/build/signer/TweakedSigner.d.ts.map +1 -0
  442. package/build/signer/TweakedSigner.js +23 -6
  443. package/build/signer/TweakedSigner.js.map +1 -0
  444. package/build/transaction/ContractAddress.d.ts +2 -2
  445. package/build/transaction/ContractAddress.d.ts.map +1 -0
  446. package/build/transaction/ContractAddress.js +4 -8
  447. package/build/transaction/ContractAddress.js.map +1 -0
  448. package/build/transaction/TransactionFactory.d.ts +147 -9
  449. package/build/transaction/TransactionFactory.d.ts.map +1 -0
  450. package/build/transaction/TransactionFactory.js +145 -26
  451. package/build/transaction/TransactionFactory.js.map +1 -0
  452. package/build/transaction/browser/BrowserSignerBase.d.ts +12 -6
  453. package/build/transaction/browser/BrowserSignerBase.d.ts.map +1 -0
  454. package/build/transaction/browser/BrowserSignerBase.js +7 -0
  455. package/build/transaction/browser/BrowserSignerBase.js.map +1 -0
  456. package/build/transaction/browser/WalletNetworks.d.ts +1 -0
  457. package/build/transaction/browser/WalletNetworks.d.ts.map +1 -0
  458. package/build/transaction/browser/WalletNetworks.js +1 -0
  459. package/build/transaction/browser/WalletNetworks.js.map +1 -0
  460. package/build/transaction/browser/Web3Provider.d.ts +30 -3
  461. package/build/transaction/browser/Web3Provider.d.ts.map +1 -0
  462. package/build/transaction/browser/Web3Provider.js +1 -0
  463. package/build/transaction/browser/Web3Provider.js.map +1 -0
  464. package/build/transaction/browser/extensions/UnisatSigner.d.ts +11 -9
  465. package/build/transaction/browser/extensions/UnisatSigner.d.ts.map +1 -0
  466. package/build/transaction/browser/extensions/UnisatSigner.js +27 -17
  467. package/build/transaction/browser/extensions/UnisatSigner.js.map +1 -0
  468. package/build/transaction/browser/extensions/XverseSigner.d.ts +10 -8
  469. package/build/transaction/browser/extensions/XverseSigner.d.ts.map +1 -0
  470. package/build/transaction/browser/extensions/XverseSigner.js +25 -15
  471. package/build/transaction/browser/extensions/XverseSigner.js.map +1 -0
  472. package/build/transaction/browser/types/OPWallet.d.ts +12 -2
  473. package/build/transaction/browser/types/OPWallet.d.ts.map +1 -0
  474. package/build/transaction/browser/types/OPWallet.js +4 -0
  475. package/build/transaction/browser/types/OPWallet.js.map +1 -0
  476. package/build/transaction/browser/types/Unisat.d.ts +2 -1
  477. package/build/transaction/browser/types/Unisat.d.ts.map +1 -0
  478. package/build/transaction/browser/types/Unisat.js +2 -0
  479. package/build/transaction/browser/types/Unisat.js.map +1 -0
  480. package/build/transaction/browser/types/Xverse.d.ts +1 -0
  481. package/build/transaction/browser/types/Xverse.d.ts.map +1 -0
  482. package/build/transaction/browser/types/Xverse.js +1 -0
  483. package/build/transaction/browser/types/Xverse.js.map +1 -0
  484. package/build/transaction/builders/CancelTransaction.d.ts +31 -6
  485. package/build/transaction/builders/CancelTransaction.d.ts.map +1 -0
  486. package/build/transaction/builders/CancelTransaction.js +116 -33
  487. package/build/transaction/builders/CancelTransaction.js.map +1 -0
  488. package/build/transaction/builders/ChallengeSolutionTransaction.d.ts +1 -0
  489. package/build/transaction/builders/ChallengeSolutionTransaction.d.ts.map +1 -0
  490. package/build/transaction/builders/ChallengeSolutionTransaction.js +88 -0
  491. package/build/transaction/builders/ChallengeSolutionTransaction.js.map +1 -0
  492. package/build/transaction/builders/ConsolidatedInteractionTransaction.d.ts +140 -13
  493. package/build/transaction/builders/ConsolidatedInteractionTransaction.d.ts.map +1 -0
  494. package/build/transaction/builders/ConsolidatedInteractionTransaction.js +197 -20
  495. package/build/transaction/builders/ConsolidatedInteractionTransaction.js.map +1 -0
  496. package/build/transaction/builders/CustomScriptTransaction.d.ts +108 -8
  497. package/build/transaction/builders/CustomScriptTransaction.d.ts.map +1 -0
  498. package/build/transaction/builders/CustomScriptTransaction.js +176 -39
  499. package/build/transaction/builders/CustomScriptTransaction.js.map +1 -0
  500. package/build/transaction/builders/DeploymentTransaction.d.ts +120 -9
  501. package/build/transaction/builders/DeploymentTransaction.d.ts.map +1 -0
  502. package/build/transaction/builders/DeploymentTransaction.js +194 -51
  503. package/build/transaction/builders/DeploymentTransaction.js.map +1 -0
  504. package/build/transaction/builders/FundingTransaction.d.ts +5 -4
  505. package/build/transaction/builders/FundingTransaction.d.ts.map +1 -0
  506. package/build/transaction/builders/FundingTransaction.js +15 -8
  507. package/build/transaction/builders/FundingTransaction.js.map +1 -0
  508. package/build/transaction/builders/InteractionTransaction.d.ts +14 -5
  509. package/build/transaction/builders/InteractionTransaction.d.ts.map +1 -0
  510. package/build/transaction/builders/InteractionTransaction.js +18 -5
  511. package/build/transaction/builders/InteractionTransaction.js.map +1 -0
  512. package/build/transaction/builders/InteractionTransactionP2WDA.d.ts +58 -7
  513. package/build/transaction/builders/InteractionTransactionP2WDA.d.ts.map +1 -0
  514. package/build/transaction/builders/InteractionTransactionP2WDA.js +95 -18
  515. package/build/transaction/builders/InteractionTransactionP2WDA.js.map +1 -0
  516. package/build/transaction/builders/MultiSignTransaction.d.ts +126 -17
  517. package/build/transaction/builders/MultiSignTransaction.d.ts.map +1 -0
  518. package/build/transaction/builders/MultiSignTransaction.js +201 -76
  519. package/build/transaction/builders/MultiSignTransaction.js.map +1 -0
  520. package/build/transaction/builders/SharedInteractionTransaction.d.ts +106 -18
  521. package/build/transaction/builders/SharedInteractionTransaction.d.ts.map +1 -0
  522. package/build/transaction/builders/SharedInteractionTransaction.js +158 -40
  523. package/build/transaction/builders/SharedInteractionTransaction.js.map +1 -0
  524. package/build/transaction/builders/TransactionBuilder.d.ts +249 -19
  525. package/build/transaction/builders/TransactionBuilder.d.ts.map +1 -0
  526. package/build/transaction/builders/TransactionBuilder.js +375 -60
  527. package/build/transaction/builders/TransactionBuilder.js.map +1 -0
  528. package/build/transaction/enums/TransactionType.d.ts +1 -0
  529. package/build/transaction/enums/TransactionType.d.ts.map +1 -0
  530. package/build/transaction/enums/TransactionType.js +1 -0
  531. package/build/transaction/enums/TransactionType.js.map +1 -0
  532. package/build/transaction/interfaces/ICancelTransactionParameters.d.ts +3 -2
  533. package/build/transaction/interfaces/ICancelTransactionParameters.d.ts.map +1 -0
  534. package/build/transaction/interfaces/ICancelTransactionParameters.js +1 -0
  535. package/build/transaction/interfaces/ICancelTransactionParameters.js.map +1 -0
  536. package/build/transaction/interfaces/IConsolidatedTransactionParameters.d.ts +48 -5
  537. package/build/transaction/interfaces/IConsolidatedTransactionParameters.d.ts.map +1 -0
  538. package/build/transaction/interfaces/IConsolidatedTransactionParameters.js +1 -0
  539. package/build/transaction/interfaces/IConsolidatedTransactionParameters.js.map +1 -0
  540. package/build/transaction/interfaces/ICustomTransactionParameters.d.ts +7 -5
  541. package/build/transaction/interfaces/ICustomTransactionParameters.d.ts.map +1 -0
  542. package/build/transaction/interfaces/ICustomTransactionParameters.js +1 -0
  543. package/build/transaction/interfaces/ICustomTransactionParameters.js.map +1 -0
  544. package/build/transaction/interfaces/ITransactionParameters.d.ts +27 -15
  545. package/build/transaction/interfaces/ITransactionParameters.d.ts.map +1 -0
  546. package/build/transaction/interfaces/ITransactionParameters.js +1 -0
  547. package/build/transaction/interfaces/ITransactionParameters.js.map +1 -0
  548. package/build/transaction/interfaces/ITransactionResponses.d.ts +3 -2
  549. package/build/transaction/interfaces/ITransactionResponses.d.ts.map +1 -0
  550. package/build/transaction/interfaces/ITransactionResponses.js +1 -0
  551. package/build/transaction/interfaces/ITransactionResponses.js.map +1 -0
  552. package/build/transaction/interfaces/ITweakedTransactionData.d.ts +21 -8
  553. package/build/transaction/interfaces/ITweakedTransactionData.d.ts.map +1 -0
  554. package/build/transaction/interfaces/ITweakedTransactionData.js +1 -0
  555. package/build/transaction/interfaces/ITweakedTransactionData.js.map +1 -0
  556. package/build/transaction/interfaces/IWeb3ProviderTypes.d.ts +29 -3
  557. package/build/transaction/interfaces/IWeb3ProviderTypes.d.ts.map +1 -0
  558. package/build/transaction/interfaces/IWeb3ProviderTypes.js +2 -1
  559. package/build/transaction/interfaces/IWeb3ProviderTypes.js.map +1 -0
  560. package/build/transaction/interfaces/Tap.d.ts +4 -3
  561. package/build/transaction/interfaces/Tap.d.ts.map +1 -0
  562. package/build/transaction/interfaces/Tap.js +1 -0
  563. package/build/transaction/interfaces/Tap.js.map +1 -0
  564. package/build/transaction/mineable/IP2WSHAddress.d.ts +2 -1
  565. package/build/transaction/mineable/IP2WSHAddress.d.ts.map +1 -0
  566. package/build/transaction/mineable/IP2WSHAddress.js +1 -0
  567. package/build/transaction/mineable/IP2WSHAddress.js.map +1 -0
  568. package/build/transaction/mineable/TimelockGenerator.d.ts +13 -4
  569. package/build/transaction/mineable/TimelockGenerator.d.ts.map +1 -0
  570. package/build/transaction/mineable/TimelockGenerator.js +12 -3
  571. package/build/transaction/mineable/TimelockGenerator.js.map +1 -0
  572. package/build/transaction/offline/OfflineTransactionManager.d.ts +193 -12
  573. package/build/transaction/offline/OfflineTransactionManager.d.ts.map +1 -0
  574. package/build/transaction/offline/OfflineTransactionManager.js +192 -8
  575. package/build/transaction/offline/OfflineTransactionManager.js.map +1 -0
  576. package/build/transaction/offline/TransactionReconstructor.d.ts +56 -6
  577. package/build/transaction/offline/TransactionReconstructor.d.ts.map +1 -0
  578. package/build/transaction/offline/TransactionReconstructor.js +111 -75
  579. package/build/transaction/offline/TransactionReconstructor.js.map +1 -0
  580. package/build/transaction/offline/TransactionSerializer.d.ts +54 -3
  581. package/build/transaction/offline/TransactionSerializer.d.ts.map +1 -0
  582. package/build/transaction/offline/TransactionSerializer.js +206 -95
  583. package/build/transaction/offline/TransactionSerializer.js.map +1 -0
  584. package/build/transaction/offline/TransactionStateCapture.d.ts +66 -7
  585. package/build/transaction/offline/TransactionStateCapture.d.ts.map +1 -0
  586. package/build/transaction/offline/TransactionStateCapture.js +124 -60
  587. package/build/transaction/offline/TransactionStateCapture.js.map +1 -0
  588. package/build/transaction/offline/interfaces/ISerializableState.d.ts +72 -1
  589. package/build/transaction/offline/interfaces/ISerializableState.d.ts.map +1 -0
  590. package/build/transaction/offline/interfaces/ISerializableState.js +10 -1
  591. package/build/transaction/offline/interfaces/ISerializableState.js.map +1 -0
  592. package/build/transaction/offline/interfaces/ITypeSpecificData.d.ts +77 -1
  593. package/build/transaction/offline/interfaces/ITypeSpecificData.d.ts.map +1 -0
  594. package/build/transaction/offline/interfaces/ITypeSpecificData.js +19 -0
  595. package/build/transaction/offline/interfaces/ITypeSpecificData.js.map +1 -0
  596. package/build/transaction/psbt/PSBTTypes.d.ts +1 -0
  597. package/build/transaction/psbt/PSBTTypes.d.ts.map +1 -0
  598. package/build/transaction/psbt/PSBTTypes.js +1 -0
  599. package/build/transaction/psbt/PSBTTypes.js.map +1 -0
  600. package/build/transaction/shared/P2TR_MS.d.ts +11 -2
  601. package/build/transaction/shared/P2TR_MS.d.ts.map +1 -0
  602. package/build/transaction/shared/P2TR_MS.js +10 -0
  603. package/build/transaction/shared/P2TR_MS.js.map +1 -0
  604. package/build/transaction/shared/TweakedTransaction.d.ts +281 -38
  605. package/build/transaction/shared/TweakedTransaction.d.ts.map +1 -0
  606. package/build/transaction/shared/TweakedTransaction.js +576 -114
  607. package/build/transaction/shared/TweakedTransaction.js.map +1 -0
  608. package/build/transaction/utils/WitnessUtils.d.ts +7 -1
  609. package/build/transaction/utils/WitnessUtils.d.ts.map +1 -0
  610. package/build/transaction/utils/WitnessUtils.js +17 -3
  611. package/build/transaction/utils/WitnessUtils.js.map +1 -0
  612. package/build/tsconfig.build.tsbuildinfo +1 -1
  613. package/build/utils/BitcoinUtils.d.ts +19 -0
  614. package/build/utils/BitcoinUtils.d.ts.map +1 -0
  615. package/build/utils/BitcoinUtils.js +19 -0
  616. package/build/utils/BitcoinUtils.js.map +1 -0
  617. package/build/utils/BufferHelper.d.ts +2 -1
  618. package/build/utils/BufferHelper.d.ts.map +1 -0
  619. package/build/utils/BufferHelper.js +38 -32
  620. package/build/utils/BufferHelper.js.map +1 -0
  621. package/build/utils/StringToBuffer.d.ts +1 -0
  622. package/build/utils/StringToBuffer.d.ts.map +1 -0
  623. package/build/utils/StringToBuffer.js +1 -0
  624. package/build/utils/StringToBuffer.js.map +1 -0
  625. package/build/utils/lengths.d.ts +1 -0
  626. package/build/utils/lengths.d.ts.map +1 -0
  627. package/build/utils/lengths.js +1 -0
  628. package/build/utils/lengths.js.map +1 -0
  629. package/build/utils/types.d.ts +1 -0
  630. package/build/utils/types.d.ts.map +1 -0
  631. package/build/utils/types.js +2 -1
  632. package/build/utils/types.js.map +1 -0
  633. package/build/utxo/OPNetLimitedProvider.d.ts +39 -3
  634. package/build/utxo/OPNetLimitedProvider.d.ts.map +1 -0
  635. package/build/utxo/OPNetLimitedProvider.js +43 -5
  636. package/build/utxo/OPNetLimitedProvider.js.map +1 -0
  637. package/build/utxo/interfaces/BroadcastResponse.d.ts +1 -0
  638. package/build/utxo/interfaces/BroadcastResponse.d.ts.map +1 -0
  639. package/build/utxo/interfaces/BroadcastResponse.js +1 -0
  640. package/build/utxo/interfaces/BroadcastResponse.js.map +1 -0
  641. package/build/utxo/interfaces/IUTXO.d.ts +13 -7
  642. package/build/utxo/interfaces/IUTXO.d.ts.map +1 -0
  643. package/build/utxo/interfaces/IUTXO.js +1 -0
  644. package/build/utxo/interfaces/IUTXO.js.map +1 -0
  645. package/build/verification/TapscriptVerificator.d.ts +12 -10
  646. package/build/verification/TapscriptVerificator.d.ts.map +1 -0
  647. package/build/verification/TapscriptVerificator.js +28 -38
  648. package/build/verification/TapscriptVerificator.js.map +1 -0
  649. package/eslint.config.js +0 -1
  650. package/package.json +12 -35
  651. package/src/abi/ABICoder.ts +0 -13
  652. package/src/branded/Branded.ts +5 -0
  653. package/src/buffer/BinaryReader.ts +7 -7
  654. package/src/buffer/BinaryWriter.ts +29 -24
  655. package/src/bytecode/Compressor.ts +1 -1
  656. package/src/chain/ChainData.ts +34 -27
  657. package/src/consensus/ConsensusConfig.ts +1 -1
  658. package/src/consensus/IConsensusConfig.ts +0 -17
  659. package/src/consensus/metadata/RoswellConsensus.ts +1 -17
  660. package/src/deterministic/AddressMap.ts +5 -1
  661. package/src/deterministic/AddressSet.ts +5 -1
  662. package/src/deterministic/CustomMap.ts +6 -2
  663. package/src/deterministic/DeterministicMap.ts +8 -4
  664. package/src/deterministic/DeterministicSet.ts +6 -2
  665. package/src/deterministic/ExtendedAddressMap.ts +9 -4
  666. package/src/deterministic/FastMap.ts +9 -5
  667. package/src/ecc/backend.ts +17 -0
  668. package/src/epoch/ChallengeSolution.ts +3 -3
  669. package/src/epoch/interfaces/IChallengeSolution.ts +13 -13
  670. package/src/epoch/validator/EpochValidator.ts +24 -43
  671. package/src/generators/AddressGenerator.ts +4 -7
  672. package/src/generators/Features.ts +3 -3
  673. package/src/generators/Generator.ts +42 -26
  674. package/src/generators/builders/CalldataGenerator.ts +26 -24
  675. package/src/generators/builders/CustomGenerator.ts +4 -4
  676. package/src/generators/builders/DeploymentGenerator.ts +25 -23
  677. package/src/generators/builders/HashCommitmentGenerator.ts +31 -31
  678. package/src/generators/builders/LegacyCalldataGenerator.ts +26 -24
  679. package/src/generators/builders/MultiSignGenerator.ts +12 -12
  680. package/src/generators/builders/P2WDAGenerator.ts +10 -10
  681. package/src/keypair/Address.ts +114 -71
  682. package/src/keypair/AddressVerificator.ts +14 -148
  683. package/src/keypair/EcKeyPair.ts +104 -116
  684. package/src/keypair/MessageSigner.ts +70 -150
  685. package/src/keypair/Wallet.ts +56 -241
  686. package/src/metadata/ContractBaseMetadata.ts +2 -2
  687. package/src/mnemonic/Mnemonic.ts +31 -222
  688. package/src/opnet.ts +12 -6
  689. package/src/p2wda/P2WDADetector.ts +23 -72
  690. package/src/polyfill/disposable.ts +29 -0
  691. package/src/signer/AddressRotation.ts +1 -1
  692. package/src/signer/IRotationSigner.ts +3 -3
  693. package/src/signer/ParallelSignerAdapter.ts +59 -0
  694. package/src/signer/SignerUtils.ts +4 -4
  695. package/src/signer/TweakedSigner.ts +26 -14
  696. package/src/transaction/ContractAddress.ts +3 -7
  697. package/src/transaction/TransactionFactory.ts +28 -50
  698. package/src/transaction/browser/BrowserSignerBase.ts +12 -6
  699. package/src/transaction/browser/Web3Provider.ts +3 -3
  700. package/src/transaction/browser/extensions/UnisatSigner.ts +52 -48
  701. package/src/transaction/browser/extensions/XverseSigner.ts +55 -38
  702. package/src/transaction/browser/types/OPWallet.ts +2 -2
  703. package/src/transaction/browser/types/Unisat.ts +1 -1
  704. package/src/transaction/builders/CancelTransaction.ts +59 -24
  705. package/src/transaction/builders/ChallengeSolutionTransaction.ts +3 -3
  706. package/src/transaction/builders/ConsolidatedInteractionTransaction.ts +39 -34
  707. package/src/transaction/builders/CustomScriptTransaction.ts +79 -56
  708. package/src/transaction/builders/DeploymentTransaction.ts +82 -63
  709. package/src/transaction/builders/FundingTransaction.ts +11 -11
  710. package/src/transaction/builders/InteractionTransaction.ts +10 -10
  711. package/src/transaction/builders/InteractionTransactionP2WDA.ts +38 -40
  712. package/src/transaction/builders/MultiSignTransaction.ts +68 -61
  713. package/src/transaction/builders/SharedInteractionTransaction.ts +81 -57
  714. package/src/transaction/builders/TransactionBuilder.ts +99 -81
  715. package/src/transaction/interfaces/ICancelTransactionParameters.ts +2 -2
  716. package/src/transaction/interfaces/IConsolidatedTransactionParameters.ts +5 -5
  717. package/src/transaction/interfaces/ICustomTransactionParameters.ts +5 -5
  718. package/src/transaction/interfaces/ITransactionParameters.ts +15 -15
  719. package/src/transaction/interfaces/ITransactionResponses.ts +2 -2
  720. package/src/transaction/interfaces/ITweakedTransactionData.ts +17 -8
  721. package/src/transaction/interfaces/IWeb3ProviderTypes.ts +3 -3
  722. package/src/transaction/interfaces/Tap.ts +3 -3
  723. package/src/transaction/mineable/IP2WSHAddress.ts +1 -1
  724. package/src/transaction/mineable/TimelockGenerator.ts +19 -12
  725. package/src/transaction/offline/OfflineTransactionManager.ts +22 -23
  726. package/src/transaction/offline/TransactionReconstructor.ts +83 -91
  727. package/src/transaction/offline/TransactionSerializer.ts +151 -101
  728. package/src/transaction/offline/TransactionStateCapture.ts +83 -79
  729. package/src/transaction/offline/interfaces/ISerializableState.ts +1 -1
  730. package/src/transaction/offline/interfaces/ITypeSpecificData.ts +1 -1
  731. package/src/transaction/shared/P2TR_MS.ts +4 -4
  732. package/src/transaction/shared/TweakedTransaction.ts +326 -124
  733. package/src/transaction/utils/WitnessUtils.ts +18 -9
  734. package/src/utils/BufferHelper.ts +39 -37
  735. package/src/utxo/OPNetLimitedProvider.ts +9 -9
  736. package/src/utxo/interfaces/IUTXO.ts +7 -7
  737. package/src/verification/TapscriptVerificator.ts +73 -86
  738. package/test/address-rotation.test.ts +24 -24
  739. package/test/address.test.ts +12 -12
  740. package/test/addressmap.test.ts +30 -30
  741. package/test/binary-reader-writer.test.ts +8 -8
  742. package/test/browser/offline-transaction.test.ts +2206 -0
  743. package/test/browser/parallel-signing.test.ts +316 -0
  744. package/test/browser/setup.ts +11 -0
  745. package/test/browser/transaction-signing.test.ts +416 -0
  746. package/test/buffer-helper.test.ts +287 -0
  747. package/test/derivePath.test.ts +4 -3
  748. package/test/disposable.test.ts +279 -0
  749. package/test/fastmap-setall.test.ts +1 -1
  750. package/test/fastmap.test.ts +3 -3
  751. package/test/messagesigner-mldsa.test.ts +3 -3
  752. package/test/messagesigner-schnorr.test.ts +9 -9
  753. package/test/offline-transaction.test.ts +461 -288
  754. package/test/old/FastBigIntMap.ts +3 -3
  755. package/test/oldfastmap.test.ts +6 -6
  756. package/test/transaction-builders.test.ts +321 -0
  757. package/tsconfig.base.json +34 -18
  758. package/tsconfig.browser.json +15 -0
  759. package/tsconfig.json +3 -8
  760. package/vite.config.browser.ts +4 -5
  761. package/vitest.config.browser.ts +68 -0
  762. package/vitest.config.ts +1 -1
  763. package/browser/valibot.js +0 -4948
  764. package/tsconfig.webpack.json +0 -18
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TapscriptVerificator.js","sourceRoot":"","sources":["../../src/verification/TapscriptVerificator.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,MAAM,EACN,MAAM,IAAI,SAAS,EACnB,MAAM,EAEN,QAAQ,EACR,OAAO,EAGP,QAAQ,EAER,MAAM,EAGN,OAAO,GACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AAEpF,OAAO,EAAgB,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAoBnE,MAAM,OAAO,oBAAoB;IACrB,MAAM,CAAU,kBAAkB,GAAW,GAAG,CAAC;IAElD,MAAM,CAAC,kBAAkB,CAC5B,MAAyC;QAEzC,MAAM,EAAE,UAAU,EAAE,GAAG,oBAAoB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAEpE,OAAO,oBAAoB,CAAC,yBAAyB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC9E,CAAC;IAEM,MAAM,CAAC,kBAAkB,CAC5B,MAAyC,EACzC,YAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,oBAAoB,EAAE,OAAO,EAAE,GAC/C,oBAAoB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAEjD,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC;YAC1B,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC;YAC9C,OAAO,EAAE,OAAO;YAChB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE;gBACJ,MAAM,EAAE,oBAA8B;gBACtC,aAAa,EAAE,oBAAoB,CAAC,kBAAkB;aACzD;SACJ,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAChC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnC,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,MAAM,oBAAoB,GAAe,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAe,CAAC;QACnF,OAAO,MAAM,CAAC,oBAAoB,EAAE,YAAY,CAAC,CAAC;IACtD,CAAC;IAEM,MAAM,CAAC,eAAe,CACzB,cAA0B,EAC1B,QAAoB,EACpB,QAAoB;QAEpB,MAAM,gBAAgB,GAAe,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjE,MAAM,GAAG,GAAe,MAAM,CAAC,CAAC,cAAc,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC;QAC7E,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC;IAEM,MAAM,CAAC,yBAAyB,CACnC,MAAyC,EACzC,UAAmB;QAEnB,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC;QACnD,MAAM,eAAe,GAA8B;YAC/C,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC;YAC9C,OAAO,EAAE,OAAO;YAChB,UAAU,EAAE,UAAU;SACzB,CAAC;QACF,MAAM,EAAE,GAAY,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACnD,OAAO,EAAE,CAAC,OAAO,CAAC;IACtB,CAAC;IAEO,MAAM,CAAC,eAAe,CAC1B,MAAyC;QAEzC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC;QACnD,MAAM,aAAa,GAAwB,IAAI,mBAAmB,CAC9D,MAAM,CAAC,cAAc,EACrB,OAAO,CAAC,MAAM,CAAC,kBAA+B,CAAC,EAC/C,OAAO,CACV,CAAC;QAEF,MAAM,oBAAoB,GAAe,aAAa,CAAC,OAAO,CAC1D,MAAM,CAAC,QAAQ,EACf,MAAM,CAAC,YAAY,EACnB,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,QAAQ,EACf,MAAM,CAAC,QAAQ,CAClB,CAAC;QAEF,MAAM,cAAc,GAAW,MAAM,CAAC,OAAO,CAAC;YAC1C,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC;YAC9B,OAAO,CAAC,WAAW;SACtB,CAAC,CAAC;QAEH,MAAM,UAAU,GAAY;YACxB;gBACI,MAAM,EAAE,oBAAoB;gBAC5B,OAAO,EAAE,oBAAoB,CAAC,kBAAkB;aACnD;YACD;gBACI,MAAM,EAAE,cAAc;gBACtB,OAAO,EAAE,oBAAoB,CAAC,kBAAkB;aACnD;SACJ,CAAC;QAEF,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,OAAO,EAAE,CAAC;IACzD,CAAC"}
package/eslint.config.js CHANGED
@@ -30,7 +30,6 @@ export default tseslint.config(
30
30
  'prefer-spread': 'off',
31
31
  '@typescript-eslint/no-empty-object-type': 'off',
32
32
  '@typescript-eslint/prefer-literal-enum-member': 'off',
33
- '@typescript-eslint/related-getter-setter-pairs': 'off'
34
33
  },
35
34
  },
36
35
  {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@btc-vision/transaction",
3
3
  "type": "module",
4
- "version": "1.8.0-beta.3",
4
+ "version": "1.8.0-beta.5",
5
5
  "author": "BlobMaster41",
6
6
  "description": "OPNet transaction library allows you to create and sign transactions for the OPNet network.",
7
7
  "engines": {
@@ -62,11 +62,6 @@
62
62
  "require": "./browser/btc-vision-logger.js",
63
63
  "default": "./browser/btc-vision-logger.js"
64
64
  },
65
- "./browser/valibot": {
66
- "import": "./browser/valibot.js",
67
- "require": "./browser/valibot.js",
68
- "default": "./browser/valibot.js"
69
- },
70
65
  "./browser/pako": {
71
66
  "import": "./browser/pako.js",
72
67
  "require": "./browser/pako.js",
@@ -141,6 +136,8 @@
141
136
  "browserBuild": "vite build --config vite.config.browser.ts",
142
137
  "docs": "typedoc --out docs --exclude 'src/tests/*.ts' --tsconfig tsconfig.json --readme README.md --name OPNet --plugin typedoc-material-theme --themeColor '#cb9820' --exclude src/tests/test.ts --exclude src/index.ts src",
143
138
  "test": "npm run build && vitest run",
139
+ "test:browser": "vitest run --config vitest.config.browser.ts",
140
+ "test:browser:watch": "vitest --config vitest.config.browser.ts",
144
141
  "test:watch": "npm run build && vitest",
145
142
  "test:ui": "npm run build && vitest --ui",
146
143
  "test:coverage": "npm run build && vitest run --coverage",
@@ -148,60 +145,40 @@
148
145
  "prebuild": "npm run check:circular"
149
146
  },
150
147
  "devDependencies": {
151
- "@babel/core": "^7.28.6",
152
- "@babel/plugin-proposal-class-properties": "^7.18.6",
153
- "@babel/plugin-transform-runtime": "^7.28.5",
154
- "@babel/preset-env": "^7.28.6",
155
- "@babel/preset-flow": "^7.27.1",
156
- "@babel/preset-react": "^7.28.5",
157
- "@babel/preset-typescript": "^7.28.5",
158
- "@rollup/plugin-typescript": "^12.3.0",
159
- "@types/node": "^25.0.10",
148
+ "@types/node": "^25.1.0",
160
149
  "@types/sha.js": "^2.4.4",
161
- "@vitejs/plugin-legacy": "^7.2.1",
150
+ "@vitest/browser": "^4.0.18",
151
+ "@vitest/browser-playwright": "^4.0.18",
162
152
  "@vitest/ui": "^4.0.18",
163
153
  "eslint": "^9.39.2",
164
- "https-browserify": "^1.0.0",
165
154
  "madge": "^8.0.0",
166
- "os-browserify": "^0.3.0",
155
+ "playwright": "^1.58.0",
167
156
  "prettier": "^3.8.1",
168
157
  "stream-browserify": "^3.0.0",
169
- "stream-http": "^3.2.0",
170
- "tslib": "^2.8.1",
171
158
  "typedoc": "^0.28.16",
172
- "typescript-eslint": "^8.53.1",
159
+ "typescript-eslint": "^8.54.0",
173
160
  "vite": "^7.3.1",
174
161
  "vite-plugin-dts": "^4.5.4",
175
162
  "vite-plugin-node-polyfills": "^0.25.0",
176
163
  "vitest": "^4.0.18"
177
164
  },
178
165
  "dependencies": {
179
- "@babel/plugin-proposal-object-rest-spread": "^7.20.7",
180
- "@bitcoinerlab/secp256k1": "^1.2.0",
181
- "@btc-vision/bip32": "^6.1.0",
182
- "@btc-vision/bitcoin": "^6.5.6",
166
+ "@btc-vision/bip32": "^7.0.2",
167
+ "@btc-vision/bitcoin": "^7.0.0-alpha.6",
183
168
  "@btc-vision/bitcoin-rpc": "^1.0.6",
169
+ "@btc-vision/ecpair": "^4.0.2",
184
170
  "@btc-vision/logger": "^1.0.8",
185
171
  "@btc-vision/post-quantum": "^0.5.3",
186
172
  "@eslint/js": "^9.39.2",
187
173
  "@noble/curves": "^2.0.1",
188
- "@noble/secp256k1": "^3.0.0",
189
- "assert": "^2.1.0",
190
- "babel-loader": "^10.0.0",
191
- "babel-plugin-transform-import-meta": "^2.3.3",
192
- "babel-preset-react": "^6.24.1",
193
- "babelify": "^10.0.0",
194
174
  "bech32": "^2.0.0",
195
- "bip174": "^2.1.1",
175
+ "bip174": "^3.0.0",
196
176
  "bip39": "^3.1.0",
197
177
  "browserify-zlib": "^0.2.0",
198
178
  "buffer": "^6.0.3",
199
- "ecpair": "^2.1.0",
200
179
  "pako": "^2.1.0",
201
180
  "process": "^0.11.10",
202
181
  "sha.js": "^2.4.12",
203
- "ts-loader": "^9.5.4",
204
- "ts-node": "^10.9.2",
205
182
  "typescript": "^5.9.3"
206
183
  }
207
184
  }
@@ -1,8 +1,6 @@
1
1
  import shajs from 'sha.js';
2
2
 
3
3
  import { BinaryReader } from '../buffer/BinaryReader.js';
4
- import { BufferHelper } from '../utils/BufferHelper.js';
5
-
6
4
  export enum ABIDataTypes {
7
5
  // Unsigned integers
8
6
  UINT8 = 'UINT8',
@@ -171,17 +169,6 @@ export class ABICoder {
171
169
  return selector.toString(16);
172
170
  }
173
171
 
174
- private bigIntToUint8Array(bigIntValue: bigint, length: number): Uint8Array {
175
- const byteArray = new Uint8Array(length);
176
- const buf = BufferHelper.valueToUint8Array(bigIntValue);
177
-
178
- for (let i = 0; i < length; i++) {
179
- byteArray[i] = buf[i] || 0;
180
- }
181
-
182
- return byteArray;
183
- }
184
-
185
172
  private sha256(buffer: Buffer | string | Uint8Array): Buffer {
186
173
  return new shajs.sha256().update(buffer).digest();
187
174
  }
@@ -0,0 +1,5 @@
1
+ import type { Brand } from '@btc-vision/ecpair';
2
+
3
+ export type MLDSAHashedPublicKey = Brand<Uint8Array, 'MLDSAHashedPublicKey'>;
4
+
5
+ export type HybridPublicKey = Brand<Uint8Array, 'HybridPublicKey'>;
@@ -17,7 +17,7 @@ import {
17
17
  U64_BYTE_LENGTH,
18
18
  U8_BYTE_LENGTH,
19
19
  } from '../utils/lengths.js';
20
- import { BufferLike, i16, i32, i64, i8, Selector, u16, u32, u8 } from '../utils/types.js';
20
+ import type { BufferLike, i16, i32, i64, i8, Selector, u16, u32, u8 } from '../utils/types.js';
21
21
 
22
22
  /**
23
23
  * Represents a Schnorr signature paired with the signer's Address.
@@ -40,6 +40,10 @@ export class BinaryReader {
40
40
  this.buffer = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
41
41
  }
42
42
 
43
+ public get byteLength(): number {
44
+ return this.buffer.byteLength;
45
+ }
46
+
43
47
  // Helpers for comparisons; unchanged
44
48
  public static stringCompare(a: string, b: string): number {
45
49
  return a.localeCompare(b);
@@ -62,10 +66,6 @@ export class BinaryReader {
62
66
  this.currentOffset = 0;
63
67
  }
64
68
 
65
- public get byteLength(): number {
66
- return this.buffer.byteLength;
67
- }
68
-
69
69
  public length(): number {
70
70
  return this.buffer.byteLength;
71
71
  }
@@ -207,7 +207,7 @@ export class BinaryReader {
207
207
 
208
208
  // If the top bit is set (sign bit in big-endian), interpret negative
209
209
  const signBitMask = 0x80;
210
- if (bytes[0] & signBitMask) {
210
+ if ((bytes[0] as number) & signBitMask) {
211
211
  // (1 << 128)
212
212
  const twoTo128 = BigInt(1) << BigInt(128);
213
213
  // 2's complement
@@ -512,7 +512,7 @@ export class BinaryReader {
512
512
  private reverseBytes(bytes: Uint8Array): Uint8Array {
513
513
  const out = new Uint8Array(bytes.length);
514
514
  for (let i = 0; i < bytes.length; i++) {
515
- out[i] = bytes[bytes.length - 1 - i];
515
+ out[i] = bytes[bytes.length - 1 - i] as number;
516
516
  }
517
517
  return out;
518
518
  }
@@ -18,10 +18,10 @@ import {
18
18
  U64_BYTE_LENGTH,
19
19
  U8_BYTE_LENGTH,
20
20
  } from '../utils/lengths.js';
21
- import { i16, i32, i64, i8, Selector, u16, u32, u64, u8 } from '../utils/types.js';
21
+ import type { i16, i32, i64, i8, Selector, u16, u32, u64, u8 } from '../utils/types.js';
22
22
  import { BinaryReader } from './BinaryReader.js';
23
23
 
24
- export class BinaryWriter {
24
+ export class BinaryWriter implements Disposable {
25
25
  private currentOffset: u32 = 0;
26
26
  private buffer: DataView;
27
27
 
@@ -34,7 +34,7 @@ export class BinaryWriter {
34
34
  let totalLength: u32 = U16_BYTE_LENGTH;
35
35
 
36
36
  for (let i = 0; i < values.length; i++) {
37
- totalLength += U32_BYTE_LENGTH + values[i].length; // each entry has a u32 length prefix
37
+ totalLength += U32_BYTE_LENGTH + (values[i] as Uint8Array).length; // each entry has a u32 length prefix
38
38
  }
39
39
 
40
40
  return totalLength;
@@ -99,7 +99,8 @@ export class BinaryWriter {
99
99
  * Writes a signed 32-bit integer. By default big-endian (be = true).
100
100
  */
101
101
  public writeI32(value: i32, be: boolean = true): void {
102
- if (value < -2147483648 || value > 2147483647) throw new Error('i32 value is out of range.');
102
+ if (value < -2147483648 || value > 2147483647)
103
+ throw new Error('i32 value is out of range.');
103
104
 
104
105
  this.allocSafe(I32_BYTE_LENGTH);
105
106
  this.buffer.setInt32(this.currentOffset, value, !be);
@@ -146,11 +147,11 @@ export class BinaryWriter {
146
147
 
147
148
  if (be) {
148
149
  for (let i = 0; i < bytesToHex.byteLength; i++) {
149
- this.writeU8(bytesToHex[i]);
150
+ this.writeU8(bytesToHex[i] as number);
150
151
  }
151
152
  } else {
152
153
  for (let i = bytesToHex.byteLength - 1; i >= 0; i--) {
153
- this.writeU8(bytesToHex[i]);
154
+ this.writeU8(bytesToHex[i] as number);
154
155
  }
155
156
  }
156
157
  }
@@ -173,11 +174,11 @@ export class BinaryWriter {
173
174
 
174
175
  if (be) {
175
176
  for (let i = 0; i < bytesToHex.byteLength; i++) {
176
- this.writeU8(bytesToHex[i]);
177
+ this.writeU8(bytesToHex[i] as number);
177
178
  }
178
179
  } else {
179
180
  for (let i = bytesToHex.byteLength - 1; i >= 0; i--) {
180
- this.writeU8(bytesToHex[i]);
181
+ this.writeU8(bytesToHex[i] as number);
181
182
  }
182
183
  }
183
184
  }
@@ -196,11 +197,11 @@ export class BinaryWriter {
196
197
 
197
198
  if (be) {
198
199
  for (let i = 0; i < bytesToHex.byteLength; i++) {
199
- this.writeU8(bytesToHex[i]);
200
+ this.writeU8(bytesToHex[i] as number);
200
201
  }
201
202
  } else {
202
203
  for (let i = bytesToHex.byteLength - 1; i >= 0; i--) {
203
- this.writeU8(bytesToHex[i]);
204
+ this.writeU8(bytesToHex[i] as number);
204
205
  }
205
206
  }
206
207
  }
@@ -209,7 +210,7 @@ export class BinaryWriter {
209
210
  this.allocSafe(value.byteLength);
210
211
 
211
212
  for (let i = 0; i < value.byteLength; i++) {
212
- this.writeU8(value[i]);
213
+ this.writeU8(value[i] as number);
213
214
  }
214
215
  }
215
216
 
@@ -322,6 +323,10 @@ export class BinaryWriter {
322
323
  this.buffer = this.getDefaultBuffer();
323
324
  }
324
325
 
326
+ public [Symbol.dispose](): void {
327
+ this.clear();
328
+ }
329
+
325
330
  public allocSafe(size: u32): void {
326
331
  if (this.currentOffset + size > this.buffer.byteLength) {
327
332
  this.resize(size);
@@ -335,7 +340,7 @@ export class BinaryWriter {
335
340
 
336
341
  const keys = Array.from(map.keys());
337
342
  for (let i = 0; i < keys.length; i++) {
338
- const key = keys[i];
343
+ const key = keys[i] as Address;
339
344
  const value = map.get(key);
340
345
 
341
346
  if (value === null || value === undefined) throw new Error('Value not found');
@@ -374,8 +379,8 @@ export class BinaryWriter {
374
379
  this.writeU16(values.length, be);
375
380
 
376
381
  for (let i = 0; i < values.length; i++) {
377
- this.writeU32(values[i].length, be);
378
- this.writeBytes(values[i]);
382
+ this.writeU32((values[i] as Uint8Array).length, be);
383
+ this.writeBytes(values[i] as Uint8Array);
379
384
  }
380
385
  }
381
386
 
@@ -385,7 +390,7 @@ export class BinaryWriter {
385
390
  this.writeU16(value.length);
386
391
 
387
392
  for (let i = 0; i < value.length; i++) {
388
- this.writeAddress(value[i]);
393
+ this.writeAddress(value[i] as Address);
389
394
  }
390
395
  }
391
396
 
@@ -400,7 +405,7 @@ export class BinaryWriter {
400
405
  this.writeU16(value.length);
401
406
 
402
407
  for (let i = 0; i < value.length; i++) {
403
- this.writeExtendedAddress(value[i]);
408
+ this.writeExtendedAddress(value[i] as Address);
404
409
  }
405
410
  }
406
411
 
@@ -410,7 +415,7 @@ export class BinaryWriter {
410
415
  this.writeU16(value.length, be);
411
416
 
412
417
  for (let i = 0; i < value.length; i++) {
413
- this.writeU32(value[i], be);
418
+ this.writeU32(value[i] as u32, be);
414
419
  }
415
420
  }
416
421
 
@@ -420,7 +425,7 @@ export class BinaryWriter {
420
425
  this.writeU16(value.length, be);
421
426
 
422
427
  for (let i = 0; i < value.length; i++) {
423
- this.writeU256(value[i], be);
428
+ this.writeU256(value[i] as bigint, be);
424
429
  }
425
430
  }
426
431
 
@@ -429,7 +434,7 @@ export class BinaryWriter {
429
434
 
430
435
  this.writeU16(value.length, be);
431
436
  for (let i = 0; i < value.length; i++) {
432
- this.writeU128(value[i], be);
437
+ this.writeU128(value[i] as bigint, be);
433
438
  }
434
439
  }
435
440
 
@@ -439,7 +444,7 @@ export class BinaryWriter {
439
444
  this.writeU16(value.length);
440
445
 
441
446
  for (let i = 0; i < value.length; i++) {
442
- this.writeStringWithLength(value[i]);
447
+ this.writeStringWithLength(value[i] as string);
443
448
  }
444
449
  }
445
450
 
@@ -449,7 +454,7 @@ export class BinaryWriter {
449
454
  this.writeU16(value.length, be);
450
455
 
451
456
  for (let i = 0; i < value.length; i++) {
452
- this.writeU16(value[i], be);
457
+ this.writeU16(value[i] as u16, be);
453
458
  }
454
459
  }
455
460
 
@@ -459,7 +464,7 @@ export class BinaryWriter {
459
464
  this.writeU16(value.length);
460
465
 
461
466
  for (let i = 0; i < value.length; i++) {
462
- this.writeU8(value[i]);
467
+ this.writeU8(value[i] as u8);
463
468
  }
464
469
  }
465
470
 
@@ -469,7 +474,7 @@ export class BinaryWriter {
469
474
  this.writeU16(value.length, be);
470
475
 
471
476
  for (let i = 0; i < value.length; i++) {
472
- this.writeU64(value[i], be);
477
+ this.writeU64(value[i] as bigint, be);
473
478
  }
474
479
  }
475
480
 
@@ -479,7 +484,7 @@ export class BinaryWriter {
479
484
  this.writeU16(value.length);
480
485
 
481
486
  for (let i = 0; i < value.length; i++) {
482
- this.writeBytesWithLength(value[i]);
487
+ this.writeBytesWithLength(value[i] as Uint8Array);
483
488
  }
484
489
  }
485
490
 
@@ -1,4 +1,4 @@
1
- import zlib, { ZlibOptions } from 'zlib';
1
+ import zlib, { type ZlibOptions } from 'zlib';
2
2
 
3
3
  /** Compressor class for compressing and decompressing data. */
4
4
  export class Compressor {
@@ -1,32 +1,39 @@
1
- import { Network, networks } from '@btc-vision/bitcoin';
1
+ import { type Network, networks } from '@btc-vision/bitcoin';
2
2
 
3
- function objectEqual<T>(obj1: T, obj2: T): boolean {
4
- return JSON.stringify(obj1) === JSON.stringify(obj2);
5
- }
6
-
7
- export function getChainIdHex(network: Network): string {
8
- if (objectEqual(network, networks.bitcoin)) {
9
- return '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f';
10
- }
11
-
12
- if (objectEqual(network, networks.testnet)) {
13
- return '000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943';
14
- }
15
-
16
- if (objectEqual(network, networks.regtest)) {
17
- return '0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206';
18
- }
19
-
20
- throw new Error('Unsupported network for chain ID retrieval');
21
- }
3
+ const CHAIN_IDS: ReadonlyMap<Network, Uint8Array> = new Map([
4
+ [
5
+ networks.bitcoin,
6
+ new Uint8Array([
7
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0xd6, 0x68, 0x9c, 0x08, 0x5a, 0xe1, 0x65, 0x83,
8
+ 0x1e, 0x93, 0x4f, 0xf7, 0x63, 0xae, 0x46, 0xa2, 0xa6, 0xc1, 0x72, 0xb3, 0xf1, 0xb6,
9
+ 0x0a, 0x8c, 0xe2, 0x6f,
10
+ ]),
11
+ ],
12
+ [
13
+ networks.testnet,
14
+ new Uint8Array([
15
+ 0x00, 0x00, 0x00, 0x00, 0x09, 0x33, 0xea, 0x01, 0xad, 0x0e, 0xe9, 0x84, 0x20, 0x97,
16
+ 0x79, 0xba, 0xae, 0xc3, 0xce, 0xd9, 0x0f, 0xa3, 0xf4, 0x08, 0x71, 0x95, 0x26, 0xf8,
17
+ 0xd7, 0x7f, 0x49, 0x43,
18
+ ]),
19
+ ],
20
+ [
21
+ networks.regtest,
22
+ new Uint8Array([
23
+ 0x0f, 0x91, 0x88, 0xf1, 0x3c, 0xb7, 0xb2, 0xc7, 0x1f, 0x2a, 0x33, 0x5e, 0x3a, 0x4f,
24
+ 0xc3, 0x28, 0xbf, 0x5b, 0xeb, 0x43, 0x60, 0x12, 0xaf, 0xca, 0x59, 0x0b, 0x1a, 0x11,
25
+ 0x46, 0x6e, 0x22, 0x06,
26
+ ]),
27
+ ],
28
+ ]);
22
29
 
23
30
  export function getChainId(network: Network): Uint8Array {
24
- return Uint8Array.from(Buffer.from(getChainIdHex(network), 'hex'));
31
+ const chainId = CHAIN_IDS.get(network);
32
+ if (!chainId) throw new Error('Unsupported network for chain ID retrieval');
33
+ return chainId.slice();
25
34
  }
26
35
 
27
- export const BITCOIN_PROTOCOL_ID = Uint8Array.from(
28
- Buffer.from(
29
- 'e784995a412d773988c4b8e333d7b39dfb3cabf118d0d645411a916ca2407939', // sha256("OP_NET")
30
- 'hex',
31
- ),
32
- );
36
+ export const BITCOIN_PROTOCOL_ID = new Uint8Array([
37
+ 0xe7, 0x84, 0x99, 0x5a, 0x41, 0x2d, 0x77, 0x39, 0x88, 0xc4, 0xb8, 0xe3, 0x33, 0xd7, 0xb3, 0x9d,
38
+ 0xfb, 0x3c, 0xab, 0xf1, 0x18, 0xd0, 0xd6, 0x45, 0x41, 0x1a, 0x91, 0x6c, 0xa2, 0x40, 0x79, 0x39,
39
+ ]);
@@ -1,5 +1,5 @@
1
1
  import { Consensus } from './Consensus.js';
2
- import { ConsensusConfig } from './IConsensusConfig.js';
2
+ import type { ConsensusConfig } from './IConsensusConfig.js';
3
3
  import { RoswellConsensus } from './metadata/RoswellConsensus.js';
4
4
 
5
5
  export const OPNetConsensusConfig: { [key in Consensus]?: ConsensusConfig<key> } = {
@@ -9,21 +9,4 @@ export interface ConsensusConfig<T extends Consensus> {
9
9
 
10
10
  // The block height at which this consensus was enabled.
11
11
  readonly ENABLED_AT_BLOCK: bigint;
12
-
13
- /** WBTC vaults */
14
- // Defines the minimum amount that can be consolidated in a single transaction.
15
- //readonly VAULT_MINIMUM_AMOUNT: bigint;
16
-
17
- // Defines the requested minimum acceptance for joining UTXOs when an unwrap is being done.
18
- // If the consolidate output going back to the vault is lower than this amount, the transaction will be rejected.
19
- // User must pay for the consolidation, this help the network by having fewer UTXOs.
20
- //readonly VAULT_NETWORK_CONSOLIDATION_ACCEPTANCE: bigint;
21
-
22
- // Everytime an user wrap bitcoin, he prepays the fees for the consolidation at a maximum fee rate of the following determined value.
23
- // If the fees are lower, the user will be refunded the difference.
24
- // If the fees are higher, the user must pay the difference.
25
- //readonly UNWRAP_CONSOLIDATION_PREPAID_FEES: bigint;
26
-
27
- // The maximum fee rate for the consolidation.
28
- //readonly UNWRAP_CONSOLIDATION_PREPAID_FEES_SAT: bigint;
29
12
  }
@@ -1,4 +1,4 @@
1
- import { ConsensusConfig } from '../IConsensusConfig.js';
1
+ import type { ConsensusConfig } from '../IConsensusConfig.js';
2
2
  import { Consensus } from '../Consensus.js';
3
3
 
4
4
  export const RoswellConsensus: ConsensusConfig<Consensus.Roswell> = {
@@ -7,20 +7,4 @@ export const RoswellConsensus: ConsensusConfig<Consensus.Roswell> = {
7
7
 
8
8
  // The block height at which this consensus was enabled.
9
9
  ENABLED_AT_BLOCK: 0n,
10
-
11
- // Defines the minimum amount that can be consolidated in a single transaction.
12
- //VAULT_MINIMUM_AMOUNT: 200000n,
13
-
14
- // Defines the requested minimum acceptance for joining UTXOs when an unwrap is being done.
15
- // If the consolidate output going back to the vault is lower than this amount, the transaction will be rejected.
16
- // User must pay for the consolidation, this help the network by having fewer UTXOs.
17
- //VAULT_NETWORK_CONSOLIDATION_ACCEPTANCE: 200000n * 2n,
18
-
19
- // Everytime an user wrap bitcoin, he prepays the fees for the consolidation at a maximum fee rate of the following determined value.
20
- // If the fees are lower, the user will be refunded the difference.
21
- // If the fees are higher, the user must pay the difference.
22
- //UNWRAP_CONSOLIDATION_PREPAID_FEES: 250n,
23
-
24
- // Equivalent to 56500 satoshis, calculated from UNWRAP_CONSOLIDATION_PREPAID_FEES.
25
- //UNWRAP_CONSOLIDATION_PREPAID_FEES_SAT: 56500n,
26
10
  };
@@ -1,7 +1,7 @@
1
1
  import { Address } from '../keypair/Address.js';
2
2
  import { FastMap } from './FastMap.js';
3
3
 
4
- export class AddressMap<V> {
4
+ export class AddressMap<V> implements Disposable {
5
5
  private items: FastMap<bigint, V>;
6
6
 
7
7
  constructor(iterable?: ReadonlyArray<readonly [Address, V]> | null) {
@@ -42,6 +42,10 @@ export class AddressMap<V> {
42
42
  this.items.clear();
43
43
  }
44
44
 
45
+ public [Symbol.dispose](): void {
46
+ this.clear();
47
+ }
48
+
45
49
  public indexOf(address: Address): number {
46
50
  return this.items.indexOf(address.toBigInt());
47
51
  }
@@ -1,6 +1,6 @@
1
1
  import { Address } from '../keypair/Address.js';
2
2
 
3
- export class AddressSet {
3
+ export class AddressSet implements Disposable {
4
4
  private items: Set<bigint>;
5
5
  private keys: Address[];
6
6
 
@@ -45,6 +45,10 @@ export class AddressSet {
45
45
  this.keys = [];
46
46
  }
47
47
 
48
+ public [Symbol.dispose](): void {
49
+ this.clear();
50
+ }
51
+
48
52
  public combine(set: AddressSet): AddressSet {
49
53
  const clone = this.clone();
50
54
 
@@ -1,4 +1,4 @@
1
- export class CustomMap<K, V> {
1
+ export class CustomMap<K, V> implements Disposable {
2
2
  private static readonly INITIAL_CAPACITY = 16;
3
3
  private static readonly LOAD_FACTOR = 0.75;
4
4
 
@@ -76,6 +76,10 @@ export class CustomMap<K, V> {
76
76
  this._size = 0;
77
77
  }
78
78
 
79
+ public [Symbol.dispose](): void {
80
+ this.clear();
81
+ }
82
+
79
83
  public *entries(): MapIterator<[K, V]> {
80
84
  for (let i = 0; i < this.capacity; i++) {
81
85
  if (this.#keys[i] !== undefined && !this.deleted[i]) {
@@ -223,7 +227,7 @@ export class CustomMap<K, V> {
223
227
  let hash = 2166136261;
224
228
  for (let i = 0; i < Math.min(bytes.length, 100); i++) {
225
229
  // Cap at 100 bytes for performance
226
- hash ^= bytes[i];
230
+ hash ^= bytes[i] as number;
227
231
  hash = Math.imul(hash, 16777619);
228
232
  }
229
233
  return hash;
@@ -1,6 +1,6 @@
1
- import { FastMap, PropertyExtendedKey } from './FastMap.js';
1
+ import { FastMap, type PropertyExtendedKey } from './FastMap.js';
2
2
 
3
- export class DeterministicMap<K extends PropertyExtendedKey, V> {
3
+ export class DeterministicMap<K extends PropertyExtendedKey, V> implements Disposable {
4
4
  private map: FastMap<K, V>;
5
5
  #keys: K[];
6
6
 
@@ -32,7 +32,7 @@ export class DeterministicMap<K extends PropertyExtendedKey, V> {
32
32
 
33
33
  while (left < right) {
34
34
  const mid = Math.floor((left + right) / 2);
35
- if (this.compareFn(this.#keys[mid], key) < 0) {
35
+ if (this.compareFn(this.#keys[mid] as K, key) < 0) {
36
36
  left = mid + 1;
37
37
  } else {
38
38
  right = mid;
@@ -83,7 +83,7 @@ export class DeterministicMap<K extends PropertyExtendedKey, V> {
83
83
 
84
84
  while (left <= right) {
85
85
  const mid = Math.floor((left + right) / 2);
86
- const cmp = this.compareFn(this.#keys[mid], key);
86
+ const cmp = this.compareFn(this.#keys[mid] as K, key);
87
87
 
88
88
  if (cmp === 0) {
89
89
  // Found it, remove at this index
@@ -104,6 +104,10 @@ export class DeterministicMap<K extends PropertyExtendedKey, V> {
104
104
  this.#keys = [];
105
105
  }
106
106
 
107
+ public [Symbol.dispose](): void {
108
+ this.clear();
109
+ }
110
+
107
111
  public forEach(callback: (value: V, key: K, map: DeterministicMap<K, V>) => void): void {
108
112
  for (const key of this.#keys) {
109
113
  const value = this.map.get(key) as V;
@@ -1,4 +1,4 @@
1
- export class DeterministicSet<T> {
1
+ export class DeterministicSet<T> implements Disposable {
2
2
  private elements: T[];
3
3
 
4
4
  constructor(private compareFn: (a: T, b: T) => number) {
@@ -44,6 +44,10 @@ export class DeterministicSet<T> {
44
44
  this.elements = [];
45
45
  }
46
46
 
47
+ public [Symbol.dispose](): void {
48
+ this.clear();
49
+ }
50
+
47
51
  public forEach(callback: (value: T, set: DeterministicSet<T>) => void): void {
48
52
  for (const value of this.elements) {
49
53
  callback(value, this);
@@ -64,7 +68,7 @@ export class DeterministicSet<T> {
64
68
 
65
69
  while (left < right) {
66
70
  const mid = Math.floor((left + right) / 2);
67
- const cmp = this.compareFn(this.elements[mid], value);
71
+ const cmp = this.compareFn(this.elements[mid] as T, value);
68
72
 
69
73
  if (cmp === 0) {
70
74
  return { found: true, index: mid };