diff --git a/datasource.js b/datasource.js index 9ccbf9e78..9b8d08603 100644 --- a/datasource.js +++ b/datasource.js @@ -14,18 +14,20 @@ import { UserTransactionPayment } from "./build/src/services/storage/entity/User import { LspOrder } from "./build/src/services/storage/entity/LspOrder.js" import { LndNodeInfo } from "./build/src/services/storage/entity/LndNodeInfo.js" import { TrackedProvider } from "./build/src/services/storage/entity/TrackedProvider.js" +import { InviteToken } from "./build/src/services/storage/entity/InviteToken.js" import { Initial1703170309875 } from './build/src/services/storage/migrations/1703170309875-initial.js' import { LspOrder1718387847693 } from './build/src/services/storage/migrations/1718387847693-lsp_order.js' import { LndNodeInfo1720187506189 } from './build/src/services/storage/migrations/1720187506189-lnd_node_info.js' import { LiquidityProvider1719335699480 } from './build/src/services/storage/migrations/1719335699480-liquidity_provider.js' +import { CreateInviteTokenTable1721751414878 } from './build/src/services/storage/migrations/1721751414878-create_invite_token_table.js' export default new DataSource({ type: "sqlite", database: "db.sqlite", // logging: true, - migrations: [Initial1703170309875, LspOrder1718387847693, LiquidityProvider1719335699480, LndNodeInfo1720187506189], + migrations: [Initial1703170309875, LspOrder1718387847693, LiquidityProvider1719335699480, LndNodeInfo1720187506189, CreateInviteTokenTable1721751414878], entities: [User, UserReceivingInvoice, UserReceivingAddress, AddressReceivingTransaction, UserInvoicePayment, UserTransactionPayment, - UserBasicAuth, UserEphemeralKey, Product, UserToUserPayment, Application, ApplicationUser, UserToUserPayment, LspOrder, LndNodeInfo, TrackedProvider], + UserBasicAuth, UserEphemeralKey, Product, UserToUserPayment, Application, ApplicationUser, UserToUserPayment, LspOrder, LndNodeInfo, TrackedProvider, InviteToken], // synchronize: true, }) //npx typeorm migration:generate ./src/services/storage/migrations/lnd_node_info -d ./datasource.js \ No newline at end of file diff --git a/proto/autogenerated/client.md b/proto/autogenerated/client.md index be3bc6495..145975432 100644 --- a/proto/autogenerated/client.md +++ b/proto/autogenerated/client.md @@ -48,16 +48,31 @@ The nostr server will send back a message response, and inside the body there wi - input: [LndMetricsRequest](#LndMetricsRequest) - output: [LndMetrics](#LndMetrics) -- LinkNPubThroughToken - - auth type: __User__ - - input: [LinkNPubThroughTokenRequest](#LinkNPubThroughTokenRequest) - - This methods has an __empty__ __response__ body +- CreateOneTimeInviteLink + - auth type: __Admin__ + - input: [CreateOneTimeInviteLinkRequest](#CreateOneTimeInviteLinkRequest) + - output: [CreateOneTimeInviteLinkResponse](#CreateOneTimeInviteLinkResponse) + +- GetInviteLinkState + - auth type: __Admin__ + - input: [GetInviteTokenStateRequest](#GetInviteTokenStateRequest) + - output: [GetInviteTokenStateResponse](#GetInviteTokenStateResponse) - EnrollAdminToken - auth type: __User__ - input: [EnrollAdminTokenRequest](#EnrollAdminTokenRequest) - This methods has an __empty__ __response__ body +- LinkNPubThroughToken + - auth type: __GuestWithPub__ + - input: [LinkNPubThroughTokenRequest](#LinkNPubThroughTokenRequest) + - This methods has an __empty__ __response__ body + +- UseInviteLink + - auth type: __GuestWithPub__ + - input: [UseInviteLinkRequest](#UseInviteLinkRequest) + - This methods has an __empty__ __response__ body + - UserHealth - auth type: __User__ - This methods has an __empty__ __request__ body @@ -176,6 +191,11 @@ The nostr server will send back a message response, and inside the body there wi - expected context content - __app_id__: _string_ +- __GuestWithPub__: + - expected context content + - __pub__: _string_ + - __app_id__: _string_ + ## HTTP Methods ### These are the http methods the client implements to communicate with the API @@ -228,6 +248,20 @@ The nostr server will send back a message response, and inside the body there wi - input: [LndMetricsRequest](#LndMetricsRequest) - output: [LndMetrics](#LndMetrics) +- CreateOneTimeInviteLink + - auth type: __Admin__ + - http method: __post__ + - http route: __/api/admin/app/invite/create__ + - input: [CreateOneTimeInviteLinkRequest](#CreateOneTimeInviteLinkRequest) + - output: [CreateOneTimeInviteLinkResponse](#CreateOneTimeInviteLinkResponse) + +- GetInviteLinkState + - auth type: __Admin__ + - http method: __post__ + - http route: __/api/admin/app/invite/get__ + - input: [GetInviteTokenStateRequest](#GetInviteTokenStateRequest) + - output: [GetInviteTokenStateResponse](#GetInviteTokenStateResponse) + - Health - auth type: __Guest__ - http method: __get__ @@ -298,18 +332,25 @@ The nostr server will send back a message response, and inside the body there wi - This methods has an __empty__ __request__ body - output: [LnurlPayInfoResponse](#LnurlPayInfoResponse) -- LinkNPubThroughToken +- EnrollAdminToken - auth type: __User__ - http method: __post__ + - http route: __/api/guest/npub/enroll/admin__ + - input: [EnrollAdminTokenRequest](#EnrollAdminTokenRequest) + - This methods has an __empty__ __response__ body + +- LinkNPubThroughToken + - auth type: __GuestWithPub__ + - http method: __post__ - http route: __/api/guest/npub/link__ - input: [LinkNPubThroughTokenRequest](#LinkNPubThroughTokenRequest) - This methods has an __empty__ __response__ body -- EnrollAdminToken - - auth type: __User__ +- UseInviteLink + - auth type: __GuestWithPub__ - http method: __post__ - - http route: __/api/guest/npub/enroll/admin__ - - input: [EnrollAdminTokenRequest](#EnrollAdminTokenRequest) + - http route: __/api/guest/invite__ + - input: [UseInviteLinkRequest](#UseInviteLinkRequest) - This methods has an __empty__ __response__ body - GetApp @@ -529,100 +570,50 @@ 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 -### Empty - -### LndMetricsRequest - - __from_unix__: _number_ *this field is optional - - __to_unix__: _number_ *this field is optional - -### LndGetInfoResponse - - __alias__: _string_ - -### PayAppUserInvoiceRequest - - __user_identifier__: _string_ - - __invoice__: _string_ - - __amount__: _number_ +### AddAppUserRequest + - __identifier__: _string_ + - __fail_if_exists__: _boolean_ + - __balance__: _number_ -### Product - - __id__: _string_ - - __name__: _string_ - - __price_sats__: _number_ +### GetProductBuyLinkResponse + - __link__: _string_ -### LndGetInfoRequest - - __nodeId__: _number_ +### CreateOneTimeInviteLinkResponse + - __invitation_link__: _string_ -### BanUserResponse - - __balance_sats__: _number_ - - __banned_app_users__: ARRAY of: _[BannedAppUser](#BannedAppUser)_ +### AppMetrics + - __users__: _[UsersInfo](#UsersInfo)_ + - __fees__: _number_ + - __total_fees__: _number_ + - __app__: _[Application](#Application)_ + - __spent__: _number_ + - __available__: _number_ + - __invoices__: _number_ + - __operations__: ARRAY of: _[UserOperation](#UserOperation)_ + - __received__: _number_ -### AuthAppRequest - - __name__: _string_ - - __allow_user_creation__: _boolean_ *this field is optional +### AddAppInvoiceRequest + - __payer_identifier__: _string_ + - __http_callback_url__: _string_ + - __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_ -### PayAddressRequest - - __address__: _string_ - - __amoutSats__: _number_ - - __satsPerVByte__: _number_ +### NewInvoiceResponse + - __invoice__: _string_ -### AppsMetricsRequest - - __from_unix__: _number_ *this field is optional - - __to_unix__: _number_ *this field is optional - - __include_operations__: _boolean_ *this field is optional +### EnrollAdminTokenRequest + - __admin_token__: _string_ -### AppsMetrics - - __apps__: ARRAY of: _[AppMetrics](#AppMetrics)_ +### GetInviteTokenStateRequest + - __invite_token__: _string_ -### RoutingEvent - - __timestamp_ns__: _number_ - - __event_type__: _string_ - - __settled__: _boolean_ - - __offchain__: _boolean_ - - __incoming_channel_id__: _number_ - - __incoming_htlc_id__: _number_ - - __outgoing_channel_id__: _number_ - - __outgoing_htlc_id__: _number_ - - __forward_fail_event__: _boolean_ - - __incoming_amt_msat__: _number_ - - __outgoing_amt_msat__: _number_ - - __failure_string__: _string_ +### AppUser + - __identifier__: _string_ + - __info__: _[UserInfo](#UserInfo)_ + - __max_withdrawable__: _number_ -### BannedAppUser - - __app_name__: _string_ - - __app_id__: _string_ +### SetMockAppUserBalanceRequest - __user_identifier__: _string_ - - __nostr_pub__: _string_ - -### GetUserOperationsResponse - - __latestOutgoingTxOperations__: _[UserOperations](#UserOperations)_ - - __latestIncomingTxOperations__: _[UserOperations](#UserOperations)_ - - __latestOutgoingUserToUserPayemnts__: _[UserOperations](#UserOperations)_ - - __latestIncomingUserToUserPayemnts__: _[UserOperations](#UserOperations)_ - - __latestOutgoingInvoiceOperations__: _[UserOperations](#UserOperations)_ - - __latestIncomingInvoiceOperations__: _[UserOperations](#UserOperations)_ - -### RequestNPubLinkingTokenResponse - - __token__: _string_ - -### UsageMetric - - __processed_at_ms__: _number_ - - __auth_in_nano__: _number_ - - __rpc_name__: _string_ - - __nostr__: _boolean_ - - __batch_size__: _number_ - - __parsed_in_nano__: _number_ - - __validate_in_nano__: _number_ - - __handle_in_nano__: _number_ - - __batch__: _boolean_ - -### NewInvoiceRequest - - __amountSats__: _number_ - - __memo__: _string_ - -### OpenChannelRequest - - __destination__: _string_ - - __fundingAmount__: _number_ - - __pushAmount__: _number_ - - __closeAddress__: _string_ + - __amount__: _number_ ### ChainBalanceEvent - __block_height__: _number_ @@ -630,41 +621,33 @@ The nostr server will send back a message response, and inside the body there wi - __unconfirmed_balance__: _number_ - __total_balance__: _number_ -### GetAppUserRequest +### GetAppUserLNURLInfoRequest + - __base_url_override__: _string_ - __user_identifier__: _string_ -### NewAddressResponse +### PayAddressRequest - __address__: _string_ + - __amoutSats__: _number_ + - __satsPerVByte__: _number_ -### PayInvoiceResponse - - __preimage__: _string_ - - __amount_paid__: _number_ - - __operation_id__: _string_ - - __service_fee__: _number_ - - __network_fee__: _number_ - -### AddProductRequest - - __name__: _string_ - - __price_sats__: _number_ - -### MigrationUpdate - - __closure__: _[ClosureMigration](#ClosureMigration)_ *this field is optional - - __relays__: _[RelaysMigration](#RelaysMigration)_ *this field is optional +### UserOperations + - __operations__: ARRAY of: _[UserOperation](#UserOperation)_ + - __fromIndex__: _number_ + - __toIndex__: _number_ -### ClosureMigration - - __closes_at_unix__: _number_ +### RequestNPubLinkingTokenRequest + - __user_identifier__: _string_ -### EncryptionExchangeRequest - - __publicKey__: _string_ - - __deviceId__: _string_ +### UseInviteLinkRequest + - __invite_token__: _string_ ### UsersInfo + - __balance_median__: _number_ - __total__: _number_ - __no_balance__: _number_ - __negative_balance__: _number_ - __always_been_inactive__: _number_ - __balance_avg__: _number_ - - __balance_median__: _number_ ### ChannelBalanceEvent - __block_height__: _number_ @@ -672,231 +655,304 @@ The nostr server will send back a message response, and inside the body there wi - __local_balance_sats__: _number_ - __remote_balance_sats__: _number_ -### ChannelRouting - - __receive_errors__: _number_ - - __forward_errors_as_output__: _number_ - - __missed_forward_fee_as_output__: _number_ - - __events_number__: _number_ - - __channel_id__: _string_ - - __forward_errors_as_input__: _number_ - - __missed_forward_fee_as_input__: _number_ - - __forward_fee_as_input__: _number_ - - __forward_fee_as_output__: _number_ - - __send_errors__: _number_ +### GetAppUserRequest + - __user_identifier__: _string_ -### SendAppUserToAppPaymentRequest - - __from_user_identifier__: _string_ - - __amount__: _number_ +### NewAddressResponse + - __address__: _string_ -### SetMockAppBalanceRequest - - __amount__: _number_ +### OpenChannelResponse + - __channelId__: _string_ -### HttpCreds - - __url__: _string_ - - __token__: _string_ +### AddProductRequest + - __name__: _string_ + - __price_sats__: _number_ -### ClosedChannel - - __channel_id__: _string_ - - __capacity__: _number_ - - __closed_height__: _number_ +### AppsMetricsRequest + - __include_operations__: _boolean_ *this field is optional + - __from_unix__: _number_ *this field is optional + - __to_unix__: _number_ *this field is optional -### Application - - __id__: _string_ - - __balance__: _number_ - - __npub__: _string_ - - __name__: _string_ +### LndMetricsRequest + - __from_unix__: _number_ *this field is optional + - __to_unix__: _number_ *this field is optional -### AddAppUserRequest - - __balance__: _number_ - - __identifier__: _string_ - - __fail_if_exists__: _boolean_ +### HandleLnurlPayResponse + - __pr__: _string_ + - __routes__: ARRAY of: _[Empty](#Empty)_ -### SetMockAppUserBalanceRequest - - __user_identifier__: _string_ - - __amount__: _number_ +### GetUserOperationsRequest + - __latestIncomingInvoice__: _number_ + - __latestOutgoingInvoice__: _number_ + - __latestIncomingTx__: _number_ + - __latestOutgoingTx__: _number_ + - __latestIncomingUserToUserPayment__: _number_ + - __latestOutgoingUserToUserPayment__: _number_ + - __max_size__: _number_ -### PayAddressResponse - - __operation_id__: _string_ +### UserOperation + - __type__: _[UserOperationType](#UserOperationType)_ + - __operationId__: _string_ + - __tx_hash__: _string_ + - __internal__: _boolean_ + - __paidAtUnix__: _number_ + - __inbound__: _boolean_ + - __amount__: _number_ + - __identifier__: _string_ - __service_fee__: _number_ - __network_fee__: _number_ - - __txId__: _string_ - -### NewInvoiceResponse - - __invoice__: _string_ - -### RequestNPubLinkingTokenRequest - - __user_identifier__: _string_ + - __confirmed__: _boolean_ -### LinkNPubThroughTokenRequest +### RequestNPubLinkingTokenResponse - __token__: _string_ - - __nostr_pub__: _string_ -### OpenChannel - - __channel_id__: _string_ - - __capacity__: _number_ - - __active__: _boolean_ - - __lifetime__: _number_ - - __local_balance__: _number_ - - __remote_balance__: _number_ +### BanUserResponse + - __balance_sats__: _number_ + - __banned_app_users__: ARRAY of: _[BannedAppUser](#BannedAppUser)_ -### SetMockInvoiceAsPaidRequest - - __invoice__: _string_ +### SendAppUserToAppPaymentRequest + - __from_user_identifier__: _string_ - __amount__: _number_ -### AddAppUserInvoiceRequest - - __receiver_identifier__: _string_ - - __payer_identifier__: _string_ - - __http_callback_url__: _string_ - - __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_ +### AuthAppRequest + - __name__: _string_ + - __allow_user_creation__: _boolean_ *this field is optional -### DecodeInvoiceResponse - - __amount__: _number_ +### NewAddressRequest + - __addressType__: _[AddressType](#AddressType)_ -### OpenChannelResponse - - __channelId__: _string_ +### PayInvoiceResponse + - __network_fee__: _number_ + - __preimage__: _string_ + - __amount_paid__: _number_ + - __operation_id__: _string_ + - __service_fee__: _number_ -### RelaysMigration - - __relays__: ARRAY of: _string_ +### LiveUserOperation + - __operation__: _[UserOperation](#UserOperation)_ -### LndMetrics - - __nodes__: ARRAY of: _[LndNodeMetrics](#LndNodeMetrics)_ +### ClosureMigration + - __closes_at_unix__: _number_ -### AppUser - - __identifier__: _string_ - - __info__: _[UserInfo](#UserInfo)_ - - __max_withdrawable__: _number_ +### GetInviteTokenStateResponse + - __used__: _boolean_ -### AddAppInvoiceRequest - - __payer_identifier__: _string_ - - __http_callback_url__: _string_ - - __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_ +### RoutingEvent + - __outgoing_amt_msat__: _number_ + - __failure_string__: _string_ + - __incoming_htlc_id__: _number_ + - __outgoing_htlc_id__: _number_ + - __event_type__: _string_ + - __incoming_amt_msat__: _number_ + - __offchain__: _boolean_ + - __forward_fail_event__: _boolean_ + - __incoming_channel_id__: _number_ + - __outgoing_channel_id__: _number_ + - __timestamp_ns__: _number_ + - __settled__: _boolean_ -### UserOperations - - __fromIndex__: _number_ - - __toIndex__: _number_ - - __operations__: ARRAY of: _[UserOperation](#UserOperation)_ +### LndGetInfoResponse + - __alias__: _string_ -### BanUserRequest - - __user_id__: _string_ +### CreateOneTimeInviteLinkRequest + - __sats__: _number_ *this field is optional -### NewAddressRequest - - __addressType__: _[AddressType](#AddressType)_ +### Empty -### DecodeInvoiceRequest - - __invoice__: _string_ +### GetUserOperationsResponse + - __latestIncomingUserToUserPayemnts__: _[UserOperations](#UserOperations)_ + - __latestOutgoingInvoiceOperations__: _[UserOperations](#UserOperations)_ + - __latestIncomingInvoiceOperations__: _[UserOperations](#UserOperations)_ + - __latestOutgoingTxOperations__: _[UserOperations](#UserOperations)_ + - __latestIncomingTxOperations__: _[UserOperations](#UserOperations)_ + - __latestOutgoingUserToUserPayemnts__: _[UserOperations](#UserOperations)_ -### LnurlWithdrawInfoResponse - - __callback__: _string_ +### LnurlLinkResponse + - __lnurl__: _string_ - __k1__: _string_ - - __defaultDescription__: _string_ - - __minWithdrawable__: _number_ - - __maxWithdrawable__: _number_ - - __balanceCheck__: _string_ - - __payLink__: _string_ - - __tag__: _string_ -### GetUserOperationsRequest - - __latestOutgoingInvoice__: _number_ - - __latestIncomingTx__: _number_ - - __latestOutgoingTx__: _number_ - - __latestIncomingUserToUserPayment__: _number_ - - __latestOutgoingUserToUserPayment__: _number_ - - __max_size__: _number_ - - __latestIncomingInvoice__: _number_ - -### AppMetrics - - __spent__: _number_ - - __available__: _number_ - - __fees__: _number_ - - __invoices__: _number_ - - __total_fees__: _number_ - - __app__: _[Application](#Application)_ - - __users__: _[UsersInfo](#UsersInfo)_ - - __received__: _number_ - - __operations__: ARRAY of: _[UserOperation](#UserOperation)_ - -### AddAppRequest - - __name__: _string_ - - __allow_user_creation__: _boolean_ +### PayAppUserInvoiceRequest + - __user_identifier__: _string_ + - __invoice__: _string_ + - __amount__: _number_ -### SendAppUserToAppUserPaymentRequest +### PayInvoiceRequest + - __invoice__: _string_ - __amount__: _number_ - - __from_user_identifier__: _string_ - - __to_user_identifier__: _string_ ### LnurlPayInfoResponse + - __nostrPubkey__: _string_ + - __tag__: _string_ - __callback__: _string_ - __maxSendable__: _number_ - __minSendable__: _number_ - __metadata__: _string_ - __allowsNostr__: _boolean_ - - __nostrPubkey__: _string_ - - __tag__: _string_ -### HandleLnurlPayResponse - - __pr__: _string_ - - __routes__: ARRAY of: _[Empty](#Empty)_ +### RelaysMigration + - __relays__: ARRAY of: _string_ -### EnrollAdminTokenRequest - - __admin_token__: _string_ +### BannedAppUser + - __user_identifier__: _string_ + - __nostr_pub__: _string_ + - __app_name__: _string_ + - __app_id__: _string_ -### UsageMetrics - - __metrics__: ARRAY of: _[UsageMetric](#UsageMetric)_ +### AddAppUserInvoiceRequest + - __receiver_identifier__: _string_ + - __payer_identifier__: _string_ + - __http_callback_url__: _string_ + - __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_ -### LnurlLinkResponse - - __k1__: _string_ - - __lnurl__: _string_ +### SetMockInvoiceAsPaidRequest + - __invoice__: _string_ + - __amount__: _number_ -### LiveUserOperation - - __operation__: _[UserOperation](#UserOperation)_ +### BanUserRequest + - __user_id__: _string_ -### PayInvoiceRequest - - __invoice__: _string_ +### DecodeInvoiceResponse - __amount__: _number_ -### GetProductBuyLinkResponse - - __link__: _string_ +### OpenChannelRequest + - __pushAmount__: _number_ + - __closeAddress__: _string_ + - __destination__: _string_ + - __fundingAmount__: _number_ + +### Product + - __price_sats__: _number_ + - __id__: _string_ + - __name__: _string_ + +### MigrationUpdate + - __closure__: _[ClosureMigration](#ClosureMigration)_ *this field is optional + - __relays__: _[RelaysMigration](#RelaysMigration)_ *this field is optional + +### EncryptionExchangeRequest + - __publicKey__: _string_ + - __deviceId__: _string_ + +### UsageMetric + - __processed_at_ms__: _number_ + - __handle_in_nano__: _number_ + - __rpc_name__: _string_ + - __batch__: _boolean_ + - __parsed_in_nano__: _number_ + - __auth_in_nano__: _number_ + - __validate_in_nano__: _number_ + - __nostr__: _boolean_ + - __batch_size__: _number_ + +### UsageMetrics + - __metrics__: ARRAY of: _[UsageMetric](#UsageMetric)_ ### LndNodeMetrics - - __chain_balance_events__: ARRAY of: _[ChainBalanceEvent](#ChainBalanceEvent)_ - - __online_channels__: _number_ - __closing_channels__: _number_ - __channels_balance_events__: ARRAY of: _[ChannelBalanceEvent](#ChannelBalanceEvent)_ + - __chain_balance_events__: ARRAY of: _[ChainBalanceEvent](#ChainBalanceEvent)_ - __pending_channels__: _number_ - - __open_channels__: ARRAY of: _[OpenChannel](#OpenChannel)_ - __closed_channels__: ARRAY of: _[ClosedChannel](#ClosedChannel)_ - __channel_routing__: ARRAY of: _[ChannelRouting](#ChannelRouting)_ - __offline_channels__: _number_ + - __online_channels__: _number_ + - __open_channels__: ARRAY of: _[OpenChannel](#OpenChannel)_ + +### NewInvoiceRequest + - __amountSats__: _number_ + - __memo__: _string_ + +### DecodeInvoiceRequest + - __invoice__: _string_ + +### LnurlWithdrawInfoResponse + - __payLink__: _string_ + - __tag__: _string_ + - __callback__: _string_ + - __k1__: _string_ + - __defaultDescription__: _string_ + - __minWithdrawable__: _number_ + - __maxWithdrawable__: _number_ + - __balanceCheck__: _string_ + +### LinkNPubThroughTokenRequest + - __token__: _string_ + - __nostr_pub__: _string_ + +### Application + - __id__: _string_ + - __balance__: _number_ + - __npub__: _string_ + - __name__: _string_ ### AuthApp - __app__: _[Application](#Application)_ - __auth_token__: _string_ -### GetAppUserLNURLInfoRequest - - __user_identifier__: _string_ - - __base_url_override__: _string_ +### LndGetInfoRequest + - __nodeId__: _number_ + +### SetMockAppBalanceRequest + - __amount__: _number_ + +### PayAddressResponse + - __txId__: _string_ + - __operation_id__: _string_ + - __service_fee__: _number_ + - __network_fee__: _number_ ### UserInfo - - __network_max_fee_fixed__: _number_ - __userId__: _string_ - __balance__: _number_ - __max_withdrawable__: _number_ - __user_identifier__: _string_ - __service_fee_bps__: _number_ - __network_max_fee_bps__: _number_ + - __network_max_fee_fixed__: _number_ -### UserOperation - - __paidAtUnix__: _number_ - - __service_fee__: _number_ - - __confirmed__: _boolean_ - - __tx_hash__: _string_ - - __internal__: _boolean_ - - __network_fee__: _number_ - - __type__: _[UserOperationType](#UserOperationType)_ - - __inbound__: _boolean_ +### HttpCreds + - __url__: _string_ + - __token__: _string_ + +### AppsMetrics + - __apps__: ARRAY of: _[AppMetrics](#AppMetrics)_ + +### LndMetrics + - __nodes__: ARRAY of: _[LndNodeMetrics](#LndNodeMetrics)_ + +### ChannelRouting + - __forward_errors_as_input__: _number_ + - __missed_forward_fee_as_input__: _number_ + - __forward_fee_as_output__: _number_ + - __channel_id__: _string_ + - __send_errors__: _number_ + - __missed_forward_fee_as_output__: _number_ + - __forward_fee_as_input__: _number_ + - __events_number__: _number_ + - __receive_errors__: _number_ + - __forward_errors_as_output__: _number_ + +### AddAppRequest + - __name__: _string_ + - __allow_user_creation__: _boolean_ + +### SendAppUserToAppUserPaymentRequest + - __from_user_identifier__: _string_ + - __to_user_identifier__: _string_ - __amount__: _number_ - - __identifier__: _string_ - - __operationId__: _string_ + +### OpenChannel + - __local_balance__: _number_ + - __remote_balance__: _number_ + - __channel_id__: _string_ + - __capacity__: _number_ + - __active__: _boolean_ + - __lifetime__: _number_ + +### ClosedChannel + - __channel_id__: _string_ + - __capacity__: _number_ + - __closed_height__: _number_ ## Enums ### The enumerators used in the messages diff --git a/proto/autogenerated/debug.txt b/proto/autogenerated/debug.txt index b62093720..f7a89b6c1 100644 --- a/proto/autogenerated/debug.txt +++ b/proto/autogenerated/debug.txt @@ -1,5 +1,5 @@ -([]*main.Method) (len=47 cap=64) { - (*main.Method)(0xc00007a230)({ +([]*main.Method) (len=50 cap=64) { + (*main.Method)(0xc0002f8730)({ 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)(0xc000070f60)({ - authType: (*main.supportedAuth)(0xc0005be600)({ + opts: (*main.methodOptions)(0xc00007d6e0)({ + authType: (*main.supportedAuth)(0xc000379f50)({ 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)(0xc00007a2d0)({ + (*main.Method)(0xc0002f88c0)({ 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)(0xc000071140)({ - authType: (*main.supportedAuth)(0xc0005be690)({ + opts: (*main.methodOptions)(0xc00007d8c0)({ + authType: (*main.supportedAuth)(0xc0003a0000)({ 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)(0xc00007a370)({ + (*main.Method)(0xc0002f8960)({ 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)(0xc000071320)({ - authType: (*main.supportedAuth)(0xc0005be720)({ + opts: (*main.methodOptions)(0xc00007daa0)({ + authType: (*main.supportedAuth)(0xc0003a0090)({ 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)(0xc00007a410)({ + (*main.Method)(0xc0002f8a00)({ 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)(0xc000071500)({ - authType: (*main.supportedAuth)(0xc0005be7b0)({ + opts: (*main.methodOptions)(0xc00007dc80)({ + authType: (*main.supportedAuth)(0xc0003a0120)({ 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)(0xc00007a460)({ + (*main.Method)(0xc0002f8a50)({ 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)(0xc0000716e0)({ - authType: (*main.supportedAuth)(0xc0005be840)({ + opts: (*main.methodOptions)(0xc00007de60)({ + authType: (*main.supportedAuth)(0xc0003a01b0)({ 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)(0xc00007a4b0)({ + (*main.Method)(0xc0002f8aa0)({ 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)(0xc0000718c0)({ - authType: (*main.supportedAuth)(0xc0005be8d0)({ + opts: (*main.methodOptions)(0xc00034bbc0)({ + authType: (*main.supportedAuth)(0xc0003a0240)({ 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)(0xc00007a500)({ + (*main.Method)(0xc0002f8af0)({ 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)(0xc000071aa0)({ - authType: (*main.supportedAuth)(0xc0005be960)({ + opts: (*main.methodOptions)(0xc00034bda0)({ + authType: (*main.supportedAuth)(0xc0003a02d0)({ id: (string) (len=7) "metrics", name: (string) (len=7) "Metrics", context: (map[string]string) (len=1) { @@ -202,7 +202,65 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007a550)({ + (*main.Method)(0xc0002f8b40)({ + in: (main.MethodMessage) { + name: (string) (len=30) "CreateOneTimeInviteLinkRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=23) "CreateOneTimeInviteLink", + out: (main.MethodMessage) { + name: (string) (len=31) "CreateOneTimeInviteLinkResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00011e420)({ + authType: (*main.supportedAuth)(0xc0003a0360)({ + id: (string) (len=5) "admin", + name: (string) (len=5) "Admin", + context: (map[string]string) (len=1) { + (string) (len=8) "admin_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=28) "/api/admin/app/invite/create", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) true, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc0002f8b90)({ + in: (main.MethodMessage) { + name: (string) (len=26) "GetInviteTokenStateRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=18) "GetInviteLinkState", + out: (main.MethodMessage) { + name: (string) (len=27) "GetInviteTokenStateResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00011e720)({ + authType: (*main.supportedAuth)(0xc0003a03f0)({ + id: (string) (len=5) "admin", + name: (string) (len=5) "Admin", + context: (map[string]string) (len=1) { + (string) (len=8) "admin_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=25) "/api/admin/app/invite/get", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) true, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc0002f8be0)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -212,8 +270,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc000071c20)({ - authType: (*main.supportedAuth)(0xc0005be9f0)({ + opts: (*main.methodOptions)(0xc00011e8a0)({ + authType: (*main.supportedAuth)(0xc0003a0480)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", context: (map[string]string) { @@ -230,7 +288,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007a5a0)({ + (*main.Method)(0xc0002f8c30)({ in: (main.MethodMessage) { name: (string) (len=25) "EncryptionExchangeRequest", hasZeroFields: (bool) false @@ -240,8 +298,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc000071da0)({ - authType: (*main.supportedAuth)(0xc0005beab0)({ + opts: (*main.methodOptions)(0xc00011ea20)({ + authType: (*main.supportedAuth)(0xc0003a0540)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", context: (map[string]string) { @@ -258,7 +316,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007a5f0)({ + (*main.Method)(0xc0002f8c80)({ in: (main.MethodMessage) { name: (string) (len=27) "SetMockInvoiceAsPaidRequest", hasZeroFields: (bool) false @@ -268,8 +326,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc000071f80)({ - authType: (*main.supportedAuth)(0xc0005beb40)({ + opts: (*main.methodOptions)(0xc00011ec00)({ + authType: (*main.supportedAuth)(0xc0003a05d0)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", context: (map[string]string) { @@ -286,7 +344,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007a690)({ + (*main.Method)(0xc0002f8d20)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -296,8 +354,8 @@ name: (string) (len=25) "LnurlWithdrawInfoResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0000ae7e0)({ - authType: (*main.supportedAuth)(0xc0005bec90)({ + opts: (*main.methodOptions)(0xc00011efc0)({ + authType: (*main.supportedAuth)(0xc0003a0720)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", context: (map[string]string) { @@ -316,7 +374,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007a730)({ + (*main.Method)(0xc0002f8dc0)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -326,8 +384,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0000aeb40)({ - authType: (*main.supportedAuth)(0xc0005bede0)({ + opts: (*main.methodOptions)(0xc00011f380)({ + authType: (*main.supportedAuth)(0xc0003a0870)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", context: (map[string]string) { @@ -347,7 +405,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007a7d0)({ + (*main.Method)(0xc0002f8e60)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -357,8 +415,8 @@ name: (string) (len=20) "LnurlPayInfoResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0000aeea0)({ - authType: (*main.supportedAuth)(0xc0005bef00)({ + opts: (*main.methodOptions)(0xc0003a6240)({ + authType: (*main.supportedAuth)(0xc0003a0990)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", context: (map[string]string) { @@ -377,7 +435,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007a870)({ + (*main.Method)(0xc0002f8f00)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -387,8 +445,8 @@ name: (string) (len=22) "HandleLnurlPayResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0000af320)({ - authType: (*main.supportedAuth)(0xc0005bf050)({ + opts: (*main.methodOptions)(0xc0003a6600)({ + authType: (*main.supportedAuth)(0xc0003a0ae0)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", context: (map[string]string) { @@ -410,7 +468,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007a8c0)({ + (*main.Method)(0xc0002f8f50)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -420,8 +478,8 @@ name: (string) (len=20) "LnurlPayInfoResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005c4000)({ - authType: (*main.supportedAuth)(0xc0005bf0e0)({ + opts: (*main.methodOptions)(0xc0003a6780)({ + authType: (*main.supportedAuth)(0xc0003a0b70)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", context: (map[string]string) { @@ -440,24 +498,54 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007a960)({ + (*main.Method)(0xc0002f8fa0)({ in: (main.MethodMessage) { - name: (string) (len=27) "LinkNPubThroughTokenRequest", + name: (string) (len=23) "EnrollAdminTokenRequest", hasZeroFields: (bool) false }, - name: (string) (len=20) "LinkNPubThroughToken", + name: (string) (len=16) "EnrollAdminToken", out: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0005c41e0)({ - authType: (*main.supportedAuth)(0xc0005bf170)({ + opts: (*main.methodOptions)(0xc0003a69c0)({ + authType: (*main.supportedAuth)(0xc0003a0c00)({ 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", + route: (main.decodedRoute) { + route: (string) (len=28) "/api/guest/npub/enroll/admin", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) true, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc0002f9040)({ + in: (main.MethodMessage) { + name: (string) (len=27) "LinkNPubThroughTokenRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=20) "LinkNPubThroughToken", + out: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + opts: (*main.methodOptions)(0xc0003a6ba0)({ + authType: (*main.supportedAuth)(0xc0003a0c90)({ + id: (string) (len=8) "guestPub", + name: (string) (len=12) "GuestWithPub", + context: (map[string]string) (len=2) { + (string) (len=3) "pub": (string) (len=6) "string", + (string) (len=6) "app_id": (string) (len=6) "string" } }), method: (string) (len=4) "post", @@ -471,29 +559,28 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007a9b0)({ + (*main.Method)(0xc0002f9090)({ in: (main.MethodMessage) { - name: (string) (len=23) "EnrollAdminTokenRequest", + name: (string) (len=20) "UseInviteLinkRequest", hasZeroFields: (bool) false }, - name: (string) (len=16) "EnrollAdminToken", + name: (string) (len=13) "UseInviteLink", out: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0005c4420)({ - authType: (*main.supportedAuth)(0xc0005bf200)({ - 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" + opts: (*main.methodOptions)(0xc0003a6d80)({ + authType: (*main.supportedAuth)(0xc0003a0d20)({ + id: (string) (len=8) "guestPub", + name: (string) (len=12) "GuestWithPub", + context: (map[string]string) (len=2) { + (string) (len=3) "pub": (string) (len=6) "string", + (string) (len=6) "app_id": (string) (len=6) "string" } }), method: (string) (len=4) "post", route: (main.decodedRoute) { - route: (string) (len=28) "/api/guest/npub/enroll/admin", + route: (string) (len=17) "/api/guest/invite", params: ([]string) }, query: ([]string) , @@ -502,7 +589,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007aa00)({ + (*main.Method)(0xc0002f90e0)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -512,8 +599,8 @@ name: (string) (len=11) "Application", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005c45a0)({ - authType: (*main.supportedAuth)(0xc0005bf290)({ + opts: (*main.methodOptions)(0xc0003a6f00)({ + authType: (*main.supportedAuth)(0xc0003a0db0)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -531,7 +618,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007aaa0)({ + (*main.Method)(0xc0002f9180)({ in: (main.MethodMessage) { name: (string) (len=17) "AddAppUserRequest", hasZeroFields: (bool) false @@ -541,8 +628,8 @@ name: (string) (len=7) "AppUser", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005c4720)({ - authType: (*main.supportedAuth)(0xc0005bf320)({ + opts: (*main.methodOptions)(0xc0003a7080)({ + authType: (*main.supportedAuth)(0xc0003a0e40)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -560,7 +647,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007ab40)({ + (*main.Method)(0xc0002f9220)({ in: (main.MethodMessage) { name: (string) (len=20) "AddAppInvoiceRequest", hasZeroFields: (bool) false @@ -570,8 +657,8 @@ name: (string) (len=18) "NewInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005c48a0)({ - authType: (*main.supportedAuth)(0xc0005bf3b0)({ + opts: (*main.methodOptions)(0xc0003a7200)({ + authType: (*main.supportedAuth)(0xc0003a0ed0)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -589,7 +676,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007ab90)({ + (*main.Method)(0xc0002f9270)({ in: (main.MethodMessage) { name: (string) (len=24) "AddAppUserInvoiceRequest", hasZeroFields: (bool) false @@ -599,8 +686,8 @@ name: (string) (len=18) "NewInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005c4a80)({ - authType: (*main.supportedAuth)(0xc0005bf440)({ + opts: (*main.methodOptions)(0xc0003a73e0)({ + authType: (*main.supportedAuth)(0xc0003a0f60)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -618,7 +705,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007ac30)({ + (*main.Method)(0xc0002f9310)({ in: (main.MethodMessage) { name: (string) (len=17) "GetAppUserRequest", hasZeroFields: (bool) false @@ -628,8 +715,8 @@ name: (string) (len=7) "AppUser", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005c4c00)({ - authType: (*main.supportedAuth)(0xc0005bf4d0)({ + opts: (*main.methodOptions)(0xc0003a7560)({ + authType: (*main.supportedAuth)(0xc0003a0ff0)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -647,7 +734,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007acd0)({ + (*main.Method)(0xc0002f93b0)({ in: (main.MethodMessage) { name: (string) (len=24) "PayAppUserInvoiceRequest", hasZeroFields: (bool) false @@ -657,8 +744,8 @@ name: (string) (len=18) "PayInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005c4d80)({ - authType: (*main.supportedAuth)(0xc0005bf560)({ + opts: (*main.methodOptions)(0xc0003a76e0)({ + authType: (*main.supportedAuth)(0xc0003a1080)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -676,7 +763,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007ad20)({ + (*main.Method)(0xc0002f9400)({ in: (main.MethodMessage) { name: (string) (len=34) "SendAppUserToAppUserPaymentRequest", hasZeroFields: (bool) false @@ -686,8 +773,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0005c4f60)({ - authType: (*main.supportedAuth)(0xc0005bf5f0)({ + opts: (*main.methodOptions)(0xc0003a78c0)({ + authType: (*main.supportedAuth)(0xc0003a1110)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -705,7 +792,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007adc0)({ + (*main.Method)(0xc0002f94a0)({ in: (main.MethodMessage) { name: (string) (len=30) "SendAppUserToAppPaymentRequest", hasZeroFields: (bool) false @@ -715,8 +802,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0005c50e0)({ - authType: (*main.supportedAuth)(0xc0005bf680)({ + opts: (*main.methodOptions)(0xc0003a7a40)({ + authType: (*main.supportedAuth)(0xc0003a11a0)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -734,7 +821,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007ae10)({ + (*main.Method)(0xc0002f94f0)({ in: (main.MethodMessage) { name: (string) (len=26) "GetAppUserLNURLInfoRequest", hasZeroFields: (bool) false @@ -744,8 +831,8 @@ name: (string) (len=20) "LnurlPayInfoResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005c5260)({ - authType: (*main.supportedAuth)(0xc0005bf710)({ + opts: (*main.methodOptions)(0xc0003a7bc0)({ + authType: (*main.supportedAuth)(0xc0003a1230)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -763,7 +850,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007ae60)({ + (*main.Method)(0xc0002f9540)({ in: (main.MethodMessage) { name: (string) (len=28) "SetMockAppUserBalanceRequest", hasZeroFields: (bool) false @@ -773,8 +860,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0005c53e0)({ - authType: (*main.supportedAuth)(0xc0005bf7a0)({ + opts: (*main.methodOptions)(0xc0003a7d40)({ + authType: (*main.supportedAuth)(0xc0003a12c0)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -792,7 +879,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007aeb0)({ + (*main.Method)(0xc0002f9590)({ in: (main.MethodMessage) { name: (string) (len=24) "SetMockAppBalanceRequest", hasZeroFields: (bool) false @@ -802,8 +889,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0005c55c0)({ - authType: (*main.supportedAuth)(0xc0005bf830)({ + opts: (*main.methodOptions)(0xc0003a7f20)({ + authType: (*main.supportedAuth)(0xc0003a1350)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -821,7 +908,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007af00)({ + (*main.Method)(0xc0002f95e0)({ in: (main.MethodMessage) { name: (string) (len=30) "RequestNPubLinkingTokenRequest", hasZeroFields: (bool) false @@ -831,8 +918,8 @@ name: (string) (len=31) "RequestNPubLinkingTokenResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005c57a0)({ - authType: (*main.supportedAuth)(0xc0005bf8c0)({ + opts: (*main.methodOptions)(0xc0003e4120)({ + authType: (*main.supportedAuth)(0xc0003a13e0)({ id: (string) (len=3) "app", name: (string) (len=3) "App", context: (map[string]string) (len=1) { @@ -850,7 +937,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007af50)({ + (*main.Method)(0xc0002f9630)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -860,14 +947,14 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0005c5980)({ - authType: (*main.supportedAuth)(0xc0005bf950)({ + opts: (*main.methodOptions)(0xc0003e4300)({ + authType: (*main.supportedAuth)(0xc0003a1470)({ 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", @@ -881,7 +968,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007afa0)({ + (*main.Method)(0xc0002f9680)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -891,14 +978,14 @@ name: (string) (len=8) "UserInfo", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005c5b60)({ - authType: (*main.supportedAuth)(0xc0005bf9e0)({ + opts: (*main.methodOptions)(0xc0003e44e0)({ + authType: (*main.supportedAuth)(0xc0003a1500)({ 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", @@ -912,7 +999,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007b040)({ + (*main.Method)(0xc0002f9720)({ in: (main.MethodMessage) { name: (string) (len=17) "AddProductRequest", hasZeroFields: (bool) false @@ -922,8 +1009,8 @@ name: (string) (len=7) "Product", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005c5d40)({ - authType: (*main.supportedAuth)(0xc0005bfa70)({ + opts: (*main.methodOptions)(0xc0003e46c0)({ + authType: (*main.supportedAuth)(0xc0003a1590)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { @@ -943,7 +1030,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007b090)({ + (*main.Method)(0xc0002f9770)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -953,8 +1040,8 @@ name: (string) (len=18) "NewInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005ca1e0)({ - authType: (*main.supportedAuth)(0xc0005bfb90)({ + opts: (*main.methodOptions)(0xc0003e4b40)({ + authType: (*main.supportedAuth)(0xc0003a16b0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { @@ -976,7 +1063,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007b0e0)({ + (*main.Method)(0xc0002f97c0)({ in: (main.MethodMessage) { name: (string) (len=24) "GetUserOperationsRequest", hasZeroFields: (bool) false @@ -986,8 +1073,8 @@ name: (string) (len=25) "GetUserOperationsResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005ca3c0)({ - authType: (*main.supportedAuth)(0xc0005bfc20)({ + opts: (*main.methodOptions)(0xc0003e4d20)({ + authType: (*main.supportedAuth)(0xc0003a1740)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { @@ -1007,7 +1094,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007b180)({ + (*main.Method)(0xc0002f9860)({ in: (main.MethodMessage) { name: (string) (len=17) "NewAddressRequest", hasZeroFields: (bool) false @@ -1017,14 +1104,14 @@ name: (string) (len=18) "NewAddressResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005ca5a0)({ - authType: (*main.supportedAuth)(0xc0005bfcb0)({ + opts: (*main.methodOptions)(0xc0003e4f00)({ + authType: (*main.supportedAuth)(0xc0003a17d0)({ 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", @@ -1038,7 +1125,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007b220)({ + (*main.Method)(0xc0002f9900)({ in: (main.MethodMessage) { name: (string) (len=17) "PayAddressRequest", hasZeroFields: (bool) false @@ -1048,8 +1135,8 @@ name: (string) (len=18) "PayAddressResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005ca780)({ - authType: (*main.supportedAuth)(0xc0005bfd40)({ + opts: (*main.methodOptions)(0xc0003e50e0)({ + authType: (*main.supportedAuth)(0xc0003a1860)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { @@ -1069,7 +1156,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007b2c0)({ + (*main.Method)(0xc0002f99a0)({ in: (main.MethodMessage) { name: (string) (len=17) "NewInvoiceRequest", hasZeroFields: (bool) false @@ -1079,8 +1166,8 @@ name: (string) (len=18) "NewInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005ca960)({ - authType: (*main.supportedAuth)(0xc0005bfdd0)({ + opts: (*main.methodOptions)(0xc0003e52c0)({ + authType: (*main.supportedAuth)(0xc0003a18f0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { @@ -1100,7 +1187,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007b360)({ + (*main.Method)(0xc0002f9a40)({ in: (main.MethodMessage) { name: (string) (len=20) "DecodeInvoiceRequest", hasZeroFields: (bool) false @@ -1110,8 +1197,8 @@ name: (string) (len=21) "DecodeInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005cab40)({ - authType: (*main.supportedAuth)(0xc0005bfe60)({ + opts: (*main.methodOptions)(0xc0003e54a0)({ + authType: (*main.supportedAuth)(0xc0003a1980)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { @@ -1131,7 +1218,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007b400)({ + (*main.Method)(0xc0002f9ae0)({ in: (main.MethodMessage) { name: (string) (len=17) "PayInvoiceRequest", hasZeroFields: (bool) false @@ -1141,8 +1228,8 @@ name: (string) (len=18) "PayInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005cad20)({ - authType: (*main.supportedAuth)(0xc0005bfef0)({ + opts: (*main.methodOptions)(0xc0003e5680)({ + authType: (*main.supportedAuth)(0xc0003a1a10)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { @@ -1162,7 +1249,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007b4a0)({ + (*main.Method)(0xc0002f9b80)({ in: (main.MethodMessage) { name: (string) (len=18) "OpenChannelRequest", hasZeroFields: (bool) false @@ -1172,8 +1259,8 @@ name: (string) (len=19) "OpenChannelResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005caf00)({ - authType: (*main.supportedAuth)(0xc0005bff80)({ + opts: (*main.methodOptions)(0xc0003e5860)({ + authType: (*main.supportedAuth)(0xc0003a1aa0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { @@ -1193,7 +1280,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007b540)({ + (*main.Method)(0xc0002f9c20)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -1203,14 +1290,14 @@ name: (string) (len=17) "LnurlLinkResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005cb0e0)({ - authType: (*main.supportedAuth)(0xc0005ce030)({ + opts: (*main.methodOptions)(0xc0003e5a40)({ + authType: (*main.supportedAuth)(0xc0003a1b30)({ 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", @@ -1224,7 +1311,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007b5e0)({ + (*main.Method)(0xc0002f9cc0)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -1234,14 +1321,14 @@ name: (string) (len=17) "LnurlLinkResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005cb2c0)({ - authType: (*main.supportedAuth)(0xc0005ce0c0)({ + opts: (*main.methodOptions)(0xc0003e5c20)({ + authType: (*main.supportedAuth)(0xc0003a1bc0)({ 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=3) "get", @@ -1255,7 +1342,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007b680)({ + (*main.Method)(0xc0002f9d60)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -1265,8 +1352,8 @@ name: (string) (len=17) "LnurlLinkResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005cb4a0)({ - authType: (*main.supportedAuth)(0xc0005ce150)({ + opts: (*main.methodOptions)(0xc0003e5e00)({ + authType: (*main.supportedAuth)(0xc0003a1c50)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { @@ -1286,7 +1373,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc00007b720)({ + (*main.Method)(0xc0001000a0)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -1296,8 +1383,8 @@ name: (string) (len=17) "LiveUserOperation", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005cb680)({ - authType: (*main.supportedAuth)(0xc0005ce1e0)({ + opts: (*main.methodOptions)(0xc000428000)({ + authType: (*main.supportedAuth)(0xc00047e030)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { @@ -1317,7 +1404,7 @@ }), serverStream: (bool) true }), - (*main.Method)(0xc00007b7c0)({ + (*main.Method)(0xc000100190)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -1327,14 +1414,14 @@ name: (string) (len=15) "MigrationUpdate", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005cb860)({ - authType: (*main.supportedAuth)(0xc0005ce270)({ + opts: (*main.methodOptions)(0xc0004281e0)({ + authType: (*main.supportedAuth)(0xc00047e0c0)({ 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", @@ -1348,7 +1435,7 @@ }), serverStream: (bool) true }), - (*main.Method)(0xc00007b810)({ + (*main.Method)(0xc000100230)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -1358,14 +1445,14 @@ name: (string) (len=9) "HttpCreds", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0005cba40)({ - authType: (*main.supportedAuth)(0xc0005ce300)({ + opts: (*main.methodOptions)(0xc0004283c0)({ + authType: (*main.supportedAuth)(0xc00047e150)({ 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", @@ -1379,7 +1466,7 @@ }), serverStream: (bool) true }), - (*main.Method)(0xc00007b860)({ + (*main.Method)(0xc000100820)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -1389,8 +1476,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0005cbc80)({ - authType: (*main.supportedAuth)(0xc0005ce3c0)({ + opts: (*main.methodOptions)(0xc000428600)({ + authType: (*main.supportedAuth)(0xc00047e210)({ id: (string) (len=4) "user", name: (string) (len=4) "User", context: (map[string]string) (len=3) { @@ -1413,7 +1500,7 @@ } ([]*main.Enum) (len=2 cap=2) { - (*main.Enum)(0xc0003ffd70)({ + (*main.Enum)(0xc0003794a0)({ name: (string) (len=11) "AddressType", values: ([]main.EnumValue) (len=3 cap=4) { (main.EnumValue) { @@ -1430,7 +1517,7 @@ } } }), - (*main.Enum)(0xc0003ffdd0)({ + (*main.Enum)(0xc000379500)({ name: (string) (len=17) "UserOperationType", values: ([]main.EnumValue) (len=6 cap=8) { (main.EnumValue) { @@ -1461,24 +1548,30 @@ }) } -(map[string]*main.Message) (len=71) { - (string) (len=11) "OpenChannel": (*main.Message)(0xc0003fe750)({ - fullName: (string) (len=11) "OpenChannel", - name: (string) (len=11) "OpenChannel", - fields: (map[string]*main.Field) (len=6) { - (string) (len=6) "active": (*main.Field)(0xc00031f740)({ - name: (string) (len=6) "active", - kind: (string) (len=4) "bool", +(map[string]*main.Message) (len=76) { + (string) (len=26) "GetInviteTokenStateRequest": (*main.Message)(0xc0003793e0)({ + fullName: (string) (len=26) "GetInviteTokenStateRequest", + name: (string) (len=26) "GetInviteTokenStateRequest", + fields: (map[string]*main.Field) (len=1) { + (string) (len=12) "invite_token": (*main.Field)(0xc00037c140)({ + name: (string) (len=12) "invite_token", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }), - (string) (len=8) "lifetime": (*main.Field)(0xc00031f780)({ - name: (string) (len=8) "lifetime", - kind: (string) (len=5) "int64", + }) + } + }), + (string) (len=7) "AppUser": (*main.Message)(0xc0003782a0)({ + fullName: (string) (len=7) "AppUser", + name: (string) (len=7) "AppUser", + fields: (map[string]*main.Field) (len=3) { + (string) (len=10) "identifier": (*main.Field)(0xc000039fc0)({ + name: (string) (len=10) "identifier", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -1486,18 +1579,18 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=13) "local_balance": (*main.Field)(0xc00031f7c0)({ - name: (string) (len=13) "local_balance", - kind: (string) (len=5) "int64", + (string) (len=4) "info": (*main.Field)(0xc0002862c0)({ + name: (string) (len=4) "info", + kind: (string) (len=8) "UserInfo", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) false, + isMessage: (bool) true, isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=14) "remote_balance": (*main.Field)(0xc00031f800)({ - name: (string) (len=14) "remote_balance", + (string) (len=16) "max_withdrawable": (*main.Field)(0xc000286300)({ + name: (string) (len=16) "max_withdrawable", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -1505,10 +1598,16 @@ isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }), - (string) (len=10) "channel_id": (*main.Field)(0xc00031f6c0)({ - name: (string) (len=10) "channel_id", - kind: (string) (len=6) "string", + }) + } + }), + (string) (len=28) "SetMockAppUserBalanceRequest": (*main.Message)(0xc0003785a0)({ + fullName: (string) (len=28) "SetMockAppUserBalanceRequest", + name: (string) (len=28) "SetMockAppUserBalanceRequest", + fields: (map[string]*main.Field) (len=2) { + (string) (len=6) "amount": (*main.Field)(0xc000287100)({ + name: (string) (len=6) "amount", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -1516,9 +1615,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=8) "capacity": (*main.Field)(0xc00031f700)({ - name: (string) (len=8) "capacity", - kind: (string) (len=5) "int64", + (string) (len=15) "user_identifier": (*main.Field)(0xc0002870c0)({ + name: (string) (len=15) "user_identifier", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -1528,11 +1627,11 @@ }) } }), - (string) (len=27) "SetMockInvoiceAsPaidRequest": (*main.Message)(0xc0003fe990)({ - fullName: (string) (len=27) "SetMockInvoiceAsPaidRequest", - name: (string) (len=27) "SetMockInvoiceAsPaidRequest", - fields: (map[string]*main.Field) (len=2) { - (string) (len=7) "invoice": (*main.Field)(0xc00031fe40)({ + (string) (len=18) "NewInvoiceResponse": (*main.Message)(0xc000378840)({ + fullName: (string) (len=18) "NewInvoiceResponse", + name: (string) (len=18) "NewInvoiceResponse", + fields: (map[string]*main.Field) (len=1) { + (string) (len=7) "invoice": (*main.Field)(0xc000287780)({ name: (string) (len=7) "invoice", kind: (string) (len=6) "string", isMap: (bool) false, @@ -1541,10 +1640,16 @@ isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }), - (string) (len=6) "amount": (*main.Field)(0xc00031fe80)({ - name: (string) (len=6) "amount", - kind: (string) (len=5) "int64", + }) + } + }), + (string) (len=23) "EnrollAdminTokenRequest": (*main.Message)(0xc000379260)({ + fullName: (string) (len=23) "EnrollAdminTokenRequest", + name: (string) (len=23) "EnrollAdminTokenRequest", + fields: (map[string]*main.Field) (len=1) { + (string) (len=11) "admin_token": (*main.Field)(0xc00037c040)({ + name: (string) (len=11) "admin_token", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -1554,12 +1659,12 @@ }) } }), - (string) (len=24) "AddAppUserInvoiceRequest": (*main.Message)(0xc0003fee10)({ - fullName: (string) (len=24) "AddAppUserInvoiceRequest", - name: (string) (len=24) "AddAppUserInvoiceRequest", - fields: (map[string]*main.Field) (len=4) { - (string) (len=19) "receiver_identifier": (*main.Field)(0xc0004625c0)({ - name: (string) (len=19) "receiver_identifier", + (string) (len=17) "PayAddressRequest": (*main.Message)(0xc000378720)({ + fullName: (string) (len=17) "PayAddressRequest", + name: (string) (len=17) "PayAddressRequest", + fields: (map[string]*main.Field) (len=3) { + (string) (len=7) "address": (*main.Field)(0xc0002873c0)({ + name: (string) (len=7) "address", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -1568,9 +1673,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=16) "payer_identifier": (*main.Field)(0xc000462600)({ - name: (string) (len=16) "payer_identifier", - kind: (string) (len=6) "string", + (string) (len=9) "amoutSats": (*main.Field)(0xc000287400)({ + name: (string) (len=9) "amoutSats", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -1578,34 +1683,34 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=17) "http_callback_url": (*main.Field)(0xc000462640)({ - name: (string) (len=17) "http_callback_url", - kind: (string) (len=6) "string", + (string) (len=12) "satsPerVByte": (*main.Field)(0xc000287440)({ + 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, oneOfName: (string) "" - }), - (string) (len=11) "invoice_req": (*main.Field)(0xc000462680)({ - name: (string) (len=11) "invoice_req", - kind: (string) (len=17) "NewInvoiceRequest", + }) + } + }), + (string) (len=14) "UserOperations": (*main.Message)(0xc000378d80)({ + fullName: (string) (len=14) "UserOperations", + name: (string) (len=14) "UserOperations", + fields: (map[string]*main.Field) (len=3) { + (string) (len=10) "operations": (*main.Field)(0xc000122e00)({ + name: (string) (len=10) "operations", + kind: (string) (len=13) "UserOperation", isMap: (bool) false, - isArray: (bool) false, + isArray: (bool) true, isEnum: (bool) false, isMessage: (bool) true, isOptional: (bool) false, oneOfName: (string) "" - }) - } - }), - (string) (len=21) "DecodeInvoiceResponse": (*main.Message)(0xc0003ff3b0)({ - fullName: (string) (len=21) "DecodeInvoiceResponse", - name: (string) (len=21) "DecodeInvoiceResponse", - fields: (map[string]*main.Field) (len=1) { - (string) (len=6) "amount": (*main.Field)(0xc000462d80)({ - name: (string) (len=6) "amount", + }), + (string) (len=9) "fromIndex": (*main.Field)(0xc000122d80)({ + name: (string) (len=9) "fromIndex", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -1613,16 +1718,10 @@ isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }) - } - }), - (string) (len=19) "OpenChannelResponse": (*main.Message)(0xc0003ff530)({ - fullName: (string) (len=19) "OpenChannelResponse", - name: (string) (len=19) "OpenChannelResponse", - fields: (map[string]*main.Field) (len=1) { - (string) (len=9) "channelId": (*main.Field)(0xc000463080)({ - name: (string) (len=9) "channelId", - kind: (string) (len=6) "string", + }), + (string) (len=7) "toIndex": (*main.Field)(0xc000122dc0)({ + name: (string) (len=7) "toIndex", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -1632,15 +1731,15 @@ }) } }), - (string) (len=15) "RelaysMigration": (*main.Message)(0xc0003ffb30)({ - fullName: (string) (len=15) "RelaysMigration", - name: (string) (len=15) "RelaysMigration", + (string) (len=30) "RequestNPubLinkingTokenRequest": (*main.Message)(0xc0003790e0)({ + fullName: (string) (len=30) "RequestNPubLinkingTokenRequest", + name: (string) (len=30) "RequestNPubLinkingTokenRequest", fields: (map[string]*main.Field) (len=1) { - (string) (len=6) "relays": (*main.Field)(0xc0000b0080)({ - name: (string) (len=6) "relays", + (string) (len=15) "user_identifier": (*main.Field)(0xc0001239c0)({ + name: (string) (len=15) "user_identifier", kind: (string) (len=6) "string", isMap: (bool) false, - isArray: (bool) true, + isArray: (bool) false, isEnum: (bool) false, isMessage: (bool) false, isOptional: (bool) false, @@ -1648,12 +1747,12 @@ }) } }), - (string) (len=30) "RequestNPubLinkingTokenRequest": (*main.Message)(0xc0003ffb90)({ - fullName: (string) (len=30) "RequestNPubLinkingTokenRequest", - name: (string) (len=30) "RequestNPubLinkingTokenRequest", + (string) (len=20) "UseInviteLinkRequest": (*main.Message)(0xc000379380)({ + fullName: (string) (len=20) "UseInviteLinkRequest", + name: (string) (len=20) "UseInviteLinkRequest", fields: (map[string]*main.Field) (len=1) { - (string) (len=15) "user_identifier": (*main.Field)(0xc0000b0180)({ - name: (string) (len=15) "user_identifier", + (string) (len=12) "invite_token": (*main.Field)(0xc00037c100)({ + name: (string) (len=12) "invite_token", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -1664,13 +1763,13 @@ }) } }), - (string) (len=27) "LinkNPubThroughTokenRequest": (*main.Message)(0xc0003ffc50)({ - fullName: (string) (len=27) "LinkNPubThroughTokenRequest", - name: (string) (len=27) "LinkNPubThroughTokenRequest", - fields: (map[string]*main.Field) (len=2) { - (string) (len=5) "token": (*main.Field)(0xc0000b0640)({ - name: (string) (len=5) "token", - kind: (string) (len=6) "string", + (string) (len=9) "UsersInfo": (*main.Message)(0xc0002705d0)({ + fullName: (string) (len=9) "UsersInfo", + name: (string) (len=9) "UsersInfo", + fields: (map[string]*main.Field) (len=6) { + (string) (len=11) "balance_avg": (*main.Field)(0xc000038a00)({ + name: (string) (len=11) "balance_avg", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -1678,41 +1777,29 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=9) "nostr_pub": (*main.Field)(0xc0000b0680)({ - name: (string) (len=9) "nostr_pub", - kind: (string) (len=6) "string", + (string) (len=14) "balance_median": (*main.Field)(0xc000038a40)({ + 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, oneOfName: (string) "" - }) - } - }), - (string) (len=10) "LndMetrics": (*main.Message)(0xc0003fe8d0)({ - fullName: (string) (len=10) "LndMetrics", - name: (string) (len=10) "LndMetrics", - fields: (map[string]*main.Field) (len=1) { - (string) (len=5) "nodes": (*main.Field)(0xc00031fdc0)({ - name: (string) (len=5) "nodes", - kind: (string) (len=14) "LndNodeMetrics", + }), + (string) (len=5) "total": (*main.Field)(0xc000038900)({ + name: (string) (len=5) "total", + kind: (string) (len=5) "int64", isMap: (bool) false, - isArray: (bool) true, + isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) true, + isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }) - } - }), - (string) (len=7) "AppUser": (*main.Message)(0xc0003fed50)({ - fullName: (string) (len=7) "AppUser", - name: (string) (len=7) "AppUser", - fields: (map[string]*main.Field) (len=3) { - (string) (len=10) "identifier": (*main.Field)(0xc000462440)({ - name: (string) (len=10) "identifier", - kind: (string) (len=6) "string", + }), + (string) (len=10) "no_balance": (*main.Field)(0xc000038940)({ + name: (string) (len=10) "no_balance", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -1720,18 +1807,18 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=4) "info": (*main.Field)(0xc000462480)({ - name: (string) (len=4) "info", - kind: (string) (len=8) "UserInfo", + (string) (len=16) "negative_balance": (*main.Field)(0xc000038980)({ + name: (string) (len=16) "negative_balance", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) true, + isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=16) "max_withdrawable": (*main.Field)(0xc0004624c0)({ - name: (string) (len=16) "max_withdrawable", + (string) (len=20) "always_been_inactive": (*main.Field)(0xc0000389c0)({ + name: (string) (len=20) "always_been_inactive", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -1742,13 +1829,13 @@ }) } }), - (string) (len=20) "AddAppInvoiceRequest": (*main.Message)(0xc0003fedb0)({ - fullName: (string) (len=20) "AddAppInvoiceRequest", - name: (string) (len=20) "AddAppInvoiceRequest", - fields: (map[string]*main.Field) (len=3) { - (string) (len=16) "payer_identifier": (*main.Field)(0xc000462500)({ - name: (string) (len=16) "payer_identifier", - kind: (string) (len=6) "string", + (string) (len=19) "ChannelBalanceEvent": (*main.Message)(0xc000271350)({ + fullName: (string) (len=19) "ChannelBalanceEvent", + name: (string) (len=19) "ChannelBalanceEvent", + fields: (map[string]*main.Field) (len=4) { + (string) (len=18) "local_balance_sats": (*main.Field)(0xc000039100)({ + name: (string) (len=18) "local_balance_sats", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -1756,9 +1843,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=17) "http_callback_url": (*main.Field)(0xc000462540)({ - name: (string) (len=17) "http_callback_url", - kind: (string) (len=6) "string", + (string) (len=19) "remote_balance_sats": (*main.Field)(0xc000039140)({ + name: (string) (len=19) "remote_balance_sats", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -1766,24 +1853,34 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=11) "invoice_req": (*main.Field)(0xc000462580)({ - name: (string) (len=11) "invoice_req", - kind: (string) (len=17) "NewInvoiceRequest", + (string) (len=12) "block_height": (*main.Field)(0xc000039080)({ + name: (string) (len=12) "block_height", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) true, + isMessage: (bool) false, + isOptional: (bool) false, + oneOfName: (string) "" + }), + (string) (len=10) "channel_id": (*main.Field)(0xc0000390c0)({ + 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, oneOfName: (string) "" }) } }), - (string) (len=14) "UserOperations": (*main.Message)(0xc0003ff830)({ - fullName: (string) (len=14) "UserOperations", - name: (string) (len=14) "UserOperations", - fields: (map[string]*main.Field) (len=3) { - (string) (len=9) "fromIndex": (*main.Field)(0xc000463bc0)({ - name: (string) (len=9) "fromIndex", + (string) (len=17) "ChainBalanceEvent": (*main.Message)(0xc0002713b0)({ + fullName: (string) (len=17) "ChainBalanceEvent", + name: (string) (len=17) "ChainBalanceEvent", + fields: (map[string]*main.Field) (len=4) { + (string) (len=12) "block_height": (*main.Field)(0xc000039180)({ + name: (string) (len=12) "block_height", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -1792,8 +1889,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=7) "toIndex": (*main.Field)(0xc000463c00)({ - name: (string) (len=7) "toIndex", + (string) (len=17) "confirmed_balance": (*main.Field)(0xc0000391c0)({ + name: (string) (len=17) "confirmed_balance", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -1802,24 +1899,34 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=10) "operations": (*main.Field)(0xc000463c40)({ - name: (string) (len=10) "operations", - kind: (string) (len=13) "UserOperation", + (string) (len=19) "unconfirmed_balance": (*main.Field)(0xc000039200)({ + name: (string) (len=19) "unconfirmed_balance", + kind: (string) (len=5) "int64", isMap: (bool) false, - isArray: (bool) true, + isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) true, + isMessage: (bool) false, + isOptional: (bool) false, + oneOfName: (string) "" + }), + (string) (len=13) "total_balance": (*main.Field)(0xc000039240)({ + 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, oneOfName: (string) "" }) } }), - (string) (len=14) "BanUserRequest": (*main.Message)(0xc0003fea50)({ - fullName: (string) (len=14) "BanUserRequest", - name: (string) (len=14) "BanUserRequest", - fields: (map[string]*main.Field) (len=1) { - (string) (len=7) "user_id": (*main.Field)(0xc00031ff00)({ - name: (string) (len=7) "user_id", + (string) (len=26) "GetAppUserLNURLInfoRequest": (*main.Message)(0xc000378540)({ + fullName: (string) (len=26) "GetAppUserLNURLInfoRequest", + name: (string) (len=26) "GetAppUserLNURLInfoRequest", + fields: (map[string]*main.Field) (len=2) { + (string) (len=15) "user_identifier": (*main.Field)(0xc000286fc0)({ + name: (string) (len=15) "user_identifier", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -1827,31 +1934,25 @@ isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }) - } - }), - (string) (len=17) "NewAddressRequest": (*main.Message)(0xc0003ff110)({ - fullName: (string) (len=17) "NewAddressRequest", - name: (string) (len=17) "NewAddressRequest", - fields: (map[string]*main.Field) (len=1) { - (string) (len=11) "addressType": (*main.Field)(0xc000462a40)({ - name: (string) (len=11) "addressType", - kind: (string) (len=11) "AddressType", + }), + (string) (len=17) "base_url_override": (*main.Field)(0xc000287080)({ + name: (string) (len=17) "base_url_override", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, - isEnum: (bool) true, + isEnum: (bool) false, isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" }) } }), - (string) (len=20) "DecodeInvoiceRequest": (*main.Message)(0xc0003ff350)({ - fullName: (string) (len=20) "DecodeInvoiceRequest", - name: (string) (len=20) "DecodeInvoiceRequest", + (string) (len=19) "OpenChannelResponse": (*main.Message)(0xc000378a80)({ + fullName: (string) (len=19) "OpenChannelResponse", + name: (string) (len=19) "OpenChannelResponse", fields: (map[string]*main.Field) (len=1) { - (string) (len=7) "invoice": (*main.Field)(0xc000462d40)({ - name: (string) (len=7) "invoice", + (string) (len=9) "channelId": (*main.Field)(0xc000287b00)({ + name: (string) (len=9) "channelId", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -1862,12 +1963,12 @@ }) } }), - (string) (len=25) "LnurlWithdrawInfoResponse": (*main.Message)(0xc0003ff5f0)({ - fullName: (string) (len=25) "LnurlWithdrawInfoResponse", - name: (string) (len=25) "LnurlWithdrawInfoResponse", - fields: (map[string]*main.Field) (len=8) { - (string) (len=8) "callback": (*main.Field)(0xc000463180)({ - name: (string) (len=8) "callback", + (string) (len=17) "AddProductRequest": (*main.Message)(0xc000378e40)({ + fullName: (string) (len=17) "AddProductRequest", + name: (string) (len=17) "AddProductRequest", + fields: (map[string]*main.Field) (len=2) { + (string) (len=4) "name": (*main.Field)(0xc000123000)({ + name: (string) (len=4) "name", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -1876,68 +1977,86 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=2) "k1": (*main.Field)(0xc0004631c0)({ - name: (string) (len=2) "k1", - kind: (string) (len=6) "string", + (string) (len=10) "price_sats": (*main.Field)(0xc000123080)({ + 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, oneOfName: (string) "" - }), - (string) (len=18) "defaultDescription": (*main.Field)(0xc000463200)({ - name: (string) (len=18) "defaultDescription", - kind: (string) (len=6) "string", + }) + } + }), + (string) (len=18) "AppsMetricsRequest": (*main.Message)(0xc000270570)({ + fullName: (string) (len=18) "AppsMetricsRequest", + name: (string) (len=18) "AppsMetricsRequest", + fields: (map[string]*main.Field) (len=3) { + (string) (len=7) "to_unix": (*main.Field)(0xc000038880)({ + 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) false, + isOptional: (bool) true, oneOfName: (string) "" }), - (string) (len=15) "minWithdrawable": (*main.Field)(0xc000463240)({ - name: (string) (len=15) "minWithdrawable", - kind: (string) (len=5) "int64", + (string) (len=18) "include_operations": (*main.Field)(0xc0000388c0)({ + 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) false, + isOptional: (bool) true, oneOfName: (string) "" }), - (string) (len=15) "maxWithdrawable": (*main.Field)(0xc000463280)({ - name: (string) (len=15) "maxWithdrawable", + (string) (len=9) "from_unix": (*main.Field)(0xc000038840)({ + 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) false, + isOptional: (bool) true, oneOfName: (string) "" - }), - (string) (len=12) "balanceCheck": (*main.Field)(0xc0004632c0)({ - name: (string) (len=12) "balanceCheck", - kind: (string) (len=6) "string", + }) + } + }), + (string) (len=17) "LndMetricsRequest": (*main.Message)(0xc000270c60)({ + fullName: (string) (len=17) "LndMetricsRequest", + name: (string) (len=17) "LndMetricsRequest", + fields: (map[string]*main.Field) (len=2) { + (string) (len=9) "from_unix": (*main.Field)(0xc000038d00)({ + 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) false, + isOptional: (bool) true, oneOfName: (string) "" }), - (string) (len=7) "payLink": (*main.Field)(0xc000463300)({ - name: (string) (len=7) "payLink", - kind: (string) (len=6) "string", + (string) (len=7) "to_unix": (*main.Field)(0xc000038d40)({ + 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) false, + isOptional: (bool) true, oneOfName: (string) "" - }), - (string) (len=3) "tag": (*main.Field)(0xc000463140)({ - name: (string) (len=3) "tag", + }) + } + }), + (string) (len=17) "GetAppUserRequest": (*main.Message)(0xc0003783c0)({ + fullName: (string) (len=17) "GetAppUserRequest", + name: (string) (len=17) "GetAppUserRequest", + fields: (map[string]*main.Field) (len=1) { + (string) (len=15) "user_identifier": (*main.Field)(0xc000286700)({ + name: (string) (len=15) "user_identifier", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -1948,23 +2067,29 @@ }) } }), - (string) (len=24) "GetUserOperationsRequest": (*main.Message)(0xc0003ff770)({ - fullName: (string) (len=24) "GetUserOperationsRequest", - name: (string) (len=24) "GetUserOperationsRequest", - fields: (map[string]*main.Field) (len=7) { - (string) (len=21) "latestIncomingInvoice": (*main.Field)(0xc000463740)({ - name: (string) (len=21) "latestIncomingInvoice", - kind: (string) (len=5) "int64", + (string) (len=18) "NewAddressResponse": (*main.Message)(0xc0003786c0)({ + fullName: (string) (len=18) "NewAddressResponse", + name: (string) (len=18) "NewAddressResponse", + fields: (map[string]*main.Field) (len=1) { + (string) (len=7) "address": (*main.Field)(0xc000287380)({ + 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, oneOfName: (string) "" - }), - (string) (len=21) "latestOutgoingInvoice": (*main.Field)(0xc000463780)({ - name: (string) (len=21) "latestOutgoingInvoice", - kind: (string) (len=5) "int64", + }) + } + }), + (string) (len=13) "UserOperation": (*main.Message)(0xc000378d20)({ + fullName: (string) (len=13) "UserOperation", + name: (string) (len=13) "UserOperation", + fields: (map[string]*main.Field) (len=11) { + (string) (len=9) "confirmed": (*main.Field)(0xc000122cc0)({ + name: (string) (len=9) "confirmed", + kind: (string) (len=4) "bool", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -1972,8 +2097,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=16) "latestIncomingTx": (*main.Field)(0xc0004637c0)({ - name: (string) (len=16) "latestIncomingTx", + (string) (len=10) "paidAtUnix": (*main.Field)(0xc000122900)({ + name: (string) (len=10) "paidAtUnix", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -1982,9 +2107,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=16) "latestOutgoingTx": (*main.Field)(0xc000463800)({ - name: (string) (len=16) "latestOutgoingTx", - kind: (string) (len=5) "int64", + (string) (len=7) "inbound": (*main.Field)(0xc000122a80)({ + name: (string) (len=7) "inbound", + kind: (string) (len=4) "bool", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -1992,8 +2117,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=31) "latestIncomingUserToUserPayment": (*main.Field)(0xc000463840)({ - name: (string) (len=31) "latestIncomingUserToUserPayment", + (string) (len=6) "amount": (*main.Field)(0xc000122ac0)({ + name: (string) (len=6) "amount", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -2002,9 +2127,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=31) "latestOutgoingUserToUserPayment": (*main.Field)(0xc000463880)({ - name: (string) (len=31) "latestOutgoingUserToUserPayment", - kind: (string) (len=5) "int64", + (string) (len=10) "identifier": (*main.Field)(0xc000122b00)({ + name: (string) (len=10) "identifier", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2012,8 +2137,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=8) "max_size": (*main.Field)(0xc0004638c0)({ - name: (string) (len=8) "max_size", + (string) (len=11) "service_fee": (*main.Field)(0xc000122b80)({ + name: (string) (len=11) "service_fee", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -2021,15 +2146,9 @@ isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }) - } - }), - (string) (len=10) "AppMetrics": (*main.Message)(0xc0003fe510)({ - fullName: (string) (len=10) "AppMetrics", - name: (string) (len=10) "AppMetrics", - fields: (map[string]*main.Field) (len=9) { - (string) (len=8) "received": (*main.Field)(0xc00031ef40)({ - name: (string) (len=8) "received", + }), + (string) (len=11) "network_fee": (*main.Field)(0xc000122bc0)({ + name: (string) (len=11) "network_fee", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -2038,39 +2157,29 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=10) "operations": (*main.Field)(0xc00031f0c0)({ - 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, - oneOfName: (string) "" - }), - (string) (len=3) "app": (*main.Field)(0xc00031eec0)({ - name: (string) (len=3) "app", - kind: (string) (len=11) "Application", + (string) (len=4) "type": (*main.Field)(0xc000122940)({ + name: (string) (len=4) "type", + kind: (string) (len=17) "UserOperationType", isMap: (bool) false, isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, + isEnum: (bool) true, + isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=5) "users": (*main.Field)(0xc00031ef00)({ - name: (string) (len=5) "users", - kind: (string) (len=9) "UsersInfo", + (string) (len=11) "operationId": (*main.Field)(0xc000122b40)({ + name: (string) (len=11) "operationId", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) true, + isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=5) "spent": (*main.Field)(0xc00031ef80)({ - name: (string) (len=5) "spent", - kind: (string) (len=5) "int64", + (string) (len=7) "tx_hash": (*main.Field)(0xc000122d00)({ + name: (string) (len=7) "tx_hash", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2078,38 +2187,50 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=9) "available": (*main.Field)(0xc00031efc0)({ - name: (string) (len=9) "available", - kind: (string) (len=5) "int64", + (string) (len=8) "internal": (*main.Field)(0xc000122d40)({ + 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, oneOfName: (string) "" - }), - (string) (len=4) "fees": (*main.Field)(0xc00031f000)({ - name: (string) (len=4) "fees", - kind: (string) (len=5) "int64", + }) + } + }), + (string) (len=31) "RequestNPubLinkingTokenResponse": (*main.Message)(0xc000379140)({ + fullName: (string) (len=31) "RequestNPubLinkingTokenResponse", + name: (string) (len=31) "RequestNPubLinkingTokenResponse", + fields: (map[string]*main.Field) (len=1) { + (string) (len=5) "token": (*main.Field)(0xc000123a40)({ + 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, oneOfName: (string) "" - }), - (string) (len=8) "invoices": (*main.Field)(0xc00031f040)({ - name: (string) (len=8) "invoices", - kind: (string) (len=5) "int64", + }) + } + }), + (string) (len=15) "BanUserResponse": (*main.Message)(0xc000378060)({ + fullName: (string) (len=15) "BanUserResponse", + name: (string) (len=15) "BanUserResponse", + fields: (map[string]*main.Field) (len=2) { + (string) (len=16) "banned_app_users": (*main.Field)(0xc000039c40)({ + name: (string) (len=16) "banned_app_users", + kind: (string) (len=13) "BannedAppUser", isMap: (bool) false, - isArray: (bool) false, + isArray: (bool) true, isEnum: (bool) false, - isMessage: (bool) false, + isMessage: (bool) true, isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=10) "total_fees": (*main.Field)(0xc00031f080)({ - name: (string) (len=10) "total_fees", + (string) (len=12) "balance_sats": (*main.Field)(0xc000039c00)({ + name: (string) (len=12) "balance_sats", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -2120,12 +2241,12 @@ }) } }), - (string) (len=13) "AddAppRequest": (*main.Message)(0xc0003feb70)({ - fullName: (string) (len=13) "AddAppRequest", - name: (string) (len=13) "AddAppRequest", + (string) (len=30) "SendAppUserToAppPaymentRequest": (*main.Message)(0xc0003784e0)({ + fullName: (string) (len=30) "SendAppUserToAppPaymentRequest", + name: (string) (len=30) "SendAppUserToAppPaymentRequest", fields: (map[string]*main.Field) (len=2) { - (string) (len=4) "name": (*main.Field)(0xc000462100)({ - name: (string) (len=4) "name", + (string) (len=20) "from_user_identifier": (*main.Field)(0xc000286f40)({ + name: (string) (len=20) "from_user_identifier", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -2134,9 +2255,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=19) "allow_user_creation": (*main.Field)(0xc000462140)({ - name: (string) (len=19) "allow_user_creation", - kind: (string) (len=4) "bool", + (string) (len=6) "amount": (*main.Field)(0xc000286f80)({ + name: (string) (len=6) "amount", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2146,22 +2267,12 @@ }) } }), - (string) (len=34) "SendAppUserToAppUserPaymentRequest": (*main.Message)(0xc0003fef30)({ - fullName: (string) (len=34) "SendAppUserToAppUserPaymentRequest", - name: (string) (len=34) "SendAppUserToAppUserPaymentRequest", - fields: (map[string]*main.Field) (len=3) { - (string) (len=20) "from_user_identifier": (*main.Field)(0xc0004627c0)({ - 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, - oneOfName: (string) "" - }), - (string) (len=18) "to_user_identifier": (*main.Field)(0xc000462800)({ - name: (string) (len=18) "to_user_identifier", + (string) (len=22) "HandleLnurlPayResponse": (*main.Message)(0xc000378c00)({ + fullName: (string) (len=22) "HandleLnurlPayResponse", + name: (string) (len=22) "HandleLnurlPayResponse", + fields: (map[string]*main.Field) (len=2) { + (string) (len=2) "pr": (*main.Field)(0xc000287f80)({ + name: (string) (len=2) "pr", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -2170,25 +2281,25 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=6) "amount": (*main.Field)(0xc000462840)({ - name: (string) (len=6) "amount", - kind: (string) (len=5) "int64", + (string) (len=6) "routes": (*main.Field)(0xc000287fc0)({ + name: (string) (len=6) "routes", + kind: (string) (len=5) "Empty", isMap: (bool) false, - isArray: (bool) false, + isArray: (bool) true, isEnum: (bool) false, - isMessage: (bool) false, + isMessage: (bool) true, isOptional: (bool) false, oneOfName: (string) "" }) } }), - (string) (len=20) "LnurlPayInfoResponse": (*main.Message)(0xc0003ff650)({ - fullName: (string) (len=20) "LnurlPayInfoResponse", - name: (string) (len=20) "LnurlPayInfoResponse", + (string) (len=24) "GetUserOperationsRequest": (*main.Message)(0xc000378cc0)({ + fullName: (string) (len=24) "GetUserOperationsRequest", + name: (string) (len=24) "GetUserOperationsRequest", fields: (map[string]*main.Field) (len=7) { - (string) (len=11) "allowsNostr": (*main.Field)(0xc000463480)({ - name: (string) (len=11) "allowsNostr", - kind: (string) (len=4) "bool", + (string) (len=16) "latestOutgoingTx": (*main.Field)(0xc000122800)({ + name: (string) (len=16) "latestOutgoingTx", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2196,9 +2307,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=11) "nostrPubkey": (*main.Field)(0xc0004634c0)({ - name: (string) (len=11) "nostrPubkey", - kind: (string) (len=6) "string", + (string) (len=31) "latestIncomingUserToUserPayment": (*main.Field)(0xc000122840)({ + name: (string) (len=31) "latestIncomingUserToUserPayment", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2206,9 +2317,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=3) "tag": (*main.Field)(0xc000463340)({ - name: (string) (len=3) "tag", - kind: (string) (len=6) "string", + (string) (len=31) "latestOutgoingUserToUserPayment": (*main.Field)(0xc000122880)({ + name: (string) (len=31) "latestOutgoingUserToUserPayment", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2216,9 +2327,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=8) "callback": (*main.Field)(0xc000463380)({ - name: (string) (len=8) "callback", - kind: (string) (len=6) "string", + (string) (len=8) "max_size": (*main.Field)(0xc0001228c0)({ + name: (string) (len=8) "max_size", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2226,8 +2337,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=11) "maxSendable": (*main.Field)(0xc0004633c0)({ - name: (string) (len=11) "maxSendable", + (string) (len=21) "latestIncomingInvoice": (*main.Field)(0xc0001226c0)({ + name: (string) (len=21) "latestIncomingInvoice", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -2236,8 +2347,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=11) "minSendable": (*main.Field)(0xc000463400)({ - name: (string) (len=11) "minSendable", + (string) (len=21) "latestOutgoingInvoice": (*main.Field)(0xc000122700)({ + name: (string) (len=21) "latestOutgoingInvoice", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -2246,9 +2357,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=8) "metadata": (*main.Field)(0xc000463440)({ - name: (string) (len=8) "metadata", - kind: (string) (len=6) "string", + (string) (len=16) "latestIncomingTx": (*main.Field)(0xc0001227c0)({ + name: (string) (len=16) "latestIncomingTx", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2258,12 +2369,12 @@ }) } }), - (string) (len=22) "HandleLnurlPayResponse": (*main.Message)(0xc0003ff6b0)({ - fullName: (string) (len=22) "HandleLnurlPayResponse", - name: (string) (len=22) "HandleLnurlPayResponse", - fields: (map[string]*main.Field) (len=2) { - (string) (len=2) "pr": (*main.Field)(0xc000463500)({ - name: (string) (len=2) "pr", + (string) (len=18) "PayInvoiceResponse": (*main.Message)(0xc0003789c0)({ + fullName: (string) (len=18) "PayInvoiceResponse", + name: (string) (len=18) "PayInvoiceResponse", + fields: (map[string]*main.Field) (len=5) { + (string) (len=8) "preimage": (*main.Field)(0xc0002878c0)({ + name: (string) (len=8) "preimage", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -2272,24 +2383,18 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=6) "routes": (*main.Field)(0xc000463540)({ - name: (string) (len=6) "routes", - kind: (string) (len=5) "Empty", + (string) (len=11) "amount_paid": (*main.Field)(0xc000287900)({ + name: (string) (len=11) "amount_paid", + kind: (string) (len=5) "int64", isMap: (bool) false, - isArray: (bool) true, + isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) true, + isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }) - } - }), - (string) (len=23) "EnrollAdminTokenRequest": (*main.Message)(0xc0003ffd10)({ - fullName: (string) (len=23) "EnrollAdminTokenRequest", - name: (string) (len=23) "EnrollAdminTokenRequest", - fields: (map[string]*main.Field) (len=1) { - (string) (len=11) "admin_token": (*main.Field)(0xc0000b07c0)({ - name: (string) (len=11) "admin_token", + }), + (string) (len=12) "operation_id": (*main.Field)(0xc000287940)({ + name: (string) (len=12) "operation_id", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -2297,32 +2402,10 @@ isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }) - } - }), - (string) (len=12) "UsageMetrics": (*main.Message)(0xc0003fe3f0)({ - fullName: (string) (len=12) "UsageMetrics", - name: (string) (len=12) "UsageMetrics", - fields: (map[string]*main.Field) (len=1) { - (string) (len=7) "metrics": (*main.Field)(0xc00031ec00)({ - name: (string) (len=7) "metrics", - kind: (string) (len=11) "UsageMetric", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false, - oneOfName: (string) "" - }) - } - }), - (string) (len=17) "LnurlLinkResponse": (*main.Message)(0xc0003ff590)({ - fullName: (string) (len=17) "LnurlLinkResponse", - name: (string) (len=17) "LnurlLinkResponse", - fields: (map[string]*main.Field) (len=2) { - (string) (len=5) "lnurl": (*main.Field)(0xc0004630c0)({ - name: (string) (len=5) "lnurl", - kind: (string) (len=6) "string", + }), + (string) (len=11) "service_fee": (*main.Field)(0xc000287980)({ + name: (string) (len=11) "service_fee", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2330,9 +2413,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=2) "k1": (*main.Field)(0xc000463100)({ - name: (string) (len=2) "k1", - kind: (string) (len=6) "string", + (string) (len=11) "network_fee": (*main.Field)(0xc0002879c0)({ + name: (string) (len=11) "network_fee", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2342,11 +2425,11 @@ }) } }), - (string) (len=17) "LiveUserOperation": (*main.Message)(0xc0003ffa10)({ + (string) (len=17) "LiveUserOperation": (*main.Message)(0xc000378f60)({ fullName: (string) (len=17) "LiveUserOperation", name: (string) (len=17) "LiveUserOperation", fields: (map[string]*main.Field) (len=1) { - (string) (len=9) "operation": (*main.Field)(0xc000463f80)({ + (string) (len=9) "operation": (*main.Field)(0xc0001232c0)({ name: (string) (len=9) "operation", kind: (string) (len=13) "UserOperation", isMap: (bool) false, @@ -2358,22 +2441,12 @@ }) } }), - (string) (len=17) "PayInvoiceRequest": (*main.Message)(0xc0003ff410)({ - fullName: (string) (len=17) "PayInvoiceRequest", - name: (string) (len=17) "PayInvoiceRequest", - fields: (map[string]*main.Field) (len=2) { - (string) (len=7) "invoice": (*main.Field)(0xc000462dc0)({ - 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, - oneOfName: (string) "" - }), - (string) (len=6) "amount": (*main.Field)(0xc000462e00)({ - name: (string) (len=6) "amount", + (string) (len=16) "ClosureMigration": (*main.Message)(0xc000379020)({ + fullName: (string) (len=16) "ClosureMigration", + name: (string) (len=16) "ClosureMigration", + fields: (map[string]*main.Field) (len=1) { + (string) (len=14) "closes_at_unix": (*main.Field)(0xc0001234c0)({ + name: (string) (len=14) "closes_at_unix", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -2384,13 +2457,13 @@ }) } }), - (string) (len=25) "GetProductBuyLinkResponse": (*main.Message)(0xc0003ff9b0)({ - fullName: (string) (len=25) "GetProductBuyLinkResponse", - name: (string) (len=25) "GetProductBuyLinkResponse", + (string) (len=27) "GetInviteTokenStateResponse": (*main.Message)(0xc000379440)({ + fullName: (string) (len=27) "GetInviteTokenStateResponse", + name: (string) (len=27) "GetInviteTokenStateResponse", fields: (map[string]*main.Field) (len=1) { - (string) (len=4) "link": (*main.Field)(0xc000463f40)({ - name: (string) (len=4) "link", - kind: (string) (len=6) "string", + (string) (len=4) "used": (*main.Field)(0xc00037c180)({ + name: (string) (len=4) "used", + kind: (string) (len=4) "bool", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2400,33 +2473,33 @@ }) } }), - (string) (len=14) "LndNodeMetrics": (*main.Message)(0xc0003fe870)({ - fullName: (string) (len=14) "LndNodeMetrics", - name: (string) (len=14) "LndNodeMetrics", - fields: (map[string]*main.Field) (len=9) { - (string) (len=23) "channels_balance_events": (*main.Field)(0xc00031fb80)({ - name: (string) (len=23) "channels_balance_events", - kind: (string) (len=19) "ChannelBalanceEvent", + (string) (len=12) "RoutingEvent": (*main.Message)(0xc000270cc0)({ + fullName: (string) (len=12) "RoutingEvent", + name: (string) (len=12) "RoutingEvent", + fields: (map[string]*main.Field) (len=12) { + (string) (len=19) "outgoing_channel_id": (*main.Field)(0xc000038e00)({ + name: (string) (len=19) "outgoing_channel_id", + kind: (string) (len=5) "int64", isMap: (bool) false, - isArray: (bool) true, + isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) true, + isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=20) "chain_balance_events": (*main.Field)(0xc00031fbc0)({ - name: (string) (len=20) "chain_balance_events", - kind: (string) (len=17) "ChainBalanceEvent", + (string) (len=12) "timestamp_ns": (*main.Field)(0xc000038e80)({ + name: (string) (len=12) "timestamp_ns", + kind: (string) (len=5) "int64", isMap: (bool) false, - isArray: (bool) true, + isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) true, + isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=15) "online_channels": (*main.Field)(0xc00031fc40)({ - name: (string) (len=15) "online_channels", - kind: (string) (len=5) "int64", + (string) (len=7) "settled": (*main.Field)(0xc000038fc0)({ + name: (string) (len=7) "settled", + kind: (string) (len=4) "bool", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2434,9 +2507,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=16) "closing_channels": (*main.Field)(0xc00031fcc0)({ - name: (string) (len=16) "closing_channels", - kind: (string) (len=5) "int64", + (string) (len=8) "offchain": (*main.Field)(0xc000039000)({ + name: (string) (len=8) "offchain", + kind: (string) (len=4) "bool", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2444,9 +2517,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=16) "offline_channels": (*main.Field)(0xc00031fc00)({ - name: (string) (len=16) "offline_channels", - kind: (string) (len=5) "int64", + (string) (len=18) "forward_fail_event": (*main.Field)(0xc000039040)({ + name: (string) (len=18) "forward_fail_event", + kind: (string) (len=4) "bool", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2454,8 +2527,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=16) "pending_channels": (*main.Field)(0xc00031fc80)({ - name: (string) (len=16) "pending_channels", + (string) (len=19) "incoming_channel_id": (*main.Field)(0xc000038d80)({ + name: (string) (len=19) "incoming_channel_id", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -2464,70 +2537,48 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=13) "open_channels": (*main.Field)(0xc00031fd00)({ - name: (string) (len=13) "open_channels", - kind: (string) (len=11) "OpenChannel", + (string) (len=16) "outgoing_htlc_id": (*main.Field)(0xc000038e40)({ + name: (string) (len=16) "outgoing_htlc_id", + kind: (string) (len=5) "int64", isMap: (bool) false, - isArray: (bool) true, + isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) true, + isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=15) "closed_channels": (*main.Field)(0xc00031fd40)({ - name: (string) (len=15) "closed_channels", - kind: (string) (len=13) "ClosedChannel", + (string) (len=10) "event_type": (*main.Field)(0xc000038ec0)({ + name: (string) (len=10) "event_type", + kind: (string) (len=6) "string", isMap: (bool) false, - isArray: (bool) true, + isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) true, + isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=15) "channel_routing": (*main.Field)(0xc00031fd80)({ - 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, - oneOfName: (string) "" - }) - } - }), - (string) (len=7) "AuthApp": (*main.Message)(0xc0003fec90)({ - fullName: (string) (len=7) "AuthApp", - name: (string) (len=7) "AuthApp", - fields: (map[string]*main.Field) (len=2) { - (string) (len=3) "app": (*main.Field)(0xc000462300)({ - name: (string) (len=3) "app", - kind: (string) (len=11) "Application", + (string) (len=17) "incoming_amt_msat": (*main.Field)(0xc000038f00)({ + name: (string) (len=17) "incoming_amt_msat", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) true, + isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=10) "auth_token": (*main.Field)(0xc000462340)({ - name: (string) (len=10) "auth_token", - kind: (string) (len=6) "string", + (string) (len=17) "outgoing_amt_msat": (*main.Field)(0xc000038f40)({ + 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, oneOfName: (string) "" - }) - } - }), - (string) (len=26) "GetAppUserLNURLInfoRequest": (*main.Message)(0xc0003feff0)({ - fullName: (string) (len=26) "GetAppUserLNURLInfoRequest", - name: (string) (len=26) "GetAppUserLNURLInfoRequest", - fields: (map[string]*main.Field) (len=2) { - (string) (len=15) "user_identifier": (*main.Field)(0xc000462900)({ - name: (string) (len=15) "user_identifier", + }), + (string) (len=14) "failure_string": (*main.Field)(0xc000038f80)({ + name: (string) (len=14) "failure_string", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -2536,9 +2587,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=17) "base_url_override": (*main.Field)(0xc000462940)({ - name: (string) (len=17) "base_url_override", - kind: (string) (len=6) "string", + (string) (len=16) "incoming_htlc_id": (*main.Field)(0xc000038dc0)({ + name: (string) (len=16) "incoming_htlc_id", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2548,12 +2599,12 @@ }) } }), - (string) (len=8) "UserInfo": (*main.Message)(0xc0003ff710)({ - fullName: (string) (len=8) "UserInfo", - name: (string) (len=8) "UserInfo", - fields: (map[string]*main.Field) (len=7) { - (string) (len=6) "userId": (*main.Field)(0xc000463580)({ - name: (string) (len=6) "userId", + (string) (len=18) "LndGetInfoResponse": (*main.Message)(0xc000271d40)({ + fullName: (string) (len=18) "LndGetInfoResponse", + name: (string) (len=18) "LndGetInfoResponse", + fields: (map[string]*main.Field) (len=1) { + (string) (len=5) "alias": (*main.Field)(0xc000039a80)({ + name: (string) (len=5) "alias", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -2561,84 +2612,144 @@ isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }), - (string) (len=7) "balance": (*main.Field)(0xc0004635c0)({ - name: (string) (len=7) "balance", - kind: (string) (len=5) "int64", - isMap: (bool) false, + }) + } + }), + (string) (len=14) "AuthAppRequest": (*main.Message)(0xc000378120)({ + fullName: (string) (len=14) "AuthAppRequest", + name: (string) (len=14) "AuthAppRequest", + fields: (map[string]*main.Field) (len=2) { + (string) (len=4) "name": (*main.Field)(0xc000039d00)({ + 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, oneOfName: (string) "" }), - (string) (len=16) "max_withdrawable": (*main.Field)(0xc000463600)({ - name: (string) (len=16) "max_withdrawable", - kind: (string) (len=5) "int64", + (string) (len=19) "allow_user_creation": (*main.Field)(0xc000039d40)({ + 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, + oneOfName: (string) "" + }) + } + }), + (string) (len=17) "NewAddressRequest": (*main.Message)(0xc000378660)({ + fullName: (string) (len=17) "NewAddressRequest", + name: (string) (len=17) "NewAddressRequest", + fields: (map[string]*main.Field) (len=1) { + (string) (len=11) "addressType": (*main.Field)(0xc0002872c0)({ + 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, + oneOfName: (string) "" + }) + } + }), + (string) (len=5) "Empty": (*main.Message)(0xc000270000)({ + fullName: (string) (len=5) "Empty", + name: (string) (len=5) "Empty", + fields: (map[string]*main.Field) { + } + }), + (string) (len=25) "GetUserOperationsResponse": (*main.Message)(0xc000378de0)({ + fullName: (string) (len=25) "GetUserOperationsResponse", + name: (string) (len=25) "GetUserOperationsResponse", + fields: (map[string]*main.Field) (len=6) { + (string) (len=32) "latestIncomingUserToUserPayemnts": (*main.Field)(0xc000122fc0)({ + 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, oneOfName: (string) "" }), - (string) (len=15) "user_identifier": (*main.Field)(0xc000463640)({ - name: (string) (len=15) "user_identifier", - kind: (string) (len=6) "string", + (string) (len=31) "latestOutgoingInvoiceOperations": (*main.Field)(0xc000122e40)({ + name: (string) (len=31) "latestOutgoingInvoiceOperations", + kind: (string) (len=14) "UserOperations", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) false, + isMessage: (bool) true, isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=15) "service_fee_bps": (*main.Field)(0xc000463680)({ - name: (string) (len=15) "service_fee_bps", - kind: (string) (len=5) "int64", + (string) (len=31) "latestIncomingInvoiceOperations": (*main.Field)(0xc000122e80)({ + name: (string) (len=31) "latestIncomingInvoiceOperations", + kind: (string) (len=14) "UserOperations", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) false, + isMessage: (bool) true, isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=19) "network_max_fee_bps": (*main.Field)(0xc0004636c0)({ - name: (string) (len=19) "network_max_fee_bps", - kind: (string) (len=5) "int64", + (string) (len=26) "latestOutgoingTxOperations": (*main.Field)(0xc000122ec0)({ + name: (string) (len=26) "latestOutgoingTxOperations", + kind: (string) (len=14) "UserOperations", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) false, + isMessage: (bool) true, isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=21) "network_max_fee_fixed": (*main.Field)(0xc000463700)({ - name: (string) (len=21) "network_max_fee_fixed", - kind: (string) (len=5) "int64", + (string) (len=26) "latestIncomingTxOperations": (*main.Field)(0xc000122f00)({ + name: (string) (len=26) "latestIncomingTxOperations", + kind: (string) (len=14) "UserOperations", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false, + oneOfName: (string) "" + }), + (string) (len=32) "latestOutgoingUserToUserPayemnts": (*main.Field)(0xc000122f80)({ + 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, oneOfName: (string) "" }) } }), - (string) (len=13) "UserOperation": (*main.Message)(0xc0003ff7d0)({ - fullName: (string) (len=13) "UserOperation", - name: (string) (len=13) "UserOperation", - fields: (map[string]*main.Field) (len=11) { - (string) (len=7) "inbound": (*main.Field)(0xc000463980)({ - name: (string) (len=7) "inbound", - kind: (string) (len=4) "bool", + (string) (len=30) "CreateOneTimeInviteLinkRequest": (*main.Message)(0xc0003792c0)({ + fullName: (string) (len=30) "CreateOneTimeInviteLinkRequest", + name: (string) (len=30) "CreateOneTimeInviteLinkRequest", + fields: (map[string]*main.Field) (len=1) { + (string) (len=4) "sats": (*main.Field)(0xc00037c080)({ + name: (string) (len=4) "sats", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, isMessage: (bool) false, - isOptional: (bool) false, + isOptional: (bool) true, oneOfName: (string) "" - }), - (string) (len=6) "amount": (*main.Field)(0xc0004639c0)({ + }) + } + }), + (string) (len=24) "PayAppUserInvoiceRequest": (*main.Message)(0xc000378420)({ + fullName: (string) (len=24) "PayAppUserInvoiceRequest", + name: (string) (len=24) "PayAppUserInvoiceRequest", + fields: (map[string]*main.Field) (len=3) { + (string) (len=6) "amount": (*main.Field)(0xc000286880)({ name: (string) (len=6) "amount", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -2648,8 +2759,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=10) "identifier": (*main.Field)(0xc000463a00)({ - name: (string) (len=10) "identifier", + (string) (len=15) "user_identifier": (*main.Field)(0xc0002867c0)({ + name: (string) (len=15) "user_identifier", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -2658,8 +2769,24 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=11) "operationId": (*main.Field)(0xc000463a40)({ - name: (string) (len=11) "operationId", + (string) (len=7) "invoice": (*main.Field)(0xc000286840)({ + 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, + oneOfName: (string) "" + }) + } + }), + (string) (len=17) "PayInvoiceRequest": (*main.Message)(0xc000378960)({ + fullName: (string) (len=17) "PayInvoiceRequest", + name: (string) (len=17) "PayInvoiceRequest", + fields: (map[string]*main.Field) (len=2) { + (string) (len=7) "invoice": (*main.Field)(0xc000287840)({ + name: (string) (len=7) "invoice", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -2668,8 +2795,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=11) "network_fee": (*main.Field)(0xc000463ac0)({ - name: (string) (len=11) "network_fee", + (string) (len=6) "amount": (*main.Field)(0xc000287880)({ + name: (string) (len=6) "amount", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -2677,20 +2804,42 @@ isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }), - (string) (len=4) "type": (*main.Field)(0xc000463940)({ - name: (string) (len=4) "type", - kind: (string) (len=17) "UserOperationType", + }) + } + }), + (string) (len=17) "LnurlLinkResponse": (*main.Message)(0xc000378ae0)({ + fullName: (string) (len=17) "LnurlLinkResponse", + name: (string) (len=17) "LnurlLinkResponse", + fields: (map[string]*main.Field) (len=2) { + (string) (len=5) "lnurl": (*main.Field)(0xc000287b40)({ + name: (string) (len=5) "lnurl", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, - isEnum: (bool) true, + isEnum: (bool) false, isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=11) "service_fee": (*main.Field)(0xc000463a80)({ - name: (string) (len=11) "service_fee", - kind: (string) (len=5) "int64", + (string) (len=2) "k1": (*main.Field)(0xc000287b80)({ + 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, + oneOfName: (string) "" + }) + } + }), + (string) (len=20) "LnurlPayInfoResponse": (*main.Message)(0xc000378ba0)({ + fullName: (string) (len=20) "LnurlPayInfoResponse", + name: (string) (len=20) "LnurlPayInfoResponse", + fields: (map[string]*main.Field) (len=7) { + (string) (len=8) "callback": (*main.Field)(0xc000287e00)({ + name: (string) (len=8) "callback", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2698,9 +2847,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=9) "confirmed": (*main.Field)(0xc000463b00)({ - name: (string) (len=9) "confirmed", - kind: (string) (len=4) "bool", + (string) (len=11) "maxSendable": (*main.Field)(0xc000287e40)({ + name: (string) (len=11) "maxSendable", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2708,9 +2857,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=7) "tx_hash": (*main.Field)(0xc000463b40)({ - name: (string) (len=7) "tx_hash", - kind: (string) (len=6) "string", + (string) (len=11) "minSendable": (*main.Field)(0xc000287e80)({ + name: (string) (len=11) "minSendable", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2718,9 +2867,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=8) "internal": (*main.Field)(0xc000463b80)({ - name: (string) (len=8) "internal", - kind: (string) (len=4) "bool", + (string) (len=8) "metadata": (*main.Field)(0xc000287ec0)({ + name: (string) (len=8) "metadata", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2728,56 +2877,44 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=10) "paidAtUnix": (*main.Field)(0xc000463900)({ - name: (string) (len=10) "paidAtUnix", - kind: (string) (len=5) "int64", + (string) (len=11) "allowsNostr": (*main.Field)(0xc000287f00)({ + 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, oneOfName: (string) "" - }) - } - }), - (string) (len=5) "Empty": (*main.Message)(0xc0003fe2d0)({ - fullName: (string) (len=5) "Empty", - name: (string) (len=5) "Empty", - fields: (map[string]*main.Field) { - } - }), - (string) (len=17) "LndMetricsRequest": (*main.Message)(0xc0003fe5d0)({ - fullName: (string) (len=17) "LndMetricsRequest", - name: (string) (len=17) "LndMetricsRequest", - fields: (map[string]*main.Field) (len=2) { - (string) (len=9) "from_unix": (*main.Field)(0xc00031f140)({ - name: (string) (len=9) "from_unix", - kind: (string) (len=5) "int64", + }), + (string) (len=11) "nostrPubkey": (*main.Field)(0xc000287f40)({ + name: (string) (len=11) "nostrPubkey", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, isMessage: (bool) false, - isOptional: (bool) true, + isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=7) "to_unix": (*main.Field)(0xc00031f180)({ - name: (string) (len=7) "to_unix", - kind: (string) (len=5) "int64", + (string) (len=3) "tag": (*main.Field)(0xc000287dc0)({ + name: (string) (len=3) "tag", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, isMessage: (bool) false, - isOptional: (bool) true, + isOptional: (bool) false, oneOfName: (string) "" }) } }), - (string) (len=18) "LndGetInfoResponse": (*main.Message)(0xc0003fe9f0)({ - fullName: (string) (len=18) "LndGetInfoResponse", - name: (string) (len=18) "LndGetInfoResponse", - fields: (map[string]*main.Field) (len=1) { - (string) (len=5) "alias": (*main.Field)(0xc00031fec0)({ - name: (string) (len=5) "alias", + (string) (len=13) "BannedAppUser": (*main.Message)(0xc000378000)({ + fullName: (string) (len=13) "BannedAppUser", + name: (string) (len=13) "BannedAppUser", + fields: (map[string]*main.Field) (len=4) { + (string) (len=6) "app_id": (*main.Field)(0xc000039b40)({ + name: (string) (len=6) "app_id", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -2785,14 +2922,8 @@ isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }) - } - }), - (string) (len=24) "PayAppUserInvoiceRequest": (*main.Message)(0xc0003feed0)({ - fullName: (string) (len=24) "PayAppUserInvoiceRequest", - name: (string) (len=24) "PayAppUserInvoiceRequest", - fields: (map[string]*main.Field) (len=3) { - (string) (len=15) "user_identifier": (*main.Field)(0xc000462700)({ + }), + (string) (len=15) "user_identifier": (*main.Field)(0xc000039b80)({ name: (string) (len=15) "user_identifier", kind: (string) (len=6) "string", isMap: (bool) false, @@ -2802,8 +2933,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=7) "invoice": (*main.Field)(0xc000462740)({ - name: (string) (len=7) "invoice", + (string) (len=9) "nostr_pub": (*main.Field)(0xc000039bc0)({ + name: (string) (len=9) "nostr_pub", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -2812,9 +2943,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=6) "amount": (*main.Field)(0xc000462780)({ - name: (string) (len=6) "amount", - kind: (string) (len=5) "int64", + (string) (len=8) "app_name": (*main.Field)(0xc000039b00)({ + name: (string) (len=8) "app_name", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2824,12 +2955,12 @@ }) } }), - (string) (len=7) "Product": (*main.Message)(0xc0003ff950)({ - fullName: (string) (len=7) "Product", - name: (string) (len=7) "Product", - fields: (map[string]*main.Field) (len=3) { - (string) (len=4) "name": (*main.Field)(0xc000463ec0)({ - name: (string) (len=4) "name", + (string) (len=24) "AddAppUserInvoiceRequest": (*main.Message)(0xc000378360)({ + fullName: (string) (len=24) "AddAppUserInvoiceRequest", + name: (string) (len=24) "AddAppUserInvoiceRequest", + fields: (map[string]*main.Field) (len=4) { + (string) (len=16) "payer_identifier": (*main.Field)(0xc000286580)({ + name: (string) (len=16) "payer_identifier", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -2838,9 +2969,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=10) "price_sats": (*main.Field)(0xc000463f00)({ - name: (string) (len=10) "price_sats", - kind: (string) (len=5) "int64", + (string) (len=17) "http_callback_url": (*main.Field)(0xc0002865c0)({ + name: (string) (len=17) "http_callback_url", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2848,8 +2979,18 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=2) "id": (*main.Field)(0xc000463e80)({ - name: (string) (len=2) "id", + (string) (len=11) "invoice_req": (*main.Field)(0xc000286680)({ + 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, + oneOfName: (string) "" + }), + (string) (len=19) "receiver_identifier": (*main.Field)(0xc000286500)({ + name: (string) (len=19) "receiver_identifier", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -2860,12 +3001,28 @@ }) } }), - (string) (len=17) "LndGetInfoRequest": (*main.Message)(0xc0003fe930)({ - fullName: (string) (len=17) "LndGetInfoRequest", - name: (string) (len=17) "LndGetInfoRequest", + (string) (len=15) "RelaysMigration": (*main.Message)(0xc000379080)({ + fullName: (string) (len=15) "RelaysMigration", + name: (string) (len=15) "RelaysMigration", fields: (map[string]*main.Field) (len=1) { - (string) (len=6) "nodeId": (*main.Field)(0xc00031fe00)({ - name: (string) (len=6) "nodeId", + (string) (len=6) "relays": (*main.Field)(0xc000123900)({ + 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, + oneOfName: (string) "" + }) + } + }), + (string) (len=21) "DecodeInvoiceResponse": (*main.Message)(0xc000378900)({ + fullName: (string) (len=21) "DecodeInvoiceResponse", + name: (string) (len=21) "DecodeInvoiceResponse", + fields: (map[string]*main.Field) (len=1) { + (string) (len=6) "amount": (*main.Field)(0xc000287800)({ + name: (string) (len=6) "amount", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -2876,13 +3033,13 @@ }) } }), - (string) (len=15) "BanUserResponse": (*main.Message)(0xc0003feb10)({ - fullName: (string) (len=15) "BanUserResponse", - name: (string) (len=15) "BanUserResponse", - fields: (map[string]*main.Field) (len=2) { - (string) (len=12) "balance_sats": (*main.Field)(0xc000462080)({ - name: (string) (len=12) "balance_sats", - kind: (string) (len=5) "int64", + (string) (len=18) "OpenChannelRequest": (*main.Message)(0xc000378a20)({ + fullName: (string) (len=18) "OpenChannelRequest", + name: (string) (len=18) "OpenChannelRequest", + fields: (map[string]*main.Field) (len=4) { + (string) (len=11) "destination": (*main.Field)(0xc000287a00)({ + name: (string) (len=11) "destination", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2890,25 +3047,19 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=16) "banned_app_users": (*main.Field)(0xc0004620c0)({ - name: (string) (len=16) "banned_app_users", - kind: (string) (len=13) "BannedAppUser", + (string) (len=13) "fundingAmount": (*main.Field)(0xc000287a40)({ + name: (string) (len=13) "fundingAmount", + kind: (string) (len=5) "int64", isMap: (bool) false, - isArray: (bool) true, + isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) true, + isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }) - } - }), - (string) (len=14) "AuthAppRequest": (*main.Message)(0xc0003febd0)({ - fullName: (string) (len=14) "AuthAppRequest", - name: (string) (len=14) "AuthAppRequest", - fields: (map[string]*main.Field) (len=2) { - (string) (len=4) "name": (*main.Field)(0xc000462180)({ - name: (string) (len=4) "name", - kind: (string) (len=6) "string", + }), + (string) (len=10) "pushAmount": (*main.Field)(0xc000287a80)({ + name: (string) (len=10) "pushAmount", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2916,24 +3067,24 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=19) "allow_user_creation": (*main.Field)(0xc0004621c0)({ - name: (string) (len=19) "allow_user_creation", - kind: (string) (len=4) "bool", + (string) (len=12) "closeAddress": (*main.Field)(0xc000287ac0)({ + name: (string) (len=12) "closeAddress", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, isMessage: (bool) false, - isOptional: (bool) true, + isOptional: (bool) false, oneOfName: (string) "" }) } }), - (string) (len=17) "PayAddressRequest": (*main.Message)(0xc0003ff1d0)({ - fullName: (string) (len=17) "PayAddressRequest", - name: (string) (len=17) "PayAddressRequest", + (string) (len=7) "Product": (*main.Message)(0xc000378ea0)({ + fullName: (string) (len=7) "Product", + name: (string) (len=7) "Product", fields: (map[string]*main.Field) (len=3) { - (string) (len=7) "address": (*main.Field)(0xc000462ac0)({ - name: (string) (len=7) "address", + (string) (len=2) "id": (*main.Field)(0xc0001230c0)({ + name: (string) (len=2) "id", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -2942,9 +3093,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=9) "amoutSats": (*main.Field)(0xc000462b00)({ - name: (string) (len=9) "amoutSats", - kind: (string) (len=5) "int64", + (string) (len=4) "name": (*main.Field)(0xc000123100)({ + name: (string) (len=4) "name", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -2952,8 +3103,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=12) "satsPerVByte": (*main.Field)(0xc000462b40)({ - name: (string) (len=12) "satsPerVByte", + (string) (len=10) "price_sats": (*main.Field)(0xc000123140)({ + name: (string) (len=10) "price_sats", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -2964,64 +3115,74 @@ }) } }), - (string) (len=18) "AppsMetricsRequest": (*main.Message)(0xc0003fe450)({ - fullName: (string) (len=18) "AppsMetricsRequest", - name: (string) (len=18) "AppsMetricsRequest", - fields: (map[string]*main.Field) (len=3) { - (string) (len=18) "include_operations": (*main.Field)(0xc00031ed00)({ - name: (string) (len=18) "include_operations", - kind: (string) (len=4) "bool", + (string) (len=15) "MigrationUpdate": (*main.Message)(0xc000378fc0)({ + fullName: (string) (len=15) "MigrationUpdate", + name: (string) (len=15) "MigrationUpdate", + fields: (map[string]*main.Field) (len=2) { + (string) (len=7) "closure": (*main.Field)(0xc000123300)({ + name: (string) (len=7) "closure", + kind: (string) (len=16) "ClosureMigration", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) false, + isMessage: (bool) true, isOptional: (bool) true, oneOfName: (string) "" }), - (string) (len=9) "from_unix": (*main.Field)(0xc00031ec80)({ - name: (string) (len=9) "from_unix", - kind: (string) (len=5) "int64", + (string) (len=6) "relays": (*main.Field)(0xc000123340)({ + name: (string) (len=6) "relays", + kind: (string) (len=15) "RelaysMigration", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) false, + isMessage: (bool) true, isOptional: (bool) true, oneOfName: (string) "" + }) + } + }), + (string) (len=25) "EncryptionExchangeRequest": (*main.Message)(0xc000270060)({ + fullName: (string) (len=25) "EncryptionExchangeRequest", + name: (string) (len=25) "EncryptionExchangeRequest", + fields: (map[string]*main.Field) (len=2) { + (string) (len=9) "publicKey": (*main.Field)(0xc000038540)({ + 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, + oneOfName: (string) "" }), - (string) (len=7) "to_unix": (*main.Field)(0xc00031ecc0)({ - name: (string) (len=7) "to_unix", - kind: (string) (len=5) "int64", + (string) (len=8) "deviceId": (*main.Field)(0xc000038580)({ + name: (string) (len=8) "deviceId", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, isMessage: (bool) false, - isOptional: (bool) true, + isOptional: (bool) false, oneOfName: (string) "" }) } }), - (string) (len=11) "AppsMetrics": (*main.Message)(0xc0003fe570)({ - fullName: (string) (len=11) "AppsMetrics", - name: (string) (len=11) "AppsMetrics", - fields: (map[string]*main.Field) (len=1) { - (string) (len=4) "apps": (*main.Field)(0xc00031f100)({ - name: (string) (len=4) "apps", - kind: (string) (len=10) "AppMetrics", + (string) (len=11) "UsageMetric": (*main.Message)(0xc000270360)({ + fullName: (string) (len=11) "UsageMetric", + name: (string) (len=11) "UsageMetric", + fields: (map[string]*main.Field) (len=9) { + (string) (len=14) "parsed_in_nano": (*main.Field)(0xc000038600)({ + name: (string) (len=14) "parsed_in_nano", + kind: (string) (len=5) "int64", isMap: (bool) false, - isArray: (bool) true, + isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) true, + isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }) - } - }), - (string) (len=12) "RoutingEvent": (*main.Message)(0xc0003fe630)({ - fullName: (string) (len=12) "RoutingEvent", - name: (string) (len=12) "RoutingEvent", - fields: (map[string]*main.Field) (len=12) { - (string) (len=17) "incoming_amt_msat": (*main.Field)(0xc00031f340)({ - name: (string) (len=17) "incoming_amt_msat", + }), + (string) (len=12) "auth_in_nano": (*main.Field)(0xc000038640)({ + name: (string) (len=12) "auth_in_nano", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3030,8 +3191,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=17) "outgoing_amt_msat": (*main.Field)(0xc00031f380)({ - name: (string) (len=17) "outgoing_amt_msat", + (string) (len=16) "validate_in_nano": (*main.Field)(0xc000038680)({ + name: (string) (len=16) "validate_in_nano", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3040,9 +3201,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=14) "failure_string": (*main.Field)(0xc00031f3c0)({ - name: (string) (len=14) "failure_string", - kind: (string) (len=6) "string", + (string) (len=5) "nostr": (*main.Field)(0xc000038780)({ + name: (string) (len=5) "nostr", + kind: (string) (len=4) "bool", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -3050,8 +3211,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=19) "incoming_channel_id": (*main.Field)(0xc00031f1c0)({ - name: (string) (len=19) "incoming_channel_id", + (string) (len=10) "batch_size": (*main.Field)(0xc0000387c0)({ + name: (string) (len=10) "batch_size", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3060,8 +3221,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=16) "incoming_htlc_id": (*main.Field)(0xc00031f200)({ - name: (string) (len=16) "incoming_htlc_id", + (string) (len=15) "processed_at_ms": (*main.Field)(0xc0000385c0)({ + name: (string) (len=15) "processed_at_ms", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3070,8 +3231,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=19) "outgoing_channel_id": (*main.Field)(0xc00031f240)({ - name: (string) (len=19) "outgoing_channel_id", + (string) (len=14) "handle_in_nano": (*main.Field)(0xc0000386c0)({ + name: (string) (len=14) "handle_in_nano", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3080,9 +3241,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=16) "outgoing_htlc_id": (*main.Field)(0xc00031f280)({ - name: (string) (len=16) "outgoing_htlc_id", - kind: (string) (len=5) "int64", + (string) (len=8) "rpc_name": (*main.Field)(0xc000038700)({ + name: (string) (len=8) "rpc_name", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -3090,9 +3251,25 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=12) "timestamp_ns": (*main.Field)(0xc00031f2c0)({ - name: (string) (len=12) "timestamp_ns", - kind: (string) (len=5) "int64", + (string) (len=5) "batch": (*main.Field)(0xc000038740)({ + 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, + oneOfName: (string) "" + }) + } + }), + (string) (len=27) "SetMockInvoiceAsPaidRequest": (*main.Message)(0xc000271ce0)({ + fullName: (string) (len=27) "SetMockInvoiceAsPaidRequest", + name: (string) (len=27) "SetMockInvoiceAsPaidRequest", + fields: (map[string]*main.Field) (len=2) { + (string) (len=7) "invoice": (*main.Field)(0xc000039a00)({ + name: (string) (len=7) "invoice", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -3100,8 +3277,24 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=10) "event_type": (*main.Field)(0xc00031f300)({ - name: (string) (len=10) "event_type", + (string) (len=6) "amount": (*main.Field)(0xc000039a40)({ + 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, + oneOfName: (string) "" + }) + } + }), + (string) (len=14) "BanUserRequest": (*main.Message)(0xc000346bd0)({ + fullName: (string) (len=14) "BanUserRequest", + name: (string) (len=14) "BanUserRequest", + fields: (map[string]*main.Field) (len=1) { + (string) (len=7) "user_id": (*main.Field)(0xc000039ac0)({ + name: (string) (len=7) "user_id", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -3109,10 +3302,52 @@ isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" + }) + } + }), + (string) (len=12) "UsageMetrics": (*main.Message)(0xc0002703c0)({ + fullName: (string) (len=12) "UsageMetrics", + name: (string) (len=12) "UsageMetrics", + fields: (map[string]*main.Field) (len=1) { + (string) (len=7) "metrics": (*main.Field)(0xc000038800)({ + name: (string) (len=7) "metrics", + kind: (string) (len=11) "UsageMetric", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false, + oneOfName: (string) "" + }) + } + }), + (string) (len=14) "LndNodeMetrics": (*main.Message)(0xc000271770)({ + fullName: (string) (len=14) "LndNodeMetrics", + name: (string) (len=14) "LndNodeMetrics", + fields: (map[string]*main.Field) (len=9) { + (string) (len=23) "channels_balance_events": (*main.Field)(0xc000039740)({ + 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, + oneOfName: (string) "" }), - (string) (len=7) "settled": (*main.Field)(0xc00031f400)({ - name: (string) (len=7) "settled", - kind: (string) (len=4) "bool", + (string) (len=20) "chain_balance_events": (*main.Field)(0xc000039780)({ + 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, + oneOfName: (string) "" + }), + (string) (len=16) "pending_channels": (*main.Field)(0xc000039840)({ + name: (string) (len=16) "pending_channels", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -3120,9 +3355,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=8) "offchain": (*main.Field)(0xc00031f440)({ - name: (string) (len=8) "offchain", - kind: (string) (len=4) "bool", + (string) (len=16) "closing_channels": (*main.Field)(0xc000039880)({ + name: (string) (len=16) "closing_channels", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -3130,25 +3365,29 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=18) "forward_fail_event": (*main.Field)(0xc00031f480)({ - name: (string) (len=18) "forward_fail_event", - kind: (string) (len=4) "bool", + (string) (len=15) "channel_routing": (*main.Field)(0xc000039940)({ + 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, + oneOfName: (string) "" + }), + (string) (len=16) "offline_channels": (*main.Field)(0xc0000397c0)({ + 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, oneOfName: (string) "" - }) - } - }), - (string) (len=13) "BannedAppUser": (*main.Message)(0xc0003feab0)({ - fullName: (string) (len=13) "BannedAppUser", - name: (string) (len=13) "BannedAppUser", - fields: (map[string]*main.Field) (len=4) { - (string) (len=6) "app_id": (*main.Field)(0xc00031ff80)({ - name: (string) (len=6) "app_id", - kind: (string) (len=6) "string", + }), + (string) (len=15) "online_channels": (*main.Field)(0xc000039800)({ + name: (string) (len=15) "online_channels", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -3156,8 +3395,34 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=15) "user_identifier": (*main.Field)(0xc00031ffc0)({ - name: (string) (len=15) "user_identifier", + (string) (len=13) "open_channels": (*main.Field)(0xc0000398c0)({ + 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, + oneOfName: (string) "" + }), + (string) (len=15) "closed_channels": (*main.Field)(0xc000039900)({ + 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, + oneOfName: (string) "" + }) + } + }), + (string) (len=25) "LnurlWithdrawInfoResponse": (*main.Message)(0xc000378b40)({ + fullName: (string) (len=25) "LnurlWithdrawInfoResponse", + name: (string) (len=25) "LnurlWithdrawInfoResponse", + fields: (map[string]*main.Field) (len=8) { + (string) (len=8) "callback": (*main.Field)(0xc000287c00)({ + name: (string) (len=8) "callback", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -3166,8 +3431,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=9) "nostr_pub": (*main.Field)(0xc000462040)({ - name: (string) (len=9) "nostr_pub", + (string) (len=2) "k1": (*main.Field)(0xc000287c40)({ + name: (string) (len=2) "k1", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -3176,8 +3441,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=8) "app_name": (*main.Field)(0xc00031ff40)({ - name: (string) (len=8) "app_name", + (string) (len=18) "defaultDescription": (*main.Field)(0xc000287c80)({ + name: (string) (len=18) "defaultDescription", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -3185,81 +3450,49 @@ isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }) - } - }), - (string) (len=25) "GetUserOperationsResponse": (*main.Message)(0xc0003ff890)({ - fullName: (string) (len=25) "GetUserOperationsResponse", - name: (string) (len=25) "GetUserOperationsResponse", - fields: (map[string]*main.Field) (len=6) { - (string) (len=26) "latestIncomingTxOperations": (*main.Field)(0xc000463d40)({ - 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, - oneOfName: (string) "" }), - (string) (len=32) "latestOutgoingUserToUserPayemnts": (*main.Field)(0xc000463d80)({ - name: (string) (len=32) "latestOutgoingUserToUserPayemnts", - kind: (string) (len=14) "UserOperations", + (string) (len=15) "minWithdrawable": (*main.Field)(0xc000287cc0)({ + name: (string) (len=15) "minWithdrawable", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) true, + isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=32) "latestIncomingUserToUserPayemnts": (*main.Field)(0xc000463dc0)({ - name: (string) (len=32) "latestIncomingUserToUserPayemnts", - kind: (string) (len=14) "UserOperations", + (string) (len=15) "maxWithdrawable": (*main.Field)(0xc000287d00)({ + name: (string) (len=15) "maxWithdrawable", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) true, + isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=31) "latestOutgoingInvoiceOperations": (*main.Field)(0xc000463c80)({ - name: (string) (len=31) "latestOutgoingInvoiceOperations", - kind: (string) (len=14) "UserOperations", + (string) (len=12) "balanceCheck": (*main.Field)(0xc000287d40)({ + name: (string) (len=12) "balanceCheck", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) true, + isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=31) "latestIncomingInvoiceOperations": (*main.Field)(0xc000463cc0)({ - name: (string) (len=31) "latestIncomingInvoiceOperations", - kind: (string) (len=14) "UserOperations", + (string) (len=7) "payLink": (*main.Field)(0xc000287d80)({ + name: (string) (len=7) "payLink", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) true, + isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=26) "latestOutgoingTxOperations": (*main.Field)(0xc000463d00)({ - 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, - oneOfName: (string) "" - }) - } - }), - (string) (len=31) "RequestNPubLinkingTokenResponse": (*main.Message)(0xc0003ffbf0)({ - fullName: (string) (len=31) "RequestNPubLinkingTokenResponse", - name: (string) (len=31) "RequestNPubLinkingTokenResponse", - fields: (map[string]*main.Field) (len=1) { - (string) (len=5) "token": (*main.Field)(0xc0000b03c0)({ - name: (string) (len=5) "token", + (string) (len=3) "tag": (*main.Field)(0xc000287bc0)({ + name: (string) (len=3) "tag", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -3270,13 +3503,13 @@ }) } }), - (string) (len=11) "UsageMetric": (*main.Message)(0xc0003fe390)({ - fullName: (string) (len=11) "UsageMetric", - name: (string) (len=11) "UsageMetric", - fields: (map[string]*main.Field) (len=9) { - (string) (len=14) "parsed_in_nano": (*main.Field)(0xc00031e640)({ - name: (string) (len=14) "parsed_in_nano", - kind: (string) (len=5) "int64", + (string) (len=27) "LinkNPubThroughTokenRequest": (*main.Message)(0xc0003791a0)({ + fullName: (string) (len=27) "LinkNPubThroughTokenRequest", + name: (string) (len=27) "LinkNPubThroughTokenRequest", + fields: (map[string]*main.Field) (len=2) { + (string) (len=5) "token": (*main.Field)(0xc000123ac0)({ + name: (string) (len=5) "token", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -3284,19 +3517,25 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=16) "validate_in_nano": (*main.Field)(0xc00031e8c0)({ - name: (string) (len=16) "validate_in_nano", - kind: (string) (len=5) "int64", + (string) (len=9) "nostr_pub": (*main.Field)(0xc000123c40)({ + 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, oneOfName: (string) "" - }), - (string) (len=14) "handle_in_nano": (*main.Field)(0xc00031e900)({ - name: (string) (len=14) "handle_in_nano", - kind: (string) (len=5) "int64", + }) + } + }), + (string) (len=11) "Application": (*main.Message)(0xc000378180)({ + fullName: (string) (len=11) "Application", + name: (string) (len=11) "Application", + fields: (map[string]*main.Field) (len=4) { + (string) (len=4) "name": (*main.Field)(0xc000039d80)({ + name: (string) (len=4) "name", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -3304,9 +3543,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=5) "batch": (*main.Field)(0xc00031e9c0)({ - name: (string) (len=5) "batch", - kind: (string) (len=4) "bool", + (string) (len=2) "id": (*main.Field)(0xc000039dc0)({ + name: (string) (len=2) "id", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -3314,8 +3553,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=10) "batch_size": (*main.Field)(0xc00031ea80)({ - name: (string) (len=10) "batch_size", + (string) (len=7) "balance": (*main.Field)(0xc000039e00)({ + name: (string) (len=7) "balance", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3324,28 +3563,34 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=15) "processed_at_ms": (*main.Field)(0xc00031e5c0)({ - name: (string) (len=15) "processed_at_ms", - kind: (string) (len=5) "int64", + (string) (len=4) "npub": (*main.Field)(0xc000039e40)({ + 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, oneOfName: (string) "" - }), - (string) (len=12) "auth_in_nano": (*main.Field)(0xc00031e680)({ - name: (string) (len=12) "auth_in_nano", - kind: (string) (len=5) "int64", + }) + } + }), + (string) (len=7) "AuthApp": (*main.Message)(0xc0003781e0)({ + fullName: (string) (len=7) "AuthApp", + name: (string) (len=7) "AuthApp", + fields: (map[string]*main.Field) (len=2) { + (string) (len=3) "app": (*main.Field)(0xc000039e80)({ + name: (string) (len=3) "app", + kind: (string) (len=11) "Application", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) false, + isMessage: (bool) true, isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=8) "rpc_name": (*main.Field)(0xc00031e980)({ - name: (string) (len=8) "rpc_name", + (string) (len=10) "auth_token": (*main.Field)(0xc000039ec0)({ + name: (string) (len=10) "auth_token", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -3353,24 +3598,14 @@ isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }), - (string) (len=5) "nostr": (*main.Field)(0xc00031ea40)({ - 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, - oneOfName: (string) "" }) } }), - (string) (len=17) "NewInvoiceRequest": (*main.Message)(0xc0003ff290)({ + (string) (len=17) "NewInvoiceRequest": (*main.Message)(0xc0003787e0)({ fullName: (string) (len=17) "NewInvoiceRequest", name: (string) (len=17) "NewInvoiceRequest", fields: (map[string]*main.Field) (len=2) { - (string) (len=10) "amountSats": (*main.Field)(0xc000462c80)({ + (string) (len=10) "amountSats": (*main.Field)(0xc000287700)({ name: (string) (len=10) "amountSats", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -3380,7 +3615,7 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=4) "memo": (*main.Field)(0xc000462cc0)({ + (string) (len=4) "memo": (*main.Field)(0xc000287740)({ name: (string) (len=4) "memo", kind: (string) (len=6) "string", isMap: (bool) false, @@ -3392,22 +3627,28 @@ }) } }), - (string) (len=18) "OpenChannelRequest": (*main.Message)(0xc0003ff4d0)({ - fullName: (string) (len=18) "OpenChannelRequest", - name: (string) (len=18) "OpenChannelRequest", - fields: (map[string]*main.Field) (len=4) { - (string) (len=10) "pushAmount": (*main.Field)(0xc000463000)({ - name: (string) (len=10) "pushAmount", - kind: (string) (len=5) "int64", + (string) (len=20) "DecodeInvoiceRequest": (*main.Message)(0xc0003788a0)({ + fullName: (string) (len=20) "DecodeInvoiceRequest", + name: (string) (len=20) "DecodeInvoiceRequest", + fields: (map[string]*main.Field) (len=1) { + (string) (len=7) "invoice": (*main.Field)(0xc0002877c0)({ + 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, oneOfName: (string) "" - }), - (string) (len=12) "closeAddress": (*main.Field)(0xc000463040)({ - name: (string) (len=12) "closeAddress", + }) + } + }), + (string) (len=18) "PayAddressResponse": (*main.Message)(0xc000378780)({ + fullName: (string) (len=18) "PayAddressResponse", + name: (string) (len=18) "PayAddressResponse", + fields: (map[string]*main.Field) (len=4) { + (string) (len=4) "txId": (*main.Field)(0xc000287480)({ + name: (string) (len=4) "txId", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -3416,8 +3657,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=11) "destination": (*main.Field)(0xc000462f80)({ - name: (string) (len=11) "destination", + (string) (len=12) "operation_id": (*main.Field)(0xc000287540)({ + name: (string) (len=12) "operation_id", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -3426,8 +3667,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=13) "fundingAmount": (*main.Field)(0xc000462fc0)({ - name: (string) (len=13) "fundingAmount", + (string) (len=11) "service_fee": (*main.Field)(0xc000287680)({ + name: (string) (len=11) "service_fee", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3435,15 +3676,9 @@ isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }) - } - }), - (string) (len=17) "ChainBalanceEvent": (*main.Message)(0xc0003fe6f0)({ - fullName: (string) (len=17) "ChainBalanceEvent", - name: (string) (len=17) "ChainBalanceEvent", - fields: (map[string]*main.Field) (len=4) { - (string) (len=19) "unconfirmed_balance": (*main.Field)(0xc00031f640)({ - name: (string) (len=19) "unconfirmed_balance", + }), + (string) (len=11) "network_fee": (*main.Field)(0xc0002876c0)({ + name: (string) (len=11) "network_fee", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3451,10 +3686,16 @@ isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }), - (string) (len=13) "total_balance": (*main.Field)(0xc00031f680)({ - name: (string) (len=13) "total_balance", - kind: (string) (len=5) "int64", + }) + } + }), + (string) (len=8) "UserInfo": (*main.Message)(0xc000378c60)({ + fullName: (string) (len=8) "UserInfo", + name: (string) (len=8) "UserInfo", + fields: (map[string]*main.Field) (len=7) { + (string) (len=6) "userId": (*main.Field)(0xc000122000)({ + name: (string) (len=6) "userId", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -3462,8 +3703,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=12) "block_height": (*main.Field)(0xc00031f5c0)({ - name: (string) (len=12) "block_height", + (string) (len=7) "balance": (*main.Field)(0xc000122040)({ + name: (string) (len=7) "balance", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3472,8 +3713,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=17) "confirmed_balance": (*main.Field)(0xc00031f600)({ - name: (string) (len=17) "confirmed_balance", + (string) (len=16) "max_withdrawable": (*main.Field)(0xc000122080)({ + name: (string) (len=16) "max_withdrawable", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3481,14 +3722,8 @@ isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }) - } - }), - (string) (len=17) "GetAppUserRequest": (*main.Message)(0xc0003fee70)({ - fullName: (string) (len=17) "GetAppUserRequest", - name: (string) (len=17) "GetAppUserRequest", - fields: (map[string]*main.Field) (len=1) { - (string) (len=15) "user_identifier": (*main.Field)(0xc0004626c0)({ + }), + (string) (len=15) "user_identifier": (*main.Field)(0xc000122180)({ name: (string) (len=15) "user_identifier", kind: (string) (len=6) "string", isMap: (bool) false, @@ -3497,32 +3732,20 @@ isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }) - } - }), - (string) (len=18) "NewAddressResponse": (*main.Message)(0xc0003ff170)({ - fullName: (string) (len=18) "NewAddressResponse", - name: (string) (len=18) "NewAddressResponse", - fields: (map[string]*main.Field) (len=1) { - (string) (len=7) "address": (*main.Field)(0xc000462a80)({ - name: (string) (len=7) "address", - kind: (string) (len=6) "string", + }), + (string) (len=15) "service_fee_bps": (*main.Field)(0xc0001223c0)({ + name: (string) (len=15) "service_fee_bps", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }) - } - }), - (string) (len=18) "PayInvoiceResponse": (*main.Message)(0xc0003ff470)({ - fullName: (string) (len=18) "PayInvoiceResponse", - name: (string) (len=18) "PayInvoiceResponse", - fields: (map[string]*main.Field) (len=5) { - (string) (len=8) "preimage": (*main.Field)(0xc000462e40)({ - name: (string) (len=8) "preimage", - kind: (string) (len=6) "string", + }), + (string) (len=19) "network_max_fee_bps": (*main.Field)(0xc000122640)({ + name: (string) (len=19) "network_max_fee_bps", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -3530,8 +3753,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=11) "amount_paid": (*main.Field)(0xc000462e80)({ - name: (string) (len=11) "amount_paid", + (string) (len=21) "network_max_fee_fixed": (*main.Field)(0xc000122680)({ + name: (string) (len=21) "network_max_fee_fixed", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3539,9 +3762,15 @@ isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }), - (string) (len=12) "operation_id": (*main.Field)(0xc000462ec0)({ - name: (string) (len=12) "operation_id", + }) + } + }), + (string) (len=9) "HttpCreds": (*main.Message)(0xc000379200)({ + fullName: (string) (len=9) "HttpCreds", + name: (string) (len=9) "HttpCreds", + fields: (map[string]*main.Field) (len=2) { + (string) (len=3) "url": (*main.Field)(0xc000123c80)({ + name: (string) (len=3) "url", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -3550,44 +3779,72 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=11) "service_fee": (*main.Field)(0xc000462f00)({ - name: (string) (len=11) "service_fee", - kind: (string) (len=5) "int64", + (string) (len=5) "token": (*main.Field)(0xc00037c000)({ + 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, oneOfName: (string) "" - }), - (string) (len=11) "network_fee": (*main.Field)(0xc000462f40)({ - name: (string) (len=11) "network_fee", - kind: (string) (len=5) "int64", + }) + } + }), + (string) (len=11) "AppsMetrics": (*main.Message)(0xc000270810)({ + fullName: (string) (len=11) "AppsMetrics", + name: (string) (len=11) "AppsMetrics", + fields: (map[string]*main.Field) (len=1) { + (string) (len=4) "apps": (*main.Field)(0xc000038cc0)({ + name: (string) (len=4) "apps", + kind: (string) (len=10) "AppMetrics", isMap: (bool) false, - isArray: (bool) false, + isArray: (bool) true, isEnum: (bool) false, - isMessage: (bool) false, + isMessage: (bool) true, isOptional: (bool) false, oneOfName: (string) "" }) } }), - (string) (len=17) "AddProductRequest": (*main.Message)(0xc0003ff8f0)({ - fullName: (string) (len=17) "AddProductRequest", - name: (string) (len=17) "AddProductRequest", - fields: (map[string]*main.Field) (len=2) { - (string) (len=4) "name": (*main.Field)(0xc000463e00)({ - name: (string) (len=4) "name", - kind: (string) (len=6) "string", + (string) (len=10) "LndMetrics": (*main.Message)(0xc000271b00)({ + fullName: (string) (len=10) "LndMetrics", + name: (string) (len=10) "LndMetrics", + fields: (map[string]*main.Field) (len=1) { + (string) (len=5) "nodes": (*main.Field)(0xc000039980)({ + 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, + oneOfName: (string) "" + }) + } + }), + (string) (len=17) "LndGetInfoRequest": (*main.Message)(0xc000271b60)({ + fullName: (string) (len=17) "LndGetInfoRequest", + name: (string) (len=17) "LndGetInfoRequest", + fields: (map[string]*main.Field) (len=1) { + (string) (len=6) "nodeId": (*main.Field)(0xc0000399c0)({ + 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, oneOfName: (string) "" - }), - (string) (len=10) "price_sats": (*main.Field)(0xc000463e40)({ - name: (string) (len=10) "price_sats", + }) + } + }), + (string) (len=24) "SetMockAppBalanceRequest": (*main.Message)(0xc000378600)({ + fullName: (string) (len=24) "SetMockAppBalanceRequest", + name: (string) (len=24) "SetMockAppBalanceRequest", + fields: (map[string]*main.Field) (len=1) { + (string) (len=6) "amount": (*main.Field)(0xc000287200)({ + name: (string) (len=6) "amount", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3598,12 +3855,12 @@ }) } }), - (string) (len=25) "EncryptionExchangeRequest": (*main.Message)(0xc0003fe330)({ - fullName: (string) (len=25) "EncryptionExchangeRequest", - name: (string) (len=25) "EncryptionExchangeRequest", - fields: (map[string]*main.Field) (len=2) { - (string) (len=9) "publicKey": (*main.Field)(0xc00031e300)({ - name: (string) (len=9) "publicKey", + (string) (len=34) "SendAppUserToAppUserPaymentRequest": (*main.Message)(0xc000378480)({ + fullName: (string) (len=34) "SendAppUserToAppUserPaymentRequest", + name: (string) (len=34) "SendAppUserToAppUserPaymentRequest", + fields: (map[string]*main.Field) (len=3) { + (string) (len=18) "to_user_identifier": (*main.Field)(0xc000286e40)({ + name: (string) (len=18) "to_user_identifier", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -3612,8 +3869,18 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=8) "deviceId": (*main.Field)(0xc00031e400)({ - name: (string) (len=8) "deviceId", + (string) (len=6) "amount": (*main.Field)(0xc000286e80)({ + 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, + oneOfName: (string) "" + }), + (string) (len=20) "from_user_identifier": (*main.Field)(0xc000286a40)({ + name: (string) (len=20) "from_user_identifier", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -3624,13 +3891,13 @@ }) } }), - (string) (len=9) "UsersInfo": (*main.Message)(0xc0003fe4b0)({ - fullName: (string) (len=9) "UsersInfo", - name: (string) (len=9) "UsersInfo", + (string) (len=11) "OpenChannel": (*main.Message)(0xc0002714d0)({ + fullName: (string) (len=11) "OpenChannel", + name: (string) (len=11) "OpenChannel", fields: (map[string]*main.Field) (len=6) { - (string) (len=10) "no_balance": (*main.Field)(0xc00031ed80)({ - name: (string) (len=10) "no_balance", - kind: (string) (len=5) "int64", + (string) (len=10) "channel_id": (*main.Field)(0xc000039280)({ + name: (string) (len=10) "channel_id", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -3638,8 +3905,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=16) "negative_balance": (*main.Field)(0xc00031edc0)({ - name: (string) (len=16) "negative_balance", + (string) (len=8) "capacity": (*main.Field)(0xc0000392c0)({ + name: (string) (len=8) "capacity", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3648,9 +3915,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=20) "always_been_inactive": (*main.Field)(0xc00031ee00)({ - name: (string) (len=20) "always_been_inactive", - kind: (string) (len=5) "int64", + (string) (len=6) "active": (*main.Field)(0xc000039300)({ + name: (string) (len=6) "active", + kind: (string) (len=4) "bool", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -3658,8 +3925,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=11) "balance_avg": (*main.Field)(0xc00031ee40)({ - name: (string) (len=11) "balance_avg", + (string) (len=8) "lifetime": (*main.Field)(0xc000039340)({ + name: (string) (len=8) "lifetime", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3668,8 +3935,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=14) "balance_median": (*main.Field)(0xc00031ee80)({ - name: (string) (len=14) "balance_median", + (string) (len=13) "local_balance": (*main.Field)(0xc000039380)({ + name: (string) (len=13) "local_balance", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3678,8 +3945,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=5) "total": (*main.Field)(0xc00031ed40)({ - name: (string) (len=5) "total", + (string) (len=14) "remote_balance": (*main.Field)(0xc0000393c0)({ + name: (string) (len=14) "remote_balance", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3690,12 +3957,12 @@ }) } }), - (string) (len=19) "ChannelBalanceEvent": (*main.Message)(0xc0003fe690)({ - fullName: (string) (len=19) "ChannelBalanceEvent", - name: (string) (len=19) "ChannelBalanceEvent", - fields: (map[string]*main.Field) (len=4) { - (string) (len=12) "block_height": (*main.Field)(0xc00031f4c0)({ - name: (string) (len=12) "block_height", + (string) (len=13) "ClosedChannel": (*main.Message)(0xc000271530)({ + fullName: (string) (len=13) "ClosedChannel", + name: (string) (len=13) "ClosedChannel", + fields: (map[string]*main.Field) (len=3) { + (string) (len=13) "closed_height": (*main.Field)(0xc000039480)({ + name: (string) (len=13) "closed_height", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3704,7 +3971,7 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=10) "channel_id": (*main.Field)(0xc00031f500)({ + (string) (len=10) "channel_id": (*main.Field)(0xc000039400)({ name: (string) (len=10) "channel_id", kind: (string) (len=6) "string", isMap: (bool) false, @@ -3714,18 +3981,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=18) "local_balance_sats": (*main.Field)(0xc00031f540)({ - 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, - oneOfName: (string) "" - }), - (string) (len=19) "remote_balance_sats": (*main.Field)(0xc00031f580)({ - name: (string) (len=19) "remote_balance_sats", + (string) (len=8) "capacity": (*main.Field)(0xc000039440)({ + name: (string) (len=8) "capacity", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3736,22 +3993,12 @@ }) } }), - (string) (len=14) "ChannelRouting": (*main.Message)(0xc0003fe810)({ + (string) (len=14) "ChannelRouting": (*main.Message)(0xc000271710)({ fullName: (string) (len=14) "ChannelRouting", name: (string) (len=14) "ChannelRouting", fields: (map[string]*main.Field) (len=10) { - (string) (len=21) "forward_fee_as_output": (*main.Field)(0xc00031fb00)({ - name: (string) (len=21) "forward_fee_as_output", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false, - oneOfName: (string) "" - }), - (string) (len=11) "send_errors": (*main.Field)(0xc00031f940)({ - name: (string) (len=11) "send_errors", + (string) (len=14) "receive_errors": (*main.Field)(0xc000039540)({ + name: (string) (len=14) "receive_errors", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3760,8 +4007,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=23) "forward_errors_as_input": (*main.Field)(0xc00031f9c0)({ - name: (string) (len=23) "forward_errors_as_input", + (string) (len=24) "forward_errors_as_output": (*main.Field)(0xc0000395c0)({ + name: (string) (len=24) "forward_errors_as_output", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3770,8 +4017,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=27) "missed_forward_fee_as_input": (*main.Field)(0xc00031fa40)({ - name: (string) (len=27) "missed_forward_fee_as_input", + (string) (len=28) "missed_forward_fee_as_output": (*main.Field)(0xc000039640)({ + name: (string) (len=28) "missed_forward_fee_as_output", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3780,7 +4027,7 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=20) "forward_fee_as_input": (*main.Field)(0xc00031fac0)({ + (string) (len=20) "forward_fee_as_input": (*main.Field)(0xc000039680)({ name: (string) (len=20) "forward_fee_as_input", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -3790,7 +4037,7 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=13) "events_number": (*main.Field)(0xc00031fb40)({ + (string) (len=13) "events_number": (*main.Field)(0xc000039700)({ name: (string) (len=13) "events_number", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -3800,7 +4047,7 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=10) "channel_id": (*main.Field)(0xc00031f900)({ + (string) (len=10) "channel_id": (*main.Field)(0xc0000394c0)({ name: (string) (len=10) "channel_id", kind: (string) (len=6) "string", isMap: (bool) false, @@ -3810,8 +4057,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=14) "receive_errors": (*main.Field)(0xc00031f980)({ - name: (string) (len=14) "receive_errors", + (string) (len=11) "send_errors": (*main.Field)(0xc000039500)({ + name: (string) (len=11) "send_errors", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3820,8 +4067,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=24) "forward_errors_as_output": (*main.Field)(0xc00031fa00)({ - name: (string) (len=24) "forward_errors_as_output", + (string) (len=23) "forward_errors_as_input": (*main.Field)(0xc000039580)({ + name: (string) (len=23) "forward_errors_as_input", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3830,8 +4077,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=28) "missed_forward_fee_as_output": (*main.Field)(0xc00031fa80)({ - name: (string) (len=28) "missed_forward_fee_as_output", + (string) (len=27) "missed_forward_fee_as_input": (*main.Field)(0xc000039600)({ + name: (string) (len=27) "missed_forward_fee_as_input", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3839,25 +4086,9 @@ isMessage: (bool) false, isOptional: (bool) false, oneOfName: (string) "" - }) - } - }), - (string) (len=30) "SendAppUserToAppPaymentRequest": (*main.Message)(0xc0003fef90)({ - fullName: (string) (len=30) "SendAppUserToAppPaymentRequest", - name: (string) (len=30) "SendAppUserToAppPaymentRequest", - fields: (map[string]*main.Field) (len=2) { - (string) (len=20) "from_user_identifier": (*main.Field)(0xc000462880)({ - 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, - oneOfName: (string) "" }), - (string) (len=6) "amount": (*main.Field)(0xc0004628c0)({ - name: (string) (len=6) "amount", + (string) (len=21) "forward_fee_as_output": (*main.Field)(0xc0000396c0)({ + name: (string) (len=21) "forward_fee_as_output", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3868,55 +4099,23 @@ }) } }), - (string) (len=24) "SetMockAppBalanceRequest": (*main.Message)(0xc0003ff0b0)({ - fullName: (string) (len=24) "SetMockAppBalanceRequest", - name: (string) (len=24) "SetMockAppBalanceRequest", - fields: (map[string]*main.Field) (len=1) { - (string) (len=6) "amount": (*main.Field)(0xc000462a00)({ - name: (string) (len=6) "amount", - kind: (string) (len=5) "int64", + (string) (len=13) "AddAppRequest": (*main.Message)(0xc0003780c0)({ + fullName: (string) (len=13) "AddAppRequest", + name: (string) (len=13) "AddAppRequest", + fields: (map[string]*main.Field) (len=2) { + (string) (len=4) "name": (*main.Field)(0xc000039c80)({ + 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, oneOfName: (string) "" - }) - } - }), - (string) (len=15) "MigrationUpdate": (*main.Message)(0xc0003ffa70)({ - fullName: (string) (len=15) "MigrationUpdate", - name: (string) (len=15) "MigrationUpdate", - fields: (map[string]*main.Field) (len=2) { - (string) (len=7) "closure": (*main.Field)(0xc000463fc0)({ - 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, - oneOfName: (string) "" }), - (string) (len=6) "relays": (*main.Field)(0xc0000b0000)({ - 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, - oneOfName: (string) "" - }) - } - }), - (string) (len=16) "ClosureMigration": (*main.Message)(0xc0003ffad0)({ - fullName: (string) (len=16) "ClosureMigration", - name: (string) (len=16) "ClosureMigration", - fields: (map[string]*main.Field) (len=1) { - (string) (len=14) "closes_at_unix": (*main.Field)(0xc0000b0040)({ - name: (string) (len=14) "closes_at_unix", - kind: (string) (len=5) "int64", + (string) (len=19) "allow_user_creation": (*main.Field)(0xc000039cc0)({ + name: (string) (len=19) "allow_user_creation", + kind: (string) (len=4) "bool", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -3926,12 +4125,12 @@ }) } }), - (string) (len=13) "ClosedChannel": (*main.Message)(0xc0003fe7b0)({ - fullName: (string) (len=13) "ClosedChannel", - name: (string) (len=13) "ClosedChannel", + (string) (len=17) "AddAppUserRequest": (*main.Message)(0xc000378240)({ + fullName: (string) (len=17) "AddAppUserRequest", + name: (string) (len=17) "AddAppUserRequest", fields: (map[string]*main.Field) (len=3) { - (string) (len=10) "channel_id": (*main.Field)(0xc00031f840)({ - name: (string) (len=10) "channel_id", + (string) (len=10) "identifier": (*main.Field)(0xc000039f00)({ + name: (string) (len=10) "identifier", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -3940,9 +4139,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=8) "capacity": (*main.Field)(0xc00031f880)({ - name: (string) (len=8) "capacity", - kind: (string) (len=5) "int64", + (string) (len=14) "fail_if_exists": (*main.Field)(0xc000039f40)({ + name: (string) (len=14) "fail_if_exists", + kind: (string) (len=4) "bool", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -3950,8 +4149,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=13) "closed_height": (*main.Field)(0xc00031f8c0)({ - name: (string) (len=13) "closed_height", + (string) (len=7) "balance": (*main.Field)(0xc000039f80)({ + name: (string) (len=7) "balance", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3962,13 +4161,13 @@ }) } }), - (string) (len=11) "Application": (*main.Message)(0xc0003fec30)({ - fullName: (string) (len=11) "Application", - name: (string) (len=11) "Application", - fields: (map[string]*main.Field) (len=4) { - (string) (len=4) "name": (*main.Field)(0xc000462200)({ - name: (string) (len=4) "name", - kind: (string) (len=6) "string", + (string) (len=10) "AppMetrics": (*main.Message)(0xc0002707b0)({ + fullName: (string) (len=10) "AppMetrics", + name: (string) (len=10) "AppMetrics", + fields: (map[string]*main.Field) (len=9) { + (string) (len=8) "received": (*main.Field)(0xc000038b00)({ + name: (string) (len=8) "received", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -3976,9 +4175,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=2) "id": (*main.Field)(0xc000462240)({ - name: (string) (len=2) "id", - kind: (string) (len=6) "string", + (string) (len=5) "spent": (*main.Field)(0xc000038b40)({ + name: (string) (len=5) "spent", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -3986,8 +4185,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=7) "balance": (*main.Field)(0xc000462280)({ - name: (string) (len=7) "balance", + (string) (len=9) "available": (*main.Field)(0xc000038b80)({ + name: (string) (len=9) "available", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -3996,61 +4195,49 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=4) "npub": (*main.Field)(0xc0004622c0)({ - name: (string) (len=4) "npub", - kind: (string) (len=6) "string", + (string) (len=8) "invoices": (*main.Field)(0xc000038c00)({ + 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, oneOfName: (string) "" - }) - } - }), - (string) (len=17) "AddAppUserRequest": (*main.Message)(0xc0003fecf0)({ - fullName: (string) (len=17) "AddAppUserRequest", - name: (string) (len=17) "AddAppUserRequest", - fields: (map[string]*main.Field) (len=3) { - (string) (len=10) "identifier": (*main.Field)(0xc000462380)({ - name: (string) (len=10) "identifier", - kind: (string) (len=6) "string", + }), + (string) (len=10) "operations": (*main.Field)(0xc000038c80)({ + name: (string) (len=10) "operations", + kind: (string) (len=13) "UserOperation", isMap: (bool) false, - isArray: (bool) false, + isArray: (bool) true, isEnum: (bool) false, - isMessage: (bool) false, + isMessage: (bool) true, isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=14) "fail_if_exists": (*main.Field)(0xc0004623c0)({ - name: (string) (len=14) "fail_if_exists", - kind: (string) (len=4) "bool", + (string) (len=3) "app": (*main.Field)(0xc000038a80)({ + name: (string) (len=3) "app", + kind: (string) (len=11) "Application", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) false, + isMessage: (bool) true, isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=7) "balance": (*main.Field)(0xc000462400)({ - name: (string) (len=7) "balance", - kind: (string) (len=5) "int64", + (string) (len=5) "users": (*main.Field)(0xc000038ac0)({ + name: (string) (len=5) "users", + kind: (string) (len=9) "UsersInfo", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) false, + isMessage: (bool) true, isOptional: (bool) false, oneOfName: (string) "" - }) - } - }), - (string) (len=28) "SetMockAppUserBalanceRequest": (*main.Message)(0xc0003ff050)({ - fullName: (string) (len=28) "SetMockAppUserBalanceRequest", - name: (string) (len=28) "SetMockAppUserBalanceRequest", - fields: (map[string]*main.Field) (len=2) { - (string) (len=15) "user_identifier": (*main.Field)(0xc000462980)({ - name: (string) (len=15) "user_identifier", - kind: (string) (len=6) "string", + }), + (string) (len=4) "fees": (*main.Field)(0xc000038bc0)({ + name: (string) (len=4) "fees", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -4058,8 +4245,8 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=6) "amount": (*main.Field)(0xc0004629c0)({ - name: (string) (len=6) "amount", + (string) (len=10) "total_fees": (*main.Field)(0xc000038c40)({ + name: (string) (len=10) "total_fees", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -4070,22 +4257,22 @@ }) } }), - (string) (len=18) "PayAddressResponse": (*main.Message)(0xc0003ff230)({ - fullName: (string) (len=18) "PayAddressResponse", - name: (string) (len=18) "PayAddressResponse", - fields: (map[string]*main.Field) (len=4) { - (string) (len=4) "txId": (*main.Field)(0xc000462b80)({ - name: (string) (len=4) "txId", - kind: (string) (len=6) "string", + (string) (len=20) "AddAppInvoiceRequest": (*main.Message)(0xc000378300)({ + fullName: (string) (len=20) "AddAppInvoiceRequest", + name: (string) (len=20) "AddAppInvoiceRequest", + fields: (map[string]*main.Field) (len=3) { + (string) (len=11) "invoice_req": (*main.Field)(0xc0002864c0)({ + name: (string) (len=11) "invoice_req", + kind: (string) (len=17) "NewInvoiceRequest", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) false, + isMessage: (bool) true, isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=12) "operation_id": (*main.Field)(0xc000462bc0)({ - name: (string) (len=12) "operation_id", + (string) (len=16) "payer_identifier": (*main.Field)(0xc000286380)({ + name: (string) (len=16) "payer_identifier", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -4094,19 +4281,9 @@ isOptional: (bool) false, oneOfName: (string) "" }), - (string) (len=11) "service_fee": (*main.Field)(0xc000462c00)({ - 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, - oneOfName: (string) "" - }), - (string) (len=11) "network_fee": (*main.Field)(0xc000462c40)({ - name: (string) (len=11) "network_fee", - kind: (string) (len=5) "int64", + (string) (len=17) "http_callback_url": (*main.Field)(0xc000286400)({ + name: (string) (len=17) "http_callback_url", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -4116,12 +4293,12 @@ }) } }), - (string) (len=18) "NewInvoiceResponse": (*main.Message)(0xc0003ff2f0)({ - fullName: (string) (len=18) "NewInvoiceResponse", - name: (string) (len=18) "NewInvoiceResponse", + (string) (len=25) "GetProductBuyLinkResponse": (*main.Message)(0xc000378f00)({ + fullName: (string) (len=25) "GetProductBuyLinkResponse", + name: (string) (len=25) "GetProductBuyLinkResponse", fields: (map[string]*main.Field) (len=1) { - (string) (len=7) "invoice": (*main.Field)(0xc000462d00)({ - name: (string) (len=7) "invoice", + (string) (len=4) "link": (*main.Field)(0xc000123200)({ + name: (string) (len=4) "link", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -4132,22 +4309,12 @@ }) } }), - (string) (len=9) "HttpCreds": (*main.Message)(0xc0003ffcb0)({ - fullName: (string) (len=9) "HttpCreds", - name: (string) (len=9) "HttpCreds", - fields: (map[string]*main.Field) (len=2) { - (string) (len=3) "url": (*main.Field)(0xc0000b06c0)({ - 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, - oneOfName: (string) "" - }), - (string) (len=5) "token": (*main.Field)(0xc0000b0700)({ - name: (string) (len=5) "token", + (string) (len=31) "CreateOneTimeInviteLinkResponse": (*main.Message)(0xc000379320)({ + fullName: (string) (len=31) "CreateOneTimeInviteLinkResponse", + name: (string) (len=31) "CreateOneTimeInviteLinkResponse", + fields: (map[string]*main.Field) (len=1) { + (string) (len=15) "invitation_link": (*main.Field)(0xc00037c0c0)({ + name: (string) (len=15) "invitation_link", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -4163,9 +4330,9 @@ (map[string][]*main.Field) { } -parsing file: structs 71 +parsing file: structs 76 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]}] +-> [{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]} {guestPub GuestWithPub map[app_id:string pub:string]}] ([]interface {}) diff --git a/proto/autogenerated/ts/express_server.ts b/proto/autogenerated/ts/express_server.ts index f041058a7..0e4360d07 100644 --- a/proto/autogenerated/ts/express_server.ts +++ b/proto/autogenerated/ts/express_server.ts @@ -18,6 +18,7 @@ export type ServerOptions = { AdminAuthGuard: (authorizationHeader?: string) => Promise MetricsAuthGuard: (authorizationHeader?: string) => Promise AppAuthGuard: (authorizationHeader?: string) => Promise + GuestWithPubAuthGuard: (authorizationHeader?: string) => Promise } declare module 'express-serve-static-core' { interface Request { startTime?: bigint, bodySize?: number, startTimeMs: number } } const logErrorAndReturnResponse = (error: Error, response: string, res: Response, logger: Logger, metric: Types.RequestMetric, metricsCallback: (metrics: Types.RequestMetric[]) => void) => { @@ -184,6 +185,50 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => { 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 } }) + if (!opts.allowNotImplementedMethods && !methods.CreateOneTimeInviteLink) throw new Error('method: CreateOneTimeInviteLink is not implemented') + app.post('/api/admin/app/invite/create', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'CreateOneTimeInviteLink', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.CreateOneTimeInviteLink) throw new Error('method: CreateOneTimeInviteLink is not implemented') + const authContext = await opts.AdminAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.CreateOneTimeInviteLinkRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.CreateOneTimeInviteLink({rpcName:'CreateOneTimeInviteLink', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({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 } + }) + if (!opts.allowNotImplementedMethods && !methods.GetInviteLinkState) throw new Error('method: GetInviteLinkState is not implemented') + app.post('/api/admin/app/invite/get', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'GetInviteLinkState', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.GetInviteLinkState) throw new Error('method: GetInviteLinkState is not implemented') + const authContext = await opts.AdminAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.GetInviteTokenStateRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.GetInviteLinkState({rpcName:'GetInviteLinkState', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({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 } + }) if (!opts.allowNotImplementedMethods && !methods.Health) throw new Error('method: Health is not implemented') app.get('/api/health', async (req, res) => { const info: Types.RequestInfo = { rpcName: 'Health', batch: false, nostr: false, batchSize: 0} @@ -342,6 +387,28 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => { 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 } }) + if (!opts.allowNotImplementedMethods && !methods.EnrollAdminToken) throw new Error('method: EnrollAdminToken is not implemented') + app.post('/api/guest/npub/enroll/admin', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'EnrollAdminToken', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.EnrollAdminToken) throw new Error('method: EnrollAdminToken is not implemented') + const authContext = await opts.UserAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.EnrollAdminTokenRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + await methods.EnrollAdminToken({rpcName:'EnrollAdminToken', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({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 } + }) if (!opts.allowNotImplementedMethods && !methods.LinkNPubThroughToken) throw new Error('method: LinkNPubThroughToken is not implemented') app.post('/api/guest/npub/link', async (req, res) => { const info: Types.RequestInfo = { rpcName: 'LinkNPubThroughToken', batch: false, nostr: false, batchSize: 0} @@ -349,7 +416,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => { let authCtx: Types.AuthContext = {} try { if (!methods.LinkNPubThroughToken) throw new Error('method: LinkNPubThroughToken is not implemented') - const authContext = await opts.UserAuthGuard(req.headers['authorization']) + const authContext = await opts.GuestWithPubAuthGuard(req.headers['authorization']) authCtx = authContext stats.guard = process.hrtime.bigint() const request = req.body @@ -364,23 +431,23 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => { 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 } }) - if (!opts.allowNotImplementedMethods && !methods.EnrollAdminToken) throw new Error('method: EnrollAdminToken is not implemented') - app.post('/api/guest/npub/enroll/admin', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'EnrollAdminToken', batch: false, nostr: false, batchSize: 0} + if (!opts.allowNotImplementedMethods && !methods.UseInviteLink) throw new Error('method: UseInviteLink is not implemented') + app.post('/api/guest/invite', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'UseInviteLink', batch: false, nostr: false, batchSize: 0} const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } let authCtx: Types.AuthContext = {} try { - if (!methods.EnrollAdminToken) throw new Error('method: EnrollAdminToken is not implemented') - const authContext = await opts.UserAuthGuard(req.headers['authorization']) + if (!methods.UseInviteLink) throw new Error('method: UseInviteLink is not implemented') + const authContext = await opts.GuestWithPubAuthGuard(req.headers['authorization']) authCtx = authContext stats.guard = process.hrtime.bigint() const request = req.body - const error = Types.EnrollAdminTokenRequestValidate(request) + const error = Types.UseInviteLinkRequestValidate(request) stats.validate = process.hrtime.bigint() if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) const query = req.query const params = req.params - await methods.EnrollAdminToken({rpcName:'EnrollAdminToken', ctx:authContext , req: request}) + await methods.UseInviteLink({rpcName:'UseInviteLink', ctx:authContext , req: request}) stats.handle = process.hrtime.bigint() res.json({status: 'OK'}) opts.metricsCallback([{ ...info, ...stats, ...authContext }]) @@ -958,18 +1025,6 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => { const opStats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: stats.parse, guard: stats.guard, validate: 0n, handle: 0n } try { switch(operation.rpcName) { - case 'LinkNPubThroughToken': - if (!methods.LinkNPubThroughToken) { - throw new Error('method LinkNPubThroughToken not found' ) - } else { - 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' }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break case 'EnrollAdminToken': if (!methods.EnrollAdminToken) { throw new Error('method EnrollAdminToken not found' ) diff --git a/proto/autogenerated/ts/http_client.ts b/proto/autogenerated/ts/http_client.ts index 1865e08a2..0785f9936 100644 --- a/proto/autogenerated/ts/http_client.ts +++ b/proto/autogenerated/ts/http_client.ts @@ -10,6 +10,7 @@ export type ClientParams = { retrieveAdminAuth: () => Promise retrieveMetricsAuth: () => Promise retrieveAppAuth: () => Promise + retrieveGuestWithPubAuth: () => Promise encryptCallback: (plain: any) => Promise decryptCallback: (encrypted: any) => Promise deviceId: string @@ -114,6 +115,34 @@ export default (params: ClientParams) => ({ } return { status: 'ERROR', reason: 'invalid response' } }, + CreateOneTimeInviteLink: async (request: Types.CreateOneTimeInviteLinkRequest): Promise => { + const auth = await params.retrieveAdminAuth() + if (auth === null) throw new Error('retrieveAdminAuth() returned null') + let finalRoute = '/api/admin/app/invite/create' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.CreateOneTimeInviteLinkResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetInviteLinkState: async (request: Types.GetInviteTokenStateRequest): Promise => { + const auth = await params.retrieveAdminAuth() + if (auth === null) throw new Error('retrieveAdminAuth() returned null') + let finalRoute = '/api/admin/app/invite/get' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.GetInviteTokenStateResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, Health: async (): Promise => { const auth = await params.retrieveGuestAuth() if (auth === null) throw new Error('retrieveGuestAuth() returned null') @@ -223,9 +252,20 @@ export default (params: ClientParams) => ({ } return { status: 'ERROR', reason: 'invalid response' } }, - LinkNPubThroughToken: async (request: Types.LinkNPubThroughTokenRequest): Promise => { + EnrollAdminToken: async (request: Types.EnrollAdminTokenRequest): Promise => { const auth = await params.retrieveUserAuth() if (auth === null) throw new Error('retrieveUserAuth() returned null') + let finalRoute = '/api/guest/npub/enroll/admin' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + return data + } + return { status: 'ERROR', reason: 'invalid response' } + }, + LinkNPubThroughToken: async (request: Types.LinkNPubThroughTokenRequest): Promise => { + const auth = await params.retrieveGuestWithPubAuth() + if (auth === null) throw new Error('retrieveGuestWithPubAuth() returned null') let finalRoute = '/api/guest/npub/link' const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) if (data.status === 'ERROR' && typeof data.reason === 'string') return data @@ -234,10 +274,10 @@ export default (params: ClientParams) => ({ } return { status: 'ERROR', reason: 'invalid response' } }, - EnrollAdminToken: async (request: Types.EnrollAdminTokenRequest): Promise => { - const auth = await params.retrieveUserAuth() - if (auth === null) throw new Error('retrieveUserAuth() returned null') - let finalRoute = '/api/guest/npub/enroll/admin' + UseInviteLink: async (request: Types.UseInviteLinkRequest): Promise => { + const auth = await params.retrieveGuestWithPubAuth() + if (auth === null) throw new Error('retrieveGuestWithPubAuth() returned null') + let finalRoute = '/api/guest/invite' const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) if (data.status === 'ERROR' && typeof data.reason === 'string') return data if (data.status === 'OK') { diff --git a/proto/autogenerated/ts/nostr_client.ts b/proto/autogenerated/ts/nostr_client.ts index ba7ec6b5a..804bc6728 100644 --- a/proto/autogenerated/ts/nostr_client.ts +++ b/proto/autogenerated/ts/nostr_client.ts @@ -8,6 +8,7 @@ export type NostrClientParams = { retrieveNostrAdminAuth: () => Promise retrieveNostrMetricsAuth: () => Promise retrieveNostrUserAuth: () => Promise + retrieveNostrGuestWithPubAuth: () => Promise checkResult?: true } export default (params: NostrClientParams, send: (to:string, message: NostrRequest) => Promise, subscribe: (to:string, message: NostrRequest, cb:(res:any)=> void) => void) => ({ @@ -115,15 +116,33 @@ export default (params: NostrClientParams, send: (to:string, message: NostrRequ } return { status: 'ERROR', reason: 'invalid response' } }, - LinkNPubThroughToken: async (request: Types.LinkNPubThroughTokenRequest): Promise => { - const auth = await params.retrieveNostrUserAuth() - if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') + CreateOneTimeInviteLink: async (request: Types.CreateOneTimeInviteLinkRequest): Promise => { + const auth = await params.retrieveNostrAdminAuth() + if (auth === null) throw new Error('retrieveNostrAdminAuth() returned null') const nostrRequest: NostrRequest = {} nostrRequest.body = request - const data = await send(params.pubDestination, {rpcName:'LinkNPubThroughToken',authIdentifier:auth, ...nostrRequest }) + const data = await send(params.pubDestination, {rpcName:'CreateOneTimeInviteLink',authIdentifier:auth, ...nostrRequest }) if (data.status === 'ERROR' && typeof data.reason === 'string') return data if (data.status === 'OK') { - return data + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.CreateOneTimeInviteLinkResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetInviteLinkState: async (request: Types.GetInviteTokenStateRequest): Promise => { + const auth = await params.retrieveNostrAdminAuth() + if (auth === null) throw new Error('retrieveNostrAdminAuth() returned null') + const nostrRequest: NostrRequest = {} + nostrRequest.body = request + const data = await send(params.pubDestination, {rpcName:'GetInviteLinkState',authIdentifier:auth, ...nostrRequest }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.GetInviteTokenStateResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } } return { status: 'ERROR', reason: 'invalid response' } }, @@ -139,6 +158,30 @@ export default (params: NostrClientParams, send: (to:string, message: NostrRequ } return { status: 'ERROR', reason: 'invalid response' } }, + LinkNPubThroughToken: async (request: Types.LinkNPubThroughTokenRequest): Promise => { + const auth = await params.retrieveNostrGuestWithPubAuth() + if (auth === null) throw new Error('retrieveNostrGuestWithPubAuth() returned null') + const nostrRequest: NostrRequest = {} + nostrRequest.body = request + const data = await send(params.pubDestination, {rpcName:'LinkNPubThroughToken',authIdentifier:auth, ...nostrRequest }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + return data + } + return { status: 'ERROR', reason: 'invalid response' } + }, + UseInviteLink: async (request: Types.UseInviteLinkRequest): Promise => { + const auth = await params.retrieveNostrGuestWithPubAuth() + if (auth === null) throw new Error('retrieveNostrGuestWithPubAuth() returned null') + const nostrRequest: NostrRequest = {} + nostrRequest.body = request + const data = await send(params.pubDestination, {rpcName:'UseInviteLink',authIdentifier:auth, ...nostrRequest }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + return data + } + return { status: 'ERROR', reason: 'invalid response' } + }, UserHealth: async (): 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 c73cd74d8..c103abe8d 100644 --- a/proto/autogenerated/ts/nostr_transport.ts +++ b/proto/autogenerated/ts/nostr_transport.ts @@ -19,6 +19,7 @@ export type NostrOptions = { NostrAdminAuthGuard: (appId?:string, identifier?: string) => Promise NostrMetricsAuthGuard: (appId?:string, identifier?: string) => Promise NostrUserAuthGuard: (appId?:string, identifier?: string) => Promise + NostrGuestWithPubAuthGuard: (appId?:string, identifier?: string) => Promise } 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 }) @@ -140,19 +141,35 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { 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 'LinkNPubThroughToken': + case 'CreateOneTimeInviteLink': try { - if (!methods.LinkNPubThroughToken) throw new Error('method: LinkNPubThroughToken is not implemented') - const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) + if (!methods.CreateOneTimeInviteLink) throw new Error('method: CreateOneTimeInviteLink is not implemented') + const authContext = await opts.NostrAdminAuthGuard(req.appId, req.authIdentifier) stats.guard = process.hrtime.bigint() authCtx = authContext const request = req.body - const error = Types.LinkNPubThroughTokenRequestValidate(request) + const error = Types.CreateOneTimeInviteLinkRequestValidate(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}) + const response = await methods.CreateOneTimeInviteLink({rpcName:'CreateOneTimeInviteLink', ctx:authContext , req: request}) stats.handle = process.hrtime.bigint() - res({status: 'OK'}) + 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 'GetInviteLinkState': + try { + if (!methods.GetInviteLinkState) throw new Error('method: GetInviteLinkState is not implemented') + const authContext = await opts.NostrAdminAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = authContext + const request = req.body + const error = Types.GetInviteTokenStateRequestValidate(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.GetInviteLinkState({rpcName:'GetInviteLinkState', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + 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 @@ -172,6 +189,38 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { 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 'LinkNPubThroughToken': + try { + if (!methods.LinkNPubThroughToken) throw new Error('method: LinkNPubThroughToken is not implemented') + const authContext = await opts.NostrGuestWithPubAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = authContext + const request = req.body + 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}) + stats.handle = process.hrtime.bigint() + 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 } + break + case 'UseInviteLink': + try { + if (!methods.UseInviteLink) throw new Error('method: UseInviteLink is not implemented') + const authContext = await opts.NostrGuestWithPubAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = authContext + const request = req.body + const error = Types.UseInviteLinkRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) + await methods.UseInviteLink({rpcName:'UseInviteLink', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + 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 } + break case 'UserHealth': try { if (!methods.UserHealth) throw new Error('method: UserHealth is not implemented') @@ -436,18 +485,6 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { const opStats: Types.RequestStats = { startMs, start: startTime, parse: stats.parse, guard: stats.guard, validate: 0n, handle: 0n } try { switch(operation.rpcName) { - case 'LinkNPubThroughToken': - if (!methods.LinkNPubThroughToken) { - throw new Error('method not defined: LinkNPubThroughToken') - } else { - 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' }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break case 'EnrollAdminToken': if (!methods.EnrollAdminToken) { throw new Error('method not defined: EnrollAdminToken') diff --git a/proto/autogenerated/ts/types.ts b/proto/autogenerated/ts/types.ts index 691dfcf6b..4c0f5678f 100644 --- a/proto/autogenerated/ts/types.ts +++ b/proto/autogenerated/ts/types.ts @@ -9,17 +9,17 @@ export type GuestContext = { export type GuestMethodInputs = Health_Input | EncryptionExchange_Input | SetMockInvoiceAsPaid_Input | GetLnurlWithdrawInfo_Input | HandleLnurlWithdraw_Input | GetLnurlPayInfo_Input | HandleLnurlPay_Input | HandleLnurlAddress_Input export type GuestMethodOutputs = Health_Output | EncryptionExchange_Output | SetMockInvoiceAsPaid_Output | GetLnurlWithdrawInfo_Output | HandleLnurlWithdraw_Output | GetLnurlPayInfo_Output | HandleLnurlPay_Output | HandleLnurlAddress_Output export type UserContext = { - app_user_id: string user_id: string app_id: string + app_user_id: string } -export type UserMethodInputs = LinkNPubThroughToken_Input | EnrollAdminToken_Input | UserHealth_Input | GetUserInfo_Input | AddProduct_Input | NewProductInvoice_Input | GetUserOperations_Input | NewAddress_Input | PayAddress_Input | NewInvoice_Input | DecodeInvoice_Input | PayInvoice_Input | OpenChannel_Input | GetLnurlWithdrawLink_Input | GetLnurlPayLink_Input | GetLNURLChannelLink_Input -export type UserMethodOutputs = LinkNPubThroughToken_Output | EnrollAdminToken_Output | UserHealth_Output | GetUserInfo_Output | AddProduct_Output | NewProductInvoice_Output | GetUserOperations_Output | NewAddress_Output | PayAddress_Output | NewInvoice_Output | DecodeInvoice_Output | PayInvoice_Output | OpenChannel_Output | GetLnurlWithdrawLink_Output | GetLnurlPayLink_Output | GetLNURLChannelLink_Output +export type UserMethodInputs = EnrollAdminToken_Input | UserHealth_Input | GetUserInfo_Input | AddProduct_Input | NewProductInvoice_Input | GetUserOperations_Input | NewAddress_Input | PayAddress_Input | NewInvoice_Input | DecodeInvoice_Input | PayInvoice_Input | OpenChannel_Input | GetLnurlWithdrawLink_Input | GetLnurlPayLink_Input | GetLNURLChannelLink_Input +export type UserMethodOutputs = EnrollAdminToken_Output | UserHealth_Output | GetUserInfo_Output | AddProduct_Output | NewProductInvoice_Output | GetUserOperations_Output | NewAddress_Output | PayAddress_Output | NewInvoice_Output | DecodeInvoice_Output | PayInvoice_Output | OpenChannel_Output | GetLnurlWithdrawLink_Output | GetLnurlPayLink_Output | GetLNURLChannelLink_Output export type AdminContext = { admin_id: string } -export type AdminMethodInputs = LndGetInfo_Input | AddApp_Input | AuthApp_Input | BanUser_Input -export type AdminMethodOutputs = LndGetInfo_Output | AddApp_Output | AuthApp_Output | BanUser_Output +export type AdminMethodInputs = LndGetInfo_Input | AddApp_Input | AuthApp_Input | BanUser_Input | CreateOneTimeInviteLink_Input | GetInviteLinkState_Input +export type AdminMethodOutputs = LndGetInfo_Output | AddApp_Output | AuthApp_Output | BanUser_Output | CreateOneTimeInviteLink_Output | GetInviteLinkState_Output export type MetricsContext = { operator_id: string } @@ -30,7 +30,13 @@ export type AppContext = { } export type AppMethodInputs = GetApp_Input | AddAppUser_Input | AddAppInvoice_Input | AddAppUserInvoice_Input | GetAppUser_Input | PayAppUserInvoice_Input | SendAppUserToAppUserPayment_Input | SendAppUserToAppPayment_Input | GetAppUserLNURLInfo_Input | SetMockAppUserBalance_Input | SetMockAppBalance_Input | RequestNPubLinkingToken_Input export type AppMethodOutputs = GetApp_Output | AddAppUser_Output | AddAppInvoice_Output | AddAppUserInvoice_Output | GetAppUser_Output | PayAppUserInvoice_Output | SendAppUserToAppUserPayment_Output | SendAppUserToAppPayment_Output | GetAppUserLNURLInfo_Output | SetMockAppUserBalance_Output | SetMockAppBalance_Output | RequestNPubLinkingToken_Output -export type AuthContext = GuestContext | UserContext | AdminContext | MetricsContext | AppContext +export type GuestWithPubContext = { + app_id: string + pub: string +} +export type GuestWithPubMethodInputs = LinkNPubThroughToken_Input | UseInviteLink_Input +export type GuestWithPubMethodOutputs = LinkNPubThroughToken_Output | UseInviteLink_Output +export type AuthContext = GuestContext | UserContext | AdminContext | MetricsContext | AppContext | GuestWithPubContext export type LndGetInfo_Input = {rpcName:'LndGetInfo', req: LndGetInfoRequest} export type LndGetInfo_Output = ResultError | ({ status: 'OK' } & LndGetInfoResponse) @@ -53,6 +59,12 @@ export type GetAppsMetrics_Output = ResultError | ({ status: 'OK' } & AppsMetric export type GetLndMetrics_Input = {rpcName:'GetLndMetrics', req: LndMetricsRequest} export type GetLndMetrics_Output = ResultError | ({ status: 'OK' } & LndMetrics) +export type CreateOneTimeInviteLink_Input = {rpcName:'CreateOneTimeInviteLink', req: CreateOneTimeInviteLinkRequest} +export type CreateOneTimeInviteLink_Output = ResultError | ({ status: 'OK' } & CreateOneTimeInviteLinkResponse) + +export type GetInviteLinkState_Input = {rpcName:'GetInviteLinkState', req: GetInviteTokenStateRequest} +export type GetInviteLinkState_Output = ResultError | ({ status: 'OK' } & GetInviteTokenStateResponse) + export type Health_Input = {rpcName:'Health'} export type Health_Output = ResultError | { status: 'OK' } @@ -96,11 +108,14 @@ export type HandleLnurlAddress_RouteParams = { export type HandleLnurlAddress_Input = {rpcName:'HandleLnurlAddress', params: HandleLnurlAddress_RouteParams} export type HandleLnurlAddress_Output = ResultError | ({ status: 'OK' } & LnurlPayInfoResponse) +export type EnrollAdminToken_Input = {rpcName:'EnrollAdminToken', req: EnrollAdminTokenRequest} +export type EnrollAdminToken_Output = ResultError | { status: 'OK' } + export type LinkNPubThroughToken_Input = {rpcName:'LinkNPubThroughToken', req: LinkNPubThroughTokenRequest} export type LinkNPubThroughToken_Output = ResultError | { status: 'OK' } -export type EnrollAdminToken_Input = {rpcName:'EnrollAdminToken', req: EnrollAdminTokenRequest} -export type EnrollAdminToken_Output = ResultError | { status: 'OK' } +export type UseInviteLink_Input = {rpcName:'UseInviteLink', req: UseInviteLinkRequest} +export type UseInviteLink_Output = ResultError | { status: 'OK' } export type GetApp_Input = {rpcName:'GetApp'} export type GetApp_Output = ResultError | ({ status: 'OK' } & Application) @@ -203,6 +218,8 @@ export type ServerMethods = { GetUsageMetrics?: (req: GetUsageMetrics_Input & {ctx: MetricsContext }) => Promise GetAppsMetrics?: (req: GetAppsMetrics_Input & {ctx: MetricsContext }) => Promise GetLndMetrics?: (req: GetLndMetrics_Input & {ctx: MetricsContext }) => Promise + CreateOneTimeInviteLink?: (req: CreateOneTimeInviteLink_Input & {ctx: AdminContext }) => Promise + GetInviteLinkState?: (req: GetInviteLinkState_Input & {ctx: AdminContext }) => Promise Health?: (req: Health_Input & {ctx: GuestContext }) => Promise EncryptionExchange?: (req: EncryptionExchange_Input & {ctx: GuestContext }) => Promise SetMockInvoiceAsPaid?: (req: SetMockInvoiceAsPaid_Input & {ctx: GuestContext }) => Promise @@ -211,8 +228,9 @@ export type ServerMethods = { GetLnurlPayInfo?: (req: GetLnurlPayInfo_Input & {ctx: GuestContext }) => Promise HandleLnurlPay?: (req: HandleLnurlPay_Input & {ctx: GuestContext }) => Promise HandleLnurlAddress?: (req: HandleLnurlAddress_Input & {ctx: GuestContext }) => Promise - LinkNPubThroughToken?: (req: LinkNPubThroughToken_Input & {ctx: UserContext }) => Promise EnrollAdminToken?: (req: EnrollAdminToken_Input & {ctx: UserContext }) => Promise + LinkNPubThroughToken?: (req: LinkNPubThroughToken_Input & {ctx: GuestWithPubContext }) => Promise + UseInviteLink?: (req: UseInviteLink_Input & {ctx: GuestWithPubContext }) => Promise GetApp?: (req: GetApp_Input & {ctx: AppContext }) => Promise AddAppUser?: (req: AddAppUser_Input & {ctx: AppContext }) => Promise AddAppInvoice?: (req: AddAppInvoice_Input & {ctx: AppContext }) => Promise @@ -270,44 +288,69 @@ export type OptionsBaseMessage = { allOptionalsAreSet?: true } +export type AddAppUserRequest = { + fail_if_exists: boolean + balance: number + identifier: string +} +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 AppMetrics = { - fees: number invoices: number + operations: UserOperation[] + received: number + spent: number + available: number total_fees: number app: Application users: UsersInfo - spent: number - available: number - received: number - operations: UserOperation[] + fees: number } export const AppMetricsOptionalFields: [] = [] export type AppMetricsOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - received_CustomCheck?: (v: number) => boolean - operations_ItemOptions?: UserOperationOptions - operations_CustomCheck?: (v: UserOperation[]) => boolean - total_fees_CustomCheck?: (v: number) => boolean app_Options?: ApplicationOptions users_Options?: UsersInfoOptions + fees_CustomCheck?: (v: number) => boolean + total_fees_CustomCheck?: (v: number) => boolean + 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 + 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') - 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`) + const usersErr = UsersInfoValidate(o.users, opts.users_Options, `${path}.users`) + if (usersErr !== null) return usersErr + - 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`) + 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.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`) @@ -316,148 +359,159 @@ export const AppMetricsValidate = (o?: AppMetrics, opts: AppMetricsOptions = {}, if (appErr !== null) return appErr - const usersErr = UsersInfoValidate(o.users, opts.users_Options, `${path}.users`) - if (usersErr !== null) return usersErr - - 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 (!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`) + + 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`) + return null } -export type AddAppRequest = { - name: string - allow_user_creation: boolean +export type AddAppInvoiceRequest = { + payer_identifier: string + http_callback_url: string + invoice_req: NewInvoiceRequest } -export const AddAppRequestOptionalFields: [] = [] -export type AddAppRequestOptions = OptionsBaseMessage & { +export const AddAppInvoiceRequestOptionalFields: [] = [] +export type AddAppInvoiceRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - name_CustomCheck?: (v: string) => boolean - allow_user_creation_CustomCheck?: (v: boolean) => boolean + http_callback_url_CustomCheck?: (v: string) => boolean + invoice_req_Options?: NewInvoiceRequestOptions + payer_identifier_CustomCheck?: (v: string) => boolean } -export const AddAppRequestValidate = (o?: AddAppRequest, opts: AddAppRequestOptions = {}, path: string = 'AddAppRequest::root.'): Error | null => { +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.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.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.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`) + 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 SendAppUserToAppUserPaymentRequest = { - from_user_identifier: string - to_user_identifier: string - amount: number +export type GetProductBuyLinkResponse = { + link: string } -export const SendAppUserToAppUserPaymentRequestOptionalFields: [] = [] -export type SendAppUserToAppUserPaymentRequestOptions = OptionsBaseMessage & { +export const GetProductBuyLinkResponseOptionalFields: [] = [] +export type GetProductBuyLinkResponseOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - amount_CustomCheck?: (v: number) => boolean - from_user_identifier_CustomCheck?: (v: string) => boolean - to_user_identifier_CustomCheck?: (v: string) => boolean + link_CustomCheck?: (v: string) => boolean } -export const SendAppUserToAppUserPaymentRequestValidate = (o?: SendAppUserToAppUserPaymentRequest, opts: SendAppUserToAppUserPaymentRequestOptions = {}, path: string = 'SendAppUserToAppUserPaymentRequest::root.'): Error | null => { +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.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.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`) - 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`) + return 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`) +export type CreateOneTimeInviteLinkResponse = { + invitation_link: string +} +export const CreateOneTimeInviteLinkResponseOptionalFields: [] = [] +export type CreateOneTimeInviteLinkResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + invitation_link_CustomCheck?: (v: string) => boolean +} +export const CreateOneTimeInviteLinkResponseValidate = (o?: CreateOneTimeInviteLinkResponse, opts: CreateOneTimeInviteLinkResponseOptions = {}, path: string = 'CreateOneTimeInviteLinkResponse::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.invitation_link !== 'string') return new Error(`${path}.invitation_link: is not a string`) + if (opts.invitation_link_CustomCheck && !opts.invitation_link_CustomCheck(o.invitation_link)) return new Error(`${path}.invitation_link: custom check failed`) return null } -export type LnurlPayInfoResponse = { - nostrPubkey: string - tag: string - callback: string - maxSendable: number - minSendable: number - metadata: string - allowsNostr: boolean +export type AppUser = { + max_withdrawable: number + identifier: string + info: UserInfo } -export const LnurlPayInfoResponseOptionalFields: [] = [] -export type LnurlPayInfoResponseOptions = OptionsBaseMessage & { +export const AppUserOptionalFields: [] = [] +export type AppUserOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - nostrPubkey_CustomCheck?: (v: string) => boolean - 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 + info_Options?: UserInfoOptions + max_withdrawable_CustomCheck?: (v: number) => boolean + identifier_CustomCheck?: (v: string) => boolean } -export const LnurlPayInfoResponseValidate = (o?: LnurlPayInfoResponse, opts: LnurlPayInfoResponseOptions = {}, path: string = 'LnurlPayInfoResponse::root.'): Error | null => { +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.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.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.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`) + const infoErr = UserInfoValidate(o.info, opts.info_Options, `${path}.info`) + if (infoErr !== null) return infoErr + - 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.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.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`) + return null +} - 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`) +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.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.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.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`) + 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 HandleLnurlPayResponse = { - pr: string - routes: Empty[] +export type NewInvoiceResponse = { + invoice: string } -export const HandleLnurlPayResponseOptionalFields: [] = [] -export type HandleLnurlPayResponseOptions = OptionsBaseMessage & { +export const NewInvoiceResponseOptionalFields: [] = [] +export type NewInvoiceResponseOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - pr_CustomCheck?: (v: string) => boolean - routes_ItemOptions?: EmptyOptions - routes_CustomCheck?: (v: Empty[]) => boolean + invoice_CustomCheck?: (v: string) => boolean } -export const HandleLnurlPayResponseValidate = (o?: HandleLnurlPayResponse, opts: HandleLnurlPayResponseOptions = {}, path: string = 'HandleLnurlPayResponse::root.'): Error | null => { +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.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`) + 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 } @@ -480,215 +534,147 @@ export const EnrollAdminTokenRequestValidate = (o?: EnrollAdminTokenRequest, opt return null } -export type UsageMetrics = { - metrics: UsageMetric[] +export type GetInviteTokenStateRequest = { + invite_token: string } -export const UsageMetricsOptionalFields: [] = [] -export type UsageMetricsOptions = OptionsBaseMessage & { +export const GetInviteTokenStateRequestOptionalFields: [] = [] +export type GetInviteTokenStateRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - metrics_ItemOptions?: UsageMetricOptions - metrics_CustomCheck?: (v: UsageMetric[]) => boolean + invite_token_CustomCheck?: (v: string) => boolean } -export const UsageMetricsValidate = (o?: UsageMetrics, opts: UsageMetricsOptions = {}, path: string = 'UsageMetrics::root.'): Error | null => { +export const GetInviteTokenStateRequestValidate = (o?: GetInviteTokenStateRequest, opts: GetInviteTokenStateRequestOptions = {}, path: string = 'GetInviteTokenStateRequest::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`) + if (typeof o.invite_token !== 'string') return new Error(`${path}.invite_token: is not a string`) + if (opts.invite_token_CustomCheck && !opts.invite_token_CustomCheck(o.invite_token)) return new Error(`${path}.invite_token: custom check failed`) return null } -export type LnurlLinkResponse = { - lnurl: string - k1: string +export type UseInviteLinkRequest = { + invite_token: string } -export const LnurlLinkResponseOptionalFields: [] = [] -export type LnurlLinkResponseOptions = OptionsBaseMessage & { +export const UseInviteLinkRequestOptionalFields: [] = [] +export type UseInviteLinkRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - lnurl_CustomCheck?: (v: string) => boolean - k1_CustomCheck?: (v: string) => boolean + invite_token_CustomCheck?: (v: string) => boolean } -export const LnurlLinkResponseValidate = (o?: LnurlLinkResponse, opts: LnurlLinkResponseOptions = {}, path: string = 'LnurlLinkResponse::root.'): Error | null => { +export const UseInviteLinkRequestValidate = (o?: UseInviteLinkRequest, opts: UseInviteLinkRequestOptions = {}, path: string = 'UseInviteLinkRequest::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`) + if (typeof o.invite_token !== 'string') return new Error(`${path}.invite_token: is not a string`) + if (opts.invite_token_CustomCheck && !opts.invite_token_CustomCheck(o.invite_token)) return new Error(`${path}.invite_token: custom check failed`) return null } -export type LiveUserOperation = { - operation: UserOperation +export type UsersInfo = { + total: number + no_balance: number + negative_balance: number + always_been_inactive: number + balance_avg: number + balance_median: number } -export const LiveUserOperationOptionalFields: [] = [] -export type LiveUserOperationOptions = OptionsBaseMessage & { +export const UsersInfoOptionalFields: [] = [] +export type UsersInfoOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - operation_Options?: UserOperationOptions + 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 + total_CustomCheck?: (v: number) => boolean } -export const LiveUserOperationValidate = (o?: LiveUserOperation, opts: LiveUserOperationOptions = {}, path: string = 'LiveUserOperation::root.'): Error | null => { +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') - const operationErr = UserOperationValidate(o.operation, opts.operation_Options, `${path}.operation`) - if (operationErr !== null) return operationErr - - - 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.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.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.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.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.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`) - return null -} + 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`) -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.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.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`) + 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 LndNodeMetrics = { - channel_routing: ChannelRouting[] - offline_channels: number - pending_channels: number - open_channels: OpenChannel[] - closed_channels: ClosedChannel[] - channels_balance_events: ChannelBalanceEvent[] - chain_balance_events: ChainBalanceEvent[] - online_channels: number - closing_channels: number +export type ChannelBalanceEvent = { + block_height: number + channel_id: string + local_balance_sats: number + remote_balance_sats: number } -export const LndNodeMetricsOptionalFields: [] = [] -export type LndNodeMetricsOptions = OptionsBaseMessage & { +export const ChannelBalanceEventOptionalFields: [] = [] +export type ChannelBalanceEventOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - channels_balance_events_ItemOptions?: ChannelBalanceEventOptions - channels_balance_events_CustomCheck?: (v: ChannelBalanceEvent[]) => boolean - chain_balance_events_ItemOptions?: ChainBalanceEventOptions - chain_balance_events_CustomCheck?: (v: ChainBalanceEvent[]) => boolean - online_channels_CustomCheck?: (v: number) => boolean - closing_channels_CustomCheck?: (v: number) => boolean - channel_routing_ItemOptions?: ChannelRoutingOptions - channel_routing_CustomCheck?: (v: ChannelRouting[]) => boolean - offline_channels_CustomCheck?: (v: number) => boolean - pending_channels_CustomCheck?: (v: number) => boolean - open_channels_ItemOptions?: OpenChannelOptions - open_channels_CustomCheck?: (v: OpenChannel[]) => boolean - closed_channels_ItemOptions?: ClosedChannelOptions - closed_channels_CustomCheck?: (v: ClosedChannel[]) => boolean + 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 LndNodeMetricsValidate = (o?: LndNodeMetrics, opts: LndNodeMetricsOptions = {}, path: string = 'LndNodeMetrics::root.'): Error | null => { +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 (!Array.isArray(o.channels_balance_events)) return new Error(`${path}.channels_balance_events: is not an array`) - for (let index = 0; index < o.channels_balance_events.length; index++) { - const channels_balance_eventsErr = ChannelBalanceEventValidate(o.channels_balance_events[index], opts.channels_balance_events_ItemOptions, `${path}.channels_balance_events[${index}]`) - if (channels_balance_eventsErr !== null) return channels_balance_eventsErr - } - if (opts.channels_balance_events_CustomCheck && !opts.channels_balance_events_CustomCheck(o.channels_balance_events)) return new Error(`${path}.channels_balance_events: custom check failed`) - - if (!Array.isArray(o.chain_balance_events)) return new Error(`${path}.chain_balance_events: is not an array`) - for (let index = 0; index < o.chain_balance_events.length; index++) { - const chain_balance_eventsErr = ChainBalanceEventValidate(o.chain_balance_events[index], opts.chain_balance_events_ItemOptions, `${path}.chain_balance_events[${index}]`) - if (chain_balance_eventsErr !== null) return chain_balance_eventsErr - } - if (opts.chain_balance_events_CustomCheck && !opts.chain_balance_events_CustomCheck(o.chain_balance_events)) return new Error(`${path}.chain_balance_events: custom check failed`) - - if (typeof o.online_channels !== 'number') return new Error(`${path}.online_channels: is not a number`) - if (opts.online_channels_CustomCheck && !opts.online_channels_CustomCheck(o.online_channels)) return new Error(`${path}.online_channels: custom check failed`) - - if (typeof o.closing_channels !== 'number') return new Error(`${path}.closing_channels: is not a number`) - if (opts.closing_channels_CustomCheck && !opts.closing_channels_CustomCheck(o.closing_channels)) return new Error(`${path}.closing_channels: custom check failed`) - - if (typeof o.offline_channels !== 'number') return new Error(`${path}.offline_channels: is not a number`) - if (opts.offline_channels_CustomCheck && !opts.offline_channels_CustomCheck(o.offline_channels)) return new Error(`${path}.offline_channels: custom check failed`) - - if (typeof o.pending_channels !== 'number') return new Error(`${path}.pending_channels: is not a number`) - if (opts.pending_channels_CustomCheck && !opts.pending_channels_CustomCheck(o.pending_channels)) return new Error(`${path}.pending_channels: custom check failed`) + 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 (!Array.isArray(o.open_channels)) return new Error(`${path}.open_channels: is not an array`) - for (let index = 0; index < o.open_channels.length; index++) { - const open_channelsErr = OpenChannelValidate(o.open_channels[index], opts.open_channels_ItemOptions, `${path}.open_channels[${index}]`) - if (open_channelsErr !== null) return open_channelsErr - } - if (opts.open_channels_CustomCheck && !opts.open_channels_CustomCheck(o.open_channels)) return new Error(`${path}.open_channels: 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 (!Array.isArray(o.closed_channels)) return new Error(`${path}.closed_channels: is not an array`) - for (let index = 0; index < o.closed_channels.length; index++) { - const closed_channelsErr = ClosedChannelValidate(o.closed_channels[index], opts.closed_channels_ItemOptions, `${path}.closed_channels[${index}]`) - if (closed_channelsErr !== null) return closed_channelsErr - } - if (opts.closed_channels_CustomCheck && !opts.closed_channels_CustomCheck(o.closed_channels)) return new Error(`${path}.closed_channels: 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 (!Array.isArray(o.channel_routing)) return new Error(`${path}.channel_routing: is not an array`) - for (let index = 0; index < o.channel_routing.length; index++) { - const channel_routingErr = ChannelRoutingValidate(o.channel_routing[index], opts.channel_routing_ItemOptions, `${path}.channel_routing[${index}]`) - if (channel_routingErr !== null) return channel_routingErr - } - if (opts.channel_routing_CustomCheck && !opts.channel_routing_CustomCheck(o.channel_routing)) return new Error(`${path}.channel_routing: 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 AuthApp = { - app: Application - auth_token: string +export type ChainBalanceEvent = { + total_balance: number + block_height: number + confirmed_balance: number + unconfirmed_balance: number } -export const AuthAppOptionalFields: [] = [] -export type AuthAppOptions = OptionsBaseMessage & { +export const ChainBalanceEventOptionalFields: [] = [] +export type ChainBalanceEventOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - app_Options?: ApplicationOptions - auth_token_CustomCheck?: (v: string) => boolean + confirmed_balance_CustomCheck?: (v: number) => boolean + unconfirmed_balance_CustomCheck?: (v: number) => boolean + total_balance_CustomCheck?: (v: number) => boolean + block_height_CustomCheck?: (v: number) => boolean } -export const AuthAppValidate = (o?: AuthApp, opts: AuthAppOptions = {}, path: string = 'AuthApp::root.'): Error | null => { +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') - const appErr = ApplicationValidate(o.app, opts.app_Options, `${path}.app`) - if (appErr !== null) return appErr - + 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.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`) + 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 } @@ -700,148 +686,127 @@ export type GetAppUserLNURLInfoRequest = { export const GetAppUserLNURLInfoRequestOptionalFields: [] = [] export type GetAppUserLNURLInfoRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - user_identifier_CustomCheck?: (v: string) => boolean base_url_override_CustomCheck?: (v: string) => boolean + user_identifier_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`) + 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 UserInfo = { - service_fee_bps: number - network_max_fee_bps: number - network_max_fee_fixed: number - userId: string - balance: number - max_withdrawable: number - user_identifier: string +export type PayAddressRequest = { + address: string + amoutSats: number + satsPerVByte: number } -export const UserInfoOptionalFields: [] = [] -export type UserInfoOptions = OptionsBaseMessage & { +export const PayAddressRequestOptionalFields: [] = [] +export type PayAddressRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - userId_CustomCheck?: (v: string) => boolean - balance_CustomCheck?: (v: number) => boolean - max_withdrawable_CustomCheck?: (v: number) => boolean - user_identifier_CustomCheck?: (v: string) => boolean - service_fee_bps_CustomCheck?: (v: number) => boolean - network_max_fee_bps_CustomCheck?: (v: number) => boolean - network_max_fee_fixed_CustomCheck?: (v: number) => boolean + address_CustomCheck?: (v: string) => boolean + amoutSats_CustomCheck?: (v: number) => boolean + satsPerVByte_CustomCheck?: (v: number) => boolean } -export const UserInfoValidate = (o?: UserInfo, opts: UserInfoOptions = {}, path: string = 'UserInfo::root.'): Error | null => { +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.network_max_fee_bps !== 'number') return new Error(`${path}.network_max_fee_bps: is not a number`) - if (opts.network_max_fee_bps_CustomCheck && !opts.network_max_fee_bps_CustomCheck(o.network_max_fee_bps)) return new Error(`${path}.network_max_fee_bps: custom check failed`) - - if (typeof o.network_max_fee_fixed !== 'number') return new Error(`${path}.network_max_fee_fixed: is not a number`) - if (opts.network_max_fee_fixed_CustomCheck && !opts.network_max_fee_fixed_CustomCheck(o.network_max_fee_fixed)) return new Error(`${path}.network_max_fee_fixed: custom check failed`) + 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.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`) + 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.service_fee_bps !== 'number') return new Error(`${path}.service_fee_bps: is not a number`) - if (opts.service_fee_bps_CustomCheck && !opts.service_fee_bps_CustomCheck(o.service_fee_bps)) return new Error(`${path}.service_fee_bps: 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 UserOperation = { - confirmed: boolean - tx_hash: string - internal: boolean - paidAtUnix: number - service_fee: number - amount: number - identifier: string - operationId: string - network_fee: number - type: UserOperationType - inbound: boolean +export type UserOperations = { + operations: UserOperation[] + fromIndex: number + toIndex: number } -export const UserOperationOptionalFields: [] = [] -export type UserOperationOptions = OptionsBaseMessage & { +export const UserOperationsOptionalFields: [] = [] +export type UserOperationsOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - amount_CustomCheck?: (v: number) => boolean - identifier_CustomCheck?: (v: string) => boolean - operationId_CustomCheck?: (v: string) => boolean - network_fee_CustomCheck?: (v: number) => boolean - type_CustomCheck?: (v: UserOperationType) => boolean - inbound_CustomCheck?: (v: boolean) => boolean - confirmed_CustomCheck?: (v: boolean) => boolean - tx_hash_CustomCheck?: (v: string) => boolean - internal_CustomCheck?: (v: boolean) => boolean - paidAtUnix_CustomCheck?: (v: number) => boolean - service_fee_CustomCheck?: (v: number) => boolean + operations_ItemOptions?: UserOperationOptions + operations_CustomCheck?: (v: UserOperation[]) => boolean + fromIndex_CustomCheck?: (v: number) => boolean + toIndex_CustomCheck?: (v: number) => boolean } -export const UserOperationValidate = (o?: UserOperation, opts: UserOperationOptions = {}, path: string = 'UserOperation::root.'): Error | null => { +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 (!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.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.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.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 (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 (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 (!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`) - 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`) + return null +} - 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`) +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.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`) + 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 Empty = { +export type AppsMetricsRequest = { + to_unix?: number + include_operations?: boolean + from_unix?: number } -export const EmptyOptionalFields: [] = [] -export type EmptyOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] +export type AppsMetricsRequestOptionalField = 'to_unix' | 'include_operations' | 'from_unix' +export const AppsMetricsRequestOptionalFields: AppsMetricsRequestOptionalField[] = ['to_unix', 'include_operations', 'from_unix'] +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 EmptyValidate = (o?: Empty, opts: EmptyOptions = {}, path: string = 'Empty::root.'): Error | null => { +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.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`) + + 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`) + return null } @@ -869,71 +834,74 @@ export const LndMetricsRequestValidate = (o?: LndMetricsRequest, opts: LndMetric return null } -export type LndGetInfoResponse = { - alias: string +export type GetAppUserRequest = { + user_identifier: string } -export const LndGetInfoResponseOptionalFields: [] = [] -export type LndGetInfoResponseOptions = OptionsBaseMessage & { +export const GetAppUserRequestOptionalFields: [] = [] +export type GetAppUserRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - alias_CustomCheck?: (v: string) => boolean + user_identifier_CustomCheck?: (v: string) => boolean } -export const LndGetInfoResponseValidate = (o?: LndGetInfoResponse, opts: LndGetInfoResponseOptions = {}, path: string = 'LndGetInfoResponse::root.'): Error | null => { +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.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`) + 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 PayAppUserInvoiceRequest = { - amount: number - user_identifier: string - invoice: string +export type NewAddressResponse = { + address: string } -export const PayAppUserInvoiceRequestOptionalFields: [] = [] -export type PayAppUserInvoiceRequestOptions = OptionsBaseMessage & { +export const NewAddressResponseOptionalFields: [] = [] +export type NewAddressResponseOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - invoice_CustomCheck?: (v: string) => boolean - amount_CustomCheck?: (v: number) => boolean - user_identifier_CustomCheck?: (v: string) => boolean + address_CustomCheck?: (v: string) => boolean } -export const PayAppUserInvoiceRequestValidate = (o?: PayAppUserInvoiceRequest, opts: PayAppUserInvoiceRequestOptions = {}, path: string = 'PayAppUserInvoiceRequest::root.'): Error | null => { +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.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.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.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 +} - 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`) +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 +export type AddProductRequest = { name: string price_sats: number } -export const ProductOptionalFields: [] = [] -export type ProductOptions = OptionsBaseMessage & { +export const AddProductRequestOptionalFields: [] = [] +export type AddProductRequestOptions = 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 => { +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.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`) @@ -943,24 +911,6 @@ export const ProductValidate = (o?: Product, opts: ProductOptions = {}, path: st 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 BanUserResponse = { balance_sats: number banned_app_users: BannedAppUser[] @@ -989,233 +939,447 @@ export const BanUserResponseValidate = (o?: BanUserResponse, opts: BanUserRespon return null } -export type AuthAppRequest = { - name: string - allow_user_creation?: boolean +export type SendAppUserToAppPaymentRequest = { + from_user_identifier: string + amount: number } -export type AuthAppRequestOptionalField = 'allow_user_creation' -export const AuthAppRequestOptionalFields: AuthAppRequestOptionalField[] = ['allow_user_creation'] -export type AuthAppRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: AuthAppRequestOptionalField[] - allow_user_creation_CustomCheck?: (v?: boolean) => boolean - name_CustomCheck?: (v: string) => boolean +export const SendAppUserToAppPaymentRequestOptionalFields: [] = [] +export type SendAppUserToAppPaymentRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + from_user_identifier_CustomCheck?: (v: string) => boolean + amount_CustomCheck?: (v: number) => boolean } -export const AuthAppRequestValidate = (o?: AuthAppRequest, opts: AuthAppRequestOptions = {}, path: string = 'AuthAppRequest::root.'): Error | null => { +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.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.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 ((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`) + 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`) return null } -export type PayAddressRequest = { - amoutSats: number - satsPerVByte: number - address: string +export type HandleLnurlPayResponse = { + routes: Empty[] + pr: string } -export const PayAddressRequestOptionalFields: [] = [] -export type PayAddressRequestOptions = OptionsBaseMessage & { +export const HandleLnurlPayResponseOptionalFields: [] = [] +export type HandleLnurlPayResponseOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - address_CustomCheck?: (v: string) => boolean - amoutSats_CustomCheck?: (v: number) => boolean - satsPerVByte_CustomCheck?: (v: number) => boolean + pr_CustomCheck?: (v: string) => boolean + routes_ItemOptions?: EmptyOptions + routes_CustomCheck?: (v: Empty[]) => boolean } -export const PayAddressRequestValidate = (o?: PayAddressRequest, opts: PayAddressRequestOptions = {}, path: string = 'PayAddressRequest::root.'): Error | null => { +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.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.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 (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 (!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`) - 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 GetUserOperationsRequest = { + latestIncomingInvoice: number + latestOutgoingInvoice: number + latestIncomingTx: number + latestOutgoingTx: number + latestIncomingUserToUserPayment: number + latestOutgoingUserToUserPayment: number + max_size: number +} +export const GetUserOperationsRequestOptionalFields: [] = [] +export type GetUserOperationsRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + latestOutgoingUserToUserPayment_CustomCheck?: (v: number) => boolean + max_size_CustomCheck?: (v: number) => boolean + 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 +} +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 AppsMetricsRequest = { - from_unix?: number - to_unix?: number - include_operations?: boolean +export type UserOperation = { + inbound: boolean + amount: number + identifier: string + service_fee: number + network_fee: number + confirmed: boolean + paidAtUnix: number + operationId: string + tx_hash: string + internal: boolean + type: UserOperationType } -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[] - to_unix_CustomCheck?: (v?: number) => boolean - include_operations_CustomCheck?: (v?: boolean) => boolean - from_unix_CustomCheck?: (v?: number) => boolean +export const UserOperationOptionalFields: [] = [] +export type UserOperationOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + paidAtUnix_CustomCheck?: (v: number) => boolean + inbound_CustomCheck?: (v: boolean) => boolean + amount_CustomCheck?: (v: number) => boolean + identifier_CustomCheck?: (v: string) => boolean + service_fee_CustomCheck?: (v: number) => boolean + network_fee_CustomCheck?: (v: number) => boolean + confirmed_CustomCheck?: (v: boolean) => boolean + type_CustomCheck?: (v: UserOperationType) => boolean + operationId_CustomCheck?: (v: string) => boolean + tx_hash_CustomCheck?: (v: string) => boolean + internal_CustomCheck?: (v: boolean) => boolean } -export const AppsMetricsRequestValidate = (o?: AppsMetricsRequest, opts: AppsMetricsRequestOptions = {}, path: string = 'AppsMetricsRequest::root.'): Error | null => { +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 ((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 (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 ((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 (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 ((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`) + 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.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 (!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.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.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 AppsMetrics = { - apps: AppMetrics[] +export type RequestNPubLinkingTokenResponse = { + token: string } -export const AppsMetricsOptionalFields: [] = [] -export type AppsMetricsOptions = OptionsBaseMessage & { +export const RequestNPubLinkingTokenResponseOptionalFields: [] = [] +export type RequestNPubLinkingTokenResponseOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - apps_ItemOptions?: AppMetricsOptions - apps_CustomCheck?: (v: AppMetrics[]) => boolean + token_CustomCheck?: (v: string) => boolean } -export const AppsMetricsValidate = (o?: AppsMetrics, opts: AppsMetricsOptions = {}, path: string = 'AppsMetrics::root.'): Error | null => { +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 (!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`) + 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 GetInviteTokenStateResponse = { + used: boolean +} +export const GetInviteTokenStateResponseOptionalFields: [] = [] +export type GetInviteTokenStateResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + used_CustomCheck?: (v: boolean) => boolean +} +export const GetInviteTokenStateResponseValidate = (o?: GetInviteTokenStateResponse, opts: GetInviteTokenStateResponseOptions = {}, path: string = 'GetInviteTokenStateResponse::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.used !== 'boolean') return new Error(`${path}.used: is not a boolean`) + if (opts.used_CustomCheck && !opts.used_CustomCheck(o.used)) return new Error(`${path}.used: custom check failed`) return null } export type RoutingEvent = { - incoming_htlc_id: number + incoming_channel_id: number outgoing_channel_id: number - outgoing_htlc_id: number timestamp_ns: number - event_type: string settled: boolean offchain: boolean - incoming_channel_id: number forward_fail_event: boolean + incoming_htlc_id: number + outgoing_htlc_id: number + event_type: string + incoming_amt_msat: number outgoing_amt_msat: number failure_string: string - incoming_amt_msat: number } export const RoutingEventOptionalFields: [] = [] export type RoutingEventOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - incoming_amt_msat_CustomCheck?: (v: number) => boolean - outgoing_amt_msat_CustomCheck?: (v: number) => boolean - failure_string_CustomCheck?: (v: string) => boolean 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 settled_CustomCheck?: (v: boolean) => boolean offchain_CustomCheck?: (v: boolean) => boolean forward_fail_event_CustomCheck?: (v: boolean) => boolean + incoming_htlc_id_CustomCheck?: (v: number) => boolean + outgoing_htlc_id_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 } 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.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.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.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.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.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.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.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`) - 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.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.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.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.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.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.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`) return null } -export type BannedAppUser = { - app_name: string - app_id: string - user_identifier: string - nostr_pub: string +export type LndGetInfoResponse = { + alias: string } -export const BannedAppUserOptionalFields: [] = [] -export type BannedAppUserOptions = OptionsBaseMessage & { +export const LndGetInfoResponseOptionalFields: [] = [] +export type LndGetInfoResponseOptions = 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 + alias_CustomCheck?: (v: string) => boolean } -export const BannedAppUserValidate = (o?: BannedAppUser, opts: BannedAppUserOptions = {}, path: string = 'BannedAppUser::root.'): Error | null => { +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.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.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`) - 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 +} - 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`) +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.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 ((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`) + + 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`) + + 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 PayInvoiceResponse = { + preimage: string + amount_paid: number + operation_id: string + service_fee: number + network_fee: number +} +export const PayInvoiceResponseOptionalFields: [] = [] +export type PayInvoiceResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + amount_paid_CustomCheck?: (v: number) => boolean + operation_id_CustomCheck?: (v: string) => boolean + service_fee_CustomCheck?: (v: number) => boolean + network_fee_CustomCheck?: (v: number) => boolean + preimage_CustomCheck?: (v: string) => 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 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 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 GetUserOperationsResponse = { - latestIncomingInvoiceOperations: UserOperations - latestOutgoingTxOperations: UserOperations latestIncomingTxOperations: UserOperations latestOutgoingUserToUserPayemnts: UserOperations latestIncomingUserToUserPayemnts: UserOperations latestOutgoingInvoiceOperations: UserOperations + latestIncomingInvoiceOperations: UserOperations + latestOutgoingTxOperations: UserOperations } export const GetUserOperationsResponseOptionalFields: [] = [] export type GetUserOperationsResponseOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - latestOutgoingInvoiceOperations_Options?: UserOperationsOptions latestIncomingInvoiceOperations_Options?: UserOperationsOptions latestOutgoingTxOperations_Options?: UserOperationsOptions latestIncomingTxOperations_Options?: UserOperationsOptions latestOutgoingUserToUserPayemnts_Options?: UserOperationsOptions latestIncomingUserToUserPayemnts_Options?: UserOperationsOptions + latestOutgoingInvoiceOperations_Options?: UserOperationsOptions } export const GetUserOperationsResponseValidate = (o?: GetUserOperationsResponse, opts: GetUserOperationsResponseOptions = {}, path: string = 'GetUserOperationsResponse::root.'): Error | null => { if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') @@ -1248,271 +1412,268 @@ export const GetUserOperationsResponseValidate = (o?: GetUserOperationsResponse, return null } -export type RequestNPubLinkingTokenResponse = { - token: string +export type CreateOneTimeInviteLinkRequest = { + sats?: number } -export const RequestNPubLinkingTokenResponseOptionalFields: [] = [] -export type RequestNPubLinkingTokenResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - token_CustomCheck?: (v: string) => boolean +export type CreateOneTimeInviteLinkRequestOptionalField = 'sats' +export const CreateOneTimeInviteLinkRequestOptionalFields: CreateOneTimeInviteLinkRequestOptionalField[] = ['sats'] +export type CreateOneTimeInviteLinkRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: CreateOneTimeInviteLinkRequestOptionalField[] + sats_CustomCheck?: (v?: number) => boolean } -export const RequestNPubLinkingTokenResponseValidate = (o?: RequestNPubLinkingTokenResponse, opts: RequestNPubLinkingTokenResponseOptions = {}, path: string = 'RequestNPubLinkingTokenResponse::root.'): Error | null => { +export const CreateOneTimeInviteLinkRequestValidate = (o?: CreateOneTimeInviteLinkRequest, opts: CreateOneTimeInviteLinkRequestOptions = {}, path: string = 'CreateOneTimeInviteLinkRequest::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 ((o.sats || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('sats')) && typeof o.sats !== 'number') return new Error(`${path}.sats: is not a number`) + if (opts.sats_CustomCheck && !opts.sats_CustomCheck(o.sats)) return new Error(`${path}.sats: custom check failed`) return null } -export type UsageMetric = { - handle_in_nano: number - batch: boolean - batch_size: number - parsed_in_nano: number - validate_in_nano: number - rpc_name: string - nostr: boolean - processed_at_ms: number - auth_in_nano: number +export type PayAppUserInvoiceRequest = { + user_identifier: string + invoice: string + amount: number } -export const UsageMetricOptionalFields: [] = [] -export type UsageMetricOptions = OptionsBaseMessage & { +export const PayAppUserInvoiceRequestOptionalFields: [] = [] +export type PayAppUserInvoiceRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - handle_in_nano_CustomCheck?: (v: number) => boolean - batch_CustomCheck?: (v: boolean) => boolean - batch_size_CustomCheck?: (v: number) => boolean - parsed_in_nano_CustomCheck?: (v: number) => boolean - validate_in_nano_CustomCheck?: (v: number) => boolean - rpc_name_CustomCheck?: (v: string) => boolean - nostr_CustomCheck?: (v: boolean) => boolean - processed_at_ms_CustomCheck?: (v: number) => boolean - auth_in_nano_CustomCheck?: (v: number) => boolean + user_identifier_CustomCheck?: (v: string) => boolean + invoice_CustomCheck?: (v: string) => boolean + amount_CustomCheck?: (v: number) => boolean } -export const UsageMetricValidate = (o?: UsageMetric, opts: UsageMetricOptions = {}, path: string = 'UsageMetric::root.'): Error | null => { +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.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.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.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`) - - 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.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.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.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.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.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.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.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.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 NewInvoiceRequest = { - amountSats: number - memo: string +export type PayInvoiceRequest = { + invoice: string + amount: number } -export const NewInvoiceRequestOptionalFields: [] = [] -export type NewInvoiceRequestOptions = OptionsBaseMessage & { +export const PayInvoiceRequestOptionalFields: [] = [] +export type PayInvoiceRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - memo_CustomCheck?: (v: string) => boolean - amountSats_CustomCheck?: (v: number) => boolean + invoice_CustomCheck?: (v: string) => boolean + amount_CustomCheck?: (v: number) => boolean } -export const NewInvoiceRequestValidate = (o?: NewInvoiceRequest, opts: NewInvoiceRequestOptions = {}, path: string = 'NewInvoiceRequest::root.'): Error | null => { +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.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.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.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`) + 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 OpenChannelRequest = { - closeAddress: string - destination: string - fundingAmount: number - pushAmount: number +export type LnurlLinkResponse = { + lnurl: string + k1: string } -export const OpenChannelRequestOptionalFields: [] = [] -export type OpenChannelRequestOptions = OptionsBaseMessage & { +export const LnurlLinkResponseOptionalFields: [] = [] +export type LnurlLinkResponseOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - destination_CustomCheck?: (v: string) => boolean - fundingAmount_CustomCheck?: (v: number) => boolean - pushAmount_CustomCheck?: (v: number) => boolean - closeAddress_CustomCheck?: (v: string) => boolean + lnurl_CustomCheck?: (v: string) => boolean + k1_CustomCheck?: (v: string) => boolean } -export const OpenChannelRequestValidate = (o?: OpenChannelRequest, opts: OpenChannelRequestOptions = {}, path: string = 'OpenChannelRequest::root.'): Error | null => { +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.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.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.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`) + 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 ChainBalanceEvent = { - total_balance: number - block_height: number - confirmed_balance: number - unconfirmed_balance: number +export type LnurlPayInfoResponse = { + allowsNostr: boolean + nostrPubkey: string + tag: string + callback: string + maxSendable: number + minSendable: number + metadata: string } -export const ChainBalanceEventOptionalFields: [] = [] -export type ChainBalanceEventOptions = OptionsBaseMessage & { +export const LnurlPayInfoResponseOptionalFields: [] = [] +export type LnurlPayInfoResponseOptions = 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 + 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 ChainBalanceEventValidate = (o?: ChainBalanceEvent, opts: ChainBalanceEventOptions = {}, path: string = 'ChainBalanceEvent::root.'): Error | null => { +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.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.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.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.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.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`) + 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.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.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`) + + 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`) return null } -export type GetAppUserRequest = { +export type BannedAppUser = { + nostr_pub: string + app_name: string + app_id: string user_identifier: string } -export const GetAppUserRequestOptionalFields: [] = [] -export type GetAppUserRequestOptions = OptionsBaseMessage & { +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 GetAppUserRequestValidate = (o?: GetAppUserRequest, opts: GetAppUserRequestOptions = {}, path: string = 'GetAppUserRequest::root.'): Error | null => { +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 NewAddressResponse = { - address: string +export type AddAppUserInvoiceRequest = { + receiver_identifier: string + payer_identifier: string + http_callback_url: string + invoice_req: NewInvoiceRequest } -export const NewAddressResponseOptionalFields: [] = [] -export type NewAddressResponseOptions = OptionsBaseMessage & { +export const AddAppUserInvoiceRequestOptionalFields: [] = [] +export type AddAppUserInvoiceRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - address_CustomCheck?: (v: string) => boolean + 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 NewAddressResponseValidate = (o?: NewAddressResponse, opts: NewAddressResponseOptions = {}, path: string = 'NewAddressResponse::root.'): Error | null => { +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.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.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 PayInvoiceResponse = { - network_fee: number - preimage: string - amount_paid: number - operation_id: string - service_fee: number +export type RelaysMigration = { + relays: string[] } -export const PayInvoiceResponseOptionalFields: [] = [] -export type PayInvoiceResponseOptions = OptionsBaseMessage & { +export const RelaysMigrationOptionalFields: [] = [] +export type RelaysMigrationOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - network_fee_CustomCheck?: (v: number) => boolean - preimage_CustomCheck?: (v: string) => boolean - amount_paid_CustomCheck?: (v: number) => boolean - operation_id_CustomCheck?: (v: string) => boolean - service_fee_CustomCheck?: (v: number) => boolean + relays_CustomCheck?: (v: string[]) => boolean } -export const PayInvoiceResponseValidate = (o?: PayInvoiceResponse, opts: PayInvoiceResponseOptions = {}, path: string = 'PayInvoiceResponse::root.'): Error | null => { +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 (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.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 (!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 AddProductRequest = { - name: string - price_sats: number +export type MigrationUpdate = { + closure?: ClosureMigration + relays?: RelaysMigration } -export const AddProductRequestOptionalFields: [] = [] -export type AddProductRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - name_CustomCheck?: (v: string) => boolean - price_sats_CustomCheck?: (v: number) => boolean +export type MigrationUpdateOptionalField = 'closure' | 'relays' +export const MigrationUpdateOptionalFields: MigrationUpdateOptionalField[] = ['closure', 'relays'] +export type MigrationUpdateOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: MigrationUpdateOptionalField[] + relays_Options?: RelaysMigrationOptions + closure_Options?: ClosureMigrationOptions } -export const AddProductRequestValidate = (o?: AddProductRequest, opts: AddProductRequestOptions = {}, path: string = 'AddProductRequest::root.'): Error | null => { +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.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.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.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`) + 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 EncryptionExchangeRequest = { - deviceId: string publicKey: string + deviceId: string } export const EncryptionExchangeRequestOptionalFields: [] = [] export type EncryptionExchangeRequestOptions = OptionsBaseMessage & { @@ -1533,177 +1694,114 @@ export const EncryptionExchangeRequestValidate = (o?: EncryptionExchangeRequest, return null } -export type UsersInfo = { - negative_balance: number - always_been_inactive: number - balance_avg: number - balance_median: number - total: number - no_balance: number +export type UsageMetric = { + processed_at_ms: number + handle_in_nano: number + rpc_name: string + batch: boolean + batch_size: number + parsed_in_nano: number + auth_in_nano: number + validate_in_nano: number + nostr: boolean } -export const UsersInfoOptionalFields: [] = [] -export type UsersInfoOptions = OptionsBaseMessage & { +export const UsageMetricOptionalFields: [] = [] +export type UsageMetricOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - 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 - total_CustomCheck?: (v: number) => boolean + handle_in_nano_CustomCheck?: (v: number) => boolean + rpc_name_CustomCheck?: (v: string) => boolean + batch_CustomCheck?: (v: boolean) => boolean + processed_at_ms_CustomCheck?: (v: number) => boolean + auth_in_nano_CustomCheck?: (v: number) => boolean + validate_in_nano_CustomCheck?: (v: number) => boolean + nostr_CustomCheck?: (v: boolean) => boolean + batch_size_CustomCheck?: (v: number) => boolean + parsed_in_nano_CustomCheck?: (v: number) => boolean } -export const UsersInfoValidate = (o?: UsersInfo, opts: UsersInfoOptions = {}, path: string = 'UsersInfo::root.'): Error | null => { +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.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.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`) - 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.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.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.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.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.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.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.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.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`) + 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`) - return null -} + 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`) -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.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`) - - 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.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.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.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`) return null } -export type ChannelRouting = { - channel_id: string - receive_errors: number - forward_errors_as_output: number - missed_forward_fee_as_output: number - events_number: number - send_errors: number - forward_errors_as_input: number - missed_forward_fee_as_input: number - forward_fee_as_input: number - forward_fee_as_output: number +export type SetMockInvoiceAsPaidRequest = { + invoice: string + amount: number } -export const ChannelRoutingOptionalFields: [] = [] -export type ChannelRoutingOptions = OptionsBaseMessage & { +export const SetMockInvoiceAsPaidRequestOptionalFields: [] = [] +export type SetMockInvoiceAsPaidRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - channel_id_CustomCheck?: (v: string) => boolean - receive_errors_CustomCheck?: (v: number) => boolean - forward_errors_as_output_CustomCheck?: (v: number) => boolean - missed_forward_fee_as_output_CustomCheck?: (v: number) => boolean - events_number_CustomCheck?: (v: number) => boolean - send_errors_CustomCheck?: (v: number) => boolean - forward_errors_as_input_CustomCheck?: (v: number) => boolean - missed_forward_fee_as_input_CustomCheck?: (v: number) => boolean - forward_fee_as_input_CustomCheck?: (v: number) => boolean - forward_fee_as_output_CustomCheck?: (v: number) => boolean + invoice_CustomCheck?: (v: string) => boolean + amount_CustomCheck?: (v: number) => boolean } -export const ChannelRoutingValidate = (o?: ChannelRouting, opts: ChannelRoutingOptions = {}, path: string = 'ChannelRouting::root.'): Error | null => { +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.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.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.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.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.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.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_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_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.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.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`) + 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 SendAppUserToAppPaymentRequest = { - from_user_identifier: string - amount: number +export type BanUserRequest = { + user_id: string } -export const SendAppUserToAppPaymentRequestOptionalFields: [] = [] -export type SendAppUserToAppPaymentRequestOptions = OptionsBaseMessage & { +export const BanUserRequestOptionalFields: [] = [] +export type BanUserRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - from_user_identifier_CustomCheck?: (v: string) => boolean - amount_CustomCheck?: (v: number) => boolean + user_id_CustomCheck?: (v: string) => boolean } -export const SendAppUserToAppPaymentRequestValidate = (o?: SendAppUserToAppPaymentRequest, opts: SendAppUserToAppPaymentRequestOptions = {}, path: string = 'SendAppUserToAppPaymentRequest::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.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`) + 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 SetMockAppBalanceRequest = { +export type DecodeInvoiceResponse = { amount: number } -export const SetMockAppBalanceRequestOptionalFields: [] = [] -export type SetMockAppBalanceRequestOptions = OptionsBaseMessage & { +export const DecodeInvoiceResponseOptionalFields: [] = [] +export type DecodeInvoiceResponseOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] amount_CustomCheck?: (v: number) => boolean } -export const SetMockAppBalanceRequestValidate = (o?: SetMockAppBalanceRequest, opts: SetMockAppBalanceRequestOptions = {}, path: string = 'SetMockAppBalanceRequest::root.'): Error | null => { +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') @@ -1713,411 +1811,320 @@ export const SetMockAppBalanceRequestValidate = (o?: SetMockAppBalanceRequest, o 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[] - relays_Options?: RelaysMigrationOptions - closure_Options?: ClosureMigrationOptions -} -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 ClosureMigration = { - closes_at_unix: number +export type OpenChannelRequest = { + destination: string + fundingAmount: number + pushAmount: number + closeAddress: string } -export const ClosureMigrationOptionalFields: [] = [] -export type ClosureMigrationOptions = OptionsBaseMessage & { +export const OpenChannelRequestOptionalFields: [] = [] +export type OpenChannelRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - closes_at_unix_CustomCheck?: (v: number) => boolean + closeAddress_CustomCheck?: (v: string) => boolean + destination_CustomCheck?: (v: string) => boolean + fundingAmount_CustomCheck?: (v: number) => boolean + pushAmount_CustomCheck?: (v: number) => boolean } -export const ClosureMigrationValidate = (o?: ClosureMigration, opts: ClosureMigrationOptions = {}, path: string = 'ClosureMigration::root.'): Error | null => { +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.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 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.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.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.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.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.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.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`) + 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`) return null } -export type Application = { - npub: string - name: string +export type Product = { id: string - balance: number + name: string + price_sats: number } -export const ApplicationOptionalFields: [] = [] -export type ApplicationOptions = OptionsBaseMessage & { +export const ProductOptionalFields: [] = [] +export type ProductOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - balance_CustomCheck?: (v: number) => boolean - npub_CustomCheck?: (v: string) => boolean - name_CustomCheck?: (v: string) => boolean id_CustomCheck?: (v: string) => boolean + name_CustomCheck?: (v: string) => boolean + price_sats_CustomCheck?: (v: number) => boolean } -export const ApplicationValidate = (o?: Application, opts: ApplicationOptions = {}, path: string = 'Application::root.'): Error | null => { +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.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.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.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`) + 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 AddAppUserRequest = { - identifier: string - fail_if_exists: boolean - balance: number +export type UsageMetrics = { + metrics: UsageMetric[] } -export const AddAppUserRequestOptionalFields: [] = [] -export type AddAppUserRequestOptions = OptionsBaseMessage & { +export const UsageMetricsOptionalFields: [] = [] +export type UsageMetricsOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - fail_if_exists_CustomCheck?: (v: boolean) => boolean - balance_CustomCheck?: (v: number) => boolean - identifier_CustomCheck?: (v: string) => boolean + metrics_ItemOptions?: UsageMetricOptions + metrics_CustomCheck?: (v: UsageMetric[]) => boolean } -export const AddAppUserRequestValidate = (o?: AddAppUserRequest, opts: AddAppUserRequestOptions = {}, path: string = 'AddAppUserRequest::root.'): Error | null => { +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 (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`) + 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 SetMockAppUserBalanceRequest = { - user_identifier: string - amount: number +export type LndNodeMetrics = { + closing_channels: number + channels_balance_events: ChannelBalanceEvent[] + chain_balance_events: ChainBalanceEvent[] + pending_channels: number + closed_channels: ClosedChannel[] + channel_routing: ChannelRouting[] + offline_channels: number + online_channels: number + open_channels: OpenChannel[] } -export const SetMockAppUserBalanceRequestOptionalFields: [] = [] -export type SetMockAppUserBalanceRequestOptions = OptionsBaseMessage & { +export const LndNodeMetricsOptionalFields: [] = [] +export type LndNodeMetricsOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - user_identifier_CustomCheck?: (v: string) => boolean - amount_CustomCheck?: (v: number) => boolean + offline_channels_CustomCheck?: (v: number) => boolean + online_channels_CustomCheck?: (v: number) => boolean + open_channels_ItemOptions?: OpenChannelOptions + open_channels_CustomCheck?: (v: OpenChannel[]) => boolean + closed_channels_ItemOptions?: ClosedChannelOptions + closed_channels_CustomCheck?: (v: ClosedChannel[]) => boolean + channel_routing_ItemOptions?: ChannelRoutingOptions + channel_routing_CustomCheck?: (v: ChannelRouting[]) => boolean + channels_balance_events_ItemOptions?: ChannelBalanceEventOptions + channels_balance_events_CustomCheck?: (v: ChannelBalanceEvent[]) => boolean + chain_balance_events_ItemOptions?: ChainBalanceEventOptions + chain_balance_events_CustomCheck?: (v: ChainBalanceEvent[]) => boolean + pending_channels_CustomCheck?: (v: number) => boolean + closing_channels_CustomCheck?: (v: number) => boolean } -export const SetMockAppUserBalanceRequestValidate = (o?: SetMockAppUserBalanceRequest, opts: SetMockAppUserBalanceRequestOptions = {}, path: string = 'SetMockAppUserBalanceRequest::root.'): Error | null => { +export const LndNodeMetricsValidate = (o?: LndNodeMetrics, opts: LndNodeMetricsOptions = {}, path: string = 'LndNodeMetrics::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`) + if (typeof o.closing_channels !== 'number') return new Error(`${path}.closing_channels: is not a number`) + if (opts.closing_channels_CustomCheck && !opts.closing_channels_CustomCheck(o.closing_channels)) return new Error(`${path}.closing_channels: 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 (!Array.isArray(o.channels_balance_events)) return new Error(`${path}.channels_balance_events: is not an array`) + for (let index = 0; index < o.channels_balance_events.length; index++) { + const channels_balance_eventsErr = ChannelBalanceEventValidate(o.channels_balance_events[index], opts.channels_balance_events_ItemOptions, `${path}.channels_balance_events[${index}]`) + if (channels_balance_eventsErr !== null) return channels_balance_eventsErr + } + if (opts.channels_balance_events_CustomCheck && !opts.channels_balance_events_CustomCheck(o.channels_balance_events)) return new Error(`${path}.channels_balance_events: custom check failed`) - return null -} + if (!Array.isArray(o.chain_balance_events)) return new Error(`${path}.chain_balance_events: is not an array`) + for (let index = 0; index < o.chain_balance_events.length; index++) { + const chain_balance_eventsErr = ChainBalanceEventValidate(o.chain_balance_events[index], opts.chain_balance_events_ItemOptions, `${path}.chain_balance_events[${index}]`) + if (chain_balance_eventsErr !== null) return chain_balance_eventsErr + } + if (opts.chain_balance_events_CustomCheck && !opts.chain_balance_events_CustomCheck(o.chain_balance_events)) return new Error(`${path}.chain_balance_events: custom check failed`) -export type PayAddressResponse = { - network_fee: number - txId: string - operation_id: string - service_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.pending_channels !== 'number') return new Error(`${path}.pending_channels: is not a number`) + if (opts.pending_channels_CustomCheck && !opts.pending_channels_CustomCheck(o.pending_channels)) return new Error(`${path}.pending_channels: custom check failed`) - 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 (!Array.isArray(o.closed_channels)) return new Error(`${path}.closed_channels: is not an array`) + for (let index = 0; index < o.closed_channels.length; index++) { + const closed_channelsErr = ClosedChannelValidate(o.closed_channels[index], opts.closed_channels_ItemOptions, `${path}.closed_channels[${index}]`) + if (closed_channelsErr !== null) return closed_channelsErr + } + if (opts.closed_channels_CustomCheck && !opts.closed_channels_CustomCheck(o.closed_channels)) return new Error(`${path}.closed_channels: 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 (!Array.isArray(o.channel_routing)) return new Error(`${path}.channel_routing: is not an array`) + for (let index = 0; index < o.channel_routing.length; index++) { + const channel_routingErr = ChannelRoutingValidate(o.channel_routing[index], opts.channel_routing_ItemOptions, `${path}.channel_routing[${index}]`) + if (channel_routingErr !== null) return channel_routingErr + } + if (opts.channel_routing_CustomCheck && !opts.channel_routing_CustomCheck(o.channel_routing)) return new Error(`${path}.channel_routing: 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.offline_channels !== 'number') return new Error(`${path}.offline_channels: is not a number`) + if (opts.offline_channels_CustomCheck && !opts.offline_channels_CustomCheck(o.offline_channels)) return new Error(`${path}.offline_channels: 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.online_channels !== 'number') return new Error(`${path}.online_channels: is not a number`) + if (opts.online_channels_CustomCheck && !opts.online_channels_CustomCheck(o.online_channels)) return new Error(`${path}.online_channels: custom check failed`) + + if (!Array.isArray(o.open_channels)) return new Error(`${path}.open_channels: is not an array`) + for (let index = 0; index < o.open_channels.length; index++) { + const open_channelsErr = OpenChannelValidate(o.open_channels[index], opts.open_channels_ItemOptions, `${path}.open_channels[${index}]`) + if (open_channelsErr !== null) return open_channelsErr + } + if (opts.open_channels_CustomCheck && !opts.open_channels_CustomCheck(o.open_channels)) return new Error(`${path}.open_channels: custom check failed`) return null } -export type NewInvoiceResponse = { - invoice: string +export type Application = { + name: string + id: string + balance: number + npub: string } -export const NewInvoiceResponseOptionalFields: [] = [] -export type NewInvoiceResponseOptions = OptionsBaseMessage & { +export const ApplicationOptionalFields: [] = [] +export type ApplicationOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - invoice_CustomCheck?: (v: string) => boolean + id_CustomCheck?: (v: string) => boolean + balance_CustomCheck?: (v: number) => boolean + npub_CustomCheck?: (v: string) => boolean + name_CustomCheck?: (v: string) => boolean } -export const NewInvoiceResponseValidate = (o?: NewInvoiceResponse, opts: NewInvoiceResponseOptions = {}, path: string = 'NewInvoiceResponse::root.'): Error | null => { +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.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.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 HttpCreds = { - url: string - token: string +export type AuthApp = { + app: Application + auth_token: string } -export const HttpCredsOptionalFields: [] = [] -export type HttpCredsOptions = OptionsBaseMessage & { +export const AuthAppOptionalFields: [] = [] +export type AuthAppOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - url_CustomCheck?: (v: string) => boolean - token_CustomCheck?: (v: string) => boolean + app_Options?: ApplicationOptions + auth_token_CustomCheck?: (v: string) => boolean } -export const HttpCredsValidate = (o?: HttpCreds, opts: HttpCredsOptions = {}, path: string = 'HttpCreds::root.'): Error | null => { +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') - 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`) + const appErr = ApplicationValidate(o.app, opts.app_Options, `${path}.app`) + if (appErr !== null) return appErr + - 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.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 OpenChannel = { - lifetime: number - local_balance: number - remote_balance: number - channel_id: string - capacity: number - active: boolean +export type NewInvoiceRequest = { + amountSats: number + memo: string } -export const OpenChannelOptionalFields: [] = [] -export type OpenChannelOptions = OptionsBaseMessage & { +export const NewInvoiceRequestOptionalFields: [] = [] +export type NewInvoiceRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - remote_balance_CustomCheck?: (v: number) => boolean - 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 + amountSats_CustomCheck?: (v: number) => boolean + memo_CustomCheck?: (v: string) => boolean } -export const OpenChannelValidate = (o?: OpenChannel, opts: OpenChannelOptions = {}, path: string = 'OpenChannel::root.'): Error | null => { +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.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.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.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`) + 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 SetMockInvoiceAsPaidRequest = { +export type DecodeInvoiceRequest = { invoice: string - amount: number } -export const SetMockInvoiceAsPaidRequestOptionalFields: [] = [] -export type SetMockInvoiceAsPaidRequestOptions = OptionsBaseMessage & { +export const DecodeInvoiceRequestOptionalFields: [] = [] +export type DecodeInvoiceRequestOptions = 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 => { +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.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.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 AddAppUserInvoiceRequest = { - receiver_identifier: string - payer_identifier: string - http_callback_url: string - invoice_req: NewInvoiceRequest +export type LnurlWithdrawInfoResponse = { + tag: string + callback: string + k1: string + defaultDescription: string + minWithdrawable: number + maxWithdrawable: number + balanceCheck: string + payLink: string } -export const AddAppUserInvoiceRequestOptionalFields: [] = [] -export type AddAppUserInvoiceRequestOptions = OptionsBaseMessage & { +export const LnurlWithdrawInfoResponseOptionalFields: [] = [] +export type LnurlWithdrawInfoResponseOptions = 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 DecodeInvoiceResponse = { - amount: number -} -export const DecodeInvoiceResponseOptionalFields: [] = [] -export type DecodeInvoiceResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - amount_CustomCheck?: (v: number) => boolean + balanceCheck_CustomCheck?: (v: string) => boolean + payLink_CustomCheck?: (v: string) => boolean + 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 } -export const DecodeInvoiceResponseValidate = (o?: DecodeInvoiceResponse, opts: DecodeInvoiceResponseOptions = {}, path: string = 'DecodeInvoiceResponse::root.'): Error | null => { +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.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 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.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.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`) + 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`) - return null -} + 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`) -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 (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 (!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`) + 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`) - return null -} + 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`) -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.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.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.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`) return null } @@ -2145,6 +2152,29 @@ export const LinkNPubThroughTokenRequestValidate = (o?: LinkNPubThroughTokenRequ 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 LndMetrics = { nodes: LndNodeMetrics[] } @@ -2168,248 +2198,327 @@ export const LndMetricsValidate = (o?: LndMetrics, opts: LndMetricsOptions = {}, return null } -export type AppUser = { - info: UserInfo - max_withdrawable: number - identifier: string +export type LndGetInfoRequest = { + nodeId: number } -export const AppUserOptionalFields: [] = [] -export type AppUserOptions = OptionsBaseMessage & { +export const LndGetInfoRequestOptionalFields: [] = [] +export type LndGetInfoRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - identifier_CustomCheck?: (v: string) => boolean - info_Options?: UserInfoOptions - max_withdrawable_CustomCheck?: (v: number) => boolean + nodeId_CustomCheck?: (v: number) => boolean } -export const AppUserValidate = (o?: AppUser, opts: AppUserOptions = {}, path: string = 'AppUser::root.'): Error | null => { +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.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.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`) - const infoErr = UserInfoValidate(o.info, opts.info_Options, `${path}.info`) - if (infoErr !== null) return infoErr - + return null +} - 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`) +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 AddAppInvoiceRequest = { - payer_identifier: string - http_callback_url: string - invoice_req: NewInvoiceRequest +export type PayAddressResponse = { + service_fee: number + network_fee: number + txId: string + operation_id: string } -export const AddAppInvoiceRequestOptionalFields: [] = [] -export type AddAppInvoiceRequestOptions = OptionsBaseMessage & { +export const PayAddressResponseOptionalFields: [] = [] +export type PayAddressResponseOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - payer_identifier_CustomCheck?: (v: string) => boolean - http_callback_url_CustomCheck?: (v: string) => boolean - invoice_req_Options?: NewInvoiceRequestOptions + network_fee_CustomCheck?: (v: number) => boolean + txId_CustomCheck?: (v: string) => boolean + operation_id_CustomCheck?: (v: string) => boolean + service_fee_CustomCheck?: (v: number) => boolean } -export const AddAppInvoiceRequestValidate = (o?: AddAppInvoiceRequest, opts: AddAppInvoiceRequestOptions = {}, path: string = 'AddAppInvoiceRequest::root.'): Error | null => { +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.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.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.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`) + 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`) - const invoice_reqErr = NewInvoiceRequestValidate(o.invoice_req, opts.invoice_req_Options, `${path}.invoice_req`) - if (invoice_reqErr !== null) return invoice_reqErr - + 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`) return null } -export type UserOperations = { - toIndex: number - operations: UserOperation[] - fromIndex: number +export type UserInfo = { + userId: string + balance: number + max_withdrawable: number + user_identifier: string + service_fee_bps: number + network_max_fee_bps: number + network_max_fee_fixed: number } -export const UserOperationsOptionalFields: [] = [] -export type UserOperationsOptions = OptionsBaseMessage & { +export const UserInfoOptionalFields: [] = [] +export type UserInfoOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - fromIndex_CustomCheck?: (v: number) => boolean - toIndex_CustomCheck?: (v: number) => boolean - operations_ItemOptions?: UserOperationOptions - operations_CustomCheck?: (v: UserOperation[]) => boolean + network_max_fee_bps_CustomCheck?: (v: number) => boolean + network_max_fee_fixed_CustomCheck?: (v: number) => boolean + userId_CustomCheck?: (v: string) => boolean + balance_CustomCheck?: (v: number) => boolean + max_withdrawable_CustomCheck?: (v: number) => boolean + user_identifier_CustomCheck?: (v: string) => boolean + service_fee_bps_CustomCheck?: (v: number) => boolean } -export const UserOperationsValidate = (o?: UserOperations, opts: UserOperationsOptions = {}, path: string = 'UserOperations::root.'): Error | null => { +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.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.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.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 (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 (!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`) + 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.service_fee_bps !== 'number') return new Error(`${path}.service_fee_bps: is not a number`) + if (opts.service_fee_bps_CustomCheck && !opts.service_fee_bps_CustomCheck(o.service_fee_bps)) return new Error(`${path}.service_fee_bps: custom check failed`) + + if (typeof o.network_max_fee_bps !== 'number') return new Error(`${path}.network_max_fee_bps: is not a number`) + if (opts.network_max_fee_bps_CustomCheck && !opts.network_max_fee_bps_CustomCheck(o.network_max_fee_bps)) return new Error(`${path}.network_max_fee_bps: custom check failed`) + + if (typeof o.network_max_fee_fixed !== 'number') return new Error(`${path}.network_max_fee_fixed: is not a number`) + if (opts.network_max_fee_fixed_CustomCheck && !opts.network_max_fee_fixed_CustomCheck(o.network_max_fee_fixed)) return new Error(`${path}.network_max_fee_fixed: custom check failed`) + + 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`) return null } -export type BanUserRequest = { - user_id: string +export type HttpCreds = { + token: string + url: string } -export const BanUserRequestOptionalFields: [] = [] -export type BanUserRequestOptions = OptionsBaseMessage & { +export const HttpCredsOptionalFields: [] = [] +export type HttpCredsOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - user_id_CustomCheck?: (v: string) => boolean + url_CustomCheck?: (v: string) => boolean + token_CustomCheck?: (v: string) => boolean } -export const BanUserRequestValidate = (o?: BanUserRequest, opts: BanUserRequestOptions = {}, path: string = 'BanUserRequest::root.'): Error | null => { +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.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`) + 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 NewAddressRequest = { - addressType: AddressType +export type OpenChannel = { + channel_id: string + capacity: number + active: boolean + lifetime: number + local_balance: number + remote_balance: number } -export const NewAddressRequestOptionalFields: [] = [] -export type NewAddressRequestOptions = OptionsBaseMessage & { +export const OpenChannelOptionalFields: [] = [] +export type OpenChannelOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - addressType_CustomCheck?: (v: AddressType) => boolean + local_balance_CustomCheck?: (v: number) => boolean + remote_balance_CustomCheck?: (v: number) => boolean + channel_id_CustomCheck?: (v: string) => boolean + capacity_CustomCheck?: (v: number) => boolean + active_CustomCheck?: (v: boolean) => boolean + lifetime_CustomCheck?: (v: number) => boolean } -export const NewAddressRequestValidate = (o?: NewAddressRequest, opts: NewAddressRequestOptions = {}, path: string = 'NewAddressRequest::root.'): Error | null => { +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 (!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.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 DecodeInvoiceRequest = { - invoice: string +export type ClosedChannel = { + channel_id: string + capacity: number + closed_height: number } -export const DecodeInvoiceRequestOptionalFields: [] = [] -export type DecodeInvoiceRequestOptions = OptionsBaseMessage & { +export const ClosedChannelOptionalFields: [] = [] +export type ClosedChannelOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - invoice_CustomCheck?: (v: string) => boolean + channel_id_CustomCheck?: (v: string) => boolean + capacity_CustomCheck?: (v: number) => boolean + closed_height_CustomCheck?: (v: number) => boolean } -export const DecodeInvoiceRequestValidate = (o?: DecodeInvoiceRequest, opts: DecodeInvoiceRequestOptions = {}, path: string = 'DecodeInvoiceRequest::root.'): Error | null => { +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.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.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 LnurlWithdrawInfoResponse = { - balanceCheck: string - payLink: string - tag: string - callback: string - k1: string - defaultDescription: string - minWithdrawable: number - maxWithdrawable: number +export type ChannelRouting = { + receive_errors: number + forward_errors_as_output: number + missed_forward_fee_as_output: number + forward_fee_as_input: number + events_number: number + channel_id: string + send_errors: number + forward_errors_as_input: number + missed_forward_fee_as_input: number + forward_fee_as_output: number } -export const LnurlWithdrawInfoResponseOptionalFields: [] = [] -export type LnurlWithdrawInfoResponseOptions = OptionsBaseMessage & { +export const ChannelRoutingOptionalFields: [] = [] +export type ChannelRoutingOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - maxWithdrawable_CustomCheck?: (v: number) => boolean - balanceCheck_CustomCheck?: (v: string) => boolean - payLink_CustomCheck?: (v: string) => boolean - 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 + forward_errors_as_output_CustomCheck?: (v: number) => boolean + missed_forward_fee_as_output_CustomCheck?: (v: number) => boolean + forward_fee_as_input_CustomCheck?: (v: number) => boolean + events_number_CustomCheck?: (v: number) => boolean + receive_errors_CustomCheck?: (v: number) => boolean + send_errors_CustomCheck?: (v: number) => boolean + forward_errors_as_input_CustomCheck?: (v: number) => boolean + missed_forward_fee_as_input_CustomCheck?: (v: number) => boolean + forward_fee_as_output_CustomCheck?: (v: number) => boolean + channel_id_CustomCheck?: (v: string) => boolean } -export const LnurlWithdrawInfoResponseValidate = (o?: LnurlWithdrawInfoResponse, opts: LnurlWithdrawInfoResponseOptions = {}, path: string = 'LnurlWithdrawInfoResponse::root.'): Error | null => { +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.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.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`) - 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.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.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.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.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.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.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.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.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`) + 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.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.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.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.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.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.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`) return null } -export type GetUserOperationsRequest = { - latestIncomingUserToUserPayment: number - latestOutgoingUserToUserPayment: number - max_size: number - latestIncomingInvoice: number - latestOutgoingInvoice: number - latestIncomingTx: number - latestOutgoingTx: number +export type AddAppRequest = { + name: string + allow_user_creation: boolean } -export const GetUserOperationsRequestOptionalFields: [] = [] -export type GetUserOperationsRequestOptions = OptionsBaseMessage & { +export const AddAppRequestOptionalFields: [] = [] +export type AddAppRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - latestIncomingUserToUserPayment_CustomCheck?: (v: number) => boolean - latestOutgoingUserToUserPayment_CustomCheck?: (v: number) => boolean - max_size_CustomCheck?: (v: number) => boolean - latestIncomingInvoice_CustomCheck?: (v: number) => boolean - latestOutgoingInvoice_CustomCheck?: (v: number) => boolean - latestIncomingTx_CustomCheck?: (v: number) => boolean - latestOutgoingTx_CustomCheck?: (v: number) => boolean + name_CustomCheck?: (v: string) => boolean + allow_user_creation_CustomCheck?: (v: boolean) => boolean } -export const GetUserOperationsRequestValidate = (o?: GetUserOperationsRequest, opts: GetUserOperationsRequestOptions = {}, path: string = 'GetUserOperationsRequest::root.'): Error | null => { +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.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`) + 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.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.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`) - 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`) + return null +} - 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`) +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.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.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.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.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.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.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 ec1860184..03047a606 100644 --- a/proto/service/methods.proto +++ b/proto/service/methods.proto @@ -53,6 +53,20 @@ option (file_options) = { key:"app_id", value: "string" } + }, + { + id: "guestPub", + name: "GuestWithPub", + context:[ + { + key: "pub", + value:"string" + }, + { + key: "app_id", + value: "string" + } + ] } ]; }; @@ -137,6 +151,20 @@ service LightningPub { option (nostr) = true; } + rpc CreateOneTimeInviteLink(structs.CreateOneTimeInviteLinkRequest) returns (structs.CreateOneTimeInviteLinkResponse) { + option (auth_type) = "Admin"; + option (http_method) = "post"; + option (http_route) = "/api/admin/app/invite/create"; + option (nostr) = true; + } + + rpc GetInviteLinkState(structs.GetInviteTokenStateRequest) returns (structs.GetInviteTokenStateResponse) { + option (auth_type) = "Admin"; + option (http_method) = "post"; + option (http_route) = "/api/admin/app/invite/get"; + option (nostr) = true; + } + // @@ -187,19 +215,30 @@ service LightningPub { option (http_route) = "/.well-known/lnurlp/:address_name"; } - rpc LinkNPubThroughToken(structs.LinkNPubThroughTokenRequest) returns (structs.Empty) { + rpc EnrollAdminToken(structs.EnrollAdminTokenRequest) returns (structs.Empty) { option (auth_type) = "User"; option (http_method) = "post"; + option (http_route) = "/api/guest/npub/enroll/admin"; + option (nostr) = true; + } + // + + + // + rpc LinkNPubThroughToken(structs.LinkNPubThroughTokenRequest) returns (structs.Empty) { + option (auth_type) = "GuestWithPub"; + option (http_method) = "post"; option (http_route) = "/api/guest/npub/link"; option (nostr) = true; } - rpc EnrollAdminToken(structs.EnrollAdminTokenRequest) returns (structs.Empty) { - option (auth_type) = "User"; + + rpc UseInviteLink(structs.UseInviteLinkRequest) returns (structs.Empty) { + option (auth_type) = "GuestWithPub"; option (http_method) = "post"; - option (http_route) = "/api/guest/npub/enroll/admin"; + option (http_route) = "/api/guest/invite"; option (nostr) = true; } - // + // // rpc GetApp(structs.Empty) returns (structs.Application) { diff --git a/proto/service/structs.proto b/proto/service/structs.proto index 52c80cb22..9d6f5e0c5 100644 --- a/proto/service/structs.proto +++ b/proto/service/structs.proto @@ -453,4 +453,25 @@ message HttpCreds { message EnrollAdminTokenRequest { string admin_token = 1; +} + +message CreateOneTimeInviteLinkRequest { + optional int64 sats = 1; +} + +message CreateOneTimeInviteLinkResponse { + string invitation_link = 1; +} + +message UseInviteLinkRequest { + string invite_token = 1; +} + + +message GetInviteTokenStateRequest { + string invite_token = 1; +} + +message GetInviteTokenStateResponse { + bool used = 1; } \ No newline at end of file diff --git a/src/auth.ts b/src/auth.ts index b5fa93dd4..aba27bff6 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -12,6 +12,7 @@ const serverOptions = (mainHandler: Main): ServerOptions => { MetricsAuthGuard: metricsAuth, AppAuthGuard: async (authHeader) => { return { app_id: mainHandler.applicationManager.DecodeAppToken(stripBearer(authHeader)) } }, UserAuthGuard: async (authHeader) => { return mainHandler.appUserManager.DecodeUserToken(stripBearer(authHeader)) }, + GuestWithPubAuthGuard: async (_) => { throw new Error("Nostr only route") }, GuestAuthGuard: async (_) => ({}), metricsCallback: metrics => mainHandler.settings.recordPerformance ? mainHandler.metricsManager.AddMetrics(metrics) : null, allowCors: true, diff --git a/src/nostrMiddleware.ts b/src/nostrMiddleware.ts index 021266ef5..522d2ca6f 100644 --- a/src/nostrMiddleware.ts +++ b/src/nostrMiddleware.ts @@ -28,7 +28,13 @@ export default (serverMethods: Types.ServerMethods, mainHandler: Main, nostrSett return { operator_id: pub } }, metricsCallback: metrics => mainHandler.settings.recordPerformance ? mainHandler.metricsManager.AddMetrics(metrics) : null, - logger: { log: console.log, error: err => log(ERROR, err) } + NostrGuestWithPubAuthGuard: async (appId, pub) => { + if (!pub || !appId) { + throw new Error("Unknown error occured") + } + return { pub, app_id: appId } + }, + logger: { log: console.log, error: err => log(ERROR, err) }, }) const nostr = new Nostr(nostrSettings, event => { let j: NostrRequest diff --git a/src/services/main/adminManager.ts b/src/services/main/adminManager.ts index f4aa302d2..6f6b2ce30 100644 --- a/src/services/main/adminManager.ts +++ b/src/services/main/adminManager.ts @@ -3,6 +3,7 @@ import crypto from 'crypto' import { getLogger } from "../helpers/logger.js"; import { MainSettings, getDataPath } from "./settings.js"; import Storage from "../storage/index.js"; +import * as Types from '../../../proto/autogenerated/ts/types.js' export class AdminManager { storage: Storage log = getLogger({ component: "adminManager" }) @@ -112,4 +113,25 @@ export class AdminManager { fs.unlinkSync(this.adminConnectPath) this.adminNpub = npub } + + CreateInviteLink = async (adminNpub: string, sats?: number): Promise => { + const adminAppUser = await this.storage.applicationStorage.FindNostrAppUser(adminNpub) + if (!adminAppUser) { + throw new Error("Admin user expected but not found!!!"); + } + const newInviteToken = await this.storage.applicationStorage.AddInviteToken(adminAppUser.application, sats); + return { + invitation_link: newInviteToken.inviteToken + } + } + + async GetInviteTokenState(ctx: Types.AdminContext, req: Types.GetInviteTokenStateRequest): Promise { + const inviteToken = await this.storage.applicationStorage.FindInviteToken(req.invite_token); + if (!inviteToken) { + throw new Error("Invite token not found"); + } + return { + used: inviteToken.used + } + } } \ No newline at end of file diff --git a/src/services/main/applicationManager.ts b/src/services/main/applicationManager.ts index a75a591cb..b78632acd 100644 --- a/src/services/main/applicationManager.ts +++ b/src/services/main/applicationManager.ts @@ -244,27 +244,29 @@ export default class { - async LinkNpubThroughToken(ctx: Types.UserContext, req: Types.LinkNPubThroughTokenRequest): Promise { - const { app_id: appId, app_user_id: appUserId } = ctx - const app = await this.storage.applicationStorage.GetApplication(appId) - const appUser = await this.storage.applicationStorage.GetApplicationUser(app, appUserId) - await this.storage.txQueue.PushToQueue({ - dbTx: true, - exec: async tx => { - await this.storage.applicationStorage.RemoveApplicationUserAndBaseUser(appUser, tx); - const entry = this.nPubLinkingTokens.get(req.token) - if (entry && entry.expiry > Date.now()) { - const copy = { ...entry } - const deleted = this.nPubLinkingTokens.delete(req.token) - if (deleted) { - await this.storage.applicationStorage.AddNPubToApplicationUser(copy.serialId, req.nostr_pub, tx) - } else { - throw new Error("An uknown error occured") - } - } else { - throw new Error("Token invalid or expired") - } + async LinkNpubThroughToken(ctx: Types.GuestWithPubContext, req: Types.LinkNPubThroughTokenRequest): Promise { + const entry = this.nPubLinkingTokens.get(req.token) + if (entry && entry.expiry > Date.now()) { + const copy = { ...entry } + const deleted = this.nPubLinkingTokens.delete(req.token) + if (deleted) { + await this.storage.applicationStorage.AddNPubToApplicationUser(copy.serialId, req.nostr_pub) + } else { + throw new Error("An uknown error occured") } - }) + } else { + throw new Error("Token invalid or expired") + } + } + + async UseInviteLink(ctx: Types.GuestWithPubContext, req: Types.UseInviteLinkRequest): Promise { + const app = await this.storage.applicationStorage.GetApplication(ctx.app_id); + const inviteToken = await this.storage.applicationStorage.FindInviteToken(req.invite_token); + if (!inviteToken || inviteToken.used || inviteToken.application.app_id !== ctx.app_id) { + throw new Error("Invite token not found"); + } + await this.storage.applicationStorage.AddApplicationUser(app, crypto.randomBytes(32).toString('hex'), 0, ctx.pub) + await this.storage.applicationStorage.SetInviteTokenAsUsed(inviteToken); + } } \ No newline at end of file diff --git a/src/services/main/liquidityProvider.ts b/src/services/main/liquidityProvider.ts index fabab3af2..0c30a07a1 100644 --- a/src/services/main/liquidityProvider.ts +++ b/src/services/main/liquidityProvider.ts @@ -45,6 +45,7 @@ export class LiquidityProvider { retrieveNostrUserAuth: async () => this.myPub, retrieveNostrAdminAuth: async () => this.myPub, retrieveNostrMetricsAuth: async () => this.myPub, + retrieveNostrGuestWithPubAuth: async () => this.myPub }, this.clientSend, this.clientSub) this.configuredInterval = setInterval(() => { diff --git a/src/services/serverMethods/index.ts b/src/services/serverMethods/index.ts index 0f385ce12..7e0c03b3c 100644 --- a/src/services/serverMethods/index.ts +++ b/src/services/serverMethods/index.ts @@ -222,5 +222,27 @@ export default (mainHandler: Main): Types.ServerMethods => { if (err != null) throw new Error(err.message) return mainHandler.adminManager.PromoteUserToAdmin(ctx.app_id, ctx.app_user_id, req.admin_token) }, + CreateOneTimeInviteLink: async ({ ctx, req }) => { + const err = Types.CreateOneTimeInviteLinkRequestValidate(req, { + sats_CustomCheck: sats => sats === undefined || typeof sats === "number" + }) + if (err != null) throw new Error(err.message) + return mainHandler.adminManager.CreateInviteLink(ctx.admin_id, req.sats) + }, + UseInviteLink: async ({ ctx, req }) => { + const err = Types.UseInviteLinkRequestValidate(req, { + invite_token_CustomCheck: token => token !== '' + }) + if (err != null) throw new Error(err.message) + return mainHandler.applicationManager.UseInviteLink(ctx, req); + }, + GetInviteLinkState: async ({ ctx, req }) => { + const err = Types.GetInviteTokenStateRequestValidate(req, { + invite_token_CustomCheck: token => token !== '' + }) + if (err != null) throw new Error(err.message) + return mainHandler.adminManager.GetInviteTokenState(ctx, req); + } + } } \ No newline at end of file diff --git a/src/services/storage/applicationStorage.ts b/src/services/storage/applicationStorage.ts index d025835cf..30e1bc6ee 100644 --- a/src/services/storage/applicationStorage.ts +++ b/src/services/storage/applicationStorage.ts @@ -7,6 +7,7 @@ import { ApplicationUser } from './entity/ApplicationUser.js'; import { getLogger } from '../helpers/logger.js'; import TransactionsQueue, { TX } from "./transactionsQueue.js"; import { User } from './entity/User.js'; +import { InviteToken } from './entity/InviteToken.js'; export default class { DB: DataSource | EntityManager userStorage: UserStorage @@ -169,4 +170,32 @@ export default class { await entityManager.getRepository(ApplicationUser).remove(appUser); await entityManager.getRepository(User).remove(baseUser); } + + + async AddInviteToken(app: Application, sats?: number) { + return this.txQueue.PushToQueue({ + dbTx: false, + exec:async tx => { + const inviteRepo = tx.getRepository(InviteToken); + const newInviteToken = inviteRepo.create({ + inviteToken: crypto.randomBytes(32).toString('hex'), + used: false, + sats: sats, + application: app + }); + + return inviteRepo.save(newInviteToken) + } + }) + } + + async FindInviteToken(token: string) { + return this.DB.getRepository(InviteToken).findOne({ where: { inviteToken: token } }) + } + + + async SetInviteTokenAsUsed(inviteToken: InviteToken) { + return this.DB.getRepository(InviteToken).update(inviteToken, { used: true }); + + } } \ No newline at end of file diff --git a/src/services/storage/db.ts b/src/services/storage/db.ts index 7993a3cb3..27e47dc87 100644 --- a/src/services/storage/db.ts +++ b/src/services/storage/db.ts @@ -20,6 +20,7 @@ import { LspOrder } from "./entity/LspOrder.js" import { Product } from "./entity/Product.js" import { LndNodeInfo } from "./entity/LndNodeInfo.js" import { TrackedProvider } from "./entity/TrackedProvider.js" +import { InviteToken } from "./entity/InviteToken.js" export type DbSettings = { @@ -59,7 +60,9 @@ export default async (settings: DbSettings, migrations: Function[]): Promise<{ s database: settings.databaseFile, // logging: true, entities: [User, UserReceivingInvoice, UserReceivingAddress, AddressReceivingTransaction, UserInvoicePayment, UserTransactionPayment, - UserBasicAuth, UserEphemeralKey, Product, UserToUserPayment, Application, ApplicationUser, UserToUserPayment, LspOrder, LndNodeInfo, TrackedProvider], + UserBasicAuth, UserEphemeralKey, Product, UserToUserPayment, Application, ApplicationUser, UserToUserPayment, LspOrder, LndNodeInfo, TrackedProvider, + InviteToken + ], //synchronize: true, migrations }).initialize() diff --git a/src/services/storage/entity/InviteToken.ts b/src/services/storage/entity/InviteToken.ts new file mode 100644 index 000000000..6ec433b3b --- /dev/null +++ b/src/services/storage/entity/InviteToken.ts @@ -0,0 +1,28 @@ +import { Entity, PrimaryGeneratedColumn, Column, Index, CreateDateColumn, UpdateDateColumn, ManyToOne, JoinColumn } from "typeorm"; +import { Application } from "./Application.js"; + +@Entity() +export class InviteToken { + @PrimaryGeneratedColumn() + serial_id: number + + @Column({ unique: true }) + @Index("IDX_invite_token") + inviteToken: string + + @ManyToOne(type => Application, { eager: true }) + @JoinColumn() + application: Application + + @Column({ nullable: true }) + sats: number + + @Column() + used: boolean + + @CreateDateColumn() + created_at: Date + + @UpdateDateColumn() + updated_at: Date +} diff --git a/src/services/storage/migrations/1721751414878-create_invite_token_table.ts b/src/services/storage/migrations/1721751414878-create_invite_token_table.ts new file mode 100644 index 000000000..c96d6a384 --- /dev/null +++ b/src/services/storage/migrations/1721751414878-create_invite_token_table.ts @@ -0,0 +1,28 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class CreateInviteTokenTable1721751414878 implements MigrationInterface { + name = 'CreateInviteTokenTable1721751414878' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`CREATE TABLE "invite_token" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "inviteToken" varchar NOT NULL, "sats" integer, "used" boolean NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "applicationSerialId" integer, CONSTRAINT "UQ_0ded0098656758c761f14a43c58" UNIQUE ("inviteToken"))`); + await queryRunner.query(`CREATE INDEX "IDX_invite_token" ON "invite_token" ("inviteToken") `); + await queryRunner.query(`DROP INDEX "IDX_invite_token"`); + await queryRunner.query(`CREATE TABLE "temporary_invite_token" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "inviteToken" varchar NOT NULL, "sats" integer, "used" boolean NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "applicationSerialId" integer, CONSTRAINT "UQ_0ded0098656758c761f14a43c58" UNIQUE ("inviteToken"), CONSTRAINT "FK_a1f025b46b1438eae2a08932169" FOREIGN KEY ("applicationSerialId") REFERENCES "application" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); + await queryRunner.query(`INSERT INTO "temporary_invite_token"("serial_id", "inviteToken", "sats", "used", "created_at", "updated_at", "applicationSerialId") SELECT "serial_id", "inviteToken", "sats", "used", "created_at", "updated_at", "applicationSerialId" FROM "invite_token"`); + await queryRunner.query(`DROP TABLE "invite_token"`); + await queryRunner.query(`ALTER TABLE "temporary_invite_token" RENAME TO "invite_token"`); + await queryRunner.query(`CREATE INDEX "IDX_invite_token" ON "invite_token" ("inviteToken") `); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`DROP INDEX "IDX_invite_token"`); + await queryRunner.query(`ALTER TABLE "invite_token" RENAME TO "temporary_invite_token"`); + await queryRunner.query(`CREATE TABLE "invite_token" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "inviteToken" varchar NOT NULL, "sats" integer, "used" boolean NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "applicationSerialId" integer, CONSTRAINT "UQ_0ded0098656758c761f14a43c58" UNIQUE ("inviteToken"))`); + await queryRunner.query(`INSERT INTO "invite_token"("serial_id", "inviteToken", "sats", "used", "created_at", "updated_at", "applicationSerialId") SELECT "serial_id", "inviteToken", "sats", "used", "created_at", "updated_at", "applicationSerialId" FROM "temporary_invite_token"`); + await queryRunner.query(`DROP TABLE "temporary_invite_token"`); + await queryRunner.query(`CREATE INDEX "IDX_invite_token" ON "invite_token" ("inviteToken") `); + await queryRunner.query(`DROP INDEX "IDX_invite_token"`); + await queryRunner.query(`DROP TABLE "invite_token"`); + } + +} diff --git a/src/services/storage/migrations/runner.ts b/src/services/storage/migrations/runner.ts index 2f09dc5e1..18f0b19d9 100644 --- a/src/services/storage/migrations/runner.ts +++ b/src/services/storage/migrations/runner.ts @@ -8,7 +8,8 @@ import { LspOrder1718387847693 } from './1718387847693-lsp_order.js' import { LiquidityProvider1719335699480 } from './1719335699480-liquidity_provider.js' import { LndNodeInfo1720187506189 } from './1720187506189-lnd_node_info.js' import { TrackedProvider1720814323679 } from './1720814323679-tracked_provider.js' -const allMigrations = [Initial1703170309875, LspOrder1718387847693, LiquidityProvider1719335699480, LndNodeInfo1720187506189, TrackedProvider1720814323679] +import { CreateInviteTokenTable1721751414878 } from "./1721751414878-create_invite_token_table.js" +const allMigrations = [Initial1703170309875, LspOrder1718387847693, LiquidityProvider1719335699480, LndNodeInfo1720187506189, TrackedProvider1720814323679, CreateInviteTokenTable1721751414878] const allMetricsMigrations = [LndMetrics1703170330183, ChannelRouting1709316653538] export const TypeOrmMigrationRunner = async (log: PubLogger, storageManager: Storage, settings: DbSettings, arg: string | undefined): Promise => { if (arg === 'fake_initial_migration') { diff --git a/static/status.html b/static/status.html index 2c6d87870..44210dc68 100644 --- a/static/status.html +++ b/static/status.html @@ -167,8 +167,8 @@

Node Status

document.getElementById("relayStatus").innerHTML = ` ${j.relay_connected ? 'Connected' : 'Disconnected'}` document.getElementById("lndStatus").innerHTML = ` ${j.lnd_state}` document.getElementById("watchdog-status").innerHTML = ` ${j.watchdog_ok ? 'No Alerts' : 'ALERT!!'}` - document.getElementById("inviteLinkHttp").href = `https://my.shockwallet.app/#/source?addSource=${j.nprofile}` - document.getElementById("inviteLinkHttp").innerHTML = `https://my.shockwallet.app/#/source?addSource=${j.nprofile}` + document.getElementById("inviteLinkHttp").href = `https://my.shockwallet.app/#/sources?addSource=${j.nprofile}` + document.getElementById("inviteLinkHttp").innerHTML = `https://my.shockwallet.app/#/sources?addSource=${j.nprofile}` document.querySelector('input[name="show-nodey"]').placeholder = j.provider_name; document.title = j.provider_name; }