hexonaut / bitcoin-transaction

Send Bitcoins from one wallet to another. This is designed to be as simple to use as possible.
MIT License
50 stars 37 forks source link

Accept Santoshi amounts #3

Open lburgers opened 6 years ago

lburgers commented 6 years ago

Hi,

I really like your project it's the only one I've found that processes btc transactions from beginning to end. I was wondering if you would be willing to add an option to accept santoshi instead of btc?

I could also add it myself if you are open to PRs.

hexonaut commented 6 years ago

Hey, glad you like the project, and good idea for an addition. Definitely open to PRs or if you don't mind waiting I can add it myself when I get a moment.

I would advise to throw an exception when both btc and satoshi are supplied just to make absolutely sure the user knows what amount they want to send before committing a transaction.

Additionally you could add an option to the getBalance method to return the amount in satoshi instead of btc. Something like "satoshi": true in the options object.

Also be sure to update the README. :)