custom ofers

This commit is contained in:
boufni95 2024-12-04 20:27:06 +00:00
parent a945038b16
commit 1f5c3041bd
22 changed files with 1254 additions and 78 deletions

View file

@ -467,6 +467,42 @@ service LightningPub {
option (http_route) = "/api/user/lnurl_channel/url";
option (nostr) = true;
}
rpc GetUserOffers(structs.Empty) returns (structs.UserOffers){
option (auth_type) = "User";
option (http_method) = "get";
option (http_route) = "/api/user/offers/get";
option (nostr) = true;
}
rpc GetUserOffer(structs.OfferId) returns (structs.OfferConfig){
option (auth_type) = "User";
option (http_method) = "get";
option (http_route) = "/api/user/offer/get";
option (nostr) = true;
}
rpc UpdateUserOffer(structs.OfferConfig) returns (structs.Empty){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/offer/update";
option (nostr) = true;
}
rpc DeleteUserOffer(structs.OfferId) returns (structs.Empty){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/offer/delete";
option (nostr) = true;
}
rpc AddUserOffer(structs.OfferConfig) returns (structs.OfferId){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/offer/add";
option (nostr) = true;
}
rpc GetDebitAuthorizations(structs.Empty) returns (structs.DebitAuthorizations){
option (auth_type) = "User";
option (http_method) = "get";

View file

@ -269,6 +269,8 @@ message AddAppUserInvoiceRequest {
string payer_identifier = 2;
string http_callback_url = 3;
NewInvoiceRequest invoice_req = 4;
optional PayerData payer_data = 5;
optional string offer_string = 6;
}
message GetAppUserRequest {
@ -331,6 +333,10 @@ message PayAddressResponse{
int64 network_fee = 4;
}
message PayerData {
map<string,string> data = 1;
}
message NewInvoiceRequest{
int64 amountSats = 1;
string memo = 2;
@ -613,4 +619,25 @@ message DebitResponse {
Empty denied = 3;
string invoice = 4;
}
}
enum OfferDataType {
DATA_STRING = 0;
}
message OfferId {
string offer_id = 1;
}
message OfferConfig {
string offer_id = 1;
string label = 2;
int64 price_sats = 3;
string callback_url = 4;
map<string, OfferDataType> expected_data = 5;
string noffer = 6;
}
message UserOffers {
repeated OfferConfig offers = 1;
}