There were cases where the currency and integer were incorrectly matched. By separating out the regex for hex formatted Amount makes it easier to deal with these cases and fixes the issue.
ISO 4217 states support for both alphabetic and numeric codes. rippled adheres to the ISO 4217 as stated in the Currency_Format on the wiki (https://ripple.com/wiki/Currency_Format) and there are trustlines out there with numeric currency codes.
The three-digit numeric code is useful when currency codes need to be understood in countries that do not use Latin scripts and for computerised systems. Where possible the 3 digit numeric code is the same as the numeric country code.
Amount#parse_quality is made currency-aware. This allows it to adjust for XRP as
the base currency, as well as for interest-bearing or demurring base currencies.
The UInt160 class used to be hardcoded to be an Account. This commit changes it
so it can be used as an account or a plain hash. It will try to automatically
self-classify based on how it is initialized.
In the future we may want to have some dedicated classes rather than a
single configurable UInt160.
- Add from_quality()
- Add parse_quality()
- Improve add.
- Better peformance for copyTo().
- Fix parse_issuer(), set_issuer(), & set_currency() not to modify sub
object.
- Correctly set currency and issuer of XRP in parse_json().
- Make not_equals_why more explicit.
- Separate classes in separate modules (files)
- Constants should be associated with a class
- Replace exports.config scheme with a config singleton
- Refactor base58 functions as a static class
- Parse negative amounts.
- Make Amount.negate() return a new value.
- Add Amount.equals().
- Rename Remote.trace() to set_trace().
- Fix request_ripple_balnce.
- Add more tests to send-test.js.
- Add more tests to amount-test.js.
- Add helper functions create_accounts and credit_limits to
testutils.js.