aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2021-12-17 11:58:07 -0800
committerAdam Soltys <[email protected]>2021-12-17 12:10:11 -0800
commit1513347249e7d9f689dd5dab8f16d118591eaa6a (patch)
treec9d88f2e367ee8914871510ece03b4e73bd89556 /routes
parent0faec2bde7c0581cbbb9eb243d8be50d69d81757 (diff)
downloadcoinos-server-1513347249e7d9f689dd5dab8f16d118591eaa6a.tar.gz
coinos-server-1513347249e7d9f689dd5dab8f16d118591eaa6a.zip
upgrade bitcoinjs
Diffstat (limited to 'routes')
-rw-r--r--routes/liquid/taxi.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/routes/liquid/taxi.js b/routes/liquid/taxi.js
index c18ea72f..13429eb8 100644
--- a/routes/liquid/taxi.js
+++ b/routes/liquid/taxi.js
@@ -1,19 +1,26 @@
const {
address: Address,
- ECPair,
Psbt,
payments,
networks
} = require("liquidjs-lib");
+
+const { ECPairFactory} = require('ecpair');
+const tinysecp = require('tiny-secp256k1');
+
const wretch = require("wretch");
const fetch = require("node-fetch");
+
wretch().polyfills({ fetch });
+
const url = prod
? "https://blockstream.info/liquid/api"
: "http://electrs-liquid:3002";
+
const electrs = wretch().url(url);
const network = prod ? networks.liquid : networks.regtest;
+const ECPair = ECPairFactory(tinysecp);
const key = ECPair.fromPrivateKey(Buffer.from(config.taxi, "hex"));
module.exports = ah(async (req, res) => {