diff --git a/env.example b/env.example index 1210cce9..42bc9330 100644 --- a/env.example +++ b/env.example @@ -9,6 +9,8 @@ #LND_CERT_PATH=~/.lnd/tls.cert #LND_MACAROON_PATH=~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon +LIQUIDITY_PROVIDER_PUB= + #DB #DATABASE_FILE=db.sqlite #METRICS_DATABASE_FILE=metrics.sqlite diff --git a/proto/autogenerated/client.md b/proto/autogenerated/client.md index 2f7c2b6f..89c50054 100644 --- a/proto/autogenerated/client.md +++ b/proto/autogenerated/client.md @@ -100,6 +100,11 @@ The nostr server will send back a message response, and inside the body there wi - This methods has an __empty__ __request__ body - output: [MigrationUpdate](#MigrationUpdate) +- GetHttpCreds + - auth type: __User__ + - This methods has an __empty__ __request__ body + - output: [HttpCreds](#HttpCreds) + - BatchUser - auth type: __User__ - This methods has an __empty__ __request__ body @@ -115,9 +120,9 @@ The nostr server will send back a message response, and inside the body there wi - __User__: - expected context content - - __user_id__: _string_ - __app_id__: _string_ - __app_user_id__: _string_ + - __user_id__: _string_ - __Admin__: - expected context content @@ -458,6 +463,13 @@ The nostr server will send back a message response, and inside the body there wi - This methods has an __empty__ __request__ body - output: [MigrationUpdate](#MigrationUpdate) +- GetHttpCreds + - auth type: __User__ + - http method: __post__ + - http route: __/api/user/http_creds__ + - This methods has an __empty__ __request__ body + - output: [HttpCreds](#HttpCreds) + - BatchUser - auth type: __User__ - http method: __post__ @@ -470,45 +482,41 @@ The nostr server will send back a message response, and inside the body there wi ## Messages ### The content of requests and response from the methods -### AddAppInvoiceRequest - - __payer_identifier__: _string_ - - __http_callback_url__: _string_ - - __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_ +### BanUserRequest + - __user_id__: _string_ -### GetAppUserRequest - - __user_identifier__: _string_ +### SendAppUserToAppUserPaymentRequest + - __from_user_identifier__: _string_ + - __to_user_identifier__: _string_ + - __amount__: _number_ -### LnurlPayInfoResponse - - __tag__: _string_ - - __callback__: _string_ - - __maxSendable__: _number_ - - __minSendable__: _number_ - - __metadata__: _string_ - - __allowsNostr__: _boolean_ - - __nostrPubkey__: _string_ +### SendAppUserToAppPaymentRequest + - __from_user_identifier__: _string_ + - __amount__: _number_ -### LinkNPubThroughTokenRequest - - __token__: _string_ - - __nostr_pub__: _string_ +### GetUserOperationsRequest + - __latestIncomingInvoice__: _number_ + - __latestOutgoingInvoice__: _number_ + - __latestIncomingTx__: _number_ + - __latestOutgoingTx__: _number_ + - __latestIncomingUserToUserPayment__: _number_ + - __latestOutgoingUserToUserPayment__: _number_ + - __max_size__: _number_ -### NewInvoiceResponse - - __invoice__: _string_ +### GetUserOperationsResponse + - __latestOutgoingInvoiceOperations__: _[UserOperations](#UserOperations)_ + - __latestIncomingInvoiceOperations__: _[UserOperations](#UserOperations)_ + - __latestOutgoingTxOperations__: _[UserOperations](#UserOperations)_ + - __latestIncomingTxOperations__: _[UserOperations](#UserOperations)_ + - __latestOutgoingUserToUserPayemnts__: _[UserOperations](#UserOperations)_ + - __latestIncomingUserToUserPayemnts__: _[UserOperations](#UserOperations)_ -### PayAddressRequest - - __address__: _string_ - - __amoutSats__: _number_ - - __satsPerVByte__: _number_ +### ClosureMigration + - __closes_at_unix__: _number_ -### GetProductBuyLinkResponse - - __link__: _string_ - -### OpenChannel - - __channel_id__: _string_ - - __capacity__: _number_ - - __active__: _boolean_ - - __lifetime__: _number_ - - __local_balance__: _number_ - - __remote_balance__: _number_ +### AuthAppRequest + - __name__: _string_ + - __allow_user_creation__: _boolean_ *this field is optional ### Application - __name__: _string_ @@ -516,17 +524,18 @@ The nostr server will send back a message response, and inside the body there wi - __balance__: _number_ - __npub__: _string_ -### AuthApp - - __app__: _[Application](#Application)_ - - __auth_token__: _string_ +### AddAppInvoiceRequest + - __payer_identifier__: _string_ + - __http_callback_url__: _string_ + - __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_ -### PayAppUserInvoiceRequest +### GetAppUserLNURLInfoRequest - __user_identifier__: _string_ - - __invoice__: _string_ - - __amount__: _number_ + - __base_url_override__: _string_ -### OpenChannelResponse - - __channelId__: _string_ +### LnurlLinkResponse + - __lnurl__: _string_ + - __k1__: _string_ ### LnurlWithdrawInfoResponse - __tag__: _string_ @@ -538,44 +547,73 @@ The nostr server will send back a message response, and inside the body there wi - __balanceCheck__: _string_ - __payLink__: _string_ -### MigrationUpdate - - __closure__: _[ClosureMigration](#ClosureMigration)_ *this field is optional - - __relays__: _[RelaysMigration](#RelaysMigration)_ *this field is optional - -### BannedAppUser - - __app_name__: _string_ - - __app_id__: _string_ - - __user_identifier__: _string_ - - __nostr_pub__: _string_ - -### AuthAppRequest - - __name__: _string_ - - __allow_user_creation__: _boolean_ *this field is optional - -### SendAppUserToAppUserPaymentRequest - - __from_user_identifier__: _string_ - - __to_user_identifier__: _string_ +### UserOperation + - __paidAtUnix__: _number_ + - __type__: _[UserOperationType](#UserOperationType)_ + - __inbound__: _boolean_ - __amount__: _number_ + - __identifier__: _string_ + - __operationId__: _string_ + - __service_fee__: _number_ + - __network_fee__: _number_ + - __confirmed__: _boolean_ + - __tx_hash__: _string_ + - __internal__: _boolean_ -### NewAddressResponse - - __address__: _string_ +### RelaysMigration + - __relays__: ARRAY of: _string_ -### SetMockAppUserBalanceRequest +### RequestNPubLinkingTokenRequest - __user_identifier__: _string_ + +### EncryptionExchangeRequest + - __publicKey__: _string_ + - __deviceId__: _string_ + +### AppsMetricsRequest + - __from_unix__: _number_ *this field is optional + - __to_unix__: _number_ *this field is optional + - __include_operations__: _boolean_ *this field is optional + +### ClosedChannel + - __channel_id__: _string_ + - __capacity__: _number_ + - __closed_height__: _number_ + +### OpenChannelResponse + - __channelId__: _string_ + +### Product + - __id__: _string_ + - __name__: _string_ + - __price_sats__: _number_ + +### PayAppUserInvoiceRequest + - __user_identifier__: _string_ + - __invoice__: _string_ - __amount__: _number_ ### NewInvoiceRequest - __amountSats__: _number_ - __memo__: _string_ -### HandleLnurlPayResponse - - __pr__: _string_ - - __routes__: ARRAY of: _[Empty](#Empty)_ +### LiveUserOperation + - __operation__: _[UserOperation](#UserOperation)_ -### ClosureMigration - - __closes_at_unix__: _number_ +### HttpCreds + - __url__: _string_ + - __token__: _string_ -### Empty +### UsageMetric + - __processed_at_ms__: _number_ + - __parsed_in_nano__: _number_ + - __auth_in_nano__: _number_ + - __validate_in_nano__: _number_ + - __handle_in_nano__: _number_ + - __rpc_name__: _string_ + - __batch__: _boolean_ + - __nostr__: _boolean_ + - __batch_size__: _number_ ### RoutingEvent - __incoming_channel_id__: _number_ @@ -591,70 +629,20 @@ The nostr server will send back a message response, and inside the body there wi - __offchain__: _boolean_ - __forward_fail_event__: _boolean_ -### ChannelRouting +### ChannelBalanceEvent + - __block_height__: _number_ - __channel_id__: _string_ - - __send_errors__: _number_ - - __receive_errors__: _number_ - - __forward_errors_as_input__: _number_ - - __forward_errors_as_output__: _number_ - - __missed_forward_fee_as_input__: _number_ - - __missed_forward_fee_as_output__: _number_ - - __forward_fee_as_input__: _number_ - - __forward_fee_as_output__: _number_ - - __events_number__: _number_ + - __local_balance_sats__: _number_ + - __remote_balance_sats__: _number_ -### BanUserResponse - - __balance_sats__: _number_ - - __banned_app_users__: ARRAY of: _[BannedAppUser](#BannedAppUser)_ +### HandleLnurlPayResponse + - __pr__: _string_ + - __routes__: ARRAY of: _[Empty](#Empty)_ -### UsageMetric - - __processed_at_ms__: _number_ - - __parsed_in_nano__: _number_ - - __auth_in_nano__: _number_ - - __validate_in_nano__: _number_ - - __handle_in_nano__: _number_ - - __rpc_name__: _string_ - - __batch__: _boolean_ - - __nostr__: _boolean_ - - __batch_size__: _number_ - -### UsersInfo - - __total__: _number_ - - __no_balance__: _number_ - - __negative_balance__: _number_ - - __always_been_inactive__: _number_ - - __balance_avg__: _number_ - - __balance_median__: _number_ - -### PayInvoiceResponse - - __preimage__: _string_ - - __amount_paid__: _number_ - - __operation_id__: _string_ - - __service_fee__: _number_ - - __network_fee__: _number_ - -### AddAppUserRequest - - __identifier__: _string_ - - __fail_if_exists__: _boolean_ - - __balance__: _number_ - -### GetAppUserLNURLInfoRequest - - __user_identifier__: _string_ - - __base_url_override__: _string_ - -### UserInfo - - __userId__: _string_ - - __balance__: _number_ - - __max_withdrawable__: _number_ - - __user_identifier__: _string_ - -### AppUser - - __identifier__: _string_ - - __info__: _[UserInfo](#UserInfo)_ - - __max_withdrawable__: _number_ - -### NewAddressRequest - - __addressType__: _[AddressType](#AddressType)_ +### UserOperations + - __fromIndex__: _number_ + - __toIndex__: _number_ + - __operations__: ARRAY of: _[UserOperation](#UserOperation)_ ### ChainBalanceEvent - __block_height__: _number_ @@ -662,21 +650,6 @@ The nostr server will send back a message response, and inside the body there wi - __unconfirmed_balance__: _number_ - __total_balance__: _number_ -### SetMockAppBalanceRequest - - __amount__: _number_ - -### GetUserOperationsResponse - - __latestOutgoingInvoiceOperations__: _[UserOperations](#UserOperations)_ - - __latestIncomingInvoiceOperations__: _[UserOperations](#UserOperations)_ - - __latestOutgoingTxOperations__: _[UserOperations](#UserOperations)_ - - __latestIncomingTxOperations__: _[UserOperations](#UserOperations)_ - - __latestOutgoingUserToUserPayemnts__: _[UserOperations](#UserOperations)_ - - __latestIncomingUserToUserPayemnts__: _[UserOperations](#UserOperations)_ - -### AddProductRequest - - __name__: _string_ - - __price_sats__: _number_ - ### LndNodeMetrics - __channels_balance_events__: ARRAY of: _[ChannelBalanceEvent](#ChannelBalanceEvent)_ - __chain_balance_events__: ARRAY of: _[ChainBalanceEvent](#ChainBalanceEvent)_ @@ -688,90 +661,109 @@ The nostr server will send back a message response, and inside the body there wi - __closed_channels__: ARRAY of: _[ClosedChannel](#ClosedChannel)_ - __channel_routing__: ARRAY of: _[ChannelRouting](#ChannelRouting)_ -### SendAppUserToAppPaymentRequest - - __from_user_identifier__: _string_ +### SetMockInvoiceAsPaidRequest + - __invoice__: _string_ - __amount__: _number_ -### DecodeInvoiceResponse - - __amount__: _number_ - -### OpenChannelRequest - - __destination__: _string_ - - __fundingAmount__: _number_ - - __pushAmount__: _number_ - - __closeAddress__: _string_ - -### LndGetInfoResponse - - __alias__: _string_ - -### AddAppRequest - - __name__: _string_ - - __allow_user_creation__: _boolean_ - ### AddAppUserInvoiceRequest - __receiver_identifier__: _string_ - __payer_identifier__: _string_ - __http_callback_url__: _string_ - __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_ -### LndMetrics - - __nodes__: ARRAY of: _[LndNodeMetrics](#LndNodeMetrics)_ - -### LndGetInfoRequest - - __nodeId__: _number_ - -### DecodeInvoiceRequest - - __invoice__: _string_ - -### UserOperations - - __fromIndex__: _number_ - - __toIndex__: _number_ - - __operations__: ARRAY of: _[UserOperation](#UserOperation)_ - -### Product - - __id__: _string_ - - __name__: _string_ - - __price_sats__: _number_ - -### RelaysMigration - - __relays__: ARRAY of: _string_ - -### LiveUserOperation - - __operation__: _[UserOperation](#UserOperation)_ - -### RequestNPubLinkingTokenResponse - - __token__: _string_ +### OpenChannelRequest + - __destination__: _string_ + - __fundingAmount__: _number_ + - __pushAmount__: _number_ + - __closeAddress__: _string_ ### UsageMetrics - __metrics__: ARRAY of: _[UsageMetric](#UsageMetric)_ -### AppsMetrics - - __apps__: ARRAY of: _[AppMetrics](#AppMetrics)_ - -### ClosedChannel +### OpenChannel - __channel_id__: _string_ - __capacity__: _number_ - - __closed_height__: _number_ + - __active__: _boolean_ + - __lifetime__: _number_ + - __local_balance__: _number_ + - __remote_balance__: _number_ -### UserOperation - - __paidAtUnix__: _number_ - - __type__: _[UserOperationType](#UserOperationType)_ - - __inbound__: _boolean_ +### NewAddressRequest + - __addressType__: _[AddressType](#AddressType)_ + +### LnurlPayInfoResponse + - __tag__: _string_ + - __callback__: _string_ + - __maxSendable__: _number_ + - __minSendable__: _number_ + - __metadata__: _string_ + - __allowsNostr__: _boolean_ + - __nostrPubkey__: _string_ + +### GetProductBuyLinkResponse + - __link__: _string_ + +### UsersInfo + - __total__: _number_ + - __no_balance__: _number_ + - __negative_balance__: _number_ + - __always_been_inactive__: _number_ + - __balance_avg__: _number_ + - __balance_median__: _number_ + +### AddAppRequest + - __name__: _string_ + - __allow_user_creation__: _boolean_ + +### DecodeInvoiceResponse - __amount__: _number_ - - __identifier__: _string_ - - __operationId__: _string_ + +### LndMetrics + - __nodes__: ARRAY of: _[LndNodeMetrics](#LndNodeMetrics)_ + +### AddProductRequest + - __name__: _string_ + - __price_sats__: _number_ + +### Empty + +### ChannelRouting + - __channel_id__: _string_ + - __send_errors__: _number_ + - __receive_errors__: _number_ + - __forward_errors_as_input__: _number_ + - __forward_errors_as_output__: _number_ + - __missed_forward_fee_as_input__: _number_ + - __missed_forward_fee_as_output__: _number_ + - __forward_fee_as_input__: _number_ + - __forward_fee_as_output__: _number_ + - __events_number__: _number_ + +### PayInvoiceResponse + - __preimage__: _string_ + - __amount_paid__: _number_ + - __operation_id__: _string_ - __service_fee__: _number_ - __network_fee__: _number_ - - __confirmed__: _boolean_ - - __tx_hash__: _string_ - - __internal__: _boolean_ -### SetMockInvoiceAsPaidRequest - - __invoice__: _string_ - - __amount__: _number_ +### UserInfo + - __userId__: _string_ + - __balance__: _number_ + - __max_withdrawable__: _number_ + - __user_identifier__: _string_ -### BanUserRequest - - __user_id__: _string_ +### MigrationUpdate + - __closure__: _[ClosureMigration](#ClosureMigration)_ *this field is optional + - __relays__: _[RelaysMigration](#RelaysMigration)_ *this field is optional + +### LinkNPubThroughTokenRequest + - __token__: _string_ + - __nostr_pub__: _string_ + +### PayAddressRequest + - __address__: _string_ + - __amoutSats__: _number_ + - __satsPerVByte__: _number_ ### PayAddressResponse - __txId__: _string_ @@ -779,24 +771,6 @@ The nostr server will send back a message response, and inside the body there wi - __service_fee__: _number_ - __network_fee__: _number_ -### GetUserOperationsRequest - - __latestIncomingInvoice__: _number_ - - __latestOutgoingInvoice__: _number_ - - __latestIncomingTx__: _number_ - - __latestOutgoingTx__: _number_ - - __latestIncomingUserToUserPayment__: _number_ - - __latestOutgoingUserToUserPayment__: _number_ - - __max_size__: _number_ - -### EncryptionExchangeRequest - - __publicKey__: _string_ - - __deviceId__: _string_ - -### AppsMetricsRequest - - __from_unix__: _number_ *this field is optional - - __to_unix__: _number_ *this field is optional - - __include_operations__: _boolean_ *this field is optional - ### AppMetrics - __app__: _[Application](#Application)_ - __users__: _[UsersInfo](#UsersInfo)_ @@ -808,26 +782,68 @@ The nostr server will send back a message response, and inside the body there wi - __total_fees__: _number_ - __operations__: ARRAY of: _[UserOperation](#UserOperation)_ -### ChannelBalanceEvent - - __block_height__: _number_ - - __channel_id__: _string_ - - __local_balance_sats__: _number_ - - __remote_balance_sats__: _number_ +### BanUserResponse + - __balance_sats__: _number_ + - __banned_app_users__: ARRAY of: _[BannedAppUser](#BannedAppUser)_ -### RequestNPubLinkingTokenRequest - - __user_identifier__: _string_ +### AuthApp + - __app__: _[Application](#Application)_ + - __auth_token__: _string_ ### LndMetricsRequest - __from_unix__: _number_ *this field is optional - __to_unix__: _number_ *this field is optional +### BannedAppUser + - __app_name__: _string_ + - __app_id__: _string_ + - __user_identifier__: _string_ + - __nostr_pub__: _string_ + +### GetAppUserRequest + - __user_identifier__: _string_ + +### SetMockAppBalanceRequest + - __amount__: _number_ + +### DecodeInvoiceRequest + - __invoice__: _string_ + +### RequestNPubLinkingTokenResponse + - __token__: _string_ + +### LndGetInfoRequest + - __nodeId__: _number_ + +### AppUser + - __identifier__: _string_ + - __info__: _[UserInfo](#UserInfo)_ + - __max_withdrawable__: _number_ + +### SetMockAppUserBalanceRequest + - __user_identifier__: _string_ + - __amount__: _number_ + ### PayInvoiceRequest - __invoice__: _string_ - __amount__: _number_ -### LnurlLinkResponse - - __lnurl__: _string_ - - __k1__: _string_ +### AddAppUserRequest + - __identifier__: _string_ + - __fail_if_exists__: _boolean_ + - __balance__: _number_ + +### NewInvoiceResponse + - __invoice__: _string_ + +### AppsMetrics + - __apps__: ARRAY of: _[AppMetrics](#AppMetrics)_ + +### LndGetInfoResponse + - __alias__: _string_ + +### NewAddressResponse + - __address__: _string_ ## Enums ### The enumerators used in the messages diff --git a/proto/autogenerated/debug.txt b/proto/autogenerated/debug.txt index 371a6229..2881b623 100644 --- a/proto/autogenerated/debug.txt +++ b/proto/autogenerated/debug.txt @@ -1,5 +1,5 @@ -([]*main.Method) (len=45 cap=64) { - (*main.Method)(0xc0002926e0)({ +([]*main.Method) (len=46 cap=64) { + (*main.Method)(0xc00007a1e0)({ in: (main.MethodMessage) { name: (string) (len=17) "LndGetInfoRequest", hasZeroFields: (bool) false @@ -9,8 +9,8 @@ name: (string) (len=18) "LndGetInfoResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc00007cc60)({ - authType: (*main.supportedAuth)(0xc0001d03c0)({ + opts: (*main.methodOptions)(0xc000071560)({ + authType: (*main.supportedAuth)(0xc0004ff020)({ id: (string) (len=5) "admin", name: (string) (len=5) "Admin", context: (map[string]string) (len=1) { @@ -28,7 +28,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000292870)({ + (*main.Method)(0xc00007a280)({ in: (main.MethodMessage) { name: (string) (len=13) "AddAppRequest", hasZeroFields: (bool) false @@ -38,8 +38,8 @@ name: (string) (len=7) "AuthApp", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc00007cde0)({ - authType: (*main.supportedAuth)(0xc0001d0450)({ + opts: (*main.methodOptions)(0xc0000716e0)({ + authType: (*main.supportedAuth)(0xc0004ff0b0)({ id: (string) (len=5) "admin", name: (string) (len=5) "Admin", context: (map[string]string) (len=1) { @@ -57,7 +57,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000292910)({ + (*main.Method)(0xc00007a320)({ in: (main.MethodMessage) { name: (string) (len=14) "AuthAppRequest", hasZeroFields: (bool) false @@ -67,8 +67,8 @@ name: (string) (len=7) "AuthApp", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc00007cf60)({ - authType: (*main.supportedAuth)(0xc0001d04e0)({ + opts: (*main.methodOptions)(0xc000071860)({ + authType: (*main.supportedAuth)(0xc0004ff140)({ id: (string) (len=5) "admin", name: (string) (len=5) "Admin", context: (map[string]string) (len=1) { @@ -86,7 +86,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002929b0)({ + (*main.Method)(0xc00007a3c0)({ in: (main.MethodMessage) { name: (string) (len=14) "BanUserRequest", hasZeroFields: (bool) false @@ -96,8 +96,8 @@ name: (string) (len=15) "BanUserResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc00007d0e0)({ - authType: (*main.supportedAuth)(0xc0001d0570)({ + opts: (*main.methodOptions)(0xc0000719e0)({ + authType: (*main.supportedAuth)(0xc0004ff1d0)({ id: (string) (len=5) "admin", name: (string) (len=5) "Admin", context: (map[string]string) (len=1) { @@ -115,7 +115,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000292a00)({ + (*main.Method)(0xc00007a410)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -125,8 +125,8 @@ name: (string) (len=12) "UsageMetrics", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc00007d260)({ - authType: (*main.supportedAuth)(0xc0001d0600)({ + opts: (*main.methodOptions)(0xc000071b60)({ + authType: (*main.supportedAuth)(0xc0004ff260)({ id: (string) (len=7) "metrics", name: (string) (len=7) "Metrics", context: (map[string]string) (len=1) { @@ -144,7 +144,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000292a50)({ + (*main.Method)(0xc00007a460)({ in: (main.MethodMessage) { name: (string) (len=18) "AppsMetricsRequest", hasZeroFields: (bool) false @@ -154,8 +154,8 @@ name: (string) (len=11) "AppsMetrics", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc00007d3e0)({ - authType: (*main.supportedAuth)(0xc0001d0690)({ + opts: (*main.methodOptions)(0xc000071ce0)({ + authType: (*main.supportedAuth)(0xc0004ff2f0)({ id: (string) (len=7) "metrics", name: (string) (len=7) "Metrics", context: (map[string]string) (len=1) { @@ -173,7 +173,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000292aa0)({ + (*main.Method)(0xc00007a4b0)({ in: (main.MethodMessage) { name: (string) (len=17) "LndMetricsRequest", hasZeroFields: (bool) false @@ -183,8 +183,8 @@ name: (string) (len=10) "LndMetrics", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc00007d560)({ - authType: (*main.supportedAuth)(0xc0001d0720)({ + opts: (*main.methodOptions)(0xc000071e60)({ + authType: (*main.supportedAuth)(0xc0004ff380)({ id: (string) (len=7) "metrics", name: (string) (len=7) "Metrics", context: (map[string]string) (len=1) { @@ -202,7 +202,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000292af0)({ + (*main.Method)(0xc00007a500)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -212,8 +212,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc00007d6e0)({ - authType: (*main.supportedAuth)(0xc0001d07b0)({ + opts: (*main.methodOptions)(0xc000351800)({ + authType: (*main.supportedAuth)(0xc0004ff410)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", context: (map[string]string) { @@ -230,7 +230,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000292b40)({ + (*main.Method)(0xc00007a550)({ in: (main.MethodMessage) { name: (string) (len=25) "EncryptionExchangeRequest", hasZeroFields: (bool) false @@ -240,8 +240,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc00007d860)({ - authType: (*main.supportedAuth)(0xc0001d0870)({ + opts: (*main.methodOptions)(0xc000351980)({ + authType: (*main.supportedAuth)(0xc0004ff4d0)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", context: (map[string]string) { @@ -258,7 +258,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000292b90)({ + (*main.Method)(0xc00007a5a0)({ in: (main.MethodMessage) { name: (string) (len=27) "SetMockInvoiceAsPaidRequest", hasZeroFields: (bool) false @@ -268,8 +268,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc00007da40)({ - authType: (*main.supportedAuth)(0xc0001d0900)({ + opts: (*main.methodOptions)(0xc000351b60)({ + authType: (*main.supportedAuth)(0xc0004ff560)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", context: (map[string]string) { @@ -286,7 +286,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000292c30)({ + (*main.Method)(0xc00007a640)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -296,8 +296,8 @@ name: (string) (len=25) "LnurlWithdrawInfoResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc00007dda0)({ - authType: (*main.supportedAuth)(0xc0001d0a50)({ + opts: (*main.methodOptions)(0xc000351ec0)({ + authType: (*main.supportedAuth)(0xc0004ff6b0)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", context: (map[string]string) { @@ -316,7 +316,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000292cd0)({ + (*main.Method)(0xc00007a6e0)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -326,8 +326,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0000b05a0)({ - authType: (*main.supportedAuth)(0xc0001d0ba0)({ + opts: (*main.methodOptions)(0xc0000a4720)({ + authType: (*main.supportedAuth)(0xc0004ff800)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", context: (map[string]string) { @@ -347,7 +347,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000292d70)({ + (*main.Method)(0xc00007a780)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -357,8 +357,8 @@ name: (string) (len=20) "LnurlPayInfoResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0000b0960)({ - authType: (*main.supportedAuth)(0xc0001d0cc0)({ + opts: (*main.methodOptions)(0xc0000a4a80)({ + authType: (*main.supportedAuth)(0xc0004ff920)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", context: (map[string]string) { @@ -377,7 +377,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000292e10)({ + (*main.Method)(0xc00007a820)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -387,8 +387,8 @@ name: (string) (len=22) "HandleLnurlPayResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0000b0d20)({ - authType: (*main.supportedAuth)(0xc0001d0e10)({ + opts: (*main.methodOptions)(0xc0000a4e40)({ + authType: (*main.supportedAuth)(0xc0004ffa70)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", context: (map[string]string) { @@ -410,7 +410,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000292e60)({ + (*main.Method)(0xc00007a870)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -420,8 +420,8 @@ name: (string) (len=20) "LnurlPayInfoResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0000b0ea0)({ - authType: (*main.supportedAuth)(0xc0001d0ea0)({ + opts: (*main.methodOptions)(0xc0000a5080)({ + authType: (*main.supportedAuth)(0xc0004ffb00)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", context: (map[string]string) { @@ -440,7 +440,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000292f00)({ + (*main.Method)(0xc00007a910)({ in: (main.MethodMessage) { name: (string) (len=27) "LinkNPubThroughTokenRequest", hasZeroFields: (bool) false @@ -450,14 +450,14 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0000b1140)({ - authType: (*main.supportedAuth)(0xc0001d0f60)({ + opts: (*main.methodOptions)(0xc0000a5260)({ + authType: (*main.supportedAuth)(0xc0004ffbc0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { - (string) (len=11) "app_user_id": (string) (len=6) "string", (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string" + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string" } }), method: (string) (len=4) "post", @@ -471,7 +471,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000292f50)({ + (*main.Method)(0xc00007a960)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -481,8 +481,8 @@ name: (string) (len=11) "Application", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0000b12c0)({ - authType: (*main.supportedAuth)(0xc0001d0ff0)({ + opts: (*main.methodOptions)(0xc0000a5440)({ + authType: (*main.supportedAuth)(0xc0004ffc50)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -500,7 +500,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000292ff0)({ + (*main.Method)(0xc00007aa00)({ in: (main.MethodMessage) { name: (string) (len=17) "AddAppUserRequest", hasZeroFields: (bool) false @@ -510,8 +510,8 @@ name: (string) (len=7) "AppUser", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0000b14a0)({ - authType: (*main.supportedAuth)(0xc0001d1080)({ + opts: (*main.methodOptions)(0xc00008a0c0)({ + authType: (*main.supportedAuth)(0xc0004ffce0)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -529,7 +529,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000293090)({ + (*main.Method)(0xc00007aaa0)({ in: (main.MethodMessage) { name: (string) (len=20) "AddAppInvoiceRequest", hasZeroFields: (bool) false @@ -539,8 +539,8 @@ name: (string) (len=18) "NewInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0001d4120)({ - authType: (*main.supportedAuth)(0xc0001d1110)({ + opts: (*main.methodOptions)(0xc00008a240)({ + authType: (*main.supportedAuth)(0xc0004ffd70)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -558,7 +558,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002930e0)({ + (*main.Method)(0xc00007aaf0)({ in: (main.MethodMessage) { name: (string) (len=24) "AddAppUserInvoiceRequest", hasZeroFields: (bool) false @@ -568,8 +568,8 @@ name: (string) (len=18) "NewInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0001d4300)({ - authType: (*main.supportedAuth)(0xc0001d11a0)({ + opts: (*main.methodOptions)(0xc00008a420)({ + authType: (*main.supportedAuth)(0xc0004ffe00)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -587,7 +587,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000293180)({ + (*main.Method)(0xc00007ab90)({ in: (main.MethodMessage) { name: (string) (len=17) "GetAppUserRequest", hasZeroFields: (bool) false @@ -597,8 +597,8 @@ name: (string) (len=7) "AppUser", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0001d4480)({ - authType: (*main.supportedAuth)(0xc0001d1230)({ + opts: (*main.methodOptions)(0xc00008a5a0)({ + authType: (*main.supportedAuth)(0xc0004ffe90)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -616,7 +616,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000293220)({ + (*main.Method)(0xc00007ac30)({ in: (main.MethodMessage) { name: (string) (len=24) "PayAppUserInvoiceRequest", hasZeroFields: (bool) false @@ -626,8 +626,8 @@ name: (string) (len=18) "PayInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0001d4600)({ - authType: (*main.supportedAuth)(0xc0001d12c0)({ + opts: (*main.methodOptions)(0xc00008a720)({ + authType: (*main.supportedAuth)(0xc0004fff20)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -645,7 +645,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000293270)({ + (*main.Method)(0xc00007ac80)({ in: (main.MethodMessage) { name: (string) (len=34) "SendAppUserToAppUserPaymentRequest", hasZeroFields: (bool) false @@ -655,8 +655,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0001d47e0)({ - authType: (*main.supportedAuth)(0xc0001d1350)({ + opts: (*main.methodOptions)(0xc00008a900)({ + authType: (*main.supportedAuth)(0xc0004fffb0)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -674,7 +674,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000293310)({ + (*main.Method)(0xc00007ad20)({ in: (main.MethodMessage) { name: (string) (len=30) "SendAppUserToAppPaymentRequest", hasZeroFields: (bool) false @@ -684,8 +684,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0001d4960)({ - authType: (*main.supportedAuth)(0xc0001d13e0)({ + opts: (*main.methodOptions)(0xc00008aa80)({ + authType: (*main.supportedAuth)(0xc000090060)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -703,7 +703,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000293360)({ + (*main.Method)(0xc00007ad70)({ in: (main.MethodMessage) { name: (string) (len=26) "GetAppUserLNURLInfoRequest", hasZeroFields: (bool) false @@ -713,8 +713,8 @@ name: (string) (len=20) "LnurlPayInfoResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0001d4ae0)({ - authType: (*main.supportedAuth)(0xc0001d1470)({ + opts: (*main.methodOptions)(0xc00008ac00)({ + authType: (*main.supportedAuth)(0xc0000900f0)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -732,7 +732,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002933b0)({ + (*main.Method)(0xc00007adc0)({ in: (main.MethodMessage) { name: (string) (len=28) "SetMockAppUserBalanceRequest", hasZeroFields: (bool) false @@ -742,8 +742,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0001d4c60)({ - authType: (*main.supportedAuth)(0xc0001d1500)({ + opts: (*main.methodOptions)(0xc00008ad80)({ + authType: (*main.supportedAuth)(0xc000090180)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -761,7 +761,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000293400)({ + (*main.Method)(0xc00007ae10)({ in: (main.MethodMessage) { name: (string) (len=24) "SetMockAppBalanceRequest", hasZeroFields: (bool) false @@ -771,8 +771,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0001d4e40)({ - authType: (*main.supportedAuth)(0xc0001d1590)({ + opts: (*main.methodOptions)(0xc00008af60)({ + authType: (*main.supportedAuth)(0xc000090210)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -790,7 +790,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000293450)({ + (*main.Method)(0xc00007ae60)({ in: (main.MethodMessage) { name: (string) (len=30) "RequestNPubLinkingTokenRequest", hasZeroFields: (bool) false @@ -800,8 +800,8 @@ name: (string) (len=31) "RequestNPubLinkingTokenResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0001d5020)({ - authType: (*main.supportedAuth)(0xc0001d1620)({ + opts: (*main.methodOptions)(0xc00008b140)({ + authType: (*main.supportedAuth)(0xc0000902a0)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -819,7 +819,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002934a0)({ + (*main.Method)(0xc00007aeb0)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -829,8 +829,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0001d5200)({ - authType: (*main.supportedAuth)(0xc0001d16b0)({ + opts: (*main.methodOptions)(0xc00008b320)({ + authType: (*main.supportedAuth)(0xc000090330)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { @@ -850,7 +850,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002934f0)({ + (*main.Method)(0xc00007af00)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -860,8 +860,8 @@ name: (string) (len=8) "UserInfo", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0001d53e0)({ - authType: (*main.supportedAuth)(0xc0001d1740)({ + opts: (*main.methodOptions)(0xc00008b500)({ + authType: (*main.supportedAuth)(0xc0000903c0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { @@ -881,7 +881,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000293590)({ + (*main.Method)(0xc00007afa0)({ in: (main.MethodMessage) { name: (string) (len=17) "AddProductRequest", hasZeroFields: (bool) false @@ -891,14 +891,14 @@ name: (string) (len=7) "Product", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0001d55c0)({ - authType: (*main.supportedAuth)(0xc0001d17d0)({ + opts: (*main.methodOptions)(0xc00008b6e0)({ + authType: (*main.supportedAuth)(0xc000090450)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { - (string) (len=7) "user_id": (string) (len=6) "string", (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" + (string) (len=11) "app_user_id": (string) (len=6) "string", + (string) (len=7) "user_id": (string) (len=6) "string" } }), method: (string) (len=4) "post", @@ -912,7 +912,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002935e0)({ + (*main.Method)(0xc00007aff0)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -922,14 +922,14 @@ name: (string) (len=18) "NewInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0001d5a40)({ - authType: (*main.supportedAuth)(0xc0001d18f0)({ + opts: (*main.methodOptions)(0xc00008bb60)({ + authType: (*main.supportedAuth)(0xc000090570)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { + (string) (len=11) "app_user_id": (string) (len=6) "string", (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" + (string) (len=6) "app_id": (string) (len=6) "string" } }), method: (string) (len=3) "get", @@ -945,7 +945,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000293630)({ + (*main.Method)(0xc00007b040)({ in: (main.MethodMessage) { name: (string) (len=24) "GetUserOperationsRequest", hasZeroFields: (bool) false @@ -955,14 +955,14 @@ name: (string) (len=25) "GetUserOperationsResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0001d5c20)({ - authType: (*main.supportedAuth)(0xc0001d1980)({ + opts: (*main.methodOptions)(0xc00008bd40)({ + authType: (*main.supportedAuth)(0xc000090600)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { + (string) (len=7) "user_id": (string) (len=6) "string", (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string", - (string) (len=7) "user_id": (string) (len=6) "string" + (string) (len=11) "app_user_id": (string) (len=6) "string" } }), method: (string) (len=4) "post", @@ -976,7 +976,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002936d0)({ + (*main.Method)(0xc00007b0e0)({ in: (main.MethodMessage) { name: (string) (len=17) "NewAddressRequest", hasZeroFields: (bool) false @@ -986,8 +986,8 @@ name: (string) (len=18) "NewAddressResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0001d5e00)({ - authType: (*main.supportedAuth)(0xc0001d1a10)({ + opts: (*main.methodOptions)(0xc00008bf20)({ + authType: (*main.supportedAuth)(0xc000090690)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { @@ -1007,7 +1007,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000293770)({ + (*main.Method)(0xc00007b180)({ in: (main.MethodMessage) { name: (string) (len=17) "PayAddressRequest", hasZeroFields: (bool) false @@ -1017,8 +1017,8 @@ name: (string) (len=18) "PayAddressResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0001e0000)({ - authType: (*main.supportedAuth)(0xc0001d1aa0)({ + opts: (*main.methodOptions)(0xc00013a120)({ + authType: (*main.supportedAuth)(0xc000090720)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { @@ -1038,7 +1038,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000293810)({ + (*main.Method)(0xc00007b220)({ in: (main.MethodMessage) { name: (string) (len=17) "NewInvoiceRequest", hasZeroFields: (bool) false @@ -1048,14 +1048,14 @@ name: (string) (len=18) "NewInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0001e01e0)({ - authType: (*main.supportedAuth)(0xc0001d1b30)({ + opts: (*main.methodOptions)(0xc00013a300)({ + authType: (*main.supportedAuth)(0xc0000907b0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { + (string) (len=7) "user_id": (string) (len=6) "string", (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string", - (string) (len=7) "user_id": (string) (len=6) "string" + (string) (len=11) "app_user_id": (string) (len=6) "string" } }), method: (string) (len=4) "post", @@ -1069,7 +1069,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002938b0)({ + (*main.Method)(0xc00007b2c0)({ in: (main.MethodMessage) { name: (string) (len=20) "DecodeInvoiceRequest", hasZeroFields: (bool) false @@ -1079,14 +1079,14 @@ name: (string) (len=21) "DecodeInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0001e03c0)({ - authType: (*main.supportedAuth)(0xc0001d1bc0)({ + opts: (*main.methodOptions)(0xc00013a4e0)({ + authType: (*main.supportedAuth)(0xc000090840)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { + (string) (len=11) "app_user_id": (string) (len=6) "string", (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" + (string) (len=6) "app_id": (string) (len=6) "string" } }), method: (string) (len=4) "post", @@ -1100,7 +1100,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000293950)({ + (*main.Method)(0xc00007b360)({ in: (main.MethodMessage) { name: (string) (len=17) "PayInvoiceRequest", hasZeroFields: (bool) false @@ -1110,8 +1110,8 @@ name: (string) (len=18) "PayInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0001e05a0)({ - authType: (*main.supportedAuth)(0xc0001d1c50)({ + opts: (*main.methodOptions)(0xc00013a6c0)({ + authType: (*main.supportedAuth)(0xc0000908d0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { @@ -1131,7 +1131,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002939f0)({ + (*main.Method)(0xc00007b400)({ in: (main.MethodMessage) { name: (string) (len=18) "OpenChannelRequest", hasZeroFields: (bool) false @@ -1141,8 +1141,8 @@ name: (string) (len=19) "OpenChannelResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0001e0780)({ - authType: (*main.supportedAuth)(0xc0001d1ce0)({ + opts: (*main.methodOptions)(0xc00013a8a0)({ + authType: (*main.supportedAuth)(0xc000090960)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { @@ -1162,7 +1162,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000293a90)({ + (*main.Method)(0xc00007b4a0)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -1172,14 +1172,14 @@ name: (string) (len=17) "LnurlLinkResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0001e0960)({ - authType: (*main.supportedAuth)(0xc0001d1d70)({ + opts: (*main.methodOptions)(0xc00013aa80)({ + authType: (*main.supportedAuth)(0xc0000909f0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { + (string) (len=7) "user_id": (string) (len=6) "string", (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string", - (string) (len=7) "user_id": (string) (len=6) "string" + (string) (len=11) "app_user_id": (string) (len=6) "string" } }), method: (string) (len=3) "get", @@ -1193,7 +1193,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000293b30)({ + (*main.Method)(0xc00007b540)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -1203,14 +1203,14 @@ name: (string) (len=17) "LnurlLinkResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0001e0b40)({ - authType: (*main.supportedAuth)(0xc0001d1e00)({ + opts: (*main.methodOptions)(0xc00013ac60)({ + authType: (*main.supportedAuth)(0xc000090a80)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { - (string) (len=11) "app_user_id": (string) (len=6) "string", (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string" + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string" } }), method: (string) (len=3) "get", @@ -1224,7 +1224,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000293bd0)({ + (*main.Method)(0xc00007b5e0)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -1234,8 +1234,8 @@ name: (string) (len=17) "LnurlLinkResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0001e0d20)({ - authType: (*main.supportedAuth)(0xc0001d1e90)({ + opts: (*main.methodOptions)(0xc00013ae40)({ + authType: (*main.supportedAuth)(0xc000090b10)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { @@ -1255,7 +1255,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc000293c70)({ + (*main.Method)(0xc00007b680)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -1265,8 +1265,8 @@ name: (string) (len=17) "LiveUserOperation", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0001e0f00)({ - authType: (*main.supportedAuth)(0xc0001d1f20)({ + opts: (*main.methodOptions)(0xc00013b020)({ + authType: (*main.supportedAuth)(0xc000090ba0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { @@ -1286,7 +1286,7 @@ }), serverStream: (bool) true }), - (*main.Method)(0xc000293d10)({ + (*main.Method)(0xc00007b720)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -1296,14 +1296,14 @@ name: (string) (len=15) "MigrationUpdate", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0001e10e0)({ - authType: (*main.supportedAuth)(0xc0001d1fb0)({ + opts: (*main.methodOptions)(0xc00013b200)({ + authType: (*main.supportedAuth)(0xc000090c30)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { - (string) (len=11) "app_user_id": (string) (len=6) "string", (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string" + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string" } }), method: (string) (len=4) "post", @@ -1317,7 +1317,38 @@ }), serverStream: (bool) true }), - (*main.Method)(0xc000293d60)({ + (*main.Method)(0xc00007b770)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=12) "GetHttpCreds", + out: (main.MethodMessage) { + name: (string) (len=9) "HttpCreds", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00013b3e0)({ + authType: (*main.supportedAuth)(0xc000090cc0)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + context: (map[string]string) (len=3) { + (string) (len=7) "user_id": (string) (len=6) "string", + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=20) "/api/user/http_creds", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) true, + batch: (bool) false + }), + serverStream: (bool) true + }), + (*main.Method)(0xc00007b7c0)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -1327,14 +1358,14 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0001e1320)({ - authType: (*main.supportedAuth)(0xc0001e4090)({ + opts: (*main.methodOptions)(0xc00013b620)({ + authType: (*main.supportedAuth)(0xc000090d80)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { - (string) (len=11) "app_user_id": (string) (len=6) "string", (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string" + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string" } }), method: (string) (len=4) "post", @@ -1351,7 +1382,7 @@ } ([]*main.Enum) (len=2 cap=2) { - (*main.Enum)(0xc0001c1a70)({ + (*main.Enum)(0xc0004fe6f0)({ name: (string) (len=11) "AddressType", values: ([]main.EnumValue) (len=3 cap=4) { (main.EnumValue) { @@ -1368,7 +1399,7 @@ } } }), - (*main.Enum)(0xc0001c1ad0)({ + (*main.Enum)(0xc0004fe750)({ name: (string) (len=17) "UserOperationType", values: ([]main.EnumValue) (len=6 cap=8) { (main.EnumValue) { @@ -1399,873 +1430,12 @@ }) } -(map[string]*main.Message) (len=69) { - (string) (len=11) "UsageMetric": (*main.Message)(0xc0000385c0)({ - fullName: (string) (len=11) "UsageMetric", - name: (string) (len=11) "UsageMetric", - fields: ([]*main.Field) (len=9 cap=16) { - (*main.Field)(0xc0000a1260)({ - name: (string) (len=15) "processed_at_ms", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a1290)({ - name: (string) (len=14) "parsed_in_nano", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a12c0)({ - name: (string) (len=12) "auth_in_nano", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a12f0)({ - name: (string) (len=16) "validate_in_nano", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a1320)({ - name: (string) (len=14) "handle_in_nano", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a1350)({ - name: (string) (len=8) "rpc_name", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a1380)({ - name: (string) (len=5) "batch", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a13b0)({ - name: (string) (len=5) "nostr", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a13e0)({ - name: (string) (len=10) "batch_size", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=9) "UsersInfo": (*main.Message)(0xc0000386c0)({ - fullName: (string) (len=9) "UsersInfo", - name: (string) (len=9) "UsersInfo", - fields: ([]*main.Field) (len=6 cap=8) { - (*main.Field)(0xc0000a14d0)({ - name: (string) (len=5) "total", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a1500)({ - name: (string) (len=10) "no_balance", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a1530)({ - name: (string) (len=16) "negative_balance", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a1560)({ - name: (string) (len=20) "always_been_inactive", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a1590)({ - name: (string) (len=11) "balance_avg", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a15c0)({ - name: (string) (len=14) "balance_median", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=18) "PayInvoiceResponse": (*main.Message)(0xc0000392c0)({ - fullName: (string) (len=18) "PayInvoiceResponse", - name: (string) (len=18) "PayInvoiceResponse", - fields: ([]*main.Field) (len=5 cap=8) { - (*main.Field)(0xc0001c0c30)({ - name: (string) (len=8) "preimage", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0c60)({ - name: (string) (len=11) "amount_paid", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0c90)({ - name: (string) (len=12) "operation_id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0cc0)({ - name: (string) (len=11) "service_fee", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0cf0)({ - name: (string) (len=11) "network_fee", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "AddAppUserRequest": (*main.Message)(0xc000038d80)({ - fullName: (string) (len=17) "AddAppUserRequest", - name: (string) (len=17) "AddAppUserRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0001c0420)({ - name: (string) (len=10) "identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0450)({ - name: (string) (len=14) "fail_if_exists", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0480)({ - name: (string) (len=7) "balance", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=26) "GetAppUserLNURLInfoRequest": (*main.Message)(0xc000038f80)({ - fullName: (string) (len=26) "GetAppUserLNURLInfoRequest", - name: (string) (len=26) "GetAppUserLNURLInfoRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001c0840)({ - name: (string) (len=15) "user_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0870)({ - name: (string) (len=17) "base_url_override", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=8) "UserInfo": (*main.Message)(0xc000039500)({ - fullName: (string) (len=8) "UserInfo", - name: (string) (len=8) "UserInfo", - fields: ([]*main.Field) (len=4 cap=4) { - (*main.Field)(0xc0001c11a0)({ - name: (string) (len=6) "userId", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c11d0)({ - name: (string) (len=7) "balance", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1200)({ - name: (string) (len=16) "max_withdrawable", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1230)({ - name: (string) (len=15) "user_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=7) "AppUser": (*main.Message)(0xc000038dc0)({ - fullName: (string) (len=7) "AppUser", - name: (string) (len=7) "AppUser", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0001c04b0)({ - name: (string) (len=10) "identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c04e0)({ - name: (string) (len=4) "info", - kind: (string) (len=8) "UserInfo", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0510)({ - name: (string) (len=16) "max_withdrawable", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "NewAddressRequest": (*main.Message)(0xc000039040)({ - fullName: (string) (len=17) "NewAddressRequest", - name: (string) (len=17) "NewAddressRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001c0930)({ - name: (string) (len=11) "addressType", - kind: (string) (len=11) "AddressType", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) true, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "ChainBalanceEvent": (*main.Message)(0xc0000388c0)({ - fullName: (string) (len=17) "ChainBalanceEvent", - name: (string) (len=17) "ChainBalanceEvent", - fields: ([]*main.Field) (len=4 cap=4) { - (*main.Field)(0xc0002085d0)({ - name: (string) (len=12) "block_height", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc000208600)({ - name: (string) (len=17) "confirmed_balance", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0002087b0)({ - name: (string) (len=19) "unconfirmed_balance", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0002087e0)({ - name: (string) (len=13) "total_balance", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=24) "SetMockAppBalanceRequest": (*main.Message)(0xc000039000)({ - fullName: (string) (len=24) "SetMockAppBalanceRequest", - name: (string) (len=24) "SetMockAppBalanceRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001c0900)({ - name: (string) (len=6) "amount", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=14) "LndNodeMetrics": (*main.Message)(0xc000038a80)({ - fullName: (string) (len=14) "LndNodeMetrics", - name: (string) (len=14) "LndNodeMetrics", - fields: ([]*main.Field) (len=9 cap=16) { - (*main.Field)(0xc000209b30)({ - name: (string) (len=23) "channels_balance_events", - kind: (string) (len=19) "ChannelBalanceEvent", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc000209b60)({ - name: (string) (len=20) "chain_balance_events", - kind: (string) (len=17) "ChainBalanceEvent", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc000209b90)({ - name: (string) (len=16) "offline_channels", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc000209ce0)({ - name: (string) (len=15) "online_channels", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc000209d10)({ - name: (string) (len=16) "pending_channels", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc000209d40)({ - name: (string) (len=16) "closing_channels", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc000209d70)({ - name: (string) (len=13) "open_channels", - kind: (string) (len=11) "OpenChannel", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0002dcae0)({ - name: (string) (len=15) "closed_channels", - kind: (string) (len=13) "ClosedChannel", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0002dcb10)({ - name: (string) (len=15) "channel_routing", - kind: (string) (len=14) "ChannelRouting", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=30) "SendAppUserToAppPaymentRequest": (*main.Message)(0xc000038f40)({ - fullName: (string) (len=30) "SendAppUserToAppPaymentRequest", - name: (string) (len=30) "SendAppUserToAppPaymentRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001c07e0)({ - name: (string) (len=20) "from_user_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0810)({ - name: (string) (len=6) "amount", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=21) "DecodeInvoiceResponse": (*main.Message)(0xc000039200)({ - fullName: (string) (len=21) "DecodeInvoiceResponse", - name: (string) (len=21) "DecodeInvoiceResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001c0ba0)({ - name: (string) (len=6) "amount", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=18) "OpenChannelRequest": (*main.Message)(0xc000039300)({ - fullName: (string) (len=18) "OpenChannelRequest", - name: (string) (len=18) "OpenChannelRequest", - fields: ([]*main.Field) (len=4 cap=4) { - (*main.Field)(0xc0001c0d20)({ - name: (string) (len=11) "destination", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0d50)({ - name: (string) (len=13) "fundingAmount", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0d80)({ - name: (string) (len=10) "pushAmount", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0db0)({ - name: (string) (len=12) "closeAddress", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=25) "GetUserOperationsResponse": (*main.Message)(0xc0000396c0)({ - fullName: (string) (len=25) "GetUserOperationsResponse", - name: (string) (len=25) "GetUserOperationsResponse", - fields: ([]*main.Field) (len=6 cap=8) { - (*main.Field)(0xc0001c1650)({ - name: (string) (len=31) "latestOutgoingInvoiceOperations", - kind: (string) (len=14) "UserOperations", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1680)({ - name: (string) (len=31) "latestIncomingInvoiceOperations", - kind: (string) (len=14) "UserOperations", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c16b0)({ - name: (string) (len=26) "latestOutgoingTxOperations", - kind: (string) (len=14) "UserOperations", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c16e0)({ - name: (string) (len=26) "latestIncomingTxOperations", - kind: (string) (len=14) "UserOperations", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1710)({ - name: (string) (len=32) "latestOutgoingUserToUserPayemnts", - kind: (string) (len=14) "UserOperations", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1740)({ - name: (string) (len=32) "latestIncomingUserToUserPayemnts", - kind: (string) (len=14) "UserOperations", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "AddProductRequest": (*main.Message)(0xc000039700)({ - fullName: (string) (len=17) "AddProductRequest", - name: (string) (len=17) "AddProductRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001c1770)({ - name: (string) (len=4) "name", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c17a0)({ - name: (string) (len=10) "price_sats", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=18) "LndGetInfoResponse": (*main.Message)(0xc000038b80)({ - fullName: (string) (len=18) "LndGetInfoResponse", - name: (string) (len=18) "LndGetInfoResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001c00c0)({ - name: (string) (len=5) "alias", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=13) "AddAppRequest": (*main.Message)(0xc000038c80)({ - fullName: (string) (len=13) "AddAppRequest", - name: (string) (len=13) "AddAppRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001c0240)({ - name: (string) (len=4) "name", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0270)({ - name: (string) (len=19) "allow_user_creation", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=24) "AddAppUserInvoiceRequest": (*main.Message)(0xc000038e40)({ - fullName: (string) (len=24) "AddAppUserInvoiceRequest", - name: (string) (len=24) "AddAppUserInvoiceRequest", - fields: ([]*main.Field) (len=4 cap=4) { - (*main.Field)(0xc0001c05d0)({ - name: (string) (len=19) "receiver_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0600)({ - name: (string) (len=16) "payer_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0630)({ - name: (string) (len=17) "http_callback_url", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0660)({ - name: (string) (len=11) "invoice_req", - kind: (string) (len=17) "NewInvoiceRequest", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=10) "LndMetrics": (*main.Message)(0xc000038ac0)({ - fullName: (string) (len=10) "LndMetrics", - name: (string) (len=10) "LndMetrics", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001c0000)({ - name: (string) (len=5) "nodes", - kind: (string) (len=14) "LndNodeMetrics", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "LndGetInfoRequest": (*main.Message)(0xc000038b00)({ - fullName: (string) (len=17) "LndGetInfoRequest", - name: (string) (len=17) "LndGetInfoRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001c0030)({ - name: (string) (len=6) "nodeId", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=20) "DecodeInvoiceRequest": (*main.Message)(0xc0000391c0)({ - fullName: (string) (len=20) "DecodeInvoiceRequest", - name: (string) (len=20) "DecodeInvoiceRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001c0b70)({ - name: (string) (len=7) "invoice", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=14) "UserOperations": (*main.Message)(0xc000039640)({ - fullName: (string) (len=14) "UserOperations", - name: (string) (len=14) "UserOperations", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0001c15c0)({ - name: (string) (len=9) "fromIndex", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c15f0)({ - name: (string) (len=7) "toIndex", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1620)({ - name: (string) (len=10) "operations", - kind: (string) (len=13) "UserOperation", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=7) "Product": (*main.Message)(0xc000039740)({ - fullName: (string) (len=7) "Product", - name: (string) (len=7) "Product", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0001c17d0)({ - name: (string) (len=2) "id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1800)({ - name: (string) (len=4) "name", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1830)({ - name: (string) (len=10) "price_sats", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=15) "RelaysMigration": (*main.Message)(0xc000039880)({ - fullName: (string) (len=15) "RelaysMigration", - name: (string) (len=15) "RelaysMigration", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001c1950)({ - name: (string) (len=6) "relays", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=12) "UsageMetrics": (*main.Message)(0xc000038600)({ +(map[string]*main.Message) (len=70) { + (string) (len=12) "UsageMetrics": (*main.Message)(0xc000348580)({ fullName: (string) (len=12) "UsageMetrics", name: (string) (len=12) "UsageMetrics", fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0000a1410)({ + (*main.Field)(0xc000207f80)({ name: (string) (len=7) "metrics", kind: (string) (len=11) "UsageMetric", isMap: (bool) false, @@ -2276,773 +1446,11 @@ }) } }), - (string) (len=11) "AppsMetrics": (*main.Message)(0xc000038780)({ - fullName: (string) (len=11) "AppsMetrics", - name: (string) (len=11) "AppsMetrics", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0000a1920)({ - name: (string) (len=4) "apps", - kind: (string) (len=10) "AppMetrics", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=13) "ClosedChannel": (*main.Message)(0xc000038980)({ - fullName: (string) (len=13) "ClosedChannel", - name: (string) (len=13) "ClosedChannel", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc000209350)({ - name: (string) (len=10) "channel_id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc000209380)({ - name: (string) (len=8) "capacity", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0002093b0)({ - name: (string) (len=13) "closed_height", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=13) "UserOperation": (*main.Message)(0xc000039600)({ - fullName: (string) (len=13) "UserOperation", - name: (string) (len=13) "UserOperation", - fields: ([]*main.Field) (len=11 cap=16) { - (*main.Field)(0xc0001c13b0)({ - name: (string) (len=10) "paidAtUnix", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c13e0)({ - name: (string) (len=4) "type", - kind: (string) (len=17) "UserOperationType", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) true, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1410)({ - name: (string) (len=7) "inbound", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1440)({ - name: (string) (len=6) "amount", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1470)({ - name: (string) (len=10) "identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c14a0)({ - name: (string) (len=11) "operationId", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c14d0)({ - name: (string) (len=11) "service_fee", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1500)({ - name: (string) (len=11) "network_fee", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1530)({ - name: (string) (len=9) "confirmed", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1560)({ - name: (string) (len=7) "tx_hash", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1590)({ - name: (string) (len=8) "internal", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "LiveUserOperation": (*main.Message)(0xc0000397c0)({ - fullName: (string) (len=17) "LiveUserOperation", - name: (string) (len=17) "LiveUserOperation", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001c1890)({ - name: (string) (len=9) "operation", - kind: (string) (len=13) "UserOperation", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=31) "RequestNPubLinkingTokenResponse": (*main.Message)(0xc000039900)({ - fullName: (string) (len=31) "RequestNPubLinkingTokenResponse", - name: (string) (len=31) "RequestNPubLinkingTokenResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001c19b0)({ - name: (string) (len=5) "token", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=18) "PayAddressResponse": (*main.Message)(0xc000039100)({ - fullName: (string) (len=18) "PayAddressResponse", - name: (string) (len=18) "PayAddressResponse", - fields: ([]*main.Field) (len=4 cap=4) { - (*main.Field)(0xc0001c0a20)({ - name: (string) (len=4) "txId", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0a50)({ - name: (string) (len=12) "operation_id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0a80)({ - name: (string) (len=11) "service_fee", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0ab0)({ - name: (string) (len=11) "network_fee", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=24) "GetUserOperationsRequest": (*main.Message)(0xc000039580)({ - fullName: (string) (len=24) "GetUserOperationsRequest", - name: (string) (len=24) "GetUserOperationsRequest", - fields: ([]*main.Field) (len=7 cap=8) { - (*main.Field)(0xc0001c1260)({ - name: (string) (len=21) "latestIncomingInvoice", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1290)({ - name: (string) (len=21) "latestOutgoingInvoice", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c12c0)({ - name: (string) (len=16) "latestIncomingTx", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c12f0)({ - name: (string) (len=16) "latestOutgoingTx", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1320)({ - name: (string) (len=31) "latestIncomingUserToUserPayment", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1350)({ - name: (string) (len=31) "latestOutgoingUserToUserPayment", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1380)({ - name: (string) (len=8) "max_size", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=25) "EncryptionExchangeRequest": (*main.Message)(0xc000038540)({ - fullName: (string) (len=25) "EncryptionExchangeRequest", - name: (string) (len=25) "EncryptionExchangeRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0000a1200)({ - name: (string) (len=9) "publicKey", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a1230)({ - name: (string) (len=8) "deviceId", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=18) "AppsMetricsRequest": (*main.Message)(0xc000038640)({ - fullName: (string) (len=18) "AppsMetricsRequest", - name: (string) (len=18) "AppsMetricsRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0000a1440)({ - name: (string) (len=9) "from_unix", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) true - }), - (*main.Field)(0xc0000a1470)({ - name: (string) (len=7) "to_unix", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) true - }), - (*main.Field)(0xc0000a14a0)({ - name: (string) (len=18) "include_operations", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) true - }) - } - }), - (string) (len=10) "AppMetrics": (*main.Message)(0xc000038740)({ - fullName: (string) (len=10) "AppMetrics", - name: (string) (len=10) "AppMetrics", - fields: ([]*main.Field) (len=9 cap=16) { - (*main.Field)(0xc0000a15f0)({ - name: (string) (len=3) "app", - kind: (string) (len=11) "Application", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a1620)({ - name: (string) (len=5) "users", - kind: (string) (len=9) "UsersInfo", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a1650)({ - name: (string) (len=8) "received", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a1680)({ - name: (string) (len=5) "spent", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a1830)({ - name: (string) (len=9) "available", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a1860)({ - name: (string) (len=4) "fees", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a1890)({ - name: (string) (len=8) "invoices", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a18c0)({ - name: (string) (len=10) "total_fees", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a18f0)({ - name: (string) (len=10) "operations", - kind: (string) (len=13) "UserOperation", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=19) "ChannelBalanceEvent": (*main.Message)(0xc000038880)({ - fullName: (string) (len=19) "ChannelBalanceEvent", - name: (string) (len=19) "ChannelBalanceEvent", - fields: ([]*main.Field) (len=4 cap=4) { - (*main.Field)(0xc0002083c0)({ - name: (string) (len=12) "block_height", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0002083f0)({ - name: (string) (len=10) "channel_id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc000208570)({ - name: (string) (len=18) "local_balance_sats", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0002085a0)({ - name: (string) (len=19) "remote_balance_sats", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=27) "SetMockInvoiceAsPaidRequest": (*main.Message)(0xc000038b40)({ - fullName: (string) (len=27) "SetMockInvoiceAsPaidRequest", - name: (string) (len=27) "SetMockInvoiceAsPaidRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001c0060)({ - name: (string) (len=7) "invoice", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0090)({ - name: (string) (len=6) "amount", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=14) "BanUserRequest": (*main.Message)(0xc000038bc0)({ - fullName: (string) (len=14) "BanUserRequest", - name: (string) (len=14) "BanUserRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001c00f0)({ - name: (string) (len=7) "user_id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=30) "RequestNPubLinkingTokenRequest": (*main.Message)(0xc0000398c0)({ - fullName: (string) (len=30) "RequestNPubLinkingTokenRequest", - name: (string) (len=30) "RequestNPubLinkingTokenRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001c1980)({ - name: (string) (len=15) "user_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "LndMetricsRequest": (*main.Message)(0xc0000387c0)({ - fullName: (string) (len=17) "LndMetricsRequest", - name: (string) (len=17) "LndMetricsRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0000a1ad0)({ - name: (string) (len=9) "from_unix", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) true - }), - (*main.Field)(0xc0000a1b00)({ - name: (string) (len=7) "to_unix", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) true - }) - } - }), - (string) (len=17) "PayInvoiceRequest": (*main.Message)(0xc000039240)({ - fullName: (string) (len=17) "PayInvoiceRequest", - name: (string) (len=17) "PayInvoiceRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001c0bd0)({ - name: (string) (len=7) "invoice", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0c00)({ - name: (string) (len=6) "amount", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "LnurlLinkResponse": (*main.Message)(0xc000039380)({ - fullName: (string) (len=17) "LnurlLinkResponse", - name: (string) (len=17) "LnurlLinkResponse", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001c0e10)({ - name: (string) (len=5) "lnurl", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0e40)({ - name: (string) (len=2) "k1", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=20) "AddAppInvoiceRequest": (*main.Message)(0xc000038e00)({ - fullName: (string) (len=20) "AddAppInvoiceRequest", - name: (string) (len=20) "AddAppInvoiceRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0001c0540)({ - name: (string) (len=16) "payer_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0570)({ - name: (string) (len=17) "http_callback_url", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c05a0)({ - name: (string) (len=11) "invoice_req", - kind: (string) (len=17) "NewInvoiceRequest", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "GetAppUserRequest": (*main.Message)(0xc000038e80)({ - fullName: (string) (len=17) "GetAppUserRequest", - name: (string) (len=17) "GetAppUserRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001c0690)({ - name: (string) (len=15) "user_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=20) "LnurlPayInfoResponse": (*main.Message)(0xc000039480)({ - fullName: (string) (len=20) "LnurlPayInfoResponse", - name: (string) (len=20) "LnurlPayInfoResponse", - fields: ([]*main.Field) (len=7 cap=8) { - (*main.Field)(0xc0001c0ff0)({ - name: (string) (len=3) "tag", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1020)({ - name: (string) (len=8) "callback", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1050)({ - name: (string) (len=11) "maxSendable", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1080)({ - name: (string) (len=11) "minSendable", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c10b0)({ - name: (string) (len=8) "metadata", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c10e0)({ - name: (string) (len=11) "allowsNostr", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1110)({ - name: (string) (len=11) "nostrPubkey", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=27) "LinkNPubThroughTokenRequest": (*main.Message)(0xc000039940)({ - fullName: (string) (len=27) "LinkNPubThroughTokenRequest", - name: (string) (len=27) "LinkNPubThroughTokenRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001c19e0)({ - name: (string) (len=5) "token", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1a10)({ - name: (string) (len=9) "nostr_pub", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=18) "NewInvoiceResponse": (*main.Message)(0xc000039180)({ - fullName: (string) (len=18) "NewInvoiceResponse", - name: (string) (len=18) "NewInvoiceResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001c0b40)({ - name: (string) (len=7) "invoice", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=11) "OpenChannel": (*main.Message)(0xc000038940)({ + (string) (len=11) "OpenChannel": (*main.Message)(0xc000348d00)({ fullName: (string) (len=11) "OpenChannel", name: (string) (len=11) "OpenChannel", fields: ([]*main.Field) (len=6 cap=8) { - (*main.Field)(0xc000208810)({ + (*main.Field)(0xc0004fc6c0)({ name: (string) (len=10) "channel_id", kind: (string) (len=6) "string", isMap: (bool) false, @@ -3051,7 +1459,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc000208840)({ + (*main.Field)(0xc0004fc6f0)({ name: (string) (len=8) "capacity", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -3060,7 +1468,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc000208c60)({ + (*main.Field)(0xc0004fc720)({ name: (string) (len=6) "active", kind: (string) (len=4) "bool", isMap: (bool) false, @@ -3069,7 +1477,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc000208c90)({ + (*main.Field)(0xc0004fc750)({ name: (string) (len=8) "lifetime", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -3078,7 +1486,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc000208cc0)({ + (*main.Field)(0xc0004fc780)({ name: (string) (len=13) "local_balance", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -3087,7 +1495,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc000208cf0)({ + (*main.Field)(0xc0004fc7b0)({ name: (string) (len=14) "remote_balance", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -3098,12 +1506,27 @@ }) } }), - (string) (len=11) "Application": (*main.Message)(0xc000038d00)({ - fullName: (string) (len=11) "Application", - name: (string) (len=11) "Application", - fields: ([]*main.Field) (len=4 cap=4) { - (*main.Field)(0xc0001c0300)({ - name: (string) (len=4) "name", + (string) (len=17) "NewAddressRequest": (*main.Message)(0xc000349400)({ + fullName: (string) (len=17) "NewAddressRequest", + name: (string) (len=17) "NewAddressRequest", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fd530)({ + name: (string) (len=11) "addressType", + kind: (string) (len=11) "AddressType", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) true, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=20) "LnurlPayInfoResponse": (*main.Message)(0xc000349840)({ + fullName: (string) (len=20) "LnurlPayInfoResponse", + name: (string) (len=20) "LnurlPayInfoResponse", + fields: ([]*main.Field) (len=7 cap=8) { + (*main.Field)(0xc0004fdbf0)({ + name: (string) (len=3) "tag", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -3111,8 +1534,8 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001c0330)({ - name: (string) (len=2) "id", + (*main.Field)(0xc0004fdc20)({ + name: (string) (len=8) "callback", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -3120,8 +1543,8 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001c0360)({ - name: (string) (len=7) "balance", + (*main.Field)(0xc0004fdc50)({ + name: (string) (len=11) "maxSendable", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3129,8 +1552,35 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001c0390)({ - name: (string) (len=4) "npub", + (*main.Field)(0xc0004fdc80)({ + name: (string) (len=11) "minSendable", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdcb0)({ + name: (string) (len=8) "metadata", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdce0)({ + name: (string) (len=11) "allowsNostr", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdd10)({ + name: (string) (len=11) "nostrPubkey", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -3140,101 +1590,11 @@ }) } }), - (string) (len=7) "AuthApp": (*main.Message)(0xc000038d40)({ - fullName: (string) (len=7) "AuthApp", - name: (string) (len=7) "AuthApp", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001c03c0)({ - name: (string) (len=3) "app", - kind: (string) (len=11) "Application", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c03f0)({ - name: (string) (len=10) "auth_token", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=24) "PayAppUserInvoiceRequest": (*main.Message)(0xc000038ec0)({ - fullName: (string) (len=24) "PayAppUserInvoiceRequest", - name: (string) (len=24) "PayAppUserInvoiceRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0001c06c0)({ - name: (string) (len=15) "user_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c06f0)({ - name: (string) (len=7) "invoice", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0720)({ - name: (string) (len=6) "amount", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "PayAddressRequest": (*main.Message)(0xc0000390c0)({ - fullName: (string) (len=17) "PayAddressRequest", - name: (string) (len=17) "PayAddressRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0001c0990)({ - name: (string) (len=7) "address", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c09c0)({ - name: (string) (len=9) "amoutSats", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c09f0)({ - name: (string) (len=12) "satsPerVByte", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=25) "GetProductBuyLinkResponse": (*main.Message)(0xc000039780)({ + (string) (len=25) "GetProductBuyLinkResponse": (*main.Message)(0xc000349b40)({ fullName: (string) (len=25) "GetProductBuyLinkResponse", name: (string) (len=25) "GetProductBuyLinkResponse", fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001c1860)({ + (*main.Field)(0xc0004fe480)({ name: (string) (len=4) "link", kind: (string) (len=6) "string", isMap: (bool) false, @@ -3245,64 +1605,58 @@ }) } }), - (string) (len=15) "MigrationUpdate": (*main.Message)(0xc000039800)({ - fullName: (string) (len=15) "MigrationUpdate", - name: (string) (len=15) "MigrationUpdate", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001c18c0)({ - name: (string) (len=7) "closure", - kind: (string) (len=16) "ClosureMigration", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) true - }), - (*main.Field)(0xc0001c18f0)({ - name: (string) (len=6) "relays", - kind: (string) (len=15) "RelaysMigration", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) true - }) - } - }), - (string) (len=13) "BannedAppUser": (*main.Message)(0xc000038c00)({ - fullName: (string) (len=13) "BannedAppUser", - name: (string) (len=13) "BannedAppUser", - fields: ([]*main.Field) (len=4 cap=4) { - (*main.Field)(0xc0001c0120)({ - name: (string) (len=8) "app_name", - kind: (string) (len=6) "string", + (string) (len=9) "UsersInfo": (*main.Message)(0xc000348840)({ + fullName: (string) (len=9) "UsersInfo", + name: (string) (len=9) "UsersInfo", + fields: ([]*main.Field) (len=6 cap=8) { + (*main.Field)(0xc00024ac60)({ + name: (string) (len=5) "total", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001c0150)({ - name: (string) (len=6) "app_id", - kind: (string) (len=6) "string", + (*main.Field)(0xc00024ac90)({ + name: (string) (len=10) "no_balance", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001c0180)({ - name: (string) (len=15) "user_identifier", - kind: (string) (len=6) "string", + (*main.Field)(0xc0004fc000)({ + name: (string) (len=16) "negative_balance", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001c01b0)({ - name: (string) (len=9) "nostr_pub", - kind: (string) (len=6) "string", + (*main.Field)(0xc0004fc030)({ + name: (string) (len=20) "always_been_inactive", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc060)({ + name: (string) (len=11) "balance_avg", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc090)({ + name: (string) (len=14) "balance_median", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -3311,11 +1665,11 @@ }) } }), - (string) (len=14) "AuthAppRequest": (*main.Message)(0xc000038cc0)({ - fullName: (string) (len=14) "AuthAppRequest", - name: (string) (len=14) "AuthAppRequest", + (string) (len=13) "AddAppRequest": (*main.Message)(0xc000349040)({ + fullName: (string) (len=13) "AddAppRequest", + name: (string) (len=13) "AddAppRequest", fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001c02a0)({ + (*main.Field)(0xc0004fce40)({ name: (string) (len=4) "name", kind: (string) (len=6) "string", isMap: (bool) false, @@ -3324,40 +1678,22 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001c02d0)({ + (*main.Field)(0xc0004fce70)({ name: (string) (len=19) "allow_user_creation", kind: (string) (len=4) "bool", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, isMessage: (bool) false, - isOptional: (bool) true + isOptional: (bool) false }) } }), - (string) (len=34) "SendAppUserToAppUserPaymentRequest": (*main.Message)(0xc000038f00)({ - fullName: (string) (len=34) "SendAppUserToAppUserPaymentRequest", - name: (string) (len=34) "SendAppUserToAppUserPaymentRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0001c0750)({ - name: (string) (len=20) "from_user_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0780)({ - name: (string) (len=18) "to_user_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c07b0)({ + (string) (len=21) "DecodeInvoiceResponse": (*main.Message)(0xc0003495c0)({ + fullName: (string) (len=21) "DecodeInvoiceResponse", + name: (string) (len=21) "DecodeInvoiceResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fd7a0)({ name: (string) (len=6) "amount", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -3368,130 +1704,13 @@ }) } }), - (string) (len=18) "NewAddressResponse": (*main.Message)(0xc000039080)({ - fullName: (string) (len=18) "NewAddressResponse", - name: (string) (len=18) "NewAddressResponse", + (string) (len=10) "LndMetrics": (*main.Message)(0xc000348e80)({ + fullName: (string) (len=10) "LndMetrics", + name: (string) (len=10) "LndMetrics", fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001c0960)({ - name: (string) (len=7) "address", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=19) "OpenChannelResponse": (*main.Message)(0xc000039340)({ - fullName: (string) (len=19) "OpenChannelResponse", - name: (string) (len=19) "OpenChannelResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001c0de0)({ - name: (string) (len=9) "channelId", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=25) "LnurlWithdrawInfoResponse": (*main.Message)(0xc000039400)({ - fullName: (string) (len=25) "LnurlWithdrawInfoResponse", - name: (string) (len=25) "LnurlWithdrawInfoResponse", - fields: ([]*main.Field) (len=8 cap=8) { - (*main.Field)(0xc0001c0e70)({ - name: (string) (len=3) "tag", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0ea0)({ - name: (string) (len=8) "callback", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0ed0)({ - name: (string) (len=2) "k1", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0f00)({ - name: (string) (len=18) "defaultDescription", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0f30)({ - name: (string) (len=15) "minWithdrawable", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0f60)({ - name: (string) (len=15) "maxWithdrawable", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0f90)({ - name: (string) (len=12) "balanceCheck", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c0fc0)({ - name: (string) (len=7) "payLink", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=22) "HandleLnurlPayResponse": (*main.Message)(0xc0000394c0)({ - fullName: (string) (len=22) "HandleLnurlPayResponse", - name: (string) (len=22) "HandleLnurlPayResponse", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001c1140)({ - name: (string) (len=2) "pr", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001c1170)({ - name: (string) (len=6) "routes", - kind: (string) (len=5) "Empty", + (*main.Field)(0xc0004fcc00)({ + name: (string) (len=5) "nodes", + kind: (string) (len=14) "LndNodeMetrics", isMap: (bool) false, isArray: (bool) true, isEnum: (bool) false, @@ -3500,12 +1719,21 @@ }) } }), - (string) (len=16) "ClosureMigration": (*main.Message)(0xc000039840)({ - fullName: (string) (len=16) "ClosureMigration", - name: (string) (len=16) "ClosureMigration", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001c1920)({ - name: (string) (len=14) "closes_at_unix", + (string) (len=17) "AddProductRequest": (*main.Message)(0xc000349ac0)({ + fullName: (string) (len=17) "AddProductRequest", + name: (string) (len=17) "AddProductRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fe390)({ + name: (string) (len=4) "name", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe3c0)({ + name: (string) (len=10) "price_sats", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3515,130 +1743,16 @@ }) } }), - (string) (len=5) "Empty": (*main.Message)(0xc000038500)({ + (string) (len=5) "Empty": (*main.Message)(0xc000348080)({ fullName: (string) (len=5) "Empty", name: (string) (len=5) "Empty", fields: ([]*main.Field) }), - (string) (len=12) "RoutingEvent": (*main.Message)(0xc000038840)({ - fullName: (string) (len=12) "RoutingEvent", - name: (string) (len=12) "RoutingEvent", - fields: ([]*main.Field) (len=12 cap=16) { - (*main.Field)(0xc0000a1b30)({ - name: (string) (len=19) "incoming_channel_id", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a1b60)({ - name: (string) (len=16) "incoming_htlc_id", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a1dd0)({ - name: (string) (len=19) "outgoing_channel_id", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a1e00)({ - name: (string) (len=16) "outgoing_htlc_id", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a1e30)({ - name: (string) (len=12) "timestamp_ns", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0000a1e60)({ - name: (string) (len=10) "event_type", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc000208000)({ - name: (string) (len=17) "incoming_amt_msat", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc000208030)({ - name: (string) (len=17) "outgoing_amt_msat", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc000208060)({ - name: (string) (len=14) "failure_string", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc000208090)({ - name: (string) (len=7) "settled", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc000208360)({ - name: (string) (len=8) "offchain", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc000208390)({ - name: (string) (len=18) "forward_fail_event", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=14) "ChannelRouting": (*main.Message)(0xc000038a00)({ + (string) (len=14) "ChannelRouting": (*main.Message)(0xc000348dc0)({ fullName: (string) (len=14) "ChannelRouting", name: (string) (len=14) "ChannelRouting", fields: ([]*main.Field) (len=10 cap=16) { - (*main.Field)(0xc0002093e0)({ + (*main.Field)(0xc0004fc870)({ name: (string) (len=10) "channel_id", kind: (string) (len=6) "string", isMap: (bool) false, @@ -3647,7 +1761,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0002094d0)({ + (*main.Field)(0xc0004fc8a0)({ name: (string) (len=11) "send_errors", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -3656,7 +1770,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc000209500)({ + (*main.Field)(0xc0004fc8d0)({ name: (string) (len=14) "receive_errors", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -3665,7 +1779,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc000209530)({ + (*main.Field)(0xc0004fc900)({ name: (string) (len=23) "forward_errors_as_input", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -3674,7 +1788,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc000209560)({ + (*main.Field)(0xc0004fc930)({ name: (string) (len=24) "forward_errors_as_output", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -3683,7 +1797,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc000209710)({ + (*main.Field)(0xc0004fc960)({ name: (string) (len=27) "missed_forward_fee_as_input", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -3692,7 +1806,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc000209740)({ + (*main.Field)(0xc0004fc990)({ name: (string) (len=28) "missed_forward_fee_as_output", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -3701,7 +1815,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc000209770)({ + (*main.Field)(0xc0004fc9c0)({ name: (string) (len=20) "forward_fee_as_input", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -3710,7 +1824,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0002097a0)({ + (*main.Field)(0xc0004fc9f0)({ name: (string) (len=21) "forward_fee_as_output", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -3719,7 +1833,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc000209b00)({ + (*main.Field)(0xc0004fca20)({ name: (string) (len=13) "events_number", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -3730,11 +1844,314 @@ }) } }), - (string) (len=15) "BanUserResponse": (*main.Message)(0xc000038c40)({ + (string) (len=18) "PayInvoiceResponse": (*main.Message)(0xc000349680)({ + fullName: (string) (len=18) "PayInvoiceResponse", + name: (string) (len=18) "PayInvoiceResponse", + fields: ([]*main.Field) (len=5 cap=8) { + (*main.Field)(0xc0004fd830)({ + name: (string) (len=8) "preimage", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd860)({ + name: (string) (len=11) "amount_paid", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd890)({ + name: (string) (len=12) "operation_id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd8c0)({ + name: (string) (len=11) "service_fee", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd8f0)({ + name: (string) (len=11) "network_fee", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=8) "UserInfo": (*main.Message)(0xc0003498c0)({ + fullName: (string) (len=8) "UserInfo", + name: (string) (len=8) "UserInfo", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc0004fdda0)({ + name: (string) (len=6) "userId", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fddd0)({ + name: (string) (len=7) "balance", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fde00)({ + name: (string) (len=16) "max_withdrawable", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fde30)({ + name: (string) (len=15) "user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=15) "MigrationUpdate": (*main.Message)(0xc000349bc0)({ + fullName: (string) (len=15) "MigrationUpdate", + name: (string) (len=15) "MigrationUpdate", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fe4e0)({ + name: (string) (len=7) "closure", + kind: (string) (len=16) "ClosureMigration", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) true + }), + (*main.Field)(0xc0004fe510)({ + name: (string) (len=6) "relays", + kind: (string) (len=15) "RelaysMigration", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) true + }) + } + }), + (string) (len=27) "LinkNPubThroughTokenRequest": (*main.Message)(0xc000349d00)({ + fullName: (string) (len=27) "LinkNPubThroughTokenRequest", + name: (string) (len=27) "LinkNPubThroughTokenRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fe600)({ + name: (string) (len=5) "token", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe630)({ + name: (string) (len=9) "nostr_pub", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "PayAddressRequest": (*main.Message)(0xc000349480)({ + fullName: (string) (len=17) "PayAddressRequest", + name: (string) (len=17) "PayAddressRequest", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0004fd590)({ + name: (string) (len=7) "address", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd5c0)({ + name: (string) (len=9) "amoutSats", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd5f0)({ + name: (string) (len=12) "satsPerVByte", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=18) "PayAddressResponse": (*main.Message)(0xc0003494c0)({ + fullName: (string) (len=18) "PayAddressResponse", + name: (string) (len=18) "PayAddressResponse", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc0004fd620)({ + name: (string) (len=4) "txId", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd650)({ + name: (string) (len=12) "operation_id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd680)({ + name: (string) (len=11) "service_fee", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd6b0)({ + name: (string) (len=11) "network_fee", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=10) "AppMetrics": (*main.Message)(0xc000348900)({ + fullName: (string) (len=10) "AppMetrics", + name: (string) (len=10) "AppMetrics", + fields: ([]*main.Field) (len=9 cap=16) { + (*main.Field)(0xc0004fc0c0)({ + name: (string) (len=3) "app", + kind: (string) (len=11) "Application", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc0f0)({ + name: (string) (len=5) "users", + kind: (string) (len=9) "UsersInfo", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc120)({ + name: (string) (len=8) "received", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc150)({ + name: (string) (len=5) "spent", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc180)({ + name: (string) (len=9) "available", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc1b0)({ + name: (string) (len=4) "fees", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc1e0)({ + name: (string) (len=8) "invoices", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc210)({ + name: (string) (len=10) "total_fees", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc240)({ + name: (string) (len=10) "operations", + kind: (string) (len=13) "UserOperation", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=15) "BanUserResponse": (*main.Message)(0xc000349000)({ fullName: (string) (len=15) "BanUserResponse", name: (string) (len=15) "BanUserResponse", fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001c01e0)({ + (*main.Field)(0xc0004fcde0)({ name: (string) (len=12) "balance_sats", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -3743,7 +2160,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001c0210)({ + (*main.Field)(0xc0004fce10)({ name: (string) (len=16) "banned_app_users", kind: (string) (len=13) "BannedAppUser", isMap: (bool) false, @@ -3754,11 +2171,77 @@ }) } }), - (string) (len=28) "SetMockAppUserBalanceRequest": (*main.Message)(0xc000038fc0)({ - fullName: (string) (len=28) "SetMockAppUserBalanceRequest", - name: (string) (len=28) "SetMockAppUserBalanceRequest", + (string) (len=7) "AuthApp": (*main.Message)(0xc000349100)({ + fullName: (string) (len=7) "AuthApp", + name: (string) (len=7) "AuthApp", fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001c08a0)({ + (*main.Field)(0xc0004fcfc0)({ + name: (string) (len=3) "app", + kind: (string) (len=11) "Application", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcff0)({ + name: (string) (len=10) "auth_token", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "LndMetricsRequest": (*main.Message)(0xc0003489c0)({ + fullName: (string) (len=17) "LndMetricsRequest", + name: (string) (len=17) "LndMetricsRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fc2a0)({ + name: (string) (len=9) "from_unix", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) true + }), + (*main.Field)(0xc0004fc2d0)({ + name: (string) (len=7) "to_unix", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) true + }) + } + }), + (string) (len=13) "BannedAppUser": (*main.Message)(0xc000348fc0)({ + fullName: (string) (len=13) "BannedAppUser", + name: (string) (len=13) "BannedAppUser", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc0004fcd20)({ + name: (string) (len=8) "app_name", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcd50)({ + name: (string) (len=6) "app_id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcd80)({ name: (string) (len=15) "user_identifier", kind: (string) (len=6) "string", isMap: (bool) false, @@ -3767,7 +2250,37 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001c08d0)({ + (*main.Field)(0xc0004fcdb0)({ + name: (string) (len=9) "nostr_pub", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "GetAppUserRequest": (*main.Message)(0xc000349240)({ + fullName: (string) (len=17) "GetAppUserRequest", + name: (string) (len=17) "GetAppUserRequest", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fd290)({ + name: (string) (len=15) "user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=24) "SetMockAppBalanceRequest": (*main.Message)(0xc0003493c0)({ + fullName: (string) (len=24) "SetMockAppBalanceRequest", + name: (string) (len=24) "SetMockAppBalanceRequest", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fd500)({ name: (string) (len=6) "amount", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -3778,11 +2291,977 @@ }) } }), - (string) (len=17) "NewInvoiceRequest": (*main.Message)(0xc000039140)({ + (string) (len=20) "DecodeInvoiceRequest": (*main.Message)(0xc000349580)({ + fullName: (string) (len=20) "DecodeInvoiceRequest", + name: (string) (len=20) "DecodeInvoiceRequest", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fd770)({ + name: (string) (len=7) "invoice", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=31) "RequestNPubLinkingTokenResponse": (*main.Message)(0xc000349cc0)({ + fullName: (string) (len=31) "RequestNPubLinkingTokenResponse", + name: (string) (len=31) "RequestNPubLinkingTokenResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fe5d0)({ + name: (string) (len=5) "token", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "LndGetInfoRequest": (*main.Message)(0xc000348ec0)({ + fullName: (string) (len=17) "LndGetInfoRequest", + name: (string) (len=17) "LndGetInfoRequest", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fcc30)({ + name: (string) (len=6) "nodeId", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=7) "AppUser": (*main.Message)(0xc000349180)({ + fullName: (string) (len=7) "AppUser", + name: (string) (len=7) "AppUser", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0004fd0b0)({ + name: (string) (len=10) "identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd0e0)({ + name: (string) (len=4) "info", + kind: (string) (len=8) "UserInfo", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd110)({ + name: (string) (len=16) "max_withdrawable", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=28) "SetMockAppUserBalanceRequest": (*main.Message)(0xc000349380)({ + fullName: (string) (len=28) "SetMockAppUserBalanceRequest", + name: (string) (len=28) "SetMockAppUserBalanceRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fd4a0)({ + name: (string) (len=15) "user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd4d0)({ + name: (string) (len=6) "amount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "PayInvoiceRequest": (*main.Message)(0xc000349600)({ + fullName: (string) (len=17) "PayInvoiceRequest", + name: (string) (len=17) "PayInvoiceRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fd7d0)({ + name: (string) (len=7) "invoice", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd800)({ + name: (string) (len=6) "amount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "AddAppUserRequest": (*main.Message)(0xc000349140)({ + fullName: (string) (len=17) "AddAppUserRequest", + name: (string) (len=17) "AddAppUserRequest", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0004fd020)({ + name: (string) (len=10) "identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd050)({ + name: (string) (len=14) "fail_if_exists", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd080)({ + name: (string) (len=7) "balance", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=18) "NewInvoiceResponse": (*main.Message)(0xc000349540)({ + fullName: (string) (len=18) "NewInvoiceResponse", + name: (string) (len=18) "NewInvoiceResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fd740)({ + name: (string) (len=7) "invoice", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=11) "AppsMetrics": (*main.Message)(0xc000348940)({ + fullName: (string) (len=11) "AppsMetrics", + name: (string) (len=11) "AppsMetrics", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fc270)({ + name: (string) (len=4) "apps", + kind: (string) (len=10) "AppMetrics", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=18) "LndGetInfoResponse": (*main.Message)(0xc000348f40)({ + fullName: (string) (len=18) "LndGetInfoResponse", + name: (string) (len=18) "LndGetInfoResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fccc0)({ + name: (string) (len=5) "alias", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=18) "NewAddressResponse": (*main.Message)(0xc000349440)({ + fullName: (string) (len=18) "NewAddressResponse", + name: (string) (len=18) "NewAddressResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fd560)({ + name: (string) (len=7) "address", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=14) "BanUserRequest": (*main.Message)(0xc000348f80)({ + fullName: (string) (len=14) "BanUserRequest", + name: (string) (len=14) "BanUserRequest", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fccf0)({ + name: (string) (len=7) "user_id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=34) "SendAppUserToAppUserPaymentRequest": (*main.Message)(0xc0003492c0)({ + fullName: (string) (len=34) "SendAppUserToAppUserPaymentRequest", + name: (string) (len=34) "SendAppUserToAppUserPaymentRequest", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0004fd350)({ + name: (string) (len=20) "from_user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd380)({ + name: (string) (len=18) "to_user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd3b0)({ + name: (string) (len=6) "amount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=30) "SendAppUserToAppPaymentRequest": (*main.Message)(0xc000349300)({ + fullName: (string) (len=30) "SendAppUserToAppPaymentRequest", + name: (string) (len=30) "SendAppUserToAppPaymentRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fd3e0)({ + name: (string) (len=20) "from_user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd410)({ + name: (string) (len=6) "amount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=24) "GetUserOperationsRequest": (*main.Message)(0xc000349940)({ + fullName: (string) (len=24) "GetUserOperationsRequest", + name: (string) (len=24) "GetUserOperationsRequest", + fields: ([]*main.Field) (len=7 cap=8) { + (*main.Field)(0xc0004fde60)({ + name: (string) (len=21) "latestIncomingInvoice", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fde90)({ + name: (string) (len=21) "latestOutgoingInvoice", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdec0)({ + name: (string) (len=16) "latestIncomingTx", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdef0)({ + name: (string) (len=16) "latestOutgoingTx", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdf20)({ + name: (string) (len=31) "latestIncomingUserToUserPayment", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdf50)({ + name: (string) (len=31) "latestOutgoingUserToUserPayment", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdf80)({ + name: (string) (len=8) "max_size", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=25) "GetUserOperationsResponse": (*main.Message)(0xc000349a80)({ + fullName: (string) (len=25) "GetUserOperationsResponse", + name: (string) (len=25) "GetUserOperationsResponse", + fields: ([]*main.Field) (len=6 cap=8) { + (*main.Field)(0xc0004fe270)({ + name: (string) (len=31) "latestOutgoingInvoiceOperations", + kind: (string) (len=14) "UserOperations", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe2a0)({ + name: (string) (len=31) "latestIncomingInvoiceOperations", + kind: (string) (len=14) "UserOperations", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe2d0)({ + name: (string) (len=26) "latestOutgoingTxOperations", + kind: (string) (len=14) "UserOperations", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe300)({ + name: (string) (len=26) "latestIncomingTxOperations", + kind: (string) (len=14) "UserOperations", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe330)({ + name: (string) (len=32) "latestOutgoingUserToUserPayemnts", + kind: (string) (len=14) "UserOperations", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe360)({ + name: (string) (len=32) "latestIncomingUserToUserPayemnts", + kind: (string) (len=14) "UserOperations", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=16) "ClosureMigration": (*main.Message)(0xc000349c00)({ + fullName: (string) (len=16) "ClosureMigration", + name: (string) (len=16) "ClosureMigration", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fe540)({ + name: (string) (len=14) "closes_at_unix", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=14) "AuthAppRequest": (*main.Message)(0xc000349080)({ + fullName: (string) (len=14) "AuthAppRequest", + name: (string) (len=14) "AuthAppRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fcea0)({ + name: (string) (len=4) "name", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fced0)({ + name: (string) (len=19) "allow_user_creation", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) true + }) + } + }), + (string) (len=11) "Application": (*main.Message)(0xc0003490c0)({ + fullName: (string) (len=11) "Application", + name: (string) (len=11) "Application", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc0004fcf00)({ + name: (string) (len=4) "name", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcf30)({ + name: (string) (len=2) "id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcf60)({ + name: (string) (len=7) "balance", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcf90)({ + name: (string) (len=4) "npub", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=20) "AddAppInvoiceRequest": (*main.Message)(0xc0003491c0)({ + fullName: (string) (len=20) "AddAppInvoiceRequest", + name: (string) (len=20) "AddAppInvoiceRequest", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0004fd140)({ + name: (string) (len=16) "payer_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd170)({ + name: (string) (len=17) "http_callback_url", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd1a0)({ + name: (string) (len=11) "invoice_req", + kind: (string) (len=17) "NewInvoiceRequest", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=26) "GetAppUserLNURLInfoRequest": (*main.Message)(0xc000349340)({ + fullName: (string) (len=26) "GetAppUserLNURLInfoRequest", + name: (string) (len=26) "GetAppUserLNURLInfoRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fd440)({ + name: (string) (len=15) "user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd470)({ + name: (string) (len=17) "base_url_override", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "LnurlLinkResponse": (*main.Message)(0xc000349740)({ + fullName: (string) (len=17) "LnurlLinkResponse", + name: (string) (len=17) "LnurlLinkResponse", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fda10)({ + name: (string) (len=5) "lnurl", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fda40)({ + name: (string) (len=2) "k1", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=25) "LnurlWithdrawInfoResponse": (*main.Message)(0xc0003497c0)({ + fullName: (string) (len=25) "LnurlWithdrawInfoResponse", + name: (string) (len=25) "LnurlWithdrawInfoResponse", + fields: ([]*main.Field) (len=8 cap=8) { + (*main.Field)(0xc0004fda70)({ + name: (string) (len=3) "tag", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdaa0)({ + name: (string) (len=8) "callback", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdad0)({ + name: (string) (len=2) "k1", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdb00)({ + name: (string) (len=18) "defaultDescription", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdb30)({ + name: (string) (len=15) "minWithdrawable", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdb60)({ + name: (string) (len=15) "maxWithdrawable", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdb90)({ + name: (string) (len=12) "balanceCheck", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdbc0)({ + name: (string) (len=7) "payLink", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=13) "UserOperation": (*main.Message)(0xc0003499c0)({ + fullName: (string) (len=13) "UserOperation", + name: (string) (len=13) "UserOperation", + fields: ([]*main.Field) (len=11 cap=16) { + (*main.Field)(0xc0004fdfb0)({ + name: (string) (len=10) "paidAtUnix", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe000)({ + name: (string) (len=4) "type", + kind: (string) (len=17) "UserOperationType", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) true, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe030)({ + name: (string) (len=7) "inbound", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe060)({ + name: (string) (len=6) "amount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe090)({ + name: (string) (len=10) "identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe0c0)({ + name: (string) (len=11) "operationId", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe0f0)({ + name: (string) (len=11) "service_fee", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe120)({ + name: (string) (len=11) "network_fee", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe150)({ + name: (string) (len=9) "confirmed", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe180)({ + name: (string) (len=7) "tx_hash", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe1b0)({ + name: (string) (len=8) "internal", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=15) "RelaysMigration": (*main.Message)(0xc000349c40)({ + fullName: (string) (len=15) "RelaysMigration", + name: (string) (len=15) "RelaysMigration", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fe570)({ + name: (string) (len=6) "relays", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=30) "RequestNPubLinkingTokenRequest": (*main.Message)(0xc000349c80)({ + fullName: (string) (len=30) "RequestNPubLinkingTokenRequest", + name: (string) (len=30) "RequestNPubLinkingTokenRequest", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fe5a0)({ + name: (string) (len=15) "user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=25) "EncryptionExchangeRequest": (*main.Message)(0xc000348180)({ + fullName: (string) (len=25) "EncryptionExchangeRequest", + name: (string) (len=25) "EncryptionExchangeRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc000207d70)({ + name: (string) (len=9) "publicKey", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc000207da0)({ + name: (string) (len=8) "deviceId", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=18) "AppsMetricsRequest": (*main.Message)(0xc000348600)({ + fullName: (string) (len=18) "AppsMetricsRequest", + name: (string) (len=18) "AppsMetricsRequest", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc000207fb0)({ + name: (string) (len=9) "from_unix", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) true + }), + (*main.Field)(0xc00034ec90)({ + name: (string) (len=7) "to_unix", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) true + }), + (*main.Field)(0xc00034ecc0)({ + name: (string) (len=18) "include_operations", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) true + }) + } + }), + (string) (len=13) "ClosedChannel": (*main.Message)(0xc000348d40)({ + fullName: (string) (len=13) "ClosedChannel", + name: (string) (len=13) "ClosedChannel", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0004fc7e0)({ + name: (string) (len=10) "channel_id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc810)({ + name: (string) (len=8) "capacity", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc840)({ + name: (string) (len=13) "closed_height", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=19) "OpenChannelResponse": (*main.Message)(0xc000349700)({ + fullName: (string) (len=19) "OpenChannelResponse", + name: (string) (len=19) "OpenChannelResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fd9e0)({ + name: (string) (len=9) "channelId", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=7) "Product": (*main.Message)(0xc000349b00)({ + fullName: (string) (len=7) "Product", + name: (string) (len=7) "Product", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0004fe3f0)({ + name: (string) (len=2) "id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe420)({ + name: (string) (len=4) "name", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe450)({ + name: (string) (len=10) "price_sats", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=24) "PayAppUserInvoiceRequest": (*main.Message)(0xc000349280)({ + fullName: (string) (len=24) "PayAppUserInvoiceRequest", + name: (string) (len=24) "PayAppUserInvoiceRequest", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0004fd2c0)({ + name: (string) (len=15) "user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd2f0)({ + name: (string) (len=7) "invoice", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd320)({ + name: (string) (len=6) "amount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "NewInvoiceRequest": (*main.Message)(0xc000349500)({ fullName: (string) (len=17) "NewInvoiceRequest", name: (string) (len=17) "NewInvoiceRequest", fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001c0ae0)({ + (*main.Field)(0xc0004fd6e0)({ name: (string) (len=10) "amountSats", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -3791,7 +3270,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001c0b10)({ + (*main.Field)(0xc0004fd710)({ name: (string) (len=4) "memo", kind: (string) (len=6) "string", isMap: (bool) false, @@ -3801,10 +3280,586 @@ isOptional: (bool) false }) } + }), + (string) (len=17) "LiveUserOperation": (*main.Message)(0xc000349b80)({ + fullName: (string) (len=17) "LiveUserOperation", + name: (string) (len=17) "LiveUserOperation", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fe4b0)({ + name: (string) (len=9) "operation", + kind: (string) (len=13) "UserOperation", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=9) "HttpCreds": (*main.Message)(0xc000349d40)({ + fullName: (string) (len=9) "HttpCreds", + name: (string) (len=9) "HttpCreds", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fe660)({ + name: (string) (len=3) "url", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe690)({ + name: (string) (len=5) "token", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=11) "UsageMetric": (*main.Message)(0xc0003482c0)({ + fullName: (string) (len=11) "UsageMetric", + name: (string) (len=11) "UsageMetric", + fields: ([]*main.Field) (len=9 cap=16) { + (*main.Field)(0xc000207dd0)({ + name: (string) (len=15) "processed_at_ms", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc000207e00)({ + name: (string) (len=14) "parsed_in_nano", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc000207e30)({ + name: (string) (len=12) "auth_in_nano", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc000207e60)({ + name: (string) (len=16) "validate_in_nano", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc000207e90)({ + name: (string) (len=14) "handle_in_nano", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc000207ec0)({ + name: (string) (len=8) "rpc_name", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc000207ef0)({ + name: (string) (len=5) "batch", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc000207f20)({ + name: (string) (len=5) "nostr", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc000207f50)({ + name: (string) (len=10) "batch_size", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=12) "RoutingEvent": (*main.Message)(0xc000348b40)({ + fullName: (string) (len=12) "RoutingEvent", + name: (string) (len=12) "RoutingEvent", + fields: ([]*main.Field) (len=12 cap=16) { + (*main.Field)(0xc0004fc300)({ + name: (string) (len=19) "incoming_channel_id", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc330)({ + name: (string) (len=16) "incoming_htlc_id", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc360)({ + name: (string) (len=19) "outgoing_channel_id", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc390)({ + name: (string) (len=16) "outgoing_htlc_id", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc3c0)({ + name: (string) (len=12) "timestamp_ns", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc3f0)({ + name: (string) (len=10) "event_type", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc420)({ + name: (string) (len=17) "incoming_amt_msat", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc450)({ + name: (string) (len=17) "outgoing_amt_msat", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc480)({ + name: (string) (len=14) "failure_string", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc4b0)({ + name: (string) (len=7) "settled", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc4e0)({ + name: (string) (len=8) "offchain", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc510)({ + name: (string) (len=18) "forward_fail_event", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=19) "ChannelBalanceEvent": (*main.Message)(0xc000348c40)({ + fullName: (string) (len=19) "ChannelBalanceEvent", + name: (string) (len=19) "ChannelBalanceEvent", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc0004fc540)({ + name: (string) (len=12) "block_height", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc570)({ + name: (string) (len=10) "channel_id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc5a0)({ + name: (string) (len=18) "local_balance_sats", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc5d0)({ + name: (string) (len=19) "remote_balance_sats", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=22) "HandleLnurlPayResponse": (*main.Message)(0xc000349880)({ + fullName: (string) (len=22) "HandleLnurlPayResponse", + name: (string) (len=22) "HandleLnurlPayResponse", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fdd40)({ + name: (string) (len=2) "pr", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdd70)({ + name: (string) (len=6) "routes", + kind: (string) (len=5) "Empty", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=14) "UserOperations": (*main.Message)(0xc000349a00)({ + fullName: (string) (len=14) "UserOperations", + name: (string) (len=14) "UserOperations", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0004fe1e0)({ + name: (string) (len=9) "fromIndex", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe210)({ + name: (string) (len=7) "toIndex", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe240)({ + name: (string) (len=10) "operations", + kind: (string) (len=13) "UserOperation", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "ChainBalanceEvent": (*main.Message)(0xc000348c80)({ + fullName: (string) (len=17) "ChainBalanceEvent", + name: (string) (len=17) "ChainBalanceEvent", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc0004fc600)({ + name: (string) (len=12) "block_height", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc630)({ + name: (string) (len=17) "confirmed_balance", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc660)({ + name: (string) (len=19) "unconfirmed_balance", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc690)({ + name: (string) (len=13) "total_balance", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=14) "LndNodeMetrics": (*main.Message)(0xc000348e40)({ + fullName: (string) (len=14) "LndNodeMetrics", + name: (string) (len=14) "LndNodeMetrics", + fields: ([]*main.Field) (len=9 cap=16) { + (*main.Field)(0xc0004fca50)({ + name: (string) (len=23) "channels_balance_events", + kind: (string) (len=19) "ChannelBalanceEvent", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fca80)({ + name: (string) (len=20) "chain_balance_events", + kind: (string) (len=17) "ChainBalanceEvent", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcab0)({ + name: (string) (len=16) "offline_channels", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcae0)({ + name: (string) (len=15) "online_channels", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcb10)({ + name: (string) (len=16) "pending_channels", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcb40)({ + name: (string) (len=16) "closing_channels", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcb70)({ + name: (string) (len=13) "open_channels", + kind: (string) (len=11) "OpenChannel", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcba0)({ + name: (string) (len=15) "closed_channels", + kind: (string) (len=13) "ClosedChannel", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcbd0)({ + name: (string) (len=15) "channel_routing", + kind: (string) (len=14) "ChannelRouting", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=27) "SetMockInvoiceAsPaidRequest": (*main.Message)(0xc000348f00)({ + fullName: (string) (len=27) "SetMockInvoiceAsPaidRequest", + name: (string) (len=27) "SetMockInvoiceAsPaidRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fcc60)({ + name: (string) (len=7) "invoice", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcc90)({ + name: (string) (len=6) "amount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=24) "AddAppUserInvoiceRequest": (*main.Message)(0xc000349200)({ + fullName: (string) (len=24) "AddAppUserInvoiceRequest", + name: (string) (len=24) "AddAppUserInvoiceRequest", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc0004fd1d0)({ + name: (string) (len=19) "receiver_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd200)({ + name: (string) (len=16) "payer_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd230)({ + name: (string) (len=17) "http_callback_url", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd260)({ + name: (string) (len=11) "invoice_req", + kind: (string) (len=17) "NewInvoiceRequest", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=18) "OpenChannelRequest": (*main.Message)(0xc0003496c0)({ + fullName: (string) (len=18) "OpenChannelRequest", + name: (string) (len=18) "OpenChannelRequest", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc0004fd920)({ + name: (string) (len=11) "destination", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd950)({ + name: (string) (len=13) "fundingAmount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd980)({ + name: (string) (len=10) "pushAmount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd9b0)({ + name: (string) (len=12) "closeAddress", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } }) } -parsing file: structs 69 +parsing file: structs 70 parsing file: methods 2 -> [{guest Guest map[]} {user User map[app_id:string app_user_id:string user_id:string]} {admin Admin map[admin_id:string]} {metrics Metrics map[operator_id:string]} {app App map[app_id:string]}] diff --git a/proto/autogenerated/ts/http_client.ts b/proto/autogenerated/ts/http_client.ts index 58d2199c..cdaec8d5 100644 --- a/proto/autogenerated/ts/http_client.ts +++ b/proto/autogenerated/ts/http_client.ts @@ -587,6 +587,7 @@ export default (params: ClientParams) => ({ }, GetLiveUserOperations: async (cb: (v:ResultError | ({ status: 'OK' }& Types.LiveUserOperation)) => void): Promise => { throw new Error('http streams are not supported')}, GetMigrationUpdate: async (cb: (v:ResultError | ({ status: 'OK' }& Types.MigrationUpdate)) => void): Promise => { throw new Error('http streams are not supported')}, + GetHttpCreds: async (cb: (v:ResultError | ({ status: 'OK' }& Types.HttpCreds)) => void): Promise => { throw new Error('http streams are not supported')}, BatchUser: async (requests:Types.UserMethodInputs[]): Promise => { const auth = await params.retrieveUserAuth() if (auth === null) throw new Error('retrieveUserAuth() returned null') diff --git a/proto/autogenerated/ts/nostr_client.ts b/proto/autogenerated/ts/nostr_client.ts index 7a9236ee..2c07d5ae 100644 --- a/proto/autogenerated/ts/nostr_client.ts +++ b/proto/autogenerated/ts/nostr_client.ts @@ -253,6 +253,21 @@ export default (params: NostrClientParams, send: (to:string, message: NostrRequ return cb({ status: 'ERROR', reason: 'invalid response' }) }) }, + GetHttpCreds: async (cb: (res:ResultError | ({ status: 'OK' }& Types.HttpCreds)) => void): Promise => { + const auth = await params.retrieveNostrUserAuth() + if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') + const nostrRequest: NostrRequest = {} + subscribe(params.pubDestination, {rpcName:'GetHttpCreds',authIdentifier:auth, ...nostrRequest }, (data) => { + if (data.status === 'ERROR' && typeof data.reason === 'string') return cb(data) + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return cb({ status: 'OK', ...result }) + const error = Types.HttpCredsValidate(result) + if (error === null) { return cb({ status: 'OK', ...result }) } else return cb({ status: 'ERROR', reason: error.message }) + } + return cb({ status: 'ERROR', reason: 'invalid response' }) + }) + }, BatchUser: async (requests:Types.UserMethodInputs[]): Promise => { const auth = await params.retrieveNostrUserAuth() if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') diff --git a/proto/autogenerated/ts/nostr_transport.ts b/proto/autogenerated/ts/nostr_transport.ts index 01c63933..323cbf3a 100644 --- a/proto/autogenerated/ts/nostr_transport.ts +++ b/proto/autogenerated/ts/nostr_transport.ts @@ -16,9 +16,9 @@ export type NostrOptions = { logger?: Logger throwErrors?: true metricsCallback: (metrics: Types.RequestMetric[]) => void - NostrUserAuthGuard: (appId?:string, identifier?: string) => Promise + NostrUserAuthGuard: (appId?: string, identifier?: string) => Promise } -const logErrorAndReturnResponse = (error: Error, response: string, res: NostrResponse, logger: Logger, metric: Types.RequestMetric, metricsCallback: (metrics: Types.RequestMetric[]) => void) => { +const logErrorAndReturnResponse = (error: Error, response: string, res: NostrResponse, logger: Logger, metric: Types.RequestMetric, metricsCallback: (metrics: Types.RequestMetric[]) => void) => { logger.error(error.message || error); metricsCallback([{ ...metric, error: response }]); res({ status: 'ERROR', reason: response }) } export default (methods: Types.ServerMethods, opts: NostrOptions) => { @@ -39,11 +39,11 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { const error = Types.LinkNPubThroughTokenRequestValidate(request) stats.validate = process.hrtime.bigint() if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) - await methods.LinkNPubThroughToken({rpcName:'LinkNPubThroughToken', ctx:authContext , req: request}) + await methods.LinkNPubThroughToken({ rpcName: 'LinkNPubThroughToken', ctx: authContext, req: request }) stats.handle = process.hrtime.bigint() - res({status: 'OK'}) + res({ status: 'OK' }) opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - }catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } break case 'UserHealth': try { @@ -52,11 +52,11 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { stats.guard = process.hrtime.bigint() authCtx = authContext stats.validate = stats.guard - await methods.UserHealth({rpcName:'UserHealth', ctx:authContext }) + await methods.UserHealth({ rpcName: 'UserHealth', ctx: authContext }) stats.handle = process.hrtime.bigint() - res({status: 'OK'}) + res({ status: 'OK' }) opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - }catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } break case 'GetUserInfo': try { @@ -65,11 +65,11 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { stats.guard = process.hrtime.bigint() authCtx = authContext stats.validate = stats.guard - const response = await methods.GetUserInfo({rpcName:'GetUserInfo', ctx:authContext }) + const response = await methods.GetUserInfo({ rpcName: 'GetUserInfo', ctx: authContext }) stats.handle = process.hrtime.bigint() - res({status: 'OK', ...response}) + res({ status: 'OK', ...response }) opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - }catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } break case 'AddProduct': try { @@ -81,11 +81,11 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { const error = Types.AddProductRequestValidate(request) stats.validate = process.hrtime.bigint() if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) - const response = await methods.AddProduct({rpcName:'AddProduct', ctx:authContext , req: request}) + const response = await methods.AddProduct({ rpcName: 'AddProduct', ctx: authContext, req: request }) stats.handle = process.hrtime.bigint() - res({status: 'OK', ...response}) + res({ status: 'OK', ...response }) opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - }catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } break case 'NewProductInvoice': try { @@ -94,11 +94,11 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { stats.guard = process.hrtime.bigint() authCtx = authContext stats.validate = stats.guard - const response = await methods.NewProductInvoice({rpcName:'NewProductInvoice', ctx:authContext ,query: req.query||{}}) + const response = await methods.NewProductInvoice({ rpcName: 'NewProductInvoice', ctx: authContext, query: req.query || {} }) stats.handle = process.hrtime.bigint() - res({status: 'OK', ...response}) + res({ status: 'OK', ...response }) opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - }catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } break case 'GetUserOperations': try { @@ -110,11 +110,11 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { const error = Types.GetUserOperationsRequestValidate(request) stats.validate = process.hrtime.bigint() if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) - const response = await methods.GetUserOperations({rpcName:'GetUserOperations', ctx:authContext , req: request}) + const response = await methods.GetUserOperations({ rpcName: 'GetUserOperations', ctx: authContext, req: request }) stats.handle = process.hrtime.bigint() - res({status: 'OK', ...response}) + res({ status: 'OK', ...response }) opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - }catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } break case 'NewAddress': try { @@ -126,11 +126,11 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { const error = Types.NewAddressRequestValidate(request) stats.validate = process.hrtime.bigint() if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) - const response = await methods.NewAddress({rpcName:'NewAddress', ctx:authContext , req: request}) + const response = await methods.NewAddress({ rpcName: 'NewAddress', ctx: authContext, req: request }) stats.handle = process.hrtime.bigint() - res({status: 'OK', ...response}) + res({ status: 'OK', ...response }) opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - }catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } break case 'PayAddress': try { @@ -142,11 +142,11 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { const error = Types.PayAddressRequestValidate(request) stats.validate = process.hrtime.bigint() if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) - const response = await methods.PayAddress({rpcName:'PayAddress', ctx:authContext , req: request}) + const response = await methods.PayAddress({ rpcName: 'PayAddress', ctx: authContext, req: request }) stats.handle = process.hrtime.bigint() - res({status: 'OK', ...response}) + res({ status: 'OK', ...response }) opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - }catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } break case 'NewInvoice': try { @@ -158,11 +158,11 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { const error = Types.NewInvoiceRequestValidate(request) stats.validate = process.hrtime.bigint() if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) - const response = await methods.NewInvoice({rpcName:'NewInvoice', ctx:authContext , req: request}) + const response = await methods.NewInvoice({ rpcName: 'NewInvoice', ctx: authContext, req: request }) stats.handle = process.hrtime.bigint() - res({status: 'OK', ...response}) + res({ status: 'OK', ...response }) opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - }catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } break case 'DecodeInvoice': try { @@ -174,11 +174,11 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { const error = Types.DecodeInvoiceRequestValidate(request) stats.validate = process.hrtime.bigint() if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) - const response = await methods.DecodeInvoice({rpcName:'DecodeInvoice', ctx:authContext , req: request}) + const response = await methods.DecodeInvoice({ rpcName: 'DecodeInvoice', ctx: authContext, req: request }) stats.handle = process.hrtime.bigint() - res({status: 'OK', ...response}) + res({ status: 'OK', ...response }) opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - }catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } break case 'PayInvoice': try { @@ -190,11 +190,11 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { const error = Types.PayInvoiceRequestValidate(request) stats.validate = process.hrtime.bigint() if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) - const response = await methods.PayInvoice({rpcName:'PayInvoice', ctx:authContext , req: request}) + const response = await methods.PayInvoice({ rpcName: 'PayInvoice', ctx: authContext, req: request }) stats.handle = process.hrtime.bigint() - res({status: 'OK', ...response}) + res({ status: 'OK', ...response }) opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - }catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } break case 'OpenChannel': try { @@ -206,11 +206,11 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { const error = Types.OpenChannelRequestValidate(request) stats.validate = process.hrtime.bigint() if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) - const response = await methods.OpenChannel({rpcName:'OpenChannel', ctx:authContext , req: request}) + const response = await methods.OpenChannel({ rpcName: 'OpenChannel', ctx: authContext, req: request }) stats.handle = process.hrtime.bigint() - res({status: 'OK', ...response}) + res({ status: 'OK', ...response }) opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - }catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } break case 'GetLnurlWithdrawLink': try { @@ -219,11 +219,11 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { stats.guard = process.hrtime.bigint() authCtx = authContext stats.validate = stats.guard - const response = await methods.GetLnurlWithdrawLink({rpcName:'GetLnurlWithdrawLink', ctx:authContext }) + const response = await methods.GetLnurlWithdrawLink({ rpcName: 'GetLnurlWithdrawLink', ctx: authContext }) stats.handle = process.hrtime.bigint() - res({status: 'OK', ...response}) + res({ status: 'OK', ...response }) opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - }catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } break case 'GetLnurlPayLink': try { @@ -232,11 +232,11 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { stats.guard = process.hrtime.bigint() authCtx = authContext stats.validate = stats.guard - const response = await methods.GetLnurlPayLink({rpcName:'GetLnurlPayLink', ctx:authContext }) + const response = await methods.GetLnurlPayLink({ rpcName: 'GetLnurlPayLink', ctx: authContext }) stats.handle = process.hrtime.bigint() - res({status: 'OK', ...response}) + res({ status: 'OK', ...response }) opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - }catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } break case 'GetLNURLChannelLink': try { @@ -245,11 +245,11 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { stats.guard = process.hrtime.bigint() authCtx = authContext stats.validate = stats.guard - const response = await methods.GetLNURLChannelLink({rpcName:'GetLNURLChannelLink', ctx:authContext }) + const response = await methods.GetLNURLChannelLink({ rpcName: 'GetLNURLChannelLink', ctx: authContext }) stats.handle = process.hrtime.bigint() - res({status: 'OK', ...response}) + res({ status: 'OK', ...response }) opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - }catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } break case 'GetLiveUserOperations': try { @@ -258,11 +258,13 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { stats.guard = process.hrtime.bigint() authCtx = authContext stats.validate = stats.guard - methods.GetLiveUserOperations({rpcName:'GetLiveUserOperations', ctx:authContext ,cb: (response, err) => { - stats.handle = process.hrtime.bigint() - if (err) { logErrorAndReturnResponse(err, err.message, res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback)} else { res({status: 'OK', ...response});opts.metricsCallback([{ ...info, ...stats, ...authContext }])} - }}) - }catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + methods.GetLiveUserOperations({ + rpcName: 'GetLiveUserOperations', ctx: authContext, cb: (response, err) => { + stats.handle = process.hrtime.bigint() + if (err) { logErrorAndReturnResponse(err, err.message, res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) } else { res({ status: 'OK', ...response }); opts.metricsCallback([{ ...info, ...stats, ...authContext }]) } + } + }) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } break case 'GetMigrationUpdate': try { @@ -271,17 +273,34 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { stats.guard = process.hrtime.bigint() authCtx = authContext stats.validate = stats.guard - methods.GetMigrationUpdate({rpcName:'GetMigrationUpdate', ctx:authContext ,cb: (response, err) => { - stats.handle = process.hrtime.bigint() - if (err) { logErrorAndReturnResponse(err, err.message, res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback)} else { res({status: 'OK', ...response});opts.metricsCallback([{ ...info, ...stats, ...authContext }])} - }}) - }catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + methods.GetMigrationUpdate({ + rpcName: 'GetMigrationUpdate', ctx: authContext, cb: (response, err) => { + stats.handle = process.hrtime.bigint() + if (err) { logErrorAndReturnResponse(err, err.message, res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) } else { res({ status: 'OK', ...response }); opts.metricsCallback([{ ...info, ...stats, ...authContext }]) } + } + }) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + break + case 'GetHttpCreds': + try { + if (!methods.GetHttpCreds) throw new Error('method: GetHttpCreds is not implemented') + const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = authContext + stats.validate = stats.guard + methods.GetHttpCreds({ + rpcName: 'GetHttpCreds', ctx: authContext, cb: (response, err) => { + stats.handle = process.hrtime.bigint() + if (err) { logErrorAndReturnResponse(err, err.message, res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) } else { res({ status: 'OK', ...response }); opts.metricsCallback([{ ...info, ...stats, ...authContext }]) } + } + }) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } break case 'BatchUser': try { info.batch = true const requests = req.body.requests as Types.UserMethodInputs[] - if (!Array.isArray(requests))throw new Error('invalid body, is not an array') + if (!Array.isArray(requests)) throw new Error('invalid body, is not an array') info.batchSize = requests.length if (requests.length > 10) throw new Error('too many requests in the batch') const ctx = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) @@ -295,7 +314,7 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { const opInfo: Types.RequestInfo = { rpcName: operation.rpcName, batch: true, nostr: true, batchSize: 0 } const opStats: Types.RequestStats = { startMs, start: startTime, parse: stats.parse, guard: stats.guard, validate: 0n, handle: 0n } try { - switch(operation.rpcName) { + switch (operation.rpcName) { case 'LinkNPubThroughToken': if (!methods.LinkNPubThroughToken) { throw new Error('method not defined: LinkNPubThroughToken') @@ -303,7 +322,7 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { const error = Types.LinkNPubThroughTokenRequestValidate(operation.req) opStats.validate = process.hrtime.bigint() if (error !== null) throw error - await methods.LinkNPubThroughToken({...operation, ctx}); responses.push({ status: 'OK' }) + await methods.LinkNPubThroughToken({ ...operation, ctx }); responses.push({ status: 'OK' }) opStats.handle = process.hrtime.bigint() callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) } @@ -313,7 +332,7 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { throw new Error('method not defined: UserHealth') } else { opStats.validate = opStats.guard - await methods.UserHealth({...operation, ctx}); responses.push({ status: 'OK' }) + await methods.UserHealth({ ...operation, ctx }); responses.push({ status: 'OK' }) opStats.handle = process.hrtime.bigint() callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) } @@ -323,7 +342,7 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { throw new Error('method not defined: GetUserInfo') } else { opStats.validate = opStats.guard - const res = await methods.GetUserInfo({...operation, ctx}); responses.push({ status: 'OK', ...res }) + const res = await methods.GetUserInfo({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) opStats.handle = process.hrtime.bigint() callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) } @@ -335,7 +354,7 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { const error = Types.AddProductRequestValidate(operation.req) opStats.validate = process.hrtime.bigint() if (error !== null) throw error - const res = await methods.AddProduct({...operation, ctx}); responses.push({ status: 'OK', ...res }) + const res = await methods.AddProduct({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) opStats.handle = process.hrtime.bigint() callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) } @@ -345,7 +364,7 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { throw new Error('method not defined: NewProductInvoice') } else { opStats.validate = opStats.guard - const res = await methods.NewProductInvoice({...operation, ctx}); responses.push({ status: 'OK', ...res }) + const res = await methods.NewProductInvoice({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) opStats.handle = process.hrtime.bigint() callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) } @@ -357,7 +376,7 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { const error = Types.GetUserOperationsRequestValidate(operation.req) opStats.validate = process.hrtime.bigint() if (error !== null) throw error - const res = await methods.GetUserOperations({...operation, ctx}); responses.push({ status: 'OK', ...res }) + const res = await methods.GetUserOperations({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) opStats.handle = process.hrtime.bigint() callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) } @@ -369,7 +388,7 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { const error = Types.NewAddressRequestValidate(operation.req) opStats.validate = process.hrtime.bigint() if (error !== null) throw error - const res = await methods.NewAddress({...operation, ctx}); responses.push({ status: 'OK', ...res }) + const res = await methods.NewAddress({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) opStats.handle = process.hrtime.bigint() callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) } @@ -381,7 +400,7 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { const error = Types.PayAddressRequestValidate(operation.req) opStats.validate = process.hrtime.bigint() if (error !== null) throw error - const res = await methods.PayAddress({...operation, ctx}); responses.push({ status: 'OK', ...res }) + const res = await methods.PayAddress({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) opStats.handle = process.hrtime.bigint() callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) } @@ -393,7 +412,7 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { const error = Types.NewInvoiceRequestValidate(operation.req) opStats.validate = process.hrtime.bigint() if (error !== null) throw error - const res = await methods.NewInvoice({...operation, ctx}); responses.push({ status: 'OK', ...res }) + const res = await methods.NewInvoice({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) opStats.handle = process.hrtime.bigint() callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) } @@ -405,7 +424,7 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { const error = Types.DecodeInvoiceRequestValidate(operation.req) opStats.validate = process.hrtime.bigint() if (error !== null) throw error - const res = await methods.DecodeInvoice({...operation, ctx}); responses.push({ status: 'OK', ...res }) + const res = await methods.DecodeInvoice({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) opStats.handle = process.hrtime.bigint() callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) } @@ -417,7 +436,7 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { const error = Types.PayInvoiceRequestValidate(operation.req) opStats.validate = process.hrtime.bigint() if (error !== null) throw error - const res = await methods.PayInvoice({...operation, ctx}); responses.push({ status: 'OK', ...res }) + const res = await methods.PayInvoice({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) opStats.handle = process.hrtime.bigint() callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) } @@ -429,7 +448,7 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { const error = Types.OpenChannelRequestValidate(operation.req) opStats.validate = process.hrtime.bigint() if (error !== null) throw error - const res = await methods.OpenChannel({...operation, ctx}); responses.push({ status: 'OK', ...res }) + const res = await methods.OpenChannel({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) opStats.handle = process.hrtime.bigint() callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) } @@ -439,7 +458,7 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { throw new Error('method not defined: GetLnurlWithdrawLink') } else { opStats.validate = opStats.guard - const res = await methods.GetLnurlWithdrawLink({...operation, ctx}); responses.push({ status: 'OK', ...res }) + const res = await methods.GetLnurlWithdrawLink({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) opStats.handle = process.hrtime.bigint() callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) } @@ -449,7 +468,7 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { throw new Error('method not defined: GetLnurlPayLink') } else { opStats.validate = opStats.guard - const res = await methods.GetLnurlPayLink({...operation, ctx}); responses.push({ status: 'OK', ...res }) + const res = await methods.GetLnurlPayLink({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) opStats.handle = process.hrtime.bigint() callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) } @@ -459,22 +478,22 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { throw new Error('method not defined: GetLNURLChannelLink') } else { opStats.validate = opStats.guard - const res = await methods.GetLNURLChannelLink({...operation, ctx}); responses.push({ status: 'OK', ...res }) + const res = await methods.GetLNURLChannelLink({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) opStats.handle = process.hrtime.bigint() callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) } break default: - throw new Error('unkown rpcName') + throw new Error('unkown rpcName') } - } catch(ex) {const e = ex as any; logger.error(e.message || e); callsMetrics.push({ ...opInfo, ...opStats, ...ctx, error: e.message }); responses.push({ status: 'ERROR', reason: e.message || e })} + } catch (ex) { const e = ex as any; logger.error(e.message || e); callsMetrics.push({ ...opInfo, ...opStats, ...ctx, error: e.message }); responses.push({ status: 'ERROR', reason: e.message || e }) } } stats.handle = process.hrtime.bigint() res({ status: 'OK', responses }) opts.metricsCallback([{ ...info, ...stats, ...ctx }, ...callsMetrics]) - }catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } break - default: logger.error('unknown rpc call name from nostr event:'+req.rpcName) + default: logger.error('unknown rpc call name from nostr event:' + req.rpcName) } } } diff --git a/proto/autogenerated/ts/types.ts b/proto/autogenerated/ts/types.ts index dd7bac7b..ec90cc06 100644 --- a/proto/autogenerated/ts/types.ts +++ b/proto/autogenerated/ts/types.ts @@ -186,6 +186,9 @@ export type GetLiveUserOperations_Output = ResultError | { status: 'OK' } export type GetMigrationUpdate_Input = {rpcName:'GetMigrationUpdate', cb:(res: MigrationUpdate, err:Error|null)=> void} export type GetMigrationUpdate_Output = ResultError | { status: 'OK' } +export type GetHttpCreds_Input = {rpcName:'GetHttpCreds', cb:(res: HttpCreds, err:Error|null)=> void} +export type GetHttpCreds_Output = ResultError | { status: 'OK' } + export type BatchUser_Input = UserMethodInputs export type BatchUser_Output = UserMethodOutputs @@ -234,6 +237,7 @@ export type ServerMethods = { GetLNURLChannelLink?: (req: GetLNURLChannelLink_Input & {ctx: UserContext }) => Promise GetLiveUserOperations?: (req: GetLiveUserOperations_Input & {ctx: UserContext }) => Promise GetMigrationUpdate?: (req: GetMigrationUpdate_Input & {ctx: UserContext }) => Promise + GetHttpCreds?: (req: GetHttpCreds_Input & {ctx: UserContext }) => Promise } export enum AddressType { @@ -262,35 +266,1058 @@ export type OptionsBaseMessage = { allOptionalsAreSet?: true } -export type OpenChannelRequest = { - destination: string - fundingAmount: number - pushAmount: number - closeAddress: string +export type NewAddressRequest = { + addressType: AddressType } -export const OpenChannelRequestOptionalFields: [] = [] -export type OpenChannelRequestOptions = OptionsBaseMessage & { +export const NewAddressRequestOptionalFields: [] = [] +export type NewAddressRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - destination_CustomCheck?: (v: string) => boolean - fundingAmount_CustomCheck?: (v: number) => boolean - pushAmount_CustomCheck?: (v: number) => boolean - closeAddress_CustomCheck?: (v: string) => boolean + addressType_CustomCheck?: (v: AddressType) => boolean } -export const OpenChannelRequestValidate = (o?: OpenChannelRequest, opts: OpenChannelRequestOptions = {}, path: string = 'OpenChannelRequest::root.'): Error | null => { +export const NewAddressRequestValidate = (o?: NewAddressRequest, opts: NewAddressRequestOptions = {}, path: string = 'NewAddressRequest::root.'): Error | null => { 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.destination !== 'string') return new Error(`${path}.destination: is not a string`) - if (opts.destination_CustomCheck && !opts.destination_CustomCheck(o.destination)) return new Error(`${path}.destination: custom check failed`) + if (!enumCheckAddressType(o.addressType)) return new Error(`${path}.addressType: is not a valid AddressType`) + if (opts.addressType_CustomCheck && !opts.addressType_CustomCheck(o.addressType)) return new Error(`${path}.addressType: custom check failed`) - if (typeof o.fundingAmount !== 'number') return new Error(`${path}.fundingAmount: is not a number`) - if (opts.fundingAmount_CustomCheck && !opts.fundingAmount_CustomCheck(o.fundingAmount)) return new Error(`${path}.fundingAmount: custom check failed`) + return null +} - if (typeof o.pushAmount !== 'number') return new Error(`${path}.pushAmount: is not a number`) - if (opts.pushAmount_CustomCheck && !opts.pushAmount_CustomCheck(o.pushAmount)) return new Error(`${path}.pushAmount: custom check failed`) +export type LnurlPayInfoResponse = { + tag: string + callback: string + maxSendable: number + minSendable: number + metadata: string + allowsNostr: boolean + nostrPubkey: string +} +export const LnurlPayInfoResponseOptionalFields: [] = [] +export type LnurlPayInfoResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + tag_CustomCheck?: (v: string) => boolean + callback_CustomCheck?: (v: string) => boolean + maxSendable_CustomCheck?: (v: number) => boolean + minSendable_CustomCheck?: (v: number) => boolean + metadata_CustomCheck?: (v: string) => boolean + allowsNostr_CustomCheck?: (v: boolean) => boolean + nostrPubkey_CustomCheck?: (v: string) => boolean +} +export const LnurlPayInfoResponseValidate = (o?: LnurlPayInfoResponse, opts: LnurlPayInfoResponseOptions = {}, path: string = 'LnurlPayInfoResponse::root.'): Error | null => { + 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.closeAddress !== 'string') return new Error(`${path}.closeAddress: is not a string`) - if (opts.closeAddress_CustomCheck && !opts.closeAddress_CustomCheck(o.closeAddress)) return new Error(`${path}.closeAddress: custom check failed`) + if (typeof o.tag !== 'string') return new Error(`${path}.tag: is not a string`) + if (opts.tag_CustomCheck && !opts.tag_CustomCheck(o.tag)) return new Error(`${path}.tag: custom check failed`) + + if (typeof o.callback !== 'string') return new Error(`${path}.callback: is not a string`) + if (opts.callback_CustomCheck && !opts.callback_CustomCheck(o.callback)) return new Error(`${path}.callback: custom check failed`) + + if (typeof o.maxSendable !== 'number') return new Error(`${path}.maxSendable: is not a number`) + if (opts.maxSendable_CustomCheck && !opts.maxSendable_CustomCheck(o.maxSendable)) return new Error(`${path}.maxSendable: custom check failed`) + + if (typeof o.minSendable !== 'number') return new Error(`${path}.minSendable: is not a number`) + if (opts.minSendable_CustomCheck && !opts.minSendable_CustomCheck(o.minSendable)) return new Error(`${path}.minSendable: custom check failed`) + + if (typeof o.metadata !== 'string') return new Error(`${path}.metadata: is not a string`) + if (opts.metadata_CustomCheck && !opts.metadata_CustomCheck(o.metadata)) return new Error(`${path}.metadata: custom check failed`) + + if (typeof o.allowsNostr !== 'boolean') return new Error(`${path}.allowsNostr: is not a boolean`) + if (opts.allowsNostr_CustomCheck && !opts.allowsNostr_CustomCheck(o.allowsNostr)) return new Error(`${path}.allowsNostr: custom check failed`) + + if (typeof o.nostrPubkey !== 'string') return new Error(`${path}.nostrPubkey: is not a string`) + if (opts.nostrPubkey_CustomCheck && !opts.nostrPubkey_CustomCheck(o.nostrPubkey)) return new Error(`${path}.nostrPubkey: custom check failed`) + + return null +} + +export type GetProductBuyLinkResponse = { + link: string +} +export const GetProductBuyLinkResponseOptionalFields: [] = [] +export type GetProductBuyLinkResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + link_CustomCheck?: (v: string) => boolean +} +export const GetProductBuyLinkResponseValidate = (o?: GetProductBuyLinkResponse, opts: GetProductBuyLinkResponseOptions = {}, path: string = 'GetProductBuyLinkResponse::root.'): Error | null => { + 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.link !== 'string') return new Error(`${path}.link: is not a string`) + if (opts.link_CustomCheck && !opts.link_CustomCheck(o.link)) return new Error(`${path}.link: custom check failed`) + + return null +} + +export type UsageMetrics = { + metrics: UsageMetric[] +} +export const UsageMetricsOptionalFields: [] = [] +export type UsageMetricsOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + metrics_ItemOptions?: UsageMetricOptions + metrics_CustomCheck?: (v: UsageMetric[]) => boolean +} +export const UsageMetricsValidate = (o?: UsageMetrics, opts: UsageMetricsOptions = {}, path: string = 'UsageMetrics::root.'): Error | null => { + 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 (!Array.isArray(o.metrics)) return new Error(`${path}.metrics: is not an array`) + for (let index = 0; index < o.metrics.length; index++) { + const metricsErr = UsageMetricValidate(o.metrics[index], opts.metrics_ItemOptions, `${path}.metrics[${index}]`) + if (metricsErr !== null) return metricsErr + } + if (opts.metrics_CustomCheck && !opts.metrics_CustomCheck(o.metrics)) return new Error(`${path}.metrics: custom check failed`) + + return null +} + +export type OpenChannel = { + channel_id: string + capacity: number + active: boolean + lifetime: number + local_balance: number + remote_balance: number +} +export const OpenChannelOptionalFields: [] = [] +export type OpenChannelOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + channel_id_CustomCheck?: (v: string) => boolean + capacity_CustomCheck?: (v: number) => boolean + active_CustomCheck?: (v: boolean) => boolean + lifetime_CustomCheck?: (v: number) => boolean + local_balance_CustomCheck?: (v: number) => boolean + remote_balance_CustomCheck?: (v: number) => boolean +} +export const OpenChannelValidate = (o?: OpenChannel, opts: OpenChannelOptions = {}, path: string = 'OpenChannel::root.'): Error | null => { + 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.channel_id !== 'string') return new Error(`${path}.channel_id: is not a string`) + if (opts.channel_id_CustomCheck && !opts.channel_id_CustomCheck(o.channel_id)) return new Error(`${path}.channel_id: custom check failed`) + + if (typeof o.capacity !== 'number') return new Error(`${path}.capacity: is not a number`) + if (opts.capacity_CustomCheck && !opts.capacity_CustomCheck(o.capacity)) return new Error(`${path}.capacity: custom check failed`) + + if (typeof o.active !== 'boolean') return new Error(`${path}.active: is not a boolean`) + if (opts.active_CustomCheck && !opts.active_CustomCheck(o.active)) return new Error(`${path}.active: custom check failed`) + + if (typeof o.lifetime !== 'number') return new Error(`${path}.lifetime: is not a number`) + if (opts.lifetime_CustomCheck && !opts.lifetime_CustomCheck(o.lifetime)) return new Error(`${path}.lifetime: custom check failed`) + + if (typeof o.local_balance !== 'number') return new Error(`${path}.local_balance: is not a number`) + if (opts.local_balance_CustomCheck && !opts.local_balance_CustomCheck(o.local_balance)) return new Error(`${path}.local_balance: custom check failed`) + + if (typeof o.remote_balance !== 'number') return new Error(`${path}.remote_balance: is not a number`) + if (opts.remote_balance_CustomCheck && !opts.remote_balance_CustomCheck(o.remote_balance)) return new Error(`${path}.remote_balance: custom check failed`) + + return null +} + +export type DecodeInvoiceResponse = { + amount: number +} +export const DecodeInvoiceResponseOptionalFields: [] = [] +export type DecodeInvoiceResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + amount_CustomCheck?: (v: number) => boolean +} +export const DecodeInvoiceResponseValidate = (o?: DecodeInvoiceResponse, opts: DecodeInvoiceResponseOptions = {}, path: string = 'DecodeInvoiceResponse::root.'): Error | null => { + 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.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + return null +} + +export type UsersInfo = { + total: number + no_balance: number + negative_balance: number + always_been_inactive: number + balance_avg: number + balance_median: number +} +export const UsersInfoOptionalFields: [] = [] +export type UsersInfoOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + total_CustomCheck?: (v: number) => boolean + no_balance_CustomCheck?: (v: number) => boolean + negative_balance_CustomCheck?: (v: number) => boolean + always_been_inactive_CustomCheck?: (v: number) => boolean + balance_avg_CustomCheck?: (v: number) => boolean + balance_median_CustomCheck?: (v: number) => boolean +} +export const UsersInfoValidate = (o?: UsersInfo, opts: UsersInfoOptions = {}, path: string = 'UsersInfo::root.'): Error | null => { + 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.total !== 'number') return new Error(`${path}.total: is not a number`) + if (opts.total_CustomCheck && !opts.total_CustomCheck(o.total)) return new Error(`${path}.total: custom check failed`) + + if (typeof o.no_balance !== 'number') return new Error(`${path}.no_balance: is not a number`) + if (opts.no_balance_CustomCheck && !opts.no_balance_CustomCheck(o.no_balance)) return new Error(`${path}.no_balance: custom check failed`) + + if (typeof o.negative_balance !== 'number') return new Error(`${path}.negative_balance: is not a number`) + if (opts.negative_balance_CustomCheck && !opts.negative_balance_CustomCheck(o.negative_balance)) return new Error(`${path}.negative_balance: custom check failed`) + + if (typeof o.always_been_inactive !== 'number') return new Error(`${path}.always_been_inactive: is not a number`) + if (opts.always_been_inactive_CustomCheck && !opts.always_been_inactive_CustomCheck(o.always_been_inactive)) return new Error(`${path}.always_been_inactive: custom check failed`) + + if (typeof o.balance_avg !== 'number') return new Error(`${path}.balance_avg: is not a number`) + if (opts.balance_avg_CustomCheck && !opts.balance_avg_CustomCheck(o.balance_avg)) return new Error(`${path}.balance_avg: custom check failed`) + + if (typeof o.balance_median !== 'number') return new Error(`${path}.balance_median: is not a number`) + if (opts.balance_median_CustomCheck && !opts.balance_median_CustomCheck(o.balance_median)) return new Error(`${path}.balance_median: custom check failed`) + + return null +} + +export type AddAppRequest = { + name: string + allow_user_creation: boolean +} +export const AddAppRequestOptionalFields: [] = [] +export type AddAppRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + name_CustomCheck?: (v: string) => boolean + allow_user_creation_CustomCheck?: (v: boolean) => boolean +} +export const AddAppRequestValidate = (o?: AddAppRequest, opts: AddAppRequestOptions = {}, path: string = 'AddAppRequest::root.'): Error | null => { + 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.name !== 'string') return new Error(`${path}.name: is not a string`) + if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) + + if (typeof o.allow_user_creation !== 'boolean') return new Error(`${path}.allow_user_creation: is not a boolean`) + if (opts.allow_user_creation_CustomCheck && !opts.allow_user_creation_CustomCheck(o.allow_user_creation)) return new Error(`${path}.allow_user_creation: custom check failed`) + + return null +} + +export type LndMetrics = { + nodes: LndNodeMetrics[] +} +export const LndMetricsOptionalFields: [] = [] +export type LndMetricsOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + nodes_ItemOptions?: LndNodeMetricsOptions + nodes_CustomCheck?: (v: LndNodeMetrics[]) => boolean +} +export const LndMetricsValidate = (o?: LndMetrics, opts: LndMetricsOptions = {}, path: string = 'LndMetrics::root.'): Error | null => { + 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 (!Array.isArray(o.nodes)) return new Error(`${path}.nodes: is not an array`) + for (let index = 0; index < o.nodes.length; index++) { + const nodesErr = LndNodeMetricsValidate(o.nodes[index], opts.nodes_ItemOptions, `${path}.nodes[${index}]`) + if (nodesErr !== null) return nodesErr + } + if (opts.nodes_CustomCheck && !opts.nodes_CustomCheck(o.nodes)) return new Error(`${path}.nodes: custom check failed`) + + return null +} + +export type AddProductRequest = { + name: string + price_sats: number +} +export const AddProductRequestOptionalFields: [] = [] +export type AddProductRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + name_CustomCheck?: (v: string) => boolean + price_sats_CustomCheck?: (v: number) => boolean +} +export const AddProductRequestValidate = (o?: AddProductRequest, opts: AddProductRequestOptions = {}, path: string = 'AddProductRequest::root.'): Error | null => { + 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.name !== 'string') return new Error(`${path}.name: is not a string`) + if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) + + if (typeof o.price_sats !== 'number') return new Error(`${path}.price_sats: is not a number`) + if (opts.price_sats_CustomCheck && !opts.price_sats_CustomCheck(o.price_sats)) return new Error(`${path}.price_sats: custom check failed`) + + return null +} + +export type PayInvoiceResponse = { + preimage: string + amount_paid: number + operation_id: string + service_fee: number + network_fee: number +} +export const PayInvoiceResponseOptionalFields: [] = [] +export type PayInvoiceResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + preimage_CustomCheck?: (v: string) => boolean + amount_paid_CustomCheck?: (v: number) => boolean + operation_id_CustomCheck?: (v: string) => boolean + service_fee_CustomCheck?: (v: number) => boolean + network_fee_CustomCheck?: (v: number) => boolean +} +export const PayInvoiceResponseValidate = (o?: PayInvoiceResponse, opts: PayInvoiceResponseOptions = {}, path: string = 'PayInvoiceResponse::root.'): Error | null => { + 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.preimage !== 'string') return new Error(`${path}.preimage: is not a string`) + if (opts.preimage_CustomCheck && !opts.preimage_CustomCheck(o.preimage)) return new Error(`${path}.preimage: custom check failed`) + + if (typeof o.amount_paid !== 'number') return new Error(`${path}.amount_paid: is not a number`) + if (opts.amount_paid_CustomCheck && !opts.amount_paid_CustomCheck(o.amount_paid)) return new Error(`${path}.amount_paid: custom check failed`) + + if (typeof o.operation_id !== 'string') return new Error(`${path}.operation_id: is not a string`) + if (opts.operation_id_CustomCheck && !opts.operation_id_CustomCheck(o.operation_id)) return new Error(`${path}.operation_id: custom check failed`) + + if (typeof o.service_fee !== 'number') return new Error(`${path}.service_fee: is not a number`) + if (opts.service_fee_CustomCheck && !opts.service_fee_CustomCheck(o.service_fee)) return new Error(`${path}.service_fee: custom check failed`) + + if (typeof o.network_fee !== 'number') return new Error(`${path}.network_fee: is not a number`) + if (opts.network_fee_CustomCheck && !opts.network_fee_CustomCheck(o.network_fee)) return new Error(`${path}.network_fee: custom check failed`) + + return null +} + +export type UserInfo = { + userId: string + balance: number + max_withdrawable: number + user_identifier: string +} +export const UserInfoOptionalFields: [] = [] +export type UserInfoOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + userId_CustomCheck?: (v: string) => boolean + balance_CustomCheck?: (v: number) => boolean + max_withdrawable_CustomCheck?: (v: number) => boolean + user_identifier_CustomCheck?: (v: string) => boolean +} +export const UserInfoValidate = (o?: UserInfo, opts: UserInfoOptions = {}, path: string = 'UserInfo::root.'): Error | null => { + 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.userId !== 'string') return new Error(`${path}.userId: is not a string`) + if (opts.userId_CustomCheck && !opts.userId_CustomCheck(o.userId)) return new Error(`${path}.userId: custom check failed`) + + if (typeof o.balance !== 'number') return new Error(`${path}.balance: is not a number`) + if (opts.balance_CustomCheck && !opts.balance_CustomCheck(o.balance)) return new Error(`${path}.balance: custom check failed`) + + if (typeof o.max_withdrawable !== 'number') return new Error(`${path}.max_withdrawable: is not a number`) + if (opts.max_withdrawable_CustomCheck && !opts.max_withdrawable_CustomCheck(o.max_withdrawable)) return new Error(`${path}.max_withdrawable: custom check failed`) + + if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) + if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) + + return null +} + +export type MigrationUpdate = { + closure?: ClosureMigration + relays?: RelaysMigration +} +export type MigrationUpdateOptionalField = 'closure' | 'relays' +export const MigrationUpdateOptionalFields: MigrationUpdateOptionalField[] = ['closure', 'relays'] +export type MigrationUpdateOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: MigrationUpdateOptionalField[] + closure_Options?: ClosureMigrationOptions + relays_Options?: RelaysMigrationOptions +} +export const MigrationUpdateValidate = (o?: MigrationUpdate, opts: MigrationUpdateOptions = {}, path: string = 'MigrationUpdate::root.'): Error | null => { + 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.closure === 'object' || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('closure')) { + const closureErr = ClosureMigrationValidate(o.closure, opts.closure_Options, `${path}.closure`) + if (closureErr !== null) return closureErr + } + + + if (typeof o.relays === 'object' || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('relays')) { + const relaysErr = RelaysMigrationValidate(o.relays, opts.relays_Options, `${path}.relays`) + if (relaysErr !== null) return relaysErr + } + + + return null +} + +export type LinkNPubThroughTokenRequest = { + token: string + nostr_pub: string +} +export const LinkNPubThroughTokenRequestOptionalFields: [] = [] +export type LinkNPubThroughTokenRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + token_CustomCheck?: (v: string) => boolean + nostr_pub_CustomCheck?: (v: string) => boolean +} +export const LinkNPubThroughTokenRequestValidate = (o?: LinkNPubThroughTokenRequest, opts: LinkNPubThroughTokenRequestOptions = {}, path: string = 'LinkNPubThroughTokenRequest::root.'): Error | null => { + 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.token !== 'string') return new Error(`${path}.token: is not a string`) + if (opts.token_CustomCheck && !opts.token_CustomCheck(o.token)) return new Error(`${path}.token: custom check failed`) + + if (typeof o.nostr_pub !== 'string') return new Error(`${path}.nostr_pub: is not a string`) + if (opts.nostr_pub_CustomCheck && !opts.nostr_pub_CustomCheck(o.nostr_pub)) return new Error(`${path}.nostr_pub: custom check failed`) + + return null +} + +export type Empty = { +} +export const EmptyOptionalFields: [] = [] +export type EmptyOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] +} +export const EmptyValidate = (o?: Empty, opts: EmptyOptions = {}, path: string = 'Empty::root.'): Error | null => { + 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') + + return null +} + +export type ChannelRouting = { + channel_id: string + send_errors: number + receive_errors: number + forward_errors_as_input: number + forward_errors_as_output: number + missed_forward_fee_as_input: number + missed_forward_fee_as_output: number + forward_fee_as_input: number + forward_fee_as_output: number + events_number: number +} +export const ChannelRoutingOptionalFields: [] = [] +export type ChannelRoutingOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + channel_id_CustomCheck?: (v: string) => boolean + send_errors_CustomCheck?: (v: number) => boolean + receive_errors_CustomCheck?: (v: number) => boolean + forward_errors_as_input_CustomCheck?: (v: number) => boolean + forward_errors_as_output_CustomCheck?: (v: number) => boolean + missed_forward_fee_as_input_CustomCheck?: (v: number) => boolean + missed_forward_fee_as_output_CustomCheck?: (v: number) => boolean + forward_fee_as_input_CustomCheck?: (v: number) => boolean + forward_fee_as_output_CustomCheck?: (v: number) => boolean + events_number_CustomCheck?: (v: number) => boolean +} +export const ChannelRoutingValidate = (o?: ChannelRouting, opts: ChannelRoutingOptions = {}, path: string = 'ChannelRouting::root.'): Error | null => { + 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.channel_id !== 'string') return new Error(`${path}.channel_id: is not a string`) + if (opts.channel_id_CustomCheck && !opts.channel_id_CustomCheck(o.channel_id)) return new Error(`${path}.channel_id: custom check failed`) + + if (typeof o.send_errors !== 'number') return new Error(`${path}.send_errors: is not a number`) + if (opts.send_errors_CustomCheck && !opts.send_errors_CustomCheck(o.send_errors)) return new Error(`${path}.send_errors: custom check failed`) + + if (typeof o.receive_errors !== 'number') return new Error(`${path}.receive_errors: is not a number`) + if (opts.receive_errors_CustomCheck && !opts.receive_errors_CustomCheck(o.receive_errors)) return new Error(`${path}.receive_errors: custom check failed`) + + if (typeof o.forward_errors_as_input !== 'number') return new Error(`${path}.forward_errors_as_input: is not a number`) + if (opts.forward_errors_as_input_CustomCheck && !opts.forward_errors_as_input_CustomCheck(o.forward_errors_as_input)) return new Error(`${path}.forward_errors_as_input: custom check failed`) + + if (typeof o.forward_errors_as_output !== 'number') return new Error(`${path}.forward_errors_as_output: is not a number`) + if (opts.forward_errors_as_output_CustomCheck && !opts.forward_errors_as_output_CustomCheck(o.forward_errors_as_output)) return new Error(`${path}.forward_errors_as_output: custom check failed`) + + if (typeof o.missed_forward_fee_as_input !== 'number') return new Error(`${path}.missed_forward_fee_as_input: is not a number`) + if (opts.missed_forward_fee_as_input_CustomCheck && !opts.missed_forward_fee_as_input_CustomCheck(o.missed_forward_fee_as_input)) return new Error(`${path}.missed_forward_fee_as_input: custom check failed`) + + if (typeof o.missed_forward_fee_as_output !== 'number') return new Error(`${path}.missed_forward_fee_as_output: is not a number`) + if (opts.missed_forward_fee_as_output_CustomCheck && !opts.missed_forward_fee_as_output_CustomCheck(o.missed_forward_fee_as_output)) return new Error(`${path}.missed_forward_fee_as_output: custom check failed`) + + if (typeof o.forward_fee_as_input !== 'number') return new Error(`${path}.forward_fee_as_input: is not a number`) + if (opts.forward_fee_as_input_CustomCheck && !opts.forward_fee_as_input_CustomCheck(o.forward_fee_as_input)) return new Error(`${path}.forward_fee_as_input: custom check failed`) + + if (typeof o.forward_fee_as_output !== 'number') return new Error(`${path}.forward_fee_as_output: is not a number`) + if (opts.forward_fee_as_output_CustomCheck && !opts.forward_fee_as_output_CustomCheck(o.forward_fee_as_output)) return new Error(`${path}.forward_fee_as_output: custom check failed`) + + if (typeof o.events_number !== 'number') return new Error(`${path}.events_number: is not a number`) + if (opts.events_number_CustomCheck && !opts.events_number_CustomCheck(o.events_number)) return new Error(`${path}.events_number: custom check failed`) + + return null +} + +export type PayAddressRequest = { + address: string + amoutSats: number + satsPerVByte: number +} +export const PayAddressRequestOptionalFields: [] = [] +export type PayAddressRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + address_CustomCheck?: (v: string) => boolean + amoutSats_CustomCheck?: (v: number) => boolean + satsPerVByte_CustomCheck?: (v: number) => boolean +} +export const PayAddressRequestValidate = (o?: PayAddressRequest, opts: PayAddressRequestOptions = {}, path: string = 'PayAddressRequest::root.'): Error | null => { + 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.address !== 'string') return new Error(`${path}.address: is not a string`) + if (opts.address_CustomCheck && !opts.address_CustomCheck(o.address)) return new Error(`${path}.address: custom check failed`) + + if (typeof o.amoutSats !== 'number') return new Error(`${path}.amoutSats: is not a number`) + if (opts.amoutSats_CustomCheck && !opts.amoutSats_CustomCheck(o.amoutSats)) return new Error(`${path}.amoutSats: custom check failed`) + + if (typeof o.satsPerVByte !== 'number') return new Error(`${path}.satsPerVByte: is not a number`) + if (opts.satsPerVByte_CustomCheck && !opts.satsPerVByte_CustomCheck(o.satsPerVByte)) return new Error(`${path}.satsPerVByte: custom check failed`) + + return null +} + +export type PayAddressResponse = { + txId: string + operation_id: string + service_fee: number + network_fee: number +} +export const PayAddressResponseOptionalFields: [] = [] +export type PayAddressResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + txId_CustomCheck?: (v: string) => boolean + operation_id_CustomCheck?: (v: string) => boolean + service_fee_CustomCheck?: (v: number) => boolean + network_fee_CustomCheck?: (v: number) => boolean +} +export const PayAddressResponseValidate = (o?: PayAddressResponse, opts: PayAddressResponseOptions = {}, path: string = 'PayAddressResponse::root.'): Error | null => { + 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.txId !== 'string') return new Error(`${path}.txId: is not a string`) + if (opts.txId_CustomCheck && !opts.txId_CustomCheck(o.txId)) return new Error(`${path}.txId: custom check failed`) + + if (typeof o.operation_id !== 'string') return new Error(`${path}.operation_id: is not a string`) + if (opts.operation_id_CustomCheck && !opts.operation_id_CustomCheck(o.operation_id)) return new Error(`${path}.operation_id: custom check failed`) + + if (typeof o.service_fee !== 'number') return new Error(`${path}.service_fee: is not a number`) + if (opts.service_fee_CustomCheck && !opts.service_fee_CustomCheck(o.service_fee)) return new Error(`${path}.service_fee: custom check failed`) + + if (typeof o.network_fee !== 'number') return new Error(`${path}.network_fee: is not a number`) + if (opts.network_fee_CustomCheck && !opts.network_fee_CustomCheck(o.network_fee)) return new Error(`${path}.network_fee: custom check failed`) + + return null +} + +export type AuthApp = { + app: Application + auth_token: string +} +export const AuthAppOptionalFields: [] = [] +export type AuthAppOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + app_Options?: ApplicationOptions + auth_token_CustomCheck?: (v: string) => boolean +} +export const AuthAppValidate = (o?: AuthApp, opts: AuthAppOptions = {}, path: string = 'AuthApp::root.'): Error | null => { + 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') + + const appErr = ApplicationValidate(o.app, opts.app_Options, `${path}.app`) + if (appErr !== null) return appErr + + + if (typeof o.auth_token !== 'string') return new Error(`${path}.auth_token: is not a string`) + if (opts.auth_token_CustomCheck && !opts.auth_token_CustomCheck(o.auth_token)) return new Error(`${path}.auth_token: custom check failed`) + + return null +} + +export type AppMetrics = { + app: Application + users: UsersInfo + received: number + spent: number + available: number + fees: number + invoices: number + total_fees: number + operations: UserOperation[] +} +export const AppMetricsOptionalFields: [] = [] +export type AppMetricsOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + app_Options?: ApplicationOptions + users_Options?: UsersInfoOptions + received_CustomCheck?: (v: number) => boolean + spent_CustomCheck?: (v: number) => boolean + available_CustomCheck?: (v: number) => boolean + fees_CustomCheck?: (v: number) => boolean + invoices_CustomCheck?: (v: number) => boolean + total_fees_CustomCheck?: (v: number) => boolean + operations_ItemOptions?: UserOperationOptions + operations_CustomCheck?: (v: UserOperation[]) => boolean +} +export const AppMetricsValidate = (o?: AppMetrics, opts: AppMetricsOptions = {}, path: string = 'AppMetrics::root.'): Error | null => { + 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') + + const appErr = ApplicationValidate(o.app, opts.app_Options, `${path}.app`) + if (appErr !== null) return appErr + + + const usersErr = UsersInfoValidate(o.users, opts.users_Options, `${path}.users`) + if (usersErr !== null) return usersErr + + + if (typeof o.received !== 'number') return new Error(`${path}.received: is not a number`) + if (opts.received_CustomCheck && !opts.received_CustomCheck(o.received)) return new Error(`${path}.received: custom check failed`) + + if (typeof o.spent !== 'number') return new Error(`${path}.spent: is not a number`) + if (opts.spent_CustomCheck && !opts.spent_CustomCheck(o.spent)) return new Error(`${path}.spent: custom check failed`) + + if (typeof o.available !== 'number') return new Error(`${path}.available: is not a number`) + if (opts.available_CustomCheck && !opts.available_CustomCheck(o.available)) return new Error(`${path}.available: custom check failed`) + + if (typeof o.fees !== 'number') return new Error(`${path}.fees: is not a number`) + if (opts.fees_CustomCheck && !opts.fees_CustomCheck(o.fees)) return new Error(`${path}.fees: custom check failed`) + + if (typeof o.invoices !== 'number') return new Error(`${path}.invoices: is not a number`) + if (opts.invoices_CustomCheck && !opts.invoices_CustomCheck(o.invoices)) return new Error(`${path}.invoices: custom check failed`) + + if (typeof o.total_fees !== 'number') return new Error(`${path}.total_fees: is not a number`) + if (opts.total_fees_CustomCheck && !opts.total_fees_CustomCheck(o.total_fees)) return new Error(`${path}.total_fees: custom check failed`) + + if (!Array.isArray(o.operations)) return new Error(`${path}.operations: is not an array`) + for (let index = 0; index < o.operations.length; index++) { + const operationsErr = UserOperationValidate(o.operations[index], opts.operations_ItemOptions, `${path}.operations[${index}]`) + if (operationsErr !== null) return operationsErr + } + if (opts.operations_CustomCheck && !opts.operations_CustomCheck(o.operations)) return new Error(`${path}.operations: custom check failed`) + + return null +} + +export type BanUserResponse = { + balance_sats: number + banned_app_users: BannedAppUser[] +} +export const BanUserResponseOptionalFields: [] = [] +export type BanUserResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + balance_sats_CustomCheck?: (v: number) => boolean + banned_app_users_ItemOptions?: BannedAppUserOptions + banned_app_users_CustomCheck?: (v: BannedAppUser[]) => boolean +} +export const BanUserResponseValidate = (o?: BanUserResponse, opts: BanUserResponseOptions = {}, path: string = 'BanUserResponse::root.'): Error | null => { + 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.balance_sats !== 'number') return new Error(`${path}.balance_sats: is not a number`) + if (opts.balance_sats_CustomCheck && !opts.balance_sats_CustomCheck(o.balance_sats)) return new Error(`${path}.balance_sats: custom check failed`) + + if (!Array.isArray(o.banned_app_users)) return new Error(`${path}.banned_app_users: is not an array`) + for (let index = 0; index < o.banned_app_users.length; index++) { + const banned_app_usersErr = BannedAppUserValidate(o.banned_app_users[index], opts.banned_app_users_ItemOptions, `${path}.banned_app_users[${index}]`) + if (banned_app_usersErr !== null) return banned_app_usersErr + } + if (opts.banned_app_users_CustomCheck && !opts.banned_app_users_CustomCheck(o.banned_app_users)) return new Error(`${path}.banned_app_users: custom check failed`) + + return null +} + +export type GetAppUserRequest = { + user_identifier: string +} +export const GetAppUserRequestOptionalFields: [] = [] +export type GetAppUserRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + user_identifier_CustomCheck?: (v: string) => boolean +} +export const GetAppUserRequestValidate = (o?: GetAppUserRequest, opts: GetAppUserRequestOptions = {}, path: string = 'GetAppUserRequest::root.'): Error | null => { + 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.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) + if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) + + return null +} + +export type SetMockAppBalanceRequest = { + amount: number +} +export const SetMockAppBalanceRequestOptionalFields: [] = [] +export type SetMockAppBalanceRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + amount_CustomCheck?: (v: number) => boolean +} +export const SetMockAppBalanceRequestValidate = (o?: SetMockAppBalanceRequest, opts: SetMockAppBalanceRequestOptions = {}, path: string = 'SetMockAppBalanceRequest::root.'): Error | null => { + 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.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + return null +} + +export type DecodeInvoiceRequest = { + invoice: string +} +export const DecodeInvoiceRequestOptionalFields: [] = [] +export type DecodeInvoiceRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + invoice_CustomCheck?: (v: string) => boolean +} +export const DecodeInvoiceRequestValidate = (o?: DecodeInvoiceRequest, opts: DecodeInvoiceRequestOptions = {}, path: string = 'DecodeInvoiceRequest::root.'): Error | null => { + 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.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) + if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) + + return null +} + +export type RequestNPubLinkingTokenResponse = { + token: string +} +export const RequestNPubLinkingTokenResponseOptionalFields: [] = [] +export type RequestNPubLinkingTokenResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + token_CustomCheck?: (v: string) => boolean +} +export const RequestNPubLinkingTokenResponseValidate = (o?: RequestNPubLinkingTokenResponse, opts: RequestNPubLinkingTokenResponseOptions = {}, path: string = 'RequestNPubLinkingTokenResponse::root.'): Error | null => { + 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.token !== 'string') return new Error(`${path}.token: is not a string`) + if (opts.token_CustomCheck && !opts.token_CustomCheck(o.token)) return new Error(`${path}.token: custom check failed`) + + return null +} + +export type LndMetricsRequest = { + from_unix?: number + to_unix?: number +} +export type LndMetricsRequestOptionalField = 'from_unix' | 'to_unix' +export const LndMetricsRequestOptionalFields: LndMetricsRequestOptionalField[] = ['from_unix', 'to_unix'] +export type LndMetricsRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: LndMetricsRequestOptionalField[] + from_unix_CustomCheck?: (v?: number) => boolean + to_unix_CustomCheck?: (v?: number) => boolean +} +export const LndMetricsRequestValidate = (o?: LndMetricsRequest, opts: LndMetricsRequestOptions = {}, path: string = 'LndMetricsRequest::root.'): Error | null => { + 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 ((o.from_unix || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('from_unix')) && typeof o.from_unix !== 'number') return new Error(`${path}.from_unix: is not a number`) + if (opts.from_unix_CustomCheck && !opts.from_unix_CustomCheck(o.from_unix)) return new Error(`${path}.from_unix: custom check failed`) + + if ((o.to_unix || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('to_unix')) && typeof o.to_unix !== 'number') return new Error(`${path}.to_unix: is not a number`) + if (opts.to_unix_CustomCheck && !opts.to_unix_CustomCheck(o.to_unix)) return new Error(`${path}.to_unix: custom check failed`) + + return null +} + +export type BannedAppUser = { + app_name: string + app_id: string + user_identifier: string + nostr_pub: string +} +export const BannedAppUserOptionalFields: [] = [] +export type BannedAppUserOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + app_name_CustomCheck?: (v: string) => boolean + app_id_CustomCheck?: (v: string) => boolean + user_identifier_CustomCheck?: (v: string) => boolean + nostr_pub_CustomCheck?: (v: string) => boolean +} +export const BannedAppUserValidate = (o?: BannedAppUser, opts: BannedAppUserOptions = {}, path: string = 'BannedAppUser::root.'): Error | null => { + 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.app_name !== 'string') return new Error(`${path}.app_name: is not a string`) + if (opts.app_name_CustomCheck && !opts.app_name_CustomCheck(o.app_name)) return new Error(`${path}.app_name: custom check failed`) + + if (typeof o.app_id !== 'string') return new Error(`${path}.app_id: is not a string`) + if (opts.app_id_CustomCheck && !opts.app_id_CustomCheck(o.app_id)) return new Error(`${path}.app_id: custom check failed`) + + if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) + if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) + + if (typeof o.nostr_pub !== 'string') return new Error(`${path}.nostr_pub: is not a string`) + if (opts.nostr_pub_CustomCheck && !opts.nostr_pub_CustomCheck(o.nostr_pub)) return new Error(`${path}.nostr_pub: custom check failed`) + + return null +} + +export type SetMockAppUserBalanceRequest = { + user_identifier: string + amount: number +} +export const SetMockAppUserBalanceRequestOptionalFields: [] = [] +export type SetMockAppUserBalanceRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + user_identifier_CustomCheck?: (v: string) => boolean + amount_CustomCheck?: (v: number) => boolean +} +export const SetMockAppUserBalanceRequestValidate = (o?: SetMockAppUserBalanceRequest, opts: SetMockAppUserBalanceRequestOptions = {}, path: string = 'SetMockAppUserBalanceRequest::root.'): Error | null => { + 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.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) + if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + return null +} + +export type PayInvoiceRequest = { + invoice: string + amount: number +} +export const PayInvoiceRequestOptionalFields: [] = [] +export type PayInvoiceRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + invoice_CustomCheck?: (v: string) => boolean + amount_CustomCheck?: (v: number) => boolean +} +export const PayInvoiceRequestValidate = (o?: PayInvoiceRequest, opts: PayInvoiceRequestOptions = {}, path: string = 'PayInvoiceRequest::root.'): Error | null => { + 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.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) + if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + return null +} + +export type LndGetInfoRequest = { + nodeId: number +} +export const LndGetInfoRequestOptionalFields: [] = [] +export type LndGetInfoRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + nodeId_CustomCheck?: (v: number) => boolean +} +export const LndGetInfoRequestValidate = (o?: LndGetInfoRequest, opts: LndGetInfoRequestOptions = {}, path: string = 'LndGetInfoRequest::root.'): Error | null => { + 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.nodeId !== 'number') return new Error(`${path}.nodeId: is not a number`) + if (opts.nodeId_CustomCheck && !opts.nodeId_CustomCheck(o.nodeId)) return new Error(`${path}.nodeId: custom check failed`) + + return null +} + +export type AppUser = { + identifier: string + info: UserInfo + max_withdrawable: number +} +export const AppUserOptionalFields: [] = [] +export type AppUserOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + identifier_CustomCheck?: (v: string) => boolean + info_Options?: UserInfoOptions + max_withdrawable_CustomCheck?: (v: number) => boolean +} +export const AppUserValidate = (o?: AppUser, opts: AppUserOptions = {}, path: string = 'AppUser::root.'): Error | null => { + 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.identifier !== 'string') return new Error(`${path}.identifier: is not a string`) + if (opts.identifier_CustomCheck && !opts.identifier_CustomCheck(o.identifier)) return new Error(`${path}.identifier: custom check failed`) + + const infoErr = UserInfoValidate(o.info, opts.info_Options, `${path}.info`) + if (infoErr !== null) return infoErr + + + if (typeof o.max_withdrawable !== 'number') return new Error(`${path}.max_withdrawable: is not a number`) + if (opts.max_withdrawable_CustomCheck && !opts.max_withdrawable_CustomCheck(o.max_withdrawable)) return new Error(`${path}.max_withdrawable: custom check failed`) + + return null +} + +export type AddAppUserRequest = { + identifier: string + fail_if_exists: boolean + balance: number +} +export const AddAppUserRequestOptionalFields: [] = [] +export type AddAppUserRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + identifier_CustomCheck?: (v: string) => boolean + fail_if_exists_CustomCheck?: (v: boolean) => boolean + balance_CustomCheck?: (v: number) => boolean +} +export const AddAppUserRequestValidate = (o?: AddAppUserRequest, opts: AddAppUserRequestOptions = {}, path: string = 'AddAppUserRequest::root.'): Error | null => { + 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.identifier !== 'string') return new Error(`${path}.identifier: is not a string`) + if (opts.identifier_CustomCheck && !opts.identifier_CustomCheck(o.identifier)) return new Error(`${path}.identifier: custom check failed`) + + if (typeof o.fail_if_exists !== 'boolean') return new Error(`${path}.fail_if_exists: is not a boolean`) + if (opts.fail_if_exists_CustomCheck && !opts.fail_if_exists_CustomCheck(o.fail_if_exists)) return new Error(`${path}.fail_if_exists: custom check failed`) + + if (typeof o.balance !== 'number') return new Error(`${path}.balance: is not a number`) + if (opts.balance_CustomCheck && !opts.balance_CustomCheck(o.balance)) return new Error(`${path}.balance: custom check failed`) + + return null +} + +export type NewInvoiceResponse = { + invoice: string +} +export const NewInvoiceResponseOptionalFields: [] = [] +export type NewInvoiceResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + invoice_CustomCheck?: (v: string) => boolean +} +export const NewInvoiceResponseValidate = (o?: NewInvoiceResponse, opts: NewInvoiceResponseOptions = {}, path: string = 'NewInvoiceResponse::root.'): Error | null => { + 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.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) + if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) + + return null +} + +export type NewAddressResponse = { + address: string +} +export const NewAddressResponseOptionalFields: [] = [] +export type NewAddressResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + address_CustomCheck?: (v: string) => boolean +} +export const NewAddressResponseValidate = (o?: NewAddressResponse, opts: NewAddressResponseOptions = {}, path: string = 'NewAddressResponse::root.'): Error | null => { + 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.address !== 'string') return new Error(`${path}.address: is not a string`) + if (opts.address_CustomCheck && !opts.address_CustomCheck(o.address)) return new Error(`${path}.address: custom check failed`) + + return null +} + +export type AppsMetrics = { + apps: AppMetrics[] +} +export const AppsMetricsOptionalFields: [] = [] +export type AppsMetricsOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + apps_ItemOptions?: AppMetricsOptions + apps_CustomCheck?: (v: AppMetrics[]) => boolean +} +export const AppsMetricsValidate = (o?: AppsMetrics, opts: AppsMetricsOptions = {}, path: string = 'AppsMetrics::root.'): Error | null => { + 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 (!Array.isArray(o.apps)) return new Error(`${path}.apps: is not an array`) + for (let index = 0; index < o.apps.length; index++) { + const appsErr = AppMetricsValidate(o.apps[index], opts.apps_ItemOptions, `${path}.apps[${index}]`) + if (appsErr !== null) return appsErr + } + if (opts.apps_CustomCheck && !opts.apps_CustomCheck(o.apps)) return new Error(`${path}.apps: custom check failed`) + + return null +} + +export type LndGetInfoResponse = { + alias: string +} +export const LndGetInfoResponseOptionalFields: [] = [] +export type LndGetInfoResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + alias_CustomCheck?: (v: string) => boolean +} +export const LndGetInfoResponseValidate = (o?: LndGetInfoResponse, opts: LndGetInfoResponseOptions = {}, path: string = 'LndGetInfoResponse::root.'): Error | null => { + 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.alias !== 'string') return new Error(`${path}.alias: is not a string`) + if (opts.alias_CustomCheck && !opts.alias_CustomCheck(o.alias)) return new Error(`${path}.alias: custom check failed`) + + return null +} + +export type SendAppUserToAppPaymentRequest = { + from_user_identifier: string + amount: number +} +export const SendAppUserToAppPaymentRequestOptionalFields: [] = [] +export type SendAppUserToAppPaymentRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + from_user_identifier_CustomCheck?: (v: string) => boolean + amount_CustomCheck?: (v: number) => boolean +} +export const SendAppUserToAppPaymentRequestValidate = (o?: SendAppUserToAppPaymentRequest, opts: SendAppUserToAppPaymentRequestOptions = {}, path: string = 'SendAppUserToAppPaymentRequest::root.'): Error | null => { + 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.from_user_identifier !== 'string') return new Error(`${path}.from_user_identifier: is not a string`) + if (opts.from_user_identifier_CustomCheck && !opts.from_user_identifier_CustomCheck(o.from_user_identifier)) return new Error(`${path}.from_user_identifier: custom check failed`) + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + return null +} + +export type GetUserOperationsRequest = { + latestIncomingInvoice: number + latestOutgoingInvoice: number + latestIncomingTx: number + latestOutgoingTx: number + latestIncomingUserToUserPayment: number + latestOutgoingUserToUserPayment: number + max_size: number +} +export const GetUserOperationsRequestOptionalFields: [] = [] +export type GetUserOperationsRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + latestIncomingInvoice_CustomCheck?: (v: number) => boolean + latestOutgoingInvoice_CustomCheck?: (v: number) => boolean + latestIncomingTx_CustomCheck?: (v: number) => boolean + latestOutgoingTx_CustomCheck?: (v: number) => boolean + latestIncomingUserToUserPayment_CustomCheck?: (v: number) => boolean + latestOutgoingUserToUserPayment_CustomCheck?: (v: number) => boolean + max_size_CustomCheck?: (v: number) => boolean +} +export const GetUserOperationsRequestValidate = (o?: GetUserOperationsRequest, opts: GetUserOperationsRequestOptions = {}, path: string = 'GetUserOperationsRequest::root.'): Error | null => { + 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.latestIncomingInvoice !== 'number') return new Error(`${path}.latestIncomingInvoice: is not a number`) + if (opts.latestIncomingInvoice_CustomCheck && !opts.latestIncomingInvoice_CustomCheck(o.latestIncomingInvoice)) return new Error(`${path}.latestIncomingInvoice: custom check failed`) + + if (typeof o.latestOutgoingInvoice !== 'number') return new Error(`${path}.latestOutgoingInvoice: is not a number`) + if (opts.latestOutgoingInvoice_CustomCheck && !opts.latestOutgoingInvoice_CustomCheck(o.latestOutgoingInvoice)) return new Error(`${path}.latestOutgoingInvoice: custom check failed`) + + if (typeof o.latestIncomingTx !== 'number') return new Error(`${path}.latestIncomingTx: is not a number`) + if (opts.latestIncomingTx_CustomCheck && !opts.latestIncomingTx_CustomCheck(o.latestIncomingTx)) return new Error(`${path}.latestIncomingTx: custom check failed`) + + if (typeof o.latestOutgoingTx !== 'number') return new Error(`${path}.latestOutgoingTx: is not a number`) + if (opts.latestOutgoingTx_CustomCheck && !opts.latestOutgoingTx_CustomCheck(o.latestOutgoingTx)) return new Error(`${path}.latestOutgoingTx: custom check failed`) + + if (typeof o.latestIncomingUserToUserPayment !== 'number') return new Error(`${path}.latestIncomingUserToUserPayment: is not a number`) + if (opts.latestIncomingUserToUserPayment_CustomCheck && !opts.latestIncomingUserToUserPayment_CustomCheck(o.latestIncomingUserToUserPayment)) return new Error(`${path}.latestIncomingUserToUserPayment: custom check failed`) + + if (typeof o.latestOutgoingUserToUserPayment !== 'number') return new Error(`${path}.latestOutgoingUserToUserPayment: is not a number`) + if (opts.latestOutgoingUserToUserPayment_CustomCheck && !opts.latestOutgoingUserToUserPayment_CustomCheck(o.latestOutgoingUserToUserPayment)) return new Error(`${path}.latestOutgoingUserToUserPayment: custom check failed`) + + if (typeof o.max_size !== 'number') return new Error(`${path}.max_size: is not a number`) + if (opts.max_size_CustomCheck && !opts.max_size_CustomCheck(o.max_size)) return new Error(`${path}.max_size: custom check failed`) return null } @@ -344,29 +1371,929 @@ export const GetUserOperationsResponseValidate = (o?: GetUserOperationsResponse, return null } -export type AddProductRequest = { - name: string - price_sats: number +export type BanUserRequest = { + user_id: string } -export const AddProductRequestOptionalFields: [] = [] -export type AddProductRequestOptions = OptionsBaseMessage & { +export const BanUserRequestOptionalFields: [] = [] +export type BanUserRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - name_CustomCheck?: (v: string) => boolean - price_sats_CustomCheck?: (v: number) => boolean + user_id_CustomCheck?: (v: string) => boolean } -export const AddProductRequestValidate = (o?: AddProductRequest, opts: AddProductRequestOptions = {}, path: string = 'AddProductRequest::root.'): Error | null => { +export const BanUserRequestValidate = (o?: BanUserRequest, opts: BanUserRequestOptions = {}, path: string = 'BanUserRequest::root.'): Error | null => { + 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.user_id !== 'string') return new Error(`${path}.user_id: is not a string`) + if (opts.user_id_CustomCheck && !opts.user_id_CustomCheck(o.user_id)) return new Error(`${path}.user_id: custom check failed`) + + return null +} + +export type SendAppUserToAppUserPaymentRequest = { + from_user_identifier: string + to_user_identifier: string + amount: number +} +export const SendAppUserToAppUserPaymentRequestOptionalFields: [] = [] +export type SendAppUserToAppUserPaymentRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + from_user_identifier_CustomCheck?: (v: string) => boolean + to_user_identifier_CustomCheck?: (v: string) => boolean + amount_CustomCheck?: (v: number) => boolean +} +export const SendAppUserToAppUserPaymentRequestValidate = (o?: SendAppUserToAppUserPaymentRequest, opts: SendAppUserToAppUserPaymentRequestOptions = {}, path: string = 'SendAppUserToAppUserPaymentRequest::root.'): Error | null => { + 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.from_user_identifier !== 'string') return new Error(`${path}.from_user_identifier: is not a string`) + if (opts.from_user_identifier_CustomCheck && !opts.from_user_identifier_CustomCheck(o.from_user_identifier)) return new Error(`${path}.from_user_identifier: custom check failed`) + + if (typeof o.to_user_identifier !== 'string') return new Error(`${path}.to_user_identifier: is not a string`) + if (opts.to_user_identifier_CustomCheck && !opts.to_user_identifier_CustomCheck(o.to_user_identifier)) return new Error(`${path}.to_user_identifier: custom check failed`) + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + return null +} + +export type AddAppInvoiceRequest = { + payer_identifier: string + http_callback_url: string + invoice_req: NewInvoiceRequest +} +export const AddAppInvoiceRequestOptionalFields: [] = [] +export type AddAppInvoiceRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + payer_identifier_CustomCheck?: (v: string) => boolean + http_callback_url_CustomCheck?: (v: string) => boolean + invoice_req_Options?: NewInvoiceRequestOptions +} +export const AddAppInvoiceRequestValidate = (o?: AddAppInvoiceRequest, opts: AddAppInvoiceRequestOptions = {}, path: string = 'AddAppInvoiceRequest::root.'): Error | null => { + 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.payer_identifier !== 'string') return new Error(`${path}.payer_identifier: is not a string`) + if (opts.payer_identifier_CustomCheck && !opts.payer_identifier_CustomCheck(o.payer_identifier)) return new Error(`${path}.payer_identifier: custom check failed`) + + if (typeof o.http_callback_url !== 'string') return new Error(`${path}.http_callback_url: is not a string`) + if (opts.http_callback_url_CustomCheck && !opts.http_callback_url_CustomCheck(o.http_callback_url)) return new Error(`${path}.http_callback_url: custom check failed`) + + const invoice_reqErr = NewInvoiceRequestValidate(o.invoice_req, opts.invoice_req_Options, `${path}.invoice_req`) + if (invoice_reqErr !== null) return invoice_reqErr + + + return null +} + +export type GetAppUserLNURLInfoRequest = { + user_identifier: string + base_url_override: string +} +export const GetAppUserLNURLInfoRequestOptionalFields: [] = [] +export type GetAppUserLNURLInfoRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + user_identifier_CustomCheck?: (v: string) => boolean + base_url_override_CustomCheck?: (v: string) => boolean +} +export const GetAppUserLNURLInfoRequestValidate = (o?: GetAppUserLNURLInfoRequest, opts: GetAppUserLNURLInfoRequestOptions = {}, path: string = 'GetAppUserLNURLInfoRequest::root.'): Error | null => { + 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.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) + if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) + + if (typeof o.base_url_override !== 'string') return new Error(`${path}.base_url_override: is not a string`) + if (opts.base_url_override_CustomCheck && !opts.base_url_override_CustomCheck(o.base_url_override)) return new Error(`${path}.base_url_override: custom check failed`) + + return null +} + +export type LnurlLinkResponse = { + lnurl: string + k1: string +} +export const LnurlLinkResponseOptionalFields: [] = [] +export type LnurlLinkResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + lnurl_CustomCheck?: (v: string) => boolean + k1_CustomCheck?: (v: string) => boolean +} +export const LnurlLinkResponseValidate = (o?: LnurlLinkResponse, opts: LnurlLinkResponseOptions = {}, path: string = 'LnurlLinkResponse::root.'): Error | null => { + 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.lnurl !== 'string') return new Error(`${path}.lnurl: is not a string`) + if (opts.lnurl_CustomCheck && !opts.lnurl_CustomCheck(o.lnurl)) return new Error(`${path}.lnurl: custom check failed`) + + if (typeof o.k1 !== 'string') return new Error(`${path}.k1: is not a string`) + if (opts.k1_CustomCheck && !opts.k1_CustomCheck(o.k1)) return new Error(`${path}.k1: custom check failed`) + + return null +} + +export type LnurlWithdrawInfoResponse = { + tag: string + callback: string + k1: string + defaultDescription: string + minWithdrawable: number + maxWithdrawable: number + balanceCheck: string + payLink: string +} +export const LnurlWithdrawInfoResponseOptionalFields: [] = [] +export type LnurlWithdrawInfoResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + tag_CustomCheck?: (v: string) => boolean + callback_CustomCheck?: (v: string) => boolean + k1_CustomCheck?: (v: string) => boolean + defaultDescription_CustomCheck?: (v: string) => boolean + minWithdrawable_CustomCheck?: (v: number) => boolean + maxWithdrawable_CustomCheck?: (v: number) => boolean + balanceCheck_CustomCheck?: (v: string) => boolean + payLink_CustomCheck?: (v: string) => boolean +} +export const LnurlWithdrawInfoResponseValidate = (o?: LnurlWithdrawInfoResponse, opts: LnurlWithdrawInfoResponseOptions = {}, path: string = 'LnurlWithdrawInfoResponse::root.'): Error | null => { + 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.tag !== 'string') return new Error(`${path}.tag: is not a string`) + if (opts.tag_CustomCheck && !opts.tag_CustomCheck(o.tag)) return new Error(`${path}.tag: custom check failed`) + + if (typeof o.callback !== 'string') return new Error(`${path}.callback: is not a string`) + if (opts.callback_CustomCheck && !opts.callback_CustomCheck(o.callback)) return new Error(`${path}.callback: custom check failed`) + + if (typeof o.k1 !== 'string') return new Error(`${path}.k1: is not a string`) + if (opts.k1_CustomCheck && !opts.k1_CustomCheck(o.k1)) return new Error(`${path}.k1: custom check failed`) + + if (typeof o.defaultDescription !== 'string') return new Error(`${path}.defaultDescription: is not a string`) + if (opts.defaultDescription_CustomCheck && !opts.defaultDescription_CustomCheck(o.defaultDescription)) return new Error(`${path}.defaultDescription: custom check failed`) + + if (typeof o.minWithdrawable !== 'number') return new Error(`${path}.minWithdrawable: is not a number`) + if (opts.minWithdrawable_CustomCheck && !opts.minWithdrawable_CustomCheck(o.minWithdrawable)) return new Error(`${path}.minWithdrawable: custom check failed`) + + if (typeof o.maxWithdrawable !== 'number') return new Error(`${path}.maxWithdrawable: is not a number`) + if (opts.maxWithdrawable_CustomCheck && !opts.maxWithdrawable_CustomCheck(o.maxWithdrawable)) return new Error(`${path}.maxWithdrawable: custom check failed`) + + if (typeof o.balanceCheck !== 'string') return new Error(`${path}.balanceCheck: is not a string`) + if (opts.balanceCheck_CustomCheck && !opts.balanceCheck_CustomCheck(o.balanceCheck)) return new Error(`${path}.balanceCheck: custom check failed`) + + if (typeof o.payLink !== 'string') return new Error(`${path}.payLink: is not a string`) + if (opts.payLink_CustomCheck && !opts.payLink_CustomCheck(o.payLink)) return new Error(`${path}.payLink: custom check failed`) + + return null +} + +export type UserOperation = { + paidAtUnix: number + type: UserOperationType + inbound: boolean + amount: number + identifier: string + operationId: string + service_fee: number + network_fee: number + confirmed: boolean + tx_hash: string + internal: boolean +} +export const UserOperationOptionalFields: [] = [] +export type UserOperationOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + paidAtUnix_CustomCheck?: (v: number) => boolean + type_CustomCheck?: (v: UserOperationType) => boolean + inbound_CustomCheck?: (v: boolean) => boolean + amount_CustomCheck?: (v: number) => boolean + identifier_CustomCheck?: (v: string) => boolean + operationId_CustomCheck?: (v: string) => boolean + service_fee_CustomCheck?: (v: number) => boolean + network_fee_CustomCheck?: (v: number) => boolean + confirmed_CustomCheck?: (v: boolean) => boolean + tx_hash_CustomCheck?: (v: string) => boolean + internal_CustomCheck?: (v: boolean) => boolean +} +export const UserOperationValidate = (o?: UserOperation, opts: UserOperationOptions = {}, path: string = 'UserOperation::root.'): Error | null => { + 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.paidAtUnix !== 'number') return new Error(`${path}.paidAtUnix: is not a number`) + if (opts.paidAtUnix_CustomCheck && !opts.paidAtUnix_CustomCheck(o.paidAtUnix)) return new Error(`${path}.paidAtUnix: custom check failed`) + + if (!enumCheckUserOperationType(o.type)) return new Error(`${path}.type: is not a valid UserOperationType`) + if (opts.type_CustomCheck && !opts.type_CustomCheck(o.type)) return new Error(`${path}.type: custom check failed`) + + if (typeof o.inbound !== 'boolean') return new Error(`${path}.inbound: is not a boolean`) + if (opts.inbound_CustomCheck && !opts.inbound_CustomCheck(o.inbound)) return new Error(`${path}.inbound: custom check failed`) + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + if (typeof o.identifier !== 'string') return new Error(`${path}.identifier: is not a string`) + if (opts.identifier_CustomCheck && !opts.identifier_CustomCheck(o.identifier)) return new Error(`${path}.identifier: custom check failed`) + + if (typeof o.operationId !== 'string') return new Error(`${path}.operationId: is not a string`) + if (opts.operationId_CustomCheck && !opts.operationId_CustomCheck(o.operationId)) return new Error(`${path}.operationId: custom check failed`) + + if (typeof o.service_fee !== 'number') return new Error(`${path}.service_fee: is not a number`) + if (opts.service_fee_CustomCheck && !opts.service_fee_CustomCheck(o.service_fee)) return new Error(`${path}.service_fee: custom check failed`) + + if (typeof o.network_fee !== 'number') return new Error(`${path}.network_fee: is not a number`) + if (opts.network_fee_CustomCheck && !opts.network_fee_CustomCheck(o.network_fee)) return new Error(`${path}.network_fee: custom check failed`) + + if (typeof o.confirmed !== 'boolean') return new Error(`${path}.confirmed: is not a boolean`) + if (opts.confirmed_CustomCheck && !opts.confirmed_CustomCheck(o.confirmed)) return new Error(`${path}.confirmed: custom check failed`) + + if (typeof o.tx_hash !== 'string') return new Error(`${path}.tx_hash: is not a string`) + if (opts.tx_hash_CustomCheck && !opts.tx_hash_CustomCheck(o.tx_hash)) return new Error(`${path}.tx_hash: custom check failed`) + + if (typeof o.internal !== 'boolean') return new Error(`${path}.internal: is not a boolean`) + if (opts.internal_CustomCheck && !opts.internal_CustomCheck(o.internal)) return new Error(`${path}.internal: custom check failed`) + + return null +} + +export type ClosureMigration = { + closes_at_unix: number +} +export const ClosureMigrationOptionalFields: [] = [] +export type ClosureMigrationOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + closes_at_unix_CustomCheck?: (v: number) => boolean +} +export const ClosureMigrationValidate = (o?: ClosureMigration, opts: ClosureMigrationOptions = {}, path: string = 'ClosureMigration::root.'): Error | null => { + 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.closes_at_unix !== 'number') return new Error(`${path}.closes_at_unix: is not a number`) + if (opts.closes_at_unix_CustomCheck && !opts.closes_at_unix_CustomCheck(o.closes_at_unix)) return new Error(`${path}.closes_at_unix: custom check failed`) + + return null +} + +export type AuthAppRequest = { + name: string + allow_user_creation?: boolean +} +export type AuthAppRequestOptionalField = 'allow_user_creation' +export const AuthAppRequestOptionalFields: AuthAppRequestOptionalField[] = ['allow_user_creation'] +export type AuthAppRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: AuthAppRequestOptionalField[] + name_CustomCheck?: (v: string) => boolean + allow_user_creation_CustomCheck?: (v?: boolean) => boolean +} +export const AuthAppRequestValidate = (o?: AuthAppRequest, opts: AuthAppRequestOptions = {}, path: string = 'AuthAppRequest::root.'): Error | null => { 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.name !== 'string') return new Error(`${path}.name: is not a string`) if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) + if ((o.allow_user_creation || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('allow_user_creation')) && typeof o.allow_user_creation !== 'boolean') return new Error(`${path}.allow_user_creation: is not a boolean`) + if (opts.allow_user_creation_CustomCheck && !opts.allow_user_creation_CustomCheck(o.allow_user_creation)) return new Error(`${path}.allow_user_creation: custom check failed`) + + return null +} + +export type Application = { + name: string + id: string + balance: number + npub: string +} +export const ApplicationOptionalFields: [] = [] +export type ApplicationOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + name_CustomCheck?: (v: string) => boolean + id_CustomCheck?: (v: string) => boolean + balance_CustomCheck?: (v: number) => boolean + npub_CustomCheck?: (v: string) => boolean +} +export const ApplicationValidate = (o?: Application, opts: ApplicationOptions = {}, path: string = 'Application::root.'): Error | null => { + 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.name !== 'string') return new Error(`${path}.name: is not a string`) + if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) + + if (typeof o.id !== 'string') return new Error(`${path}.id: is not a string`) + if (opts.id_CustomCheck && !opts.id_CustomCheck(o.id)) return new Error(`${path}.id: custom check failed`) + + if (typeof o.balance !== 'number') return new Error(`${path}.balance: is not a number`) + if (opts.balance_CustomCheck && !opts.balance_CustomCheck(o.balance)) return new Error(`${path}.balance: custom check failed`) + + if (typeof o.npub !== 'string') return new Error(`${path}.npub: is not a string`) + if (opts.npub_CustomCheck && !opts.npub_CustomCheck(o.npub)) return new Error(`${path}.npub: custom check failed`) + + return null +} + +export type RelaysMigration = { + relays: string[] +} +export const RelaysMigrationOptionalFields: [] = [] +export type RelaysMigrationOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + relays_CustomCheck?: (v: string[]) => boolean +} +export const RelaysMigrationValidate = (o?: RelaysMigration, opts: RelaysMigrationOptions = {}, path: string = 'RelaysMigration::root.'): Error | null => { + 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 (!Array.isArray(o.relays)) return new Error(`${path}.relays: is not an array`) + for (let index = 0; index < o.relays.length; index++) { + if (typeof o.relays[index] !== 'string') return new Error(`${path}.relays[${index}]: is not a string`) + } + if (opts.relays_CustomCheck && !opts.relays_CustomCheck(o.relays)) return new Error(`${path}.relays: custom check failed`) + + return null +} + +export type RequestNPubLinkingTokenRequest = { + user_identifier: string +} +export const RequestNPubLinkingTokenRequestOptionalFields: [] = [] +export type RequestNPubLinkingTokenRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + user_identifier_CustomCheck?: (v: string) => boolean +} +export const RequestNPubLinkingTokenRequestValidate = (o?: RequestNPubLinkingTokenRequest, opts: RequestNPubLinkingTokenRequestOptions = {}, path: string = 'RequestNPubLinkingTokenRequest::root.'): Error | null => { + 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.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) + if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) + + return null +} + +export type ClosedChannel = { + channel_id: string + capacity: number + closed_height: number +} +export const ClosedChannelOptionalFields: [] = [] +export type ClosedChannelOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + channel_id_CustomCheck?: (v: string) => boolean + capacity_CustomCheck?: (v: number) => boolean + closed_height_CustomCheck?: (v: number) => boolean +} +export const ClosedChannelValidate = (o?: ClosedChannel, opts: ClosedChannelOptions = {}, path: string = 'ClosedChannel::root.'): Error | null => { + 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.channel_id !== 'string') return new Error(`${path}.channel_id: is not a string`) + if (opts.channel_id_CustomCheck && !opts.channel_id_CustomCheck(o.channel_id)) return new Error(`${path}.channel_id: custom check failed`) + + if (typeof o.capacity !== 'number') return new Error(`${path}.capacity: is not a number`) + if (opts.capacity_CustomCheck && !opts.capacity_CustomCheck(o.capacity)) return new Error(`${path}.capacity: custom check failed`) + + if (typeof o.closed_height !== 'number') return new Error(`${path}.closed_height: is not a number`) + if (opts.closed_height_CustomCheck && !opts.closed_height_CustomCheck(o.closed_height)) return new Error(`${path}.closed_height: custom check failed`) + + return null +} + +export type OpenChannelResponse = { + channelId: string +} +export const OpenChannelResponseOptionalFields: [] = [] +export type OpenChannelResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + channelId_CustomCheck?: (v: string) => boolean +} +export const OpenChannelResponseValidate = (o?: OpenChannelResponse, opts: OpenChannelResponseOptions = {}, path: string = 'OpenChannelResponse::root.'): Error | null => { + 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.channelId !== 'string') return new Error(`${path}.channelId: is not a string`) + if (opts.channelId_CustomCheck && !opts.channelId_CustomCheck(o.channelId)) return new Error(`${path}.channelId: custom check failed`) + + return null +} + +export type Product = { + id: string + name: string + price_sats: number +} +export const ProductOptionalFields: [] = [] +export type ProductOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + id_CustomCheck?: (v: string) => boolean + name_CustomCheck?: (v: string) => boolean + price_sats_CustomCheck?: (v: number) => boolean +} +export const ProductValidate = (o?: Product, opts: ProductOptions = {}, path: string = 'Product::root.'): Error | null => { + 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.id !== 'string') return new Error(`${path}.id: is not a string`) + if (opts.id_CustomCheck && !opts.id_CustomCheck(o.id)) return new Error(`${path}.id: custom check failed`) + + if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`) + if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) + if (typeof o.price_sats !== 'number') return new Error(`${path}.price_sats: is not a number`) if (opts.price_sats_CustomCheck && !opts.price_sats_CustomCheck(o.price_sats)) return new Error(`${path}.price_sats: custom check failed`) return null } +export type EncryptionExchangeRequest = { + publicKey: string + deviceId: string +} +export const EncryptionExchangeRequestOptionalFields: [] = [] +export type EncryptionExchangeRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + publicKey_CustomCheck?: (v: string) => boolean + deviceId_CustomCheck?: (v: string) => boolean +} +export const EncryptionExchangeRequestValidate = (o?: EncryptionExchangeRequest, opts: EncryptionExchangeRequestOptions = {}, path: string = 'EncryptionExchangeRequest::root.'): Error | null => { + 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.publicKey !== 'string') return new Error(`${path}.publicKey: is not a string`) + if (opts.publicKey_CustomCheck && !opts.publicKey_CustomCheck(o.publicKey)) return new Error(`${path}.publicKey: custom check failed`) + + if (typeof o.deviceId !== 'string') return new Error(`${path}.deviceId: is not a string`) + if (opts.deviceId_CustomCheck && !opts.deviceId_CustomCheck(o.deviceId)) return new Error(`${path}.deviceId: custom check failed`) + + return null +} + +export type AppsMetricsRequest = { + from_unix?: number + to_unix?: number + include_operations?: boolean +} +export type AppsMetricsRequestOptionalField = 'from_unix' | 'to_unix' | 'include_operations' +export const AppsMetricsRequestOptionalFields: AppsMetricsRequestOptionalField[] = ['from_unix', 'to_unix', 'include_operations'] +export type AppsMetricsRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: AppsMetricsRequestOptionalField[] + from_unix_CustomCheck?: (v?: number) => boolean + to_unix_CustomCheck?: (v?: number) => boolean + include_operations_CustomCheck?: (v?: boolean) => boolean +} +export const AppsMetricsRequestValidate = (o?: AppsMetricsRequest, opts: AppsMetricsRequestOptions = {}, path: string = 'AppsMetricsRequest::root.'): Error | null => { + 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 ((o.from_unix || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('from_unix')) && typeof o.from_unix !== 'number') return new Error(`${path}.from_unix: is not a number`) + if (opts.from_unix_CustomCheck && !opts.from_unix_CustomCheck(o.from_unix)) return new Error(`${path}.from_unix: custom check failed`) + + if ((o.to_unix || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('to_unix')) && typeof o.to_unix !== 'number') return new Error(`${path}.to_unix: is not a number`) + if (opts.to_unix_CustomCheck && !opts.to_unix_CustomCheck(o.to_unix)) return new Error(`${path}.to_unix: custom check failed`) + + if ((o.include_operations || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('include_operations')) && typeof o.include_operations !== 'boolean') return new Error(`${path}.include_operations: is not a boolean`) + if (opts.include_operations_CustomCheck && !opts.include_operations_CustomCheck(o.include_operations)) return new Error(`${path}.include_operations: custom check failed`) + + return null +} + +export type LiveUserOperation = { + operation: UserOperation +} +export const LiveUserOperationOptionalFields: [] = [] +export type LiveUserOperationOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + operation_Options?: UserOperationOptions +} +export const LiveUserOperationValidate = (o?: LiveUserOperation, opts: LiveUserOperationOptions = {}, path: string = 'LiveUserOperation::root.'): Error | null => { + 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') + + const operationErr = UserOperationValidate(o.operation, opts.operation_Options, `${path}.operation`) + if (operationErr !== null) return operationErr + + + return null +} + +export type HttpCreds = { + url: string + token: string +} +export const HttpCredsOptionalFields: [] = [] +export type HttpCredsOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + url_CustomCheck?: (v: string) => boolean + token_CustomCheck?: (v: string) => boolean +} +export const HttpCredsValidate = (o?: HttpCreds, opts: HttpCredsOptions = {}, path: string = 'HttpCreds::root.'): Error | null => { + 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.url !== 'string') return new Error(`${path}.url: is not a string`) + if (opts.url_CustomCheck && !opts.url_CustomCheck(o.url)) return new Error(`${path}.url: custom check failed`) + + if (typeof o.token !== 'string') return new Error(`${path}.token: is not a string`) + if (opts.token_CustomCheck && !opts.token_CustomCheck(o.token)) return new Error(`${path}.token: custom check failed`) + + return null +} + +export type PayAppUserInvoiceRequest = { + user_identifier: string + invoice: string + amount: number +} +export const PayAppUserInvoiceRequestOptionalFields: [] = [] +export type PayAppUserInvoiceRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + user_identifier_CustomCheck?: (v: string) => boolean + invoice_CustomCheck?: (v: string) => boolean + amount_CustomCheck?: (v: number) => boolean +} +export const PayAppUserInvoiceRequestValidate = (o?: PayAppUserInvoiceRequest, opts: PayAppUserInvoiceRequestOptions = {}, path: string = 'PayAppUserInvoiceRequest::root.'): Error | null => { + 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.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) + if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) + + if (typeof o.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) + if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + return null +} + +export type NewInvoiceRequest = { + amountSats: number + memo: string +} +export const NewInvoiceRequestOptionalFields: [] = [] +export type NewInvoiceRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + amountSats_CustomCheck?: (v: number) => boolean + memo_CustomCheck?: (v: string) => boolean +} +export const NewInvoiceRequestValidate = (o?: NewInvoiceRequest, opts: NewInvoiceRequestOptions = {}, path: string = 'NewInvoiceRequest::root.'): Error | null => { + 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.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 (typeof o.memo !== 'string') return new Error(`${path}.memo: is not a string`) + if (opts.memo_CustomCheck && !opts.memo_CustomCheck(o.memo)) return new Error(`${path}.memo: custom check failed`) + + return null +} + +export type ChannelBalanceEvent = { + block_height: number + channel_id: string + local_balance_sats: number + remote_balance_sats: number +} +export const ChannelBalanceEventOptionalFields: [] = [] +export type ChannelBalanceEventOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + block_height_CustomCheck?: (v: number) => boolean + channel_id_CustomCheck?: (v: string) => boolean + local_balance_sats_CustomCheck?: (v: number) => boolean + remote_balance_sats_CustomCheck?: (v: number) => boolean +} +export const ChannelBalanceEventValidate = (o?: ChannelBalanceEvent, opts: ChannelBalanceEventOptions = {}, path: string = 'ChannelBalanceEvent::root.'): Error | null => { + 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.block_height !== 'number') return new Error(`${path}.block_height: is not a number`) + if (opts.block_height_CustomCheck && !opts.block_height_CustomCheck(o.block_height)) return new Error(`${path}.block_height: custom check failed`) + + if (typeof o.channel_id !== 'string') return new Error(`${path}.channel_id: is not a string`) + if (opts.channel_id_CustomCheck && !opts.channel_id_CustomCheck(o.channel_id)) return new Error(`${path}.channel_id: custom check failed`) + + if (typeof o.local_balance_sats !== 'number') return new Error(`${path}.local_balance_sats: is not a number`) + if (opts.local_balance_sats_CustomCheck && !opts.local_balance_sats_CustomCheck(o.local_balance_sats)) return new Error(`${path}.local_balance_sats: custom check failed`) + + if (typeof o.remote_balance_sats !== 'number') return new Error(`${path}.remote_balance_sats: is not a number`) + if (opts.remote_balance_sats_CustomCheck && !opts.remote_balance_sats_CustomCheck(o.remote_balance_sats)) return new Error(`${path}.remote_balance_sats: custom check failed`) + + return null +} + +export type HandleLnurlPayResponse = { + pr: string + routes: Empty[] +} +export const HandleLnurlPayResponseOptionalFields: [] = [] +export type HandleLnurlPayResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + pr_CustomCheck?: (v: string) => boolean + routes_ItemOptions?: EmptyOptions + routes_CustomCheck?: (v: Empty[]) => boolean +} +export const HandleLnurlPayResponseValidate = (o?: HandleLnurlPayResponse, opts: HandleLnurlPayResponseOptions = {}, path: string = 'HandleLnurlPayResponse::root.'): Error | null => { + 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.pr !== 'string') return new Error(`${path}.pr: is not a string`) + if (opts.pr_CustomCheck && !opts.pr_CustomCheck(o.pr)) return new Error(`${path}.pr: custom check failed`) + + if (!Array.isArray(o.routes)) return new Error(`${path}.routes: is not an array`) + for (let index = 0; index < o.routes.length; index++) { + const routesErr = EmptyValidate(o.routes[index], opts.routes_ItemOptions, `${path}.routes[${index}]`) + if (routesErr !== null) return routesErr + } + if (opts.routes_CustomCheck && !opts.routes_CustomCheck(o.routes)) return new Error(`${path}.routes: custom check failed`) + + return null +} + +export type UserOperations = { + fromIndex: number + toIndex: number + operations: UserOperation[] +} +export const UserOperationsOptionalFields: [] = [] +export type UserOperationsOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + fromIndex_CustomCheck?: (v: number) => boolean + toIndex_CustomCheck?: (v: number) => boolean + operations_ItemOptions?: UserOperationOptions + operations_CustomCheck?: (v: UserOperation[]) => boolean +} +export const UserOperationsValidate = (o?: UserOperations, opts: UserOperationsOptions = {}, path: string = 'UserOperations::root.'): Error | null => { + 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.fromIndex !== 'number') return new Error(`${path}.fromIndex: is not a number`) + if (opts.fromIndex_CustomCheck && !opts.fromIndex_CustomCheck(o.fromIndex)) return new Error(`${path}.fromIndex: custom check failed`) + + if (typeof o.toIndex !== 'number') return new Error(`${path}.toIndex: is not a number`) + if (opts.toIndex_CustomCheck && !opts.toIndex_CustomCheck(o.toIndex)) return new Error(`${path}.toIndex: custom check failed`) + + if (!Array.isArray(o.operations)) return new Error(`${path}.operations: is not an array`) + for (let index = 0; index < o.operations.length; index++) { + const operationsErr = UserOperationValidate(o.operations[index], opts.operations_ItemOptions, `${path}.operations[${index}]`) + if (operationsErr !== null) return operationsErr + } + if (opts.operations_CustomCheck && !opts.operations_CustomCheck(o.operations)) return new Error(`${path}.operations: custom check failed`) + + return null +} + +export type UsageMetric = { + processed_at_ms: number + parsed_in_nano: number + auth_in_nano: number + validate_in_nano: number + handle_in_nano: number + rpc_name: string + batch: boolean + nostr: boolean + batch_size: number +} +export const UsageMetricOptionalFields: [] = [] +export type UsageMetricOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + processed_at_ms_CustomCheck?: (v: number) => boolean + parsed_in_nano_CustomCheck?: (v: number) => boolean + auth_in_nano_CustomCheck?: (v: number) => boolean + validate_in_nano_CustomCheck?: (v: number) => boolean + handle_in_nano_CustomCheck?: (v: number) => boolean + rpc_name_CustomCheck?: (v: string) => boolean + batch_CustomCheck?: (v: boolean) => boolean + nostr_CustomCheck?: (v: boolean) => boolean + batch_size_CustomCheck?: (v: number) => boolean +} +export const UsageMetricValidate = (o?: UsageMetric, opts: UsageMetricOptions = {}, path: string = 'UsageMetric::root.'): Error | null => { + 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.processed_at_ms !== 'number') return new Error(`${path}.processed_at_ms: is not a number`) + if (opts.processed_at_ms_CustomCheck && !opts.processed_at_ms_CustomCheck(o.processed_at_ms)) return new Error(`${path}.processed_at_ms: custom check failed`) + + if (typeof o.parsed_in_nano !== 'number') return new Error(`${path}.parsed_in_nano: is not a number`) + if (opts.parsed_in_nano_CustomCheck && !opts.parsed_in_nano_CustomCheck(o.parsed_in_nano)) return new Error(`${path}.parsed_in_nano: custom check failed`) + + if (typeof o.auth_in_nano !== 'number') return new Error(`${path}.auth_in_nano: is not a number`) + if (opts.auth_in_nano_CustomCheck && !opts.auth_in_nano_CustomCheck(o.auth_in_nano)) return new Error(`${path}.auth_in_nano: custom check failed`) + + if (typeof o.validate_in_nano !== 'number') return new Error(`${path}.validate_in_nano: is not a number`) + if (opts.validate_in_nano_CustomCheck && !opts.validate_in_nano_CustomCheck(o.validate_in_nano)) return new Error(`${path}.validate_in_nano: custom check failed`) + + if (typeof o.handle_in_nano !== 'number') return new Error(`${path}.handle_in_nano: is not a number`) + if (opts.handle_in_nano_CustomCheck && !opts.handle_in_nano_CustomCheck(o.handle_in_nano)) return new Error(`${path}.handle_in_nano: custom check failed`) + + if (typeof o.rpc_name !== 'string') return new Error(`${path}.rpc_name: is not a string`) + if (opts.rpc_name_CustomCheck && !opts.rpc_name_CustomCheck(o.rpc_name)) return new Error(`${path}.rpc_name: custom check failed`) + + if (typeof o.batch !== 'boolean') return new Error(`${path}.batch: is not a boolean`) + if (opts.batch_CustomCheck && !opts.batch_CustomCheck(o.batch)) return new Error(`${path}.batch: custom check failed`) + + if (typeof o.nostr !== 'boolean') return new Error(`${path}.nostr: is not a boolean`) + if (opts.nostr_CustomCheck && !opts.nostr_CustomCheck(o.nostr)) return new Error(`${path}.nostr: custom check failed`) + + if (typeof o.batch_size !== 'number') return new Error(`${path}.batch_size: is not a number`) + if (opts.batch_size_CustomCheck && !opts.batch_size_CustomCheck(o.batch_size)) return new Error(`${path}.batch_size: custom check failed`) + + return null +} + +export type RoutingEvent = { + incoming_channel_id: number + incoming_htlc_id: number + outgoing_channel_id: number + outgoing_htlc_id: number + timestamp_ns: number + event_type: string + incoming_amt_msat: number + outgoing_amt_msat: number + failure_string: string + settled: boolean + offchain: boolean + forward_fail_event: boolean +} +export const RoutingEventOptionalFields: [] = [] +export type RoutingEventOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + incoming_channel_id_CustomCheck?: (v: number) => boolean + incoming_htlc_id_CustomCheck?: (v: number) => boolean + outgoing_channel_id_CustomCheck?: (v: number) => boolean + outgoing_htlc_id_CustomCheck?: (v: number) => boolean + timestamp_ns_CustomCheck?: (v: number) => boolean + event_type_CustomCheck?: (v: string) => boolean + incoming_amt_msat_CustomCheck?: (v: number) => boolean + outgoing_amt_msat_CustomCheck?: (v: number) => boolean + failure_string_CustomCheck?: (v: string) => boolean + settled_CustomCheck?: (v: boolean) => boolean + offchain_CustomCheck?: (v: boolean) => boolean + forward_fail_event_CustomCheck?: (v: boolean) => boolean +} +export const RoutingEventValidate = (o?: RoutingEvent, opts: RoutingEventOptions = {}, path: string = 'RoutingEvent::root.'): Error | null => { + 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.incoming_channel_id !== 'number') return new Error(`${path}.incoming_channel_id: is not a number`) + if (opts.incoming_channel_id_CustomCheck && !opts.incoming_channel_id_CustomCheck(o.incoming_channel_id)) return new Error(`${path}.incoming_channel_id: custom check failed`) + + if (typeof o.incoming_htlc_id !== 'number') return new Error(`${path}.incoming_htlc_id: is not a number`) + if (opts.incoming_htlc_id_CustomCheck && !opts.incoming_htlc_id_CustomCheck(o.incoming_htlc_id)) return new Error(`${path}.incoming_htlc_id: custom check failed`) + + if (typeof o.outgoing_channel_id !== 'number') return new Error(`${path}.outgoing_channel_id: is not a number`) + if (opts.outgoing_channel_id_CustomCheck && !opts.outgoing_channel_id_CustomCheck(o.outgoing_channel_id)) return new Error(`${path}.outgoing_channel_id: custom check failed`) + + if (typeof o.outgoing_htlc_id !== 'number') return new Error(`${path}.outgoing_htlc_id: is not a number`) + if (opts.outgoing_htlc_id_CustomCheck && !opts.outgoing_htlc_id_CustomCheck(o.outgoing_htlc_id)) return new Error(`${path}.outgoing_htlc_id: custom check failed`) + + if (typeof o.timestamp_ns !== 'number') return new Error(`${path}.timestamp_ns: is not a number`) + if (opts.timestamp_ns_CustomCheck && !opts.timestamp_ns_CustomCheck(o.timestamp_ns)) return new Error(`${path}.timestamp_ns: custom check failed`) + + if (typeof o.event_type !== 'string') return new Error(`${path}.event_type: is not a string`) + if (opts.event_type_CustomCheck && !opts.event_type_CustomCheck(o.event_type)) return new Error(`${path}.event_type: custom check failed`) + + if (typeof o.incoming_amt_msat !== 'number') return new Error(`${path}.incoming_amt_msat: is not a number`) + if (opts.incoming_amt_msat_CustomCheck && !opts.incoming_amt_msat_CustomCheck(o.incoming_amt_msat)) return new Error(`${path}.incoming_amt_msat: custom check failed`) + + if (typeof o.outgoing_amt_msat !== 'number') return new Error(`${path}.outgoing_amt_msat: is not a number`) + if (opts.outgoing_amt_msat_CustomCheck && !opts.outgoing_amt_msat_CustomCheck(o.outgoing_amt_msat)) return new Error(`${path}.outgoing_amt_msat: custom check failed`) + + if (typeof o.failure_string !== 'string') return new Error(`${path}.failure_string: is not a string`) + if (opts.failure_string_CustomCheck && !opts.failure_string_CustomCheck(o.failure_string)) return new Error(`${path}.failure_string: custom check failed`) + + if (typeof o.settled !== 'boolean') return new Error(`${path}.settled: is not a boolean`) + if (opts.settled_CustomCheck && !opts.settled_CustomCheck(o.settled)) return new Error(`${path}.settled: custom check failed`) + + if (typeof o.offchain !== 'boolean') return new Error(`${path}.offchain: is not a boolean`) + if (opts.offchain_CustomCheck && !opts.offchain_CustomCheck(o.offchain)) return new Error(`${path}.offchain: custom check failed`) + + if (typeof o.forward_fail_event !== 'boolean') return new Error(`${path}.forward_fail_event: is not a boolean`) + if (opts.forward_fail_event_CustomCheck && !opts.forward_fail_event_CustomCheck(o.forward_fail_event)) return new Error(`${path}.forward_fail_event: custom check failed`) + + return null +} + +export type SetMockInvoiceAsPaidRequest = { + invoice: string + amount: number +} +export const SetMockInvoiceAsPaidRequestOptionalFields: [] = [] +export type SetMockInvoiceAsPaidRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + invoice_CustomCheck?: (v: string) => boolean + amount_CustomCheck?: (v: number) => boolean +} +export const SetMockInvoiceAsPaidRequestValidate = (o?: SetMockInvoiceAsPaidRequest, opts: SetMockInvoiceAsPaidRequestOptions = {}, path: string = 'SetMockInvoiceAsPaidRequest::root.'): Error | null => { + 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.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) + if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + return null +} + +export type AddAppUserInvoiceRequest = { + receiver_identifier: string + payer_identifier: string + http_callback_url: string + invoice_req: NewInvoiceRequest +} +export const AddAppUserInvoiceRequestOptionalFields: [] = [] +export type AddAppUserInvoiceRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + receiver_identifier_CustomCheck?: (v: string) => boolean + payer_identifier_CustomCheck?: (v: string) => boolean + http_callback_url_CustomCheck?: (v: string) => boolean + invoice_req_Options?: NewInvoiceRequestOptions +} +export const AddAppUserInvoiceRequestValidate = (o?: AddAppUserInvoiceRequest, opts: AddAppUserInvoiceRequestOptions = {}, path: string = 'AddAppUserInvoiceRequest::root.'): Error | null => { + 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.receiver_identifier !== 'string') return new Error(`${path}.receiver_identifier: is not a string`) + if (opts.receiver_identifier_CustomCheck && !opts.receiver_identifier_CustomCheck(o.receiver_identifier)) return new Error(`${path}.receiver_identifier: custom check failed`) + + if (typeof o.payer_identifier !== 'string') return new Error(`${path}.payer_identifier: is not a string`) + if (opts.payer_identifier_CustomCheck && !opts.payer_identifier_CustomCheck(o.payer_identifier)) return new Error(`${path}.payer_identifier: custom check failed`) + + if (typeof o.http_callback_url !== 'string') return new Error(`${path}.http_callback_url: is not a string`) + if (opts.http_callback_url_CustomCheck && !opts.http_callback_url_CustomCheck(o.http_callback_url)) return new Error(`${path}.http_callback_url: custom check failed`) + + const invoice_reqErr = NewInvoiceRequestValidate(o.invoice_req, opts.invoice_req_Options, `${path}.invoice_req`) + if (invoice_reqErr !== null) return invoice_reqErr + + + return null +} + +export type OpenChannelRequest = { + destination: string + fundingAmount: number + pushAmount: number + closeAddress: string +} +export const OpenChannelRequestOptionalFields: [] = [] +export type OpenChannelRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + destination_CustomCheck?: (v: string) => boolean + fundingAmount_CustomCheck?: (v: number) => boolean + pushAmount_CustomCheck?: (v: number) => boolean + closeAddress_CustomCheck?: (v: string) => boolean +} +export const OpenChannelRequestValidate = (o?: OpenChannelRequest, opts: OpenChannelRequestOptions = {}, path: string = 'OpenChannelRequest::root.'): Error | null => { + 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.destination !== 'string') return new Error(`${path}.destination: is not a string`) + if (opts.destination_CustomCheck && !opts.destination_CustomCheck(o.destination)) return new Error(`${path}.destination: custom check failed`) + + if (typeof o.fundingAmount !== 'number') return new Error(`${path}.fundingAmount: is not a number`) + if (opts.fundingAmount_CustomCheck && !opts.fundingAmount_CustomCheck(o.fundingAmount)) return new Error(`${path}.fundingAmount: custom check failed`) + + if (typeof o.pushAmount !== 'number') return new Error(`${path}.pushAmount: is not a number`) + if (opts.pushAmount_CustomCheck && !opts.pushAmount_CustomCheck(o.pushAmount)) return new Error(`${path}.pushAmount: custom check failed`) + + if (typeof o.closeAddress !== 'string') return new Error(`${path}.closeAddress: is not a string`) + if (opts.closeAddress_CustomCheck && !opts.closeAddress_CustomCheck(o.closeAddress)) return new Error(`${path}.closeAddress: custom check failed`) + + return null +} + +export type ChainBalanceEvent = { + block_height: number + confirmed_balance: number + unconfirmed_balance: number + total_balance: number +} +export const ChainBalanceEventOptionalFields: [] = [] +export type ChainBalanceEventOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + block_height_CustomCheck?: (v: number) => boolean + confirmed_balance_CustomCheck?: (v: number) => boolean + unconfirmed_balance_CustomCheck?: (v: number) => boolean + total_balance_CustomCheck?: (v: number) => boolean +} +export const ChainBalanceEventValidate = (o?: ChainBalanceEvent, opts: ChainBalanceEventOptions = {}, path: string = 'ChainBalanceEvent::root.'): Error | null => { + 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.block_height !== 'number') return new Error(`${path}.block_height: is not a number`) + if (opts.block_height_CustomCheck && !opts.block_height_CustomCheck(o.block_height)) return new Error(`${path}.block_height: custom check failed`) + + if (typeof o.confirmed_balance !== 'number') return new Error(`${path}.confirmed_balance: is not a number`) + if (opts.confirmed_balance_CustomCheck && !opts.confirmed_balance_CustomCheck(o.confirmed_balance)) return new Error(`${path}.confirmed_balance: custom check failed`) + + if (typeof o.unconfirmed_balance !== 'number') return new Error(`${path}.unconfirmed_balance: is not a number`) + if (opts.unconfirmed_balance_CustomCheck && !opts.unconfirmed_balance_CustomCheck(o.unconfirmed_balance)) return new Error(`${path}.unconfirmed_balance: custom check failed`) + + if (typeof o.total_balance !== 'number') return new Error(`${path}.total_balance: is not a number`) + if (opts.total_balance_CustomCheck && !opts.total_balance_CustomCheck(o.total_balance)) return new Error(`${path}.total_balance: custom check failed`) + + return null +} + export type LndNodeMetrics = { channels_balance_events: ChannelBalanceEvent[] chain_balance_events: ChainBalanceEvent[] @@ -450,1903 +2377,3 @@ export const LndNodeMetricsValidate = (o?: LndNodeMetrics, opts: LndNodeMetricsO return null } -export type SendAppUserToAppPaymentRequest = { - from_user_identifier: string - amount: number -} -export const SendAppUserToAppPaymentRequestOptionalFields: [] = [] -export type SendAppUserToAppPaymentRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - from_user_identifier_CustomCheck?: (v: string) => boolean - amount_CustomCheck?: (v: number) => boolean -} -export const SendAppUserToAppPaymentRequestValidate = (o?: SendAppUserToAppPaymentRequest, opts: SendAppUserToAppPaymentRequestOptions = {}, path: string = 'SendAppUserToAppPaymentRequest::root.'): Error | null => { - 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.from_user_identifier !== 'string') return new Error(`${path}.from_user_identifier: is not a string`) - if (opts.from_user_identifier_CustomCheck && !opts.from_user_identifier_CustomCheck(o.from_user_identifier)) return new Error(`${path}.from_user_identifier: custom check failed`) - - if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - return null -} - -export type DecodeInvoiceResponse = { - amount: number -} -export const DecodeInvoiceResponseOptionalFields: [] = [] -export type DecodeInvoiceResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - amount_CustomCheck?: (v: number) => boolean -} -export const DecodeInvoiceResponseValidate = (o?: DecodeInvoiceResponse, opts: DecodeInvoiceResponseOptions = {}, path: string = 'DecodeInvoiceResponse::root.'): Error | null => { - 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.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - return null -} - -export type LndGetInfoResponse = { - alias: string -} -export const LndGetInfoResponseOptionalFields: [] = [] -export type LndGetInfoResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - alias_CustomCheck?: (v: string) => boolean -} -export const LndGetInfoResponseValidate = (o?: LndGetInfoResponse, opts: LndGetInfoResponseOptions = {}, path: string = 'LndGetInfoResponse::root.'): Error | null => { - 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.alias !== 'string') return new Error(`${path}.alias: is not a string`) - if (opts.alias_CustomCheck && !opts.alias_CustomCheck(o.alias)) return new Error(`${path}.alias: custom check failed`) - - return null -} - -export type AddAppRequest = { - name: string - allow_user_creation: boolean -} -export const AddAppRequestOptionalFields: [] = [] -export type AddAppRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - name_CustomCheck?: (v: string) => boolean - allow_user_creation_CustomCheck?: (v: boolean) => boolean -} -export const AddAppRequestValidate = (o?: AddAppRequest, opts: AddAppRequestOptions = {}, path: string = 'AddAppRequest::root.'): Error | null => { - 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.name !== 'string') return new Error(`${path}.name: is not a string`) - if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) - - if (typeof o.allow_user_creation !== 'boolean') return new Error(`${path}.allow_user_creation: is not a boolean`) - if (opts.allow_user_creation_CustomCheck && !opts.allow_user_creation_CustomCheck(o.allow_user_creation)) return new Error(`${path}.allow_user_creation: custom check failed`) - - return null -} - -export type AddAppUserInvoiceRequest = { - receiver_identifier: string - payer_identifier: string - http_callback_url: string - invoice_req: NewInvoiceRequest -} -export const AddAppUserInvoiceRequestOptionalFields: [] = [] -export type AddAppUserInvoiceRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - receiver_identifier_CustomCheck?: (v: string) => boolean - payer_identifier_CustomCheck?: (v: string) => boolean - http_callback_url_CustomCheck?: (v: string) => boolean - invoice_req_Options?: NewInvoiceRequestOptions -} -export const AddAppUserInvoiceRequestValidate = (o?: AddAppUserInvoiceRequest, opts: AddAppUserInvoiceRequestOptions = {}, path: string = 'AddAppUserInvoiceRequest::root.'): Error | null => { - 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.receiver_identifier !== 'string') return new Error(`${path}.receiver_identifier: is not a string`) - if (opts.receiver_identifier_CustomCheck && !opts.receiver_identifier_CustomCheck(o.receiver_identifier)) return new Error(`${path}.receiver_identifier: custom check failed`) - - if (typeof o.payer_identifier !== 'string') return new Error(`${path}.payer_identifier: is not a string`) - if (opts.payer_identifier_CustomCheck && !opts.payer_identifier_CustomCheck(o.payer_identifier)) return new Error(`${path}.payer_identifier: custom check failed`) - - if (typeof o.http_callback_url !== 'string') return new Error(`${path}.http_callback_url: is not a string`) - if (opts.http_callback_url_CustomCheck && !opts.http_callback_url_CustomCheck(o.http_callback_url)) return new Error(`${path}.http_callback_url: custom check failed`) - - const invoice_reqErr = NewInvoiceRequestValidate(o.invoice_req, opts.invoice_req_Options, `${path}.invoice_req`) - if (invoice_reqErr !== null) return invoice_reqErr - - - return null -} - -export type LndMetrics = { - nodes: LndNodeMetrics[] -} -export const LndMetricsOptionalFields: [] = [] -export type LndMetricsOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - nodes_ItemOptions?: LndNodeMetricsOptions - nodes_CustomCheck?: (v: LndNodeMetrics[]) => boolean -} -export const LndMetricsValidate = (o?: LndMetrics, opts: LndMetricsOptions = {}, path: string = 'LndMetrics::root.'): Error | null => { - 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 (!Array.isArray(o.nodes)) return new Error(`${path}.nodes: is not an array`) - for (let index = 0; index < o.nodes.length; index++) { - const nodesErr = LndNodeMetricsValidate(o.nodes[index], opts.nodes_ItemOptions, `${path}.nodes[${index}]`) - if (nodesErr !== null) return nodesErr - } - if (opts.nodes_CustomCheck && !opts.nodes_CustomCheck(o.nodes)) return new Error(`${path}.nodes: custom check failed`) - - return null -} - -export type LndGetInfoRequest = { - nodeId: number -} -export const LndGetInfoRequestOptionalFields: [] = [] -export type LndGetInfoRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - nodeId_CustomCheck?: (v: number) => boolean -} -export const LndGetInfoRequestValidate = (o?: LndGetInfoRequest, opts: LndGetInfoRequestOptions = {}, path: string = 'LndGetInfoRequest::root.'): Error | null => { - 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.nodeId !== 'number') return new Error(`${path}.nodeId: is not a number`) - if (opts.nodeId_CustomCheck && !opts.nodeId_CustomCheck(o.nodeId)) return new Error(`${path}.nodeId: custom check failed`) - - return null -} - -export type DecodeInvoiceRequest = { - invoice: string -} -export const DecodeInvoiceRequestOptionalFields: [] = [] -export type DecodeInvoiceRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - invoice_CustomCheck?: (v: string) => boolean -} -export const DecodeInvoiceRequestValidate = (o?: DecodeInvoiceRequest, opts: DecodeInvoiceRequestOptions = {}, path: string = 'DecodeInvoiceRequest::root.'): Error | null => { - 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.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) - if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) - - return null -} - -export type UserOperations = { - fromIndex: number - toIndex: number - operations: UserOperation[] -} -export const UserOperationsOptionalFields: [] = [] -export type UserOperationsOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - fromIndex_CustomCheck?: (v: number) => boolean - toIndex_CustomCheck?: (v: number) => boolean - operations_ItemOptions?: UserOperationOptions - operations_CustomCheck?: (v: UserOperation[]) => boolean -} -export const UserOperationsValidate = (o?: UserOperations, opts: UserOperationsOptions = {}, path: string = 'UserOperations::root.'): Error | null => { - 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.fromIndex !== 'number') return new Error(`${path}.fromIndex: is not a number`) - if (opts.fromIndex_CustomCheck && !opts.fromIndex_CustomCheck(o.fromIndex)) return new Error(`${path}.fromIndex: custom check failed`) - - if (typeof o.toIndex !== 'number') return new Error(`${path}.toIndex: is not a number`) - if (opts.toIndex_CustomCheck && !opts.toIndex_CustomCheck(o.toIndex)) return new Error(`${path}.toIndex: custom check failed`) - - if (!Array.isArray(o.operations)) return new Error(`${path}.operations: is not an array`) - for (let index = 0; index < o.operations.length; index++) { - const operationsErr = UserOperationValidate(o.operations[index], opts.operations_ItemOptions, `${path}.operations[${index}]`) - if (operationsErr !== null) return operationsErr - } - if (opts.operations_CustomCheck && !opts.operations_CustomCheck(o.operations)) return new Error(`${path}.operations: custom check failed`) - - return null -} - -export type Product = { - id: string - name: string - price_sats: number -} -export const ProductOptionalFields: [] = [] -export type ProductOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - id_CustomCheck?: (v: string) => boolean - name_CustomCheck?: (v: string) => boolean - price_sats_CustomCheck?: (v: number) => boolean -} -export const ProductValidate = (o?: Product, opts: ProductOptions = {}, path: string = 'Product::root.'): Error | null => { - 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.id !== 'string') return new Error(`${path}.id: is not a string`) - if (opts.id_CustomCheck && !opts.id_CustomCheck(o.id)) return new Error(`${path}.id: custom check failed`) - - if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`) - if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) - - if (typeof o.price_sats !== 'number') return new Error(`${path}.price_sats: is not a number`) - if (opts.price_sats_CustomCheck && !opts.price_sats_CustomCheck(o.price_sats)) return new Error(`${path}.price_sats: custom check failed`) - - return null -} - -export type RelaysMigration = { - relays: string[] -} -export const RelaysMigrationOptionalFields: [] = [] -export type RelaysMigrationOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - relays_CustomCheck?: (v: string[]) => boolean -} -export const RelaysMigrationValidate = (o?: RelaysMigration, opts: RelaysMigrationOptions = {}, path: string = 'RelaysMigration::root.'): Error | null => { - 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 (!Array.isArray(o.relays)) return new Error(`${path}.relays: is not an array`) - for (let index = 0; index < o.relays.length; index++) { - if (typeof o.relays[index] !== 'string') return new Error(`${path}.relays[${index}]: is not a string`) - } - if (opts.relays_CustomCheck && !opts.relays_CustomCheck(o.relays)) return new Error(`${path}.relays: custom check failed`) - - return null -} - -export type UserOperation = { - paidAtUnix: number - type: UserOperationType - inbound: boolean - amount: number - identifier: string - operationId: string - service_fee: number - network_fee: number - confirmed: boolean - tx_hash: string - internal: boolean -} -export const UserOperationOptionalFields: [] = [] -export type UserOperationOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - paidAtUnix_CustomCheck?: (v: number) => boolean - type_CustomCheck?: (v: UserOperationType) => boolean - inbound_CustomCheck?: (v: boolean) => boolean - amount_CustomCheck?: (v: number) => boolean - identifier_CustomCheck?: (v: string) => boolean - operationId_CustomCheck?: (v: string) => boolean - service_fee_CustomCheck?: (v: number) => boolean - network_fee_CustomCheck?: (v: number) => boolean - confirmed_CustomCheck?: (v: boolean) => boolean - tx_hash_CustomCheck?: (v: string) => boolean - internal_CustomCheck?: (v: boolean) => boolean -} -export const UserOperationValidate = (o?: UserOperation, opts: UserOperationOptions = {}, path: string = 'UserOperation::root.'): Error | null => { - 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.paidAtUnix !== 'number') return new Error(`${path}.paidAtUnix: is not a number`) - if (opts.paidAtUnix_CustomCheck && !opts.paidAtUnix_CustomCheck(o.paidAtUnix)) return new Error(`${path}.paidAtUnix: custom check failed`) - - if (!enumCheckUserOperationType(o.type)) return new Error(`${path}.type: is not a valid UserOperationType`) - if (opts.type_CustomCheck && !opts.type_CustomCheck(o.type)) return new Error(`${path}.type: custom check failed`) - - if (typeof o.inbound !== 'boolean') return new Error(`${path}.inbound: is not a boolean`) - if (opts.inbound_CustomCheck && !opts.inbound_CustomCheck(o.inbound)) return new Error(`${path}.inbound: custom check failed`) - - if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - if (typeof o.identifier !== 'string') return new Error(`${path}.identifier: is not a string`) - if (opts.identifier_CustomCheck && !opts.identifier_CustomCheck(o.identifier)) return new Error(`${path}.identifier: custom check failed`) - - if (typeof o.operationId !== 'string') return new Error(`${path}.operationId: is not a string`) - if (opts.operationId_CustomCheck && !opts.operationId_CustomCheck(o.operationId)) return new Error(`${path}.operationId: custom check failed`) - - if (typeof o.service_fee !== 'number') return new Error(`${path}.service_fee: is not a number`) - if (opts.service_fee_CustomCheck && !opts.service_fee_CustomCheck(o.service_fee)) return new Error(`${path}.service_fee: custom check failed`) - - if (typeof o.network_fee !== 'number') return new Error(`${path}.network_fee: is not a number`) - if (opts.network_fee_CustomCheck && !opts.network_fee_CustomCheck(o.network_fee)) return new Error(`${path}.network_fee: custom check failed`) - - if (typeof o.confirmed !== 'boolean') return new Error(`${path}.confirmed: is not a boolean`) - if (opts.confirmed_CustomCheck && !opts.confirmed_CustomCheck(o.confirmed)) return new Error(`${path}.confirmed: custom check failed`) - - if (typeof o.tx_hash !== 'string') return new Error(`${path}.tx_hash: is not a string`) - if (opts.tx_hash_CustomCheck && !opts.tx_hash_CustomCheck(o.tx_hash)) return new Error(`${path}.tx_hash: custom check failed`) - - if (typeof o.internal !== 'boolean') return new Error(`${path}.internal: is not a boolean`) - if (opts.internal_CustomCheck && !opts.internal_CustomCheck(o.internal)) return new Error(`${path}.internal: custom check failed`) - - return null -} - -export type LiveUserOperation = { - operation: UserOperation -} -export const LiveUserOperationOptionalFields: [] = [] -export type LiveUserOperationOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - operation_Options?: UserOperationOptions -} -export const LiveUserOperationValidate = (o?: LiveUserOperation, opts: LiveUserOperationOptions = {}, path: string = 'LiveUserOperation::root.'): Error | null => { - 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') - - const operationErr = UserOperationValidate(o.operation, opts.operation_Options, `${path}.operation`) - if (operationErr !== null) return operationErr - - - return null -} - -export type RequestNPubLinkingTokenResponse = { - token: string -} -export const RequestNPubLinkingTokenResponseOptionalFields: [] = [] -export type RequestNPubLinkingTokenResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - token_CustomCheck?: (v: string) => boolean -} -export const RequestNPubLinkingTokenResponseValidate = (o?: RequestNPubLinkingTokenResponse, opts: RequestNPubLinkingTokenResponseOptions = {}, path: string = 'RequestNPubLinkingTokenResponse::root.'): Error | null => { - 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.token !== 'string') return new Error(`${path}.token: is not a string`) - if (opts.token_CustomCheck && !opts.token_CustomCheck(o.token)) return new Error(`${path}.token: custom check failed`) - - return null -} - -export type UsageMetrics = { - metrics: UsageMetric[] -} -export const UsageMetricsOptionalFields: [] = [] -export type UsageMetricsOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - metrics_ItemOptions?: UsageMetricOptions - metrics_CustomCheck?: (v: UsageMetric[]) => boolean -} -export const UsageMetricsValidate = (o?: UsageMetrics, opts: UsageMetricsOptions = {}, path: string = 'UsageMetrics::root.'): Error | null => { - 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 (!Array.isArray(o.metrics)) return new Error(`${path}.metrics: is not an array`) - for (let index = 0; index < o.metrics.length; index++) { - const metricsErr = UsageMetricValidate(o.metrics[index], opts.metrics_ItemOptions, `${path}.metrics[${index}]`) - if (metricsErr !== null) return metricsErr - } - if (opts.metrics_CustomCheck && !opts.metrics_CustomCheck(o.metrics)) return new Error(`${path}.metrics: custom check failed`) - - return null -} - -export type AppsMetrics = { - apps: AppMetrics[] -} -export const AppsMetricsOptionalFields: [] = [] -export type AppsMetricsOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - apps_ItemOptions?: AppMetricsOptions - apps_CustomCheck?: (v: AppMetrics[]) => boolean -} -export const AppsMetricsValidate = (o?: AppsMetrics, opts: AppsMetricsOptions = {}, path: string = 'AppsMetrics::root.'): Error | null => { - 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 (!Array.isArray(o.apps)) return new Error(`${path}.apps: is not an array`) - for (let index = 0; index < o.apps.length; index++) { - const appsErr = AppMetricsValidate(o.apps[index], opts.apps_ItemOptions, `${path}.apps[${index}]`) - if (appsErr !== null) return appsErr - } - if (opts.apps_CustomCheck && !opts.apps_CustomCheck(o.apps)) return new Error(`${path}.apps: custom check failed`) - - return null -} - -export type ClosedChannel = { - channel_id: string - capacity: number - closed_height: number -} -export const ClosedChannelOptionalFields: [] = [] -export type ClosedChannelOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - channel_id_CustomCheck?: (v: string) => boolean - capacity_CustomCheck?: (v: number) => boolean - closed_height_CustomCheck?: (v: number) => boolean -} -export const ClosedChannelValidate = (o?: ClosedChannel, opts: ClosedChannelOptions = {}, path: string = 'ClosedChannel::root.'): Error | null => { - 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.channel_id !== 'string') return new Error(`${path}.channel_id: is not a string`) - if (opts.channel_id_CustomCheck && !opts.channel_id_CustomCheck(o.channel_id)) return new Error(`${path}.channel_id: custom check failed`) - - if (typeof o.capacity !== 'number') return new Error(`${path}.capacity: is not a number`) - if (opts.capacity_CustomCheck && !opts.capacity_CustomCheck(o.capacity)) return new Error(`${path}.capacity: custom check failed`) - - if (typeof o.closed_height !== 'number') return new Error(`${path}.closed_height: is not a number`) - if (opts.closed_height_CustomCheck && !opts.closed_height_CustomCheck(o.closed_height)) return new Error(`${path}.closed_height: custom check failed`) - - return null -} - -export type ChannelBalanceEvent = { - block_height: number - channel_id: string - local_balance_sats: number - remote_balance_sats: number -} -export const ChannelBalanceEventOptionalFields: [] = [] -export type ChannelBalanceEventOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - block_height_CustomCheck?: (v: number) => boolean - channel_id_CustomCheck?: (v: string) => boolean - local_balance_sats_CustomCheck?: (v: number) => boolean - remote_balance_sats_CustomCheck?: (v: number) => boolean -} -export const ChannelBalanceEventValidate = (o?: ChannelBalanceEvent, opts: ChannelBalanceEventOptions = {}, path: string = 'ChannelBalanceEvent::root.'): Error | null => { - 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.block_height !== 'number') return new Error(`${path}.block_height: is not a number`) - if (opts.block_height_CustomCheck && !opts.block_height_CustomCheck(o.block_height)) return new Error(`${path}.block_height: custom check failed`) - - if (typeof o.channel_id !== 'string') return new Error(`${path}.channel_id: is not a string`) - if (opts.channel_id_CustomCheck && !opts.channel_id_CustomCheck(o.channel_id)) return new Error(`${path}.channel_id: custom check failed`) - - if (typeof o.local_balance_sats !== 'number') return new Error(`${path}.local_balance_sats: is not a number`) - if (opts.local_balance_sats_CustomCheck && !opts.local_balance_sats_CustomCheck(o.local_balance_sats)) return new Error(`${path}.local_balance_sats: custom check failed`) - - if (typeof o.remote_balance_sats !== 'number') return new Error(`${path}.remote_balance_sats: is not a number`) - if (opts.remote_balance_sats_CustomCheck && !opts.remote_balance_sats_CustomCheck(o.remote_balance_sats)) return new Error(`${path}.remote_balance_sats: custom check failed`) - - return null -} - -export type SetMockInvoiceAsPaidRequest = { - invoice: string - amount: number -} -export const SetMockInvoiceAsPaidRequestOptionalFields: [] = [] -export type SetMockInvoiceAsPaidRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - invoice_CustomCheck?: (v: string) => boolean - amount_CustomCheck?: (v: number) => boolean -} -export const SetMockInvoiceAsPaidRequestValidate = (o?: SetMockInvoiceAsPaidRequest, opts: SetMockInvoiceAsPaidRequestOptions = {}, path: string = 'SetMockInvoiceAsPaidRequest::root.'): Error | null => { - 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.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) - if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) - - if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - return null -} - -export type BanUserRequest = { - user_id: string -} -export const BanUserRequestOptionalFields: [] = [] -export type BanUserRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - user_id_CustomCheck?: (v: string) => boolean -} -export const BanUserRequestValidate = (o?: BanUserRequest, opts: BanUserRequestOptions = {}, path: string = 'BanUserRequest::root.'): Error | null => { - 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.user_id !== 'string') return new Error(`${path}.user_id: is not a string`) - if (opts.user_id_CustomCheck && !opts.user_id_CustomCheck(o.user_id)) return new Error(`${path}.user_id: custom check failed`) - - return null -} - -export type PayAddressResponse = { - txId: string - operation_id: string - service_fee: number - network_fee: number -} -export const PayAddressResponseOptionalFields: [] = [] -export type PayAddressResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - txId_CustomCheck?: (v: string) => boolean - operation_id_CustomCheck?: (v: string) => boolean - service_fee_CustomCheck?: (v: number) => boolean - network_fee_CustomCheck?: (v: number) => boolean -} -export const PayAddressResponseValidate = (o?: PayAddressResponse, opts: PayAddressResponseOptions = {}, path: string = 'PayAddressResponse::root.'): Error | null => { - 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.txId !== 'string') return new Error(`${path}.txId: is not a string`) - if (opts.txId_CustomCheck && !opts.txId_CustomCheck(o.txId)) return new Error(`${path}.txId: custom check failed`) - - if (typeof o.operation_id !== 'string') return new Error(`${path}.operation_id: is not a string`) - if (opts.operation_id_CustomCheck && !opts.operation_id_CustomCheck(o.operation_id)) return new Error(`${path}.operation_id: custom check failed`) - - if (typeof o.service_fee !== 'number') return new Error(`${path}.service_fee: is not a number`) - if (opts.service_fee_CustomCheck && !opts.service_fee_CustomCheck(o.service_fee)) return new Error(`${path}.service_fee: custom check failed`) - - if (typeof o.network_fee !== 'number') return new Error(`${path}.network_fee: is not a number`) - if (opts.network_fee_CustomCheck && !opts.network_fee_CustomCheck(o.network_fee)) return new Error(`${path}.network_fee: custom check failed`) - - return null -} - -export type GetUserOperationsRequest = { - latestIncomingInvoice: number - latestOutgoingInvoice: number - latestIncomingTx: number - latestOutgoingTx: number - latestIncomingUserToUserPayment: number - latestOutgoingUserToUserPayment: number - max_size: number -} -export const GetUserOperationsRequestOptionalFields: [] = [] -export type GetUserOperationsRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - latestIncomingInvoice_CustomCheck?: (v: number) => boolean - latestOutgoingInvoice_CustomCheck?: (v: number) => boolean - latestIncomingTx_CustomCheck?: (v: number) => boolean - latestOutgoingTx_CustomCheck?: (v: number) => boolean - latestIncomingUserToUserPayment_CustomCheck?: (v: number) => boolean - latestOutgoingUserToUserPayment_CustomCheck?: (v: number) => boolean - max_size_CustomCheck?: (v: number) => boolean -} -export const GetUserOperationsRequestValidate = (o?: GetUserOperationsRequest, opts: GetUserOperationsRequestOptions = {}, path: string = 'GetUserOperationsRequest::root.'): Error | null => { - 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.latestIncomingInvoice !== 'number') return new Error(`${path}.latestIncomingInvoice: is not a number`) - if (opts.latestIncomingInvoice_CustomCheck && !opts.latestIncomingInvoice_CustomCheck(o.latestIncomingInvoice)) return new Error(`${path}.latestIncomingInvoice: custom check failed`) - - if (typeof o.latestOutgoingInvoice !== 'number') return new Error(`${path}.latestOutgoingInvoice: is not a number`) - if (opts.latestOutgoingInvoice_CustomCheck && !opts.latestOutgoingInvoice_CustomCheck(o.latestOutgoingInvoice)) return new Error(`${path}.latestOutgoingInvoice: custom check failed`) - - if (typeof o.latestIncomingTx !== 'number') return new Error(`${path}.latestIncomingTx: is not a number`) - if (opts.latestIncomingTx_CustomCheck && !opts.latestIncomingTx_CustomCheck(o.latestIncomingTx)) return new Error(`${path}.latestIncomingTx: custom check failed`) - - if (typeof o.latestOutgoingTx !== 'number') return new Error(`${path}.latestOutgoingTx: is not a number`) - if (opts.latestOutgoingTx_CustomCheck && !opts.latestOutgoingTx_CustomCheck(o.latestOutgoingTx)) return new Error(`${path}.latestOutgoingTx: custom check failed`) - - if (typeof o.latestIncomingUserToUserPayment !== 'number') return new Error(`${path}.latestIncomingUserToUserPayment: is not a number`) - if (opts.latestIncomingUserToUserPayment_CustomCheck && !opts.latestIncomingUserToUserPayment_CustomCheck(o.latestIncomingUserToUserPayment)) return new Error(`${path}.latestIncomingUserToUserPayment: custom check failed`) - - if (typeof o.latestOutgoingUserToUserPayment !== 'number') return new Error(`${path}.latestOutgoingUserToUserPayment: is not a number`) - if (opts.latestOutgoingUserToUserPayment_CustomCheck && !opts.latestOutgoingUserToUserPayment_CustomCheck(o.latestOutgoingUserToUserPayment)) return new Error(`${path}.latestOutgoingUserToUserPayment: custom check failed`) - - if (typeof o.max_size !== 'number') return new Error(`${path}.max_size: is not a number`) - if (opts.max_size_CustomCheck && !opts.max_size_CustomCheck(o.max_size)) return new Error(`${path}.max_size: custom check failed`) - - return null -} - -export type EncryptionExchangeRequest = { - publicKey: string - deviceId: string -} -export const EncryptionExchangeRequestOptionalFields: [] = [] -export type EncryptionExchangeRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - publicKey_CustomCheck?: (v: string) => boolean - deviceId_CustomCheck?: (v: string) => boolean -} -export const EncryptionExchangeRequestValidate = (o?: EncryptionExchangeRequest, opts: EncryptionExchangeRequestOptions = {}, path: string = 'EncryptionExchangeRequest::root.'): Error | null => { - 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.publicKey !== 'string') return new Error(`${path}.publicKey: is not a string`) - if (opts.publicKey_CustomCheck && !opts.publicKey_CustomCheck(o.publicKey)) return new Error(`${path}.publicKey: custom check failed`) - - if (typeof o.deviceId !== 'string') return new Error(`${path}.deviceId: is not a string`) - if (opts.deviceId_CustomCheck && !opts.deviceId_CustomCheck(o.deviceId)) return new Error(`${path}.deviceId: custom check failed`) - - return null -} - -export type AppsMetricsRequest = { - from_unix?: number - to_unix?: number - include_operations?: boolean -} -export type AppsMetricsRequestOptionalField = 'from_unix' | 'to_unix' | 'include_operations' -export const AppsMetricsRequestOptionalFields: AppsMetricsRequestOptionalField[] = ['from_unix', 'to_unix', 'include_operations'] -export type AppsMetricsRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: AppsMetricsRequestOptionalField[] - from_unix_CustomCheck?: (v?: number) => boolean - to_unix_CustomCheck?: (v?: number) => boolean - include_operations_CustomCheck?: (v?: boolean) => boolean -} -export const AppsMetricsRequestValidate = (o?: AppsMetricsRequest, opts: AppsMetricsRequestOptions = {}, path: string = 'AppsMetricsRequest::root.'): Error | null => { - 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 ((o.from_unix || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('from_unix')) && typeof o.from_unix !== 'number') return new Error(`${path}.from_unix: is not a number`) - if (opts.from_unix_CustomCheck && !opts.from_unix_CustomCheck(o.from_unix)) return new Error(`${path}.from_unix: custom check failed`) - - if ((o.to_unix || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('to_unix')) && typeof o.to_unix !== 'number') return new Error(`${path}.to_unix: is not a number`) - if (opts.to_unix_CustomCheck && !opts.to_unix_CustomCheck(o.to_unix)) return new Error(`${path}.to_unix: custom check failed`) - - if ((o.include_operations || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('include_operations')) && typeof o.include_operations !== 'boolean') return new Error(`${path}.include_operations: is not a boolean`) - if (opts.include_operations_CustomCheck && !opts.include_operations_CustomCheck(o.include_operations)) return new Error(`${path}.include_operations: custom check failed`) - - return null -} - -export type AppMetrics = { - app: Application - users: UsersInfo - received: number - spent: number - available: number - fees: number - invoices: number - total_fees: number - operations: UserOperation[] -} -export const AppMetricsOptionalFields: [] = [] -export type AppMetricsOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - app_Options?: ApplicationOptions - users_Options?: UsersInfoOptions - received_CustomCheck?: (v: number) => boolean - spent_CustomCheck?: (v: number) => boolean - available_CustomCheck?: (v: number) => boolean - fees_CustomCheck?: (v: number) => boolean - invoices_CustomCheck?: (v: number) => boolean - total_fees_CustomCheck?: (v: number) => boolean - operations_ItemOptions?: UserOperationOptions - operations_CustomCheck?: (v: UserOperation[]) => boolean -} -export const AppMetricsValidate = (o?: AppMetrics, opts: AppMetricsOptions = {}, path: string = 'AppMetrics::root.'): Error | null => { - 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') - - const appErr = ApplicationValidate(o.app, opts.app_Options, `${path}.app`) - if (appErr !== null) return appErr - - - const usersErr = UsersInfoValidate(o.users, opts.users_Options, `${path}.users`) - if (usersErr !== null) return usersErr - - - if (typeof o.received !== 'number') return new Error(`${path}.received: is not a number`) - if (opts.received_CustomCheck && !opts.received_CustomCheck(o.received)) return new Error(`${path}.received: custom check failed`) - - if (typeof o.spent !== 'number') return new Error(`${path}.spent: is not a number`) - if (opts.spent_CustomCheck && !opts.spent_CustomCheck(o.spent)) return new Error(`${path}.spent: custom check failed`) - - if (typeof o.available !== 'number') return new Error(`${path}.available: is not a number`) - if (opts.available_CustomCheck && !opts.available_CustomCheck(o.available)) return new Error(`${path}.available: custom check failed`) - - if (typeof o.fees !== 'number') return new Error(`${path}.fees: is not a number`) - if (opts.fees_CustomCheck && !opts.fees_CustomCheck(o.fees)) return new Error(`${path}.fees: custom check failed`) - - if (typeof o.invoices !== 'number') return new Error(`${path}.invoices: is not a number`) - if (opts.invoices_CustomCheck && !opts.invoices_CustomCheck(o.invoices)) return new Error(`${path}.invoices: custom check failed`) - - if (typeof o.total_fees !== 'number') return new Error(`${path}.total_fees: is not a number`) - if (opts.total_fees_CustomCheck && !opts.total_fees_CustomCheck(o.total_fees)) return new Error(`${path}.total_fees: custom check failed`) - - if (!Array.isArray(o.operations)) return new Error(`${path}.operations: is not an array`) - for (let index = 0; index < o.operations.length; index++) { - const operationsErr = UserOperationValidate(o.operations[index], opts.operations_ItemOptions, `${path}.operations[${index}]`) - if (operationsErr !== null) return operationsErr - } - if (opts.operations_CustomCheck && !opts.operations_CustomCheck(o.operations)) return new Error(`${path}.operations: custom check failed`) - - return null -} - -export type RequestNPubLinkingTokenRequest = { - user_identifier: string -} -export const RequestNPubLinkingTokenRequestOptionalFields: [] = [] -export type RequestNPubLinkingTokenRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - user_identifier_CustomCheck?: (v: string) => boolean -} -export const RequestNPubLinkingTokenRequestValidate = (o?: RequestNPubLinkingTokenRequest, opts: RequestNPubLinkingTokenRequestOptions = {}, path: string = 'RequestNPubLinkingTokenRequest::root.'): Error | null => { - 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.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) - if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) - - return null -} - -export type LndMetricsRequest = { - from_unix?: number - to_unix?: number -} -export type LndMetricsRequestOptionalField = 'from_unix' | 'to_unix' -export const LndMetricsRequestOptionalFields: LndMetricsRequestOptionalField[] = ['from_unix', 'to_unix'] -export type LndMetricsRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: LndMetricsRequestOptionalField[] - from_unix_CustomCheck?: (v?: number) => boolean - to_unix_CustomCheck?: (v?: number) => boolean -} -export const LndMetricsRequestValidate = (o?: LndMetricsRequest, opts: LndMetricsRequestOptions = {}, path: string = 'LndMetricsRequest::root.'): Error | null => { - 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 ((o.from_unix || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('from_unix')) && typeof o.from_unix !== 'number') return new Error(`${path}.from_unix: is not a number`) - if (opts.from_unix_CustomCheck && !opts.from_unix_CustomCheck(o.from_unix)) return new Error(`${path}.from_unix: custom check failed`) - - if ((o.to_unix || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('to_unix')) && typeof o.to_unix !== 'number') return new Error(`${path}.to_unix: is not a number`) - if (opts.to_unix_CustomCheck && !opts.to_unix_CustomCheck(o.to_unix)) return new Error(`${path}.to_unix: custom check failed`) - - return null -} - -export type PayInvoiceRequest = { - invoice: string - amount: number -} -export const PayInvoiceRequestOptionalFields: [] = [] -export type PayInvoiceRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - invoice_CustomCheck?: (v: string) => boolean - amount_CustomCheck?: (v: number) => boolean -} -export const PayInvoiceRequestValidate = (o?: PayInvoiceRequest, opts: PayInvoiceRequestOptions = {}, path: string = 'PayInvoiceRequest::root.'): Error | null => { - 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.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) - if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) - - if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - return null -} - -export type LnurlLinkResponse = { - lnurl: string - k1: string -} -export const LnurlLinkResponseOptionalFields: [] = [] -export type LnurlLinkResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - lnurl_CustomCheck?: (v: string) => boolean - k1_CustomCheck?: (v: string) => boolean -} -export const LnurlLinkResponseValidate = (o?: LnurlLinkResponse, opts: LnurlLinkResponseOptions = {}, path: string = 'LnurlLinkResponse::root.'): Error | null => { - 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.lnurl !== 'string') return new Error(`${path}.lnurl: is not a string`) - if (opts.lnurl_CustomCheck && !opts.lnurl_CustomCheck(o.lnurl)) return new Error(`${path}.lnurl: custom check failed`) - - if (typeof o.k1 !== 'string') return new Error(`${path}.k1: is not a string`) - if (opts.k1_CustomCheck && !opts.k1_CustomCheck(o.k1)) return new Error(`${path}.k1: custom check failed`) - - return null -} - -export type LinkNPubThroughTokenRequest = { - token: string - nostr_pub: string -} -export const LinkNPubThroughTokenRequestOptionalFields: [] = [] -export type LinkNPubThroughTokenRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - token_CustomCheck?: (v: string) => boolean - nostr_pub_CustomCheck?: (v: string) => boolean -} -export const LinkNPubThroughTokenRequestValidate = (o?: LinkNPubThroughTokenRequest, opts: LinkNPubThroughTokenRequestOptions = {}, path: string = 'LinkNPubThroughTokenRequest::root.'): Error | null => { - 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.token !== 'string') return new Error(`${path}.token: is not a string`) - if (opts.token_CustomCheck && !opts.token_CustomCheck(o.token)) return new Error(`${path}.token: custom check failed`) - - if (typeof o.nostr_pub !== 'string') return new Error(`${path}.nostr_pub: is not a string`) - if (opts.nostr_pub_CustomCheck && !opts.nostr_pub_CustomCheck(o.nostr_pub)) return new Error(`${path}.nostr_pub: custom check failed`) - - return null -} - -export type AddAppInvoiceRequest = { - payer_identifier: string - http_callback_url: string - invoice_req: NewInvoiceRequest -} -export const AddAppInvoiceRequestOptionalFields: [] = [] -export type AddAppInvoiceRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - payer_identifier_CustomCheck?: (v: string) => boolean - http_callback_url_CustomCheck?: (v: string) => boolean - invoice_req_Options?: NewInvoiceRequestOptions -} -export const AddAppInvoiceRequestValidate = (o?: AddAppInvoiceRequest, opts: AddAppInvoiceRequestOptions = {}, path: string = 'AddAppInvoiceRequest::root.'): Error | null => { - 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.payer_identifier !== 'string') return new Error(`${path}.payer_identifier: is not a string`) - if (opts.payer_identifier_CustomCheck && !opts.payer_identifier_CustomCheck(o.payer_identifier)) return new Error(`${path}.payer_identifier: custom check failed`) - - if (typeof o.http_callback_url !== 'string') return new Error(`${path}.http_callback_url: is not a string`) - if (opts.http_callback_url_CustomCheck && !opts.http_callback_url_CustomCheck(o.http_callback_url)) return new Error(`${path}.http_callback_url: custom check failed`) - - const invoice_reqErr = NewInvoiceRequestValidate(o.invoice_req, opts.invoice_req_Options, `${path}.invoice_req`) - if (invoice_reqErr !== null) return invoice_reqErr - - - return null -} - -export type GetAppUserRequest = { - user_identifier: string -} -export const GetAppUserRequestOptionalFields: [] = [] -export type GetAppUserRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - user_identifier_CustomCheck?: (v: string) => boolean -} -export const GetAppUserRequestValidate = (o?: GetAppUserRequest, opts: GetAppUserRequestOptions = {}, path: string = 'GetAppUserRequest::root.'): Error | null => { - 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.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) - if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) - - return null -} - -export type LnurlPayInfoResponse = { - tag: string - callback: string - maxSendable: number - minSendable: number - metadata: string - allowsNostr: boolean - nostrPubkey: string -} -export const LnurlPayInfoResponseOptionalFields: [] = [] -export type LnurlPayInfoResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - tag_CustomCheck?: (v: string) => boolean - callback_CustomCheck?: (v: string) => boolean - maxSendable_CustomCheck?: (v: number) => boolean - minSendable_CustomCheck?: (v: number) => boolean - metadata_CustomCheck?: (v: string) => boolean - allowsNostr_CustomCheck?: (v: boolean) => boolean - nostrPubkey_CustomCheck?: (v: string) => boolean -} -export const LnurlPayInfoResponseValidate = (o?: LnurlPayInfoResponse, opts: LnurlPayInfoResponseOptions = {}, path: string = 'LnurlPayInfoResponse::root.'): Error | null => { - 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.tag !== 'string') return new Error(`${path}.tag: is not a string`) - if (opts.tag_CustomCheck && !opts.tag_CustomCheck(o.tag)) return new Error(`${path}.tag: custom check failed`) - - if (typeof o.callback !== 'string') return new Error(`${path}.callback: is not a string`) - if (opts.callback_CustomCheck && !opts.callback_CustomCheck(o.callback)) return new Error(`${path}.callback: custom check failed`) - - if (typeof o.maxSendable !== 'number') return new Error(`${path}.maxSendable: is not a number`) - if (opts.maxSendable_CustomCheck && !opts.maxSendable_CustomCheck(o.maxSendable)) return new Error(`${path}.maxSendable: custom check failed`) - - if (typeof o.minSendable !== 'number') return new Error(`${path}.minSendable: is not a number`) - if (opts.minSendable_CustomCheck && !opts.minSendable_CustomCheck(o.minSendable)) return new Error(`${path}.minSendable: custom check failed`) - - if (typeof o.metadata !== 'string') return new Error(`${path}.metadata: is not a string`) - if (opts.metadata_CustomCheck && !opts.metadata_CustomCheck(o.metadata)) return new Error(`${path}.metadata: custom check failed`) - - if (typeof o.allowsNostr !== 'boolean') return new Error(`${path}.allowsNostr: is not a boolean`) - if (opts.allowsNostr_CustomCheck && !opts.allowsNostr_CustomCheck(o.allowsNostr)) return new Error(`${path}.allowsNostr: custom check failed`) - - if (typeof o.nostrPubkey !== 'string') return new Error(`${path}.nostrPubkey: is not a string`) - if (opts.nostrPubkey_CustomCheck && !opts.nostrPubkey_CustomCheck(o.nostrPubkey)) return new Error(`${path}.nostrPubkey: custom check failed`) - - return null -} - -export type NewInvoiceResponse = { - invoice: string -} -export const NewInvoiceResponseOptionalFields: [] = [] -export type NewInvoiceResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - invoice_CustomCheck?: (v: string) => boolean -} -export const NewInvoiceResponseValidate = (o?: NewInvoiceResponse, opts: NewInvoiceResponseOptions = {}, path: string = 'NewInvoiceResponse::root.'): Error | null => { - 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.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) - if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) - - return null -} - -export type PayAppUserInvoiceRequest = { - user_identifier: string - invoice: string - amount: number -} -export const PayAppUserInvoiceRequestOptionalFields: [] = [] -export type PayAppUserInvoiceRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - user_identifier_CustomCheck?: (v: string) => boolean - invoice_CustomCheck?: (v: string) => boolean - amount_CustomCheck?: (v: number) => boolean -} -export const PayAppUserInvoiceRequestValidate = (o?: PayAppUserInvoiceRequest, opts: PayAppUserInvoiceRequestOptions = {}, path: string = 'PayAppUserInvoiceRequest::root.'): Error | null => { - 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.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) - if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) - - if (typeof o.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) - if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) - - if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - return null -} - -export type PayAddressRequest = { - address: string - amoutSats: number - satsPerVByte: number -} -export const PayAddressRequestOptionalFields: [] = [] -export type PayAddressRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - address_CustomCheck?: (v: string) => boolean - amoutSats_CustomCheck?: (v: number) => boolean - satsPerVByte_CustomCheck?: (v: number) => boolean -} -export const PayAddressRequestValidate = (o?: PayAddressRequest, opts: PayAddressRequestOptions = {}, path: string = 'PayAddressRequest::root.'): Error | null => { - 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.address !== 'string') return new Error(`${path}.address: is not a string`) - if (opts.address_CustomCheck && !opts.address_CustomCheck(o.address)) return new Error(`${path}.address: custom check failed`) - - if (typeof o.amoutSats !== 'number') return new Error(`${path}.amoutSats: is not a number`) - if (opts.amoutSats_CustomCheck && !opts.amoutSats_CustomCheck(o.amoutSats)) return new Error(`${path}.amoutSats: custom check failed`) - - if (typeof o.satsPerVByte !== 'number') return new Error(`${path}.satsPerVByte: is not a number`) - if (opts.satsPerVByte_CustomCheck && !opts.satsPerVByte_CustomCheck(o.satsPerVByte)) return new Error(`${path}.satsPerVByte: custom check failed`) - - return null -} - -export type GetProductBuyLinkResponse = { - link: string -} -export const GetProductBuyLinkResponseOptionalFields: [] = [] -export type GetProductBuyLinkResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - link_CustomCheck?: (v: string) => boolean -} -export const GetProductBuyLinkResponseValidate = (o?: GetProductBuyLinkResponse, opts: GetProductBuyLinkResponseOptions = {}, path: string = 'GetProductBuyLinkResponse::root.'): Error | null => { - 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.link !== 'string') return new Error(`${path}.link: is not a string`) - if (opts.link_CustomCheck && !opts.link_CustomCheck(o.link)) return new Error(`${path}.link: custom check failed`) - - return null -} - -export type OpenChannel = { - channel_id: string - capacity: number - active: boolean - lifetime: number - local_balance: number - remote_balance: number -} -export const OpenChannelOptionalFields: [] = [] -export type OpenChannelOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - channel_id_CustomCheck?: (v: string) => boolean - capacity_CustomCheck?: (v: number) => boolean - active_CustomCheck?: (v: boolean) => boolean - lifetime_CustomCheck?: (v: number) => boolean - local_balance_CustomCheck?: (v: number) => boolean - remote_balance_CustomCheck?: (v: number) => boolean -} -export const OpenChannelValidate = (o?: OpenChannel, opts: OpenChannelOptions = {}, path: string = 'OpenChannel::root.'): Error | null => { - 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.channel_id !== 'string') return new Error(`${path}.channel_id: is not a string`) - if (opts.channel_id_CustomCheck && !opts.channel_id_CustomCheck(o.channel_id)) return new Error(`${path}.channel_id: custom check failed`) - - if (typeof o.capacity !== 'number') return new Error(`${path}.capacity: is not a number`) - if (opts.capacity_CustomCheck && !opts.capacity_CustomCheck(o.capacity)) return new Error(`${path}.capacity: custom check failed`) - - if (typeof o.active !== 'boolean') return new Error(`${path}.active: is not a boolean`) - if (opts.active_CustomCheck && !opts.active_CustomCheck(o.active)) return new Error(`${path}.active: custom check failed`) - - if (typeof o.lifetime !== 'number') return new Error(`${path}.lifetime: is not a number`) - if (opts.lifetime_CustomCheck && !opts.lifetime_CustomCheck(o.lifetime)) return new Error(`${path}.lifetime: custom check failed`) - - if (typeof o.local_balance !== 'number') return new Error(`${path}.local_balance: is not a number`) - if (opts.local_balance_CustomCheck && !opts.local_balance_CustomCheck(o.local_balance)) return new Error(`${path}.local_balance: custom check failed`) - - if (typeof o.remote_balance !== 'number') return new Error(`${path}.remote_balance: is not a number`) - if (opts.remote_balance_CustomCheck && !opts.remote_balance_CustomCheck(o.remote_balance)) return new Error(`${path}.remote_balance: custom check failed`) - - return null -} - -export type Application = { - name: string - id: string - balance: number - npub: string -} -export const ApplicationOptionalFields: [] = [] -export type ApplicationOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - name_CustomCheck?: (v: string) => boolean - id_CustomCheck?: (v: string) => boolean - balance_CustomCheck?: (v: number) => boolean - npub_CustomCheck?: (v: string) => boolean -} -export const ApplicationValidate = (o?: Application, opts: ApplicationOptions = {}, path: string = 'Application::root.'): Error | null => { - 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.name !== 'string') return new Error(`${path}.name: is not a string`) - if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) - - if (typeof o.id !== 'string') return new Error(`${path}.id: is not a string`) - if (opts.id_CustomCheck && !opts.id_CustomCheck(o.id)) return new Error(`${path}.id: custom check failed`) - - if (typeof o.balance !== 'number') return new Error(`${path}.balance: is not a number`) - if (opts.balance_CustomCheck && !opts.balance_CustomCheck(o.balance)) return new Error(`${path}.balance: custom check failed`) - - if (typeof o.npub !== 'string') return new Error(`${path}.npub: is not a string`) - if (opts.npub_CustomCheck && !opts.npub_CustomCheck(o.npub)) return new Error(`${path}.npub: custom check failed`) - - return null -} - -export type AuthApp = { - app: Application - auth_token: string -} -export const AuthAppOptionalFields: [] = [] -export type AuthAppOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - app_Options?: ApplicationOptions - auth_token_CustomCheck?: (v: string) => boolean -} -export const AuthAppValidate = (o?: AuthApp, opts: AuthAppOptions = {}, path: string = 'AuthApp::root.'): Error | null => { - 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') - - const appErr = ApplicationValidate(o.app, opts.app_Options, `${path}.app`) - if (appErr !== null) return appErr - - - if (typeof o.auth_token !== 'string') return new Error(`${path}.auth_token: is not a string`) - if (opts.auth_token_CustomCheck && !opts.auth_token_CustomCheck(o.auth_token)) return new Error(`${path}.auth_token: custom check failed`) - - return null -} - -export type NewAddressResponse = { - address: string -} -export const NewAddressResponseOptionalFields: [] = [] -export type NewAddressResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - address_CustomCheck?: (v: string) => boolean -} -export const NewAddressResponseValidate = (o?: NewAddressResponse, opts: NewAddressResponseOptions = {}, path: string = 'NewAddressResponse::root.'): Error | null => { - 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.address !== 'string') return new Error(`${path}.address: is not a string`) - if (opts.address_CustomCheck && !opts.address_CustomCheck(o.address)) return new Error(`${path}.address: custom check failed`) - - return null -} - -export type OpenChannelResponse = { - channelId: string -} -export const OpenChannelResponseOptionalFields: [] = [] -export type OpenChannelResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - channelId_CustomCheck?: (v: string) => boolean -} -export const OpenChannelResponseValidate = (o?: OpenChannelResponse, opts: OpenChannelResponseOptions = {}, path: string = 'OpenChannelResponse::root.'): Error | null => { - 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.channelId !== 'string') return new Error(`${path}.channelId: is not a string`) - if (opts.channelId_CustomCheck && !opts.channelId_CustomCheck(o.channelId)) return new Error(`${path}.channelId: custom check failed`) - - return null -} - -export type LnurlWithdrawInfoResponse = { - tag: string - callback: string - k1: string - defaultDescription: string - minWithdrawable: number - maxWithdrawable: number - balanceCheck: string - payLink: string -} -export const LnurlWithdrawInfoResponseOptionalFields: [] = [] -export type LnurlWithdrawInfoResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - tag_CustomCheck?: (v: string) => boolean - callback_CustomCheck?: (v: string) => boolean - k1_CustomCheck?: (v: string) => boolean - defaultDescription_CustomCheck?: (v: string) => boolean - minWithdrawable_CustomCheck?: (v: number) => boolean - maxWithdrawable_CustomCheck?: (v: number) => boolean - balanceCheck_CustomCheck?: (v: string) => boolean - payLink_CustomCheck?: (v: string) => boolean -} -export const LnurlWithdrawInfoResponseValidate = (o?: LnurlWithdrawInfoResponse, opts: LnurlWithdrawInfoResponseOptions = {}, path: string = 'LnurlWithdrawInfoResponse::root.'): Error | null => { - 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.tag !== 'string') return new Error(`${path}.tag: is not a string`) - if (opts.tag_CustomCheck && !opts.tag_CustomCheck(o.tag)) return new Error(`${path}.tag: custom check failed`) - - if (typeof o.callback !== 'string') return new Error(`${path}.callback: is not a string`) - if (opts.callback_CustomCheck && !opts.callback_CustomCheck(o.callback)) return new Error(`${path}.callback: custom check failed`) - - if (typeof o.k1 !== 'string') return new Error(`${path}.k1: is not a string`) - if (opts.k1_CustomCheck && !opts.k1_CustomCheck(o.k1)) return new Error(`${path}.k1: custom check failed`) - - if (typeof o.defaultDescription !== 'string') return new Error(`${path}.defaultDescription: is not a string`) - if (opts.defaultDescription_CustomCheck && !opts.defaultDescription_CustomCheck(o.defaultDescription)) return new Error(`${path}.defaultDescription: custom check failed`) - - if (typeof o.minWithdrawable !== 'number') return new Error(`${path}.minWithdrawable: is not a number`) - if (opts.minWithdrawable_CustomCheck && !opts.minWithdrawable_CustomCheck(o.minWithdrawable)) return new Error(`${path}.minWithdrawable: custom check failed`) - - if (typeof o.maxWithdrawable !== 'number') return new Error(`${path}.maxWithdrawable: is not a number`) - if (opts.maxWithdrawable_CustomCheck && !opts.maxWithdrawable_CustomCheck(o.maxWithdrawable)) return new Error(`${path}.maxWithdrawable: custom check failed`) - - if (typeof o.balanceCheck !== 'string') return new Error(`${path}.balanceCheck: is not a string`) - if (opts.balanceCheck_CustomCheck && !opts.balanceCheck_CustomCheck(o.balanceCheck)) return new Error(`${path}.balanceCheck: custom check failed`) - - if (typeof o.payLink !== 'string') return new Error(`${path}.payLink: is not a string`) - if (opts.payLink_CustomCheck && !opts.payLink_CustomCheck(o.payLink)) return new Error(`${path}.payLink: custom check failed`) - - return null -} - -export type MigrationUpdate = { - closure?: ClosureMigration - relays?: RelaysMigration -} -export type MigrationUpdateOptionalField = 'closure' | 'relays' -export const MigrationUpdateOptionalFields: MigrationUpdateOptionalField[] = ['closure', 'relays'] -export type MigrationUpdateOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: MigrationUpdateOptionalField[] - closure_Options?: ClosureMigrationOptions - relays_Options?: RelaysMigrationOptions -} -export const MigrationUpdateValidate = (o?: MigrationUpdate, opts: MigrationUpdateOptions = {}, path: string = 'MigrationUpdate::root.'): Error | null => { - 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.closure === 'object' || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('closure')) { - const closureErr = ClosureMigrationValidate(o.closure, opts.closure_Options, `${path}.closure`) - if (closureErr !== null) return closureErr - } - - - if (typeof o.relays === 'object' || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('relays')) { - const relaysErr = RelaysMigrationValidate(o.relays, opts.relays_Options, `${path}.relays`) - if (relaysErr !== null) return relaysErr - } - - - return null -} - -export type BannedAppUser = { - app_name: string - app_id: string - user_identifier: string - nostr_pub: string -} -export const BannedAppUserOptionalFields: [] = [] -export type BannedAppUserOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - app_name_CustomCheck?: (v: string) => boolean - app_id_CustomCheck?: (v: string) => boolean - user_identifier_CustomCheck?: (v: string) => boolean - nostr_pub_CustomCheck?: (v: string) => boolean -} -export const BannedAppUserValidate = (o?: BannedAppUser, opts: BannedAppUserOptions = {}, path: string = 'BannedAppUser::root.'): Error | null => { - 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.app_name !== 'string') return new Error(`${path}.app_name: is not a string`) - if (opts.app_name_CustomCheck && !opts.app_name_CustomCheck(o.app_name)) return new Error(`${path}.app_name: custom check failed`) - - if (typeof o.app_id !== 'string') return new Error(`${path}.app_id: is not a string`) - if (opts.app_id_CustomCheck && !opts.app_id_CustomCheck(o.app_id)) return new Error(`${path}.app_id: custom check failed`) - - if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) - if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) - - if (typeof o.nostr_pub !== 'string') return new Error(`${path}.nostr_pub: is not a string`) - if (opts.nostr_pub_CustomCheck && !opts.nostr_pub_CustomCheck(o.nostr_pub)) return new Error(`${path}.nostr_pub: custom check failed`) - - return null -} - -export type AuthAppRequest = { - name: string - allow_user_creation?: boolean -} -export type AuthAppRequestOptionalField = 'allow_user_creation' -export const AuthAppRequestOptionalFields: AuthAppRequestOptionalField[] = ['allow_user_creation'] -export type AuthAppRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: AuthAppRequestOptionalField[] - name_CustomCheck?: (v: string) => boolean - allow_user_creation_CustomCheck?: (v?: boolean) => boolean -} -export const AuthAppRequestValidate = (o?: AuthAppRequest, opts: AuthAppRequestOptions = {}, path: string = 'AuthAppRequest::root.'): Error | null => { - 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.name !== 'string') return new Error(`${path}.name: is not a string`) - if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) - - if ((o.allow_user_creation || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('allow_user_creation')) && typeof o.allow_user_creation !== 'boolean') return new Error(`${path}.allow_user_creation: is not a boolean`) - if (opts.allow_user_creation_CustomCheck && !opts.allow_user_creation_CustomCheck(o.allow_user_creation)) return new Error(`${path}.allow_user_creation: custom check failed`) - - return null -} - -export type SendAppUserToAppUserPaymentRequest = { - from_user_identifier: string - to_user_identifier: string - amount: number -} -export const SendAppUserToAppUserPaymentRequestOptionalFields: [] = [] -export type SendAppUserToAppUserPaymentRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - from_user_identifier_CustomCheck?: (v: string) => boolean - to_user_identifier_CustomCheck?: (v: string) => boolean - amount_CustomCheck?: (v: number) => boolean -} -export const SendAppUserToAppUserPaymentRequestValidate = (o?: SendAppUserToAppUserPaymentRequest, opts: SendAppUserToAppUserPaymentRequestOptions = {}, path: string = 'SendAppUserToAppUserPaymentRequest::root.'): Error | null => { - 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.from_user_identifier !== 'string') return new Error(`${path}.from_user_identifier: is not a string`) - if (opts.from_user_identifier_CustomCheck && !opts.from_user_identifier_CustomCheck(o.from_user_identifier)) return new Error(`${path}.from_user_identifier: custom check failed`) - - if (typeof o.to_user_identifier !== 'string') return new Error(`${path}.to_user_identifier: is not a string`) - if (opts.to_user_identifier_CustomCheck && !opts.to_user_identifier_CustomCheck(o.to_user_identifier)) return new Error(`${path}.to_user_identifier: custom check failed`) - - if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - return null -} - -export type BanUserResponse = { - balance_sats: number - banned_app_users: BannedAppUser[] -} -export const BanUserResponseOptionalFields: [] = [] -export type BanUserResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - balance_sats_CustomCheck?: (v: number) => boolean - banned_app_users_ItemOptions?: BannedAppUserOptions - banned_app_users_CustomCheck?: (v: BannedAppUser[]) => boolean -} -export const BanUserResponseValidate = (o?: BanUserResponse, opts: BanUserResponseOptions = {}, path: string = 'BanUserResponse::root.'): Error | null => { - 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.balance_sats !== 'number') return new Error(`${path}.balance_sats: is not a number`) - if (opts.balance_sats_CustomCheck && !opts.balance_sats_CustomCheck(o.balance_sats)) return new Error(`${path}.balance_sats: custom check failed`) - - if (!Array.isArray(o.banned_app_users)) return new Error(`${path}.banned_app_users: is not an array`) - for (let index = 0; index < o.banned_app_users.length; index++) { - const banned_app_usersErr = BannedAppUserValidate(o.banned_app_users[index], opts.banned_app_users_ItemOptions, `${path}.banned_app_users[${index}]`) - if (banned_app_usersErr !== null) return banned_app_usersErr - } - if (opts.banned_app_users_CustomCheck && !opts.banned_app_users_CustomCheck(o.banned_app_users)) return new Error(`${path}.banned_app_users: custom check failed`) - - return null -} - -export type SetMockAppUserBalanceRequest = { - user_identifier: string - amount: number -} -export const SetMockAppUserBalanceRequestOptionalFields: [] = [] -export type SetMockAppUserBalanceRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - user_identifier_CustomCheck?: (v: string) => boolean - amount_CustomCheck?: (v: number) => boolean -} -export const SetMockAppUserBalanceRequestValidate = (o?: SetMockAppUserBalanceRequest, opts: SetMockAppUserBalanceRequestOptions = {}, path: string = 'SetMockAppUserBalanceRequest::root.'): Error | null => { - 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.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) - if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) - - if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - return null -} - -export type NewInvoiceRequest = { - amountSats: number - memo: string -} -export const NewInvoiceRequestOptionalFields: [] = [] -export type NewInvoiceRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - amountSats_CustomCheck?: (v: number) => boolean - memo_CustomCheck?: (v: string) => boolean -} -export const NewInvoiceRequestValidate = (o?: NewInvoiceRequest, opts: NewInvoiceRequestOptions = {}, path: string = 'NewInvoiceRequest::root.'): Error | null => { - 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.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 (typeof o.memo !== 'string') return new Error(`${path}.memo: is not a string`) - if (opts.memo_CustomCheck && !opts.memo_CustomCheck(o.memo)) return new Error(`${path}.memo: custom check failed`) - - return null -} - -export type HandleLnurlPayResponse = { - pr: string - routes: Empty[] -} -export const HandleLnurlPayResponseOptionalFields: [] = [] -export type HandleLnurlPayResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - pr_CustomCheck?: (v: string) => boolean - routes_ItemOptions?: EmptyOptions - routes_CustomCheck?: (v: Empty[]) => boolean -} -export const HandleLnurlPayResponseValidate = (o?: HandleLnurlPayResponse, opts: HandleLnurlPayResponseOptions = {}, path: string = 'HandleLnurlPayResponse::root.'): Error | null => { - 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.pr !== 'string') return new Error(`${path}.pr: is not a string`) - if (opts.pr_CustomCheck && !opts.pr_CustomCheck(o.pr)) return new Error(`${path}.pr: custom check failed`) - - if (!Array.isArray(o.routes)) return new Error(`${path}.routes: is not an array`) - for (let index = 0; index < o.routes.length; index++) { - const routesErr = EmptyValidate(o.routes[index], opts.routes_ItemOptions, `${path}.routes[${index}]`) - if (routesErr !== null) return routesErr - } - if (opts.routes_CustomCheck && !opts.routes_CustomCheck(o.routes)) return new Error(`${path}.routes: custom check failed`) - - return null -} - -export type ClosureMigration = { - closes_at_unix: number -} -export const ClosureMigrationOptionalFields: [] = [] -export type ClosureMigrationOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - closes_at_unix_CustomCheck?: (v: number) => boolean -} -export const ClosureMigrationValidate = (o?: ClosureMigration, opts: ClosureMigrationOptions = {}, path: string = 'ClosureMigration::root.'): Error | null => { - 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.closes_at_unix !== 'number') return new Error(`${path}.closes_at_unix: is not a number`) - if (opts.closes_at_unix_CustomCheck && !opts.closes_at_unix_CustomCheck(o.closes_at_unix)) return new Error(`${path}.closes_at_unix: custom check failed`) - - return null -} - -export type Empty = { -} -export const EmptyOptionalFields: [] = [] -export type EmptyOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] -} -export const EmptyValidate = (o?: Empty, opts: EmptyOptions = {}, path: string = 'Empty::root.'): Error | null => { - 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') - - return null -} - -export type RoutingEvent = { - incoming_channel_id: number - incoming_htlc_id: number - outgoing_channel_id: number - outgoing_htlc_id: number - timestamp_ns: number - event_type: string - incoming_amt_msat: number - outgoing_amt_msat: number - failure_string: string - settled: boolean - offchain: boolean - forward_fail_event: boolean -} -export const RoutingEventOptionalFields: [] = [] -export type RoutingEventOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - incoming_channel_id_CustomCheck?: (v: number) => boolean - incoming_htlc_id_CustomCheck?: (v: number) => boolean - outgoing_channel_id_CustomCheck?: (v: number) => boolean - outgoing_htlc_id_CustomCheck?: (v: number) => boolean - timestamp_ns_CustomCheck?: (v: number) => boolean - event_type_CustomCheck?: (v: string) => boolean - incoming_amt_msat_CustomCheck?: (v: number) => boolean - outgoing_amt_msat_CustomCheck?: (v: number) => boolean - failure_string_CustomCheck?: (v: string) => boolean - settled_CustomCheck?: (v: boolean) => boolean - offchain_CustomCheck?: (v: boolean) => boolean - forward_fail_event_CustomCheck?: (v: boolean) => boolean -} -export const RoutingEventValidate = (o?: RoutingEvent, opts: RoutingEventOptions = {}, path: string = 'RoutingEvent::root.'): Error | null => { - 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.incoming_channel_id !== 'number') return new Error(`${path}.incoming_channel_id: is not a number`) - if (opts.incoming_channel_id_CustomCheck && !opts.incoming_channel_id_CustomCheck(o.incoming_channel_id)) return new Error(`${path}.incoming_channel_id: custom check failed`) - - if (typeof o.incoming_htlc_id !== 'number') return new Error(`${path}.incoming_htlc_id: is not a number`) - if (opts.incoming_htlc_id_CustomCheck && !opts.incoming_htlc_id_CustomCheck(o.incoming_htlc_id)) return new Error(`${path}.incoming_htlc_id: custom check failed`) - - if (typeof o.outgoing_channel_id !== 'number') return new Error(`${path}.outgoing_channel_id: is not a number`) - if (opts.outgoing_channel_id_CustomCheck && !opts.outgoing_channel_id_CustomCheck(o.outgoing_channel_id)) return new Error(`${path}.outgoing_channel_id: custom check failed`) - - if (typeof o.outgoing_htlc_id !== 'number') return new Error(`${path}.outgoing_htlc_id: is not a number`) - if (opts.outgoing_htlc_id_CustomCheck && !opts.outgoing_htlc_id_CustomCheck(o.outgoing_htlc_id)) return new Error(`${path}.outgoing_htlc_id: custom check failed`) - - if (typeof o.timestamp_ns !== 'number') return new Error(`${path}.timestamp_ns: is not a number`) - if (opts.timestamp_ns_CustomCheck && !opts.timestamp_ns_CustomCheck(o.timestamp_ns)) return new Error(`${path}.timestamp_ns: custom check failed`) - - if (typeof o.event_type !== 'string') return new Error(`${path}.event_type: is not a string`) - if (opts.event_type_CustomCheck && !opts.event_type_CustomCheck(o.event_type)) return new Error(`${path}.event_type: custom check failed`) - - if (typeof o.incoming_amt_msat !== 'number') return new Error(`${path}.incoming_amt_msat: is not a number`) - if (opts.incoming_amt_msat_CustomCheck && !opts.incoming_amt_msat_CustomCheck(o.incoming_amt_msat)) return new Error(`${path}.incoming_amt_msat: custom check failed`) - - if (typeof o.outgoing_amt_msat !== 'number') return new Error(`${path}.outgoing_amt_msat: is not a number`) - if (opts.outgoing_amt_msat_CustomCheck && !opts.outgoing_amt_msat_CustomCheck(o.outgoing_amt_msat)) return new Error(`${path}.outgoing_amt_msat: custom check failed`) - - if (typeof o.failure_string !== 'string') return new Error(`${path}.failure_string: is not a string`) - if (opts.failure_string_CustomCheck && !opts.failure_string_CustomCheck(o.failure_string)) return new Error(`${path}.failure_string: custom check failed`) - - if (typeof o.settled !== 'boolean') return new Error(`${path}.settled: is not a boolean`) - if (opts.settled_CustomCheck && !opts.settled_CustomCheck(o.settled)) return new Error(`${path}.settled: custom check failed`) - - if (typeof o.offchain !== 'boolean') return new Error(`${path}.offchain: is not a boolean`) - if (opts.offchain_CustomCheck && !opts.offchain_CustomCheck(o.offchain)) return new Error(`${path}.offchain: custom check failed`) - - if (typeof o.forward_fail_event !== 'boolean') return new Error(`${path}.forward_fail_event: is not a boolean`) - if (opts.forward_fail_event_CustomCheck && !opts.forward_fail_event_CustomCheck(o.forward_fail_event)) return new Error(`${path}.forward_fail_event: custom check failed`) - - return null -} - -export type ChannelRouting = { - channel_id: string - send_errors: number - receive_errors: number - forward_errors_as_input: number - forward_errors_as_output: number - missed_forward_fee_as_input: number - missed_forward_fee_as_output: number - forward_fee_as_input: number - forward_fee_as_output: number - events_number: number -} -export const ChannelRoutingOptionalFields: [] = [] -export type ChannelRoutingOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - channel_id_CustomCheck?: (v: string) => boolean - send_errors_CustomCheck?: (v: number) => boolean - receive_errors_CustomCheck?: (v: number) => boolean - forward_errors_as_input_CustomCheck?: (v: number) => boolean - forward_errors_as_output_CustomCheck?: (v: number) => boolean - missed_forward_fee_as_input_CustomCheck?: (v: number) => boolean - missed_forward_fee_as_output_CustomCheck?: (v: number) => boolean - forward_fee_as_input_CustomCheck?: (v: number) => boolean - forward_fee_as_output_CustomCheck?: (v: number) => boolean - events_number_CustomCheck?: (v: number) => boolean -} -export const ChannelRoutingValidate = (o?: ChannelRouting, opts: ChannelRoutingOptions = {}, path: string = 'ChannelRouting::root.'): Error | null => { - 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.channel_id !== 'string') return new Error(`${path}.channel_id: is not a string`) - if (opts.channel_id_CustomCheck && !opts.channel_id_CustomCheck(o.channel_id)) return new Error(`${path}.channel_id: custom check failed`) - - if (typeof o.send_errors !== 'number') return new Error(`${path}.send_errors: is not a number`) - if (opts.send_errors_CustomCheck && !opts.send_errors_CustomCheck(o.send_errors)) return new Error(`${path}.send_errors: custom check failed`) - - if (typeof o.receive_errors !== 'number') return new Error(`${path}.receive_errors: is not a number`) - if (opts.receive_errors_CustomCheck && !opts.receive_errors_CustomCheck(o.receive_errors)) return new Error(`${path}.receive_errors: custom check failed`) - - if (typeof o.forward_errors_as_input !== 'number') return new Error(`${path}.forward_errors_as_input: is not a number`) - if (opts.forward_errors_as_input_CustomCheck && !opts.forward_errors_as_input_CustomCheck(o.forward_errors_as_input)) return new Error(`${path}.forward_errors_as_input: custom check failed`) - - if (typeof o.forward_errors_as_output !== 'number') return new Error(`${path}.forward_errors_as_output: is not a number`) - if (opts.forward_errors_as_output_CustomCheck && !opts.forward_errors_as_output_CustomCheck(o.forward_errors_as_output)) return new Error(`${path}.forward_errors_as_output: custom check failed`) - - if (typeof o.missed_forward_fee_as_input !== 'number') return new Error(`${path}.missed_forward_fee_as_input: is not a number`) - if (opts.missed_forward_fee_as_input_CustomCheck && !opts.missed_forward_fee_as_input_CustomCheck(o.missed_forward_fee_as_input)) return new Error(`${path}.missed_forward_fee_as_input: custom check failed`) - - if (typeof o.missed_forward_fee_as_output !== 'number') return new Error(`${path}.missed_forward_fee_as_output: is not a number`) - if (opts.missed_forward_fee_as_output_CustomCheck && !opts.missed_forward_fee_as_output_CustomCheck(o.missed_forward_fee_as_output)) return new Error(`${path}.missed_forward_fee_as_output: custom check failed`) - - if (typeof o.forward_fee_as_input !== 'number') return new Error(`${path}.forward_fee_as_input: is not a number`) - if (opts.forward_fee_as_input_CustomCheck && !opts.forward_fee_as_input_CustomCheck(o.forward_fee_as_input)) return new Error(`${path}.forward_fee_as_input: custom check failed`) - - if (typeof o.forward_fee_as_output !== 'number') return new Error(`${path}.forward_fee_as_output: is not a number`) - if (opts.forward_fee_as_output_CustomCheck && !opts.forward_fee_as_output_CustomCheck(o.forward_fee_as_output)) return new Error(`${path}.forward_fee_as_output: custom check failed`) - - if (typeof o.events_number !== 'number') return new Error(`${path}.events_number: is not a number`) - if (opts.events_number_CustomCheck && !opts.events_number_CustomCheck(o.events_number)) return new Error(`${path}.events_number: custom check failed`) - - return null -} - -export type UsageMetric = { - processed_at_ms: number - parsed_in_nano: number - auth_in_nano: number - validate_in_nano: number - handle_in_nano: number - rpc_name: string - batch: boolean - nostr: boolean - batch_size: number -} -export const UsageMetricOptionalFields: [] = [] -export type UsageMetricOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - processed_at_ms_CustomCheck?: (v: number) => boolean - parsed_in_nano_CustomCheck?: (v: number) => boolean - auth_in_nano_CustomCheck?: (v: number) => boolean - validate_in_nano_CustomCheck?: (v: number) => boolean - handle_in_nano_CustomCheck?: (v: number) => boolean - rpc_name_CustomCheck?: (v: string) => boolean - batch_CustomCheck?: (v: boolean) => boolean - nostr_CustomCheck?: (v: boolean) => boolean - batch_size_CustomCheck?: (v: number) => boolean -} -export const UsageMetricValidate = (o?: UsageMetric, opts: UsageMetricOptions = {}, path: string = 'UsageMetric::root.'): Error | null => { - 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.processed_at_ms !== 'number') return new Error(`${path}.processed_at_ms: is not a number`) - if (opts.processed_at_ms_CustomCheck && !opts.processed_at_ms_CustomCheck(o.processed_at_ms)) return new Error(`${path}.processed_at_ms: custom check failed`) - - if (typeof o.parsed_in_nano !== 'number') return new Error(`${path}.parsed_in_nano: is not a number`) - if (opts.parsed_in_nano_CustomCheck && !opts.parsed_in_nano_CustomCheck(o.parsed_in_nano)) return new Error(`${path}.parsed_in_nano: custom check failed`) - - if (typeof o.auth_in_nano !== 'number') return new Error(`${path}.auth_in_nano: is not a number`) - if (opts.auth_in_nano_CustomCheck && !opts.auth_in_nano_CustomCheck(o.auth_in_nano)) return new Error(`${path}.auth_in_nano: custom check failed`) - - if (typeof o.validate_in_nano !== 'number') return new Error(`${path}.validate_in_nano: is not a number`) - if (opts.validate_in_nano_CustomCheck && !opts.validate_in_nano_CustomCheck(o.validate_in_nano)) return new Error(`${path}.validate_in_nano: custom check failed`) - - if (typeof o.handle_in_nano !== 'number') return new Error(`${path}.handle_in_nano: is not a number`) - if (opts.handle_in_nano_CustomCheck && !opts.handle_in_nano_CustomCheck(o.handle_in_nano)) return new Error(`${path}.handle_in_nano: custom check failed`) - - if (typeof o.rpc_name !== 'string') return new Error(`${path}.rpc_name: is not a string`) - if (opts.rpc_name_CustomCheck && !opts.rpc_name_CustomCheck(o.rpc_name)) return new Error(`${path}.rpc_name: custom check failed`) - - if (typeof o.batch !== 'boolean') return new Error(`${path}.batch: is not a boolean`) - if (opts.batch_CustomCheck && !opts.batch_CustomCheck(o.batch)) return new Error(`${path}.batch: custom check failed`) - - if (typeof o.nostr !== 'boolean') return new Error(`${path}.nostr: is not a boolean`) - if (opts.nostr_CustomCheck && !opts.nostr_CustomCheck(o.nostr)) return new Error(`${path}.nostr: custom check failed`) - - if (typeof o.batch_size !== 'number') return new Error(`${path}.batch_size: is not a number`) - if (opts.batch_size_CustomCheck && !opts.batch_size_CustomCheck(o.batch_size)) return new Error(`${path}.batch_size: custom check failed`) - - return null -} - -export type UsersInfo = { - total: number - no_balance: number - negative_balance: number - always_been_inactive: number - balance_avg: number - balance_median: number -} -export const UsersInfoOptionalFields: [] = [] -export type UsersInfoOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - total_CustomCheck?: (v: number) => boolean - no_balance_CustomCheck?: (v: number) => boolean - negative_balance_CustomCheck?: (v: number) => boolean - always_been_inactive_CustomCheck?: (v: number) => boolean - balance_avg_CustomCheck?: (v: number) => boolean - balance_median_CustomCheck?: (v: number) => boolean -} -export const UsersInfoValidate = (o?: UsersInfo, opts: UsersInfoOptions = {}, path: string = 'UsersInfo::root.'): Error | null => { - 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.total !== 'number') return new Error(`${path}.total: is not a number`) - if (opts.total_CustomCheck && !opts.total_CustomCheck(o.total)) return new Error(`${path}.total: custom check failed`) - - if (typeof o.no_balance !== 'number') return new Error(`${path}.no_balance: is not a number`) - if (opts.no_balance_CustomCheck && !opts.no_balance_CustomCheck(o.no_balance)) return new Error(`${path}.no_balance: custom check failed`) - - if (typeof o.negative_balance !== 'number') return new Error(`${path}.negative_balance: is not a number`) - if (opts.negative_balance_CustomCheck && !opts.negative_balance_CustomCheck(o.negative_balance)) return new Error(`${path}.negative_balance: custom check failed`) - - if (typeof o.always_been_inactive !== 'number') return new Error(`${path}.always_been_inactive: is not a number`) - if (opts.always_been_inactive_CustomCheck && !opts.always_been_inactive_CustomCheck(o.always_been_inactive)) return new Error(`${path}.always_been_inactive: custom check failed`) - - if (typeof o.balance_avg !== 'number') return new Error(`${path}.balance_avg: is not a number`) - if (opts.balance_avg_CustomCheck && !opts.balance_avg_CustomCheck(o.balance_avg)) return new Error(`${path}.balance_avg: custom check failed`) - - if (typeof o.balance_median !== 'number') return new Error(`${path}.balance_median: is not a number`) - if (opts.balance_median_CustomCheck && !opts.balance_median_CustomCheck(o.balance_median)) return new Error(`${path}.balance_median: custom check failed`) - - return null -} - -export type PayInvoiceResponse = { - preimage: string - amount_paid: number - operation_id: string - service_fee: number - network_fee: number -} -export const PayInvoiceResponseOptionalFields: [] = [] -export type PayInvoiceResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - preimage_CustomCheck?: (v: string) => boolean - amount_paid_CustomCheck?: (v: number) => boolean - operation_id_CustomCheck?: (v: string) => boolean - service_fee_CustomCheck?: (v: number) => boolean - network_fee_CustomCheck?: (v: number) => boolean -} -export const PayInvoiceResponseValidate = (o?: PayInvoiceResponse, opts: PayInvoiceResponseOptions = {}, path: string = 'PayInvoiceResponse::root.'): Error | null => { - 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.preimage !== 'string') return new Error(`${path}.preimage: is not a string`) - if (opts.preimage_CustomCheck && !opts.preimage_CustomCheck(o.preimage)) return new Error(`${path}.preimage: custom check failed`) - - if (typeof o.amount_paid !== 'number') return new Error(`${path}.amount_paid: is not a number`) - if (opts.amount_paid_CustomCheck && !opts.amount_paid_CustomCheck(o.amount_paid)) return new Error(`${path}.amount_paid: custom check failed`) - - if (typeof o.operation_id !== 'string') return new Error(`${path}.operation_id: is not a string`) - if (opts.operation_id_CustomCheck && !opts.operation_id_CustomCheck(o.operation_id)) return new Error(`${path}.operation_id: custom check failed`) - - if (typeof o.service_fee !== 'number') return new Error(`${path}.service_fee: is not a number`) - if (opts.service_fee_CustomCheck && !opts.service_fee_CustomCheck(o.service_fee)) return new Error(`${path}.service_fee: custom check failed`) - - if (typeof o.network_fee !== 'number') return new Error(`${path}.network_fee: is not a number`) - if (opts.network_fee_CustomCheck && !opts.network_fee_CustomCheck(o.network_fee)) return new Error(`${path}.network_fee: custom check failed`) - - return null -} - -export type AddAppUserRequest = { - identifier: string - fail_if_exists: boolean - balance: number -} -export const AddAppUserRequestOptionalFields: [] = [] -export type AddAppUserRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - identifier_CustomCheck?: (v: string) => boolean - fail_if_exists_CustomCheck?: (v: boolean) => boolean - balance_CustomCheck?: (v: number) => boolean -} -export const AddAppUserRequestValidate = (o?: AddAppUserRequest, opts: AddAppUserRequestOptions = {}, path: string = 'AddAppUserRequest::root.'): Error | null => { - 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.identifier !== 'string') return new Error(`${path}.identifier: is not a string`) - if (opts.identifier_CustomCheck && !opts.identifier_CustomCheck(o.identifier)) return new Error(`${path}.identifier: custom check failed`) - - if (typeof o.fail_if_exists !== 'boolean') return new Error(`${path}.fail_if_exists: is not a boolean`) - if (opts.fail_if_exists_CustomCheck && !opts.fail_if_exists_CustomCheck(o.fail_if_exists)) return new Error(`${path}.fail_if_exists: custom check failed`) - - if (typeof o.balance !== 'number') return new Error(`${path}.balance: is not a number`) - if (opts.balance_CustomCheck && !opts.balance_CustomCheck(o.balance)) return new Error(`${path}.balance: custom check failed`) - - return null -} - -export type GetAppUserLNURLInfoRequest = { - user_identifier: string - base_url_override: string -} -export const GetAppUserLNURLInfoRequestOptionalFields: [] = [] -export type GetAppUserLNURLInfoRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - user_identifier_CustomCheck?: (v: string) => boolean - base_url_override_CustomCheck?: (v: string) => boolean -} -export const GetAppUserLNURLInfoRequestValidate = (o?: GetAppUserLNURLInfoRequest, opts: GetAppUserLNURLInfoRequestOptions = {}, path: string = 'GetAppUserLNURLInfoRequest::root.'): Error | null => { - 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.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) - if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) - - if (typeof o.base_url_override !== 'string') return new Error(`${path}.base_url_override: is not a string`) - if (opts.base_url_override_CustomCheck && !opts.base_url_override_CustomCheck(o.base_url_override)) return new Error(`${path}.base_url_override: custom check failed`) - - return null -} - -export type UserInfo = { - userId: string - balance: number - max_withdrawable: number - user_identifier: string -} -export const UserInfoOptionalFields: [] = [] -export type UserInfoOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - userId_CustomCheck?: (v: string) => boolean - balance_CustomCheck?: (v: number) => boolean - max_withdrawable_CustomCheck?: (v: number) => boolean - user_identifier_CustomCheck?: (v: string) => boolean -} -export const UserInfoValidate = (o?: UserInfo, opts: UserInfoOptions = {}, path: string = 'UserInfo::root.'): Error | null => { - 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.userId !== 'string') return new Error(`${path}.userId: is not a string`) - if (opts.userId_CustomCheck && !opts.userId_CustomCheck(o.userId)) return new Error(`${path}.userId: custom check failed`) - - if (typeof o.balance !== 'number') return new Error(`${path}.balance: is not a number`) - if (opts.balance_CustomCheck && !opts.balance_CustomCheck(o.balance)) return new Error(`${path}.balance: custom check failed`) - - if (typeof o.max_withdrawable !== 'number') return new Error(`${path}.max_withdrawable: is not a number`) - if (opts.max_withdrawable_CustomCheck && !opts.max_withdrawable_CustomCheck(o.max_withdrawable)) return new Error(`${path}.max_withdrawable: custom check failed`) - - if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) - if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) - - return null -} - -export type AppUser = { - identifier: string - info: UserInfo - max_withdrawable: number -} -export const AppUserOptionalFields: [] = [] -export type AppUserOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - identifier_CustomCheck?: (v: string) => boolean - info_Options?: UserInfoOptions - max_withdrawable_CustomCheck?: (v: number) => boolean -} -export const AppUserValidate = (o?: AppUser, opts: AppUserOptions = {}, path: string = 'AppUser::root.'): Error | null => { - 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.identifier !== 'string') return new Error(`${path}.identifier: is not a string`) - if (opts.identifier_CustomCheck && !opts.identifier_CustomCheck(o.identifier)) return new Error(`${path}.identifier: custom check failed`) - - const infoErr = UserInfoValidate(o.info, opts.info_Options, `${path}.info`) - if (infoErr !== null) return infoErr - - - if (typeof o.max_withdrawable !== 'number') return new Error(`${path}.max_withdrawable: is not a number`) - if (opts.max_withdrawable_CustomCheck && !opts.max_withdrawable_CustomCheck(o.max_withdrawable)) return new Error(`${path}.max_withdrawable: custom check failed`) - - return null -} - -export type NewAddressRequest = { - addressType: AddressType -} -export const NewAddressRequestOptionalFields: [] = [] -export type NewAddressRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - addressType_CustomCheck?: (v: AddressType) => boolean -} -export const NewAddressRequestValidate = (o?: NewAddressRequest, opts: NewAddressRequestOptions = {}, path: string = 'NewAddressRequest::root.'): Error | null => { - 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 (!enumCheckAddressType(o.addressType)) return new Error(`${path}.addressType: is not a valid AddressType`) - if (opts.addressType_CustomCheck && !opts.addressType_CustomCheck(o.addressType)) return new Error(`${path}.addressType: custom check failed`) - - return null -} - -export type ChainBalanceEvent = { - block_height: number - confirmed_balance: number - unconfirmed_balance: number - total_balance: number -} -export const ChainBalanceEventOptionalFields: [] = [] -export type ChainBalanceEventOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - block_height_CustomCheck?: (v: number) => boolean - confirmed_balance_CustomCheck?: (v: number) => boolean - unconfirmed_balance_CustomCheck?: (v: number) => boolean - total_balance_CustomCheck?: (v: number) => boolean -} -export const ChainBalanceEventValidate = (o?: ChainBalanceEvent, opts: ChainBalanceEventOptions = {}, path: string = 'ChainBalanceEvent::root.'): Error | null => { - 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.block_height !== 'number') return new Error(`${path}.block_height: is not a number`) - if (opts.block_height_CustomCheck && !opts.block_height_CustomCheck(o.block_height)) return new Error(`${path}.block_height: custom check failed`) - - if (typeof o.confirmed_balance !== 'number') return new Error(`${path}.confirmed_balance: is not a number`) - if (opts.confirmed_balance_CustomCheck && !opts.confirmed_balance_CustomCheck(o.confirmed_balance)) return new Error(`${path}.confirmed_balance: custom check failed`) - - if (typeof o.unconfirmed_balance !== 'number') return new Error(`${path}.unconfirmed_balance: is not a number`) - if (opts.unconfirmed_balance_CustomCheck && !opts.unconfirmed_balance_CustomCheck(o.unconfirmed_balance)) return new Error(`${path}.unconfirmed_balance: custom check failed`) - - if (typeof o.total_balance !== 'number') return new Error(`${path}.total_balance: is not a number`) - if (opts.total_balance_CustomCheck && !opts.total_balance_CustomCheck(o.total_balance)) return new Error(`${path}.total_balance: custom check failed`) - - return null -} - -export type SetMockAppBalanceRequest = { - amount: number -} -export const SetMockAppBalanceRequestOptionalFields: [] = [] -export type SetMockAppBalanceRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - amount_CustomCheck?: (v: number) => boolean -} -export const SetMockAppBalanceRequestValidate = (o?: SetMockAppBalanceRequest, opts: SetMockAppBalanceRequestOptions = {}, path: string = 'SetMockAppBalanceRequest::root.'): Error | null => { - 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.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - return null -} - diff --git a/proto/service/methods.proto b/proto/service/methods.proto index 94dbf74f..9e8c08ad 100644 --- a/proto/service/methods.proto +++ b/proto/service/methods.proto @@ -369,6 +369,12 @@ service LightningPub { 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"; diff --git a/proto/service/structs.proto b/proto/service/structs.proto index 33385b0a..43be5a49 100644 --- a/proto/service/structs.proto +++ b/proto/service/structs.proto @@ -443,3 +443,7 @@ message LinkNPubThroughTokenRequest { string nostr_pub = 2; } +message HttpCreds { + string url = 1; + string token = 2; +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 41cbb3cc..d60ae63e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,10 +16,13 @@ const start = async () => { log("manual process ended") return } - const { apps, mainHandler } = keepOn + const { apps, mainHandler, liquidityProviderInfo } = keepOn const serverMethods = GetServerMethods(mainHandler) const nostrSettings = LoadNosrtSettingsFromEnv() - const { Send } = nostrMiddleware(serverMethods, mainHandler, { ...nostrSettings, apps }) + const { Send } = nostrMiddleware(serverMethods, mainHandler, + { ...nostrSettings, apps, clients: [liquidityProviderInfo] }, + (e, p) => mainHandler.liquidProvider.onEvent(e, p) + ) mainHandler.attachNostrSend(Send) mainHandler.StartBeacons() const Server = NewServer(serverMethods, serverOptions(mainHandler)) diff --git a/src/nostrMiddleware.ts b/src/nostrMiddleware.ts index f7c2a3e9..56dd9ecf 100644 --- a/src/nostrMiddleware.ts +++ b/src/nostrMiddleware.ts @@ -5,7 +5,7 @@ import * as Types from '../proto/autogenerated/ts/types.js' import NewNostrTransport, { NostrRequest } from '../proto/autogenerated/ts/nostr_transport.js'; import { ERROR, getLogger } from "./services/helpers/logger.js"; -export default (serverMethods: Types.ServerMethods, mainHandler: Main, nostrSettings: NostrSettings): { Stop: () => void, Send: NostrSend } => { +export default (serverMethods: Types.ServerMethods, mainHandler: Main, nostrSettings: NostrSettings, onClientEvent: (e: { requestId: string }, fromPub: string) => void): { Stop: () => void, Send: NostrSend } => { const log = getLogger({}) const nostrTransport = NewNostrTransport(serverMethods, { NostrUserAuthGuard: async (appId, pub) => { @@ -25,12 +25,16 @@ export default (serverMethods: Types.ServerMethods, mainHandler: Main, nostrSett log(ERROR, "invalid json event received", event.content) return } + if (!j.rpcName) { + onClientEvent(j as { requestId: string }, event.pub) + return + } if (j.authIdentifier !== event.pub) { log(ERROR, "authIdentifier does not match", j.authIdentifier || "--", event.pub) return } nostrTransport({ ...j, appId: event.appId }, res => { - nostr.Send(event.appId, { type: 'content', pub: event.pub, content: JSON.stringify({ ...res, requestId: j.requestId }) }) + nostr.Send({ type: 'app', appId: event.appId }, { type: 'content', pub: event.pub, content: JSON.stringify({ ...res, requestId: j.requestId }) }) }, event.startAtNano, event.startAtMs) }) return { Stop: () => nostr.Stop, Send: (...args) => nostr.Send(...args) } diff --git a/src/services/lnd/index.ts b/src/services/lnd/index.ts index 765db0e6..b60f12dd 100644 --- a/src/services/lnd/index.ts +++ b/src/services/lnd/index.ts @@ -7,5 +7,6 @@ export const LoadLndSettingsFromEnv = (): LndSettings => { const feeRateLimit = EnvCanBeInteger("OUTBOUND_MAX_FEE_BPS", 60) / 10000 const feeFixedLimit = EnvCanBeInteger("OUTBOUND_MAX_FEE_EXTRA_SATS", 100) const mockLnd = EnvCanBeBoolean("MOCK_LND") - return { mainNode: { lndAddr, lndCertPath, lndMacaroonPath }, feeRateLimit, feeFixedLimit, mockLnd } + const liquidityProviderPub = process.env.LIQUIDITY_PROVIDER_PUB || "" + return { mainNode: { lndAddr, lndCertPath, lndMacaroonPath }, feeRateLimit, feeFixedLimit, mockLnd, liquidityProviderPub } } diff --git a/src/services/lnd/liquidityProvider.ts b/src/services/lnd/liquidityProvider.ts new file mode 100644 index 00000000..7e672861 --- /dev/null +++ b/src/services/lnd/liquidityProvider.ts @@ -0,0 +1,153 @@ +import newNostrClient from '../../../proto/autogenerated/ts/nostr_client.js' +import { NostrRequest } from '../../../proto/autogenerated/ts/nostr_transport.js' +import * as Types from '../../../proto/autogenerated/ts/types.js' +import { decodeNprofile } from '../../custom-nip19.js' +import { getLogger } from '../helpers/logger.js' +import { NostrEvent, NostrSend } from '../nostr/handler.js' +import { relayInit } from '../nostr/tools/relay.js' + + +export type nostrCallback = { startedAtMillis: number, type: 'single' | 'stream', f: (res: T) => void } +export class LiquidityProvider { + client: ReturnType + clientCbs: Record> = {} + clientId: string = "" + log = getLogger({ component: 'liquidityProvider' }) + nostrSend: NostrSend | null = null + ready = false + pubDestination: string + + // make the sub process accept client + constructor(pubDestination: string) { + if (!pubDestination) { + this.log("No pub provider to liquidity provider, will not be initialized") + } + this.client = newNostrClient({ + pubDestination: pubDestination, + retrieveNostrUserAuth: async () => "", + }, this.clientSend, this.clientSub) + + const interval = setInterval(() => { + if (this.ready) { + this.log("ready") + clearInterval(interval) + this.client.GetUserInfo().then(res => { + if (res.status === 'ERROR') { + this.log("error getting user info", res) + return + } + this.log("got user info", res) + }) + } + }, 1000) + } + + setClientId = (clientId: string) => { + this.clientId = clientId + if (this.nostrSend && this.pubDestination !== "") { + this.ready = true + } + } + + attachNostrSend(f: NostrSend) { + this.nostrSend = f + if (this.clientId !== "" && this.pubDestination !== "") { + this.ready = true + } + } + + IsReady = () => { + return this.ready + } + + onEvent = async (res: { requestId: string }, fromPub: string) => { + if (fromPub !== this.pubDestination) { + return false + } + if (this.clientCbs[res.requestId]) { + const cb = this.clientCbs[res.requestId] + cb.f(res) + if (cb.type === 'single') { + const deleteOk = (delete this.clientCbs[res.requestId]) + console.log(this.getSingleSubs(), "single subs left", deleteOk) + } + return true + } + return false + } + + clientSend = (to: string, message: NostrRequest): Promise => { + if (!this.ready || !this.nostrSend) { + throw new Error("liquidity provider not initialized") + } + if (!message.requestId) { + message.requestId = makeId(16) + } + const reqId = message.requestId + if (this.clientCbs[reqId]) { + throw new Error("request was already sent") + } + this.nostrSend({ type: 'client', clientId: this.clientId }, { + type: 'content', + pub: to, + content: JSON.stringify(message) + }) + + //this.nostrSend(this.relays, to, JSON.stringify(message), this.settings) + + console.log("subbing to single send", reqId, message.rpcName) + return new Promise(res => { + this.clientCbs[reqId] = { + startedAtMillis: Date.now(), + type: 'single', + f: (response: any) => { res(response) }, + } + }) + } + + clientSub = (to: string, message: NostrRequest, cb: (res: any) => void): void => { + if (!this.ready || !this.nostrSend) { + throw new Error("liquidity provider not initialized") + } + if (!message.requestId) { + message.requestId = message.rpcName + } + const reqId = message.requestId + if (!reqId) { + throw new Error("invalid sub") + } + if (this.clientCbs[reqId]) { + this.clientCbs[reqId] = { + startedAtMillis: Date.now(), + type: 'stream', + f: (response: any) => { cb(response) }, + } + console.log("sub for", reqId, "was already registered, overriding") + return + } + this.nostrSend({ type: 'client', clientId: this.clientId }, { + type: 'content', + pub: to, + content: JSON.stringify(message) + }) + console.log("subbing to stream", reqId) + this.clientCbs[reqId] = { + startedAtMillis: Date.now(), + type: 'stream', + f: (response: any) => { cb(response) } + } + } + getSingleSubs = () => { + return Object.entries(this.clientCbs).filter(([_, cb]) => cb.type === 'single') + } +} + +export const makeId = (length: number) => { + let result = ''; + const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + const charactersLength = characters.length; + for (let i = 0; i < length; i++) { + result += characters.charAt(Math.floor(Math.random() * charactersLength)); + } + return result; +} \ No newline at end of file diff --git a/src/services/lnd/lnd.ts b/src/services/lnd/lnd.ts index 44129bae..2caa70ed 100644 --- a/src/services/lnd/lnd.ts +++ b/src/services/lnd/lnd.ts @@ -16,6 +16,7 @@ import { SendCoinsReq } from './sendCoinsReq.js'; import { LndSettings, AddressPaidCb, InvoicePaidCb, NodeInfo, Invoice, DecodedInvoice, PaidInvoice, NewBlockCb, HtlcCb, BalanceInfo } from './settings.js'; import { getLogger } from '../helpers/logger.js'; import { HtlcEvent_EventType } from '../../../proto/lnd/router.js'; +import { LiquidityProvider } from './liquidityProvider.js'; const DeadLineMetadata = (deadline = 10 * 1000) => ({ deadline: Date.now() + deadline }) const deadLndRetrySeconds = 5 export default class { @@ -34,7 +35,9 @@ export default class { htlcCb: HtlcCb log = getLogger({ component: 'lndManager' }) outgoingOpsLocked = false - constructor(settings: LndSettings, addressPaidCb: AddressPaidCb, invoicePaidCb: InvoicePaidCb, newBlockCb: NewBlockCb, htlcCb: HtlcCb) { + liquidProvider: LiquidityProvider + useLiquidityProvider = false + constructor(settings: LndSettings, liquidProvider: LiquidityProvider, addressPaidCb: AddressPaidCb, invoicePaidCb: InvoicePaidCb, newBlockCb: NewBlockCb, htlcCb: HtlcCb) { this.settings = settings this.addressPaidCb = addressPaidCb this.invoicePaidCb = invoicePaidCb @@ -60,6 +63,8 @@ export default class { this.invoices = new InvoicesClient(transport) this.router = new RouterClient(transport) this.chainNotifier = new ChainNotifierClient(transport) + this.liquidProvider = liquidProvider + this.useLiquidityProvider = !!settings.liquidityProviderPub } LockOutgoingOperations(): void { diff --git a/src/services/lnd/settings.ts b/src/services/lnd/settings.ts index 3d4c97f1..c240e200 100644 --- a/src/services/lnd/settings.ts +++ b/src/services/lnd/settings.ts @@ -9,6 +9,7 @@ export type LndSettings = { feeRateLimit: number feeFixedLimit: number mockLnd: boolean + liquidityProviderPub: string otherNode?: NodeSettings thirdNode?: NodeSettings diff --git a/src/services/main/index.ts b/src/services/main/index.ts index 96e456c6..89a9b7f8 100644 --- a/src/services/main/index.ts +++ b/src/services/main/index.ts @@ -15,6 +15,7 @@ import { UnsignedEvent } from '../nostr/tools/event.js' import { NostrSend } from '../nostr/handler.js' import MetricsManager from '../metrics/index.js' import { LoggedEvent } from '../storage/eventsLog.js' +import { LiquidityProvider } from "../lnd/liquidityProvider.js" type UserOperationsSub = { id: string @@ -35,12 +36,14 @@ export default class { paymentManager: PaymentManager paymentSubs: Record void) | null> = {} metricsManager: MetricsManager + liquidProvider: LiquidityProvider nostrSend: NostrSend = () => { getLogger({})("nostr send not initialized yet") } - constructor(settings: MainSettings, storage: Storage) { + constructor(settings: MainSettings, storage: Storage, liquidProvider: LiquidityProvider) { this.settings = settings this.storage = storage + this.liquidProvider = liquidProvider - this.lnd = new LND(settings.lndSettings, this.addressPaidCb, this.invoicePaidCb, this.newBlockCb, this.htlcCb) + this.lnd = new LND(settings.lndSettings, this.liquidProvider, this.addressPaidCb, this.invoicePaidCb, this.newBlockCb, this.htlcCb) this.metricsManager = new MetricsManager(this.storage, this.lnd) this.paymentManager = new PaymentManager(this.storage, this.lnd, this.settings, this.addressPaidCb, this.invoicePaidCb) @@ -63,6 +66,7 @@ export default class { attachNostrSend(f: NostrSend) { this.nostrSend = f + this.liquidProvider.attachNostrSend(f) } htlcCb: HtlcCb = (e) => { @@ -208,7 +212,7 @@ export default class { return } const message: Types.LiveUserOperation & { requestId: string, status: 'OK' } = { operation: op, requestId: "GetLiveUserOperations", status: 'OK' } - this.nostrSend(app.app_id, { type: 'content', content: JSON.stringify(message), pub: user.nostr_public_key }) + this.nostrSend({ type: 'app', appId: app.app_id }, { type: 'content', content: JSON.stringify(message), pub: user.nostr_public_key }) } async UpdateBeacon(app: Application, content: { type: 'service', name: string }) { @@ -224,7 +228,7 @@ export default class { pubkey: app.nostr_public_key, tags, } - this.nostrSend(app.app_id, { type: 'event', event }) + this.nostrSend({ type: 'app', appId: app.app_id }, { type: 'event', event }) } async createZapReceipt(log: PubLogger, invoice: UserReceivingInvoice) { @@ -245,6 +249,6 @@ export default class { tags, } log({ unsigned: event }) - this.nostrSend(invoice.linkedApplication.app_id, { type: 'event', event }) + this.nostrSend({ type: 'app', appId: invoice.linkedApplication.app_id }, { type: 'event', event }) } } diff --git a/src/services/main/init.ts b/src/services/main/init.ts index 71bcbe4f..80ef8cc5 100644 --- a/src/services/main/init.ts +++ b/src/services/main/init.ts @@ -1,4 +1,5 @@ import { PubLogger, getLogger } from "../helpers/logger.js" +import { LiquidityProvider } from "../lnd/liquidityProvider.js" import Storage from "../storage/index.js" import { TypeOrmMigrationRunner } from "../storage/migrations/runner.js" import Main from "./index.js" @@ -16,7 +17,8 @@ export const initMainHandler = async (log: PubLogger, mainSettings: MainSettings if (manualMigration) { return } - const mainHandler = new Main(mainSettings, storageManager) + const liquidityProvider = new LiquidityProvider(mainSettings.lndSettings.liquidityProviderPub) + const mainHandler = new Main(mainSettings, storageManager, liquidityProvider) await mainHandler.lnd.Warmup() if (!mainSettings.skipSanityCheck) { const sanityChecker = new SanityChecker(storageManager, mainHandler.lnd) @@ -38,11 +40,21 @@ export const initMainHandler = async (log: PubLogger, mainSettings: MainSettings return { privateKey: app.nostr_private_key, publicKey: app.nostr_public_key, appId: app.app_id, name: app.name } } })) + const liquidityProviderApp = apps.find(app => app.name === 'wallet' || app.name === 'wallet-test') + if (!liquidityProviderApp) { + throw new Error("wallet app not initialized correctly") + } + const liquidityProviderInfo = { + privateKey: liquidityProviderApp.privateKey, + publicKey: liquidityProviderApp.publicKey, + name: "liquidity_provider", clientId: `client_${liquidityProviderApp.appId}` + } + liquidityProvider.setClientId(liquidityProviderInfo.clientId) const stop = await processArgs(mainHandler) if (stop) { return } - return { mainHandler, apps } + return { mainHandler, apps, liquidityProviderInfo } } const processArgs = async (mainHandler: Main) => { diff --git a/src/services/main/paymentManager.ts b/src/services/main/paymentManager.ts index d8d40d06..3a8e37c7 100644 --- a/src/services/main/paymentManager.ts +++ b/src/services/main/paymentManager.ts @@ -15,6 +15,7 @@ import { Event, verifiedSymbol, verifySignature } from '../nostr/tools/event.js' import { AddressReceivingTransaction } from '../storage/entity/AddressReceivingTransaction.js' import { UserTransactionPayment } from '../storage/entity/UserTransactionPayment.js' import { Watchdog } from './watchdog.js' +import { LiquidityProvider } from '../lnd/liquidityProvider.js' interface UserOperationInfo { serial_id: number paid_amount: number @@ -39,7 +40,6 @@ const defaultLnurlPayMetadata = `[["text/plain", "lnurl pay to Lightning.pub"]]` const confInOne = 1000 * 1000 const confInTwo = 100 * 1000 * 1000 export default class { - storage: Storage settings: MainSettings lnd: LND @@ -297,7 +297,7 @@ export default class { } async GetLnurlWithdrawLink(ctx: Types.UserContext): Promise { - if(this.isDefaultServiceUrl()) { + if (this.isDefaultServiceUrl()) { throw new Error("Lnurl not enabled. Make sure to set SERVICE_URL env variable") } const app = await this.storage.applicationStorage.GetApplication(ctx.app_id) @@ -345,7 +345,7 @@ export default class { } async GetLnurlPayLink(ctx: Types.UserContext): Promise { - if(this.isDefaultServiceUrl()) { + if (this.isDefaultServiceUrl()) { throw new Error("Lnurl not enabled. Make sure to set SERVICE_URL env variable") } getLogger({})("getting lnurl pay link") @@ -360,7 +360,7 @@ export default class { } async GetLnurlPayInfoFromUser(userId: string, linkedApplication: Application, baseUrl?: string): Promise { - if(this.isDefaultServiceUrl()) { + if (this.isDefaultServiceUrl()) { throw new Error("Lnurl not enabled. Make sure to set SERVICE_URL env variable") } const payK1 = await this.storage.paymentStorage.AddUserEphemeralKey(userId, 'pay', linkedApplication) @@ -378,7 +378,7 @@ export default class { } async GetLnurlPayInfo(payInfoK1: string): Promise { - if(this.isDefaultServiceUrl()) { + if (this.isDefaultServiceUrl()) { throw new Error("Lnurl not enabled. Make sure to set SERVICE_URL env variable") } const key = await this.storage.paymentStorage.UseUserEphemeralKey(payInfoK1, 'pay', true) diff --git a/src/services/main/settings.ts b/src/services/main/settings.ts index ee213415..054858d9 100644 --- a/src/services/main/settings.ts +++ b/src/services/main/settings.ts @@ -49,7 +49,7 @@ export const LoadMainSettingsFromEnv = (): MainSettings => { servicePort: EnvCanBeInteger("PORT", 1776), recordPerformance: process.env.RECORD_PERFORMANCE === 'true' || false, skipSanityCheck: process.env.SKIP_SANITY_CHECK === 'true' || false, - disableExternalPayments: process.env.DISABLE_EXTERNAL_PAYMENTS === 'true' || false + disableExternalPayments: process.env.DISABLE_EXTERNAL_PAYMENTS === 'true' || false, } } diff --git a/src/services/nostr/handler.ts b/src/services/nostr/handler.ts index 9e213400..398026c5 100644 --- a/src/services/nostr/handler.ts +++ b/src/services/nostr/handler.ts @@ -5,12 +5,15 @@ import { ERROR, getLogger } from '../helpers/logger.js' import { encodeNprofile } from '../../custom-nip19.js' const handledEvents: string[] = [] // TODO: - big memory leak here, add TTL type AppInfo = { appId: string, publicKey: string, privateKey: string, name: string } +type ClientInfo = { clientId: string, publicKey: string, privateKey: string, name: string } export type SendData = { type: "content", content: string, pub: string } | { type: "event", event: UnsignedEvent } -export type NostrSend = (appId: string, data: SendData, relays?: string[] | undefined) => void +export type SendInitiator = { type: 'app', appId: string } | { type: 'client', clientId: string } +export type NostrSend = (initiator: SendInitiator, data: SendData, relays?: string[] | undefined) => void export type NostrSettings = { apps: AppInfo[] relays: string[] + clients: ClientInfo[] } export type NostrEvent = { id: string @@ -20,6 +23,7 @@ export type NostrEvent = { startAtNano: string startAtMs: number } + type SettingsRequest = { type: 'settings' settings: NostrSettings @@ -27,7 +31,7 @@ type SettingsRequest = { type SendRequest = { type: 'send' - appId: string + initiator: SendInitiator data: SendData relays?: string[] } @@ -53,7 +57,7 @@ process.on("message", (message: ChildProcessRequest) => { initSubprocessHandler(message.settings) break case 'send': - sendToNostr(message.appId, message.data, message.relays) + sendToNostr(message.initiator, message.data, message.relays) break default: getLogger({ component: "nostrMiddleware" })(ERROR, "unknown nostr request", message) @@ -72,12 +76,12 @@ const initSubprocessHandler = (settings: NostrSettings) => { }) }) } -const sendToNostr: NostrSend = (appId, data, relays) => { +const sendToNostr: NostrSend = (initiator, data, relays) => { if (!subProcessHandler) { getLogger({ component: "nostrMiddleware" })(ERROR, "nostr was not initialized") return } - subProcessHandler.Send(appId, data, relays) + subProcessHandler.Send(initiator, data, relays) } send({ type: 'ready' }) @@ -147,43 +151,47 @@ export default class Handler { return } const app = this.apps[pubTags[1]] - if (!app) { + if (app) { + await this.processEvent(e, app) return } - const eventId = e.id - if (handledEvents.includes(eventId)) { - this.log("event already handled") - return - } - handledEvents.push(eventId) - const startAtMs = Date.now() - const startAtNano = process.hrtime.bigint().toString() - const decoded = decodePayload(e.content) - const content = await decryptData(decoded, getSharedSecret(app.privateKey, e.pubkey)) - this.eventCallback({ id: eventId, content, pub: e.pubkey, appId: app.appId, startAtNano, startAtMs }) }) } - async Send(appId: string, data: SendData, relays?: string[]) { - const appInfo = this.GetAppKeys({ appId }) + async processEvent(e: Event<21000>, app: AppInfo) { + const eventId = e.id + if (handledEvents.includes(eventId)) { + this.log("event already handled") + return + } + handledEvents.push(eventId) + const startAtMs = Date.now() + const startAtNano = process.hrtime.bigint().toString() + const decoded = decodePayload(e.content) + const content = await decryptData(decoded, getSharedSecret(app.privateKey, e.pubkey)) + this.eventCallback({ id: eventId, content, pub: e.pubkey, appId: app.appId, startAtNano, startAtMs }) + } + + async Send(initiator: SendInitiator, data: SendData, relays?: string[]) { + const keys = this.GetSendKeys(initiator) let toSign: UnsignedEvent if (data.type === 'content') { - const decoded = await encryptData(data.content, getSharedSecret(appInfo.privateKey, data.pub)) + const decoded = await encryptData(data.content, getSharedSecret(keys.privateKey, data.pub)) const content = encodePayload(decoded) toSign = { content, created_at: Math.floor(Date.now() / 1000), kind: 21000, - pubkey: appInfo.publicKey, + pubkey: keys.publicKey, tags: [['p', data.pub]], } } else { toSign = data.event } - const signed = finishEvent(toSign, appInfo.privateKey) + const signed = finishEvent(toSign, keys.privateKey) let sent = false - const log = getLogger({ appName: appInfo.name }) + const log = getLogger({ appName: keys.name }) await Promise.all(this.pool.publish(relays || this.settings.relays, signed).map(async p => { try { await p @@ -197,21 +205,22 @@ export default class Handler { } } - GetAppKeys(appInfo: Partial) { - let check: (info: AppInfo) => boolean - if (appInfo.appId) { - check = (info: AppInfo) => info.appId === appInfo.appId - } else if (appInfo.privateKey) { - check = (info: AppInfo) => info.privateKey === appInfo.privateKey - } else if (appInfo.publicKey) { - check = (info: AppInfo) => info.publicKey === appInfo.publicKey - } else { - throw new Error("app info is empty") + GetSendKeys(initiator: SendInitiator) { + if (initiator.type === 'app') { + const { appId } = initiator + const found = this.settings.apps.find((info: AppInfo) => info.appId === appId) + if (!found) { + throw new Error("unkown app") + } + return found + } else if (initiator.type === 'client') { + const { clientId } = initiator + const found = this.settings.clients.find((info: ClientInfo) => info.clientId === clientId) + if (!found) { + throw new Error("unkown client") + } + return found } - const found = this.settings.apps.find(check) - if (!found) { - throw new Error("unkown app") - } - return found + throw new Error("unkown initiator type") } } \ No newline at end of file diff --git a/src/services/nostr/index.ts b/src/services/nostr/index.ts index 49e1e280..b0c255cc 100644 --- a/src/services/nostr/index.ts +++ b/src/services/nostr/index.ts @@ -1,6 +1,6 @@ import { ChildProcess, fork } from 'child_process' import { EnvMustBeNonEmptyString } from "../helpers/envParser.js" -import { NostrSettings, NostrEvent, ChildProcessRequest, ChildProcessResponse, SendData } from "./handler.js" +import { NostrSettings, NostrEvent, ChildProcessRequest, ChildProcessResponse, SendData, SendInitiator } from "./handler.js" type EventCallback = (event: NostrEvent) => void export const LoadNosrtSettingsFromEnv = (test = false) => { return { @@ -31,8 +31,8 @@ export default class NostrSubprocess { this.childProcess.send(message) } - Send(appId: string, data: SendData, relays?: string[]) { - this.sendToChildProcess({ type: 'send', data, appId, relays }) + Send(initiator: SendInitiator, data: SendData, relays?: string[]) { + this.sendToChildProcess({ type: 'send', data, initiator, relays }) } Stop() { this.childProcess.kill()