diff --git a/src/transaction_builder.js b/src/transaction_builder.js index 37768a0..06cb6b8 100644 --- a/src/transaction_builder.js +++ b/src/transaction_builder.js @@ -162,12 +162,14 @@ class TransactionBuilder { vin = signParams; } else if (typeof signParams === 'object') { checkSignArgs(this, signParams); - vin = signParams.vin; - keyPair = signParams.keyPair; - redeemScript = signParams.redeemScript; - hashType = signParams.hashType; - witnessValue = signParams.witnessValue; - witnessScript = signParams.witnessScript; + ({ + vin, + keyPair, + redeemScript, + hashType, + witnessValue, + witnessScript, + } = signParams); } else { throw new TypeError( 'TransactionBuilder sign first arg must be TxbSignArg or number', diff --git a/ts_src/transaction_builder.ts b/ts_src/transaction_builder.ts index f4fd644..ccf91cf 100644 --- a/ts_src/transaction_builder.ts +++ b/ts_src/transaction_builder.ts @@ -252,12 +252,14 @@ export class TransactionBuilder { vin = signParams; } else if (typeof signParams === 'object') { checkSignArgs(this, signParams); - vin = signParams.vin; - keyPair = signParams.keyPair; - redeemScript = signParams.redeemScript; - hashType = signParams.hashType; - witnessValue = signParams.witnessValue; - witnessScript = signParams.witnessScript; + ({ + vin, + keyPair, + redeemScript, + hashType, + witnessValue, + witnessScript, + } = signParams); } else { throw new TypeError( 'TransactionBuilder sign first arg must be TxbSignArg or number',