mirror of
https://github.com/Ride-The-Lightning/RTL.git
synced 2025-02-20 13:34:43 +01:00
Peer testing fixes
This commit is contained in:
parent
c3e6fb5b88
commit
91cf05cee6
52 changed files with 127 additions and 115 deletions
|
@ -58,8 +58,8 @@ export const openChannel = (req, res, next) => {
|
|||
return res.status(options.statusCode).json({ message: options.message, error: options.error });
|
||||
}
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/fundchannel';
|
||||
options.form = req.body;
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Open Channel Options', data: options.form });
|
||||
options.body = req.body;
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Open Channel Options', data: options.body });
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Channels', msg: 'Channel Opened', data: body });
|
||||
res.status(201).json(body);
|
||||
|
@ -75,8 +75,8 @@ export const setChannelFee = (req, res, next) => {
|
|||
return res.status(options.statusCode).json({ message: options.message, error: options.error });
|
||||
}
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/setchannel';
|
||||
options.form = req.body;
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Update Channel Policy Options', data: options.form });
|
||||
options.body = req.body;
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Update Channel Policy Options', data: options.body });
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Channels', msg: 'Updated Channel Policy', data: body });
|
||||
res.status(201).json(body);
|
||||
|
@ -93,7 +93,7 @@ export const closeChannel = (req, res, next) => {
|
|||
return res.status(options.statusCode).json({ message: options.message, error: options.error });
|
||||
}
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/close';
|
||||
options.form = { channelId: req.params.channelId, unilaterlaltimeout: req.query.force ? 1 : null };
|
||||
options.body = { channelId: req.params.channelId, unilaterlaltimeout: req.query.force ? 1 : null };
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Closing Channel', data: options.url });
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Channels', msg: 'Channel Closed', data: body });
|
||||
|
@ -148,7 +148,7 @@ export const listForwards = (req, res, next) => {
|
|||
return res.status(options.statusCode).json({ message: options.message, error: options.error });
|
||||
}
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/listforwards';
|
||||
options.form = { status: req.query.status || 'settled' };
|
||||
options.body = { status: req.query.status || 'settled' };
|
||||
request.get(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Forwarding History Received For Status ' + req.query.status, data: body });
|
||||
res.status(200).json(!body.forwards ? [] : (req.query.status === 'failed' || req.query.status === 'local_failed') ? body.forwards.slice(Math.max(0, body.forwards.length - 1000), Math.max(1000, body.forwards.length)).reverse() : body.forwards.reverse());
|
||||
|
@ -164,8 +164,8 @@ export const funderUpdatePolicy = (req, res, next) => {
|
|||
return res.status(options.statusCode).json({ message: options.message, error: options.error });
|
||||
}
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/funderupdate';
|
||||
options.form = req.body;
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Funder Update Body', data: options.form });
|
||||
options.body = req.body;
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Funder Update Body', data: options.body });
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Channels', msg: 'Funder Policy Received', data: body });
|
||||
body.channel_fee_max_base_msat = (body.channel_fee_max_base_msat && typeof body.channel_fee_max_base_msat === 'string' && body.channel_fee_max_base_msat.includes('msat')) ? +body.channel_fee_max_base_msat?.replace('msat', '') : body.channel_fee_max_base_msat;
|
||||
|
|
|
@ -11,7 +11,7 @@ export const deleteExpiredInvoice = (req, res, next) => {
|
|||
return res.status(options.statusCode).json({ message: options.message, error: options.error });
|
||||
}
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/delexpiredinvoice';
|
||||
options.form = req.query.maxexpiry ? { maxexpiry: req.query.maxexpiry } : null;
|
||||
options.body = req.query.maxexpiry ? { maxexpiry: req.query.maxexpiry } : null;
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Invoice', msg: 'Invoices Deleted', data: body });
|
||||
res.status(204).json({ status: 'Invoice Deleted Successfully' });
|
||||
|
@ -26,7 +26,7 @@ export const listInvoices = (req, res, next) => {
|
|||
if (options.error) {
|
||||
return res.status(options.statusCode).json({ message: options.message, error: options.error });
|
||||
}
|
||||
options.form = req.query.label ? { label: req.query.label } : null;
|
||||
options.body = req.query.label ? { label: req.query.label } : null;
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/listinvoices';
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Invoice', msg: 'Invoices List URL', data: options.url });
|
||||
request.post(options).then((body) => {
|
||||
|
@ -44,7 +44,7 @@ export const addInvoice = (req, res, next) => {
|
|||
return res.status(options.statusCode).json({ message: options.message, error: options.error });
|
||||
}
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/invoice';
|
||||
options.form = req.body;
|
||||
options.body = req.body;
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Invoice', msg: 'Invoice Created', data: body });
|
||||
res.status(201).json(body);
|
||||
|
|
|
@ -11,7 +11,7 @@ export const getRoute = (req, res, next) => {
|
|||
return res.status(options.statusCode).json({ message: options.message, error: options.error });
|
||||
}
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/getroute';
|
||||
options.form = { id: req.params.destPubkey, amount_msat: req.params.amount, riskfactor: (req.query.riskFactor || 0) };
|
||||
options.body = { id: req.params.destPubkey, amount_msat: req.params.amount, riskfactor: (req.query.riskFactor || 0) };
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Network', msg: 'Network Routes Received', data: body });
|
||||
res.status(200).json({ routes: body });
|
||||
|
@ -27,7 +27,7 @@ export const listChannels = (req, res, next) => {
|
|||
return res.status(options.statusCode).json({ message: options.message, error: options.error });
|
||||
}
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/listchannels';
|
||||
options.form = req.params.channelShortId ? { short_channel_id: req.params.channelShortId } : null;
|
||||
options.body = req.params.channelShortId ? { short_channel_id: req.params.channelShortId } : null;
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Network', msg: 'Channel Lookup Finished', data: body });
|
||||
res.status(200).json(body);
|
||||
|
@ -43,7 +43,7 @@ export const feeRates = (req, res, next) => {
|
|||
return res.status(options.statusCode).json({ message: options.message, error: options.error });
|
||||
}
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/feerates';
|
||||
options.form = req.params.feeRateStyle ? { style: req.params.feeRateStyle } : null;
|
||||
options.body = req.params.feeRateStyle ? { style: req.params.feeRateStyle } : null;
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Network', msg: 'Network Fee Rates Received for ' + req.params.feeRateStyle, data: body });
|
||||
res.status(200).json(body);
|
||||
|
@ -60,7 +60,7 @@ export const listNodes = (req, res, next) => {
|
|||
}
|
||||
const queryStr = req.query.liquidity_ads ? '?liquidity_ads=' + req.query.liquidity_ads : '';
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/listnodes';
|
||||
options.form = req.params.id ? { id: req.params.id } : null;
|
||||
options.body = req.params.id ? { id: req.params.id } : null;
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Network', msg: 'List Nodes URL' + options.url });
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Network', msg: 'List Nodes Finished', data: body });
|
||||
|
|
|
@ -34,7 +34,7 @@ export const listOffers = (req, res, next) => {
|
|||
return res.status(options.statusCode).json({ message: options.message, error: options.error });
|
||||
}
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/listoffers';
|
||||
options.form = { offer_id: (req.query.offer_id) ? req.query.offer_id : null, active_only: !(req.query.active_only === '0' || req.query.active_only === 'false' || !req.query.active_only) };
|
||||
options.body = { offer_id: (req.query.offer_id) ? req.query.offer_id : null, active_only: !(req.query.active_only === '0' || req.query.active_only === 'false' || !req.query.active_only) };
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Offers', msg: 'Offers List URL', data: options.url });
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Offers', msg: 'Offers List Received', data: body });
|
||||
|
@ -61,7 +61,7 @@ export const createOffer = (req, res, next) => {
|
|||
req.body.recurrence_limit = (req.body.recurrence_limit) ? req.body.recurrence_limit : null;
|
||||
req.body.single_use = !(req.body.single_use === '0' || req.body.single_use === 'false' || !req.body.single_use);
|
||||
req.body.quantity_min = (req.body.quantity_min) ? req.body.quantity_min : null;
|
||||
options.form = req.body;
|
||||
options.body = req.body;
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Offers', msg: 'Offer Created', data: body });
|
||||
res.status(201).json(body);
|
||||
|
@ -83,8 +83,8 @@ export const fetchOfferInvoice = (req, res, next) => {
|
|||
req.body.recurrence_start = (req.body.recurrence_start) ? req.body.recurrence_start : null;
|
||||
req.body.recurrence_label = (req.body.recurrence_label) ? req.body.recurrence_label : null;
|
||||
req.body.timeout = (req.body.timeout) ? req.body.timeout : null;
|
||||
options.form = req.body;
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Offers', msg: 'Offer Invoice Body', data: options.form });
|
||||
options.body = req.body;
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Offers', msg: 'Offer Invoice Body', data: options.body });
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Offers', msg: 'Offer Invoice Received', data: body });
|
||||
res.status(201).json(body);
|
||||
|
@ -100,7 +100,7 @@ export const disableOffer = (req, res, next) => {
|
|||
return res.status(options.statusCode).json({ message: options.message, error: options.error });
|
||||
}
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/disableOffer';
|
||||
options.form = { offer_id: req.params.offerID };
|
||||
options.body = { offer_id: req.params.offerID };
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Offers', msg: 'Offer Disabled', data: body });
|
||||
res.status(202).json(body);
|
||||
|
|
|
@ -11,7 +11,7 @@ export const getNewAddress = (req, res, next) => {
|
|||
return res.status(options.statusCode).json({ message: options.message, error: options.error });
|
||||
}
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/newaddr';
|
||||
options.form = { addresstype: req.query.type };
|
||||
options.body = { addresstype: req.query.type };
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'OnChain', msg: 'New Address Generated', data: body });
|
||||
res.status(200).json(body);
|
||||
|
@ -31,8 +31,8 @@ export const onChainWithdraw = (req, res, next) => {
|
|||
req.body.feeRate = (req.body.feeRate) ? req.body.feeRate : null;
|
||||
req.body.minConf = (req.body.minConf) ? req.body.minConf : null;
|
||||
req.body.utxos = (req.body.utxos) ? req.body.utxos : null;
|
||||
options.form = req.body;
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'OnChain', msg: 'OnChain Withdraw Options', data: options.form });
|
||||
options.body = req.body;
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'OnChain', msg: 'OnChain Withdraw Options', data: options.body });
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'OnChain', msg: 'Withdraw Finished', data: body });
|
||||
res.status(201).json(body);
|
||||
|
|
|
@ -71,7 +71,7 @@ export const listPayments = (req, res, next) => {
|
|||
}
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/listsendpays';
|
||||
const { invoice, payment_hash, status } = req.query;
|
||||
options.form = {
|
||||
options.body = {
|
||||
...(invoice && { bolt11: invoice }),
|
||||
...(payment_hash && { payment_hash }),
|
||||
...(status && { status })
|
||||
|
@ -99,7 +99,7 @@ export const postPayment = (req, res, next) => {
|
|||
req.body.retry_for = (req.body.retry_for) ? req.body.retry_for : null;
|
||||
req.body.maxdelay = (req.body.maxdelay) ? req.body.maxdelay : null;
|
||||
req.body.exemptfee = (req.body.exemptfee) ? req.body.exemptfee : null;
|
||||
options.form = req.body;
|
||||
options.body = req.body;
|
||||
}
|
||||
else {
|
||||
if (req.body.paymentType === 'OFFER') {
|
||||
|
@ -120,7 +120,7 @@ export const postPayment = (req, res, next) => {
|
|||
req.body.exclude = (req.body.exclude) ? req.body.exclude : null;
|
||||
req.body.maxfee = (req.body.maxfee) ? req.body.maxfee : null;
|
||||
req.body.description = (req.body.description) ? req.body.description : null;
|
||||
options.form = req.body;
|
||||
options.body = req.body;
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/pay';
|
||||
}
|
||||
request.post(options).then((body) => {
|
||||
|
|
|
@ -13,7 +13,7 @@ export const getPeers = (req, res, next) => {
|
|||
options.url = req.session.selectedNode.ln_server_url + '/v1/listpeers';
|
||||
request.post(options).then((body) => {
|
||||
body.peers.forEach((peer) => {
|
||||
peer.alias = peer.peer_id.substring(0, 20);
|
||||
peer.alias = peer.id.substring(0, 20);
|
||||
return peer;
|
||||
});
|
||||
res.status(200).json(body.peers || []);
|
||||
|
@ -36,12 +36,13 @@ export const postPeer = (req, res, next) => {
|
|||
return res.status(options.statusCode).json({ message: options.message, error: options.error });
|
||||
}
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/connect';
|
||||
options.form = req.body;
|
||||
options.body = req.body;
|
||||
request.post(options).then((connectRes) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Peers', msg: 'Peer Connected', data: connectRes });
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/listpeers';
|
||||
request.post(options).then((listPeersRes) => {
|
||||
const peers = listPeersRes ? common.newestOnTop(listPeersRes, 'id', req.body.id) : [];
|
||||
const listOptions = common.getOptions(req);
|
||||
listOptions.url = req.session.selectedNode.ln_server_url + '/v1/listpeers';
|
||||
request.post(listOptions).then((listPeersRes) => {
|
||||
const peers = listPeersRes && listPeersRes.peers ? common.newestOnTop(listPeersRes.peers, 'id', connectRes.id) : [];
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Peers', msg: 'Peers List after Connect Received', data: peers });
|
||||
res.status(201).json(peers);
|
||||
}).catch((errRes) => {
|
||||
|
@ -60,7 +61,12 @@ export const deletePeer = (req, res, next) => {
|
|||
return res.status(options.statusCode).json({ message: options.message, error: options.error });
|
||||
}
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/disconnect';
|
||||
options.form = { id: req.params.peerId, force: !!req.query.force };
|
||||
const id = req.params.peerId;
|
||||
const force = !!req.query.force;
|
||||
options.body = {
|
||||
...(id && { id }),
|
||||
...(force && { force })
|
||||
};
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Peers', msg: 'Peer Disconnected', data: body });
|
||||
res.status(204).json({});
|
||||
|
|
|
@ -6,7 +6,7 @@ const logger = Logger;
|
|||
const common = Common;
|
||||
export const decodePaymentFromPaymentRequest = (selNode, payment) => {
|
||||
options.url = selNode.ln_server_url + '/v1/decode';
|
||||
options.form = { string: payment };
|
||||
options.body = { string: payment };
|
||||
return request.post(options).then((res) => {
|
||||
logger.log({ selectedNode: selNode, level: 'DEBUG', fileName: 'Payments', msg: 'Payment Decode Received', data: res });
|
||||
return res;
|
||||
|
@ -42,7 +42,7 @@ export const decodePayment = (req, res, next) => {
|
|||
return res.status(options.statusCode).json({ message: options.message, error: options.error });
|
||||
}
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/decode';
|
||||
options.form = { string: req.params.payReq };
|
||||
options.body = { string: req.params.payReq };
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Payments', msg: 'Payment Decoded', data: body });
|
||||
res.status(200).json(body);
|
||||
|
@ -58,7 +58,7 @@ export const signMessage = (req, res, next) => {
|
|||
return res.status(options.statusCode).json({ message: options.message, error: options.error });
|
||||
}
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/signmessage';
|
||||
options.form = { message: req.body.message };
|
||||
options.body = { message: req.body.message };
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Message', msg: 'Message Signed', data: body });
|
||||
res.status(201).json(body);
|
||||
|
@ -74,7 +74,7 @@ export const verifyMessage = (req, res, next) => {
|
|||
return res.status(options.statusCode).json({ message: options.message, error: options.error });
|
||||
}
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/checkmessage';
|
||||
options.form = { message: req.body.message, zbase: req.body.signature };
|
||||
options.body = { message: req.body.message, zbase: req.body.signature };
|
||||
request.post(options, (error, response, body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Message', msg: 'Message Verified', data: body });
|
||||
res.status(201).json(body);
|
||||
|
|
File diff suppressed because one or more lines are too long
1
frontend/125.294a420aeb50ae88.js
Normal file
1
frontend/125.294a420aeb50ae88.js
Normal file
File diff suppressed because one or more lines are too long
1
frontend/456.16212571f65d0b5f.js
Normal file
1
frontend/456.16212571f65d0b5f.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
frontend/570.a719a189ca60c55b.js
Normal file
1
frontend/570.a719a189ca60c55b.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
frontend/main.a3bd492672473cc8.js
Normal file
1
frontend/main.a3bd492672473cc8.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
(()=>{"use strict";var e,v={},m={};function r(e){var f=m[e];if(void 0!==f)return f.exports;var t=m[e]={id:e,loaded:!1,exports:{}};return v[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=v,e=[],r.O=(f,t,i,o)=>{if(!t){var a=1/0;for(n=0;n<e.length;n++){for(var[t,i,o]=e[n],s=!0,d=0;d<t.length;d++)(!1&o||a>=o)&&Object.keys(r.O).every(b=>r.O[b](t[d]))?t.splice(d--,1):(s=!1,o<a&&(a=o));if(s){e.splice(n--,1);var u=i();void 0!==u&&(f=u)}}return f}o=o||0;for(var n=e.length;n>0&&e[n-1][2]>o;n--)e[n]=e[n-1];e[n]=[t,i,o]},r.d=(e,f)=>{for(var t in f)r.o(f,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:f[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((f,t)=>(r.f[t](e,f),f),[])),r.u=e=>e+"."+{125:"020bb8ec6698fd7e",456:"a54c45d211d6d10c",570:"28ed94d292ccd982",758:"2801e2da6f8bba94"}[e]+".js",r.miniCssF=e=>{},r.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),(()=>{var e={},f="RTLApp:";r.l=(t,i,o,n)=>{if(e[t])e[t].push(i);else{var a,s;if(void 0!==o)for(var d=document.getElementsByTagName("script"),u=0;u<d.length;u++){var l=d[u];if(l.getAttribute("src")==t||l.getAttribute("data-webpack")==f+o){a=l;break}}a||(s=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",f+o),a.src=r.tu(t)),e[t]=[i];var c=(g,b)=>{a.onerror=a.onload=null,clearTimeout(p);var h=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),h&&h.forEach(y=>y(b)),g)return g(b)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=c.bind(null,a.onerror),a.onload=c.bind(null,a.onload),s&&document.head.appendChild(a)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:f=>f},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="",(()=>{var e={666:0};r.f.j=(i,o)=>{var n=r.o(e,i)?e[i]:void 0;if(0!==n)if(n)o.push(n[2]);else if(666!=i){var a=new Promise((l,c)=>n=e[i]=[l,c]);o.push(n[2]=a);var s=r.p+r.u(i),d=new Error;r.l(s,l=>{if(r.o(e,i)&&(0!==(n=e[i])&&(e[i]=void 0),n)){var c=l&&("load"===l.type?"missing":l.type),p=l&&l.target&&l.target.src;d.message="Loading chunk "+i+" failed.\n("+c+": "+p+")",d.name="ChunkLoadError",d.type=c,d.request=p,n[1](d)}},"chunk-"+i,i)}else e[i]=0},r.O.j=i=>0===e[i];var f=(i,o)=>{var d,u,[n,a,s]=o,l=0;if(n.some(p=>0!==e[p])){for(d in a)r.o(a,d)&&(r.m[d]=a[d]);if(s)var c=s(r)}for(i&&i(o);l<n.length;l++)r.o(e,u=n[l])&&e[u]&&e[u][0](),e[u]=0;return r.O(c)},t=self.webpackChunkRTLApp=self.webpackChunkRTLApp||[];t.forEach(f.bind(null,0)),t.push=f.bind(null,t.push.bind(t))})()})();
|
||||
(()=>{"use strict";var e,v={},m={};function r(e){var f=m[e];if(void 0!==f)return f.exports;var t=m[e]={id:e,loaded:!1,exports:{}};return v[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=v,e=[],r.O=(f,t,i,o)=>{if(!t){var a=1/0;for(n=0;n<e.length;n++){for(var[t,i,o]=e[n],s=!0,l=0;l<t.length;l++)(!1&o||a>=o)&&Object.keys(r.O).every(b=>r.O[b](t[l]))?t.splice(l--,1):(s=!1,o<a&&(a=o));if(s){e.splice(n--,1);var d=i();void 0!==d&&(f=d)}}return f}o=o||0;for(var n=e.length;n>0&&e[n-1][2]>o;n--)e[n]=e[n-1];e[n]=[t,i,o]},r.d=(e,f)=>{for(var t in f)r.o(f,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:f[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((f,t)=>(r.f[t](e,f),f),[])),r.u=e=>e+"."+{125:"294a420aeb50ae88",456:"16212571f65d0b5f",570:"a719a189ca60c55b",758:"2801e2da6f8bba94"}[e]+".js",r.miniCssF=e=>{},r.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),(()=>{var e={},f="RTLApp:";r.l=(t,i,o,n)=>{if(e[t])e[t].push(i);else{var a,s;if(void 0!==o)for(var l=document.getElementsByTagName("script"),d=0;d<l.length;d++){var u=l[d];if(u.getAttribute("src")==t||u.getAttribute("data-webpack")==f+o){a=u;break}}a||(s=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",f+o),a.src=r.tu(t)),e[t]=[i];var c=(g,b)=>{a.onerror=a.onload=null,clearTimeout(p);var h=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),h&&h.forEach(y=>y(b)),g)return g(b)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=c.bind(null,a.onerror),a.onload=c.bind(null,a.onload),s&&document.head.appendChild(a)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:f=>f},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="",(()=>{var e={666:0};r.f.j=(i,o)=>{var n=r.o(e,i)?e[i]:void 0;if(0!==n)if(n)o.push(n[2]);else if(666!=i){var a=new Promise((u,c)=>n=e[i]=[u,c]);o.push(n[2]=a);var s=r.p+r.u(i),l=new Error;r.l(s,u=>{if(r.o(e,i)&&(0!==(n=e[i])&&(e[i]=void 0),n)){var c=u&&("load"===u.type?"missing":u.type),p=u&&u.target&&u.target.src;l.message="Loading chunk "+i+" failed.\n("+c+": "+p+")",l.name="ChunkLoadError",l.type=c,l.request=p,n[1](l)}},"chunk-"+i,i)}else e[i]=0},r.O.j=i=>0===e[i];var f=(i,o)=>{var l,d,[n,a,s]=o,u=0;if(n.some(p=>0!==e[p])){for(l in a)r.o(a,l)&&(r.m[l]=a[l]);if(s)var c=s(r)}for(i&&i(o);u<n.length;u++)r.o(e,d=n[u])&&e[d]&&e[d][0](),e[d]=0;return r.O(c)},t=self.webpackChunkRTLApp=self.webpackChunkRTLApp||[];t.forEach(f.bind(null,0)),t.push=f.bind(null,t.push.bind(t))})()})();
|
|
@ -56,8 +56,8 @@ export const openChannel = (req, res, next) => {
|
|||
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/fundchannel';
|
||||
options.form = req.body;
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Open Channel Options', data: options.form });
|
||||
options.body = req.body;
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Open Channel Options', data: options.body });
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Channels', msg: 'Channel Opened', data: body });
|
||||
res.status(201).json(body);
|
||||
|
@ -72,8 +72,8 @@ export const setChannelFee = (req, res, next) => {
|
|||
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/setchannel';
|
||||
options.form = req.body;
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Update Channel Policy Options', data: options.form });
|
||||
options.body = req.body;
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Update Channel Policy Options', data: options.body });
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Channels', msg: 'Updated Channel Policy', data: body });
|
||||
res.status(201).json(body);
|
||||
|
@ -89,7 +89,7 @@ export const closeChannel = (req, res, next) => {
|
|||
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/close';
|
||||
options.form = { channelId: req.params.channelId, unilaterlaltimeout: req.query.force ? 1 : null };
|
||||
options.body = { channelId: req.params.channelId, unilaterlaltimeout: req.query.force ? 1 : null };
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Closing Channel', data: options.url });
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Channels', msg: 'Channel Closed', data: body });
|
||||
|
@ -140,7 +140,7 @@ export const listForwards = (req, res, next) => {
|
|||
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/listforwards';
|
||||
options.form = { status: req.query.status || 'settled' };
|
||||
options.body = { status: req.query.status || 'settled' };
|
||||
request.get(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Forwarding History Received For Status ' + req.query.status, data: body });
|
||||
res.status(200).json(!body.forwards ? [] : (req.query.status === 'failed' || req.query.status === 'local_failed') ? body.forwards.slice(Math.max(0, body.forwards.length - 1000), Math.max(1000, body.forwards.length)).reverse() : body.forwards.reverse());
|
||||
|
@ -155,8 +155,8 @@ export const funderUpdatePolicy = (req, res, next) => {
|
|||
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/funderupdate';
|
||||
options.form = req.body;
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Funder Update Body', data: options.form });
|
||||
options.body = req.body;
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Funder Update Body', data: options.body });
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Channels', msg: 'Funder Policy Received', data: body });
|
||||
body.channel_fee_max_base_msat = (body.channel_fee_max_base_msat && typeof body.channel_fee_max_base_msat === 'string' && body.channel_fee_max_base_msat.includes('msat')) ? +body.channel_fee_max_base_msat?.replace('msat', '') : body.channel_fee_max_base_msat;
|
||||
|
|
|
@ -10,7 +10,7 @@ export const deleteExpiredInvoice = (req, res, next) => {
|
|||
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/delexpiredinvoice';
|
||||
options.form = req.query.maxexpiry ? { maxexpiry: req.query.maxexpiry } : null;
|
||||
options.body = req.query.maxexpiry ? { maxexpiry: req.query.maxexpiry } : null;
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Invoice', msg: 'Invoices Deleted', data: body });
|
||||
res.status(204).json({ status: 'Invoice Deleted Successfully' });
|
||||
|
@ -24,7 +24,7 @@ export const listInvoices = (req, res, next) => {
|
|||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Invoices', msg: 'Getting Invoices..' });
|
||||
options = common.getOptions(req);
|
||||
if (options.error) { return res.status(options.statusCode).json({ message: options.message, error: options.error }); }
|
||||
options.form = req.query.label ? { label: req.query.label } : null;
|
||||
options.body = req.query.label ? { label: req.query.label } : null;
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/listinvoices';
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Invoice', msg: 'Invoices List URL', data: options.url });
|
||||
request.post(options).then((body) => {
|
||||
|
@ -41,7 +41,7 @@ export const addInvoice = (req, res, next) => {
|
|||
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/invoice';
|
||||
options.form = req.body;
|
||||
options.body = req.body;
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Invoice', msg: 'Invoice Created', data: body });
|
||||
res.status(201).json(body);
|
||||
|
|
|
@ -10,7 +10,7 @@ export const getRoute = (req, res, next) => {
|
|||
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/getroute';
|
||||
options.form = { id: req.params.destPubkey, amount_msat: req.params.amount, riskfactor: (req.query.riskFactor || 0) };
|
||||
options.body = { id: req.params.destPubkey, amount_msat: req.params.amount, riskfactor: (req.query.riskFactor || 0) };
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Network', msg: 'Network Routes Received', data: body });
|
||||
res.status(200).json({ routes: body });
|
||||
|
@ -25,7 +25,7 @@ export const listChannels = (req, res, next) => {
|
|||
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/listchannels';
|
||||
options.form = req.params.channelShortId ? { short_channel_id: req.params.channelShortId } : null;
|
||||
options.body = req.params.channelShortId ? { short_channel_id: req.params.channelShortId } : null;
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Network', msg: 'Channel Lookup Finished', data: body });
|
||||
res.status(200).json(body);
|
||||
|
@ -40,7 +40,7 @@ export const feeRates = (req, res, next) => {
|
|||
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/feerates';
|
||||
options.form = req.params.feeRateStyle ? { style : req.params.feeRateStyle } : null;
|
||||
options.body = req.params.feeRateStyle ? { style : req.params.feeRateStyle } : null;
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Network', msg: 'Network Fee Rates Received for ' + req.params.feeRateStyle, data: body });
|
||||
res.status(200).json(body);
|
||||
|
@ -56,7 +56,7 @@ export const listNodes = (req, res, next) => {
|
|||
if (options.error) { return res.status(options.statusCode).json({ message: options.message, error: options.error }); }
|
||||
const queryStr = req.query.liquidity_ads ? '?liquidity_ads=' + req.query.liquidity_ads : '';
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/listnodes';
|
||||
options.form = req.params.id ? { id: req.params.id } : null;
|
||||
options.body = req.params.id ? { id: req.params.id } : null;
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Network', msg: 'List Nodes URL' + options.url });
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Network', msg: 'List Nodes Finished', data: body });
|
||||
|
|
|
@ -36,7 +36,7 @@ export const listOffers = (req, res, next) => {
|
|||
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/listoffers';
|
||||
options.form = { offer_id: (req.query.offer_id) ? req.query.offer_id : null, active_only: !(req.query.active_only === '0' || req.query.active_only === 'false' || !req.query.active_only) };
|
||||
options.body = { offer_id: (req.query.offer_id) ? req.query.offer_id : null, active_only: !(req.query.active_only === '0' || req.query.active_only === 'false' || !req.query.active_only) };
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Offers', msg: 'Offers List URL', data: options.url });
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Offers', msg: 'Offers List Received', data: body });
|
||||
|
@ -62,7 +62,7 @@ export const createOffer = (req, res, next) => {
|
|||
req.body.recurrence_limit = (req.body.recurrence_limit) ? req.body.recurrence_limit : null;
|
||||
req.body.single_use = !(req.body.single_use === '0' || req.body.single_use === 'false' || !req.body.single_use);
|
||||
req.body.quantity_min = (req.body.quantity_min) ? req.body.quantity_min : null;
|
||||
options.form = req.body;
|
||||
options.body = req.body;
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Offers', msg: 'Offer Created', data: body });
|
||||
res.status(201).json(body);
|
||||
|
@ -83,8 +83,8 @@ export const fetchOfferInvoice = (req, res, next) => {
|
|||
req.body.recurrence_start = (req.body.recurrence_start) ? req.body.recurrence_start : null;
|
||||
req.body.recurrence_label = (req.body.recurrence_label) ? req.body.recurrence_label : null;
|
||||
req.body.timeout = (req.body.timeout) ? req.body.timeout : null;
|
||||
options.form = req.body;
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Offers', msg: 'Offer Invoice Body', data: options.form });
|
||||
options.body = req.body;
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Offers', msg: 'Offer Invoice Body', data: options.body });
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Offers', msg: 'Offer Invoice Received', data: body });
|
||||
res.status(201).json(body);
|
||||
|
@ -99,7 +99,7 @@ export const disableOffer = (req, res, next) => {
|
|||
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/disableOffer';
|
||||
options.form = { offer_id: req.params.offerID };
|
||||
options.body = { offer_id: req.params.offerID };
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Offers', msg: 'Offer Disabled', data: body });
|
||||
res.status(202).json(body);
|
||||
|
|
|
@ -10,7 +10,7 @@ export const getNewAddress = (req, res, next) => {
|
|||
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/newaddr';
|
||||
options.form = { addresstype: req.query.type };
|
||||
options.body = { addresstype: req.query.type };
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'OnChain', msg: 'New Address Generated', data: body });
|
||||
res.status(200).json(body);
|
||||
|
@ -29,8 +29,8 @@ export const onChainWithdraw = (req, res, next) => {
|
|||
req.body.feeRate = (req.body.feeRate) ? req.body.feeRate : null;
|
||||
req.body.minConf = (req.body.minConf) ? req.body.minConf : null;
|
||||
req.body.utxos = (req.body.utxos) ? req.body.utxos : null;
|
||||
options.form = req.body;
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'OnChain', msg: 'OnChain Withdraw Options', data: options.form });
|
||||
options.body = req.body;
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'OnChain', msg: 'OnChain Withdraw Options', data: options.body });
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'OnChain', msg: 'Withdraw Finished', data: body });
|
||||
res.status(201).json(body);
|
||||
|
|
|
@ -62,7 +62,7 @@ export const listPayments = (req, res, next) => {
|
|||
if (options.error) { return res.status(options.statusCode).json({ message: options.message, error: options.error }); }
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/listsendpays';
|
||||
const { invoice, payment_hash, status } = req.query;
|
||||
options.form = {
|
||||
options.body = {
|
||||
...(invoice && { bolt11: invoice }),
|
||||
...(payment_hash && { payment_hash }),
|
||||
...(status && { status })
|
||||
|
@ -89,7 +89,7 @@ export const postPayment = (req, res, next) => {
|
|||
req.body.retry_for = (req.body.retry_for) ? req.body.retry_for : null;
|
||||
req.body.maxdelay = (req.body.maxdelay) ? req.body.maxdelay : null;
|
||||
req.body.exemptfee = (req.body.exemptfee) ? req.body.exemptfee : null;
|
||||
options.form = req.body;
|
||||
options.body = req.body;
|
||||
} else {
|
||||
if (req.body.paymentType === 'OFFER') {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Payments', msg: 'Sending Offer Payment..' });
|
||||
|
@ -108,7 +108,7 @@ export const postPayment = (req, res, next) => {
|
|||
req.body.exclude = (req.body.exclude) ? req.body.exclude : null;
|
||||
req.body.maxfee = (req.body.maxfee) ? req.body.maxfee : null;
|
||||
req.body.description = (req.body.description) ? req.body.description : null;
|
||||
options.form = req.body;
|
||||
options.body = req.body;
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/pay';
|
||||
}
|
||||
request.post(options).then((body) => {
|
||||
|
|
|
@ -12,7 +12,7 @@ export const getPeers = (req, res, next) => {
|
|||
options.url = req.session.selectedNode.ln_server_url + '/v1/listpeers';
|
||||
request.post(options).then((body) => {
|
||||
body.peers.forEach((peer) => {
|
||||
peer.alias = peer.peer_id.substring(0, 20);
|
||||
peer.alias = peer.id.substring(0, 20);
|
||||
return peer;
|
||||
});
|
||||
res.status(200).json(body.peers || []);
|
||||
|
@ -34,12 +34,13 @@ export const postPeer = (req, res, next) => {
|
|||
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/connect';
|
||||
options.form = req.body;
|
||||
options.body = req.body;
|
||||
request.post(options).then((connectRes) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Peers', msg: 'Peer Connected', data: connectRes });
|
||||
options.url = req.session.selectedNode.ln_server_url + '/v1/listpeers';
|
||||
request.post(options).then((listPeersRes) => {
|
||||
const peers = listPeersRes ? common.newestOnTop(listPeersRes, 'id', req.body.id) : [];
|
||||
const listOptions = common.getOptions(req);
|
||||
listOptions.url = req.session.selectedNode.ln_server_url + '/v1/listpeers';
|
||||
request.post(listOptions).then((listPeersRes) => {
|
||||
const peers = listPeersRes && listPeersRes.peers ? common.newestOnTop(listPeersRes.peers, 'id', connectRes.id) : [];
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Peers', msg: 'Peers List after Connect Received', data: peers });
|
||||
res.status(201).json(peers);
|
||||
}).catch((errRes) => {
|
||||
|
@ -57,7 +58,12 @@ export const deletePeer = (req, res, next) => {
|
|||
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/disconnect';
|
||||
options.form = { id: req.params.peerId, force: !!req.query.force };
|
||||
const id = req.params.peerId;
|
||||
const force = !!req.query.force;
|
||||
options.body = {
|
||||
...(id && { id }),
|
||||
...(force && { force })
|
||||
};
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Peers', msg: 'Peer Disconnected', data: body });
|
||||
res.status(204).json({});
|
||||
|
|
|
@ -9,7 +9,7 @@ const common: CommonService = Common;
|
|||
|
||||
export const decodePaymentFromPaymentRequest = (selNode: CommonSelectedNode, payment) => {
|
||||
options.url = selNode.ln_server_url + '/v1/decode';
|
||||
options.form = { string: payment };
|
||||
options.body = { string: payment };
|
||||
return request.post(options).then((res) => {
|
||||
logger.log({ selectedNode: selNode, level: 'DEBUG', fileName: 'Payments', msg: 'Payment Decode Received', data: res });
|
||||
return res;
|
||||
|
@ -42,7 +42,7 @@ export const decodePayment = (req, res, next) => {
|
|||
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/decode';
|
||||
options.form = { string: req.params.payReq };
|
||||
options.body = { string: req.params.payReq };
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Payments', msg: 'Payment Decoded', data: body });
|
||||
res.status(200).json(body);
|
||||
|
@ -57,7 +57,7 @@ export const signMessage = (req, res, next) => {
|
|||
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/signmessage';
|
||||
options.form = { message: req.body.message };
|
||||
options.body = { message: req.body.message };
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Message', msg: 'Message Signed', data: body });
|
||||
res.status(201).json(body);
|
||||
|
@ -72,7 +72,7 @@ export const verifyMessage = (req, res, next) => {
|
|||
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/checkmessage';
|
||||
options.form = { message: req.body.message, zbase: req.body.signature };
|
||||
options.body = { message: req.body.message, zbase: req.body.signature };
|
||||
request.post(options, (error, response, body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Message', msg: 'Message Verified', data: body });
|
||||
res.status(201).json(body);
|
||||
|
|
|
@ -90,12 +90,12 @@ export class CLNOnChainUtxosComponent implements OnInit, AfterViewInit, OnDestro
|
|||
this.dustUtxos = utxosSelector.utxos?.filter((utxo) => +(utxo.amount_msat || 0) / 1000 < this.dustAmount);
|
||||
this.utxos = utxosSelector.utxos;
|
||||
if (this.isDustUTXO) {
|
||||
if (this.dustUtxos && this.dustUtxos.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.dustUtxos && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadUTXOsTable(this.dustUtxos);
|
||||
}
|
||||
} else {
|
||||
this.displayedColumns.unshift('is_dust');
|
||||
if (this.utxos && this.utxos.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.utxos && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadUTXOsTable(this.utxos);
|
||||
}
|
||||
}
|
||||
|
@ -107,11 +107,11 @@ export class CLNOnChainUtxosComponent implements OnInit, AfterViewInit, OnDestro
|
|||
ngAfterViewInit() {
|
||||
setTimeout(() => {
|
||||
if (this.isDustUTXO) {
|
||||
if (this.dustUtxos && this.dustUtxos.length > 0) {
|
||||
if (this.dustUtxos && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadUTXOsTable(this.dustUtxos);
|
||||
}
|
||||
} else {
|
||||
if (this.utxos && this.utxos.length > 0) {
|
||||
if (this.utxos && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadUTXOsTable(this.utxos);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ export class CLNChannelActiveHTLCsTableComponent implements OnInit, AfterViewIni
|
|||
}
|
||||
const allChannels = [...channelsSelector.activeChannels, ...channelsSelector.pendingChannels, ...channelsSelector.inactiveChannels];
|
||||
this.channelsJSONArr = allChannels?.filter((channel) => channel.htlcs && channel.htlcs.length > 0) || [];
|
||||
if (this.channelsJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.channelsJSONArr && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadHTLCsTable(this.channelsJSONArr);
|
||||
}
|
||||
this.logger.info(channelsSelector);
|
||||
|
|
|
@ -106,7 +106,7 @@ export class CLNChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe
|
|||
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
|
||||
}
|
||||
this.channelsData = channelsSeletor.activeChannels;
|
||||
if (this.channelsData.length > 0) {
|
||||
if (this.channelsData && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadChannelsTable(this.channelsData);
|
||||
}
|
||||
this.logger.info(channelsSeletor);
|
||||
|
|
|
@ -103,7 +103,7 @@ export class CLNChannelPendingTableComponent implements OnInit, AfterViewInit, O
|
|||
}
|
||||
this.channelsData = [...channelsSeletor.pendingChannels, ...channelsSeletor.inactiveChannels];
|
||||
this.channelsData = this.channelsData.sort((a, b) => ((this.CLNChannelPendingState[a.state || ''] >= this.CLNChannelPendingState[b.state || '']) ? 1 : -1));
|
||||
if (this.channelsData && this.channelsData.length > 0) {
|
||||
if (this.channelsData && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadChannelsTable(this.channelsData);
|
||||
}
|
||||
this.logger.info(channelsSeletor);
|
||||
|
|
|
@ -99,7 +99,7 @@ export class CLNPeersComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
|
||||
}
|
||||
this.peersData = peersSeletor.peers || [];
|
||||
if (this.peersData.length > 0) {
|
||||
if (this.peersData && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadPeersTable(this.peersData);
|
||||
}
|
||||
this.logger.info(peersSeletor);
|
||||
|
|
|
@ -88,7 +88,7 @@ export class CLNFailedTransactionsComponent implements OnInit, AfterViewInit, On
|
|||
}
|
||||
this.totalFailedTransactions = ffhSeletor.failedForwardingHistory.totalForwards || 0;
|
||||
this.failedEvents = ffhSeletor.failedForwardingHistory.listForwards || [];
|
||||
if (this.failedEvents.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.failedEvents && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadFailedEventsTable(this.failedEvents);
|
||||
}
|
||||
this.logger.info(ffhSeletor);
|
||||
|
|
|
@ -111,7 +111,7 @@ export class CLNForwardingHistoryComponent implements OnInit, OnChanges, AfterVi
|
|||
if (this.eventsData.length <= 0 && fhSeletor.forwardingHistory.listForwards) {
|
||||
this.totalForwardedTransactions = fhSeletor.forwardingHistory.totalForwards || 0;
|
||||
this.successfulEvents = fhSeletor.forwardingHistory.listForwards || [];
|
||||
if (this.successfulEvents.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.successfulEvents && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadForwardingEventsTable(this.successfulEvents);
|
||||
}
|
||||
this.logger.info(fhSeletor);
|
||||
|
|
|
@ -89,7 +89,7 @@ export class CLNLocalFailedTransactionsComponent implements OnInit, AfterViewIni
|
|||
}
|
||||
this.totalLocalFailedTransactions = lffhSeletor.localFailedForwardingHistory.totalForwards || 0;
|
||||
this.failedLocalEvents = lffhSeletor.localFailedForwardingHistory.listForwards || [];
|
||||
if (this.failedLocalEvents.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.failedLocalEvents&& this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadLocalfailedLocalEventsTable(this.failedLocalEvents);
|
||||
}
|
||||
this.logger.info(lffhSeletor);
|
||||
|
|
|
@ -110,7 +110,7 @@ export class CLNLightningInvoicesTableComponent implements OnInit, AfterViewInit
|
|||
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
|
||||
}
|
||||
this.invoiceJSONArr = invoicesSeletor.listInvoices.invoices || [];
|
||||
if (this.invoiceJSONArr && this.invoiceJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.invoiceJSONArr && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadInvoicesTable(this.invoiceJSONArr);
|
||||
}
|
||||
this.logger.info(invoicesSeletor);
|
||||
|
@ -118,7 +118,7 @@ export class CLNLightningInvoicesTableComponent implements OnInit, AfterViewInit
|
|||
this.actions.pipe(takeUntil(this.unSubs[4]), filter((action) => (action.type === CLNActions.SET_LOOKUP_CLN || action.type === CLNActions.UPDATE_API_CALL_STATUS_CLN))).
|
||||
subscribe((resLookup: any) => {
|
||||
if (resLookup.type === CLNActions.SET_LOOKUP_CLN) {
|
||||
if (this.invoiceJSONArr && this.invoiceJSONArr.length > 0 && this.sort && this.paginator && resLookup.payload) {
|
||||
if (this.invoiceJSONArr && this.sort && this.paginator && resLookup.payload) {
|
||||
this.updateInvoicesData(JSON.parse(JSON.stringify(resLookup.payload)));
|
||||
this.loadInvoicesTable(this.invoiceJSONArr);
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ export class CLNLightningInvoicesTableComponent implements OnInit, AfterViewInit
|
|||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
if (this.invoiceJSONArr && this.invoiceJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.invoiceJSONArr && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadInvoicesTable(this.invoiceJSONArr);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ export class CLNOffersTableComponent implements OnInit, AfterViewInit, OnDestroy
|
|||
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
|
||||
}
|
||||
this.offerJSONArr = offersSeletor.offers || [];
|
||||
if (this.offerJSONArr && this.offerJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.offerJSONArr && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadOffersTable(this.offerJSONArr);
|
||||
}
|
||||
this.logger.info(offersSeletor);
|
||||
|
@ -120,7 +120,7 @@ export class CLNOffersTableComponent implements OnInit, AfterViewInit, OnDestroy
|
|||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
if (this.offerJSONArr && this.offerJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.offerJSONArr && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadOffersTable(this.offerJSONArr);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,7 +119,7 @@ export class CLNLightningPaymentsComponent implements OnInit, AfterViewInit, OnD
|
|||
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
|
||||
}
|
||||
this.paymentJSONArr = paymentsSeletor.payments || [];
|
||||
if (this.paymentJSONArr.length && this.paymentJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.paymentJSONArr.length && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadPaymentsTable(this.paymentJSONArr);
|
||||
}
|
||||
this.logger.info(paymentsSeletor);
|
||||
|
@ -127,7 +127,7 @@ export class CLNLightningPaymentsComponent implements OnInit, AfterViewInit, OnD
|
|||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
if (this.paymentJSONArr.length && this.paymentJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.paymentJSONArr.length && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadPaymentsTable(this.paymentJSONArr);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ export class ECLChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe
|
|||
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
|
||||
}
|
||||
this.activeChannels = allChannelsSelector.activeChannels;
|
||||
if (this.activeChannels.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.activeChannels && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadChannelsTable();
|
||||
}
|
||||
this.logger.info(allChannelsSelector);
|
||||
|
@ -119,7 +119,7 @@ export class ECLChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe
|
|||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
if (this.activeChannels.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.activeChannels && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadChannelsTable();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ export class ECLForwardingHistoryComponent implements OnInit, OnChanges, AfterVi
|
|||
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
|
||||
}
|
||||
this.eventsData = paymentsSelector.payments && paymentsSelector.payments.relayed ? paymentsSelector.payments.relayed : [];
|
||||
if (this.eventsData.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.eventsData && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadForwardingEventsTable(this.eventsData);
|
||||
}
|
||||
this.logger.info(this.eventsData);
|
||||
|
|
|
@ -109,7 +109,7 @@ export class ECLLightningInvoicesComponent implements OnInit, AfterViewInit, OnD
|
|||
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
|
||||
}
|
||||
this.invoiceJSONArr = (invoicesSelector.invoices && invoicesSelector.invoices.length > 0) ? invoicesSelector.invoices : [];
|
||||
if (this.invoiceJSONArr && this.invoiceJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.invoiceJSONArr && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadInvoicesTable(this.invoiceJSONArr);
|
||||
}
|
||||
this.logger.info(invoicesSelector);
|
||||
|
@ -117,7 +117,7 @@ export class ECLLightningInvoicesComponent implements OnInit, AfterViewInit, OnD
|
|||
this.actions.pipe(takeUntil(this.unSubs[4]), filter((action) => (action.type === ECLActions.SET_LOOKUP_ECL || action.type === ECLActions.UPDATE_API_CALL_STATUS_ECL))).
|
||||
subscribe((resLookup: any) => {
|
||||
if (resLookup.type === ECLActions.SET_LOOKUP_ECL) {
|
||||
if (this.invoiceJSONArr.length > 0 && this.sort && this.paginator && resLookup.payload) {
|
||||
if (this.invoiceJSONArr && this.sort && this.paginator && resLookup.payload) {
|
||||
this.updateInvoicesData(JSON.parse(JSON.stringify(resLookup.payload)));
|
||||
this.loadInvoicesTable(this.invoiceJSONArr);
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ export class ECLLightningInvoicesComponent implements OnInit, AfterViewInit, OnD
|
|||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
if (this.invoiceJSONArr && this.invoiceJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.invoiceJSONArr && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadInvoicesTable(this.invoiceJSONArr);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ export class ECLLightningPaymentsComponent implements OnInit, AfterViewInit, OnD
|
|||
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
|
||||
}
|
||||
this.paymentJSONArr = (paymentsSeletor.payments && paymentsSeletor.payments.sent && paymentsSeletor.payments.sent.length > 0) ? paymentsSeletor.payments.sent : [];
|
||||
if (this.paymentJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.paymentJSONArr && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadPaymentsTable(this.paymentJSONArr);
|
||||
}
|
||||
this.logger.info(paymentsSeletor);
|
||||
|
|
|
@ -67,7 +67,7 @@ export class ChannelBackupTableComponent implements OnInit, AfterViewInit, OnDes
|
|||
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
|
||||
}
|
||||
this.channelsData = channelsSeletor.channels;
|
||||
if (this.channelsData.length > 0) {
|
||||
if (this.channelsData && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadBackupTable(this.channelsData);
|
||||
}
|
||||
this.logger.info(channelsSeletor);
|
||||
|
|
|
@ -83,7 +83,7 @@ export class ChannelActiveHTLCsTableComponent implements OnInit, AfterViewInit,
|
|||
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
|
||||
}
|
||||
this.channelsJSONArr = channelsSelector.channels?.filter((channel) => channel.pending_htlcs && channel.pending_htlcs.length > 0) || [];
|
||||
if (this.channelsJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.channelsJSONArr && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadHTLCsTable(this.channelsJSONArr);
|
||||
}
|
||||
this.logger.info(channelsSelector);
|
||||
|
|
|
@ -84,7 +84,7 @@ export class ChannelClosedTableComponent implements OnInit, AfterViewInit, OnDes
|
|||
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
|
||||
}
|
||||
this.closedChannelsData = closedChannelsSelector.closedChannels;
|
||||
if (this.closedChannelsData.length > 0) {
|
||||
if (this.closedChannelsData && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadClosedChannelsTable(this.closedChannelsData);
|
||||
}
|
||||
this.logger.info(closedChannelsSelector);
|
||||
|
|
|
@ -94,7 +94,7 @@ export class PeersComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
|
||||
}
|
||||
this.peersData = peersSelector.peers;
|
||||
if (this.peersData.length > 0) {
|
||||
if (this.peersData && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadPeersTable(this.peersData);
|
||||
}
|
||||
this.logger.info(peersSelector);
|
||||
|
|
|
@ -101,7 +101,7 @@ export class ForwardingHistoryComponent implements OnInit, AfterViewInit, OnChan
|
|||
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
|
||||
}
|
||||
this.forwardingHistoryData = fhSelector.forwardingHistory.forwarding_events || [];
|
||||
if (this.forwardingHistoryData.length > 0 && this.sort && this.paginator) {
|
||||
if (this.forwardingHistoryData && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadForwardingEventsTable(this.forwardingHistoryData);
|
||||
}
|
||||
this.logger.info(fhSelector.apiCallStatus);
|
||||
|
|
|
@ -85,7 +85,7 @@ export class NonRoutingPeersComponent implements OnInit, AfterViewInit, OnDestro
|
|||
} else {
|
||||
this.routingPeersData = [];
|
||||
}
|
||||
if (this.routingPeersData.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.routingPeersData && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadNonRoutingPeersTable(this.routingPeersData);
|
||||
}
|
||||
this.logger.info(fhSelector.apiCallStatus);
|
||||
|
|
|
@ -117,7 +117,7 @@ export class LightningInvoicesComponent implements OnInit, AfterViewInit, OnDest
|
|||
this.firstOffset = +(invoicesSelector.listInvoices.first_index_offset || -1);
|
||||
this.lastOffset = +(invoicesSelector.listInvoices.last_index_offset || -1);
|
||||
this.invoicesData = invoicesSelector.listInvoices.invoices || [];
|
||||
if (this.invoicesData.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.invoicesData && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadInvoicesTable(this.invoicesData);
|
||||
}
|
||||
this.logger.info(invoicesSelector);
|
||||
|
@ -125,7 +125,7 @@ export class LightningInvoicesComponent implements OnInit, AfterViewInit, OnDest
|
|||
this.actions.pipe(takeUntil(this.unSubs[4]), filter((action) => (action.type === LNDActions.SET_LOOKUP_LND || action.type === LNDActions.UPDATE_API_CALL_STATUS_LND))).
|
||||
subscribe((resLookup: any) => {
|
||||
if (resLookup.type === LNDActions.SET_LOOKUP_LND) {
|
||||
if (this.invoicesData.length > 0 && this.sort && this.paginator && resLookup.payload) {
|
||||
if (this.invoicesData && this.sort && this.paginator && resLookup.payload) {
|
||||
this.updateInvoicesData(JSON.parse(JSON.stringify(resLookup.payload)));
|
||||
this.loadInvoicesTable(this.invoicesData);
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ export class LightningPaymentsComponent implements OnInit, AfterViewInit, OnDest
|
|||
this.totalPayments = this.paymentJSONArr.length;
|
||||
this.firstOffset = +(paymentsSelector.listPayments.first_index_offset || -1);
|
||||
this.lastOffset = +(paymentsSelector.listPayments.last_index_offset || -1);
|
||||
if (this.paymentJSONArr && this.paymentJSONArr.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.paymentJSONArr && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
// this.loadPaymentsTable(this.paymentJSONArr);
|
||||
this.loadPaymentsTable(this.paymentJSONArr.slice(0, this.pageSize));
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ export class BoltzSwapsComponent implements OnInit, AfterViewInit, OnChanges, On
|
|||
this.tableSettingSwapIn = settings.pageSettings.find((page) => page.pageId === this.PAGE_ID)?.tables.find((table) => table.tableId === this.tableSettingSwapIn.tableId) ||
|
||||
LND_DEFAULT_PAGE_SETTINGS.find((page) => page.pageId === this.PAGE_ID)?.tables.find((table) => table.tableId === this.tableSettingSwapIn.tableId)!;
|
||||
this.setTableColumns();
|
||||
if (this.swapsData && this.swapsData.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.swapsData && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadSwapsTable(this.swapsData);
|
||||
}
|
||||
this.colWidth = this.displayedColumns.length ? ((this.commonService.getContainerSize().width / this.displayedColumns.length) / 14) + 'rem' : '20rem';
|
||||
|
|
|
@ -76,7 +76,7 @@ export class SwapsComponent implements OnInit, AfterViewInit, OnChanges, OnDestr
|
|||
}
|
||||
this.displayedColumns.push('actions');
|
||||
this.pageSize = this.tableSetting.recordsPerPage ? +this.tableSetting.recordsPerPage : PAGE_SIZE;
|
||||
if (this.swapsData && this.swapsData.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
if (this.swapsData && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadSwapsTable(this.swapsData);
|
||||
}
|
||||
this.colWidth = this.displayedColumns.length ? ((this.commonService.getContainerSize().width / this.displayedColumns.length) / 14) + 'rem' : '20rem';
|
||||
|
|
|
@ -12,7 +12,7 @@ export const HOUR_SECONDS = 3600;
|
|||
|
||||
export const DEFAULT_INVOICE_EXPIRY = HOUR_SECONDS * 24 * 7;
|
||||
|
||||
export const VERSION = '0.14.1-beta';
|
||||
export const VERSION = '0.15.0-beta';
|
||||
|
||||
export const API_URL = isDevMode() ? 'http://localhost:3000/rtl/api' : './api';
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue