This commit is contained in:
hatim boufnichel 2022-11-21 23:12:38 +01:00
parent 96b619c886
commit 4fd8c0d71d
31 changed files with 2734 additions and 2004 deletions

View file

@ -89,7 +89,19 @@ service LightningPub {
option (http_method) = "post";
option (http_route) = "/api/user/auth";
}
// USER
rpc GetUserInfo(structs.Empty)returns(structs.UserInfo){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/info";
option (nostr) = true;
}
// USER
rpc GetUserOperations(structs.GetUserOperationsRequest) returns (structs.GetUserOperationsResponse) {
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/operations";
option (nostr) = true;
}
rpc NewAddress(structs.NewAddressRequest) returns (structs.NewAddressResponse) {
option (auth_type) = "User";
option (http_method) = "post";

View file

@ -115,3 +115,36 @@ message AuthUserResponse{
string userId = 1;
string authToken = 2;
}
message UserInfo{
string userId = 1;
int64 balance = 2;
}
message GetUserOperationsRequest{
int64 latestIncomingInvoice = 1;
int64 latestOutgoingInvoice = 2;
int64 latestIncomingTx = 3;
int64 latestOutgoingTx = 4;
}
enum UserOperationType {
INCOMING_TX =0;
OUTGOING_TX =1;
INCOMING_INVOICE =2;
OUTGOING_INVOICE=3;
}
message UserOperation{
int64 paidAtUnix=1;
UserOperationType type = 2;
bool inbound =3;
int64 amount = 4;
}
message UserOperations {
int64 fromIndex=1;
int64 toIndex=2;
repeated UserOperation operations=3;
}
message GetUserOperationsResponse{
UserOperations latestOutgoingInvoiceOperations=1;
UserOperations latestIncomingInvoiceOperations=2;
UserOperations latestOutgoingTxOperations=3;
UserOperations latestIncomingTxOperations=4;
}