@btc-vision/transaction 1.7.7 → 1.7.11

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 (174) hide show
  1. package/browser/_version.d.ts +1 -0
  2. package/browser/chain/ChainData.d.ts +4 -0
  3. package/browser/{src/epoch → epoch}/interfaces/IChallengeSolution.d.ts +4 -4
  4. package/browser/{src/generators → generators}/Features.d.ts +6 -1
  5. package/browser/{src/generators → generators}/Generator.d.ts +1 -0
  6. package/browser/generators/MLDSAData.d.ts +15 -0
  7. package/browser/index.js +1 -1
  8. package/browser/{src/keypair → keypair}/Address.d.ts +9 -3
  9. package/browser/{src/keypair → keypair}/MessageSigner.d.ts +9 -0
  10. package/browser/{src/opnet.d.ts → opnet.d.ts} +1 -0
  11. package/browser/{src/transaction → transaction}/browser/Web3Provider.d.ts +15 -4
  12. package/browser/transaction/browser/types/OPWallet.d.ts +6 -0
  13. package/browser/{src/transaction → transaction}/builders/CustomScriptTransaction.d.ts +1 -0
  14. package/browser/{src/transaction → transaction}/builders/DeploymentTransaction.d.ts +1 -0
  15. package/browser/{src/transaction → transaction}/builders/TransactionBuilder.d.ts +4 -0
  16. package/browser/{src/transaction → transaction}/interfaces/ITransactionParameters.d.ts +3 -0
  17. package/browser/{src/transaction → transaction}/shared/TweakedTransaction.d.ts +6 -0
  18. package/browser/{src/utxo → utxo}/OPNetLimitedProvider.d.ts +1 -0
  19. package/build/_version.d.ts +1 -1
  20. package/build/_version.js +1 -1
  21. package/build/chain/ChainData.d.ts +4 -0
  22. package/build/chain/ChainData.js +20 -0
  23. package/build/epoch/ChallengeSolution.js +4 -4
  24. package/build/epoch/interfaces/IChallengeSolution.d.ts +4 -4
  25. package/build/generators/Features.d.ts +6 -1
  26. package/build/generators/Features.js +1 -0
  27. package/build/generators/Generator.d.ts +1 -0
  28. package/build/generators/Generator.js +24 -2
  29. package/build/generators/MLDSAData.d.ts +15 -0
  30. package/build/generators/MLDSAData.js +19 -0
  31. package/build/generators/builders/CalldataGenerator.js +1 -1
  32. package/build/generators/builders/DeploymentGenerator.js +1 -1
  33. package/build/generators/builders/P2WDAGenerator.js +1 -1
  34. package/build/keypair/Address.d.ts +9 -3
  35. package/build/keypair/Address.js +63 -38
  36. package/build/keypair/MessageSigner.d.ts +9 -0
  37. package/build/keypair/MessageSigner.js +101 -3
  38. package/build/opnet.d.ts +1 -0
  39. package/build/opnet.js +1 -0
  40. package/build/transaction/TransactionFactory.js +3 -0
  41. package/build/transaction/browser/Web3Provider.d.ts +15 -4
  42. package/build/transaction/browser/types/OPWallet.d.ts +2 -10
  43. package/build/transaction/browser/types/OPWallet.js +4 -2
  44. package/build/transaction/builders/CustomScriptTransaction.d.ts +1 -0
  45. package/build/transaction/builders/CustomScriptTransaction.js +3 -0
  46. package/build/transaction/builders/DeploymentTransaction.d.ts +1 -0
  47. package/build/transaction/builders/DeploymentTransaction.js +26 -1
  48. package/build/transaction/builders/InteractionTransaction.js +14 -1
  49. package/build/transaction/builders/InteractionTransactionP2WDA.js +14 -1
  50. package/build/transaction/builders/TransactionBuilder.d.ts +4 -0
  51. package/build/transaction/builders/TransactionBuilder.js +77 -0
  52. package/build/transaction/interfaces/ITransactionParameters.d.ts +3 -0
  53. package/build/transaction/shared/P2TR_MS.js +1 -0
  54. package/build/transaction/shared/TweakedTransaction.d.ts +6 -0
  55. package/build/transaction/shared/TweakedTransaction.js +19 -1
  56. package/build/utxo/OPNetLimitedProvider.d.ts +1 -0
  57. package/build/utxo/OPNetLimitedProvider.js +11 -1
  58. package/eslint.config.js +2 -1
  59. package/package.json +2 -1
  60. package/src/_version.ts +1 -1
  61. package/src/chain/ChainData.ts +32 -0
  62. package/src/deterministic/DeterministicSet.ts +2 -1
  63. package/src/epoch/ChallengeSolution.ts +4 -4
  64. package/src/epoch/interfaces/IChallengeSolution.ts +4 -4
  65. package/src/generators/Features.ts +8 -2
  66. package/src/generators/Generator.ts +35 -2
  67. package/src/generators/MLDSAData.ts +30 -0
  68. package/src/generators/builders/CalldataGenerator.ts +1 -1
  69. package/src/generators/builders/DeploymentGenerator.ts +2 -1
  70. package/src/generators/builders/LegacyCalldataGenerator.ts +1 -0
  71. package/src/generators/builders/P2WDAGenerator.ts +5 -1
  72. package/src/keypair/Address.ts +78 -38
  73. package/src/keypair/MessageSigner.ts +214 -15
  74. package/src/opnet.ts +2 -0
  75. package/src/transaction/TransactionFactory.ts +3 -0
  76. package/src/transaction/browser/Web3Provider.ts +64 -4
  77. package/src/transaction/browser/types/OPWallet.ts +6 -53
  78. package/src/transaction/builders/CustomScriptTransaction.ts +4 -0
  79. package/src/transaction/builders/DeploymentTransaction.ts +36 -8
  80. package/src/transaction/builders/InteractionTransaction.ts +17 -7
  81. package/src/transaction/builders/InteractionTransactionP2WDA.ts +17 -7
  82. package/src/transaction/builders/TransactionBuilder.ts +107 -0
  83. package/src/transaction/interfaces/ITransactionParameters.ts +12 -0
  84. package/src/transaction/shared/P2TR_MS.ts +1 -0
  85. package/src/transaction/shared/TweakedTransaction.ts +35 -2
  86. package/src/utxo/OPNetLimitedProvider.ts +19 -2
  87. package/test/address.test.ts +18 -20
  88. package/test/addressmap.test.ts +783 -0
  89. package/test/addressverificator-mldsa.test.ts +40 -16
  90. package/test/messagesigner-mldsa.test.ts +50 -50
  91. package/test/messagesigner-schnorr.test.ts +40 -40
  92. package/tsconfig.webpack.json +2 -6
  93. package/webpack.config.js +1 -1
  94. package/browser/src/_version.d.ts +0 -1
  95. package/browser/src/transaction/browser/types/OPWallet.d.ts +0 -14
  96. package/browser/test/address.test.d.ts +0 -1
  97. package/browser/test/addressverificator-mldsa.test.d.ts +0 -1
  98. package/browser/test/derivePath.test.d.ts +0 -1
  99. package/browser/test/fastmap-setall.test.d.ts +0 -1
  100. package/browser/test/fastmap.test.d.ts +0 -1
  101. package/browser/test/messagesigner-mldsa.test.d.ts +0 -1
  102. package/browser/test/messagesigner-schnorr.test.d.ts +0 -1
  103. package/browser/test/network-awareness.test.d.ts +0 -1
  104. package/browser/test/old/FastBigIntMap.d.ts +0 -18
  105. package/browser/test/oldfastmap.test.d.ts +0 -1
  106. /package/browser/{src/abi → abi}/ABICoder.d.ts +0 -0
  107. /package/browser/{src/buffer → buffer}/BinaryReader.d.ts +0 -0
  108. /package/browser/{src/buffer → buffer}/BinaryWriter.d.ts +0 -0
  109. /package/browser/{src/bytecode → bytecode}/Compressor.d.ts +0 -0
  110. /package/browser/{src/consensus → consensus}/Consensus.d.ts +0 -0
  111. /package/browser/{src/consensus → consensus}/ConsensusConfig.d.ts +0 -0
  112. /package/browser/{src/consensus → consensus}/metadata/RoswellConsensus.d.ts +0 -0
  113. /package/browser/{src/crypto → crypto}/crypto-browser.d.ts +0 -0
  114. /package/browser/{src/crypto → crypto}/crypto.d.ts +0 -0
  115. /package/browser/{src/deterministic → deterministic}/AddressMap.d.ts +0 -0
  116. /package/browser/{src/deterministic → deterministic}/AddressSet.d.ts +0 -0
  117. /package/browser/{src/deterministic → deterministic}/CustomMap.d.ts +0 -0
  118. /package/browser/{src/deterministic → deterministic}/DeterministicMap.d.ts +0 -0
  119. /package/browser/{src/deterministic → deterministic}/DeterministicSet.d.ts +0 -0
  120. /package/browser/{src/deterministic → deterministic}/FastMap.d.ts +0 -0
  121. /package/browser/{src/epoch → epoch}/ChallengeSolution.d.ts +0 -0
  122. /package/browser/{src/epoch → epoch}/validator/EpochValidator.d.ts +0 -0
  123. /package/browser/{src/event → event}/NetEvent.d.ts +0 -0
  124. /package/browser/{src/generators → generators}/AddressGenerator.d.ts +0 -0
  125. /package/browser/{src/generators → generators}/builders/CalldataGenerator.d.ts +0 -0
  126. /package/browser/{src/generators → generators}/builders/CustomGenerator.d.ts +0 -0
  127. /package/browser/{src/generators → generators}/builders/DeploymentGenerator.d.ts +0 -0
  128. /package/browser/{src/generators → generators}/builders/LegacyCalldataGenerator.d.ts +0 -0
  129. /package/browser/{src/generators → generators}/builders/MultiSignGenerator.d.ts +0 -0
  130. /package/browser/{src/generators → generators}/builders/P2WDAGenerator.d.ts +0 -0
  131. /package/browser/{src/index.d.ts → index.d.ts} +0 -0
  132. /package/browser/{src/keypair → keypair}/AddressVerificator.d.ts +0 -0
  133. /package/browser/{src/keypair → keypair}/EcKeyPair.d.ts +0 -0
  134. /package/browser/{src/keypair → keypair}/Secp256k1PointDeriver.d.ts +0 -0
  135. /package/browser/{src/keypair → keypair}/Wallet.d.ts +0 -0
  136. /package/browser/{src/keypair → keypair}/interfaces/IWallet.d.ts +0 -0
  137. /package/browser/{src/metadata → metadata}/ContractBaseMetadata.d.ts +0 -0
  138. /package/browser/{src/metadata → metadata}/tokens.d.ts +0 -0
  139. /package/browser/{src/mnemonic → mnemonic}/BIPStandard.d.ts +0 -0
  140. /package/browser/{src/mnemonic → mnemonic}/Mnemonic.d.ts +0 -0
  141. /package/browser/{src/mnemonic → mnemonic}/MnemonicStrength.d.ts +0 -0
  142. /package/browser/{src/network → network}/ChainId.d.ts +0 -0
  143. /package/browser/{src/p2wda → p2wda}/P2WDADetector.d.ts +0 -0
  144. /package/browser/{src/signer → signer}/SignerUtils.d.ts +0 -0
  145. /package/browser/{src/signer → signer}/TweakedSigner.d.ts +0 -0
  146. /package/browser/{src/transaction → transaction}/ContractAddress.d.ts +0 -0
  147. /package/browser/{src/transaction → transaction}/TransactionFactory.d.ts +0 -0
  148. /package/browser/{src/transaction → transaction}/browser/BrowserSignerBase.d.ts +0 -0
  149. /package/browser/{src/transaction → transaction}/browser/extensions/UnisatSigner.d.ts +0 -0
  150. /package/browser/{src/transaction → transaction}/browser/extensions/XverseSigner.d.ts +0 -0
  151. /package/browser/{src/transaction → transaction}/browser/types/Unisat.d.ts +0 -0
  152. /package/browser/{src/transaction → transaction}/browser/types/Xverse.d.ts +0 -0
  153. /package/browser/{src/transaction → transaction}/builders/CancelTransaction.d.ts +0 -0
  154. /package/browser/{src/transaction → transaction}/builders/ChallengeSolutionTransaction.d.ts +0 -0
  155. /package/browser/{src/transaction → transaction}/builders/FundingTransaction.d.ts +0 -0
  156. /package/browser/{src/transaction → transaction}/builders/InteractionTransaction.d.ts +0 -0
  157. /package/browser/{src/transaction → transaction}/builders/InteractionTransactionP2WDA.d.ts +0 -0
  158. /package/browser/{src/transaction → transaction}/builders/MultiSignTransaction.d.ts +0 -0
  159. /package/browser/{src/transaction → transaction}/builders/SharedInteractionTransaction.d.ts +0 -0
  160. /package/browser/{src/transaction → transaction}/enums/TransactionType.d.ts +0 -0
  161. /package/browser/{src/transaction → transaction}/interfaces/Tap.d.ts +0 -0
  162. /package/browser/{src/transaction → transaction}/mineable/IP2WSHAddress.d.ts +0 -0
  163. /package/browser/{src/transaction → transaction}/mineable/TimelockGenerator.d.ts +0 -0
  164. /package/browser/{src/transaction → transaction}/processor/PsbtTransaction.d.ts +0 -0
  165. /package/browser/{src/transaction → transaction}/psbt/PSBTTypes.d.ts +0 -0
  166. /package/browser/{src/transaction → transaction}/shared/P2TR_MS.d.ts +0 -0
  167. /package/browser/{src/utils → utils}/BitcoinUtils.d.ts +0 -0
  168. /package/browser/{src/utils → utils}/BufferHelper.d.ts +0 -0
  169. /package/browser/{src/utils → utils}/StringToBuffer.d.ts +0 -0
  170. /package/browser/{src/utils → utils}/lengths.d.ts +0 -0
  171. /package/browser/{src/utils → utils}/types.d.ts +0 -0
  172. /package/browser/{src/utxo → utxo}/interfaces/BroadcastResponse.d.ts +0 -0
  173. /package/browser/{src/utxo → utxo}/interfaces/IUTXO.d.ts +0 -0
  174. /package/browser/{src/verification → verification}/TapscriptVerificator.d.ts +0 -0
