@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
|
@@ -1,35 +1,76 @@
|
|
|
1
|
-
import { crypto as bitCrypto, PaymentType, toXOnly, } from '@btc-vision/bitcoin';
|
|
1
|
+
import { crypto as bitCrypto, PaymentType, Psbt, toSatoshi, toXOnly, } from '@btc-vision/bitcoin';
|
|
2
2
|
import { TransactionType } from '../enums/TransactionType.js';
|
|
3
3
|
import { TransactionBuilder } from './TransactionBuilder.js';
|
|
4
4
|
import { CustomGenerator } from '../../generators/builders/CustomGenerator.js';
|
|
5
5
|
import { BitcoinUtils } from '../../utils/BitcoinUtils.js';
|
|
6
6
|
import { EcKeyPair } from '../../keypair/EcKeyPair.js';
|
|
7
7
|
import { AddressGenerator } from '../../generators/AddressGenerator.js';
|
|
8
|
+
import {} from '@btc-vision/ecpair';
|
|
9
|
+
import { isUniversalSigner } from '../../signer/TweakedSigner.js';
|
|
10
|
+
/**
|
|
11
|
+
* Class for interaction transactions
|
|
12
|
+
* @class CustomScriptTransaction
|
|
13
|
+
*/
|
|
8
14
|
export class CustomScriptTransaction extends TransactionBuilder {
|
|
15
|
+
type = TransactionType.CUSTOM_CODE;
|
|
16
|
+
/**
|
|
17
|
+
* The contract address
|
|
18
|
+
* @protected
|
|
19
|
+
*/
|
|
20
|
+
_scriptAddress;
|
|
21
|
+
/**
|
|
22
|
+
* The tap leaf script
|
|
23
|
+
* @private
|
|
24
|
+
*/
|
|
25
|
+
tapLeafScript = null;
|
|
26
|
+
/**
|
|
27
|
+
* The target script redeem
|
|
28
|
+
* @private
|
|
29
|
+
*/
|
|
30
|
+
targetScriptRedeem = null;
|
|
31
|
+
/**
|
|
32
|
+
* The left over funds script redeem
|
|
33
|
+
* @private
|
|
34
|
+
*/
|
|
35
|
+
leftOverFundsScriptRedeem = null;
|
|
36
|
+
/**
|
|
37
|
+
* The compiled target script
|
|
38
|
+
* @private
|
|
39
|
+
*/
|
|
40
|
+
compiledTargetScript;
|
|
41
|
+
/**
|
|
42
|
+
* The script tree
|
|
43
|
+
* @private
|
|
44
|
+
*/
|
|
45
|
+
scriptTree;
|
|
46
|
+
/**
|
|
47
|
+
* The deployment bitcoin generator
|
|
48
|
+
* @private
|
|
49
|
+
*/
|
|
50
|
+
generator;
|
|
51
|
+
/**
|
|
52
|
+
* The contract seed
|
|
53
|
+
* @private
|
|
54
|
+
*/
|
|
55
|
+
scriptSeed;
|
|
56
|
+
/**
|
|
57
|
+
* The contract signer
|
|
58
|
+
* @private
|
|
59
|
+
*/
|
|
60
|
+
contractSigner;
|
|
61
|
+
/**
|
|
62
|
+
* The contract salt random bytes
|
|
63
|
+
* @private
|
|
64
|
+
*/
|
|
65
|
+
randomBytes;
|
|
66
|
+
/**
|
|
67
|
+
* The witnesses
|
|
68
|
+
* @private
|
|
69
|
+
*/
|
|
70
|
+
witnesses;
|
|
71
|
+
annexData;
|
|
9
72
|
constructor(parameters) {
|
|
10
73
|
super(parameters);
|
|
11
|
-
this.type = TransactionType.CUSTOM_CODE;
|
|
12
|
-
this.tapLeafScript = null;
|
|
13
|
-
this.targetScriptRedeem = null;
|
|
14
|
-
this.leftOverFundsScriptRedeem = null;
|
|
15
|
-
this.customFinalizer = (_inputIndex, input) => {
|
|
16
|
-
if (!this.tapLeafScript) {
|
|
17
|
-
throw new Error('Tap leaf script is required');
|
|
18
|
-
}
|
|
19
|
-
const scriptSolution = this.getScriptSolution(input);
|
|
20
|
-
const witness = scriptSolution
|
|
21
|
-
.concat(this.tapLeafScript.script)
|
|
22
|
-
.concat(this.tapLeafScript.controlBlock);
|
|
23
|
-
if (this.annexData && this.annexData.length > 0) {
|
|
24
|
-
const annex = this.annexData[0] === 0x50
|
|
25
|
-
? this.annexData
|
|
26
|
-
: Buffer.concat([Buffer.from([0x50]), this.annexData]);
|
|
27
|
-
witness.push(annex);
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
finalScriptWitness: TransactionBuilder.witnessStackToScriptWitness(witness),
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
74
|
if (!parameters.script)
|
|
34
75
|
throw new Error('Bitcoin script is required');
|
|
35
76
|
if (!parameters.witnesses)
|
|
@@ -45,21 +86,39 @@ export class CustomScriptTransaction extends TransactionBuilder {
|
|
|
45
86
|
this.internalInit();
|
|
46
87
|
this._scriptAddress = AddressGenerator.generatePKSH(this.scriptSeed, this.network);
|
|
47
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* @description Get the contract address (PKSH)
|
|
91
|
+
*/
|
|
48
92
|
get scriptAddress() {
|
|
49
93
|
return this._scriptAddress;
|
|
50
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* @description Get the P2TR address
|
|
97
|
+
*/
|
|
51
98
|
get p2trAddress() {
|
|
52
99
|
return this.to || this.getScriptAddress();
|
|
53
100
|
}
|
|
54
101
|
exportCompiledTargetScript() {
|
|
55
102
|
return this.compiledTargetScript;
|
|
56
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* Get the random bytes used for the interaction
|
|
106
|
+
* @returns {Buffer} The random bytes
|
|
107
|
+
*/
|
|
57
108
|
getRndBytes() {
|
|
58
109
|
return this.randomBytes;
|
|
59
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Get the contract signer public key
|
|
113
|
+
* @protected
|
|
114
|
+
*/
|
|
60
115
|
contractSignerXOnlyPubKey() {
|
|
61
|
-
return toXOnly(
|
|
116
|
+
return toXOnly(this.contractSigner.publicKey);
|
|
62
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* Build the transaction
|
|
120
|
+
* @protected
|
|
121
|
+
*/
|
|
63
122
|
async buildTransaction() {
|
|
64
123
|
if (!this.to) {
|
|
65
124
|
this.to = this.getScriptAddress();
|
|
@@ -84,31 +143,63 @@ export class CustomScriptTransaction extends TransactionBuilder {
|
|
|
84
143
|
this.addInputsFromUTXO();
|
|
85
144
|
const amountSpent = this.getTransactionOPNetFee();
|
|
86
145
|
this.addOutput({
|
|
87
|
-
value:
|
|
146
|
+
value: toSatoshi(amountSpent),
|
|
88
147
|
address: this.to,
|
|
89
148
|
});
|
|
90
149
|
await this.addRefundOutput(amountSpent + this.addOptionalOutputsAndGetAmount());
|
|
91
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* Sign the inputs
|
|
153
|
+
* @param {Psbt} transaction The transaction to sign
|
|
154
|
+
* @protected
|
|
155
|
+
*/
|
|
92
156
|
async signInputs(transaction) {
|
|
93
157
|
if (!this.contractSigner) {
|
|
94
158
|
await super.signInputs(transaction);
|
|
95
159
|
return;
|
|
96
160
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
161
|
+
// Input 0: sequential (contractSigner + main signer, custom finalizer)
|
|
162
|
+
try {
|
|
163
|
+
transaction.signInput(0, this.contractSigner);
|
|
164
|
+
}
|
|
165
|
+
catch {
|
|
166
|
+
// contractSigner may fail for some script types
|
|
167
|
+
}
|
|
168
|
+
transaction.signInput(0, this.getSignerKey());
|
|
169
|
+
transaction.finalizeInput(0, this.customFinalizer);
|
|
170
|
+
// Inputs 1+: parallel key-path if available, then sequential for remaining
|
|
171
|
+
const signedIndices = new Set([0]);
|
|
172
|
+
if (this.canUseParallelSigning && isUniversalSigner(this.signer)) {
|
|
173
|
+
try {
|
|
174
|
+
const result = await this.signKeyPathInputsParallel(transaction, new Set([0]));
|
|
175
|
+
if (result.success) {
|
|
176
|
+
for (const idx of result.signatures.keys())
|
|
177
|
+
signedIndices.add(idx);
|
|
101
178
|
}
|
|
102
|
-
catch (e) { }
|
|
103
|
-
transaction.signInput(0, this.getSignerKey());
|
|
104
|
-
transaction.finalizeInput(0, this.customFinalizer);
|
|
105
179
|
}
|
|
106
|
-
|
|
180
|
+
catch (e) {
|
|
181
|
+
this.error(`Parallel signing failed: ${e.message}`);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
for (let i = 1; i < transaction.data.inputs.length; i++) {
|
|
185
|
+
if (!signedIndices.has(i)) {
|
|
107
186
|
transaction.signInput(i, this.getSignerKey());
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// Finalize inputs 1+
|
|
190
|
+
for (let i = 1; i < transaction.data.inputs.length; i++) {
|
|
191
|
+
try {
|
|
192
|
+
transaction.finalizeInput(i, this.customFinalizerP2SH.bind(this));
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
108
195
|
transaction.finalizeInput(i);
|
|
109
196
|
}
|
|
110
197
|
}
|
|
111
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* Get the tap output
|
|
201
|
+
* @protected
|
|
202
|
+
*/
|
|
112
203
|
generateScriptAddress() {
|
|
113
204
|
return {
|
|
114
205
|
internalPubkey: this.internalPubKeyToXOnly(),
|
|
@@ -117,6 +208,10 @@ export class CustomScriptTransaction extends TransactionBuilder {
|
|
|
117
208
|
name: PaymentType.P2TR,
|
|
118
209
|
};
|
|
119
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* Generate the tap data
|
|
213
|
+
* @protected
|
|
214
|
+
*/
|
|
120
215
|
generateTapData() {
|
|
121
216
|
const selectedRedeem = this.contractSigner
|
|
122
217
|
? this.targetScriptRedeem
|
|
@@ -147,31 +242,72 @@ export class CustomScriptTransaction extends TransactionBuilder {
|
|
|
147
242
|
}
|
|
148
243
|
return witnesses;
|
|
149
244
|
}
|
|
245
|
+
/**
|
|
246
|
+
* Generate the contract seed for the deployment
|
|
247
|
+
* @private
|
|
248
|
+
*/
|
|
150
249
|
getContractSeed() {
|
|
151
250
|
return bitCrypto.hash256(this.randomBytes);
|
|
152
251
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
252
|
+
/**
|
|
253
|
+
* Finalize the transaction
|
|
254
|
+
* @param _inputIndex
|
|
255
|
+
* @param input
|
|
256
|
+
*/
|
|
257
|
+
customFinalizer = (_inputIndex, input) => {
|
|
258
|
+
if (!this.tapLeafScript) {
|
|
259
|
+
throw new Error('Tap leaf script is required');
|
|
157
260
|
}
|
|
158
|
-
|
|
159
|
-
|
|
261
|
+
const scriptSolution = this.getScriptSolution(input);
|
|
262
|
+
const witness = scriptSolution
|
|
263
|
+
.concat(this.tapLeafScript.script)
|
|
264
|
+
.concat(this.tapLeafScript.controlBlock);
|
|
265
|
+
if (this.annexData && this.annexData.length > 0) {
|
|
266
|
+
let annex;
|
|
267
|
+
if (this.annexData[0] === 0x50) {
|
|
268
|
+
annex = this.annexData;
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
const prefixed = new Uint8Array(this.annexData.length + 1);
|
|
272
|
+
prefixed[0] = 0x50;
|
|
273
|
+
prefixed.set(this.annexData, 1);
|
|
274
|
+
annex = prefixed;
|
|
275
|
+
}
|
|
276
|
+
witness.push(annex);
|
|
277
|
+
}
|
|
278
|
+
return {
|
|
279
|
+
finalScriptWitness: TransactionBuilder.witnessStackToScriptWitness(witness),
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
/**
|
|
283
|
+
* Generate the redeem scripts
|
|
284
|
+
* @private
|
|
285
|
+
*/
|
|
160
286
|
generateRedeemScripts() {
|
|
161
287
|
this.targetScriptRedeem = {
|
|
162
288
|
name: PaymentType.P2TR,
|
|
289
|
+
//pubkeys: this.getPubKeys(),
|
|
163
290
|
output: this.compiledTargetScript,
|
|
164
291
|
redeemVersion: 192,
|
|
165
292
|
};
|
|
166
293
|
this.leftOverFundsScriptRedeem = {
|
|
167
294
|
name: PaymentType.P2TR,
|
|
295
|
+
//pubkeys: this.getPubKeys(),
|
|
168
296
|
output: this.getLeafScript(),
|
|
169
297
|
redeemVersion: 192,
|
|
170
298
|
};
|
|
171
299
|
}
|
|
300
|
+
/**
|
|
301
|
+
* Get the second leaf script
|
|
302
|
+
* @private
|
|
303
|
+
*/
|
|
172
304
|
getLeafScript() {
|
|
173
305
|
return this.LOCK_LEAF_SCRIPT;
|
|
174
306
|
}
|
|
307
|
+
/**
|
|
308
|
+
* Get the script tree
|
|
309
|
+
* @private
|
|
310
|
+
*/
|
|
175
311
|
getScriptTree() {
|
|
176
312
|
this.generateRedeemScripts();
|
|
177
313
|
return [
|
|
@@ -186,3 +322,4 @@ export class CustomScriptTransaction extends TransactionBuilder {
|
|
|
186
322
|
];
|
|
187
323
|
}
|
|
188
324
|
}
|
|
325
|
+
//# sourceMappingURL=CustomScriptTransaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomScriptTransaction.js","sourceRoot":"","sources":["../../../src/transaction/builders/CustomScriptTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,MAAM,IAAI,SAAS,EAGnB,WAAW,EACX,IAAI,EAKJ,SAAS,EACT,OAAO,GACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAwB,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,iBAAi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6BAA6B;YAC7B,MAAM,EAAE,IAAI,CAAC,oBAA8B;YAC3C,aAAa,EAAE,GAAG;SACrB,CAAC;QAEF,IAAI,CAAC,yBAAyB,GAAG;YAC7B,IAAI,EAAE,WAAW,CAAC,IAAI;YACtB,6BAA6B;YAC7B,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE;YAC5B,aAAa,EAAE,GAAG;SACrB,CAAC;IACN,CAAC;IAED;;;OAGG;IACK,aAAa;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IAED;;;OAGG;IACK,aAAa;QACjB,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAE7B,OAAO;YACH;gBACI,MAAM,EAAE,IAAI,CAAC,oBAAoB;gBACjC,OAAO,EAAE,GAAG;aACf;YACD;gBACI,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE;gBAC5B,OAAO,EAAE,GAAG;aACf;SACJ,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -1,52 +1,163 @@
|
|
|
1
1
|
import { TransactionType } from '../enums/TransactionType.js';
|
|
2
|
-
import { IDeploymentParameters } from '../interfaces/ITransactionParameters.js';
|
|
3
|
-
import { P2TRPayment, Psbt } from '@btc-vision/bitcoin';
|
|
2
|
+
import type { IDeploymentParameters } from '../interfaces/ITransactionParameters.js';
|
|
3
|
+
import { type P2TRPayment, Psbt } from '@btc-vision/bitcoin';
|
|
4
4
|
import { TransactionBuilder } from './TransactionBuilder.js';
|
|
5
|
-
import { TapLeafScript } from '../interfaces/Tap.js';
|
|
5
|
+
import type { TapLeafScript } from '../interfaces/Tap.js';
|
|
6
6
|
import { Address } from '../../keypair/Address.js';
|
|
7
|
-
import { IChallengeSolution } from '../../epoch/interfaces/IChallengeSolution.js';
|
|
8
|
-
import { IP2WSHAddress } from '../mineable/IP2WSHAddress.js';
|
|
7
|
+
import type { IChallengeSolution } from '../../epoch/interfaces/IChallengeSolution.js';
|
|
8
|
+
import type { IP2WSHAddress } from '../mineable/IP2WSHAddress.js';
|
|
9
9
|
export declare class DeploymentTransaction extends TransactionBuilder<TransactionType.DEPLOYMENT> {
|
|
10
10
|
static readonly MAXIMUM_CONTRACT_SIZE: number;
|
|
11
11
|
type: TransactionType.DEPLOYMENT;
|
|
12
12
|
protected readonly challenge: IChallengeSolution;
|
|
13
13
|
protected readonly epochChallenge: IP2WSHAddress;
|
|
14
|
+
/**
|
|
15
|
+
* The contract address
|
|
16
|
+
* @protected
|
|
17
|
+
*/
|
|
14
18
|
protected readonly _contractAddress: Address;
|
|
19
|
+
/**
|
|
20
|
+
* The tap leaf script
|
|
21
|
+
* @private
|
|
22
|
+
*/
|
|
15
23
|
protected tapLeafScript: TapLeafScript | null;
|
|
16
24
|
private readonly deploymentVersion;
|
|
25
|
+
/**
|
|
26
|
+
* The target script redeem
|
|
27
|
+
* @private
|
|
28
|
+
*/
|
|
17
29
|
private targetScriptRedeem;
|
|
30
|
+
/**
|
|
31
|
+
* The left over funds script redeem
|
|
32
|
+
* @private
|
|
33
|
+
*/
|
|
18
34
|
private leftOverFundsScriptRedeem;
|
|
35
|
+
/**
|
|
36
|
+
* The compiled target script
|
|
37
|
+
* @private
|
|
38
|
+
*/
|
|
19
39
|
private readonly compiledTargetScript;
|
|
40
|
+
/**
|
|
41
|
+
* The script tree
|
|
42
|
+
* @private
|
|
43
|
+
*/
|
|
20
44
|
private readonly scriptTree;
|
|
45
|
+
/**
|
|
46
|
+
* The deployment bitcoin generator
|
|
47
|
+
* @private
|
|
48
|
+
*/
|
|
21
49
|
private deploymentGenerator;
|
|
50
|
+
/**
|
|
51
|
+
* The contract seed
|
|
52
|
+
* @private
|
|
53
|
+
*/
|
|
22
54
|
private readonly contractSeed;
|
|
55
|
+
/**
|
|
56
|
+
* The contract bytecode
|
|
57
|
+
* @private
|
|
58
|
+
*/
|
|
23
59
|
private readonly bytecode;
|
|
60
|
+
/**
|
|
61
|
+
* Constructor calldata
|
|
62
|
+
* @private
|
|
63
|
+
*/
|
|
24
64
|
private readonly calldata?;
|
|
65
|
+
/**
|
|
66
|
+
* The contract signer
|
|
67
|
+
* @private
|
|
68
|
+
*/
|
|
25
69
|
private readonly contractSigner;
|
|
70
|
+
/**
|
|
71
|
+
* The contract public key
|
|
72
|
+
* @private
|
|
73
|
+
*/
|
|
26
74
|
private readonly _contractPubKey;
|
|
75
|
+
/**
|
|
76
|
+
* The contract salt random bytes
|
|
77
|
+
* @private
|
|
78
|
+
*/
|
|
27
79
|
private readonly randomBytes;
|
|
28
80
|
private _computedAddress;
|
|
29
81
|
constructor(parameters: IDeploymentParameters);
|
|
82
|
+
/**
|
|
83
|
+
* Get the contract public key
|
|
84
|
+
*/
|
|
30
85
|
get contractPubKey(): string;
|
|
86
|
+
/**
|
|
87
|
+
* @description Get the contract address (PKSH)
|
|
88
|
+
*/
|
|
31
89
|
get contractAddress(): Address;
|
|
90
|
+
/**
|
|
91
|
+
* @description Get the P2TR address
|
|
92
|
+
*/
|
|
32
93
|
get p2trAddress(): string;
|
|
33
|
-
exportCompiledTargetScript():
|
|
34
|
-
|
|
94
|
+
exportCompiledTargetScript(): Uint8Array;
|
|
95
|
+
/**
|
|
96
|
+
* Get the random bytes used for the interaction
|
|
97
|
+
* @returns {Buffer} The random bytes
|
|
98
|
+
*/
|
|
99
|
+
getRndBytes(): Uint8Array;
|
|
100
|
+
/**
|
|
101
|
+
* Get the contract bytecode
|
|
102
|
+
* @returns {Buffer} The contract bytecode
|
|
103
|
+
*/
|
|
35
104
|
getChallenge(): IChallengeSolution;
|
|
36
105
|
getContractAddress(): string;
|
|
37
|
-
|
|
106
|
+
/**
|
|
107
|
+
* Get the contract signer public key
|
|
108
|
+
* @protected
|
|
109
|
+
*/
|
|
110
|
+
protected contractSignerXOnlyPubKey(): Uint8Array;
|
|
111
|
+
/**
|
|
112
|
+
* Build the transaction
|
|
113
|
+
* @protected
|
|
114
|
+
*/
|
|
38
115
|
protected buildTransaction(): Promise<void>;
|
|
39
116
|
protected signInputsWalletBased(transaction: Psbt): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* Sign the inputs
|
|
119
|
+
* @param {Psbt} transaction The transaction to sign
|
|
120
|
+
* @protected
|
|
121
|
+
*/
|
|
40
122
|
protected signInputs(transaction: Psbt): Promise<void>;
|
|
123
|
+
/**
|
|
124
|
+
* Get the tap output
|
|
125
|
+
* @protected
|
|
126
|
+
*/
|
|
41
127
|
protected generateScriptAddress(): P2TRPayment;
|
|
128
|
+
/**
|
|
129
|
+
* Generate the tap data
|
|
130
|
+
* @protected
|
|
131
|
+
*/
|
|
42
132
|
protected generateTapData(): P2TRPayment;
|
|
43
133
|
private generateFeatures;
|
|
44
134
|
private verifyCalldata;
|
|
45
135
|
private verifyBytecode;
|
|
136
|
+
/**
|
|
137
|
+
* Generate the contract seed for the deployment
|
|
138
|
+
* @private
|
|
139
|
+
*/
|
|
46
140
|
private getContractSeed;
|
|
141
|
+
/**
|
|
142
|
+
* Finalize the transaction
|
|
143
|
+
* @param _inputIndex
|
|
144
|
+
* @param input
|
|
145
|
+
*/
|
|
47
146
|
private customFinalizer;
|
|
48
|
-
|
|
147
|
+
/**
|
|
148
|
+
* Generate the redeem scripts
|
|
149
|
+
* @private
|
|
150
|
+
*/
|
|
49
151
|
private generateRedeemScripts;
|
|
152
|
+
/**
|
|
153
|
+
* Get the second leaf script
|
|
154
|
+
* @private
|
|
155
|
+
*/
|
|
50
156
|
private getLeafScript;
|
|
157
|
+
/**
|
|
158
|
+
* Get the script tree
|
|
159
|
+
* @private
|
|
160
|
+
*/
|
|
51
161
|
private getScriptTree;
|
|
52
162
|
}
|
|
163
|
+
//# sourceMappingURL=DeploymentTransaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeploymentTransaction.d.ts","sourceRoot":"","sources":["../../../src/transaction/builders/DeploymentTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,qBAAqB,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