@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
|
@@ -91,7 +91,7 @@ export class FastBigIntMap {
|
|
|
91
91
|
*/
|
|
92
92
|
*entries(): IterableIterator<[bigint, bigint]> {
|
|
93
93
|
for (const key of this.keyOrder) {
|
|
94
|
-
yield [key, this.items[key.toString()]];
|
|
94
|
+
yield [key, this.items[key.toString()] as bigint];
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -107,7 +107,7 @@ export class FastBigIntMap {
|
|
|
107
107
|
*/
|
|
108
108
|
*values(): IterableIterator<bigint> {
|
|
109
109
|
for (const key of this.keyOrder) {
|
|
110
|
-
yield this.items[key.toString()];
|
|
110
|
+
yield this.items[key.toString()] as bigint;
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
|
|
@@ -119,7 +119,7 @@ export class FastBigIntMap {
|
|
|
119
119
|
thisArg?: unknown,
|
|
120
120
|
): void {
|
|
121
121
|
for (const key of this.keyOrder) {
|
|
122
|
-
callback.call(thisArg, this.items[key.toString()], key, this);
|
|
122
|
+
callback.call(thisArg, this.items[key.toString()] as bigint, key, this);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
|
package/test/oldfastmap.test.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
-
import { FastBigIntMap } from './old/FastBigIntMap';
|
|
2
|
+
import { FastBigIntMap } from './old/FastBigIntMap.js';
|
|
3
3
|
|
|
4
4
|
describe('FastBigIntMap - Comprehensive Tests', () => {
|
|
5
5
|
describe('Constructor', () => {
|
|
@@ -634,7 +634,7 @@ describe('FastBigIntMap - Comprehensive Tests', () => {
|
|
|
634
634
|
map.set(2n, 200n);
|
|
635
635
|
|
|
636
636
|
const order: bigint[] = [];
|
|
637
|
-
map.forEach((
|
|
637
|
+
map.forEach((_value: bigint, key: bigint) => {
|
|
638
638
|
order.push(key);
|
|
639
639
|
});
|
|
640
640
|
|
|
@@ -646,7 +646,7 @@ describe('FastBigIntMap - Comprehensive Tests', () => {
|
|
|
646
646
|
const context = { multiplier: 2n };
|
|
647
647
|
|
|
648
648
|
let result: bigint = 0n;
|
|
649
|
-
map.forEach(function (this: { multiplier: bigint }, value) {
|
|
649
|
+
map.forEach(function (this: { multiplier: bigint }, value: bigint) {
|
|
650
650
|
result = value * this.multiplier;
|
|
651
651
|
}, context);
|
|
652
652
|
|
|
@@ -657,7 +657,7 @@ describe('FastBigIntMap - Comprehensive Tests', () => {
|
|
|
657
657
|
const map = new FastBigIntMap([[1n, 100n]]);
|
|
658
658
|
let sum = 0n;
|
|
659
659
|
|
|
660
|
-
map.forEach((value) => {
|
|
660
|
+
map.forEach((value: bigint) => {
|
|
661
661
|
sum += value;
|
|
662
662
|
});
|
|
663
663
|
|
|
@@ -668,7 +668,7 @@ describe('FastBigIntMap - Comprehensive Tests', () => {
|
|
|
668
668
|
const map = new FastBigIntMap([[1n, 100n]]);
|
|
669
669
|
let receivedMap: FastBigIntMap | null = null;
|
|
670
670
|
|
|
671
|
-
map.forEach((
|
|
671
|
+
map.forEach((_value: bigint, _key: bigint, m: FastBigIntMap) => {
|
|
672
672
|
receivedMap = m;
|
|
673
673
|
});
|
|
674
674
|
|
|
@@ -763,7 +763,7 @@ describe('FastBigIntMap - Comprehensive Tests', () => {
|
|
|
763
763
|
const keysFromKeys = [...map.keys()];
|
|
764
764
|
const keysFromEntries = [...map.entries()].map(([k]) => k);
|
|
765
765
|
const keysFromForEach: bigint[] = [];
|
|
766
|
-
map.forEach((_, key) => keysFromForEach.push(key));
|
|
766
|
+
map.forEach((_: bigint, key: bigint) => keysFromForEach.push(key));
|
|
767
767
|
const keysFromIterator = [...map].map(([k]) => k);
|
|
768
768
|
|
|
769
769
|
const expectedOrder = [5n, 1n, 3n, 2n, 4n];
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import { describe, expect, it, beforeAll } from 'vitest';
|
|
2
|
+
import { networks, payments, script, toHex, toXOnly, opcodes } from '@btc-vision/bitcoin';
|
|
3
|
+
import { type UniversalSigner } from '@btc-vision/ecpair';
|
|
4
|
+
import type { QuantumBIP32Interface } from '@btc-vision/bip32';
|
|
5
|
+
import {
|
|
6
|
+
Address,
|
|
7
|
+
CancelTransaction,
|
|
8
|
+
CustomScriptTransaction,
|
|
9
|
+
DeploymentTransaction,
|
|
10
|
+
EcKeyPair,
|
|
11
|
+
FundingTransaction,
|
|
12
|
+
InteractionTransaction,
|
|
13
|
+
MLDSASecurityLevel,
|
|
14
|
+
Mnemonic,
|
|
15
|
+
MultiSignTransaction,
|
|
16
|
+
} from '../build/opnet.js';
|
|
17
|
+
import type { IChallengeSolution, IChallengeVerification, UTXO } from '../build/opnet.js';
|
|
18
|
+
|
|
19
|
+
const network = networks.regtest;
|
|
20
|
+
const testMnemonic =
|
|
21
|
+
'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Helper: create a taproot UTXO for an address
|
|
25
|
+
*/
|
|
26
|
+
function createTaprootUtxo(
|
|
27
|
+
addr: string,
|
|
28
|
+
value: bigint,
|
|
29
|
+
txId: string = '0'.repeat(64),
|
|
30
|
+
index: number = 0,
|
|
31
|
+
): UTXO {
|
|
32
|
+
const p2tr = payments.p2tr({ address: addr, network });
|
|
33
|
+
return {
|
|
34
|
+
transactionId: txId,
|
|
35
|
+
outputIndex: index,
|
|
36
|
+
value,
|
|
37
|
+
scriptPubKey: {
|
|
38
|
+
hex: toHex(p2tr.output as Uint8Array),
|
|
39
|
+
address: addr,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Helper: create a minimal mock IChallengeSolution
|
|
46
|
+
*/
|
|
47
|
+
function createMockChallenge(publicKey: Address): IChallengeSolution {
|
|
48
|
+
const verification: IChallengeVerification = {
|
|
49
|
+
epochHash: new Uint8Array(32),
|
|
50
|
+
epochRoot: new Uint8Array(32),
|
|
51
|
+
targetHash: new Uint8Array(32),
|
|
52
|
+
targetChecksum: new Uint8Array(32),
|
|
53
|
+
startBlock: 0n,
|
|
54
|
+
endBlock: 100n,
|
|
55
|
+
proofs: [],
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
return {
|
|
59
|
+
epochNumber: 1n,
|
|
60
|
+
publicKey,
|
|
61
|
+
solution: new Uint8Array(32),
|
|
62
|
+
salt: new Uint8Array(32),
|
|
63
|
+
graffiti: new Uint8Array(32),
|
|
64
|
+
difficulty: 1,
|
|
65
|
+
verification,
|
|
66
|
+
verifySubmissionSignature: () => true,
|
|
67
|
+
getSubmission: () => undefined,
|
|
68
|
+
toRaw: () => {
|
|
69
|
+
throw new Error('Not implemented in mock');
|
|
70
|
+
},
|
|
71
|
+
verify: () => true,
|
|
72
|
+
toBuffer: () => new Uint8Array(0),
|
|
73
|
+
toHex: () => '',
|
|
74
|
+
calculateSolution: () => new Uint8Array(32),
|
|
75
|
+
checkDifficulty: () => ({ valid: true, difficulty: 1 }),
|
|
76
|
+
getMiningTargetBlock: () => null,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
describe('Transaction Builders - End-to-End', () => {
|
|
81
|
+
let signer: UniversalSigner;
|
|
82
|
+
let taprootAddress: string;
|
|
83
|
+
let walletAddress: Address;
|
|
84
|
+
let quantumRoot: QuantumBIP32Interface;
|
|
85
|
+
|
|
86
|
+
beforeAll(() => {
|
|
87
|
+
const mnemonic = new Mnemonic(
|
|
88
|
+
testMnemonic,
|
|
89
|
+
'',
|
|
90
|
+
network,
|
|
91
|
+
MLDSASecurityLevel.LEVEL2,
|
|
92
|
+
);
|
|
93
|
+
const wallet = mnemonic.derive(0);
|
|
94
|
+
signer = wallet.keypair;
|
|
95
|
+
walletAddress = wallet.address;
|
|
96
|
+
taprootAddress = wallet.p2tr;
|
|
97
|
+
quantumRoot = mnemonic.getQuantumRoot();
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
describe('FundingTransaction', () => {
|
|
101
|
+
it('should build and sign a basic funding transaction', async () => {
|
|
102
|
+
const utxo = createTaprootUtxo(taprootAddress, 100_000n);
|
|
103
|
+
|
|
104
|
+
const tx = new FundingTransaction({
|
|
105
|
+
signer,
|
|
106
|
+
network,
|
|
107
|
+
utxos: [utxo],
|
|
108
|
+
to: taprootAddress,
|
|
109
|
+
amount: 50_000n,
|
|
110
|
+
feeRate: 1,
|
|
111
|
+
priorityFee: 0n,
|
|
112
|
+
gasSatFee: 0n,
|
|
113
|
+
mldsaSigner: null,
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
const signed = await tx.signTransaction();
|
|
117
|
+
|
|
118
|
+
expect(signed.ins.length).toBeGreaterThan(0);
|
|
119
|
+
expect(signed.outs.length).toBeGreaterThan(0);
|
|
120
|
+
expect(signed.toHex()).toBeTruthy();
|
|
121
|
+
expect(signed.virtualSize()).toBeGreaterThan(0);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it('should produce multiple outputs when splitInputsInto > 1', async () => {
|
|
125
|
+
const utxo = createTaprootUtxo(taprootAddress, 200_000n);
|
|
126
|
+
|
|
127
|
+
const tx = new FundingTransaction({
|
|
128
|
+
signer,
|
|
129
|
+
network,
|
|
130
|
+
utxos: [utxo],
|
|
131
|
+
to: taprootAddress,
|
|
132
|
+
amount: 100_000n,
|
|
133
|
+
splitInputsInto: 3,
|
|
134
|
+
feeRate: 1,
|
|
135
|
+
priorityFee: 0n,
|
|
136
|
+
gasSatFee: 0n,
|
|
137
|
+
mldsaSigner: null,
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
const signed = await tx.signTransaction();
|
|
141
|
+
|
|
142
|
+
// 3 split outputs + possible change output
|
|
143
|
+
expect(signed.outs.length).toBeGreaterThanOrEqual(3);
|
|
144
|
+
expect(signed.ins.length).toBeGreaterThan(0);
|
|
145
|
+
expect(signed.toHex()).toBeTruthy();
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
describe('CancelTransaction', () => {
|
|
150
|
+
it('should build and sign a cancel transaction with compiledTargetScript', async () => {
|
|
151
|
+
const utxo = createTaprootUtxo(taprootAddress, 100_000n);
|
|
152
|
+
|
|
153
|
+
// Use script.compile to produce a valid compiled target script
|
|
154
|
+
const compiledTargetScript = script.compile([
|
|
155
|
+
toXOnly(signer.publicKey),
|
|
156
|
+
opcodes.OP_CHECKSIG,
|
|
157
|
+
]);
|
|
158
|
+
|
|
159
|
+
const tx = new CancelTransaction({
|
|
160
|
+
signer,
|
|
161
|
+
network,
|
|
162
|
+
utxos: [utxo],
|
|
163
|
+
compiledTargetScript,
|
|
164
|
+
feeRate: 1,
|
|
165
|
+
mldsaSigner: null,
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
const signed = await tx.signTransaction();
|
|
169
|
+
|
|
170
|
+
expect(signed.ins.length).toBeGreaterThan(0);
|
|
171
|
+
expect(signed.outs.length).toBeGreaterThan(0);
|
|
172
|
+
expect(signed.toHex()).toBeTruthy();
|
|
173
|
+
expect(signed.virtualSize()).toBeGreaterThan(0);
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
describe('CustomScriptTransaction', () => {
|
|
178
|
+
it('should build and sign a custom script transaction', async () => {
|
|
179
|
+
const utxo = createTaprootUtxo(taprootAddress, 100_000n);
|
|
180
|
+
|
|
181
|
+
// Use fixed random bytes so we can compute the contract signer's pubkey
|
|
182
|
+
// and build a script that both signers can sign against.
|
|
183
|
+
const { crypto: bitCrypto } = await import('@btc-vision/bitcoin');
|
|
184
|
+
const fixedRandomBytes = new Uint8Array(32);
|
|
185
|
+
fixedRandomBytes.fill(0x42);
|
|
186
|
+
const contractSeed = bitCrypto.hash256(fixedRandomBytes);
|
|
187
|
+
const contractSigner = EcKeyPair.fromSeedKeyPair(contractSeed, network);
|
|
188
|
+
|
|
189
|
+
// Build a script that includes both pubkeys: [contractPubKey OP_CHECKSIGVERIFY signerXOnly OP_CHECKSIG]
|
|
190
|
+
const contractXOnly = toXOnly(contractSigner.publicKey);
|
|
191
|
+
const signerXOnly = toXOnly(signer.publicKey);
|
|
192
|
+
|
|
193
|
+
const tx = new CustomScriptTransaction({
|
|
194
|
+
signer,
|
|
195
|
+
network,
|
|
196
|
+
utxos: [utxo],
|
|
197
|
+
to: taprootAddress,
|
|
198
|
+
script: [
|
|
199
|
+
contractXOnly,
|
|
200
|
+
new Uint8Array([opcodes.OP_CHECKSIGVERIFY]),
|
|
201
|
+
signerXOnly,
|
|
202
|
+
new Uint8Array([opcodes.OP_CHECKSIG]),
|
|
203
|
+
],
|
|
204
|
+
witnesses: [],
|
|
205
|
+
randomBytes: fixedRandomBytes,
|
|
206
|
+
feeRate: 1,
|
|
207
|
+
priorityFee: 330n,
|
|
208
|
+
gasSatFee: 330n,
|
|
209
|
+
mldsaSigner: null,
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
const signed = await tx.signTransaction();
|
|
213
|
+
|
|
214
|
+
expect(signed.ins.length).toBeGreaterThan(0);
|
|
215
|
+
expect(signed.outs.length).toBeGreaterThan(0);
|
|
216
|
+
expect(signed.toHex()).toBeTruthy();
|
|
217
|
+
expect(signed.virtualSize()).toBeGreaterThan(0);
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
describe('MultiSignTransaction', () => {
|
|
222
|
+
it('should build a multisig transaction and produce valid PSBT', async () => {
|
|
223
|
+
const signer2 = EcKeyPair.generateRandomKeyPair(network);
|
|
224
|
+
const signer3 = EcKeyPair.generateRandomKeyPair(network);
|
|
225
|
+
|
|
226
|
+
const receiver = EcKeyPair.getTaprootAddress(signer2, network);
|
|
227
|
+
const refundVault = EcKeyPair.getTaprootAddress(signer3, network);
|
|
228
|
+
|
|
229
|
+
const pubkeys = [signer.publicKey, signer2.publicKey, signer3.publicKey];
|
|
230
|
+
|
|
231
|
+
const multiSigTx = new MultiSignTransaction({
|
|
232
|
+
network,
|
|
233
|
+
utxos: [createTaprootUtxo(taprootAddress, 100_000n)],
|
|
234
|
+
pubkeys,
|
|
235
|
+
minimumSignatures: 2,
|
|
236
|
+
receiver,
|
|
237
|
+
requestedAmount: 30_000n,
|
|
238
|
+
refundVault,
|
|
239
|
+
feeRate: 1,
|
|
240
|
+
mldsaSigner: null,
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
// signPSBT returns a Psbt (not fully signed since it's multisig)
|
|
244
|
+
const psbt = await multiSigTx.signPSBT();
|
|
245
|
+
|
|
246
|
+
expect(psbt).toBeDefined();
|
|
247
|
+
expect(psbt.data.inputs.length).toBeGreaterThan(0);
|
|
248
|
+
// There should be outputs (refund + receiver)
|
|
249
|
+
expect(psbt.data.outputs.length).toBeGreaterThanOrEqual(2);
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
describe('InteractionTransaction', () => {
|
|
254
|
+
it('should build and sign an interaction transaction', async () => {
|
|
255
|
+
const utxo = createTaprootUtxo(taprootAddress, 100_000n);
|
|
256
|
+
|
|
257
|
+
const challenge = createMockChallenge(walletAddress);
|
|
258
|
+
|
|
259
|
+
// contract is a 32-byte hex string
|
|
260
|
+
const contract = '0x' + '00'.repeat(32);
|
|
261
|
+
|
|
262
|
+
// Let the builder generate the compiled target script from calldata+challenge
|
|
263
|
+
const tx = new InteractionTransaction({
|
|
264
|
+
signer,
|
|
265
|
+
network,
|
|
266
|
+
utxos: [utxo],
|
|
267
|
+
to: taprootAddress,
|
|
268
|
+
calldata: new Uint8Array([0x01, 0x02, 0x03, 0x04]),
|
|
269
|
+
challenge,
|
|
270
|
+
contract,
|
|
271
|
+
feeRate: 1,
|
|
272
|
+
priorityFee: 330n,
|
|
273
|
+
gasSatFee: 330n,
|
|
274
|
+
mldsaSigner: null,
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
const signed = await tx.signTransaction();
|
|
278
|
+
|
|
279
|
+
expect(signed.ins.length).toBeGreaterThan(0);
|
|
280
|
+
expect(signed.outs.length).toBeGreaterThan(0);
|
|
281
|
+
expect(signed.toHex()).toBeTruthy();
|
|
282
|
+
expect(signed.virtualSize()).toBeGreaterThan(0);
|
|
283
|
+
});
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
describe('DeploymentTransaction', () => {
|
|
287
|
+
it('should build and sign a deployment transaction', async () => {
|
|
288
|
+
const utxo = createTaprootUtxo(taprootAddress, 200_000n);
|
|
289
|
+
|
|
290
|
+
const challenge = createMockChallenge(walletAddress);
|
|
291
|
+
|
|
292
|
+
// Minimal bytecode
|
|
293
|
+
const bytecode = new Uint8Array(100);
|
|
294
|
+
bytecode.fill(0xab);
|
|
295
|
+
|
|
296
|
+
// Let the builder generate the compiled target script from bytecode+challenge
|
|
297
|
+
const tx = new DeploymentTransaction({
|
|
298
|
+
signer,
|
|
299
|
+
network,
|
|
300
|
+
utxos: [utxo],
|
|
301
|
+
bytecode,
|
|
302
|
+
challenge,
|
|
303
|
+
feeRate: 1,
|
|
304
|
+
priorityFee: 330n,
|
|
305
|
+
gasSatFee: 330n,
|
|
306
|
+
mldsaSigner: quantumRoot,
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
const signed = await tx.signTransaction();
|
|
310
|
+
|
|
311
|
+
expect(signed.ins.length).toBeGreaterThan(0);
|
|
312
|
+
expect(signed.outs.length).toBeGreaterThan(0);
|
|
313
|
+
expect(signed.toHex()).toBeTruthy();
|
|
314
|
+
expect(signed.virtualSize()).toBeGreaterThan(0);
|
|
315
|
+
|
|
316
|
+
// Deployment should expose contract address
|
|
317
|
+
expect(tx.contractAddress).toBeDefined();
|
|
318
|
+
expect(tx.contractPubKey).toBeDefined();
|
|
319
|
+
});
|
|
320
|
+
});
|
|
321
|
+
});
|
package/tsconfig.base.json
CHANGED
|
@@ -1,27 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"declaration": true,
|
|
4
|
-
"noImplicitAny": true,
|
|
5
|
-
"removeComments": true,
|
|
6
|
-
"suppressImplicitAnyIndexErrors": false,
|
|
7
|
-
"preserveConstEnums": true,
|
|
8
|
-
"resolveJsonModule": true,
|
|
9
|
-
"skipLibCheck": true,
|
|
10
|
-
"sourceMap": false,
|
|
11
|
-
"moduleDetection": "force",
|
|
12
|
-
"experimentalDecorators": true,
|
|
13
|
-
"lib": ["es6", "es2020", "es2021", "es2022", "esnext", "webworker", "dom", "scripthost"],
|
|
14
3
|
"strict": true,
|
|
4
|
+
"noImplicitAny": true,
|
|
15
5
|
"strictNullChecks": true,
|
|
16
6
|
"strictFunctionTypes": true,
|
|
17
7
|
"strictBindCallApply": true,
|
|
18
8
|
"strictPropertyInitialization": true,
|
|
9
|
+
"noImplicitThis": true,
|
|
10
|
+
"useUnknownInCatchVariables": true,
|
|
19
11
|
"alwaysStrict": true,
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
"noUnusedLocals": true,
|
|
13
|
+
"noUnusedParameters": true,
|
|
14
|
+
"exactOptionalPropertyTypes": true,
|
|
15
|
+
"noImplicitReturns": true,
|
|
16
|
+
"noFallthroughCasesInSwitch": true,
|
|
17
|
+
"noUncheckedIndexedAccess": true,
|
|
18
|
+
"noImplicitOverride": true,
|
|
19
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
20
|
+
"module": "ESNext",
|
|
21
|
+
"target": "ESNext",
|
|
22
|
+
"lib": [
|
|
23
|
+
"ESNext",
|
|
24
|
+
"DOM",
|
|
25
|
+
"DOM.Iterable",
|
|
26
|
+
"DOM.AsyncIterable",
|
|
27
|
+
"WebWorker",
|
|
28
|
+
"WebWorker.AsyncIterable",
|
|
29
|
+
"WebWorker.ImportScripts"
|
|
30
|
+
],
|
|
31
|
+
"isolatedModules": true,
|
|
32
|
+
"verbatimModuleSyntax": true,
|
|
33
|
+
"esModuleInterop": true,
|
|
34
|
+
"resolveJsonModule": true,
|
|
35
|
+
"declaration": true,
|
|
36
|
+
"declarationMap": true,
|
|
37
|
+
"sourceMap": true,
|
|
38
|
+
"forceConsistentCasingInFileNames": true,
|
|
39
|
+
"skipLibCheck": true,
|
|
40
|
+
"moduleDetection": "force",
|
|
41
|
+
"incremental": true
|
|
42
|
+
}
|
|
27
43
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
6
|
+
"verbatimModuleSyntax": false,
|
|
7
|
+
"outDir": "./browser",
|
|
8
|
+
"baseUrl": ".",
|
|
9
|
+
"paths": {
|
|
10
|
+
"@btc-vision/transaction": ["node_modules/@btc-vision/transaction"]
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"include": ["src/**/*.ts"],
|
|
14
|
+
"exclude": ["node_modules", "test", "**/*.test.ts", "**/*.spec.ts"]
|
|
15
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "./tsconfig.base.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
-
"module": "
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"outDir": "./build",
|
|
8
|
-
"moduleResolution": "node",
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"allowSyntheticDefaultImports": true
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"outDir": "./build"
|
|
12
7
|
},
|
|
13
8
|
"include": ["src/**/*.ts", "test/**/*.ts"],
|
|
14
9
|
"exclude": ["node_modules"]
|
package/vite.config.browser.ts
CHANGED
|
@@ -41,15 +41,13 @@ export default defineConfig({
|
|
|
41
41
|
chunkFileNames: '[name].js',
|
|
42
42
|
manualChunks: (id) => {
|
|
43
43
|
// BTC Vision packages - keep bitcoin separate as it's large and isolated
|
|
44
|
-
if (id.includes('@btc-vision/bitcoin') || id.includes('/bitcoin/build/') || id.includes('/bitcoin/src/')) {
|
|
44
|
+
if (id.includes('@btc-vision/bitcoin') || id.includes('/bitcoin/build/') || id.includes('/bitcoin/browser/') || id.includes('/bitcoin/src/')) {
|
|
45
45
|
return 'btc-vision-bitcoin';
|
|
46
46
|
}
|
|
47
47
|
if (id.includes('node_modules')) {
|
|
48
48
|
// Noble crypto - isolated, no circular deps
|
|
49
49
|
if (id.includes('@noble/curves')) return 'noble-curves';
|
|
50
50
|
if (id.includes('@noble/hashes')) return 'noble-hashes';
|
|
51
|
-
// Validation - isolated
|
|
52
|
-
if (id.includes('valibot')) return 'valibot';
|
|
53
51
|
// Everything else in vendors to avoid circular deps
|
|
54
52
|
return 'vendors';
|
|
55
53
|
}
|
|
@@ -64,8 +62,8 @@ export default defineConfig({
|
|
|
64
62
|
vm: resolve(__dirname, 'src/shims/vm-browser.js'),
|
|
65
63
|
stream: 'stream-browserify',
|
|
66
64
|
buffer: 'buffer',
|
|
67
|
-
|
|
68
|
-
'@btc-vision/bitcoin': resolve(__dirname, 'node_modules/@btc-vision/bitcoin/
|
|
65
|
+
'@btc-vision/bitcoin/workers': resolve(__dirname, 'node_modules/@btc-vision/bitcoin/browser/workers/index.js'),
|
|
66
|
+
'@btc-vision/bitcoin': resolve(__dirname, 'node_modules/@btc-vision/bitcoin/browser/index.js'),
|
|
69
67
|
'@btc-vision/bip32': resolve(__dirname, 'node_modules/@btc-vision/bip32/src/cjs/index.cjs'),
|
|
70
68
|
},
|
|
71
69
|
mainFields: ['module', 'main'],
|
|
@@ -86,6 +84,7 @@ export default defineConfig({
|
|
|
86
84
|
exclude: ['crypto', 'fs', 'path', 'os', 'http', 'https', 'net', 'tls', 'dns', 'child_process', 'cluster', 'dgram', 'readline', 'repl', 'tty', 'worker_threads', 'perf_hooks', 'inspector', 'async_hooks', 'trace_events', 'v8', 'wasi', 'zlib', 'vm'],
|
|
87
85
|
}),
|
|
88
86
|
dts({
|
|
87
|
+
tsconfigPath: resolve(__dirname, 'tsconfig.browser.json'),
|
|
89
88
|
outDir: 'browser',
|
|
90
89
|
include: ['src/**/*.ts'],
|
|
91
90
|
exclude: ['src/**/*.test.ts', 'src/**/*.spec.ts'],
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { resolve } from 'path';
|
|
2
|
+
import { defineConfig } from 'vitest/config';
|
|
3
|
+
import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
|
4
|
+
import { playwright } from '@vitest/browser-playwright';
|
|
5
|
+
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
resolve: {
|
|
8
|
+
alias: {
|
|
9
|
+
crypto: resolve(__dirname, 'src/crypto/crypto-browser.js'),
|
|
10
|
+
zlib: resolve(__dirname, 'src/shims/zlib-browser.js'),
|
|
11
|
+
vm: resolve(__dirname, 'src/shims/vm-browser.js'),
|
|
12
|
+
stream: 'stream-browserify',
|
|
13
|
+
buffer: 'buffer',
|
|
14
|
+
'@btc-vision/bitcoin/workers': resolve(__dirname, 'node_modules/@btc-vision/bitcoin/browser/workers/index.js'),
|
|
15
|
+
'@btc-vision/bitcoin': resolve(__dirname, 'node_modules/@btc-vision/bitcoin/browser/index.js'),
|
|
16
|
+
'@btc-vision/bip32': resolve(__dirname, 'node_modules/@btc-vision/bip32/src/cjs/index.cjs'),
|
|
17
|
+
'../build/opnet.js': resolve(__dirname, 'src/opnet.ts'),
|
|
18
|
+
'../../build/opnet.js': resolve(__dirname, 'src/opnet.ts'),
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
plugins: [
|
|
22
|
+
nodePolyfills({
|
|
23
|
+
globals: {
|
|
24
|
+
Buffer: true,
|
|
25
|
+
global: true,
|
|
26
|
+
process: true,
|
|
27
|
+
},
|
|
28
|
+
exclude: ['crypto', 'fs', 'path', 'os', 'http', 'https', 'net', 'tls', 'dns', 'child_process', 'cluster', 'dgram', 'readline', 'repl', 'tty', 'worker_threads', 'perf_hooks', 'inspector', 'async_hooks', 'trace_events', 'v8', 'wasi', 'zlib', 'vm'],
|
|
29
|
+
}),
|
|
30
|
+
],
|
|
31
|
+
test: {
|
|
32
|
+
globals: true,
|
|
33
|
+
include: [
|
|
34
|
+
// Browser-compatible existing tests (pure logic, no Node.js crypto)
|
|
35
|
+
'test/address.test.ts',
|
|
36
|
+
'test/addressmap.test.ts',
|
|
37
|
+
'test/address-rotation.test.ts',
|
|
38
|
+
'test/addressverificator-mldsa.test.ts',
|
|
39
|
+
'test/binary-reader-writer.test.ts',
|
|
40
|
+
'test/buffer-helper.test.ts',
|
|
41
|
+
'test/derivePath.test.ts',
|
|
42
|
+
'test/disposable.test.ts',
|
|
43
|
+
'test/fastmap.test.ts',
|
|
44
|
+
'test/fastmap-setall.test.ts',
|
|
45
|
+
'test/messagesigner-mldsa.test.ts',
|
|
46
|
+
'test/messagesigner-schnorr.test.ts',
|
|
47
|
+
'test/network-awareness.test.ts',
|
|
48
|
+
'test/oldfastmap.test.ts',
|
|
49
|
+
'test/transaction-builders.test.ts',
|
|
50
|
+
// Browser-adapted versions
|
|
51
|
+
'test/browser/offline-transaction.test.ts',
|
|
52
|
+
'test/browser/transaction-signing.test.ts',
|
|
53
|
+
'test/browser/parallel-signing.test.ts',
|
|
54
|
+
],
|
|
55
|
+
exclude: [
|
|
56
|
+
// Original uses import { createHash } from 'crypto'
|
|
57
|
+
'test/offline-transaction.test.ts',
|
|
58
|
+
],
|
|
59
|
+
testTimeout: 30000,
|
|
60
|
+
browser: {
|
|
61
|
+
enabled: true,
|
|
62
|
+
provider: playwright(),
|
|
63
|
+
instances: [{ browser: 'chromium' }],
|
|
64
|
+
headless: true,
|
|
65
|
+
screenshotFailures: false,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
});
|
package/vitest.config.ts
CHANGED