fix ui responsive ness

This commit is contained in:
polarDefender 2024-05-28 19:57:20 +09:00
parent 6e4a01cc51
commit 90058deb1a
126 changed files with 63419 additions and 63416 deletions

View file

@ -1,386 +1,386 @@
syntax = "proto3";
package methods;
import "google/protobuf/descriptor.proto";
import "structs.proto";
option go_package = "github.com/shocknet/lightning.pub";
option (file_options) = {
supported_http_methods:["post", "get"];
supported_auths:[
{
id: "guest"
name: "Guest"
context:[]
},
{
id: "user"
name: "User",
context:[{
key:"user_id",
value:"string"
},{
key:"app_id",
value:"string"
},{
key:"app_user_id",
value:"string"
}]
},
{
id: "admin",
name: "Admin",
//encrypted:true,
context:{
key:"admin_id",
value:"string"
}
},
{
id: "metrics",
name: "Metrics",
//encrypted:true,
context:{
key:"operator_id",
value:"string"
}
},
{
id:"app",
name:"App",
context:{
key:"app_id",
value: "string"
}
}
];
};
message MethodQueryOptions {
repeated string items = 1;
}
extend google.protobuf.MethodOptions { // TODO: move this stuff to dep repo?
string auth_type = 50003;
string http_method = 50004;
string http_route = 50005;
MethodQueryOptions query = 50006;
bool nostr = 50007;
bool batch = 50008;
}
message ProtoFileOptions {
message SupportedAuth {
string id = 1;
string name = 2;
bool encrypted = 3;
map<string,string> context = 4;
}
repeated SupportedAuth supported_auths = 1;
repeated string supported_http_methods = 2;
}
extend google.protobuf.FileOptions {
ProtoFileOptions file_options = 50004;
}
service LightningPub {
// <Admin>
rpc LndGetInfo(structs.LndGetInfoRequest) returns (structs.LndGetInfoResponse){
option (auth_type) = "Admin";
option (http_method) = "post";
option (http_route) = "/api/admin/lnd/getinfo";
};
rpc AddApp(structs.AddAppRequest) returns (structs.AuthApp) {
option (auth_type) = "Admin";
option (http_method) = "post";
option (http_route) = "/api/admin/app/add";
};
rpc AuthApp(structs.AuthAppRequest) returns (structs.AuthApp) {
option (auth_type) = "Admin";
option (http_method) = "post";
option (http_route) = "/api/admin/app/auth";
}
rpc BanUser(structs.BanUserRequest) returns (structs.BanUserResponse) {
option (auth_type) = "Admin";
option (http_method) = "post";
option (http_route) = "/api/admin/user/ban";
}
rpc GetUsageMetrics(structs.Empty) returns (structs.UsageMetrics) {
option (auth_type) = "Metrics";
option (http_method) = "post";
option (http_route) = "/api/reports/usage";
}
rpc GetAppsMetrics(structs.AppsMetricsRequest) returns (structs.AppsMetrics) {
option (auth_type) = "Metrics";
option (http_method) = "post";
option (http_route) = "/api/reports/apps";
}
rpc GetLndMetrics(structs.LndMetricsRequest) returns (structs.LndMetrics) {
option (auth_type) = "Metrics";
option (http_method) = "post";
option (http_route) = "/api/reports/lnd";
}
// </Admin>
// <Guest>
rpc Health(structs.Empty) returns (structs.Empty){
option (auth_type) = "Guest";
option (http_method) = "get";
option (http_route) = "/api/health";
};
rpc EncryptionExchange(structs.EncryptionExchangeRequest) returns (structs.Empty){
option (auth_type) = "Guest";
option (http_method) = "post";
option (http_route) = "/api/encryption/exchange";
};
rpc SetMockInvoiceAsPaid(structs.SetMockInvoiceAsPaidRequest) returns (structs.Empty) {
option (auth_type) = "Guest";
option (http_method) = "post";
option (http_route) = "/api/lnd/mock/invoice/paid";
}
rpc GetLnurlWithdrawInfo(structs.Empty) returns (structs.LnurlWithdrawInfoResponse){
option (auth_type) = "Guest";
option (http_method) = "get";
option (http_route) = "/api/guest/lnurl_withdraw/info";
option (query) = {items: ["k1"]};
}
rpc HandleLnurlWithdraw(structs.Empty) returns (structs.Empty){
option (auth_type) = "Guest";
option (http_method) = "get";
option (http_route) = "/api/guest/lnurl_withdraw/handle";
option (query) = {items: ["k1", "pr"]};
}
rpc GetLnurlPayInfo(structs.Empty)returns (structs.LnurlPayInfoResponse) {
option (auth_type) = "Guest";
option (http_method) = "get";
option (http_route) = "/api/guest/lnurl_pay/info";
option (query) = {items: ["k1"]};
}
rpc HandleLnurlPay(structs.Empty)returns (structs.HandleLnurlPayResponse) {
option (auth_type) = "Guest";
option (http_method) = "get";
option (http_route) = "/api/guest/lnurl_pay/handle";
option (query) = {items: ["k1", "amount", "nostr", "lnurl"]};
}
rpc HandleLnurlAddress(structs.Empty)returns (structs.LnurlPayInfoResponse) {
option (auth_type) = "Guest";
option (http_method) = "get";
option (http_route) = "/.well-known/lnurlp/:address_name";
}
rpc LinkNPubThroughToken(structs.LinkNPubThroughTokenRequest) returns (structs.Empty) {
option (auth_type) = "User";
option(http_method) = "post";
option (http_route) = "/api/guest/npub/link";
option (nostr) = true;
}
//</Guest>
// <App>
rpc GetApp(structs.Empty) returns (structs.Application) {
option (auth_type) = "App";
option (http_method) = "post";
option (http_route) = "/api/app/get";
}
rpc AddAppUser(structs.AddAppUserRequest)returns (structs.AppUser) {
option (auth_type) = "App";
option (http_method) = "post";
option (http_route) = "/api/app/user/add";
};
rpc AddAppInvoice(structs.AddAppInvoiceRequest) returns (structs.NewInvoiceResponse) {
option (auth_type) = "App";
option (http_method) = "post";
option (http_route) = "/api/app/add/invoice";
}
rpc AddAppUserInvoice(structs.AddAppUserInvoiceRequest) returns (structs.NewInvoiceResponse) {
option (auth_type) = "App";
option (http_method) = "post";
option (http_route) = "/api/app/user/add/invoice";
}
rpc GetAppUser(structs.GetAppUserRequest) returns (structs.AppUser) {
option (auth_type) = "App";
option (http_method) = "post";
option (http_route) = "/api/app/user/get";
}
rpc PayAppUserInvoice(structs.PayAppUserInvoiceRequest) returns (structs.PayInvoiceResponse) {
option (auth_type) = "App";
option (http_method) = "post";
option (http_route) = "/api/app/invoice/pay";
}
rpc SendAppUserToAppUserPayment(structs.SendAppUserToAppUserPaymentRequest) returns (structs.Empty) {
option (auth_type) = "App";
option (http_method) = "post";
option (http_route) = "/api/app/user/internal/pay";
}
rpc SendAppUserToAppPayment(structs.SendAppUserToAppPaymentRequest) returns (structs.Empty) {
option (auth_type) = "App";
option (http_method) = "post";
option (http_route) = "/api/app/internal/pay";
}
rpc GetAppUserLNURLInfo(structs.GetAppUserLNURLInfoRequest) returns (structs.LnurlPayInfoResponse) {
option (auth_type) = "App";
option (http_method) = "post";
option (http_route) = "/api/app/user/lnurl/pay/info";
}
rpc SetMockAppUserBalance(structs.SetMockAppUserBalanceRequest) returns (structs.Empty) {
option (auth_type) = "App";
option (http_method) = "post";
option (http_route) = "/api/app/mock/user/blance/set";
}
rpc SetMockAppBalance(structs.SetMockAppBalanceRequest) returns (structs.Empty) {
option (auth_type) = "App";
option (http_method) = "post";
option (http_route) = "/api/app/mock/blance/set";
}
rpc RequestNPubLinkingToken(structs.RequestNPubLinkingTokenRequest) returns (structs.RequestNPubLinkingTokenResponse) {
option (auth_type) = "App";
option(http_method) = "post";
option (http_route) = "/api/app/user/npub/token";
}
// </App>
// <User>
rpc UserHealth(structs.Empty)returns(structs.Empty){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/health";
option (nostr) = true;
}
rpc GetUserInfo(structs.Empty)returns(structs.UserInfo){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/info";
option (nostr) = true;
}
rpc AddProduct(structs.AddProductRequest) returns (structs.Product){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/product/add";
option (nostr) = true;
};
rpc NewProductInvoice(structs.Empty) returns (structs.NewInvoiceResponse){
option (auth_type) = "User";
option (http_method) = "get";
option (http_route) = "/api/user/product/get/invoice";
option (query) = {items: ["id"]};
option (nostr) = true;
};
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";
option (http_route) = "/api/user/chain/new";
option (nostr) = true;
}
rpc PayAddress(structs.PayAddressRequest) returns (structs.PayAddressResponse){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/chain/pay";
option (nostr) = true;
}
rpc NewInvoice(structs.NewInvoiceRequest) returns (structs.NewInvoiceResponse){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/invoice/new";
option (nostr) = true;
}
rpc DecodeInvoice(structs.DecodeInvoiceRequest) returns (structs.DecodeInvoiceResponse){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/invoice/decode";
option (nostr) = true;
}
rpc PayInvoice(structs.PayInvoiceRequest) returns (structs.PayInvoiceResponse){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/invoice/pay";
option (nostr) = true;
}
rpc OpenChannel(structs.OpenChannelRequest) returns (structs.OpenChannelResponse){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/open/channel";
option (nostr) = true;
}
rpc GetLnurlWithdrawLink(structs.Empty) returns (structs.LnurlLinkResponse){
option (auth_type) = "User";
option (http_method) = "get";
option (http_route) = "/api/user/lnurl_withdraw/link";
option (nostr) = true;
}
rpc GetLnurlPayLink(structs.Empty) returns (structs.LnurlLinkResponse){
option (auth_type) = "User";
option (http_method) = "get";
option (http_route) = "/api/user/lnurl_pay/link";
option (nostr) = true;
}
rpc GetLNURLChannelLink(structs.Empty) returns (structs.LnurlLinkResponse){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/lnurl_channel/url";
option (nostr) = true;
}
rpc GetLiveUserOperations(structs.Empty) returns (stream structs.LiveUserOperation){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/operations/sub";
option (nostr) = true;
}
rpc GetMigrationUpdate(structs.Empty) returns (stream structs.MigrationUpdate){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/migrations/sub";
option (nostr) = true;
}
rpc GetHttpCreds(structs.Empty) returns (stream structs.HttpCreds){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/http_creds";
option (nostr) = true;
}
rpc BatchUser(structs.Empty) returns (structs.Empty){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/batch";
option (nostr) = true;
option (batch) = true;
}
// </User>
syntax = "proto3";
package methods;
import "google/protobuf/descriptor.proto";
import "structs.proto";
option go_package = "github.com/shocknet/lightning.pub";
option (file_options) = {
supported_http_methods:["post", "get"];
supported_auths:[
{
id: "guest"
name: "Guest"
context:[]
},
{
id: "user"
name: "User",
context:[{
key:"user_id",
value:"string"
},{
key:"app_id",
value:"string"
},{
key:"app_user_id",
value:"string"
}]
},
{
id: "admin",
name: "Admin",
//encrypted:true,
context:{
key:"admin_id",
value:"string"
}
},
{
id: "metrics",
name: "Metrics",
//encrypted:true,
context:{
key:"operator_id",
value:"string"
}
},
{
id:"app",
name:"App",
context:{
key:"app_id",
value: "string"
}
}
];
};
message MethodQueryOptions {
repeated string items = 1;
}
extend google.protobuf.MethodOptions { // TODO: move this stuff to dep repo?
string auth_type = 50003;
string http_method = 50004;
string http_route = 50005;
MethodQueryOptions query = 50006;
bool nostr = 50007;
bool batch = 50008;
}
message ProtoFileOptions {
message SupportedAuth {
string id = 1;
string name = 2;
bool encrypted = 3;
map<string,string> context = 4;
}
repeated SupportedAuth supported_auths = 1;
repeated string supported_http_methods = 2;
}
extend google.protobuf.FileOptions {
ProtoFileOptions file_options = 50004;
}
service LightningPub {
// <Admin>
rpc LndGetInfo(structs.LndGetInfoRequest) returns (structs.LndGetInfoResponse){
option (auth_type) = "Admin";
option (http_method) = "post";
option (http_route) = "/api/admin/lnd/getinfo";
};
rpc AddApp(structs.AddAppRequest) returns (structs.AuthApp) {
option (auth_type) = "Admin";
option (http_method) = "post";
option (http_route) = "/api/admin/app/add";
};
rpc AuthApp(structs.AuthAppRequest) returns (structs.AuthApp) {
option (auth_type) = "Admin";
option (http_method) = "post";
option (http_route) = "/api/admin/app/auth";
}
rpc BanUser(structs.BanUserRequest) returns (structs.BanUserResponse) {
option (auth_type) = "Admin";
option (http_method) = "post";
option (http_route) = "/api/admin/user/ban";
}
rpc GetUsageMetrics(structs.Empty) returns (structs.UsageMetrics) {
option (auth_type) = "Metrics";
option (http_method) = "post";
option (http_route) = "/api/reports/usage";
}
rpc GetAppsMetrics(structs.AppsMetricsRequest) returns (structs.AppsMetrics) {
option (auth_type) = "Metrics";
option (http_method) = "post";
option (http_route) = "/api/reports/apps";
}
rpc GetLndMetrics(structs.LndMetricsRequest) returns (structs.LndMetrics) {
option (auth_type) = "Metrics";
option (http_method) = "post";
option (http_route) = "/api/reports/lnd";
}
// </Admin>
// <Guest>
rpc Health(structs.Empty) returns (structs.Empty){
option (auth_type) = "Guest";
option (http_method) = "get";
option (http_route) = "/api/health";
};
rpc EncryptionExchange(structs.EncryptionExchangeRequest) returns (structs.Empty){
option (auth_type) = "Guest";
option (http_method) = "post";
option (http_route) = "/api/encryption/exchange";
};
rpc SetMockInvoiceAsPaid(structs.SetMockInvoiceAsPaidRequest) returns (structs.Empty) {
option (auth_type) = "Guest";
option (http_method) = "post";
option (http_route) = "/api/lnd/mock/invoice/paid";
}
rpc GetLnurlWithdrawInfo(structs.Empty) returns (structs.LnurlWithdrawInfoResponse){
option (auth_type) = "Guest";
option (http_method) = "get";
option (http_route) = "/api/guest/lnurl_withdraw/info";
option (query) = {items: ["k1"]};
}
rpc HandleLnurlWithdraw(structs.Empty) returns (structs.Empty){
option (auth_type) = "Guest";
option (http_method) = "get";
option (http_route) = "/api/guest/lnurl_withdraw/handle";
option (query) = {items: ["k1", "pr"]};
}
rpc GetLnurlPayInfo(structs.Empty)returns (structs.LnurlPayInfoResponse) {
option (auth_type) = "Guest";
option (http_method) = "get";
option (http_route) = "/api/guest/lnurl_pay/info";
option (query) = {items: ["k1"]};
}
rpc HandleLnurlPay(structs.Empty)returns (structs.HandleLnurlPayResponse) {
option (auth_type) = "Guest";
option (http_method) = "get";
option (http_route) = "/api/guest/lnurl_pay/handle";
option (query) = {items: ["k1", "amount", "nostr", "lnurl"]};
}
rpc HandleLnurlAddress(structs.Empty)returns (structs.LnurlPayInfoResponse) {
option (auth_type) = "Guest";
option (http_method) = "get";
option (http_route) = "/.well-known/lnurlp/:address_name";
}
rpc LinkNPubThroughToken(structs.LinkNPubThroughTokenRequest) returns (structs.Empty) {
option (auth_type) = "User";
option(http_method) = "post";
option (http_route) = "/api/guest/npub/link";
option (nostr) = true;
}
//</Guest>
// <App>
rpc GetApp(structs.Empty) returns (structs.Application) {
option (auth_type) = "App";
option (http_method) = "post";
option (http_route) = "/api/app/get";
}
rpc AddAppUser(structs.AddAppUserRequest)returns (structs.AppUser) {
option (auth_type) = "App";
option (http_method) = "post";
option (http_route) = "/api/app/user/add";
};
rpc AddAppInvoice(structs.AddAppInvoiceRequest) returns (structs.NewInvoiceResponse) {
option (auth_type) = "App";
option (http_method) = "post";
option (http_route) = "/api/app/add/invoice";
}
rpc AddAppUserInvoice(structs.AddAppUserInvoiceRequest) returns (structs.NewInvoiceResponse) {
option (auth_type) = "App";
option (http_method) = "post";
option (http_route) = "/api/app/user/add/invoice";
}
rpc GetAppUser(structs.GetAppUserRequest) returns (structs.AppUser) {
option (auth_type) = "App";
option (http_method) = "post";
option (http_route) = "/api/app/user/get";
}
rpc PayAppUserInvoice(structs.PayAppUserInvoiceRequest) returns (structs.PayInvoiceResponse) {
option (auth_type) = "App";
option (http_method) = "post";
option (http_route) = "/api/app/invoice/pay";
}
rpc SendAppUserToAppUserPayment(structs.SendAppUserToAppUserPaymentRequest) returns (structs.Empty) {
option (auth_type) = "App";
option (http_method) = "post";
option (http_route) = "/api/app/user/internal/pay";
}
rpc SendAppUserToAppPayment(structs.SendAppUserToAppPaymentRequest) returns (structs.Empty) {
option (auth_type) = "App";
option (http_method) = "post";
option (http_route) = "/api/app/internal/pay";
}
rpc GetAppUserLNURLInfo(structs.GetAppUserLNURLInfoRequest) returns (structs.LnurlPayInfoResponse) {
option (auth_type) = "App";
option (http_method) = "post";
option (http_route) = "/api/app/user/lnurl/pay/info";
}
rpc SetMockAppUserBalance(structs.SetMockAppUserBalanceRequest) returns (structs.Empty) {
option (auth_type) = "App";
option (http_method) = "post";
option (http_route) = "/api/app/mock/user/blance/set";
}
rpc SetMockAppBalance(structs.SetMockAppBalanceRequest) returns (structs.Empty) {
option (auth_type) = "App";
option (http_method) = "post";
option (http_route) = "/api/app/mock/blance/set";
}
rpc RequestNPubLinkingToken(structs.RequestNPubLinkingTokenRequest) returns (structs.RequestNPubLinkingTokenResponse) {
option (auth_type) = "App";
option(http_method) = "post";
option (http_route) = "/api/app/user/npub/token";
}
// </App>
// <User>
rpc UserHealth(structs.Empty)returns(structs.Empty){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/health";
option (nostr) = true;
}
rpc GetUserInfo(structs.Empty)returns(structs.UserInfo){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/info";
option (nostr) = true;
}
rpc AddProduct(structs.AddProductRequest) returns (structs.Product){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/product/add";
option (nostr) = true;
};
rpc NewProductInvoice(structs.Empty) returns (structs.NewInvoiceResponse){
option (auth_type) = "User";
option (http_method) = "get";
option (http_route) = "/api/user/product/get/invoice";
option (query) = {items: ["id"]};
option (nostr) = true;
};
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";
option (http_route) = "/api/user/chain/new";
option (nostr) = true;
}
rpc PayAddress(structs.PayAddressRequest) returns (structs.PayAddressResponse){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/chain/pay";
option (nostr) = true;
}
rpc NewInvoice(structs.NewInvoiceRequest) returns (structs.NewInvoiceResponse){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/invoice/new";
option (nostr) = true;
}
rpc DecodeInvoice(structs.DecodeInvoiceRequest) returns (structs.DecodeInvoiceResponse){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/invoice/decode";
option (nostr) = true;
}
rpc PayInvoice(structs.PayInvoiceRequest) returns (structs.PayInvoiceResponse){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/invoice/pay";
option (nostr) = true;
}
rpc OpenChannel(structs.OpenChannelRequest) returns (structs.OpenChannelResponse){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/open/channel";
option (nostr) = true;
}
rpc GetLnurlWithdrawLink(structs.Empty) returns (structs.LnurlLinkResponse){
option (auth_type) = "User";
option (http_method) = "get";
option (http_route) = "/api/user/lnurl_withdraw/link";
option (nostr) = true;
}
rpc GetLnurlPayLink(structs.Empty) returns (structs.LnurlLinkResponse){
option (auth_type) = "User";
option (http_method) = "get";
option (http_route) = "/api/user/lnurl_pay/link";
option (nostr) = true;
}
rpc GetLNURLChannelLink(structs.Empty) returns (structs.LnurlLinkResponse){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/lnurl_channel/url";
option (nostr) = true;
}
rpc GetLiveUserOperations(structs.Empty) returns (stream structs.LiveUserOperation){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/operations/sub";
option (nostr) = true;
}
rpc GetMigrationUpdate(structs.Empty) returns (stream structs.MigrationUpdate){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/migrations/sub";
option (nostr) = true;
}
rpc GetHttpCreds(structs.Empty) returns (stream structs.HttpCreds){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/http_creds";
option (nostr) = true;
}
rpc BatchUser(structs.Empty) returns (structs.Empty){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/batch";
option (nostr) = true;
option (batch) = true;
}
// </User>
}

