diff --git a/proto/autogenerated/client.md b/proto/autogenerated/client.md index 557b4499..c0eb3c82 100644 --- a/proto/autogenerated/client.md +++ b/proto/autogenerated/client.md @@ -1385,6 +1385,7 @@ The nostr server will send back a message response, and inside the body there wi ### NewInvoiceRequest - __amountSats__: _number_ + - __blind__: _boolean_ *this field is optional - __expiry__: _number_ *this field is optional - __memo__: _string_ - __zap__: _string_ *this field is optional @@ -1393,6 +1394,7 @@ The nostr server will send back a message response, and inside the body there wi - __invoice__: _string_ ### OfferConfig + - __blind__: _boolean_ - __callback_url__: _string_ - __createdAtUnix__: _number_ - __default_offer__: _boolean_ diff --git a/proto/autogenerated/go/types.go b/proto/autogenerated/go/types.go index 2a75a291..e8e90df5 100644 --- a/proto/autogenerated/go/types.go +++ b/proto/autogenerated/go/types.go @@ -470,6 +470,7 @@ type NewAddressResponse struct { } type NewInvoiceRequest struct { Amountsats int64 `json:"amountSats"` + Blind bool `json:"blind"` Expiry int64 `json:"expiry"` Memo string `json:"memo"` Zap string `json:"zap"` @@ -478,6 +479,7 @@ type NewInvoiceResponse struct { Invoice string `json:"invoice"` } type OfferConfig struct { + Blind bool `json:"blind"` Callback_url string `json:"callback_url"` Createdatunix int64 `json:"createdAtUnix"` Default_offer bool `json:"default_offer"` diff --git a/proto/autogenerated/ts/types.ts b/proto/autogenerated/ts/types.ts index 8a219ecb..1f0e6524 100644 --- a/proto/autogenerated/ts/types.ts +++ b/proto/autogenerated/ts/types.ts @@ -2768,15 +2768,17 @@ export const NewAddressResponseValidate = (o?: NewAddressResponse, opts: NewAddr export type NewInvoiceRequest = { amountSats: number + blind?: boolean expiry?: number memo: string zap?: string } -export type NewInvoiceRequestOptionalField = 'expiry' | 'zap' -export const NewInvoiceRequestOptionalFields: NewInvoiceRequestOptionalField[] = ['expiry', 'zap'] +export type NewInvoiceRequestOptionalField = 'blind' | 'expiry' | 'zap' +export const NewInvoiceRequestOptionalFields: NewInvoiceRequestOptionalField[] = ['blind', 'expiry', 'zap'] export type NewInvoiceRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: NewInvoiceRequestOptionalField[] amountSats_CustomCheck?: (v: number) => boolean + blind_CustomCheck?: (v?: boolean) => boolean expiry_CustomCheck?: (v?: number) => boolean memo_CustomCheck?: (v: string) => boolean zap_CustomCheck?: (v?: string) => boolean @@ -2788,6 +2790,9 @@ export const NewInvoiceRequestValidate = (o?: NewInvoiceRequest, opts: NewInvoic if (typeof o.amountSats !== 'number') return new Error(`${path}.amountSats: is not a number`) if (opts.amountSats_CustomCheck && !opts.amountSats_CustomCheck(o.amountSats)) return new Error(`${path}.amountSats: custom check failed`) + if ((o.blind || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('blind')) && typeof o.blind !== 'boolean') return new Error(`${path}.blind: is not a boolean`) + if (opts.blind_CustomCheck && !opts.blind_CustomCheck(o.blind)) return new Error(`${path}.blind: custom check failed`) + if ((o.expiry || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('expiry')) && typeof o.expiry !== 'number') return new Error(`${path}.expiry: is not a number`) if (opts.expiry_CustomCheck && !opts.expiry_CustomCheck(o.expiry)) return new Error(`${path}.expiry: custom check failed`) @@ -2819,6 +2824,7 @@ export const NewInvoiceResponseValidate = (o?: NewInvoiceResponse, opts: NewInvo } export type OfferConfig = { + blind: boolean callback_url: string createdAtUnix: number default_offer: boolean @@ -2834,6 +2840,7 @@ export type OfferConfig = { export const OfferConfigOptionalFields: [] = [] export type OfferConfigOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] + blind_CustomCheck?: (v: boolean) => boolean callback_url_CustomCheck?: (v: string) => boolean createdAtUnix_CustomCheck?: (v: number) => boolean default_offer_CustomCheck?: (v: boolean) => boolean @@ -2850,6 +2857,9 @@ export const OfferConfigValidate = (o?: OfferConfig, opts: OfferConfigOptions = if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + if (typeof o.blind !== 'boolean') return new Error(`${path}.blind: is not a boolean`) + if (opts.blind_CustomCheck && !opts.blind_CustomCheck(o.blind)) return new Error(`${path}.blind: custom check failed`) + if (typeof o.callback_url !== 'string') return new Error(`${path}.callback_url: is not a string`) if (opts.callback_url_CustomCheck && !opts.callback_url_CustomCheck(o.callback_url)) return new Error(`${path}.callback_url: custom check failed`) diff --git a/proto/service/structs.proto b/proto/service/structs.proto index 4e6d4b50..fa6a3505 100644 --- a/proto/service/structs.proto +++ b/proto/service/structs.proto @@ -1,824 +1,826 @@ -syntax = "proto3"; - -package structs; - -option go_package = "github.com/shocknet/lightning.pub"; - -message Empty {} - -message LndSeed { - repeated string seed = 1; -} - -message ZippedMetrics { - string path = 1; -} - -message EncryptionExchangeRequest { - string publicKey = 1; - string deviceId = 2; -} - -message UserHealthState { - string downtime_reason = 1; -} - -message ErrorStat { - int64 from_unix = 1; - int64 total = 2; - int64 errors = 3; -} - -message ErrorStats { - ErrorStat past24h = 1; - ErrorStat past6h = 2; - ErrorStat past1h = 3; - ErrorStat past10m = 4; - ErrorStat past1m = 5; -} - -message MetricsFile { - -} - -message LatestUsageMetricReq { - optional int64 limit = 1; -} - -enum SingleMetricType { - USAGE_METRIC = 0; - BUNDLE_METRIC = 1; -} - -message SingleMetricReq { - string app_id = 1; - string metrics_name = 2; - int64 page = 3; - SingleMetricType metric_type = 4; - optional int64 request_id = 5; -} - -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; - bool success = 10; - optional string app_id = 11; -} - - - -message UsageMetricTlv { - repeated string base_64_tlvs = 1; - int64 current_chunk = 2; - repeated int64 available_chunks = 3; - -} - -message AppUsageMetrics { - map app_metrics = 1; -} - -message UsageMetrics { - map apps = 1; -} - -message LatestBundleMetricReq { - optional int64 limit = 1; -} - -message BundleData { - repeated string base_64_data = 1; - int64 current_chunk = 2; - repeated int64 available_chunks = 3; -} - -message BundleMetric { - map app_bundles = 1; -} - -message BundleMetrics { - map apps = 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 ChannelPolicy { - int64 base_fee_msat= 1; - int64 fee_rate_ppm = 2; - int64 max_htlc_msat = 3; - int64 min_htlc_msat = 4; - int64 timelock_delta = 5; -} - -message UpdateChannelPolicyRequest { - oneof update { - string channel_point = 1; - Empty all = 2; - } - ChannelPolicy policy = 3; -} - -message OpenChannel { - string channel_id = 1; - int64 capacity = 2; - bool active = 3; - int64 lifetime =4; - int64 local_balance=5; - int64 remote_balance = 6; - string label = 7; - string channel_point = 8; - optional ChannelPolicy policy = 9; - int64 inactive_since_unix = 10; -} -message ClosedChannel { - string channel_id = 1; - int64 capacity = 2; - int64 closed_height =4; - int64 close_tx_timestamp = 5; -} - -message GraphPoint { - int64 x = 1; - int64 y = 2; -} -enum OperationType { - CHAIN_OP = 0; - INVOICE_OP = 1; -} -message RootOperation { - OperationType op_type = 1; - string op_id = 2; - int64 amount = 3; - int64 created_at_unix = 4; -} - -message LndForwardingEvent { - string chan_id_in = 1; - string chan_id_out = 2; - int64 amt_in = 3; - int64 amt_out = 4; - int64 fee = 5; - int64 at_unix = 6; -} - -message LndForwardingMetrics { - int64 total_fees = 1; - repeated LndForwardingEvent events = 2; -} - -message LndNodeMetrics { - repeated GraphPoint chain_balance = 1; - repeated GraphPoint channel_balance = 2; - repeated GraphPoint external_balance = 3; - 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; - int64 forwarding_events = 11; - int64 forwarding_fees = 12; - repeated RootOperation root_ops = 13; -} - -message LndMetrics { - repeated LndNodeMetrics nodes = 1; - -} - -message LndChannels { - repeated OpenChannel open_channels = 1; -} - -message WebRtcMessage { - oneof message { - string offer = 1; - string candidate = 2; - } -} - -message WebRtcAnswer { - optional string answer = 1; -} - -message WebRtcCandidate { - string candidate = 1; -} - - - -message OpenChannelRequest{ - string node_pubkey = 1; - int64 local_funding_amount = 2; - int64 sat_per_v_byte = 3; - optional int64 push_sat = 5; - optional string close_address = 6; -} - -message OpenChannelResponse{ - string channel_id = 1; -} - -message CloseChannelRequest{ - bool force = 2; - int64 sat_per_v_byte = 3; - string funding_txid = 4; - int64 output_index = 5; -} - -message CloseChannelResponse{ - string closing_txid = 1; -} - -message AddPeerRequest { - string pubkey = 1; - string host = 2; - int64 port = 3; -} - -message LndGetInfoRequest { - int64 nodeId = 1; -} - -message SetMockInvoiceAsPaidRequest { - string invoice = 1; - int64 amount =2; -} - -message LndGetInfoResponse { - string alias = 1; - bool synced_to_chain = 2; - bool synced_to_graph = 3; - bool watchdog_barking = 4; -} - -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; - optional PayerData payer_data = 5; - optional string offer_string = 6; - optional bool rejectUnauthorized = 7; - optional string token = 8; -} - -message GetAppUserRequest { - string user_identifier = 1; -} - -message PayAppUserInvoiceRequest { - string user_identifier = 1; - string invoice = 2; - int64 amount = 3; - optional string debit_npub = 4; -} - -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 PayerData { - map data = 1; -} - -message NewInvoiceRequest{ - int64 amountSats = 1; - string memo = 2; - optional string zap = 3; - optional int64 expiry = 4; -} - -message NewInvoiceResponse{ - string invoice = 1; -} -message DecodeInvoiceRequest{ - string invoice = 1; -} -message DecodeInvoiceResponse{ - int64 amount=1; -} -message PayInvoiceRequest{ - string invoice = 1; - int64 amount = 2; - optional string debit_npub = 3; -} - -message PayInvoiceResponse{ - string preimage = 1; - int64 amount_paid = 2; - string operation_id = 3; - int64 service_fee = 4; - int64 network_fee = 5; -} - -message GetPaymentStateRequest{ - string invoice = 1; - -} - -message PaymentState{ - int64 paid_at_unix = 1; - int64 amount = 2; - int64 service_fee = 3; - int64 network_fee = 4; -} - -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 CallbackUrl { - string url = 1; -} - -message UserInfo{ - string userId = 1; - int64 balance = 2; - int64 max_withdrawable = 3; - string user_identifier = 4; - int64 service_fee_bps = 5; - int64 network_max_fee_bps = 6; - int64 network_max_fee_fixed = 7; - string noffer = 8; - string ndebit = 9; - string callback_url = 10; - string bridge_url = 11; - string nmanage = 12; -} - - -message OperationsCursor { - int64 ts = 1; // last timestamp - int64 id = 2; // last serial_id -} -message GetUserOperationsRequest{ - OperationsCursor latestIncomingInvoice = 1; - OperationsCursor latestOutgoingInvoice = 2; - OperationsCursor latestIncomingTx = 3; - OperationsCursor latestOutgoingTx = 4; - OperationsCursor latestIncomingUserToUserPayment = 5; - OperationsCursor 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 { - OperationsCursor fromIndex=1; - OperationsCursor 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; - string noffer = 4; -} - -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 GetNPubLinking { - string user_identifier = 1; -} - -message NPubLinking { - oneof state { - Empty unlinked = 1; - string linked_npub = 2; - string linking_token = 3; - } -} - - -message RequestNPubLinkingTokenRequest { - string user_identifier = 1; -} - -message RequestNPubLinkingTokenResponse { - string token = 1; -} - - - -message LinkNPubThroughTokenRequest { - string token = 1; -} - -message HttpCreds { - string url = 1; - string token = 2; -} - -message EnrollAdminTokenRequest { - string admin_token = 1; -} - -message CreateOneTimeInviteLinkRequest { - optional int64 sats = 1; -} - -message CreateOneTimeInviteLinkResponse { - string invitation_link = 1; -} - -message UseInviteLinkRequest { - string invite_token = 1; -} - - -message GetInviteTokenStateRequest { - string invite_token = 1; -} - -message GetInviteTokenStateResponse { - bool used = 1; -} - -message DebitOperation { - string npub = 1; -} - -message DebitAuthorizationRequest { - string authorize_npub = 1; - repeated DebitRule rules = 2; - optional string request_id = 3; -} - -message ManageOperation { - string npub = 1; -} - -message ManageAuthorizationRequest { - string authorize_npub = 1; - optional string request_id = 2; - bool ban = 3; -} - -message ManageAuthorization { - string manage_id = 1; - bool authorized = 2; - string npub = 3; -} - -message ManageAuthorizations { - repeated ManageAuthorization manages = 1; -} - -message DebitAuthorization { - string debit_id = 1; - bool authorized = 2; - string npub = 3; - repeated DebitRule rules = 4; - -} - -message DebitAuthorizations { - repeated DebitAuthorization debits = 1; -} - -message DebitExpirationRule { - int64 expires_at_unix = 1; -} - -enum IntervalType { - DAY = 0; - WEEK = 1; - MONTH = 2; -} -message FrequencyRule { - int64 number_of_intervals = 1; - IntervalType interval = 2; - int64 amount = 3; -} - -message DebitRule { - oneof rule { - DebitExpirationRule expiration_rule = 1; - FrequencyRule frequency_rule = 2; - } -} - -message LiveDebitRequest { - string request_id = 1; - string npub = 2; - oneof debit { - string invoice = 3; - FrequencyRule frequency = 4; - Empty full_access = 5; - } -} - -message LiveManageRequest { - string request_id = 1; - string npub = 2; -} - -message DebitToAuthorize { - repeated DebitRule rules = 1; - optional string invoice = 2; -} - -message DebitResponse { - string request_id = 1; - string npub = 2; - oneof response { - Empty denied = 3; - string invoice = 4; - DebitToAuthorize authorize = 5; - } -} - - -message OfferId { - string offer_id = 1; -} - -message OfferConfig { - string offer_id = 1; - string label = 2; - int64 price_sats = 3; - string callback_url = 4; - repeated string payer_data = 5; - string noffer = 6; - bool default_offer = 7; - string token = 8; - bool rejectUnauthorized = 9; - int64 createdAtUnix = 10; - int64 updatedAtUnix = 11; -} - -message UserOffers { - repeated OfferConfig offers = 1; -} - -message GetUserOfferInvoicesReq { - string offer_id = 1; - bool include_unpaid = 2; -} - -message OfferInvoices { - repeated OfferInvoice invoices = 1; -} - -message OfferInvoice { - string invoice = 1; - string offer_id = 2; - int64 paid_at_unix = 3; - int64 amount = 4; - map data = 5; -} - -message ProviderDisruption { - string provider_pubkey = 1; - string provider_type = 2; - int64 since_unix = 3; -} - -message ProvidersDisruption { - repeated ProviderDisruption disruptions = 1; -} - -message MessagingToken { - string device_id = 1; - string firebase_messaging_token = 2; -} +syntax = "proto3"; + +package structs; + +option go_package = "github.com/shocknet/lightning.pub"; + +message Empty {} + +message LndSeed { + repeated string seed = 1; +} + +message ZippedMetrics { + string path = 1; +} + +message EncryptionExchangeRequest { + string publicKey = 1; + string deviceId = 2; +} + +message UserHealthState { + string downtime_reason = 1; +} + +message ErrorStat { + int64 from_unix = 1; + int64 total = 2; + int64 errors = 3; +} + +message ErrorStats { + ErrorStat past24h = 1; + ErrorStat past6h = 2; + ErrorStat past1h = 3; + ErrorStat past10m = 4; + ErrorStat past1m = 5; +} + +message MetricsFile { + +} + +message LatestUsageMetricReq { + optional int64 limit = 1; +} + +enum SingleMetricType { + USAGE_METRIC = 0; + BUNDLE_METRIC = 1; +} + +message SingleMetricReq { + string app_id = 1; + string metrics_name = 2; + int64 page = 3; + SingleMetricType metric_type = 4; + optional int64 request_id = 5; +} + +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; + bool success = 10; + optional string app_id = 11; +} + + + +message UsageMetricTlv { + repeated string base_64_tlvs = 1; + int64 current_chunk = 2; + repeated int64 available_chunks = 3; + +} + +message AppUsageMetrics { + map app_metrics = 1; +} + +message UsageMetrics { + map apps = 1; +} + +message LatestBundleMetricReq { + optional int64 limit = 1; +} + +message BundleData { + repeated string base_64_data = 1; + int64 current_chunk = 2; + repeated int64 available_chunks = 3; +} + +message BundleMetric { + map app_bundles = 1; +} + +message BundleMetrics { + map apps = 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 ChannelPolicy { + int64 base_fee_msat= 1; + int64 fee_rate_ppm = 2; + int64 max_htlc_msat = 3; + int64 min_htlc_msat = 4; + int64 timelock_delta = 5; +} + +message UpdateChannelPolicyRequest { + oneof update { + string channel_point = 1; + Empty all = 2; + } + ChannelPolicy policy = 3; +} + +message OpenChannel { + string channel_id = 1; + int64 capacity = 2; + bool active = 3; + int64 lifetime =4; + int64 local_balance=5; + int64 remote_balance = 6; + string label = 7; + string channel_point = 8; + optional ChannelPolicy policy = 9; + int64 inactive_since_unix = 10; +} +message ClosedChannel { + string channel_id = 1; + int64 capacity = 2; + int64 closed_height =4; + int64 close_tx_timestamp = 5; +} + +message GraphPoint { + int64 x = 1; + int64 y = 2; +} +enum OperationType { + CHAIN_OP = 0; + INVOICE_OP = 1; +} +message RootOperation { + OperationType op_type = 1; + string op_id = 2; + int64 amount = 3; + int64 created_at_unix = 4; +} + +message LndForwardingEvent { + string chan_id_in = 1; + string chan_id_out = 2; + int64 amt_in = 3; + int64 amt_out = 4; + int64 fee = 5; + int64 at_unix = 6; +} + +message LndForwardingMetrics { + int64 total_fees = 1; + repeated LndForwardingEvent events = 2; +} + +message LndNodeMetrics { + repeated GraphPoint chain_balance = 1; + repeated GraphPoint channel_balance = 2; + repeated GraphPoint external_balance = 3; + 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; + int64 forwarding_events = 11; + int64 forwarding_fees = 12; + repeated RootOperation root_ops = 13; +} + +message LndMetrics { + repeated LndNodeMetrics nodes = 1; + +} + +message LndChannels { + repeated OpenChannel open_channels = 1; +} + +message WebRtcMessage { + oneof message { + string offer = 1; + string candidate = 2; + } +} + +message WebRtcAnswer { + optional string answer = 1; +} + +message WebRtcCandidate { + string candidate = 1; +} + + + +message OpenChannelRequest{ + string node_pubkey = 1; + int64 local_funding_amount = 2; + int64 sat_per_v_byte = 3; + optional int64 push_sat = 5; + optional string close_address = 6; +} + +message OpenChannelResponse{ + string channel_id = 1; +} + +message CloseChannelRequest{ + bool force = 2; + int64 sat_per_v_byte = 3; + string funding_txid = 4; + int64 output_index = 5; +} + +message CloseChannelResponse{ + string closing_txid = 1; +} + +message AddPeerRequest { + string pubkey = 1; + string host = 2; + int64 port = 3; +} + +message LndGetInfoRequest { + int64 nodeId = 1; +} + +message SetMockInvoiceAsPaidRequest { + string invoice = 1; + int64 amount =2; +} + +message LndGetInfoResponse { + string alias = 1; + bool synced_to_chain = 2; + bool synced_to_graph = 3; + bool watchdog_barking = 4; +} + +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; + optional PayerData payer_data = 5; + optional string offer_string = 6; + optional bool rejectUnauthorized = 7; + optional string token = 8; +} + +message GetAppUserRequest { + string user_identifier = 1; +} + +message PayAppUserInvoiceRequest { + string user_identifier = 1; + string invoice = 2; + int64 amount = 3; + optional string debit_npub = 4; +} + +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 PayerData { + map data = 1; +} + +message NewInvoiceRequest{ + int64 amountSats = 1; + string memo = 2; + optional string zap = 3; + optional int64 expiry = 4; + optional bool blind = 5; +} + +message NewInvoiceResponse{ + string invoice = 1; +} +message DecodeInvoiceRequest{ + string invoice = 1; +} +message DecodeInvoiceResponse{ + int64 amount=1; +} +message PayInvoiceRequest{ + string invoice = 1; + int64 amount = 2; + optional string debit_npub = 3; +} + +message PayInvoiceResponse{ + string preimage = 1; + int64 amount_paid = 2; + string operation_id = 3; + int64 service_fee = 4; + int64 network_fee = 5; +} + +message GetPaymentStateRequest{ + string invoice = 1; + +} + +message PaymentState{ + int64 paid_at_unix = 1; + int64 amount = 2; + int64 service_fee = 3; + int64 network_fee = 4; +} + +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 CallbackUrl { + string url = 1; +} + +message UserInfo{ + string userId = 1; + int64 balance = 2; + int64 max_withdrawable = 3; + string user_identifier = 4; + int64 service_fee_bps = 5; + int64 network_max_fee_bps = 6; + int64 network_max_fee_fixed = 7; + string noffer = 8; + string ndebit = 9; + string callback_url = 10; + string bridge_url = 11; + string nmanage = 12; +} + + +message OperationsCursor { + int64 ts = 1; // last timestamp + int64 id = 2; // last serial_id +} +message GetUserOperationsRequest{ + OperationsCursor latestIncomingInvoice = 1; + OperationsCursor latestOutgoingInvoice = 2; + OperationsCursor latestIncomingTx = 3; + OperationsCursor latestOutgoingTx = 4; + OperationsCursor latestIncomingUserToUserPayment = 5; + OperationsCursor 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 { + OperationsCursor fromIndex=1; + OperationsCursor 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; + string noffer = 4; +} + +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 GetNPubLinking { + string user_identifier = 1; +} + +message NPubLinking { + oneof state { + Empty unlinked = 1; + string linked_npub = 2; + string linking_token = 3; + } +} + + +message RequestNPubLinkingTokenRequest { + string user_identifier = 1; +} + +message RequestNPubLinkingTokenResponse { + string token = 1; +} + + + +message LinkNPubThroughTokenRequest { + string token = 1; +} + +message HttpCreds { + string url = 1; + string token = 2; +} + +message EnrollAdminTokenRequest { + string admin_token = 1; +} + +message CreateOneTimeInviteLinkRequest { + optional int64 sats = 1; +} + +message CreateOneTimeInviteLinkResponse { + string invitation_link = 1; +} + +message UseInviteLinkRequest { + string invite_token = 1; +} + + +message GetInviteTokenStateRequest { + string invite_token = 1; +} + +message GetInviteTokenStateResponse { + bool used = 1; +} + +message DebitOperation { + string npub = 1; +} + +message DebitAuthorizationRequest { + string authorize_npub = 1; + repeated DebitRule rules = 2; + optional string request_id = 3; +} + +message ManageOperation { + string npub = 1; +} + +message ManageAuthorizationRequest { + string authorize_npub = 1; + optional string request_id = 2; + bool ban = 3; +} + +message ManageAuthorization { + string manage_id = 1; + bool authorized = 2; + string npub = 3; +} + +message ManageAuthorizations { + repeated ManageAuthorization manages = 1; +} + +message DebitAuthorization { + string debit_id = 1; + bool authorized = 2; + string npub = 3; + repeated DebitRule rules = 4; + +} + +message DebitAuthorizations { + repeated DebitAuthorization debits = 1; +} + +message DebitExpirationRule { + int64 expires_at_unix = 1; +} + +enum IntervalType { + DAY = 0; + WEEK = 1; + MONTH = 2; +} +message FrequencyRule { + int64 number_of_intervals = 1; + IntervalType interval = 2; + int64 amount = 3; +} + +message DebitRule { + oneof rule { + DebitExpirationRule expiration_rule = 1; + FrequencyRule frequency_rule = 2; + } +} + +message LiveDebitRequest { + string request_id = 1; + string npub = 2; + oneof debit { + string invoice = 3; + FrequencyRule frequency = 4; + Empty full_access = 5; + } +} + +message LiveManageRequest { + string request_id = 1; + string npub = 2; +} + +message DebitToAuthorize { + repeated DebitRule rules = 1; + optional string invoice = 2; +} + +message DebitResponse { + string request_id = 1; + string npub = 2; + oneof response { + Empty denied = 3; + string invoice = 4; + DebitToAuthorize authorize = 5; + } +} + + +message OfferId { + string offer_id = 1; +} + +message OfferConfig { + string offer_id = 1; + string label = 2; + int64 price_sats = 3; + string callback_url = 4; + repeated string payer_data = 5; + string noffer = 6; + bool default_offer = 7; + string token = 8; + bool rejectUnauthorized = 9; + int64 createdAtUnix = 10; + int64 updatedAtUnix = 11; + bool blind = 12; +} + +message UserOffers { + repeated OfferConfig offers = 1; +} + +message GetUserOfferInvoicesReq { + string offer_id = 1; + bool include_unpaid = 2; +} + +message OfferInvoices { + repeated OfferInvoice invoices = 1; +} + +message OfferInvoice { + string invoice = 1; + string offer_id = 2; + int64 paid_at_unix = 3; + int64 amount = 4; + map data = 5; +} + +message ProviderDisruption { + string provider_pubkey = 1; + string provider_type = 2; + int64 since_unix = 3; +} + +message ProvidersDisruption { + repeated ProviderDisruption disruptions = 1; +} + +message MessagingToken { + string device_id = 1; + string firebase_messaging_token = 2; +} diff --git a/src/services/lnd/addInvoiceReq.ts b/src/services/lnd/addInvoiceReq.ts index 0cf7fd97..072a1541 100644 --- a/src/services/lnd/addInvoiceReq.ts +++ b/src/services/lnd/addInvoiceReq.ts @@ -1,34 +1,34 @@ -import { OpenChannelRequest, Invoice } from "../../../proto/lnd/lightning"; - -export const AddInvoiceReq = (value: number, expiry = 60 * 60, privateHints = false, memo?: string): Invoice => ({ - expiry: BigInt(expiry), - memo: memo || "", - private: privateHints, - value: BigInt(value), - - fallbackAddr: "", - cltvExpiry: 0n, - descriptionHash: Buffer.alloc(0), - features: {}, - isAmp: false, - rPreimage: Buffer.alloc(0), - routeHints: [], - valueMsat: 0n, - - addIndex: 0n, - ampInvoiceState: {}, - amtPaidMsat: 0n, - amtPaidSat: 0n, - creationDate: 0n, - htlcs: [], - isKeysend: false, - paymentAddr: Buffer.alloc(0), - paymentRequest: "", - rHash: Buffer.alloc(0), - settleDate: 0n, - settleIndex: 0n, - state: 0, - isBlinded: false, - amtPaid: 0n, - settled: false, +import { OpenChannelRequest, Invoice } from "../../../proto/lnd/lightning"; + +export const AddInvoiceReq = (value: number, expiry = 60 * 60, privateHints = false, memo?: string, blind = false): Invoice => ({ + expiry: BigInt(expiry), + memo: memo || "", + private: privateHints, + value: BigInt(value), + + fallbackAddr: "", + cltvExpiry: 0n, + descriptionHash: Buffer.alloc(0), + features: {}, + isAmp: false, + rPreimage: Buffer.alloc(0), + routeHints: [], + valueMsat: 0n, + + addIndex: 0n, + ampInvoiceState: {}, + amtPaidMsat: 0n, + amtPaidSat: 0n, + creationDate: 0n, + htlcs: [], + isKeysend: false, + paymentAddr: Buffer.alloc(0), + paymentRequest: "", + rHash: Buffer.alloc(0), + settleDate: 0n, + settleIndex: 0n, + state: 0, + isBlinded: blind, + amtPaid: 0n, + settled: false, }) \ No newline at end of file diff --git a/src/services/lnd/lnd.ts b/src/services/lnd/lnd.ts index d1b65b50..254ccb7b 100644 --- a/src/services/lnd/lnd.ts +++ b/src/services/lnd/lnd.ts @@ -288,7 +288,7 @@ export default class { } } - async NewInvoice(value: number, memo: string, expiry: number, { useProvider, from }: TxActionOptions): Promise { + async NewInvoice(value: number, memo: string, expiry: number, { useProvider, from }: TxActionOptions, blind = false): Promise { if (useProvider) { console.log("using provider") const invoice = await this.liquidProvider.AddInvoice(value, memo, from, expiry) @@ -296,7 +296,7 @@ export default class { return { payRequest: invoice, providerDst } } try { - const res = await this.lightning.addInvoice(AddInvoiceReq(value, expiry, true, memo), DeadLineMetadata()) + const res = await this.lightning.addInvoice(AddInvoiceReq(value, expiry, true, memo, blind), DeadLineMetadata()) this.utils.stateBundler.AddTxPoint('addedInvoice', value, { from, used: 'lnd' }) return { payRequest: res.response.paymentRequest } } catch (err) { diff --git a/src/services/main/applicationManager.ts b/src/services/main/applicationManager.ts index 3aa33f52..fd084c27 100644 --- a/src/services/main/applicationManager.ts +++ b/src/services/main/applicationManager.ts @@ -199,7 +199,8 @@ export default class { const opts: InboundOptionals = { callbackUrl: cbUrl, expiry: expiry, expectedPayer: payer.user, linkedApplication: app, zapInfo, offerId: req.offer_string, payerData: req.payer_data?.data, rejectUnauthorized: req.rejectUnauthorized, - token: req.token + token: req.token, + blind: req.invoice_req.blind } const appUserInvoice = await this.paymentManager.NewInvoice(receiver.user.user_id, req.invoice_req, opts) return { diff --git a/src/services/main/offerManager.ts b/src/services/main/offerManager.ts index e8dd21b2..7f60a8a6 100644 --- a/src/services/main/offerManager.ts +++ b/src/services/main/offerManager.ts @@ -26,7 +26,8 @@ const mapToOfferConfig = (appUserId: string, offer: UserOffer, { pubkey, relay } createdAtUnix: offer.created_at.getTime(), updatedAtUnix: offer.updated_at.getTime(), token: offer.bearer_token, - rejectUnauthorized: offer.rejectUnauthorized + rejectUnauthorized: offer.rejectUnauthorized, + blind: offer.blind } } export class OfferManager { @@ -65,6 +66,7 @@ export class OfferManager { label: req.label, price_sats: req.price_sats, callback_url: req.callback_url, + blind: req.blind, }) return { offer_id: newOffer.offer_id @@ -81,6 +83,7 @@ export class OfferManager { label: req.label, price_sats: req.price_sats, callback_url: req.callback_url, + blind: req.blind, }) } async GetUserOfferInvoices(ctx: Types.UserContext, req: Types.GetUserOfferInvoicesReq): Promise { @@ -242,7 +245,7 @@ export class OfferManager { const memo = offerReq.description || userOffer.label const res = await this.applicationManager.AddAppUserInvoice(appId, { http_callback_url: userOffer.callback_url, payer_identifier: userOffer.app_user_id, receiver_identifier: userOffer.app_user_id, - invoice_req: { amountSats: amt, memo, zap: offerReq.zap, expiry }, + invoice_req: { amountSats: amt, memo, zap: offerReq.zap, expiry, blind: userOffer.blind }, payer_data: validated ? { data: validated } : undefined, offer_string: offer, rejectUnauthorized: userOffer.rejectUnauthorized, diff --git a/src/services/main/paymentManager.ts b/src/services/main/paymentManager.ts index ff0f04fb..e6db1af1 100644 --- a/src/services/main/paymentManager.ts +++ b/src/services/main/paymentManager.ts @@ -223,7 +223,7 @@ export default class { throw new Error("user is banned, cannot generate invoice") } const use = await this.liquidityManager.beforeInvoiceCreation(req.amountSats) - const res = await this.lnd.NewInvoice(req.amountSats, req.memo, options.expiry, { useProvider: use === 'provider', from: 'user' }) + const res = await this.lnd.NewInvoice(req.amountSats, req.memo, options.expiry, { useProvider: use === 'provider', from: 'user' }, req.blind) const userInvoice = await this.storage.paymentStorage.AddUserInvoice(user, res.payRequest, options, res.providerDst) const appId = options.linkedApplication ? options.linkedApplication.app_id : "" this.storage.eventsLog.LogEvent({ type: 'new_invoice', userId: user.user_id, appUserId: "", appId, balance: user.balance_sats, data: userInvoice.invoice, amount: req.amountSats }) diff --git a/src/services/storage/entity/UserOffer.ts b/src/services/storage/entity/UserOffer.ts index 3b30de99..a1df2c57 100644 --- a/src/services/storage/entity/UserOffer.ts +++ b/src/services/storage/entity/UserOffer.ts @@ -38,6 +38,9 @@ export class UserOffer { @Column({ default: true }) rejectUnauthorized: boolean + @Column({ default: false }) + blind: boolean + @CreateDateColumn() created_at: Date diff --git a/src/services/storage/migrations/1760000000000-add_blind_to_user_offer.ts b/src/services/storage/migrations/1760000000000-add_blind_to_user_offer.ts new file mode 100644 index 00000000..dac8965e --- /dev/null +++ b/src/services/storage/migrations/1760000000000-add_blind_to_user_offer.ts @@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class AddBlindToUserOffer1760000000000 implements MigrationInterface { + name = 'AddBlindToUserOffer1760000000000' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "user_offer" ADD COLUMN "blind" boolean NOT NULL DEFAULT (0)`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "user_offer" DROP COLUMN "blind"`); + } + +} diff --git a/src/services/storage/migrations/runner.ts b/src/services/storage/migrations/runner.ts index 59b8ab7e..f22ce37e 100644 --- a/src/services/storage/migrations/runner.ts +++ b/src/services/storage/migrations/runner.ts @@ -24,12 +24,13 @@ import { AppUserDevice1753285173175 } from './1753285173175-app_user_device.js' import { OldSomethingLeftover1753106599604 } from './1753106599604-old_something_leftover.js' import { UserReceivingInvoiceIdx1753109184611 } from './1753109184611-user_receiving_invoice_idx.js' import { UserAccess1759426050669 } from './1759426050669-user_access.js' +import { AddBlindToUserOffer1760000000000 } from './1760000000000-add_blind_to_user_offer.js' export const allMigrations = [Initial1703170309875, LspOrder1718387847693, LiquidityProvider1719335699480, LndNodeInfo1720187506189, TrackedProvider1720814323679, CreateInviteTokenTable1721751414878, PaymentIndex1721760297610, DebitAccess1726496225078, DebitAccessFixes1726685229264, DebitToPub1727105758354, UserCbUrl1727112281043, UserOffer1733502626042, ManagementGrant1751307732346, ManagementGrantBanned1751989251513, - InvoiceCallbackUrls1752425992291, OldSomethingLeftover1753106599604, UserReceivingInvoiceIdx1753109184611, AppUserDevice1753285173175, UserAccess1759426050669] + InvoiceCallbackUrls1752425992291, OldSomethingLeftover1753106599604, UserReceivingInvoiceIdx1753109184611, AppUserDevice1753285173175, UserAccess1759426050669, AddBlindToUserOffer1760000000000] export const allMetricsMigrations = [LndMetrics1703170330183, ChannelRouting1709316653538, HtlcCount1724266887195, BalanceEvents1724860966825, RootOps1732566440447, RootOpsTime1745428134124, ChannelEvents1750777346411] /* export const TypeOrmMigrationRunner = async (log: PubLogger, storageManager: Storage, settings: DbSettings, arg: string | undefined): Promise => { diff --git a/src/services/storage/paymentStorage.ts b/src/services/storage/paymentStorage.ts index cc75de8a..b327a444 100644 --- a/src/services/storage/paymentStorage.ts +++ b/src/services/storage/paymentStorage.ts @@ -14,7 +14,7 @@ import { Application } from './entity/Application.js'; import TransactionsQueue from "./db/transactionsQueue.js"; import { LoggedEvent } from './eventsLog.js'; import { StorageInterface } from './db/storageInterface.js'; -export type InboundOptionals = { product?: Product, callbackUrl?: string, expiry: number, expectedPayer?: User, linkedApplication?: Application, zapInfo?: ZapInfo, offerId?: string, payerData?: Record, rejectUnauthorized?: boolean, token?: string } +export type InboundOptionals = { product?: Product, callbackUrl?: string, expiry: number, expectedPayer?: User, linkedApplication?: Application, zapInfo?: ZapInfo, offerId?: string, payerData?: Record, rejectUnauthorized?: boolean, token?: string, blind?: boolean } export const defaultInvoiceExpiry = 60 * 60 export default class { dbs: StorageInterface