Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @core-ln/rest

Index

Enumerations

Classes

Interfaces

Type aliases

Functions

Type aliases

ConnectRequest: { id: string } | { host: string; id: string; port: number }

The connect RPC command establishes a new connection with another node in the Lightning Network.

id represents the target node's public key. As a convenience, id may be of the form id@host or id@host:port. In this case, the host and port parameters must be omitted.

host is the peer's hostname or IP address.

If not specified, the port depends on the current network:

  • bitcoin mainnet: 9735.
  • bitcoin testnet: 19735.
  • bitcoin signet: 39735.
  • bitcoin regtest: 19846.

If host is not specified (or doesn't work), the connection will be attempted to an IP belonging to id obtained through gossip with other already connected peers. This can fail if your C-lightning node is a fresh install that has not connected to any peers yet (your node has no gossip yet), or if the target id is a fresh install that has no channels yet (nobody will gossip about a node until it has one published channel).

If host begins with a * / * it is interpreted as a local path, and the connection will be made to that local socket (see bind-addr in lightningd-config(5)).

Connecting to a node is just the first step in opening a channel with another node. Once the peer is connected a channel can be opened with lightning-fundchannel(7).

If there are active channels with the peer, connect returns once all the subdaemons are in place to handle the channels, not just once it's connected.

DecodeResponse: ValidBolt12OfferDecodeResponse | InvalidBolt12OfferDecodeResponse | ValidBolt12InvoiceDecodeResponse | InvalidBolt12InvoiceDecodeResponse | ValidBolt12InvoiceRequestDecodeResponse | InvalidBolt12InvoiceRequestDecodeResponse | ValidBolt11InvoiceDecodeResponse | ValidRuneDecodeResponse | InvalidRuneDecodeResponse
ListfundsOutput: { address?: string; amount_msat: number; output: number; redeemscript?: string; scriptpubkey: string; txid: string } & ({ blockheight: number; status: Confirmed } | { blockheight: number; status: Unconfirmed | Spent }) & ({ reserved: false } | { reserved: true; reserved_to_block: number })
ListinvoicesInvoice: { amount_msat?: number; amount_received_msat: number; bolt11?: string; bolt12?: string; description?: string; expires_at: number; label: string; local_offer_id?: string; paid_at: number; pay_index: number; payer_note?: string; payment_hash: string; payment_preimage: string; status: Paid } | { amount_msat?: number; bolt11?: string; bolt12?: string; description?: string; expires_at: number; label: string; local_offer_id?: string; payer_note?: string; payment_hash: string; status: Expired | Unpaid }
ListpaysPay: { bolt11?: string; bolt12?: string; created_at: number; description?: string; destination?: string; label?: string; payment_hash: string } & ({ amount_msat: number; amount_sent_msat: string; status: Pending } | { amount_msat: number; amount_sent_msat: string; number_of_parts: number; preimage: string; status: Complete } | { erroronion: string; status: Failed })
ListpeersHtlc: { amount_msat: number; direction: Out; expiry: number; id: number; local_trimmed?: boolean; payment_hash: string; state: OutState; status?: string } | { amount_msat: number; direction: In; expiry: number; id: number; local_trimmed?: boolean; payment_hash: string; state: OutState; status?: string }
ListpeersLog: { num_skipped: number; type: Skipped } | { log: string; node_id: string; source: string; time: string; type: Broken | Unusual | Info | Debug } | { data: string; log: string; node_id: string; source: string; time: string; type: IoIn | IoOut }
ListpeersPeer: { channels: ListpeersChannel[]; connected: false; id: string; log?: ListpeersLog[] } | { channels: ListpeersChannel[]; connected: true; features: string; id: string; log?: ListpeersLog[]; netaddr: [string]; remote_addr: string }
ListsendpaysPayment: { amount_msat?: number; amount_sent_msat: number; bolt11?: string; bolt12?: string; created_at: number; description?: string; destination?: string; groupid?: number; id: number; label?: string; payment_hash: string } & ({ status: Pending } | { payment_preimage: string; status: Complete } | { erroronion: string; status: Failed })

Functions

  • transform<ReturnType>(data: any): ReturnType
  • Type parameters

    • ReturnType = unknown

    Parameters

    • data: any

    Returns ReturnType

Generated using TypeDoc