commit
a2b7ac1673
2 changed files with 18 additions and 7 deletions
|
|
@ -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,13 +184,16 @@ export class SubmarineSwaps {
|
|||
}
|
||||
]
|
||||
const outputScript = address.toOutputScript(refundAddress, network)
|
||||
// Construct the refund transaction
|
||||
const refundTx = constructRefundTransaction(
|
||||
details,
|
||||
outputScript,
|
||||
cooperative ? 0 : timeoutBlockHeight,
|
||||
// Construct the refund transaction: targetFee converts sat/vbyte rate to flat fee
|
||||
const refundTx = targetFee(
|
||||
feePerVbyte,
|
||||
true
|
||||
(fee) => constructRefundTransaction(
|
||||
details,
|
||||
outputScript,
|
||||
cooperative ? 0 : timeoutBlockHeight,
|
||||
fee,
|
||||
true
|
||||
)
|
||||
)
|
||||
|
||||
if (!cooperative) {
|
||||
|
|
|
|||
|
|
@ -91,6 +91,14 @@ export default (mainHandler: Main): Types.ServerMethods => {
|
|||
if (err != null) throw new Error(err.message)
|
||||
return mainHandler.adminManager.CloseChannel(req)
|
||||
},
|
||||
BumpTx: async ({ ctx, req }) => {
|
||||
const err = Types.BumpTxValidate(req, {
|
||||
txid_CustomCheck: txid => txid !== '',
|
||||
sat_per_vbyte_CustomCheck: spv => spv > 0
|
||||
})
|
||||
if (err != null) throw new Error(err.message)
|
||||
return mainHandler.adminManager.BumpTx(req)
|
||||
},
|
||||
GetAdminTransactionSwapQuotes: async ({ ctx, req }) => {
|
||||
const err = Types.TransactionSwapRequestValidate(req, {
|
||||
transaction_amount_sats_CustomCheck: amt => amt > 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue