diff options
| author | Adam Soltys <[email protected]> | 2020-06-03 15:19:16 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-06-03 15:19:16 -0700 |
| commit | 3e93f327881d7793cffa324c3aee27600fffa9e3 (patch) | |
| tree | 05e8d45ef0521e206f95722e6241833395cc7566 | |
| parent | 0481598ebc1e01c44b5cf198a07685d4f29682d7 (diff) | |
| download | coinos-server-3e93f327881d7793cffa324c3aee27600fffa9e3.tar.gz coinos-server-3e93f327881d7793cffa324c3aee27600fffa9e3.zip | |
generate endpoints
| -rw-r--r-- | routes/bitcoin/generate.js | 5 | ||||
| -rw-r--r-- | routes/liquid/generate.js | 5 | ||||
| -rw-r--r-- | routes/payments.js | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/routes/bitcoin/generate.js b/routes/bitcoin/generate.js new file mode 100644 index 00000000..8017c8f0 --- /dev/null +++ b/routes/bitcoin/generate.js @@ -0,0 +1,5 @@ +module.exports = async (req, res) => { + let address = await bc.getNewAddress(); + await bc.generateToAddress(1, address); + res.end(); +} diff --git a/routes/liquid/generate.js b/routes/liquid/generate.js new file mode 100644 index 00000000..4e443d75 --- /dev/null +++ b/routes/liquid/generate.js @@ -0,0 +1,5 @@ +module.exports = async (req, res) => { + let address = await lq.getNewAddress(); + await lq.generateToAddress(1, address); + res.end(); +} diff --git a/routes/payments.js b/routes/payments.js index 9586a9a8..db40c73e 100644 --- a/routes/payments.js +++ b/routes/payments.js @@ -40,6 +40,7 @@ const { join } = require("path"); if (config.bitcoin) { bc = new BitcoinCore(config.bitcoin); + app.get("/bitcoin/generate", auth, require("./bitcoin/generate")); app.post("/bitcoin/sweep", auth, require("./bitcoin/sweep")); app.post("/bitcoin/fee", auth, require("./bitcoin/fee")); app.post("/bitcoin/send", auth, require("./bitcoin/send")); @@ -48,6 +49,7 @@ const { join } = require("path"); if (config.liquid) { lq = new BitcoinCore(config.liquid); + app.get("/liquid/generate", auth, require("./liquid/generate")); app.post("/liquid/fee", auth, require("./liquid/fee")); app.post("/liquid/send", auth, require("./liquid/send")); require("./liquid/receive"); |