@@ -311,7 +311,7 @@ describe('Address - Comprehensive Tests', () => {
311
311
  const mldsaHash = Buffer.alloc(32, 0x01);
312
312
  const address = new Address(mldsaHash);
313
313
 
314
- expect(() => address.tweakedToHex()).toThrow('Classical public key not set');
314
+ expect(() => address.tweakedToHex()).toThrow('Legacy public key not set');
315
315
  });
316
316
 
317
317
  it('should convert tweaked public key to buffer', () => {
@@ -326,9 +326,7 @@ describe('Address - Comprehensive Tests', () => {
326
326
  const mldsaHash = Buffer.alloc(32, 0x01);
327
327
  const address = new Address(mldsaHash);
328
328
 
329
- expect(() => address.tweakedPublicKeyToBuffer()).toThrow(
330
- 'Classical public key not set',
331
- );
329
+ expect(() => address.tweakedPublicKeyToBuffer()).toThrow('Legacy public key not set');
332
330
  });
333
331
 
334
332
  it('should get toTweakedHybridPublicKeyHex', () => {
@@ -343,7 +341,7 @@ describe('Address - Comprehensive Tests', () => {
343
341
  const address = new Address(mldsaHash);
344
342
 
345
343
  expect(() => address.toTweakedHybridPublicKeyHex()).toThrow(
346
- 'Classical public key not set',
344
+ 'Legacy public key not set',
347
345
  );
348
346
  });
349
347
 
@@ -359,7 +357,7 @@ describe('Address - Comprehensive Tests', () => {
359
357
  const address = new Address(mldsaHash);
360
358
 
361
359
  expect(() => address.toTweakedHybridPublicKeyBuffer()).toThrow(
362
- 'Classical public key not set',
360
+ 'Legacy public key not set',
363
361
  );
364
362
  });
365
363
  });
@@ -376,7 +374,7 @@ describe('Address - Comprehensive Tests', () => {
376
374
  const mldsaHash = Buffer.alloc(32, 0x01);
377
375
  const address = new Address(mldsaHash);
378
376
 
379
- expect(() => address.toUncompressedHex()).toThrow('Classical public key not set');
377
+ expect(() => address.toUncompressedHex()).toThrow('Legacy public key not set');
380
378
  });
381
379
 
382
380
  it('should get uncompressed buffer', () => {
@@ -391,7 +389,7 @@ describe('Address - Comprehensive Tests', () => {
391
389
  const mldsaHash = Buffer.alloc(32, 0x01);
392
390
  const address = new Address(mldsaHash);
393
391
 
394
- expect(() => address.toUncompressedBuffer()).toThrow('Classical public key not set');
392
+ expect(() => address.toUncompressedBuffer()).toThrow('Legacy public key not set');
395
393
  });
396
394
 
397
395
  it('should get hybrid public key hex', () => {
@@ -405,7 +403,7 @@ describe('Address - Comprehensive Tests', () => {
405
403
  const mldsaHash = Buffer.alloc(32, 0x01);
406
404
  const address = new Address(mldsaHash);
407
405
 
408
- expect(() => address.toHybridPublicKeyHex()).toThrow('Classical public key not set');
406
+ expect(() => address.toHybridPublicKeyHex()).toThrow('Legacy public key not set');
409
407
  });
410
408
 
411
409
  it('should get hybrid public key buffer', () => {
@@ -419,7 +417,7 @@ describe('Address - Comprehensive Tests', () => {
419
417
  const mldsaHash = Buffer.alloc(32, 0x01);
420
418
  const address = new Address(mldsaHash);
421
419
 
422
- expect(() => address.toHybridPublicKeyBuffer()).toThrow('Classical public key not set');
420
+ expect(() => address.toHybridPublicKeyBuffer()).toThrow('Legacy public key not set');
423
421
  });
424
422
 
425
423
  it('should get original public key buffer', () => {
@@ -434,7 +432,7 @@ describe('Address - Comprehensive Tests', () => {
434
432
  const mldsaHash = Buffer.alloc(32, 0x01);
435
433
  const address = new Address(mldsaHash);
436
434
 
437
- expect(() => address.originalPublicKeyBuffer()).toThrow('Classical public key not set');
435
+ expect(() => address.originalPublicKeyBuffer()).toThrow('Legacy public key not set');
438
436
  });
439
437
  });
440
438
 
@@ -646,7 +644,7 @@ describe('Address - Comprehensive Tests', () => {
646
644
  const mldsaHash = Buffer.alloc(32, 0x01);
647
645
  const address = new Address(mldsaHash);
648
646
 
649
- expect(() => address.p2wpkh(networks.bitcoin)).toThrow('Classical public key not set');
647
+ expect(() => address.p2wpkh(networks.bitcoin)).toThrow('Legacy public key not set');
650
648
  });
651
649
  });
652
650
 
@@ -676,7 +674,7 @@ describe('Address - Comprehensive Tests', () => {
676
674
  const address = new Address(mldsaHash);
677
675
 
678
676
  expect(() => address.p2pkh(networks.bitcoin)).toThrow(
679
- 'Classical public key not set for address',
677
+ 'Legacy public key not set for address',
680
678
  );
681
679
  });
682
680
  });
@@ -707,7 +705,7 @@ describe('Address - Comprehensive Tests', () => {
707
705
  const address = new Address(mldsaHash);
708
706
 
709
707
  expect(() => address.p2shp2wpkh(networks.bitcoin)).toThrow(
710
- 'Classical public key not set for address',
708
+ 'Legacy public key not set for address',
711
709
  );
712
710
  });
713
711
  });
@@ -759,7 +757,7 @@ describe('Address - Comprehensive Tests', () => {
759
757
  const mldsaHash = Buffer.alloc(32, 0x01);
760
758
  const address = new Address(mldsaHash);
761
759
 
762
- expect(() => address.p2tr(networks.bitcoin)).toThrow('Classical public key not set');
760
+ expect(() => address.p2tr(networks.bitcoin)).toThrow('Legacy public key not set');
763
761
  });
764
762
  });
