-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/sensei-client' of https://github.com/atlantabit…
…devs/familybtc into feature/nodes
- Loading branch information
Showing
10 changed files
with
191 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
const express = require('express'); | ||
const router = express(); | ||
|
||
const { getAccountAllowance } = require('./accountController'); | ||
const { getAccountAllowance, payInvoice, createInvoice } = require('./accountController'); | ||
|
||
router.get('/allowance', getAccountAllowance); | ||
router.get('/payment/send', payInvoice); | ||
router.get('/payment/receive', createInvoice); | ||
|
||
module.exports = router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,21 @@ | ||
const debug = require('../../utils/debug'); | ||
const accounts = require('../../db/collection'); | ||
const senseiAdmin = require('../../sensei/admin'); | ||
const senseiNodes = require('../../sensei/nodes'); | ||
|
||
module.exports = { }; | ||
const getAllBalances = async (req, res) => { | ||
try { | ||
const response = await senseiAdmin.listNodes(); | ||
let nodes = []; | ||
for (let node of response.nodes) { | ||
node.balance = await senseiNodes.getBalance(node.username); | ||
nodes.push(node);x | ||
} | ||
return { success: true, message: nodes }; | ||
} catch (error) { | ||
debug.error(error.stack); | ||
throw new Error(error); | ||
} | ||
}; | ||
|
||
module.exports = { getAllBalances }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,10 +6,9 @@ | |
"repository": "[email protected]:atlantabitdevs/familybtc.git", | ||
"author": "[email protected]", | ||
"license": "MIT", | ||
"private": false, | ||
"scripts": { | ||
"start": "NODE_ENV=prod node server.js", | ||
"dev": "NODE_ENV=local nodemon server.js" | ||
"start": "PORT=8080 node server.js", | ||
"dev": "PORT=8081 nodemon server.js" | ||
}, | ||
"dependencies": { | ||
"cors": "^2.8.5", | ||
|
@@ -20,6 +19,7 @@ | |
"http-errors": "^2.0.0", | ||
"mailgun-js": "^0.22.0", | ||
"morgan": "^1.10.0", | ||
"node-fetch": "2.6.6", | ||
"nodemon": "^2.0.15", | ||
"opennode": "^1.3.0", | ||
"uuid": "^8.3.2", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.