2
0
mirror of https://github.com/Ride-The-Lightning/RTL synced 2024-11-11 13:10:41 +00:00
RTL/server/controllers/cln/fees.ts
ShahanaFarooqui 44412d357e
Release 0.12.3 (#1012)
LND Palemoon UX extension panel bug
Cookie file not generated for BTCPayServer #990
ECL Missing fee calculation on Dashboard #975
CLT channel filter on alias bug fix #982
CLightning to Code Lightning #997
Added Infographics for Channel Rebalance
CLN Base fee zero bug fix #987
ECL Query Route bug fix #1007
LND faster initial load
LND Transactions Lookup #1002
LND Bug fix for Routing Fee Calculation
2022-05-01 13:35:20 -04:00

22 lines
1.1 KiB
TypeScript

import request from 'request-promise';
import { Logger, LoggerService } from '../../utils/logger.js';
import { Common, CommonService } from '../../utils/common.js';
let options = null;
const logger: LoggerService = Logger;
const common: CommonService = Common;
export const getFees = (req, res, next) => {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Fees', msg: 'Getting Fees..' });
options = common.getOptions(req);
if (options.error) { return res.status(options.statusCode).json({ message: options.message, error: options.error }); }
options.url = req.session.selectedNode.ln_server_url + '/v1/getFees';
request(options).then((body) => {
if (!body.feeCollected) { body.feeCollected = 0; }
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Fees', msg: 'Fee Received', data: body });
res.status(200).json(body);
}).catch((errRes) => {
const err = common.handleError(errRes, 'Fees', 'Get Fees Error', req.session.selectedNode);
return res.status(err.statusCode).json({ message: err.message, error: err.error });
});
};