writePublicKey static method
Implementation
static String writePublicKey(String publicKey) {
if (publicKey.startsWith("edpk")) {
return "00" + hex.encode(bs58check.decode(publicKey).sublist(4));
} else if (publicKey.startsWith("sppk")) {
return "01" + hex.encode(bs58check.decode(publicKey).sublist(4));
} else if (publicKey.startsWith("p2pk")) {
return "02" + hex.encode(bs58check.decode(publicKey).sublist(4));
} else {
throw new Exception('Unrecognized key type');
}
}