commit
0beac312f5
37 changed files with 35581 additions and 33600 deletions
|
|
@ -21,11 +21,12 @@ import { LspOrder1718387847693 } from './build/src/services/storage/migrations/1
|
|||
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'
|
||||
import { PaymentIndex1721760297610 } from './build/src/services/storage/migrations/1721760297610-payment_index.js'
|
||||
export default new DataSource({
|
||||
type: "sqlite",
|
||||
database: "db.sqlite",
|
||||
// logging: true,
|
||||
migrations: [Initial1703170309875, LspOrder1718387847693, LiquidityProvider1719335699480, LndNodeInfo1720187506189, CreateInviteTokenTable1721751414878],
|
||||
migrations: [Initial1703170309875, LspOrder1718387847693, LiquidityProvider1719335699480, LndNodeInfo1720187506189, CreateInviteTokenTable1721751414878, PaymentIndex1721760297610],
|
||||
entities: [User, UserReceivingInvoice, UserReceivingAddress, AddressReceivingTransaction, UserInvoicePayment, UserTransactionPayment,
|
||||
UserBasicAuth, UserEphemeralKey, Product, UserToUserPayment, Application, ApplicationUser, UserToUserPayment, LspOrder, LndNodeInfo, TrackedProvider, InviteToken],
|
||||
// synchronize: true,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,16 @@
|
|||
import { DataSource } from "typeorm"
|
||||
import { LspOrder } from "./build/src/services/storage/entity/LspOrder.js"
|
||||
|
||||
|
||||
import { BalanceEvent } from "./build/src/services/storage/entity/BalanceEvent.js"
|
||||
import { ChannelBalanceEvent } from "./build/src/services/storage/entity/ChannelsBalanceEvent.js"
|
||||
import { ChannelRouting } from "./build/src/services/storage/entity/ChannelRouting.js"
|
||||
import { LndMetrics1703170330183 } from './build/src/services/storage/migrations/1703170330183-lnd_metrics.js'
|
||||
import { ChannelRouting1709316653538 } from './build/src/services/storage/migrations/1709316653538-channel_routing.js'
|
||||
import { HtlcCount1724266887195 } from './build/src/services/storage/migrations/1724266887195-htlc_count.js'
|
||||
|
||||
export default new DataSource({
|
||||
type: "sqlite",
|
||||
database: "db.sqlite",
|
||||
entities: [LspOrder],
|
||||
});
|
||||
database: "metrics.sqlite",
|
||||
entities: [BalanceEvent, ChannelBalanceEvent, ChannelRouting],
|
||||
migrations: [LndMetrics1703170330183, ChannelRouting1709316653538, HtlcCount1724266887195]
|
||||
});
|
||||
|
||||
//npx typeorm migration:generate ./src/services/storage/migrations/balance_events -d ./metricsDatasource.js
|
||||
|
|
@ -38,6 +38,11 @@ The nostr server will send back a message response, and inside the body there wi
|
|||
- This methods has an __empty__ __request__ body
|
||||
- output: [LndSeed](#LndSeed)
|
||||
|
||||
- ListChannels
|
||||
- auth type: __Admin__
|
||||
- This methods has an __empty__ __request__ body
|
||||
- output: [LndChannels](#LndChannels)
|
||||
|
||||
- GetUsageMetrics
|
||||
- auth type: __Metrics__
|
||||
- This methods has an __empty__ __request__ body
|
||||
|
|
@ -244,6 +249,13 @@ The nostr server will send back a message response, and inside the body there wi
|
|||
- This methods has an __empty__ __request__ body
|
||||
- output: [LndSeed](#LndSeed)
|
||||
|
||||
- ListChannels
|
||||
- auth type: __Admin__
|
||||
- http method: __get__
|
||||
- http route: __/api/admin/channels__
|
||||
- This methods has an __empty__ __request__ body
|
||||
- output: [LndChannels](#LndChannels)
|
||||
|
||||
- GetUsageMetrics
|
||||
- auth type: __Metrics__
|
||||
- http method: __post__
|
||||
|
|
@ -601,160 +613,158 @@ 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
|
||||
|
||||
### AppsMetricsRequest
|
||||
- __from_unix__: _number_ *this field is optional
|
||||
- __to_unix__: _number_ *this field is optional
|
||||
- __include_operations__: _boolean_ *this field is optional
|
||||
### GetUserOperationsResponse
|
||||
- __latestIncomingUserToUserPayemnts__: _[UserOperations](#UserOperations)_
|
||||
- __latestOutgoingInvoiceOperations__: _[UserOperations](#UserOperations)_
|
||||
- __latestIncomingInvoiceOperations__: _[UserOperations](#UserOperations)_
|
||||
- __latestOutgoingTxOperations__: _[UserOperations](#UserOperations)_
|
||||
- __latestIncomingTxOperations__: _[UserOperations](#UserOperations)_
|
||||
- __latestOutgoingUserToUserPayemnts__: _[UserOperations](#UserOperations)_
|
||||
|
||||
### SetMockAppBalanceRequest
|
||||
- __amount__: _number_
|
||||
|
||||
### NewAddressResponse
|
||||
- __address__: _string_
|
||||
|
||||
### PayAddressResponse
|
||||
- __txId__: _string_
|
||||
- __operation_id__: _string_
|
||||
- __service_fee__: _number_
|
||||
- __network_fee__: _number_
|
||||
|
||||
### HandleLnurlPayResponse
|
||||
- __pr__: _string_
|
||||
- __routes__: ARRAY of: _[Empty](#Empty)_
|
||||
|
||||
### GetProductBuyLinkResponse
|
||||
- __link__: _string_
|
||||
|
||||
### UsageMetric
|
||||
- __parsed_in_nano__: _number_
|
||||
- __validate_in_nano__: _number_
|
||||
- __handle_in_nano__: _number_
|
||||
- __batch__: _boolean_
|
||||
- __nostr__: _boolean_
|
||||
- __batch_size__: _number_
|
||||
- __processed_at_ms__: _number_
|
||||
- __auth_in_nano__: _number_
|
||||
- __rpc_name__: _string_
|
||||
|
||||
### AppMetrics
|
||||
- __app__: _[Application](#Application)_
|
||||
- __users__: _[UsersInfo](#UsersInfo)_
|
||||
- __received__: _number_
|
||||
- __total_fees__: _number_
|
||||
- __operations__: ARRAY of: _[UserOperation](#UserOperation)_
|
||||
- __spent__: _number_
|
||||
- __available__: _number_
|
||||
- __fees__: _number_
|
||||
- __invoices__: _number_
|
||||
|
||||
### LndMetrics
|
||||
- __nodes__: ARRAY of: _[LndNodeMetrics](#LndNodeMetrics)_
|
||||
|
||||
### Application
|
||||
- __balance__: _number_
|
||||
- __npub__: _string_
|
||||
### AuthAppRequest
|
||||
- __name__: _string_
|
||||
- __id__: _string_
|
||||
|
||||
### AddAppInvoiceRequest
|
||||
- __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_
|
||||
- __payer_identifier__: _string_
|
||||
- __http_callback_url__: _string_
|
||||
- __allow_user_creation__: _boolean_ *this field is optional
|
||||
|
||||
### GetAppUserLNURLInfoRequest
|
||||
- __user_identifier__: _string_
|
||||
- __base_url_override__: _string_
|
||||
|
||||
### GetPaymentStateRequest
|
||||
- __invoice__: _string_
|
||||
### AddAppUserInvoiceRequest
|
||||
- __receiver_identifier__: _string_
|
||||
- __payer_identifier__: _string_
|
||||
- __http_callback_url__: _string_
|
||||
- __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_
|
||||
|
||||
### ChannelRouting
|
||||
- __forward_fee_as_output__: _number_
|
||||
- __events_number__: _number_
|
||||
- __send_errors__: _number_
|
||||
- __forward_errors_as_output__: _number_
|
||||
- __forward_fee_as_input__: _number_
|
||||
- __missed_forward_fee_as_input__: _number_
|
||||
- __missed_forward_fee_as_output__: _number_
|
||||
- __channel_id__: _string_
|
||||
- __receive_errors__: _number_
|
||||
- __forward_errors_as_input__: _number_
|
||||
|
||||
### PayAppUserInvoiceRequest
|
||||
- __user_identifier__: _string_
|
||||
- __invoice__: _string_
|
||||
- __amount__: _number_
|
||||
|
||||
### SetMockAppUserBalanceRequest
|
||||
- __user_identifier__: _string_
|
||||
- __amount__: _number_
|
||||
|
||||
### PayAddressRequest
|
||||
### NewAddressResponse
|
||||
- __address__: _string_
|
||||
- __amoutSats__: _number_
|
||||
- __satsPerVByte__: _number_
|
||||
|
||||
### GetUserOperationsRequest
|
||||
- __max_size__: _number_
|
||||
- __latestIncomingInvoice__: _number_
|
||||
- __latestOutgoingInvoice__: _number_
|
||||
- __latestIncomingTx__: _number_
|
||||
- __latestOutgoingTx__: _number_
|
||||
- __latestIncomingUserToUserPayment__: _number_
|
||||
- __latestOutgoingUserToUserPayment__: _number_
|
||||
|
||||
### Product
|
||||
- __id__: _string_
|
||||
- __name__: _string_
|
||||
- __price_sats__: _number_
|
||||
|
||||
### UseInviteLinkRequest
|
||||
- __invite_token__: _string_
|
||||
### CreateOneTimeInviteLinkResponse
|
||||
- __invitation_link__: _string_
|
||||
|
||||
### AppsMetrics
|
||||
- __apps__: ARRAY of: _[AppMetrics](#AppMetrics)_
|
||||
|
||||
### SetMockInvoiceAsPaidRequest
|
||||
- __invoice__: _string_
|
||||
- __amount__: _number_
|
||||
|
||||
### BanUserRequest
|
||||
- __user_id__: _string_
|
||||
|
||||
### GetAppUserRequest
|
||||
- __user_identifier__: _string_
|
||||
|
||||
### NewInvoiceResponse
|
||||
- __invoice__: _string_
|
||||
|
||||
### GetUserOperationsResponse
|
||||
- __latestIncomingTxOperations__: _[UserOperations](#UserOperations)_
|
||||
- __latestOutgoingUserToUserPayemnts__: _[UserOperations](#UserOperations)_
|
||||
- __latestIncomingUserToUserPayemnts__: _[UserOperations](#UserOperations)_
|
||||
- __latestOutgoingInvoiceOperations__: _[UserOperations](#UserOperations)_
|
||||
- __latestIncomingInvoiceOperations__: _[UserOperations](#UserOperations)_
|
||||
- __latestOutgoingTxOperations__: _[UserOperations](#UserOperations)_
|
||||
|
||||
### LndMetricsRequest
|
||||
### AppsMetricsRequest
|
||||
- __include_operations__: _boolean_ *this field is optional
|
||||
- __from_unix__: _number_ *this field is optional
|
||||
- __to_unix__: _number_ *this field is optional
|
||||
|
||||
### AuthApp
|
||||
- __app__: _[Application](#Application)_
|
||||
- __auth_token__: _string_
|
||||
### LndGetInfoRequest
|
||||
- __nodeId__: _number_
|
||||
|
||||
### DecodeInvoiceRequest
|
||||
- __invoice__: _string_
|
||||
### SetMockAppBalanceRequest
|
||||
- __amount__: _number_
|
||||
|
||||
### LnurlLinkResponse
|
||||
- __lnurl__: _string_
|
||||
- __k1__: _string_
|
||||
|
||||
### LnurlWithdrawInfoResponse
|
||||
- __tag__: _string_
|
||||
- __callback__: _string_
|
||||
- __k1__: _string_
|
||||
- __defaultDescription__: _string_
|
||||
- __minWithdrawable__: _number_
|
||||
- __maxWithdrawable__: _number_
|
||||
- __balanceCheck__: _string_
|
||||
- __payLink__: _string_
|
||||
|
||||
### AddAppUserRequest
|
||||
- __identifier__: _string_
|
||||
- __fail_if_exists__: _boolean_
|
||||
- __balance__: _number_
|
||||
|
||||
### AddAppInvoiceRequest
|
||||
- __payer_identifier__: _string_
|
||||
- __http_callback_url__: _string_
|
||||
- __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_
|
||||
|
||||
### AddAppRequest
|
||||
- __name__: _string_
|
||||
- __allow_user_creation__: _boolean_
|
||||
|
||||
### PayAddressResponse
|
||||
- __service_fee__: _number_
|
||||
- __network_fee__: _number_
|
||||
- __txId__: _string_
|
||||
- __operation_id__: _string_
|
||||
|
||||
### RequestNPubLinkingTokenResponse
|
||||
- __token__: _string_
|
||||
|
||||
### CreateOneTimeInviteLinkResponse
|
||||
- __invitation_link__: _string_
|
||||
### UsageMetric
|
||||
- __parsed_in_nano__: _number_
|
||||
- __rpc_name__: _string_
|
||||
- __batch_size__: _number_
|
||||
- __processed_at_ms__: _number_
|
||||
- __auth_in_nano__: _number_
|
||||
- __validate_in_nano__: _number_
|
||||
- __handle_in_nano__: _number_
|
||||
- __batch__: _boolean_
|
||||
- __nostr__: _boolean_
|
||||
|
||||
### SetMockInvoiceAsPaidRequest
|
||||
- __invoice__: _string_
|
||||
- __amount__: _number_
|
||||
|
||||
### LndGetInfoResponse
|
||||
- __alias__: _string_
|
||||
|
||||
### HttpCreds
|
||||
- __url__: _string_
|
||||
- __token__: _string_
|
||||
|
||||
### OpenChannel
|
||||
- __capacity__: _number_
|
||||
- __active__: _boolean_
|
||||
- __lifetime__: _number_
|
||||
- __local_balance__: _number_
|
||||
- __remote_balance__: _number_
|
||||
- __label__: _string_
|
||||
- __channel_id__: _string_
|
||||
|
||||
### LndNodeMetrics
|
||||
- __pending_channels__: _number_
|
||||
- __closing_channels__: _number_
|
||||
- __forwarding_events__: _number_
|
||||
- __forwarding_fees__: _number_
|
||||
- __chain_balance__: ARRAY of: _[GraphPoint](#GraphPoint)_
|
||||
- __channel_balance__: ARRAY of: _[GraphPoint](#GraphPoint)_
|
||||
- __external_balance__: ARRAY of: _[GraphPoint](#GraphPoint)_
|
||||
- __offline_channels__: _number_
|
||||
- __online_channels__: _number_
|
||||
- __open_channels__: ARRAY of: _[OpenChannel](#OpenChannel)_
|
||||
- __closed_channels__: ARRAY of: _[ClosedChannel](#ClosedChannel)_
|
||||
|
||||
### OpenChannelResponse
|
||||
- __channelId__: _string_
|
||||
|
||||
### LinkNPubThroughTokenRequest
|
||||
- __token__: _string_
|
||||
|
||||
### LndMetricsRequest
|
||||
- __from_unix__: _number_ *this field is optional
|
||||
- __to_unix__: _number_ *this field is optional
|
||||
|
||||
### DecodeInvoiceResponse
|
||||
- __amount__: _number_
|
||||
|
||||
### BanUserRequest
|
||||
- __user_id__: _string_
|
||||
|
||||
### AppUser
|
||||
- __identifier__: _string_
|
||||
- __info__: _[UserInfo](#UserInfo)_
|
||||
- __max_withdrawable__: _number_
|
||||
|
||||
### NewInvoiceRequest
|
||||
- __amountSats__: _number_
|
||||
- __memo__: _string_
|
||||
|
||||
### DecodeInvoiceRequest
|
||||
- __invoice__: _string_
|
||||
|
||||
### UsersInfo
|
||||
- __total__: _number_
|
||||
|
|
@ -764,195 +774,133 @@ The nostr server will send back a message response, and inside the body there wi
|
|||
- __balance_avg__: _number_
|
||||
- __balance_median__: _number_
|
||||
|
||||
### RoutingEvent
|
||||
- __outgoing_channel_id__: _number_
|
||||
- __incoming_amt_msat__: _number_
|
||||
- __settled__: _boolean_
|
||||
- __outgoing_amt_msat__: _number_
|
||||
- __failure_string__: _string_
|
||||
- __offchain__: _boolean_
|
||||
- __incoming_channel_id__: _number_
|
||||
- __incoming_htlc_id__: _number_
|
||||
- __outgoing_htlc_id__: _number_
|
||||
- __timestamp_ns__: _number_
|
||||
- __event_type__: _string_
|
||||
- __forward_fail_event__: _boolean_
|
||||
### LndMetrics
|
||||
- __nodes__: ARRAY of: _[LndNodeMetrics](#LndNodeMetrics)_
|
||||
|
||||
### UserInfo
|
||||
- __user_identifier__: _string_
|
||||
- __service_fee_bps__: _number_
|
||||
- __network_max_fee_bps__: _number_
|
||||
- __network_max_fee_fixed__: _number_
|
||||
- __userId__: _string_
|
||||
- __balance__: _number_
|
||||
- __max_withdrawable__: _number_
|
||||
|
||||
### LndGetInfoRequest
|
||||
- __nodeId__: _number_
|
||||
|
||||
### AddAppRequest
|
||||
- __name__: _string_
|
||||
- __allow_user_creation__: _boolean_
|
||||
|
||||
### AddAppUserInvoiceRequest
|
||||
- __receiver_identifier__: _string_
|
||||
- __payer_identifier__: _string_
|
||||
- __http_callback_url__: _string_
|
||||
- __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_
|
||||
|
||||
### LinkNPubThroughTokenRequest
|
||||
- __token__: _string_
|
||||
|
||||
### PayInvoiceResponse
|
||||
- __network_fee__: _number_
|
||||
- __preimage__: _string_
|
||||
- __amount_paid__: _number_
|
||||
- __operation_id__: _string_
|
||||
- __service_fee__: _number_
|
||||
|
||||
### LnurlPayInfoResponse
|
||||
- __allowsNostr__: _boolean_
|
||||
- __nostrPubkey__: _string_
|
||||
- __tag__: _string_
|
||||
- __callback__: _string_
|
||||
- __maxSendable__: _number_
|
||||
- __minSendable__: _number_
|
||||
- __metadata__: _string_
|
||||
|
||||
### ClosureMigration
|
||||
- __closes_at_unix__: _number_
|
||||
|
||||
### ChainBalanceEvent
|
||||
- __block_height__: _number_
|
||||
- __confirmed_balance__: _number_
|
||||
- __unconfirmed_balance__: _number_
|
||||
- __total_balance__: _number_
|
||||
|
||||
### LndNodeMetrics
|
||||
- __channels_balance_events__: ARRAY of: _[ChannelBalanceEvent](#ChannelBalanceEvent)_
|
||||
- __channel_routing__: ARRAY of: _[ChannelRouting](#ChannelRouting)_
|
||||
- __closing_channels__: _number_
|
||||
- __open_channels__: ARRAY of: _[OpenChannel](#OpenChannel)_
|
||||
- __closed_channels__: ARRAY of: _[ClosedChannel](#ClosedChannel)_
|
||||
- __chain_balance_events__: ARRAY of: _[ChainBalanceEvent](#ChainBalanceEvent)_
|
||||
- __offline_channels__: _number_
|
||||
- __online_channels__: _number_
|
||||
- __pending_channels__: _number_
|
||||
|
||||
### UserOperation
|
||||
- __network_fee__: _number_
|
||||
- __type__: _[UserOperationType](#UserOperationType)_
|
||||
- __identifier__: _string_
|
||||
- __service_fee__: _number_
|
||||
- __operationId__: _string_
|
||||
- __confirmed__: _boolean_
|
||||
- __tx_hash__: _string_
|
||||
- __internal__: _boolean_
|
||||
- __paidAtUnix__: _number_
|
||||
- __inbound__: _boolean_
|
||||
- __amount__: _number_
|
||||
|
||||
### GetInviteTokenStateRequest
|
||||
- __invite_token__: _string_
|
||||
|
||||
### ChannelBalanceEvent
|
||||
- __block_height__: _number_
|
||||
- __channel_id__: _string_
|
||||
- __local_balance_sats__: _number_
|
||||
- __remote_balance_sats__: _number_
|
||||
|
||||
### 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)_
|
||||
|
||||
### AppUser
|
||||
- __identifier__: _string_
|
||||
- __info__: _[UserInfo](#UserInfo)_
|
||||
- __max_withdrawable__: _number_
|
||||
### PayAddressRequest
|
||||
- __address__: _string_
|
||||
- __amoutSats__: _number_
|
||||
- __satsPerVByte__: _number_
|
||||
|
||||
### PaymentState
|
||||
- __paid_at_unix__: _number_
|
||||
- __amount__: _number_
|
||||
- __service_fee__: _number_
|
||||
- __network_fee__: _number_
|
||||
- __paid_at_unix__: _number_
|
||||
|
||||
### MigrationUpdate
|
||||
- __closure__: _[ClosureMigration](#ClosureMigration)_ *this field is optional
|
||||
- __relays__: _[RelaysMigration](#RelaysMigration)_ *this field is optional
|
||||
|
||||
### HttpCreds
|
||||
- __url__: _string_
|
||||
- __token__: _string_
|
||||
|
||||
### ClosedChannel
|
||||
- __capacity__: _number_
|
||||
- __closed_height__: _number_
|
||||
- __channel_id__: _string_
|
||||
|
||||
### LndGetInfoResponse
|
||||
- __alias__: _string_
|
||||
|
||||
### PayInvoiceRequest
|
||||
- __invoice__: _string_
|
||||
- __amount__: _number_
|
||||
|
||||
### SendAppUserToAppPaymentRequest
|
||||
- __from_user_identifier__: _string_
|
||||
- __amount__: _number_
|
||||
|
||||
### OpenChannelRequest
|
||||
- __closeAddress__: _string_
|
||||
- __destination__: _string_
|
||||
- __fundingAmount__: _number_
|
||||
- __pushAmount__: _number_
|
||||
|
||||
### EnrollAdminTokenRequest
|
||||
- __admin_token__: _string_
|
||||
|
||||
### Empty
|
||||
|
||||
### NewAddressRequest
|
||||
- __addressType__: _[AddressType](#AddressType)_
|
||||
|
||||
### AddProductRequest
|
||||
- __name__: _string_
|
||||
- __price_sats__: _number_
|
||||
|
||||
### GetInviteTokenStateResponse
|
||||
- __used__: _boolean_
|
||||
|
||||
### EncryptionExchangeRequest
|
||||
- __publicKey__: _string_
|
||||
- __deviceId__: _string_
|
||||
### UserOperations
|
||||
- __fromIndex__: _number_
|
||||
- __toIndex__: _number_
|
||||
- __operations__: ARRAY of: _[UserOperation](#UserOperation)_
|
||||
|
||||
### UsageMetrics
|
||||
- __metrics__: ARRAY of: _[UsageMetric](#UsageMetric)_
|
||||
|
||||
### AuthAppRequest
|
||||
- __name__: _string_
|
||||
- __allow_user_creation__: _boolean_ *this field is optional
|
||||
### LndChannels
|
||||
- __open_channels__: ARRAY of: _[OpenChannel](#OpenChannel)_
|
||||
|
||||
### AddAppUserRequest
|
||||
- __identifier__: _string_
|
||||
- __fail_if_exists__: _boolean_
|
||||
- __balance__: _number_
|
||||
### RequestNPubLinkingTokenRequest
|
||||
- __user_identifier__: _string_
|
||||
|
||||
### DecodeInvoiceResponse
|
||||
### SendAppUserToAppUserPaymentRequest
|
||||
- __from_user_identifier__: _string_
|
||||
- __to_user_identifier__: _string_
|
||||
- __amount__: _number_
|
||||
|
||||
### GetUserOperationsRequest
|
||||
- __latestIncomingTx__: _number_
|
||||
- __latestOutgoingTx__: _number_
|
||||
- __latestIncomingUserToUserPayment__: _number_
|
||||
- __latestOutgoingUserToUserPayment__: _number_
|
||||
- __max_size__: _number_
|
||||
- __latestIncomingInvoice__: _number_
|
||||
- __latestOutgoingInvoice__: _number_
|
||||
|
||||
### GraphPoint
|
||||
- __x__: _number_
|
||||
- __y__: _number_
|
||||
|
||||
### GetAppUserRequest
|
||||
- __user_identifier__: _string_
|
||||
|
||||
### OpenChannelRequest
|
||||
- __pushAmount__: _number_
|
||||
- __closeAddress__: _string_
|
||||
- __destination__: _string_
|
||||
- __fundingAmount__: _number_
|
||||
|
||||
### EnrollAdminTokenRequest
|
||||
- __admin_token__: _string_
|
||||
|
||||
### LndSeed
|
||||
- __seed__: ARRAY of: _string_
|
||||
|
||||
### RoutingEvent
|
||||
- __outgoing_amt_msat__: _number_
|
||||
- __settled__: _boolean_
|
||||
- __forward_fail_event__: _boolean_
|
||||
- __incoming_htlc_id__: _number_
|
||||
- __outgoing_htlc_id__: _number_
|
||||
- __event_type__: _string_
|
||||
- __incoming_amt_msat__: _number_
|
||||
- __offchain__: _boolean_
|
||||
- __incoming_channel_id__: _number_
|
||||
- __outgoing_channel_id__: _number_
|
||||
- __timestamp_ns__: _number_
|
||||
- __failure_string__: _string_
|
||||
|
||||
### HandleLnurlPayResponse
|
||||
- __routes__: ARRAY of: _[Empty](#Empty)_
|
||||
- __pr__: _string_
|
||||
|
||||
### GetProductBuyLinkResponse
|
||||
- __link__: _string_
|
||||
|
||||
### GetInviteTokenStateResponse
|
||||
- __used__: _boolean_
|
||||
|
||||
### PayAppUserInvoiceRequest
|
||||
- __amount__: _number_
|
||||
- __user_identifier__: _string_
|
||||
- __invoice__: _string_
|
||||
|
||||
### PayInvoiceRequest
|
||||
- __amount__: _number_
|
||||
- __invoice__: _string_
|
||||
|
||||
### LnurlPayInfoResponse
|
||||
- __maxSendable__: _number_
|
||||
- __minSendable__: _number_
|
||||
- __metadata__: _string_
|
||||
- __allowsNostr__: _boolean_
|
||||
- __nostrPubkey__: _string_
|
||||
- __tag__: _string_
|
||||
- __callback__: _string_
|
||||
|
||||
### UserOperation
|
||||
- __confirmed__: _boolean_
|
||||
- __internal__: _boolean_
|
||||
- __paidAtUnix__: _number_
|
||||
- __inbound__: _boolean_
|
||||
- __operationId__: _string_
|
||||
- __service_fee__: _number_
|
||||
- __network_fee__: _number_
|
||||
- __type__: _[UserOperationType](#UserOperationType)_
|
||||
- __amount__: _number_
|
||||
- __identifier__: _string_
|
||||
- __tx_hash__: _string_
|
||||
|
||||
### LiveUserOperation
|
||||
- __operation__: _[UserOperation](#UserOperation)_
|
||||
|
||||
### RelaysMigration
|
||||
- __relays__: ARRAY of: _string_
|
||||
|
||||
### CreateOneTimeInviteLinkRequest
|
||||
- __sats__: _number_ *this field is optional
|
||||
### GetInviteTokenStateRequest
|
||||
- __invite_token__: _string_
|
||||
|
||||
### AppsMetrics
|
||||
- __apps__: ARRAY of: _[AppMetrics](#AppMetrics)_
|
||||
|
||||
### BannedAppUser
|
||||
- __app_name__: _string_
|
||||
|
|
@ -960,41 +908,91 @@ The nostr server will send back a message response, and inside the body there wi
|
|||
- __user_identifier__: _string_
|
||||
- __nostr_pub__: _string_
|
||||
|
||||
### SendAppUserToAppUserPaymentRequest
|
||||
- __from_user_identifier__: _string_
|
||||
- __to_user_identifier__: _string_
|
||||
### NewAddressRequest
|
||||
- __addressType__: _[AddressType](#AddressType)_
|
||||
|
||||
### CreateOneTimeInviteLinkRequest
|
||||
- __sats__: _number_ *this field is optional
|
||||
|
||||
### UseInviteLinkRequest
|
||||
- __invite_token__: _string_
|
||||
|
||||
### Application
|
||||
- __name__: _string_
|
||||
- __id__: _string_
|
||||
- __balance__: _number_
|
||||
- __npub__: _string_
|
||||
|
||||
### SetMockAppUserBalanceRequest
|
||||
- __user_identifier__: _string_
|
||||
- __amount__: _number_
|
||||
|
||||
### NewInvoiceRequest
|
||||
- __amountSats__: _number_
|
||||
- __memo__: _string_
|
||||
### NewInvoiceResponse
|
||||
- __invoice__: _string_
|
||||
|
||||
### OpenChannelResponse
|
||||
- __channelId__: _string_
|
||||
### PayInvoiceResponse
|
||||
- __operation_id__: _string_
|
||||
- __service_fee__: _number_
|
||||
- __network_fee__: _number_
|
||||
- __preimage__: _string_
|
||||
- __amount_paid__: _number_
|
||||
|
||||
### LiveUserOperation
|
||||
- __operation__: _[UserOperation](#UserOperation)_
|
||||
### GetPaymentStateRequest
|
||||
- __invoice__: _string_
|
||||
|
||||
### LndSeed
|
||||
- __seed__: ARRAY of: _string_
|
||||
|
||||
### LnurlWithdrawInfoResponse
|
||||
- __maxWithdrawable__: _number_
|
||||
- __balanceCheck__: _string_
|
||||
- __payLink__: _string_
|
||||
- __tag__: _string_
|
||||
- __callback__: _string_
|
||||
- __k1__: _string_
|
||||
- __defaultDescription__: _string_
|
||||
- __minWithdrawable__: _number_
|
||||
|
||||
### UserOperations
|
||||
- __toIndex__: _number_
|
||||
### AppMetrics
|
||||
- __app__: _[Application](#Application)_
|
||||
- __users__: _[UsersInfo](#UsersInfo)_
|
||||
- __invoices__: _number_
|
||||
- __fees__: _number_
|
||||
- __total_fees__: _number_
|
||||
- __operations__: ARRAY of: _[UserOperation](#UserOperation)_
|
||||
- __fromIndex__: _number_
|
||||
- __received__: _number_
|
||||
- __spent__: _number_
|
||||
- __available__: _number_
|
||||
|
||||
### RequestNPubLinkingTokenRequest
|
||||
### AuthApp
|
||||
- __app__: _[Application](#Application)_
|
||||
- __auth_token__: _string_
|
||||
|
||||
### AddProductRequest
|
||||
- __name__: _string_
|
||||
- __price_sats__: _number_
|
||||
|
||||
### ClosureMigration
|
||||
- __closes_at_unix__: _number_
|
||||
|
||||
### SendAppUserToAppPaymentRequest
|
||||
- __from_user_identifier__: _string_
|
||||
- __amount__: _number_
|
||||
|
||||
### UserInfo
|
||||
- __balance__: _number_
|
||||
- __max_withdrawable__: _number_
|
||||
- __user_identifier__: _string_
|
||||
- __service_fee_bps__: _number_
|
||||
- __network_max_fee_bps__: _number_
|
||||
- __network_max_fee_fixed__: _number_
|
||||
- __userId__: _string_
|
||||
|
||||
### ClosedChannel
|
||||
- __channel_id__: _string_
|
||||
- __capacity__: _number_
|
||||
- __closed_height__: _number_
|
||||
|
||||
### BanUserResponse
|
||||
- __balance_sats__: _number_
|
||||
- __banned_app_users__: ARRAY of: _[BannedAppUser](#BannedAppUser)_
|
||||
|
||||
### MigrationUpdate
|
||||
- __closure__: _[ClosureMigration](#ClosureMigration)_ *this field is optional
|
||||
- __relays__: _[RelaysMigration](#RelaysMigration)_ *this field is optional
|
||||
|
||||
### Empty
|
||||
|
||||
### EncryptionExchangeRequest
|
||||
- __publicKey__: _string_
|
||||
- __deviceId__: _string_
|
||||
## Enums
|
||||
### The enumerators used in the messages
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -141,6 +141,25 @@ 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.ListChannels) throw new Error('method: ListChannels is not implemented')
|
||||
app.get('/api/admin/channels', async (req, res) => {
|
||||
const info: Types.RequestInfo = { rpcName: 'ListChannels', 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.ListChannels) throw new Error('method: ListChannels is not implemented')
|
||||
const authContext = await opts.AdminAuthGuard(req.headers['authorization'])
|
||||
authCtx = authContext
|
||||
stats.guard = process.hrtime.bigint()
|
||||
stats.validate = stats.guard
|
||||
const query = req.query
|
||||
const params = req.params
|
||||
const response = await methods.ListChannels({rpcName:'ListChannels', ctx:authContext })
|
||||
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.GetUsageMetrics) throw new Error('method: GetUsageMetrics is not implemented')
|
||||
app.post('/api/reports/usage', async (req, res) => {
|
||||
const info: Types.RequestInfo = { rpcName: 'GetUsageMetrics', batch: false, nostr: false, batchSize: 0}
|
||||
|
|
|
|||
|
|
@ -87,6 +87,20 @@ export default (params: ClientParams) => ({
|
|||
}
|
||||
return { status: 'ERROR', reason: 'invalid response' }
|
||||
},
|
||||
ListChannels: async (): Promise<ResultError | ({ status: 'OK' }& Types.LndChannels)> => {
|
||||
const auth = await params.retrieveAdminAuth()
|
||||
if (auth === null) throw new Error('retrieveAdminAuth() returned null')
|
||||
let finalRoute = '/api/admin/channels'
|
||||
const { data } = await axios.get(params.baseUrl + finalRoute, { 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.LndChannelsValidate(result)
|
||||
if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message }
|
||||
}
|
||||
return { status: 'ERROR', reason: 'invalid response' }
|
||||
},
|
||||
GetUsageMetrics: async (): Promise<ResultError | ({ status: 'OK' }& Types.UsageMetrics)> => {
|
||||
const auth = await params.retrieveMetricsAuth()
|
||||
if (auth === null) throw new Error('retrieveMetricsAuth() returned null')
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ export type ResultError = { status: 'ERROR', reason: string }
|
|||
|
||||
export type NostrClientParams = {
|
||||
pubDestination: string
|
||||
retrieveNostrAdminAuth: () => Promise<string | null>
|
||||
retrieveNostrMetricsAuth: () => Promise<string | null>
|
||||
retrieveNostrUserAuth: () => Promise<string | null>
|
||||
retrieveNostrGuestWithPubAuth: () => Promise<string | null>
|
||||
retrieveNostrAdminAuth: () => Promise<string | null>
|
||||
checkResult?: true
|
||||
}
|
||||
export default (params: NostrClientParams, send: (to:string, message: NostrRequest) => Promise<any>, subscribe: (to:string, message: NostrRequest, cb:(res:any)=> void) => void) => ({
|
||||
|
|
@ -86,6 +86,20 @@ export default (params: NostrClientParams, send: (to:string, message: NostrRequ
|
|||
}
|
||||
return { status: 'ERROR', reason: 'invalid response' }
|
||||
},
|
||||
ListChannels: async (): Promise<ResultError | ({ status: 'OK' }& Types.LndChannels)> => {
|
||||
const auth = await params.retrieveNostrAdminAuth()
|
||||
if (auth === null) throw new Error('retrieveNostrAdminAuth() returned null')
|
||||
const nostrRequest: NostrRequest = {}
|
||||
const data = await send(params.pubDestination, {rpcName:'ListChannels',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.LndChannelsValidate(result)
|
||||
if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message }
|
||||
}
|
||||
return { status: 'ERROR', reason: 'invalid response' }
|
||||
},
|
||||
GetUsageMetrics: async (): Promise<ResultError | ({ status: 'OK' }& Types.UsageMetrics)> => {
|
||||
const auth = await params.retrieveNostrMetricsAuth()
|
||||
if (auth === null) throw new Error('retrieveNostrMetricsAuth() returned null')
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@ export type NostrOptions = {
|
|||
logger?: Logger
|
||||
throwErrors?: true
|
||||
metricsCallback: (metrics: Types.RequestMetric[]) => void
|
||||
NostrAdminAuthGuard: (appId?:string, identifier?: string) => Promise<Types.AdminContext>
|
||||
NostrMetricsAuthGuard: (appId?:string, identifier?: string) => Promise<Types.MetricsContext>
|
||||
NostrUserAuthGuard: (appId?:string, identifier?: string) => Promise<Types.UserContext>
|
||||
NostrGuestWithPubAuthGuard: (appId?:string, identifier?: string) => Promise<Types.GuestWithPubContext>
|
||||
NostrAdminAuthGuard: (appId?:string, identifier?: string) => Promise<Types.AdminContext>
|
||||
}
|
||||
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 })
|
||||
|
|
@ -109,6 +109,19 @@ 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 'ListChannels':
|
||||
try {
|
||||
if (!methods.ListChannels) throw new Error('method: ListChannels is not implemented')
|
||||
const authContext = await opts.NostrAdminAuthGuard(req.appId, req.authIdentifier)
|
||||
stats.guard = process.hrtime.bigint()
|
||||
authCtx = authContext
|
||||
stats.validate = stats.guard
|
||||
const response = await methods.ListChannels({rpcName:'ListChannels', ctx:authContext })
|
||||
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
|
||||
case 'GetUsageMetrics':
|
||||
try {
|
||||
if (!methods.GetUsageMetrics) throw new Error('method: GetUsageMetrics is not implemented')
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,128 +1,128 @@
|
|||
// @generated by protobuf-ts 2.8.1
|
||||
// @generated from protobuf file "chainnotifier.proto" (package "chainrpc", syntax proto3)
|
||||
// tslint:disable
|
||||
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
|
||||
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
|
||||
import { ChainNotifier } from "./chainnotifier.js";
|
||||
import type { BlockEpoch } from "./chainnotifier.js";
|
||||
import type { SpendEvent } from "./chainnotifier.js";
|
||||
import type { SpendRequest } from "./chainnotifier.js";
|
||||
import { stackIntercept } from "@protobuf-ts/runtime-rpc";
|
||||
import type { ConfEvent } from "./chainnotifier.js";
|
||||
import type { ConfRequest } from "./chainnotifier.js";
|
||||
import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
|
||||
import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
|
||||
/**
|
||||
* ChainNotifier is a service that can be used to get information about the
|
||||
* chain backend by registering notifiers for chain events.
|
||||
*
|
||||
* @generated from protobuf service chainrpc.ChainNotifier
|
||||
*/
|
||||
export interface IChainNotifierClient {
|
||||
/**
|
||||
*
|
||||
* RegisterConfirmationsNtfn is a synchronous response-streaming RPC that
|
||||
* registers an intent for a client to be notified once a confirmation request
|
||||
* has reached its required number of confirmations on-chain.
|
||||
*
|
||||
* A confirmation request must have a valid output script. It is also possible
|
||||
* to give a transaction ID. If the transaction ID is not set, a notification
|
||||
* is sent once the output script confirms. If the transaction ID is also set,
|
||||
* a notification is sent once the output script confirms in the given
|
||||
* transaction.
|
||||
*
|
||||
* @generated from protobuf rpc: RegisterConfirmationsNtfn(chainrpc.ConfRequest) returns (stream chainrpc.ConfEvent);
|
||||
*/
|
||||
registerConfirmationsNtfn(input: ConfRequest, options?: RpcOptions): ServerStreamingCall<ConfRequest, ConfEvent>;
|
||||
/**
|
||||
*
|
||||
* RegisterSpendNtfn is a synchronous response-streaming RPC that registers an
|
||||
* intent for a client to be notification once a spend request has been spent
|
||||
* by a transaction that has confirmed on-chain.
|
||||
*
|
||||
* A client can specify whether the spend request should be for a particular
|
||||
* outpoint or for an output script by specifying a zero outpoint.
|
||||
*
|
||||
* @generated from protobuf rpc: RegisterSpendNtfn(chainrpc.SpendRequest) returns (stream chainrpc.SpendEvent);
|
||||
*/
|
||||
registerSpendNtfn(input: SpendRequest, options?: RpcOptions): ServerStreamingCall<SpendRequest, SpendEvent>;
|
||||
/**
|
||||
*
|
||||
* RegisterBlockEpochNtfn is a synchronous response-streaming RPC that
|
||||
* registers an intent for a client to be notified of blocks in the chain. The
|
||||
* stream will return a hash and height tuple of a block for each new/stale
|
||||
* block in the chain. It is the client's responsibility to determine whether
|
||||
* the tuple returned is for a new or stale block in the chain.
|
||||
*
|
||||
* A client can also request a historical backlog of blocks from a particular
|
||||
* point. This allows clients to be idempotent by ensuring that they do not
|
||||
* missing processing a single block within the chain.
|
||||
*
|
||||
* @generated from protobuf rpc: RegisterBlockEpochNtfn(chainrpc.BlockEpoch) returns (stream chainrpc.BlockEpoch);
|
||||
*/
|
||||
registerBlockEpochNtfn(input: BlockEpoch, options?: RpcOptions): ServerStreamingCall<BlockEpoch, BlockEpoch>;
|
||||
}
|
||||
/**
|
||||
* ChainNotifier is a service that can be used to get information about the
|
||||
* chain backend by registering notifiers for chain events.
|
||||
*
|
||||
* @generated from protobuf service chainrpc.ChainNotifier
|
||||
*/
|
||||
export class ChainNotifierClient implements IChainNotifierClient, ServiceInfo {
|
||||
typeName = ChainNotifier.typeName;
|
||||
methods = ChainNotifier.methods;
|
||||
options = ChainNotifier.options;
|
||||
constructor(private readonly _transport: RpcTransport) {
|
||||
}
|
||||
/**
|
||||
*
|
||||
* RegisterConfirmationsNtfn is a synchronous response-streaming RPC that
|
||||
* registers an intent for a client to be notified once a confirmation request
|
||||
* has reached its required number of confirmations on-chain.
|
||||
*
|
||||
* A confirmation request must have a valid output script. It is also possible
|
||||
* to give a transaction ID. If the transaction ID is not set, a notification
|
||||
* is sent once the output script confirms. If the transaction ID is also set,
|
||||
* a notification is sent once the output script confirms in the given
|
||||
* transaction.
|
||||
*
|
||||
* @generated from protobuf rpc: RegisterConfirmationsNtfn(chainrpc.ConfRequest) returns (stream chainrpc.ConfEvent);
|
||||
*/
|
||||
registerConfirmationsNtfn(input: ConfRequest, options?: RpcOptions): ServerStreamingCall<ConfRequest, ConfEvent> {
|
||||
const method = this.methods[0], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<ConfRequest, ConfEvent>("serverStreaming", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* RegisterSpendNtfn is a synchronous response-streaming RPC that registers an
|
||||
* intent for a client to be notification once a spend request has been spent
|
||||
* by a transaction that has confirmed on-chain.
|
||||
*
|
||||
* A client can specify whether the spend request should be for a particular
|
||||
* outpoint or for an output script by specifying a zero outpoint.
|
||||
*
|
||||
* @generated from protobuf rpc: RegisterSpendNtfn(chainrpc.SpendRequest) returns (stream chainrpc.SpendEvent);
|
||||
*/
|
||||
registerSpendNtfn(input: SpendRequest, options?: RpcOptions): ServerStreamingCall<SpendRequest, SpendEvent> {
|
||||
const method = this.methods[1], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<SpendRequest, SpendEvent>("serverStreaming", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* RegisterBlockEpochNtfn is a synchronous response-streaming RPC that
|
||||
* registers an intent for a client to be notified of blocks in the chain. The
|
||||
* stream will return a hash and height tuple of a block for each new/stale
|
||||
* block in the chain. It is the client's responsibility to determine whether
|
||||
* the tuple returned is for a new or stale block in the chain.
|
||||
*
|
||||
* A client can also request a historical backlog of blocks from a particular
|
||||
* point. This allows clients to be idempotent by ensuring that they do not
|
||||
* missing processing a single block within the chain.
|
||||
*
|
||||
* @generated from protobuf rpc: RegisterBlockEpochNtfn(chainrpc.BlockEpoch) returns (stream chainrpc.BlockEpoch);
|
||||
*/
|
||||
registerBlockEpochNtfn(input: BlockEpoch, options?: RpcOptions): ServerStreamingCall<BlockEpoch, BlockEpoch> {
|
||||
const method = this.methods[2], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<BlockEpoch, BlockEpoch>("serverStreaming", this._transport, method, opt, input);
|
||||
}
|
||||
}
|
||||
// @generated by protobuf-ts 2.8.1
|
||||
// @generated from protobuf file "chainnotifier.proto" (package "chainrpc", syntax proto3)
|
||||
// tslint:disable
|
||||
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
|
||||
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
|
||||
import { ChainNotifier } from "./chainnotifier.js";
|
||||
import type { BlockEpoch } from "./chainnotifier.js";
|
||||
import type { SpendEvent } from "./chainnotifier.js";
|
||||
import type { SpendRequest } from "./chainnotifier.js";
|
||||
import { stackIntercept } from "@protobuf-ts/runtime-rpc";
|
||||
import type { ConfEvent } from "./chainnotifier";
|
||||
import type { ConfRequest } from "./chainnotifier";
|
||||
import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
|
||||
import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
|
||||
/**
|
||||
* ChainNotifier is a service that can be used to get information about the
|
||||
* chain backend by registering notifiers for chain events.
|
||||
*
|
||||
* @generated from protobuf service chainrpc.ChainNotifier
|
||||
*/
|
||||
export interface IChainNotifierClient {
|
||||
/**
|
||||
*
|
||||
* RegisterConfirmationsNtfn is a synchronous response-streaming RPC that
|
||||
* registers an intent for a client to be notified once a confirmation request
|
||||
* has reached its required number of confirmations on-chain.
|
||||
*
|
||||
* A confirmation request must have a valid output script. It is also possible
|
||||
* to give a transaction ID. If the transaction ID is not set, a notification
|
||||
* is sent once the output script confirms. If the transaction ID is also set,
|
||||
* a notification is sent once the output script confirms in the given
|
||||
* transaction.
|
||||
*
|
||||
* @generated from protobuf rpc: RegisterConfirmationsNtfn(chainrpc.ConfRequest) returns (stream chainrpc.ConfEvent);
|
||||
*/
|
||||
registerConfirmationsNtfn(input: ConfRequest, options?: RpcOptions): ServerStreamingCall<ConfRequest, ConfEvent>;
|
||||
/**
|
||||
*
|
||||
* RegisterSpendNtfn is a synchronous response-streaming RPC that registers an
|
||||
* intent for a client to be notification once a spend request has been spent
|
||||
* by a transaction that has confirmed on-chain.
|
||||
*
|
||||
* A client can specify whether the spend request should be for a particular
|
||||
* outpoint or for an output script by specifying a zero outpoint.
|
||||
*
|
||||
* @generated from protobuf rpc: RegisterSpendNtfn(chainrpc.SpendRequest) returns (stream chainrpc.SpendEvent);
|
||||
*/
|
||||
registerSpendNtfn(input: SpendRequest, options?: RpcOptions): ServerStreamingCall<SpendRequest, SpendEvent>;
|
||||
/**
|
||||
*
|
||||
* RegisterBlockEpochNtfn is a synchronous response-streaming RPC that
|
||||
* registers an intent for a client to be notified of blocks in the chain. The
|
||||
* stream will return a hash and height tuple of a block for each new/stale
|
||||
* block in the chain. It is the client's responsibility to determine whether
|
||||
* the tuple returned is for a new or stale block in the chain.
|
||||
*
|
||||
* A client can also request a historical backlog of blocks from a particular
|
||||
* point. This allows clients to be idempotent by ensuring that they do not
|
||||
* missing processing a single block within the chain.
|
||||
*
|
||||
* @generated from protobuf rpc: RegisterBlockEpochNtfn(chainrpc.BlockEpoch) returns (stream chainrpc.BlockEpoch);
|
||||
*/
|
||||
registerBlockEpochNtfn(input: BlockEpoch, options?: RpcOptions): ServerStreamingCall<BlockEpoch, BlockEpoch>;
|
||||
}
|
||||
/**
|
||||
* ChainNotifier is a service that can be used to get information about the
|
||||
* chain backend by registering notifiers for chain events.
|
||||
*
|
||||
* @generated from protobuf service chainrpc.ChainNotifier
|
||||
*/
|
||||
export class ChainNotifierClient implements IChainNotifierClient, ServiceInfo {
|
||||
typeName = ChainNotifier.typeName;
|
||||
methods = ChainNotifier.methods;
|
||||
options = ChainNotifier.options;
|
||||
constructor(private readonly _transport: RpcTransport) {
|
||||
}
|
||||
/**
|
||||
*
|
||||
* RegisterConfirmationsNtfn is a synchronous response-streaming RPC that
|
||||
* registers an intent for a client to be notified once a confirmation request
|
||||
* has reached its required number of confirmations on-chain.
|
||||
*
|
||||
* A confirmation request must have a valid output script. It is also possible
|
||||
* to give a transaction ID. If the transaction ID is not set, a notification
|
||||
* is sent once the output script confirms. If the transaction ID is also set,
|
||||
* a notification is sent once the output script confirms in the given
|
||||
* transaction.
|
||||
*
|
||||
* @generated from protobuf rpc: RegisterConfirmationsNtfn(chainrpc.ConfRequest) returns (stream chainrpc.ConfEvent);
|
||||
*/
|
||||
registerConfirmationsNtfn(input: ConfRequest, options?: RpcOptions): ServerStreamingCall<ConfRequest, ConfEvent> {
|
||||
const method = this.methods[0], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<ConfRequest, ConfEvent>("serverStreaming", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* RegisterSpendNtfn is a synchronous response-streaming RPC that registers an
|
||||
* intent for a client to be notification once a spend request has been spent
|
||||
* by a transaction that has confirmed on-chain.
|
||||
*
|
||||
* A client can specify whether the spend request should be for a particular
|
||||
* outpoint or for an output script by specifying a zero outpoint.
|
||||
*
|
||||
* @generated from protobuf rpc: RegisterSpendNtfn(chainrpc.SpendRequest) returns (stream chainrpc.SpendEvent);
|
||||
*/
|
||||
registerSpendNtfn(input: SpendRequest, options?: RpcOptions): ServerStreamingCall<SpendRequest, SpendEvent> {
|
||||
const method = this.methods[1], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<SpendRequest, SpendEvent>("serverStreaming", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* RegisterBlockEpochNtfn is a synchronous response-streaming RPC that
|
||||
* registers an intent for a client to be notified of blocks in the chain. The
|
||||
* stream will return a hash and height tuple of a block for each new/stale
|
||||
* block in the chain. It is the client's responsibility to determine whether
|
||||
* the tuple returned is for a new or stale block in the chain.
|
||||
*
|
||||
* A client can also request a historical backlog of blocks from a particular
|
||||
* point. This allows clients to be idempotent by ensuring that they do not
|
||||
* missing processing a single block within the chain.
|
||||
*
|
||||
* @generated from protobuf rpc: RegisterBlockEpochNtfn(chainrpc.BlockEpoch) returns (stream chainrpc.BlockEpoch);
|
||||
*/
|
||||
registerBlockEpochNtfn(input: BlockEpoch, options?: RpcOptions): ServerStreamingCall<BlockEpoch, BlockEpoch> {
|
||||
const method = this.methods[2], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<BlockEpoch, BlockEpoch>("serverStreaming", this._transport, method, opt, input);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,139 +1,139 @@
|
|||
// @generated by protobuf-ts 2.8.1
|
||||
// @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3)
|
||||
// tslint:disable
|
||||
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
|
||||
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
|
||||
import { Invoices } from "./invoices.js";
|
||||
import type { LookupInvoiceMsg } from "./invoices.js";
|
||||
import type { SettleInvoiceResp } from "./invoices.js";
|
||||
import type { SettleInvoiceMsg } from "./invoices.js";
|
||||
import type { AddHoldInvoiceResp } from "./invoices.js";
|
||||
import type { AddHoldInvoiceRequest } from "./invoices.js";
|
||||
import type { CancelInvoiceResp } from "./invoices.js";
|
||||
import type { CancelInvoiceMsg } from "./invoices.js";
|
||||
import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
|
||||
import { stackIntercept } from "@protobuf-ts/runtime-rpc";
|
||||
import type { Invoice } from "./lightning.js";
|
||||
import type { SubscribeSingleInvoiceRequest } from "./invoices.js";
|
||||
import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
|
||||
import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
|
||||
/**
|
||||
* Invoices is a service that can be used to create, accept, settle and cancel
|
||||
* invoices.
|
||||
*
|
||||
* @generated from protobuf service invoicesrpc.Invoices
|
||||
*/
|
||||
export interface IInvoicesClient {
|
||||
/**
|
||||
*
|
||||
* SubscribeSingleInvoice returns a uni-directional stream (server -> client)
|
||||
* to notify the client of state transitions of the specified invoice.
|
||||
* Initially the current invoice state is always sent out.
|
||||
*
|
||||
* @generated from protobuf rpc: SubscribeSingleInvoice(invoicesrpc.SubscribeSingleInvoiceRequest) returns (stream lnrpc.Invoice);
|
||||
*/
|
||||
subscribeSingleInvoice(input: SubscribeSingleInvoiceRequest, options?: RpcOptions): ServerStreamingCall<SubscribeSingleInvoiceRequest, Invoice>;
|
||||
/**
|
||||
*
|
||||
* CancelInvoice cancels a currently open invoice. If the invoice is already
|
||||
* canceled, this call will succeed. If the invoice is already settled, it will
|
||||
* fail.
|
||||
*
|
||||
* @generated from protobuf rpc: CancelInvoice(invoicesrpc.CancelInvoiceMsg) returns (invoicesrpc.CancelInvoiceResp);
|
||||
*/
|
||||
cancelInvoice(input: CancelInvoiceMsg, options?: RpcOptions): UnaryCall<CancelInvoiceMsg, CancelInvoiceResp>;
|
||||
/**
|
||||
*
|
||||
* AddHoldInvoice creates a hold invoice. It ties the invoice to the hash
|
||||
* supplied in the request.
|
||||
*
|
||||
* @generated from protobuf rpc: AddHoldInvoice(invoicesrpc.AddHoldInvoiceRequest) returns (invoicesrpc.AddHoldInvoiceResp);
|
||||
*/
|
||||
addHoldInvoice(input: AddHoldInvoiceRequest, options?: RpcOptions): UnaryCall<AddHoldInvoiceRequest, AddHoldInvoiceResp>;
|
||||
/**
|
||||
*
|
||||
* SettleInvoice settles an accepted invoice. If the invoice is already
|
||||
* settled, this call will succeed.
|
||||
*
|
||||
* @generated from protobuf rpc: SettleInvoice(invoicesrpc.SettleInvoiceMsg) returns (invoicesrpc.SettleInvoiceResp);
|
||||
*/
|
||||
settleInvoice(input: SettleInvoiceMsg, options?: RpcOptions): UnaryCall<SettleInvoiceMsg, SettleInvoiceResp>;
|
||||
/**
|
||||
*
|
||||
* LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced
|
||||
* using either its payment hash, payment address, or set ID.
|
||||
*
|
||||
* @generated from protobuf rpc: LookupInvoiceV2(invoicesrpc.LookupInvoiceMsg) returns (lnrpc.Invoice);
|
||||
*/
|
||||
lookupInvoiceV2(input: LookupInvoiceMsg, options?: RpcOptions): UnaryCall<LookupInvoiceMsg, Invoice>;
|
||||
}
|
||||
/**
|
||||
* Invoices is a service that can be used to create, accept, settle and cancel
|
||||
* invoices.
|
||||
*
|
||||
* @generated from protobuf service invoicesrpc.Invoices
|
||||
*/
|
||||
export class InvoicesClient implements IInvoicesClient, ServiceInfo {
|
||||
typeName = Invoices.typeName;
|
||||
methods = Invoices.methods;
|
||||
options = Invoices.options;
|
||||
constructor(private readonly _transport: RpcTransport) {
|
||||
}
|
||||
/**
|
||||
*
|
||||
* SubscribeSingleInvoice returns a uni-directional stream (server -> client)
|
||||
* to notify the client of state transitions of the specified invoice.
|
||||
* Initially the current invoice state is always sent out.
|
||||
*
|
||||
* @generated from protobuf rpc: SubscribeSingleInvoice(invoicesrpc.SubscribeSingleInvoiceRequest) returns (stream lnrpc.Invoice);
|
||||
*/
|
||||
subscribeSingleInvoice(input: SubscribeSingleInvoiceRequest, options?: RpcOptions): ServerStreamingCall<SubscribeSingleInvoiceRequest, Invoice> {
|
||||
const method = this.methods[0], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<SubscribeSingleInvoiceRequest, Invoice>("serverStreaming", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* CancelInvoice cancels a currently open invoice. If the invoice is already
|
||||
* canceled, this call will succeed. If the invoice is already settled, it will
|
||||
* fail.
|
||||
*
|
||||
* @generated from protobuf rpc: CancelInvoice(invoicesrpc.CancelInvoiceMsg) returns (invoicesrpc.CancelInvoiceResp);
|
||||
*/
|
||||
cancelInvoice(input: CancelInvoiceMsg, options?: RpcOptions): UnaryCall<CancelInvoiceMsg, CancelInvoiceResp> {
|
||||
const method = this.methods[1], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<CancelInvoiceMsg, CancelInvoiceResp>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* AddHoldInvoice creates a hold invoice. It ties the invoice to the hash
|
||||
* supplied in the request.
|
||||
*
|
||||
* @generated from protobuf rpc: AddHoldInvoice(invoicesrpc.AddHoldInvoiceRequest) returns (invoicesrpc.AddHoldInvoiceResp);
|
||||
*/
|
||||
addHoldInvoice(input: AddHoldInvoiceRequest, options?: RpcOptions): UnaryCall<AddHoldInvoiceRequest, AddHoldInvoiceResp> {
|
||||
const method = this.methods[2], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<AddHoldInvoiceRequest, AddHoldInvoiceResp>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* SettleInvoice settles an accepted invoice. If the invoice is already
|
||||
* settled, this call will succeed.
|
||||
*
|
||||
* @generated from protobuf rpc: SettleInvoice(invoicesrpc.SettleInvoiceMsg) returns (invoicesrpc.SettleInvoiceResp);
|
||||
*/
|
||||
settleInvoice(input: SettleInvoiceMsg, options?: RpcOptions): UnaryCall<SettleInvoiceMsg, SettleInvoiceResp> {
|
||||
const method = this.methods[3], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<SettleInvoiceMsg, SettleInvoiceResp>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced
|
||||
* using either its payment hash, payment address, or set ID.
|
||||
*
|
||||
* @generated from protobuf rpc: LookupInvoiceV2(invoicesrpc.LookupInvoiceMsg) returns (lnrpc.Invoice);
|
||||
*/
|
||||
lookupInvoiceV2(input: LookupInvoiceMsg, options?: RpcOptions): UnaryCall<LookupInvoiceMsg, Invoice> {
|
||||
const method = this.methods[4], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<LookupInvoiceMsg, Invoice>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
}
|
||||
// @generated by protobuf-ts 2.8.1
|
||||
// @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3)
|
||||
// tslint:disable
|
||||
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
|
||||
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
|
||||
import { Invoices } from "./invoices.js";
|
||||
import type { LookupInvoiceMsg } from "./invoices.js";
|
||||
import type { SettleInvoiceResp } from "./invoices.js";
|
||||
import type { SettleInvoiceMsg } from "./invoices.js";
|
||||
import type { AddHoldInvoiceResp } from "./invoices.js";
|
||||
import type { AddHoldInvoiceRequest } from "./invoices.js";
|
||||
import type { CancelInvoiceResp } from "./invoices.js";
|
||||
import type { CancelInvoiceMsg } from "./invoices.js";
|
||||
import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
|
||||
import { stackIntercept } from "@protobuf-ts/runtime-rpc";
|
||||
import type { Invoice } from "./lightning.js";
|
||||
import type { SubscribeSingleInvoiceRequest } from "./invoices.js";
|
||||
import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
|
||||
import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
|
||||
/**
|
||||
* Invoices is a service that can be used to create, accept, settle and cancel
|
||||
* invoices.
|
||||
*
|
||||
* @generated from protobuf service invoicesrpc.Invoices
|
||||
*/
|
||||
export interface IInvoicesClient {
|
||||
/**
|
||||
*
|
||||
* SubscribeSingleInvoice returns a uni-directional stream (server -> client)
|
||||
* to notify the client of state transitions of the specified invoice.
|
||||
* Initially the current invoice state is always sent out.
|
||||
*
|
||||
* @generated from protobuf rpc: SubscribeSingleInvoice(invoicesrpc.SubscribeSingleInvoiceRequest) returns (stream lnrpc.Invoice);
|
||||
*/
|
||||
subscribeSingleInvoice(input: SubscribeSingleInvoiceRequest, options?: RpcOptions): ServerStreamingCall<SubscribeSingleInvoiceRequest, Invoice>;
|
||||
/**
|
||||
*
|
||||
* CancelInvoice cancels a currently open invoice. If the invoice is already
|
||||
* canceled, this call will succeed. If the invoice is already settled, it will
|
||||
* fail.
|
||||
*
|
||||
* @generated from protobuf rpc: CancelInvoice(invoicesrpc.CancelInvoiceMsg) returns (invoicesrpc.CancelInvoiceResp);
|
||||
*/
|
||||
cancelInvoice(input: CancelInvoiceMsg, options?: RpcOptions): UnaryCall<CancelInvoiceMsg, CancelInvoiceResp>;
|
||||
/**
|
||||
*
|
||||
* AddHoldInvoice creates a hold invoice. It ties the invoice to the hash
|
||||
* supplied in the request.
|
||||
*
|
||||
* @generated from protobuf rpc: AddHoldInvoice(invoicesrpc.AddHoldInvoiceRequest) returns (invoicesrpc.AddHoldInvoiceResp);
|
||||
*/
|
||||
addHoldInvoice(input: AddHoldInvoiceRequest, options?: RpcOptions): UnaryCall<AddHoldInvoiceRequest, AddHoldInvoiceResp>;
|
||||
/**
|
||||
*
|
||||
* SettleInvoice settles an accepted invoice. If the invoice is already
|
||||
* settled, this call will succeed.
|
||||
*
|
||||
* @generated from protobuf rpc: SettleInvoice(invoicesrpc.SettleInvoiceMsg) returns (invoicesrpc.SettleInvoiceResp);
|
||||
*/
|
||||
settleInvoice(input: SettleInvoiceMsg, options?: RpcOptions): UnaryCall<SettleInvoiceMsg, SettleInvoiceResp>;
|
||||
/**
|
||||
*
|
||||
* LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced
|
||||
* using either its payment hash, payment address, or set ID.
|
||||
*
|
||||
* @generated from protobuf rpc: LookupInvoiceV2(invoicesrpc.LookupInvoiceMsg) returns (lnrpc.Invoice);
|
||||
*/
|
||||
lookupInvoiceV2(input: LookupInvoiceMsg, options?: RpcOptions): UnaryCall<LookupInvoiceMsg, Invoice>;
|
||||
}
|
||||
/**
|
||||
* Invoices is a service that can be used to create, accept, settle and cancel
|
||||
* invoices.
|
||||
*
|
||||
* @generated from protobuf service invoicesrpc.Invoices
|
||||
*/
|
||||
export class InvoicesClient implements IInvoicesClient, ServiceInfo {
|
||||
typeName = Invoices.typeName;
|
||||
methods = Invoices.methods;
|
||||
options = Invoices.options;
|
||||
constructor(private readonly _transport: RpcTransport) {
|
||||
}
|
||||
/**
|
||||
*
|
||||
* SubscribeSingleInvoice returns a uni-directional stream (server -> client)
|
||||
* to notify the client of state transitions of the specified invoice.
|
||||
* Initially the current invoice state is always sent out.
|
||||
*
|
||||
* @generated from protobuf rpc: SubscribeSingleInvoice(invoicesrpc.SubscribeSingleInvoiceRequest) returns (stream lnrpc.Invoice);
|
||||
*/
|
||||
subscribeSingleInvoice(input: SubscribeSingleInvoiceRequest, options?: RpcOptions): ServerStreamingCall<SubscribeSingleInvoiceRequest, Invoice> {
|
||||
const method = this.methods[0], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<SubscribeSingleInvoiceRequest, Invoice>("serverStreaming", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* CancelInvoice cancels a currently open invoice. If the invoice is already
|
||||
* canceled, this call will succeed. If the invoice is already settled, it will
|
||||
* fail.
|
||||
*
|
||||
* @generated from protobuf rpc: CancelInvoice(invoicesrpc.CancelInvoiceMsg) returns (invoicesrpc.CancelInvoiceResp);
|
||||
*/
|
||||
cancelInvoice(input: CancelInvoiceMsg, options?: RpcOptions): UnaryCall<CancelInvoiceMsg, CancelInvoiceResp> {
|
||||
const method = this.methods[1], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<CancelInvoiceMsg, CancelInvoiceResp>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* AddHoldInvoice creates a hold invoice. It ties the invoice to the hash
|
||||
* supplied in the request.
|
||||
*
|
||||
* @generated from protobuf rpc: AddHoldInvoice(invoicesrpc.AddHoldInvoiceRequest) returns (invoicesrpc.AddHoldInvoiceResp);
|
||||
*/
|
||||
addHoldInvoice(input: AddHoldInvoiceRequest, options?: RpcOptions): UnaryCall<AddHoldInvoiceRequest, AddHoldInvoiceResp> {
|
||||
const method = this.methods[2], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<AddHoldInvoiceRequest, AddHoldInvoiceResp>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* SettleInvoice settles an accepted invoice. If the invoice is already
|
||||
* settled, this call will succeed.
|
||||
*
|
||||
* @generated from protobuf rpc: SettleInvoice(invoicesrpc.SettleInvoiceMsg) returns (invoicesrpc.SettleInvoiceResp);
|
||||
*/
|
||||
settleInvoice(input: SettleInvoiceMsg, options?: RpcOptions): UnaryCall<SettleInvoiceMsg, SettleInvoiceResp> {
|
||||
const method = this.methods[3], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<SettleInvoiceMsg, SettleInvoiceResp>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced
|
||||
* using either its payment hash, payment address, or set ID.
|
||||
*
|
||||
* @generated from protobuf rpc: LookupInvoiceV2(invoicesrpc.LookupInvoiceMsg) returns (lnrpc.Invoice);
|
||||
*/
|
||||
lookupInvoiceV2(input: LookupInvoiceMsg, options?: RpcOptions): UnaryCall<LookupInvoiceMsg, Invoice> {
|
||||
const method = this.methods[4], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<LookupInvoiceMsg, Invoice>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
43491
proto/lnd/lightning.ts
43491
proto/lnd/lightning.ts
File diff suppressed because it is too large
Load diff
|
|
@ -1,446 +1,446 @@
|
|||
// @generated by protobuf-ts 2.8.1
|
||||
// @generated from protobuf file "router.proto" (package "routerrpc", syntax proto3)
|
||||
// tslint:disable
|
||||
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
|
||||
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
|
||||
import { Router } from "./router.js";
|
||||
import type { UpdateChanStatusResponse } from "./router.js";
|
||||
import type { UpdateChanStatusRequest } from "./router.js";
|
||||
import type { ForwardHtlcInterceptRequest } from "./router.js";
|
||||
import type { ForwardHtlcInterceptResponse } from "./router.js";
|
||||
import type { DuplexStreamingCall } from "@protobuf-ts/runtime-rpc";
|
||||
import type { PaymentStatus } from "./router.js";
|
||||
import type { HtlcEvent } from "./router.js";
|
||||
import type { SubscribeHtlcEventsRequest } from "./router.js";
|
||||
import type { BuildRouteResponse } from "./router.js";
|
||||
import type { BuildRouteRequest } from "./router.js";
|
||||
import type { QueryProbabilityResponse } from "./router.js";
|
||||
import type { QueryProbabilityRequest } from "./router.js";
|
||||
import type { SetMissionControlConfigResponse } from "./router.js";
|
||||
import type { SetMissionControlConfigRequest } from "./router.js";
|
||||
import type { GetMissionControlConfigResponse } from "./router.js";
|
||||
import type { GetMissionControlConfigRequest } from "./router.js";
|
||||
import type { XImportMissionControlResponse } from "./router.js";
|
||||
import type { XImportMissionControlRequest } from "./router.js";
|
||||
import type { QueryMissionControlResponse } from "./router.js";
|
||||
import type { QueryMissionControlRequest } from "./router.js";
|
||||
import type { ResetMissionControlResponse } from "./router.js";
|
||||
import type { ResetMissionControlRequest } from "./router.js";
|
||||
import type { HTLCAttempt } from "./lightning.js";
|
||||
import type { SendToRouteResponse } from "./router.js";
|
||||
import type { SendToRouteRequest } from "./router.js";
|
||||
import type { RouteFeeResponse } from "./router.js";
|
||||
import type { RouteFeeRequest } from "./router.js";
|
||||
import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
|
||||
import type { TrackPaymentsRequest } from "./router.js";
|
||||
import type { TrackPaymentRequest } from "./router.js";
|
||||
import { stackIntercept } from "@protobuf-ts/runtime-rpc";
|
||||
import type { Payment } from "./lightning.js";
|
||||
import type { SendPaymentRequest } from "./router.js";
|
||||
import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
|
||||
import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
|
||||
/**
|
||||
* Router is a service that offers advanced interaction with the router
|
||||
* subsystem of the daemon.
|
||||
*
|
||||
* @generated from protobuf service routerrpc.Router
|
||||
*/
|
||||
export interface IRouterClient {
|
||||
/**
|
||||
*
|
||||
* SendPaymentV2 attempts to route a payment described by the passed
|
||||
* PaymentRequest to the final destination. The call returns a stream of
|
||||
* payment updates.
|
||||
*
|
||||
* @generated from protobuf rpc: SendPaymentV2(routerrpc.SendPaymentRequest) returns (stream lnrpc.Payment);
|
||||
*/
|
||||
sendPaymentV2(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall<SendPaymentRequest, Payment>;
|
||||
/**
|
||||
*
|
||||
* TrackPaymentV2 returns an update stream for the payment identified by the
|
||||
* payment hash.
|
||||
*
|
||||
* @generated from protobuf rpc: TrackPaymentV2(routerrpc.TrackPaymentRequest) returns (stream lnrpc.Payment);
|
||||
*/
|
||||
trackPaymentV2(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentRequest, Payment>;
|
||||
/**
|
||||
*
|
||||
* TrackPayments returns an update stream for every payment that is not in a
|
||||
* terminal state. Note that if payments are in-flight while starting a new
|
||||
* subscription, the start of the payment stream could produce out-of-order
|
||||
* and/or duplicate events. In order to get updates for every in-flight
|
||||
* payment attempt make sure to subscribe to this method before initiating any
|
||||
* payments.
|
||||
*
|
||||
* @generated from protobuf rpc: TrackPayments(routerrpc.TrackPaymentsRequest) returns (stream lnrpc.Payment);
|
||||
*/
|
||||
trackPayments(input: TrackPaymentsRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentsRequest, Payment>;
|
||||
/**
|
||||
*
|
||||
* EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it
|
||||
* may cost to send an HTLC to the target end destination.
|
||||
*
|
||||
* @generated from protobuf rpc: EstimateRouteFee(routerrpc.RouteFeeRequest) returns (routerrpc.RouteFeeResponse);
|
||||
*/
|
||||
estimateRouteFee(input: RouteFeeRequest, options?: RpcOptions): UnaryCall<RouteFeeRequest, RouteFeeResponse>;
|
||||
/**
|
||||
*
|
||||
* Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via
|
||||
* the specified route. This method differs from SendPayment in that it
|
||||
* allows users to specify a full route manually. This can be used for
|
||||
* things like rebalancing, and atomic swaps. It differs from the newer
|
||||
* SendToRouteV2 in that it doesn't return the full HTLC information.
|
||||
*
|
||||
* @deprecated
|
||||
* @generated from protobuf rpc: SendToRoute(routerrpc.SendToRouteRequest) returns (routerrpc.SendToRouteResponse);
|
||||
*/
|
||||
sendToRoute(input: SendToRouteRequest, options?: RpcOptions): UnaryCall<SendToRouteRequest, SendToRouteResponse>;
|
||||
/**
|
||||
*
|
||||
* SendToRouteV2 attempts to make a payment via the specified route. This
|
||||
* method differs from SendPayment in that it allows users to specify a full
|
||||
* route manually. This can be used for things like rebalancing, and atomic
|
||||
* swaps.
|
||||
*
|
||||
* @generated from protobuf rpc: SendToRouteV2(routerrpc.SendToRouteRequest) returns (lnrpc.HTLCAttempt);
|
||||
*/
|
||||
sendToRouteV2(input: SendToRouteRequest, options?: RpcOptions): UnaryCall<SendToRouteRequest, HTLCAttempt>;
|
||||
/**
|
||||
*
|
||||
* ResetMissionControl clears all mission control state and starts with a clean
|
||||
* slate.
|
||||
*
|
||||
* @generated from protobuf rpc: ResetMissionControl(routerrpc.ResetMissionControlRequest) returns (routerrpc.ResetMissionControlResponse);
|
||||
*/
|
||||
resetMissionControl(input: ResetMissionControlRequest, options?: RpcOptions): UnaryCall<ResetMissionControlRequest, ResetMissionControlResponse>;
|
||||
/**
|
||||
*
|
||||
* QueryMissionControl exposes the internal mission control state to callers.
|
||||
* It is a development feature.
|
||||
*
|
||||
* @generated from protobuf rpc: QueryMissionControl(routerrpc.QueryMissionControlRequest) returns (routerrpc.QueryMissionControlResponse);
|
||||
*/
|
||||
queryMissionControl(input: QueryMissionControlRequest, options?: RpcOptions): UnaryCall<QueryMissionControlRequest, QueryMissionControlResponse>;
|
||||
/**
|
||||
*
|
||||
* XImportMissionControl is an experimental API that imports the state provided
|
||||
* to the internal mission control's state, using all results which are more
|
||||
* recent than our existing values. These values will only be imported
|
||||
* in-memory, and will not be persisted across restarts.
|
||||
*
|
||||
* @generated from protobuf rpc: XImportMissionControl(routerrpc.XImportMissionControlRequest) returns (routerrpc.XImportMissionControlResponse);
|
||||
*/
|
||||
xImportMissionControl(input: XImportMissionControlRequest, options?: RpcOptions): UnaryCall<XImportMissionControlRequest, XImportMissionControlResponse>;
|
||||
/**
|
||||
*
|
||||
* GetMissionControlConfig returns mission control's current config.
|
||||
*
|
||||
* @generated from protobuf rpc: GetMissionControlConfig(routerrpc.GetMissionControlConfigRequest) returns (routerrpc.GetMissionControlConfigResponse);
|
||||
*/
|
||||
getMissionControlConfig(input: GetMissionControlConfigRequest, options?: RpcOptions): UnaryCall<GetMissionControlConfigRequest, GetMissionControlConfigResponse>;
|
||||
/**
|
||||
*
|
||||
* SetMissionControlConfig will set mission control's config, if the config
|
||||
* provided is valid.
|
||||
*
|
||||
* @generated from protobuf rpc: SetMissionControlConfig(routerrpc.SetMissionControlConfigRequest) returns (routerrpc.SetMissionControlConfigResponse);
|
||||
*/
|
||||
setMissionControlConfig(input: SetMissionControlConfigRequest, options?: RpcOptions): UnaryCall<SetMissionControlConfigRequest, SetMissionControlConfigResponse>;
|
||||
/**
|
||||
*
|
||||
* QueryProbability returns the current success probability estimate for a
|
||||
* given node pair and amount.
|
||||
*
|
||||
* @generated from protobuf rpc: QueryProbability(routerrpc.QueryProbabilityRequest) returns (routerrpc.QueryProbabilityResponse);
|
||||
*/
|
||||
queryProbability(input: QueryProbabilityRequest, options?: RpcOptions): UnaryCall<QueryProbabilityRequest, QueryProbabilityResponse>;
|
||||
/**
|
||||
*
|
||||
* BuildRoute builds a fully specified route based on a list of hop public
|
||||
* keys. It retrieves the relevant channel policies from the graph in order to
|
||||
* calculate the correct fees and time locks.
|
||||
*
|
||||
* @generated from protobuf rpc: BuildRoute(routerrpc.BuildRouteRequest) returns (routerrpc.BuildRouteResponse);
|
||||
*/
|
||||
buildRoute(input: BuildRouteRequest, options?: RpcOptions): UnaryCall<BuildRouteRequest, BuildRouteResponse>;
|
||||
/**
|
||||
*
|
||||
* SubscribeHtlcEvents creates a uni-directional stream from the server to
|
||||
* the client which delivers a stream of htlc events.
|
||||
*
|
||||
* @generated from protobuf rpc: SubscribeHtlcEvents(routerrpc.SubscribeHtlcEventsRequest) returns (stream routerrpc.HtlcEvent);
|
||||
*/
|
||||
subscribeHtlcEvents(input: SubscribeHtlcEventsRequest, options?: RpcOptions): ServerStreamingCall<SubscribeHtlcEventsRequest, HtlcEvent>;
|
||||
/**
|
||||
*
|
||||
* Deprecated, use SendPaymentV2. SendPayment attempts to route a payment
|
||||
* described by the passed PaymentRequest to the final destination. The call
|
||||
* returns a stream of payment status updates.
|
||||
*
|
||||
* @deprecated
|
||||
* @generated from protobuf rpc: SendPayment(routerrpc.SendPaymentRequest) returns (stream routerrpc.PaymentStatus);
|
||||
*/
|
||||
sendPayment(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall<SendPaymentRequest, PaymentStatus>;
|
||||
/**
|
||||
*
|
||||
* Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for
|
||||
* the payment identified by the payment hash.
|
||||
*
|
||||
* @deprecated
|
||||
* @generated from protobuf rpc: TrackPayment(routerrpc.TrackPaymentRequest) returns (stream routerrpc.PaymentStatus);
|
||||
*/
|
||||
trackPayment(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentRequest, PaymentStatus>;
|
||||
/**
|
||||
* *
|
||||
* HtlcInterceptor dispatches a bi-directional streaming RPC in which
|
||||
* Forwarded HTLC requests are sent to the client and the client responds with
|
||||
* a boolean that tells LND if this htlc should be intercepted.
|
||||
* In case of interception, the htlc can be either settled, cancelled or
|
||||
* resumed later by using the ResolveHoldForward endpoint.
|
||||
*
|
||||
* @generated from protobuf rpc: HtlcInterceptor(stream routerrpc.ForwardHtlcInterceptResponse) returns (stream routerrpc.ForwardHtlcInterceptRequest);
|
||||
*/
|
||||
htlcInterceptor(options?: RpcOptions): DuplexStreamingCall<ForwardHtlcInterceptResponse, ForwardHtlcInterceptRequest>;
|
||||
/**
|
||||
*
|
||||
* UpdateChanStatus attempts to manually set the state of a channel
|
||||
* (enabled, disabled, or auto). A manual "disable" request will cause the
|
||||
* channel to stay disabled until a subsequent manual request of either
|
||||
* "enable" or "auto".
|
||||
*
|
||||
* @generated from protobuf rpc: UpdateChanStatus(routerrpc.UpdateChanStatusRequest) returns (routerrpc.UpdateChanStatusResponse);
|
||||
*/
|
||||
updateChanStatus(input: UpdateChanStatusRequest, options?: RpcOptions): UnaryCall<UpdateChanStatusRequest, UpdateChanStatusResponse>;
|
||||
}
|
||||
/**
|
||||
* Router is a service that offers advanced interaction with the router
|
||||
* subsystem of the daemon.
|
||||
*
|
||||
* @generated from protobuf service routerrpc.Router
|
||||
*/
|
||||
export class RouterClient implements IRouterClient, ServiceInfo {
|
||||
typeName = Router.typeName;
|
||||
methods = Router.methods;
|
||||
options = Router.options;
|
||||
constructor(private readonly _transport: RpcTransport) {
|
||||
}
|
||||
/**
|
||||
*
|
||||
* SendPaymentV2 attempts to route a payment described by the passed
|
||||
* PaymentRequest to the final destination. The call returns a stream of
|
||||
* payment updates.
|
||||
*
|
||||
* @generated from protobuf rpc: SendPaymentV2(routerrpc.SendPaymentRequest) returns (stream lnrpc.Payment);
|
||||
*/
|
||||
sendPaymentV2(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall<SendPaymentRequest, Payment> {
|
||||
const method = this.methods[0], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<SendPaymentRequest, Payment>("serverStreaming", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* TrackPaymentV2 returns an update stream for the payment identified by the
|
||||
* payment hash.
|
||||
*
|
||||
* @generated from protobuf rpc: TrackPaymentV2(routerrpc.TrackPaymentRequest) returns (stream lnrpc.Payment);
|
||||
*/
|
||||
trackPaymentV2(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentRequest, Payment> {
|
||||
const method = this.methods[1], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<TrackPaymentRequest, Payment>("serverStreaming", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* TrackPayments returns an update stream for every payment that is not in a
|
||||
* terminal state. Note that if payments are in-flight while starting a new
|
||||
* subscription, the start of the payment stream could produce out-of-order
|
||||
* and/or duplicate events. In order to get updates for every in-flight
|
||||
* payment attempt make sure to subscribe to this method before initiating any
|
||||
* payments.
|
||||
*
|
||||
* @generated from protobuf rpc: TrackPayments(routerrpc.TrackPaymentsRequest) returns (stream lnrpc.Payment);
|
||||
*/
|
||||
trackPayments(input: TrackPaymentsRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentsRequest, Payment> {
|
||||
const method = this.methods[2], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<TrackPaymentsRequest, Payment>("serverStreaming", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it
|
||||
* may cost to send an HTLC to the target end destination.
|
||||
*
|
||||
* @generated from protobuf rpc: EstimateRouteFee(routerrpc.RouteFeeRequest) returns (routerrpc.RouteFeeResponse);
|
||||
*/
|
||||
estimateRouteFee(input: RouteFeeRequest, options?: RpcOptions): UnaryCall<RouteFeeRequest, RouteFeeResponse> {
|
||||
const method = this.methods[3], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<RouteFeeRequest, RouteFeeResponse>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via
|
||||
* the specified route. This method differs from SendPayment in that it
|
||||
* allows users to specify a full route manually. This can be used for
|
||||
* things like rebalancing, and atomic swaps. It differs from the newer
|
||||
* SendToRouteV2 in that it doesn't return the full HTLC information.
|
||||
*
|
||||
* @deprecated
|
||||
* @generated from protobuf rpc: SendToRoute(routerrpc.SendToRouteRequest) returns (routerrpc.SendToRouteResponse);
|
||||
*/
|
||||
sendToRoute(input: SendToRouteRequest, options?: RpcOptions): UnaryCall<SendToRouteRequest, SendToRouteResponse> {
|
||||
const method = this.methods[4], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<SendToRouteRequest, SendToRouteResponse>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* SendToRouteV2 attempts to make a payment via the specified route. This
|
||||
* method differs from SendPayment in that it allows users to specify a full
|
||||
* route manually. This can be used for things like rebalancing, and atomic
|
||||
* swaps.
|
||||
*
|
||||
* @generated from protobuf rpc: SendToRouteV2(routerrpc.SendToRouteRequest) returns (lnrpc.HTLCAttempt);
|
||||
*/
|
||||
sendToRouteV2(input: SendToRouteRequest, options?: RpcOptions): UnaryCall<SendToRouteRequest, HTLCAttempt> {
|
||||
const method = this.methods[5], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<SendToRouteRequest, HTLCAttempt>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* ResetMissionControl clears all mission control state and starts with a clean
|
||||
* slate.
|
||||
*
|
||||
* @generated from protobuf rpc: ResetMissionControl(routerrpc.ResetMissionControlRequest) returns (routerrpc.ResetMissionControlResponse);
|
||||
*/
|
||||
resetMissionControl(input: ResetMissionControlRequest, options?: RpcOptions): UnaryCall<ResetMissionControlRequest, ResetMissionControlResponse> {
|
||||
const method = this.methods[6], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<ResetMissionControlRequest, ResetMissionControlResponse>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* QueryMissionControl exposes the internal mission control state to callers.
|
||||
* It is a development feature.
|
||||
*
|
||||
* @generated from protobuf rpc: QueryMissionControl(routerrpc.QueryMissionControlRequest) returns (routerrpc.QueryMissionControlResponse);
|
||||
*/
|
||||
queryMissionControl(input: QueryMissionControlRequest, options?: RpcOptions): UnaryCall<QueryMissionControlRequest, QueryMissionControlResponse> {
|
||||
const method = this.methods[7], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<QueryMissionControlRequest, QueryMissionControlResponse>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* XImportMissionControl is an experimental API that imports the state provided
|
||||
* to the internal mission control's state, using all results which are more
|
||||
* recent than our existing values. These values will only be imported
|
||||
* in-memory, and will not be persisted across restarts.
|
||||
*
|
||||
* @generated from protobuf rpc: XImportMissionControl(routerrpc.XImportMissionControlRequest) returns (routerrpc.XImportMissionControlResponse);
|
||||
*/
|
||||
xImportMissionControl(input: XImportMissionControlRequest, options?: RpcOptions): UnaryCall<XImportMissionControlRequest, XImportMissionControlResponse> {
|
||||
const method = this.methods[8], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<XImportMissionControlRequest, XImportMissionControlResponse>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* GetMissionControlConfig returns mission control's current config.
|
||||
*
|
||||
* @generated from protobuf rpc: GetMissionControlConfig(routerrpc.GetMissionControlConfigRequest) returns (routerrpc.GetMissionControlConfigResponse);
|
||||
*/
|
||||
getMissionControlConfig(input: GetMissionControlConfigRequest, options?: RpcOptions): UnaryCall<GetMissionControlConfigRequest, GetMissionControlConfigResponse> {
|
||||
const method = this.methods[9], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<GetMissionControlConfigRequest, GetMissionControlConfigResponse>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* SetMissionControlConfig will set mission control's config, if the config
|
||||
* provided is valid.
|
||||
*
|
||||
* @generated from protobuf rpc: SetMissionControlConfig(routerrpc.SetMissionControlConfigRequest) returns (routerrpc.SetMissionControlConfigResponse);
|
||||
*/
|
||||
setMissionControlConfig(input: SetMissionControlConfigRequest, options?: RpcOptions): UnaryCall<SetMissionControlConfigRequest, SetMissionControlConfigResponse> {
|
||||
const method = this.methods[10], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<SetMissionControlConfigRequest, SetMissionControlConfigResponse>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* QueryProbability returns the current success probability estimate for a
|
||||
* given node pair and amount.
|
||||
*
|
||||
* @generated from protobuf rpc: QueryProbability(routerrpc.QueryProbabilityRequest) returns (routerrpc.QueryProbabilityResponse);
|
||||
*/
|
||||
queryProbability(input: QueryProbabilityRequest, options?: RpcOptions): UnaryCall<QueryProbabilityRequest, QueryProbabilityResponse> {
|
||||
const method = this.methods[11], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<QueryProbabilityRequest, QueryProbabilityResponse>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* BuildRoute builds a fully specified route based on a list of hop public
|
||||
* keys. It retrieves the relevant channel policies from the graph in order to
|
||||
* calculate the correct fees and time locks.
|
||||
*
|
||||
* @generated from protobuf rpc: BuildRoute(routerrpc.BuildRouteRequest) returns (routerrpc.BuildRouteResponse);
|
||||
*/
|
||||
buildRoute(input: BuildRouteRequest, options?: RpcOptions): UnaryCall<BuildRouteRequest, BuildRouteResponse> {
|
||||
const method = this.methods[12], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<BuildRouteRequest, BuildRouteResponse>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* SubscribeHtlcEvents creates a uni-directional stream from the server to
|
||||
* the client which delivers a stream of htlc events.
|
||||
*
|
||||
* @generated from protobuf rpc: SubscribeHtlcEvents(routerrpc.SubscribeHtlcEventsRequest) returns (stream routerrpc.HtlcEvent);
|
||||
*/
|
||||
subscribeHtlcEvents(input: SubscribeHtlcEventsRequest, options?: RpcOptions): ServerStreamingCall<SubscribeHtlcEventsRequest, HtlcEvent> {
|
||||
const method = this.methods[13], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<SubscribeHtlcEventsRequest, HtlcEvent>("serverStreaming", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* Deprecated, use SendPaymentV2. SendPayment attempts to route a payment
|
||||
* described by the passed PaymentRequest to the final destination. The call
|
||||
* returns a stream of payment status updates.
|
||||
*
|
||||
* @deprecated
|
||||
* @generated from protobuf rpc: SendPayment(routerrpc.SendPaymentRequest) returns (stream routerrpc.PaymentStatus);
|
||||
*/
|
||||
sendPayment(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall<SendPaymentRequest, PaymentStatus> {
|
||||
const method = this.methods[14], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<SendPaymentRequest, PaymentStatus>("serverStreaming", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for
|
||||
* the payment identified by the payment hash.
|
||||
*
|
||||
* @deprecated
|
||||
* @generated from protobuf rpc: TrackPayment(routerrpc.TrackPaymentRequest) returns (stream routerrpc.PaymentStatus);
|
||||
*/
|
||||
trackPayment(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentRequest, PaymentStatus> {
|
||||
const method = this.methods[15], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<TrackPaymentRequest, PaymentStatus>("serverStreaming", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
* *
|
||||
* HtlcInterceptor dispatches a bi-directional streaming RPC in which
|
||||
* Forwarded HTLC requests are sent to the client and the client responds with
|
||||
* a boolean that tells LND if this htlc should be intercepted.
|
||||
* In case of interception, the htlc can be either settled, cancelled or
|
||||
* resumed later by using the ResolveHoldForward endpoint.
|
||||
*
|
||||
* @generated from protobuf rpc: HtlcInterceptor(stream routerrpc.ForwardHtlcInterceptResponse) returns (stream routerrpc.ForwardHtlcInterceptRequest);
|
||||
*/
|
||||
htlcInterceptor(options?: RpcOptions): DuplexStreamingCall<ForwardHtlcInterceptResponse, ForwardHtlcInterceptRequest> {
|
||||
const method = this.methods[16], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<ForwardHtlcInterceptResponse, ForwardHtlcInterceptRequest>("duplex", this._transport, method, opt);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* UpdateChanStatus attempts to manually set the state of a channel
|
||||
* (enabled, disabled, or auto). A manual "disable" request will cause the
|
||||
* channel to stay disabled until a subsequent manual request of either
|
||||
* "enable" or "auto".
|
||||
*
|
||||
* @generated from protobuf rpc: UpdateChanStatus(routerrpc.UpdateChanStatusRequest) returns (routerrpc.UpdateChanStatusResponse);
|
||||
*/
|
||||
updateChanStatus(input: UpdateChanStatusRequest, options?: RpcOptions): UnaryCall<UpdateChanStatusRequest, UpdateChanStatusResponse> {
|
||||
const method = this.methods[17], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<UpdateChanStatusRequest, UpdateChanStatusResponse>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
}
|
||||
// @generated by protobuf-ts 2.8.1
|
||||
// @generated from protobuf file "router.proto" (package "routerrpc", syntax proto3)
|
||||
// tslint:disable
|
||||
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
|
||||
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
|
||||
import { Router } from "./router.js";
|
||||
import type { UpdateChanStatusResponse } from "./router.js";
|
||||
import type { UpdateChanStatusRequest } from "./router.js";
|
||||
import type { ForwardHtlcInterceptRequest } from "./router.js";
|
||||
import type { ForwardHtlcInterceptResponse } from "./router.js";
|
||||
import type { DuplexStreamingCall } from "@protobuf-ts/runtime-rpc";
|
||||
import type { PaymentStatus } from "./router.js";
|
||||
import type { HtlcEvent } from "./router.js";
|
||||
import type { SubscribeHtlcEventsRequest } from "./router.js";
|
||||
import type { BuildRouteResponse } from "./router.js";
|
||||
import type { BuildRouteRequest } from "./router.js";
|
||||
import type { QueryProbabilityResponse } from "./router.js";
|
||||
import type { QueryProbabilityRequest } from "./router.js";
|
||||
import type { SetMissionControlConfigResponse } from "./router.js";
|
||||
import type { SetMissionControlConfigRequest } from "./router.js";
|
||||
import type { GetMissionControlConfigResponse } from "./router.js";
|
||||
import type { GetMissionControlConfigRequest } from "./router.js";
|
||||
import type { XImportMissionControlResponse } from "./router.js";
|
||||
import type { XImportMissionControlRequest } from "./router.js";
|
||||
import type { QueryMissionControlResponse } from "./router.js";
|
||||
import type { QueryMissionControlRequest } from "./router.js";
|
||||
import type { ResetMissionControlResponse } from "./router.js";
|
||||
import type { ResetMissionControlRequest } from "./router.js";
|
||||
import type { HTLCAttempt } from "./lightning.js";
|
||||
import type { SendToRouteResponse } from "./router.js";
|
||||
import type { SendToRouteRequest } from "./router.js";
|
||||
import type { RouteFeeResponse } from "./router.js";
|
||||
import type { RouteFeeRequest } from "./router.js";
|
||||
import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
|
||||
import type { TrackPaymentsRequest } from "./router.js";
|
||||
import type { TrackPaymentRequest } from "./router.js";
|
||||
import { stackIntercept } from "@protobuf-ts/runtime-rpc";
|
||||
import type { Payment } from "./lightning.js";
|
||||
import type { SendPaymentRequest } from "./router.js";
|
||||
import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
|
||||
import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
|
||||
/**
|
||||
* Router is a service that offers advanced interaction with the router
|
||||
* subsystem of the daemon.
|
||||
*
|
||||
* @generated from protobuf service routerrpc.Router
|
||||
*/
|
||||
export interface IRouterClient {
|
||||
/**
|
||||
*
|
||||
* SendPaymentV2 attempts to route a payment described by the passed
|
||||
* PaymentRequest to the final destination. The call returns a stream of
|
||||
* payment updates.
|
||||
*
|
||||
* @generated from protobuf rpc: SendPaymentV2(routerrpc.SendPaymentRequest) returns (stream lnrpc.Payment);
|
||||
*/
|
||||
sendPaymentV2(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall<SendPaymentRequest, Payment>;
|
||||
/**
|
||||
*
|
||||
* TrackPaymentV2 returns an update stream for the payment identified by the
|
||||
* payment hash.
|
||||
*
|
||||
* @generated from protobuf rpc: TrackPaymentV2(routerrpc.TrackPaymentRequest) returns (stream lnrpc.Payment);
|
||||
*/
|
||||
trackPaymentV2(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentRequest, Payment>;
|
||||
/**
|
||||
*
|
||||
* TrackPayments returns an update stream for every payment that is not in a
|
||||
* terminal state. Note that if payments are in-flight while starting a new
|
||||
* subscription, the start of the payment stream could produce out-of-order
|
||||
* and/or duplicate events. In order to get updates for every in-flight
|
||||
* payment attempt make sure to subscribe to this method before initiating any
|
||||
* payments.
|
||||
*
|
||||
* @generated from protobuf rpc: TrackPayments(routerrpc.TrackPaymentsRequest) returns (stream lnrpc.Payment);
|
||||
*/
|
||||
trackPayments(input: TrackPaymentsRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentsRequest, Payment>;
|
||||
/**
|
||||
*
|
||||
* EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it
|
||||
* may cost to send an HTLC to the target end destination.
|
||||
*
|
||||
* @generated from protobuf rpc: EstimateRouteFee(routerrpc.RouteFeeRequest) returns (routerrpc.RouteFeeResponse);
|
||||
*/
|
||||
estimateRouteFee(input: RouteFeeRequest, options?: RpcOptions): UnaryCall<RouteFeeRequest, RouteFeeResponse>;
|
||||
/**
|
||||
*
|
||||
* Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via
|
||||
* the specified route. This method differs from SendPayment in that it
|
||||
* allows users to specify a full route manually. This can be used for
|
||||
* things like rebalancing, and atomic swaps. It differs from the newer
|
||||
* SendToRouteV2 in that it doesn't return the full HTLC information.
|
||||
*
|
||||
* @deprecated
|
||||
* @generated from protobuf rpc: SendToRoute(routerrpc.SendToRouteRequest) returns (routerrpc.SendToRouteResponse);
|
||||
*/
|
||||
sendToRoute(input: SendToRouteRequest, options?: RpcOptions): UnaryCall<SendToRouteRequest, SendToRouteResponse>;
|
||||
/**
|
||||
*
|
||||
* SendToRouteV2 attempts to make a payment via the specified route. This
|
||||
* method differs from SendPayment in that it allows users to specify a full
|
||||
* route manually. This can be used for things like rebalancing, and atomic
|
||||
* swaps.
|
||||
*
|
||||
* @generated from protobuf rpc: SendToRouteV2(routerrpc.SendToRouteRequest) returns (lnrpc.HTLCAttempt);
|
||||
*/
|
||||
sendToRouteV2(input: SendToRouteRequest, options?: RpcOptions): UnaryCall<SendToRouteRequest, HTLCAttempt>;
|
||||
/**
|
||||
*
|
||||
* ResetMissionControl clears all mission control state and starts with a clean
|
||||
* slate.
|
||||
*
|
||||
* @generated from protobuf rpc: ResetMissionControl(routerrpc.ResetMissionControlRequest) returns (routerrpc.ResetMissionControlResponse);
|
||||
*/
|
||||
resetMissionControl(input: ResetMissionControlRequest, options?: RpcOptions): UnaryCall<ResetMissionControlRequest, ResetMissionControlResponse>;
|
||||
/**
|
||||
*
|
||||
* QueryMissionControl exposes the internal mission control state to callers.
|
||||
* It is a development feature.
|
||||
*
|
||||
* @generated from protobuf rpc: QueryMissionControl(routerrpc.QueryMissionControlRequest) returns (routerrpc.QueryMissionControlResponse);
|
||||
*/
|
||||
queryMissionControl(input: QueryMissionControlRequest, options?: RpcOptions): UnaryCall<QueryMissionControlRequest, QueryMissionControlResponse>;
|
||||
/**
|
||||
*
|
||||
* XImportMissionControl is an experimental API that imports the state provided
|
||||
* to the internal mission control's state, using all results which are more
|
||||
* recent than our existing values. These values will only be imported
|
||||
* in-memory, and will not be persisted across restarts.
|
||||
*
|
||||
* @generated from protobuf rpc: XImportMissionControl(routerrpc.XImportMissionControlRequest) returns (routerrpc.XImportMissionControlResponse);
|
||||
*/
|
||||
xImportMissionControl(input: XImportMissionControlRequest, options?: RpcOptions): UnaryCall<XImportMissionControlRequest, XImportMissionControlResponse>;
|
||||
/**
|
||||
*
|
||||
* GetMissionControlConfig returns mission control's current config.
|
||||
*
|
||||
* @generated from protobuf rpc: GetMissionControlConfig(routerrpc.GetMissionControlConfigRequest) returns (routerrpc.GetMissionControlConfigResponse);
|
||||
*/
|
||||
getMissionControlConfig(input: GetMissionControlConfigRequest, options?: RpcOptions): UnaryCall<GetMissionControlConfigRequest, GetMissionControlConfigResponse>;
|
||||
/**
|
||||
*
|
||||
* SetMissionControlConfig will set mission control's config, if the config
|
||||
* provided is valid.
|
||||
*
|
||||
* @generated from protobuf rpc: SetMissionControlConfig(routerrpc.SetMissionControlConfigRequest) returns (routerrpc.SetMissionControlConfigResponse);
|
||||
*/
|
||||
setMissionControlConfig(input: SetMissionControlConfigRequest, options?: RpcOptions): UnaryCall<SetMissionControlConfigRequest, SetMissionControlConfigResponse>;
|
||||
/**
|
||||
*
|
||||
* QueryProbability returns the current success probability estimate for a
|
||||
* given node pair and amount.
|
||||
*
|
||||
* @generated from protobuf rpc: QueryProbability(routerrpc.QueryProbabilityRequest) returns (routerrpc.QueryProbabilityResponse);
|
||||
*/
|
||||
queryProbability(input: QueryProbabilityRequest, options?: RpcOptions): UnaryCall<QueryProbabilityRequest, QueryProbabilityResponse>;
|
||||
/**
|
||||
*
|
||||
* BuildRoute builds a fully specified route based on a list of hop public
|
||||
* keys. It retrieves the relevant channel policies from the graph in order to
|
||||
* calculate the correct fees and time locks.
|
||||
*
|
||||
* @generated from protobuf rpc: BuildRoute(routerrpc.BuildRouteRequest) returns (routerrpc.BuildRouteResponse);
|
||||
*/
|
||||
buildRoute(input: BuildRouteRequest, options?: RpcOptions): UnaryCall<BuildRouteRequest, BuildRouteResponse>;
|
||||
/**
|
||||
*
|
||||
* SubscribeHtlcEvents creates a uni-directional stream from the server to
|
||||
* the client which delivers a stream of htlc events.
|
||||
*
|
||||
* @generated from protobuf rpc: SubscribeHtlcEvents(routerrpc.SubscribeHtlcEventsRequest) returns (stream routerrpc.HtlcEvent);
|
||||
*/
|
||||
subscribeHtlcEvents(input: SubscribeHtlcEventsRequest, options?: RpcOptions): ServerStreamingCall<SubscribeHtlcEventsRequest, HtlcEvent>;
|
||||
/**
|
||||
*
|
||||
* Deprecated, use SendPaymentV2. SendPayment attempts to route a payment
|
||||
* described by the passed PaymentRequest to the final destination. The call
|
||||
* returns a stream of payment status updates.
|
||||
*
|
||||
* @deprecated
|
||||
* @generated from protobuf rpc: SendPayment(routerrpc.SendPaymentRequest) returns (stream routerrpc.PaymentStatus);
|
||||
*/
|
||||
sendPayment(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall<SendPaymentRequest, PaymentStatus>;
|
||||
/**
|
||||
*
|
||||
* Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for
|
||||
* the payment identified by the payment hash.
|
||||
*
|
||||
* @deprecated
|
||||
* @generated from protobuf rpc: TrackPayment(routerrpc.TrackPaymentRequest) returns (stream routerrpc.PaymentStatus);
|
||||
*/
|
||||
trackPayment(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentRequest, PaymentStatus>;
|
||||
/**
|
||||
* *
|
||||
* HtlcInterceptor dispatches a bi-directional streaming RPC in which
|
||||
* Forwarded HTLC requests are sent to the client and the client responds with
|
||||
* a boolean that tells LND if this htlc should be intercepted.
|
||||
* In case of interception, the htlc can be either settled, cancelled or
|
||||
* resumed later by using the ResolveHoldForward endpoint.
|
||||
*
|
||||
* @generated from protobuf rpc: HtlcInterceptor(stream routerrpc.ForwardHtlcInterceptResponse) returns (stream routerrpc.ForwardHtlcInterceptRequest);
|
||||
*/
|
||||
htlcInterceptor(options?: RpcOptions): DuplexStreamingCall<ForwardHtlcInterceptResponse, ForwardHtlcInterceptRequest>;
|
||||
/**
|
||||
*
|
||||
* UpdateChanStatus attempts to manually set the state of a channel
|
||||
* (enabled, disabled, or auto). A manual "disable" request will cause the
|
||||
* channel to stay disabled until a subsequent manual request of either
|
||||
* "enable" or "auto".
|
||||
*
|
||||
* @generated from protobuf rpc: UpdateChanStatus(routerrpc.UpdateChanStatusRequest) returns (routerrpc.UpdateChanStatusResponse);
|
||||
*/
|
||||
updateChanStatus(input: UpdateChanStatusRequest, options?: RpcOptions): UnaryCall<UpdateChanStatusRequest, UpdateChanStatusResponse>;
|
||||
}
|
||||
/**
|
||||
* Router is a service that offers advanced interaction with the router
|
||||
* subsystem of the daemon.
|
||||
*
|
||||
* @generated from protobuf service routerrpc.Router
|
||||
*/
|
||||
export class RouterClient implements IRouterClient, ServiceInfo {
|
||||
typeName = Router.typeName;
|
||||
methods = Router.methods;
|
||||
options = Router.options;
|
||||
constructor(private readonly _transport: RpcTransport) {
|
||||
}
|
||||
/**
|
||||
*
|
||||
* SendPaymentV2 attempts to route a payment described by the passed
|
||||
* PaymentRequest to the final destination. The call returns a stream of
|
||||
* payment updates.
|
||||
*
|
||||
* @generated from protobuf rpc: SendPaymentV2(routerrpc.SendPaymentRequest) returns (stream lnrpc.Payment);
|
||||
*/
|
||||
sendPaymentV2(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall<SendPaymentRequest, Payment> {
|
||||
const method = this.methods[0], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<SendPaymentRequest, Payment>("serverStreaming", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* TrackPaymentV2 returns an update stream for the payment identified by the
|
||||
* payment hash.
|
||||
*
|
||||
* @generated from protobuf rpc: TrackPaymentV2(routerrpc.TrackPaymentRequest) returns (stream lnrpc.Payment);
|
||||
*/
|
||||
trackPaymentV2(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentRequest, Payment> {
|
||||
const method = this.methods[1], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<TrackPaymentRequest, Payment>("serverStreaming", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* TrackPayments returns an update stream for every payment that is not in a
|
||||
* terminal state. Note that if payments are in-flight while starting a new
|
||||
* subscription, the start of the payment stream could produce out-of-order
|
||||
* and/or duplicate events. In order to get updates for every in-flight
|
||||
* payment attempt make sure to subscribe to this method before initiating any
|
||||
* payments.
|
||||
*
|
||||
* @generated from protobuf rpc: TrackPayments(routerrpc.TrackPaymentsRequest) returns (stream lnrpc.Payment);
|
||||
*/
|
||||
trackPayments(input: TrackPaymentsRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentsRequest, Payment> {
|
||||
const method = this.methods[2], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<TrackPaymentsRequest, Payment>("serverStreaming", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it
|
||||
* may cost to send an HTLC to the target end destination.
|
||||
*
|
||||
* @generated from protobuf rpc: EstimateRouteFee(routerrpc.RouteFeeRequest) returns (routerrpc.RouteFeeResponse);
|
||||
*/
|
||||
estimateRouteFee(input: RouteFeeRequest, options?: RpcOptions): UnaryCall<RouteFeeRequest, RouteFeeResponse> {
|
||||
const method = this.methods[3], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<RouteFeeRequest, RouteFeeResponse>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via
|
||||
* the specified route. This method differs from SendPayment in that it
|
||||
* allows users to specify a full route manually. This can be used for
|
||||
* things like rebalancing, and atomic swaps. It differs from the newer
|
||||
* SendToRouteV2 in that it doesn't return the full HTLC information.
|
||||
*
|
||||
* @deprecated
|
||||
* @generated from protobuf rpc: SendToRoute(routerrpc.SendToRouteRequest) returns (routerrpc.SendToRouteResponse);
|
||||
*/
|
||||
sendToRoute(input: SendToRouteRequest, options?: RpcOptions): UnaryCall<SendToRouteRequest, SendToRouteResponse> {
|
||||
const method = this.methods[4], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<SendToRouteRequest, SendToRouteResponse>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* SendToRouteV2 attempts to make a payment via the specified route. This
|
||||
* method differs from SendPayment in that it allows users to specify a full
|
||||
* route manually. This can be used for things like rebalancing, and atomic
|
||||
* swaps.
|
||||
*
|
||||
* @generated from protobuf rpc: SendToRouteV2(routerrpc.SendToRouteRequest) returns (lnrpc.HTLCAttempt);
|
||||
*/
|
||||
sendToRouteV2(input: SendToRouteRequest, options?: RpcOptions): UnaryCall<SendToRouteRequest, HTLCAttempt> {
|
||||
const method = this.methods[5], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<SendToRouteRequest, HTLCAttempt>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* ResetMissionControl clears all mission control state and starts with a clean
|
||||
* slate.
|
||||
*
|
||||
* @generated from protobuf rpc: ResetMissionControl(routerrpc.ResetMissionControlRequest) returns (routerrpc.ResetMissionControlResponse);
|
||||
*/
|
||||
resetMissionControl(input: ResetMissionControlRequest, options?: RpcOptions): UnaryCall<ResetMissionControlRequest, ResetMissionControlResponse> {
|
||||
const method = this.methods[6], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<ResetMissionControlRequest, ResetMissionControlResponse>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* QueryMissionControl exposes the internal mission control state to callers.
|
||||
* It is a development feature.
|
||||
*
|
||||
* @generated from protobuf rpc: QueryMissionControl(routerrpc.QueryMissionControlRequest) returns (routerrpc.QueryMissionControlResponse);
|
||||
*/
|
||||
queryMissionControl(input: QueryMissionControlRequest, options?: RpcOptions): UnaryCall<QueryMissionControlRequest, QueryMissionControlResponse> {
|
||||
const method = this.methods[7], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<QueryMissionControlRequest, QueryMissionControlResponse>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* XImportMissionControl is an experimental API that imports the state provided
|
||||
* to the internal mission control's state, using all results which are more
|
||||
* recent than our existing values. These values will only be imported
|
||||
* in-memory, and will not be persisted across restarts.
|
||||
*
|
||||
* @generated from protobuf rpc: XImportMissionControl(routerrpc.XImportMissionControlRequest) returns (routerrpc.XImportMissionControlResponse);
|
||||
*/
|
||||
xImportMissionControl(input: XImportMissionControlRequest, options?: RpcOptions): UnaryCall<XImportMissionControlRequest, XImportMissionControlResponse> {
|
||||
const method = this.methods[8], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<XImportMissionControlRequest, XImportMissionControlResponse>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* GetMissionControlConfig returns mission control's current config.
|
||||
*
|
||||
* @generated from protobuf rpc: GetMissionControlConfig(routerrpc.GetMissionControlConfigRequest) returns (routerrpc.GetMissionControlConfigResponse);
|
||||
*/
|
||||
getMissionControlConfig(input: GetMissionControlConfigRequest, options?: RpcOptions): UnaryCall<GetMissionControlConfigRequest, GetMissionControlConfigResponse> {
|
||||
const method = this.methods[9], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<GetMissionControlConfigRequest, GetMissionControlConfigResponse>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* SetMissionControlConfig will set mission control's config, if the config
|
||||
* provided is valid.
|
||||
*
|
||||
* @generated from protobuf rpc: SetMissionControlConfig(routerrpc.SetMissionControlConfigRequest) returns (routerrpc.SetMissionControlConfigResponse);
|
||||
*/
|
||||
setMissionControlConfig(input: SetMissionControlConfigRequest, options?: RpcOptions): UnaryCall<SetMissionControlConfigRequest, SetMissionControlConfigResponse> {
|
||||
const method = this.methods[10], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<SetMissionControlConfigRequest, SetMissionControlConfigResponse>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* QueryProbability returns the current success probability estimate for a
|
||||
* given node pair and amount.
|
||||
*
|
||||
* @generated from protobuf rpc: QueryProbability(routerrpc.QueryProbabilityRequest) returns (routerrpc.QueryProbabilityResponse);
|
||||
*/
|
||||
queryProbability(input: QueryProbabilityRequest, options?: RpcOptions): UnaryCall<QueryProbabilityRequest, QueryProbabilityResponse> {
|
||||
const method = this.methods[11], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<QueryProbabilityRequest, QueryProbabilityResponse>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* BuildRoute builds a fully specified route based on a list of hop public
|
||||
* keys. It retrieves the relevant channel policies from the graph in order to
|
||||
* calculate the correct fees and time locks.
|
||||
*
|
||||
* @generated from protobuf rpc: BuildRoute(routerrpc.BuildRouteRequest) returns (routerrpc.BuildRouteResponse);
|
||||
*/
|
||||
buildRoute(input: BuildRouteRequest, options?: RpcOptions): UnaryCall<BuildRouteRequest, BuildRouteResponse> {
|
||||
const method = this.methods[12], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<BuildRouteRequest, BuildRouteResponse>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* SubscribeHtlcEvents creates a uni-directional stream from the server to
|
||||
* the client which delivers a stream of htlc events.
|
||||
*
|
||||
* @generated from protobuf rpc: SubscribeHtlcEvents(routerrpc.SubscribeHtlcEventsRequest) returns (stream routerrpc.HtlcEvent);
|
||||
*/
|
||||
subscribeHtlcEvents(input: SubscribeHtlcEventsRequest, options?: RpcOptions): ServerStreamingCall<SubscribeHtlcEventsRequest, HtlcEvent> {
|
||||
const method = this.methods[13], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<SubscribeHtlcEventsRequest, HtlcEvent>("serverStreaming", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* Deprecated, use SendPaymentV2. SendPayment attempts to route a payment
|
||||
* described by the passed PaymentRequest to the final destination. The call
|
||||
* returns a stream of payment status updates.
|
||||
*
|
||||
* @deprecated
|
||||
* @generated from protobuf rpc: SendPayment(routerrpc.SendPaymentRequest) returns (stream routerrpc.PaymentStatus);
|
||||
*/
|
||||
sendPayment(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall<SendPaymentRequest, PaymentStatus> {
|
||||
const method = this.methods[14], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<SendPaymentRequest, PaymentStatus>("serverStreaming", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for
|
||||
* the payment identified by the payment hash.
|
||||
*
|
||||
* @deprecated
|
||||
* @generated from protobuf rpc: TrackPayment(routerrpc.TrackPaymentRequest) returns (stream routerrpc.PaymentStatus);
|
||||
*/
|
||||
trackPayment(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentRequest, PaymentStatus> {
|
||||
const method = this.methods[15], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<TrackPaymentRequest, PaymentStatus>("serverStreaming", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
* *
|
||||
* HtlcInterceptor dispatches a bi-directional streaming RPC in which
|
||||
* Forwarded HTLC requests are sent to the client and the client responds with
|
||||
* a boolean that tells LND if this htlc should be intercepted.
|
||||
* In case of interception, the htlc can be either settled, cancelled or
|
||||
* resumed later by using the ResolveHoldForward endpoint.
|
||||
*
|
||||
* @generated from protobuf rpc: HtlcInterceptor(stream routerrpc.ForwardHtlcInterceptResponse) returns (stream routerrpc.ForwardHtlcInterceptRequest);
|
||||
*/
|
||||
htlcInterceptor(options?: RpcOptions): DuplexStreamingCall<ForwardHtlcInterceptResponse, ForwardHtlcInterceptRequest> {
|
||||
const method = this.methods[16], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<ForwardHtlcInterceptResponse, ForwardHtlcInterceptRequest>("duplex", this._transport, method, opt);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* UpdateChanStatus attempts to manually set the state of a channel
|
||||
* (enabled, disabled, or auto). A manual "disable" request will cause the
|
||||
* channel to stay disabled until a subsequent manual request of either
|
||||
* "enable" or "auto".
|
||||
*
|
||||
* @generated from protobuf rpc: UpdateChanStatus(routerrpc.UpdateChanStatusRequest) returns (routerrpc.UpdateChanStatusResponse);
|
||||
*/
|
||||
updateChanStatus(input: UpdateChanStatusRequest, options?: RpcOptions): UnaryCall<UpdateChanStatusRequest, UpdateChanStatusResponse> {
|
||||
const method = this.methods[17], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<UpdateChanStatusRequest, UpdateChanStatusResponse>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
7088
proto/lnd/router.ts
7088
proto/lnd/router.ts
File diff suppressed because it is too large
Load diff
|
|
@ -101,8 +101,10 @@ service Lightning {
|
|||
rpc SignMessage (SignMessageRequest) returns (SignMessageResponse);
|
||||
|
||||
/* lncli: `verifymessage`
|
||||
VerifyMessage verifies a signature over a msg. The signature must be
|
||||
zbase32 encoded and signed by an active node in the resident node's
|
||||
VerifyMessage verifies a signature over a message and recovers the signer's
|
||||
public key. The signature is only deemed valid if the recovered public key
|
||||
corresponds to a node key in the public Lightning network. The signature
|
||||
must be zbase32 encoded and signed by an active node in the resident node's
|
||||
channel database. In addition to returning the validity of the signature,
|
||||
VerifyMessage also returns the recovered pubkey from the signature.
|
||||
*/
|
||||
|
|
@ -141,6 +143,13 @@ service Lightning {
|
|||
*/
|
||||
rpc GetInfo (GetInfoRequest) returns (GetInfoResponse);
|
||||
|
||||
/* lncli: 'getdebuginfo'
|
||||
GetDebugInfo returns debug information concerning the state of the daemon
|
||||
and its subsystems. This includes the full configuration and the latest log
|
||||
entries from the log file.
|
||||
*/
|
||||
rpc GetDebugInfo (GetDebugInfoRequest) returns (GetDebugInfoResponse);
|
||||
|
||||
/** lncli: `getrecoveryinfo`
|
||||
GetRecoveryInfo returns information concerning the recovery mode including
|
||||
whether it's in a recovery mode, whether the recovery is finished, and the
|
||||
|
|
@ -320,7 +329,7 @@ service Lightning {
|
|||
optionally specify the add_index and/or the settle_index. If the add_index
|
||||
is specified, then we'll first start by sending add invoice events for all
|
||||
invoices with an add_index greater than the specified value. If the
|
||||
settle_index is specified, the next, we'll send out all settle events for
|
||||
settle_index is specified, then next, we'll send out all settle events for
|
||||
invoices with a settle_index greater than the specified value. One or both
|
||||
of these fields can be set. If no fields are set, then we'll only send out
|
||||
the latest add/settle events.
|
||||
|
|
@ -339,13 +348,13 @@ service Lightning {
|
|||
*/
|
||||
rpc ListPayments (ListPaymentsRequest) returns (ListPaymentsResponse);
|
||||
|
||||
/*
|
||||
/* lncli: `deletepayments`
|
||||
DeletePayment deletes an outgoing payment from DB. Note that it will not
|
||||
attempt to delete an In-Flight payment, since that would be unsafe.
|
||||
*/
|
||||
rpc DeletePayment (DeletePaymentRequest) returns (DeletePaymentResponse);
|
||||
|
||||
/*
|
||||
/* lncli: `deletepayments --all`
|
||||
DeleteAllPayments deletes all outgoing payments from DB. Note that it will
|
||||
not attempt to delete In-Flight payments, since that would be unsafe.
|
||||
*/
|
||||
|
|
@ -477,7 +486,7 @@ service Lightning {
|
|||
rpc ExportAllChannelBackups (ChanBackupExportRequest)
|
||||
returns (ChanBackupSnapshot);
|
||||
|
||||
/*
|
||||
/* lncli: `verifychanbackup`
|
||||
VerifyChanBackup allows a caller to verify the integrity of a channel backup
|
||||
snapshot. This method will accept either a packed Single or a packed Multi.
|
||||
Specifying both will result in an error.
|
||||
|
|
@ -567,6 +576,10 @@ service Lightning {
|
|||
/* lncli: `subscribecustom`
|
||||
SubscribeCustomMessages subscribes to a stream of incoming custom peer
|
||||
messages.
|
||||
|
||||
To include messages with type outside of the custom range (>= 32768) lnd
|
||||
needs to be compiled with the `dev` build tag, and the message type to
|
||||
override should be specified in lnd's experimental protocol configuration.
|
||||
*/
|
||||
rpc SubscribeCustomMessages (SubscribeCustomMessagesRequest)
|
||||
returns (stream CustomMessage);
|
||||
|
|
@ -578,18 +591,26 @@ service Lightning {
|
|||
*/
|
||||
rpc ListAliases (ListAliasesRequest) returns (ListAliasesResponse);
|
||||
|
||||
rpc LookupHtlc (LookupHtlcRequest) returns (LookupHtlcResponse);
|
||||
/*
|
||||
LookupHtlcResolution retrieves a final htlc resolution from the database.
|
||||
If the htlc has no final resolution yet, a NotFound grpc status code is
|
||||
returned.
|
||||
*/
|
||||
rpc LookupHtlcResolution (LookupHtlcResolutionRequest)
|
||||
returns (LookupHtlcResolutionResponse);
|
||||
}
|
||||
|
||||
message LookupHtlcRequest {
|
||||
message LookupHtlcResolutionRequest {
|
||||
uint64 chan_id = 1;
|
||||
|
||||
uint64 htlc_index = 2;
|
||||
}
|
||||
|
||||
message LookupHtlcResponse {
|
||||
message LookupHtlcResolutionResponse {
|
||||
// Settled is true is the htlc was settled. If false, the htlc was failed.
|
||||
bool settled = 1;
|
||||
|
||||
// Offchain indicates whether the htlc was resolved off-chain or on-chain.
|
||||
bool offchain = 2;
|
||||
}
|
||||
|
||||
|
|
@ -612,6 +633,9 @@ message SendCustomMessageRequest {
|
|||
bytes peer = 1;
|
||||
|
||||
// Message type. This value needs to be in the custom range (>= 32768).
|
||||
// To send a type < custom range, lnd needs to be compiled with the `dev`
|
||||
// build tag, and the message type to override should be specified in lnd's
|
||||
// experimental protocol configuration.
|
||||
uint32 type = 2;
|
||||
|
||||
// Raw message data.
|
||||
|
|
@ -860,7 +884,8 @@ message SendRequest {
|
|||
repeated FeatureBit dest_features = 15;
|
||||
|
||||
/*
|
||||
The payment address of the generated invoice.
|
||||
The payment address of the generated invoice. This is also called
|
||||
payment secret in specifications (e.g. BOLT 11).
|
||||
*/
|
||||
bytes payment_addr = 16;
|
||||
}
|
||||
|
|
@ -1066,6 +1091,18 @@ message LightningAddress {
|
|||
string host = 2;
|
||||
}
|
||||
|
||||
enum CoinSelectionStrategy {
|
||||
// Use the coin selection strategy defined in the global configuration
|
||||
// (lnd.conf).
|
||||
STRATEGY_USE_GLOBAL_CONFIG = 0;
|
||||
|
||||
// Select the largest available coins first during coin selection.
|
||||
STRATEGY_LARGEST = 1;
|
||||
|
||||
// Randomly select the available coins during coin selection.
|
||||
STRATEGY_RANDOM = 2;
|
||||
}
|
||||
|
||||
message EstimateFeeRequest {
|
||||
// The map from addresses to amounts for the transaction.
|
||||
map<string, int64> AddrToAmount = 1;
|
||||
|
|
@ -1080,6 +1117,9 @@ message EstimateFeeRequest {
|
|||
|
||||
// Whether unconfirmed outputs should be used as inputs for the transaction.
|
||||
bool spend_unconfirmed = 4;
|
||||
|
||||
// The strategy to use for selecting coins during fees estimation.
|
||||
CoinSelectionStrategy coin_selection_strategy = 5;
|
||||
}
|
||||
|
||||
message EstimateFeeResponse {
|
||||
|
|
@ -1120,6 +1160,9 @@ message SendManyRequest {
|
|||
|
||||
// Whether unconfirmed outputs should be used as inputs for the transaction.
|
||||
bool spend_unconfirmed = 8;
|
||||
|
||||
// The strategy to use for selecting coins during sending many requests.
|
||||
CoinSelectionStrategy coin_selection_strategy = 9;
|
||||
}
|
||||
message SendManyResponse {
|
||||
// The id of the transaction
|
||||
|
|
@ -1147,9 +1190,8 @@ message SendCoinsRequest {
|
|||
int64 sat_per_byte = 5 [deprecated = true];
|
||||
|
||||
/*
|
||||
If set, then the amount field will be ignored, and lnd will attempt to
|
||||
send all the coins under control of the internal wallet to the specified
|
||||
address.
|
||||
If set, the amount field should be unset. It indicates lnd will send all
|
||||
wallet coins or all selected coins to the specified address.
|
||||
*/
|
||||
bool send_all = 6;
|
||||
|
||||
|
|
@ -1162,6 +1204,12 @@ message SendCoinsRequest {
|
|||
|
||||
// Whether unconfirmed outputs should be used as inputs for the transaction.
|
||||
bool spend_unconfirmed = 9;
|
||||
|
||||
// The strategy to use for selecting coins.
|
||||
CoinSelectionStrategy coin_selection_strategy = 10;
|
||||
|
||||
// A list of selected outpoints as inputs for the transaction.
|
||||
repeated OutPoint outpoints = 11;
|
||||
}
|
||||
message SendCoinsResponse {
|
||||
// The transaction ID of the transaction
|
||||
|
|
@ -1335,6 +1383,13 @@ enum CommitmentType {
|
|||
channel before its maturity date.
|
||||
*/
|
||||
SCRIPT_ENFORCED_LEASE = 4;
|
||||
|
||||
/*
|
||||
A channel that uses musig2 for the funding output, and the new tapscript
|
||||
features where relevant.
|
||||
*/
|
||||
// TODO(roasbeef): need script enforce mirror type for the above as well?
|
||||
SIMPLE_TAPROOT = 5;
|
||||
}
|
||||
|
||||
message ChannelConstraints {
|
||||
|
|
@ -1524,6 +1579,19 @@ message Channel {
|
|||
|
||||
// This is the confirmed / on-chain zero-conf SCID.
|
||||
uint64 zero_conf_confirmed_scid = 33;
|
||||
|
||||
// The configured alias name of our peer.
|
||||
string peer_alias = 34;
|
||||
|
||||
// This is the peer SCID alias.
|
||||
uint64 peer_scid_alias = 35 [jstype = JS_STRING];
|
||||
|
||||
/*
|
||||
An optional note-to-self to go along with the channel containing some
|
||||
useful information. This is only ever stored locally and in no way impacts
|
||||
the channel's operation.
|
||||
*/
|
||||
string memo = 36;
|
||||
}
|
||||
|
||||
message ListChannelsRequest {
|
||||
|
|
@ -1537,6 +1605,11 @@ message ListChannelsRequest {
|
|||
empty, all channels will be returned.
|
||||
*/
|
||||
bytes peer = 5;
|
||||
|
||||
// Informs the server if the peer alias lookup per channel should be
|
||||
// enabled. It is turned off by default in order to avoid degradation of
|
||||
// performance for existing clients.
|
||||
bool peer_alias_lookup = 6;
|
||||
}
|
||||
message ListChannelsResponse {
|
||||
// The list of active channels
|
||||
|
|
@ -1884,12 +1957,16 @@ message GetInfoResponse {
|
|||
/*
|
||||
Whether the current node is connected to testnet. This field is
|
||||
deprecated and the network field should be used instead
|
||||
**/
|
||||
*/
|
||||
bool testnet = 10 [deprecated = true];
|
||||
|
||||
reserved 11;
|
||||
|
||||
// A list of active chains the node is connected to
|
||||
/*
|
||||
A list of active chains the node is connected to. This will only
|
||||
ever contain a single entry since LND will only ever have a single
|
||||
chain backend during its lifetime.
|
||||
*/
|
||||
repeated Chain chains = 16;
|
||||
|
||||
// The URIs of the current node.
|
||||
|
|
@ -1905,6 +1982,17 @@ message GetInfoResponse {
|
|||
Indicates whether the HTLC interceptor API is in always-on mode.
|
||||
*/
|
||||
bool require_htlc_interceptor = 21;
|
||||
|
||||
// Indicates whether final htlc resolutions are stored on disk.
|
||||
bool store_final_htlc_resolutions = 22;
|
||||
}
|
||||
|
||||
message GetDebugInfoRequest {
|
||||
}
|
||||
|
||||
message GetDebugInfoResponse {
|
||||
map<string, string> config = 1;
|
||||
repeated string log = 2;
|
||||
}
|
||||
|
||||
message GetRecoveryInfoRequest {
|
||||
|
|
@ -1921,8 +2009,9 @@ message GetRecoveryInfoResponse {
|
|||
}
|
||||
|
||||
message Chain {
|
||||
// The blockchain the node is on (eg bitcoin, litecoin)
|
||||
string chain = 1;
|
||||
// Deprecated. The chain is now always assumed to be bitcoin.
|
||||
// The blockchain the node is on (must be bitcoin)
|
||||
string chain = 1 [deprecated = true];
|
||||
|
||||
// The network the node is on (eg regtest, testnet, mainnet)
|
||||
string network = 2;
|
||||
|
|
@ -1982,12 +2071,18 @@ message CloseChannelRequest {
|
|||
//
|
||||
// NOTE: This field is only respected if we're the initiator of the channel.
|
||||
uint64 max_fee_per_vbyte = 7;
|
||||
|
||||
// If true, then the rpc call will not block while it awaits a closing txid.
|
||||
// Consequently this RPC call will not return a closing txid if this value
|
||||
// is set.
|
||||
bool no_wait = 8;
|
||||
}
|
||||
|
||||
message CloseStatusUpdate {
|
||||
oneof update {
|
||||
PendingUpdate close_pending = 1;
|
||||
ChannelCloseUpdate chan_close = 3;
|
||||
InstantUpdate close_instant = 4;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1996,6 +2091,9 @@ message PendingUpdate {
|
|||
uint32 output_index = 2;
|
||||
}
|
||||
|
||||
message InstantUpdate {
|
||||
}
|
||||
|
||||
message ReadyForPsbtFunding {
|
||||
/*
|
||||
The P2WSH address of the channel funding multisig address that the below
|
||||
|
|
@ -2040,6 +2138,9 @@ message BatchOpenChannelRequest {
|
|||
|
||||
// An optional label for the batch transaction, limited to 500 characters.
|
||||
string label = 6;
|
||||
|
||||
// The strategy to use for selecting coins during batch opening channels.
|
||||
CoinSelectionStrategy coin_selection_strategy = 7;
|
||||
}
|
||||
|
||||
message BatchOpenChannel {
|
||||
|
|
@ -2090,6 +2191,76 @@ message BatchOpenChannel {
|
|||
the remote peer supports explicit channel negotiation.
|
||||
*/
|
||||
CommitmentType commitment_type = 9;
|
||||
|
||||
/*
|
||||
The maximum amount of coins in millisatoshi that can be pending within
|
||||
the channel. It only applies to the remote party.
|
||||
*/
|
||||
uint64 remote_max_value_in_flight_msat = 10;
|
||||
|
||||
/*
|
||||
The maximum number of concurrent HTLCs we will allow the remote party to add
|
||||
to the commitment transaction.
|
||||
*/
|
||||
uint32 remote_max_htlcs = 11;
|
||||
|
||||
/*
|
||||
Max local csv is the maximum csv delay we will allow for our own commitment
|
||||
transaction.
|
||||
*/
|
||||
uint32 max_local_csv = 12;
|
||||
|
||||
/*
|
||||
If this is true, then a zero-conf channel open will be attempted.
|
||||
*/
|
||||
bool zero_conf = 13;
|
||||
|
||||
/*
|
||||
If this is true, then an option-scid-alias channel-type open will be
|
||||
attempted.
|
||||
*/
|
||||
bool scid_alias = 14;
|
||||
|
||||
/*
|
||||
The base fee charged regardless of the number of milli-satoshis sent.
|
||||
*/
|
||||
uint64 base_fee = 15;
|
||||
|
||||
/*
|
||||
The fee rate in ppm (parts per million) that will be charged in
|
||||
proportion of the value of each forwarded HTLC.
|
||||
*/
|
||||
uint64 fee_rate = 16;
|
||||
|
||||
/*
|
||||
If use_base_fee is true the open channel announcement will update the
|
||||
channel base fee with the value specified in base_fee. In the case of
|
||||
a base_fee of 0 use_base_fee is needed downstream to distinguish whether
|
||||
to use the default base fee value specified in the config or 0.
|
||||
*/
|
||||
bool use_base_fee = 17;
|
||||
|
||||
/*
|
||||
If use_fee_rate is true the open channel announcement will update the
|
||||
channel fee rate with the value specified in fee_rate. In the case of
|
||||
a fee_rate of 0 use_fee_rate is needed downstream to distinguish whether
|
||||
to use the default fee rate value specified in the config or 0.
|
||||
*/
|
||||
bool use_fee_rate = 18;
|
||||
|
||||
/*
|
||||
The number of satoshis we require the remote peer to reserve. This value,
|
||||
if specified, must be above the dust limit and below 20% of the channel
|
||||
capacity.
|
||||
*/
|
||||
uint64 remote_chan_reserve_sat = 19;
|
||||
|
||||
/*
|
||||
An optional note-to-self to go along with the channel containing some
|
||||
useful information. This is only ever stored locally and in no way impacts
|
||||
the channel's operation.
|
||||
*/
|
||||
string memo = 20;
|
||||
}
|
||||
|
||||
message BatchOpenChannelResponse {
|
||||
|
|
@ -2238,6 +2409,25 @@ message OpenChannelRequest {
|
|||
capacity.
|
||||
*/
|
||||
uint64 remote_chan_reserve_sat = 25;
|
||||
|
||||
/*
|
||||
If set, then lnd will attempt to commit all the coins under control of the
|
||||
internal wallet to open the channel, and the LocalFundingAmount field must
|
||||
be zero and is ignored.
|
||||
*/
|
||||
bool fund_max = 26;
|
||||
|
||||
/*
|
||||
An optional note-to-self to go along with the channel containing some
|
||||
useful information. This is only ever stored locally and in no way impacts
|
||||
the channel's operation.
|
||||
*/
|
||||
string memo = 27;
|
||||
|
||||
/*
|
||||
A list of selected outpoints that are allocated for channel funding.
|
||||
*/
|
||||
repeated OutPoint outpoints = 28;
|
||||
}
|
||||
message OpenStatusUpdate {
|
||||
oneof update {
|
||||
|
|
@ -2319,6 +2509,11 @@ message ChanPointShim {
|
|||
the value is less than 500,000, or as an absolute height otherwise.
|
||||
*/
|
||||
uint32 thaw_height = 6;
|
||||
|
||||
/*
|
||||
Indicates that the funding output is using a MuSig2 multi-sig output.
|
||||
*/
|
||||
bool musig2 = 7;
|
||||
}
|
||||
|
||||
message PsbtShim {
|
||||
|
|
@ -2469,6 +2664,9 @@ message PendingHTLC {
|
|||
}
|
||||
|
||||
message PendingChannelsRequest {
|
||||
// Indicates whether to include the raw transaction hex for
|
||||
// waiting_close_channels.
|
||||
bool include_raw_tx = 1;
|
||||
}
|
||||
message PendingChannelsResponse {
|
||||
message PendingChannel {
|
||||
|
|
@ -2504,6 +2702,13 @@ message PendingChannelsResponse {
|
|||
|
||||
// Whether this channel is advertised to the network or not.
|
||||
bool private = 12;
|
||||
|
||||
/*
|
||||
An optional note-to-self to go along with the channel containing some
|
||||
useful information. This is only ever stored locally and in no way
|
||||
impacts the channel's operation.
|
||||
*/
|
||||
string memo = 13;
|
||||
}
|
||||
|
||||
message PendingOpenChannel {
|
||||
|
|
@ -2531,6 +2736,17 @@ message PendingChannelsResponse {
|
|||
|
||||
// Previously used for confirmation_height. Do not reuse.
|
||||
reserved 2;
|
||||
|
||||
// The number of blocks until the funding transaction is considered
|
||||
// expired. If this value gets close to zero, there is a risk that the
|
||||
// channel funding will be canceled by the channel responder. The
|
||||
// channel should be fee bumped using CPFP (see walletrpc.BumpFee) to
|
||||
// ensure that the channel confirms in time. Otherwise a force-close
|
||||
// will be necessary if the channel confirms after the funding
|
||||
// transaction expires. A negative value means the channel responder has
|
||||
// very likely canceled the funding and the channel will never become
|
||||
// fully operational.
|
||||
int32 funding_expiry_blocks = 3;
|
||||
}
|
||||
|
||||
message WaitingCloseChannel {
|
||||
|
|
@ -2548,6 +2764,10 @@ message PendingChannelsResponse {
|
|||
|
||||
// The transaction id of the closing transaction
|
||||
string closing_txid = 4;
|
||||
|
||||
// The raw hex encoded bytes of the closing transaction. Included if
|
||||
// include_raw_tx in the request is true.
|
||||
string closing_tx_hex = 5;
|
||||
}
|
||||
|
||||
message Commitments {
|
||||
|
|
@ -2683,6 +2903,14 @@ message WalletAccountBalance {
|
|||
}
|
||||
|
||||
message WalletBalanceRequest {
|
||||
// The wallet account the balance is shown for.
|
||||
// If this is not specified, the balance of the "default" account is shown.
|
||||
string account = 1;
|
||||
|
||||
// The minimum number of confirmations each one of your outputs used for the
|
||||
// funding transaction must satisfy. If this is not specified, the default
|
||||
// value of 1 is used.
|
||||
int32 min_confs = 2;
|
||||
}
|
||||
|
||||
message WalletBalanceResponse {
|
||||
|
|
@ -2768,6 +2996,9 @@ message QueryRoutesRequest {
|
|||
not add any additional block padding on top of final_ctlv_delta. This
|
||||
padding of a few blocks needs to be added manually or otherwise failures may
|
||||
happen when a block comes in while the payment is in flight.
|
||||
|
||||
Note: must not be set if making a payment to a blinded path (delta is
|
||||
set by the aggregate parameters provided by blinded_payment_paths)
|
||||
*/
|
||||
int32 final_cltv_delta = 4;
|
||||
|
||||
|
|
@ -2841,12 +3072,21 @@ message QueryRoutesRequest {
|
|||
*/
|
||||
repeated lnrpc.RouteHint route_hints = 16;
|
||||
|
||||
/*
|
||||
An optional blinded path(s) to reach the destination. Note that the
|
||||
introduction node must be provided as the first hop in the route.
|
||||
*/
|
||||
repeated BlindedPaymentPath blinded_payment_paths = 19;
|
||||
|
||||
/*
|
||||
Features assumed to be supported by the final node. All transitive feature
|
||||
dependencies must also be set properly. For a given feature bit pair, either
|
||||
optional or remote may be set, but not both. If this field is nil or empty,
|
||||
the router will try to load destination features from the graph as a
|
||||
fallback.
|
||||
|
||||
Note: must not be set if making a payment to a blinded route (features
|
||||
are provided in blinded_payment_paths).
|
||||
*/
|
||||
repeated lnrpc.FeatureBit dest_features = 17;
|
||||
|
||||
|
|
@ -2952,6 +3192,32 @@ message Hop {
|
|||
|
||||
// The payment metadata to send along with the payment to the payee.
|
||||
bytes metadata = 13;
|
||||
|
||||
/*
|
||||
Blinding point is an optional blinding point included for introduction
|
||||
nodes in blinded paths. This field is mandatory for hops that represents
|
||||
the introduction point in a blinded path.
|
||||
*/
|
||||
bytes blinding_point = 14;
|
||||
|
||||
/*
|
||||
Encrypted data is a receiver-produced blob of data that provides hops
|
||||
in a blinded route with forwarding data. As this data is encrypted by
|
||||
the recipient, we will not be able to parse it - it is essentially an
|
||||
arbitrary blob of data from our node's perspective. This field is
|
||||
mandatory for all hops in a blinded path, including the introduction
|
||||
node.
|
||||
*/
|
||||
bytes encrypted_data = 15;
|
||||
|
||||
/*
|
||||
The total amount that is sent to the recipient (possibly across multiple
|
||||
HTLCs), as specified by the sender when making a payment to a blinded path.
|
||||
This value is only set in the final hop payload of a blinded payment. This
|
||||
value is analogous to the MPPRecord that is used for regular (non-blinded)
|
||||
MPP payments.
|
||||
*/
|
||||
uint64 total_amt_msat = 16;
|
||||
}
|
||||
|
||||
message MPPRecord {
|
||||
|
|
@ -2959,7 +3225,8 @@ message MPPRecord {
|
|||
A unique, random identifier used to authenticate the sender as the intended
|
||||
payer of a multi-path payment. The payment_addr must be the same for all
|
||||
subpayments, and match the payment_addr provided in the receiver's invoice.
|
||||
The same payment_addr must be used on all subpayments.
|
||||
The same payment_addr must be used on all subpayments. This is also called
|
||||
payment secret in specifications (e.g. BOLT 11).
|
||||
*/
|
||||
bytes payment_addr = 11;
|
||||
|
||||
|
|
@ -3089,6 +3356,9 @@ message RoutingPolicy {
|
|||
|
||||
// Custom channel update tlv records.
|
||||
map<uint64, bytes> custom_records = 8;
|
||||
|
||||
int32 inbound_fee_base_msat = 9;
|
||||
int32 inbound_fee_rate_milli_msat = 10;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -3175,6 +3445,10 @@ message ChanInfoRequest {
|
|||
output index for the channel.
|
||||
*/
|
||||
uint64 chan_id = 1 [jstype = JS_STRING];
|
||||
|
||||
// The channel point of the channel in format funding_txid:output_index. If
|
||||
// chan_id is specified, this field is ignored.
|
||||
string chan_point = 2;
|
||||
}
|
||||
|
||||
message NetworkInfoRequest {
|
||||
|
|
@ -3297,6 +3571,64 @@ message RouteHint {
|
|||
repeated HopHint hop_hints = 1;
|
||||
}
|
||||
|
||||
message BlindedPaymentPath {
|
||||
// The blinded path to send the payment to.
|
||||
BlindedPath blinded_path = 1;
|
||||
|
||||
// The base fee for the blinded path provided, expressed in msat.
|
||||
uint64 base_fee_msat = 2;
|
||||
|
||||
/*
|
||||
The proportional fee for the blinded path provided, expressed in parts
|
||||
per million.
|
||||
*/
|
||||
uint32 proportional_fee_rate = 3;
|
||||
|
||||
/*
|
||||
The total CLTV delta for the blinded path provided, including the
|
||||
final CLTV delta for the receiving node.
|
||||
*/
|
||||
uint32 total_cltv_delta = 4;
|
||||
|
||||
/*
|
||||
The minimum hltc size that may be sent over the blinded path, expressed
|
||||
in msat.
|
||||
*/
|
||||
uint64 htlc_min_msat = 5;
|
||||
|
||||
/*
|
||||
The maximum htlc size that may be sent over the blinded path, expressed
|
||||
in msat.
|
||||
*/
|
||||
uint64 htlc_max_msat = 6;
|
||||
|
||||
// The feature bits for the route.
|
||||
repeated FeatureBit features = 7;
|
||||
}
|
||||
|
||||
message BlindedPath {
|
||||
// The unblinded pubkey of the introduction node for the route.
|
||||
bytes introduction_node = 1;
|
||||
|
||||
// The ephemeral pubkey used by nodes in the blinded route.
|
||||
bytes blinding_point = 2;
|
||||
|
||||
/*
|
||||
A set of blinded node keys and data blobs for the blinded portion of the
|
||||
route. Note that the first hop is expected to be the introduction node,
|
||||
so the route is always expected to have at least one hop.
|
||||
*/
|
||||
repeated BlindedHop blinded_hops = 3;
|
||||
}
|
||||
|
||||
message BlindedHop {
|
||||
// The blinded public key of the node.
|
||||
bytes blinded_node = 1;
|
||||
|
||||
// An encrypted blob of data provided to the blinded node.
|
||||
bytes encrypted_data = 2;
|
||||
}
|
||||
|
||||
message AMPInvoiceState {
|
||||
// The state the HTLCs associated with this setID are in.
|
||||
InvoiceHTLCState state = 1;
|
||||
|
|
@ -3351,7 +3683,7 @@ message Invoice {
|
|||
int64 value_msat = 23;
|
||||
|
||||
/*
|
||||
Whether this invoice has been fulfilled
|
||||
Whether this invoice has been fulfilled.
|
||||
|
||||
The field is deprecated. Use the state field instead (compare to SETTLED).
|
||||
*/
|
||||
|
|
@ -3359,12 +3691,14 @@ message Invoice {
|
|||
|
||||
/*
|
||||
When this invoice was created.
|
||||
Measured in seconds since the unix epoch.
|
||||
Note: Output only, don't specify for creating an invoice.
|
||||
*/
|
||||
int64 creation_date = 7;
|
||||
|
||||
/*
|
||||
When this invoice was settled.
|
||||
Measured in seconds since the unix epoch.
|
||||
Note: Output only, don't specify for creating an invoice.
|
||||
*/
|
||||
int64 settle_date = 8;
|
||||
|
|
@ -3385,7 +3719,7 @@ message Invoice {
|
|||
*/
|
||||
bytes description_hash = 10;
|
||||
|
||||
// Payment request expiry time in seconds. Default is 3600 (1 hour).
|
||||
// Payment request expiry time in seconds. Default is 86400 (24 hours).
|
||||
int64 expiry = 11;
|
||||
|
||||
// Fallback on-chain address.
|
||||
|
|
@ -3401,6 +3735,8 @@ message Invoice {
|
|||
repeated RouteHint route_hints = 14;
|
||||
|
||||
// Whether this invoice should include routing hints for private channels.
|
||||
// Note: When enabled, if value and value_msat are zero, a large number of
|
||||
// hints with these channels can be included, which might not be desirable.
|
||||
bool private = 15;
|
||||
|
||||
/*
|
||||
|
|
@ -3426,22 +3762,22 @@ message Invoice {
|
|||
|
||||
/*
|
||||
The amount that was accepted for this invoice, in satoshis. This will ONLY
|
||||
be set if this invoice has been settled. We provide this field as if the
|
||||
invoice was created with a zero value, then we need to record what amount
|
||||
was ultimately accepted. Additionally, it's possible that the sender paid
|
||||
MORE that was specified in the original invoice. So we'll record that here
|
||||
as well.
|
||||
be set if this invoice has been settled or accepted. We provide this field
|
||||
as if the invoice was created with a zero value, then we need to record what
|
||||
amount was ultimately accepted. Additionally, it's possible that the sender
|
||||
paid MORE that was specified in the original invoice. So we'll record that
|
||||
here as well.
|
||||
Note: Output only, don't specify for creating an invoice.
|
||||
*/
|
||||
int64 amt_paid_sat = 19;
|
||||
|
||||
/*
|
||||
The amount that was accepted for this invoice, in millisatoshis. This will
|
||||
ONLY be set if this invoice has been settled. We provide this field as if
|
||||
the invoice was created with a zero value, then we need to record what
|
||||
amount was ultimately accepted. Additionally, it's possible that the sender
|
||||
paid MORE that was specified in the original invoice. So we'll record that
|
||||
here as well.
|
||||
ONLY be set if this invoice has been settled or accepted. We provide this
|
||||
field as if the invoice was created with a zero value, then we need to
|
||||
record what amount was ultimately accepted. Additionally, it's possible that
|
||||
the sender paid MORE that was specified in the original invoice. So we'll
|
||||
record that here as well.
|
||||
Note: Output only, don't specify for creating an invoice.
|
||||
*/
|
||||
int64 amt_paid_msat = 20;
|
||||
|
|
@ -3479,9 +3815,10 @@ message Invoice {
|
|||
bool is_keysend = 25;
|
||||
|
||||
/*
|
||||
The payment address of this invoice. This value will be used in MPP
|
||||
payments, and also for newer invoices that always require the MPP payload
|
||||
for added end-to-end security.
|
||||
The payment address of this invoice. This is also called payment secret in
|
||||
specifications (e.g. BOLT 11). This value will be used in MPP payments, and
|
||||
also for newer invoices that always require the MPP payload for added
|
||||
end-to-end security.
|
||||
Note: Output only, don't specify for creating an invoice.
|
||||
*/
|
||||
bytes payment_addr = 26;
|
||||
|
|
@ -3501,6 +3838,48 @@ message Invoice {
|
|||
Note: Output only, don't specify for creating an invoice.
|
||||
*/
|
||||
map<string, AMPInvoiceState> amp_invoice_state = 28;
|
||||
|
||||
/*
|
||||
Signals that the invoice should include blinded paths to hide the true
|
||||
identity of the recipient.
|
||||
*/
|
||||
bool is_blinded = 29;
|
||||
|
||||
/*
|
||||
Config values to use when creating blinded paths for this invoice. These
|
||||
can be used to override the defaults config values provided in by the
|
||||
global config. This field is only used if is_blinded is true.
|
||||
*/
|
||||
BlindedPathConfig blinded_path_config = 30;
|
||||
}
|
||||
|
||||
message BlindedPathConfig {
|
||||
/*
|
||||
The minimum number of real hops to include in a blinded path. This doesn't
|
||||
include our node, so if the minimum is 1, then the path will contain at
|
||||
minimum our node along with an introduction node hop. If it is zero then
|
||||
the shortest path will use our node as an introduction node.
|
||||
*/
|
||||
optional uint32 min_num_real_hops = 1;
|
||||
|
||||
/*
|
||||
The number of hops to include in a blinded path. This doesn't include our
|
||||
node, so if it is 1, then the path will contain our node along with an
|
||||
introduction node or dummy node hop. If paths shorter than NumHops is
|
||||
found, then they will be padded using dummy hops.
|
||||
*/
|
||||
optional uint32 num_hops = 2;
|
||||
|
||||
/*
|
||||
The maximum number of blinded paths to select and add to an invoice.
|
||||
*/
|
||||
optional uint32 max_num_paths = 3;
|
||||
|
||||
/*
|
||||
A list of node IDs of nodes that should not be used in any of our generated
|
||||
blinded paths.
|
||||
*/
|
||||
repeated bytes node_omission_list = 4;
|
||||
}
|
||||
|
||||
enum InvoiceHTLCState {
|
||||
|
|
@ -3586,9 +3965,9 @@ message AddInvoiceResponse {
|
|||
uint64 add_index = 16;
|
||||
|
||||
/*
|
||||
The payment address of the generated invoice. This value should be used
|
||||
in all payments for this invoice as we require it for end to end
|
||||
security.
|
||||
The payment address of the generated invoice. This is also called
|
||||
payment secret in specifications (e.g. BOLT 11). This value should be used
|
||||
in all payments for this invoice as we require it for end to end security.
|
||||
*/
|
||||
bytes payment_addr = 17;
|
||||
}
|
||||
|
|
@ -3629,7 +4008,16 @@ message ListInvoiceRequest {
|
|||
specified index offset. This can be used to paginate backwards.
|
||||
*/
|
||||
bool reversed = 6;
|
||||
|
||||
// If set, returns all invoices with a creation date greater than or equal
|
||||
// to it. Measured in seconds since the unix epoch.
|
||||
uint64 creation_date_start = 7;
|
||||
|
||||
// If set, returns all invoices with a creation date less than or equal to
|
||||
// it. Measured in seconds since the unix epoch.
|
||||
uint64 creation_date_end = 8;
|
||||
}
|
||||
|
||||
message ListInvoiceResponse {
|
||||
/*
|
||||
A list of invoices from the time slice of the time series specified in the
|
||||
|
|
@ -3700,6 +4088,11 @@ enum PaymentFailureReason {
|
|||
Insufficient local balance.
|
||||
*/
|
||||
FAILURE_REASON_INSUFFICIENT_BALANCE = 5;
|
||||
|
||||
/*
|
||||
The payment was canceled.
|
||||
*/
|
||||
FAILURE_REASON_CANCELED = 6;
|
||||
}
|
||||
|
||||
message Payment {
|
||||
|
|
@ -3730,10 +4123,20 @@ message Payment {
|
|||
string payment_request = 9;
|
||||
|
||||
enum PaymentStatus {
|
||||
UNKNOWN = 0;
|
||||
// Deprecated. This status will never be returned.
|
||||
UNKNOWN = 0 [deprecated = true];
|
||||
|
||||
// Payment has inflight HTLCs.
|
||||
IN_FLIGHT = 1;
|
||||
|
||||
// Payment is settled.
|
||||
SUCCEEDED = 2;
|
||||
|
||||
// Payment is failed.
|
||||
FAILED = 3;
|
||||
|
||||
// Payment is created and has not attempted any HTLCs.
|
||||
INITIATED = 4;
|
||||
}
|
||||
|
||||
// The status of the payment.
|
||||
|
|
@ -3828,6 +4231,14 @@ message ListPaymentsRequest {
|
|||
of payments, as all of them have to be iterated through to be counted.
|
||||
*/
|
||||
bool count_total_payments = 5;
|
||||
|
||||
// If set, returns all payments with a creation date greater than or equal
|
||||
// to it. Measured in seconds since the unix epoch.
|
||||
uint64 creation_date_start = 6;
|
||||
|
||||
// If set, returns all payments with a creation date less than or equal to
|
||||
// it. Measured in seconds since the unix epoch.
|
||||
uint64 creation_date_end = 7;
|
||||
}
|
||||
|
||||
message ListPaymentsResponse {
|
||||
|
|
@ -3873,6 +4284,10 @@ message DeleteAllPaymentsRequest {
|
|||
Only delete failed HTLCs from payments, not the payment itself.
|
||||
*/
|
||||
bool failed_htlcs_only = 2;
|
||||
|
||||
// Delete all payments. NOTE: Using this option requires careful
|
||||
// consideration as it is a destructive operation.
|
||||
bool all_payments = 3;
|
||||
}
|
||||
|
||||
message DeletePaymentResponse {
|
||||
|
|
@ -3923,6 +4338,7 @@ message PayReq {
|
|||
bytes payment_addr = 11;
|
||||
int64 num_msat = 12;
|
||||
map<uint32, Feature> features = 13;
|
||||
repeated BlindedPaymentPath blinded_paths = 14;
|
||||
}
|
||||
|
||||
enum FeatureBit {
|
||||
|
|
@ -3949,6 +4365,8 @@ enum FeatureBit {
|
|||
ANCHORS_OPT = 21;
|
||||
ANCHORS_ZERO_FEE_HTLC_REQ = 22;
|
||||
ANCHORS_ZERO_FEE_HTLC_OPT = 23;
|
||||
ROUTE_BLINDING_REQUIRED = 24;
|
||||
ROUTE_BLINDING_OPTIONAL = 25;
|
||||
AMP_REQ = 30;
|
||||
AMP_OPT = 31;
|
||||
}
|
||||
|
|
@ -3978,7 +4396,15 @@ message ChannelFeeReport {
|
|||
// The effective fee rate in milli-satoshis. Computed by dividing the
|
||||
// fee_per_mil value by 1 million.
|
||||
double fee_rate = 4;
|
||||
|
||||
// The base fee charged regardless of the number of milli-satoshis sent.
|
||||
int32 inbound_base_fee_msat = 6;
|
||||
|
||||
// The amount charged per milli-satoshis transferred expressed in
|
||||
// millionths of a satoshi.
|
||||
int32 inbound_fee_per_mil = 7;
|
||||
}
|
||||
|
||||
message FeeReportResponse {
|
||||
// An array of channel fee reports which describes the current fee schedule
|
||||
// for each channel.
|
||||
|
|
@ -3997,6 +4423,16 @@ message FeeReportResponse {
|
|||
uint64 month_fee_sum = 4;
|
||||
}
|
||||
|
||||
message InboundFee {
|
||||
// The inbound base fee charged regardless of the number of milli-satoshis
|
||||
// received in the channel. By default, only negative values are accepted.
|
||||
int32 base_fee_msat = 1;
|
||||
|
||||
// The effective inbound fee rate in micro-satoshis (parts per million).
|
||||
// By default, only negative values are accepted.
|
||||
int32 fee_rate_ppm = 2;
|
||||
}
|
||||
|
||||
message PolicyUpdateRequest {
|
||||
oneof scope {
|
||||
// If set, then this update applies to all currently active channels.
|
||||
|
|
@ -4029,7 +4465,12 @@ message PolicyUpdateRequest {
|
|||
|
||||
// If true, min_htlc_msat is applied.
|
||||
bool min_htlc_msat_specified = 8;
|
||||
|
||||
// Optional inbound fee. If unset, the previously set value will be
|
||||
// retained [EXPERIMENTAL].
|
||||
InboundFee inbound_fee = 10;
|
||||
}
|
||||
|
||||
enum UpdateFailure {
|
||||
UPDATE_FAILURE_UNKNOWN = 0;
|
||||
UPDATE_FAILURE_PENDING = 1;
|
||||
|
|
@ -4305,6 +4746,7 @@ message Failure {
|
|||
EXPIRY_TOO_FAR = 22;
|
||||
MPP_TIMEOUT = 23;
|
||||
INVALID_ONION_PAYLOAD = 24;
|
||||
INVALID_ONION_BLINDING = 25;
|
||||
|
||||
/*
|
||||
An internal error occurred.
|
||||
|
|
|
|||
|
|
@ -137,6 +137,13 @@ service LightningPub {
|
|||
option (nostr) = true;
|
||||
}
|
||||
|
||||
rpc ListChannels(structs.Empty) returns (structs.LndChannels) {
|
||||
option (auth_type) = "Admin";
|
||||
option (http_method) = "get";
|
||||
option (http_route) = "/api/admin/channels";
|
||||
option (nostr) = true;
|
||||
}
|
||||
|
||||
rpc GetUsageMetrics(structs.Empty) returns (structs.UsageMetrics) {
|
||||
option (auth_type) = "Metrics";
|
||||
option (http_method) = "post";
|
||||
|
|
|
|||
|
|
@ -87,19 +87,6 @@ message RoutingEvent {
|
|||
bool offchain = 11;
|
||||
bool forward_fail_event = 12;
|
||||
}
|
||||
message ChannelBalanceEvent {
|
||||
int64 block_height = 1;
|
||||
string channel_id = 2;
|
||||
int64 local_balance_sats = 3;
|
||||
int64 remote_balance_sats = 4;
|
||||
}
|
||||
|
||||
message ChainBalanceEvent {
|
||||
int64 block_height = 1;
|
||||
int64 confirmed_balance = 2;
|
||||
int64 unconfirmed_balance = 3;
|
||||
int64 total_balance = 4;
|
||||
}
|
||||
|
||||
message OpenChannel {
|
||||
string channel_id = 1;
|
||||
|
|
@ -108,6 +95,7 @@ message OpenChannel {
|
|||
int64 lifetime =4 ;
|
||||
int64 local_balance=5;
|
||||
int64 remote_balance = 6;
|
||||
string label = 7;
|
||||
}
|
||||
message ClosedChannel {
|
||||
string channel_id = 1;
|
||||
|
|
@ -115,29 +103,23 @@ message ClosedChannel {
|
|||
int64 closed_height =4;
|
||||
}
|
||||
|
||||
message ChannelRouting {
|
||||
string channel_id = 1;
|
||||
int64 send_errors = 2;
|
||||
int64 receive_errors = 3;
|
||||
int64 forward_errors_as_input = 4;
|
||||
int64 forward_errors_as_output = 5;
|
||||
int64 missed_forward_fee_as_input = 6;
|
||||
int64 missed_forward_fee_as_output = 7;
|
||||
int64 forward_fee_as_input = 8;
|
||||
int64 forward_fee_as_output = 9;
|
||||
int64 events_number = 10;
|
||||
message GraphPoint {
|
||||
int64 x = 1;
|
||||
int64 y = 2;
|
||||
}
|
||||
|
||||
message LndNodeMetrics {
|
||||
repeated ChannelBalanceEvent channels_balance_events = 1;
|
||||
repeated ChainBalanceEvent chain_balance_events = 2;
|
||||
repeated GraphPoint chain_balance = 1;
|
||||
repeated GraphPoint channel_balance = 2;
|
||||
repeated GraphPoint external_balance = 3;
|
||||
int64 offline_channels = 4;
|
||||
int64 online_channels = 5;
|
||||
int64 pending_channels = 6;
|
||||
int64 closing_channels = 7;
|
||||
repeated OpenChannel open_channels = 8;
|
||||
repeated ClosedChannel closed_channels = 9;
|
||||
repeated ChannelRouting channel_routing = 10;
|
||||
int64 forwarding_events = 11;
|
||||
int64 forwarding_fees = 12;
|
||||
}
|
||||
|
||||
message LndMetrics {
|
||||
|
|
@ -145,6 +127,10 @@ message LndMetrics {
|
|||
|
||||
}
|
||||
|
||||
message LndChannels {
|
||||
repeated OpenChannel open_channels = 1;
|
||||
}
|
||||
|
||||
message LndGetInfoRequest {
|
||||
int64 nodeId = 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ export const AddInvoiceReq = (value: number, expiry = 60 * 60, privateHints = fa
|
|||
settleDate: 0n,
|
||||
settleIndex: 0n,
|
||||
state: 0,
|
||||
|
||||
isBlinded: false,
|
||||
amtPaid: 0n,
|
||||
settled: false,
|
||||
})
|
||||
|
|
@ -8,7 +8,7 @@ import { LightningClient } from '../../../proto/lnd/lightning.client.js'
|
|||
import { InvoicesClient } from '../../../proto/lnd/invoices.client.js'
|
||||
import { RouterClient } from '../../../proto/lnd/router.client.js'
|
||||
import { ChainNotifierClient } from '../../../proto/lnd/chainnotifier.client.js'
|
||||
import { GetInfoResponse, AddressType, NewAddressResponse, AddInvoiceResponse, Invoice_InvoiceState, PayReq, Payment_PaymentStatus, Payment, PaymentFailureReason, SendCoinsResponse, EstimateFeeResponse, ChannelBalanceResponse, TransactionDetails, ListChannelsResponse, ClosedChannelsResponse, PendingChannelsResponse, ForwardingHistoryResponse } from '../../../proto/lnd/lightning.js'
|
||||
import { GetInfoResponse, AddressType, NewAddressResponse, AddInvoiceResponse, Invoice_InvoiceState, PayReq, Payment_PaymentStatus, Payment, PaymentFailureReason, SendCoinsResponse, EstimateFeeResponse, ChannelBalanceResponse, TransactionDetails, ListChannelsResponse, ClosedChannelsResponse, PendingChannelsResponse, ForwardingHistoryResponse, CoinSelectionStrategy } from '../../../proto/lnd/lightning.js'
|
||||
import { OpenChannelReq } from './openChannelReq.js';
|
||||
import { AddInvoiceReq } from './addInvoiceReq.js';
|
||||
import { PayInvoiceReq } from './payInvoiceReq.js';
|
||||
|
|
@ -113,12 +113,12 @@ export default class {
|
|||
return res.response
|
||||
}
|
||||
async ListPendingChannels(): Promise<PendingChannelsResponse> {
|
||||
const res = await this.lightning.pendingChannels({}, DeadLineMetadata())
|
||||
const res = await this.lightning.pendingChannels({ includeRawTx: false }, DeadLineMetadata())
|
||||
return res.response
|
||||
}
|
||||
async ListChannels(): Promise<ListChannelsResponse> {
|
||||
async ListChannels(peerLookup = false): Promise<ListChannelsResponse> {
|
||||
const res = await this.lightning.listChannels({
|
||||
activeOnly: false, inactiveOnly: false, privateOnly: false, publicOnly: false, peer: Buffer.alloc(0)
|
||||
activeOnly: false, inactiveOnly: false, privateOnly: false, publicOnly: false, peer: Buffer.alloc(0), peerAliasLookup: peerLookup
|
||||
}, DeadLineMetadata())
|
||||
return res.response
|
||||
}
|
||||
|
|
@ -350,7 +350,8 @@ export default class {
|
|||
addrToAmount: { [address]: BigInt(amount) },
|
||||
minConfs: 1,
|
||||
spendUnconfirmed: false,
|
||||
targetConf: targetConf
|
||||
targetConf: targetConf,
|
||||
coinSelectionStrategy: CoinSelectionStrategy.STRATEGY_LARGEST
|
||||
})
|
||||
return res.response
|
||||
}
|
||||
|
|
@ -385,7 +386,7 @@ export default class {
|
|||
}
|
||||
|
||||
async GetWalletBalance() {
|
||||
const res = await this.lightning.walletBalance({}, DeadLineMetadata())
|
||||
const res = await this.lightning.walletBalance({ account: "", minConfs: 1 }, DeadLineMetadata())
|
||||
return res.response
|
||||
}
|
||||
|
||||
|
|
@ -404,10 +405,10 @@ export default class {
|
|||
}
|
||||
|
||||
async GetBalance(): Promise<BalanceInfo> { // TODO: remove this
|
||||
const wRes = await this.lightning.walletBalance({}, DeadLineMetadata())
|
||||
const wRes = await this.lightning.walletBalance({ account: "", minConfs: 1 }, DeadLineMetadata())
|
||||
const { confirmedBalance, unconfirmedBalance, totalBalance } = wRes.response
|
||||
const { response } = await this.lightning.listChannels({
|
||||
activeOnly: false, inactiveOnly: false, privateOnly: false, publicOnly: false, peer: Buffer.alloc(0)
|
||||
activeOnly: false, inactiveOnly: false, privateOnly: false, publicOnly: false, peer: Buffer.alloc(0), peerAliasLookup: false
|
||||
}, DeadLineMetadata())
|
||||
const channelsBalance = response.channels.map(c => ({
|
||||
channelId: c.chanId,
|
||||
|
|
@ -424,11 +425,11 @@ export default class {
|
|||
}
|
||||
|
||||
async GetAllPaidInvoices(max: number) {
|
||||
const res = await this.lightning.listInvoices({ indexOffset: 0n, numMaxInvoices: BigInt(max), pendingOnly: false, reversed: true }, DeadLineMetadata())
|
||||
const res = await this.lightning.listInvoices({ indexOffset: 0n, numMaxInvoices: BigInt(max), pendingOnly: false, reversed: true, creationDateEnd: 0n, creationDateStart: 0n }, DeadLineMetadata())
|
||||
return res.response
|
||||
}
|
||||
async GetAllPayments(max: number) {
|
||||
const res = await this.lightning.listPayments({ countTotalPayments: false, includeIncomplete: false, indexOffset: 0n, maxPayments: BigInt(max), reversed: true })
|
||||
const res = await this.lightning.listPayments({ countTotalPayments: false, includeIncomplete: false, indexOffset: 0n, maxPayments: BigInt(max), reversed: true, creationDateEnd: 0n, creationDateStart: 0n })
|
||||
return res.response
|
||||
}
|
||||
|
||||
|
|
@ -438,7 +439,7 @@ export default class {
|
|||
}
|
||||
const indexOffset = BigInt(paymentIndex - 1)
|
||||
const res = await this.lightning.listPayments({
|
||||
countTotalPayments: false, includeIncomplete: true, indexOffset, maxPayments: 1n, reversed: false
|
||||
countTotalPayments: false, includeIncomplete: true, indexOffset, maxPayments: 1n, reversed: false, creationDateEnd: 0n, creationDateStart: 0n
|
||||
}, DeadLineMetadata())
|
||||
return res.response
|
||||
}
|
||||
|
|
@ -446,7 +447,7 @@ export default class {
|
|||
async GetLatestPaymentIndex(from = 0) {
|
||||
let indexOffset = BigInt(from)
|
||||
while (true) {
|
||||
const res = await this.lightning.listPayments({ countTotalPayments: false, includeIncomplete: false, indexOffset, maxPayments: 0n, reversed: false }, DeadLineMetadata())
|
||||
const res = await this.lightning.listPayments({ countTotalPayments: false, includeIncomplete: false, indexOffset, maxPayments: 0n, reversed: false, creationDateEnd: 0n, creationDateStart: 0n }, DeadLineMetadata())
|
||||
if (res.response.payments.length === 0) {
|
||||
return Number(indexOffset)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ export const OpenChannelReq = (destination: string, closeAddress: string, fundin
|
|||
scidAlias: false,
|
||||
nodePubkeyString: "",
|
||||
satPerByte: 0n,
|
||||
|
||||
fundMax: false,
|
||||
memo: "",
|
||||
outpoints: [],
|
||||
fundingShim: undefined
|
||||
})
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { SendCoinsRequest } from "../../../proto/lnd/lightning";
|
||||
import { CoinSelectionStrategy, SendCoinsRequest } from "../../../proto/lnd/lightning.js";
|
||||
|
||||
export const SendCoinsReq = (address: string, amount: number, satPerVByte: number, label = ""): SendCoinsRequest => ({
|
||||
addr: address,
|
||||
|
|
@ -9,5 +9,7 @@ export const SendCoinsReq = (address: string, amount: number, satPerVByte: numbe
|
|||
minConfs: 1,
|
||||
sendAll: false,
|
||||
spendUnconfirmed: false,
|
||||
satPerByte: BigInt(0)
|
||||
satPerByte: BigInt(0),
|
||||
coinSelectionStrategy: CoinSelectionStrategy.STRATEGY_LARGEST,
|
||||
outpoints: [],
|
||||
})
|
||||
|
|
@ -4,6 +4,7 @@ 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'
|
||||
import LND from "../lnd/lnd.js";
|
||||
export class AdminManager {
|
||||
|
||||
storage: Storage
|
||||
|
|
@ -16,6 +17,7 @@ export class AdminManager {
|
|||
appNprofilePath: string
|
||||
interval: NodeJS.Timer
|
||||
appNprofile: string
|
||||
lnd: LND
|
||||
constructor(mainSettings: MainSettings, storage: Storage) {
|
||||
this.storage = storage
|
||||
this.dataDir = mainSettings.storageSettings.dataDir
|
||||
|
|
@ -26,6 +28,10 @@ export class AdminManager {
|
|||
this.start()
|
||||
}
|
||||
|
||||
setLND = (lnd: LND) => {
|
||||
this.lnd = lnd
|
||||
}
|
||||
|
||||
setAppNprofile = (nprofile: string) => {
|
||||
this.appNprofile = nprofile
|
||||
const enrollToken = this.ReadAdminEnrollToken()
|
||||
|
|
@ -118,7 +124,7 @@ export class AdminManager {
|
|||
CreateInviteLink = async (adminNpub: string, sats?: number): Promise<Types.CreateOneTimeInviteLinkResponse> => {
|
||||
const adminAppUser = await this.storage.applicationStorage.FindNostrAppUser(adminNpub)
|
||||
if (!adminAppUser) {
|
||||
throw new Error("Admin user expected but not found!!!");
|
||||
throw new Error("Admin user expected but not found!!!");
|
||||
}
|
||||
const newInviteToken = await this.storage.applicationStorage.AddInviteToken(adminAppUser.application, sats);
|
||||
return {
|
||||
|
|
@ -135,4 +141,19 @@ export class AdminManager {
|
|||
used: inviteToken.used
|
||||
}
|
||||
}
|
||||
|
||||
ListChannels = async (): Promise<Types.LndChannels> => {
|
||||
const channels = await this.lnd.ListChannels(true)
|
||||
return {
|
||||
open_channels: channels.channels.map(c => ({
|
||||
active: c.active,
|
||||
capacity: Number(c.capacity),
|
||||
local_balance: Number(c.localBalance),
|
||||
remote_balance: Number(c.remoteBalance),
|
||||
channel_id: c.chanId,
|
||||
label: c.peerAlias || c.remotePubkey,
|
||||
lifetime: Number(c.lifetime)
|
||||
}))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -36,7 +36,8 @@ export const initMainHandler = async (log: PubLogger, mainSettings: MainSettings
|
|||
}
|
||||
}
|
||||
|
||||
const mainHandler = new Main(reloadedSettings, storageManager, adminManager, utils,unlocker)
|
||||
const mainHandler = new Main(reloadedSettings, storageManager, adminManager, utils, unlocker)
|
||||
adminManager.setLND(mainHandler.lnd)
|
||||
await mainHandler.lnd.Warmup()
|
||||
if (!reloadedSettings.skipSanityCheck) {
|
||||
const sanityChecker = new SanityChecker(storageManager, mainHandler.lnd)
|
||||
|
|
|
|||
|
|
@ -109,33 +109,33 @@ export class Watchdog {
|
|||
checkBalanceUpdate = async (deltaLnd: number, deltaUsers: number) => {
|
||||
this.utils.stateBundler.AddBalancePoint('deltaExternal', deltaLnd)
|
||||
this.utils.stateBundler.AddBalancePoint('deltaUsers', deltaUsers)
|
||||
|
||||
const lndWithDeltaUsers = this.initialLndBalance + deltaUsers
|
||||
const result = this.checkDeltas(deltaLnd, deltaUsers)
|
||||
switch (result.type) {
|
||||
case 'mismatch':
|
||||
if (deltaLnd < 0) {
|
||||
if (result.absoluteDiff > this.settings.maxDiffSats) {
|
||||
await this.updateDisruption(true, result.absoluteDiff)
|
||||
await this.updateDisruption(true, result.absoluteDiff, lndWithDeltaUsers)
|
||||
return true
|
||||
}
|
||||
} else {
|
||||
this.log("WARNING! LND balance increased more than users balance with a difference of", result.absoluteDiff, "sats")
|
||||
this.updateDisruption(false, result.absoluteDiff)
|
||||
this.updateDisruption(false, result.absoluteDiff, lndWithDeltaUsers)
|
||||
return false
|
||||
}
|
||||
break
|
||||
case 'negative':
|
||||
if (Math.abs(deltaLnd) > Math.abs(deltaUsers)) {
|
||||
if (result.absoluteDiff > this.settings.maxDiffSats) {
|
||||
await this.updateDisruption(true, result.absoluteDiff)
|
||||
await this.updateDisruption(true, result.absoluteDiff, lndWithDeltaUsers)
|
||||
return true
|
||||
}
|
||||
} else if (deltaLnd === deltaUsers) {
|
||||
await this.updateDisruption(false, 0)
|
||||
await this.updateDisruption(false, 0, lndWithDeltaUsers)
|
||||
return false
|
||||
} else {
|
||||
this.log("WARNING! LND balance decreased less than users balance with a difference of", result.absoluteDiff, "sats")
|
||||
await this.updateDisruption(false, result.absoluteDiff)
|
||||
await this.updateDisruption(false, result.absoluteDiff, lndWithDeltaUsers)
|
||||
return false
|
||||
}
|
||||
break
|
||||
|
|
@ -143,22 +143,23 @@ export class Watchdog {
|
|||
if (deltaLnd < deltaUsers) {
|
||||
this.log("WARNING! LND balance increased less than users balance with a difference of", result.absoluteDiff, "sats")
|
||||
if (result.absoluteDiff > this.settings.maxDiffSats) {
|
||||
await this.updateDisruption(true, result.absoluteDiff)
|
||||
await this.updateDisruption(true, result.absoluteDiff, lndWithDeltaUsers)
|
||||
return true
|
||||
}
|
||||
} else if (deltaLnd === deltaUsers) {
|
||||
await this.updateDisruption(false, 0)
|
||||
await this.updateDisruption(false, 0, lndWithDeltaUsers)
|
||||
return false
|
||||
} else {
|
||||
await this.updateDisruption(false, result.absoluteDiff)
|
||||
await this.updateDisruption(false, result.absoluteDiff, lndWithDeltaUsers)
|
||||
return false
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
updateDisruption = async (isDisrupted: boolean, absoluteDiff: number) => {
|
||||
updateDisruption = async (isDisrupted: boolean, absoluteDiff: number, lndWithDeltaUsers: number) => {
|
||||
const tracker = await this.getTracker()
|
||||
this.storage.liquidityStorage.UpdateTrackedProviderBalance('lnd', this.lndPubKey, lndWithDeltaUsers)
|
||||
if (isDisrupted) {
|
||||
if (tracker.latest_distruption_at_unix === 0) {
|
||||
await this.storage.liquidityStorage.UpdateTrackedProviderDisruption('lnd', this.lndPubKey, Math.floor(Date.now() / 1000))
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ export default class HtlcTracker {
|
|||
}
|
||||
log = getLogger({ component: 'htlcTracker' })
|
||||
onHtlcEvent = async (htlc: HtlcEvent) => {
|
||||
//getLogger({ component: 'debugHtlcs' })(htlc)
|
||||
/* //getLogger({ component: 'debugHtlcs' })(htlc)
|
||||
const htlcEvent = htlc.event
|
||||
if (htlcEvent.oneofKind === 'subscribedEvent') {
|
||||
return
|
||||
|
|
@ -45,81 +45,81 @@ export default class HtlcTracker {
|
|||
return this.handleSuccess(info)
|
||||
default:
|
||||
//this.log("unknown htlc event type")
|
||||
}
|
||||
} */
|
||||
}
|
||||
|
||||
handleForward = (fwe: ForwardEvent, { eventType, outgoingHtlcId, incomingHtlcId }: EventInfo) => {
|
||||
const { info } = fwe
|
||||
const incomingAmtMsat = info ? Number(info.incomingAmtMsat) : 0
|
||||
const outgoingAmtMsat = info ? Number(info.outgoingAmtMsat) : 0
|
||||
if (eventType === HtlcEvent_EventType.SEND) {
|
||||
this.pendingSendHtlcs.set(outgoingHtlcId, outgoingAmtMsat - incomingAmtMsat)
|
||||
} else if (eventType === HtlcEvent_EventType.RECEIVE) {
|
||||
this.pendingReceiveHtlcs.set(incomingHtlcId, incomingAmtMsat - outgoingAmtMsat)
|
||||
} else if (eventType === HtlcEvent_EventType.FORWARD) {
|
||||
this.pendingForwardHtlcs.set(outgoingHtlcId, outgoingAmtMsat - incomingAmtMsat)
|
||||
}
|
||||
}
|
||||
/* handleForward = (fwe: ForwardEvent, { eventType, outgoingHtlcId, incomingHtlcId }: EventInfo) => {
|
||||
const { info } = fwe
|
||||
const incomingAmtMsat = info ? Number(info.incomingAmtMsat) : 0
|
||||
const outgoingAmtMsat = info ? Number(info.outgoingAmtMsat) : 0
|
||||
if (eventType === HtlcEvent_EventType.SEND) {
|
||||
this.pendingSendHtlcs.set(outgoingHtlcId, outgoingAmtMsat - incomingAmtMsat)
|
||||
} else if (eventType === HtlcEvent_EventType.RECEIVE) {
|
||||
this.pendingReceiveHtlcs.set(incomingHtlcId, incomingAmtMsat - outgoingAmtMsat)
|
||||
} else if (eventType === HtlcEvent_EventType.FORWARD) {
|
||||
this.pendingForwardHtlcs.set(outgoingHtlcId, outgoingAmtMsat - incomingAmtMsat)
|
||||
}
|
||||
} */
|
||||
|
||||
handleFailure = ({ eventType, outgoingHtlcId, incomingHtlcId, incomingChannelId, outgoingChannelId }: EventInfo) => {
|
||||
if (eventType === HtlcEvent_EventType.SEND && this.deleteMapEntry(outgoingHtlcId, this.pendingSendHtlcs) !== null) {
|
||||
return this.incrementSendFailures(outgoingChannelId)
|
||||
}
|
||||
if (eventType === HtlcEvent_EventType.RECEIVE && this.deleteMapEntry(incomingHtlcId, this.pendingReceiveHtlcs) !== null) {
|
||||
return this.incrementReceiveFailures(incomingChannelId)
|
||||
}
|
||||
if (eventType === HtlcEvent_EventType.FORWARD) {
|
||||
const amt = this.deleteMapEntry(outgoingHtlcId, this.pendingForwardHtlcs)
|
||||
if (amt !== null) {
|
||||
return this.incrementForwardFailures(incomingChannelId, outgoingChannelId, amt)
|
||||
}
|
||||
}
|
||||
if (eventType === HtlcEvent_EventType.UNKNOWN) {
|
||||
const fwdAmt = this.deleteMapEntry(outgoingHtlcId, this.pendingForwardHtlcs)
|
||||
if (fwdAmt !== null) {
|
||||
return this.incrementForwardFailures(incomingChannelId, outgoingChannelId, fwdAmt)
|
||||
}
|
||||
if (this.deleteMapEntry(outgoingHtlcId, this.pendingSendHtlcs) !== null) {
|
||||
/* handleFailure = ({ eventType, outgoingHtlcId, incomingHtlcId, incomingChannelId, outgoingChannelId }: EventInfo) => {
|
||||
if (eventType === HtlcEvent_EventType.SEND && this.deleteMapEntry(outgoingHtlcId, this.pendingSendHtlcs) !== null) {
|
||||
return this.incrementSendFailures(outgoingChannelId)
|
||||
}
|
||||
if (this.deleteMapEntry(incomingHtlcId, this.pendingReceiveHtlcs) !== null) {
|
||||
if (eventType === HtlcEvent_EventType.RECEIVE && this.deleteMapEntry(incomingHtlcId, this.pendingReceiveHtlcs) !== null) {
|
||||
return this.incrementReceiveFailures(incomingChannelId)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (eventType === HtlcEvent_EventType.FORWARD) {
|
||||
const amt = this.deleteMapEntry(outgoingHtlcId, this.pendingForwardHtlcs)
|
||||
if (amt !== null) {
|
||||
return this.incrementForwardFailures(incomingChannelId, outgoingChannelId, amt)
|
||||
}
|
||||
}
|
||||
if (eventType === HtlcEvent_EventType.UNKNOWN) {
|
||||
const fwdAmt = this.deleteMapEntry(outgoingHtlcId, this.pendingForwardHtlcs)
|
||||
if (fwdAmt !== null) {
|
||||
return this.incrementForwardFailures(incomingChannelId, outgoingChannelId, fwdAmt)
|
||||
}
|
||||
if (this.deleteMapEntry(outgoingHtlcId, this.pendingSendHtlcs) !== null) {
|
||||
return this.incrementSendFailures(outgoingChannelId)
|
||||
}
|
||||
if (this.deleteMapEntry(incomingHtlcId, this.pendingReceiveHtlcs) !== null) {
|
||||
return this.incrementReceiveFailures(incomingChannelId)
|
||||
}
|
||||
}
|
||||
} */
|
||||
|
||||
handleSuccess = ({ eventType, outgoingHtlcId, incomingHtlcId }: EventInfo) => {
|
||||
if (eventType === HtlcEvent_EventType.SEND) {
|
||||
this.deleteMapEntry(outgoingHtlcId, this.pendingSendHtlcs)
|
||||
} else if (eventType === HtlcEvent_EventType.RECEIVE) {
|
||||
this.deleteMapEntry(incomingHtlcId, this.pendingReceiveHtlcs)
|
||||
} else if (eventType === HtlcEvent_EventType.FORWARD) {
|
||||
this.deleteMapEntry(outgoingHtlcId, this.pendingForwardHtlcs)
|
||||
} else if (eventType === HtlcEvent_EventType.UNKNOWN) {
|
||||
if (this.deleteMapEntry(outgoingHtlcId, this.pendingSendHtlcs) !== null) return
|
||||
if (this.deleteMapEntry(incomingHtlcId, this.pendingReceiveHtlcs) !== null) return
|
||||
if (this.deleteMapEntry(outgoingHtlcId, this.pendingForwardHtlcs) !== null) return
|
||||
}
|
||||
}
|
||||
/* handleSuccess = ({ eventType, outgoingHtlcId, incomingHtlcId }: EventInfo) => {
|
||||
if (eventType === HtlcEvent_EventType.SEND) {
|
||||
this.deleteMapEntry(outgoingHtlcId, this.pendingSendHtlcs)
|
||||
} else if (eventType === HtlcEvent_EventType.RECEIVE) {
|
||||
this.deleteMapEntry(incomingHtlcId, this.pendingReceiveHtlcs)
|
||||
} else if (eventType === HtlcEvent_EventType.FORWARD) {
|
||||
this.deleteMapEntry(outgoingHtlcId, this.pendingForwardHtlcs)
|
||||
} else if (eventType === HtlcEvent_EventType.UNKNOWN) {
|
||||
if (this.deleteMapEntry(outgoingHtlcId, this.pendingSendHtlcs) !== null) return
|
||||
if (this.deleteMapEntry(incomingHtlcId, this.pendingReceiveHtlcs) !== null) return
|
||||
if (this.deleteMapEntry(outgoingHtlcId, this.pendingForwardHtlcs) !== null) return
|
||||
}
|
||||
} */
|
||||
/*
|
||||
deleteMapEntry = (key: number, map: Map<number, number>) => {
|
||||
if (!map.has(key)) {
|
||||
return null
|
||||
}
|
||||
const v = map.get(key)
|
||||
map.delete(key)
|
||||
return v || null
|
||||
} */
|
||||
|
||||
deleteMapEntry = (key: number, map: Map<number, number>) => {
|
||||
if (!map.has(key)) {
|
||||
return null
|
||||
/* incrementSendFailures = async (outgoingChannelId: number) => {
|
||||
await this.storage.metricsStorage.IncrementChannelRouting(outgoingChannelId.toString(), { send_errors: 1 })
|
||||
}
|
||||
const v = map.get(key)
|
||||
map.delete(key)
|
||||
return v || null
|
||||
}
|
||||
|
||||
incrementSendFailures = async (outgoingChannelId: number) => {
|
||||
await this.storage.metricsStorage.IncrementChannelRouting(outgoingChannelId.toString(), { send_errors: 1 })
|
||||
}
|
||||
incrementReceiveFailures = async (incomingChannelId: number) => {
|
||||
await this.storage.metricsStorage.IncrementChannelRouting(incomingChannelId.toString(), { receive_errors: 1 })
|
||||
}
|
||||
incrementForwardFailures = async (incomingChannelId: number, outgoingChannelId: number, amt: number) => {
|
||||
await this.storage.metricsStorage.IncrementChannelRouting(incomingChannelId.toString(), { forward_errors_as_input: 1, missed_forward_fee_as_input: amt })
|
||||
await this.storage.metricsStorage.IncrementChannelRouting(outgoingChannelId.toString(), { forward_errors_as_output: 1, missed_forward_fee_as_output: amt })
|
||||
}
|
||||
incrementReceiveFailures = async (incomingChannelId: number) => {
|
||||
await this.storage.metricsStorage.IncrementChannelRouting(incomingChannelId.toString(), { receive_errors: 1 })
|
||||
}
|
||||
incrementForwardFailures = async (incomingChannelId: number, outgoingChannelId: number, amt: number) => {
|
||||
await this.storage.metricsStorage.IncrementChannelRouting(incomingChannelId.toString(), { forward_errors_as_input: 1, missed_forward_fee_as_input: amt })
|
||||
await this.storage.metricsStorage.IncrementChannelRouting(outgoingChannelId.toString(), { forward_errors_as_output: 1, missed_forward_fee_as_output: amt })
|
||||
} */
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,11 +24,23 @@ export default class Handler {
|
|||
}
|
||||
|
||||
async NewBlockCb(height: number, balanceInfo: BalanceInfo) {
|
||||
const providers = await this.storage.liquidityStorage.GetTrackedProviders()
|
||||
let lndTotal = 0
|
||||
let providerTotal = 0
|
||||
providers.forEach(p => {
|
||||
if (p.provider_type === 'lnd') {
|
||||
lndTotal += p.latest_balance
|
||||
} else {
|
||||
providerTotal += p.latest_balance
|
||||
}
|
||||
})
|
||||
const balanceEvent: Partial<BalanceEvent> = {
|
||||
block_height: height,
|
||||
confirmed_chain_balance: balanceInfo.confirmedBalance,
|
||||
unconfirmed_chain_balance: balanceInfo.unconfirmedBalance,
|
||||
total_chain_balance: balanceInfo.totalBalance,
|
||||
channels_balance: lndTotal,
|
||||
external_balance: providerTotal
|
||||
}
|
||||
const channelsEvents: Partial<ChannelBalanceEvent>[] = balanceInfo.channelsBalance.map(c => ({
|
||||
channel_id: c.channelId,
|
||||
|
|
@ -36,6 +48,7 @@ export default class Handler {
|
|||
remote_balance_sats: c.remoteBalanceSats,
|
||||
}))
|
||||
await this.storage.metricsStorage.SaveBalanceEvents(balanceEvent, channelsEvents)
|
||||
await this.FetchLatestForwardingEvents()
|
||||
}
|
||||
|
||||
async FetchLatestForwardingEvents() {
|
||||
|
|
@ -43,8 +56,8 @@ export default class Handler {
|
|||
const res = await this.lnd.GetForwardingHistory(latestIndex)
|
||||
const forwards = res.forwardingEvents.map(e => ({ fee: Number(e.fee), chanIdIn: e.chanIdIn, chanIdOut: e.chanIdOut, timestampNs: e.timestampNs.toString(), offset: res.lastOffsetIndex }))
|
||||
await Promise.all(forwards.map(async f => {
|
||||
await this.storage.metricsStorage.IncrementChannelRouting(f.chanIdIn, { forward_fee_as_input: f.fee, latest_index_offset: f.offset })
|
||||
await this.storage.metricsStorage.IncrementChannelRouting(f.chanIdOut, { forward_fee_as_output: f.fee, latest_index_offset: f.offset })
|
||||
await this.storage.metricsStorage.IncrementChannelRouting(f.chanIdIn, { forward_fee_as_input: f.fee, latest_index_offset: f.offset, events_as_input: 1 })
|
||||
await this.storage.metricsStorage.IncrementChannelRouting(f.chanIdOut, { forward_fee_as_output: f.fee, latest_index_offset: f.offset, events_as_output: 1 })
|
||||
}))
|
||||
}
|
||||
|
||||
|
|
@ -176,7 +189,7 @@ export default class Handler {
|
|||
total_fees: totalFees,
|
||||
invoices: receivingInvoices.length,
|
||||
|
||||
operations:[]
|
||||
operations: []
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -207,54 +220,43 @@ export default class Handler {
|
|||
const { totalPendingOpen, totalPendingClose } = await this.GetPendingChannelsInfo()
|
||||
const { channels: closedChannels } = await this.lnd.ListClosedChannels()
|
||||
const rawRouting = await this.storage.metricsStorage.GetChannelRouting({ from: req.from_unix, to: req.to_unix })
|
||||
const routingMap: Record<string, Types.ChannelRouting> = {}
|
||||
let totalEvents = 0
|
||||
let totalFees = 0
|
||||
rawRouting.forEach(r => {
|
||||
if (!routingMap[r.channel_id]) {
|
||||
routingMap[r.channel_id] = {
|
||||
channel_id: r.channel_id,
|
||||
send_errors: 0,
|
||||
receive_errors: 0,
|
||||
forward_errors_as_input: 0,
|
||||
forward_errors_as_output: 0,
|
||||
missed_forward_fee_as_input: 0,
|
||||
missed_forward_fee_as_output: 0,
|
||||
forward_fee_as_input: 0,
|
||||
forward_fee_as_output: 0,
|
||||
events_number: 0
|
||||
}
|
||||
}
|
||||
routingMap[r.channel_id].send_errors += r.send_errors
|
||||
routingMap[r.channel_id].receive_errors += r.receive_errors
|
||||
routingMap[r.channel_id].forward_errors_as_input += r.forward_errors_as_input
|
||||
routingMap[r.channel_id].forward_errors_as_output += r.forward_errors_as_output
|
||||
routingMap[r.channel_id].missed_forward_fee_as_input += r.missed_forward_fee_as_input
|
||||
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_output += r.forward_fee_as_output
|
||||
routingMap[r.channel_id].events_number++
|
||||
totalEvents += r.events_as_input
|
||||
totalFees += r.forward_fee_as_input
|
||||
})
|
||||
const { channelsBalanceEvents, chainBalanceEvents } = await this.storage.metricsStorage.GetBalanceEvents({ from: req.from_unix, to: req.to_unix })
|
||||
const { chainBalanceEvents } = await this.storage.metricsStorage.GetBalanceEvents({ from: req.from_unix, to: req.to_unix })
|
||||
const chainBalance: Types.GraphPoint[] = []
|
||||
const chansBalance: Types.GraphPoint[] = []
|
||||
const externalBalance: Types.GraphPoint[] = []
|
||||
chainBalanceEvents.forEach(e => {
|
||||
if (chainBalance.length === 0 || chainBalance[chainBalance.length - 1].y !== e.total_chain_balance) {
|
||||
chainBalance.push({ x: e.block_height, y: e.total_chain_balance })
|
||||
}
|
||||
|
||||
if (chansBalance.length === 0 || chansBalance[chansBalance.length - 1].y !== e.channels_balance) {
|
||||
chansBalance.push({ x: e.block_height, y: e.channels_balance })
|
||||
}
|
||||
|
||||
if (externalBalance.length === 0 || externalBalance[externalBalance.length - 1].y !== e.external_balance) {
|
||||
externalBalance.push({ x: e.block_height, y: e.external_balance })
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
nodes: [{
|
||||
chain_balance_events: []/*chainBalanceEvents.map(e => ({
|
||||
block_height: e.block_height,
|
||||
confirmed_balance: e.confirmed_chain_balance,
|
||||
unconfirmed_balance: e.unconfirmed_chain_balance,
|
||||
total_balance: e.total_chain_balance
|
||||
}))*/,
|
||||
channels_balance_events: []/*channelsBalanceEvents.map(e => ({
|
||||
block_height: e.balance_event.block_height,
|
||||
channel_id: e.channel_id,
|
||||
local_balance_sats: e.local_balance_sats,
|
||||
remote_balance_sats: e.remote_balance_sats
|
||||
}))*/,
|
||||
chain_balance: chainBalance,
|
||||
channel_balance: chansBalance,
|
||||
external_balance: externalBalance,
|
||||
closing_channels: totalPendingClose,
|
||||
pending_channels: totalPendingOpen,
|
||||
offline_channels: totalInactive,
|
||||
online_channels: totalActive,
|
||||
closed_channels: closedChannels.map(c => ({ capacity: Number(c.capacity), channel_id: c.chanId, closed_height: c.closeHeight })),
|
||||
open_channels: openChannels.map(c => ({ active: c.active, capacity: Number(c.capacity), channel_id: c.chanId, lifetime: Number(c.lifetime), local_balance: Number(c.localBalance), remote_balance: Number(c.remoteBalance) })),
|
||||
channel_routing: Object.values(routingMap)
|
||||
open_channels: openChannels.map(c => ({ active: c.active, capacity: Number(c.capacity), channel_id: c.chanId, lifetime: Number(c.lifetime), local_balance: Number(c.localBalance), remote_balance: Number(c.remoteBalance), label: c.peerAlias })),
|
||||
forwarding_events: totalEvents,
|
||||
forwarding_fees: totalFees
|
||||
}],
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,9 @@ export default (mainHandler: Main): Types.ServerMethods => {
|
|||
GetLndMetrics: async ({ ctx, req }) => {
|
||||
return mainHandler.metricsManager.GetLndMetrics(req)
|
||||
},
|
||||
ListChannels: async ({ ctx }) => {
|
||||
return mainHandler.adminManager.ListChannels()
|
||||
},
|
||||
EncryptionExchange: async () => { },
|
||||
Health: async () => { await mainHandler.lnd.Health() },
|
||||
LndGetInfo: async ({ ctx }) => {
|
||||
|
|
|
|||
|
|
@ -17,6 +17,12 @@ export class BalanceEvent {
|
|||
@Column()
|
||||
total_chain_balance: number
|
||||
|
||||
@Column({ default: 0 })
|
||||
channels_balance: number
|
||||
|
||||
@Column({ default: 0 })
|
||||
external_balance: number
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,12 @@ export class ChannelRouting {
|
|||
@Column({ default: 0 })
|
||||
forward_fee_as_output: number
|
||||
|
||||
@Column({ default: 0 })
|
||||
events_as_output: number
|
||||
|
||||
@Column({ default: 0 })
|
||||
events_as_input: number
|
||||
|
||||
@Column({ default: 0 })
|
||||
latest_index_offset: number
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export class LiquidityStorage {
|
|||
}
|
||||
|
||||
async GetNoodeSeed(pubkey: string) {
|
||||
return this.DB.getRepository(LndNodeInfo).findOne({ where: { pubkey, seed:Not(IsNull()) } })
|
||||
return this.DB.getRepository(LndNodeInfo).findOne({ where: { pubkey, seed: Not(IsNull()) } })
|
||||
}
|
||||
|
||||
async SaveNodeSeed(pubkey: string, seed: string) {
|
||||
|
|
@ -43,6 +43,10 @@ export class LiquidityStorage {
|
|||
await this.txQueue.PushToQueue<LndNodeInfo>({ exec: async db => db.getRepository(LndNodeInfo).save(entry), dbTx: false })
|
||||
}
|
||||
|
||||
async GetTrackedProviders() {
|
||||
return this.DB.getRepository(TrackedProvider).find()
|
||||
}
|
||||
|
||||
async GetTrackedProvider(providerType: 'lnd' | 'lnPub', pub: string) {
|
||||
return this.DB.getRepository(TrackedProvider).findOne({ where: { provider_pubkey: pub, provider_type: providerType } })
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Between, DataSource, EntityManager, FindOperator, LessThanOrEqual, MoreThanOrEqual } from "typeorm"
|
||||
import { Between, DataSource, EntityManager, FindManyOptions, FindOperator, LessThanOrEqual, MoreThanOrEqual } from "typeorm"
|
||||
import { BalanceEvent } from "./entity/BalanceEvent.js"
|
||||
import { ChannelBalanceEvent } from "./entity/ChannelsBalanceEvent.js"
|
||||
import TransactionsQueue, { TX } from "./transactionsQueue.js";
|
||||
|
|
@ -32,11 +32,10 @@ export default class {
|
|||
async GetBalanceEvents({ from, to }: { from?: number, to?: number }, entityManager = this.DB) {
|
||||
const q = getTimeQuery({ from, to })
|
||||
|
||||
const [chainBalanceEvents, channelsBalanceEvents] = await Promise.all([
|
||||
const [chainBalanceEvents] = await Promise.all([
|
||||
entityManager.getRepository(BalanceEvent).find(q),
|
||||
entityManager.getRepository(ChannelBalanceEvent).find(q),
|
||||
])
|
||||
return { chainBalanceEvents, channelsBalanceEvents }
|
||||
return { chainBalanceEvents }
|
||||
}
|
||||
|
||||
async initChannelRoutingEvent(dayUnix: number, channelId: string) {
|
||||
|
|
@ -89,21 +88,25 @@ export default class {
|
|||
if (event.forward_fee_as_output) {
|
||||
await repo.increment({ day_unix: dayUnix, channel_id: channelId }, "forward_fee_as_output", event.forward_fee_as_output)
|
||||
}
|
||||
if (event.events_as_input) {
|
||||
await repo.increment({ day_unix: dayUnix, channel_id: channelId }, "events_as_input", event.events_as_input)
|
||||
}
|
||||
if (event.events_as_output) {
|
||||
await repo.increment({ day_unix: dayUnix, channel_id: channelId }, "events_as_output", event.events_as_output)
|
||||
}
|
||||
if (event.latest_index_offset) {
|
||||
await repo.update(existing.serial_id, { latest_index_offset: event.latest_index_offset })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getTimeQuery = ({ from, to }: { from?: number, to?: number }) => {
|
||||
const getTimeQuery = ({ from, to }: { from?: number, to?: number }): FindManyOptions<{ created_at: Date }> => {
|
||||
if (!!from && !!to) {
|
||||
return { where: { created_at: Between<Date>(new Date(from * 1000), new Date(to * 1000)) } }
|
||||
return { where: { created_at: Between<Date>(new Date(from * 1000), new Date(to * 1000)) }, order: { created_at: 'ASC' } }
|
||||
} else if (!!from) {
|
||||
return { where: { created_at: MoreThanOrEqual<Date>(new Date(from * 1000)) } }
|
||||
return { where: { created_at: MoreThanOrEqual<Date>(new Date(from * 1000)) }, order: { created_at: 'ASC' } }
|
||||
} else if (!!to) {
|
||||
return { where: { created_at: LessThanOrEqual<Date>(new Date(to * 1000)) } }
|
||||
return { where: { created_at: LessThanOrEqual<Date>(new Date(to * 1000)) }, order: { created_at: 'ASC' } }
|
||||
}
|
||||
return {}
|
||||
}
|
||||
|
|
|
|||
20
src/services/storage/migrations/1724266887195-htlc_count.ts
Normal file
20
src/services/storage/migrations/1724266887195-htlc_count.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class HtlcCount1724266887195 implements MigrationInterface {
|
||||
name = 'HtlcCount1724266887195'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`CREATE TABLE "temporary_channel_routing" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "day_unix" integer NOT NULL, "channel_id" varchar NOT NULL, "send_errors" integer NOT NULL DEFAULT (0), "receive_errors" integer NOT NULL DEFAULT (0), "forward_errors_as_input" integer NOT NULL DEFAULT (0), "forward_errors_as_output" integer NOT NULL DEFAULT (0), "missed_forward_fee_as_input" integer NOT NULL DEFAULT (0), "missed_forward_fee_as_output" integer NOT NULL DEFAULT (0), "forward_fee_as_input" integer NOT NULL DEFAULT (0), "forward_fee_as_output" integer NOT NULL DEFAULT (0), "latest_index_offset" integer NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "events_as_output" integer NOT NULL DEFAULT (0), "events_as_input" integer NOT NULL DEFAULT (0))`);
|
||||
await queryRunner.query(`INSERT INTO "temporary_channel_routing"("serial_id", "day_unix", "channel_id", "send_errors", "receive_errors", "forward_errors_as_input", "forward_errors_as_output", "missed_forward_fee_as_input", "missed_forward_fee_as_output", "forward_fee_as_input", "forward_fee_as_output", "latest_index_offset", "created_at", "updated_at") SELECT "serial_id", "day_unix", "channel_id", "send_errors", "receive_errors", "forward_errors_as_input", "forward_errors_as_output", "missed_forward_fee_as_input", "missed_forward_fee_as_output", "forward_fee_as_input", "forward_fee_as_output", "latest_index_offset", "created_at", "updated_at" FROM "channel_routing"`);
|
||||
await queryRunner.query(`DROP TABLE "channel_routing"`);
|
||||
await queryRunner.query(`ALTER TABLE "temporary_channel_routing" RENAME TO "channel_routing"`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "channel_routing" RENAME TO "temporary_channel_routing"`);
|
||||
await queryRunner.query(`CREATE TABLE "channel_routing" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "day_unix" integer NOT NULL, "channel_id" varchar NOT NULL, "send_errors" integer NOT NULL DEFAULT (0), "receive_errors" integer NOT NULL DEFAULT (0), "forward_errors_as_input" integer NOT NULL DEFAULT (0), "forward_errors_as_output" integer NOT NULL DEFAULT (0), "missed_forward_fee_as_input" integer NOT NULL DEFAULT (0), "missed_forward_fee_as_output" integer NOT NULL DEFAULT (0), "forward_fee_as_input" integer NOT NULL DEFAULT (0), "forward_fee_as_output" integer NOT NULL DEFAULT (0), "latest_index_offset" integer NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')))`);
|
||||
await queryRunner.query(`INSERT INTO "channel_routing"("serial_id", "day_unix", "channel_id", "send_errors", "receive_errors", "forward_errors_as_input", "forward_errors_as_output", "missed_forward_fee_as_input", "missed_forward_fee_as_output", "forward_fee_as_input", "forward_fee_as_output", "latest_index_offset", "created_at", "updated_at") SELECT "serial_id", "day_unix", "channel_id", "send_errors", "receive_errors", "forward_errors_as_input", "forward_errors_as_output", "missed_forward_fee_as_input", "missed_forward_fee_as_output", "forward_fee_as_input", "forward_fee_as_output", "latest_index_offset", "created_at", "updated_at" FROM "temporary_channel_routing"`);
|
||||
await queryRunner.query(`DROP TABLE "temporary_channel_routing"`);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class BalanceEvents1724860966825 implements MigrationInterface {
|
||||
name = 'BalanceEvents1724860966825'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`CREATE TABLE "temporary_balance_event" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "block_height" integer NOT NULL, "confirmed_chain_balance" integer NOT NULL, "unconfirmed_chain_balance" integer NOT NULL, "total_chain_balance" integer NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "channels_balance" integer NOT NULL DEFAULT (0), "external_balance" integer NOT NULL DEFAULT (0))`);
|
||||
await queryRunner.query(`INSERT INTO "temporary_balance_event"("serial_id", "block_height", "confirmed_chain_balance", "unconfirmed_chain_balance", "total_chain_balance", "created_at", "updated_at") SELECT "serial_id", "block_height", "confirmed_chain_balance", "unconfirmed_chain_balance", "total_chain_balance", "created_at", "updated_at" FROM "balance_event"`);
|
||||
await queryRunner.query(`DROP TABLE "balance_event"`);
|
||||
await queryRunner.query(`ALTER TABLE "temporary_balance_event" RENAME TO "balance_event"`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "balance_event" RENAME TO "temporary_balance_event"`);
|
||||
await queryRunner.query(`CREATE TABLE "balance_event" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "block_height" integer NOT NULL, "confirmed_chain_balance" integer NOT NULL, "unconfirmed_chain_balance" integer NOT NULL, "total_chain_balance" integer NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')))`);
|
||||
await queryRunner.query(`INSERT INTO "balance_event"("serial_id", "block_height", "confirmed_chain_balance", "unconfirmed_chain_balance", "total_chain_balance", "created_at", "updated_at") SELECT "serial_id", "block_height", "confirmed_chain_balance", "unconfirmed_chain_balance", "total_chain_balance", "created_at", "updated_at" FROM "temporary_balance_event"`);
|
||||
await queryRunner.query(`DROP TABLE "temporary_balance_event"`);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -10,8 +10,10 @@ import { LndNodeInfo1720187506189 } from './1720187506189-lnd_node_info.js'
|
|||
import { TrackedProvider1720814323679 } from './1720814323679-tracked_provider.js'
|
||||
import { CreateInviteTokenTable1721751414878 } from "./1721751414878-create_invite_token_table.js"
|
||||
import { PaymentIndex1721760297610 } from './1721760297610-payment_index.js'
|
||||
import { HtlcCount1724266887195 } from './1724266887195-htlc_count.js'
|
||||
import { BalanceEvents1724860966825 } from './1724860966825-balance_events.js'
|
||||
const allMigrations = [Initial1703170309875, LspOrder1718387847693, LiquidityProvider1719335699480, LndNodeInfo1720187506189, TrackedProvider1720814323679, CreateInviteTokenTable1721751414878, PaymentIndex1721760297610]
|
||||
const allMetricsMigrations = [LndMetrics1703170330183, ChannelRouting1709316653538]
|
||||
const allMetricsMigrations = [LndMetrics1703170330183, ChannelRouting1709316653538, HtlcCount1724266887195, BalanceEvents1724860966825]
|
||||
export const TypeOrmMigrationRunner = async (log: PubLogger, storageManager: Storage, settings: DbSettings, arg: string | undefined): Promise<boolean> => {
|
||||
if (arg === 'fake_initial_migration') {
|
||||
runFakeMigration(settings.databaseFile, [Initial1703170309875])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue