From 7a8d64833de8873afb92982b3f5bfff59b30c542 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 2 Sep 2022 11:02:06 -0700 Subject: es6 migration --- lib/buildtx.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/buildtx.js') 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); -- cgit v1.2.3