@btc-vision/transaction 1.8.0-beta.0 → 1.8.0-beta.10
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 +2 -1
- package/browser/_version.d.ts.map +1 -0
- package/browser/abi/ABICoder.d.ts +15 -36
- package/browser/abi/ABICoder.d.ts.map +1 -0
- package/browser/abi/ABIDataTypes.d.ts +35 -0
- package/browser/abi/ABIDataTypes.d.ts.map +1 -0
- package/browser/abi/AbiTypes.d.ts +50 -0
- package/browser/abi/AbiTypes.d.ts.map +1 -0
- package/browser/abi/TupleUtils.d.ts +25 -0
- package/browser/abi/TupleUtils.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 +12388 -3684
- 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 +3921 -3450
- 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 -20
- package/browser/keypair/EcKeyPair.d.ts.map +1 -0
- package/browser/keypair/MessageSigner.d.ts +17 -16
- package/browser/keypair/MessageSigner.d.ts.map +1 -0
- package/browser/keypair/Secp256k1PointDeriver.d.ts +55 -0
- package/browser/keypair/Secp256k1PointDeriver.d.ts.map +1 -0
- package/browser/keypair/Wallet.d.ts +27 -13
- package/browser/keypair/Wallet.d.ts.map +1 -0
- package/browser/keypair/interfaces/IWallet.d.ts +19 -0
- package/browser/keypair/interfaces/IWallet.d.ts.map +1 -0
- package/browser/metadata/ContractBaseMetadata.d.ts +10 -2
- package/browser/metadata/ContractBaseMetadata.d.ts.map +1 -0
- package/browser/mnemonic/BIPStandard.d.ts +59 -0
- package/browser/mnemonic/BIPStandard.d.ts.map +1 -0
- package/browser/mnemonic/Mnemonic.d.ts +15 -3
- package/browser/mnemonic/Mnemonic.d.ts.map +1 -0
- package/browser/mnemonic/MnemonicStrength.d.ts +6 -0
- package/browser/mnemonic/MnemonicStrength.d.ts.map +1 -0
- package/browser/network/ChainId.d.ts +1 -0
- package/browser/network/ChainId.d.ts.map +1 -0
- package/browser/noble-curves.js +920 -2966
- package/browser/noble-hashes.js +2067 -1038
- package/browser/opnet.d.ts +25 -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 +5 -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 +238 -15
- 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 +33 -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 +13940 -9389
- package/browser/verification/TapscriptVerificator.d.ts +10 -8
- package/browser/verification/TapscriptVerificator.d.ts.map +1 -0
- package/build/_version.d.ts +2 -1
- package/build/_version.d.ts.map +1 -0
- package/build/_version.js +2 -1
- package/build/_version.js.map +1 -0
- package/build/abi/ABICoder.d.ts +15 -36
- package/build/abi/ABICoder.d.ts.map +1 -0
- package/build/abi/ABICoder.js +120 -143
- package/build/abi/ABICoder.js.map +1 -0
- package/build/abi/ABIDataTypes.d.ts +35 -0
- package/build/abi/ABIDataTypes.d.ts.map +1 -0
- package/build/abi/ABIDataTypes.js +42 -0
- package/build/abi/ABIDataTypes.js.map +1 -0
- package/build/abi/AbiTypes.d.ts +50 -0
- package/build/abi/AbiTypes.d.ts.map +1 -0
- package/build/abi/AbiTypes.js +78 -0
- package/build/abi/AbiTypes.js.map +1 -0
- package/build/abi/TupleUtils.d.ts +25 -0
- package/build/abi/TupleUtils.d.ts.map +1 -0
- package/build/abi/TupleUtils.js +50 -0
- package/build/abi/TupleUtils.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 +37 -16
- 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 +447 -129
- package/build/keypair/Address.js.map +1 -0
- package/build/keypair/AddressVerificator.d.ts +7 -6
- package/build/keypair/AddressVerificator.d.ts.map +1 -0
- package/build/keypair/AddressVerificator.js +4 -5
- package/build/keypair/AddressVerificator.js.map +1 -0
- package/build/keypair/EcKeyPair.d.ts +185 -22
- package/build/keypair/EcKeyPair.d.ts.map +1 -0
- package/build/keypair/EcKeyPair.js +226 -49
- 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 +29 -3
- package/build/opnet.d.ts.map +1 -0
- package/build/opnet.js +26 -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 +6 -4
- package/build/transaction/builders/FundingTransaction.d.ts.map +1 -0
- package/build/transaction/builders/FundingTransaction.js +50 -9
- 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 +244 -20
- package/build/transaction/builders/TransactionBuilder.d.ts.map +1 -0
- package/build/transaction/builders/TransactionBuilder.js +371 -152
- 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 +38 -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 +280 -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/documentation/offline-transaction-signing.md +10 -8
- package/documentation/quantum-support/01-introduction.md +2 -2
- package/documentation/quantum-support/02-mnemonic-and-wallet.md +5 -3
- package/documentation/quantum-support/03-address-generation.md +6 -4
- package/documentation/quantum-support/04-message-signing.md +36 -43
- package/documentation/quantum-support/05-address-verification.md +13 -18
- package/documentation/quantum-support/README.md +1 -1
- package/documentation/transaction-building.md +9 -9
- package/eslint.config.js +0 -1
- package/package.json +16 -39
- package/src/_version.ts +1 -1
- package/src/abi/ABICoder.ts +131 -154
- package/src/abi/ABIDataTypes.ts +45 -0
- package/src/abi/AbiTypes.ts +183 -0
- package/src/abi/TupleUtils.ts +57 -0
- 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 +36 -25
- package/src/consensus/ConsensusConfig.ts +1 -1
- package/src/consensus/IConsensusConfig.ts +0 -17
- package/src/consensus/metadata/RoswellConsensus.ts +1 -17
- package/src/crypto/crypto-browser.js +3 -4
- package/src/deterministic/AddressMap.ts +5 -1
- package/src/deterministic/AddressSet.ts +5 -1
- package/src/deterministic/CustomMap.ts +6 -2
- package/src/deterministic/DeterministicMap.ts +8 -4
- package/src/deterministic/DeterministicSet.ts +6 -2
- package/src/deterministic/ExtendedAddressMap.ts +9 -4
- package/src/deterministic/FastMap.ts +9 -5
- package/src/ecc/backend.ts +17 -0
- package/src/epoch/ChallengeSolution.ts +3 -3
- package/src/epoch/interfaces/IChallengeSolution.ts +13 -13
- package/src/epoch/validator/EpochValidator.ts +24 -43
- package/src/generators/AddressGenerator.ts +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 +115 -72
- package/src/keypair/AddressVerificator.ts +14 -148
- package/src/keypair/EcKeyPair.ts +110 -111
- 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 +15 -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 +38 -53
- 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 +53 -12
- 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 +159 -255
- 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 +28 -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 +318 -125
- 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/add-refund-output.test.ts +535 -0
- 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 +482 -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
|
@@ -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,43 @@
|
|
|
1
|
-
import { Network, networks } from '@btc-vision/bitcoin';
|
|
1
|
+
import { type Network, networks } from '@btc-vision/bitcoin';
|
|
2
2
|
|
|
3
|
-
function
|
|
4
|
-
return
|
|
3
|
+
function networkKey(network: Network): string {
|
|
4
|
+
return `${network.messagePrefix}|${network.bech32}`;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
7
|
+
const CHAIN_IDS: ReadonlyMap<string, Uint8Array> = new Map([
|
|
8
|
+
[
|
|
9
|
+
networkKey(networks.bitcoin),
|
|
10
|
+
new Uint8Array([
|
|
11
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0xd6, 0x68, 0x9c, 0x08, 0x5a, 0xe1, 0x65, 0x83,
|
|
12
|
+
0x1e, 0x93, 0x4f, 0xf7, 0x63, 0xae, 0x46, 0xa2, 0xa6, 0xc1, 0x72, 0xb3, 0xf1, 0xb6,
|
|
13
|
+
0x0a, 0x8c, 0xe2, 0x6f,
|
|
14
|
+
]),
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
networkKey(networks.testnet),
|
|
18
|
+
new Uint8Array([
|
|
19
|
+
0x00, 0x00, 0x00, 0x00, 0x09, 0x33, 0xea, 0x01, 0xad, 0x0e, 0xe9, 0x84, 0x20, 0x97,
|
|
20
|
+
0x79, 0xba, 0xae, 0xc3, 0xce, 0xd9, 0x0f, 0xa3, 0xf4, 0x08, 0x71, 0x95, 0x26, 0xf8,
|
|
21
|
+
0xd7, 0x7f, 0x49, 0x43,
|
|
22
|
+
]),
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
networkKey(networks.regtest),
|
|
26
|
+
new Uint8Array([
|
|
27
|
+
0x0f, 0x91, 0x88, 0xf1, 0x3c, 0xb7, 0xb2, 0xc7, 0x1f, 0x2a, 0x33, 0x5e, 0x3a, 0x4f,
|
|
28
|
+
0xc3, 0x28, 0xbf, 0x5b, 0xeb, 0x43, 0x60, 0x12, 0xaf, 0xca, 0x59, 0x0b, 0x1a, 0x11,
|
|
29
|
+
0x46, 0x6e, 0x22, 0x06,
|
|
30
|
+
]),
|
|
31
|
+
],
|
|
32
|
+
]);
|
|
22
33
|
|
|
23
34
|
export function getChainId(network: Network): Uint8Array {
|
|
24
|
-
|
|
35
|
+
const chainId = CHAIN_IDS.get(networkKey(network));
|
|
36
|
+
if (!chainId) throw new Error('Unsupported network for chain ID retrieval');
|
|
37
|
+
return chainId.slice();
|
|
25
38
|
}
|
|
26
39
|
|
|
27
|
-
export const BITCOIN_PROTOCOL_ID = Uint8Array
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
),
|
|
32
|
-
);
|
|
40
|
+
export const BITCOIN_PROTOCOL_ID = new Uint8Array([
|
|
41
|
+
0xe7, 0x84, 0x99, 0x5a, 0x41, 0x2d, 0x77, 0x39, 0x88, 0xc4, 0xb8, 0xe3, 0x33, 0xd7, 0xb3, 0x9d,
|
|
42
|
+
0xfb, 0x3c, 0xab, 0xf1, 0x18, 0xd0, 0xd6, 0x45, 0x41, 0x1a, 0x91, 0x6c, 0xa2, 0x40, 0x79, 0x39,
|
|
43
|
+
]);
|
|
@@ -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,8 +1,7 @@
|
|
|
1
1
|
/* Browser Crypto Shims */
|
|
2
|
-
import { hmac } from '@noble/hashes/hmac';
|
|
3
|
-
import { pbkdf2 } from '@noble/hashes/pbkdf2';
|
|
4
|
-
import { sha256 } from '@noble/hashes/
|
|
5
|
-
import { sha512 } from '@noble/hashes/sha512';
|
|
2
|
+
import { hmac } from '@noble/hashes/hmac.js';
|
|
3
|
+
import { pbkdf2 } from '@noble/hashes/pbkdf2.js';
|
|
4
|
+
import { sha256, sha512 } from '@noble/hashes/sha2.js';
|
|
6
5
|
|
|
7
6
|
function assertArgument(check, message, name, value) {
|
|
8
7
|
if (!check) {
|
|
@@ -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 };
|
|
@@ -5,9 +5,10 @@ import { FastMap } from './FastMap.js';
|
|
|
5
5
|
* A map implementation using Address with both MLDSA and tweaked keys.
|
|
6
6
|
* Uses the tweaked public key for lookup/indexing, but stores the full Address.
|
|
7
7
|
*/
|
|
8
|
-
export class ExtendedAddressMap<V> {
|
|
8
|
+
export class ExtendedAddressMap<V> implements Disposable {
|
|
9
9
|
// Store tweaked bigint -> index mapping for fast lookup
|
|
10
10
|
private indexMap: FastMap<bigint, number>;
|
|
11
|
+
|
|
11
12
|
// Store actual addresses and values
|
|
12
13
|
private _keys: Address[] = [];
|
|
13
14
|
private _values: V[] = [];
|
|
@@ -72,7 +73,7 @@ export class ExtendedAddressMap<V> {
|
|
|
72
73
|
// Rebuild index map (indices shifted after splice)
|
|
73
74
|
this.indexMap.clear();
|
|
74
75
|
for (let i = 0; i < this._keys.length; i++) {
|
|
75
|
-
this.indexMap.set(this._keys[i].tweakedToBigInt(), i);
|
|
76
|
+
this.indexMap.set((this._keys[i] as Address).tweakedToBigInt(), i);
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
return true;
|
|
@@ -84,6 +85,10 @@ export class ExtendedAddressMap<V> {
|
|
|
84
85
|
this._values = [];
|
|
85
86
|
}
|
|
86
87
|
|
|
88
|
+
public [Symbol.dispose](): void {
|
|
89
|
+
this.clear();
|
|
90
|
+
}
|
|
91
|
+
|
|
87
92
|
public indexOf(address: Address): number {
|
|
88
93
|
const index = this.indexMap.get(address.tweakedToBigInt());
|
|
89
94
|
return index !== undefined ? index : -1;
|
|
@@ -91,7 +96,7 @@ export class ExtendedAddressMap<V> {
|
|
|
91
96
|
|
|
92
97
|
*entries(): IterableIterator<[Address, V]> {
|
|
93
98
|
for (let i = 0; i < this._keys.length; i++) {
|
|
94
|
-
yield [this._keys[i], this._values[i]];
|
|
99
|
+
yield [this._keys[i] as Address, this._values[i] as V];
|
|
95
100
|
}
|
|
96
101
|
}
|
|
97
102
|
|
|
@@ -112,7 +117,7 @@ export class ExtendedAddressMap<V> {
|
|
|
112
117
|
thisArg?: unknown,
|
|
113
118
|
): void {
|
|
114
119
|
for (let i = 0; i < this._keys.length; i++) {
|
|
115
|
-
callback.call(thisArg, this._values[i], this._keys[i], this);
|
|
120
|
+
callback.call(thisArg, this._values[i] as V, this._keys[i] as Address, this);
|
|
116
121
|
}
|
|
117
122
|
}
|
|
118
123
|
|
|
@@ -10,7 +10,7 @@ export type FastRecord<V> = {
|
|
|
10
10
|
|
|
11
11
|
export type IndexKey = string | number;
|
|
12
12
|
|
|
13
|
-
export class FastMap<K extends PropertyExtendedKey, V> {
|
|
13
|
+
export class FastMap<K extends PropertyExtendedKey, V> implements Disposable {
|
|
14
14
|
protected _keys: K[] = [];
|
|
15
15
|
protected _values: FastRecord<V> = {};
|
|
16
16
|
|
|
@@ -47,13 +47,13 @@ export class FastMap<K extends PropertyExtendedKey, V> {
|
|
|
47
47
|
|
|
48
48
|
public *values(): IterableIterator<V> {
|
|
49
49
|
for (const key of this._keys) {
|
|
50
|
-
yield this._values[key as IndexKey];
|
|
50
|
+
yield this._values[key as IndexKey] as V;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
public *entries(): IterableIterator<[K, V]> {
|
|
55
55
|
for (const key of this._keys) {
|
|
56
|
-
yield [key, this._values[key as IndexKey]];
|
|
56
|
+
yield [key, this._values[key as IndexKey] as V];
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -107,18 +107,22 @@ export class FastMap<K extends PropertyExtendedKey, V> {
|
|
|
107
107
|
this._values = {};
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
public [Symbol.dispose](): void {
|
|
111
|
+
this.clear();
|
|
112
|
+
}
|
|
113
|
+
|
|
110
114
|
public forEach(
|
|
111
115
|
callback: (value: V, key: K, map: FastMap<K, V>) => void,
|
|
112
116
|
thisArg?: unknown,
|
|
113
117
|
): void {
|
|
114
118
|
for (const key of this._keys) {
|
|
115
|
-
callback.call(thisArg, this._values[key as IndexKey], key, this);
|
|
119
|
+
callback.call(thisArg, this._values[key as IndexKey] as V, key, this);
|
|
116
120
|
}
|
|
117
121
|
}
|
|
118
122
|
|
|
119
123
|
*[Symbol.iterator](): IterableIterator<[K, V]> {
|
|
120
124
|
for (const key of this._keys) {
|
|
121
|
-
yield [key, this._values[key as IndexKey]];
|
|
125
|
+
yield [key, this._values[key as IndexKey] as V];
|
|
122
126
|
}
|
|
123
127
|
}
|
|
124
128
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createNobleBackend, type CryptoBackend } from '@btc-vision/ecpair';
|
|
2
|
+
import { type EccLib, initEccLib } from '@btc-vision/bitcoin';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Shared noble-curves backend for all EC operations.
|
|
6
|
+
* Instantiated once and reused across the entire library.
|
|
7
|
+
*/
|
|
8
|
+
export const backend: CryptoBackend = createNobleBackend();
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* EccLib is now a type alias for CryptoBackend.
|
|
12
|
+
* The backend can be used directly.
|
|
13
|
+
*/
|
|
14
|
+
export const eccLib: EccLib = backend;
|
|
15
|
+
|
|
16
|
+
// Initialize the ECC library once at module load
|
|
17
|
+
initEccLib(eccLib);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { stringToBuffer } from '../utils/StringToBuffer.js';
|
|
2
|
-
import {
|
|
2
|
+
import type {
|
|
3
3
|
IChallengeSolution,
|
|
4
4
|
IChallengeSubmission,
|
|
5
5
|
IChallengeVerification,
|
|
@@ -76,7 +76,7 @@ export class ChallengeSolution implements IChallengeSolution {
|
|
|
76
76
|
public readonly difficulty: number;
|
|
77
77
|
public readonly verification: ChallengeVerification;
|
|
78
78
|
|
|
79
|
-
private readonly submission?: ChallengeSubmission;
|
|
79
|
+
private readonly submission?: ChallengeSubmission | undefined;
|
|
80
80
|
|
|
81
81
|
constructor(data: RawChallenge) {
|
|
82
82
|
this.epochNumber = BigInt(data.epochNumber);
|
|
@@ -170,7 +170,7 @@ export class ChallengeSolution implements IChallengeSolution {
|
|
|
170
170
|
* Calculate the expected solution hash for this challenge
|
|
171
171
|
* @returns {Promise<Buffer>} The calculated solution hash
|
|
172
172
|
*/
|
|
173
|
-
public calculateSolution():
|
|
173
|
+
public calculateSolution(): Uint8Array {
|
|
174
174
|
return EpochValidator.calculateSolution(
|
|
175
175
|
this.verification.targetChecksum,
|
|
176
176
|
this.publicKey.toBuffer(),
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { Address } from '../../keypair/Address.js';
|
|
2
2
|
|
|
3
3
|
export interface IChallengeVerification {
|
|
4
|
-
readonly epochHash:
|
|
5
|
-
readonly epochRoot:
|
|
6
|
-
readonly targetHash:
|
|
7
|
-
readonly targetChecksum:
|
|
4
|
+
readonly epochHash: Uint8Array;
|
|
5
|
+
readonly epochRoot: Uint8Array;
|
|
6
|
+
readonly targetHash: Uint8Array;
|
|
7
|
+
readonly targetChecksum: Uint8Array;
|
|
8
8
|
readonly startBlock: bigint;
|
|
9
9
|
readonly endBlock: bigint;
|
|
10
|
-
readonly proofs: readonly
|
|
10
|
+
readonly proofs: readonly Uint8Array[];
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export interface IChallengeSolution {
|
|
14
14
|
readonly epochNumber: bigint;
|
|
15
15
|
readonly publicKey: Address;
|
|
16
|
-
readonly solution:
|
|
17
|
-
readonly salt:
|
|
18
|
-
readonly graffiti:
|
|
16
|
+
readonly solution: Uint8Array;
|
|
17
|
+
readonly salt: Uint8Array;
|
|
18
|
+
readonly graffiti: Uint8Array;
|
|
19
19
|
readonly difficulty: number;
|
|
20
20
|
readonly verification: IChallengeVerification;
|
|
21
21
|
|
|
@@ -23,9 +23,9 @@ export interface IChallengeSolution {
|
|
|
23
23
|
getSubmission(): IChallengeSubmission | undefined;
|
|
24
24
|
toRaw(): RawChallenge;
|
|
25
25
|
verify(): boolean;
|
|
26
|
-
toBuffer():
|
|
26
|
+
toBuffer(): Uint8Array;
|
|
27
27
|
toHex(): string;
|
|
28
|
-
calculateSolution():
|
|
28
|
+
calculateSolution(): Uint8Array;
|
|
29
29
|
checkDifficulty(minDifficulty: number): { valid: boolean; difficulty: number };
|
|
30
30
|
getMiningTargetBlock(): bigint | null;
|
|
31
31
|
}
|
|
@@ -50,9 +50,9 @@ export interface RawChallengeSubmission {
|
|
|
50
50
|
|
|
51
51
|
export interface IChallengeSubmission {
|
|
52
52
|
readonly publicKey: Address;
|
|
53
|
-
readonly solution:
|
|
54
|
-
readonly graffiti:
|
|
55
|
-
readonly signature:
|
|
53
|
+
readonly solution: Uint8Array;
|
|
54
|
+
readonly graffiti: Uint8Array | undefined;
|
|
55
|
+
readonly signature: Uint8Array;
|
|
56
56
|
readonly epochNumber: bigint;
|
|
57
57
|
verifySignature(): boolean;
|
|
58
58
|
}
|