ChrisCho-H / bitcoin-sdk-js

Bitcoin TypeScript/JavaScript Library for NodeJS, Browser and Mobile. Segwit & Taproot support.✨
MIT License
32 stars 4 forks source link

Issue broadcasting transaction #1

Closed george-hub331 closed 4 months ago

george-hub331 commented 4 months ago

Hello good day,

I was able to setup everything with the package and so far its working well, but then when i try to broadcast a transaction on blockstream testnet, i get this {"code":-26,"message":"mempool min fee not met, 2 < 1953"}.

Was wondering if there was a way i could dictate the fee in the transaction using the sdk?

Thank you.

ChrisCho-H commented 4 months ago

Hi, thanks for opening an issue!

The fee is determined as sum of total input value - sum of total ouput value.

Error message from testnet means your fee is 2 satoshi, but network requires at least 1953 satoshi.

It would be solved if you just deduct fee from one of output value. It would be more helpful if you share the code :)

george-hub331 commented 4 months ago

ohh, after close inspection, i noticed i was multiplying my fee estimation by 100,000 instead of 100,000,000

Thanks so much, it works now