bitcoinjs / bolt11

A library for encoding and decoding lightning network payment requests as defined in BOLT #11.
MIT License
92 stars 64 forks source link

millisatoshis is a string? #35

Closed nicolasburtey closed 4 years ago

nicolasburtey commented 4 years ago

satoshis is returned as a number millisatoshis as a string

Is that intended? Because of javascript issue with big numbers?

junderw commented 4 years ago

Yes.

Other libraries tend to use their favorite big number library as output, but that can cause problems with other apps where people who don't want to use OUR big number library do things like new TheirBigNumLib(millisats.toString(10), 10)

BigInt is finally supported in JavaScript, but everyone wants to support IE8 for all eternity, so any time a library uses anything modern they are yelled at.

This was a balance we struck.

If you have a better idea, we're open to discussing it / reviewing Pull Requests.

nicolasburtey commented 4 years ago

ok make sense. don't have a better idea but at least I understand what that is