765
763
 
@@ -921,12 +919,12 @@ describe('Address - Comprehensive Tests', () => {
921
919
  });
922
920
  });
923
921
 
924
- describe('isValid Method', () => {
922
+ describe('isValidLegacyPublicKey Method', () => {
925
923
  it('should validate address on mainnet', () => {
926
924
  const addr = getValidAddress();
927
- const isValid = addr.isValid(networks.bitcoin);
925
+ const isValidLegacyPublicKey = addr.isValidLegacyPublicKey(networks.bitcoin);
928
926
 
929
- expect(isValid).toBe(true);
927
+ expect(isValidLegacyPublicKey).toBe(true);
930
928
  });
931
929
 
932
930
  it('should validate address on testnet', () => {
@@ -937,9 +935,9 @@ describe('Address - Comprehensive Tests', () => {
937
935
  MLDSASecurityLevel.LEVEL2,
938
936
  );
939
937
  const wallet = mnemonic.derive(0);
940
- const isValid = wallet.address.isValid(networks.testnet);
938
+ const isValidLegacyPublicKey = wallet.address.isValidLegacyPublicKey(networks.testnet);
941
939
 
942
- expect(isValid).toBe(true);
940
+ expect(isValidLegacyPublicKey).toBe(true);
943
941
  });
944
942
  });
945
943