@btc-vision/transaction 1.0.119 → 1.0.120
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 -1
- package/browser/generators/AddressGenerator.d.ts +1 -1
- package/browser/generators/Generator.d.ts +1 -1
- package/browser/generators/builders/CalldataGenerator.d.ts +1 -1
- package/browser/generators/builders/CustomGenerator.d.ts +1 -1
- package/browser/generators/builders/DeploymentGenerator.d.ts +1 -1
- package/browser/generators/builders/LegacyCalldataGenerator.d.ts +1 -1
- package/browser/index.js +1 -1
- package/browser/keypair/Address.d.ts +1 -1
- package/browser/keypair/AddressVerificator.d.ts +1 -1
- package/browser/keypair/EcKeyPair.d.ts +1 -1
- package/browser/keypair/Wallet.d.ts +1 -1
- package/browser/metadata/ContractBaseMetadata.d.ts +1 -1
- package/browser/metadata/contracts/wBTC.d.ts +1 -1
- package/browser/signer/TweakedSigner.d.ts +1 -1
- package/browser/transaction/TransactionFactory.d.ts +1 -1
- package/browser/transaction/browser/BrowserSignerBase.d.ts +1 -1
- package/browser/transaction/browser/extensions/UnisatSigner.d.ts +1 -1
- package/browser/transaction/builders/CustomScriptTransaction.d.ts +1 -1
- package/browser/transaction/builders/DeploymentTransaction.d.ts +1 -1
- package/browser/transaction/builders/FundingTransaction.d.ts +1 -1
- package/browser/transaction/builders/InteractionTransaction.d.ts +1 -1
- package/browser/transaction/builders/MultiSignTransaction.d.ts +2 -2
- package/browser/transaction/builders/SharedInteractionTransaction.d.ts +2 -2
- package/browser/transaction/builders/TransactionBuilder.d.ts +1 -1
- package/browser/transaction/builders/UnwrapSegwitTransaction.d.ts +2 -2
- package/browser/transaction/builders/UnwrapTransaction.d.ts +2 -2
- package/browser/transaction/builders/WrapTransaction.d.ts +1 -1
- package/browser/transaction/interfaces/ITransactionParameters.d.ts +1 -1
- package/browser/transaction/interfaces/Tap.d.ts +1 -1
- package/browser/transaction/processor/PsbtTransaction.d.ts +1 -1
- package/browser/transaction/shared/P2TR_MS.d.ts +1 -1
- package/browser/transaction/shared/TweakedTransaction.d.ts +1 -1
- package/browser/utxo/OPNetLimitedProvider.d.ts +1 -1
- package/browser/verification/TapscriptVerificator.d.ts +2 -2
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/generators/AddressGenerator.d.ts +1 -1
- package/build/generators/AddressGenerator.js +2 -2
- package/build/generators/Features.js +1 -1
- package/build/generators/Generator.d.ts +1 -1
- package/build/generators/Generator.js +2 -2
- package/build/generators/builders/CalldataGenerator.d.ts +1 -1
- package/build/generators/builders/CalldataGenerator.js +1 -1
- package/build/generators/builders/CustomGenerator.d.ts +1 -1
- package/build/generators/builders/CustomGenerator.js +1 -1
- package/build/generators/builders/DeploymentGenerator.d.ts +1 -1
- package/build/generators/builders/DeploymentGenerator.js +1 -1
- package/build/generators/builders/LegacyCalldataGenerator.d.ts +1 -1
- package/build/generators/builders/LegacyCalldataGenerator.js +1 -1
- package/build/generators/builders/MultiSignGenerator.js +2 -2
- package/build/keypair/Address.d.ts +1 -1
- package/build/keypair/Address.js +1 -1
- package/build/keypair/AddressVerificator.d.ts +1 -1
- package/build/keypair/AddressVerificator.js +1 -1
- package/build/keypair/EcKeyPair.d.ts +1 -1
- package/build/keypair/EcKeyPair.js +3 -3
- package/build/keypair/Wallet.d.ts +1 -1
- package/build/keypair/Wallet.js +2 -2
- package/build/metadata/ContractBaseMetadata.d.ts +1 -1
- package/build/metadata/ContractBaseMetadata.js +1 -1
- package/build/metadata/contracts/wBTC.d.ts +1 -1
- package/build/metadata/contracts/wBTC.js +1 -1
- package/build/signer/TweakedSigner.d.ts +1 -1
- package/build/signer/TweakedSigner.js +3 -3
- package/build/transaction/TransactionFactory.d.ts +1 -1
- package/build/transaction/browser/BrowserSignerBase.d.ts +1 -1
- package/build/transaction/browser/extensions/UnisatSigner.d.ts +1 -1
- package/build/transaction/browser/extensions/UnisatSigner.js +1 -1
- package/build/transaction/builders/CustomScriptTransaction.d.ts +1 -1
- package/build/transaction/builders/CustomScriptTransaction.js +2 -2
- package/build/transaction/builders/DeploymentTransaction.d.ts +1 -1
- package/build/transaction/builders/DeploymentTransaction.js +2 -2
- package/build/transaction/builders/FundingTransaction.d.ts +1 -1
- package/build/transaction/builders/InteractionTransaction.d.ts +1 -1
- package/build/transaction/builders/MultiSignTransaction.d.ts +2 -2
- package/build/transaction/builders/MultiSignTransaction.js +2 -2
- package/build/transaction/builders/SharedInteractionTransaction.d.ts +2 -2
- package/build/transaction/builders/SharedInteractionTransaction.js +2 -2
- package/build/transaction/builders/TransactionBuilder.d.ts +1 -1
- package/build/transaction/builders/TransactionBuilder.js +2 -2
- package/build/transaction/builders/UnwrapSegwitTransaction.d.ts +2 -2
- package/build/transaction/builders/UnwrapSegwitTransaction.js +1 -1
- package/build/transaction/builders/UnwrapTransaction.d.ts +2 -2
- package/build/transaction/builders/UnwrapTransaction.js +2 -2
- package/build/transaction/builders/WrapTransaction.d.ts +1 -1
- package/build/transaction/interfaces/ITransactionParameters.d.ts +1 -1
- package/build/transaction/interfaces/Tap.d.ts +1 -1
- package/build/transaction/processor/PsbtTransaction.d.ts +1 -1
- package/build/transaction/processor/PsbtTransaction.js +1 -1
- package/build/transaction/shared/P2TR_MS.d.ts +1 -1
- package/build/transaction/shared/P2TR_MS.js +1 -1
- package/build/transaction/shared/TweakedTransaction.d.ts +1 -1
- package/build/transaction/shared/TweakedTransaction.js +3 -3
- package/build/utxo/OPNetLimitedProvider.d.ts +1 -1
- package/build/verification/TapscriptVerificator.d.ts +2 -2
- package/build/verification/TapscriptVerificator.js +2 -2
- package/package.json +2 -2
- package/src/_version.ts +1 -1
- package/src/generators/AddressGenerator.ts +2 -2
- package/src/generators/Features.ts +1 -1
- package/src/generators/Generator.ts +2 -2
- package/src/generators/builders/CalldataGenerator.ts +2 -2
- package/src/generators/builders/CustomGenerator.ts +1 -1
- package/src/generators/builders/DeploymentGenerator.ts +1 -1
- package/src/generators/builders/LegacyCalldataGenerator.ts +1 -1
- package/src/generators/builders/MultiSignGenerator.ts +2 -2
- package/src/keypair/Address.ts +2 -2
- package/src/keypair/AddressVerificator.ts +1 -1
- package/src/keypair/EcKeyPair.ts +3 -3
- package/src/keypair/Wallet.ts +2 -2
- package/src/metadata/ContractBaseMetadata.ts +1 -1
- package/src/metadata/contracts/wBTC.ts +1 -1
- package/src/signer/TweakedSigner.ts +3 -3
- package/src/transaction/TransactionFactory.ts +2 -2
- package/src/transaction/browser/BrowserSignerBase.ts +1 -1
- package/src/transaction/browser/extensions/UnisatSigner.ts +1 -1
- package/src/transaction/builders/CustomScriptTransaction.ts +3 -3
- package/src/transaction/builders/DeploymentTransaction.ts +3 -3
- package/src/transaction/builders/FundingTransaction.ts +1 -1
- package/src/transaction/builders/InteractionTransaction.ts +1 -1
- package/src/transaction/builders/MultiSignTransaction.ts +3 -3
- package/src/transaction/builders/SharedInteractionTransaction.ts +3 -3
- package/src/transaction/builders/TransactionBuilder.ts +2 -2
- package/src/transaction/builders/UnwrapSegwitTransaction.ts +2 -2
- package/src/transaction/builders/UnwrapTransaction.ts +3 -3
- package/src/transaction/builders/WrapTransaction.ts +2 -2
- package/src/transaction/interfaces/ITransactionParameters.ts +1 -1
- package/src/transaction/interfaces/Tap.ts +1 -1
- package/src/transaction/processor/PsbtTransaction.ts +1 -1
- package/src/transaction/shared/P2TR_MS.ts +1 -1
- package/src/transaction/shared/TweakedTransaction.ts +3 -3
- package/src/utxo/OPNetLimitedProvider.ts +1 -1
- package/src/verification/TapscriptVerificator.ts +3 -3
- package/webpack.config.js +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Payment, Psbt, PsbtInput, Signer } from '
|
|
2
|
-
import { Taptree } from '
|
|
1
|
+
import { Payment, Psbt, PsbtInput, Signer } from '@btc-vision/bitcoin';
|
|
2
|
+
import { Taptree } from '@btc-vision/bitcoin/src/types.js';
|
|
3
3
|
import { ECPairInterface } from 'ecpair';
|
|
4
4
|
import { TransactionBuilder } from './TransactionBuilder.js';
|
|
5
5
|
import { TransactionType } from '../enums/TransactionType.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { address } from '
|
|
1
|
+
import { address } from '@btc-vision/bitcoin';
|
|
2
2
|
import { TransactionBuilder } from './TransactionBuilder.js';
|
|
3
3
|
import { CalldataGenerator } from '../../generators/builders/CalldataGenerator.js';
|
|
4
4
|
import { Compressor } from '../../bytecode/Compressor.js';
|
|
5
5
|
import { EcKeyPair } from '../../keypair/EcKeyPair.js';
|
|
6
6
|
import { BitcoinUtils } from '../../utils/BitcoinUtils.js';
|
|
7
|
-
import { toXOnly } from '
|
|
7
|
+
import { toXOnly } from '@btc-vision/bitcoin/src/psbt/bip371.js';
|
|
8
8
|
export class SharedInteractionTransaction extends TransactionBuilder {
|
|
9
9
|
constructor(parameters) {
|
|
10
10
|
super(parameters);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Network, Psbt, PsbtInputExtended, PsbtOutputExtended, Signer, Transaction } from '
|
|
1
|
+
import { Network, Psbt, PsbtInputExtended, PsbtOutputExtended, Signer, Transaction } from '@btc-vision/bitcoin';
|
|
2
2
|
import { UpdateInput } from '../interfaces/Tap.js';
|
|
3
3
|
import { TransactionType } from '../enums/TransactionType.js';
|
|
4
4
|
import { IFundingTransactionParameters, ITransactionParameters } from '../interfaces/ITransactionParameters.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { initEccLib, opcodes, Psbt, script, Transaction, } from '
|
|
2
|
-
import { varuint } from '
|
|
1
|
+
import { initEccLib, opcodes, Psbt, script, Transaction, } from '@btc-vision/bitcoin';
|
|
2
|
+
import { varuint } from '@btc-vision/bitcoin/src/bufferutils.js';
|
|
3
3
|
import * as ecc from '@bitcoinerlab/secp256k1';
|
|
4
4
|
import { EcKeyPair } from '../../keypair/EcKeyPair.js';
|
|
5
5
|
import { AddressVerificator } from '../../keypair/AddressVerificator.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Taptree } from '
|
|
1
|
+
import { Taptree } from '@btc-vision/bitcoin/src/types.js';
|
|
2
2
|
import { TransactionType } from '../enums/TransactionType.js';
|
|
3
3
|
import { IUnwrapParameters } from '../interfaces/ITransactionParameters.js';
|
|
4
4
|
import { SharedInteractionTransaction } from './SharedInteractionTransaction.js';
|
|
5
|
-
import { Psbt } from '
|
|
5
|
+
import { Psbt } from '@btc-vision/bitcoin';
|
|
6
6
|
import { VaultUTXOs } from '../processor/PsbtTransaction.js';
|
|
7
7
|
export declare class UnwrapSegwitTransaction extends SharedInteractionTransaction<TransactionType.WBTC_UNWRAP> {
|
|
8
8
|
private static readonly UNWRAP_SELECTOR;
|
|
@@ -2,7 +2,7 @@ import { TransactionType } from '../enums/TransactionType.js';
|
|
|
2
2
|
import { SharedInteractionTransaction } from './SharedInteractionTransaction.js';
|
|
3
3
|
import { TransactionBuilder } from './TransactionBuilder.js';
|
|
4
4
|
import { wBTC } from '../../metadata/contracts/wBTC.js';
|
|
5
|
-
import { payments } from '
|
|
5
|
+
import { payments } from '@btc-vision/bitcoin';
|
|
6
6
|
import { EcKeyPair } from '../../keypair/EcKeyPair.js';
|
|
7
7
|
import { PsbtTransaction } from '../processor/PsbtTransaction.js';
|
|
8
8
|
import { currentConsensusConfig } from '../../consensus/ConsensusConfig.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Taptree } from '
|
|
1
|
+
import { Taptree } from '@btc-vision/bitcoin/src/types.js';
|
|
2
2
|
import { TransactionType } from '../enums/TransactionType.js';
|
|
3
3
|
import { IUnwrapParameters } from '../interfaces/ITransactionParameters.js';
|
|
4
4
|
import { SharedInteractionTransaction } from './SharedInteractionTransaction.js';
|
|
5
|
-
import { Network, Payment, Psbt, PsbtInput } from '
|
|
5
|
+
import { Network, Payment, Psbt, PsbtInput } from '@btc-vision/bitcoin';
|
|
6
6
|
import { VaultUTXOs } from '../processor/PsbtTransaction.js';
|
|
7
7
|
export declare class UnwrapTransaction extends SharedInteractionTransaction<TransactionType.WBTC_UNWRAP> {
|
|
8
8
|
private static readonly UNWRAP_SELECTOR;
|
|
@@ -2,12 +2,12 @@ import { TransactionType } from '../enums/TransactionType.js';
|
|
|
2
2
|
import { SharedInteractionTransaction } from './SharedInteractionTransaction.js';
|
|
3
3
|
import { TransactionBuilder } from './TransactionBuilder.js';
|
|
4
4
|
import { wBTC } from '../../metadata/contracts/wBTC.js';
|
|
5
|
-
import { payments, } from '
|
|
5
|
+
import { payments, } from '@btc-vision/bitcoin';
|
|
6
6
|
import { EcKeyPair } from '../../keypair/EcKeyPair.js';
|
|
7
7
|
import { PsbtTransaction } from '../processor/PsbtTransaction.js';
|
|
8
8
|
import { MultiSignGenerator } from '../../generators/builders/MultiSignGenerator.js';
|
|
9
9
|
import { MultiSignTransaction } from './MultiSignTransaction.js';
|
|
10
|
-
import { toXOnly } from '
|
|
10
|
+
import { toXOnly } from '@btc-vision/bitcoin/src/psbt/bip371.js';
|
|
11
11
|
import { CalldataGenerator } from '../../generators/builders/CalldataGenerator.js';
|
|
12
12
|
import { currentConsensusConfig } from '../../consensus/ConsensusConfig.js';
|
|
13
13
|
import { BitcoinUtils } from '../../utils/BitcoinUtils.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Taptree } from '
|
|
1
|
+
import { Taptree } from '@btc-vision/bitcoin/src/types.js';
|
|
2
2
|
import { TransactionType } from '../enums/TransactionType.js';
|
|
3
3
|
import { TapLeafScript } from '../interfaces/Tap.js';
|
|
4
4
|
import { IWrapParameters } from '../interfaces/ITransactionParameters.js';
|
|
@@ -4,7 +4,7 @@ import { ITweakedTransactionData } from '../shared/TweakedTransaction.js';
|
|
|
4
4
|
import { VaultUTXOs } from '../processor/PsbtTransaction.js';
|
|
5
5
|
import { ChainId } from '../../network/ChainId.js';
|
|
6
6
|
import { Address } from '../../keypair/Address.js';
|
|
7
|
-
import { PsbtOutputExtended } from '
|
|
7
|
+
import { PsbtOutputExtended } from '@btc-vision/bitcoin';
|
|
8
8
|
export interface ITransactionParameters extends ITweakedTransactionData {
|
|
9
9
|
readonly from?: string;
|
|
10
10
|
readonly to?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PsbtInput as _PsbtInput, PsbtInputUpdate as _PsbtInputUpdate, PsbtOutput as _PsbtOutput, TapBip32Derivation as _TapBip32Derivation, TapInternalKey as _TapInternalKey, TapKeySig as _TapKeySig, TapLeaf as _TapLeaf, TapLeafScript as _TapLeafScript, TapMerkleRoot as _TapMerkleRoot, TapScriptSig as _TapScriptSig, TapTree as _TapTree } from '
|
|
1
|
+
import { PsbtInput as _PsbtInput, PsbtInputUpdate as _PsbtInputUpdate, PsbtOutput as _PsbtOutput, TapBip32Derivation as _TapBip32Derivation, TapInternalKey as _TapInternalKey, TapKeySig as _TapKeySig, TapLeaf as _TapLeaf, TapLeafScript as _TapLeafScript, TapMerkleRoot as _TapMerkleRoot, TapScriptSig as _TapScriptSig, TapTree as _TapTree } from '@btc-vision/bitcoin';
|
|
2
2
|
export interface TapLeafScript {
|
|
3
3
|
readonly leafVersion: number;
|
|
4
4
|
readonly controlBlock: Buffer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Network, Psbt, PsbtInputExtended, PsbtOutputExtended, Signer, Transaction } from '
|
|
1
|
+
import { Network, Psbt, PsbtInputExtended, PsbtOutputExtended, Signer, Transaction } from '@btc-vision/bitcoin';
|
|
2
2
|
import { ITweakedTransactionData, TweakedTransaction } from '../shared/TweakedTransaction.js';
|
|
3
3
|
export interface PsbtTransactionData extends ITweakedTransactionData {
|
|
4
4
|
readonly psbt: Psbt;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Logger } from '@btc-vision/logger';
|
|
2
|
-
import { Network, Payment, Psbt, PsbtInput, PsbtInputExtended, Signer, Transaction } from '
|
|
2
|
+
import { Network, Payment, Psbt, PsbtInput, PsbtInputExtended, Signer, Transaction } from '@btc-vision/bitcoin';
|
|
3
3
|
import { ECPairInterface } from 'ecpair';
|
|
4
4
|
import { UTXO } from '../../utxo/interfaces/IUTXO.js';
|
|
5
5
|
import { TapLeafScript } from '../interfaces/Tap.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Logger } from '@btc-vision/logger';
|
|
2
|
-
import { address as bitAddress, crypto as bitCrypto, getFinalScripts, opcodes, payments, script, } from '
|
|
2
|
+
import { address as bitAddress, crypto as bitCrypto, getFinalScripts, opcodes, payments, script, } from '@btc-vision/bitcoin';
|
|
3
3
|
import { TweakedSigner } from '../../signer/TweakedSigner.js';
|
|
4
|
-
import { toXOnly } from '
|
|
4
|
+
import { toXOnly } from '@btc-vision/bitcoin/src/psbt/bip371.js';
|
|
5
5
|
import { AddressTypes, AddressVerificator } from '../../keypair/AddressVerificator.js';
|
|
6
|
-
import { varuint } from '
|
|
6
|
+
import { varuint } from '@btc-vision/bitcoin/src/bufferutils.js';
|
|
7
7
|
export var TransactionSequence;
|
|
8
8
|
(function (TransactionSequence) {
|
|
9
9
|
TransactionSequence[TransactionSequence["REPLACE_BY_FEE"] = 4294967293] = "REPLACE_BY_FEE";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Network } from '
|
|
1
|
+
import { Network } from '@btc-vision/bitcoin';
|
|
2
2
|
import { Address, Wallet } from '../opnet.js';
|
|
3
3
|
import { UnwrapGeneration } from '../wbtc/UnwrapGeneration.js';
|
|
4
4
|
import { WrappedGeneration } from '../wbtc/WrappedGenerationParameters.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Network } from '
|
|
2
|
-
import { Taptree } from '
|
|
1
|
+
import { Network } from '@btc-vision/bitcoin';
|
|
2
|
+
import { Taptree } from '@btc-vision/bitcoin/src/types.js';
|
|
3
3
|
export interface ContractAddressVerificationParams {
|
|
4
4
|
readonly deployerPubKey: Buffer;
|
|
5
5
|
readonly contractSaltPubKey: Buffer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { crypto as bitCrypto, networks, payments } from '
|
|
2
|
-
import { toXOnly } from '
|
|
1
|
+
import { crypto as bitCrypto, networks, payments } from '@btc-vision/bitcoin';
|
|
2
|
+
import { toXOnly } from '@btc-vision/bitcoin/src/psbt/bip371.js';
|
|
3
3
|
import { DeploymentGenerator } from '../generators/builders/DeploymentGenerator.js';
|
|
4
4
|
import { TransactionBuilder } from '../transaction/builders/TransactionBuilder.js';
|
|
5
5
|
import { Address } from '../keypair/Address.js';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@btc-vision/transaction",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.120",
|
|
5
5
|
"author": "BlobMaster41",
|
|
6
6
|
"description": "OPNet transaction library allows you to create and sign transactions for the OPNet network.",
|
|
7
7
|
"engines": {
|
|
@@ -92,6 +92,7 @@
|
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
|
|
94
94
|
"@bitcoinerlab/secp256k1": "^1.1.1",
|
|
95
|
+
"@btc-vision/bitcoin": "^6.3.0",
|
|
95
96
|
"@btc-vision/bsi-bitcoin-rpc": "^1.0.29",
|
|
96
97
|
"@btc-vision/logger": "^1.0.6",
|
|
97
98
|
"@eslint/js": "^9.10.0",
|
|
@@ -104,7 +105,6 @@
|
|
|
104
105
|
"bech32": "^2.0.0",
|
|
105
106
|
"bignumber.js": "^9.1.2",
|
|
106
107
|
"bip32": "^4.0.0",
|
|
107
|
-
"bitcoinjs-lib": "github:btc-vision/bitcoinjs-lib",
|
|
108
108
|
"browserify-zlib": "^0.2.0",
|
|
109
109
|
"buffer": "^6.0.3",
|
|
110
110
|
"ecpair": "^2.1.0",
|
package/src/_version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.0.
|
|
1
|
+
export const version = '1.0.120';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { bech32, bech32m } from 'bech32';
|
|
2
|
-
import { initEccLib, Network } from '
|
|
2
|
+
import { initEccLib, Network } from '@btc-vision/bitcoin';
|
|
3
3
|
import * as ecc from '@bitcoinerlab/secp256k1';
|
|
4
|
-
import { ripemd160 } from '
|
|
4
|
+
import { ripemd160 } from '@btc-vision/bitcoin/src/crypto.js';
|
|
5
5
|
|
|
6
6
|
initEccLib(ecc);
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Network, networks } from '
|
|
2
|
-
import { toXOnly } from '
|
|
1
|
+
import { Network, networks } from '@btc-vision/bitcoin';
|
|
2
|
+
import { toXOnly } from '@btc-vision/bitcoin/src/psbt/bip371.js';
|
|
3
3
|
|
|
4
4
|
/** Bitcoin Script Generator */
|
|
5
5
|
export abstract class Generator {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { crypto, Network, networks, opcodes, script } from '
|
|
1
|
+
import { crypto, Network, networks, opcodes, script } from '@btc-vision/bitcoin';
|
|
2
2
|
import { ECPairInterface } from 'ecpair';
|
|
3
3
|
import { Compressor } from '../../bytecode/Compressor.js';
|
|
4
4
|
import { EcKeyPair } from '../../keypair/EcKeyPair.js';
|
|
@@ -99,7 +99,7 @@ export class CalldataGenerator extends Generator {
|
|
|
99
99
|
|
|
100
100
|
Generator.MAGIC,
|
|
101
101
|
];
|
|
102
|
-
|
|
102
|
+
|
|
103
103
|
// write pub keys, when requested.
|
|
104
104
|
if (vaultPublicKeys.length > 0) {
|
|
105
105
|
const pubKeyBuffer = CalldataGenerator.getPubKeyAsBuffer(vaultPublicKeys, this.network);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Network, networks, opcodes, script } from '
|
|
1
|
+
import { Network, networks, opcodes, script } from '@btc-vision/bitcoin';
|
|
2
2
|
import { ECPairInterface } from 'ecpair';
|
|
3
3
|
import { Compressor } from '../../bytecode/Compressor.js';
|
|
4
4
|
import { EcKeyPair } from '../../keypair/EcKeyPair.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { opcodes, script } from '
|
|
2
|
-
import { toXOnly } from '
|
|
1
|
+
import { opcodes, script } from '@btc-vision/bitcoin';
|
|
2
|
+
import { toXOnly } from '@btc-vision/bitcoin/src/psbt/bip371.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Generate a bitcoin script for a multisign interaction
|
package/src/keypair/Address.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Network } from '
|
|
1
|
+
import { Network } from '@btc-vision/bitcoin';
|
|
2
2
|
import { EcKeyPair } from './EcKeyPair.js';
|
|
3
3
|
import { ECPairInterface } from 'ecpair';
|
|
4
4
|
import { ADDRESS_BYTE_LENGTH } from '../utils/types.js';
|
|
5
5
|
import { AddressVerificator } from './AddressVerificator.js';
|
|
6
|
-
import { toXOnly } from '
|
|
6
|
+
import { toXOnly } from '@btc-vision/bitcoin/src/psbt/bip371.js';
|
|
7
7
|
|
|
8
8
|
export class Address extends Uint8Array {
|
|
9
9
|
private isP2TROnly: boolean = false;
|
package/src/keypair/EcKeyPair.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as ecc from '@bitcoinerlab/secp256k1';
|
|
2
2
|
import bip32, { BIP32API, BIP32Factory, BIP32Interface } from 'bip32';
|
|
3
|
-
import { address, initEccLib, Network, networks, payments, Signer } from '
|
|
4
|
-
import { toXOnly } from '
|
|
3
|
+
import { address, initEccLib, Network, networks, payments, Signer } from '@btc-vision/bitcoin';
|
|
4
|
+
import { toXOnly } from '@btc-vision/bitcoin/src/psbt/bip371.js';
|
|
5
5
|
import { ECPairAPI, ECPairFactory, ECPairInterface } from 'ecpair';
|
|
6
6
|
import { IWallet } from './interfaces/IWallet.js';
|
|
7
7
|
import { CURVE, Point, utils } from '@noble/secp256k1';
|
|
8
|
-
import { taggedHash } from '
|
|
8
|
+
import { taggedHash } from '@btc-vision/bitcoin/src/crypto.js';
|
|
9
9
|
|
|
10
10
|
initEccLib(ecc);
|
|
11
11
|
|
package/src/keypair/Wallet.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { IWallet } from './interfaces/IWallet.js';
|
|
2
2
|
import { ECPairInterface } from 'ecpair';
|
|
3
3
|
import { EcKeyPair } from './EcKeyPair.js';
|
|
4
|
-
import { Network, networks } from '
|
|
5
|
-
import { toXOnly } from '
|
|
4
|
+
import { Network, networks } from '@btc-vision/bitcoin';
|
|
5
|
+
import { toXOnly } from '@btc-vision/bitcoin/src/psbt/bip371.js';
|
|
6
6
|
import { Address } from './Address.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Network, networks } from '
|
|
1
|
+
import { Network, networks } from '@btc-vision/bitcoin';
|
|
2
2
|
import { ChainId } from '../../network/ChainId.js';
|
|
3
3
|
import { ContractBaseMetadata } from '../ContractBaseMetadata.js';
|
|
4
4
|
import { WBTC_ADDRESS_FRACTAL, WBTC_ADDRESS_REGTEST, WBTC_ADDRESS_TESTNET } from '../tokens.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as ecc from '@bitcoinerlab/secp256k1';
|
|
2
|
-
import { initEccLib, Network, Signer } from '
|
|
3
|
-
import { tapTweakHash } from '
|
|
4
|
-
import { toXOnly } from '
|
|
2
|
+
import { initEccLib, Network, Signer } from '@btc-vision/bitcoin';
|
|
3
|
+
import { tapTweakHash } from '@btc-vision/bitcoin/src/payments/bip341.js';
|
|
4
|
+
import { toXOnly } from '@btc-vision/bitcoin/src/psbt/bip371.js';
|
|
5
5
|
import { ECPairInterface } from 'ecpair';
|
|
6
6
|
import { EcKeyPair } from '../keypair/EcKeyPair.js';
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Psbt, Transaction } from '
|
|
2
|
-
import { Output } from '
|
|
1
|
+
import { Psbt, Transaction } from '@btc-vision/bitcoin';
|
|
2
|
+
import { Output } from '@btc-vision/bitcoin/src/transaction.js';
|
|
3
3
|
import { currentConsensus, currentConsensusConfig } from '../consensus/ConsensusConfig.js';
|
|
4
4
|
import { wBTC } from '../metadata/contracts/wBTC.js';
|
|
5
5
|
import { UTXO } from '../utxo/interfaces/IUTXO.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Network, networks, Psbt, TapScriptSig } from '
|
|
1
|
+
import { Network, networks, Psbt, TapScriptSig } from '@btc-vision/bitcoin';
|
|
2
2
|
import { ECPairInterface } from 'ecpair';
|
|
3
3
|
import { EcKeyPair } from '../../../keypair/EcKeyPair.js';
|
|
4
4
|
import { CustomKeypair } from '../BrowserSignerBase.js';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Taptree } from '
|
|
1
|
+
import { Taptree } from '@btc-vision/bitcoin/src/types.js';
|
|
2
2
|
import { TransactionType } from '../enums/TransactionType.js';
|
|
3
3
|
import { TapLeafScript } from '../interfaces/Tap.js';
|
|
4
4
|
import { SharedInteractionParameters } from '../interfaces/ITransactionParameters.js';
|
|
5
|
-
import { crypto as bitCrypto, Payment, Psbt, PsbtInput, Signer, Stack } from '
|
|
5
|
+
import { crypto as bitCrypto, Payment, Psbt, PsbtInput, Signer, Stack } from '@btc-vision/bitcoin';
|
|
6
6
|
import { TransactionBuilder } from './TransactionBuilder.js';
|
|
7
7
|
import { CustomGenerator } from '../../generators/builders/CustomGenerator.js';
|
|
8
8
|
import { BitcoinUtils } from '../../utils/BitcoinUtils.js';
|
|
9
9
|
import { EcKeyPair } from '../../keypair/EcKeyPair.js';
|
|
10
10
|
import { AddressGenerator } from '../../generators/AddressGenerator.js';
|
|
11
|
-
import { toXOnly } from '
|
|
11
|
+
import { toXOnly } from '@btc-vision/bitcoin/src/psbt/bip371.js';
|
|
12
12
|
import { ECPairInterface } from 'ecpair';
|
|
13
13
|
|
|
14
14
|
export interface ICustomTransactionParameters extends SharedInteractionParameters {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { TransactionType } from '../enums/TransactionType.js';
|
|
2
2
|
import { IDeploymentParameters } from '../interfaces/ITransactionParameters.js';
|
|
3
|
-
import { crypto as bitCrypto, Payment, Psbt, PsbtInput, Signer } from '
|
|
3
|
+
import { crypto as bitCrypto, Payment, Psbt, PsbtInput, Signer } from '@btc-vision/bitcoin';
|
|
4
4
|
import { TransactionBuilder } from './TransactionBuilder.js';
|
|
5
|
-
import { Taptree } from '
|
|
5
|
+
import { Taptree } from '@btc-vision/bitcoin/src/types.js';
|
|
6
6
|
import { TapLeafScript } from '../interfaces/Tap.js';
|
|
7
7
|
import { DeploymentGenerator } from '../../generators/builders/DeploymentGenerator.js';
|
|
8
|
-
import { toXOnly } from '
|
|
8
|
+
import { toXOnly } from '@btc-vision/bitcoin/src/psbt/bip371.js';
|
|
9
9
|
import { EcKeyPair } from '../../keypair/EcKeyPair.js';
|
|
10
10
|
import { BitcoinUtils } from '../../utils/BitcoinUtils.js';
|
|
11
11
|
import { Compressor } from '../../bytecode/Compressor.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TransactionType } from '../enums/TransactionType.js';
|
|
2
2
|
import { IFundingTransactionParameters } from '../interfaces/ITransactionParameters.js';
|
|
3
|
-
import { Signer } from '
|
|
3
|
+
import { Signer } from '@btc-vision/bitcoin';
|
|
4
4
|
import { TransactionBuilder } from './TransactionBuilder.js';
|
|
5
5
|
import { ECPairInterface } from 'ecpair';
|
|
6
6
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Taptree } from '
|
|
1
|
+
import { Taptree } from '@btc-vision/bitcoin/src/types.js';
|
|
2
2
|
import { TransactionType } from '../enums/TransactionType.js';
|
|
3
3
|
import { TapLeafScript } from '../interfaces/Tap.js';
|
|
4
4
|
import { IInteractionParameters } from '../interfaces/ITransactionParameters.js';
|
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
script,
|
|
10
10
|
Signer,
|
|
11
11
|
TapScriptSig,
|
|
12
|
-
} from '
|
|
13
|
-
import { Taptree } from '
|
|
12
|
+
} from '@btc-vision/bitcoin';
|
|
13
|
+
import { Taptree } from '@btc-vision/bitcoin/src/types.js';
|
|
14
14
|
import { TransactionBuilder } from './TransactionBuilder.js';
|
|
15
15
|
import { TransactionType } from '../enums/TransactionType.js';
|
|
16
16
|
import { ITransactionParameters } from '../interfaces/ITransactionParameters.js';
|
|
17
17
|
import { MultiSignGenerator } from '../../generators/builders/MultiSignGenerator.js';
|
|
18
18
|
import { UTXO } from '../../utxo/interfaces/IUTXO.js';
|
|
19
|
-
import { toXOnly } from '
|
|
19
|
+
import { toXOnly } from '@btc-vision/bitcoin/src/psbt/bip371.js';
|
|
20
20
|
import { EcKeyPair } from '../../keypair/EcKeyPair.js';
|
|
21
21
|
import { ECPairInterface } from 'ecpair';
|
|
22
22
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { address, Payment, Psbt, PsbtInput, Signer } from '
|
|
2
|
-
import { Taptree } from '
|
|
1
|
+
import { address, Payment, Psbt, PsbtInput, Signer } from '@btc-vision/bitcoin';
|
|
2
|
+
import { Taptree } from '@btc-vision/bitcoin/src/types.js';
|
|
3
3
|
import { ECPairInterface } from 'ecpair';
|
|
4
4
|
import { TransactionBuilder } from './TransactionBuilder.js';
|
|
5
5
|
import { TransactionType } from '../enums/TransactionType.js';
|
|
@@ -8,7 +8,7 @@ import { SharedInteractionParameters } from '../interfaces/ITransactionParameter
|
|
|
8
8
|
import { Compressor } from '../../bytecode/Compressor.js';
|
|
9
9
|
import { EcKeyPair } from '../../keypair/EcKeyPair.js';
|
|
10
10
|
import { BitcoinUtils } from '../../utils/BitcoinUtils.js';
|
|
11
|
-
import { toXOnly } from '
|
|
11
|
+
import { toXOnly } from '@btc-vision/bitcoin/src/psbt/bip371.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Shared interaction transaction
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
script,
|
|
9
9
|
Signer,
|
|
10
10
|
Transaction,
|
|
11
|
-
} from '
|
|
12
|
-
import { varuint } from '
|
|
11
|
+
} from '@btc-vision/bitcoin';
|
|
12
|
+
import { varuint } from '@btc-vision/bitcoin/src/bufferutils.js';
|
|
13
13
|
import * as ecc from '@bitcoinerlab/secp256k1';
|
|
14
14
|
import { UpdateInput } from '../interfaces/Tap.js';
|
|
15
15
|
import { TransactionType } from '../enums/TransactionType.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Taptree } from '
|
|
1
|
+
import { Taptree } from '@btc-vision/bitcoin/src/types.js';
|
|
2
2
|
import { TransactionType } from '../enums/TransactionType.js';
|
|
3
3
|
import { IUnwrapParameters } from '../interfaces/ITransactionParameters.js';
|
|
4
4
|
import { SharedInteractionTransaction } from './SharedInteractionTransaction.js';
|
|
5
5
|
import { TransactionBuilder } from './TransactionBuilder.js';
|
|
6
6
|
import { wBTC } from '../../metadata/contracts/wBTC.js';
|
|
7
|
-
import { payments, Psbt, PsbtInputExtended, PsbtOutputExtended, Signer } from '
|
|
7
|
+
import { payments, Psbt, PsbtInputExtended, PsbtOutputExtended, Signer } from '@btc-vision/bitcoin';
|
|
8
8
|
import { EcKeyPair } from '../../keypair/EcKeyPair.js';
|
|
9
9
|
import { IWBTCUTXODocument, PsbtTransaction, VaultUTXOs } from '../processor/PsbtTransaction.js';
|
|
10
10
|
import { currentConsensusConfig } from '../../consensus/ConsensusConfig.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Taptree } from '
|
|
1
|
+
import { Taptree } from '@btc-vision/bitcoin/src/types.js';
|
|
2
2
|
import { TransactionType } from '../enums/TransactionType.js';
|
|
3
3
|
import { IUnwrapParameters } from '../interfaces/ITransactionParameters.js';
|
|
4
4
|
import { SharedInteractionTransaction } from './SharedInteractionTransaction.js';
|
|
@@ -12,12 +12,12 @@ import {
|
|
|
12
12
|
PsbtInput,
|
|
13
13
|
PsbtInputExtended,
|
|
14
14
|
PsbtOutputExtended,
|
|
15
|
-
} from '
|
|
15
|
+
} from '@btc-vision/bitcoin';
|
|
16
16
|
import { EcKeyPair } from '../../keypair/EcKeyPair.js';
|
|
17
17
|
import { IWBTCUTXODocument, PsbtTransaction, VaultUTXOs } from '../processor/PsbtTransaction.js';
|
|
18
18
|
import { MultiSignGenerator } from '../../generators/builders/MultiSignGenerator.js';
|
|
19
19
|
import { MultiSignTransaction } from './MultiSignTransaction.js';
|
|
20
|
-
import { toXOnly } from '
|
|
20
|
+
import { toXOnly } from '@btc-vision/bitcoin/src/psbt/bip371.js';
|
|
21
21
|
import { CalldataGenerator } from '../../generators/builders/CalldataGenerator.js';
|
|
22
22
|
import { currentConsensusConfig } from '../../consensus/ConsensusConfig.js';
|
|
23
23
|
import { BitcoinUtils } from '../../utils/BitcoinUtils.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Taptree } from '
|
|
1
|
+
import { Taptree } from '@btc-vision/bitcoin/src/types.js';
|
|
2
2
|
import { TransactionType } from '../enums/TransactionType.js';
|
|
3
3
|
import { TapLeafScript } from '../interfaces/Tap.js';
|
|
4
4
|
import { IWrapParameters } from '../interfaces/ITransactionParameters.js';
|
|
@@ -6,7 +6,7 @@ import { SharedInteractionTransaction } from './SharedInteractionTransaction.js'
|
|
|
6
6
|
import { wBTC } from '../../metadata/contracts/wBTC.js';
|
|
7
7
|
import { WrappedGeneration } from '../../wbtc/WrappedGenerationParameters.js';
|
|
8
8
|
import { BitcoinUtils } from '../../utils/BitcoinUtils.js';
|
|
9
|
-
import { Network, PsbtOutputExtendedAddress } from '
|
|
9
|
+
import { Network, PsbtOutputExtendedAddress } from '@btc-vision/bitcoin';
|
|
10
10
|
import { P2TR_MS } from '../shared/P2TR_MS.js';
|
|
11
11
|
import { currentConsensusConfig } from '../../consensus/ConsensusConfig.js';
|
|
12
12
|
import { Selector } from '../../utils/types.js';
|
|
@@ -4,7 +4,7 @@ import { ITweakedTransactionData } from '../shared/TweakedTransaction.js';
|
|
|
4
4
|
import { VaultUTXOs } from '../processor/PsbtTransaction.js';
|
|
5
5
|
import { ChainId } from '../../network/ChainId.js';
|
|
6
6
|
import { Address } from '../../keypair/Address.js';
|
|
7
|
-
import { PsbtOutputExtended } from '
|
|
7
|
+
import { PsbtOutputExtended } from '@btc-vision/bitcoin';
|
|
8
8
|
|
|
9
9
|
export interface ITransactionParameters extends ITweakedTransactionData {
|
|
10
10
|
readonly from?: string;
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
PsbtOutputExtended,
|
|
6
6
|
Signer,
|
|
7
7
|
Transaction,
|
|
8
|
-
} from '
|
|
8
|
+
} from '@btc-vision/bitcoin';
|
|
9
9
|
import { ITweakedTransactionData, TweakedTransaction } from '../shared/TweakedTransaction.js';
|
|
10
10
|
|
|
11
11
|
export interface PsbtTransactionData extends ITweakedTransactionData {
|