@btc-vision/transaction 1.8.0-beta.0 → 1.8.0-beta.10

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 (796) hide show
  1. package/browser/_version.d.ts +2 -1
  2. package/browser/_version.d.ts.map +1 -0
  3. package/browser/abi/ABICoder.d.ts +15 -36
  4. package/browser/abi/ABICoder.d.ts.map +1 -0
  5. package/browser/abi/ABIDataTypes.d.ts +35 -0
  6. package/browser/abi/ABIDataTypes.d.ts.map +1 -0
  7. package/browser/abi/AbiTypes.d.ts +50 -0
  8. package/browser/abi/AbiTypes.d.ts.map +1 -0
  9. package/browser/abi/TupleUtils.d.ts +25 -0
  10. package/browser/abi/TupleUtils.d.ts.map +1 -0
  11. package/browser/branded/Branded.d.ts +4 -0
  12. package/browser/branded/Branded.d.ts.map +1 -0
  13. package/browser/btc-vision-bitcoin.js +12388 -3684
  14. package/browser/buffer/BinaryReader.d.ts +120 -1
  15. package/browser/buffer/BinaryReader.d.ts.map +1 -0
  16. package/browser/buffer/BinaryWriter.d.ts +51 -1
  17. package/browser/buffer/BinaryWriter.d.ts.map +1 -0
  18. package/browser/bytecode/Compressor.d.ts +12 -0
  19. package/browser/bytecode/Compressor.d.ts.map +1 -0
  20. package/browser/chain/ChainData.d.ts +2 -2
  21. package/browser/chain/ChainData.d.ts.map +1 -0
  22. package/browser/consensus/Consensus.d.ts +11 -3
  23. package/browser/consensus/Consensus.d.ts.map +1 -0
  24. package/browser/consensus/ConsensusConfig.d.ts +1 -0
  25. package/browser/consensus/ConsensusConfig.d.ts.map +1 -0
  26. package/browser/consensus/IConsensusConfig.d.ts +1 -0
  27. package/browser/consensus/IConsensusConfig.d.ts.map +1 -0
  28. package/browser/consensus/metadata/RoswellConsensus.d.ts +1 -0
  29. package/browser/consensus/metadata/RoswellConsensus.d.ts.map +1 -0
  30. package/browser/crypto/crypto.d.ts +1 -0
  31. package/browser/crypto/crypto.d.ts.map +1 -0
  32. package/browser/deterministic/AddressMap.d.ts +6 -1
  33. package/browser/deterministic/AddressMap.d.ts.map +1 -0
  34. package/browser/deterministic/AddressSet.d.ts +3 -1
  35. package/browser/deterministic/AddressSet.d.ts.map +1 -0
  36. package/browser/deterministic/CustomMap.d.ts +3 -1
  37. package/browser/deterministic/CustomMap.d.ts.map +1 -0
  38. package/browser/deterministic/DeterministicMap.d.ts +3 -1
  39. package/browser/deterministic/DeterministicMap.d.ts.map +1 -0
  40. package/browser/deterministic/DeterministicSet.d.ts +3 -1
  41. package/browser/deterministic/DeterministicSet.d.ts.map +1 -0
  42. package/browser/deterministic/ExtendedAddressMap.d.ts +7 -1
  43. package/browser/deterministic/ExtendedAddressMap.d.ts.map +1 -0
  44. package/browser/deterministic/FastMap.d.ts +7 -1
  45. package/browser/deterministic/FastMap.d.ts.map +1 -0
  46. package/browser/ecc/backend.d.ts +13 -0
  47. package/browser/ecc/backend.d.ts.map +1 -0
  48. package/browser/epoch/ChallengeSolution.d.ts +33 -1
  49. package/browser/epoch/ChallengeSolution.d.ts.map +1 -0
  50. package/browser/epoch/interfaces/IChallengeSolution.d.ts +14 -13
  51. package/browser/epoch/interfaces/IChallengeSolution.d.ts.map +1 -0
  52. package/browser/epoch/validator/EpochValidator.d.ts +37 -7
  53. package/browser/epoch/validator/EpochValidator.d.ts.map +1 -0
  54. package/browser/event/NetEvent.d.ts +1 -0
  55. package/browser/event/NetEvent.d.ts.map +1 -0
  56. package/browser/generators/AddressGenerator.d.ts +4 -3
  57. package/browser/generators/AddressGenerator.d.ts.map +1 -0
  58. package/browser/generators/Features.d.ts +1 -0
  59. package/browser/generators/Features.d.ts.map +1 -0
  60. package/browser/generators/Generator.d.ts +46 -10
  61. package/browser/generators/Generator.d.ts.map +1 -0
  62. package/browser/generators/MLDSAData.d.ts +1 -0
  63. package/browser/generators/MLDSAData.d.ts.map +1 -0
  64. package/browser/generators/builders/CalldataGenerator.d.ts +25 -4
  65. package/browser/generators/builders/CalldataGenerator.d.ts.map +1 -0
  66. package/browser/generators/builders/CustomGenerator.d.ts +13 -3
  67. package/browser/generators/builders/CustomGenerator.d.ts.map +1 -0
  68. package/browser/generators/builders/DeploymentGenerator.d.ts +15 -4
  69. package/browser/generators/builders/DeploymentGenerator.d.ts.map +1 -0
  70. package/browser/generators/builders/HashCommitmentGenerator.d.ts +164 -12
  71. package/browser/generators/builders/HashCommitmentGenerator.d.ts.map +1 -0
  72. package/browser/generators/builders/LegacyCalldataGenerator.d.ts +26 -4
  73. package/browser/generators/builders/LegacyCalldataGenerator.d.ts.map +1 -0
  74. package/browser/generators/builders/MultiSignGenerator.d.ts +6 -1
  75. package/browser/generators/builders/MultiSignGenerator.d.ts.map +1 -0
  76. package/browser/generators/builders/P2WDAGenerator.d.ts +42 -4
  77. package/browser/generators/builders/P2WDAGenerator.d.ts.map +1 -0
  78. package/browser/index.d.ts +1 -0
  79. package/browser/index.d.ts.map +1 -0
  80. package/browser/index.js +3921 -3450
  81. package/browser/keypair/Address.d.ts +283 -13
  82. package/browser/keypair/Address.d.ts.map +1 -0
  83. package/browser/keypair/AddressVerificator.d.ts +7 -6
  84. package/browser/keypair/AddressVerificator.d.ts.map +1 -0
  85. package/browser/keypair/EcKeyPair.d.ts +183 -20
  86. package/browser/keypair/EcKeyPair.d.ts.map +1 -0
  87. package/browser/keypair/MessageSigner.d.ts +17 -16
  88. package/browser/keypair/MessageSigner.d.ts.map +1 -0
  89. package/browser/keypair/Secp256k1PointDeriver.d.ts +55 -0
  90. package/browser/keypair/Secp256k1PointDeriver.d.ts.map +1 -0
  91. package/browser/keypair/Wallet.d.ts +27 -13
  92. package/browser/keypair/Wallet.d.ts.map +1 -0
  93. package/browser/keypair/interfaces/IWallet.d.ts +19 -0
  94. package/browser/keypair/interfaces/IWallet.d.ts.map +1 -0
  95. package/browser/metadata/ContractBaseMetadata.d.ts +10 -2
  96. package/browser/metadata/ContractBaseMetadata.d.ts.map +1 -0
  97. package/browser/mnemonic/BIPStandard.d.ts +59 -0
  98. package/browser/mnemonic/BIPStandard.d.ts.map +1 -0
  99. package/browser/mnemonic/Mnemonic.d.ts +15 -3
  100. package/browser/mnemonic/Mnemonic.d.ts.map +1 -0
  101. package/browser/mnemonic/MnemonicStrength.d.ts +6 -0
  102. package/browser/mnemonic/MnemonicStrength.d.ts.map +1 -0
  103. package/browser/network/ChainId.d.ts +1 -0
  104. package/browser/network/ChainId.d.ts.map +1 -0
  105. package/browser/noble-curves.js +920 -2966
  106. package/browser/noble-hashes.js +2067 -1038
  107. package/browser/opnet.d.ts +25 -1
  108. package/browser/opnet.d.ts.map +1 -0
  109. package/browser/p2wda/P2WDADetector.d.ts +36 -9
  110. package/browser/p2wda/P2WDADetector.d.ts.map +1 -0
  111. package/browser/polyfill/disposable.d.ts +16 -0
  112. package/browser/polyfill/disposable.d.ts.map +1 -0
  113. package/browser/signer/AddressRotation.d.ts +36 -0
  114. package/browser/signer/AddressRotation.d.ts.map +1 -0
  115. package/browser/signer/IRotationSigner.d.ts +27 -3
  116. package/browser/signer/IRotationSigner.d.ts.map +1 -0
  117. package/browser/signer/ParallelSignerAdapter.d.ts +14 -0
  118. package/browser/signer/ParallelSignerAdapter.d.ts.map +1 -0
  119. package/browser/signer/SignerUtils.d.ts +11 -4
  120. package/browser/signer/SignerUtils.d.ts.map +1 -0
  121. package/browser/signer/TweakedSigner.d.ts +28 -4
  122. package/browser/signer/TweakedSigner.d.ts.map +1 -0
  123. package/browser/transaction/ContractAddress.d.ts +2 -2
  124. package/browser/transaction/ContractAddress.d.ts.map +1 -0
  125. package/browser/transaction/TransactionFactory.d.ts +140 -2
  126. package/browser/transaction/TransactionFactory.d.ts.map +1 -0
  127. package/browser/transaction/browser/BrowserSignerBase.d.ts +12 -6
  128. package/browser/transaction/browser/BrowserSignerBase.d.ts.map +1 -0
  129. package/browser/transaction/browser/WalletNetworks.d.ts +1 -0
  130. package/browser/transaction/browser/WalletNetworks.d.ts.map +1 -0
  131. package/browser/transaction/browser/Web3Provider.d.ts +27 -0
  132. package/browser/transaction/browser/Web3Provider.d.ts.map +1 -0
  133. package/browser/transaction/browser/extensions/UnisatSigner.d.ts +9 -7
  134. package/browser/transaction/browser/extensions/UnisatSigner.d.ts.map +1 -0
  135. package/browser/transaction/browser/extensions/XverseSigner.d.ts +9 -7
  136. package/browser/transaction/browser/extensions/XverseSigner.d.ts.map +1 -0
  137. package/browser/transaction/browser/types/OPWallet.d.ts +10 -0
  138. package/browser/transaction/browser/types/OPWallet.d.ts.map +1 -0
  139. package/browser/transaction/browser/types/Unisat.d.ts +1 -0
  140. package/browser/transaction/browser/types/Unisat.d.ts.map +1 -0
  141. package/browser/transaction/browser/types/Xverse.d.ts +1 -0
  142. package/browser/transaction/browser/types/Xverse.d.ts.map +1 -0
  143. package/browser/transaction/builders/CancelTransaction.d.ts +29 -4
  144. package/browser/transaction/builders/CancelTransaction.d.ts.map +1 -0
  145. package/browser/transaction/builders/ChallengeSolutionTransaction.d.ts +1 -0
  146. package/browser/transaction/builders/ChallengeSolutionTransaction.d.ts.map +1 -0
  147. package/browser/transaction/builders/ConsolidatedInteractionTransaction.d.ts +137 -10
  148. package/browser/transaction/builders/ConsolidatedInteractionTransaction.d.ts.map +1 -0
  149. package/browser/transaction/builders/CustomScriptTransaction.d.ts +106 -6
  150. package/browser/transaction/builders/CustomScriptTransaction.d.ts.map +1 -0
  151. package/browser/transaction/builders/DeploymentTransaction.d.ts +116 -5
  152. package/browser/transaction/builders/DeploymentTransaction.d.ts.map +1 -0
  153. package/browser/transaction/builders/FundingTransaction.d.ts +5 -3
  154. package/browser/transaction/builders/FundingTransaction.d.ts.map +1 -0
  155. package/browser/transaction/builders/InteractionTransaction.d.ts +12 -3
  156. package/browser/transaction/builders/InteractionTransaction.d.ts.map +1 -0
  157. package/browser/transaction/builders/InteractionTransactionP2WDA.d.ts +56 -5
  158. package/browser/transaction/builders/InteractionTransactionP2WDA.d.ts.map +1 -0
  159. package/browser/transaction/builders/MultiSignTransaction.d.ts +125 -16
  160. package/browser/transaction/builders/MultiSignTransaction.d.ts.map +1 -0
  161. package/browser/transaction/builders/SharedInteractionTransaction.d.ts +103 -15
  162. package/browser/transaction/builders/SharedInteractionTransaction.d.ts.map +1 -0
  163. package/browser/transaction/builders/TransactionBuilder.d.ts +238 -15
  164. package/browser/transaction/builders/TransactionBuilder.d.ts.map +1 -0
  165. package/browser/transaction/enums/TransactionType.d.ts +1 -0
  166. package/browser/transaction/enums/TransactionType.d.ts.map +1 -0
  167. package/browser/transaction/interfaces/ICancelTransactionParameters.d.ts +2 -1
  168. package/browser/transaction/interfaces/ICancelTransactionParameters.d.ts.map +1 -0
  169. package/browser/transaction/interfaces/IConsolidatedTransactionParameters.d.ts +46 -3
  170. package/browser/transaction/interfaces/IConsolidatedTransactionParameters.d.ts.map +1 -0
  171. package/browser/transaction/interfaces/ICustomTransactionParameters.d.ts +6 -4
  172. package/browser/transaction/interfaces/ICustomTransactionParameters.d.ts.map +1 -0
  173. package/browser/transaction/interfaces/ITransactionParameters.d.ts +33 -10
  174. package/browser/transaction/interfaces/ITransactionParameters.d.ts.map +1 -0
  175. package/browser/transaction/interfaces/ITransactionResponses.d.ts +1 -0
  176. package/browser/transaction/interfaces/ITransactionResponses.d.ts.map +1 -0
  177. package/browser/transaction/interfaces/ITweakedTransactionData.d.ts +17 -5
  178. package/browser/transaction/interfaces/ITweakedTransactionData.d.ts.map +1 -0
  179. package/browser/transaction/interfaces/IWeb3ProviderTypes.d.ts +26 -0
  180. package/browser/transaction/interfaces/IWeb3ProviderTypes.d.ts.map +1 -0
  181. package/browser/transaction/interfaces/Tap.d.ts +4 -3
  182. package/browser/transaction/interfaces/Tap.d.ts.map +1 -0
  183. package/browser/transaction/mineable/IP2WSHAddress.d.ts +2 -1
  184. package/browser/transaction/mineable/IP2WSHAddress.d.ts.map +1 -0
  185. package/browser/transaction/mineable/TimelockGenerator.d.ts +12 -3
  186. package/browser/transaction/mineable/TimelockGenerator.d.ts.map +1 -0
  187. package/browser/transaction/offline/OfflineTransactionManager.d.ts +190 -9
  188. package/browser/transaction/offline/OfflineTransactionManager.d.ts.map +1 -0
  189. package/browser/transaction/offline/TransactionReconstructor.d.ts +53 -3
  190. package/browser/transaction/offline/TransactionReconstructor.d.ts.map +1 -0
  191. package/browser/transaction/offline/TransactionSerializer.d.ts +53 -2
  192. package/browser/transaction/offline/TransactionSerializer.d.ts.map +1 -0
  193. package/browser/transaction/offline/TransactionStateCapture.d.ts +64 -5
  194. package/browser/transaction/offline/TransactionStateCapture.d.ts.map +1 -0
  195. package/browser/transaction/offline/interfaces/ISerializableState.d.ts +71 -0
  196. package/browser/transaction/offline/interfaces/ISerializableState.d.ts.map +1 -0
  197. package/browser/transaction/offline/interfaces/ITypeSpecificData.d.ts +76 -0
  198. package/browser/transaction/offline/interfaces/ITypeSpecificData.d.ts.map +1 -0
  199. package/browser/transaction/psbt/PSBTTypes.d.ts +1 -0
  200. package/browser/transaction/psbt/PSBTTypes.d.ts.map +1 -0
  201. package/browser/transaction/shared/P2TR_MS.d.ts +11 -2
  202. package/browser/transaction/shared/P2TR_MS.d.ts.map +1 -0
  203. package/browser/transaction/shared/TweakedTransaction.d.ts +274 -33
  204. package/browser/transaction/shared/TweakedTransaction.d.ts.map +1 -0
  205. package/browser/transaction/utils/WitnessUtils.d.ts +7 -1
  206. package/browser/transaction/utils/WitnessUtils.d.ts.map +1 -0
  207. package/browser/utils/BitcoinUtils.d.ts +19 -0
  208. package/browser/utils/BitcoinUtils.d.ts.map +1 -0
  209. package/browser/utils/BufferHelper.d.ts +1 -0
  210. package/browser/utils/BufferHelper.d.ts.map +1 -0
  211. package/browser/utils/StringToBuffer.d.ts +1 -0
  212. package/browser/utils/StringToBuffer.d.ts.map +1 -0
  213. package/browser/utils/lengths.d.ts +1 -0
  214. package/browser/utils/lengths.d.ts.map +1 -0
  215. package/browser/utils/types.d.ts +1 -0
  216. package/browser/utils/types.d.ts.map +1 -0
  217. package/browser/utxo/OPNetLimitedProvider.d.ts +37 -1
  218. package/browser/utxo/OPNetLimitedProvider.d.ts.map +1 -0
  219. package/browser/utxo/interfaces/BroadcastResponse.d.ts +1 -0
  220. package/browser/utxo/interfaces/BroadcastResponse.d.ts.map +1 -0
  221. package/browser/utxo/interfaces/IUTXO.d.ts +11 -5
  222. package/browser/utxo/interfaces/IUTXO.d.ts.map +1 -0
  223. package/browser/vendors.js +13940 -9389
  224. package/browser/verification/TapscriptVerificator.d.ts +10 -8
  225. package/browser/verification/TapscriptVerificator.d.ts.map +1 -0
  226. package/build/_version.d.ts +2 -1
  227. package/build/_version.d.ts.map +1 -0
  228. package/build/_version.js +2 -1
  229. package/build/_version.js.map +1 -0
  230. package/build/abi/ABICoder.d.ts +15 -36
  231. package/build/abi/ABICoder.d.ts.map +1 -0
  232. package/build/abi/ABICoder.js +120 -143
  233. package/build/abi/ABICoder.js.map +1 -0
  234. package/build/abi/ABIDataTypes.d.ts +35 -0
  235. package/build/abi/ABIDataTypes.d.ts.map +1 -0
  236. package/build/abi/ABIDataTypes.js +42 -0
  237. package/build/abi/ABIDataTypes.js.map +1 -0
  238. package/build/abi/AbiTypes.d.ts +50 -0
  239. package/build/abi/AbiTypes.d.ts.map +1 -0
  240. package/build/abi/AbiTypes.js +78 -0
  241. package/build/abi/AbiTypes.js.map +1 -0
  242. package/build/abi/TupleUtils.d.ts +25 -0
  243. package/build/abi/TupleUtils.d.ts.map +1 -0
  244. package/build/abi/TupleUtils.js +50 -0
  245. package/build/abi/TupleUtils.js.map +1 -0
  246. package/build/branded/Branded.d.ts +4 -0
  247. package/build/branded/Branded.d.ts.map +1 -0
  248. package/build/branded/Branded.js +2 -0
  249. package/build/branded/Branded.js.map +1 -0
  250. package/build/buffer/BinaryReader.d.ts +121 -2
  251. package/build/buffer/BinaryReader.d.ts.map +1 -0
  252. package/build/buffer/BinaryReader.js +129 -5
  253. package/build/buffer/BinaryReader.js.map +1 -0
  254. package/build/buffer/BinaryWriter.d.ts +52 -2
  255. package/build/buffer/BinaryWriter.d.ts.map +1 -0
  256. package/build/buffer/BinaryWriter.js +62 -2
  257. package/build/buffer/BinaryWriter.js.map +1 -0
  258. package/build/bytecode/Compressor.d.ts +12 -0
  259. package/build/bytecode/Compressor.d.ts.map +1 -0
  260. package/build/bytecode/Compressor.js +17 -5
  261. package/build/bytecode/Compressor.js.map +1 -0
  262. package/build/chain/ChainData.d.ts +2 -2
  263. package/build/chain/ChainData.d.ts.map +1 -0
  264. package/build/chain/ChainData.js +37 -16
  265. package/build/chain/ChainData.js.map +1 -0
  266. package/build/consensus/Consensus.d.ts +11 -3
  267. package/build/consensus/Consensus.d.ts.map +1 -0
  268. package/build/consensus/Consensus.js +8 -0
  269. package/build/consensus/Consensus.js.map +1 -0
  270. package/build/consensus/ConsensusConfig.d.ts +2 -1
  271. package/build/consensus/ConsensusConfig.d.ts.map +1 -0
  272. package/build/consensus/ConsensusConfig.js +1 -0
  273. package/build/consensus/ConsensusConfig.js.map +1 -0
  274. package/build/consensus/IConsensusConfig.d.ts +1 -0
  275. package/build/consensus/IConsensusConfig.d.ts.map +1 -0
  276. package/build/consensus/IConsensusConfig.js +2 -1
  277. package/build/consensus/IConsensusConfig.js.map +1 -0
  278. package/build/consensus/metadata/RoswellConsensus.d.ts +2 -1
  279. package/build/consensus/metadata/RoswellConsensus.d.ts.map +1 -0
  280. package/build/consensus/metadata/RoswellConsensus.js +2 -0
  281. package/build/consensus/metadata/RoswellConsensus.js.map +1 -0
  282. package/build/crypto/crypto.d.ts +1 -0
  283. package/build/crypto/crypto.d.ts.map +1 -0
  284. package/build/crypto/crypto.js +1 -0
  285. package/build/crypto/crypto.js.map +1 -0
  286. package/build/deterministic/AddressMap.d.ts +6 -1
  287. package/build/deterministic/AddressMap.d.ts.map +1 -0
  288. package/build/deterministic/AddressMap.js +8 -0
  289. package/build/deterministic/AddressMap.js.map +1 -0
  290. package/build/deterministic/AddressSet.d.ts +3 -1
  291. package/build/deterministic/AddressSet.d.ts.map +1 -0
  292. package/build/deterministic/AddressSet.js +7 -0
  293. package/build/deterministic/AddressSet.js.map +1 -0
  294. package/build/deterministic/CustomMap.d.ts +3 -1
  295. package/build/deterministic/CustomMap.d.ts.map +1 -0
  296. package/build/deterministic/CustomMap.js +65 -47
  297. package/build/deterministic/CustomMap.js.map +1 -0
  298. package/build/deterministic/DeterministicMap.d.ts +4 -2
  299. package/build/deterministic/DeterministicMap.d.ts.map +1 -0
  300. package/build/deterministic/DeterministicMap.js +24 -27
  301. package/build/deterministic/DeterministicMap.js.map +1 -0
  302. package/build/deterministic/DeterministicSet.d.ts +3 -1
  303. package/build/deterministic/DeterministicSet.d.ts.map +1 -0
  304. package/build/deterministic/DeterministicSet.js +6 -0
  305. package/build/deterministic/DeterministicSet.js.map +1 -0
  306. package/build/deterministic/ExtendedAddressMap.d.ts +7 -1
  307. package/build/deterministic/ExtendedAddressMap.d.ts.map +1 -0
  308. package/build/deterministic/ExtendedAddressMap.js +18 -2
  309. package/build/deterministic/ExtendedAddressMap.js.map +1 -0
  310. package/build/deterministic/FastMap.d.ts +7 -1
  311. package/build/deterministic/FastMap.d.ts.map +1 -0
  312. package/build/deterministic/FastMap.js +7 -2
  313. package/build/deterministic/FastMap.js.map +1 -0
  314. package/build/ecc/backend.d.ts +13 -0
  315. package/build/ecc/backend.d.ts.map +1 -0
  316. package/build/ecc/backend.js +15 -0
  317. package/build/ecc/backend.js.map +1 -0
  318. package/build/epoch/ChallengeSolution.d.ts +34 -2
  319. package/build/epoch/ChallengeSolution.d.ts.map +1 -0
  320. package/build/epoch/ChallengeSolution.js +52 -0
  321. package/build/epoch/ChallengeSolution.js.map +1 -0
  322. package/build/epoch/interfaces/IChallengeSolution.d.ts +14 -13
  323. package/build/epoch/interfaces/IChallengeSolution.d.ts.map +1 -0
  324. package/build/epoch/interfaces/IChallengeSolution.js +2 -1
  325. package/build/epoch/interfaces/IChallengeSolution.js.map +1 -0
  326. package/build/epoch/validator/EpochValidator.d.ts +38 -8
  327. package/build/epoch/validator/EpochValidator.d.ts.map +1 -0
  328. package/build/epoch/validator/EpochValidator.js +45 -19
  329. package/build/epoch/validator/EpochValidator.js.map +1 -0
  330. package/build/event/NetEvent.d.ts +1 -0
  331. package/build/event/NetEvent.d.ts.map +1 -0
  332. package/build/event/NetEvent.js +3 -0
  333. package/build/event/NetEvent.js.map +1 -0
  334. package/build/generators/AddressGenerator.d.ts +4 -3
  335. package/build/generators/AddressGenerator.d.ts.map +1 -0
  336. package/build/generators/AddressGenerator.js +9 -4
  337. package/build/generators/AddressGenerator.js.map +1 -0
  338. package/build/generators/Features.d.ts +4 -3
  339. package/build/generators/Features.d.ts.map +1 -0
  340. package/build/generators/Features.js +1 -0
  341. package/build/generators/Features.js.map +1 -0
  342. package/build/generators/Generator.d.ts +47 -11
  343. package/build/generators/Generator.d.ts.map +1 -0
  344. package/build/generators/Generator.js +48 -12
  345. package/build/generators/Generator.js.map +1 -0
  346. package/build/generators/MLDSAData.d.ts +1 -0
  347. package/build/generators/MLDSAData.d.ts.map +1 -0
  348. package/build/generators/MLDSAData.js +1 -0
  349. package/build/generators/MLDSAData.js.map +1 -0
  350. package/build/generators/builders/CalldataGenerator.d.ts +27 -6
  351. package/build/generators/builders/CalldataGenerator.d.ts.map +1 -0
  352. package/build/generators/builders/CalldataGenerator.js +33 -4
  353. package/build/generators/builders/CalldataGenerator.js.map +1 -0
  354. package/build/generators/builders/CustomGenerator.d.ts +13 -3
  355. package/build/generators/builders/CustomGenerator.d.ts.map +1 -0
  356. package/build/generators/builders/CustomGenerator.js +11 -0
  357. package/build/generators/builders/CustomGenerator.js.map +1 -0
  358. package/build/generators/builders/DeploymentGenerator.d.ts +17 -6
  359. package/build/generators/builders/DeploymentGenerator.d.ts.map +1 -0
  360. package/build/generators/builders/DeploymentGenerator.js +18 -2
  361. package/build/generators/builders/DeploymentGenerator.js.map +1 -0
  362. package/build/generators/builders/HashCommitmentGenerator.d.ts +166 -14
  363. package/build/generators/builders/HashCommitmentGenerator.d.ts.map +1 -0
  364. package/build/generators/builders/HashCommitmentGenerator.js +193 -27
  365. package/build/generators/builders/HashCommitmentGenerator.js.map +1 -0
  366. package/build/generators/builders/LegacyCalldataGenerator.d.ts +27 -5
  367. package/build/generators/builders/LegacyCalldataGenerator.d.ts.map +1 -0
  368. package/build/generators/builders/LegacyCalldataGenerator.js +35 -5
  369. package/build/generators/builders/LegacyCalldataGenerator.js.map +1 -0
  370. package/build/generators/builders/MultiSignGenerator.d.ts +6 -1
  371. package/build/generators/builders/MultiSignGenerator.d.ts.map +1 -0
  372. package/build/generators/builders/MultiSignGenerator.js +20 -10
  373. package/build/generators/builders/MultiSignGenerator.js.map +1 -0
  374. package/build/generators/builders/P2WDAGenerator.d.ts +44 -6
  375. package/build/generators/builders/P2WDAGenerator.d.ts.map +1 -0
  376. package/build/generators/builders/P2WDAGenerator.js +41 -2
  377. package/build/generators/builders/P2WDAGenerator.js.map +1 -0
  378. package/build/index.d.ts +1 -0
  379. package/build/index.d.ts.map +1 -0
  380. package/build/index.js +1 -0
  381. package/build/index.js.map +1 -0
  382. package/build/keypair/Address.d.ts +284 -14
  383. package/build/keypair/Address.d.ts.map +1 -0
  384. package/build/keypair/Address.js +447 -129
  385. package/build/keypair/Address.js.map +1 -0
  386. package/build/keypair/AddressVerificator.d.ts +7 -6
  387. package/build/keypair/AddressVerificator.d.ts.map +1 -0
  388. package/build/keypair/AddressVerificator.js +4 -5
  389. package/build/keypair/AddressVerificator.js.map +1 -0
  390. package/build/keypair/EcKeyPair.d.ts +185 -22
  391. package/build/keypair/EcKeyPair.d.ts.map +1 -0
  392. package/build/keypair/EcKeyPair.js +226 -49
  393. package/build/keypair/EcKeyPair.js.map +1 -0
  394. package/build/keypair/MessageSigner.d.ts +18 -17
  395. package/build/keypair/MessageSigner.d.ts.map +1 -0
  396. package/build/keypair/MessageSigner.js +34 -25
  397. package/build/keypair/MessageSigner.js.map +1 -0
  398. package/build/keypair/Secp256k1PointDeriver.d.ts +55 -0
  399. package/build/keypair/Secp256k1PointDeriver.d.ts.map +1 -0
  400. package/build/keypair/Secp256k1PointDeriver.js +66 -0
  401. package/build/keypair/Secp256k1PointDeriver.js.map +1 -0
  402. package/build/keypair/Wallet.d.ts +29 -15
  403. package/build/keypair/Wallet.d.ts.map +1 -0
  404. package/build/keypair/Wallet.js +46 -14
  405. package/build/keypair/Wallet.js.map +1 -0
  406. package/build/keypair/interfaces/IWallet.d.ts +19 -0
  407. package/build/keypair/interfaces/IWallet.d.ts.map +1 -0
  408. package/build/keypair/interfaces/IWallet.js +1 -0
  409. package/build/keypair/interfaces/IWallet.js.map +1 -0
  410. package/build/metadata/ContractBaseMetadata.d.ts +10 -2
  411. package/build/metadata/ContractBaseMetadata.d.ts.map +1 -0
  412. package/build/metadata/ContractBaseMetadata.js +10 -1
  413. package/build/metadata/ContractBaseMetadata.js.map +1 -0
  414. package/build/mnemonic/BIPStandard.d.ts +59 -0
  415. package/build/mnemonic/BIPStandard.d.ts.map +1 -0
  416. package/build/mnemonic/BIPStandard.js +59 -0
  417. package/build/mnemonic/BIPStandard.js.map +1 -0
  418. package/build/mnemonic/Mnemonic.d.ts +16 -4
  419. package/build/mnemonic/Mnemonic.d.ts.map +1 -0
  420. package/build/mnemonic/Mnemonic.js +35 -8
  421. package/build/mnemonic/Mnemonic.js.map +1 -0
  422. package/build/mnemonic/MnemonicStrength.d.ts +6 -0
  423. package/build/mnemonic/MnemonicStrength.d.ts.map +1 -0
  424. package/build/mnemonic/MnemonicStrength.js +6 -0
  425. package/build/mnemonic/MnemonicStrength.js.map +1 -0
  426. package/build/network/ChainId.d.ts +1 -0
  427. package/build/network/ChainId.d.ts.map +1 -0
  428. package/build/network/ChainId.js +1 -0
  429. package/build/network/ChainId.js.map +1 -0
  430. package/build/opnet.d.ts +29 -3
  431. package/build/opnet.d.ts.map +1 -0
  432. package/build/opnet.js +26 -0
  433. package/build/opnet.js.map +1 -0
  434. package/build/p2wda/P2WDADetector.d.ts +38 -11
  435. package/build/p2wda/P2WDADetector.d.ts.map +1 -0
  436. package/build/p2wda/P2WDADetector.js +43 -10
  437. package/build/p2wda/P2WDADetector.js.map +1 -0
  438. package/build/polyfill/disposable.d.ts +16 -0
  439. package/build/polyfill/disposable.d.ts.map +1 -0
  440. package/build/polyfill/disposable.js +23 -0
  441. package/build/polyfill/disposable.js.map +1 -0
  442. package/build/signer/AddressRotation.d.ts +37 -1
  443. package/build/signer/AddressRotation.d.ts.map +1 -0
  444. package/build/signer/AddressRotation.js +16 -0
  445. package/build/signer/AddressRotation.js.map +1 -0
  446. package/build/signer/IRotationSigner.d.ts +27 -3
  447. package/build/signer/IRotationSigner.d.ts.map +1 -0
  448. package/build/signer/IRotationSigner.js +2 -1
  449. package/build/signer/IRotationSigner.js.map +1 -0
  450. package/build/signer/ParallelSignerAdapter.d.ts +14 -0
  451. package/build/signer/ParallelSignerAdapter.d.ts.map +1 -0
  452. package/build/signer/ParallelSignerAdapter.js +51 -0
  453. package/build/signer/ParallelSignerAdapter.js.map +1 -0
  454. package/build/signer/SignerUtils.d.ts +11 -4
  455. package/build/signer/SignerUtils.d.ts.map +1 -0
  456. package/build/signer/SignerUtils.js +16 -0
  457. package/build/signer/SignerUtils.js.map +1 -0
  458. package/build/signer/TweakedSigner.d.ts +28 -4
  459. package/build/signer/TweakedSigner.d.ts.map +1 -0
  460. package/build/signer/TweakedSigner.js +23 -6
  461. package/build/signer/TweakedSigner.js.map +1 -0
  462. package/build/transaction/ContractAddress.d.ts +2 -2
  463. package/build/transaction/ContractAddress.d.ts.map +1 -0
  464. package/build/transaction/ContractAddress.js +4 -8
  465. package/build/transaction/ContractAddress.js.map +1 -0
  466. package/build/transaction/TransactionFactory.d.ts +147 -9
  467. package/build/transaction/TransactionFactory.d.ts.map +1 -0
  468. package/build/transaction/TransactionFactory.js +145 -26
  469. package/build/transaction/TransactionFactory.js.map +1 -0
  470. package/build/transaction/browser/BrowserSignerBase.d.ts +12 -6
  471. package/build/transaction/browser/BrowserSignerBase.d.ts.map +1 -0
  472. package/build/transaction/browser/BrowserSignerBase.js +7 -0
  473. package/build/transaction/browser/BrowserSignerBase.js.map +1 -0
  474. package/build/transaction/browser/WalletNetworks.d.ts +1 -0
  475. package/build/transaction/browser/WalletNetworks.d.ts.map +1 -0
  476. package/build/transaction/browser/WalletNetworks.js +1 -0
  477. package/build/transaction/browser/WalletNetworks.js.map +1 -0
  478. package/build/transaction/browser/Web3Provider.d.ts +30 -3
  479. package/build/transaction/browser/Web3Provider.d.ts.map +1 -0
  480. package/build/transaction/browser/Web3Provider.js +1 -0
  481. package/build/transaction/browser/Web3Provider.js.map +1 -0
  482. package/build/transaction/browser/extensions/UnisatSigner.d.ts +11 -9
  483. package/build/transaction/browser/extensions/UnisatSigner.d.ts.map +1 -0
  484. package/build/transaction/browser/extensions/UnisatSigner.js +27 -17
  485. package/build/transaction/browser/extensions/UnisatSigner.js.map +1 -0
  486. package/build/transaction/browser/extensions/XverseSigner.d.ts +10 -8
  487. package/build/transaction/browser/extensions/XverseSigner.d.ts.map +1 -0
  488. package/build/transaction/browser/extensions/XverseSigner.js +25 -15
  489. package/build/transaction/browser/extensions/XverseSigner.js.map +1 -0
  490. package/build/transaction/browser/types/OPWallet.d.ts +12 -2
  491. package/build/transaction/browser/types/OPWallet.d.ts.map +1 -0
  492. package/build/transaction/browser/types/OPWallet.js +4 -0
  493. package/build/transaction/browser/types/OPWallet.js.map +1 -0
  494. package/build/transaction/browser/types/Unisat.d.ts +2 -1
  495. package/build/transaction/browser/types/Unisat.d.ts.map +1 -0
  496. package/build/transaction/browser/types/Unisat.js +2 -0
  497. package/build/transaction/browser/types/Unisat.js.map +1 -0
  498. package/build/transaction/browser/types/Xverse.d.ts +1 -0
  499. package/build/transaction/browser/types/Xverse.d.ts.map +1 -0
  500. package/build/transaction/browser/types/Xverse.js +1 -0
  501. package/build/transaction/browser/types/Xverse.js.map +1 -0
  502. package/build/transaction/builders/CancelTransaction.d.ts +31 -6
  503. package/build/transaction/builders/CancelTransaction.d.ts.map +1 -0
  504. package/build/transaction/builders/CancelTransaction.js +116 -33
  505. package/build/transaction/builders/CancelTransaction.js.map +1 -0
  506. package/build/transaction/builders/ChallengeSolutionTransaction.d.ts +1 -0
  507. package/build/transaction/builders/ChallengeSolutionTransaction.d.ts.map +1 -0
  508. package/build/transaction/builders/ChallengeSolutionTransaction.js +88 -0
  509. package/build/transaction/builders/ChallengeSolutionTransaction.js.map +1 -0
  510. package/build/transaction/builders/ConsolidatedInteractionTransaction.d.ts +140 -13
  511. package/build/transaction/builders/ConsolidatedInteractionTransaction.d.ts.map +1 -0
  512. package/build/transaction/builders/ConsolidatedInteractionTransaction.js +197 -20
  513. package/build/transaction/builders/ConsolidatedInteractionTransaction.js.map +1 -0
  514. package/build/transaction/builders/CustomScriptTransaction.d.ts +108 -8
  515. package/build/transaction/builders/CustomScriptTransaction.d.ts.map +1 -0
  516. package/build/transaction/builders/CustomScriptTransaction.js +176 -39
  517. package/build/transaction/builders/CustomScriptTransaction.js.map +1 -0
  518. package/build/transaction/builders/DeploymentTransaction.d.ts +120 -9
  519. package/build/transaction/builders/DeploymentTransaction.d.ts.map +1 -0
  520. package/build/transaction/builders/DeploymentTransaction.js +194 -51
  521. package/build/transaction/builders/DeploymentTransaction.js.map +1 -0
  522. package/build/transaction/builders/FundingTransaction.d.ts +6 -4
  523. package/build/transaction/builders/FundingTransaction.d.ts.map +1 -0
  524. package/build/transaction/builders/FundingTransaction.js +50 -9
  525. package/build/transaction/builders/FundingTransaction.js.map +1 -0
  526. package/build/transaction/builders/InteractionTransaction.d.ts +14 -5
  527. package/build/transaction/builders/InteractionTransaction.d.ts.map +1 -0
  528. package/build/transaction/builders/InteractionTransaction.js +18 -5
  529. package/build/transaction/builders/InteractionTransaction.js.map +1 -0
  530. package/build/transaction/builders/InteractionTransactionP2WDA.d.ts +58 -7
  531. package/build/transaction/builders/InteractionTransactionP2WDA.d.ts.map +1 -0
  532. package/build/transaction/builders/InteractionTransactionP2WDA.js +95 -18
  533. package/build/transaction/builders/InteractionTransactionP2WDA.js.map +1 -0
  534. package/build/transaction/builders/MultiSignTransaction.d.ts +126 -17
  535. package/build/transaction/builders/MultiSignTransaction.d.ts.map +1 -0
  536. package/build/transaction/builders/MultiSignTransaction.js +201 -76
  537. package/build/transaction/builders/MultiSignTransaction.js.map +1 -0
  538. package/build/transaction/builders/SharedInteractionTransaction.d.ts +106 -18
  539. package/build/transaction/builders/SharedInteractionTransaction.d.ts.map +1 -0
  540. package/build/transaction/builders/SharedInteractionTransaction.js +158 -40
  541. package/build/transaction/builders/SharedInteractionTransaction.js.map +1 -0
  542. package/build/transaction/builders/TransactionBuilder.d.ts +244 -20
  543. package/build/transaction/builders/TransactionBuilder.d.ts.map +1 -0
  544. package/build/transaction/builders/TransactionBuilder.js +371 -152
  545. package/build/transaction/builders/TransactionBuilder.js.map +1 -0
  546. package/build/transaction/enums/TransactionType.d.ts +1 -0
  547. package/build/transaction/enums/TransactionType.d.ts.map +1 -0
  548. package/build/transaction/enums/TransactionType.js +1 -0
  549. package/build/transaction/enums/TransactionType.js.map +1 -0
  550. package/build/transaction/interfaces/ICancelTransactionParameters.d.ts +3 -2
  551. package/build/transaction/interfaces/ICancelTransactionParameters.d.ts.map +1 -0
  552. package/build/transaction/interfaces/ICancelTransactionParameters.js +1 -0
  553. package/build/transaction/interfaces/ICancelTransactionParameters.js.map +1 -0
  554. package/build/transaction/interfaces/IConsolidatedTransactionParameters.d.ts +48 -5
  555. package/build/transaction/interfaces/IConsolidatedTransactionParameters.d.ts.map +1 -0
  556. package/build/transaction/interfaces/IConsolidatedTransactionParameters.js +1 -0
  557. package/build/transaction/interfaces/IConsolidatedTransactionParameters.js.map +1 -0
  558. package/build/transaction/interfaces/ICustomTransactionParameters.d.ts +7 -5
  559. package/build/transaction/interfaces/ICustomTransactionParameters.d.ts.map +1 -0
  560. package/build/transaction/interfaces/ICustomTransactionParameters.js +1 -0
  561. package/build/transaction/interfaces/ICustomTransactionParameters.js.map +1 -0
  562. package/build/transaction/interfaces/ITransactionParameters.d.ts +38 -15
  563. package/build/transaction/interfaces/ITransactionParameters.d.ts.map +1 -0
  564. package/build/transaction/interfaces/ITransactionParameters.js +1 -0
  565. package/build/transaction/interfaces/ITransactionParameters.js.map +1 -0
  566. package/build/transaction/interfaces/ITransactionResponses.d.ts +3 -2
  567. package/build/transaction/interfaces/ITransactionResponses.d.ts.map +1 -0
  568. package/build/transaction/interfaces/ITransactionResponses.js +1 -0
  569. package/build/transaction/interfaces/ITransactionResponses.js.map +1 -0
  570. package/build/transaction/interfaces/ITweakedTransactionData.d.ts +21 -8
  571. package/build/transaction/interfaces/ITweakedTransactionData.d.ts.map +1 -0
  572. package/build/transaction/interfaces/ITweakedTransactionData.js +1 -0
  573. package/build/transaction/interfaces/ITweakedTransactionData.js.map +1 -0
  574. package/build/transaction/interfaces/IWeb3ProviderTypes.d.ts +29 -3
  575. package/build/transaction/interfaces/IWeb3ProviderTypes.d.ts.map +1 -0
  576. package/build/transaction/interfaces/IWeb3ProviderTypes.js +2 -1
  577. package/build/transaction/interfaces/IWeb3ProviderTypes.js.map +1 -0
  578. package/build/transaction/interfaces/Tap.d.ts +4 -3
  579. package/build/transaction/interfaces/Tap.d.ts.map +1 -0
  580. package/build/transaction/interfaces/Tap.js +1 -0
  581. package/build/transaction/interfaces/Tap.js.map +1 -0
  582. package/build/transaction/mineable/IP2WSHAddress.d.ts +2 -1
  583. package/build/transaction/mineable/IP2WSHAddress.d.ts.map +1 -0
  584. package/build/transaction/mineable/IP2WSHAddress.js +1 -0
  585. package/build/transaction/mineable/IP2WSHAddress.js.map +1 -0
  586. package/build/transaction/mineable/TimelockGenerator.d.ts +13 -4
  587. package/build/transaction/mineable/TimelockGenerator.d.ts.map +1 -0
  588. package/build/transaction/mineable/TimelockGenerator.js +12 -3
  589. package/build/transaction/mineable/TimelockGenerator.js.map +1 -0
  590. package/build/transaction/offline/OfflineTransactionManager.d.ts +193 -12
  591. package/build/transaction/offline/OfflineTransactionManager.d.ts.map +1 -0
  592. package/build/transaction/offline/OfflineTransactionManager.js +192 -8
  593. package/build/transaction/offline/OfflineTransactionManager.js.map +1 -0
  594. package/build/transaction/offline/TransactionReconstructor.d.ts +56 -6
  595. package/build/transaction/offline/TransactionReconstructor.d.ts.map +1 -0
  596. package/build/transaction/offline/TransactionReconstructor.js +111 -75
  597. package/build/transaction/offline/TransactionReconstructor.js.map +1 -0
  598. package/build/transaction/offline/TransactionSerializer.d.ts +54 -3
  599. package/build/transaction/offline/TransactionSerializer.d.ts.map +1 -0
  600. package/build/transaction/offline/TransactionSerializer.js +206 -95
  601. package/build/transaction/offline/TransactionSerializer.js.map +1 -0
  602. package/build/transaction/offline/TransactionStateCapture.d.ts +66 -7
  603. package/build/transaction/offline/TransactionStateCapture.d.ts.map +1 -0
  604. package/build/transaction/offline/TransactionStateCapture.js +124 -60
  605. package/build/transaction/offline/TransactionStateCapture.js.map +1 -0
  606. package/build/transaction/offline/interfaces/ISerializableState.d.ts +72 -1
  607. package/build/transaction/offline/interfaces/ISerializableState.d.ts.map +1 -0
  608. package/build/transaction/offline/interfaces/ISerializableState.js +10 -1
  609. package/build/transaction/offline/interfaces/ISerializableState.js.map +1 -0
  610. package/build/transaction/offline/interfaces/ITypeSpecificData.d.ts +77 -1
  611. package/build/transaction/offline/interfaces/ITypeSpecificData.d.ts.map +1 -0
  612. package/build/transaction/offline/interfaces/ITypeSpecificData.js +19 -0
  613. package/build/transaction/offline/interfaces/ITypeSpecificData.js.map +1 -0
  614. package/build/transaction/psbt/PSBTTypes.d.ts +1 -0
  615. package/build/transaction/psbt/PSBTTypes.d.ts.map +1 -0
  616. package/build/transaction/psbt/PSBTTypes.js +1 -0
  617. package/build/transaction/psbt/PSBTTypes.js.map +1 -0
  618. package/build/transaction/shared/P2TR_MS.d.ts +11 -2
  619. package/build/transaction/shared/P2TR_MS.d.ts.map +1 -0
  620. package/build/transaction/shared/P2TR_MS.js +10 -0
  621. package/build/transaction/shared/P2TR_MS.js.map +1 -0
  622. package/build/transaction/shared/TweakedTransaction.d.ts +280 -38
  623. package/build/transaction/shared/TweakedTransaction.d.ts.map +1 -0
  624. package/build/transaction/shared/TweakedTransaction.js +576 -114
  625. package/build/transaction/shared/TweakedTransaction.js.map +1 -0
  626. package/build/transaction/utils/WitnessUtils.d.ts +7 -1
  627. package/build/transaction/utils/WitnessUtils.d.ts.map +1 -0
  628. package/build/transaction/utils/WitnessUtils.js +17 -3
  629. package/build/transaction/utils/WitnessUtils.js.map +1 -0
  630. package/build/tsconfig.build.tsbuildinfo +1 -1
  631. package/build/utils/BitcoinUtils.d.ts +19 -0
  632. package/build/utils/BitcoinUtils.d.ts.map +1 -0
  633. package/build/utils/BitcoinUtils.js +19 -0
  634. package/build/utils/BitcoinUtils.js.map +1 -0
  635. package/build/utils/BufferHelper.d.ts +2 -1
  636. package/build/utils/BufferHelper.d.ts.map +1 -0
  637. package/build/utils/BufferHelper.js +38 -32
  638. package/build/utils/BufferHelper.js.map +1 -0
  639. package/build/utils/StringToBuffer.d.ts +1 -0
  640. package/build/utils/StringToBuffer.d.ts.map +1 -0
  641. package/build/utils/StringToBuffer.js +1 -0
  642. package/build/utils/StringToBuffer.js.map +1 -0
  643. package/build/utils/lengths.d.ts +1 -0
  644. package/build/utils/lengths.d.ts.map +1 -0
  645. package/build/utils/lengths.js +1 -0
  646. package/build/utils/lengths.js.map +1 -0
  647. package/build/utils/types.d.ts +1 -0
  648. package/build/utils/types.d.ts.map +1 -0
  649. package/build/utils/types.js +2 -1
  650. package/build/utils/types.js.map +1 -0
  651. package/build/utxo/OPNetLimitedProvider.d.ts +39 -3
  652. package/build/utxo/OPNetLimitedProvider.d.ts.map +1 -0
  653. package/build/utxo/OPNetLimitedProvider.js +43 -5
  654. package/build/utxo/OPNetLimitedProvider.js.map +1 -0
  655. package/build/utxo/interfaces/BroadcastResponse.d.ts +1 -0
  656. package/build/utxo/interfaces/BroadcastResponse.d.ts.map +1 -0
  657. package/build/utxo/interfaces/BroadcastResponse.js +1 -0
  658. package/build/utxo/interfaces/BroadcastResponse.js.map +1 -0
  659. package/build/utxo/interfaces/IUTXO.d.ts +13 -7
  660. package/build/utxo/interfaces/IUTXO.d.ts.map +1 -0
  661. package/build/utxo/interfaces/IUTXO.js +1 -0
  662. package/build/utxo/interfaces/IUTXO.js.map +1 -0
  663. package/build/verification/TapscriptVerificator.d.ts +12 -10
  664. package/build/verification/TapscriptVerificator.d.ts.map +1 -0
  665. package/build/verification/TapscriptVerificator.js +28 -38
  666. package/build/verification/TapscriptVerificator.js.map +1 -0
  667. package/documentation/offline-transaction-signing.md +10 -8
  668. package/documentation/quantum-support/01-introduction.md +2 -2
  669. package/documentation/quantum-support/02-mnemonic-and-wallet.md +5 -3
  670. package/documentation/quantum-support/03-address-generation.md +6 -4
  671. package/documentation/quantum-support/04-message-signing.md +36 -43
  672. package/documentation/quantum-support/05-address-verification.md +13 -18
  673. package/documentation/quantum-support/README.md +1 -1
  674. package/documentation/transaction-building.md +9 -9
  675. package/eslint.config.js +0 -1
  676. package/package.json +16 -39
  677. package/src/_version.ts +1 -1
  678. package/src/abi/ABICoder.ts +131 -154
  679. package/src/abi/ABIDataTypes.ts +45 -0
  680. package/src/abi/AbiTypes.ts +183 -0
  681. package/src/abi/TupleUtils.ts +57 -0
  682. package/src/branded/Branded.ts +5 -0
  683. package/src/buffer/BinaryReader.ts +7 -7
  684. package/src/buffer/BinaryWriter.ts +29 -24
  685. package/src/bytecode/Compressor.ts +1 -1
  686. package/src/chain/ChainData.ts +36 -25
  687. package/src/consensus/ConsensusConfig.ts +1 -1
  688. package/src/consensus/IConsensusConfig.ts +0 -17
  689. package/src/consensus/metadata/RoswellConsensus.ts +1 -17
  690. package/src/crypto/crypto-browser.js +3 -4
  691. package/src/deterministic/AddressMap.ts +5 -1
  692. package/src/deterministic/AddressSet.ts +5 -1
  693. package/src/deterministic/CustomMap.ts +6 -2
  694. package/src/deterministic/DeterministicMap.ts +8 -4
  695. package/src/deterministic/DeterministicSet.ts +6 -2
  696. package/src/deterministic/ExtendedAddressMap.ts +9 -4
  697. package/src/deterministic/FastMap.ts +9 -5
  698. package/src/ecc/backend.ts +17 -0
  699. package/src/epoch/ChallengeSolution.ts +3 -3
  700. package/src/epoch/interfaces/IChallengeSolution.ts +13 -13
  701. package/src/epoch/validator/EpochValidator.ts +24 -43
  702. package/src/generators/AddressGenerator.ts +4 -7
  703. package/src/generators/Features.ts +3 -3
  704. package/src/generators/Generator.ts +42 -26
  705. package/src/generators/builders/CalldataGenerator.ts +26 -24
  706. package/src/generators/builders/CustomGenerator.ts +4 -4
  707. package/src/generators/builders/DeploymentGenerator.ts +25 -23
  708. package/src/generators/builders/HashCommitmentGenerator.ts +31 -31
  709. package/src/generators/builders/LegacyCalldataGenerator.ts +26 -24
  710. package/src/generators/builders/MultiSignGenerator.ts +12 -12
  711. package/src/generators/builders/P2WDAGenerator.ts +10 -10
  712. package/src/keypair/Address.ts +115 -72
  713. package/src/keypair/AddressVerificator.ts +14 -148
  714. package/src/keypair/EcKeyPair.ts +110 -111
  715. package/src/keypair/MessageSigner.ts +70 -150
  716. package/src/keypair/Wallet.ts +56 -241
  717. package/src/metadata/ContractBaseMetadata.ts +2 -2
  718. package/src/mnemonic/Mnemonic.ts +31 -222
  719. package/src/opnet.ts +15 -6
  720. package/src/p2wda/P2WDADetector.ts +23 -72
  721. package/src/polyfill/disposable.ts +29 -0
  722. package/src/signer/AddressRotation.ts +1 -1
  723. package/src/signer/IRotationSigner.ts +3 -3
  724. package/src/signer/ParallelSignerAdapter.ts +59 -0
  725. package/src/signer/SignerUtils.ts +4 -4
  726. package/src/signer/TweakedSigner.ts +26 -14
  727. package/src/transaction/ContractAddress.ts +3 -7
  728. package/src/transaction/TransactionFactory.ts +38 -53
  729. package/src/transaction/browser/BrowserSignerBase.ts +12 -6
  730. package/src/transaction/browser/Web3Provider.ts +3 -3
  731. package/src/transaction/browser/extensions/UnisatSigner.ts +52 -48
  732. package/src/transaction/browser/extensions/XverseSigner.ts +55 -38
  733. package/src/transaction/browser/types/OPWallet.ts +2 -2
  734. package/src/transaction/browser/types/Unisat.ts +1 -1
  735. package/src/transaction/builders/CancelTransaction.ts +59 -24
  736. package/src/transaction/builders/ChallengeSolutionTransaction.ts +3 -3
  737. package/src/transaction/builders/ConsolidatedInteractionTransaction.ts +39 -34
  738. package/src/transaction/builders/CustomScriptTransaction.ts +79 -56
  739. package/src/transaction/builders/DeploymentTransaction.ts +82 -63
  740. package/src/transaction/builders/FundingTransaction.ts +53 -12
  741. package/src/transaction/builders/InteractionTransaction.ts +10 -10
  742. package/src/transaction/builders/InteractionTransactionP2WDA.ts +38 -40
  743. package/src/transaction/builders/MultiSignTransaction.ts +68 -61
  744. package/src/transaction/builders/SharedInteractionTransaction.ts +81 -57
  745. package/src/transaction/builders/TransactionBuilder.ts +159 -255
  746. package/src/transaction/interfaces/ICancelTransactionParameters.ts +2 -2
  747. package/src/transaction/interfaces/IConsolidatedTransactionParameters.ts +5 -5
  748. package/src/transaction/interfaces/ICustomTransactionParameters.ts +5 -5
  749. package/src/transaction/interfaces/ITransactionParameters.ts +28 -15
  750. package/src/transaction/interfaces/ITransactionResponses.ts +2 -2
  751. package/src/transaction/interfaces/ITweakedTransactionData.ts +17 -8
  752. package/src/transaction/interfaces/IWeb3ProviderTypes.ts +3 -3
  753. package/src/transaction/interfaces/Tap.ts +3 -3
  754. package/src/transaction/mineable/IP2WSHAddress.ts +1 -1
  755. package/src/transaction/mineable/TimelockGenerator.ts +19 -12
  756. package/src/transaction/offline/OfflineTransactionManager.ts +22 -23
  757. package/src/transaction/offline/TransactionReconstructor.ts +83 -91
  758. package/src/transaction/offline/TransactionSerializer.ts +151 -101
  759. package/src/transaction/offline/TransactionStateCapture.ts +83 -79
  760. package/src/transaction/offline/interfaces/ISerializableState.ts +1 -1
  761. package/src/transaction/offline/interfaces/ITypeSpecificData.ts +1 -1
  762. package/src/transaction/shared/P2TR_MS.ts +4 -4
  763. package/src/transaction/shared/TweakedTransaction.ts +318 -125
  764. package/src/transaction/utils/WitnessUtils.ts +18 -9
  765. package/src/utils/BufferHelper.ts +39 -37
  766. package/src/utxo/OPNetLimitedProvider.ts +9 -9
  767. package/src/utxo/interfaces/IUTXO.ts +7 -7
  768. package/src/verification/TapscriptVerificator.ts +73 -86
  769. package/test/add-refund-output.test.ts +535 -0
  770. package/test/address-rotation.test.ts +24 -24
  771. package/test/address.test.ts +12 -12
  772. package/test/addressmap.test.ts +30 -30
  773. package/test/binary-reader-writer.test.ts +8 -8
  774. package/test/browser/offline-transaction.test.ts +2206 -0
  775. package/test/browser/parallel-signing.test.ts +316 -0
  776. package/test/browser/setup.ts +11 -0
  777. package/test/browser/transaction-signing.test.ts +416 -0
  778. package/test/buffer-helper.test.ts +287 -0
  779. package/test/derivePath.test.ts +4 -3
  780. package/test/disposable.test.ts +279 -0
  781. package/test/fastmap-setall.test.ts +1 -1
  782. package/test/fastmap.test.ts +3 -3
  783. package/test/messagesigner-mldsa.test.ts +3 -3
  784. package/test/messagesigner-schnorr.test.ts +9 -9
  785. package/test/offline-transaction.test.ts +461 -288
  786. package/test/old/FastBigIntMap.ts +3 -3
  787. package/test/oldfastmap.test.ts +6 -6
  788. package/test/transaction-builders.test.ts +482 -0
  789. package/tsconfig.base.json +34 -18
  790. package/tsconfig.browser.json +15 -0
  791. package/tsconfig.json +3 -8
  792. package/vite.config.browser.ts +4 -5
  793. package/vitest.config.browser.ts +68 -0
  794. package/vitest.config.ts +1 -1
  795. package/browser/valibot.js +0 -4948
  796. package/tsconfig.webpack.json +0 -18
