LND API Methods Overview
Lightning Network API Methods
Info Methods
GetInfo
Retrieves general information about the node including identity pubkey, alias, network, and version.
GetNetworkInfo
Provides network-wide data like total number of nodes, channels, and network capacity.
ChannelBalance
Returns the sum of funds held in all open channels, distinguishing between local and remote balances.
WalletBalance
Shows wallet balance details including confirmed, unconfirmed, and locked funds.
Invoice Methods
AddInvoice
Creates a new Lightning invoice with specified amount, memo, and optional parameters.
CancelInvoice
Cancels an unpaid invoice to prevent it from being paid.
LookupInvoiceV2
Retrieves detailed information about a specific invoice by payment hash.
SubscribeSingleInvoice
Creates a real-time subscription for updates to a specific invoice.
SubscribeInvoices
Establishes a streaming connection to receive updates for all invoices.
ListInvoices
Returns a paginated list of all invoices, supporting filtering by payment status.
Payment Methods
DecodePayReq
Parses and decodes a BOLT11 payment request, showing destination, amount, and other encoded information.
DeleteAllPayments
Removes all payment records from the database, primarily used for testing or resetting state.
DeletePayment
Deletes a specific payment record from the database.
ListPayments
Returns a paginated list of all outgoing payments with detailed status information.
TrackPaymentV2
Provides real-time tracking of a specific payment attempt.
TrackPayments
Establishes a subscription to track the status of all payments.
SendPaymentV2
Sends a payment through the Lightning Network with advanced routing options.
Advanced Methods
Channel Management
ChannelAcceptor
Creates a bidirectional stream to accept or reject incoming channel open requests based on custom criteria.
CloseChannel
Initiates a cooperative or force close of an existing channel with a specified channel point.
ClosedChannels
Returns a list of all channels that have been closed, with details about the close type and transaction.
GetChanInfo
Retrieves detailed information about a specific channel using its channel ID.
ListChannels
Returns a list of all open channels with detailed information about capacity, balances, and state.
OpenChannelSync
Opens a new channel to a peer synchronously, blocking until the funding transaction is confirmed.
OpenChannel
Opens a new channel to a peer asynchronously, returning a stream of updates as the channel progresses.
PendingChannels
Lists all channels that are pending open, closing, or in other intermediate states.
SubscribeChannelEvents
Establishes a subscription to receive updates about channel lifecycle events.
On-Chain Methods
EstimateFee
Estimates the fee rate needed for a transaction to be confirmed within a target number of blocks.
GetTransactions
Retrieves a list of on-chain transactions that affect the wallet.
NewAddress
Generates a new address for receiving on-chain Bitcoin payments.
ListUnspent
Returns a list of all unspent transaction outputs (UTXOs) controlled by the wallet.
ListAddresses
Returns a list of all addresses that have been generated by the wallet.
SendCoins
Sends Bitcoin to a specified address, creating and broadcasting an on-chain transaction.
SendMany
Creates and broadcasts a transaction that sends to multiple addresses in a single operation.
SubscribeTransactions
Establishes a subscription to receive notifications about new on-chain transactions.
Peer Methods
ConnectPeer
Establishes a connection to a remote peer using their public key and network address.
DisconnectPeer
Disconnects from a connected peer, closing all channels if the force flag is set.
ListPeers
Returns a list of all connected peers with details about their connection and channels.
SubscribePeerEvents
Creates a subscription to receive updates about peer connection and disconnection events.
Routing Methods
BuildRoute
Manually constructs a route through the Lightning Network for payment delivery.
EstimateRouteFee
Estimates the fee required to send a specific amount of satoshis to a destination node.
SendToRouteV2
Sends a payment using a pre-defined route, bypassing the built-in pathfinding.
QueryRoutes
Finds potential routes through the network for sending a payment to a destination.
DescribeGraph
Returns a complete view of the network graph as known by the node.
HODL Invoices
AddHodlInvoice
Creates a hold invoice (also known as HODL invoice) that allows accepting payment without immediately settling it.
SettleInvoice
Settles a previously created hold invoice by revealing the preimage.