From 8ba2d2be884d24f6148699c1ae30299fb4d7b043 Mon Sep 17 00:00:00 2001 From: jackstar12 <62219658+jackstar12@users.noreply.github.com> Date: Wed, 7 May 2025 22:35:52 +0200 Subject: [PATCH] feat: boltz swap in refund address (#1490) require a refund address when creating a swap in and paying it externally to make sure the swap can be refunded automatically if it fails. --- backend/controllers/shared/boltz.js | 4 +- frontend/index.html | 2 +- frontend/main.4c9a64ff53139049.js | 1 - frontend/main.f5539fed9d1e4c46.js | 1 + server/controllers/shared/boltz.ts | 4 +- .../swap-modal/swap-modal.component.html | 10 ++++ .../boltz/swap-modal/swap-modal.component.ts | 52 +++++++++++++++++-- src/app/shared/services/boltz.service.ts | 4 +- 8 files changed, 66 insertions(+), 12 deletions(-) delete mode 100644 frontend/main.4c9a64ff53139049.js create mode 100644 frontend/main.f5539fed9d1e4c46.js diff --git a/backend/controllers/shared/boltz.js b/backend/controllers/shared/boltz.js index 6af21b1b..caa9d700 100644 --- a/backend/controllers/shared/boltz.js +++ b/backend/controllers/shared/boltz.js @@ -79,7 +79,7 @@ export const getSwapInfo = (req, res, next) => { }); }; export const createSwap = (req, res, next) => { - const { amount, sendFromInternal, address } = req.body; + const { amount, sendFromInternal, address, refundAddress } = req.body; logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Boltz', msg: 'Creating Swap..' }); options = common.getBoltzServerOptions(req); if (options.url === '') { @@ -88,7 +88,7 @@ export const createSwap = (req, res, next) => { return res.status(err.statusCode).json({ message: err.message, error: err.error }); } options.url = options.url + '/v1/createswap'; - options.body = { amount: amount }; + options.body = { amount: amount, refundAddress }; if (sendFromInternal) { options.body.send_from_internal = sendFromInternal; } diff --git a/frontend/index.html b/frontend/index.html index 77aaf4c8..e39f1577 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -15,5 +15,5 @@