@@ -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,43 @@
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);
3
+ function networkKey(network: Network): string {
4
+ return `${network.messagePrefix}|${network.bech32}`;
5
5
  }
6
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
- }
7
+ const CHAIN_IDS: ReadonlyMap<string, Uint8Array> = new Map([
8
+ [
9
+ networkKey(networks.bitcoin),
10
+ new Uint8Array([
11
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0xd6, 0x68, 0x9c, 0x08, 0x5a, 0xe1, 0x65, 0x83,
12
+ 0x1e, 0x93, 0x4f, 0xf7, 0x63, 0xae, 0x46, 0xa2, 0xa6, 0xc1, 0x72, 0xb3, 0xf1, 0xb6,
13
+ 0x0a, 0x8c, 0xe2, 0x6f,
14
+ ]),
15
+ ],
16
+ [
17
+ networkKey(networks.testnet),
18
+ new Uint8Array([
19
+ 0x00, 0x00, 0x00, 0x00, 0x09, 0x33, 0xea, 0x01, 0xad, 0x0e, 0xe9, 0x84, 0x20, 0x97,
20
+ 0x79, 0xba, 0xae, 0xc3, 0xce, 0xd9, 0x0f, 0xa3, 0xf4, 0x08, 0x71, 0x95, 0x26, 0xf8,
21
+ 0xd7, 0x7f, 0x49, 0x43,
22
+ ]),
23
+ ],
24
+ [
25
+ networkKey(networks.regtest),
26
+ new Uint8Array([
27
+ 0x0f, 0x91, 0x88, 0xf1, 0x3c, 0xb7, 0xb2, 0xc7, 0x1f, 0x2a, 0x33, 0x5e, 0x3a, 0x4f,
28
+ 0xc3, 0x28, 0xbf, 0x5b, 0xeb, 0x43, 0x60, 0x12, 0xaf, 0xca, 0x59, 0x0b, 0x1a, 0x11,
29
+ 0x46, 0x6e, 0x22, 0x06,
30
+ ]),
31
+ ],
32
+ ]);
22
33
 
