events number

This commit is contained in:
boufni95 2024-03-01 19:59:36 +01:00
parent d48a0fda22
commit f9c5b11e8f
5 changed files with 4022 additions and 4004 deletions

View file

@ -110,9 +110,9 @@ The nostr server will send back a message response, and inside the body there wi
- __User__: - __User__:
- expected context content - expected context content
- __user_id__: _string_
- __app_id__: _string_ - __app_id__: _string_
- __app_user_id__: _string_ - __app_user_id__: _string_
- __user_id__: _string_
- __Admin__: - __Admin__:
- expected context content - expected context content
@ -444,34 +444,6 @@ The nostr server will send back a message response, and inside the body there wi
## Messages ## Messages
### The content of requests and response from the methods ### The content of requests and response from the methods
### EncryptionExchangeRequest
- __publicKey__: _string_
- __deviceId__: _string_
### DecodeInvoiceResponse
- __amount__: _number_
### SetMockAppUserBalanceRequest
- __user_identifier__: _string_
- __amount__: _number_
### NewAddressRequest
- __addressType__: _[AddressType](#AddressType)_
### NewInvoiceRequest
- __amountSats__: _number_
- __memo__: _string_
### UserInfo
- __userId__: _string_
- __balance__: _number_
- __max_withdrawable__: _number_
- __user_identifier__: _string_
### MigrationUpdate
- __closure__: _[ClosureMigration](#ClosureMigration)_ *this field is optional
- __relays__: _[RelaysMigration](#RelaysMigration)_ *this field is optional
### ChannelRouting ### ChannelRouting
- __channel_id__: _string_ - __channel_id__: _string_
- __send_errors__: _number_ - __send_errors__: _number_
@ -482,79 +454,16 @@ The nostr server will send back a message response, and inside the body there wi
- __missed_forward_fee_as_output__: _number_ - __missed_forward_fee_as_output__: _number_
- __forward_fee_as_input__: _number_ - __forward_fee_as_input__: _number_
- __forward_fee_as_output__: _number_ - __forward_fee_as_output__: _number_
- __events_number__: _number_
### AddAppRequest ### AddAppInvoiceRequest
- __name__: _string_ - __payer_identifier__: _string_
- __allow_user_creation__: _boolean_ - __http_callback_url__: _string_
- __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_
### PayAddressResponse ### GetAppUserLNURLInfoRequest
- __txId__: _string_ - __user_identifier__: _string_
- __operation_id__: _string_ - __base_url_override__: _string_
- __service_fee__: _number_
- __network_fee__: _number_
### RelaysMigration
- __relays__: ARRAY of: _string_
### Empty
### LndMetricsRequest
- __from_unix__: _number_ *this field is optional
- __to_unix__: _number_ *this field is optional
### OpenChannel
- __channel_id__: _string_
- __capacity__: _number_
- __active__: _boolean_
- __lifetime__: _number_
- __local_balance__: _number_
- __remote_balance__: _number_
### Application
- __name__: _string_
- __id__: _string_
- __balance__: _number_
- __npub__: _string_
### SendAppUserToAppPaymentRequest
- __from_user_identifier__: _string_
- __amount__: _number_
### UserOperations
- __fromIndex__: _number_
- __toIndex__: _number_
- __operations__: ARRAY of: _[UserOperation](#UserOperation)_
### GetProductBuyLinkResponse
- __link__: _string_
### AddAppUserRequest
- __identifier__: _string_
- __fail_if_exists__: _boolean_
- __balance__: _number_
### AppUser
- __identifier__: _string_
- __info__: _[UserInfo](#UserInfo)_
- __max_withdrawable__: _number_
### OpenChannelResponse
- __channelId__: _string_
### GetUserOperationsRequest
- __latestIncomingInvoice__: _number_
- __latestOutgoingInvoice__: _number_
- __latestIncomingTx__: _number_
- __latestOutgoingTx__: _number_
- __latestIncomingUserToUserPayment__: _number_
- __latestOutgoingUserToUserPayment__: _number_
- __max_size__: _number_
### ChainBalanceEvent
- __block_height__: _number_
- __confirmed_balance__: _number_
- __unconfirmed_balance__: _number_
- __total_balance__: _number_
### PayInvoiceResponse ### PayInvoiceResponse
- __preimage__: _string_ - __preimage__: _string_
@ -563,88 +472,23 @@ The nostr server will send back a message response, and inside the body there wi
- __service_fee__: _number_ - __service_fee__: _number_
- __network_fee__: _number_ - __network_fee__: _number_
### NewAddressResponse ### ChainBalanceEvent
- __address__: _string_ - __block_height__: _number_
- __confirmed_balance__: _number_
- __unconfirmed_balance__: _number_
- __total_balance__: _number_
### PayAddressRequest ### SetMockInvoiceAsPaidRequest
- __address__: _string_ - __invoice__: _string_
- __amoutSats__: _number_
- __satsPerVByte__: _number_
### UserOperation
- __paidAtUnix__: _number_
- __type__: _[UserOperationType](#UserOperationType)_
- __inbound__: _boolean_
- __amount__: _number_ - __amount__: _number_
### AddAppUserRequest
- __identifier__: _string_ - __identifier__: _string_
- __operationId__: _string_ - __fail_if_exists__: _boolean_
- __service_fee__: _number_ - __balance__: _number_
- __network_fee__: _number_
- __confirmed__: _boolean_
- __tx_hash__: _string_
- __internal__: _boolean_
### AddAppInvoiceRequest ### NewInvoiceResponse
- __payer_identifier__: _string_
- __http_callback_url__: _string_
- __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_
### AddAppUserInvoiceRequest
- __receiver_identifier__: _string_
- __payer_identifier__: _string_
- __http_callback_url__: _string_
- __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_
### AddProductRequest
- __name__: _string_
- __price_sats__: _number_
### UsersInfo
- __total__: _number_
- __no_balance__: _number_
- __negative_balance__: _number_
- __always_been_inactive__: _number_
- __balance_avg__: _number_
- __balance_median__: _number_
### LndGetInfoRequest
- __nodeId__: _number_
### LnurlLinkResponse
- __lnurl__: _string_
- __k1__: _string_
### LnurlWithdrawInfoResponse
- __tag__: _string_
- __callback__: _string_
- __k1__: _string_
- __defaultDescription__: _string_
- __minWithdrawable__: _number_
- __maxWithdrawable__: _number_
- __balanceCheck__: _string_
- __payLink__: _string_
### GetAppUserLNURLInfoRequest
- __user_identifier__: _string_
- __base_url_override__: _string_
### SetMockAppBalanceRequest
- __amount__: _number_
### PayAppUserInvoiceRequest
- __user_identifier__: _string_
- __invoice__: _string_ - __invoice__: _string_
- __amount__: _number_
### PayInvoiceRequest
- __invoice__: _string_
- __amount__: _number_
### OpenChannelRequest
- __destination__: _string_
- __fundingAmount__: _number_
- __pushAmount__: _number_
- __closeAddress__: _string_
### RoutingEvent ### RoutingEvent
- __incoming_channel_id__: _number_ - __incoming_channel_id__: _number_
@ -660,47 +504,80 @@ The nostr server will send back a message response, and inside the body there wi
- __offchain__: _boolean_ - __offchain__: _boolean_
- __forward_fail_event__: _boolean_ - __forward_fail_event__: _boolean_
### LndNodeMetrics ### AuthApp
- __channels_balance_events__: ARRAY of: _[ChannelBalanceEvent](#ChannelBalanceEvent)_ - __app__: _[Application](#Application)_
- __chain_balance_events__: ARRAY of: _[ChainBalanceEvent](#ChainBalanceEvent)_ - __auth_token__: _string_
- __offline_channels__: _number_
- __online_channels__: _number_
- __pending_channels__: _number_
- __closing_channels__: _number_
- __open_channels__: ARRAY of: _[OpenChannel](#OpenChannel)_
- __closed_channels__: ARRAY of: _[ClosedChannel](#ClosedChannel)_
- __channel_routing__: ARRAY of: _[ChannelRouting](#ChannelRouting)_
### SetMockInvoiceAsPaidRequest ### DecodeInvoiceResponse
- __invoice__: _string_
- __amount__: _number_ - __amount__: _number_
### EncryptionExchangeRequest
- __publicKey__: _string_
- __deviceId__: _string_
### AppUser
- __identifier__: _string_
- __info__: _[UserInfo](#UserInfo)_
- __max_withdrawable__: _number_
### SetMockAppUserBalanceRequest
- __user_identifier__: _string_
- __amount__: _number_
### NewAddressRequest
- __addressType__: _[AddressType](#AddressType)_
### OpenChannelRequest
- __destination__: _string_
- __fundingAmount__: _number_
- __pushAmount__: _number_
- __closeAddress__: _string_
### UserOperation
- __paidAtUnix__: _number_
- __type__: _[UserOperationType](#UserOperationType)_
- __inbound__: _boolean_
- __amount__: _number_
- __identifier__: _string_
- __operationId__: _string_
- __service_fee__: _number_
- __network_fee__: _number_
- __confirmed__: _boolean_
- __tx_hash__: _string_
- __internal__: _boolean_
### AddProductRequest
- __name__: _string_
- __price_sats__: _number_
### AddAppUserInvoiceRequest
- __receiver_identifier__: _string_
- __payer_identifier__: _string_
- __http_callback_url__: _string_
- __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_
### LndGetInfoRequest
- __nodeId__: _number_
### GetAppUserRequest ### GetAppUserRequest
- __user_identifier__: _string_ - __user_identifier__: _string_
### SendAppUserToAppUserPaymentRequest ### PayAppUserInvoiceRequest
- __from_user_identifier__: _string_ - __user_identifier__: _string_
- __to_user_identifier__: _string_ - __invoice__: _string_
- __amount__: _number_ - __amount__: _number_
### GetUserOperationsResponse ### SetMockAppBalanceRequest
- __latestOutgoingInvoiceOperations__: _[UserOperations](#UserOperations)_ - __amount__: _number_
- __latestIncomingInvoiceOperations__: _[UserOperations](#UserOperations)_
- __latestOutgoingTxOperations__: _[UserOperations](#UserOperations)_
- __latestIncomingTxOperations__: _[UserOperations](#UserOperations)_
- __latestOutgoingUserToUserPayemnts__: _[UserOperations](#UserOperations)_
- __latestIncomingUserToUserPayemnts__: _[UserOperations](#UserOperations)_
### ClosureMigration ### GetUserOperationsRequest
- __closes_at_unix__: _number_ - __latestIncomingInvoice__: _number_
- __latestOutgoingInvoice__: _number_
### AppsMetrics - __latestIncomingTx__: _number_
- __apps__: ARRAY of: _[AppMetrics](#AppMetrics)_ - __latestOutgoingTx__: _number_
- __latestIncomingUserToUserPayment__: _number_
### ClosedChannel - __latestOutgoingUserToUserPayment__: _number_
- __channel_id__: _string_ - __max_size__: _number_
- __capacity__: _number_
- __closed_height__: _number_
### AppMetrics ### AppMetrics
- __app__: _[Application](#Application)_ - __app__: _[Application](#Application)_
@ -713,22 +590,40 @@ The nostr server will send back a message response, and inside the body there wi
- __total_fees__: _number_ - __total_fees__: _number_
- __operations__: ARRAY of: _[UserOperation](#UserOperation)_ - __operations__: ARRAY of: _[UserOperation](#UserOperation)_
### LnurlPayInfoResponse ### LndGetInfoResponse
- __tag__: _string_ - __alias__: _string_
- __callback__: _string_
- __maxSendable__: _number_
- __minSendable__: _number_
- __metadata__: _string_
- __allowsNostr__: _boolean_
- __nostrPubkey__: _string_
### AppsMetricsRequest ### SendAppUserToAppPaymentRequest
- __from_unix__: _number_ *this field is optional - __from_user_identifier__: _string_
- __to_unix__: _number_ *this field is optional - __amount__: _number_
- __include_operations__: _boolean_ *this field is optional
### NewInvoiceResponse ### PayInvoiceRequest
- __invoice__: _string_ - __invoice__: _string_
- __amount__: _number_
### LiveUserOperation
- __operation__: _[UserOperation](#UserOperation)_
### MigrationUpdate
- __closure__: _[ClosureMigration](#ClosureMigration)_ *this field is optional
- __relays__: _[RelaysMigration](#RelaysMigration)_ *this field is optional
### OpenChannel
- __channel_id__: _string_
- __capacity__: _number_
- __active__: _boolean_
- __lifetime__: _number_
- __local_balance__: _number_
- __remote_balance__: _number_
### DecodeInvoiceRequest
- __invoice__: _string_
### UserInfo
- __userId__: _string_
- __balance__: _number_
- __max_withdrawable__: _number_
- __user_identifier__: _string_
### UsageMetric ### UsageMetric
- __processed_at_ms__: _number_ - __processed_at_ms__: _number_
@ -741,43 +636,149 @@ The nostr server will send back a message response, and inside the body there wi
- __nostr__: _boolean_ - __nostr__: _boolean_
- __batch_size__: _number_ - __batch_size__: _number_
### LndMetrics ### ChannelBalanceEvent
- __nodes__: ARRAY of: _[LndNodeMetrics](#LndNodeMetrics)_ - __block_height__: _number_
- __channel_id__: _string_
- __local_balance_sats__: _number_
- __remote_balance_sats__: _number_
### LndGetInfoResponse ### AddAppRequest
- __alias__: _string_ - __name__: _string_
- __allow_user_creation__: _boolean_
### LiveUserOperation ### Application
- __operation__: _[UserOperation](#UserOperation)_ - __name__: _string_
- __id__: _string_
- __balance__: _number_
- __npub__: _string_
### PayAddressRequest
- __address__: _string_
- __amoutSats__: _number_
- __satsPerVByte__: _number_
### AppsMetricsRequest
- __from_unix__: _number_ *this field is optional
- __to_unix__: _number_ *this field is optional
- __include_operations__: _boolean_ *this field is optional
### LndMetricsRequest
- __from_unix__: _number_ *this field is optional
- __to_unix__: _number_ *this field is optional
### SendAppUserToAppUserPaymentRequest
- __from_user_identifier__: _string_
- __to_user_identifier__: _string_
- __amount__: _number_
### LnurlLinkResponse
- __lnurl__: _string_
- __k1__: _string_
### LnurlPayInfoResponse
- __tag__: _string_
- __callback__: _string_
- __maxSendable__: _number_
- __minSendable__: _number_
- __metadata__: _string_
- __allowsNostr__: _boolean_
- __nostrPubkey__: _string_
### UsageMetrics
- __metrics__: ARRAY of: _[UsageMetric](#UsageMetric)_
### AuthAppRequest ### AuthAppRequest
- __name__: _string_ - __name__: _string_
- __allow_user_creation__: _boolean_ *this field is optional - __allow_user_creation__: _boolean_ *this field is optional
### AuthApp ### GetUserOperationsResponse
- __app__: _[Application](#Application)_ - __latestOutgoingInvoiceOperations__: _[UserOperations](#UserOperations)_
- __auth_token__: _string_ - __latestIncomingInvoiceOperations__: _[UserOperations](#UserOperations)_
- __latestOutgoingTxOperations__: _[UserOperations](#UserOperations)_
- __latestIncomingTxOperations__: _[UserOperations](#UserOperations)_
- __latestOutgoingUserToUserPayemnts__: _[UserOperations](#UserOperations)_
- __latestIncomingUserToUserPayemnts__: _[UserOperations](#UserOperations)_
### DecodeInvoiceRequest ### LndNodeMetrics
- __invoice__: _string_ - __channels_balance_events__: ARRAY of: _[ChannelBalanceEvent](#ChannelBalanceEvent)_
- __chain_balance_events__: ARRAY of: _[ChainBalanceEvent](#ChainBalanceEvent)_
- __offline_channels__: _number_
- __online_channels__: _number_
- __pending_channels__: _number_
- __closing_channels__: _number_
- __open_channels__: ARRAY of: _[OpenChannel](#OpenChannel)_
- __closed_channels__: ARRAY of: _[ClosedChannel](#ClosedChannel)_
- __channel_routing__: ARRAY of: _[ChannelRouting](#ChannelRouting)_
### HandleLnurlPayResponse ### UserOperations
- __pr__: _string_ - __fromIndex__: _number_
- __routes__: ARRAY of: _[Empty](#Empty)_ - __toIndex__: _number_
- __operations__: ARRAY of: _[UserOperation](#UserOperation)_
### RelaysMigration
- __relays__: ARRAY of: _string_
### Empty
### UsersInfo
- __total__: _number_
- __no_balance__: _number_
- __negative_balance__: _number_
- __always_been_inactive__: _number_
- __balance_avg__: _number_
- __balance_median__: _number_
### NewAddressResponse
- __address__: _string_
### Product ### Product
- __id__: _string_ - __id__: _string_
- __name__: _string_ - __name__: _string_
- __price_sats__: _number_ - __price_sats__: _number_
### UsageMetrics ### AppsMetrics
- __metrics__: ARRAY of: _[UsageMetric](#UsageMetric)_ - __apps__: ARRAY of: _[AppMetrics](#AppMetrics)_
### ChannelBalanceEvent ### ClosedChannel
- __block_height__: _number_
- __channel_id__: _string_ - __channel_id__: _string_
- __local_balance_sats__: _number_ - __capacity__: _number_
- __remote_balance_sats__: _number_ - __closed_height__: _number_
### PayAddressResponse
- __txId__: _string_
- __operation_id__: _string_
- __service_fee__: _number_
- __network_fee__: _number_
### LnurlWithdrawInfoResponse
- __tag__: _string_
- __callback__: _string_
- __k1__: _string_
- __defaultDescription__: _string_
- __minWithdrawable__: _number_
- __maxWithdrawable__: _number_
- __balanceCheck__: _string_
- __payLink__: _string_
### HandleLnurlPayResponse
- __pr__: _string_
- __routes__: ARRAY of: _[Empty](#Empty)_
### GetProductBuyLinkResponse
- __link__: _string_
### NewInvoiceRequest
- __amountSats__: _number_
- __memo__: _string_
### ClosureMigration
- __closes_at_unix__: _number_
### LndMetrics
- __nodes__: ARRAY of: _[LndNodeMetrics](#LndNodeMetrics)_
### OpenChannelResponse
- __channelId__: _string_
## Enums ## Enums
### The enumerators used in the messages ### The enumerators used in the messages

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -122,6 +122,7 @@ message ChannelRouting {
int64 missed_forward_fee_as_output = 7; int64 missed_forward_fee_as_output = 7;
int64 forward_fee_as_input = 8; int64 forward_fee_as_input = 8;
int64 forward_fee_as_output = 9; int64 forward_fee_as_output = 9;
int64 events_number = 10;
} }
message LndNodeMetrics { message LndNodeMetrics {

View file

@ -219,6 +219,7 @@ export default class Handler {
missed_forward_fee_as_output: 0, missed_forward_fee_as_output: 0,
forward_fee_as_input: 0, forward_fee_as_input: 0,
forward_fee_as_output: 0, forward_fee_as_output: 0,
events_number: 0
} }
} }
routingMap[r.channel_id].send_errors += r.send_errors routingMap[r.channel_id].send_errors += r.send_errors
@ -229,6 +230,7 @@ export default class Handler {
routingMap[r.channel_id].missed_forward_fee_as_output += r.missed_forward_fee_as_output routingMap[r.channel_id].missed_forward_fee_as_output += r.missed_forward_fee_as_output
routingMap[r.channel_id].forward_fee_as_input += r.forward_fee_as_input routingMap[r.channel_id].forward_fee_as_input += r.forward_fee_as_input
routingMap[r.channel_id].forward_fee_as_output += r.forward_fee_as_output routingMap[r.channel_id].forward_fee_as_output += r.forward_fee_as_output
routingMap[r.channel_id].events_number++
}) })
const { channelsBalanceEvents, chainBalanceEvents } = await this.storage.metricsStorage.GetBalanceEvents({ from: req.from_unix, to: req.to_unix }) const { channelsBalanceEvents, chainBalanceEvents } = await this.storage.metricsStorage.GetBalanceEvents({ from: req.from_unix, to: req.to_unix })
return { return {