mirror of
https://github.com/Ride-The-Lightning/RTL.git
synced 2025-02-21 22:11:54 +01:00
Sats to BTC
Sats to BTC
This commit is contained in:
parent
8bd46169f8
commit
0b0ece429f
6 changed files with 43 additions and 5 deletions
|
@ -164,6 +164,14 @@
|
|||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.overflow-y-auto {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.overflow-auto {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.mat-footer-row, .mat-header-row, .mat-row {
|
||||
border-bottom-width: 0px;
|
||||
}
|
||||
|
@ -214,4 +222,5 @@
|
|||
|
||||
.cursor-pointer {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
<base href="/">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes">
|
||||
<link rel="icon" type="image/x-icon" href="./assets/img/favicon.ico">
|
||||
<link rel="stylesheet" href="styles.d5d7e795bfda7c99a927.css"></head>
|
||||
<link rel="stylesheet" href="styles.c15bc5aec7303c953f16.css"></head>
|
||||
<body>
|
||||
<rtl-root></rtl-root>
|
||||
|
||||
<script type="text/javascript" src="runtime.6afe30102d8fe7337431.js"></script><script type="text/javascript" src="polyfills.c7939909ac1e754960ad.js"></script><script type="text/javascript" src="main.f67708a74ab81f3d782a.js"></script></body></html>
|
||||
<script type="text/javascript" src="runtime.6afe30102d8fe7337431.js"></script><script type="text/javascript" src="polyfills.c7939909ac1e754960ad.js"></script><script type="text/javascript" src="main.11a4ab7fea338667ab3f.js"></script></body></html>
|
1
angular/main.11a4ab7fea338667ab3f.js
Normal file
1
angular/main.11a4ab7fea338667ab3f.js
Normal file
File diff suppressed because one or more lines are too long
1
angular/styles.c15bc5aec7303c953f16.css
Normal file
1
angular/styles.c15bc5aec7303c953f16.css
Normal file
File diff suppressed because one or more lines are too long
|
@ -9,13 +9,25 @@ exports.getBalance = (req, res, next) => {
|
|||
options.qs = req.query;
|
||||
request.get(options, (error, response, body) => {
|
||||
console.log('Request params: ' + JSON.stringify(req.params) + '\nRequest Query: ' + JSON.stringify(req.query) + ' \nBalance Received: ' + JSON.stringify(body));
|
||||
if(undefined === body || body.error) {
|
||||
const body_str = (undefined === body) ? '' : JSON.stringify(body);
|
||||
const search_idx = (undefined === body) ? -1 : body_str.search('Not Found');
|
||||
console.log('Balance Information Received: ' + body_str);
|
||||
if(undefined === body || search_idx > -1 || body.error) {
|
||||
res.status(500).json({
|
||||
message: "Fetching balance failed!",
|
||||
error: (undefined === body) ? 'ERROR From Server!' : body.error
|
||||
error: (undefined === body || search_idx > -1) ? 'ERROR From Server!' : body.error
|
||||
});
|
||||
} else {
|
||||
body.balance = (undefined === body.balance) ? 0 : convertToBTC(body.balance);
|
||||
body.total_balance = (undefined === body.total_balance) ? 0 : convertToBTC(body.total_balance);
|
||||
body.confirmed_balance = (undefined === body.confirmed_balance) ? 0 : convertToBTC(body.confirmed_balance);
|
||||
body.unconfirmed_balance = (undefined === body.unconfirmed_balance) ? 0 : convertToBTC(body.unconfirmed_balance);
|
||||
res.status(200).json({balance: body});
|
||||
}
|
||||
});
|
||||
|
||||
convertToBTC = (num) => {
|
||||
return (num / 100000000).toFixed(6);
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -14,7 +14,22 @@ exports.getGraphInfo = (req, res, next) => {
|
|||
error: (undefined === body || search_idx > -1) ? 'ERROR From Server!' : body.error
|
||||
});
|
||||
} else {
|
||||
body.avg_out_degree = (undefined === body.avg_out_degree) ? 0 : twoDecimalRound(body.avg_out_degree);
|
||||
body.total_network_capacity = (undefined === body.total_network_capacity) ? 0 : convertToBTC(body.total_network_capacity);
|
||||
body.avg_channel_size = (undefined === body.avg_channel_size) ? 0 : convertToBTC(body.avg_channel_size);
|
||||
body.min_channel_size = (undefined === body.min_channel_size) ? 0 : convertToBTC(body.min_channel_size);
|
||||
body.max_channel_size = (undefined === body.max_channel_size) ? 0 : convertToBTC(body.max_channel_size);
|
||||
console.log('Network Information After Rounding and Conversion: ' + body_str);
|
||||
res.status(200).json(body);
|
||||
}
|
||||
});
|
||||
|
||||
twoDecimalRound = (num) => {
|
||||
return num.toFixed(2);
|
||||
};
|
||||
|
||||
convertToBTC = (num) => {
|
||||
return (num / 100000000).toFixed(6);
|
||||
};
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue