Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.
Sign up to join this communityAnybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
I installed a BCOIN full node and I would like to calculate estimated fees for Bitcoin transactions. This functionality works perfectly in the CLI. For example:
bcoin-cli fee 3
Anyway things go wrong when I use the JS api inside my express client app:
const result = await client.estimateFee(3);
The API doesn't throw any error and no response is given back. This was copied from the official API documentation.
Please note that client and options are properly configured. It works all fine in other express routes where I use the bcoin JS API to get blockchain info, lists of transactions etc.
What's wrong? Perhaps the API changed and documentation is outdated ?
Regards
Evebtually I decide to do it the curl way.
By having my express app to make a simple GET http request to the bitcoin node, I managed to get the job done. Doing this with the request npm module is súper simple.
It doesn't solve the issue with the JS api, but allows me to properly leverage on the éstimate fee feature of Bcoin.
You can get bonuses upto $100 FREE BONUS when you:
💰 Install these recommended apps:
💲 SocialGood - 100% Crypto Back on Everyday Shopping
💲 xPortal - The DeFi For The Next Billion
💲 CryptoTab Browser - Lightweight, fast, and ready to mine!
💰 Register on these recommended exchanges:
🟡 Binance🟡 Bitfinex🟡 Bitmart🟡 Bittrex🟡 Bitget
🟡 CoinEx🟡 Crypto.com🟡 Gate.io🟡 Huobi🟡 Kucoin.
Comments