@btc-vision/transaction 1.0.112 → 1.0.114
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/abi/ABICoder.d.ts +31 -0
- package/browser/buffer/BinaryReader.d.ts +37 -0
- package/browser/buffer/BinaryWriter.d.ts +46 -0
- package/browser/deterministic/AddressMap.d.ts +10 -0
- package/browser/deterministic/AddressSet.d.ts +13 -0
- package/browser/deterministic/DeterministicMap.d.ts +17 -0
- package/browser/deterministic/DeterministicSet.d.ts +13 -0
- package/browser/deterministic/Map.d.ts +14 -0
- package/browser/event/NetEvent.d.ts +5 -0
- package/browser/generators/AddressGenerator.d.ts +3 -0
- package/browser/index.js +1 -1
- package/browser/keypair/Address.d.ts +23 -0
- package/browser/keypair/AddressVerificator.d.ts +15 -4
- package/browser/keypair/EcKeyPair.d.ts +15 -12
- package/browser/keypair/Wallet.d.ts +12 -5
- package/browser/metadata/ContractBaseMetadata.d.ts +3 -4
- package/browser/metadata/contracts/wBTC.d.ts +2 -3
- package/browser/metadata/tokens.d.ts +1 -1
- package/browser/opnet.d.ts +11 -0
- package/browser/signer/TweakedSigner.d.ts +2 -2
- package/browser/transaction/TransactionFactory.d.ts +6 -6
- package/browser/transaction/browser/BrowserSignerBase.d.ts +3 -4
- package/browser/transaction/browser/extensions/UnisatSigner.d.ts +3 -4
- package/browser/transaction/browser/types/Unisat.d.ts +2 -3
- package/browser/transaction/builders/CustomScriptTransaction.d.ts +4 -5
- package/browser/transaction/builders/DeploymentTransaction.d.ts +4 -2
- package/browser/transaction/builders/FundingTransaction.d.ts +2 -1
- package/browser/transaction/builders/MultiSignTransaction.d.ts +6 -6
- package/browser/transaction/builders/SharedInteractionTransaction.d.ts +1 -1
- package/browser/transaction/builders/TransactionBuilder.d.ts +6 -7
- package/browser/transaction/builders/WrapTransaction.d.ts +2 -2
- package/browser/transaction/interfaces/ITransactionParameters.d.ts +6 -6
- package/browser/transaction/processor/PsbtTransaction.d.ts +3 -4
- package/browser/transaction/shared/P2TR_MS.d.ts +1 -2
- package/browser/transaction/shared/TweakedTransaction.d.ts +8 -7
- package/browser/utils/BufferHelper.d.ts +11 -0
- package/browser/utils/types.d.ts +12 -0
- package/browser/utxo/OPNetLimitedProvider.d.ts +1 -2
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/abi/ABICoder.d.ts +31 -0
- package/build/abi/ABICoder.js +137 -0
- package/build/buffer/BinaryReader.d.ts +37 -0
- package/build/buffer/BinaryReader.js +192 -0
- package/build/buffer/BinaryWriter.d.ts +46 -0
- package/build/buffer/BinaryWriter.js +258 -0
- package/build/deterministic/AddressMap.d.ts +10 -0
- package/build/deterministic/AddressMap.js +46 -0
- package/build/deterministic/AddressSet.d.ts +13 -0
- package/build/deterministic/AddressSet.js +44 -0
- package/build/deterministic/DeterministicMap.d.ts +17 -0
- package/build/deterministic/DeterministicMap.js +83 -0
- package/build/deterministic/DeterministicSet.d.ts +13 -0
- package/build/deterministic/DeterministicSet.js +46 -0
- package/build/deterministic/Map.d.ts +14 -0
- package/build/deterministic/Map.js +56 -0
- package/build/event/NetEvent.d.ts +5 -0
- package/build/event/NetEvent.js +6 -0
- package/build/generators/AddressGenerator.d.ts +3 -0
- package/build/generators/AddressGenerator.js +8 -1
- package/build/keypair/Address.d.ts +23 -0
- package/build/keypair/Address.js +129 -0
- package/build/keypair/AddressVerificator.d.ts +15 -4
- package/build/keypair/AddressVerificator.js +79 -3
- package/build/keypair/EcKeyPair.d.ts +15 -12
- package/build/keypair/EcKeyPair.js +61 -9
- package/build/keypair/Wallet.d.ts +12 -5
- package/build/keypair/Wallet.js +19 -5
- package/build/metadata/ContractBaseMetadata.d.ts +3 -4
- package/build/metadata/contracts/wBTC.d.ts +2 -3
- package/build/metadata/contracts/wBTC.js +4 -6
- package/build/metadata/tokens.d.ts +1 -1
- package/build/metadata/tokens.js +19 -15
- package/build/opnet.d.ts +11 -0
- package/build/opnet.js +11 -0
- package/build/signer/TweakedSigner.d.ts +2 -2
- package/build/signer/TweakedSigner.js +1 -1
- package/build/transaction/TransactionFactory.d.ts +6 -6
- package/build/transaction/TransactionFactory.js +3 -2
- package/build/transaction/browser/BrowserSignerBase.d.ts +3 -4
- package/build/transaction/browser/extensions/UnisatSigner.d.ts +3 -4
- package/build/transaction/browser/types/Unisat.d.ts +2 -3
- package/build/transaction/builders/CustomScriptTransaction.d.ts +4 -5
- package/build/transaction/builders/CustomScriptTransaction.js +3 -3
- package/build/transaction/builders/DeploymentTransaction.d.ts +4 -2
- package/build/transaction/builders/DeploymentTransaction.js +10 -6
- package/build/transaction/builders/FundingTransaction.d.ts +2 -1
- package/build/transaction/builders/MultiSignTransaction.d.ts +6 -6
- package/build/transaction/builders/SharedInteractionTransaction.d.ts +1 -1
- package/build/transaction/builders/SharedInteractionTransaction.js +4 -4
- package/build/transaction/builders/TransactionBuilder.d.ts +6 -7
- package/build/transaction/builders/UnwrapSegwitTransaction.js +2 -1
- package/build/transaction/builders/UnwrapTransaction.js +4 -3
- package/build/transaction/builders/WrapTransaction.d.ts +2 -2
- package/build/transaction/builders/WrapTransaction.js +5 -6
- package/build/transaction/interfaces/ITransactionParameters.d.ts +6 -6
- package/build/transaction/processor/PsbtTransaction.d.ts +3 -4
- package/build/transaction/shared/P2TR_MS.d.ts +1 -2
- package/build/transaction/shared/TweakedTransaction.d.ts +8 -7
- package/build/transaction/shared/TweakedTransaction.js +1 -1
- package/build/utils/BufferHelper.d.ts +11 -0
- package/build/utils/BufferHelper.js +50 -0
- package/build/utils/types.d.ts +12 -0
- package/build/utils/types.js +1 -0
- package/build/utxo/OPNetLimitedProvider.d.ts +1 -2
- package/build/utxo/OPNetLimitedProvider.js +1 -1
- package/build/verification/TapscriptVerificator.js +3 -2
- package/package.json +4 -2
- package/src/_version.ts +1 -1
- package/src/abi/ABICoder.ts +158 -0
- package/src/buffer/BinaryReader.ts +260 -0
- package/src/buffer/BinaryWriter.ts +331 -0
- package/src/deterministic/AddressMap.ts +57 -0
- package/src/deterministic/AddressSet.ts +62 -0
- package/src/deterministic/DeterministicMap.ts +88 -0
- package/src/deterministic/DeterministicSet.ts +56 -0
- package/src/deterministic/Map.ts +66 -0
- package/src/event/NetEvent.ts +6 -0
- package/src/generators/AddressGenerator.ts +15 -1
- package/src/keypair/Address.ts +235 -0
- package/src/keypair/AddressVerificator.ts +149 -6
- package/src/keypair/EcKeyPair.ts +146 -47
- package/src/keypair/Wallet.ts +72 -15
- package/src/metadata/ContractBaseMetadata.ts +3 -4
- package/src/metadata/contracts/wBTC.ts +8 -9
- package/src/metadata/tokens.ts +21 -16
- package/src/opnet.ts +13 -0
- package/src/signer/TweakedSigner.ts +3 -2
- package/src/transaction/TransactionFactory.ts +11 -10
- package/src/transaction/browser/BrowserSignerBase.ts +3 -4
- package/src/transaction/browser/extensions/UnisatSigner.ts +6 -7
- package/src/transaction/browser/types/Unisat.ts +2 -3
- package/src/transaction/builders/CustomScriptTransaction.ts +10 -10
- package/src/transaction/builders/DeploymentTransaction.ts +23 -9
- package/src/transaction/builders/FundingTransaction.ts +2 -1
- package/src/transaction/builders/MultiSignTransaction.ts +10 -7
- package/src/transaction/builders/SharedInteractionTransaction.ts +5 -5
- package/src/transaction/builders/TransactionBuilder.ts +26 -17
- package/src/transaction/builders/UnwrapSegwitTransaction.ts +10 -4
- package/src/transaction/builders/UnwrapTransaction.ts +5 -19
- package/src/transaction/builders/WrapTransaction.ts +7 -13
- package/src/transaction/interfaces/ITransactionParameters.ts +7 -6
- package/src/transaction/processor/PsbtTransaction.ts +3 -4
- package/src/transaction/shared/P2TR_MS.ts +2 -3
- package/src/transaction/shared/TweakedTransaction.ts +12 -12
- package/src/utils/BufferHelper.ts +71 -0
- package/src/utils/types.ts +19 -0
- package/src/utxo/OPNetLimitedProvider.ts +3 -8
- package/src/verification/TapscriptVerificator.ts +4 -2
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Network } from 'bitcoinjs-lib';
|
|
2
|
+
import { ECPairInterface } from 'ecpair';
|
|
3
|
+
export declare class Address extends Uint8Array {
|
|
4
|
+
#private;
|
|
5
|
+
private isP2TROnly;
|
|
6
|
+
constructor(bytes?: ArrayLike<number>);
|
|
7
|
+
private _keyPair;
|
|
8
|
+
get keyPair(): ECPairInterface;
|
|
9
|
+
static dead(): Address;
|
|
10
|
+
static fromString(pubKey: string): Address;
|
|
11
|
+
static wrap(bytes: ArrayLike<number>): Address;
|
|
12
|
+
toHex(): string;
|
|
13
|
+
equals(a: Address): boolean;
|
|
14
|
+
isBiggerThan(a: Address): boolean;
|
|
15
|
+
isSmallerThan(a: Address): boolean;
|
|
16
|
+
set(publicKey: ArrayLike<number>): void;
|
|
17
|
+
isValid(network: Network): boolean;
|
|
18
|
+
p2wpkh(network: Network): string;
|
|
19
|
+
p2pkh(network: Network): string;
|
|
20
|
+
p2shp2wpkh(network: Network): string;
|
|
21
|
+
toString(): string;
|
|
22
|
+
p2tr(network: Network): string;
|
|
23
|
+
}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Network } from 'bitcoinjs-lib';
|
|
2
|
+
export declare enum AddressTypes {
|
|
3
|
+
P2PKH = "P2PKH",
|
|
4
|
+
P2SH = "P2SH",
|
|
5
|
+
P2SH_P2WPKH = "P2SH-P2WPKH",
|
|
6
|
+
P2SH_OR_P2SH_P2WPKH = "P2SH_OR_P2SH-P2WPKH",
|
|
7
|
+
P2PK = "P2PK",
|
|
8
|
+
P2TR = "P2TR",
|
|
9
|
+
P2WPKH = "P2WPKH"
|
|
10
|
+
}
|
|
3
11
|
export declare class AddressVerificator {
|
|
4
|
-
static isValidP2TRAddress(inAddress:
|
|
5
|
-
static
|
|
12
|
+
static isValidP2TRAddress(inAddress: string, network: Network): boolean;
|
|
13
|
+
static isP2WPKHAddress(inAddress: string, network: Network): boolean;
|
|
14
|
+
static isP2PKHOrP2SH(addy: string, network: Network): boolean;
|
|
15
|
+
static isValidPublicKey(input: string, network: Network): boolean;
|
|
16
|
+
static validateBitcoinAddress(addy: string, network: Network): AddressTypes | null;
|
|
6
17
|
}
|
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
import { Address } from '@btc-vision/bsi-binary';
|
|
2
1
|
import { BIP32API, BIP32Interface } from 'bip32';
|
|
3
|
-
import { Network } from 'bitcoinjs-lib';
|
|
2
|
+
import { Network, Signer } from 'bitcoinjs-lib';
|
|
4
3
|
import { ECPairAPI, ECPairInterface } from 'ecpair';
|
|
5
4
|
import { IWallet } from './interfaces/IWallet.js';
|
|
6
5
|
export declare class EcKeyPair {
|
|
7
6
|
static BIP32: BIP32API;
|
|
8
7
|
static ECPair: ECPairAPI;
|
|
9
8
|
static fromWIF(wif: string, network?: Network): ECPairInterface;
|
|
10
|
-
static fromPrivateKey(privateKey: Buffer, network?: Network): ECPairInterface;
|
|
11
|
-
static fromPublicKey(publicKey: Buffer, network?: Network): ECPairInterface;
|
|
12
|
-
static generateMultiSigAddress(pubKeys: Buffer[], minimumSignatureRequired: number, network?: Network):
|
|
9
|
+
static fromPrivateKey(privateKey: Buffer | Uint8Array, network?: Network): ECPairInterface;
|
|
10
|
+
static fromPublicKey(publicKey: Buffer | Uint8Array, network?: Network): ECPairInterface;
|
|
11
|
+
static generateMultiSigAddress(pubKeys: Buffer[], minimumSignatureRequired: number, network?: Network): string;
|
|
13
12
|
static verifyPubKeys(pubKeys: Buffer[], network?: Network): Buffer[];
|
|
14
|
-
static getP2WPKHAddress(keyPair: ECPairInterface, network?: Network):
|
|
13
|
+
static getP2WPKHAddress(keyPair: ECPairInterface, network?: Network): string;
|
|
14
|
+
static tweakedPubKeyToAddress(tweakedPubKeyHex: string, network: Network): string;
|
|
15
|
+
static tweakedPubKeyBufferToAddress(tweakedPubKeyBuffer: Buffer | Uint8Array, network: Network): string;
|
|
16
|
+
static xOnlyTweakedPubKeyToAddress(tweakedPubKeyHex: string, network: Network): string;
|
|
17
|
+
static tweakPublicKey(compressedPubKeyHex: string): string;
|
|
15
18
|
static generateWallet(network?: Network): IWallet;
|
|
16
|
-
static verifyContractAddress(contractAddress:
|
|
17
|
-
static getLegacySegwitAddress(keyPair: ECPairInterface, network?: Network):
|
|
18
|
-
static getLegacyAddress(keyPair: ECPairInterface, network?: Network):
|
|
19
|
-
static getP2PKAddress(keyPair: ECPairInterface, network?: Network):
|
|
19
|
+
static verifyContractAddress(contractAddress: string, network?: Network): boolean;
|
|
20
|
+
static getLegacySegwitAddress(keyPair: ECPairInterface, network?: Network): string;
|
|
21
|
+
static getLegacyAddress(keyPair: ECPairInterface, network?: Network): string;
|
|
22
|
+
static getP2PKAddress(keyPair: ECPairInterface, network?: Network): string;
|
|
20
23
|
static generateRandomKeyPair(network?: Network): ECPairInterface;
|
|
21
24
|
static fromSeed(seed: Buffer, network?: Network): BIP32Interface;
|
|
22
|
-
static getTaprootAddress(keyPair: ECPairInterface, network?: Network):
|
|
23
|
-
static getTaprootAddressFromAddress(inAddr:
|
|
25
|
+
static getTaprootAddress(keyPair: ECPairInterface | Signer, network?: Network): string;
|
|
26
|
+
static getTaprootAddressFromAddress(inAddr: string, network?: Network): string;
|
|
24
27
|
static fromSeedKeyPair(seed: Buffer, network?: Network): ECPairInterface;
|
|
25
28
|
}
|
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
import { IWallet } from './interfaces/IWallet.js';
|
|
2
2
|
import { ECPairInterface } from 'ecpair';
|
|
3
3
|
import { Network } from 'bitcoinjs-lib';
|
|
4
|
-
import { Address } from '
|
|
4
|
+
import { Address } from './Address.js';
|
|
5
5
|
export declare class Wallet {
|
|
6
6
|
readonly network: Network;
|
|
7
7
|
private readonly _keypair;
|
|
8
8
|
private readonly _p2wpkh;
|
|
9
9
|
private readonly _p2tr;
|
|
10
10
|
private readonly _legacy;
|
|
11
|
+
private readonly _segwitLegacy;
|
|
12
|
+
private readonly _bufferPubKey;
|
|
13
|
+
private readonly _tweakedKey;
|
|
14
|
+
private readonly _address;
|
|
11
15
|
constructor(wallet: IWallet, network?: Network);
|
|
16
|
+
get address(): Address;
|
|
17
|
+
get tweakedPubKeyKey(): Buffer;
|
|
12
18
|
get keypair(): ECPairInterface;
|
|
13
|
-
get p2wpkh():
|
|
14
|
-
get p2tr():
|
|
15
|
-
get legacy():
|
|
16
|
-
get addresses():
|
|
19
|
+
get p2wpkh(): string;
|
|
20
|
+
get p2tr(): string;
|
|
21
|
+
get legacy(): string;
|
|
22
|
+
get addresses(): string[];
|
|
23
|
+
get segwitLegacy(): string;
|
|
17
24
|
get publicKey(): Buffer;
|
|
18
25
|
get xOnly(): Buffer;
|
|
19
26
|
static fromWif(wif: string, network?: Network): Wallet;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Address } from '@btc-vision/bsi-binary';
|
|
2
1
|
import { Network } from 'bitcoinjs-lib';
|
|
3
2
|
export declare abstract class ContractBaseMetadata {
|
|
4
3
|
protected network: Network;
|
|
5
|
-
protected abstract readonly address:
|
|
4
|
+
protected abstract readonly address: string;
|
|
6
5
|
protected constructor(network?: Network);
|
|
7
|
-
static getAddress(network?: Network):
|
|
8
|
-
getAddress():
|
|
6
|
+
static getAddress(network?: Network): string;
|
|
7
|
+
getAddress(): string;
|
|
9
8
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Address } from '@btc-vision/bsi-binary';
|
|
2
1
|
import { Network } from 'bitcoinjs-lib';
|
|
3
2
|
import { ChainId } from '../../network/ChainId.js';
|
|
4
3
|
import { ContractBaseMetadata } from '../ContractBaseMetadata.js';
|
|
@@ -7,8 +6,8 @@ export declare class wBTC extends ContractBaseMetadata {
|
|
|
7
6
|
readonly tokenName: string;
|
|
8
7
|
readonly tokenSymbol: string;
|
|
9
8
|
readonly decimals: number;
|
|
10
|
-
protected readonly address:
|
|
9
|
+
protected readonly address: string;
|
|
11
10
|
constructor(network?: Network, chainId?: ChainId);
|
|
12
|
-
static getAddress(network?: Network, chainId?: ChainId):
|
|
11
|
+
static getAddress(network?: Network, chainId?: ChainId): string;
|
|
13
12
|
private static getWBTCAddressForChain;
|
|
14
13
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Address } from '@btc-vision/bsi-binary';
|
|
2
1
|
import { ChainId } from '../network/ChainId.js';
|
|
2
|
+
import { Address } from '../keypair/Address.js';
|
|
3
3
|
export declare const FACTORY_ADDRESS_REGTEST: Address;
|
|
4
4
|
export declare const POOL_ADDRESS_REGTEST: Address;
|
|
5
5
|
export declare const WBTC_ADDRESS_REGTEST: Address;
|
package/browser/opnet.d.ts
CHANGED
|
@@ -43,6 +43,17 @@ export * from './wbtc/UnwrapGeneration.js';
|
|
|
43
43
|
export * from './consensus/ConsensusConfig.js';
|
|
44
44
|
export * from './consensus/Consensus.js';
|
|
45
45
|
export * from './consensus/metadata/RoswellConsensus.js';
|
|
46
|
+
export * from './utils/BufferHelper.js';
|
|
47
|
+
export * from './utils/types.js';
|
|
48
|
+
export * from './keypair/Address.js';
|
|
49
|
+
export * from './event/NetEvent.js';
|
|
50
|
+
export * from './deterministic/DeterministicMap.js';
|
|
51
|
+
export * from './deterministic/DeterministicSet.js';
|
|
52
|
+
export * from './deterministic/AddressMap.js';
|
|
53
|
+
export * from './deterministic/AddressSet.js';
|
|
54
|
+
export * from './abi/ABICoder.js';
|
|
55
|
+
export * from './buffer/BinaryWriter.js';
|
|
56
|
+
export * from './buffer/BinaryReader.js';
|
|
46
57
|
export * from './transaction/browser/BrowserSignerBase.js';
|
|
47
58
|
export * from './transaction/browser/extensions/UnisatSigner.js';
|
|
48
59
|
export * from './transaction/browser/types/Unisat.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Network
|
|
1
|
+
import { Network } from 'bitcoinjs-lib';
|
|
2
2
|
import { ECPairInterface } from 'ecpair';
|
|
3
3
|
export interface TweakSettings {
|
|
4
4
|
readonly network?: Network;
|
|
5
5
|
tweakHash?: Buffer;
|
|
6
6
|
}
|
|
7
7
|
export declare class TweakedSigner {
|
|
8
|
-
static tweakSigner(signer: ECPairInterface, opts?: TweakSettings):
|
|
8
|
+
static tweakSigner(signer: ECPairInterface, opts?: TweakSettings): ECPairInterface;
|
|
9
9
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Address } from '@btc-vision/bsi-binary';
|
|
2
1
|
import { Transaction } from 'bitcoinjs-lib';
|
|
3
2
|
import { UTXO } from '../utxo/interfaces/IUTXO.js';
|
|
4
3
|
import { ICustomTransactionParameters } from './builders/CustomScriptTransaction.js';
|
|
@@ -8,15 +7,16 @@ import { TransactionType } from './enums/TransactionType.js';
|
|
|
8
7
|
import { IDeploymentParameters, IFundingTransactionParameters, IInteractionParameters, IUnwrapParameters, IWrapParameters } from './interfaces/ITransactionParameters.js';
|
|
9
8
|
export interface DeploymentResult {
|
|
10
9
|
readonly transaction: [string, string];
|
|
11
|
-
readonly contractAddress:
|
|
12
|
-
readonly
|
|
10
|
+
readonly contractAddress: string;
|
|
11
|
+
readonly contractPubKey: string;
|
|
12
|
+
readonly p2trAddress: string;
|
|
13
13
|
readonly utxos: UTXO[];
|
|
14
14
|
}
|
|
15
15
|
export interface WrapResult {
|
|
16
16
|
readonly transaction: [string, string];
|
|
17
|
-
readonly vaultAddress:
|
|
17
|
+
readonly vaultAddress: string;
|
|
18
18
|
readonly amount: bigint;
|
|
19
|
-
readonly receiverAddress:
|
|
19
|
+
readonly receiverAddress: string;
|
|
20
20
|
readonly utxos: UTXO[];
|
|
21
21
|
}
|
|
22
22
|
export interface FundingTransactionResponse {
|
|
@@ -45,7 +45,7 @@ export declare class TransactionFactory {
|
|
|
45
45
|
unwrapSegwit(unwrapParameters: IUnwrapParameters): Promise<UnwrapResult>;
|
|
46
46
|
unwrap(unwrapParameters: IUnwrapParameters): Promise<UnwrapResult>;
|
|
47
47
|
createBTCTransfer(parameters: IFundingTransactionParameters): Promise<BitcoinTransferResponse>;
|
|
48
|
-
getAllNewUTXOs(original: TransactionBuilder<TransactionType>, tx: Transaction, to:
|
|
48
|
+
getAllNewUTXOs(original: TransactionBuilder<TransactionType>, tx: Transaction, to: string): UTXO[];
|
|
49
49
|
private createFundTransaction;
|
|
50
50
|
private calculateNumSignatures;
|
|
51
51
|
private calculateNumInputs;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Network, Psbt, Signer } from 'bitcoinjs-lib';
|
|
2
|
-
import { Address } from '@btc-vision/bsi-binary';
|
|
3
2
|
export declare abstract class CustomKeypair implements Signer {
|
|
4
3
|
abstract network: Network;
|
|
5
4
|
abstract publicKey: Buffer;
|
|
6
|
-
abstract addresses:
|
|
7
|
-
abstract p2tr:
|
|
8
|
-
abstract p2wpkh:
|
|
5
|
+
abstract addresses: string[];
|
|
6
|
+
abstract p2tr: string;
|
|
7
|
+
abstract p2wpkh: string;
|
|
9
8
|
protected constructor();
|
|
10
9
|
abstract signTaprootInput(transaction: Psbt, i: number, sighashTypes: number[]): Promise<void>;
|
|
11
10
|
abstract signInput(transaction: Psbt, i: number, sighashTypes: number[]): Promise<void>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Address } from '@btc-vision/bsi-binary';
|
|
2
1
|
import { Network, Psbt } from 'bitcoinjs-lib';
|
|
3
2
|
import { CustomKeypair } from '../BrowserSignerBase.js';
|
|
4
3
|
import { Unisat } from '../types/Unisat.js';
|
|
@@ -12,11 +11,11 @@ export declare class UnisatSigner extends CustomKeypair {
|
|
|
12
11
|
private isInitialized;
|
|
13
12
|
constructor();
|
|
14
13
|
private _p2tr;
|
|
15
|
-
get p2tr():
|
|
14
|
+
get p2tr(): string;
|
|
16
15
|
private _p2wpkh;
|
|
17
|
-
get p2wpkh():
|
|
16
|
+
get p2wpkh(): string;
|
|
18
17
|
private _addresses;
|
|
19
|
-
get addresses():
|
|
18
|
+
get addresses(): string[];
|
|
20
19
|
private _publicKey;
|
|
21
20
|
get publicKey(): Buffer;
|
|
22
21
|
_network: Network | undefined;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Address } from '@btc-vision/bsi-binary';
|
|
2
1
|
import { Web3Provider } from '../Web3Provider.js';
|
|
3
2
|
export declare enum UnisatNetwork {
|
|
4
3
|
testnet = "testnet",
|
|
@@ -37,7 +36,7 @@ export interface ToSignInputPublicKey extends ToSignInputBase {
|
|
|
37
36
|
readonly publicKey: string;
|
|
38
37
|
}
|
|
39
38
|
export interface ToSignInputAddress extends ToSignInputBase {
|
|
40
|
-
readonly address:
|
|
39
|
+
readonly address: string;
|
|
41
40
|
}
|
|
42
41
|
export type ToSignInput = ToSignInputPublicKey | ToSignInputAddress;
|
|
43
42
|
export interface PsbtSignatureOptions {
|
|
@@ -46,7 +45,7 @@ export interface PsbtSignatureOptions {
|
|
|
46
45
|
}
|
|
47
46
|
export interface Unisat {
|
|
48
47
|
web3?: Web3Provider;
|
|
49
|
-
sendBitcoin(toAddress:
|
|
48
|
+
sendBitcoin(toAddress: string, satoshis: number, options: {
|
|
50
49
|
feeRate: number;
|
|
51
50
|
memo?: string;
|
|
52
51
|
memos?: string[];
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { TransactionType } from '../enums/TransactionType.js';
|
|
2
2
|
import { TapLeafScript } from '../interfaces/Tap.js';
|
|
3
3
|
import { SharedInteractionParameters } from '../interfaces/ITransactionParameters.js';
|
|
4
|
-
import { Address } from '@btc-vision/bsi-binary';
|
|
5
4
|
import { Payment, Psbt, Stack } from 'bitcoinjs-lib';
|
|
6
5
|
import { TransactionBuilder } from './TransactionBuilder.js';
|
|
7
6
|
export interface ICustomTransactionParameters extends SharedInteractionParameters {
|
|
8
7
|
readonly script: (Buffer | Stack)[];
|
|
9
8
|
readonly witnesses: Buffer[];
|
|
10
|
-
readonly to:
|
|
9
|
+
readonly to: string;
|
|
11
10
|
}
|
|
12
11
|
export declare class CustomScriptTransaction extends TransactionBuilder<TransactionType.CUSTOM_CODE> {
|
|
13
12
|
type: TransactionType.CUSTOM_CODE;
|
|
14
|
-
protected readonly _scriptAddress:
|
|
13
|
+
protected readonly _scriptAddress: string;
|
|
15
14
|
protected tapLeafScript: TapLeafScript | null;
|
|
16
15
|
private targetScriptRedeem;
|
|
17
16
|
private leftOverFundsScriptRedeem;
|
|
@@ -23,8 +22,8 @@ export declare class CustomScriptTransaction extends TransactionBuilder<Transact
|
|
|
23
22
|
private readonly randomBytes;
|
|
24
23
|
private readonly witnesses;
|
|
25
24
|
constructor(parameters: ICustomTransactionParameters);
|
|
26
|
-
get scriptAddress():
|
|
27
|
-
get p2trAddress():
|
|
25
|
+
get scriptAddress(): string;
|
|
26
|
+
get p2trAddress(): string;
|
|
28
27
|
getRndBytes(): Buffer;
|
|
29
28
|
protected contractSignerXOnlyPubKey(): Buffer;
|
|
30
29
|
protected buildTransaction(): Promise<void>;
|
|
@@ -3,7 +3,7 @@ import { IDeploymentParameters } from '../interfaces/ITransactionParameters.js';
|
|
|
3
3
|
import { Payment, Psbt } from 'bitcoinjs-lib';
|
|
4
4
|
import { TransactionBuilder } from './TransactionBuilder.js';
|
|
5
5
|
import { TapLeafScript } from '../interfaces/Tap.js';
|
|
6
|
-
import { Address } from '
|
|
6
|
+
import { Address } from '../../keypair/Address.js';
|
|
7
7
|
export declare class DeploymentTransaction extends TransactionBuilder<TransactionType.DEPLOYMENT> {
|
|
8
8
|
static readonly MAXIMUM_CONTRACT_SIZE: number;
|
|
9
9
|
type: TransactionType.DEPLOYMENT;
|
|
@@ -18,10 +18,12 @@ export declare class DeploymentTransaction extends TransactionBuilder<Transactio
|
|
|
18
18
|
private readonly bytecode;
|
|
19
19
|
private readonly calldata?;
|
|
20
20
|
private readonly contractSigner;
|
|
21
|
+
private readonly _contractPubKey;
|
|
21
22
|
private readonly randomBytes;
|
|
22
23
|
constructor(parameters: IDeploymentParameters);
|
|
24
|
+
get contractPubKey(): string;
|
|
23
25
|
get contractAddress(): Address;
|
|
24
|
-
get p2trAddress():
|
|
26
|
+
get p2trAddress(): string;
|
|
25
27
|
getRndBytes(): Buffer;
|
|
26
28
|
protected contractSignerXOnlyPubKey(): Buffer;
|
|
27
29
|
protected buildTransaction(): Promise<void>;
|
|
@@ -2,6 +2,7 @@ import { TransactionType } from '../enums/TransactionType.js';
|
|
|
2
2
|
import { IFundingTransactionParameters } from '../interfaces/ITransactionParameters.js';
|
|
3
3
|
import { Signer } from 'bitcoinjs-lib';
|
|
4
4
|
import { TransactionBuilder } from './TransactionBuilder.js';
|
|
5
|
+
import { ECPairInterface } from 'ecpair';
|
|
5
6
|
export declare class FundingTransaction extends TransactionBuilder<TransactionType.FUNDING> {
|
|
6
7
|
readonly type: TransactionType.FUNDING;
|
|
7
8
|
protected amount: bigint;
|
|
@@ -9,5 +10,5 @@ export declare class FundingTransaction extends TransactionBuilder<TransactionTy
|
|
|
9
10
|
constructor(parameters: IFundingTransactionParameters);
|
|
10
11
|
protected buildTransaction(): Promise<void>;
|
|
11
12
|
protected splitInputs(amountSpent: bigint): void;
|
|
12
|
-
protected getSignerKey(): Signer;
|
|
13
|
+
protected getSignerKey(): Signer | ECPairInterface;
|
|
13
14
|
}
|
|
@@ -4,16 +4,16 @@ import { Taptree } from 'bitcoinjs-lib/src/types.js';
|
|
|
4
4
|
import { TransactionBuilder } from './TransactionBuilder.js';
|
|
5
5
|
import { TransactionType } from '../enums/TransactionType.js';
|
|
6
6
|
import { ITransactionParameters } from '../interfaces/ITransactionParameters.js';
|
|
7
|
-
import {
|
|
7
|
+
import { ECPairInterface } from 'ecpair';
|
|
8
8
|
export interface MultiSignParameters extends Omit<ITransactionParameters, 'priorityFee' | 'signer'> {
|
|
9
9
|
readonly pubkeys: Buffer[];
|
|
10
10
|
readonly minimumSignatures: number;
|
|
11
11
|
readonly from?: undefined;
|
|
12
12
|
readonly to?: undefined;
|
|
13
13
|
readonly psbt?: Psbt;
|
|
14
|
-
readonly receiver:
|
|
14
|
+
readonly receiver: string;
|
|
15
15
|
readonly requestedAmount: bigint;
|
|
16
|
-
readonly refundVault:
|
|
16
|
+
readonly refundVault: string;
|
|
17
17
|
}
|
|
18
18
|
export interface MultiSignFromBase64Params extends Omit<MultiSignParameters, 'psbt'> {
|
|
19
19
|
readonly psbt: string;
|
|
@@ -31,13 +31,13 @@ export declare class MultiSignTransaction extends TransactionBuilder<Transaction
|
|
|
31
31
|
protected readonly minimumSignatures: number;
|
|
32
32
|
protected readonly originalInputCount: number;
|
|
33
33
|
protected readonly requestedAmount: bigint;
|
|
34
|
-
protected readonly receiver:
|
|
35
|
-
protected readonly refundVault:
|
|
34
|
+
protected readonly receiver: string;
|
|
35
|
+
protected readonly refundVault: string;
|
|
36
36
|
protected readonly sighashTypes: number[];
|
|
37
37
|
constructor(parameters: MultiSignParameters);
|
|
38
38
|
static fromBase64(params: MultiSignFromBase64Params): MultiSignTransaction;
|
|
39
39
|
static verifyIfSigned(psbt: Psbt, signerPubKey: Buffer): boolean;
|
|
40
|
-
static signPartial(psbt: Psbt, signer: Signer, originalInputCount: number, minimums: number[]): {
|
|
40
|
+
static signPartial(psbt: Psbt, signer: Signer | ECPairInterface, originalInputCount: number, minimums: number[]): {
|
|
41
41
|
final: boolean;
|
|
42
42
|
signed: boolean;
|
|
43
43
|
};
|
|
@@ -16,7 +16,7 @@ export declare abstract class SharedInteractionTransaction<T extends Transaction
|
|
|
16
16
|
protected calldataGenerator: CalldataGenerator;
|
|
17
17
|
protected readonly calldata: Buffer;
|
|
18
18
|
protected abstract readonly contractSecret: Buffer;
|
|
19
|
-
protected readonly scriptSigner: Signer;
|
|
19
|
+
protected readonly scriptSigner: Signer | ECPairInterface;
|
|
20
20
|
protected readonly disableAutoRefund: boolean;
|
|
21
21
|
protected constructor(parameters: SharedInteractionParameters);
|
|
22
22
|
getContractSecret(): Buffer;
|
|
@@ -2,7 +2,6 @@ import { Network, Psbt, Signer, Transaction } from 'bitcoinjs-lib';
|
|
|
2
2
|
import { PsbtInputExtended, PsbtOutputExtended, UpdateInput } from '../interfaces/Tap.js';
|
|
3
3
|
import { TransactionType } from '../enums/TransactionType.js';
|
|
4
4
|
import { IFundingTransactionParameters, ITransactionParameters } from '../interfaces/ITransactionParameters.js';
|
|
5
|
-
import { Address } from '@btc-vision/bsi-binary';
|
|
6
5
|
import { UTXO } from '../../utxo/interfaces/IUTXO.js';
|
|
7
6
|
import { ECPairInterface } from 'ecpair';
|
|
8
7
|
import { TweakedTransaction } from '../shared/TweakedTransaction.js';
|
|
@@ -20,20 +19,20 @@ export declare abstract class TransactionBuilder<T extends TransactionType> exte
|
|
|
20
19
|
protected readonly outputs: PsbtOutputExtended[];
|
|
21
20
|
protected feeOutput: PsbtOutputExtended | null;
|
|
22
21
|
protected totalInputAmount: bigint;
|
|
23
|
-
protected readonly signer: Signer;
|
|
22
|
+
protected readonly signer: Signer | ECPairInterface;
|
|
24
23
|
protected readonly network: Network;
|
|
25
24
|
protected readonly feeRate: number;
|
|
26
25
|
protected priorityFee: bigint;
|
|
27
26
|
protected utxos: UTXO[];
|
|
28
|
-
protected to:
|
|
29
|
-
protected from:
|
|
27
|
+
protected to: string | undefined;
|
|
28
|
+
protected from: string;
|
|
30
29
|
protected _maximumFeeRate: number;
|
|
31
30
|
protected isPubKeyDestination: boolean;
|
|
32
31
|
protected constructor(parameters: ITransactionParameters);
|
|
33
|
-
static getFrom(from: string | undefined, keypair: ECPairInterface, network: Network):
|
|
32
|
+
static getFrom(from: string | undefined, keypair: ECPairInterface | Signer, network: Network): string;
|
|
34
33
|
static witnessStackToScriptWitness(witness: Buffer[]): Buffer;
|
|
35
34
|
getFundingTransactionParameters(): Promise<IFundingTransactionParameters>;
|
|
36
|
-
setDestinationAddress(address:
|
|
35
|
+
setDestinationAddress(address: string): void;
|
|
37
36
|
setMaximumFeeRate(feeRate: number): void;
|
|
38
37
|
signTransaction(): Promise<Transaction>;
|
|
39
38
|
generateTransactionMinimalSignatures(checkPartialSigs?: boolean): Promise<void>;
|
|
@@ -41,7 +40,7 @@ export declare abstract class TransactionBuilder<T extends TransactionType> exte
|
|
|
41
40
|
addInput(input: PsbtInputExtended): void;
|
|
42
41
|
addOutput(output: PsbtOutputExtended): void;
|
|
43
42
|
toAddress(): string | undefined;
|
|
44
|
-
address():
|
|
43
|
+
address(): string | undefined;
|
|
45
44
|
estimateTransactionFees(): Promise<bigint>;
|
|
46
45
|
rebuildFromBase64(base64: string): Promise<Psbt>;
|
|
47
46
|
setPSBT(psbt: Psbt): void;
|
|
@@ -3,12 +3,12 @@ import { TransactionType } from '../enums/TransactionType.js';
|
|
|
3
3
|
import { TapLeafScript } from '../interfaces/Tap.js';
|
|
4
4
|
import { IWrapParameters } from '../interfaces/ITransactionParameters.js';
|
|
5
5
|
import { SharedInteractionTransaction } from './SharedInteractionTransaction.js';
|
|
6
|
-
import { Address } from '@btc-vision/bsi-binary';
|
|
7
6
|
import { WrappedGeneration } from '../../wbtc/WrappedGenerationParameters.js';
|
|
7
|
+
import { Address } from '../../keypair/Address.js';
|
|
8
8
|
export declare class WrapTransaction extends SharedInteractionTransaction<TransactionType.WBTC_WRAP> {
|
|
9
9
|
private static readonly WRAP_SELECTOR;
|
|
10
10
|
type: TransactionType.WBTC_WRAP;
|
|
11
|
-
readonly vault:
|
|
11
|
+
readonly vault: string;
|
|
12
12
|
readonly amount: bigint;
|
|
13
13
|
readonly receiver: Address;
|
|
14
14
|
protected readonly compiledTargetScript: Buffer;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { UTXO } from '../../utxo/interfaces/IUTXO.js';
|
|
2
|
-
import { Address } from '@btc-vision/bsi-binary';
|
|
3
2
|
import { WrappedGeneration } from '../../wbtc/WrappedGenerationParameters.js';
|
|
4
3
|
import { ITweakedTransactionData } from '../shared/TweakedTransaction.js';
|
|
5
4
|
import { VaultUTXOs } from '../processor/PsbtTransaction.js';
|
|
6
5
|
import { ChainId } from '../../network/ChainId.js';
|
|
7
6
|
import { PsbtOutputExtended } from './Tap.js';
|
|
7
|
+
import { Address } from '../../keypair/Address.js';
|
|
8
8
|
export interface ITransactionParameters extends ITweakedTransactionData {
|
|
9
|
-
readonly from?:
|
|
10
|
-
readonly to?:
|
|
9
|
+
readonly from?: string;
|
|
10
|
+
readonly to?: string;
|
|
11
11
|
utxos: UTXO[];
|
|
12
12
|
nonWitnessUtxo?: Buffer;
|
|
13
13
|
estimatedFees?: bigint;
|
|
@@ -27,11 +27,11 @@ export interface SharedInteractionParameters extends ITransactionParameters {
|
|
|
27
27
|
}
|
|
28
28
|
export interface IInteractionParameters extends Omit<SharedInteractionParameters, 'optionalOutputs'> {
|
|
29
29
|
readonly calldata: Buffer;
|
|
30
|
-
readonly to:
|
|
30
|
+
readonly to: string;
|
|
31
31
|
}
|
|
32
32
|
export interface IWrapParameters extends Omit<SharedInteractionParameters, 'optionalOutputs'> {
|
|
33
|
-
readonly to?:
|
|
34
|
-
readonly from:
|
|
33
|
+
readonly to?: string;
|
|
34
|
+
readonly from: string;
|
|
35
35
|
readonly amount: bigint;
|
|
36
36
|
readonly receiver?: Address;
|
|
37
37
|
readonly generationParameters: WrappedGeneration;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Address } from '@btc-vision/bsi-binary';
|
|
2
1
|
import { Network, Psbt, Signer, Transaction } from 'bitcoinjs-lib';
|
|
3
2
|
import { PsbtInputExtended, PsbtOutputExtended } from '../interfaces/Tap.js';
|
|
4
3
|
import { ITweakedTransactionData, TweakedTransaction } from '../shared/TweakedTransaction.js';
|
|
@@ -8,7 +7,7 @@ export interface PsbtTransactionData extends ITweakedTransactionData {
|
|
|
8
7
|
readonly network: Network;
|
|
9
8
|
}
|
|
10
9
|
export interface IWBTCUTXODocument {
|
|
11
|
-
readonly vault:
|
|
10
|
+
readonly vault: string;
|
|
12
11
|
readonly blockId: bigint;
|
|
13
12
|
readonly hash: string;
|
|
14
13
|
readonly value: bigint;
|
|
@@ -16,8 +15,8 @@ export interface IWBTCUTXODocument {
|
|
|
16
15
|
readonly output: string;
|
|
17
16
|
}
|
|
18
17
|
export interface VaultUTXOs {
|
|
19
|
-
readonly vault:
|
|
20
|
-
readonly publicKeys:
|
|
18
|
+
readonly vault: string;
|
|
19
|
+
readonly publicKeys: string[];
|
|
21
20
|
readonly minimum: number;
|
|
22
21
|
readonly utxos: IWBTCUTXODocument[];
|
|
23
22
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Network } from 'bitcoinjs-lib';
|
|
2
|
-
import { Address } from '@btc-vision/bsi-binary';
|
|
3
2
|
export declare class P2TR_MS {
|
|
4
|
-
static generateMultiSigAddress(pubKeys: Buffer[], minimumSignatureRequired: number, network?: Network):
|
|
3
|
+
static generateMultiSigAddress(pubKeys: Buffer[], minimumSignatureRequired: number, network?: Network): string;
|
|
5
4
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Logger } from '@btc-vision/logger';
|
|
2
2
|
import { Network, Payment, Psbt, Signer, Transaction } from 'bitcoinjs-lib';
|
|
3
|
+
import { ECPairInterface } from 'ecpair';
|
|
3
4
|
import { PsbtInput } from 'bip174/src/lib/interfaces.js';
|
|
4
5
|
import { UTXO } from '../../utxo/interfaces/IUTXO.js';
|
|
5
6
|
import { PsbtInputExtended, TapLeafScript } from '../interfaces/Tap.js';
|
|
6
7
|
import { ChainId } from '../../network/ChainId.js';
|
|
7
8
|
export interface ITweakedTransactionData {
|
|
8
|
-
readonly signer: Signer;
|
|
9
|
+
readonly signer: Signer | ECPairInterface;
|
|
9
10
|
readonly network: Network;
|
|
10
11
|
readonly chainId?: ChainId;
|
|
11
12
|
readonly nonWitnessUtxo?: Buffer;
|
|
@@ -17,8 +18,8 @@ export declare enum TransactionSequence {
|
|
|
17
18
|
export declare abstract class TweakedTransaction extends Logger {
|
|
18
19
|
readonly logColor: string;
|
|
19
20
|
finalized: boolean;
|
|
20
|
-
protected signer: Signer;
|
|
21
|
-
protected tweakedSigner?:
|
|
21
|
+
protected signer: Signer | ECPairInterface;
|
|
22
|
+
protected tweakedSigner?: ECPairInterface;
|
|
22
23
|
protected network: Network;
|
|
23
24
|
protected signed: boolean;
|
|
24
25
|
protected abstract readonly transaction: Psbt;
|
|
@@ -35,7 +36,7 @@ export declare abstract class TweakedTransaction extends Logger {
|
|
|
35
36
|
protected constructor(data: ITweakedTransactionData);
|
|
36
37
|
static readScriptWitnessToWitnessStack(Buffer: Buffer): Buffer[];
|
|
37
38
|
static preEstimateTaprootTransactionFees(feeRate: bigint, numInputs: bigint, numOutputs: bigint, numWitnessElements: bigint, witnessElementSize: bigint, emptyWitness: bigint, taprootControlWitnessSize?: bigint, taprootScriptSize?: bigint): bigint;
|
|
38
|
-
protected static signInput(transaction: Psbt, input: PsbtInput, i: number, signer: Signer, sighashTypes: number[]): void;
|
|
39
|
+
protected static signInput(transaction: Psbt, input: PsbtInput, i: number, signer: Signer | ECPairInterface, sighashTypes: number[]): void;
|
|
39
40
|
protected static calculateSignHash(sighashTypes: number[]): number;
|
|
40
41
|
ignoreSignatureError(): void;
|
|
41
42
|
getScriptAddress(): string;
|
|
@@ -46,13 +47,13 @@ export declare abstract class TweakedTransaction extends Logger {
|
|
|
46
47
|
preEstimateTransactionFees(feeRate: bigint, numInputs: bigint, numOutputs: bigint, numSignatures: bigint, numPubkeys: bigint): bigint;
|
|
47
48
|
protected generateTapData(): Payment;
|
|
48
49
|
protected generateScriptAddress(): Payment;
|
|
49
|
-
protected getSignerKey(): Signer;
|
|
50
|
-
protected signInput(transaction: Psbt, input: PsbtInput, i: number, signer?: Signer): Promise<void>;
|
|
50
|
+
protected getSignerKey(): Signer | ECPairInterface;
|
|
51
|
+
protected signInput(transaction: Psbt, input: PsbtInput, i: number, signer?: Signer | ECPairInterface): Promise<void>;
|
|
51
52
|
protected splitArray<T>(arr: T[], chunkSize: number): T[][];
|
|
52
53
|
protected signInputs(transaction: Psbt): Promise<void>;
|
|
53
54
|
protected internalPubKeyToXOnly(): Buffer;
|
|
54
55
|
protected internalInit(): void;
|
|
55
56
|
protected tweakSigner(): void;
|
|
56
|
-
protected getTweakedSigner(useTweakedHash?: boolean, signer?: Signer):
|
|
57
|
+
protected getTweakedSigner(useTweakedHash?: boolean, signer?: Signer | ECPairInterface): ECPairInterface | undefined;
|
|
57
58
|
protected generatePsbtInputExtended(utxo: UTXO, i: number): PsbtInputExtended;
|
|
58
59
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MemorySlotPointer } from './types.js';
|
|
2
|
+
export declare class BufferHelper {
|
|
3
|
+
static readonly EXPECTED_BUFFER_LENGTH: number;
|
|
4
|
+
static bufferToUint8Array(buffer: Buffer | Uint8Array): Uint8Array;
|
|
5
|
+
static uint8ArrayToHex(input: Uint8Array): string;
|
|
6
|
+
static hexToUint8Array(input: string): Uint8Array;
|
|
7
|
+
static pointerToUint8Array(pointer: MemorySlotPointer): Uint8Array;
|
|
8
|
+
static uint8ArrayToPointer(input: Uint8Array): MemorySlotPointer;
|
|
9
|
+
static valueToUint8Array(value: bigint): Uint8Array;
|
|
10
|
+
static uint8ArrayToValue(input: Uint8Array): bigint;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DeterministicMap } from '../deterministic/DeterministicMap.js';
|
|
2
|
+
export declare const ADDRESS_BYTE_LENGTH: number;
|
|
3
|
+
export type MemorySlotPointer = bigint;
|
|
4
|
+
export type BufferLike = Uint8Array | Buffer;
|
|
5
|
+
export type MemorySlotData<T> = T;
|
|
6
|
+
export type PointerStorage = DeterministicMap<MemorySlotPointer, MemorySlotData<bigint>>;
|
|
7
|
+
export type i32 = number;
|
|
8
|
+
export type u8 = number;
|
|
9
|
+
export type u16 = number;
|
|
10
|
+
export type u32 = number;
|
|
11
|
+
export type u64 = bigint;
|
|
12
|
+
export type Selector = number;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Address } from '@btc-vision/bsi-binary';
|
|
2
1
|
import { Network } from 'bitcoinjs-lib';
|
|
3
|
-
import { Wallet } from '../opnet.js';
|
|
2
|
+
import { Address, Wallet } from '../opnet.js';
|
|
4
3
|
import { UnwrapGeneration } from '../wbtc/UnwrapGeneration.js';
|
|
5
4
|
import { WrappedGeneration } from '../wbtc/WrappedGenerationParameters.js';
|
|
6
5
|
import { BroadcastResponse } from './interfaces/BroadcastResponse.js';
|
package/build/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.0.
|
|
1
|
+
export declare const version = "1.0.114";
|
package/build/_version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.0.
|
|
1
|
+
export const version = '1.0.114';
|