Skip to content

rfq: fleshing out the wallet RPCs #9

Closed
@torkelrogstad

Description

@torkelrogstad

For the new L1 GUI we need certain functionality exposed as gRPC endpoints. This is a proposal for those RPCs. More is needed, but this is a start.

  // Fetches balance for the L1 wallet
  rpc GetBalance(google.protobuf.Empty) returns (GetBalanceResponse);
  
  // Lists all transactions for the L1 wallet, analogous to the `listtransactions`
  // RPC in Bitcoin Core
   rpc ListTransactions(ListTransactionsRequest) returns (ListTransactionsResponse);

message GetBalanceResponse {
  uint64 confirmed_satoshi = 1;

  uint64 pending_satoshi = 2;
}

// Eventually this should probably include support for filtering/pagination for large wallets. 
// Not something we need to deal with right now. 
message ListTransactionsRequest {
}

message ListTransactionsResponse {
  repeated Transaction transactions = 1;
}

message Confirmation {
  uint32 block_height = 1;
  google.protobuf.Timestamp timestamp = 2;
}

message Transaction {
  // Aren't TXIDs displayed in reverse? Saw we already had usage of `ConensusHex` for TXIDs...
  ConsensusHex txid = 1;
  uint32 vout = 2;

  uint64 fee_satoshi = 3;
  // Negative if sending /from/ the wallet, positive if receiving /to/ the wallet
  int64 satoshi  = 4;
  
  // Address sending/receiving to.
  string address = 5;

  Confirmation confirmation_time = 6;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions