WalletServiceCLI
wavecli balanceBalance
Balance returns the unified balance across confirmed VTXOs and in-flight inbound and outbound amounts.
Endpoints
gRPC
rpc Balance(BalanceRequest) returns (BalanceResponse)REST
POST/v1/wallet/balanceExamples
wavecli balancewavecli balanceconn, err := grpc.NewClient("localhost:10029",
grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
log.Fatal(err)
}
defer conn.Close()
client := wavewalletrpc.NewWalletServiceClient(conn)
ctx := context.Background()
req := &wavewalletrpc.BalanceRequest{}
resp, err := client.Balance(ctx, req)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp)import grpc
import wallet_pb2
import wallet_pb2_grpc
channel = grpc.insecure_channel('localhost:10029')
stub = wallet_pb2_grpc.WalletServiceStub(channel)
request = wallet_pb2.BalanceRequest()
response = stub.Balance(request)
print(response)const grpc = require('@grpc/grpc-js');
const protoLoader = require('@grpc/proto-loader');
const packageDefinition = protoLoader.loadSync('wallet.proto');
const { wavewalletrpc } = grpc.loadPackageDefinition(packageDefinition);
const client = new wavewalletrpc.WalletService(
'localhost:10029',
grpc.credentials.createInsecure(),
);
const request = {};
// Calls wavewalletrpc.WalletService.Balance.
client.balance(request, (err, response) => {
if (err) throw err;
console.log(response);
});curl -X POST http://localhost:10031/v1/wallet/balance \
-H 'Content-Type: application/json' \
-d '{}'const res = await fetch('http://localhost:10031/v1/wallet/balance', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({}),
});
const balanceResponse = await res.json();RequestBalanceRequest
BalanceRequest is the empty request for WalletService.Balance.
This message has no fields.
ResponseBalanceResponse
BalanceResponse is the unified balance summary returned by WalletService.Balance across confirmed, in-flight, and credit amounts.
| Field | Type | Description |
|---|---|---|
confirmed_sat | int64 | confirmed_sat is the total spendable VTXO amount in satoshis. |
pending_in_sat | int64 | pending_in_sat is the total in-flight inbound amount (boarding plus receive operations). |
pending_out_sat | int64 | pending_out_sat is the total in-flight outbound amount (send plus exit operations). |
credit_available_sat | uint64 | credit_available_sat is the server-authoritative available credit balance for the wallet identity. |
credit_reserved_sat | uint64 | credit_reserved_sat is the server-authoritative in-flight credit reservation amount. |