23
34
  export function getChainId(network: Network): Uint8Array {
24
- return Uint8Array.from(Buffer.from(getChainIdHex(network), 'hex'));
35
+ const chainId = CHAIN_IDS.get(networkKey(network));
36
+ if (!chainId) throw new Error('Unsupported network for chain ID retrieval');
37
+ return chainId.slice();
25
38
  }
26
39
 
27
- export const BITCOIN_PROTOCOL_ID = Uint8Array.from(
28
- Buffer.from(
29
- 'e784995a412d773988c4b8e333d7b39dfb3cabf118d0d645411a916ca2407939', // sha256("OP_NET")
30
- 'hex',
31
- ),
32
- );
40
+ export const BITCOIN_PROTOCOL_ID = new Uint8Array([
41
+ 0xe7, 0x84, 0x99, 0x5a, 0x41, 0x2d, 0x77, 0x39, 0x88, 0xc4, 0xb8, 0xe3, 0x33, 0xd7, 0xb3, 0x9d,
42
+ 0xfb, 0x3c, 0xab, 0xf1, 0x18, 0xd0, 0xd6, 0x45, 0x41, 0x1a, 0x91, 0x6c, 0xa2, 0x40, 0x79, 0x39,
43
+ ]);
@@ -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,8 +1,7 @@
1
1
  /* Browser Crypto Shims */
