@btc-vision/transaction 1.8.0-beta.1 → 1.8.0-beta.4
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/_version.d.ts.map +1 -0
- package/browser/abi/ABICoder.d.ts +1 -1
- package/browser/abi/ABICoder.d.ts.map +1 -0
- package/browser/branded/Branded.d.ts +4 -0
- package/browser/branded/Branded.d.ts.map +1 -0
- package/browser/btc-vision-bitcoin.js +12420 -3637
- package/browser/buffer/BinaryReader.d.ts +120 -1
- package/browser/buffer/BinaryReader.d.ts.map +1 -0
- package/browser/buffer/BinaryWriter.d.ts +51 -1
- package/browser/buffer/BinaryWriter.d.ts.map +1 -0
- package/browser/bytecode/Compressor.d.ts +12 -0
- package/browser/bytecode/Compressor.d.ts.map +1 -0
- package/browser/chain/ChainData.d.ts +2 -2
- package/browser/chain/ChainData.d.ts.map +1 -0
- package/browser/consensus/Consensus.d.ts +11 -3
- package/browser/consensus/Consensus.d.ts.map +1 -0
- package/browser/consensus/ConsensusConfig.d.ts +1 -0
- package/browser/consensus/ConsensusConfig.d.ts.map +1 -0
- package/browser/consensus/IConsensusConfig.d.ts +1 -0
- package/browser/consensus/IConsensusConfig.d.ts.map +1 -0
- package/browser/consensus/metadata/RoswellConsensus.d.ts +1 -0
- package/browser/consensus/metadata/RoswellConsensus.d.ts.map +1 -0
- package/browser/crypto/crypto.d.ts +1 -0
- package/browser/crypto/crypto.d.ts.map +1 -0
- package/browser/deterministic/AddressMap.d.ts +6 -1
- package/browser/deterministic/AddressMap.d.ts.map +1 -0
- package/browser/deterministic/AddressSet.d.ts +3 -1
- package/browser/deterministic/AddressSet.d.ts.map +1 -0
- package/browser/deterministic/CustomMap.d.ts +3 -1
- package/browser/deterministic/CustomMap.d.ts.map +1 -0
- package/browser/deterministic/DeterministicMap.d.ts +3 -1
- package/browser/deterministic/DeterministicMap.d.ts.map +1 -0
- package/browser/deterministic/DeterministicSet.d.ts +3 -1
- package/browser/deterministic/DeterministicSet.d.ts.map +1 -0
- package/browser/deterministic/ExtendedAddressMap.d.ts +7 -1
- package/browser/deterministic/ExtendedAddressMap.d.ts.map +1 -0
- package/browser/deterministic/FastMap.d.ts +7 -1
- package/browser/deterministic/FastMap.d.ts.map +1 -0
- package/browser/ecc/backend.d.ts +13 -0
- package/browser/ecc/backend.d.ts.map +1 -0
- package/browser/epoch/ChallengeSolution.d.ts +33 -1
- package/browser/epoch/ChallengeSolution.d.ts.map +1 -0
- package/browser/epoch/interfaces/IChallengeSolution.d.ts +14 -13
- package/browser/epoch/interfaces/IChallengeSolution.d.ts.map +1 -0
- package/browser/epoch/validator/EpochValidator.d.ts +37 -7
- package/browser/epoch/validator/EpochValidator.d.ts.map +1 -0
- package/browser/event/NetEvent.d.ts +1 -0
- package/browser/event/NetEvent.d.ts.map +1 -0
- package/browser/generators/AddressGenerator.d.ts +4 -3
- package/browser/generators/AddressGenerator.d.ts.map +1 -0
- package/browser/generators/Features.d.ts +1 -0
- package/browser/generators/Features.d.ts.map +1 -0
- package/browser/generators/Generator.d.ts +46 -10
- package/browser/generators/Generator.d.ts.map +1 -0
- package/browser/generators/MLDSAData.d.ts +1 -0
- package/browser/generators/MLDSAData.d.ts.map +1 -0
- package/browser/generators/builders/CalldataGenerator.d.ts +25 -4
- package/browser/generators/builders/CalldataGenerator.d.ts.map +1 -0
- package/browser/generators/builders/CustomGenerator.d.ts +13 -3
- package/browser/generators/builders/CustomGenerator.d.ts.map +1 -0
- package/browser/generators/builders/DeploymentGenerator.d.ts +15 -4
- package/browser/generators/builders/DeploymentGenerator.d.ts.map +1 -0
- package/browser/generators/builders/HashCommitmentGenerator.d.ts +164 -12
- package/browser/generators/builders/HashCommitmentGenerator.d.ts.map +1 -0
- package/browser/generators/builders/LegacyCalldataGenerator.d.ts +26 -4
- package/browser/generators/builders/LegacyCalldataGenerator.d.ts.map +1 -0
- package/browser/generators/builders/MultiSignGenerator.d.ts +6 -1
- package/browser/generators/builders/MultiSignGenerator.d.ts.map +1 -0
- package/browser/generators/builders/P2WDAGenerator.d.ts +42 -4
- package/browser/generators/builders/P2WDAGenerator.d.ts.map +1 -0
- package/browser/index.d.ts +1 -0
- package/browser/index.d.ts.map +1 -0
- package/browser/index.js +3602 -3203
- package/browser/keypair/Address.d.ts +283 -13
- package/browser/keypair/Address.d.ts.map +1 -0
- package/browser/keypair/AddressVerificator.d.ts +7 -6
- package/browser/keypair/AddressVerificator.d.ts.map +1 -0
- package/browser/keypair/EcKeyPair.d.ts +183 -21
- package/browser/keypair/EcKeyPair.d.ts.map +1 -0
- package/browser/keypair/MessageSigner.d.ts +17 -16
- package/browser/keypair/MessageSigner.d.ts.map +1 -0
- package/browser/keypair/Secp256k1PointDeriver.d.ts +55 -0
- package/browser/keypair/Secp256k1PointDeriver.d.ts.map +1 -0
- package/browser/keypair/Wallet.d.ts +27 -13
- package/browser/keypair/Wallet.d.ts.map +1 -0
- package/browser/keypair/interfaces/IWallet.d.ts +19 -0
- package/browser/keypair/interfaces/IWallet.d.ts.map +1 -0
- package/browser/metadata/ContractBaseMetadata.d.ts +10 -2
- package/browser/metadata/ContractBaseMetadata.d.ts.map +1 -0
- package/browser/mnemonic/BIPStandard.d.ts +59 -0
- package/browser/mnemonic/BIPStandard.d.ts.map +1 -0
- package/browser/mnemonic/Mnemonic.d.ts +15 -3
- package/browser/mnemonic/Mnemonic.d.ts.map +1 -0
- package/browser/mnemonic/MnemonicStrength.d.ts +6 -0
- package/browser/mnemonic/MnemonicStrength.d.ts.map +1 -0
- package/browser/network/ChainId.d.ts +1 -0
- package/browser/network/ChainId.d.ts.map +1 -0
- package/browser/noble-curves.js +920 -2966
- package/browser/noble-hashes.js +2067 -1038
- package/browser/opnet.d.ts +22 -1
- package/browser/opnet.d.ts.map +1 -0
- package/browser/p2wda/P2WDADetector.d.ts +36 -9
- package/browser/p2wda/P2WDADetector.d.ts.map +1 -0
- package/browser/polyfill/disposable.d.ts +16 -0
- package/browser/polyfill/disposable.d.ts.map +1 -0
- package/browser/signer/AddressRotation.d.ts +36 -0
- package/browser/signer/AddressRotation.d.ts.map +1 -0
- package/browser/signer/IRotationSigner.d.ts +27 -3
- package/browser/signer/IRotationSigner.d.ts.map +1 -0
- package/browser/signer/ParallelSignerAdapter.d.ts +14 -0
- package/browser/signer/ParallelSignerAdapter.d.ts.map +1 -0
- package/browser/signer/SignerUtils.d.ts +11 -4
- package/browser/signer/SignerUtils.d.ts.map +1 -0
- package/browser/signer/TweakedSigner.d.ts +28 -4
- package/browser/signer/TweakedSigner.d.ts.map +1 -0
- package/browser/transaction/ContractAddress.d.ts +2 -2
- package/browser/transaction/ContractAddress.d.ts.map +1 -0
- package/browser/transaction/TransactionFactory.d.ts +140 -2
- package/browser/transaction/TransactionFactory.d.ts.map +1 -0
- package/browser/transaction/browser/BrowserSignerBase.d.ts +12 -6
- package/browser/transaction/browser/BrowserSignerBase.d.ts.map +1 -0
- package/browser/transaction/browser/WalletNetworks.d.ts +1 -0
- package/browser/transaction/browser/WalletNetworks.d.ts.map +1 -0
- package/browser/transaction/browser/Web3Provider.d.ts +27 -0
- package/browser/transaction/browser/Web3Provider.d.ts.map +1 -0
- package/browser/transaction/browser/extensions/UnisatSigner.d.ts +9 -7
- package/browser/transaction/browser/extensions/UnisatSigner.d.ts.map +1 -0
- package/browser/transaction/browser/extensions/XverseSigner.d.ts +9 -7
- package/browser/transaction/browser/extensions/XverseSigner.d.ts.map +1 -0
- package/browser/transaction/browser/types/OPWallet.d.ts +10 -0
- package/browser/transaction/browser/types/OPWallet.d.ts.map +1 -0
- package/browser/transaction/browser/types/Unisat.d.ts +1 -0
- package/browser/transaction/browser/types/Unisat.d.ts.map +1 -0
- package/browser/transaction/browser/types/Xverse.d.ts +1 -0
- package/browser/transaction/browser/types/Xverse.d.ts.map +1 -0
- package/browser/transaction/builders/CancelTransaction.d.ts +29 -4
- package/browser/transaction/builders/CancelTransaction.d.ts.map +1 -0
- package/browser/transaction/builders/ChallengeSolutionTransaction.d.ts +1 -0
- package/browser/transaction/builders/ChallengeSolutionTransaction.d.ts.map +1 -0
- package/browser/transaction/builders/ConsolidatedInteractionTransaction.d.ts +137 -10
- package/browser/transaction/builders/ConsolidatedInteractionTransaction.d.ts.map +1 -0
- package/browser/transaction/builders/CustomScriptTransaction.d.ts +106 -6
- package/browser/transaction/builders/CustomScriptTransaction.d.ts.map +1 -0
- package/browser/transaction/builders/DeploymentTransaction.d.ts +116 -5
- package/browser/transaction/builders/DeploymentTransaction.d.ts.map +1 -0
- package/browser/transaction/builders/FundingTransaction.d.ts +4 -3
- package/browser/transaction/builders/FundingTransaction.d.ts.map +1 -0
- package/browser/transaction/builders/InteractionTransaction.d.ts +12 -3
- package/browser/transaction/builders/InteractionTransaction.d.ts.map +1 -0
- package/browser/transaction/builders/InteractionTransactionP2WDA.d.ts +56 -5
- package/browser/transaction/builders/InteractionTransactionP2WDA.d.ts.map +1 -0
- package/browser/transaction/builders/MultiSignTransaction.d.ts +125 -16
- package/browser/transaction/builders/MultiSignTransaction.d.ts.map +1 -0
- package/browser/transaction/builders/SharedInteractionTransaction.d.ts +103 -15
- package/browser/transaction/builders/SharedInteractionTransaction.d.ts.map +1 -0
- package/browser/transaction/builders/TransactionBuilder.d.ts +243 -14
- package/browser/transaction/builders/TransactionBuilder.d.ts.map +1 -0
- package/browser/transaction/enums/TransactionType.d.ts +1 -0
- package/browser/transaction/enums/TransactionType.d.ts.map +1 -0
- package/browser/transaction/interfaces/ICancelTransactionParameters.d.ts +2 -1
- package/browser/transaction/interfaces/ICancelTransactionParameters.d.ts.map +1 -0
- package/browser/transaction/interfaces/IConsolidatedTransactionParameters.d.ts +46 -3
- package/browser/transaction/interfaces/IConsolidatedTransactionParameters.d.ts.map +1 -0
- package/browser/transaction/interfaces/ICustomTransactionParameters.d.ts +6 -4
- package/browser/transaction/interfaces/ICustomTransactionParameters.d.ts.map +1 -0
- package/browser/transaction/interfaces/ITransactionParameters.d.ts +22 -10
- package/browser/transaction/interfaces/ITransactionParameters.d.ts.map +1 -0
- package/browser/transaction/interfaces/ITransactionResponses.d.ts +1 -0
- package/browser/transaction/interfaces/ITransactionResponses.d.ts.map +1 -0
- package/browser/transaction/interfaces/ITweakedTransactionData.d.ts +18 -5
- package/browser/transaction/interfaces/ITweakedTransactionData.d.ts.map +1 -0
- package/browser/transaction/interfaces/IWeb3ProviderTypes.d.ts +26 -0
- package/browser/transaction/interfaces/IWeb3ProviderTypes.d.ts.map +1 -0
- package/browser/transaction/interfaces/Tap.d.ts +4 -3
- package/browser/transaction/interfaces/Tap.d.ts.map +1 -0
- package/browser/transaction/mineable/IP2WSHAddress.d.ts +2 -1
- package/browser/transaction/mineable/IP2WSHAddress.d.ts.map +1 -0
- package/browser/transaction/mineable/TimelockGenerator.d.ts +12 -3
- package/browser/transaction/mineable/TimelockGenerator.d.ts.map +1 -0
- package/browser/transaction/offline/OfflineTransactionManager.d.ts +190 -9
- package/browser/transaction/offline/OfflineTransactionManager.d.ts.map +1 -0
- package/browser/transaction/offline/TransactionReconstructor.d.ts +53 -3
- package/browser/transaction/offline/TransactionReconstructor.d.ts.map +1 -0
- package/browser/transaction/offline/TransactionSerializer.d.ts +53 -2
- package/browser/transaction/offline/TransactionSerializer.d.ts.map +1 -0
- package/browser/transaction/offline/TransactionStateCapture.d.ts +64 -5
- package/browser/transaction/offline/TransactionStateCapture.d.ts.map +1 -0
- package/browser/transaction/offline/interfaces/ISerializableState.d.ts +71 -0
- package/browser/transaction/offline/interfaces/ISerializableState.d.ts.map +1 -0
- package/browser/transaction/offline/interfaces/ITypeSpecificData.d.ts +76 -0
- package/browser/transaction/offline/interfaces/ITypeSpecificData.d.ts.map +1 -0
- package/browser/transaction/psbt/PSBTTypes.d.ts +1 -0
- package/browser/transaction/psbt/PSBTTypes.d.ts.map +1 -0
- package/browser/transaction/shared/P2TR_MS.d.ts +11 -2
- package/browser/transaction/shared/P2TR_MS.d.ts.map +1 -0
- package/browser/transaction/shared/TweakedTransaction.d.ts +275 -33
- package/browser/transaction/shared/TweakedTransaction.d.ts.map +1 -0
- package/browser/transaction/utils/WitnessUtils.d.ts +7 -1
- package/browser/transaction/utils/WitnessUtils.d.ts.map +1 -0
- package/browser/utils/BitcoinUtils.d.ts +19 -0
- package/browser/utils/BitcoinUtils.d.ts.map +1 -0
- package/browser/utils/BufferHelper.d.ts +1 -0
- package/browser/utils/BufferHelper.d.ts.map +1 -0
- package/browser/utils/StringToBuffer.d.ts +1 -0
- package/browser/utils/StringToBuffer.d.ts.map +1 -0
- package/browser/utils/lengths.d.ts +1 -0
- package/browser/utils/lengths.d.ts.map +1 -0
- package/browser/utils/types.d.ts +1 -0
- package/browser/utils/types.d.ts.map +1 -0
- package/browser/utxo/OPNetLimitedProvider.d.ts +37 -1
- package/browser/utxo/OPNetLimitedProvider.d.ts.map +1 -0
- package/browser/utxo/interfaces/BroadcastResponse.d.ts +1 -0
- package/browser/utxo/interfaces/BroadcastResponse.d.ts.map +1 -0
- package/browser/utxo/interfaces/IUTXO.d.ts +11 -5
- package/browser/utxo/interfaces/IUTXO.d.ts.map +1 -0
- package/browser/vendors.js +13940 -9389
- package/browser/verification/TapscriptVerificator.d.ts +10 -8
- package/browser/verification/TapscriptVerificator.d.ts.map +1 -0
- package/build/_version.d.ts +1 -0
- package/build/_version.d.ts.map +1 -0
- package/build/_version.js +1 -0
- package/build/_version.js.map +1 -0
- package/build/abi/ABICoder.d.ts +1 -1
- package/build/abi/ABICoder.d.ts.map +1 -0
- package/build/abi/ABICoder.js +9 -10
- package/build/abi/ABICoder.js.map +1 -0
- package/build/branded/Branded.d.ts +4 -0
- package/build/branded/Branded.d.ts.map +1 -0
- package/build/branded/Branded.js +2 -0
- package/build/branded/Branded.js.map +1 -0
- package/build/buffer/BinaryReader.d.ts +121 -2
- package/build/buffer/BinaryReader.d.ts.map +1 -0
- package/build/buffer/BinaryReader.js +129 -5
- package/build/buffer/BinaryReader.js.map +1 -0
- package/build/buffer/BinaryWriter.d.ts +52 -2
- package/build/buffer/BinaryWriter.d.ts.map +1 -0
- package/build/buffer/BinaryWriter.js +62 -2
- package/build/buffer/BinaryWriter.js.map +1 -0
- package/build/bytecode/Compressor.d.ts +12 -0
- package/build/bytecode/Compressor.d.ts.map +1 -0
- package/build/bytecode/Compressor.js +17 -5
- package/build/bytecode/Compressor.js.map +1 -0
- package/build/chain/ChainData.d.ts +2 -2
- package/build/chain/ChainData.d.ts.map +1 -0
- package/build/chain/ChainData.js +35 -17
- package/build/chain/ChainData.js.map +1 -0
- package/build/consensus/Consensus.d.ts +11 -3
- package/build/consensus/Consensus.d.ts.map +1 -0
- package/build/consensus/Consensus.js +8 -0
- package/build/consensus/Consensus.js.map +1 -0
- package/build/consensus/ConsensusConfig.d.ts +2 -1
- package/build/consensus/ConsensusConfig.d.ts.map +1 -0
- package/build/consensus/ConsensusConfig.js +1 -0
- package/build/consensus/ConsensusConfig.js.map +1 -0
- package/build/consensus/IConsensusConfig.d.ts +1 -0
- package/build/consensus/IConsensusConfig.d.ts.map +1 -0
- package/build/consensus/IConsensusConfig.js +2 -1
- package/build/consensus/IConsensusConfig.js.map +1 -0
- package/build/consensus/metadata/RoswellConsensus.d.ts +2 -1
- package/build/consensus/metadata/RoswellConsensus.d.ts.map +1 -0
- package/build/consensus/metadata/RoswellConsensus.js +2 -0
- package/build/consensus/metadata/RoswellConsensus.js.map +1 -0
- package/build/crypto/crypto.d.ts +1 -0
- package/build/crypto/crypto.d.ts.map +1 -0
- package/build/crypto/crypto.js +1 -0
- package/build/crypto/crypto.js.map +1 -0
- package/build/deterministic/AddressMap.d.ts +6 -1
- package/build/deterministic/AddressMap.d.ts.map +1 -0
- package/build/deterministic/AddressMap.js +8 -0
- package/build/deterministic/AddressMap.js.map +1 -0
- package/build/deterministic/AddressSet.d.ts +3 -1
- package/build/deterministic/AddressSet.d.ts.map +1 -0
- package/build/deterministic/AddressSet.js +7 -0
- package/build/deterministic/AddressSet.js.map +1 -0
- package/build/deterministic/CustomMap.d.ts +3 -1
- package/build/deterministic/CustomMap.d.ts.map +1 -0
- package/build/deterministic/CustomMap.js +65 -47
- package/build/deterministic/CustomMap.js.map +1 -0
- package/build/deterministic/DeterministicMap.d.ts +4 -2
- package/build/deterministic/DeterministicMap.d.ts.map +1 -0
- package/build/deterministic/DeterministicMap.js +24 -27
- package/build/deterministic/DeterministicMap.js.map +1 -0
- package/build/deterministic/DeterministicSet.d.ts +3 -1
- package/build/deterministic/DeterministicSet.d.ts.map +1 -0
- package/build/deterministic/DeterministicSet.js +6 -0
- package/build/deterministic/DeterministicSet.js.map +1 -0
- package/build/deterministic/ExtendedAddressMap.d.ts +7 -1
- package/build/deterministic/ExtendedAddressMap.d.ts.map +1 -0
- package/build/deterministic/ExtendedAddressMap.js +18 -2
- package/build/deterministic/ExtendedAddressMap.js.map +1 -0
- package/build/deterministic/FastMap.d.ts +7 -1
- package/build/deterministic/FastMap.d.ts.map +1 -0
- package/build/deterministic/FastMap.js +7 -2
- package/build/deterministic/FastMap.js.map +1 -0
- package/build/ecc/backend.d.ts +13 -0
- package/build/ecc/backend.d.ts.map +1 -0
- package/build/ecc/backend.js +15 -0
- package/build/ecc/backend.js.map +1 -0
- package/build/epoch/ChallengeSolution.d.ts +34 -2
- package/build/epoch/ChallengeSolution.d.ts.map +1 -0
- package/build/epoch/ChallengeSolution.js +52 -0
- package/build/epoch/ChallengeSolution.js.map +1 -0
- package/build/epoch/interfaces/IChallengeSolution.d.ts +14 -13
- package/build/epoch/interfaces/IChallengeSolution.d.ts.map +1 -0
- package/build/epoch/interfaces/IChallengeSolution.js +2 -1
- package/build/epoch/interfaces/IChallengeSolution.js.map +1 -0
- package/build/epoch/validator/EpochValidator.d.ts +38 -8
- package/build/epoch/validator/EpochValidator.d.ts.map +1 -0
- package/build/epoch/validator/EpochValidator.js +45 -19
- package/build/epoch/validator/EpochValidator.js.map +1 -0
- package/build/event/NetEvent.d.ts +1 -0
- package/build/event/NetEvent.d.ts.map +1 -0
- package/build/event/NetEvent.js +3 -0
- package/build/event/NetEvent.js.map +1 -0
- package/build/generators/AddressGenerator.d.ts +4 -3
- package/build/generators/AddressGenerator.d.ts.map +1 -0
- package/build/generators/AddressGenerator.js +10 -3
- package/build/generators/AddressGenerator.js.map +1 -0
- package/build/generators/Features.d.ts +4 -3
- package/build/generators/Features.d.ts.map +1 -0
- package/build/generators/Features.js +1 -0
- package/build/generators/Features.js.map +1 -0
- package/build/generators/Generator.d.ts +47 -11
- package/build/generators/Generator.d.ts.map +1 -0
- package/build/generators/Generator.js +48 -12
- package/build/generators/Generator.js.map +1 -0
- package/build/generators/MLDSAData.d.ts +1 -0
- package/build/generators/MLDSAData.d.ts.map +1 -0
- package/build/generators/MLDSAData.js +1 -0
- package/build/generators/MLDSAData.js.map +1 -0
- package/build/generators/builders/CalldataGenerator.d.ts +27 -6
- package/build/generators/builders/CalldataGenerator.d.ts.map +1 -0
- package/build/generators/builders/CalldataGenerator.js +33 -4
- package/build/generators/builders/CalldataGenerator.js.map +1 -0
- package/build/generators/builders/CustomGenerator.d.ts +13 -3
- package/build/generators/builders/CustomGenerator.d.ts.map +1 -0
- package/build/generators/builders/CustomGenerator.js +11 -0
- package/build/generators/builders/CustomGenerator.js.map +1 -0
- package/build/generators/builders/DeploymentGenerator.d.ts +17 -6
- package/build/generators/builders/DeploymentGenerator.d.ts.map +1 -0
- package/build/generators/builders/DeploymentGenerator.js +18 -2
- package/build/generators/builders/DeploymentGenerator.js.map +1 -0
- package/build/generators/builders/HashCommitmentGenerator.d.ts +166 -14
- package/build/generators/builders/HashCommitmentGenerator.d.ts.map +1 -0
- package/build/generators/builders/HashCommitmentGenerator.js +193 -27
- package/build/generators/builders/HashCommitmentGenerator.js.map +1 -0
- package/build/generators/builders/LegacyCalldataGenerator.d.ts +27 -5
- package/build/generators/builders/LegacyCalldataGenerator.d.ts.map +1 -0
- package/build/generators/builders/LegacyCalldataGenerator.js +35 -5
- package/build/generators/builders/LegacyCalldataGenerator.js.map +1 -0
- package/build/generators/builders/MultiSignGenerator.d.ts +6 -1
- package/build/generators/builders/MultiSignGenerator.d.ts.map +1 -0
- package/build/generators/builders/MultiSignGenerator.js +20 -10
- package/build/generators/builders/MultiSignGenerator.js.map +1 -0
- package/build/generators/builders/P2WDAGenerator.d.ts +44 -6
- package/build/generators/builders/P2WDAGenerator.d.ts.map +1 -0
- package/build/generators/builders/P2WDAGenerator.js +41 -2
- package/build/generators/builders/P2WDAGenerator.js.map +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +1 -0
- package/build/index.js.map +1 -0
- package/build/keypair/Address.d.ts +284 -14
- package/build/keypair/Address.d.ts.map +1 -0
- package/build/keypair/Address.js +447 -129
- package/build/keypair/Address.js.map +1 -0
- package/build/keypair/AddressVerificator.d.ts +7 -6
- package/build/keypair/AddressVerificator.d.ts.map +1 -0
- package/build/keypair/AddressVerificator.js +6 -5
- package/build/keypair/AddressVerificator.js.map +1 -0
- package/build/keypair/EcKeyPair.d.ts +185 -23
- package/build/keypair/EcKeyPair.d.ts.map +1 -0
- package/build/keypair/EcKeyPair.js +223 -54
- package/build/keypair/EcKeyPair.js.map +1 -0
- package/build/keypair/MessageSigner.d.ts +18 -17
- package/build/keypair/MessageSigner.d.ts.map +1 -0
- package/build/keypair/MessageSigner.js +34 -25
- package/build/keypair/MessageSigner.js.map +1 -0
- package/build/keypair/Secp256k1PointDeriver.d.ts +55 -0
- package/build/keypair/Secp256k1PointDeriver.d.ts.map +1 -0
- package/build/keypair/Secp256k1PointDeriver.js +66 -0
- package/build/keypair/Secp256k1PointDeriver.js.map +1 -0
- package/build/keypair/Wallet.d.ts +29 -15
- package/build/keypair/Wallet.d.ts.map +1 -0
- package/build/keypair/Wallet.js +48 -14
- package/build/keypair/Wallet.js.map +1 -0
- package/build/keypair/interfaces/IWallet.d.ts +19 -0
- package/build/keypair/interfaces/IWallet.d.ts.map +1 -0
- package/build/keypair/interfaces/IWallet.js +1 -0
- package/build/keypair/interfaces/IWallet.js.map +1 -0
- package/build/metadata/ContractBaseMetadata.d.ts +10 -2
- package/build/metadata/ContractBaseMetadata.d.ts.map +1 -0
- package/build/metadata/ContractBaseMetadata.js +10 -1
- package/build/metadata/ContractBaseMetadata.js.map +1 -0
- package/build/mnemonic/BIPStandard.d.ts +59 -0
- package/build/mnemonic/BIPStandard.d.ts.map +1 -0
- package/build/mnemonic/BIPStandard.js +59 -0
- package/build/mnemonic/BIPStandard.js.map +1 -0
- package/build/mnemonic/Mnemonic.d.ts +16 -4
- package/build/mnemonic/Mnemonic.d.ts.map +1 -0
- package/build/mnemonic/Mnemonic.js +36 -8
- package/build/mnemonic/Mnemonic.js.map +1 -0
- package/build/mnemonic/MnemonicStrength.d.ts +6 -0
- package/build/mnemonic/MnemonicStrength.d.ts.map +1 -0
- package/build/mnemonic/MnemonicStrength.js +6 -0
- package/build/mnemonic/MnemonicStrength.js.map +1 -0
- package/build/network/ChainId.d.ts +1 -0
- package/build/network/ChainId.d.ts.map +1 -0
- package/build/network/ChainId.js +1 -0
- package/build/network/ChainId.js.map +1 -0
- package/build/opnet.d.ts +26 -3
- package/build/opnet.d.ts.map +1 -0
- package/build/opnet.js +23 -0
- package/build/opnet.js.map +1 -0
- package/build/p2wda/P2WDADetector.d.ts +38 -11
- package/build/p2wda/P2WDADetector.d.ts.map +1 -0
- package/build/p2wda/P2WDADetector.js +43 -10
- package/build/p2wda/P2WDADetector.js.map +1 -0
- package/build/polyfill/disposable.d.ts +16 -0
- package/build/polyfill/disposable.d.ts.map +1 -0
- package/build/polyfill/disposable.js +23 -0
- package/build/polyfill/disposable.js.map +1 -0
- package/build/signer/AddressRotation.d.ts +37 -1
- package/build/signer/AddressRotation.d.ts.map +1 -0
- package/build/signer/AddressRotation.js +16 -0
- package/build/signer/AddressRotation.js.map +1 -0
- package/build/signer/IRotationSigner.d.ts +27 -3
- package/build/signer/IRotationSigner.d.ts.map +1 -0
- package/build/signer/IRotationSigner.js +2 -1
- package/build/signer/IRotationSigner.js.map +1 -0
- package/build/signer/ParallelSignerAdapter.d.ts +14 -0
- package/build/signer/ParallelSignerAdapter.d.ts.map +1 -0
- package/build/signer/ParallelSignerAdapter.js +51 -0
- package/build/signer/ParallelSignerAdapter.js.map +1 -0
- package/build/signer/SignerUtils.d.ts +11 -4
- package/build/signer/SignerUtils.d.ts.map +1 -0
- package/build/signer/SignerUtils.js +16 -0
- package/build/signer/SignerUtils.js.map +1 -0
- package/build/signer/TweakedSigner.d.ts +28 -4
- package/build/signer/TweakedSigner.d.ts.map +1 -0
- package/build/signer/TweakedSigner.js +24 -6
- package/build/signer/TweakedSigner.js.map +1 -0
- package/build/transaction/ContractAddress.d.ts +2 -2
- package/build/transaction/ContractAddress.d.ts.map +1 -0
- package/build/transaction/ContractAddress.js +4 -8
- package/build/transaction/ContractAddress.js.map +1 -0
- package/build/transaction/TransactionFactory.d.ts +147 -9
- package/build/transaction/TransactionFactory.d.ts.map +1 -0
- package/build/transaction/TransactionFactory.js +145 -26
- package/build/transaction/TransactionFactory.js.map +1 -0
- package/build/transaction/browser/BrowserSignerBase.d.ts +12 -6
- package/build/transaction/browser/BrowserSignerBase.d.ts.map +1 -0
- package/build/transaction/browser/BrowserSignerBase.js +7 -0
- package/build/transaction/browser/BrowserSignerBase.js.map +1 -0
- package/build/transaction/browser/WalletNetworks.d.ts +1 -0
- package/build/transaction/browser/WalletNetworks.d.ts.map +1 -0
- package/build/transaction/browser/WalletNetworks.js +1 -0
- package/build/transaction/browser/WalletNetworks.js.map +1 -0
- package/build/transaction/browser/Web3Provider.d.ts +30 -3
- package/build/transaction/browser/Web3Provider.d.ts.map +1 -0
- package/build/transaction/browser/Web3Provider.js +1 -0
- package/build/transaction/browser/Web3Provider.js.map +1 -0
- package/build/transaction/browser/extensions/UnisatSigner.d.ts +11 -9
- package/build/transaction/browser/extensions/UnisatSigner.d.ts.map +1 -0
- package/build/transaction/browser/extensions/UnisatSigner.js +27 -17
- package/build/transaction/browser/extensions/UnisatSigner.js.map +1 -0
- package/build/transaction/browser/extensions/XverseSigner.d.ts +10 -8
- package/build/transaction/browser/extensions/XverseSigner.d.ts.map +1 -0
- package/build/transaction/browser/extensions/XverseSigner.js +25 -15
- package/build/transaction/browser/extensions/XverseSigner.js.map +1 -0
- package/build/transaction/browser/types/OPWallet.d.ts +12 -2
- package/build/transaction/browser/types/OPWallet.d.ts.map +1 -0
- package/build/transaction/browser/types/OPWallet.js +4 -0
- package/build/transaction/browser/types/OPWallet.js.map +1 -0
- package/build/transaction/browser/types/Unisat.d.ts +2 -1
- package/build/transaction/browser/types/Unisat.d.ts.map +1 -0
- package/build/transaction/browser/types/Unisat.js +2 -0
- package/build/transaction/browser/types/Unisat.js.map +1 -0
- package/build/transaction/browser/types/Xverse.d.ts +1 -0
- package/build/transaction/browser/types/Xverse.d.ts.map +1 -0
- package/build/transaction/browser/types/Xverse.js +1 -0
- package/build/transaction/browser/types/Xverse.js.map +1 -0
- package/build/transaction/builders/CancelTransaction.d.ts +31 -6
- package/build/transaction/builders/CancelTransaction.d.ts.map +1 -0
- package/build/transaction/builders/CancelTransaction.js +116 -33
- package/build/transaction/builders/CancelTransaction.js.map +1 -0
- package/build/transaction/builders/ChallengeSolutionTransaction.d.ts +1 -0
- package/build/transaction/builders/ChallengeSolutionTransaction.d.ts.map +1 -0
- package/build/transaction/builders/ChallengeSolutionTransaction.js +88 -0
- package/build/transaction/builders/ChallengeSolutionTransaction.js.map +1 -0
- package/build/transaction/builders/ConsolidatedInteractionTransaction.d.ts +140 -13
- package/build/transaction/builders/ConsolidatedInteractionTransaction.d.ts.map +1 -0
- package/build/transaction/builders/ConsolidatedInteractionTransaction.js +197 -20
- package/build/transaction/builders/ConsolidatedInteractionTransaction.js.map +1 -0
- package/build/transaction/builders/CustomScriptTransaction.d.ts +108 -8
- package/build/transaction/builders/CustomScriptTransaction.d.ts.map +1 -0
- package/build/transaction/builders/CustomScriptTransaction.js +176 -39
- package/build/transaction/builders/CustomScriptTransaction.js.map +1 -0
- package/build/transaction/builders/DeploymentTransaction.d.ts +120 -9
- package/build/transaction/builders/DeploymentTransaction.d.ts.map +1 -0
- package/build/transaction/builders/DeploymentTransaction.js +194 -51
- package/build/transaction/builders/DeploymentTransaction.js.map +1 -0
- package/build/transaction/builders/FundingTransaction.d.ts +5 -4
- package/build/transaction/builders/FundingTransaction.d.ts.map +1 -0
- package/build/transaction/builders/FundingTransaction.js +15 -8
- package/build/transaction/builders/FundingTransaction.js.map +1 -0
- package/build/transaction/builders/InteractionTransaction.d.ts +14 -5
- package/build/transaction/builders/InteractionTransaction.d.ts.map +1 -0
- package/build/transaction/builders/InteractionTransaction.js +18 -5
- package/build/transaction/builders/InteractionTransaction.js.map +1 -0
- package/build/transaction/builders/InteractionTransactionP2WDA.d.ts +58 -7
- package/build/transaction/builders/InteractionTransactionP2WDA.d.ts.map +1 -0
- package/build/transaction/builders/InteractionTransactionP2WDA.js +95 -18
- package/build/transaction/builders/InteractionTransactionP2WDA.js.map +1 -0
- package/build/transaction/builders/MultiSignTransaction.d.ts +126 -17
- package/build/transaction/builders/MultiSignTransaction.d.ts.map +1 -0
- package/build/transaction/builders/MultiSignTransaction.js +201 -76
- package/build/transaction/builders/MultiSignTransaction.js.map +1 -0
- package/build/transaction/builders/SharedInteractionTransaction.d.ts +106 -18
- package/build/transaction/builders/SharedInteractionTransaction.d.ts.map +1 -0
- package/build/transaction/builders/SharedInteractionTransaction.js +158 -40
- package/build/transaction/builders/SharedInteractionTransaction.js.map +1 -0
- package/build/transaction/builders/TransactionBuilder.d.ts +249 -19
- package/build/transaction/builders/TransactionBuilder.d.ts.map +1 -0
- package/build/transaction/builders/TransactionBuilder.js +377 -60
- package/build/transaction/builders/TransactionBuilder.js.map +1 -0
- package/build/transaction/enums/TransactionType.d.ts +1 -0
- package/build/transaction/enums/TransactionType.d.ts.map +1 -0
- package/build/transaction/enums/TransactionType.js +1 -0
- package/build/transaction/enums/TransactionType.js.map +1 -0
- package/build/transaction/interfaces/ICancelTransactionParameters.d.ts +3 -2
- package/build/transaction/interfaces/ICancelTransactionParameters.d.ts.map +1 -0
- package/build/transaction/interfaces/ICancelTransactionParameters.js +1 -0
- package/build/transaction/interfaces/ICancelTransactionParameters.js.map +1 -0
- package/build/transaction/interfaces/IConsolidatedTransactionParameters.d.ts +48 -5
- package/build/transaction/interfaces/IConsolidatedTransactionParameters.d.ts.map +1 -0
- package/build/transaction/interfaces/IConsolidatedTransactionParameters.js +1 -0
- package/build/transaction/interfaces/IConsolidatedTransactionParameters.js.map +1 -0
- package/build/transaction/interfaces/ICustomTransactionParameters.d.ts +7 -5
- package/build/transaction/interfaces/ICustomTransactionParameters.d.ts.map +1 -0
- package/build/transaction/interfaces/ICustomTransactionParameters.js +1 -0
- package/build/transaction/interfaces/ICustomTransactionParameters.js.map +1 -0
- package/build/transaction/interfaces/ITransactionParameters.d.ts +27 -15
- package/build/transaction/interfaces/ITransactionParameters.d.ts.map +1 -0
- package/build/transaction/interfaces/ITransactionParameters.js +1 -0
- package/build/transaction/interfaces/ITransactionParameters.js.map +1 -0
- package/build/transaction/interfaces/ITransactionResponses.d.ts +3 -2
- package/build/transaction/interfaces/ITransactionResponses.d.ts.map +1 -0
- package/build/transaction/interfaces/ITransactionResponses.js +1 -0
- package/build/transaction/interfaces/ITransactionResponses.js.map +1 -0
- package/build/transaction/interfaces/ITweakedTransactionData.d.ts +21 -8
- package/build/transaction/interfaces/ITweakedTransactionData.d.ts.map +1 -0
- package/build/transaction/interfaces/ITweakedTransactionData.js +1 -0
- package/build/transaction/interfaces/ITweakedTransactionData.js.map +1 -0
- package/build/transaction/interfaces/IWeb3ProviderTypes.d.ts +29 -3
- package/build/transaction/interfaces/IWeb3ProviderTypes.d.ts.map +1 -0
- package/build/transaction/interfaces/IWeb3ProviderTypes.js +2 -1
- package/build/transaction/interfaces/IWeb3ProviderTypes.js.map +1 -0
- package/build/transaction/interfaces/Tap.d.ts +4 -3
- package/build/transaction/interfaces/Tap.d.ts.map +1 -0
- package/build/transaction/interfaces/Tap.js +1 -0
- package/build/transaction/interfaces/Tap.js.map +1 -0
- package/build/transaction/mineable/IP2WSHAddress.d.ts +2 -1
- package/build/transaction/mineable/IP2WSHAddress.d.ts.map +1 -0
- package/build/transaction/mineable/IP2WSHAddress.js +1 -0
- package/build/transaction/mineable/IP2WSHAddress.js.map +1 -0
- package/build/transaction/mineable/TimelockGenerator.d.ts +13 -4
- package/build/transaction/mineable/TimelockGenerator.d.ts.map +1 -0
- package/build/transaction/mineable/TimelockGenerator.js +12 -3
- package/build/transaction/mineable/TimelockGenerator.js.map +1 -0
- package/build/transaction/offline/OfflineTransactionManager.d.ts +193 -12
- package/build/transaction/offline/OfflineTransactionManager.d.ts.map +1 -0
- package/build/transaction/offline/OfflineTransactionManager.js +192 -8
- package/build/transaction/offline/OfflineTransactionManager.js.map +1 -0
- package/build/transaction/offline/TransactionReconstructor.d.ts +56 -6
- package/build/transaction/offline/TransactionReconstructor.d.ts.map +1 -0
- package/build/transaction/offline/TransactionReconstructor.js +111 -75
- package/build/transaction/offline/TransactionReconstructor.js.map +1 -0
- package/build/transaction/offline/TransactionSerializer.d.ts +54 -3
- package/build/transaction/offline/TransactionSerializer.d.ts.map +1 -0
- package/build/transaction/offline/TransactionSerializer.js +206 -95
- package/build/transaction/offline/TransactionSerializer.js.map +1 -0
- package/build/transaction/offline/TransactionStateCapture.d.ts +66 -7
- package/build/transaction/offline/TransactionStateCapture.d.ts.map +1 -0
- package/build/transaction/offline/TransactionStateCapture.js +124 -60
- package/build/transaction/offline/TransactionStateCapture.js.map +1 -0
- package/build/transaction/offline/interfaces/ISerializableState.d.ts +72 -1
- package/build/transaction/offline/interfaces/ISerializableState.d.ts.map +1 -0
- package/build/transaction/offline/interfaces/ISerializableState.js +10 -1
- package/build/transaction/offline/interfaces/ISerializableState.js.map +1 -0
- package/build/transaction/offline/interfaces/ITypeSpecificData.d.ts +77 -1
- package/build/transaction/offline/interfaces/ITypeSpecificData.d.ts.map +1 -0
- package/build/transaction/offline/interfaces/ITypeSpecificData.js +19 -0
- package/build/transaction/offline/interfaces/ITypeSpecificData.js.map +1 -0
- package/build/transaction/psbt/PSBTTypes.d.ts +1 -0
- package/build/transaction/psbt/PSBTTypes.d.ts.map +1 -0
- package/build/transaction/psbt/PSBTTypes.js +1 -0
- package/build/transaction/psbt/PSBTTypes.js.map +1 -0
- package/build/transaction/shared/P2TR_MS.d.ts +11 -2
- package/build/transaction/shared/P2TR_MS.d.ts.map +1 -0
- package/build/transaction/shared/P2TR_MS.js +10 -0
- package/build/transaction/shared/P2TR_MS.js.map +1 -0
- package/build/transaction/shared/TweakedTransaction.d.ts +281 -38
- package/build/transaction/shared/TweakedTransaction.d.ts.map +1 -0
- package/build/transaction/shared/TweakedTransaction.js +576 -114
- package/build/transaction/shared/TweakedTransaction.js.map +1 -0
- package/build/transaction/utils/WitnessUtils.d.ts +7 -1
- package/build/transaction/utils/WitnessUtils.d.ts.map +1 -0
- package/build/transaction/utils/WitnessUtils.js +17 -3
- package/build/transaction/utils/WitnessUtils.js.map +1 -0
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/build/utils/BitcoinUtils.d.ts +19 -0
- package/build/utils/BitcoinUtils.d.ts.map +1 -0
- package/build/utils/BitcoinUtils.js +19 -0
- package/build/utils/BitcoinUtils.js.map +1 -0
- package/build/utils/BufferHelper.d.ts +2 -1
- package/build/utils/BufferHelper.d.ts.map +1 -0
- package/build/utils/BufferHelper.js +38 -32
- package/build/utils/BufferHelper.js.map +1 -0
- package/build/utils/StringToBuffer.d.ts +1 -0
- package/build/utils/StringToBuffer.d.ts.map +1 -0
- package/build/utils/StringToBuffer.js +1 -0
- package/build/utils/StringToBuffer.js.map +1 -0
- package/build/utils/lengths.d.ts +1 -0
- package/build/utils/lengths.d.ts.map +1 -0
- package/build/utils/lengths.js +1 -0
- package/build/utils/lengths.js.map +1 -0
- package/build/utils/types.d.ts +1 -0
- package/build/utils/types.d.ts.map +1 -0
- package/build/utils/types.js +2 -1
- package/build/utils/types.js.map +1 -0
- package/build/utxo/OPNetLimitedProvider.d.ts +39 -3
- package/build/utxo/OPNetLimitedProvider.d.ts.map +1 -0
- package/build/utxo/OPNetLimitedProvider.js +41 -3
- package/build/utxo/OPNetLimitedProvider.js.map +1 -0
- package/build/utxo/interfaces/BroadcastResponse.d.ts +1 -0
- package/build/utxo/interfaces/BroadcastResponse.d.ts.map +1 -0
- package/build/utxo/interfaces/BroadcastResponse.js +1 -0
- package/build/utxo/interfaces/BroadcastResponse.js.map +1 -0
- package/build/utxo/interfaces/IUTXO.d.ts +13 -7
- package/build/utxo/interfaces/IUTXO.d.ts.map +1 -0
- package/build/utxo/interfaces/IUTXO.js +1 -0
- package/build/utxo/interfaces/IUTXO.js.map +1 -0
- package/build/verification/TapscriptVerificator.d.ts +12 -10
- package/build/verification/TapscriptVerificator.d.ts.map +1 -0
- package/build/verification/TapscriptVerificator.js +28 -38
- package/build/verification/TapscriptVerificator.js.map +1 -0
- package/eslint.config.js +0 -1
- package/package.json +16 -39
- package/src/abi/ABICoder.ts +0 -13
- package/src/branded/Branded.ts +5 -0
- package/src/buffer/BinaryReader.ts +7 -7
- package/src/buffer/BinaryWriter.ts +29 -24
- package/src/bytecode/Compressor.ts +1 -1
- package/src/chain/ChainData.ts +34 -27
- package/src/consensus/ConsensusConfig.ts +1 -1
- package/src/consensus/IConsensusConfig.ts +0 -17
- package/src/consensus/metadata/RoswellConsensus.ts +1 -17
- package/src/crypto/crypto-browser.js +3 -4
- package/src/deterministic/AddressMap.ts +5 -1
- package/src/deterministic/AddressSet.ts +5 -1
- package/src/deterministic/CustomMap.ts +6 -2
- package/src/deterministic/DeterministicMap.ts +8 -4
- package/src/deterministic/DeterministicSet.ts +6 -2
- package/src/deterministic/ExtendedAddressMap.ts +9 -4
- package/src/deterministic/FastMap.ts +9 -5
- package/src/ecc/backend.ts +17 -0
- package/src/epoch/ChallengeSolution.ts +3 -3
- package/src/epoch/interfaces/IChallengeSolution.ts +13 -13
- package/src/epoch/validator/EpochValidator.ts +24 -43
- package/src/generators/AddressGenerator.ts +6 -6
- package/src/generators/Features.ts +3 -3
- package/src/generators/Generator.ts +42 -26
- package/src/generators/builders/CalldataGenerator.ts +26 -24
- package/src/generators/builders/CustomGenerator.ts +4 -4
- package/src/generators/builders/DeploymentGenerator.ts +25 -23
- package/src/generators/builders/HashCommitmentGenerator.ts +31 -31
- package/src/generators/builders/LegacyCalldataGenerator.ts +26 -24
- package/src/generators/builders/MultiSignGenerator.ts +12 -12
- package/src/generators/builders/P2WDAGenerator.ts +10 -10
- package/src/keypair/Address.ts +115 -72
- package/src/keypair/AddressVerificator.ts +16 -147
- package/src/keypair/EcKeyPair.ts +109 -118
- package/src/keypair/MessageSigner.ts +70 -150
- package/src/keypair/Wallet.ts +59 -240
- package/src/metadata/ContractBaseMetadata.ts +2 -2
- package/src/mnemonic/Mnemonic.ts +32 -221
- package/src/opnet.ts +12 -6
- package/src/p2wda/P2WDADetector.ts +23 -72
- package/src/polyfill/disposable.ts +29 -0
- package/src/signer/AddressRotation.ts +1 -1
- package/src/signer/IRotationSigner.ts +3 -3
- package/src/signer/ParallelSignerAdapter.ts +59 -0
- package/src/signer/SignerUtils.ts +4 -4
- package/src/signer/TweakedSigner.ts +28 -13
- package/src/transaction/ContractAddress.ts +3 -7
- package/src/transaction/TransactionFactory.ts +28 -50
- package/src/transaction/browser/BrowserSignerBase.ts +12 -6
- package/src/transaction/browser/Web3Provider.ts +3 -3
- package/src/transaction/browser/extensions/UnisatSigner.ts +52 -48
- package/src/transaction/browser/extensions/XverseSigner.ts +55 -38
- package/src/transaction/browser/types/OPWallet.ts +2 -2
- package/src/transaction/browser/types/Unisat.ts +1 -1
- package/src/transaction/builders/CancelTransaction.ts +59 -24
- package/src/transaction/builders/ChallengeSolutionTransaction.ts +3 -3
- package/src/transaction/builders/ConsolidatedInteractionTransaction.ts +39 -34
- package/src/transaction/builders/CustomScriptTransaction.ts +79 -56
- package/src/transaction/builders/DeploymentTransaction.ts +82 -63
- package/src/transaction/builders/FundingTransaction.ts +11 -11
- package/src/transaction/builders/InteractionTransaction.ts +10 -10
- package/src/transaction/builders/InteractionTransactionP2WDA.ts +38 -40
- package/src/transaction/builders/MultiSignTransaction.ts +68 -61
- package/src/transaction/builders/SharedInteractionTransaction.ts +81 -57
- package/src/transaction/builders/TransactionBuilder.ts +101 -79
- package/src/transaction/interfaces/ICancelTransactionParameters.ts +2 -2
- package/src/transaction/interfaces/IConsolidatedTransactionParameters.ts +5 -5
- package/src/transaction/interfaces/ICustomTransactionParameters.ts +5 -5
- package/src/transaction/interfaces/ITransactionParameters.ts +15 -15
- package/src/transaction/interfaces/ITransactionResponses.ts +2 -2
- package/src/transaction/interfaces/ITweakedTransactionData.ts +17 -8
- package/src/transaction/interfaces/IWeb3ProviderTypes.ts +3 -3
- package/src/transaction/interfaces/Tap.ts +3 -3
- package/src/transaction/mineable/IP2WSHAddress.ts +1 -1
- package/src/transaction/mineable/TimelockGenerator.ts +19 -12
- package/src/transaction/offline/OfflineTransactionManager.ts +22 -23
- package/src/transaction/offline/TransactionReconstructor.ts +83 -91
- package/src/transaction/offline/TransactionSerializer.ts +151 -101
- package/src/transaction/offline/TransactionStateCapture.ts +83 -79
- package/src/transaction/offline/interfaces/ISerializableState.ts +1 -1
- package/src/transaction/offline/interfaces/ITypeSpecificData.ts +1 -1
- package/src/transaction/shared/P2TR_MS.ts +4 -4
- package/src/transaction/shared/TweakedTransaction.ts +326 -124
- package/src/transaction/utils/WitnessUtils.ts +18 -9
- package/src/utils/BufferHelper.ts +39 -37
- package/src/utxo/OPNetLimitedProvider.ts +7 -7
- package/src/utxo/interfaces/IUTXO.ts +7 -7
- package/src/verification/TapscriptVerificator.ts +73 -86
- package/test/address-rotation.test.ts +24 -24
- package/test/address.test.ts +12 -12
- package/test/addressmap.test.ts +30 -30
- package/test/binary-reader-writer.test.ts +8 -8
- package/test/browser/offline-transaction.test.ts +2206 -0
- package/test/browser/parallel-signing.test.ts +316 -0
- package/test/browser/setup.ts +11 -0
- package/test/browser/transaction-signing.test.ts +416 -0
- package/test/buffer-helper.test.ts +287 -0
- package/test/derivePath.test.ts +4 -3
- package/test/disposable.test.ts +279 -0
- package/test/fastmap-setall.test.ts +1 -1
- package/test/fastmap.test.ts +3 -3
- package/test/messagesigner-mldsa.test.ts +3 -3
- package/test/messagesigner-schnorr.test.ts +9 -9
- package/test/offline-transaction.test.ts +461 -288
- package/test/old/FastBigIntMap.ts +3 -3
- package/test/oldfastmap.test.ts +6 -6
- package/test/transaction-builders.test.ts +321 -0
- package/tsconfig.base.json +34 -18
- package/tsconfig.browser.json +15 -0
- package/tsconfig.json +3 -8
- package/vite.config.browser.ts +4 -5
- package/vitest.config.browser.ts +68 -0
- package/vitest.config.ts +1 -1
- package/browser/valibot.js +0 -4948
- package/tsconfig.webpack.json +0 -18
package/src/mnemonic/Mnemonic.ts
CHANGED
|
@@ -1,91 +1,36 @@
|
|
|
1
1
|
import * as bip39 from 'bip39';
|
|
2
2
|
import {
|
|
3
3
|
BIP32Factory,
|
|
4
|
-
BIP32Interface,
|
|
4
|
+
type BIP32Interface,
|
|
5
5
|
MLDSASecurityLevel,
|
|
6
6
|
QuantumBIP32Factory,
|
|
7
|
-
QuantumBIP32Interface,
|
|
7
|
+
type QuantumBIP32Interface,
|
|
8
8
|
} from '@btc-vision/bip32';
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
9
|
+
import { initEccLib, type Network, networks, toHex } from '@btc-vision/bitcoin';
|
|
10
|
+
import { backend, eccLib } from '../ecc/backend.js';
|
|
11
11
|
import { Wallet } from '../keypair/Wallet.js';
|
|
12
12
|
import { MnemonicStrength } from './MnemonicStrength.js';
|
|
13
13
|
import { BIPStandard, buildBIPPath } from './BIPStandard.js';
|
|
14
14
|
import { AddressTypes } from '../keypair/AddressVerificator.js';
|
|
15
15
|
|
|
16
|
-
initEccLib(
|
|
16
|
+
initEccLib(eccLib);
|
|
17
17
|
|
|
18
|
-
const bip32 = BIP32Factory(
|
|
18
|
+
const bip32 = BIP32Factory(backend);
|
|
19
19
|
|
|
20
20
|
export { BIPStandard, getBIPDescription } from './BIPStandard.js';
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Mnemonic class for managing BIP39 mnemonic phrases with BIP360 quantum support
|
|
24
|
-
*
|
|
25
|
-
* This class provides methods to generate, validate, and derive wallets from mnemonic phrases.
|
|
26
|
-
* It supports both classical Bitcoin derivation paths (BIP44, BIP84, etc.) and quantum-resistant
|
|
27
|
-
* ML-DSA keys via BIP360.
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```typescript
|
|
31
|
-
* // Generate a new mnemonic
|
|
32
|
-
* const mnemonic = Mnemonic.generate();
|
|
33
|
-
*
|
|
34
|
-
* // Derive a wallet at index 0
|
|
35
|
-
* const wallet = mnemonic.derive(0);
|
|
36
|
-
*
|
|
37
|
-
* // Derive multiple wallets
|
|
38
|
-
* const wallets = mnemonic.deriveMultiple(5);
|
|
39
|
-
*
|
|
40
|
-
* // Load from existing mnemonic
|
|
41
|
-
* const existingMnemonic = new Mnemonic('your twelve word mnemonic phrase here...');
|
|
42
|
-
* ```
|
|
43
24
|
*/
|
|
44
|
-
export class Mnemonic {
|
|
45
|
-
/**
|
|
46
|
-
* The BIP39 mnemonic phrase
|
|
47
|
-
*/
|
|
25
|
+
export class Mnemonic implements Disposable {
|
|
48
26
|
private readonly _phrase: string;
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Optional BIP39 passphrase for additional security
|
|
52
|
-
*/
|
|
53
27
|
private readonly _passphrase: string;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* The network to use for derivation
|
|
57
|
-
*/
|
|
58
28
|
private readonly _network: Network;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* The ML-DSA security level for quantum keys
|
|
62
|
-
*/
|
|
63
29
|
private readonly _securityLevel: MLDSASecurityLevel;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* The seed derived from the mnemonic
|
|
67
|
-
*/
|
|
68
|
-
private readonly _seed: Buffer;
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* The classical BIP32 root for Bitcoin keys
|
|
72
|
-
*/
|
|
30
|
+
private readonly _seed: Uint8Array;
|
|
73
31
|
private readonly _classicalRoot: BIP32Interface;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* The quantum BIP32 root for ML-DSA keys
|
|
77
|
-
*/
|
|
78
32
|
private readonly _quantumRoot: QuantumBIP32Interface;
|
|
79
33
|
|
|
80
|
-
/**
|
|
81
|
-
* Create a new Mnemonic instance from an existing phrase
|
|
82
|
-
*
|
|
83
|
-
* @param phrase - The BIP39 mnemonic phrase (12, 15, 18, 21, or 24 words)
|
|
84
|
-
* @param passphrase - Optional BIP39 passphrase for additional security (default: '')
|
|
85
|
-
* @param network - The Bitcoin network to use (default: bitcoin mainnet)
|
|
86
|
-
* @param securityLevel - The ML-DSA security level for quantum keys (default: LEVEL2/44)
|
|
87
|
-
* @throws {Error} If the mnemonic phrase is invalid
|
|
88
|
-
*/
|
|
89
34
|
constructor(
|
|
90
35
|
phrase: string,
|
|
91
36
|
passphrase: string = '',
|
|
@@ -115,63 +60,42 @@ export class Mnemonic {
|
|
|
115
60
|
);
|
|
116
61
|
}
|
|
117
62
|
|
|
118
|
-
/**
|
|
119
|
-
* Get the mnemonic phrase
|
|
120
|
-
*
|
|
121
|
-
* @warning This phrase is highly sensitive and can be used to derive all keys in the wallet.
|
|
122
|
-
* Handle with extreme care, never log or transmit insecurely, and store only in secure environments.
|
|
123
|
-
*
|
|
124
|
-
* @returns The BIP39 mnemonic phrase
|
|
125
|
-
*/
|
|
126
63
|
public get phrase(): string {
|
|
127
64
|
return this._phrase;
|
|
128
65
|
}
|
|
129
66
|
|
|
130
|
-
/**
|
|
131
|
-
* Get the network
|
|
132
|
-
*/
|
|
133
67
|
public get network(): Network {
|
|
134
68
|
return this._network;
|
|
135
69
|
}
|
|
136
70
|
|
|
137
|
-
/**
|
|
138
|
-
* Get the ML-DSA security level
|
|
139
|
-
*/
|
|
140
71
|
public get securityLevel(): MLDSASecurityLevel {
|
|
141
72
|
return this._securityLevel;
|
|
142
73
|
}
|
|
143
74
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
*
|
|
147
|
-
* @warning This seed is highly sensitive and can be used to derive all keys in the wallet.
|
|
148
|
-
* Handle with extreme care, never log or transmit insecurely, and store only in secure environments.
|
|
149
|
-
*
|
|
150
|
-
* @returns A copy of the seed buffer to prevent external modification
|
|
151
|
-
*/
|
|
152
|
-
public get seed(): Buffer {
|
|
153
|
-
return Buffer.from(this._seed);
|
|
75
|
+
public get seed(): Uint8Array {
|
|
76
|
+
return new Uint8Array(this._seed);
|
|
154
77
|
}
|
|
155
78
|
|
|
156
79
|
/**
|
|
157
|
-
*
|
|
80
|
+
* Best-effort zeroing of secret material held by this mnemonic.
|
|
158
81
|
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
82
|
+
* Zeros the seed buffer and root private keys in-place.
|
|
83
|
+
* The mnemonic phrase and passphrase are JS strings and cannot be zeroed.
|
|
161
84
|
*/
|
|
85
|
+
public zeroize(): void {
|
|
86
|
+
this._seed.fill(0);
|
|
87
|
+
this._classicalRoot.privateKey?.fill(0);
|
|
88
|
+
this._quantumRoot.privateKey?.fill(0);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
public [Symbol.dispose](): void {
|
|
92
|
+
this.zeroize();
|
|
93
|
+
}
|
|
94
|
+
|
|
162
95
|
public static generatePhrase(strength: MnemonicStrength = MnemonicStrength.MAXIMUM): string {
|
|
163
96
|
return bip39.generateMnemonic(strength);
|
|
164
97
|
}
|
|
165
98
|
|
|
166
|
-
/**
|
|
167
|
-
* Generate a new Mnemonic instance with a random phrase
|
|
168
|
-
*
|
|
169
|
-
* @param strength - The entropy strength in bits (default: 256 for 24 words)
|
|
170
|
-
* @param passphrase - Optional BIP39 passphrase for additional security (default: '')
|
|
171
|
-
* @param network - The Bitcoin network to use (default: bitcoin mainnet)
|
|
172
|
-
* @param securityLevel - The ML-DSA security level for quantum keys (default: LEVEL2/44)
|
|
173
|
-
* @returns A new Mnemonic instance
|
|
174
|
-
*/
|
|
175
99
|
public static generate(
|
|
176
100
|
strength: MnemonicStrength = MnemonicStrength.MAXIMUM,
|
|
177
101
|
passphrase: string = '',
|
|
@@ -182,47 +106,16 @@ export class Mnemonic {
|
|
|
182
106
|
return new Mnemonic(phrase, passphrase, network, securityLevel);
|
|
183
107
|
}
|
|
184
108
|
|
|
185
|
-
/**
|
|
186
|
-
* Validate a mnemonic phrase
|
|
187
|
-
*
|
|
188
|
-
* @param phrase - The mnemonic phrase to validate
|
|
189
|
-
* @returns True if the phrase is valid, false otherwise
|
|
190
|
-
*/
|
|
191
109
|
public static validate(phrase: string): boolean {
|
|
192
110
|
return bip39.validateMnemonic(phrase);
|
|
193
111
|
}
|
|
194
112
|
|
|
195
|
-
/**
|
|
196
|
-
* Derive a wallet at a specific index using BIP360 (quantum) and configurable BIP standard (classical) paths
|
|
197
|
-
*
|
|
198
|
-
* This method derives both classical ECDSA/Schnorr keys and quantum-resistant ML-DSA keys
|
|
199
|
-
* for the wallet, providing hybrid post-quantum security.
|
|
200
|
-
*
|
|
201
|
-
* @param index - The address index to derive (default: 0)
|
|
202
|
-
* @param account - The account index (default: 0)
|
|
203
|
-
* @param isChange - Whether this is a change address (default: false)
|
|
204
|
-
* @param bipStandard - The BIP standard to use for classical derivation (default: BIP84)
|
|
205
|
-
* @returns A Wallet instance with both classical and quantum keys
|
|
206
|
-
*
|
|
207
|
-
* @example
|
|
208
|
-
* ```typescript
|
|
209
|
-
* // Default: BIP84 (Native SegWit)
|
|
210
|
-
* const wallet1 = mnemonic.derive(0);
|
|
211
|
-
*
|
|
212
|
-
* // BIP44 (Compatible with Unisat)
|
|
213
|
-
* const wallet2 = mnemonic.derive(0, 0, false, BIPStandard.BIP44);
|
|
214
|
-
*
|
|
215
|
-
* // BIP86 (Taproot)
|
|
216
|
-
* const wallet3 = mnemonic.derive(0, 0, false, BIPStandard.BIP86);
|
|
217
|
-
* ```
|
|
218
|
-
*/
|
|
219
113
|
public derive(
|
|
220
114
|
index: number = 0,
|
|
221
115
|
account: number = 0,
|
|
222
116
|
isChange: boolean = false,
|
|
223
117
|
bipStandard: BIPStandard = BIPStandard.BIP84,
|
|
224
118
|
): Wallet {
|
|
225
|
-
// Derive classical key using specified BIP standard
|
|
226
119
|
const classicalPath = this.buildClassicalPath(account, index, isChange, bipStandard);
|
|
227
120
|
const classicalChild = this._classicalRoot.derivePath(classicalPath);
|
|
228
121
|
|
|
@@ -230,7 +123,6 @@ export class Mnemonic {
|
|
|
230
123
|
throw new Error(`Failed to derive classical private key at index ${index}`);
|
|
231
124
|
}
|
|
232
125
|
|
|
233
|
-
// Derive quantum key using BIP360
|
|
234
126
|
const quantumPath = this.buildQuantumPath(account, index, isChange);
|
|
235
127
|
const quantumChild = this._quantumRoot.derivePath(quantumPath);
|
|
236
128
|
|
|
@@ -238,38 +130,21 @@ export class Mnemonic {
|
|
|
238
130
|
throw new Error(`Failed to derive quantum private key at index ${index}`);
|
|
239
131
|
}
|
|
240
132
|
|
|
241
|
-
// Create a wallet with both keys
|
|
242
133
|
return new Wallet(
|
|
243
|
-
|
|
244
|
-
|
|
134
|
+
toHex(new Uint8Array(classicalChild.privateKey)),
|
|
135
|
+
toHex(new Uint8Array(quantumChild.privateKey)),
|
|
245
136
|
this._network,
|
|
246
137
|
this._securityLevel,
|
|
247
|
-
|
|
138
|
+
new Uint8Array(this._quantumRoot.chainCode),
|
|
248
139
|
);
|
|
249
140
|
}
|
|
250
141
|
|
|
251
|
-
/**
|
|
252
|
-
* Derive a Unisat-compatible wallet
|
|
253
|
-
*
|
|
254
|
-
* Unisat uses different derivation paths based on address type:
|
|
255
|
-
* - Legacy (P2PKH): m/44'/coinType'/account'/change/index
|
|
256
|
-
* - Nested SegWit (P2SH-P2WPKH): m/49'/coinType'/account'/change/index
|
|
257
|
-
* - Native SegWit (P2WPKH): m/84'/coinType'/account'/change/index
|
|
258
|
-
* - Taproot (P2TR): m/86'/coinType'/account'/change/index
|
|
259
|
-
*
|
|
260
|
-
* @param addressType - The address type to generate
|
|
261
|
-
* @param index - The address index (default: 0)
|
|
262
|
-
* @param account - The account index (default: 0)
|
|
263
|
-
* @param isChange - Whether this is a change address (default: false)
|
|
264
|
-
* @returns A Wallet instance with both classical and quantum keys
|
|
265
|
-
*/
|
|
266
142
|
public deriveOPWallet(
|
|
267
143
|
addressType: AddressTypes = AddressTypes.P2TR,
|
|
268
144
|
index: number = 0,
|
|
269
145
|
account: number = 0,
|
|
270
146
|
isChange: boolean = false,
|
|
271
147
|
): Wallet {
|
|
272
|
-
// Determine BIP purpose based on address type
|
|
273
148
|
let purpose: number;
|
|
274
149
|
switch (addressType) {
|
|
275
150
|
case AddressTypes.P2PKH:
|
|
@@ -288,19 +163,16 @@ export class Mnemonic {
|
|
|
288
163
|
throw new Error(`Unsupported address type: ${addressType}`);
|
|
289
164
|
}
|
|
290
165
|
|
|
291
|
-
// Build classical derivation path for Unisat
|
|
292
166
|
const coinType = this.getCoinType();
|
|
293
167
|
const change = isChange ? 1 : 0;
|
|
294
168
|
const classicalPath = `m/${purpose}'/0'/${account}'/${change}/${index}`;
|
|
295
169
|
|
|
296
|
-
// Derive classical key
|
|
297
170
|
const classicalChild = this._classicalRoot.derivePath(classicalPath);
|
|
298
171
|
|
|
299
172
|
if (!classicalChild.privateKey) {
|
|
300
173
|
throw new Error(`Failed to derive classical private key at path ${classicalPath}`);
|
|
301
174
|
}
|
|
302
175
|
|
|
303
|
-
// Derive quantum key using BIP360
|
|
304
176
|
const quantumPath = `m/360'/${coinType}'/${account}'/${change}/${index}`;
|
|
305
177
|
const quantumChild = this._quantumRoot.derivePath(quantumPath);
|
|
306
178
|
|
|
@@ -308,26 +180,15 @@ export class Mnemonic {
|
|
|
308
180
|
throw new Error(`Failed to derive quantum private key at path ${quantumPath}`);
|
|
309
181
|
}
|
|
310
182
|
|
|
311
|
-
// Create wallet with both classical and quantum keys
|
|
312
183
|
return new Wallet(
|
|
313
|
-
|
|
314
|
-
|
|
184
|
+
toHex(new Uint8Array(classicalChild.privateKey)),
|
|
185
|
+
toHex(new Uint8Array(quantumChild.privateKey)),
|
|
315
186
|
this._network,
|
|
316
187
|
this._securityLevel,
|
|
317
|
-
|
|
188
|
+
new Uint8Array(this._quantumRoot.chainCode),
|
|
318
189
|
);
|
|
319
190
|
}
|
|
320
191
|
|
|
321
|
-
/**
|
|
322
|
-
* Derive multiple Unisat-compatible wallets
|
|
323
|
-
*
|
|
324
|
-
* @param addressType - The address type to generate
|
|
325
|
-
* @param count - Number of wallets to derive
|
|
326
|
-
* @param startIndex - Starting index (default: 0)
|
|
327
|
-
* @param account - The account index (default: 0)
|
|
328
|
-
* @param isChange - Whether these are change addresses (default: false)
|
|
329
|
-
* @returns Array of Wallet instances
|
|
330
|
-
*/
|
|
331
192
|
public deriveMultipleUnisat(
|
|
332
193
|
addressType: AddressTypes = AddressTypes.P2TR,
|
|
333
194
|
count: number = 5,
|
|
@@ -344,16 +205,6 @@ export class Mnemonic {
|
|
|
344
205
|
return wallets;
|
|
345
206
|
}
|
|
346
207
|
|
|
347
|
-
/**
|
|
348
|
-
* Derive multiple wallets with sequential indices
|
|
349
|
-
*
|
|
350
|
-
* @param count - The number of wallets to derive
|
|
351
|
-
* @param startIndex - The starting address index (default: 0)
|
|
352
|
-
* @param account - The account index (default: 0)
|
|
353
|
-
* @param isChange - Whether these are change addresses (default: false)
|
|
354
|
-
* @param bipStandard - The BIP standard to use for classical derivation (default: BIP84)
|
|
355
|
-
* @returns An array of Wallet instances
|
|
356
|
-
*/
|
|
357
208
|
public deriveMultiple(
|
|
358
209
|
count: number,
|
|
359
210
|
startIndex: number = 0,
|
|
@@ -370,13 +221,6 @@ export class Mnemonic {
|
|
|
370
221
|
return wallets;
|
|
371
222
|
}
|
|
372
223
|
|
|
373
|
-
/**
|
|
374
|
-
* Derive a wallet using a custom derivation path
|
|
375
|
-
*
|
|
376
|
-
* @param classicalPath - The BIP32 path for classical keys (e.g., "m/84'/0'/0'/0/0")
|
|
377
|
-
* @param quantumPath - The BIP360 path for quantum keys (e.g., "m/360'/0'/0'/0/0")
|
|
378
|
-
* @returns A Wallet instance
|
|
379
|
-
*/
|
|
380
224
|
public deriveCustomPath(classicalPath: string, quantumPath: string): Wallet {
|
|
381
225
|
const classicalChild = this._classicalRoot.derivePath(classicalPath);
|
|
382
226
|
const quantumChild = this._quantumRoot.derivePath(quantumPath);
|
|
@@ -389,43 +233,23 @@ export class Mnemonic {
|
|
|
389
233
|
throw new Error(`Failed to derive quantum private key at path ${quantumPath}`);
|
|
390
234
|
}
|
|
391
235
|
|
|
392
|
-
// Create wallet with both classical and ML-DSA private keys
|
|
393
236
|
return new Wallet(
|
|
394
|
-
|
|
395
|
-
|
|
237
|
+
toHex(new Uint8Array(classicalChild.privateKey)),
|
|
238
|
+
toHex(new Uint8Array(quantumChild.privateKey)),
|
|
396
239
|
this._network,
|
|
397
240
|
this._securityLevel,
|
|
398
|
-
|
|
241
|
+
new Uint8Array(this._quantumRoot.chainCode),
|
|
399
242
|
);
|
|
400
243
|
}
|
|
401
244
|
|
|
402
|
-
/**
|
|
403
|
-
* Get the classical BIP32 root
|
|
404
|
-
*
|
|
405
|
-
* @returns The classical BIP32Interface for manual derivation
|
|
406
|
-
*/
|
|
407
245
|
public getClassicalRoot(): BIP32Interface {
|
|
408
246
|
return this._classicalRoot;
|
|
409
247
|
}
|
|
410
248
|
|
|
411
|
-
/**
|
|
412
|
-
* Get the quantum BIP32 root
|
|
413
|
-
*
|
|
414
|
-
* @returns The quantum BIP32Interface for manual derivation
|
|
415
|
-
*/
|
|
416
249
|
public getQuantumRoot(): QuantumBIP32Interface {
|
|
417
250
|
return this._quantumRoot;
|
|
418
251
|
}
|
|
419
252
|
|
|
420
|
-
/**
|
|
421
|
-
* Build a classical derivation path using specified BIP standard
|
|
422
|
-
*
|
|
423
|
-
* @param account - The account index
|
|
424
|
-
* @param index - The address index
|
|
425
|
-
* @param isChange - Whether this is a change address
|
|
426
|
-
* @param bipStandard - The BIP standard to use (default: BIP84)
|
|
427
|
-
* @returns The derivation path string
|
|
428
|
-
*/
|
|
429
253
|
private buildClassicalPath(
|
|
430
254
|
account: number,
|
|
431
255
|
index: number,
|
|
@@ -437,25 +261,12 @@ export class Mnemonic {
|
|
|
437
261
|
return buildBIPPath(bipStandard, coinType, account, change, index);
|
|
438
262
|
}
|
|
439
263
|
|
|
440
|
-
/**
|
|
441
|
-
* Build a quantum derivation path (BIP360)
|
|
442
|
-
*
|
|
443
|
-
* @param account - The account index
|
|
444
|
-
* @param index - The address index
|
|
445
|
-
* @param isChange - Whether this is a change address
|
|
446
|
-
* @returns The derivation path string
|
|
447
|
-
*/
|
|
448
264
|
private buildQuantumPath(account: number, index: number, isChange: boolean): string {
|
|
449
265
|
const coinType = this.getCoinType();
|
|
450
266
|
const change = isChange ? 1 : 0;
|
|
451
267
|
return `m/360'/${coinType}'/${account}'/${change}/${index}`;
|
|
452
268
|
}
|
|
453
269
|
|
|
454
|
-
/**
|
|
455
|
-
* Get the coin type based on the network
|
|
456
|
-
*
|
|
457
|
-
* @returns The coin type (0 for mainnet, 1 for testnet/regtest)
|
|
458
|
-
*/
|
|
459
270
|
private getCoinType(): number {
|
|
460
271
|
if (
|
|
461
272
|
this._network.bech32 === networks.testnet.bech32 ||
|
package/src/opnet.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
/** Polyfill Symbol.dispose / Symbol.asyncDispose for Safari & Android WebView */
|
|
2
|
+
import './polyfill/disposable.js';
|
|
3
|
+
|
|
4
|
+
import type { Unisat } from './transaction/browser/types/Unisat.js';
|
|
5
|
+
import type { OPWallet } from './transaction/browser/types/OPWallet.js';
|
|
3
6
|
|
|
4
7
|
export { version } from './_version.js';
|
|
5
8
|
|
|
@@ -40,10 +43,10 @@ export * from './mnemonic/BIPStandard.js';
|
|
|
40
43
|
/** Quantum (ML-DSA) */
|
|
41
44
|
export {
|
|
42
45
|
MLDSASecurityLevel,
|
|
43
|
-
MLDSAKeyPair,
|
|
44
|
-
QuantumBIP32Interface,
|
|
45
|
-
QuantumBIP32API,
|
|
46
|
-
QuantumSigner,
|
|
46
|
+
type MLDSAKeyPair,
|
|
47
|
+
type QuantumBIP32Interface,
|
|
48
|
+
type QuantumBIP32API,
|
|
49
|
+
type QuantumSigner,
|
|
47
50
|
QuantumBIP32Factory,
|
|
48
51
|
QuantumDerivationPath,
|
|
49
52
|
} from '@btc-vision/bip32';
|
|
@@ -59,6 +62,9 @@ export * from './signer/TweakedSigner.js';
|
|
|
59
62
|
export * from './signer/IRotationSigner.js';
|
|
60
63
|
export * from './signer/AddressRotation.js';
|
|
61
64
|
|
|
65
|
+
/** Parallel Signing */
|
|
66
|
+
export * from './signer/ParallelSignerAdapter.js';
|
|
67
|
+
|
|
62
68
|
/** Transaction */
|
|
63
69
|
export * from './transaction/enums/TransactionType.js';
|
|
64
70
|
export * from './transaction/interfaces/ITransactionParameters.js';
|
|
@@ -1,44 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { IP2WSHAddress } from '../transaction/mineable/IP2WSHAddress.js';
|
|
1
|
+
import { fromHex, type Network, opcodes, payments, script } from '@btc-vision/bitcoin';
|
|
2
|
+
import type { UTXO } from '../utxo/interfaces/IUTXO.js';
|
|
3
|
+
import type { IP2WSHAddress } from '../transaction/mineable/IP2WSHAddress.js';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* P2WDA Detection and Validation Utilities
|
|
8
|
-
*
|
|
9
|
-
* This class provides methods to detect and validate P2WDA (Pay-to-Witness-Data-Authentication) addresses
|
|
10
|
-
* and UTXOs. P2WDA addresses have a specific witness script pattern that allows for efficient data storage.
|
|
11
7
|
*/
|
|
12
8
|
export class P2WDADetector {
|
|
13
9
|
/**
|
|
14
10
|
* Check if a UTXO is a P2WDA output by examining its script structure
|
|
15
|
-
*
|
|
16
|
-
* @param utxo The UTXO to check
|
|
17
|
-
* @returns true if this is a P2WDA UTXO
|
|
18
11
|
*/
|
|
19
12
|
public static isP2WDAUTXO(utxo: UTXO): boolean {
|
|
20
|
-
// P2WDA outputs are P2WSH outputs with a specific witness script pattern
|
|
21
13
|
if (!utxo.witnessScript) {
|
|
22
14
|
return false;
|
|
23
15
|
}
|
|
24
16
|
|
|
25
|
-
const witnessScript =
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
const witnessScript =
|
|
18
|
+
utxo.witnessScript instanceof Uint8Array
|
|
19
|
+
? utxo.witnessScript
|
|
20
|
+
: fromHex(utxo.witnessScript);
|
|
28
21
|
|
|
29
22
|
return this.isP2WDAWitnessScript(witnessScript);
|
|
30
23
|
}
|
|
31
24
|
|
|
32
25
|
/**
|
|
33
26
|
* Check if a witness script follows the P2WDA pattern
|
|
34
|
-
*
|
|
35
|
-
* P2WDA witness script pattern: (OP_2DROP * 5) <pubkey> OP_CHECKSIG
|
|
36
|
-
* This allows for up to 10 witness data fields (5 * 2 = 10)
|
|
37
|
-
*
|
|
38
|
-
* @param witnessScript The witness script to check
|
|
39
|
-
* @returns true if this is a P2WDA witness script
|
|
40
27
|
*/
|
|
41
|
-
public static isP2WDAWitnessScript(witnessScript:
|
|
28
|
+
public static isP2WDAWitnessScript(witnessScript: Uint8Array): boolean {
|
|
42
29
|
try {
|
|
43
30
|
const decompiled = script.decompile(witnessScript);
|
|
44
31
|
|
|
@@ -55,7 +42,7 @@ export class P2WDADetector {
|
|
|
55
42
|
|
|
56
43
|
// Check for pubkey and OP_CHECKSIG
|
|
57
44
|
return (
|
|
58
|
-
|
|
45
|
+
decompiled[5] instanceof Uint8Array &&
|
|
59
46
|
decompiled[5].length === 33 && // Compressed public key
|
|
60
47
|
decompiled[6] === opcodes.OP_CHECKSIG
|
|
61
48
|
);
|
|
@@ -66,16 +53,12 @@ export class P2WDADetector {
|
|
|
66
53
|
|
|
67
54
|
/**
|
|
68
55
|
* Generate a P2WDA address from a public key
|
|
69
|
-
*
|
|
70
|
-
* @param publicKey The public key to use (33 bytes compressed)
|
|
71
|
-
* @param network The Bitcoin network
|
|
72
|
-
* @returns The P2WDA address and related payment information
|
|
73
56
|
*/
|
|
74
57
|
public static generateP2WDAAddress(
|
|
75
|
-
publicKey:
|
|
58
|
+
publicKey: Uint8Array,
|
|
76
59
|
network: Network,
|
|
77
60
|
): IP2WSHAddress & {
|
|
78
|
-
scriptPubKey:
|
|
61
|
+
scriptPubKey: Uint8Array;
|
|
79
62
|
} {
|
|
80
63
|
if (publicKey.length !== 33) {
|
|
81
64
|
throw new Error('Public key must be 33 bytes (compressed)');
|
|
@@ -111,11 +94,8 @@ export class P2WDADetector {
|
|
|
111
94
|
|
|
112
95
|
/**
|
|
113
96
|
* Extract the public key from a P2WDA witness script
|
|
114
|
-
*
|
|
115
|
-
* @param witnessScript The P2WDA witness script
|
|
116
|
-
* @returns The public key or null if not a valid P2WDA script
|
|
117
97
|
*/
|
|
118
|
-
public static extractPublicKeyFromP2WDA(witnessScript:
|
|
98
|
+
public static extractPublicKeyFromP2WDA(witnessScript: Uint8Array): Uint8Array | null {
|
|
119
99
|
try {
|
|
120
100
|
const decompiled = script.decompile(witnessScript);
|
|
121
101
|
|
|
@@ -131,7 +111,7 @@ export class P2WDADetector {
|
|
|
131
111
|
}
|
|
132
112
|
|
|
133
113
|
if (
|
|
134
|
-
|
|
114
|
+
decompiled[5] instanceof Uint8Array &&
|
|
135
115
|
decompiled[5].length === 33 &&
|
|
136
116
|
decompiled[6] === opcodes.OP_CHECKSIG
|
|
137
117
|
) {
|
|
@@ -146,23 +126,16 @@ export class P2WDADetector {
|
|
|
146
126
|
|
|
147
127
|
/**
|
|
148
128
|
* Create witness data for a simple P2WDA spend (no operation data)
|
|
149
|
-
*
|
|
150
|
-
* For simple transfers, P2WDA requires 10 dummy witness items (zeros) before the signature
|
|
151
|
-
*
|
|
152
|
-
* @param transactionSignature The transaction signature
|
|
153
|
-
* @param witnessScript The P2WDA witness script
|
|
154
|
-
* @returns The witness stack for a simple P2WDA spend
|
|
155
129
|
*/
|
|
156
130
|
public static createSimpleP2WDAWitness(
|
|
157
|
-
transactionSignature:
|
|
158
|
-
witnessScript:
|
|
159
|
-
):
|
|
160
|
-
const witnessStack:
|
|
131
|
+
transactionSignature: Uint8Array,
|
|
132
|
+
witnessScript: Uint8Array,
|
|
133
|
+
): Uint8Array[] {
|
|
134
|
+
const witnessStack: Uint8Array[] = [transactionSignature];
|
|
161
135
|
|
|
162
136
|
// Add 10 empty buffers for the 5x OP_2DROP operations
|
|
163
|
-
// Bitcoin stack is reversed!
|
|
164
137
|
for (let i = 0; i < 10; i++) {
|
|
165
|
-
witnessStack.push(
|
|
138
|
+
witnessStack.push(new Uint8Array(0));
|
|
166
139
|
}
|
|
167
140
|
|
|
168
141
|
witnessStack.push(witnessScript);
|
|
@@ -171,48 +144,26 @@ export class P2WDADetector {
|
|
|
171
144
|
|
|
172
145
|
/**
|
|
173
146
|
* Validate P2WDA operation data signature
|
|
174
|
-
*
|
|
175
|
-
* @param publicKey The public key from the witness script
|
|
176
|
-
* @param dataSignature The Schnorr signature
|
|
177
|
-
* @param operationData The operation data that was signed
|
|
178
|
-
* @returns true if the signature is valid
|
|
179
147
|
*/
|
|
180
148
|
public static validateP2WDASignature(
|
|
181
|
-
|
|
182
|
-
dataSignature:
|
|
183
|
-
|
|
149
|
+
_publicKey: Uint8Array,
|
|
150
|
+
dataSignature: Uint8Array,
|
|
151
|
+
_operationData: Uint8Array,
|
|
184
152
|
): boolean {
|
|
185
|
-
// This would use MessageSigner.verifySignature internally
|
|
186
|
-
// For now, we'll assume the signature validation is handled by MessageSigner
|
|
187
153
|
return dataSignature.length === 64; // Schnorr signatures are always 64 bytes
|
|
188
154
|
}
|
|
189
155
|
|
|
190
156
|
/**
|
|
191
157
|
* Calculate the witness size for P2WDA transaction estimation
|
|
192
|
-
*
|
|
193
|
-
* @param dataSize The size of the operation data (0 for simple transfers)
|
|
194
|
-
* @returns The estimated witness size in bytes
|
|
195
158
|
*/
|
|
196
159
|
public static estimateP2WDAWitnessSize(dataSize: number = 0): number {
|
|
197
|
-
// Witness structure:
|
|
198
|
-
// - Transaction signature: ~72 bytes
|
|
199
|
-
// - 10 data fields (can be empty or contain data)
|
|
200
|
-
// - Witness script: 39 bytes (5x OP_2DROP + 33-byte pubkey + OP_CHECKSIG)
|
|
201
|
-
// - Overhead for length prefixes: ~12 bytes (1 byte per witness element)
|
|
202
|
-
|
|
203
|
-
// For simple transfers, dataSize is 0 (10 empty fields)
|
|
204
|
-
// For interactions, dataSize is the total size of data split across fields
|
|
205
160
|
return 72 + dataSize + 39 + 12;
|
|
206
161
|
}
|
|
207
162
|
|
|
208
163
|
/**
|
|
209
164
|
* Check if a scriptPubKey is a P2WSH that could be P2WDA
|
|
210
|
-
*
|
|
211
|
-
* @param scriptPubKey The script public key to check
|
|
212
|
-
* @returns true if this could be a P2WDA output
|
|
213
165
|
*/
|
|
214
|
-
public static couldBeP2WDA(scriptPubKey:
|
|
215
|
-
|
|
216
|
-
return scriptPubKey.length === 34 && scriptPubKey[0] === 0x00 && scriptPubKey[1] === 0x20; // 32 bytes
|
|
166
|
+
public static couldBeP2WDA(scriptPubKey: Uint8Array): boolean {
|
|
167
|
+
return scriptPubKey.length === 34 && scriptPubKey[0] === 0x00 && scriptPubKey[1] === 0x20;
|
|
217
168
|
}
|
|
218
169
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polyfill for Symbol.dispose and Symbol.asyncDispose.
|
|
3
|
+
*
|
|
4
|
+
* ES2024 Explicit Resource Management defines these well-known symbols,
|
|
5
|
+
* but Safari and Android WebView do not yet support them. This polyfill
|
|
6
|
+
* creates globally-shared symbols via Symbol.for() so that classes can
|
|
7
|
+
* implement [Symbol.dispose]() and [Symbol.asyncDispose]() today.
|
|
8
|
+
*
|
|
9
|
+
* When native support lands, the guards prevent the polyfill from running
|
|
10
|
+
* and the native symbols are used transparently.
|
|
11
|
+
*
|
|
12
|
+
* NOTE: This file must be imported before any module that references
|
|
13
|
+
* Symbol.dispose or Symbol.asyncDispose at the module-evaluation scope.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
interface PolyfillableSymbolConstructor {
|
|
17
|
+
dispose?: symbol;
|
|
18
|
+
asyncDispose?: symbol;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const S = Symbol as unknown as PolyfillableSymbolConstructor;
|
|
22
|
+
|
|
23
|
+
if (typeof S.dispose !== 'symbol') {
|
|
24
|
+
S.dispose = Symbol.for('Symbol.dispose');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (typeof S.asyncDispose !== 'symbol') {
|
|
28
|
+
S.asyncDispose = Symbol.for('Symbol.asyncDispose');
|
|
29
|
+
}
|