Skip to content

Commit

Permalink
Define new grpc bsq/btc balances protos
Browse files Browse the repository at this point in the history
This change adds proto serivces and messages to support new api
implementations for serving bsq, btc or all wallet balances.

- RPC GetBsqBalances will return complete BSQ balance info.
- Message BsqBalanceInfo is proto returned by rpc GetBsqBalances.

- RPC GetBtcBalances wil return complete BTC balance info.
- Message BtcBalanceInfo is proto returned by rpc GetBtcBalances.

- RPC GetBalances returns complete BTC and BSQ balance info.
- Message BalancesInfo is proto returned by rpc GetBalances.

RPC GetBalance remains unchnaged, still returns only the available
BTC balance.  It may be deprecated and removed in a future PR.
  • Loading branch information
ghubstan committed Nov 13, 2020
1 parent 61c8d55 commit fc8af8c
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions proto/src/main/proto/grpc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,12 @@ message TradeInfo {
service Wallets {
rpc GetBalance (GetBalanceRequest) returns (GetBalanceReply) {
}
rpc GetBalances (GetBalancesRequest) returns (GetBalancesReply) {
}
rpc GetBsqBalances (GetBsqBalancesRequest) returns (GetBsqBalancesReply) {
}
rpc GetBtcBalances (GetBtcBalancesRequest) returns (GetBtcBalancesReply) {
}
rpc GetAddressBalance (GetAddressBalanceRequest) returns (GetAddressBalanceReply) {
}
rpc GetFundingAddresses (GetFundingAddressesRequest) returns (GetFundingAddressesReply) {
Expand All @@ -296,6 +302,27 @@ message GetBalanceReply {
uint64 balance = 1;
}

message GetBalancesRequest {
}

message GetBalancesReply {
BalancesInfo balances = 1;
}

message GetBsqBalancesRequest {
}

message GetBsqBalancesReply {
BsqBalanceInfo bsqBalanceInfo = 1;
}

message GetBtcBalancesRequest {
}

message GetBtcBalancesReply {
BtcBalanceInfo btcBalanceInfo = 1;
}

message GetAddressBalanceRequest {
string address = 1;
}
Expand Down Expand Up @@ -340,6 +367,27 @@ message UnlockWalletRequest {
message UnlockWalletReply {
}

message BalancesInfo {
BsqBalanceInfo bsqBalanceInfo = 1;
BtcBalanceInfo btcBalanceInfo = 2;
}

message BsqBalanceInfo {
uint64 availableConfirmedBalance = 1;
uint64 unverifiedBalance = 2;
uint64 unconfirmedChangeBalance = 3;
uint64 lockedForVotingBalance = 4;
uint64 lockupBondsBalance = 5;
uint64 unlockingBondsBalance = 6;
}

message BtcBalanceInfo {
uint64 availableBalance = 1;
uint64 reservedBalance = 2;
uint64 totalAvailableBalance = 3;
uint64 lockedBalance = 4;
}

message AddressBalanceInfo {
string address = 1;
int64 balance = 2;
Expand Down

0 comments on commit fc8af8c

Please sign in to comment.