2
- import { hmac } from '@noble/hashes/hmac';
3
- import { pbkdf2 } from '@noble/hashes/pbkdf2';
4
- import { sha256 } from '@noble/hashes/sha256';
5
- import { sha512 } from '@noble/hashes/sha512';
2
+ import { hmac } from '@noble/hashes/hmac.js';
3
+ import { pbkdf2 } from '@noble/hashes/pbkdf2.js';
4
+ import { sha256, sha512 } from '@noble/hashes/sha2.js';
6
5
 
7
6
  function assertArgument(check, message, name, value) {
8
7
  if (!check) {
@@ -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 };
@@ -5,9 +5,10 @@ import { FastMap } from './FastMap.js';
5
5
  * A map implementation using Address with both MLDSA and tweaked keys.
6
6
  * Uses the tweaked public key for lookup/indexing, but stores the full Address.
7
7
  */
8
- export class ExtendedAddressMap<V> {
8
+ export class ExtendedAddressMap<V> implements Disposable {
9
9
  // Store tweaked bigint -> index mapping for fast lookup
10
10
  private indexMap: FastMap<bigint, number>;
11
+
11
12
  // Store actual addresses and values
12
13
  private _keys: Address[] = [];
13
14
  private _values: V[] = [];
@@ -72,7 +73,7 @@ export class ExtendedAddressMap<V> {
72
73
  // Rebuild index map (indices shifted after splice)
73
74
  this.indexMap.clear();
74
75
  for (let i = 0; i < this._keys.length; i++) {
75
- this.indexMap.set(this._keys[i].tweakedToBigInt(), i);
76
+ this.indexMap.set((this._keys[i] as Address).tweakedToBigInt(), i);
76
77
  }
77
78
 
78
79
  return true;
@@ -84,6 +85,10 @@ export class ExtendedAddressMap<V> {
84
85
  this._values = [];
85
86
  }
86
87
 
88
+ public [Symbol.dispose](): void {
89
+ this.clear();
90
+ }
91
+
87
92
  public indexOf(address: Address): number {
88
93
  const index = this.indexMap.get(address.tweakedToBigInt());
89
94
  return index !== undefined ? index : -1;
@@ -91,7 +96,7 @@ export class ExtendedAddressMap<V> {
91
96
 
92
97
  *entries(): IterableIterator<[Address, V]> {
93
98
  for (let i = 0; i < this._keys.length; i++) {
94
- yield [this._keys[i], this._values[i]];
99
+ yield [this._keys[i] as Address, this._values[i] as V];
95
100
  }
96
101
  }
97
102
 
@@ -112,7 +117,7 @@ export class ExtendedAddressMap<V> {
112
117
  thisArg?: unknown,
113
118
  ): void {
114
119
  for (let i = 0; i < this._keys.length; i++) {
115
- callback.call(thisArg, this._values[i], this._keys[i], this);
120
+ callback.call(thisArg, this._values[i] as V, this._keys[i] as Address, this);
116
121
  }
117
122
  }
118
123
 
@@ -10,7 +10,7 @@ export type FastRecord<V> = {
10
10
 
11
11
  export type IndexKey = string | number;
12
12
 
13
- export class FastMap<K extends PropertyExtendedKey, V> {
13
+ export class FastMap<K extends PropertyExtendedKey, V> implements Disposable {
14
14
  protected _keys: K[] = [];
15
15
  protected _values: FastRecord<V> = {};
16
16
 
@@ -47,13 +47,13 @@ export class FastMap<K extends PropertyExtendedKey, V> {
47
47
 
48
48
  public *values(): IterableIterator<V> {
49
49
  for (const key of this._keys) {
50
- yield this._values[key as IndexKey];
50
+ yield this._values[key as IndexKey] as V;
51
51
  }
52
52
  }
53
53
 
54
54
  public *entries(): IterableIterator<[K, V]> {
55
55
  for (const key of this._keys) {
56
- yield [key, this._values[key as IndexKey]];
56
+ yield [key, this._values[key as IndexKey] as V];
57
57
  }
58
58
  }
59
59
 
@@ -107,18 +107,22 @@ export class FastMap<K extends PropertyExtendedKey, V> {
107
107
  this._values = {};
108
108
  }
109
109
 
110
+ public [Symbol.dispose](): void {
111
+ this.clear();
112
+ }
113
+
110
114
  public forEach(
111
115
  callback: (value: V, key: K, map: FastMap<K, V>) => void,
112
116
  thisArg?: unknown,
113
117
  ): void {
114
118
  for (const key of this._keys) {
115
- callback.call(thisArg, this._values[key as IndexKey], key, this);
119
+ callback.call(thisArg, this._values[key as IndexKey] as V, key, this);
116
120
  }
117
121
  }
118
122
 
119
123
  *[Symbol.iterator](): IterableIterator<[K, V]> {
120
124
  for (const key of this._keys) {
121
- yield [key, this._values[key as IndexKey]];
125
+ yield [key, this._values[key as IndexKey] as V];
122
126
  }
123
127
  }
124
128
  }
@@ -0,0 +1,17 @@
1
+ import { createNobleBackend, type CryptoBackend } from '@btc-vision/ecpair';
2
+ import { type EccLib, initEccLib } from '@btc-vision/bitcoin';
3
+
4
+ /**
5
+ * Shared noble-curves backend for all EC operations.
6
+ * Instantiated once and reused across the entire library.
7
+ */
8
+ export const backend: CryptoBackend = createNobleBackend();
9
+
10
+ /**
11
+ * EccLib is now a type alias for CryptoBackend.
12
+ * The backend can be used directly.
13
+ */
14
+ export const eccLib: EccLib = backend;
15
+
16
+ // Initialize the ECC library once at module load
17
+ initEccLib(eccLib);
@@ -1,5 +1,5 @@
1
1
  import { stringToBuffer } from '../utils/StringToBuffer.js';
2
- import {
2
+ import type {
3
3
  IChallengeSolution,
4
4
  IChallengeSubmission,
5
5
  IChallengeVerification,
@@ -76,7 +76,7 @@ export class ChallengeSolution implements IChallengeSolution {
76
76
  public readonly difficulty: number;
77
77
  public readonly verification: ChallengeVerification;
78
78
 
79
- private readonly submission?: ChallengeSubmission;
79
+ private readonly submission?: ChallengeSubmission | undefined;
80
80
 
81
81
  constructor(data: RawChallenge) {
82
82
  this.epochNumber = BigInt(data.epochNumber);
@@ -170,7 +170,7 @@ export class ChallengeSolution implements IChallengeSolution {
170
170
  * Calculate the expected solution hash for this challenge
171
171
  * @returns {Promise<Buffer>} The calculated solution hash
172
172
  */
173
- public calculateSolution(): Buffer {
173
+ public calculateSolution(): Uint8Array {
174
174
  return EpochValidator.calculateSolution(
175
175
  this.verification.targetChecksum,
176
176
  this.publicKey.toBuffer(),
@@ -1,21 +1,21 @@
1
1
  import { Address } from '../../keypair/Address.js';
2
2
 
3
3
  export interface IChallengeVerification {
4
- readonly epochHash: Buffer;
5
- readonly epochRoot: Buffer;
6
- readonly targetHash: Buffer;
7
- readonly targetChecksum: Buffer;
4
+ readonly epochHash: Uint8Array;
5
+ readonly epochRoot: Uint8Array;
6
+ readonly targetHash: Uint8Array;
7
+ readonly targetChecksum: Uint8Array;
8
8
  readonly startBlock: bigint;
9
9
  readonly endBlock: bigint;
10
- readonly proofs: readonly Buffer[];
10
+ readonly proofs: readonly Uint8Array[];
11
11
  }
12
12
 
13
13
  export interface IChallengeSolution {
14
14
  readonly epochNumber: bigint;
15
15
  readonly publicKey: Address;
16
- readonly solution: Buffer;
17
- readonly salt: Buffer;
18
- readonly graffiti: Buffer;
16
+ readonly solution: Uint8Array;
17
+ readonly salt: Uint8Array;
18
+ readonly graffiti: Uint8Array;
19
19
  readonly difficulty: number;
20
20
  readonly verification: IChallengeVerification;
21
21
 
@@ -23,9 +23,9 @@ export interface IChallengeSolution {
23
23
  getSubmission(): IChallengeSubmission | undefined;
24
24
  toRaw(): RawChallenge;
25
25
  verify(): boolean;
26
- toBuffer(): Buffer;
26
+ toBuffer(): Uint8Array;
27
27
  toHex(): string;
28
- calculateSolution(): Buffer;
28
+ calculateSolution(): Uint8Array;
29
29
  checkDifficulty(minDifficulty: number): { valid: boolean; difficulty: number };
30
30
  getMiningTargetBlock(): bigint | null;
31
31
  }
@@ -50,9 +50,9 @@ export interface RawChallengeSubmission {
50
50
 
51
51
  export interface IChallengeSubmission {
52
52
  readonly publicKey: Address;
53
- readonly solution: Buffer;
54
- readonly graffiti: Buffer | undefined;
55
- readonly signature: Buffer;
53
+ readonly solution: Uint8Array;
54
+ readonly graffiti: Uint8Array | undefined;
55
+ readonly signature: Uint8Array;
56
56
  readonly epochNumber: bigint;
57
57
  verifySignature(): boolean;
58
58
  }