@@ -77,10 +77,7 @@ export function toUnspent(
7777 rootWalletKeys : RootWalletKeys
7878) : Unspent < bigint > {
7979 if ( input . scriptType === 'p2shP2pk' ) {
80- return mockReplayProtectionUnspent ( network , input . value , {
81- key : rootWalletKeys [ 'user' ] ,
82- vout : index ,
83- } ) ;
80+ return mockReplayProtectionUnspent ( network , input . value , { key : rootWalletKeys [ 'user' ] , vout : index } ) ;
8481 } else {
8582 const chain = getInternalChainCode ( input . scriptType === 'taprootKeyPathSpend' ? 'p2trMusig2' : input . scriptType ) ;
8683 return mockWalletUnspent ( network , input . value , {
@@ -98,10 +95,7 @@ export function toUnspent(
9895 * user and backup as signer and cosigner respectively for p2trMusig2.
9996 * user and bitgo as signer and cosigner respectively for other input script types.
10097 */
101- export function getSigners ( inputType : InputScriptType ) : {
102- signerName : KeyName ;
103- cosignerName ?: KeyName ;
104- } {
98+ export function getSigners ( inputType : InputScriptType ) : { signerName : KeyName ; cosignerName ?: KeyName } {
10599 return {
106100 signerName : 'user' ,
107101 cosignerName : inputType === 'p2shP2pk' ? undefined : inputType === 'p2trMusig2' ? 'backup' : 'bitgo' ,
@@ -144,10 +138,7 @@ export function signPsbtInput(
144138 if ( sign === 'fullsigned' && cosignerName && input . scriptType !== 'p2shP2pk' ) {
145139 signPsbt (
146140 psbt ,
147- ( ) =>
148- psbt . signInputHD ( inputIndex , rootWalletKeys [ cosignerName ] , {
149- deterministic,
150- } ) ,
141+ ( ) => psbt . signInputHD ( inputIndex , rootWalletKeys [ cosignerName ] , { deterministic } ) ,
151142 skipNonWitnessUtxo
152143 ) ;
153144 }
@@ -170,11 +161,7 @@ export function signAllPsbtInputs(
170161) : void {
171162 const { signers, deterministic, skipNonWitnessUtxo } = params ?? { } ;
172163 inputs . forEach ( ( input , inputIndex ) => {
173- signPsbtInput ( psbt , input , inputIndex , rootWalletKeys , sign , {
174- signers,
175- deterministic,
176- skipNonWitnessUtxo,
177- } ) ;
164+ signPsbtInput ( psbt , input , inputIndex , rootWalletKeys , sign , { signers, deterministic, skipNonWitnessUtxo } ) ;
178165 } ) ;
179166}
180167
@@ -208,9 +195,7 @@ export function constructPsbt(
208195 } else {
209196 const { redeemScript } = createOutputScriptP2shP2pk ( rootWalletKeys [ signerName ] . publicKey ) ;
210197 assert ( redeemScript ) ;
211- addReplayProtectionUnspentToPsbt ( psbt , u , redeemScript , {
212- skipNonWitnessUtxo,
213- } ) ;
198+ addReplayProtectionUnspentToPsbt ( psbt , u , redeemScript , { skipNonWitnessUtxo } ) ;
214199 }
215200 } ) ;
216201
@@ -239,17 +224,10 @@ export function constructPsbt(
239224 psbt . setAllInputsMusig2NonceHD ( rootWalletKeys [ 'user' ] ) ;
240225 psbt . setAllInputsMusig2NonceHD ( rootWalletKeys [ 'bitgo' ] , { deterministic } ) ;
241226
242- signAllPsbtInputs ( psbt , inputs , rootWalletKeys , 'halfsigned' , {
243- signers,
244- skipNonWitnessUtxo,
245- } ) ;
227+ signAllPsbtInputs ( psbt , inputs , rootWalletKeys , 'halfsigned' , { signers, skipNonWitnessUtxo } ) ;
246228
247229 if ( sign === 'fullsigned' ) {
248- signAllPsbtInputs ( psbt , inputs , rootWalletKeys , sign , {
249- signers,
250- deterministic,
251- skipNonWitnessUtxo,
252- } ) ;
230+ signAllPsbtInputs ( psbt , inputs , rootWalletKeys , sign , { signers, deterministic, skipNonWitnessUtxo } ) ;
253231 }
254232
255233 return psbt ;
0 commit comments