diff --git a/src/main/java/monero/wallet/MoneroWalletRpc.java b/src/main/java/monero/wallet/MoneroWalletRpc.java index 262fe10a..26f083f3 100644 --- a/src/main/java/monero/wallet/MoneroWalletRpc.java +++ b/src/main/java/monero/wallet/MoneroWalletRpc.java @@ -574,14 +574,24 @@ public String getPrivateViewKey() { } + @SuppressWarnings("unchecked") @Override public String getPublicViewKey() { - throw new MoneroError("MoneroWalletRpc.getPublicViewKey() not supported"); + Map params = new HashMap(); + params.put("key_type", "public_view_key"); + Map resp = rpc.sendJsonRequest("query_key", params); + Map result = (Map) resp.get("result"); + return (String) result.get("key"); } + @SuppressWarnings("unchecked") @Override public String getPublicSpendKey() { - throw new MoneroError("MoneroWalletRpc.getPublicSpendKey() not supported"); + Map params = new HashMap(); + params.put("key_type", "public_spend_key"); + Map resp = rpc.sendJsonRequest("query_key", params); + Map result = (Map) resp.get("result"); + return (String) result.get("key"); } @SuppressWarnings("unchecked")