2019-01-04 10:33:02 +01:00
|
|
|
/// <reference types="node" />
|
2019-06-14 08:25:07 +02:00
|
|
|
import { Signer } from './ecpair';
|
2019-01-04 10:33:02 +01:00
|
|
|
import { Network } from './networks';
|
|
|
|
import { Transaction } from './transaction';
|
2019-06-12 12:33:18 +02:00
|
|
|
interface TxbSignArg {
|
|
|
|
prevOutScriptType: string;
|
|
|
|
vin: number;
|
2019-06-14 08:25:07 +02:00
|
|
|
keyPair: Signer;
|
2019-06-12 12:33:18 +02:00
|
|
|
redeemScript?: Buffer;
|
|
|
|
hashType?: number;
|
|
|
|
witnessValue?: number;
|
|
|
|
witnessScript?: Buffer;
|
|
|
|
}
|
2019-01-04 10:33:02 +01:00
|
|
|
export declare class TransactionBuilder {
|
|
|
|
network: Network;
|
|
|
|
maximumFeeRate: number;
|
2019-03-20 07:25:48 +01:00
|
|
|
static fromTransaction(transaction: Transaction, network?: Network): TransactionBuilder;
|
2019-03-07 06:03:04 +01:00
|
|
|
private __PREV_TX_SET;
|
|
|
|
private __INPUTS;
|
|
|
|
private __TX;
|
2019-04-15 10:27:28 +02:00
|
|
|
private __USE_LOW_R;
|
2019-01-04 10:33:02 +01:00
|
|
|
constructor(network?: Network, maximumFeeRate?: number);
|
2019-04-15 10:27:28 +02:00
|
|
|
setLowR(setting?: boolean): boolean;
|
2019-01-04 10:33:02 +01:00
|
|
|
setLockTime(locktime: number): void;
|
|
|
|
setVersion(version: number): void;
|
2019-04-08 11:15:25 +02:00
|
|
|
addInput(txHash: Buffer | string | Transaction, vout: number, sequence?: number, prevOutScript?: Buffer): number;
|
2019-01-04 10:33:02 +01:00
|
|
|
addOutput(scriptPubKey: string | Buffer, value: number): number;
|
|
|
|
build(): Transaction;
|
|
|
|
buildIncomplete(): Transaction;
|
2019-06-14 08:25:07 +02:00
|
|
|
sign(signParams: number | TxbSignArg, keyPair?: Signer, redeemScript?: Buffer, hashType?: number, witnessValue?: number, witnessScript?: Buffer): void;
|
2019-03-07 06:03:04 +01:00
|
|
|
private __addInputUnsafe;
|
|
|
|
private __build;
|
2019-01-04 10:33:02 +01:00
|
|
|
private __canModifyInputs;
|
|
|
|
private __needsOutputs;
|
|
|
|
private __canModifyOutputs;
|
|
|
|
private __overMaximumFees;
|
|
|
|
}
|
2019-06-12 12:33:18 +02:00
|
|
|
export {};
|