Skip to content

Commit

Permalink
clear
Browse files Browse the repository at this point in the history
  • Loading branch information
bnonni committed May 7, 2022
2 parents 38710d8 + e295aad commit 0c35289
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
3 changes: 3 additions & 0 deletions backend/api/account/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ const router = express();

const { getAccountAllowance, payInvoice, createInvoice } = require('./accountController');

const { getBalance } = require('../../sensei/nodes');

router.get('/account/balance', getBalance);
router.get('/allowance', getAccountAllowance);
router.get('/payment/send', payInvoice);
router.get('/payment/receive', createInvoice);
Expand Down
21 changes: 19 additions & 2 deletions backend/sensei/nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,30 @@ const payInvoice = async (invoice) => {
return await res.json();
}

<<<<<<< HEAD
const keysend = async (destPubkey, amtMsat) => {
const res = await apiCall('/v1/node/invoices/pay', 'POST', { dest_pubkey: destPubkey, amt_msat: amtMsat });
return await res.json();
=======
const keySend = async (destPubkey, amtMsat) => {
const res = await fetch(`${BASE_URL}/v1/node/keysend`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
credentials: 'include',
body: JSON.stringify({
dest_pubkey: destPubkey,
amt_msat: amtMsat
})
}
);
>>>>>>> e295aada2015b250764e2aa5e1db0e8d8a7f6d24
}


module.exports = {
module.exports = {
getUnusedAddress,
getBalance,
getChannels,
Expand All @@ -69,5 +86,5 @@ module.exports = {
stopNode,
createInvoice,
payInvoice,
keysend,
keySend,
}

0 comments on commit 0c35289

Please sign in to comment.