support getXmrSeed()

This commit is contained in:
woodser 2022-05-10 14:58:47 -04:00
parent 0e30603d15
commit f4120b869d
4 changed files with 33 additions and 0 deletions

View file

@ -268,6 +268,10 @@ public class CoreApi {
public BalancesInfo getBalances(String currencyCode) {
return walletsService.getBalances(currencyCode);
}
public String getXmrSeed() {
return walletsService.getXmrSeed();
}
public String getNewDepositAddress() {
return walletsService.getNewDepositAddress();

View file

@ -160,6 +160,10 @@ class CoreWalletsService {
return new BalancesInfo(getBtcBalances(), getXmrBalances());
}
}
String getXmrSeed() {
return xmrWalletService.getWallet().getMnemonic();
}
String getNewDepositAddress() {
accountService.checkAccountOpen();

View file

@ -40,6 +40,8 @@ import bisq.proto.grpc.GetTransactionReply;
import bisq.proto.grpc.GetTransactionRequest;
import bisq.proto.grpc.GetTxFeeRateReply;
import bisq.proto.grpc.GetTxFeeRateRequest;
import bisq.proto.grpc.GetXmrSeedReply;
import bisq.proto.grpc.GetXmrSeedRequest;
import bisq.proto.grpc.LockWalletReply;
import bisq.proto.grpc.LockWalletRequest;
import bisq.proto.grpc.RemoveWalletPasswordReply;
@ -117,6 +119,20 @@ class GrpcWalletsService extends WalletsImplBase {
});
}
@Override
public void getXmrSeed(GetXmrSeedRequest req,
StreamObserver<GetXmrSeedReply> responseObserver) {
try {
var reply = GetXmrSeedReply.newBuilder()
.setSeed(coreApi.getXmrSeed())
.build();
responseObserver.onNext(reply);
responseObserver.onCompleted();
} catch (Throwable cause) {
exceptionHandler.handleException(log, cause, responseObserver);
}
}
@Override
public void getNewDepositAddress(GetNewDepositAddressRequest req,
StreamObserver<GetNewDepositAddressReply> responseObserver) {

View file

@ -856,6 +856,8 @@ message TxInfo {
service Wallets {
rpc GetBalances (GetBalancesRequest) returns (GetBalancesReply) {
}
rpc GetXmrSeed (GetXmrSeedRequest) returns (GetXmrSeedReply) {
}
rpc GetNewDepositAddress (GetNewDepositAddressRequest) returns (GetNewDepositAddressReply) {
}
rpc GetXmrTxs (GetXmrTxsRequest) returns (GetXmrTxsReply) {
@ -896,6 +898,13 @@ message GetBalancesReply {
BalancesInfo balances = 1;
}
message GetXmrSeedRequest {
}
message GetXmrSeedReply {
string seed = 1;
}
message GetNewDepositAddressRequest {
}