last seen inactive chan

This commit is contained in:
boufni95 2025-06-24 15:05:57 +00:00
parent 9f9a66a513
commit 67896c81ec
17 changed files with 162 additions and 27 deletions

View file

@ -1340,6 +1340,7 @@ The nostr server will send back a message response, and inside the body there wi
- __capacity__: _number_
- __channel_id__: _string_
- __channel_point__: _string_
- __inactive_since_unix__: _number_
- __label__: _string_
- __lifetime__: _number_
- __local_balance__: _number_

View file

@ -475,15 +475,16 @@ type OfferInvoices struct {
Invoices []OfferInvoice `json:"invoices"`
}
type OpenChannel struct {
Active bool `json:"active"`
Capacity int64 `json:"capacity"`
Channel_id string `json:"channel_id"`
Channel_point string `json:"channel_point"`
Label string `json:"label"`
Lifetime int64 `json:"lifetime"`
Local_balance int64 `json:"local_balance"`
Policy *ChannelPolicy `json:"policy"`
Remote_balance int64 `json:"remote_balance"`
Active bool `json:"active"`
Capacity int64 `json:"capacity"`
Channel_id string `json:"channel_id"`
Channel_point string `json:"channel_point"`
Inactive_since_unix int64 `json:"inactive_since_unix"`
Label string `json:"label"`
Lifetime int64 `json:"lifetime"`
Local_balance int64 `json:"local_balance"`
Policy *ChannelPolicy `json:"policy"`
Remote_balance int64 `json:"remote_balance"`
}
type OpenChannelRequest struct {
Close_address string `json:"close_address"`

View file

@ -2751,6 +2751,7 @@ export type OpenChannel = {
capacity: number
channel_id: string
channel_point: string
inactive_since_unix: number
label: string
lifetime: number
local_balance: number
@ -2765,6 +2766,7 @@ export type OpenChannelOptions = OptionsBaseMessage & {
capacity_CustomCheck?: (v: number) => boolean
channel_id_CustomCheck?: (v: string) => boolean
channel_point_CustomCheck?: (v: string) => boolean
inactive_since_unix_CustomCheck?: (v: number) => boolean
label_CustomCheck?: (v: string) => boolean
lifetime_CustomCheck?: (v: number) => boolean
local_balance_CustomCheck?: (v: number) => boolean
@ -2787,6 +2789,9 @@ export const OpenChannelValidate = (o?: OpenChannel, opts: OpenChannelOptions =
if (typeof o.channel_point !== 'string') return new Error(`${path}.channel_point: is not a string`)
if (opts.channel_point_CustomCheck && !opts.channel_point_CustomCheck(o.channel_point)) return new Error(`${path}.channel_point: custom check failed`)
if (typeof o.inactive_since_unix !== 'number') return new Error(`${path}.inactive_since_unix: is not a number`)
if (opts.inactive_since_unix_CustomCheck && !opts.inactive_since_unix_CustomCheck(o.inactive_since_unix)) return new Error(`${path}.inactive_since_unix: custom check failed`)
if (typeof o.label !== 'string') return new Error(`${path}.label: is not a string`)
if (opts.label_CustomCheck && !opts.label_CustomCheck(o.label)) return new Error(`${path}.label: custom check failed`)

View file

@ -184,12 +184,13 @@ message OpenChannel {
string channel_id = 1;
int64 capacity = 2;
bool active = 3;
int64 lifetime =4 ;
int64 lifetime =4;
int64 local_balance=5;
int64 remote_balance = 6;
string label = 7;
string channel_point = 8;
optional ChannelPolicy policy = 9;
int64 inactive_since_unix = 10;
}
message ClosedChannel {
string channel_id = 1;