This commit is contained in:
boufni95 2026-03-04 18:26:21 +00:00
parent 74513a1412
commit 70544bd551
No known key found for this signature in database

View file

@ -3,7 +3,7 @@ const zkpInit = (secp256k1ZkpModule as any).default || secp256k1ZkpModule;
// import bolt11 from 'bolt11';
import {
Musig, SwapTreeSerializer, TaprootUtils, constructRefundTransaction,
detectSwap, OutputType
detectSwap, OutputType, targetFee
} from 'boltz-core';
import { randomBytes, createHash } from 'crypto';
import { ECPairFactory, ECPairInterface } from 'ecpair';
@ -184,14 +184,17 @@ export class SubmarineSwaps {
}
]
const outputScript = address.toOutputScript(refundAddress, network)
// Construct the refund transaction
const refundTx = constructRefundTransaction(
// Construct the refund transaction: targetFee converts sat/vbyte rate to flat fee
const refundTx = targetFee(
feePerVbyte,
(fee) => constructRefundTransaction(
details,
outputScript,
cooperative ? 0 : timeoutBlockHeight,
feePerVbyte,
fee,
true
)
)
if (!cooperative) {
return {