1
0
mirror of https://github.com/ACINQ/eclair.git synced 2024-11-20 10:39:19 +01:00
eclair/OLD-API-DOCS.md
araspitzu a4b94004e4 API: use form data instead of JSON-RPC (#894)
Port the existing API functionalities over a new structure of HTTP endpoints, with the biggest difference being the usage of **named parameters** for the requests (responses are unchanged). RPC methods have become endpoints and the parameters for each are now passed via form-params (clients must use the header "Content-Type" : "multipart/form-data"), this allows for a clearer interpretation of the parameters and results in more elegant parsing code on the server side. It is possible to still use the old API version via a configuration key.

Old API can be used by setting `eclair.api.use-old-api=true`.
2019-03-26 18:10:09 +01:00

5.9 KiB

JSON-RPC API

⚠️ Note this interface is being deprecated.

method params description
getinfo return basic node information (id, chain hash, current block height)
connect nodeId, host, port open a secure connection to a lightning node
connect uri open a secure connection to a lightning node
open nodeId, fundingSatoshis, pushMsat = 0, feerateSatPerByte = ?, channelFlags = 0x01 open a channel with another lightning node, by default push = 0, feerate for the funding tx targets 6 blocks, and channel is announced
updaterelayfee channelId, feeBaseMsat, feeProportionalMillionths update relay fee for payments going through this channel
peers list existing local peers
channels list existing local channels
channels nodeId list existing local channels opened with a particular nodeId
channel channelId retrieve detailed information about a given channel
channelstats retrieves statistics about channel usage (fees, number and average amount of payments)
allnodes list all known nodes
allchannels list all known channels
allupdates list all channels updates
allupdates nodeId list all channels updates for this nodeId
receive description generate a payment request without a required amount (can be useful for donations)
receive amountMsat, description generate a payment request for a given amount
receive amountMsat, description, expirySeconds generate a payment request for a given amount that expires after given number of seconds
parseinvoice paymentRequest returns node, amount and payment hash in a payment request
findroute paymentRequest returns nodes and channels of the route for this payment request if there is any
findroute paymentRequest, amountMsat returns nodes and channels of the route for this payment request and amount, if there is any
findroute nodeId, amountMsat returns nodes and channels of the route to the nodeId, if there is any
send amountMsat, paymentHash, nodeId send a payment to a lightning node
send paymentRequest send a payment to a lightning node using a BOLT11 payment request
send paymentRequest, amountMsat send a payment to a lightning node using a BOLT11 payment request and a custom amount
checkpayment paymentHash returns true if the payment has been received, false otherwise
checkpayment paymentRequest returns true if the payment has been received, false otherwise
close channelId close a channel
close channelId, scriptPubKey close a channel and send the funds to the given scriptPubKey
forceclose channelId force-close a channel by publishing the local commitment tx (careful: this is more expensive than a regular close and will incur a delay before funds are spendable)"
audit list all send/received/relayed payments
audit from, to list send/received/relayed payments in that interval (from <= timestamp < to)
networkfees list all network fees paid to the miners, by transaction
networkfees from, to list network fees paid to the miners, by transaction, in that interval (from <= timestamp < to)
help display available methods