commit
cdbf56c480
4 changed files with 13 additions and 13 deletions
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "bitcoinjs-lib",
|
||||
"version": "5.0.0",
|
||||
"version": "5.0.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "bitcoinjs-lib",
|
||||
"version": "5.0.0",
|
||||
"version": "5.0.1",
|
||||
"description": "Client-side Bitcoin JavaScript library",
|
||||
"main": "./src/index.js",
|
||||
"types": "./types/index.d.ts",
|
||||
|
|
|
@ -134,8 +134,8 @@ export class TransactionBuilder {
|
|||
addInput(
|
||||
txHash: Buffer | string | Transaction,
|
||||
vout: number,
|
||||
sequence: number,
|
||||
prevOutScript: Buffer,
|
||||
sequence?: number,
|
||||
prevOutScript?: Buffer,
|
||||
): number {
|
||||
if (!this.__canModifyInputs()) {
|
||||
throw new Error('No, this would invalidate signatures');
|
||||
|
@ -188,10 +188,10 @@ export class TransactionBuilder {
|
|||
sign(
|
||||
vin: number,
|
||||
keyPair: ECPairInterface,
|
||||
redeemScript: Buffer,
|
||||
hashType: number,
|
||||
witnessValue: number,
|
||||
witnessScript: Buffer,
|
||||
redeemScript?: Buffer,
|
||||
hashType?: number,
|
||||
witnessValue?: number,
|
||||
witnessScript?: Buffer,
|
||||
): void {
|
||||
// TODO: remove keyPair.network matching in 4.0.0
|
||||
if (keyPair.network && keyPair.network !== this.network)
|
||||
|
@ -267,7 +267,7 @@ export class TransactionBuilder {
|
|||
}
|
||||
|
||||
const signature = keyPair.sign(signatureHash);
|
||||
input.signatures![i] = bscript.signature.encode(signature, hashType);
|
||||
input.signatures![i] = bscript.signature.encode(signature, hashType!);
|
||||
return true;
|
||||
});
|
||||
|
||||
|
@ -679,8 +679,8 @@ function expandOutput(script: Buffer, ourPubKey?: Buffer): TxbOutput {
|
|||
function prepareInput(
|
||||
input: TxbInput,
|
||||
ourPubKey: Buffer,
|
||||
redeemScript: Buffer,
|
||||
witnessScript: Buffer,
|
||||
redeemScript?: Buffer,
|
||||
witnessScript?: Buffer,
|
||||
): TxbInput {
|
||||
if (redeemScript && witnessScript) {
|
||||
const p2wsh = payments.p2wsh({
|
||||
|
|
4
types/transaction_builder.d.ts
vendored
4
types/transaction_builder.d.ts
vendored
|
@ -12,11 +12,11 @@ export declare class TransactionBuilder {
|
|||
constructor(network?: Network, maximumFeeRate?: number);
|
||||
setLockTime(locktime: number): void;
|
||||
setVersion(version: number): void;
|
||||
addInput(txHash: Buffer | string | Transaction, vout: number, sequence: number, prevOutScript: Buffer): number;
|
||||
addInput(txHash: Buffer | string | Transaction, vout: number, sequence?: number, prevOutScript?: Buffer): number;
|
||||
addOutput(scriptPubKey: string | Buffer, value: number): number;
|
||||
build(): Transaction;
|
||||
buildIncomplete(): Transaction;
|
||||
sign(vin: number, keyPair: ECPairInterface, redeemScript: Buffer, hashType: number, witnessValue: number, witnessScript: Buffer): void;
|
||||
sign(vin: number, keyPair: ECPairInterface, redeemScript?: Buffer, hashType?: number, witnessValue?: number, witnessScript?: Buffer): void;
|
||||
private __addInputUnsafe;
|
||||
private __build;
|
||||
private __canModifyInputs;
|
||||
|
|
Loading…
Reference in a new issue