@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TapscriptVerificator.js","sourceRoot":"","sources":["../../src/verification/TapscriptVerificator.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,MAAM,EACN,MAAM,IAAI,SAAS,EACnB,MAAM,EAEN,QAAQ,EACR,OAAO,EAGP,QAAQ,EAER,MAAM,EAGN,OAAO,GACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AAEpF,OAAO,EAAgB,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAoBnE,MAAM,OAAO,oBAAoB;IACrB,MAAM,CAAU,kBAAkB,GAAW,GAAG,CAAC;IAElD,MAAM,CAAC,kBAAkB,CAC5B,MAAyC;QAEzC,MAAM,EAAE,UAAU,EAAE,GAAG,oBAAoB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAEpE,OAAO,oBAAoB,CAAC,yBAAyB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC9E,CAAC;IAEM,MAAM,CAAC,kBAAkB,CAC5B,MAAyC,EACzC,YAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,oBAAoB,EAAE,OAAO,EAAE,GAC/C,oBAAoB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAEjD,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC;YAC1B,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC;YAC9C,OAAO,EAAE,OAAO;YAChB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE;gBACJ,MAAM,EAAE,oBAA8B;gBACtC,aAAa,EAAE,oBAAoB,CAAC,kBAAkB;aACzD;SACJ,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAChC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnC,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,MAAM,oBAAoB,GAAe,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAe,CAAC;QACnF,OAAO,MAAM,CAAC,oBAAoB,EAAE,YAAY,CAAC,CAAC;IACtD,CAAC;IAEM,MAAM,CAAC,eAAe,CACzB,cAA0B,EAC1B,QAAoB,EACpB,QAAoB;QAEpB,MAAM,gBAAgB,GAAe,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjE,MAAM,GAAG,GAAe,MAAM,CAAC,CAAC,cAAc,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC;QAC7E,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC;IAEM,MAAM,CAAC,yBAAyB,CACnC,MAAyC,EACzC,UAAmB;QAEnB,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC;QACnD,MAAM,eAAe,GAA8B;YAC/C,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC;YAC9C,OAAO,EAAE,OAAO;YAChB,UAAU,EAAE,UAAU;SACzB,CAAC;QACF,MAAM,EAAE,GAAY,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACnD,OAAO,EAAE,CAAC,OAAO,CAAC;IACtB,CAAC;IAEO,MAAM,CAAC,eAAe,CAC1B,MAAyC;QAEzC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC;QACnD,MAAM,aAAa,GAAwB,IAAI,mBAAmB,CAC9D,MAAM,CAAC,cAAc,EACrB,OAAO,CAAC,MAAM,CAAC,kBAA+B,CAAC,EAC/C,OAAO,CACV,CAAC;QAEF,MAAM,oBAAoB,GAAe,aAAa,CAAC,OAAO,CAC1D,MAAM,CAAC,QAAQ,EACf,MAAM,CAAC,YAAY,EACnB,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,QAAQ,EACf,MAAM,CAAC,QAAQ,CAClB,CAAC;QAEF,MAAM,cAAc,GAAW,MAAM,CAAC,OAAO,CAAC;YAC1C,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC;YAC9B,OAAO,CAAC,WAAW;SACtB,CAAC,CAAC;QAEH,MAAM,UAAU,GAAY;YACxB;gBACI,MAAM,EAAE,oBAAoB;gBAC5B,OAAO,EAAE,oBAAoB,CAAC,kBAAkB;aACnD;YACD;gBACI,MAAM,EAAE,cAAc;gBACtB,OAAO,EAAE,oBAAoB,CAAC,kBAAkB;aACnD;SACJ,CAAC;QAEF,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,OAAO,EAAE,CAAC;IACzD,CAAC"}
|
package/eslint.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@btc-vision/transaction",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.8.0-beta.
|
|
4
|
+
"version": "1.8.0-beta.5",
|
|
5
5
|
"author": "BlobMaster41",
|
|
6
6
|
"description": "OPNet transaction library allows you to create and sign transactions for the OPNet network.",
|
|
7
7
|
"engines": {
|
|
@@ -62,11 +62,6 @@
|
|
|
62
62
|
"require": "./browser/btc-vision-logger.js",
|
|
63
63
|
"default": "./browser/btc-vision-logger.js"
|
|
64
64
|
},
|
|
65
|
-
"./browser/valibot": {
|
|
66
|
-
"import": "./browser/valibot.js",
|
|
67
|
-
"require": "./browser/valibot.js",
|
|
68
|
-
"default": "./browser/valibot.js"
|
|
69
|
-
},
|
|
70
65
|
"./browser/pako": {
|
|
71
66
|
"import": "./browser/pako.js",
|
|
72
67
|
"require": "./browser/pako.js",
|
|
@@ -141,6 +136,8 @@
|
|
|
141
136
|
"browserBuild": "vite build --config vite.config.browser.ts",
|
|
142
137
|
"docs": "typedoc --out docs --exclude 'src/tests/*.ts' --tsconfig tsconfig.json --readme README.md --name OPNet --plugin typedoc-material-theme --themeColor '#cb9820' --exclude src/tests/test.ts --exclude src/index.ts src",
|
|
143
138
|
"test": "npm run build && vitest run",
|
|
139
|
+
"test:browser": "vitest run --config vitest.config.browser.ts",
|
|
140
|
+
"test:browser:watch": "vitest --config vitest.config.browser.ts",
|
|
144
141
|
"test:watch": "npm run build && vitest",
|
|
145
142
|
"test:ui": "npm run build && vitest --ui",
|
|
146
143
|
"test:coverage": "npm run build && vitest run --coverage",
|
|
@@ -148,60 +145,40 @@
|
|
|
148
145
|
"prebuild": "npm run check:circular"
|
|
149
146
|
},
|
|
150
147
|
"devDependencies": {
|
|
151
|
-
"@
|
|
152
|
-
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
153
|
-
"@babel/plugin-transform-runtime": "^7.28.5",
|
|
154
|
-
"@babel/preset-env": "^7.28.6",
|
|
155
|
-
"@babel/preset-flow": "^7.27.1",
|
|
156
|
-
"@babel/preset-react": "^7.28.5",
|
|
157
|
-
"@babel/preset-typescript": "^7.28.5",
|
|
158
|
-
"@rollup/plugin-typescript": "^12.3.0",
|
|
159
|
-
"@types/node": "^25.0.10",
|
|
148
|
+
"@types/node": "^25.1.0",
|
|
160
149
|
"@types/sha.js": "^2.4.4",
|
|
161
|
-
"@
|
|
150
|
+
"@vitest/browser": "^4.0.18",
|
|
151
|
+
"@vitest/browser-playwright": "^4.0.18",
|
|
162
152
|
"@vitest/ui": "^4.0.18",
|
|
163
153
|
"eslint": "^9.39.2",
|
|
164
|
-
"https-browserify": "^1.0.0",
|
|
165
154
|
"madge": "^8.0.0",
|
|
166
|
-
"
|
|
155
|
+
"playwright": "^1.58.0",
|
|
167
156
|
"prettier": "^3.8.1",
|
|
168
157
|
"stream-browserify": "^3.0.0",
|
|
169
|
-
"stream-http": "^3.2.0",
|
|
170
|
-
"tslib": "^2.8.1",
|
|
171
158
|
"typedoc": "^0.28.16",
|
|
172
|
-
"typescript-eslint": "^8.
|
|
159
|
+
"typescript-eslint": "^8.54.0",
|
|
173
160
|
"vite": "^7.3.1",
|
|
174
161
|
"vite-plugin-dts": "^4.5.4",
|
|
175
162
|
"vite-plugin-node-polyfills": "^0.25.0",
|
|
176
163
|
"vitest": "^4.0.18"
|
|
177
164
|
},
|
|
178
165
|
"dependencies": {
|
|
179
|
-
"@
|
|
180
|
-
"@
|
|
181
|
-
"@btc-vision/bip32": "^6.1.0",
|
|
182
|
-
"@btc-vision/bitcoin": "^6.5.6",
|
|
166
|
+
"@btc-vision/bip32": "^7.0.2",
|
|
167
|
+
"@btc-vision/bitcoin": "^7.0.0-alpha.6",
|
|
183
168
|
"@btc-vision/bitcoin-rpc": "^1.0.6",
|
|
169
|
+
"@btc-vision/ecpair": "^4.0.2",
|
|
184
170
|
"@btc-vision/logger": "^1.0.8",
|
|
185
171
|
"@btc-vision/post-quantum": "^0.5.3",
|
|
186
172
|
"@eslint/js": "^9.39.2",
|
|
187
173
|
"@noble/curves": "^2.0.1",
|
|
188
|
-
"@noble/secp256k1": "^3.0.0",
|
|
189
|
-
"assert": "^2.1.0",
|
|
190
|
-
"babel-loader": "^10.0.0",
|
|
191
|
-
"babel-plugin-transform-import-meta": "^2.3.3",
|
|
192
|
-
"babel-preset-react": "^6.24.1",
|
|
193
|
-
"babelify": "^10.0.0",
|
|
194
174
|
"bech32": "^2.0.0",
|
|
195
|
-
"bip174": "^
|
|
175
|
+
"bip174": "^3.0.0",
|
|
196
176
|
"bip39": "^3.1.0",
|
|
197
177
|
"browserify-zlib": "^0.2.0",
|
|
198
178
|
"buffer": "^6.0.3",
|
|
199
|
-
"ecpair": "^2.1.0",
|
|
200
179
|
"pako": "^2.1.0",
|
|
201
180
|
"process": "^0.11.10",
|
|
202
181
|
"sha.js": "^2.4.12",
|
|
203
|
-
"ts-loader": "^9.5.4",
|
|
204
|
-
"ts-node": "^10.9.2",
|
|
205
182
|
"typescript": "^5.9.3"
|
|
206
183
|
}
|
|
207
184
|
}
|
package/src/abi/ABICoder.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import shajs from 'sha.js';
|
|
2
2
|
|
|
3
3
|
import { BinaryReader } from '../buffer/BinaryReader.js';
|
|
4
|
-
import { BufferHelper } from '../utils/BufferHelper.js';
|
|
5
|
-
|
|
6
4
|
export enum ABIDataTypes {
|
|
7
5
|
// Unsigned integers
|
|
8
6
|
UINT8 = 'UINT8',
|
|
@@ -171,17 +169,6 @@ export class ABICoder {
|
|
|
171
169
|
return selector.toString(16);
|
|
172
170
|
}
|
|
173
171
|
|
|
174
|
-
private bigIntToUint8Array(bigIntValue: bigint, length: number): Uint8Array {
|
|
175
|
-
const byteArray = new Uint8Array(length);
|
|
176
|
-
const buf = BufferHelper.valueToUint8Array(bigIntValue);
|
|
177
|
-
|
|
178
|
-
for (let i = 0; i < length; i++) {
|
|
179
|
-
byteArray[i] = buf[i] || 0;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
return byteArray;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
172
|
private sha256(buffer: Buffer | string | Uint8Array): Buffer {
|
|
186
173
|
return new shajs.sha256().update(buffer).digest();
|
|
187
174
|
}
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
U64_BYTE_LENGTH,
|
|
18
18
|
U8_BYTE_LENGTH,
|
|
19
19
|
} from '../utils/lengths.js';
|
|
20
|
-
import { BufferLike, i16, i32, i64, i8, Selector, u16, u32, u8 } from '../utils/types.js';
|
|
20
|
+
import type { BufferLike, i16, i32, i64, i8, Selector, u16, u32, u8 } from '../utils/types.js';
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Represents a Schnorr signature paired with the signer's Address.
|
|
@@ -40,6 +40,10 @@ export class BinaryReader {
|
|
|
40
40
|
this.buffer = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
public get byteLength(): number {
|
|
44
|
+
return this.buffer.byteLength;
|
|
45
|
+
}
|
|
46
|
+
|
|
43
47
|
// Helpers for comparisons; unchanged
|
|
44
48
|
public static stringCompare(a: string, b: string): number {
|
|
45
49
|
return a.localeCompare(b);
|
|
@@ -62,10 +66,6 @@ export class BinaryReader {
|
|
|
62
66
|
this.currentOffset = 0;
|
|
63
67
|
}
|
|
64
68
|
|
|
65
|
-
public get byteLength(): number {
|
|
66
|
-
return this.buffer.byteLength;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
69
|
public length(): number {
|
|
70
70
|
return this.buffer.byteLength;
|
|
71
71
|
}
|
|
@@ -207,7 +207,7 @@ export class BinaryReader {
|
|
|
207
207
|
|
|
208
208
|
// If the top bit is set (sign bit in big-endian), interpret negative
|
|
209
209
|
const signBitMask = 0x80;
|
|
210
|
-
if (bytes[0] & signBitMask) {
|
|
210
|
+
if ((bytes[0] as number) & signBitMask) {
|
|
211
211
|
// (1 << 128)
|
|
212
212
|
const twoTo128 = BigInt(1) << BigInt(128);
|
|
213
213
|
// 2's complement
|
|
@@ -512,7 +512,7 @@ export class BinaryReader {
|
|
|
512
512
|
private reverseBytes(bytes: Uint8Array): Uint8Array {
|
|
513
513
|
const out = new Uint8Array(bytes.length);
|
|
514
514
|
for (let i = 0; i < bytes.length; i++) {
|
|
515
|
-
out[i] = bytes[bytes.length - 1 - i];
|
|
515
|
+
out[i] = bytes[bytes.length - 1 - i] as number;
|
|
516
516
|
}
|
|
517
517
|
return out;
|
|
518
518
|
}
|
|
@@ -18,10 +18,10 @@ import {
|
|
|
18
18
|
U64_BYTE_LENGTH,
|
|
19
19
|
U8_BYTE_LENGTH,
|
|
20
20
|
} from '../utils/lengths.js';
|
|
21
|
-
import { i16, i32, i64, i8, Selector, u16, u32, u64, u8 } from '../utils/types.js';
|
|
21
|
+
import type { i16, i32, i64, i8, Selector, u16, u32, u64, u8 } from '../utils/types.js';
|
|
22
22
|
import { BinaryReader } from './BinaryReader.js';
|
|
23
23
|
|
|
24
|
-
export class BinaryWriter {
|
|
24
|
+
export class BinaryWriter implements Disposable {
|
|
25
25
|
private currentOffset: u32 = 0;
|
|
26
26
|
private buffer: DataView;
|
|
27
27
|
|
|
@@ -34,7 +34,7 @@ export class BinaryWriter {
|
|
|
34
34
|
let totalLength: u32 = U16_BYTE_LENGTH;
|
|
35
35
|
|
|
36
36
|
for (let i = 0; i < values.length; i++) {
|
|
37
|
-
totalLength += U32_BYTE_LENGTH + values[i].length; // each entry has a u32 length prefix
|
|
37
|
+
totalLength += U32_BYTE_LENGTH + (values[i] as Uint8Array).length; // each entry has a u32 length prefix
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
return totalLength;
|
|
@@ -99,7 +99,8 @@ export class BinaryWriter {
|
|
|
99
99
|
* Writes a signed 32-bit integer. By default big-endian (be = true).
|
|
100
100
|
*/
|
|
101
101
|
public writeI32(value: i32, be: boolean = true): void {
|
|
102
|
-
if (value < -2147483648 || value > 2147483647)
|
|
102
|
+
if (value < -2147483648 || value > 2147483647)
|
|
103
|
+
throw new Error('i32 value is out of range.');
|
|
103
104
|
|
|
104
105
|
this.allocSafe(I32_BYTE_LENGTH);
|
|
105
106
|
this.buffer.setInt32(this.currentOffset, value, !be);
|
|
@@ -146,11 +147,11 @@ export class BinaryWriter {
|
|
|
146
147
|
|
|
147
148
|
if (be) {
|
|
148
149
|
for (let i = 0; i < bytesToHex.byteLength; i++) {
|
|
149
|
-
this.writeU8(bytesToHex[i]);
|
|
150
|
+
this.writeU8(bytesToHex[i] as number);
|
|
150
151
|
}
|
|
151
152
|
} else {
|
|
152
153
|
for (let i = bytesToHex.byteLength - 1; i >= 0; i--) {
|
|
153
|
-
this.writeU8(bytesToHex[i]);
|
|
154
|
+
this.writeU8(bytesToHex[i] as number);
|
|
154
155
|
}
|
|
155
156
|
}
|
|
156
157
|
}
|
|
@@ -173,11 +174,11 @@ export class BinaryWriter {
|
|
|
173
174
|
|
|
174
175
|
if (be) {
|
|
175
176
|
for (let i = 0; i < bytesToHex.byteLength; i++) {
|
|
176
|
-
this.writeU8(bytesToHex[i]);
|
|
177
|
+
this.writeU8(bytesToHex[i] as number);
|
|
177
178
|
}
|
|
178
179
|
} else {
|
|
179
180
|
for (let i = bytesToHex.byteLength - 1; i >= 0; i--) {
|
|
180
|
-
this.writeU8(bytesToHex[i]);
|
|
181
|
+
this.writeU8(bytesToHex[i] as number);
|
|
181
182
|
}
|
|
182
183
|
}
|
|
183
184
|
}
|
|
@@ -196,11 +197,11 @@ export class BinaryWriter {
|
|
|
196
197
|
|
|
197
198
|
if (be) {
|
|
198
199
|
for (let i = 0; i < bytesToHex.byteLength; i++) {
|
|
199
|
-
this.writeU8(bytesToHex[i]);
|
|
200
|
+
this.writeU8(bytesToHex[i] as number);
|
|
200
201
|
}
|
|
201
202
|
} else {
|
|
202
203
|
for (let i = bytesToHex.byteLength - 1; i >= 0; i--) {
|
|
203
|
-
this.writeU8(bytesToHex[i]);
|
|
204
|
+
this.writeU8(bytesToHex[i] as number);
|
|
204
205
|
}
|
|
205
206
|
}
|
|
206
207
|
}
|
|
@@ -209,7 +210,7 @@ export class BinaryWriter {
|
|
|
209
210
|
this.allocSafe(value.byteLength);
|
|
210
211
|
|
|
211
212
|
for (let i = 0; i < value.byteLength; i++) {
|
|
212
|
-
this.writeU8(value[i]);
|
|
213
|
+
this.writeU8(value[i] as number);
|
|
213
214
|
}
|
|
214
215
|
}
|
|
215
216
|
|
|
@@ -322,6 +323,10 @@ export class BinaryWriter {
|
|
|
322
323
|
this.buffer = this.getDefaultBuffer();
|
|
323
324
|
}
|
|
324
325
|
|
|
326
|
+
public [Symbol.dispose](): void {
|
|
327
|
+
this.clear();
|
|
328
|
+
}
|
|
329
|
+
|
|
325
330
|
public allocSafe(size: u32): void {
|
|
326
331
|
if (this.currentOffset + size > this.buffer.byteLength) {
|
|
327
332
|
this.resize(size);
|
|
@@ -335,7 +340,7 @@ export class BinaryWriter {
|
|
|
335
340
|
|
|
336
341
|
const keys = Array.from(map.keys());
|
|
337
342
|
for (let i = 0; i < keys.length; i++) {
|
|
338
|
-
const key = keys[i];
|
|
343
|
+
const key = keys[i] as Address;
|
|
339
344
|
const value = map.get(key);
|
|
340
345
|
|
|
341
346
|
if (value === null || value === undefined) throw new Error('Value not found');
|
|
@@ -374,8 +379,8 @@ export class BinaryWriter {
|
|
|
374
379
|
this.writeU16(values.length, be);
|
|
375
380
|
|
|
376
381
|
for (let i = 0; i < values.length; i++) {
|
|
377
|
-
this.writeU32(values[i].length, be);
|
|
378
|
-
this.writeBytes(values[i]);
|
|
382
|
+
this.writeU32((values[i] as Uint8Array).length, be);
|
|
383
|
+
this.writeBytes(values[i] as Uint8Array);
|
|
379
384
|
}
|
|
380
385
|
}
|
|
381
386
|
|
|
@@ -385,7 +390,7 @@ export class BinaryWriter {
|
|
|
385
390
|
this.writeU16(value.length);
|
|
386
391
|
|
|
387
392
|
for (let i = 0; i < value.length; i++) {
|
|
388
|
-
this.writeAddress(value[i]);
|
|
393
|
+
this.writeAddress(value[i] as Address);
|
|
389
394
|
}
|
|
390
395
|
}
|
|
391
396
|
|
|
@@ -400,7 +405,7 @@ export class BinaryWriter {
|
|
|
400
405
|
this.writeU16(value.length);
|
|
401
406
|
|
|
402
407
|
for (let i = 0; i < value.length; i++) {
|
|
403
|
-
this.writeExtendedAddress(value[i]);
|
|
408
|
+
this.writeExtendedAddress(value[i] as Address);
|
|
404
409
|
}
|
|
405
410
|
}
|
|
406
411
|
|
|
@@ -410,7 +415,7 @@ export class BinaryWriter {
|
|
|
410
415
|
this.writeU16(value.length, be);
|
|
411
416
|
|
|
412
417
|
for (let i = 0; i < value.length; i++) {
|
|
413
|
-
this.writeU32(value[i], be);
|
|
418
|
+
this.writeU32(value[i] as u32, be);
|
|
414
419
|
}
|
|
415
420
|
}
|
|
416
421
|
|
|
@@ -420,7 +425,7 @@ export class BinaryWriter {
|
|
|
420
425
|
this.writeU16(value.length, be);
|
|
421
426
|
|
|
422
427
|
for (let i = 0; i < value.length; i++) {
|
|
423
|
-
this.writeU256(value[i], be);
|
|
428
|
+
this.writeU256(value[i] as bigint, be);
|
|
424
429
|
}
|
|
425
430
|
}
|
|
426
431
|
|
|
@@ -429,7 +434,7 @@ export class BinaryWriter {
|
|
|
429
434
|
|
|
430
435
|
this.writeU16(value.length, be);
|
|
431
436
|
for (let i = 0; i < value.length; i++) {
|
|
432
|
-
this.writeU128(value[i], be);
|
|
437
|
+
this.writeU128(value[i] as bigint, be);
|
|
433
438
|
}
|
|
434
439
|
}
|
|
435
440
|
|
|
@@ -439,7 +444,7 @@ export class BinaryWriter {
|
|
|
439
444
|
this.writeU16(value.length);
|
|
440
445
|
|
|
441
446
|
for (let i = 0; i < value.length; i++) {
|
|
442
|
-
this.writeStringWithLength(value[i]);
|
|
447
|
+
this.writeStringWithLength(value[i] as string);
|
|
443
448
|
}
|
|
444
449
|
}
|
|
445
450
|
|
|
@@ -449,7 +454,7 @@ export class BinaryWriter {
|
|
|
449
454
|
this.writeU16(value.length, be);
|
|
450
455
|
|
|
451
456
|
for (let i = 0; i < value.length; i++) {
|
|
452
|
-
this.writeU16(value[i], be);
|
|
457
|
+
this.writeU16(value[i] as u16, be);
|
|
453
458
|
}
|
|
454
459
|
}
|
|
455
460
|
|
|
@@ -459,7 +464,7 @@ export class BinaryWriter {
|
|
|
459
464
|
this.writeU16(value.length);
|
|
460
465
|
|
|
461
466
|
for (let i = 0; i < value.length; i++) {
|
|
462
|
-
this.writeU8(value[i]);
|
|
467
|
+
this.writeU8(value[i] as u8);
|
|
463
468
|
}
|
|
464
469
|
}
|
|
465
470
|
|
|
@@ -469,7 +474,7 @@ export class BinaryWriter {
|
|
|
469
474
|
this.writeU16(value.length, be);
|
|
470
475
|
|
|
471
476
|
for (let i = 0; i < value.length; i++) {
|
|
472
|
-
this.writeU64(value[i], be);
|
|
477
|
+
this.writeU64(value[i] as bigint, be);
|
|
473
478
|
}
|
|
474
479
|
}
|
|
475
480
|
|
|
@@ -479,7 +484,7 @@ export class BinaryWriter {
|
|
|
479
484
|
this.writeU16(value.length);
|
|
480
485
|
|
|
481
486
|
for (let i = 0; i < value.length; i++) {
|
|
482
|
-
this.writeBytesWithLength(value[i]);
|
|
487
|
+
this.writeBytesWithLength(value[i] as Uint8Array);
|
|
483
488
|
}
|
|
484
489
|
}
|
|
485
490
|
|
package/src/chain/ChainData.ts
CHANGED
|
@@ -1,32 +1,39 @@
|
|
|
1
|
-
import { Network, networks } from '@btc-vision/bitcoin';
|
|
1
|
+
import { type Network, networks } from '@btc-vision/bitcoin';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
3
|
+
const CHAIN_IDS: ReadonlyMap<Network, Uint8Array> = new Map([
|
|
4
|
+
[
|
|
5
|
+
networks.bitcoin,
|
|
6
|
+
new Uint8Array([
|
|
7
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0xd6, 0x68, 0x9c, 0x08, 0x5a, 0xe1, 0x65, 0x83,
|
|
8
|
+
0x1e, 0x93, 0x4f, 0xf7, 0x63, 0xae, 0x46, 0xa2, 0xa6, 0xc1, 0x72, 0xb3, 0xf1, 0xb6,
|
|
9
|
+
0x0a, 0x8c, 0xe2, 0x6f,
|
|
10
|
+
]),
|
|
11
|
+
],
|
|
12
|
+
[
|
|
13
|
+
networks.testnet,
|
|
14
|
+
new Uint8Array([
|
|
15
|
+
0x00, 0x00, 0x00, 0x00, 0x09, 0x33, 0xea, 0x01, 0xad, 0x0e, 0xe9, 0x84, 0x20, 0x97,
|
|
16
|
+
0x79, 0xba, 0xae, 0xc3, 0xce, 0xd9, 0x0f, 0xa3, 0xf4, 0x08, 0x71, 0x95, 0x26, 0xf8,
|
|
17
|
+
0xd7, 0x7f, 0x49, 0x43,
|
|
18
|
+
]),
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
networks.regtest,
|
|
22
|
+
new Uint8Array([
|
|
23
|
+
0x0f, 0x91, 0x88, 0xf1, 0x3c, 0xb7, 0xb2, 0xc7, 0x1f, 0x2a, 0x33, 0x5e, 0x3a, 0x4f,
|
|
24
|
+
0xc3, 0x28, 0xbf, 0x5b, 0xeb, 0x43, 0x60, 0x12, 0xaf, 0xca, 0x59, 0x0b, 0x1a, 0x11,
|
|
25
|
+
0x46, 0x6e, 0x22, 0x06,
|
|
26
|
+
]),
|
|
27
|
+
],
|
|
28
|
+
]);
|
|
22
29
|
|
|
23
30
|
export function getChainId(network: Network): Uint8Array {
|
|
24
|
-
|
|
31
|
+
const chainId = CHAIN_IDS.get(network);
|
|
32
|
+
if (!chainId) throw new Error('Unsupported network for chain ID retrieval');
|
|
33
|
+
return chainId.slice();
|
|
25
34
|
}
|
|
26
35
|
|
|
27
|
-
export const BITCOIN_PROTOCOL_ID = Uint8Array
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
),
|
|
32
|
-
);
|
|
36
|
+
export const BITCOIN_PROTOCOL_ID = new Uint8Array([
|
|
37
|
+
0xe7, 0x84, 0x99, 0x5a, 0x41, 0x2d, 0x77, 0x39, 0x88, 0xc4, 0xb8, 0xe3, 0x33, 0xd7, 0xb3, 0x9d,
|
|
38
|
+
0xfb, 0x3c, 0xab, 0xf1, 0x18, 0xd0, 0xd6, 0x45, 0x41, 0x1a, 0x91, 0x6c, 0xa2, 0x40, 0x79, 0x39,
|
|
39
|
+
]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Consensus } from './Consensus.js';
|
|
2
|
-
import { ConsensusConfig } from './IConsensusConfig.js';
|
|
2
|
+
import type { ConsensusConfig } from './IConsensusConfig.js';
|
|
3
3
|
import { RoswellConsensus } from './metadata/RoswellConsensus.js';
|
|
4
4
|
|
|
5
5
|
export const OPNetConsensusConfig: { [key in Consensus]?: ConsensusConfig<key> } = {
|
|
@@ -9,21 +9,4 @@ export interface ConsensusConfig<T extends Consensus> {
|
|
|
9
9
|
|
|
10
10
|
// The block height at which this consensus was enabled.
|
|
11
11
|
readonly ENABLED_AT_BLOCK: bigint;
|
|
12
|
-
|
|
13
|
-
/** WBTC vaults */
|
|
14
|
-
// Defines the minimum amount that can be consolidated in a single transaction.
|
|
15
|
-
//readonly VAULT_MINIMUM_AMOUNT: bigint;
|
|
16
|
-
|
|
17
|
-
// Defines the requested minimum acceptance for joining UTXOs when an unwrap is being done.
|
|
18
|
-
// If the consolidate output going back to the vault is lower than this amount, the transaction will be rejected.
|
|
19
|
-
// User must pay for the consolidation, this help the network by having fewer UTXOs.
|
|
20
|
-
//readonly VAULT_NETWORK_CONSOLIDATION_ACCEPTANCE: bigint;
|
|
21
|
-
|
|
22
|
-
// Everytime an user wrap bitcoin, he prepays the fees for the consolidation at a maximum fee rate of the following determined value.
|
|
23
|
-
// If the fees are lower, the user will be refunded the difference.
|
|
24
|
-
// If the fees are higher, the user must pay the difference.
|
|
25
|
-
//readonly UNWRAP_CONSOLIDATION_PREPAID_FEES: bigint;
|
|
26
|
-
|
|
27
|
-
// The maximum fee rate for the consolidation.
|
|
28
|
-
//readonly UNWRAP_CONSOLIDATION_PREPAID_FEES_SAT: bigint;
|
|
29
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConsensusConfig } from '../IConsensusConfig.js';
|
|
1
|
+
import type { ConsensusConfig } from '../IConsensusConfig.js';
|
|
2
2
|
import { Consensus } from '../Consensus.js';
|
|
3
3
|
|
|
4
4
|
export const RoswellConsensus: ConsensusConfig<Consensus.Roswell> = {
|
|
@@ -7,20 +7,4 @@ export const RoswellConsensus: ConsensusConfig<Consensus.Roswell> = {
|
|
|
7
7
|
|
|
8
8
|
// The block height at which this consensus was enabled.
|
|
9
9
|
ENABLED_AT_BLOCK: 0n,
|
|
10
|
-
|
|
11
|
-
// Defines the minimum amount that can be consolidated in a single transaction.
|
|
12
|
-
//VAULT_MINIMUM_AMOUNT: 200000n,
|
|
13
|
-
|
|
14
|
-
// Defines the requested minimum acceptance for joining UTXOs when an unwrap is being done.
|
|
15
|
-
// If the consolidate output going back to the vault is lower than this amount, the transaction will be rejected.
|
|
16
|
-
// User must pay for the consolidation, this help the network by having fewer UTXOs.
|
|
17
|
-
//VAULT_NETWORK_CONSOLIDATION_ACCEPTANCE: 200000n * 2n,
|
|
18
|
-
|
|
19
|
-
// Everytime an user wrap bitcoin, he prepays the fees for the consolidation at a maximum fee rate of the following determined value.
|
|
20
|
-
// If the fees are lower, the user will be refunded the difference.
|
|
21
|
-
// If the fees are higher, the user must pay the difference.
|
|
22
|
-
//UNWRAP_CONSOLIDATION_PREPAID_FEES: 250n,
|
|
23
|
-
|
|
24
|
-
// Equivalent to 56500 satoshis, calculated from UNWRAP_CONSOLIDATION_PREPAID_FEES.
|
|
25
|
-
//UNWRAP_CONSOLIDATION_PREPAID_FEES_SAT: 56500n,
|
|
26
10
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Address } from '../keypair/Address.js';
|
|
2
2
|
import { FastMap } from './FastMap.js';
|
|
3
3
|
|
|
4
|
-
export class AddressMap<V> {
|
|
4
|
+
export class AddressMap<V> implements Disposable {
|
|
5
5
|
private items: FastMap<bigint, V>;
|
|
6
6
|
|
|
7
7
|
constructor(iterable?: ReadonlyArray<readonly [Address, V]> | null) {
|
|
@@ -42,6 +42,10 @@ export class AddressMap<V> {
|
|
|
42
42
|
this.items.clear();
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
public [Symbol.dispose](): void {
|
|
46
|
+
this.clear();
|
|
47
|
+
}
|
|
48
|
+
|
|
45
49
|
public indexOf(address: Address): number {
|
|
46
50
|
return this.items.indexOf(address.toBigInt());
|
|
47
51
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Address } from '../keypair/Address.js';
|
|
2
2
|
|
|
3
|
-
export class AddressSet {
|
|
3
|
+
export class AddressSet implements Disposable {
|
|
4
4
|
private items: Set<bigint>;
|
|
5
5
|
private keys: Address[];
|
|
6
6
|
|
|
@@ -45,6 +45,10 @@ export class AddressSet {
|
|
|
45
45
|
this.keys = [];
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
public [Symbol.dispose](): void {
|
|
49
|
+
this.clear();
|
|
50
|
+
}
|
|
51
|
+
|
|
48
52
|
public combine(set: AddressSet): AddressSet {
|
|
49
53
|
const clone = this.clone();
|
|
50
54
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class CustomMap<K, V> {
|
|
1
|
+
export class CustomMap<K, V> implements Disposable {
|
|
2
2
|
private static readonly INITIAL_CAPACITY = 16;
|
|
3
3
|
private static readonly LOAD_FACTOR = 0.75;
|
|
4
4
|
|
|
@@ -76,6 +76,10 @@ export class CustomMap<K, V> {
|
|
|
76
76
|
this._size = 0;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
public [Symbol.dispose](): void {
|
|
80
|
+
this.clear();
|
|
81
|
+
}
|
|
82
|
+
|
|
79
83
|
public *entries(): MapIterator<[K, V]> {
|
|
80
84
|
for (let i = 0; i < this.capacity; i++) {
|
|
81
85
|
if (this.#keys[i] !== undefined && !this.deleted[i]) {
|
|
@@ -223,7 +227,7 @@ export class CustomMap<K, V> {
|
|
|
223
227
|
let hash = 2166136261;
|
|
224
228
|
for (let i = 0; i < Math.min(bytes.length, 100); i++) {
|
|
225
229
|
// Cap at 100 bytes for performance
|
|
226
|
-
hash ^= bytes[i];
|
|
230
|
+
hash ^= bytes[i] as number;
|
|
227
231
|
hash = Math.imul(hash, 16777619);
|
|
228
232
|
}
|
|
229
233
|
return hash;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FastMap, PropertyExtendedKey } from './FastMap.js';
|
|
1
|
+
import { FastMap, type PropertyExtendedKey } from './FastMap.js';
|
|
2
2
|
|
|
3
|
-
export class DeterministicMap<K extends PropertyExtendedKey, V> {
|
|
3
|
+
export class DeterministicMap<K extends PropertyExtendedKey, V> implements Disposable {
|
|
4
4
|
private map: FastMap<K, V>;
|
|
5
5
|
#keys: K[];
|
|
6
6
|
|
|
@@ -32,7 +32,7 @@ export class DeterministicMap<K extends PropertyExtendedKey, V> {
|
|
|
32
32
|
|
|
33
33
|
while (left < right) {
|
|
34
34
|
const mid = Math.floor((left + right) / 2);
|
|
35
|
-
if (this.compareFn(this.#keys[mid], key) < 0) {
|
|
35
|
+
if (this.compareFn(this.#keys[mid] as K, key) < 0) {
|
|
36
36
|
left = mid + 1;
|
|
37
37
|
} else {
|
|
38
38
|
right = mid;
|
|
@@ -83,7 +83,7 @@ export class DeterministicMap<K extends PropertyExtendedKey, V> {
|
|
|
83
83
|
|
|
84
84
|
while (left <= right) {
|
|
85
85
|
const mid = Math.floor((left + right) / 2);
|
|
86
|
-
const cmp = this.compareFn(this.#keys[mid], key);
|
|
86
|
+
const cmp = this.compareFn(this.#keys[mid] as K, key);
|
|
87
87
|
|
|
88
88
|
if (cmp === 0) {
|
|
89
89
|
// Found it, remove at this index
|
|
@@ -104,6 +104,10 @@ export class DeterministicMap<K extends PropertyExtendedKey, V> {
|
|
|
104
104
|
this.#keys = [];
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
public [Symbol.dispose](): void {
|
|
108
|
+
this.clear();
|
|
109
|
+
}
|
|
110
|
+
|
|
107
111
|
public forEach(callback: (value: V, key: K, map: DeterministicMap<K, V>) => void): void {
|
|
108
112
|
for (const key of this.#keys) {
|
|
109
113
|
const value = this.map.get(key) as V;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class DeterministicSet<T> {
|
|
1
|
+
export class DeterministicSet<T> implements Disposable {
|
|
2
2
|
private elements: T[];
|
|
3
3
|
|
|
4
4
|
constructor(private compareFn: (a: T, b: T) => number) {
|
|
@@ -44,6 +44,10 @@ export class DeterministicSet<T> {
|
|
|
44
44
|
this.elements = [];
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
public [Symbol.dispose](): void {
|
|
48
|
+
this.clear();
|
|
49
|
+
}
|
|
50
|
+
|
|
47
51
|
public forEach(callback: (value: T, set: DeterministicSet<T>) => void): void {
|
|
48
52
|
for (const value of this.elements) {
|
|
49
53
|
callback(value, this);
|
|
@@ -64,7 +68,7 @@ export class DeterministicSet<T> {
|
|
|
64
68
|
|
|
65
69
|
while (left < right) {
|
|
66
70
|
const mid = Math.floor((left + right) / 2);
|
|
67
|
-
const cmp = this.compareFn(this.elements[mid], value);
|
|
71
|
+
const cmp = this.compareFn(this.elements[mid] as T, value);
|
|
68
72
|
|
|
69
73
|
if (cmp === 0) {
|
|
70
74
|
return { found: true, index: mid };
|