aboutsummaryrefslogtreecommitdiffstats
path: root/lib/buildtx.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/buildtx.js')
-rw-r--r--lib/buildtx.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/buildtx.js b/lib/buildtx.js
index 99fd6daa..970a17e3 100644
--- a/lib/buildtx.js
+++ b/lib/buildtx.js
@@ -1,14 +1,14 @@
-const axios = require("axios");
-const bitcoin = require("bitcoinjs-lib");
-const coinselect = require("coinselect");
-const split = require("coinselect/split");
+import axios from 'axios';
+import bitcoin from 'bitcoinjs-lib';
+import coinselect from 'coinselect';
+import split from 'coinselect/split';
const api = prod ? "https://blockstream.info/api" : "http://electrsb:3095";
const SATS = 100000000;
const network = prod
? bitcoin.networks["bitcoin"]
: bitcoin.networks["regtest"];
-module.exports = async ({ address, amount, feeRate, replaceable, user }) => {
+export default async ({ address, amount, feeRate, replaceable, user }) => {
if (!feeRate) feeRate = (await bc.estimateSmartFee(6)).feerate * SATS;
feeRate = Math.round(feeRate / 1000);