aboutsummaryrefslogtreecommitdiffstats
path: root/routes/payments.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-10-12 00:39:45 -0700
committerAdam Soltys <[email protected]>2020-10-12 00:39:45 -0700
commita90d6cc97470696ade30f237b050b8b329858a17 (patch)
treed2b0144a6076d799aa779a731f61e7c9c864f6a7 /routes/payments.js
parentd7e5d530bd37f611beb1884c0587593fb9fb5880 (diff)
downloadcoinos-server-a90d6cc97470696ade30f237b050b8b329858a17.tar.gz
coinos-server-a90d6cc97470696ade30f237b050b8b329858a17.zip
javascript address generation
Diffstat (limited to 'routes/payments.js')
-rw-r--r--routes/payments.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/routes/payments.js b/routes/payments.js
index 11242667..cf9e1d00 100644
--- a/routes/payments.js
+++ b/routes/payments.js
@@ -113,6 +113,13 @@ ah(async () => {
app.post("/bitcoin/fee", auth, require("./bitcoin/fee"));
app.post("/bitcoin/send", auth, require("./bitcoin/send"));
require("./bitcoin/receive");
+
+ setTimeout(async () => {
+ const address = await bc.getNewAddress();
+ const { hdkeypath } = await bc.getAddressInfo(address);
+ const parts = hdkeypath.split('/');
+ app.set("bcAddressIndex", parts[parts.length - 1].slice(0, -1));
+ }, 50);
}
if (config.liquid) {
@@ -126,6 +133,13 @@ ah(async () => {
app.post("/liquid/fee", auth, require("./liquid/fee"));
app.post("/liquid/send", auth, require("./liquid/send"));
require("./liquid/receive");
+
+ setTimeout(async () => {
+ const address = await lq.getNewAddress();
+ const { hdkeypath } = await lq.getAddressInfo(address);
+ const parts = hdkeypath.split('/');
+ app.set("lqAddressIndex", parts[parts.length - 1].slice(0, -1));
+ }, 50);
}
app.get(