#1477 remove TransactionBuilder and all references to it

This commit is contained in:
Vlad Stan 2020-11-27 11:39:10 +02:00
parent 533d6c2e6d
commit 5c6243f4e4
10 changed files with 4 additions and 6145 deletions

View file

@ -22,5 +22,3 @@ var script_1 = require('./script');
exports.opcodes = script_1.OPS;
var transaction_1 = require('./transaction');
exports.Transaction = transaction_1.Transaction;
var transaction_builder_1 = require('./transaction_builder');
exports.TransactionBuilder = transaction_builder_1.TransactionBuilder;

View file

@ -69,8 +69,7 @@ class Psbt {
__NON_WITNESS_UTXO_BUF_CACHE: [],
__TX_IN_CACHE: {},
__TX: this.data.globalMap.unsignedTx.tx,
// Old TransactionBuilder behavior was to not confirm input values
// before signing. Even though we highly encourage people to get
// Even though we highly encourage people to get
// the full parent transaction to verify values, the ability to
// sign non-segwit inputs without the full transaction was often
// requested. So the only way to activate is to use @ts-ignore.
@ -998,8 +997,7 @@ function getHashForSig(inputIndex, input, cache, forValidate, sighashTypes) {
console.warn(
'Warning: Signing non-segwit inputs without the full parent transaction ' +
'means there is a chance that a miner could feed you incorrect information ' +
'to trick you into paying large fees. This behavior is the same as the old ' +
'TransactionBuilder class when signing non-segwit scripts. You are not ' +
'to trick you into paying large fees. You are not ' +
'able to export this Psbt with toBuffer|toBase64|toHex since it is not ' +
'BIP174 compliant.\n*********************\nPROCEED WITH CAUTION!\n' +
'*********************',

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -12,7 +12,6 @@ export { Block } from './block';
export { Psbt, PsbtTxInput, PsbtTxOutput } from './psbt';
export { OPS as opcodes } from './script';
export { Transaction } from './transaction';
export { TransactionBuilder } from './transaction_builder';
export { BIP32Interface } from 'bip32';
export { ECPairInterface, Signer, SignerAsync } from './ecpair';

View file

@ -117,8 +117,7 @@ export class Psbt {
__NON_WITNESS_UTXO_BUF_CACHE: [],
__TX_IN_CACHE: {},
__TX: (this.data.globalMap.unsignedTx as PsbtTransaction).tx,
// Old TransactionBuilder behavior was to not confirm input values
// before signing. Even though we highly encourage people to get
// Even though we highly encourage people to get
// the full parent transaction to verify values, the ability to
// sign non-segwit inputs without the full transaction was often
// requested. So the only way to activate is to use @ts-ignore.
@ -1295,8 +1294,7 @@ function getHashForSig(
console.warn(
'Warning: Signing non-segwit inputs without the full parent transaction ' +
'means there is a chance that a miner could feed you incorrect information ' +
'to trick you into paying large fees. This behavior is the same as the old ' +
'TransactionBuilder class when signing non-segwit scripts. You are not ' +
'to trick you into paying large fees. You are not ' +
'able to export this Psbt with toBuffer|toBase64|toHex since it is not ' +
'BIP174 compliant.\n*********************\nPROCEED WITH CAUTION!\n' +
'*********************',

File diff suppressed because it is too large Load diff

1
types/index.d.ts vendored
View file

@ -10,7 +10,6 @@ export { Block } from './block';
export { Psbt, PsbtTxInput, PsbtTxOutput } from './psbt';
export { OPS as opcodes } from './script';
export { Transaction } from './transaction';
export { TransactionBuilder } from './transaction_builder';
export { BIP32Interface } from 'bip32';
export { ECPairInterface, Signer, SignerAsync } from './ecpair';
export { Network } from './networks';

View file

@ -1,37 +0,0 @@
import { Signer } from './ecpair';
import { Network } from './networks';
import { Transaction } from './transaction';
interface TxbSignArg {
prevOutScriptType: string;
vin: number;
keyPair: Signer;
redeemScript?: Buffer;
hashType?: number;
witnessValue?: number;
witnessScript?: Buffer;
}
export declare class TransactionBuilder {
network: Network;
maximumFeeRate: number;
static fromTransaction(transaction: Transaction, network?: Network): TransactionBuilder;
private __PREV_TX_SET;
private __INPUTS;
private __TX;
private __USE_LOW_R;
constructor(network?: Network, maximumFeeRate?: number);
setLowR(setting?: boolean): boolean;
setLockTime(locktime: number): void;
setVersion(version: number): void;
addInput(txHash: Buffer | string | Transaction, vout: number, sequence?: number, prevOutScript?: Buffer): number;
addOutput(scriptPubKey: string | Buffer, value: number): number;
build(): Transaction;
buildIncomplete(): Transaction;
sign(signParams: number | TxbSignArg, keyPair?: Signer, redeemScript?: Buffer, hashType?: number, witnessValue?: number, witnessScript?: Buffer): void;
private __addInputUnsafe;
private __build;
private __canModifyInputs;
private __needsOutputs;
private __canModifyOutputs;
private __overMaximumFees;
}
export {};