the reason for that is that the Purpose Map is a String: Int map and you’re trying to use the same values as keys here.
Unfortunately according to the specs (and stackoverflow) object keys are always a string.
This PR changes the values to Strings, updates the AccountTypeMap and moves both into a separate file so we can incude it in both files (paths.js and xpub.js).
you’re were parsing purpose back to a number here https://github.com/give-bitcoin/xpub-tool/blob/64a3365eff84df3bae6bacdeba031c86119a925b/src/lib/xpub.js#L58
the reason for that is that the Purpose Map is a
String: Int
map and you’re trying to use the same values as keys here. Unfortunately according to the specs (and stackoverflow) object keys are always a string.This PR changes the values to Strings, updates the
AccountTypeMap
and moves both into a separate file so we can incude it in both files (paths.js and xpub.js).