@btc-vision/transaction 1.7.7 → 1.7.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.
- package/browser/_version.d.ts +1 -0
- package/browser/chain/ChainData.d.ts +4 -0
- package/browser/{src/epoch → epoch}/interfaces/IChallengeSolution.d.ts +4 -4
- package/browser/{src/generators → generators}/Features.d.ts +6 -1
- package/browser/{src/generators → generators}/Generator.d.ts +1 -0
- package/browser/generators/MLDSAData.d.ts +15 -0
- package/browser/index.js +1 -1
- package/browser/{src/keypair → keypair}/Address.d.ts +9 -3
- package/browser/{src/keypair → keypair}/MessageSigner.d.ts +9 -0
- package/browser/{src/opnet.d.ts → opnet.d.ts} +1 -0
- package/browser/{src/transaction → transaction}/browser/Web3Provider.d.ts +15 -4
- package/browser/transaction/browser/types/OPWallet.d.ts +6 -0
- package/browser/{src/transaction → transaction}/builders/CustomScriptTransaction.d.ts +1 -0
- package/browser/{src/transaction → transaction}/builders/DeploymentTransaction.d.ts +1 -0
- package/browser/{src/transaction → transaction}/builders/TransactionBuilder.d.ts +4 -0
- package/browser/{src/transaction → transaction}/interfaces/ITransactionParameters.d.ts +3 -0
- package/browser/{src/transaction → transaction}/shared/TweakedTransaction.d.ts +6 -0
- package/browser/{src/utxo → utxo}/OPNetLimitedProvider.d.ts +1 -0
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/chain/ChainData.d.ts +4 -0
- package/build/chain/ChainData.js +20 -0
- package/build/epoch/ChallengeSolution.js +4 -4
- package/build/epoch/interfaces/IChallengeSolution.d.ts +4 -4
- package/build/generators/Features.d.ts +6 -1
- package/build/generators/Features.js +1 -0
- package/build/generators/Generator.d.ts +1 -0
- package/build/generators/Generator.js +24 -2
- package/build/generators/MLDSAData.d.ts +15 -0
- package/build/generators/MLDSAData.js +19 -0
- package/build/generators/builders/CalldataGenerator.js +1 -1
- package/build/generators/builders/DeploymentGenerator.js +1 -1
- package/build/generators/builders/P2WDAGenerator.js +1 -1
- package/build/keypair/Address.d.ts +9 -3
- package/build/keypair/Address.js +63 -38
- package/build/keypair/MessageSigner.d.ts +9 -0
- package/build/keypair/MessageSigner.js +101 -3
- package/build/opnet.d.ts +1 -0
- package/build/opnet.js +1 -0
- package/build/transaction/TransactionFactory.js +3 -0
- package/build/transaction/browser/Web3Provider.d.ts +15 -4
- package/build/transaction/browser/types/OPWallet.d.ts +2 -10
- package/build/transaction/browser/types/OPWallet.js +4 -2
- package/build/transaction/builders/CustomScriptTransaction.d.ts +1 -0
- package/build/transaction/builders/CustomScriptTransaction.js +3 -0
- package/build/transaction/builders/DeploymentTransaction.d.ts +1 -0
- package/build/transaction/builders/DeploymentTransaction.js +26 -1
- package/build/transaction/builders/InteractionTransaction.js +14 -1
- package/build/transaction/builders/InteractionTransactionP2WDA.js +14 -1
- package/build/transaction/builders/TransactionBuilder.d.ts +4 -0
- package/build/transaction/builders/TransactionBuilder.js +77 -0
- package/build/transaction/interfaces/ITransactionParameters.d.ts +3 -0
- package/build/transaction/shared/P2TR_MS.js +1 -0
- package/build/transaction/shared/TweakedTransaction.d.ts +6 -0
- package/build/transaction/shared/TweakedTransaction.js +19 -0
- package/build/utxo/OPNetLimitedProvider.d.ts +1 -0
- package/build/utxo/OPNetLimitedProvider.js +11 -1
- package/eslint.config.js +2 -1
- package/package.json +1 -1
- package/src/_version.ts +1 -1
- package/src/chain/ChainData.ts +32 -0
- package/src/epoch/ChallengeSolution.ts +4 -4
- package/src/epoch/interfaces/IChallengeSolution.ts +4 -4
- package/src/generators/Features.ts +8 -2
- package/src/generators/Generator.ts +35 -2
- package/src/generators/MLDSAData.ts +30 -0
- package/src/generators/builders/CalldataGenerator.ts +1 -1
- package/src/generators/builders/DeploymentGenerator.ts +2 -1
- package/src/generators/builders/LegacyCalldataGenerator.ts +1 -0
- package/src/generators/builders/P2WDAGenerator.ts +5 -1
- package/src/keypair/Address.ts +78 -38
- package/src/keypair/MessageSigner.ts +214 -15
- package/src/opnet.ts +2 -0
- package/src/transaction/TransactionFactory.ts +3 -0
- package/src/transaction/browser/Web3Provider.ts +64 -4
- package/src/transaction/browser/types/OPWallet.ts +6 -53
- package/src/transaction/builders/CustomScriptTransaction.ts +4 -0
- package/src/transaction/builders/DeploymentTransaction.ts +36 -8
- package/src/transaction/builders/InteractionTransaction.ts +17 -7
- package/src/transaction/builders/InteractionTransactionP2WDA.ts +17 -7
- package/src/transaction/builders/TransactionBuilder.ts +107 -0
- package/src/transaction/interfaces/ITransactionParameters.ts +12 -0
- package/src/transaction/shared/P2TR_MS.ts +1 -0
- package/src/transaction/shared/TweakedTransaction.ts +35 -0
- package/src/utxo/OPNetLimitedProvider.ts +19 -2
- package/test/address.test.ts +18 -20
- package/test/addressmap.test.ts +783 -0
- package/test/addressverificator-mldsa.test.ts +40 -16
- package/test/messagesigner-mldsa.test.ts +50 -50
- package/test/messagesigner-schnorr.test.ts +40 -40
- package/tsconfig.webpack.json +2 -6
- package/webpack.config.js +1 -1
- package/browser/src/_version.d.ts +0 -1
- package/browser/src/transaction/browser/types/OPWallet.d.ts +0 -14
- package/browser/test/address.test.d.ts +0 -1
- package/browser/test/addressverificator-mldsa.test.d.ts +0 -1
- package/browser/test/derivePath.test.d.ts +0 -1
- package/browser/test/fastmap-setall.test.d.ts +0 -1
- package/browser/test/fastmap.test.d.ts +0 -1
- package/browser/test/messagesigner-mldsa.test.d.ts +0 -1
- package/browser/test/messagesigner-schnorr.test.d.ts +0 -1
- package/browser/test/network-awareness.test.d.ts +0 -1
- package/browser/test/old/FastBigIntMap.d.ts +0 -18
- package/browser/test/oldfastmap.test.d.ts +0 -1
- /package/browser/{src/abi → abi}/ABICoder.d.ts +0 -0
- /package/browser/{src/buffer → buffer}/BinaryReader.d.ts +0 -0
- /package/browser/{src/buffer → buffer}/BinaryWriter.d.ts +0 -0
- /package/browser/{src/bytecode → bytecode}/Compressor.d.ts +0 -0
- /package/browser/{src/consensus → consensus}/Consensus.d.ts +0 -0
- /package/browser/{src/consensus → consensus}/ConsensusConfig.d.ts +0 -0
- /package/browser/{src/consensus → consensus}/metadata/RoswellConsensus.d.ts +0 -0
- /package/browser/{src/crypto → crypto}/crypto-browser.d.ts +0 -0
- /package/browser/{src/crypto → crypto}/crypto.d.ts +0 -0
- /package/browser/{src/deterministic → deterministic}/AddressMap.d.ts +0 -0
- /package/browser/{src/deterministic → deterministic}/AddressSet.d.ts +0 -0
- /package/browser/{src/deterministic → deterministic}/CustomMap.d.ts +0 -0
- /package/browser/{src/deterministic → deterministic}/DeterministicMap.d.ts +0 -0
- /package/browser/{src/deterministic → deterministic}/DeterministicSet.d.ts +0 -0
- /package/browser/{src/deterministic → deterministic}/FastMap.d.ts +0 -0
- /package/browser/{src/epoch → epoch}/ChallengeSolution.d.ts +0 -0
- /package/browser/{src/epoch → epoch}/validator/EpochValidator.d.ts +0 -0
- /package/browser/{src/event → event}/NetEvent.d.ts +0 -0
- /package/browser/{src/generators → generators}/AddressGenerator.d.ts +0 -0
- /package/browser/{src/generators → generators}/builders/CalldataGenerator.d.ts +0 -0
- /package/browser/{src/generators → generators}/builders/CustomGenerator.d.ts +0 -0
- /package/browser/{src/generators → generators}/builders/DeploymentGenerator.d.ts +0 -0
- /package/browser/{src/generators → generators}/builders/LegacyCalldataGenerator.d.ts +0 -0
- /package/browser/{src/generators → generators}/builders/MultiSignGenerator.d.ts +0 -0
- /package/browser/{src/generators → generators}/builders/P2WDAGenerator.d.ts +0 -0
- /package/browser/{src/index.d.ts → index.d.ts} +0 -0
- /package/browser/{src/keypair → keypair}/AddressVerificator.d.ts +0 -0
- /package/browser/{src/keypair → keypair}/EcKeyPair.d.ts +0 -0
- /package/browser/{src/keypair → keypair}/Secp256k1PointDeriver.d.ts +0 -0
- /package/browser/{src/keypair → keypair}/Wallet.d.ts +0 -0
- /package/browser/{src/keypair → keypair}/interfaces/IWallet.d.ts +0 -0
- /package/browser/{src/metadata → metadata}/ContractBaseMetadata.d.ts +0 -0
- /package/browser/{src/metadata → metadata}/tokens.d.ts +0 -0
- /package/browser/{src/mnemonic → mnemonic}/BIPStandard.d.ts +0 -0
- /package/browser/{src/mnemonic → mnemonic}/Mnemonic.d.ts +0 -0
- /package/browser/{src/mnemonic → mnemonic}/MnemonicStrength.d.ts +0 -0
- /package/browser/{src/network → network}/ChainId.d.ts +0 -0
- /package/browser/{src/p2wda → p2wda}/P2WDADetector.d.ts +0 -0
- /package/browser/{src/signer → signer}/SignerUtils.d.ts +0 -0
- /package/browser/{src/signer → signer}/TweakedSigner.d.ts +0 -0
- /package/browser/{src/transaction → transaction}/ContractAddress.d.ts +0 -0
- /package/browser/{src/transaction → transaction}/TransactionFactory.d.ts +0 -0
- /package/browser/{src/transaction → transaction}/browser/BrowserSignerBase.d.ts +0 -0
- /package/browser/{src/transaction → transaction}/browser/extensions/UnisatSigner.d.ts +0 -0
- /package/browser/{src/transaction → transaction}/browser/extensions/XverseSigner.d.ts +0 -0
- /package/browser/{src/transaction → transaction}/browser/types/Unisat.d.ts +0 -0
- /package/browser/{src/transaction → transaction}/browser/types/Xverse.d.ts +0 -0
- /package/browser/{src/transaction → transaction}/builders/CancelTransaction.d.ts +0 -0
- /package/browser/{src/transaction → transaction}/builders/ChallengeSolutionTransaction.d.ts +0 -0
- /package/browser/{src/transaction → transaction}/builders/FundingTransaction.d.ts +0 -0
- /package/browser/{src/transaction → transaction}/builders/InteractionTransaction.d.ts +0 -0
- /package/browser/{src/transaction → transaction}/builders/InteractionTransactionP2WDA.d.ts +0 -0
- /package/browser/{src/transaction → transaction}/builders/MultiSignTransaction.d.ts +0 -0
- /package/browser/{src/transaction → transaction}/builders/SharedInteractionTransaction.d.ts +0 -0
- /package/browser/{src/transaction → transaction}/enums/TransactionType.d.ts +0 -0
- /package/browser/{src/transaction → transaction}/interfaces/Tap.d.ts +0 -0
- /package/browser/{src/transaction → transaction}/mineable/IP2WSHAddress.d.ts +0 -0
- /package/browser/{src/transaction → transaction}/mineable/TimelockGenerator.d.ts +0 -0
- /package/browser/{src/transaction → transaction}/processor/PsbtTransaction.d.ts +0 -0
- /package/browser/{src/transaction → transaction}/psbt/PSBTTypes.d.ts +0 -0
- /package/browser/{src/transaction → transaction}/shared/P2TR_MS.d.ts +0 -0
- /package/browser/{src/utils → utils}/BitcoinUtils.d.ts +0 -0
- /package/browser/{src/utils → utils}/BufferHelper.d.ts +0 -0
- /package/browser/{src/utils → utils}/StringToBuffer.d.ts +0 -0
- /package/browser/{src/utils → utils}/lengths.d.ts +0 -0
- /package/browser/{src/utils → utils}/types.d.ts +0 -0
- /package/browser/{src/utxo → utxo}/interfaces/BroadcastResponse.d.ts +0 -0
- /package/browser/{src/utxo → utxo}/interfaces/IUTXO.d.ts +0 -0
- /package/browser/{src/verification → verification}/TapscriptVerificator.d.ts +0 -0
package/test/address.test.ts
CHANGED
|
@@ -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('
|
|
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
|
-
'
|
|
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
|
-
'
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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
|
-
'
|
|
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
|
-
'
|
|
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('
|
|
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('
|
|
922
|
+
describe('isValidLegacyPublicKey Method', () => {
|
|
925
923
|
it('should validate address on mainnet', () => {
|
|
926
924
|
const addr = getValidAddress();
|
|
927
|
-
const
|
|
925
|
+
const isValidLegacyPublicKey = addr.isValidLegacyPublicKey(networks.bitcoin);
|
|
928
926
|
|
|
929
|
-
expect(
|
|
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
|
|
938
|
+
const isValidLegacyPublicKey = wallet.address.isValidLegacyPublicKey(networks.testnet);
|
|
941
939
|
|
|
942
|
-
expect(
|
|
940
|
+
expect(isValidLegacyPublicKey).toBe(true);
|
|
943
941
|
});
|
|
944
942
|
});
|
|
945
943
|
|