Add support to schemes with amounts of 15+ digits
This PR provides additional support for URN schemes that need to support more than 15 digits, like Ethereum.
NACK. This library shouldn't bring in an bignum / bigint library as a dep. Ultimately it should just be a dumb parser and return a string for the number.
The reason I didn't suggest using a dumb parser and simply returning a string was to ensure the precision of the numbers returned for values greater than 15 digits. A bignum 7 bigint lib is a safe way to ensure the larger digit values stay precise, which could be necessary for other urn schemes.
returning a string was to ensure the precision of the numbers returned for values greater than 15 digits.
The input data is a string. The output number would be a string. No precision would be lost. This way the consumer of this library and my proposed change can use their favorite big number library and no precision would be lost.
Stated another way, my proposal is just to return options.amount in its string form.
@jprichardson - Got it now. Makes sense. Since it comes in as a string, you're right, and a bignum lib isn't necessary. I removed it from the PR, and only updated to return options.amount as the original parsed string.