@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
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Logger } from '@btc-vision/logger';
|
|
2
|
+
import type { Bytes32, FinalScriptsFunc, Script, XOnlyPublicKey } from '@btc-vision/bitcoin';
|
|
2
3
|
import {
|
|
3
4
|
address as bitAddress,
|
|
4
5
|
crypto as bitCrypto,
|
|
6
|
+
fromHex,
|
|
5
7
|
getFinalScripts,
|
|
6
8
|
isP2A,
|
|
7
9
|
isP2MS,
|
|
@@ -12,34 +14,48 @@ import {
|
|
|
12
14
|
isP2WPKH,
|
|
13
15
|
isP2WSHScript,
|
|
14
16
|
isUnknownSegwitVersion,
|
|
15
|
-
Network,
|
|
17
|
+
type Network,
|
|
16
18
|
opcodes,
|
|
17
|
-
P2TRPayment,
|
|
19
|
+
type P2TRPayment,
|
|
18
20
|
payments,
|
|
19
21
|
PaymentType,
|
|
20
22
|
Psbt,
|
|
21
|
-
PsbtInput,
|
|
22
|
-
PsbtInputExtended,
|
|
23
|
+
type PsbtInput,
|
|
24
|
+
type PsbtInputExtended,
|
|
23
25
|
script,
|
|
24
|
-
Signer,
|
|
26
|
+
type Signer,
|
|
25
27
|
toXOnly,
|
|
26
28
|
Transaction,
|
|
27
29
|
varuint,
|
|
28
30
|
} from '@btc-vision/bitcoin';
|
|
29
31
|
|
|
30
|
-
import { TweakedSigner, TweakSettings } from '../../signer/TweakedSigner.js';
|
|
31
|
-
import {
|
|
32
|
-
import { UTXO } from '../../utxo/interfaces/IUTXO.js';
|
|
33
|
-
import { TapLeafScript } from '../interfaces/Tap.js';
|
|
32
|
+
import { isUniversalSigner, TweakedSigner, type TweakSettings } from '../../signer/TweakedSigner.js';
|
|
33
|
+
import { type UniversalSigner } from '@btc-vision/ecpair';
|
|
34
|
+
import type { UTXO } from '../../utxo/interfaces/IUTXO.js';
|
|
35
|
+
import type { TapLeafScript } from '../interfaces/Tap.js';
|
|
34
36
|
import { UnisatSigner } from '../browser/extensions/UnisatSigner.js';
|
|
35
|
-
import {
|
|
37
|
+
import {
|
|
38
|
+
canSignNonTaprootInput,
|
|
39
|
+
isTaprootInput,
|
|
40
|
+
pubkeyInScript,
|
|
41
|
+
} from '../../signer/SignerUtils.js';
|
|
36
42
|
import { witnessStackToScriptWitness } from '../utils/WitnessUtils.js';
|
|
37
|
-
import { Buffer } from 'buffer';
|
|
38
43
|
import { P2WDADetector } from '../../p2wda/P2WDADetector.js';
|
|
39
|
-
import { QuantumBIP32Interface } from '@btc-vision/bip32';
|
|
44
|
+
import type { QuantumBIP32Interface } from '@btc-vision/bip32';
|
|
40
45
|
import { MessageSigner } from '../../keypair/MessageSigner.js';
|
|
41
|
-
import { RotationSigner, SignerMap } from '../../signer/AddressRotation.js';
|
|
42
|
-
import {
|
|
46
|
+
import { type RotationSigner, type SignerMap } from '../../signer/AddressRotation.js';
|
|
47
|
+
import type {
|
|
48
|
+
ITweakedTransactionData,
|
|
49
|
+
SupportedTransactionVersion,
|
|
50
|
+
} from '../interfaces/ITweakedTransactionData.js';
|
|
51
|
+
import {
|
|
52
|
+
prepareSigningTasks,
|
|
53
|
+
applySignaturesToPsbt,
|
|
54
|
+
type ParallelSigningResult,
|
|
55
|
+
WorkerSigningPool,
|
|
56
|
+
type WorkerPoolConfig,
|
|
57
|
+
} from '@btc-vision/bitcoin/workers';
|
|
58
|
+
import { toTweakedParallelKeyPair } from '../../signer/ParallelSignerAdapter.js';
|
|
43
59
|
|
|
44
60
|
/**
|
|
45
61
|
* The transaction sequence
|
|
@@ -57,19 +73,19 @@ export enum CSVModes {
|
|
|
57
73
|
/**
|
|
58
74
|
* @description PSBT Transaction processor.
|
|
59
75
|
* */
|
|
60
|
-
export abstract class TweakedTransaction extends Logger {
|
|
61
|
-
public readonly logColor: string = '#00ffe1';
|
|
76
|
+
export abstract class TweakedTransaction extends Logger implements Disposable {
|
|
77
|
+
public override readonly logColor: string = '#00ffe1';
|
|
62
78
|
public finalized: boolean = false;
|
|
63
79
|
|
|
64
80
|
/**
|
|
65
81
|
* @description Was the transaction signed?
|
|
66
82
|
*/
|
|
67
|
-
protected signer: Signer |
|
|
83
|
+
protected signer: Signer | UniversalSigner | UnisatSigner;
|
|
68
84
|
|
|
69
85
|
/**
|
|
70
86
|
* @description Tweaked signer
|
|
71
87
|
*/
|
|
72
|
-
protected tweakedSigner?:
|
|
88
|
+
protected tweakedSigner?: UniversalSigner;
|
|
73
89
|
|
|
74
90
|
/**
|
|
75
91
|
* @description The network of the transaction
|
|
@@ -124,7 +140,7 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
124
140
|
* Add a non-witness utxo to the transaction
|
|
125
141
|
* @protected
|
|
126
142
|
*/
|
|
127
|
-
protected nonWitnessUtxo?:
|
|
143
|
+
protected nonWitnessUtxo?: Uint8Array;
|
|
128
144
|
|
|
129
145
|
/**
|
|
130
146
|
* Is the transaction being generated inside a browser?
|
|
@@ -142,12 +158,12 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
142
158
|
protected regenerated: boolean = false;
|
|
143
159
|
protected ignoreSignatureErrors: boolean = false;
|
|
144
160
|
protected noSignatures: boolean = false;
|
|
145
|
-
protected unlockScript:
|
|
161
|
+
protected unlockScript: Uint8Array[] | undefined;
|
|
146
162
|
|
|
147
163
|
protected txVersion: SupportedTransactionVersion = 2;
|
|
148
164
|
|
|
149
165
|
protected readonly _mldsaSigner: QuantumBIP32Interface | null = null;
|
|
150
|
-
protected readonly _hashedPublicKey:
|
|
166
|
+
protected readonly _hashedPublicKey: Uint8Array | null = null;
|
|
151
167
|
|
|
152
168
|
/**
|
|
153
169
|
* Whether address rotation mode is enabled.
|
|
@@ -169,7 +185,13 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
169
185
|
/**
|
|
170
186
|
* Cache of tweaked signers per input for address rotation mode.
|
|
171
187
|
*/
|
|
172
|
-
protected readonly tweakedSignerCache: Map<number,
|
|
188
|
+
protected readonly tweakedSignerCache: Map<number, UniversalSigner | undefined> = new Map();
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Parallel signing configuration using worker threads.
|
|
192
|
+
* When set, key-path taproot inputs are signed in parallel via workers.
|
|
193
|
+
*/
|
|
194
|
+
protected parallelSigningConfig?: WorkerSigningPool | WorkerPoolConfig;
|
|
173
195
|
|
|
174
196
|
protected constructor(data: ITweakedTransactionData) {
|
|
175
197
|
super();
|
|
@@ -178,8 +200,12 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
178
200
|
this.network = data.network;
|
|
179
201
|
|
|
180
202
|
this.noSignatures = data.noSignatures || false;
|
|
181
|
-
|
|
182
|
-
|
|
203
|
+
if (data.nonWitnessUtxo !== undefined) {
|
|
204
|
+
this.nonWitnessUtxo = data.nonWitnessUtxo;
|
|
205
|
+
}
|
|
206
|
+
if (data.unlockScript !== undefined) {
|
|
207
|
+
this.unlockScript = data.unlockScript;
|
|
208
|
+
}
|
|
183
209
|
|
|
184
210
|
this.isBrowser = typeof window !== 'undefined';
|
|
185
211
|
|
|
@@ -197,6 +223,23 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
197
223
|
this.addressRotationEnabled = true;
|
|
198
224
|
this.signerMap = data.addressRotation.signerMap;
|
|
199
225
|
}
|
|
226
|
+
|
|
227
|
+
if (data.parallelSigning) {
|
|
228
|
+
this.parallelSigningConfig = data.parallelSigning;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
public [Symbol.dispose](): void {
|
|
233
|
+
this.inputs.length = 0;
|
|
234
|
+
this.scriptData = null;
|
|
235
|
+
this.tapData = null;
|
|
236
|
+
this.tapLeafScript = null;
|
|
237
|
+
delete this.tweakedSigner;
|
|
238
|
+
this.csvInputIndices.clear();
|
|
239
|
+
this.anchorInputIndices.clear();
|
|
240
|
+
this.inputSignerMap.clear();
|
|
241
|
+
this.tweakedSignerCache.clear();
|
|
242
|
+
delete this.parallelSigningConfig;
|
|
200
243
|
}
|
|
201
244
|
|
|
202
245
|
/**
|
|
@@ -215,7 +258,7 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
215
258
|
* Get the hashed public key
|
|
216
259
|
* @protected
|
|
217
260
|
*/
|
|
218
|
-
protected get hashedPublicKey():
|
|
261
|
+
protected get hashedPublicKey(): Uint8Array {
|
|
219
262
|
if (!this._hashedPublicKey) {
|
|
220
263
|
throw new Error('Hashed public key is not set');
|
|
221
264
|
}
|
|
@@ -227,11 +270,11 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
227
270
|
* Read witnesses
|
|
228
271
|
* @protected
|
|
229
272
|
*/
|
|
230
|
-
public static readScriptWitnessToWitnessStack(buffer:
|
|
273
|
+
public static readScriptWitnessToWitnessStack(buffer: Uint8Array): Uint8Array[] {
|
|
231
274
|
let offset = 0;
|
|
232
275
|
|
|
233
|
-
function readSlice(n: number):
|
|
234
|
-
const slice =
|
|
276
|
+
function readSlice(n: number): Uint8Array {
|
|
277
|
+
const slice = new Uint8Array(buffer.subarray(offset, offset + n));
|
|
235
278
|
offset += n;
|
|
236
279
|
return slice;
|
|
237
280
|
}
|
|
@@ -242,12 +285,12 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
242
285
|
return varint.numberValue || 0;
|
|
243
286
|
}
|
|
244
287
|
|
|
245
|
-
function readVarSlice():
|
|
288
|
+
function readVarSlice(): Uint8Array {
|
|
246
289
|
const len = readVarInt();
|
|
247
290
|
return readSlice(len);
|
|
248
291
|
}
|
|
249
292
|
|
|
250
|
-
function readVector():
|
|
293
|
+
function readVector(): Uint8Array[] {
|
|
251
294
|
const count = readVarInt();
|
|
252
295
|
const vector = [];
|
|
253
296
|
for (let i = 0; i < count; i++) {
|
|
@@ -308,7 +351,7 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
308
351
|
transaction: Psbt,
|
|
309
352
|
input: PsbtInput,
|
|
310
353
|
i: number,
|
|
311
|
-
signer: Signer |
|
|
354
|
+
signer: Signer | UniversalSigner,
|
|
312
355
|
sighashTypes: number[],
|
|
313
356
|
): void {
|
|
314
357
|
if (sighashTypes && sighashTypes[0]) input.sighashType = sighashTypes[0];
|
|
@@ -393,7 +436,7 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
393
436
|
continue;
|
|
394
437
|
}
|
|
395
438
|
|
|
396
|
-
input.sequence = TransactionSequence.FINAL;
|
|
439
|
+
(input as { sequence: number }).sequence = TransactionSequence.FINAL;
|
|
397
440
|
}
|
|
398
441
|
}
|
|
399
442
|
|
|
@@ -403,7 +446,7 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
403
446
|
*
|
|
404
447
|
* @returns {Buffer | undefined} The tweaked hash
|
|
405
448
|
*/
|
|
406
|
-
public getTweakerHash():
|
|
449
|
+
public getTweakerHash(): Uint8Array | undefined {
|
|
407
450
|
return this.tapData?.hash;
|
|
408
451
|
}
|
|
409
452
|
|
|
@@ -494,9 +537,9 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
494
537
|
* Used for taproot inputs in address rotation mode.
|
|
495
538
|
* @param inputIndex - The index of the input
|
|
496
539
|
*/
|
|
497
|
-
protected internalPubKeyToXOnlyForInput(inputIndex: number):
|
|
540
|
+
protected internalPubKeyToXOnlyForInput(inputIndex: number): XOnlyPublicKey {
|
|
498
541
|
const signer = this.getSignerForInput(inputIndex);
|
|
499
|
-
return toXOnly(
|
|
542
|
+
return toXOnly(signer.publicKey);
|
|
500
543
|
}
|
|
501
544
|
|
|
502
545
|
/**
|
|
@@ -508,7 +551,7 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
508
551
|
protected getTweakedSignerForInput(
|
|
509
552
|
inputIndex: number,
|
|
510
553
|
useTweakedHash: boolean = false,
|
|
511
|
-
):
|
|
554
|
+
): UniversalSigner | undefined {
|
|
512
555
|
if (!this.addressRotationEnabled) {
|
|
513
556
|
// Fall back to original behavior
|
|
514
557
|
if (useTweakedHash) {
|
|
@@ -555,9 +598,9 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
555
598
|
/**
|
|
556
599
|
* Returns the signer key.
|
|
557
600
|
* @protected
|
|
558
|
-
* @returns {Signer |
|
|
601
|
+
* @returns {Signer | UniversalSigner}
|
|
559
602
|
*/
|
|
560
|
-
protected getSignerKey(): Signer |
|
|
603
|
+
protected getSignerKey(): Signer | UniversalSigner {
|
|
561
604
|
return this.signer;
|
|
562
605
|
}
|
|
563
606
|
|
|
@@ -575,7 +618,7 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
575
618
|
transaction: Psbt,
|
|
576
619
|
input: PsbtInput,
|
|
577
620
|
i: number,
|
|
578
|
-
signer: Signer |
|
|
621
|
+
signer: Signer | UniversalSigner,
|
|
579
622
|
reverse: boolean = false,
|
|
580
623
|
errored: boolean = false,
|
|
581
624
|
): Promise<void> {
|
|
@@ -656,49 +699,114 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
656
699
|
}
|
|
657
700
|
|
|
658
701
|
protected async signInputsNonWalletBased(transaction: Psbt): Promise<void> {
|
|
659
|
-
// non web based signing.
|
|
660
|
-
const txs: PsbtInput[] = transaction.data.inputs;
|
|
661
|
-
|
|
662
|
-
const batchSize: number = 20;
|
|
663
|
-
const batches = this.splitArray(txs, batchSize);
|
|
664
|
-
|
|
665
702
|
if (!this.noSignatures) {
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
const input = batch[j];
|
|
674
|
-
|
|
675
|
-
try {
|
|
676
|
-
// Use per-input signer in address rotation mode
|
|
677
|
-
const inputSigner = this.getSignerForInput(index);
|
|
678
|
-
promises.push(this.signInput(transaction, input, index, inputSigner));
|
|
679
|
-
} catch (e) {
|
|
680
|
-
this.log(`Failed to sign input ${index}: ${(e as Error).stack}`);
|
|
703
|
+
if (this.canUseParallelSigning && isUniversalSigner(this.signer)) {
|
|
704
|
+
let parallelSignedIndices = new Set<number>();
|
|
705
|
+
|
|
706
|
+
try {
|
|
707
|
+
const result = await this.signKeyPathInputsParallel(transaction);
|
|
708
|
+
if (result.success) {
|
|
709
|
+
parallelSignedIndices = new Set(result.signatures.keys());
|
|
681
710
|
}
|
|
711
|
+
} catch (e) {
|
|
712
|
+
this.error(
|
|
713
|
+
`Parallel signing failed, falling back to sequential: ${(e as Error).message}`,
|
|
714
|
+
);
|
|
682
715
|
}
|
|
683
716
|
|
|
684
|
-
|
|
717
|
+
// Sign remaining inputs (script-path, non-taproot, etc.) sequentially
|
|
718
|
+
await this.signRemainingInputsSequential(transaction, parallelSignedIndices);
|
|
719
|
+
} else {
|
|
720
|
+
await this.signInputsSequential(transaction);
|
|
685
721
|
}
|
|
686
722
|
}
|
|
687
723
|
|
|
688
724
|
for (let i = 0; i < transaction.data.inputs.length; i++) {
|
|
689
|
-
transaction.finalizeInput(i, this.customFinalizerP2SH.bind(this));
|
|
725
|
+
transaction.finalizeInput(i, this.customFinalizerP2SH.bind(this) as FinalScriptsFunc);
|
|
690
726
|
}
|
|
691
727
|
|
|
692
728
|
this.finalized = true;
|
|
693
729
|
}
|
|
694
730
|
|
|
731
|
+
/**
|
|
732
|
+
* Signs all inputs sequentially in batches of 20.
|
|
733
|
+
* This is the original signing logic, used as fallback when parallel signing is unavailable.
|
|
734
|
+
*/
|
|
735
|
+
protected async signInputsSequential(transaction: Psbt): Promise<void> {
|
|
736
|
+
const txs: PsbtInput[] = transaction.data.inputs;
|
|
737
|
+
|
|
738
|
+
const batchSize: number = 20;
|
|
739
|
+
const batches = this.splitArray(txs, batchSize);
|
|
740
|
+
|
|
741
|
+
for (let i = 0; i < batches.length; i++) {
|
|
742
|
+
const batch = batches[i] as PsbtInput[];
|
|
743
|
+
const promises: Promise<void>[] = [];
|
|
744
|
+
const offset = i * batchSize;
|
|
745
|
+
|
|
746
|
+
for (let j = 0; j < batch.length; j++) {
|
|
747
|
+
const index = offset + j;
|
|
748
|
+
const input = batch[j] as PsbtInput;
|
|
749
|
+
|
|
750
|
+
try {
|
|
751
|
+
// Use per-input signer in address rotation mode
|
|
752
|
+
const inputSigner = this.getSignerForInput(index);
|
|
753
|
+
promises.push(this.signInput(transaction, input, index, inputSigner));
|
|
754
|
+
} catch (e) {
|
|
755
|
+
this.log(`Failed to sign input ${index}: ${(e as Error).stack}`);
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
await Promise.all(promises);
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* Signs inputs that were not handled by parallel signing.
|
|
765
|
+
* After parallel key-path signing, script-path taproot inputs, non-taproot inputs,
|
|
766
|
+
* and any inputs that failed parallel signing need sequential signing.
|
|
767
|
+
*/
|
|
768
|
+
protected async signRemainingInputsSequential(
|
|
769
|
+
transaction: Psbt,
|
|
770
|
+
signedIndices: Set<number>,
|
|
771
|
+
): Promise<void> {
|
|
772
|
+
const txs: PsbtInput[] = transaction.data.inputs;
|
|
773
|
+
|
|
774
|
+
const unsignedIndices: number[] = [];
|
|
775
|
+
for (let i = 0; i < txs.length; i++) {
|
|
776
|
+
if (!signedIndices.has(i)) {
|
|
777
|
+
unsignedIndices.push(i);
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
if (unsignedIndices.length === 0) return;
|
|
782
|
+
|
|
783
|
+
const batchSize = 20;
|
|
784
|
+
const batches = this.splitArray(unsignedIndices, batchSize);
|
|
785
|
+
|
|
786
|
+
for (const batch of batches) {
|
|
787
|
+
const promises: Promise<void>[] = [];
|
|
788
|
+
|
|
789
|
+
for (const index of batch) {
|
|
790
|
+
const input = txs[index] as PsbtInput;
|
|
791
|
+
try {
|
|
792
|
+
const inputSigner = this.getSignerForInput(index);
|
|
793
|
+
promises.push(this.signInput(transaction, input, index, inputSigner));
|
|
794
|
+
} catch (e) {
|
|
795
|
+
this.log(`Failed to sign input ${index}: ${(e as Error).stack}`);
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
await Promise.all(promises);
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
|
|
695
803
|
/**
|
|
696
804
|
* Converts the public key to x-only.
|
|
697
805
|
* @protected
|
|
698
806
|
* @returns {Buffer}
|
|
699
807
|
*/
|
|
700
|
-
protected internalPubKeyToXOnly():
|
|
701
|
-
return toXOnly(
|
|
808
|
+
protected internalPubKeyToXOnly(): XOnlyPublicKey {
|
|
809
|
+
return toXOnly(this.signer.publicKey);
|
|
702
810
|
}
|
|
703
811
|
|
|
704
812
|
/**
|
|
@@ -718,36 +826,123 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
718
826
|
if (this.tweakedSigner) return;
|
|
719
827
|
|
|
720
828
|
// tweaked p2tr signer.
|
|
721
|
-
|
|
829
|
+
const tweaked = this.getTweakedSigner(true);
|
|
830
|
+
if (tweaked !== undefined) {
|
|
831
|
+
this.tweakedSigner = tweaked;
|
|
832
|
+
}
|
|
722
833
|
}
|
|
723
834
|
|
|
724
835
|
/**
|
|
725
836
|
* Get the tweaked signer
|
|
726
837
|
* @private
|
|
727
|
-
* @returns {
|
|
838
|
+
* @returns {UniversalSigner} The tweaked signer
|
|
728
839
|
*/
|
|
729
840
|
protected getTweakedSigner(
|
|
730
841
|
useTweakedHash: boolean = false,
|
|
731
|
-
signer: Signer |
|
|
732
|
-
):
|
|
842
|
+
signer: Signer | UniversalSigner = this.signer,
|
|
843
|
+
): UniversalSigner | undefined {
|
|
733
844
|
const settings: TweakSettings = {
|
|
734
845
|
network: this.network,
|
|
735
846
|
};
|
|
736
847
|
|
|
737
848
|
if (useTweakedHash) {
|
|
738
|
-
|
|
849
|
+
const tweakHash = this.getTweakerHash() as Bytes32 | undefined;
|
|
850
|
+
if (tweakHash !== undefined) {
|
|
851
|
+
settings.tweakHash = tweakHash;
|
|
852
|
+
}
|
|
739
853
|
}
|
|
740
854
|
|
|
741
|
-
if (!(
|
|
855
|
+
if (!isUniversalSigner(signer)) {
|
|
742
856
|
return;
|
|
743
857
|
}
|
|
744
858
|
|
|
745
|
-
return TweakedSigner.tweakSigner(signer
|
|
859
|
+
return TweakedSigner.tweakSigner(signer, settings);
|
|
746
860
|
}
|
|
747
861
|
|
|
748
|
-
|
|
862
|
+
/**
|
|
863
|
+
* Whether parallel signing can be used for this transaction.
|
|
864
|
+
* Requires parallelSigningConfig and excludes browser, address rotation, and no-signature modes.
|
|
865
|
+
*/
|
|
866
|
+
protected get canUseParallelSigning(): boolean {
|
|
867
|
+
return (
|
|
868
|
+
!!this.parallelSigningConfig &&
|
|
869
|
+
!this.addressRotationEnabled &&
|
|
870
|
+
!this.noSignatures
|
|
871
|
+
);
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
/**
|
|
875
|
+
* Signs key-path taproot inputs in parallel using worker threads.
|
|
876
|
+
* @param transaction - The PSBT to sign
|
|
877
|
+
* @param excludeIndices - Input indices to skip (e.g., script-path inputs already signed)
|
|
878
|
+
* @returns The parallel signing result
|
|
879
|
+
*/
|
|
880
|
+
protected async signKeyPathInputsParallel(
|
|
881
|
+
transaction: Psbt,
|
|
882
|
+
excludeIndices?: Set<number>,
|
|
883
|
+
): Promise<ParallelSigningResult> {
|
|
884
|
+
const signer = this.signer as UniversalSigner;
|
|
885
|
+
|
|
886
|
+
// Get the tweaked signer for key-path
|
|
887
|
+
const tweakedSigner = this.getTweakedSigner(true);
|
|
888
|
+
if (!tweakedSigner) {
|
|
889
|
+
throw new Error('Cannot create tweaked signer for parallel signing');
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
// Create hybrid adapter: untweaked pubkey (for PSBT matching) + tweaked privkey
|
|
893
|
+
const adapter = toTweakedParallelKeyPair(signer, tweakedSigner);
|
|
894
|
+
|
|
895
|
+
// Prepare tasks from PSBT
|
|
896
|
+
const allTasks = prepareSigningTasks(transaction, adapter);
|
|
897
|
+
|
|
898
|
+
// Filter out excluded indices
|
|
899
|
+
const tasks = excludeIndices
|
|
900
|
+
? allTasks.filter((t) => !excludeIndices.has(t.inputIndex))
|
|
901
|
+
: allTasks;
|
|
902
|
+
|
|
903
|
+
if (tasks.length === 0) {
|
|
904
|
+
return {
|
|
905
|
+
success: true,
|
|
906
|
+
signatures: new Map(),
|
|
907
|
+
errors: new Map(),
|
|
908
|
+
durationMs: 0,
|
|
909
|
+
};
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
// Get or create pool
|
|
913
|
+
let pool: WorkerSigningPool;
|
|
914
|
+
let shouldShutdown = false;
|
|
915
|
+
|
|
916
|
+
if (this.parallelSigningConfig instanceof WorkerSigningPool) {
|
|
917
|
+
pool = this.parallelSigningConfig;
|
|
918
|
+
} else {
|
|
919
|
+
pool = WorkerSigningPool.getInstance(this.parallelSigningConfig);
|
|
920
|
+
if (!pool.isPreservingWorkers) shouldShutdown = true;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
try {
|
|
924
|
+
await pool.initialize();
|
|
925
|
+
const result = await pool.signBatch(tasks, adapter);
|
|
926
|
+
|
|
927
|
+
if (result.success) {
|
|
928
|
+
applySignaturesToPsbt(transaction, result, adapter);
|
|
929
|
+
} else {
|
|
930
|
+
const errorEntries = [...result.errors.entries()];
|
|
931
|
+
const errorMsg = errorEntries
|
|
932
|
+
.map(([idx, err]) => `Input ${idx}: ${err}`)
|
|
933
|
+
.join(', ');
|
|
934
|
+
this.error(`Parallel signing had errors: ${errorMsg}`);
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
return result;
|
|
938
|
+
} finally {
|
|
939
|
+
if (shouldShutdown) await pool.shutdown();
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
protected generateP2SHRedeemScript(customWitnessScript: Uint8Array): Uint8Array | undefined {
|
|
749
944
|
const p2wsh = payments.p2wsh({
|
|
750
|
-
redeem: { output: customWitnessScript },
|
|
945
|
+
redeem: { output: customWitnessScript as Script },
|
|
751
946
|
network: this.network,
|
|
752
947
|
});
|
|
753
948
|
|
|
@@ -762,12 +957,12 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
762
957
|
|
|
763
958
|
protected generateP2SHRedeemScriptLegacy(inputAddr: string):
|
|
764
959
|
| {
|
|
765
|
-
redeemScript:
|
|
766
|
-
outputScript:
|
|
960
|
+
redeemScript: Uint8Array;
|
|
961
|
+
outputScript: Uint8Array;
|
|
767
962
|
}
|
|
768
963
|
| undefined {
|
|
769
964
|
const pubKeyHash = bitCrypto.hash160(this.signer.publicKey);
|
|
770
|
-
const redeemScript:
|
|
965
|
+
const redeemScript: Script = script.compile([
|
|
771
966
|
opcodes.OP_DUP,
|
|
772
967
|
opcodes.OP_HASH160,
|
|
773
968
|
pubKeyHash,
|
|
@@ -809,8 +1004,8 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
809
1004
|
inputIndex?: number,
|
|
810
1005
|
):
|
|
811
1006
|
| {
|
|
812
|
-
redeemScript:
|
|
813
|
-
outputScript:
|
|
1007
|
+
redeemScript: Uint8Array;
|
|
1008
|
+
outputScript: Uint8Array;
|
|
814
1009
|
}
|
|
815
1010
|
| undefined {
|
|
816
1011
|
// Use per-input signer in address rotation mode
|
|
@@ -819,9 +1014,7 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
819
1014
|
? this.getSignerForInput(inputIndex)
|
|
820
1015
|
: this.signer;
|
|
821
1016
|
|
|
822
|
-
const pubkey =
|
|
823
|
-
? signer.publicKey
|
|
824
|
-
: Buffer.from(signer.publicKey, 'hex');
|
|
1017
|
+
const pubkey = signer.publicKey;
|
|
825
1018
|
|
|
826
1019
|
const w = payments.p2wpkh({
|
|
827
1020
|
pubkey: pubkey,
|
|
@@ -862,26 +1055,27 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
862
1055
|
i: number,
|
|
863
1056
|
_extra: boolean = false,
|
|
864
1057
|
): PsbtInputExtended {
|
|
865
|
-
const scriptPub =
|
|
1058
|
+
const scriptPub = fromHex(utxo.scriptPubKey.hex);
|
|
866
1059
|
|
|
867
1060
|
const input: PsbtInputExtended = {
|
|
868
1061
|
hash: utxo.transactionId,
|
|
869
1062
|
index: utxo.outputIndex,
|
|
870
1063
|
sequence: this.sequence,
|
|
871
1064
|
witnessUtxo: {
|
|
872
|
-
value:
|
|
1065
|
+
value: utxo.value,
|
|
873
1066
|
script: scriptPub,
|
|
874
1067
|
},
|
|
875
|
-
};
|
|
1068
|
+
} as PsbtInputExtended;
|
|
876
1069
|
|
|
877
1070
|
// Handle P2PKH (Legacy)
|
|
878
1071
|
if (isP2PKH(scriptPub)) {
|
|
879
1072
|
// Legacy input requires nonWitnessUtxo
|
|
880
1073
|
if (utxo.nonWitnessUtxo) {
|
|
881
1074
|
//delete input.witnessUtxo;
|
|
882
|
-
input.nonWitnessUtxo =
|
|
883
|
-
|
|
884
|
-
|
|
1075
|
+
input.nonWitnessUtxo =
|
|
1076
|
+
utxo.nonWitnessUtxo instanceof Uint8Array
|
|
1077
|
+
? utxo.nonWitnessUtxo
|
|
1078
|
+
: fromHex(utxo.nonWitnessUtxo);
|
|
885
1079
|
} else {
|
|
886
1080
|
throw new Error('Missing nonWitnessUtxo for P2PKH UTXO');
|
|
887
1081
|
}
|
|
@@ -901,12 +1095,13 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
901
1095
|
// Handle P2SH (Can be legacy or wrapping segwit)
|
|
902
1096
|
else if (isP2SHScript(scriptPub)) {
|
|
903
1097
|
// Redeem script is required for P2SH
|
|
904
|
-
let redeemScriptBuf:
|
|
1098
|
+
let redeemScriptBuf: Uint8Array | undefined;
|
|
905
1099
|
|
|
906
1100
|
if (utxo.redeemScript) {
|
|
907
|
-
redeemScriptBuf =
|
|
908
|
-
|
|
909
|
-
|
|
1101
|
+
redeemScriptBuf =
|
|
1102
|
+
utxo.redeemScript instanceof Uint8Array
|
|
1103
|
+
? utxo.redeemScript
|
|
1104
|
+
: fromHex(utxo.redeemScript);
|
|
910
1105
|
} else {
|
|
911
1106
|
// Attempt to generate a redeem script if missing
|
|
912
1107
|
if (!utxo.scriptPubKey.address) {
|
|
@@ -929,7 +1124,7 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
929
1124
|
input.redeemScript = redeemScriptBuf;
|
|
930
1125
|
|
|
931
1126
|
// Check if redeemScript is wrapping segwit (like P2SH-P2WPKH or P2SH-P2WSH)
|
|
932
|
-
const payment = payments.p2sh({ redeem: { output: input.redeemScript } });
|
|
1127
|
+
const payment = payments.p2sh({ redeem: { output: input.redeemScript as Script } });
|
|
933
1128
|
if (!payment.redeem) {
|
|
934
1129
|
throw new Error('Failed to extract redeem script from P2SH UTXO');
|
|
935
1130
|
}
|
|
@@ -940,9 +1135,10 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
940
1135
|
}
|
|
941
1136
|
|
|
942
1137
|
if (utxo.nonWitnessUtxo) {
|
|
943
|
-
input.nonWitnessUtxo =
|
|
944
|
-
|
|
945
|
-
|
|
1138
|
+
input.nonWitnessUtxo =
|
|
1139
|
+
utxo.nonWitnessUtxo instanceof Uint8Array
|
|
1140
|
+
? utxo.nonWitnessUtxo
|
|
1141
|
+
: fromHex(utxo.nonWitnessUtxo);
|
|
946
1142
|
}
|
|
947
1143
|
|
|
948
1144
|
if (isP2WPKH(redeemOutput)) {
|
|
@@ -986,16 +1182,17 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
986
1182
|
else if (isP2A(scriptPub)) {
|
|
987
1183
|
this.anchorInputIndices.add(i);
|
|
988
1184
|
|
|
989
|
-
input.isPayToAnchor = true;
|
|
1185
|
+
(input as { isPayToAnchor: boolean }).isPayToAnchor = true;
|
|
990
1186
|
}
|
|
991
1187
|
|
|
992
1188
|
// Handle P2PK (legacy) or P2MS (bare multisig)
|
|
993
1189
|
else if (isP2PK(scriptPub) || isP2MS(scriptPub)) {
|
|
994
1190
|
// These are legacy scripts, need nonWitnessUtxo
|
|
995
1191
|
if (utxo.nonWitnessUtxo) {
|
|
996
|
-
input.nonWitnessUtxo =
|
|
997
|
-
|
|
998
|
-
|
|
1192
|
+
input.nonWitnessUtxo =
|
|
1193
|
+
utxo.nonWitnessUtxo instanceof Uint8Array
|
|
1194
|
+
? utxo.nonWitnessUtxo
|
|
1195
|
+
: fromHex(utxo.nonWitnessUtxo);
|
|
999
1196
|
} else {
|
|
1000
1197
|
throw new Error('Missing nonWitnessUtxo for P2PK or P2MS UTXO');
|
|
1001
1198
|
}
|
|
@@ -1036,9 +1233,10 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
1036
1233
|
throw new Error('Missing witnessScript for P2WSH UTXO');
|
|
1037
1234
|
}
|
|
1038
1235
|
|
|
1039
|
-
input.witnessScript =
|
|
1040
|
-
|
|
1041
|
-
|
|
1236
|
+
input.witnessScript =
|
|
1237
|
+
utxo.witnessScript instanceof Uint8Array
|
|
1238
|
+
? utxo.witnessScript
|
|
1239
|
+
: fromHex(utxo.witnessScript);
|
|
1042
1240
|
|
|
1043
1241
|
// No nonWitnessUtxo needed for segwit
|
|
1044
1242
|
|
|
@@ -1052,7 +1250,10 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
1052
1250
|
const csvBlocks = this.extractCSVBlocks(decompiled);
|
|
1053
1251
|
|
|
1054
1252
|
// Use the setCSVSequence method to properly set the sequence
|
|
1055
|
-
input.sequence = this.setCSVSequence(
|
|
1253
|
+
(input as { sequence: number }).sequence = this.setCSVSequence(
|
|
1254
|
+
csvBlocks,
|
|
1255
|
+
this.sequence,
|
|
1256
|
+
);
|
|
1056
1257
|
}
|
|
1057
1258
|
}
|
|
1058
1259
|
}
|
|
@@ -1080,13 +1281,14 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
1080
1281
|
protected customFinalizerP2SH = (
|
|
1081
1282
|
inputIndex: number,
|
|
1082
1283
|
input: PsbtInput,
|
|
1083
|
-
scriptA:
|
|
1284
|
+
scriptA: Script,
|
|
1084
1285
|
isSegwit: boolean,
|
|
1085
1286
|
isP2SH: boolean,
|
|
1086
1287
|
isP2WSH: boolean,
|
|
1288
|
+
_canRunChecks?: boolean,
|
|
1087
1289
|
): {
|
|
1088
|
-
finalScriptSig:
|
|
1089
|
-
finalScriptWitness:
|
|
1290
|
+
finalScriptSig: Script | undefined;
|
|
1291
|
+
finalScriptWitness: Uint8Array | undefined;
|
|
1090
1292
|
} => {
|
|
1091
1293
|
const inputDecoded = this.inputs[inputIndex];
|
|
1092
1294
|
if (isP2SH && input.partialSig && inputDecoded && inputDecoded.redeemScript) {
|
|
@@ -1102,7 +1304,7 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
1102
1304
|
if (this.anchorInputIndices.has(inputIndex)) {
|
|
1103
1305
|
return {
|
|
1104
1306
|
finalScriptSig: undefined,
|
|
1105
|
-
finalScriptWitness:
|
|
1307
|
+
finalScriptWitness: Uint8Array.from([0]),
|
|
1106
1308
|
};
|
|
1107
1309
|
}
|
|
1108
1310
|
|
|
@@ -1120,7 +1322,7 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
1120
1322
|
const isCSVInput = this.csvInputIndices.has(inputIndex);
|
|
1121
1323
|
if (isCSVInput) {
|
|
1122
1324
|
// For CSV P2WSH, the witness stack should be: [signature, witnessScript]
|
|
1123
|
-
const witnessStack = [input.partialSig[0].signature, input.witnessScript];
|
|
1325
|
+
const witnessStack = [(input.partialSig[0] as { signature: Uint8Array }).signature, input.witnessScript];
|
|
1124
1326
|
return {
|
|
1125
1327
|
finalScriptSig: undefined,
|
|
1126
1328
|
finalScriptWitness: witnessStackToScriptWitness(witnessStack),
|
|
@@ -1149,8 +1351,8 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
1149
1351
|
inputIndex: number,
|
|
1150
1352
|
input: PsbtInput,
|
|
1151
1353
|
): {
|
|
1152
|
-
finalScriptWitness:
|
|
1153
|
-
finalScriptSig:
|
|
1354
|
+
finalScriptWitness: Uint8Array | undefined;
|
|
1355
|
+
finalScriptSig: Script | undefined;
|
|
1154
1356
|
} {
|
|
1155
1357
|
if (!input.partialSig || input.partialSig.length === 0) {
|
|
1156
1358
|
throw new Error(`No signature for P2WDA input #${inputIndex}`);
|
|
@@ -1161,7 +1363,7 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
1161
1363
|
}
|
|
1162
1364
|
|
|
1163
1365
|
const witnessStack = P2WDADetector.createSimpleP2WDAWitness(
|
|
1164
|
-
input.partialSig[0].signature,
|
|
1366
|
+
(input.partialSig[0] as { signature: Uint8Array }).signature,
|
|
1165
1367
|
input.witnessScript,
|
|
1166
1368
|
);
|
|
1167
1369
|
|
|
@@ -1179,13 +1381,13 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
1179
1381
|
|
|
1180
1382
|
// Then, we finalize every input.
|
|
1181
1383
|
for (let i = 0; i < transaction.data.inputs.length; i++) {
|
|
1182
|
-
transaction.finalizeInput(i, this.customFinalizerP2SH.bind(this));
|
|
1384
|
+
transaction.finalizeInput(i, this.customFinalizerP2SH.bind(this) as FinalScriptsFunc);
|
|
1183
1385
|
}
|
|
1184
1386
|
|
|
1185
1387
|
this.finalized = true;
|
|
1186
1388
|
}
|
|
1187
1389
|
|
|
1188
|
-
protected isCSVScript(decompiled: (number |
|
|
1390
|
+
protected isCSVScript(decompiled: (number | Uint8Array)[]): boolean {
|
|
1189
1391
|
return decompiled.some((op) => op === opcodes.OP_CHECKSEQUENCEVERIFY);
|
|
1190
1392
|
}
|
|
1191
1393
|
|
|
@@ -1236,12 +1438,12 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
1236
1438
|
return csvValue & (1 << 22) ? CSVModes.TIMESTAMPS : CSVModes.BLOCKS;
|
|
1237
1439
|
}
|
|
1238
1440
|
|
|
1239
|
-
private extractCSVBlocks(decompiled: (number |
|
|
1441
|
+
private extractCSVBlocks(decompiled: (number | Uint8Array)[]): number {
|
|
1240
1442
|
for (let i = 0; i < decompiled.length; i++) {
|
|
1241
1443
|
if (decompiled[i] === opcodes.OP_CHECKSEQUENCEVERIFY && i > 0) {
|
|
1242
1444
|
const csvValue = decompiled[i - 1];
|
|
1243
|
-
if (
|
|
1244
|
-
return script.number.decode(csvValue);
|
|
1445
|
+
if (csvValue instanceof Uint8Array) {
|
|
1446
|
+
return script.number.decode(csvValue as Buffer);
|
|
1245
1447
|
} else if (typeof csvValue === 'number') {
|
|
1246
1448
|
// Handle OP_N directly
|
|
1247
1449
|
if (csvValue === opcodes.OP_0 || csvValue === opcodes.OP_FALSE) {
|
|
@@ -1265,15 +1467,15 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
1265
1467
|
transaction: Psbt,
|
|
1266
1468
|
input: PsbtInput,
|
|
1267
1469
|
i: number,
|
|
1268
|
-
signer: Signer |
|
|
1269
|
-
publicKey:
|
|
1470
|
+
signer: Signer | UniversalSigner,
|
|
1471
|
+
publicKey: Uint8Array,
|
|
1270
1472
|
): Promise<void> {
|
|
1271
1473
|
const isScriptSpend = this.isTaprootScriptSpend(input, publicKey);
|
|
1272
1474
|
|
|
1273
1475
|
if (isScriptSpend) {
|
|
1274
1476
|
await this.signTaprootInput(signer, transaction, i);
|
|
1275
1477
|
} else {
|
|
1276
|
-
let tweakedSigner:
|
|
1478
|
+
let tweakedSigner: UniversalSigner | undefined;
|
|
1277
1479
|
if (signer !== this.signer) {
|
|
1278
1480
|
tweakedSigner = this.getTweakedSigner(true, signer);
|
|
1279
1481
|
} else {
|
|
@@ -1298,7 +1500,7 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
1298
1500
|
}
|
|
1299
1501
|
}
|
|
1300
1502
|
|
|
1301
|
-
private isTaprootScriptSpend(input: PsbtInput, publicKey:
|
|
1503
|
+
private isTaprootScriptSpend(input: PsbtInput, publicKey: Uint8Array): boolean {
|
|
1302
1504
|
if (input.tapLeafScript && input.tapLeafScript.length > 0) {
|
|
1303
1505
|
// Check if the signer's public key is involved in any tapLeafScript
|
|
1304
1506
|
for (const tapLeafScript of input.tapLeafScript) {
|
|
@@ -1312,10 +1514,10 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
1312
1514
|
}
|
|
1313
1515
|
|
|
1314
1516
|
private async signTaprootInput(
|
|
1315
|
-
signer: Signer |
|
|
1517
|
+
signer: Signer | UniversalSigner,
|
|
1316
1518
|
transaction: Psbt,
|
|
1317
1519
|
i: number,
|
|
1318
|
-
tapLeafHash?:
|
|
1520
|
+
tapLeafHash?: Uint8Array,
|
|
1319
1521
|
): Promise<void> {
|
|
1320
1522
|
if ('signTaprootInput' in signer) {
|
|
1321
1523
|
try {
|
|
@@ -1323,7 +1525,7 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
1323
1525
|
signer.signTaprootInput as (
|
|
1324
1526
|
tx: Psbt,
|
|
1325
1527
|
i: number,
|
|
1326
|
-
tapLeafHash?:
|
|
1528
|
+
tapLeafHash?: Uint8Array,
|
|
1327
1529
|
) => Promise<void>
|
|
1328
1530
|
)(transaction, i, tapLeafHash);
|
|
1329
1531
|
} catch {
|
|
@@ -1335,7 +1537,7 @@ export abstract class TweakedTransaction extends Logger {
|
|
|
1335
1537
|
}
|
|
1336
1538
|
|
|
1337
1539
|
private async signNonTaprootInput(
|
|
1338
|
-
signer: Signer |
|
|
1540
|
+
signer: Signer | UniversalSigner,
|
|
1339
1541
|
transaction: Psbt,
|
|
1340
1542
|
i: number,
|
|
1341
1543
|
): Promise<void> {
|