From 8a080ef9a198799e7ee31cf81f92afd5495e4074 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 6 Sep 2022 09:18:19 -0700 Subject: missing imports --- routes/bitcoin/broadcast.js | 1 + routes/bitcoin/fee.js | 1 + routes/bitcoin/receive.js | 7 +++++-- routes/bitcoin/send.js | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) (limited to 'routes/bitcoin') diff --git a/routes/bitcoin/broadcast.js b/routes/bitcoin/broadcast.js index ec733101..e4c7ba62 100644 --- a/routes/bitcoin/broadcast.js +++ b/routes/bitcoin/broadcast.js @@ -1,3 +1,4 @@ +import { emit } from "$lib/sockets"; import store from "$lib/store"; export default async (req, res) => { try { diff --git a/routes/bitcoin/fee.js b/routes/bitcoin/fee.js index a47ac05e..af622ca5 100644 --- a/routes/bitcoin/fee.js +++ b/routes/bitcoin/fee.js @@ -1,3 +1,4 @@ +import { emit } from "$lib/sockets"; import buildTx from "$lib/buildtx"; export default async (req, res) => { diff --git a/routes/bitcoin/receive.js b/routes/bitcoin/receive.js index de98170c..15e21121 100644 --- a/routes/bitcoin/receive.js +++ b/routes/bitcoin/receive.js @@ -1,4 +1,6 @@ -import { rates } from "$lib/store"; +import config from "$config"; +import { emit } from "$lib/sockets"; +import store from "$lib/store"; import { notify } from "$lib/notifications"; import { callWebhook } from "$lib/webhooks"; import reverse from 'buffer-reverse'; @@ -7,6 +9,7 @@ import { Op } from '@sequelize/core'; import { fromBase58 } from 'bip32'; import bitcoin from 'bitcoinjs-lib'; import { sendLiquid } from "$routes/liquid/send"; +import { computeConversionFee } from './conversionFee'; const zmqRawBlock = zmq.socket("sub"); zmqRawBlock.connect(config.bitcoin.zmqrawblock); @@ -24,9 +27,9 @@ const network = const queue = {}; const seen = []; -import { computeConversionFee } from './conversionFee'; zmqRawTx.on("message", async (topic, message, sequence) => { + console.log("TX", message) const hex = message.toString("hex"); let tx = bitcoin.Transaction.fromHex(message); diff --git a/routes/bitcoin/send.js b/routes/bitcoin/send.js index 1992bbde..51d702fd 100644 --- a/routes/bitcoin/send.js +++ b/routes/bitcoin/send.js @@ -1,3 +1,4 @@ +import { toSats } from "$lib/utils"; import store from "$lib/store"; import config from "$config"; const btc = config.liquid.btcasset; -- cgit v1.2.3