convertLegacyPublicKey function

String convertLegacyPublicKey(
  1. String s
)

If a key is in the legacy format (EOS prefix), then convert it to the new format (PUB_K1_). Leaves other formats untouched

Implementation

String convertLegacyPublicKey(String s) {
  if (s.substring(0, 3) == 'EOS') {
    return publicKeyToString(stringToPublicKey(s));
  }
  return s;
}