@btc-vision/transaction 1.8.0-beta.3 → 1.8.0-beta.5
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 +11999 -2647
- 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 +3558 -3167
- 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 +844 -2746
- package/browser/noble-hashes.js +1338 -2067
- 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 +17 -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 +274 -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 +14351 -10031
- 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 +9 -4
- 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 +446 -128
- 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 +4 -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 +218 -50
- 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 +46 -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 +35 -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 +23 -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 +375 -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 +43 -5
- 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 +12 -35
- 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/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 +4 -7
- 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 +114 -71
- package/src/keypair/AddressVerificator.ts +14 -148
- package/src/keypair/EcKeyPair.ts +104 -116
- package/src/keypair/MessageSigner.ts +70 -150
- package/src/keypair/Wallet.ts +56 -241
- package/src/metadata/ContractBaseMetadata.ts +2 -2
- package/src/mnemonic/Mnemonic.ts +31 -222
- 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 +26 -14
- 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 +99 -81
- 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 +9 -9
- 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
|
@@ -2,30 +2,39 @@ import { varuint } from '@btc-vision/bitcoin';
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Convert witness stack to script witness buffer
|
|
5
|
-
* @param {
|
|
6
|
-
* @returns {
|
|
5
|
+
* @param {Uint8Array[]} witness - The witness stack
|
|
6
|
+
* @returns {Uint8Array}
|
|
7
7
|
*/
|
|
8
|
-
export function witnessStackToScriptWitness(witness:
|
|
9
|
-
let buffer =
|
|
8
|
+
export function witnessStackToScriptWitness(witness: Uint8Array[]): Uint8Array {
|
|
9
|
+
let buffer = new Uint8Array(0);
|
|
10
|
+
|
|
11
|
+
function concatBuffers(a: Uint8Array, b: Uint8Array): Uint8Array<ArrayBuffer> {
|
|
12
|
+
const result = new Uint8Array(a.length + b.length);
|
|
13
|
+
result.set(a, 0);
|
|
14
|
+
result.set(b, a.length);
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
10
17
|
|
|
11
|
-
function writeSlice(slice:
|
|
12
|
-
buffer =
|
|
18
|
+
function writeSlice(slice: Uint8Array) {
|
|
19
|
+
buffer = concatBuffers(buffer, slice);
|
|
13
20
|
}
|
|
14
21
|
|
|
15
22
|
function writeVarInt(i: number) {
|
|
16
23
|
const currentLen = buffer.length;
|
|
17
24
|
const varintLen = varuint.encodingLength(i);
|
|
18
25
|
|
|
19
|
-
|
|
26
|
+
const newBuffer = new Uint8Array(currentLen + varintLen);
|
|
27
|
+
newBuffer.set(buffer, 0);
|
|
28
|
+
buffer = newBuffer;
|
|
20
29
|
varuint.encode(i, buffer, currentLen);
|
|
21
30
|
}
|
|
22
31
|
|
|
23
|
-
function writeVarSlice(slice:
|
|
32
|
+
function writeVarSlice(slice: Uint8Array) {
|
|
24
33
|
writeVarInt(slice.length);
|
|
25
34
|
writeSlice(slice);
|
|
26
35
|
}
|
|
27
36
|
|
|
28
|
-
function writeVector(vector:
|
|
37
|
+
function writeVector(vector: Uint8Array[]) {
|
|
29
38
|
writeVarInt(vector.length);
|
|
30
39
|
vector.forEach(writeVarSlice);
|
|
31
40
|
}
|
|
@@ -1,71 +1,73 @@
|
|
|
1
|
+
import { fromHex, toHex } from '@btc-vision/bitcoin';
|
|
1
2
|
import { U256_BYTE_LENGTH } from './lengths.js';
|
|
2
|
-
import { MemorySlotPointer } from './types.js';
|
|
3
|
+
import type { MemorySlotPointer } from './types.js';
|
|
3
4
|
|
|
4
5
|
export class BufferHelper {
|
|
5
6
|
public static readonly EXPECTED_BUFFER_LENGTH: number = 32;
|
|
6
7
|
|
|
7
8
|
public static bufferToUint8Array(buffer: Buffer | Uint8Array): Uint8Array {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const view: Uint8Array = new Uint8Array(arrayBuffer);
|
|
13
|
-
for (let i = 0; i < length; ++i) {
|
|
14
|
-
view[i] = buffer[i];
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return view;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return buffer;
|
|
9
|
+
const result = new Uint8Array(buffer.byteLength);
|
|
10
|
+
result.set(buffer);
|
|
11
|
+
return result;
|
|
21
12
|
}
|
|
22
13
|
|
|
23
14
|
public static uint8ArrayToHex(input: Uint8Array): string {
|
|
24
|
-
return
|
|
15
|
+
return toHex(input);
|
|
25
16
|
}
|
|
26
17
|
|
|
27
18
|
public static hexToUint8Array(input: string): Uint8Array {
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
let hex = input;
|
|
20
|
+
if (hex.length >= 2 && hex[0] === '0' && (hex[1] === 'x' || hex[1] === 'X')) {
|
|
21
|
+
hex = hex.slice(2);
|
|
30
22
|
}
|
|
31
23
|
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
// Pad with a leading zero if the length is odd
|
|
25
|
+
if (hex.length % 2 !== 0) {
|
|
26
|
+
hex = '0' + hex;
|
|
34
27
|
}
|
|
35
28
|
|
|
36
|
-
|
|
37
|
-
const buffer = new Uint8Array(lengthS);
|
|
38
|
-
|
|
39
|
-
for (let i = 0; i < lengthS; i++) {
|
|
40
|
-
buffer[i] = parseInt(input.substring(i * 2, i * 2 + 2), 16);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return buffer;
|
|
29
|
+
return fromHex(hex);
|
|
44
30
|
}
|
|
45
31
|
|
|
46
32
|
public static pointerToUint8Array(pointer: MemorySlotPointer): Uint8Array {
|
|
47
|
-
|
|
33
|
+
if (pointer < 0n) {
|
|
34
|
+
throw new RangeError('Pointer cannot be negative');
|
|
35
|
+
}
|
|
48
36
|
|
|
49
|
-
|
|
37
|
+
const hex = pointer.toString(16).padStart(64, '0');
|
|
38
|
+
if (hex.length > 64) {
|
|
39
|
+
throw new RangeError('Pointer exceeds 256-bit range');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return fromHex(hex);
|
|
50
43
|
}
|
|
51
44
|
|
|
52
45
|
public static uint8ArrayToPointer(input: Uint8Array): MemorySlotPointer {
|
|
53
|
-
|
|
46
|
+
if (input.length === 0) {
|
|
47
|
+
return 0n;
|
|
48
|
+
}
|
|
54
49
|
|
|
55
|
-
return BigInt('0x' +
|
|
50
|
+
return BigInt('0x' + toHex(input));
|
|
56
51
|
}
|
|
57
52
|
|
|
58
53
|
public static valueToUint8Array(value: bigint, length: number = U256_BYTE_LENGTH): Uint8Array {
|
|
59
|
-
|
|
54
|
+
if (value < 0n) {
|
|
55
|
+
throw new RangeError('Value cannot be negative');
|
|
56
|
+
}
|
|
60
57
|
|
|
61
|
-
|
|
58
|
+
const hex = value.toString(16).padStart(length * 2, '0');
|
|
59
|
+
if (hex.length > length * 2) {
|
|
60
|
+
throw new RangeError(`Value exceeds ${length}-byte range`);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return fromHex(hex);
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
public static uint8ArrayToValue(input: Uint8Array): bigint {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
if (input.length === 0) {
|
|
68
|
+
return 0n;
|
|
69
|
+
}
|
|
68
70
|
|
|
69
|
-
return BigInt('0x' +
|
|
71
|
+
return BigInt('0x' + toHex(input));
|
|
70
72
|
}
|
|
71
73
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Network } from '@btc-vision/bitcoin';
|
|
2
|
-
import { IFundingTransactionParameters } from '../transaction/interfaces/ITransactionParameters.js';
|
|
1
|
+
import type { Network } from '@btc-vision/bitcoin';
|
|
2
|
+
import type { IFundingTransactionParameters } from '../transaction/interfaces/ITransactionParameters.js';
|
|
3
3
|
import { TransactionFactory } from '../transaction/TransactionFactory.js';
|
|
4
4
|
import { Wallet } from '../keypair/Wallet.js';
|
|
5
|
-
import { BroadcastResponse } from './interfaces/BroadcastResponse.js';
|
|
6
|
-
import {
|
|
5
|
+
import type { BroadcastResponse } from './interfaces/BroadcastResponse.js';
|
|
6
|
+
import type {
|
|
7
7
|
FetchUTXOParams,
|
|
8
8
|
FetchUTXOParamsMultiAddress,
|
|
9
9
|
RawUTXOResponse,
|
|
@@ -100,10 +100,10 @@ export class OPNetLimitedProvider {
|
|
|
100
100
|
continue;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
const rawIndex = utxo.raw
|
|
104
|
-
if (rawIndex
|
|
103
|
+
const rawIndex = Number(utxo.raw);
|
|
104
|
+
if (!Number.isInteger(rawIndex) || rawIndex < 0 || rawIndex >= rawTransactions.length) {
|
|
105
105
|
throw new Error(
|
|
106
|
-
`
|
|
106
|
+
`Invalid raw index for UTXO ${utxo.transactionId}:${utxo.outputIndex}`,
|
|
107
107
|
);
|
|
108
108
|
}
|
|
109
109
|
|
|
@@ -168,8 +168,8 @@ export class OPNetLimitedProvider {
|
|
|
168
168
|
break;
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
currentAmount += utxo.value;
|
|
172
|
-
finalUTXOs.push(utxo);
|
|
171
|
+
currentAmount += (utxo as UTXO).value;
|
|
172
|
+
finalUTXOs.push(utxo as UTXO);
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
return finalUTXOs;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ScriptPubKey } from '@btc-vision/bitcoin-rpc';
|
|
2
|
-
import { RotationSignerBase } from '../../signer/IRotationSigner.js';
|
|
1
|
+
import type { ScriptPubKey } from '@btc-vision/bitcoin-rpc';
|
|
2
|
+
import type { RotationSignerBase } from '../../signer/IRotationSigner.js';
|
|
3
3
|
|
|
4
4
|
export interface UTXO {
|
|
5
5
|
readonly transactionId: string;
|
|
@@ -7,9 +7,9 @@ export interface UTXO {
|
|
|
7
7
|
readonly value: bigint;
|
|
8
8
|
readonly scriptPubKey: ScriptPubKey;
|
|
9
9
|
|
|
10
|
-
redeemScript?: string |
|
|
11
|
-
witnessScript?: string |
|
|
12
|
-
nonWitnessUtxo?: string |
|
|
10
|
+
redeemScript?: string | Uint8Array;
|
|
11
|
+
witnessScript?: string | Uint8Array;
|
|
12
|
+
nonWitnessUtxo?: string | Uint8Array;
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Optional signer for this specific UTXO.
|
|
@@ -23,8 +23,8 @@ export interface FetchUTXOParams {
|
|
|
23
23
|
readonly address: string;
|
|
24
24
|
readonly minAmount: bigint;
|
|
25
25
|
readonly requestedAmount: bigint;
|
|
26
|
-
optimized?: boolean;
|
|
27
|
-
usePendingUTXO?: boolean;
|
|
26
|
+
optimized?: boolean | undefined;
|
|
27
|
+
usePendingUTXO?: boolean | undefined;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export interface FetchUTXOParamsMultiAddress {
|
|
@@ -1,113 +1,65 @@
|
|
|
1
1
|
import {
|
|
2
|
+
concat,
|
|
2
3
|
crypto as bitCrypto,
|
|
3
|
-
|
|
4
|
+
equals,
|
|
5
|
+
type Network,
|
|
4
6
|
networks,
|
|
5
7
|
opcodes,
|
|
6
|
-
|
|
8
|
+
type P2TRPayment,
|
|
9
|
+
type Payment,
|
|
7
10
|
payments,
|
|
11
|
+
type PublicKey,
|
|
8
12
|
script,
|
|
9
|
-
|
|
13
|
+
type Script,
|
|
14
|
+
type Taptree,
|
|
10
15
|
toXOnly,
|
|
11
16
|
} from '@btc-vision/bitcoin';
|
|
12
17
|
import { DeploymentGenerator } from '../generators/builders/DeploymentGenerator.js';
|
|
13
|
-
import { IChallengeSolution } from '../epoch/interfaces/IChallengeSolution.js';
|
|
14
|
-
import { Feature, Features } from '../generators/Features.js';
|
|
18
|
+
import type { IChallengeSolution } from '../epoch/interfaces/IChallengeSolution.js';
|
|
19
|
+
import { type Feature, Features } from '../generators/Features.js';
|
|
15
20
|
|
|
16
21
|
export interface ContractAddressVerificationParams {
|
|
17
|
-
readonly deployerPubKey:
|
|
18
|
-
readonly contractSaltPubKey:
|
|
19
|
-
readonly originalSalt:
|
|
20
|
-
readonly bytecode:
|
|
22
|
+
readonly deployerPubKey: PublicKey;
|
|
23
|
+
readonly contractSaltPubKey: Uint8Array;
|
|
24
|
+
readonly originalSalt: Uint8Array;
|
|
25
|
+
readonly bytecode: Uint8Array;
|
|
21
26
|
readonly challenge: IChallengeSolution;
|
|
22
27
|
readonly priorityFee: bigint;
|
|
23
28
|
readonly features: Feature<Features>[];
|
|
24
|
-
readonly calldata?:
|
|
29
|
+
readonly calldata?: Uint8Array;
|
|
25
30
|
readonly network?: Network;
|
|
26
31
|
}
|
|
27
32
|
|
|
33
|
+
interface ScriptTreeComponents {
|
|
34
|
+
readonly scriptTree: Taptree;
|
|
35
|
+
readonly compiledTargetScript: Uint8Array;
|
|
36
|
+
readonly network: Network;
|
|
37
|
+
}
|
|
38
|
+
|
|
28
39
|
export class TapscriptVerificator {
|
|
29
40
|
private static readonly TAP_SCRIPT_VERSION: number = 192;
|
|
30
41
|
|
|
31
42
|
public static getContractAddress(
|
|
32
43
|
params: ContractAddressVerificationParams,
|
|
33
44
|
): string | undefined {
|
|
34
|
-
const
|
|
35
|
-
const scriptBuilder: DeploymentGenerator = new DeploymentGenerator(
|
|
36
|
-
params.deployerPubKey,
|
|
37
|
-
toXOnly(params.contractSaltPubKey),
|
|
38
|
-
network,
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
const compiledTargetScript: Buffer = scriptBuilder.compile(
|
|
42
|
-
params.bytecode,
|
|
43
|
-
params.originalSalt,
|
|
44
|
-
params.challenge,
|
|
45
|
-
params.priorityFee,
|
|
46
|
-
params.calldata,
|
|
47
|
-
params.features,
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
const lockLeafScript = script.compile([
|
|
51
|
-
toXOnly(params.deployerPubKey),
|
|
52
|
-
opcodes.OP_CHECKSIG,
|
|
53
|
-
]);
|
|
54
|
-
|
|
55
|
-
const scriptTree: Taptree = [
|
|
56
|
-
{
|
|
57
|
-
output: compiledTargetScript,
|
|
58
|
-
version: TapscriptVerificator.TAP_SCRIPT_VERSION,
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
output: lockLeafScript,
|
|
62
|
-
version: TapscriptVerificator.TAP_SCRIPT_VERSION,
|
|
63
|
-
},
|
|
64
|
-
];
|
|
45
|
+
const { scriptTree } = TapscriptVerificator.buildScriptTree(params);
|
|
65
46
|
|
|
66
47
|
return TapscriptVerificator.generateAddressFromScript(params, scriptTree);
|
|
67
48
|
}
|
|
68
49
|
|
|
69
50
|
public static verifyControlBlock(
|
|
70
51
|
params: ContractAddressVerificationParams,
|
|
71
|
-
controlBlock:
|
|
52
|
+
controlBlock: Uint8Array,
|
|
72
53
|
): boolean {
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
params.deployerPubKey,
|
|
76
|
-
toXOnly(params.contractSaltPubKey),
|
|
77
|
-
network,
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
const compiledTargetScript: Buffer = scriptBuilder.compile(
|
|
81
|
-
params.bytecode,
|
|
82
|
-
params.originalSalt,
|
|
83
|
-
params.challenge,
|
|
84
|
-
params.priorityFee,
|
|
85
|
-
params.calldata,
|
|
86
|
-
params.features,
|
|
87
|
-
);
|
|
88
|
-
|
|
89
|
-
const lockLeafScript = script.compile([
|
|
90
|
-
toXOnly(params.deployerPubKey),
|
|
91
|
-
opcodes.OP_CHECKSIG,
|
|
92
|
-
]);
|
|
93
|
-
|
|
94
|
-
const scriptTree: Taptree = [
|
|
95
|
-
{
|
|
96
|
-
output: compiledTargetScript,
|
|
97
|
-
version: TapscriptVerificator.TAP_SCRIPT_VERSION,
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
output: lockLeafScript,
|
|
101
|
-
version: TapscriptVerificator.TAP_SCRIPT_VERSION,
|
|
102
|
-
},
|
|
103
|
-
];
|
|
54
|
+
const { scriptTree, compiledTargetScript, network } =
|
|
55
|
+
TapscriptVerificator.buildScriptTree(params);
|
|
104
56
|
|
|
105
57
|
const tapData = payments.p2tr({
|
|
106
58
|
internalPubkey: toXOnly(params.deployerPubKey),
|
|
107
59
|
network: network,
|
|
108
60
|
scriptTree: scriptTree,
|
|
109
61
|
redeem: {
|
|
110
|
-
output: compiledTargetScript,
|
|
62
|
+
output: compiledTargetScript as Script,
|
|
111
63
|
redeemVersion: TapscriptVerificator.TAP_SCRIPT_VERSION,
|
|
112
64
|
},
|
|
113
65
|
});
|
|
@@ -117,18 +69,17 @@ export class TapscriptVerificator {
|
|
|
117
69
|
return false;
|
|
118
70
|
}
|
|
119
71
|
|
|
120
|
-
const requiredControlBlock:
|
|
121
|
-
return
|
|
72
|
+
const requiredControlBlock: Uint8Array = witness[witness.length - 1] as Uint8Array;
|
|
73
|
+
return equals(requiredControlBlock, controlBlock);
|
|
122
74
|
}
|
|
123
75
|
|
|
124
76
|
public static getContractSeed(
|
|
125
|
-
deployerPubKey:
|
|
126
|
-
bytecode:
|
|
127
|
-
saltHash:
|
|
128
|
-
):
|
|
129
|
-
const sha256OfBytecode:
|
|
130
|
-
const buf:
|
|
131
|
-
|
|
77
|
+
deployerPubKey: Uint8Array,
|
|
78
|
+
bytecode: Uint8Array,
|
|
79
|
+
saltHash: Uint8Array,
|
|
80
|
+
): Uint8Array {
|
|
81
|
+
const sha256OfBytecode: Uint8Array = bitCrypto.hash256(bytecode);
|
|
82
|
+
const buf: Uint8Array = concat([deployerPubKey, saltHash, sha256OfBytecode]);
|
|
132
83
|
return bitCrypto.hash256(buf);
|
|
133
84
|
}
|
|
134
85
|
|
|
@@ -137,14 +88,50 @@ export class TapscriptVerificator {
|
|
|
137
88
|
scriptTree: Taptree,
|
|
138
89
|
): string | undefined {
|
|
139
90
|
const network = params.network || networks.bitcoin;
|
|
140
|
-
|
|
141
|
-
const transactionData: Payment = {
|
|
91
|
+
const transactionData: Omit<P2TRPayment, 'name'> = {
|
|
142
92
|
internalPubkey: toXOnly(params.deployerPubKey),
|
|
143
93
|
network: network,
|
|
144
94
|
scriptTree: scriptTree,
|
|
145
95
|
};
|
|
146
|
-
|
|
147
96
|
const tx: Payment = payments.p2tr(transactionData);
|
|
148
97
|
return tx.address;
|
|
149
98
|
}
|
|
99
|
+
|
|
100
|
+
private static buildScriptTree(
|
|
101
|
+
params: ContractAddressVerificationParams,
|
|
102
|
+
): ScriptTreeComponents {
|
|
103
|
+
const network = params.network || networks.bitcoin;
|
|
104
|
+
const scriptBuilder: DeploymentGenerator = new DeploymentGenerator(
|
|
105
|
+
params.deployerPubKey,
|
|
106
|
+
toXOnly(params.contractSaltPubKey as PublicKey),
|
|
107
|
+
network,
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
const compiledTargetScript: Uint8Array = scriptBuilder.compile(
|
|
111
|
+
params.bytecode,
|
|
112
|
+
params.originalSalt,
|
|
113
|
+
params.challenge,
|
|
114
|
+
params.priorityFee,
|
|
115
|
+
params.calldata,
|
|
116
|
+
params.features,
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
const lockLeafScript: Script = script.compile([
|
|
120
|
+
toXOnly(params.deployerPubKey),
|
|
121
|
+
opcodes.OP_CHECKSIG,
|
|
122
|
+
]);
|
|
123
|
+
|
|
124
|
+
const scriptTree: Taptree = [
|
|
125
|
+
{
|
|
126
|
+
output: compiledTargetScript,
|
|
127
|
+
version: TapscriptVerificator.TAP_SCRIPT_VERSION,
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
output: lockLeafScript,
|
|
131
|
+
version: TapscriptVerificator.TAP_SCRIPT_VERSION,
|
|
132
|
+
},
|
|
133
|
+
];
|
|
134
|
+
|
|
135
|
+
return { scriptTree, compiledTargetScript, network };
|
|
136
|
+
}
|
|
150
137
|
}
|
|
@@ -5,22 +5,19 @@ import {
|
|
|
5
5
|
disabledAddressRotation,
|
|
6
6
|
EcKeyPair,
|
|
7
7
|
FundingTransaction,
|
|
8
|
-
SignerMap,
|
|
9
|
-
RotationSigner,
|
|
10
|
-
AddressRotationConfig,
|
|
11
8
|
} from '../build/opnet.js';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
9
|
+
import type { SignerMap, RotationSigner, AddressRotationConfig, UTXO } from '../build/opnet.js';
|
|
10
|
+
import { networks, payments, toXOnly, toHex, equals } from '@btc-vision/bitcoin';
|
|
11
|
+
import type { UniversalSigner } from '@btc-vision/ecpair';
|
|
15
12
|
|
|
16
13
|
describe('Address Rotation', () => {
|
|
17
14
|
const network = networks.regtest;
|
|
18
15
|
|
|
19
16
|
// Generate test keypairs
|
|
20
|
-
let signer1:
|
|
21
|
-
let signer2:
|
|
22
|
-
let signer3:
|
|
23
|
-
let defaultSigner:
|
|
17
|
+
let signer1: UniversalSigner;
|
|
18
|
+
let signer2: UniversalSigner;
|
|
19
|
+
let signer3: UniversalSigner;
|
|
20
|
+
let defaultSigner: UniversalSigner;
|
|
24
21
|
|
|
25
22
|
let address1: string;
|
|
26
23
|
let address2: string;
|
|
@@ -56,7 +53,7 @@ describe('Address Rotation', () => {
|
|
|
56
53
|
outputIndex: index,
|
|
57
54
|
value,
|
|
58
55
|
scriptPubKey: {
|
|
59
|
-
hex: p2tr.output
|
|
56
|
+
hex: toHex(p2tr.output as Uint8Array),
|
|
60
57
|
address,
|
|
61
58
|
},
|
|
62
59
|
};
|
|
@@ -400,7 +397,7 @@ describe('Address Rotation', () => {
|
|
|
400
397
|
});
|
|
401
398
|
|
|
402
399
|
it('should handle many UTXOs from different addresses', async () => {
|
|
403
|
-
const signers:
|
|
400
|
+
const signers: UniversalSigner[] = [];
|
|
404
401
|
const addresses: string[] = [];
|
|
405
402
|
const utxos: UTXO[] = [];
|
|
406
403
|
|
|
@@ -413,9 +410,9 @@ describe('Address Rotation', () => {
|
|
|
413
410
|
utxos.push(createTaprootUtxo(addr, 20000n, i.toString().repeat(64), 0));
|
|
414
411
|
}
|
|
415
412
|
|
|
416
|
-
const pairs: [string,
|
|
413
|
+
const pairs: [string, UniversalSigner][] = addresses.map((addr, i) => [
|
|
417
414
|
addr,
|
|
418
|
-
signers[i],
|
|
415
|
+
signers[i] as UniversalSigner,
|
|
419
416
|
]);
|
|
420
417
|
|
|
421
418
|
const tx = new FundingTransaction({
|
|
@@ -515,13 +512,15 @@ describe('Address Rotation', () => {
|
|
|
515
512
|
const inputs = tx.getInputs();
|
|
516
513
|
|
|
517
514
|
// Verify each input has the correct tapInternalKey
|
|
518
|
-
const expectedKey1 = toXOnly(
|
|
519
|
-
const expectedKey2 = toXOnly(
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
expect(
|
|
524
|
-
expect(
|
|
515
|
+
const expectedKey1 = toXOnly(signer1.publicKey);
|
|
516
|
+
const expectedKey2 = toXOnly(signer2.publicKey);
|
|
517
|
+
|
|
518
|
+
const input0 = inputs[0] as (typeof inputs)[0];
|
|
519
|
+
const input1 = inputs[1] as (typeof inputs)[0];
|
|
520
|
+
expect(input0.tapInternalKey).toBeDefined();
|
|
521
|
+
expect(input1.tapInternalKey).toBeDefined();
|
|
522
|
+
expect(equals(input0.tapInternalKey as Uint8Array, expectedKey1)).toBe(true);
|
|
523
|
+
expect(equals(input1.tapInternalKey as Uint8Array, expectedKey2)).toBe(true);
|
|
525
524
|
});
|
|
526
525
|
|
|
527
526
|
it('should use default signer tapInternalKey when rotation disabled', async () => {
|
|
@@ -544,10 +543,11 @@ describe('Address Rotation', () => {
|
|
|
544
543
|
await tx.generateTransactionMinimalSignatures();
|
|
545
544
|
|
|
546
545
|
const inputs = tx.getInputs();
|
|
547
|
-
const expectedKey = toXOnly(
|
|
546
|
+
const expectedKey = toXOnly(defaultSigner.publicKey);
|
|
548
547
|
|
|
549
|
-
|
|
550
|
-
expect(
|
|
548
|
+
const input0 = inputs[0] as (typeof inputs)[0];
|
|
549
|
+
expect(input0.tapInternalKey).toBeDefined();
|
|
550
|
+
expect(equals(input0.tapInternalKey as Uint8Array, expectedKey)).toBe(true);
|
|
551
551
|
});
|
|
552
552
|
});
|
|
553
553
|
});
|
package/test/address.test.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest';
|
|
2
2
|
import { Address, MLDSASecurityLevel, Mnemonic } from '../build/opnet.js';
|
|
3
|
-
import { networks } from '@btc-vision/bitcoin';
|
|
3
|
+
import { networks, toHex } from '@btc-vision/bitcoin';
|
|
4
4
|
|
|
5
5
|
describe('Address - Comprehensive Tests', () => {
|
|
6
6
|
const testMnemonic =
|
|
@@ -283,9 +283,9 @@ describe('Address - Comprehensive Tests', () => {
|
|
|
283
283
|
const address = new Address(bytes);
|
|
284
284
|
|
|
285
285
|
const buffer = address.toBuffer();
|
|
286
|
-
expect(buffer).toBeInstanceOf(
|
|
286
|
+
expect(buffer).toBeInstanceOf(Uint8Array);
|
|
287
287
|
expect(buffer.length).toBe(32);
|
|
288
|
-
expect(buffer
|
|
288
|
+
expect(toHex(buffer)).toContain('aaaa');
|
|
289
289
|
});
|
|
290
290
|
|
|
291
291
|
it('should toString return same as toHex', () => {
|
|
@@ -318,7 +318,7 @@ describe('Address - Comprehensive Tests', () => {
|
|
|
318
318
|
const addr = getValidAddress();
|
|
319
319
|
const buffer = addr.tweakedPublicKeyToBuffer();
|
|
320
320
|
|
|
321
|
-
expect(buffer).toBeInstanceOf(
|
|
321
|
+
expect(buffer).toBeInstanceOf(Uint8Array);
|
|
322
322
|
expect(buffer.length).toBe(32);
|
|
323
323
|
});
|
|
324
324
|
|
|
@@ -349,7 +349,7 @@ describe('Address - Comprehensive Tests', () => {
|
|
|
349
349
|
const addr = getValidAddress();
|
|
350
350
|
const buffer = addr.toTweakedHybridPublicKeyBuffer();
|
|
351
351
|
|
|
352
|
-
expect(buffer).toBeInstanceOf(
|
|
352
|
+
expect(buffer).toBeInstanceOf(Uint8Array);
|
|
353
353
|
});
|
|
354
354
|
|
|
355
355
|
it('should throw error for toTweakedHybridPublicKeyBuffer without key', () => {
|
|
@@ -381,7 +381,7 @@ describe('Address - Comprehensive Tests', () => {
|
|
|
381
381
|
const addr = getValidAddress();
|
|
382
382
|
const buffer = addr.toUncompressedBuffer();
|
|
383
383
|
|
|
384
|
-
expect(buffer).toBeInstanceOf(
|
|
384
|
+
expect(buffer).toBeInstanceOf(Uint8Array);
|
|
385
385
|
expect(buffer.length).toBe(65);
|
|
386
386
|
});
|
|
387
387
|
|
|
@@ -410,7 +410,7 @@ describe('Address - Comprehensive Tests', () => {
|
|
|
410
410
|
const addr = getValidAddress();
|
|
411
411
|
const buffer = addr.toHybridPublicKeyBuffer();
|
|
412
412
|
|
|
413
|
-
expect(buffer).toBeInstanceOf(
|
|
413
|
+
expect(buffer).toBeInstanceOf(Uint8Array);
|
|
414
414
|
});
|
|
415
415
|
|
|
416
416
|
it('should throw error for toHybridPublicKeyBuffer without key', () => {
|
|
@@ -424,7 +424,7 @@ describe('Address - Comprehensive Tests', () => {
|
|
|
424
424
|
const addr = getValidAddress();
|
|
425
425
|
const buffer = addr.originalPublicKeyBuffer();
|
|
426
426
|
|
|
427
|
-
expect(buffer).toBeInstanceOf(
|
|
427
|
+
expect(buffer).toBeInstanceOf(Uint8Array);
|
|
428
428
|
expect(buffer.length).toBe(33);
|
|
429
429
|
});
|
|
430
430
|
|
|
@@ -813,7 +813,7 @@ describe('Address - Comprehensive Tests', () => {
|
|
|
813
813
|
const p2wda = addr.p2wda(networks.bitcoin);
|
|
814
814
|
|
|
815
815
|
expect(p2wda.address).toMatch(/^bc1q/);
|
|
816
|
-
expect(p2wda.witnessScript).toBeInstanceOf(
|
|
816
|
+
expect(p2wda.witnessScript).toBeInstanceOf(Uint8Array);
|
|
817
817
|
});
|
|
818
818
|
|
|
819
819
|
it('should cache p2wda for same network', () => {
|
|
@@ -851,7 +851,7 @@ describe('Address - Comprehensive Tests', () => {
|
|
|
851
851
|
const csv = addr.toCSV(100, networks.bitcoin);
|
|
852
852
|
|
|
853
853
|
expect(csv.address).toMatch(/^bc1q/);
|
|
854
|
-
expect(csv.witnessScript).toBeInstanceOf(
|
|
854
|
+
expect(csv.witnessScript).toBeInstanceOf(Uint8Array);
|
|
855
855
|
});
|
|
856
856
|
|
|
857
857
|
it('should generate CSV address with valid duration (bigint)', () => {
|
|
@@ -1029,8 +1029,8 @@ describe('Address - Comprehensive Tests', () => {
|
|
|
1029
1029
|
}
|
|
1030
1030
|
|
|
1031
1031
|
for (let i = 0; i < addresses.length - 1; i++) {
|
|
1032
|
-
expect(addresses[i].lessThan(addresses[i + 1])).toBe(true);
|
|
1033
|
-
expect(addresses[i + 1].greaterThan(addresses[i])).toBe(true);
|
|
1032
|
+
expect((addresses[i] as Address).lessThan(addresses[i + 1] as Address)).toBe(true);
|
|
1033
|
+
expect((addresses[i + 1] as Address).greaterThan(addresses[i] as Address)).toBe(true);
|
|
1034
1034
|
}
|
|
1035
1035
|
});
|
|
1036
1036
|
});
|