diff options
| author | Adam Soltys <[email protected]> | 2022-07-25 21:32:44 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-07-25 21:32:44 -0700 |
| commit | 482df6b7ac12636221a898513ef944205617167d (patch) | |
| tree | eb728a7326c998e9e8162f31906f72d326f30c49 /src/routes/invoice.js | |
| parent | 11c7b181e2af1359d031f66736f0e90eeb1fab08 (diff) | |
| download | coinos-ui-482df6b7ac12636221a898513ef944205617167d.tar.gz coinos-ui-482df6b7ac12636221a898513ef944205617167d.zip | |
invoice endpoint
Diffstat (limited to 'src/routes/invoice.js')
| -rw-r--r-- | src/routes/invoice.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/routes/invoice.js b/src/routes/invoice.js new file mode 100644 index 00000000..fa493fe1 --- /dev/null +++ b/src/routes/invoice.js @@ -0,0 +1,20 @@ +import got from 'got'; + +const username = 'bob', + network = 'lightning'; + +export async function GET({ params }) { + let text = await got + .post('http://localhost:3119/lightning/invoice', { + json: { amount: 100 } + }) + .text(); + + let body = await got + .post('http://localhost:3119/invoice', { + json: { invoice: { text, network }, user: { username } } + }) + .json(); + + return { body }; +} |