View file

@ -1,449 +1,449 @@
syntax = "proto3";
package structs;
option go_package = "github.com/shocknet/lightning.pub";
message Empty {}
message EncryptionExchangeRequest {
string publicKey = 1;
string deviceId = 2;
}
message UsageMetric {
int64 processed_at_ms = 1;
int64 parsed_in_nano = 2;
int64 auth_in_nano = 3;
int64 validate_in_nano = 4;
int64 handle_in_nano = 5;
string rpc_name = 6;
bool batch = 7;
bool nostr = 8;
int64 batch_size = 9;
}
message UsageMetrics {
repeated UsageMetric metrics = 1;
}
message AppsMetricsRequest {
optional int64 from_unix = 1;
optional int64 to_unix = 2;
optional bool include_operations = 3;
}
message UsersInfo {
int64 total = 1;
int64 no_balance = 2;
int64 negative_balance = 3;
int64 always_been_inactive = 4;
int64 balance_avg = 5;
int64 balance_median = 6;
}
message AppMetrics {
Application app = 1;
UsersInfo users = 2;
int64 received = 5;
int64 spent = 6;
int64 available = 7;
int64 fees = 8;
int64 invoices = 9;
int64 total_fees = 10;
repeated UserOperation operations = 100;
}
message AppsMetrics {
repeated AppMetrics apps = 1;
}
message LndMetricsRequest {
optional int64 from_unix = 1;
optional int64 to_unix = 2;
}
message RoutingEvent {
int64 incoming_channel_id = 1;
int64 incoming_htlc_id=2;
int64 outgoing_channel_id = 3;
int64 outgoing_htlc_id =4;
int64 timestamp_ns = 5;
string event_type = 6;
int64 incoming_amt_msat = 7;
int64 outgoing_amt_msat = 8;
string failure_string = 9;
bool settled = 10;
bool offchain = 11;
bool forward_fail_event = 12;
}
message ChannelBalanceEvent {
int64 block_height = 1;
string channel_id = 2;
int64 local_balance_sats = 3;
int64 remote_balance_sats = 4;
}
message ChainBalanceEvent {
int64 block_height = 1;
int64 confirmed_balance = 2;
int64 unconfirmed_balance = 3;
int64 total_balance = 4;
}
message OpenChannel {
string channel_id = 1;
int64 capacity = 2;
bool active = 3;
int64 lifetime =4 ;
int64 local_balance=5;
int64 remote_balance = 6;
}
message ClosedChannel {
string channel_id = 1;
int64 capacity = 2;
int64 closed_height =4;
}
message ChannelRouting {
string channel_id = 1;
int64 send_errors = 2;
int64 receive_errors = 3;
int64 forward_errors_as_input = 4;
int64 forward_errors_as_output = 5;
int64 missed_forward_fee_as_input = 6;
int64 missed_forward_fee_as_output = 7;
int64 forward_fee_as_input = 8;
int64 forward_fee_as_output = 9;
int64 events_number = 10;
}
message LndNodeMetrics {
repeated ChannelBalanceEvent channels_balance_events = 1;
repeated ChainBalanceEvent chain_balance_events = 2;
int64 offline_channels = 4;
int64 online_channels = 5;
int64 pending_channels = 6;
int64 closing_channels = 7;
repeated OpenChannel open_channels = 8;
repeated ClosedChannel closed_channels = 9;
repeated ChannelRouting channel_routing = 10;
}
message LndMetrics {
repeated LndNodeMetrics nodes = 1;
}
message LndGetInfoRequest {
int64 nodeId = 1;
}
message SetMockInvoiceAsPaidRequest {
string invoice = 1;
int64 amount =2;
}
message LndGetInfoResponse {
string alias = 1;
}
message BanUserRequest {
string user_id = 1;
}
message BannedAppUser {
string app_name = 1;
string app_id = 2;
string user_identifier = 3;
string nostr_pub = 4;
}
message BanUserResponse {
int64 balance_sats = 1;
repeated BannedAppUser banned_app_users = 2;
}
message AddAppRequest {
string name = 1;
bool allow_user_creation = 2;
}
message AuthAppRequest {
string name = 1;
optional bool allow_user_creation = 2;
}
message Application {
string name = 1;
string id = 2;
int64 balance = 3;
string npub = 4;
}
message AuthApp {
Application app = 1;
string auth_token = 2;
}
message AddAppUserRequest {
string identifier = 1;
bool fail_if_exists = 2;
int64 balance = 3;
}
message AppUser {
string identifier = 1;
UserInfo info = 2;
int64 max_withdrawable = 3;
}
message AddAppInvoiceRequest {
string payer_identifier = 1;
string http_callback_url = 2;
NewInvoiceRequest invoice_req = 3;
}
message AddAppUserInvoiceRequest {
string receiver_identifier = 1;
string payer_identifier = 2;
string http_callback_url = 3;
NewInvoiceRequest invoice_req = 4;
}
message GetAppUserRequest {
string user_identifier = 1;
}
message PayAppUserInvoiceRequest {
string user_identifier = 1;
string invoice = 2;
int64 amount = 3;
}
message SendAppUserToAppUserPaymentRequest {
string from_user_identifier = 1;
string to_user_identifier = 2;
int64 amount = 3;
}
message SendAppUserToAppPaymentRequest {
string from_user_identifier = 1;
int64 amount = 2;
}
message GetAppUserLNURLInfoRequest {
string user_identifier = 1;
string base_url_override = 2;
}
message SetMockAppUserBalanceRequest {
string user_identifier = 1;
int64 amount = 2;
}
message SetMockAppBalanceRequest {
int64 amount = 1;
}
enum AddressType {
WITNESS_PUBKEY_HASH = 0;
NESTED_PUBKEY_HASH = 1;
TAPROOT_PUBKEY = 2;
}
message NewAddressRequest {
AddressType addressType = 1;
}
message NewAddressResponse{
string address = 1;
}
message PayAddressRequest{
string address = 1;
int64 amoutSats = 2;
int64 satsPerVByte = 3;
}
message PayAddressResponse{
string txId = 1;
string operation_id = 2;
int64 service_fee = 3;
int64 network_fee = 4;
}
message NewInvoiceRequest{
int64 amountSats = 1;
string memo = 2;
}
message NewInvoiceResponse{
string invoice = 1;
}
message DecodeInvoiceRequest{
string invoice = 1;
}
message DecodeInvoiceResponse{
int64 amount=1;
}
message PayInvoiceRequest{
string invoice = 1;
int64 amount = 2;
}
message PayInvoiceResponse{
string preimage = 1;
int64 amount_paid = 2;
string operation_id = 3;
int64 service_fee = 4;
int64 network_fee = 5;
}
message OpenChannelRequest{
string destination = 1;
int64 fundingAmount = 2;
int64 pushAmount = 3;
string closeAddress = 4;
}
message OpenChannelResponse{
string channelId = 1;
}
message LnurlLinkResponse{
string lnurl = 1;
string k1 = 2;
}
message LnurlWithdrawInfoResponse {
string tag = 1;
string callback = 2;
string k1 = 3;
string defaultDescription = 4;
int64 minWithdrawable = 5; // millisatoshi - unsafe overflow possible, but very unlikely
int64 maxWithdrawable = 6; // millisatoshi - unsafe overflow possible, but very unlikely
string balanceCheck = 7;
string payLink = 8;
}
message LnurlPayInfoResponse {
string tag = 1;
string callback = 2;
int64 maxSendable = 3; // millisatoshi - unsafe overflow possible, but very unlikely
int64 minSendable = 4; // millisatoshi - unsafe overflow possible, but very unlikely
string metadata = 5;
bool allowsNostr = 6;
string nostrPubkey = 7;
}
message HandleLnurlPayResponse {
string pr = 1;
repeated Empty routes = 2;
}
message UserInfo{
string userId = 1;
int64 balance = 2;
int64 max_withdrawable = 3;
string user_identifier = 4;
}
message GetUserOperationsRequest{
int64 latestIncomingInvoice = 1;
int64 latestOutgoingInvoice = 2;
int64 latestIncomingTx = 3;
int64 latestOutgoingTx = 4;
int64 latestIncomingUserToUserPayment = 5;
int64 latestOutgoingUserToUserPayment = 6;
int64 max_size = 7;
}
enum UserOperationType {
INCOMING_TX =0;
OUTGOING_TX =1;
INCOMING_INVOICE =2;
OUTGOING_INVOICE=3;
OUTGOING_USER_TO_USER=4;
INCOMING_USER_TO_USER=5;
}
message UserOperation {
int64 paidAtUnix=1;
UserOperationType type = 2;
bool inbound =3;
int64 amount = 4;
string identifier = 5;
string operationId = 6;
int64 service_fee = 7;
int64 network_fee = 8;
bool confirmed = 9;
string tx_hash = 10;
bool internal = 11;
}
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;
UserOperations latestOutgoingUserToUserPayemnts=5;
UserOperations latestIncomingUserToUserPayemnts=6;
}
message AddProductRequest {
string name = 1;
int64 price_sats = 2;
}
message Product {
string id = 1;
string name = 2;
int64 price_sats = 3;
}
message GetProductBuyLinkResponse {
string link = 1;
}
message LiveUserOperation {
UserOperation operation = 1;
}
message MigrationUpdate {
optional ClosureMigration closure = 1;
optional RelaysMigration relays = 2;
}
message ClosureMigration {
int64 closes_at_unix = 1;
}
message RelaysMigration {
repeated string relays = 1;
}
message RequestNPubLinkingTokenRequest {
string user_identifier = 1;
}
message RequestNPubLinkingTokenResponse {
string token = 1;
}
message LinkNPubThroughTokenRequest {
string token = 1;
string nostr_pub = 2;
}
message HttpCreds {
string url = 1;
string token = 2;
syntax = "proto3";
package structs;
option go_package = "github.com/shocknet/lightning.pub";
message Empty {}
message EncryptionExchangeRequest {
string publicKey = 1;
string deviceId = 2;
}
message UsageMetric {
int64 processed_at_ms = 1;
int64 parsed_in_nano = 2;
int64 auth_in_nano = 3;
int64 validate_in_nano = 4;
int64 handle_in_nano = 5;
string rpc_name = 6;
bool batch = 7;
bool nostr = 8;
int64 batch_size = 9;
}
message UsageMetrics {
repeated UsageMetric metrics = 1;
}
message AppsMetricsRequest {
optional int64 from_unix = 1;
optional int64 to_unix = 2;
optional bool include_operations = 3;
}
message UsersInfo {
int64 total = 1;
int64 no_balance = 2;
int64 negative_balance = 3;
int64 always_been_inactive = 4;
int64 balance_avg = 5;
int64 balance_median = 6;
}
message AppMetrics {
Application app = 1;
UsersInfo users = 2;
int64 received = 5;
int64 spent = 6;
int64 available = 7;
int64 fees = 8;
int64 invoices = 9;
int64 total_fees = 10;
repeated UserOperation operations = 100;
}
message AppsMetrics {
repeated AppMetrics apps = 1;
}
message LndMetricsRequest {
optional int64 from_unix = 1;
optional int64 to_unix = 2;
}
message RoutingEvent {
int64 incoming_channel_id = 1;
int64 incoming_htlc_id=2;
int64 outgoing_channel_id = 3;
int64 outgoing_htlc_id =4;
int64 timestamp_ns = 5;
string event_type = 6;
int64 incoming_amt_msat = 7;
int64 outgoing_amt_msat = 8;
string failure_string = 9;
bool settled = 10;
bool offchain = 11;
bool forward_fail_event = 12;
}
message ChannelBalanceEvent {
int64 block_height = 1;
string channel_id = 2;
int64 local_balance_sats = 3;
int64 remote_balance_sats = 4;
}
message ChainBalanceEvent {
int64 block_height = 1;
int64 confirmed_balance = 2;
int64 unconfirmed_balance = 3;
int64 total_balance = 4;
}
message OpenChannel {
string channel_id = 1;
int64 capacity = 2;
bool active = 3;
int64 lifetime =4 ;
int64 local_balance=5;
int64 remote_balance = 6;
}
message ClosedChannel {
string channel_id = 1;
int64 capacity = 2;
int64 closed_height =4;
}
message ChannelRouting {
string channel_id = 1;
int64 send_errors = 2;
int64 receive_errors = 3;
int64 forward_errors_as_input = 4;
int64 forward_errors_as_output = 5;
int64 missed_forward_fee_as_input = 6;
int64 missed_forward_fee_as_output = 7;
int64 forward_fee_as_input = 8;
int64 forward_fee_as_output = 9;
int64 events_number = 10;
}
message LndNodeMetrics {
repeated ChannelBalanceEvent channels_balance_events = 1;
repeated ChainBalanceEvent chain_balance_events = 2;
int64 offline_channels = 4;
int64 online_channels = 5;
int64 pending_channels = 6;
int64 closing_channels = 7;
repeated OpenChannel open_channels = 8;
repeated ClosedChannel closed_channels = 9;
repeated ChannelRouting channel_routing = 10;
}
message LndMetrics {
repeated LndNodeMetrics nodes = 1;
}
message LndGetInfoRequest {
int64 nodeId = 1;
}
message SetMockInvoiceAsPaidRequest {
string invoice = 1;
int64 amount =2;
}
message LndGetInfoResponse {
string alias = 1;
}
message BanUserRequest {
string user_id = 1;
}
message BannedAppUser {
string app_name = 1;
string app_id = 2;
string user_identifier = 3;
string nostr_pub = 4;
}
message BanUserResponse {
int64 balance_sats = 1;
repeated BannedAppUser banned_app_users = 2;
}
message AddAppRequest {
string name = 1;
bool allow_user_creation = 2;
}
message AuthAppRequest {
string name = 1;
optional bool allow_user_creation = 2;
}
message Application {
string name = 1;
string id = 2;
int64 balance = 3;
string npub = 4;
}
message AuthApp {
Application app = 1;
string auth_token = 2;
}
message AddAppUserRequest {
string identifier = 1;
bool fail_if_exists = 2;
int64 balance = 3;
}
message AppUser {
string identifier = 1;
UserInfo info = 2;
int64 max_withdrawable = 3;
}
message AddAppInvoiceRequest {
string payer_identifier = 1;
string http_callback_url = 2;
NewInvoiceRequest invoice_req = 3;
}
message AddAppUserInvoiceRequest {
string receiver_identifier = 1;
string payer_identifier = 2;
string http_callback_url = 3;
NewInvoiceRequest invoice_req = 4;
}
message GetAppUserRequest {
string user_identifier = 1;
}
message PayAppUserInvoiceRequest {
string user_identifier = 1;
string invoice = 2;
int64 amount = 3;
}
message SendAppUserToAppUserPaymentRequest {
string from_user_identifier = 1;
string to_user_identifier = 2;
int64 amount = 3;
}
message SendAppUserToAppPaymentRequest {
string from_user_identifier = 1;
int64 amount = 2;
}
message GetAppUserLNURLInfoRequest {
string user_identifier = 1;
string base_url_override = 2;
}
message SetMockAppUserBalanceRequest {
string user_identifier = 1;
int64 amount = 2;
}
message SetMockAppBalanceRequest {
int64 amount = 1;
}
enum AddressType {
WITNESS_PUBKEY_HASH = 0;
NESTED_PUBKEY_HASH = 1;
TAPROOT_PUBKEY = 2;
}
message NewAddressRequest {
AddressType addressType = 1;
}
message NewAddressResponse{
string address = 1;
}
message PayAddressRequest{
string address = 1;
int64 amoutSats = 2;
int64 satsPerVByte = 3;
}
message PayAddressResponse{
string txId = 1;
string operation_id = 2;
int64 service_fee = 3;
int64 network_fee = 4;
}
message NewInvoiceRequest{
int64 amountSats = 1;
string memo = 2;
}
message NewInvoiceResponse{
string invoice = 1;
}
message DecodeInvoiceRequest{
string invoice = 1;
}
message DecodeInvoiceResponse{
int64 amount=1;
}
message PayInvoiceRequest{
string invoice = 1;
int64 amount = 2;
}
message PayInvoiceResponse{
string preimage = 1;
int64 amount_paid = 2;
string operation_id = 3;
int64 service_fee = 4;
int64 network_fee = 5;
}
message OpenChannelRequest{
string destination = 1;
int64 fundingAmount = 2;
int64 pushAmount = 3;
string closeAddress = 4;
}
message OpenChannelResponse{
string channelId = 1;
}
message LnurlLinkResponse{
string lnurl = 1;
string k1 = 2;
}
message LnurlWithdrawInfoResponse {
string tag = 1;
string callback = 2;
string k1 = 3;
string defaultDescription = 4;
int64 minWithdrawable = 5; // millisatoshi - unsafe overflow possible, but very unlikely
int64 maxWithdrawable = 6; // millisatoshi - unsafe overflow possible, but very unlikely
string balanceCheck = 7;
string payLink = 8;
}
message LnurlPayInfoResponse {
string tag = 1;
string callback = 2;
int64 maxSendable = 3; // millisatoshi - unsafe overflow possible, but very unlikely
int64 minSendable = 4; // millisatoshi - unsafe overflow possible, but very unlikely
string metadata = 5;
bool allowsNostr = 6;
string nostrPubkey = 7;
}
message HandleLnurlPayResponse {
string pr = 1;
repeated Empty routes = 2;
}
message UserInfo{
string userId = 1;
int64 balance = 2;
int64 max_withdrawable = 3;
string user_identifier = 4;
}
message GetUserOperationsRequest{
int64 latestIncomingInvoice = 1;
int64 latestOutgoingInvoice = 2;
int64 latestIncomingTx = 3;
int64 latestOutgoingTx = 4;
int64 latestIncomingUserToUserPayment = 5;
int64 latestOutgoingUserToUserPayment = 6;
int64 max_size = 7;
}
enum UserOperationType {
INCOMING_TX =0;
OUTGOING_TX =1;
INCOMING_INVOICE =2;
OUTGOING_INVOICE=3;
OUTGOING_USER_TO_USER=4;
INCOMING_USER_TO_USER=5;
}
message UserOperation {
int64 paidAtUnix=1;
UserOperationType type = 2;
bool inbound =3;
int64 amount = 4;
string identifier = 5;
string operationId = 6;
int64 service_fee = 7;
int64 network_fee = 8;
bool confirmed = 9;
string tx_hash = 10;
bool internal = 11;
}
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;
UserOperations latestOutgoingUserToUserPayemnts=5;
UserOperations latestIncomingUserToUserPayemnts=6;
}
message AddProductRequest {
string name = 1;
int64 price_sats = 2;
}
message Product {
string id = 1;
string name = 2;
int64 price_sats = 3;
}
message GetProductBuyLinkResponse {
string link = 1;
}
message LiveUserOperation {
UserOperation operation = 1;
}
message MigrationUpdate {
optional ClosureMigration closure = 1;
optional RelaysMigration relays = 2;
}
message ClosureMigration {
int64 closes_at_unix = 1;
}
message RelaysMigration {
repeated string relays = 1;
}
message RequestNPubLinkingTokenRequest {
string user_identifier = 1;
}
message RequestNPubLinkingTokenResponse {
string token = 1;
}
message LinkNPubThroughTokenRequest {
string token = 1;
string nostr_pub = 2;
}
message HttpCreds {
string url = 1;
string token = 2;
}