File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
modules/utxo-staking/src/babylon Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,19 @@ export function getSignedPsbt(
4444 return bitcoinjslib . Psbt . fromBuffer ( Buffer . from ( wrappedPsbt . serialize ( ) ) ) ;
4545}
4646
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+
4760export function getBtcProviderForECKey (
4861 descriptorBuilder : BabylonDescriptorBuilder ,
4962 stakerKey : utxolib . ECPairInterface
You can’t perform that action at this time.
0 commit comments