File tree 1 file changed +13
-0
lines changed
modules/utxo-staking/src/babylon
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,19 @@ export function getSignedPsbt(
44
44
return bitcoinjslib . Psbt . fromBuffer ( Buffer . from ( wrappedPsbt . serialize ( ) ) ) ;
45
45
}
46
46
47
+ /**
48
+ * Utility method to work around a bug in btc-staking-ts
49
+ * https://github.com/babylonlabs-io/btc-staking-ts/issues/71
50
+ * @param buffer
51
+ * @param network
52
+ */
53
+ export function forceFinalizePsbt ( buffer : Buffer , network : BabylonNetworkLike ) : bitcoinjslib . Psbt {
54
+ const psbt = bitcoinjslib . Psbt . fromBuffer ( buffer , { network : toBitcoinJsNetwork ( network ) } ) ;
55
+ // this only works with certain bitcoinjslib versions
56
+ psbt . finalizeAllInputs ( ) ;
57
+ return psbt ;
58
+ }
59
+
47
60
export function getBtcProviderForECKey (
48
61
descriptorBuilder : BabylonDescriptorBuilder ,
49
62
stakerKey : utxolib . ECPairInterface
You can’t perform that action at this time.
0 commit comments