diff options
| author | Adam Soltys <[email protected]> | 2022-09-02 11:02:06 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-09-02 11:02:06 -0700 |
| commit | 7a8d64833de8873afb92982b3f5bfff59b30c542 (patch) | |
| tree | bc92e20c7d5127d3b6b17f7b8d3190e08579f49e /lib/buildtx.js | |
| parent | b06e117af96a38b163384f6a343f1de7c8996724 (diff) | |
| download | coinos-server-7a8d64833de8873afb92982b3f5bfff59b30c542.tar.gz coinos-server-7a8d64833de8873afb92982b3f5bfff59b30c542.zip | |
es6 migration
Diffstat (limited to 'lib/buildtx.js')
| -rw-r--r-- | lib/buildtx.js | 10 |
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); |
