parent
e3668d2a37
commit
fd18fc5dca
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
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 +1 @@
|
||||
!function(e){function r(r){for(var n,i,a=r[0],c=r[1],f=r[2],p=0,s=[];p<a.length;p++)o[i=a[p]]&&s.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);s.length;)s.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++)0!==o[t[a]]&&(n=!1);n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={0:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise(function(r,n){t=o[e]=[r,n]});r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+""+({}[e]||e)+"."+{1:"54859a9ed4dbe675e082",6:"10cd8607c932f8229120",7:"2becbc02aff346bd8d1e"}[e]+".js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(f);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var f=setTimeout(function(){u({type:"timeout",target:a})},12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,(function(r){return e[r]}).bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="",i.oe=function(e){throw console.error(e),e};var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var f=0;f<a.length;f++)r(a[f]);var l=c;t()}([]);
|
||||
!function(e){function r(r){for(var n,i,a=r[0],c=r[1],f=r[2],p=0,s=[];p<a.length;p++)o[i=a[p]]&&s.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);s.length;)s.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++)0!==o[t[a]]&&(n=!1);n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={0:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise(function(r,n){t=o[e]=[r,n]});r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+""+({}[e]||e)+"."+{1:"54859a9ed4dbe675e082",6:"ce8707b220b01fc9d2e2",7:"0664e0a31cfe902f29cf"}[e]+".js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(f);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var f=setTimeout(function(){u({type:"timeout",target:a})},12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,(function(r){return e[r]}).bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="",i.oe=function(e){throw console.error(e),e};var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var f=0;f<a.length;f++)r(a[f]);var l=c;t()}([]);
|
@ -0,0 +1,73 @@
|
||||
var request = require('request-promise');
|
||||
var common = require('../../common');
|
||||
var logger = require('../logger');
|
||||
var options = {};
|
||||
|
||||
exports.getRoute = (req, res, next) => {
|
||||
options = common.getOptions();
|
||||
options.url = common.getSelLNServerUrl() + '/network/getRoute/' + req.params.destPubkey + '/' + req.params.amount;
|
||||
request(options).then((body) => {
|
||||
logger.info({fileName: 'Network', msg: 'Query Routes Received: ' + JSON.stringify(body)});
|
||||
if(undefined === body || body.error) {
|
||||
res.status(500).json({
|
||||
message: "Fetching Query Routes Failed!",
|
||||
error: (undefined === body) ? 'Error From Server!' : body.error
|
||||
});
|
||||
}
|
||||
res.status(200).json({routes: body});
|
||||
})
|
||||
.catch((err) => {
|
||||
return res.status(500).json({
|
||||
message: "Fetching Query Routes Failed!",
|
||||
error: err.error
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
exports.listNode = (req, res, next) => {
|
||||
options = common.getOptions();
|
||||
options.url = common.getSelLNServerUrl() + '/peer/listPeers';
|
||||
request(options).then(function (body) {
|
||||
let peers = (undefined !== body) ? common.sortDescByKey(body, 'alias') : [];
|
||||
logger.info({fileName: 'Peers', msg: 'Peers with Alias: ' + JSON.stringify(peers)});
|
||||
res.status(200).json(peers);
|
||||
})
|
||||
.catch((err) => {
|
||||
return res.status(500).json({
|
||||
message: "Peers Fetch Failed!",
|
||||
error: err.error
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
exports.listChannel = (req, res, next) => {
|
||||
options = common.getOptions();
|
||||
options.url = common.getSelLNServerUrl() + '/peer/listPeers';
|
||||
request(options).then(function (body) {
|
||||
let peers = (undefined !== body) ? common.sortDescByKey(body, 'alias') : [];
|
||||
logger.info({fileName: 'Peers', msg: 'Peers with Alias: ' + JSON.stringify(peers)});
|
||||
res.status(200).json(peers);
|
||||
})
|
||||
.catch((err) => {
|
||||
return res.status(500).json({
|
||||
message: "Peers Fetch Failed!",
|
||||
error: err.error
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
exports.feeRates = (req, res, next) => {
|
||||
options = common.getOptions();
|
||||
options.url = common.getSelLNServerUrl() + '/peer/listPeers';
|
||||
request(options).then(function (body) {
|
||||
let peers = (undefined !== body) ? common.sortDescByKey(body, 'alias') : [];
|
||||
logger.info({fileName: 'Peers', msg: 'Peers with Alias: ' + JSON.stringify(peers)});
|
||||
res.status(200).json(peers);
|
||||
})
|
||||
.catch((err) => {
|
||||
return res.status(500).json({
|
||||
message: "Peers Fetch Failed!",
|
||||
error: err.error
|
||||
});
|
||||
});
|
||||
};
|
@ -1,30 +0,0 @@
|
||||
var request = require('request-promise');
|
||||
var common = require('../../common');
|
||||
var logger = require('../logger');
|
||||
var options = {};
|
||||
|
||||
exports.decodePayment = (req, res, next) => {
|
||||
options = common.getOptions();
|
||||
options.url = common.getSelLNServerUrl() + '/payreq/' + req.params.payRequest;
|
||||
request(options).then((body) => {
|
||||
const body_str = (undefined === body) ? '' : JSON.stringify(body);
|
||||
const search_idx = (undefined === body) ? -1 : body_str.search('Not Found');
|
||||
logger.info({fileName: 'PayReq', msg: 'Payment Decodd Received: ' + body_str});
|
||||
if(undefined === body || search_idx > -1 || body.error) {
|
||||
res.status(500).json({
|
||||
message: "Payment Request Decode Failed!",
|
||||
error: (undefined === body || search_idx > -1) ? 'Error From Server!' : body.error
|
||||
});
|
||||
} else {
|
||||
body.btc_num_satoshis = (undefined === body.num_satoshis) ? 0 : common.convertToBTC(body.num_satoshis);
|
||||
body.timestamp_str = (undefined === body.timestamp) ? '' : common.convertTimestampToDate(body.timestamp);
|
||||
res.status(200).json(body);
|
||||
}
|
||||
})
|
||||
.catch(function (err) {
|
||||
return res.status(500).json({
|
||||
message: "Payment Request Decode Failed!",
|
||||
error: err.error
|
||||
});
|
||||
});
|
||||
};
|
@ -1,50 +0,0 @@
|
||||
var request = require('request-promise');
|
||||
var common = require('../../common');
|
||||
var logger = require('../logger');
|
||||
var options = {};
|
||||
|
||||
exports.forwardingHistory = (req, res, next) => {
|
||||
options = common.getOptions();
|
||||
options.url = common.getSelLNServerUrl() + '/switch';
|
||||
options.form = {};
|
||||
if (undefined !== req.body.num_max_events) {
|
||||
options.form.num_max_events = req.body.num_max_events;
|
||||
}
|
||||
if (undefined !== req.body.index_offset) {
|
||||
options.form.index_offset = req.body.index_offset;
|
||||
}
|
||||
if (undefined !== req.body.end_time) {
|
||||
options.form.end_time = req.body.end_time;
|
||||
}
|
||||
if (undefined !== req.body.start_time) {
|
||||
options.form.start_time = req.body.start_time;
|
||||
}
|
||||
options.form = JSON.stringify(options.form);
|
||||
logger.info({fileName: 'Switch', msg: 'Switch Post Options: ' + JSON.stringify(options)});
|
||||
request.post(options).then((body) => {
|
||||
logger.info({fileName: 'Switch', msg: 'Switch Post Response: ' + JSON.stringify(body)});
|
||||
if(undefined === body || body.error) {
|
||||
logger.error({fileName: 'Switch', lineNum: 27, msg: 'Switch Post Erroe: ' + JSON.stringify((undefined === body) ? 'Error From Server!' : body.error)});
|
||||
res.status(500).json({
|
||||
message: "Switch post failed!",
|
||||
error: (undefined === body) ? 'Error From Server!' : body.error
|
||||
});
|
||||
} else {
|
||||
if (undefined !== body.forwarding_events) {
|
||||
body.forwarding_events.forEach(event => {
|
||||
event.timestamp_str = (undefined === event.timestamp) ? '' : common.convertTimestampToDate(event.timestamp);
|
||||
});
|
||||
body.forwarding_events = common.sortDescByKey(body.forwarding_events, 'timestamp');
|
||||
}
|
||||
logger.info({fileName: 'Switch', msg: 'Forwarding History Received: ' + JSON.stringify(body)});
|
||||
res.status(201).json(body);
|
||||
}
|
||||
})
|
||||
.catch(function (err) {
|
||||
logger.error({fileName: 'Switch', lineNum: 44, msg: 'Switch Post Error: ' + JSON.stringify(err)});
|
||||
return res.status(500).json({
|
||||
message: "Switch post failed!",
|
||||
error: err.error
|
||||
});
|
||||
});
|
||||
};
|
@ -1,66 +0,0 @@
|
||||
var request = require('request-promise');
|
||||
var common = require('../../common');
|
||||
var logger = require('../logger');
|
||||
var options = {};
|
||||
|
||||
exports.getTransactions = (req, res, next) => {
|
||||
options = common.getOptions();
|
||||
options.url = common.getSelLNServerUrl() + '/transactions';
|
||||
request(options).then((body) => {
|
||||
const body_str = (undefined === body) ? '' : JSON.stringify(body);
|
||||
const search_idx = (undefined === body) ? -1 : body_str.search('Not Found');
|
||||
logger.info({fileName: 'Transactions', msg: 'Transaction Received: ' + body_str});
|
||||
if(undefined === body || search_idx > -1 || body.error) {
|
||||
res.status(500).json({
|
||||
message: "Fetching Transactions Failed!",
|
||||
error: (undefined === body || search_idx > -1) ? 'Error From Server!' : body.error
|
||||
});
|
||||
} else {
|
||||
if (undefined !== body.transactions) {
|
||||
body.transactions.forEach(transaction => {
|
||||
transaction.time_stamp_str = (undefined === transaction.time_stamp) ? '' : common.convertTimestampToDate(transaction.time_stamp);
|
||||
});
|
||||
body.transactions = common.sortDescByKey(body.transactions, 'time_stamp');
|
||||
}
|
||||
res.status(200).json(body.transactions);
|
||||
}
|
||||
})
|
||||
.catch(function (err) {
|
||||
return res.status(500).json({
|
||||
message: "Fetching Transactions Failed!",
|
||||
error: err.error
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
exports.postTransactions = (req, res, next) => {
|
||||
options = common.getOptions();
|
||||
options.url = common.getSelLNServerUrl() + '/transactions';
|
||||
options.form = {
|
||||
amount: req.body.amount,
|
||||
addr: req.body.address,
|
||||
sat_per_byte: req.body.fees,
|
||||
target_conf: req.body.blocks
|
||||
};
|
||||
if (req.body.sendAll) {
|
||||
options.form.send_all = req.body.sendAll;
|
||||
}
|
||||
options.form = JSON.stringify(options.form);
|
||||
request.post(options).then((body) => {
|
||||
logger.info({fileName: 'Transactions', msg: 'Transaction Post Response: ' + JSON.stringify(body)});
|
||||
if(undefined === body || body.error) {
|
||||
res.status(500).json({
|
||||
message: "Transactions post failed!",
|
||||
error: (undefined === body) ? 'Error From Server!' : body.error
|
||||
});
|
||||
} else {
|
||||
res.status(201).json(body);
|
||||
}
|
||||
})
|
||||
.catch(function (err) {
|
||||
return res.status(500).json({
|
||||
message: "Transactions post failed!",
|
||||
error: err.error
|
||||
});
|
||||
});
|
||||
};
|
@ -1,93 +0,0 @@
|
||||
var request = require('request-promise');
|
||||
var common = require('../../common');
|
||||
var atob = require('atob');
|
||||
var logger = require('../logger');
|
||||
var options = {};
|
||||
|
||||
exports.genSeed = (req, res, next) => {
|
||||
options = common.getOptions();
|
||||
options.url = common.getSelLNServerUrl() + '/genseed';
|
||||
if (undefined !== req.params.passphrase) {
|
||||
options.form = JSON.stringify({aezeed_passphrase: atob(req.params.passphrase)});
|
||||
}
|
||||
request(options).then((body) => {
|
||||
if(undefined === body || body.error) {
|
||||
res.status(500).json({
|
||||
message: "Genseed failed!",
|
||||
error: (undefined === body) ? 'Error From Server!' : body.error
|
||||
});
|
||||
} else {
|
||||
res.status(200).json(body);
|
||||
}
|
||||
})
|
||||
.catch(function (err) {
|
||||
return res.status(500).json({
|
||||
message: "Genseed failed!",
|
||||
error: err.error
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
exports.operateWallet = (req, res, next) => {
|
||||
options = common.getOptions();
|
||||
options.method = 'POST';
|
||||
if (undefined === req.params.operation || req.params.operation === 'unlockwallet') {
|
||||
options.url = common.getSelLNServerUrl() + '/unlockwallet';
|
||||
options.form = JSON.stringify({
|
||||
wallet_password: Buffer.from(atob(req.body.wallet_password)).toString('base64')
|
||||
});
|
||||
err_message = 'Unlocking wallet failed! Verify that lnd is running and the wallet is locked!';
|
||||
} else {
|
||||
options.url = common.getSelLNServerUrl() + '/initwallet';
|
||||
if (undefined !== req.body.aezeed_passphrase && req.body.aezeed_passphrase !== '') {
|
||||
options.form = JSON.stringify({
|
||||
wallet_password: Buffer.from(atob(req.body.wallet_password)).toString('base64'),
|
||||
cipher_seed_mnemonic: req.body.cipher_seed_mnemonic,
|
||||
aezeed_passphrase: Buffer.from(atob(req.body.aezeed_passphrase)).toString('base64')
|
||||
});
|
||||
} else {
|
||||
options.form = JSON.stringify({
|
||||
wallet_password: Buffer.from(atob(req.body.wallet_password)).toString('base64'),
|
||||
cipher_seed_mnemonic: req.body.cipher_seed_mnemonic
|
||||
});
|
||||
}
|
||||
err_message = 'Initializing wallet failed!';
|
||||
}
|
||||
request(options).then((body) => {
|
||||
logger.info({fileName: 'Wallet', msg: 'Wallet Response: ' + JSON.stringify(body)});
|
||||
const body_str = (undefined === body) ? '' : JSON.stringify(body);
|
||||
const search_idx = (undefined === body) ? -1 : body_str.search('Not Found');
|
||||
if(undefined === body) {
|
||||
res.status(500).json({
|
||||
message: err_message,
|
||||
error: (error) ? error : err_message
|
||||
});
|
||||
} else if(search_idx > -1) {
|
||||
res.status(500).json({
|
||||
message: err_message,
|
||||
error: err_message
|
||||
});
|
||||
} else if(body.error) {
|
||||
if((body.code === 1 && body.error === 'context canceled') || (body.code === 14 && body.error === 'transport is closing')) {
|
||||
res.status(201).json('Successful');
|
||||
} else {
|
||||
res.status(500).json({
|
||||
message: err_message,
|
||||
error: body.error
|
||||
});
|
||||
}
|
||||
} else {
|
||||
res.status(201).json('Successful');
|
||||
}
|
||||
}).catch(error => {
|
||||
logger.error({fileName: 'Wallet', lineNum: 83, msg: 'Wallet Response: ' + JSON.stringify(error.error)});
|
||||
if((error.error.code === 1 && error.error.error === 'context canceled') || (error.error.code === 14 && error.error.error === 'transport is closing')) {
|
||||
res.status(201).json('Successful');
|
||||
} else {
|
||||
res.status(500).json({
|
||||
message: err_message,
|
||||
error: error.message
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
@ -0,0 +1,11 @@
|
||||
const NetworkController = require("../../controllers/c-lightning/network");
|
||||
const express = require("express");
|
||||
const router = express.Router();
|
||||
const authCheck = require("../authCheck");
|
||||
|
||||
router.get("/getRoute/:destPubkey/:amount", authCheck, NetworkController.getRoute);
|
||||
router.get("/listNode", authCheck, NetworkController.listNode);
|
||||
router.get("/listChannel", authCheck, NetworkController.listChannel);
|
||||
router.get("/feeRates", authCheck, NetworkController.feeRates);
|
||||
|
||||
module.exports = router;
|
@ -1,8 +0,0 @@
|
||||
const NewAddressController = require("../../controllers/c-lightning/newAddress");
|
||||
const express = require("express");
|
||||
const router = express.Router();
|
||||
const authCheck = require("../authCheck");
|
||||
|
||||
router.get("/", authCheck, NewAddressController.getNewAddress);
|
||||
|
||||
module.exports = router;
|
@ -1,8 +1,8 @@
|
||||
const SwitchController = require("../../controllers/c-lightning/switch");
|
||||
const OnChainController = require("../../controllers/c-lightning/onchain");
|
||||
const express = require("express");
|
||||
const router = express.Router();
|
||||
const authCheck = require("../authCheck");
|
||||
|
||||
router.post("/", authCheck, SwitchController.forwardingHistory);
|
||||
router.get("/", authCheck, OnChainController.getNewAddress);
|
||||
|
||||
module.exports = router;
|
@ -1,8 +0,0 @@
|
||||
const PayRequestController = require("../../controllers/c-lightning/payReq");
|
||||
const express = require("express");
|
||||
const router = express.Router();
|
||||
const authCheck = require("../authCheck");
|
||||
|
||||
router.get("/:payRequest", authCheck, PayRequestController.decodePayment);
|
||||
|
||||
module.exports = router;
|
@ -1,9 +0,0 @@
|
||||
const TransactionsController = require("../../controllers/c-lightning/transactions");
|
||||
const express = require("express");
|
||||
const router = express.Router();
|
||||
const authCheck = require("../authCheck");
|
||||
|
||||
router.get("/", authCheck, TransactionsController.getTransactions);
|
||||
router.post("/", authCheck, TransactionsController.postTransactions);
|
||||
|
||||
module.exports = router;
|
@ -1,9 +0,0 @@
|
||||
const WalletController = require("../../controllers/c-lightning/wallet");
|
||||
const express = require("express");
|
||||
const router = express.Router();
|
||||
const authCheck = require("../authCheck");
|
||||
|
||||
router.get("/genseed/:passphrase?", authCheck, WalletController.genSeed);
|
||||
router.post("/:operation", authCheck, WalletController.operateWallet);
|
||||
|
||||
module.exports = router;
|
@ -1,80 +1,84 @@
|
||||
<!-- <div fxLayout="column">
|
||||
<div class="padding-gap">
|
||||
<mat-card>
|
||||
<mat-card-header>
|
||||
<mat-card-subtitle>
|
||||
<h2>Query Routes</h2>
|
||||
</mat-card-subtitle>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<form fxLayout="column" fxLayoutAlign="space-between stretch" fxLayout.gt-md="row wrap"
|
||||
(ngSubmit)="queryRoutesForm.form.valid && onQueryRoutes()" #queryRoutesForm="ngForm">
|
||||
<mat-form-field fxFlex="50" fxLayoutAlign="start end">
|
||||
<input matInput placeholder="Destination Pubkey" name="destinationPubkey" [(ngModel)]="destinationPubkey"
|
||||
tabindex="1" required #destPubkey="ngModel">
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex="20" fxLayoutAlign="start end">
|
||||
<input matInput placeholder="Amount (Sats)" name="amount" [(ngModel)]="amount" tabindex="2" type="number"
|
||||
step="1000" min="0" required #destAmount="ngModel">
|
||||
</mat-form-field>
|
||||
<div fxFlex="15" fxLayoutAlign="start start">
|
||||
<button fxFlex="90" fxLayoutAlign="center center" mat-raised-button color="primary"
|
||||
[disabled]="destPubkey.invalid || destAmount.invalid" type="submit" tabindex="3">
|
||||
<p *ngIf="(destPubkey.invalid && (destPubkey.dirty || destPubkey.touched) || (destAmount.invalid && (destAmount.dirty || destAmount.touched))); else queryText">Invalid Pubkey/Amount
|
||||
</p>
|
||||
<ng-template #queryText>
|
||||
<p>Query</p>
|
||||
</ng-template>
|
||||
</button>
|
||||
</div>
|
||||
<div fxFlex="15" fxLayoutAlign="start start">
|
||||
<button fxFlex="90" fxLayoutAlign="center center" mat-raised-button color="accent" tabindex="4" type="reset"
|
||||
(click)="resetData()">Clear</button>
|
||||
</div>
|
||||
</form>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div class="padding-gap">
|
||||
<mat-card>
|
||||
<mat-card-content class="table-card-content">
|
||||
<div perfectScrollbar class="table-container mat-elevation-z8">
|
||||
<mat-progress-bar *ngIf="flgLoading[0]===true" mode="indeterminate"></mat-progress-bar>
|
||||
<table mat-table #table [dataSource]="qrHops" matSort
|
||||
[ngClass]="{'mat-elevation-z8 overflow-x-auto error-border': flgLoading[0]==='error','mat-elevation-z8 overflow-x-auto': true}">
|
||||
<ng-container matColumnDef="hop_sequence">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Hop </th>
|
||||
<td mat-cell *matCellDef="let hop"> {{hop?.hop_sequence}} </td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="pubkey_alias">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Node </th>
|
||||
<td mat-cell *matCellDef="let hop"> {{hop?.pubkey_alias}} </td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="chan_id">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Channel </th>
|
||||
<td mat-cell *matCellDef="let hop"> {{hop?.chan_id}} </td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="chan_capacity">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Capacity (sats) </th>
|
||||
<td mat-cell *matCellDef="let hop"><span fxLayoutAlign="end center"> {{hop?.chan_capacity | number}}
|
||||
</span></td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="amt_to_forward_msat">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Amount To Fwd (msats) </th>
|
||||
<td mat-cell *matCellDef="let hop"><span fxLayoutAlign="end center"> {{hop?.amt_to_forward_msat | number}}
|
||||
</span></td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="fee_msat">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Fee (msat) </th>
|
||||
<td mat-cell *matCellDef="let hop"><span fxLayoutAlign="end center"> {{hop?.fee_msat | number}} </span>
|
||||
</td>
|
||||
</ng-container>
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: flgSticky;"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;" (click)="onHopClick(row, $event)"></tr>
|
||||
</table>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
</div> -->
|
||||
<h3>PAYMENTS QUERY ROUTES</h3>
|
||||
<div fxLayout="column">
|
||||
<div class="padding-gap">
|
||||
<mat-card>
|
||||
<mat-card-header>
|
||||
<mat-card-subtitle>
|
||||
<h2>Query Routes</h2>
|
||||
</mat-card-subtitle>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<form fxLayout="column" fxLayoutAlign="space-between stretch" fxLayout.gt-md="row wrap"
|
||||
(ngSubmit)="queryRoutesForm.form.valid && onQueryRoutes()" #queryRoutesForm="ngForm">
|
||||
<mat-form-field fxFlex="50" fxLayoutAlign="start end">
|
||||
<input matInput placeholder="Destination Pubkey" name="destinationPubkey" [(ngModel)]="destinationPubkey"
|
||||
tabindex="1" required #destPubkey="ngModel">
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex="20" fxLayoutAlign="start end">
|
||||
<input matInput placeholder="Amount (Sats)" name="amount" [(ngModel)]="amount" tabindex="2" type="number"
|
||||
step="1000" min="0" required #destAmount="ngModel">
|
||||
</mat-form-field>
|
||||
<div fxFlex="15" fxLayoutAlign="start start">
|
||||
<button fxFlex="90" fxLayoutAlign="center center" mat-raised-button color="primary"
|
||||
[disabled]="destPubkey.invalid || destAmount.invalid" type="submit" tabindex="3">
|
||||
<p
|
||||
*ngIf="(destPubkey.invalid && (destPubkey.dirty || destPubkey.touched) || (destAmount.invalid && (destAmount.dirty || destAmount.touched))); else queryText">
|
||||
Invalid Pubkey/Amount
|
||||
</p>
|
||||
<ng-template #queryText>
|
||||
<p>Query</p>
|
||||
</ng-template>
|
||||
</button>
|
||||
</div>
|
||||
<div fxFlex="15" fxLayoutAlign="start start">
|
||||
<button fxFlex="90" fxLayoutAlign="center center" mat-raised-button color="accent" tabindex="4" type="reset"
|
||||
(click)="resetData()">Clear</button>
|
||||
</div>
|
||||
</form>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div class="padding-gap">
|
||||
<mat-card>
|
||||
<mat-card-content class="table-card-content">
|
||||
<div perfectScrollbar class="table-container mat-elevation-z8">
|
||||
<mat-progress-bar *ngIf="flgLoading[0]===true" mode="indeterminate"></mat-progress-bar>
|
||||
<table mat-table #table [dataSource]="qRoutes" matSort
|
||||
[ngClass]="{'mat-elevation-z8 overflow-x-auto error-border': flgLoading[0]==='error','mat-elevation-z8 overflow-x-auto': true}">
|
||||
<ng-container matColumnDef="id">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> ID </th>
|
||||
<td mat-cell *matCellDef="let route"> {{route?.id}} </td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="alias">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Alias </th>
|
||||
<td mat-cell *matCellDef="let route"> {{route?.alias}} </td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="channel">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Channel </th>
|
||||
<td mat-cell *matCellDef="let route"> {{route?.channel}} </td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="direction">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Direction </th>
|
||||
<td mat-cell *matCellDef="let route"> {{route?.direction}} </td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="msatoshi">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> mSatoshi </th>
|
||||
<td mat-cell *matCellDef="let route"><span fxLayoutAlign="end center"> {{route?.msatoshi | number}}
|
||||
</span></td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="amount_msat">
|
||||
<th mat-header-cell class="pl-4" *matHeaderCellDef mat-sort-header> Amount mSat </th>
|
||||
<td mat-cell class="pl-4" *matCellDef="let route"> {{route?.amount_msat}} </td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="delay">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Delay </th>
|
||||
<td mat-cell *matCellDef="let route"><span fxLayoutAlign="end center"> {{route?.delay | number}} </span>
|
||||
</td>
|
||||
</ng-container>
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: flgSticky;"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;" (click)="onRouteClick(row, $event)"></tr>
|
||||
</table>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in New Issue