admin swaps
This commit is contained in:
parent
a596e186fe
commit
d120ad7f99
22 changed files with 1258 additions and 226 deletions
|
|
@ -175,6 +175,27 @@ service LightningPub {
|
|||
option (nostr) = true;
|
||||
}
|
||||
|
||||
rpc GetAdminInvoiceSwapQuotes(structs.InvoiceSwapRequest) returns (structs.InvoiceSwapQuoteList) {
|
||||
option (auth_type) = "Admin";
|
||||
option (http_method) = "post";
|
||||
option (http_route) = "/api/admin/swap/invoice/quote";
|
||||
option (nostr) = true;
|
||||
}
|
||||
|
||||
rpc ListAdminInvoiceSwaps(structs.Empty) returns (structs.InvoiceSwapsList) {
|
||||
option (auth_type) = "Admin";
|
||||
option (http_method) = "post";
|
||||
option (http_route) = "/api/admin/swap/invoice/list";
|
||||
option (nostr) = true;
|
||||
}
|
||||
|
||||
rpc PayAdminInvoiceSwap(structs.PayAdminInvoiceSwapRequest) returns (structs.AdminInvoiceSwapResponse) {
|
||||
option (auth_type) = "Admin";
|
||||
option (http_method) = "post";
|
||||
option (http_route) = "/api/admin/swap/invoice/pay";
|
||||
option (nostr) = true;
|
||||
}
|
||||
|
||||
rpc GetAdminTransactionSwapQuotes(structs.TransactionSwapRequest) returns (structs.TransactionSwapQuoteList) {
|
||||
option (auth_type) = "Admin";
|
||||
option (http_method) = "post";
|
||||
|
|
@ -182,17 +203,17 @@ service LightningPub {
|
|||
option (nostr) = true;
|
||||
}
|
||||
|
||||
rpc PayAdminTransactionSwap(structs.PayAdminTransactionSwapRequest) returns (structs.AdminSwapResponse) {
|
||||
rpc PayAdminTransactionSwap(structs.PayAdminTransactionSwapRequest) returns (structs.AdminTxSwapResponse) {
|
||||
option (auth_type) = "Admin";
|
||||
option (http_method) = "post";
|
||||
option (http_route) = "/api/admin/swap/transaction/pay";
|
||||
option (nostr) = true;
|
||||
}
|
||||
|
||||
rpc ListAdminSwaps(structs.Empty) returns (structs.SwapsList) {
|
||||
rpc ListAdminTxSwaps(structs.Empty) returns (structs.TxSwapsList) {
|
||||
option (auth_type) = "Admin";
|
||||
option (http_method) = "post";
|
||||
option (http_route) = "/api/admin/swap/list";
|
||||
option (http_route) = "/api/admin/swap/transaction/list";
|
||||
option (nostr) = true;
|
||||
}
|
||||
|
||||
|
|
@ -520,14 +541,14 @@ service LightningPub {
|
|||
rpc GetTransactionSwapQuotes(structs.TransactionSwapRequest) returns (structs.TransactionSwapQuoteList){
|
||||
option (auth_type) = "User";
|
||||
option (http_method) = "post";
|
||||
option (http_route) = "/api/user/swap/quote";
|
||||
option (http_route) = "/api/user/swap/transaction/quote";
|
||||
option (nostr) = true;
|
||||
}
|
||||
|
||||
rpc ListSwaps(structs.Empty) returns (structs.SwapsList){
|
||||
rpc ListTxSwaps(structs.Empty) returns (structs.TxSwapsList){
|
||||
option (auth_type) = "User";
|
||||
option (http_method) = "post";
|
||||
option (http_route) = "/api/user/swap/list";
|
||||
option (http_route) = "/api/user/swap/transaction/list";
|
||||
option (nostr) = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -833,6 +833,49 @@ message MessagingToken {
|
|||
string firebase_messaging_token = 2;
|
||||
}
|
||||
|
||||
message InvoiceSwapRequest {
|
||||
string invoice = 1;
|
||||
}
|
||||
|
||||
message InvoiceSwapQuote {
|
||||
string swap_operation_id = 1;
|
||||
string invoice = 2;
|
||||
int64 invoice_amount_sats = 3;
|
||||
string address = 4;
|
||||
int64 transaction_amount_sats = 5;
|
||||
int64 chain_fee_sats = 6;
|
||||
int64 service_fee_sats = 7;
|
||||
string service_url = 8;
|
||||
int64 swap_fee_sats = 9;
|
||||
string tx_id = 10;
|
||||
}
|
||||
|
||||
message InvoiceSwapQuoteList {
|
||||
repeated InvoiceSwapQuote quotes = 1;
|
||||
}
|
||||
|
||||
message InvoiceSwapOperation {
|
||||
string swap_operation_id = 1;
|
||||
optional UserOperation operation_payment = 2;
|
||||
optional string failure_reason = 3;
|
||||
string invoice_paid = 4;
|
||||
string tx_id = 5;
|
||||
}
|
||||
|
||||
message InvoiceSwapsList {
|
||||
repeated InvoiceSwapOperation swaps = 1;
|
||||
repeated InvoiceSwapQuote quotes = 2;
|
||||
}
|
||||
|
||||
message PayAdminInvoiceSwapRequest {
|
||||
string swap_operation_id = 1;
|
||||
int64 sat_per_v_byte = 2;
|
||||
}
|
||||
|
||||
message AdminInvoiceSwapResponse {
|
||||
string tx_id = 1;
|
||||
}
|
||||
|
||||
message TransactionSwapRequest {
|
||||
int64 transaction_amount_sats = 2;
|
||||
}
|
||||
|
|
@ -857,20 +900,20 @@ message TransactionSwapQuoteList {
|
|||
repeated TransactionSwapQuote quotes = 1;
|
||||
}
|
||||
|
||||
message AdminSwapResponse {
|
||||
message AdminTxSwapResponse {
|
||||
string tx_id = 1;
|
||||
int64 network_fee = 2;
|
||||
}
|
||||
|
||||
message SwapOperation {
|
||||
message TxSwapOperation {
|
||||
string swap_operation_id = 1;
|
||||
optional UserOperation operation_payment = 2;
|
||||
optional string failure_reason = 3;
|
||||
string address_paid = 4;
|
||||
}
|
||||
|
||||
message SwapsList {
|
||||
repeated SwapOperation swaps = 1;
|
||||
message TxSwapsList {
|
||||
repeated TxSwapOperation swaps = 1;
|
||||
repeated TransactionSwapQuote quotes = 2;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue