You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1678 lines
58 KiB
1678 lines
58 KiB
8 years ago
|
syntax = "proto3";
|
||
|
|
||
7 years ago
|
// import "google/api/annotations.proto";
|
||
8 years ago
|
|
||
|
package lnrpc;
|
||
7 years ago
|
/**
|
||
|
* Comments in this file will be directly parsed into the API
|
||
|
* Documentation as descriptions of the associated method, message, or field.
|
||
|
* These descriptions should go right above the definition of the object, and
|
||
|
* can be in either block or /// comment format.
|
||
|
*
|
||
|
* One edge case exists where a // comment followed by a /// comment in the
|
||
|
* next line will cause the description not to show up in the documentation. In
|
||
|
* that instance, simply separate the two comments with a blank line.
|
||
|
*
|
||
|
* An RPC method can be matched to an lncli command by placing a line in the
|
||
|
* beginning of the description in exactly the following format:
|
||
|
* lncli: `methodname`
|
||
|
*
|
||
|
* Failure to specify the exact name of the command will cause documentation
|
||
|
* generation to fail.
|
||
|
*
|
||
|
* More information on how exactly the gRPC documentation is generated from
|
||
|
* this proto file can be found here:
|
||
|
* https://github.com/MaxFangX/lightning-api
|
||
|
*/
|
||
8 years ago
|
|
||
7 years ago
|
// The WalletUnlocker service is used to set up a wallet password for
|
||
|
// lnd at first startup, and unlock a previously set up wallet.
|
||
|
service WalletUnlocker {
|
||
7 years ago
|
/**
|
||
|
GenSeed is the first method that should be used to instantiate a new lnd
|
||
|
instance. This method allows a caller to generate a new aezeed cipher seed
|
||
|
given an optional passphrase. If provided, the passphrase will be necessary
|
||
|
to decrypt the cipherseed to expose the internal wallet seed.
|
||
|
|
||
|
Once the cipherseed is obtained and verified by the user, the InitWallet
|
||
|
method should be used to commit the newly generated seed, and create the
|
||
|
wallet.
|
||
7 years ago
|
*/
|
||
7 years ago
|
rpc GenSeed(GenSeedRequest) returns (GenSeedResponse) {
|
||
7 years ago
|
option (google.api.http) = {
|
||
7 years ago
|
get: "/v1/genseed"
|
||
|
};
|
||
|
}
|
||
|
|
||
7 years ago
|
/**
|
||
7 years ago
|
InitWallet is used when lnd is starting up for the first time to fully
|
||
|
initialize the daemon and its internal wallet. At the very least a wallet
|
||
|
password must be provided. This will be used to encrypt sensitive material
|
||
|
on disk.
|
||
|
|
||
|
In the case of a recovery scenario, the user can also specify their aezeed
|
||
|
mnemonic and passphrase. If set, then the daemon will use this prior state
|
||
|
to initialize its internal wallet.
|
||
|
|
||
|
Alternatively, this can be used along with the GenSeed RPC to obtain a
|
||
|
seed, then present it to the user. Once it has been verified by the user,
|
||
|
the seed can be fed into this RPC in order to commit the new wallet.
|
||
|
*/
|
||
|
rpc InitWallet(InitWalletRequest) returns (InitWalletResponse) {
|
||
|
option (google.api.http) = {
|
||
|
post: "/v1/initwallet"
|
||
7 years ago
|
body: "*"
|
||
|
};
|
||
|
}
|
||
|
|
||
|
/** lncli: `unlock`
|
||
|
UnlockWallet is used at startup of lnd to provide a password to unlock
|
||
|
the wallet database.
|
||
|
*/
|
||
|
rpc UnlockWallet(UnlockWalletRequest) returns (UnlockWalletResponse) {
|
||
|
option (google.api.http) = {
|
||
|
post: "/v1/unlockwallet"
|
||
|
body: "*"
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
7 years ago
|
message GenSeedRequest {
|
||
|
/**
|
||
|
aezeed_passphrase is an optional user provided passphrase that will be used
|
||
|
to encrypt the generated aezeed cipher seed.
|
||
|
*/
|
||
|
bytes aezeed_passphrase = 1;
|
||
|
|
||
|
/**
|
||
|
seed_entropy is an optional 16-bytes generated via CSPRNG. If not
|
||
|
specified, then a fresh set of randomness will be used to create the seed.
|
||
|
*/
|
||
|
bytes seed_entropy = 2;
|
||
7 years ago
|
}
|
||
7 years ago
|
message GenSeedResponse {
|
||
|
/**
|
||
|
cipher_seed_mnemonic is a 24-word mnemonic that encodes a prior aezeed
|
||
|
cipher seed obtained by the user. This field is optional, as if not
|
||
|
provided, then the daemon will generate a new cipher seed for the user.
|
||
|
Otherwise, then the daemon will attempt to recover the wallet state linked
|
||
|
to this cipher seed.
|
||
|
*/
|
||
|
repeated string cipher_seed_mnemonic = 1;
|
||
7 years ago
|
|
||
7 years ago
|
/**
|
||
|
enciphered_seed are the raw aezeed cipher seed bytes. This is the raw
|
||
|
cipher text before run through our mnemonic encoding scheme.
|
||
|
*/
|
||
|
bytes enciphered_seed = 2;
|
||
|
}
|
||
|
|
||
|
message InitWalletRequest {
|
||
|
/**
|
||
|
wallet_password is the passphrase that should be used to encrypt the
|
||
|
wallet. This MUST be at least 8 chars in length. After creation, this
|
||
|
password is required to unlock the daemon.
|
||
|
*/
|
||
|
bytes wallet_password = 1;
|
||
|
|
||
|
/**
|
||
|
cipher_seed_mnemonic is a 24-word mnemonic that encodes a prior aezeed
|
||
|
cipher seed obtained by the user. This may have been generated by the
|
||
|
GenSeed method, or be an existing seed.
|
||
|
*/
|
||
|
repeated string cipher_seed_mnemonic = 2;
|
||
|
|
||
|
/**
|
||
|
aezeed_passphrase is an optional user provided passphrase that will be used
|
||
|
to encrypt the generated aezeed cipher seed.
|
||
|
*/
|
||
|
bytes aezeed_passphrase = 3;
|
||
7 years ago
|
|
||
|
/**
|
||
|
recovery_window is an optional argument specifying the address lookahead
|
||
|
when restoring a wallet seed. The recovery window applies to each
|
||
|
invdividual branch of the BIP44 derivation paths. Supplying a recovery
|
||
|
window of zero indicates that no addresses should be recovered, such after
|
||
|
the first initialization of the wallet.
|
||
|
*/
|
||
|
int32 recovery_window = 4;
|
||
7 years ago
|
}
|
||
|
message InitWalletResponse {
|
||
|
}
|
||
7 years ago
|
|
||
|
message UnlockWalletRequest {
|
||
7 years ago
|
/**
|
||
|
wallet_password should be the current valid passphrase for the daemon. This
|
||
|
will be required to decrypt on-disk material that the daemon requires to
|
||
|
function properly.
|
||
|
*/
|
||
|
bytes wallet_password = 1;
|
||
7 years ago
|
|
||
|
/**
|
||
|
recovery_window is an optional argument specifying the address lookahead
|
||
|
when restoring a wallet seed. The recovery window applies to each
|
||
|
invdividual branch of the BIP44 derivation paths. Supplying a recovery
|
||
|
window of zero indicates that no addresses should be recovered, such after
|
||
|
the first initialization of the wallet.
|
||
|
*/
|
||
|
int32 recovery_window = 2;
|
||
7 years ago
|
}
|
||
|
message UnlockWalletResponse {}
|
||
|
|
||
8 years ago
|
service Lightning {
|
||
7 years ago
|
/** lncli: `walletbalance`
|
||
7 years ago
|
WalletBalance returns total unspent outputs(confirmed and unconfirmed), all
|
||
|
confirmed unspent outputs and all unconfirmed unspent outputs under control
|
||
7 years ago
|
of the wallet.
|
||
7 years ago
|
*/
|
||
8 years ago
|
rpc WalletBalance (WalletBalanceRequest) returns (WalletBalanceResponse) {
|
||
|
option (google.api.http) = {
|
||
|
get: "/v1/balance/blockchain"
|
||
|
};
|
||
|
}
|
||
7 years ago
|
|
||
|
/** lncli: `channelbalance`
|
||
|
ChannelBalance returns the total funds available across all open channels
|
||
|
in satoshis.
|
||
|
*/
|
||
8 years ago
|
rpc ChannelBalance (ChannelBalanceRequest) returns (ChannelBalanceResponse) {
|
||
|
option (google.api.http) = {
|
||
|
get: "/v1/balance/channels"
|
||
|
};
|
||
|
}
|
||
|
|
||
7 years ago
|
/** lncli: `listchaintxns`
|
||
|
GetTransactions returns a list describing all the known transactions
|
||
|
relevant to the wallet.
|
||
|
*/
|
||
8 years ago
|
rpc GetTransactions (GetTransactionsRequest) returns (TransactionDetails) {
|
||
|
option (google.api.http) = {
|
||
|
get: "/v1/transactions"
|
||
|
};
|
||
|
}
|
||
7 years ago
|
|
||
|
/** lncli: `sendcoins`
|
||
|
SendCoins executes a request to send coins to a particular address. Unlike
|
||
7 years ago
|
SendMany, this RPC call only allows creating a single output at a time. If
|
||
|
neither target_conf, or sat_per_byte are set, then the internal wallet will
|
||
|
consult its fee model to determine a fee for the default confirmation
|
||
|
target.
|
||
7 years ago
|
*/
|
||
8 years ago
|
rpc SendCoins (SendCoinsRequest) returns (SendCoinsResponse) {
|
||
|
option (google.api.http) = {
|
||
|
post: "/v1/transactions"
|
||
|
body: "*"
|
||
|
};
|
||
|
}
|
||
7 years ago
|
|
||
|
/**
|
||
|
SubscribeTransactions creates a uni-directional stream from the server to
|
||
|
the client in which any newly discovered transactions relevant to the
|
||
|
wallet are sent over.
|
||
|
*/
|
||
8 years ago
|
rpc SubscribeTransactions (GetTransactionsRequest) returns (stream Transaction);
|
||
|
|
||
7 years ago
|
/** lncli: `sendmany`
|
||
|
SendMany handles a request for a transaction that creates multiple specified
|
||
7 years ago
|
outputs in parallel. If neither target_conf, or sat_per_byte are set, then
|
||
|
the internal wallet will consult its fee model to determine a fee for the
|
||
|
default confirmation target.
|
||
7 years ago
|
*/
|
||
8 years ago
|
rpc SendMany (SendManyRequest) returns (SendManyResponse);
|
||
|
|
||
7 years ago
|
/** lncli: `newaddress`
|
||
|
NewAddress creates a new address under control of the local wallet.
|
||
|
*/
|
||
8 years ago
|
rpc NewAddress (NewAddressRequest) returns (NewAddressResponse);
|
||
7 years ago
|
|
||
|
/**
|
||
|
NewWitnessAddress creates a new witness address under control of the local wallet.
|
||
|
*/
|
||
8 years ago
|
rpc NewWitnessAddress (NewWitnessAddressRequest) returns (NewAddressResponse) {
|
||
|
option (google.api.http) = {
|
||
|
get: "/v1/newaddress"
|
||
|
};
|
||
|
}
|
||
|
|
||
7 years ago
|
/** lncli: `signmessage`
|
||
|
SignMessage signs a message with this node's private key. The returned
|
||
|
signature string is `zbase32` encoded and pubkey recoverable, meaning that
|
||
|
only the message digest and signature are needed for verification.
|
||
|
*/
|
||
8 years ago
|
rpc SignMessage (SignMessageRequest) returns (SignMessageResponse);
|
||
7 years ago
|
|
||
|
/** 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
|
||
|
channel database. In addition to returning the validity of the signature,
|
||
|
VerifyMessage also returns the recovered pubkey from the signature.
|
||
|
*/
|
||
8 years ago
|
rpc VerifyMessage (VerifyMessageRequest) returns (VerifyMessageResponse);
|
||
|
|
||
7 years ago
|
/** lncli: `connect`
|
||
|
ConnectPeer attempts to establish a connection to a remote peer. This is at
|
||
|
the networking level, and is used for communication between nodes. This is
|
||
|
distinct from establishing a channel with a peer.
|
||
|
*/
|
||
8 years ago
|
rpc ConnectPeer (ConnectPeerRequest) returns (ConnectPeerResponse) {
|
||
|
option (google.api.http) = {
|
||
|
post: "/v1/peers"
|
||
|
body: "*"
|
||
|
};
|
||
|
}
|
||
|
|
||
7 years ago
|
/** lncli: `disconnect`
|
||
|
DisconnectPeer attempts to disconnect one peer from another identified by a
|
||
|
given pubKey. In the case that we currently have a pending or active channel
|
||
|
with the target peer, then this action will be not be allowed.
|
||
|
*/
|
||
8 years ago
|
rpc DisconnectPeer (DisconnectPeerRequest) returns (DisconnectPeerResponse) {
|
||
|
option (google.api.http) = {
|
||
|
delete: "/v1/peers/{pub_key}"
|
||
|
};
|
||
|
}
|
||
|
|
||
7 years ago
|
/** lncli: `listpeers`
|
||
|
ListPeers returns a verbose listing of all currently active peers.
|
||
|
*/
|
||
8 years ago
|
rpc ListPeers (ListPeersRequest) returns (ListPeersResponse) {
|
||
|
option (google.api.http) = {
|
||
|
get: "/v1/peers"
|
||
|
};
|
||
|
}
|
||
7 years ago
|
|
||
|
/** lncli: `getinfo`
|
||
|
GetInfo returns general information concerning the lightning node including
|
||
|
it's identity pubkey, alias, the chains it is connected to, and information
|
||
|
concerning the number of open+pending channels.
|
||
|
*/
|
||
8 years ago
|
rpc GetInfo (GetInfoRequest) returns (GetInfoResponse) {
|
||
|
option (google.api.http) = {
|
||
|
get: "/v1/getinfo"
|
||
|
};
|
||
|
}
|
||
|
|
||
|
// TODO(roasbeef): merge with below with bool?
|
||
7 years ago
|
/** lncli: `pendingchannels`
|
||
|
PendingChannels returns a list of all the channels that are currently
|
||
|
considered "pending". A channel is pending if it has finished the funding
|
||
|
workflow and is waiting for confirmations for the funding txn, or is in the
|
||
|
process of closure, either initiated cooperatively or non-cooperatively.
|
||
|
*/
|
||
7 years ago
|
rpc PendingChannels (PendingChannelsRequest) returns (PendingChannelsResponse) {
|
||
8 years ago
|
option (google.api.http) = {
|
||
|
get: "/v1/channels/pending"
|
||
|
};
|
||
|
}
|
||
7 years ago
|
|
||
|
/** lncli: `listchannels`
|
||
|
ListChannels returns a description of all the open channels that this node
|
||
|
is a participant in.
|
||
|
*/
|
||
8 years ago
|
rpc ListChannels (ListChannelsRequest) returns (ListChannelsResponse) {
|
||
|
option (google.api.http) = {
|
||
|
get: "/v1/channels"
|
||
|
};
|
||
|
}
|
||
7 years ago
|
|
||
|
/**
|
||
|
OpenChannelSync is a synchronous version of the OpenChannel RPC call. This
|
||
|
call is meant to be consumed by clients to the REST proxy. As with all
|
||
|
other sync calls, all byte slices are intended to be populated as hex
|
||
|
encoded strings.
|
||
|
*/
|
||
8 years ago
|
rpc OpenChannelSync (OpenChannelRequest) returns (ChannelPoint) {
|
||
|
option (google.api.http) = {
|
||
|
post: "/v1/channels"
|
||
|
body: "*"
|
||
|
};
|
||
|
}
|
||
|
|
||
7 years ago
|
/** lncli: `openchannel`
|
||
|
OpenChannel attempts to open a singly funded channel specified in the
|
||
7 years ago
|
request to a remote peer. Users are able to specify a target number of
|
||
|
blocks that the funding transaction should be confirmed in, or a manual fee
|
||
|
rate to us for the funding transaction. If neither are specified, then a
|
||
|
lax block confirmation target is used.
|
||
7 years ago
|
*/
|
||
8 years ago
|
rpc OpenChannel (OpenChannelRequest) returns (stream OpenStatusUpdate);
|
||
|
|
||
7 years ago
|
/** lncli: `closechannel`
|
||
|
CloseChannel attempts to close an active channel identified by its channel
|
||
|
outpoint (ChannelPoint). The actions of this method can additionally be
|
||
|
augmented to attempt a force close after a timeout period in the case of an
|
||
7 years ago
|
inactive peer. If a non-force close (cooperative closure) is requested,
|
||
|
then the user can specify either a target number of blocks until the
|
||
|
closure transaction is confirmed, or a manual fee rate. If neither are
|
||
|
specified, then a default lax, block confirmation target is used.
|
||
7 years ago
|
*/
|
||
8 years ago
|
rpc CloseChannel (CloseChannelRequest) returns (stream CloseStatusUpdate) {
|
||
|
option (google.api.http) = {
|
||
7 years ago
|
delete: "/v1/channels/{channel_point.funding_txid_str}/{channel_point.output_index}"
|
||
8 years ago
|
};
|
||
|
}
|
||
|
|
||
7 years ago
|
/** lncli: `sendpayment`
|
||
|
SendPayment dispatches a bi-directional streaming RPC for sending payments
|
||
|
through the Lightning Network. A single RPC invocation creates a persistent
|
||
|
bi-directional stream allowing clients to rapidly send payments through the
|
||
|
Lightning Network with a single persistent connection.
|
||
|
*/
|
||
8 years ago
|
rpc SendPayment (stream SendRequest) returns (stream SendResponse);
|
||
|
|
||
7 years ago
|
/**
|
||
|
SendPaymentSync is the synchronous non-streaming version of SendPayment.
|
||
|
This RPC is intended to be consumed by clients of the REST proxy.
|
||
|
Additionally, this RPC expects the destination's public key and the payment
|
||
|
hash (if any) to be encoded as hex strings.
|
||
|
*/
|
||
8 years ago
|
rpc SendPaymentSync (SendRequest) returns (SendResponse) {
|
||
|
option (google.api.http) = {
|
||
|
post: "/v1/channels/transactions"
|
||
|
body: "*"
|
||
|
};
|
||
|
}
|
||
|
|
||
7 years ago
|
/** lncli: `addinvoice`
|
||
|
AddInvoice attempts to add a new invoice to the invoice database. Any
|
||
|
duplicated invoices are rejected, therefore all invoices *must* have a
|
||
|
unique payment preimage.
|
||
|
*/
|
||
8 years ago
|
rpc AddInvoice (Invoice) returns (AddInvoiceResponse) {
|
||
|
option (google.api.http) = {
|
||
|
post: "/v1/invoices"
|
||
|
body: "*"
|
||
|
};
|
||
|
}
|
||
7 years ago
|
|
||
|
/** lncli: `listinvoices`
|
||
|
ListInvoices returns a list of all the invoices currently stored within the
|
||
|
database. Any active debug invoices are ignored.
|
||
|
*/
|
||
8 years ago
|
rpc ListInvoices (ListInvoiceRequest) returns (ListInvoiceResponse) {
|
||
|
option (google.api.http) = {
|
||
7 years ago
|
get: "/v1/invoices"
|
||
8 years ago
|
};
|
||
|
}
|
||
7 years ago
|
|
||
|
/** lncli: `lookupinvoice`
|
||
7 years ago
|
LookupInvoice attempts to look up an invoice according to its payment hash.
|
||
7 years ago
|
The passed payment hash *must* be exactly 32 bytes, if not, an error is
|
||
|
returned.
|
||
|
*/
|
||
8 years ago
|
rpc LookupInvoice (PaymentHash) returns (Invoice) {
|
||
|
option (google.api.http) = {
|
||
7 years ago
|
get: "/v1/invoice/{r_hash_str}"
|
||
8 years ago
|
};
|
||
|
}
|
||
7 years ago
|
|
||
|
/**
|
||
|
SubscribeInvoices returns a uni-directional stream (sever -> client) for
|
||
|
notifying the client of newly added/settled invoices.
|
||
|
*/
|
||
8 years ago
|
rpc SubscribeInvoices (InvoiceSubscription) returns (stream Invoice) {
|
||
|
option (google.api.http) = {
|
||
|
get: "/v1/invoices/subscribe"
|
||
|
};
|
||
|
}
|
||
7 years ago
|
|
||
|
/** lncli: `decodepayreq`
|
||
|
DecodePayReq takes an encoded payment request string and attempts to decode
|
||
|
it, returning a full description of the conditions encoded within the
|
||
|
payment request.
|
||
|
*/
|
||
8 years ago
|
rpc DecodePayReq (PayReqString) returns (PayReq) {
|
||
|
option (google.api.http) = {
|
||
|
get: "/v1/payreq/{pay_req}"
|
||
|
};
|
||
|
}
|
||
|
|
||
7 years ago
|
/** lncli: `listpayments`
|
||
|
ListPayments returns a list of all outgoing payments.
|
||
|
*/
|
||
8 years ago
|
rpc ListPayments (ListPaymentsRequest) returns (ListPaymentsResponse) {
|
||
|
option (google.api.http) = {
|
||
|
get: "/v1/payments"
|
||
|
};
|
||
|
};
|
||
|
|
||
7 years ago
|
/**
|
||
|
DeleteAllPayments deletes all outgoing payments from DB.
|
||
|
*/
|
||
8 years ago
|
rpc DeleteAllPayments (DeleteAllPaymentsRequest) returns (DeleteAllPaymentsResponse) {
|
||
|
option (google.api.http) = {
|
||
|
delete: "/v1/payments"
|
||
|
};
|
||
|
};
|
||
|
|
||
7 years ago
|
/** lncli: `describegraph`
|
||
|
DescribeGraph returns a description of the latest graph state from the
|
||
|
point of view of the node. The graph information is partitioned into two
|
||
|
components: all the nodes/vertexes, and all the edges that connect the
|
||
|
vertexes themselves. As this is a directed graph, the edges also contain
|
||
|
the node directional specific routing policy which includes: the time lock
|
||
|
delta, fee information, etc.
|
||
|
*/
|
||
8 years ago
|
rpc DescribeGraph (ChannelGraphRequest) returns (ChannelGraph) {
|
||
|
option (google.api.http) = {
|
||
|
get: "/v1/graph"
|
||
|
};
|
||
|
}
|
||
|
|
||
7 years ago
|
/** lncli: `getchaninfo`
|
||
|
GetChanInfo returns the latest authenticated network announcement for the
|
||
|
given channel identified by its channel ID: an 8-byte integer which
|
||
|
uniquely identifies the location of transaction's funding output within the
|
||
|
blockchain.
|
||
|
*/
|
||
8 years ago
|
rpc GetChanInfo (ChanInfoRequest) returns (ChannelEdge) {
|
||
|
option (google.api.http) = {
|
||
|
get: "/v1/graph/edge/{chan_id}"
|
||
|
};
|
||
|
}
|
||
|
|
||
7 years ago
|
/** lncli: `getnodeinfo`
|
||
|
GetNodeInfo returns the latest advertised, aggregated, and authenticated
|
||
|
channel information for the specified node identified by its public key.
|
||
|
*/
|
||
8 years ago
|
rpc GetNodeInfo (NodeInfoRequest) returns (NodeInfo) {
|
||
|
option (google.api.http) = {
|
||
|
get: "/v1/graph/node/{pub_key}"
|
||
|
};
|
||
|
}
|
||
|
|
||
7 years ago
|
/** lncli: `queryroutes`
|
||
|
QueryRoutes attempts to query the daemon's Channel Router for a possible
|
||
|
route to a target destination capable of carrying a specific amount of
|
||
|
satoshis. The retuned route contains the full details required to craft and
|
||
|
send an HTLC, also including the necessary information that should be
|
||
7 years ago
|
present within the Sphinx packet encapsulated within the HTLC.
|
||
7 years ago
|
*/
|
||
8 years ago
|
rpc QueryRoutes(QueryRoutesRequest) returns (QueryRoutesResponse) {
|
||
|
option (google.api.http) = {
|
||
|
get: "/v1/graph/routes/{pub_key}/{amt}"
|
||
|
};
|
||
|
}
|
||
|
|
||
7 years ago
|
/** lncli: `getnetworkinfo`
|
||
|
GetNetworkInfo returns some basic stats about the known channel graph from
|
||
|
the point of view of the node.
|
||
|
*/
|
||
8 years ago
|
rpc GetNetworkInfo (NetworkInfoRequest) returns (NetworkInfo) {
|
||
|
option (google.api.http) = {
|
||
|
get: "/v1/graph/info"
|
||
|
};
|
||
|
}
|
||
|
|
||
7 years ago
|
/** lncli: `stop`
|
||
|
StopDaemon will send a shutdown request to the interrupt handler, triggering
|
||
|
a graceful shutdown of the daemon.
|
||
|
*/
|
||
8 years ago
|
rpc StopDaemon(StopRequest) returns (StopResponse);
|
||
|
|
||
7 years ago
|
/**
|
||
|
SubscribeChannelGraph launches a streaming RPC that allows the caller to
|
||
|
receive notifications upon any changes to the channel graph topology from
|
||
|
the point of view of the responding node. Events notified include: new
|
||
|
nodes coming online, nodes updating their authenticated attributes, new
|
||
|
channels being advertised, updates in the routing policy for a directional
|
||
|
channel edge, and when channels are closed on-chain.
|
||
|
*/
|
||
8 years ago
|
rpc SubscribeChannelGraph(GraphTopologySubscription) returns (stream GraphTopologyUpdate);
|
||
|
|
||
7 years ago
|
/** lncli: `debuglevel`
|
||
|
DebugLevel allows a caller to programmatically set the logging verbosity of
|
||
|
lnd. The logging can be targeted according to a coarse daemon-wide logging
|
||
|
level, or in a granular fashion to specify the logging for a target
|
||
|
sub-system.
|
||
|
*/
|
||
8 years ago
|
rpc DebugLevel (DebugLevelRequest) returns (DebugLevelResponse);
|
||
7 years ago
|
|
||
|
/** lncli: `feereport`
|
||
|
FeeReport allows the caller to obtain a report detailing the current fee
|
||
|
schedule enforced by the node globally for each channel.
|
||
|
*/
|
||
|
rpc FeeReport(FeeReportRequest) returns (FeeReportResponse) {
|
||
|
option (google.api.http) = {
|
||
|
get: "/v1/fees"
|
||
|
};
|
||
|
}
|
||
|
|
||
7 years ago
|
/** lncli: `updatechanpolicy`
|
||
|
UpdateChannelPolicy allows the caller to update the fee schedule and
|
||
|
channel policies for all channels globally, or a particular channel.
|
||
7 years ago
|
*/
|
||
7 years ago
|
rpc UpdateChannelPolicy(PolicyUpdateRequest) returns (PolicyUpdateResponse) {
|
||
7 years ago
|
option (google.api.http) = {
|
||
7 years ago
|
post: "/v1/chanpolicy"
|
||
7 years ago
|
body: "*"
|
||
|
};
|
||
|
}
|
||
7 years ago
|
|
||
|
/** lncli: `fwdinghistory`
|
||
|
ForwardingHistory allows the caller to query the htlcswitch for a record of
|
||
|
all HTLC's forwarded within the target time range, and integer offset
|
||
|
within that time range. If no time-range is specified, then the first chunk
|
||
|
of the past 24 hrs of forwarding history are returned.
|
||
|
|
||
|
A list of forwarding events are returned. The size of each forwarding event
|
||
|
is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB.
|
||
|
As a result each message can only contain 50k entries. Each response has
|
||
|
the index offset of the last entry. The index offset can be provided to the
|
||
|
request to allow the caller to skip a series of records.
|
||
|
*/
|
||
|
rpc ForwardingHistory(ForwardingHistoryRequest) returns (ForwardingHistoryResponse) {
|
||
|
option (google.api.http) = {
|
||
|
post: "/v1/switch"
|
||
|
body: "*"
|
||
|
};
|
||
|
};
|
||
8 years ago
|
}
|
||
|
|
||
|
message Transaction {
|
||
7 years ago
|
/// The transaction hash
|
||
8 years ago
|
string tx_hash = 1 [ json_name = "tx_hash" ];
|
||
7 years ago
|
|
||
|
/// The transaction ammount, denominated in satoshis
|
||
8 years ago
|
int64 amount = 2 [ json_name = "amount" ];
|
||
7 years ago
|
|
||
|
/// The number of confirmations
|
||
8 years ago
|
int32 num_confirmations = 3 [ json_name = "num_confirmations" ];
|
||
7 years ago
|
|
||
|
/// The hash of the block this transaction was included in
|
||
8 years ago
|
string block_hash = 4 [ json_name = "block_hash" ];
|
||
7 years ago
|
|
||
|
/// The height of the block this transaction was included in
|
||
8 years ago
|
int32 block_height = 5 [ json_name = "block_height" ];
|
||
7 years ago
|
|
||
|
/// Timestamp of this transaction
|
||
8 years ago
|
int64 time_stamp = 6 [ json_name = "time_stamp" ];
|
||
7 years ago
|
|
||
|
/// Fees paid for this transaction
|
||
8 years ago
|
int64 total_fees = 7 [ json_name = "total_fees" ];
|
||
7 years ago
|
|
||
|
/// Addresses that received funds for this transaction
|
||
|
repeated string dest_addresses = 8 [ json_name = "dest_addresses" ];
|
||
8 years ago
|
}
|
||
|
message GetTransactionsRequest {
|
||
|
}
|
||
|
message TransactionDetails {
|
||
7 years ago
|
/// The list of transactions relevant to the wallet.
|
||
8 years ago
|
repeated Transaction transactions = 1 [json_name = "transactions"];
|
||
|
}
|
||
|
|
||
|
message SendRequest {
|
||
7 years ago
|
/// The identity pubkey of the payment recipient
|
||
8 years ago
|
bytes dest = 1;
|
||
7 years ago
|
|
||
|
/// The hex-encoded identity pubkey of the payment recipient
|
||
8 years ago
|
string dest_string = 2;
|
||
|
|
||
7 years ago
|
/// Number of satoshis to send.
|
||
8 years ago
|
int64 amt = 3;
|
||
|
|
||
7 years ago
|
/// The hash to use within the payment's HTLC
|
||
8 years ago
|
bytes payment_hash = 4;
|
||
7 years ago
|
|
||
|
/// The hex-encoded hash to use within the payment's HTLC
|
||
8 years ago
|
string payment_hash_string = 5;
|
||
|
|
||
7 years ago
|
/**
|
||
|
A bare-bones invoice for a payment within the Lightning Network. With the
|
||
|
details of the invoice, the sender has all the data necessary to send a
|
||
|
payment to the recipient.
|
||
|
*/
|
||
8 years ago
|
string payment_request = 6;
|
||
7 years ago
|
|
||
|
/// The CLTV delta from the current height that should be used to set the timelock for the final hop.
|
||
|
int32 final_cltv_delta = 7;
|
||
8 years ago
|
}
|
||
|
message SendResponse {
|
||
|
string payment_error = 1 [json_name = "payment_error"];
|
||
|
bytes payment_preimage = 2 [json_name = "payment_preimage"];
|
||
|
Route payment_route = 3 [json_name = "payment_route"];
|
||
|
}
|
||
|
|
||
|
message ChannelPoint {
|
||
7 years ago
|
oneof funding_txid {
|
||
|
/// Txid of the funding transaction
|
||
|
bytes funding_txid_bytes = 1 [json_name = "funding_txid_bytes"];
|
||
7 years ago
|
|
||
7 years ago
|
/// Hex-encoded string representing the funding transaction
|
||
|
string funding_txid_str = 2 [json_name = "funding_txid_str"];
|
||
|
}
|
||
7 years ago
|
|
||
|
/// The index of the output of the funding transaction
|
||
7 years ago
|
uint32 output_index = 3 [json_name = "output_index"];
|
||
8 years ago
|
}
|
||
|
|
||
|
message LightningAddress {
|
||
7 years ago
|
/// The identity pubkey of the Lightning node
|
||
8 years ago
|
string pubkey = 1 [json_name = "pubkey"];
|
||
7 years ago
|
|
||
|
/// The network location of the lightning node, e.g. `69.69.69.69:1337` or `localhost:10011`
|
||
8 years ago
|
string host = 2 [json_name = "host"];
|
||
|
}
|
||
|
|
||
|
message SendManyRequest {
|
||
7 years ago
|
/// The map from addresses to amounts
|
||
8 years ago
|
map<string, int64> AddrToAmount = 1;
|
||
7 years ago
|
|
||
|
/// The target number of blocks that this transaction should be confirmed by.
|
||
|
int32 target_conf = 3;
|
||
|
|
||
|
/// A manual fee rate set in sat/byte that should be used when crafting the transaction.
|
||
|
int64 sat_per_byte = 5;
|
||
8 years ago
|
}
|
||
|
message SendManyResponse {
|
||
7 years ago
|
/// The id of the transaction
|
||
8 years ago
|
string txid = 1 [json_name = "txid"];
|
||
|
}
|
||
|
|
||
|
message SendCoinsRequest {
|
||
7 years ago
|
/// The address to send coins to
|
||
8 years ago
|
string addr = 1;
|
||
7 years ago
|
|
||
|
/// The amount in satoshis to send
|
||
8 years ago
|
int64 amount = 2;
|
||
7 years ago
|
|
||
|
/// The target number of blocks that this transaction should be confirmed by.
|
||
|
int32 target_conf = 3;
|
||
|
|
||
|
/// A manual fee rate set in sat/byte that should be used when crafting the transaction.
|
||
|
int64 sat_per_byte = 5;
|
||
8 years ago
|
}
|
||
|
message SendCoinsResponse {
|
||
7 years ago
|
/// The transaction ID of the transaction
|
||
8 years ago
|
string txid = 1 [json_name = "txid"];
|
||
|
}
|
||
|
|
||
7 years ago
|
/**
|
||
|
`AddressType` has to be one of:
|
||
|
|
||
|
- `p2wkh`: Pay to witness key hash (`WITNESS_PUBKEY_HASH` = 0)
|
||
|
- `np2wkh`: Pay to nested witness key hash (`NESTED_PUBKEY_HASH` = 1)
|
||
|
- `p2pkh`: Pay to public key hash (`PUBKEY_HASH` = 2)
|
||
|
*/
|
||
8 years ago
|
message NewAddressRequest {
|
||
|
enum AddressType {
|
||
|
WITNESS_PUBKEY_HASH = 0;
|
||
|
NESTED_PUBKEY_HASH = 1;
|
||
|
}
|
||
7 years ago
|
|
||
|
/// The address type
|
||
8 years ago
|
AddressType type = 1;
|
||
|
}
|
||
7 years ago
|
|
||
8 years ago
|
message NewWitnessAddressRequest {
|
||
|
}
|
||
7 years ago
|
|
||
8 years ago
|
message NewAddressResponse {
|
||
7 years ago
|
/// The newly generated wallet address
|
||
8 years ago
|
string address = 1 [json_name = "address"];
|
||
|
}
|
||
|
|
||
|
message SignMessageRequest {
|
||
7 years ago
|
/// The message to be signed
|
||
8 years ago
|
bytes msg = 1 [ json_name = "msg" ];
|
||
|
}
|
||
|
message SignMessageResponse {
|
||
7 years ago
|
/// The signature for the given message
|
||
8 years ago
|
string signature = 1 [ json_name = "signature" ];
|
||
|
}
|
||
|
|
||
|
message VerifyMessageRequest {
|
||
7 years ago
|
/// The message over which the signature is to be verified
|
||
8 years ago
|
bytes msg = 1 [ json_name = "msg" ];
|
||
7 years ago
|
|
||
7 years ago
|
/// The signature to be verified over the given message
|
||
8 years ago
|
string signature = 2 [ json_name = "signature" ];
|
||
|
}
|
||
|
message VerifyMessageResponse {
|
||
7 years ago
|
/// Whether the signature was valid over the given message
|
||
8 years ago
|
bool valid = 1 [ json_name = "valid" ];
|
||
7 years ago
|
|
||
|
/// The pubkey recovered from the signature
|
||
8 years ago
|
string pubkey = 2 [ json_name = "pubkey" ];
|
||
|
}
|
||
|
|
||
|
message ConnectPeerRequest {
|
||
7 years ago
|
/// Lightning address of the peer, in the format `<pubkey>@host`
|
||
8 years ago
|
LightningAddress addr = 1;
|
||
7 years ago
|
|
||
|
/** If set, the daemon will attempt to persistently connect to the target
|
||
|
* peer. Otherwise, the call will be synchronous. */
|
||
8 years ago
|
bool perm = 2;
|
||
|
}
|
||
|
message ConnectPeerResponse {
|
||
|
}
|
||
|
|
||
|
message DisconnectPeerRequest {
|
||
7 years ago
|
/// The pubkey of the node to disconnect from
|
||
8 years ago
|
string pub_key = 1 [json_name = "pub_key"];
|
||
|
}
|
||
|
message DisconnectPeerResponse {
|
||
|
}
|
||
|
|
||
|
message HTLC {
|
||
|
bool incoming = 1 [json_name = "incoming"];
|
||
|
int64 amount = 2 [json_name = "amount"];
|
||
|
bytes hash_lock = 3 [json_name = "hash_lock"];
|
||
|
uint32 expiration_height = 4 [json_name = "expiration_height"];
|
||
|
}
|
||
|
|
||
7 years ago
|
message Channel {
|
||
7 years ago
|
/// Whether this channel is active or not
|
||
8 years ago
|
bool active = 1 [json_name = "active"];
|
||
7 years ago
|
|
||
|
/// The identity pubkey of the remote node
|
||
8 years ago
|
string remote_pubkey = 2 [json_name = "remote_pubkey"];
|
||
7 years ago
|
|
||
|
/**
|
||
|
The outpoint (txid:index) of the funding transaction. With this value, Bob
|
||
|
will be able to generate a signature for Alice's version of the commitment
|
||
|
transaction.
|
||
|
*/
|
||
8 years ago
|
string channel_point = 3 [json_name = "channel_point"];
|
||
7 years ago
|
|
||
|
/**
|
||
|
The unique channel ID for the channel. The first 3 bytes are the block
|
||
|
height, the next 3 the index within the block, and the last 2 bytes are the
|
||
|
output index for the channel.
|
||
|
*/
|
||
8 years ago
|
uint64 chan_id = 4 [json_name = "chan_id"];
|
||
|
|
||
7 years ago
|
/// The total amount of funds held in this channel
|
||
8 years ago
|
int64 capacity = 5 [json_name = "capacity"];
|
||
7 years ago
|
|
||
|
/// This node's current balance in this channel
|
||
8 years ago
|
int64 local_balance = 6 [json_name = "local_balance"];
|
||
7 years ago
|
|
||
|
/// The counterparty's current balance in this channel
|
||
8 years ago
|
int64 remote_balance = 7 [json_name = "remote_balance"];
|
||
|
|
||
7 years ago
|
/**
|
||
|
The amount calculated to be paid in fees for the current set of commitment
|
||
|
transactions. The fee amount is persisted with the channel in order to
|
||
|
allow the fee amount to be removed and recalculated with each channel state
|
||
|
update, including updates that happen after a system restart.
|
||
|
*/
|
||
8 years ago
|
int64 commit_fee = 8 [json_name = "commit_fee"];
|
||
7 years ago
|
|
||
|
/// The weight of the commitment transaction
|
||
7 years ago
|
int64 commit_weight = 9 [json_name = "commit_weight"];
|
||
7 years ago
|
|
||
|
/**
|
||
|
The required number of satoshis per kilo-weight that the requester will pay
|
||
|
at all times, for both the funding transaction and commitment transaction.
|
||
|
This value can later be updated once the channel is open.
|
||
|
*/
|
||
8 years ago
|
int64 fee_per_kw = 10 [json_name = "fee_per_kw"];
|
||
|
|
||
7 years ago
|
/// The unsettled balance in this channel
|
||
8 years ago
|
int64 unsettled_balance = 11 [json_name = "unsettled_balance"];
|
||
7 years ago
|
|
||
|
/**
|
||
|
The total number of satoshis we've sent within this channel.
|
||
|
*/
|
||
8 years ago
|
int64 total_satoshis_sent = 12 [json_name = "total_satoshis_sent"];
|
||
7 years ago
|
|
||
|
/**
|
||
|
The total number of satoshis we've received within this channel.
|
||
|
*/
|
||
8 years ago
|
int64 total_satoshis_received = 13 [json_name = "total_satoshis_received"];
|
||
7 years ago
|
|
||
|
/**
|
||
|
The total number of updates conducted within this channel.
|
||
|
*/
|
||
8 years ago
|
uint64 num_updates = 14 [json_name = "num_updates"];
|
||
|
|
||
7 years ago
|
/**
|
||
|
The list of active, uncleared HTLCs currently pending within the channel.
|
||
|
*/
|
||
8 years ago
|
repeated HTLC pending_htlcs = 15 [json_name = "pending_htlcs"];
|
||
7 years ago
|
|
||
|
/**
|
||
|
The CSV delay expressed in relative blocks. If the channel is force
|
||
|
closed, we'll need to wait for this many blocks before we can regain our
|
||
|
funds.
|
||
|
*/
|
||
7 years ago
|
uint32 csv_delay = 16 [json_name = "csv_delay"];
|
||
|
|
||
|
/// Whether this channel is advertised to the network or not
|
||
|
bool private = 17 [json_name = "private"];
|
||
8 years ago
|
}
|
||
|
|
||
|
message ListChannelsRequest {
|
||
7 years ago
|
bool active_only = 1;
|
||
|
bool inactive_only = 2;
|
||
|
bool public_only = 3;
|
||
|
bool private_only = 4;
|
||
8 years ago
|
}
|
||
|
message ListChannelsResponse {
|
||
7 years ago
|
/// The list of active channels
|
||
7 years ago
|
repeated Channel channels = 11 [json_name = "channels"];
|
||
8 years ago
|
}
|
||
|
|
||
|
message Peer {
|
||
7 years ago
|
/// The identity pubkey of the peer
|
||
8 years ago
|
string pub_key = 1 [json_name = "pub_key"];
|
||
7 years ago
|
|
||
|
/// Network address of the peer; eg `127.0.0.1:10011`
|
||
8 years ago
|
string address = 3 [json_name = "address"];
|
||
|
|
||
7 years ago
|
/// Bytes of data transmitted to this peer
|
||
8 years ago
|
uint64 bytes_sent = 4 [json_name = "bytes_sent"];
|
||
7 years ago
|
|
||
|
/// Bytes of data transmitted from this peer
|
||
8 years ago
|
uint64 bytes_recv = 5 [json_name = "bytes_recv"];
|
||
|
|
||
7 years ago
|
/// Satoshis sent to this peer
|
||
8 years ago
|
int64 sat_sent = 6 [json_name = "sat_sent"];
|
||
7 years ago
|
|
||
|
/// Satoshis received from this peer
|
||
8 years ago
|
int64 sat_recv = 7 [json_name = "sat_recv"];
|
||
|
|
||
7 years ago
|
/// A channel is inbound if the counterparty initiated the channel
|
||
8 years ago
|
bool inbound = 8 [json_name = "inbound"];
|
||
|
|
||
7 years ago
|
/// Ping time to this peer
|
||
8 years ago
|
int64 ping_time = 9 [json_name = "ping_time"];
|
||
|
}
|
||
|
|
||
|
message ListPeersRequest {
|
||
|
}
|
||
|
message ListPeersResponse {
|
||
7 years ago
|
/// The list of currently connected peers
|
||
8 years ago
|
repeated Peer peers = 1 [json_name = "peers"];
|
||
|
}
|
||
|
|
||
|
message GetInfoRequest {
|
||
|
}
|
||
|
message GetInfoResponse {
|
||
7 years ago
|
|
||
|
/// The identity pubkey of the current node.
|
||
8 years ago
|
string identity_pubkey = 1 [json_name = "identity_pubkey"];
|
||
7 years ago
|
|
||
|
/// If applicable, the alias of the current node, e.g. "bob"
|
||
8 years ago
|
string alias = 2 [json_name = "alias"];
|
||
|
|
||
7 years ago
|
/// Number of pending channels
|
||
8 years ago
|
uint32 num_pending_channels = 3 [json_name = "num_pending_channels"];
|
||
7 years ago
|
|
||
|
/// Number of active channels
|
||
8 years ago
|
uint32 num_active_channels = 4 [json_name = "num_active_channels"];
|
||
|
|
||
7 years ago
|
/// Number of peers
|
||
8 years ago
|
uint32 num_peers = 5 [json_name = "num_peers"];
|
||
|
|
||
7 years ago
|
/// The node's current view of the height of the best block
|
||
8 years ago
|
uint32 block_height = 6 [json_name = "block_height"];
|
||
7 years ago
|
|
||
|
/// The node's current view of the hash of the best block
|
||
8 years ago
|
string block_hash = 8 [json_name = "block_hash"];
|
||
|
|
||
7 years ago
|
/// Whether the wallet's view is synced to the main chain
|
||
7 years ago
|
bool synced_to_chain = 9 [json_name = "synced_to_chain"];
|
||
7 years ago
|
|
||
|
/// Whether the current node is connected to testnet
|
||
7 years ago
|
bool testnet = 10 [json_name = "testnet"];
|
||
8 years ago
|
|
||
7 years ago
|
/// A list of active chains the node is connected to
|
||
7 years ago
|
repeated string chains = 11 [json_name = "chains"];
|
||
|
|
||
|
/// The URIs of the current node.
|
||
|
repeated string uris = 12 [json_name = "uris"];
|
||
7 years ago
|
|
||
|
/// Timestamp of the block best known to the wallet
|
||
|
int64 best_header_timestamp = 13 [ json_name = "best_header_timestamp" ];
|
||
7 years ago
|
|
||
|
/// The version of the LND software that the node is running.
|
||
|
string version = 14 [ json_name = "version" ];
|
||
|
|
||
8 years ago
|
}
|
||
|
|
||
|
message ConfirmationUpdate {
|
||
|
bytes block_sha = 1;
|
||
|
int32 block_height = 2;
|
||
|
|
||
|
uint32 num_confs_left = 3;
|
||
|
}
|
||
|
|
||
|
message ChannelOpenUpdate {
|
||
|
ChannelPoint channel_point = 1 [json_name = "channel_point"];
|
||
|
}
|
||
|
|
||
|
message ChannelCloseUpdate {
|
||
|
bytes closing_txid = 1 [json_name = "closing_txid"];
|
||
|
|
||
|
bool success = 2 [json_name = "success"];
|
||
|
}
|
||
|
|
||
|
message CloseChannelRequest {
|
||
7 years ago
|
/**
|
||
|
The outpoint (txid:index) of the funding transaction. With this value, Bob
|
||
|
will be able to generate a signature for Alice's version of the commitment
|
||
|
transaction.
|
||
|
*/
|
||
8 years ago
|
ChannelPoint channel_point = 1;
|
||
7 years ago
|
|
||
|
/// If true, then the channel will be closed forcibly. This means the current commitment transaction will be signed and broadcast.
|
||
|
bool force = 2;
|
||
7 years ago
|
|
||
|
/// The target number of blocks that the closure transaction should be confirmed by.
|
||
|
int32 target_conf = 3;
|
||
|
|
||
|
/// A manual fee rate set in sat/byte that should be used when crafting the closure transaction.
|
||
7 years ago
|
int64 sat_per_byte = 4;
|
||
8 years ago
|
}
|
||
7 years ago
|
|
||
8 years ago
|
message CloseStatusUpdate {
|
||
|
oneof update {
|
||
|
PendingUpdate close_pending = 1 [json_name = "close_pending"];
|
||
|
ConfirmationUpdate confirmation = 2 [json_name = "confirmation"];
|
||
|
ChannelCloseUpdate chan_close = 3 [json_name = "chan_close"];
|
||
|
}
|
||
|
}
|
||
|
|
||
|
message PendingUpdate {
|
||
|
bytes txid = 1 [json_name = "txid"];
|
||
|
uint32 output_index = 2 [json_name = "output_index"];
|
||
|
}
|
||
|
|
||
|
message OpenChannelRequest {
|
||
7 years ago
|
|
||
|
/// The pubkey of the node to open a channel with
|
||
8 years ago
|
bytes node_pubkey = 2 [json_name = "node_pubkey"];
|
||
7 years ago
|
|
||
7 years ago
|
/// The hex encoded pubkey of the node to open a channel with
|
||
8 years ago
|
string node_pubkey_string = 3 [json_name = "node_pubkey_string"];
|
||
|
|
||
7 years ago
|
/// The number of satoshis the wallet should commit to the channel
|
||
8 years ago
|
int64 local_funding_amount = 4 [json_name = "local_funding_amount"];
|
||
|
|
||
7 years ago
|
/// The number of satoshis to push to the remote side as part of the initial commitment state
|
||
|
int64 push_sat = 5 [json_name = "push_sat"];
|
||
7 years ago
|
|
||
7 years ago
|
/// The target number of blocks that the funding transaction should be confirmed by.
|
||
7 years ago
|
int32 target_conf = 6;
|
||
|
|
||
7 years ago
|
/// A manual fee rate set in sat/byte that should be used when crafting the funding transaction.
|
||
7 years ago
|
int64 sat_per_byte = 7;
|
||
|
|
||
|
/// Whether this channel should be private, not announced to the greater network.
|
||
|
bool private = 8 [json_name = "private"];
|
||
|
|
||
|
/// The minimum value in millisatoshi we will require for incoming HTLCs on the channel.
|
||
|
int64 min_htlc_msat = 9 [json_name = "min_htlc_msat"];
|
||
7 years ago
|
|
||
|
/// The delay we require on the remote's commitment transaction. If this is not set, it will be scaled automatically with the channel size.
|
||
|
uint32 remote_csv_delay = 10 [json_name = "remote_csv_delay"];
|
||
8 years ago
|
}
|
||
|
message OpenStatusUpdate {
|
||
|
oneof update {
|
||
|
PendingUpdate chan_pending = 1 [json_name = "chan_pending"];
|
||
|
ConfirmationUpdate confirmation = 2 [json_name = "confirmation"];
|
||
|
ChannelOpenUpdate chan_open = 3 [json_name = "chan_open"];
|
||
|
}
|
||
|
}
|
||
|
|
||
7 years ago
|
message PendingHTLC {
|
||
|
|
||
|
/// The direction within the channel that the htlc was sent
|
||
|
bool incoming = 1 [ json_name = "incoming" ];
|
||
|
|
||
|
/// The total value of the htlc
|
||
|
int64 amount = 2 [ json_name = "amount" ];
|
||
|
|
||
|
/// The final output to be swept back to the user's wallet
|
||
|
string outpoint = 3 [ json_name = "outpoint" ];
|
||
|
|
||
|
/// The next block height at which we can spend the current stage
|
||
|
uint32 maturity_height = 4 [ json_name = "maturity_height" ];
|
||
|
|
||
|
/**
|
||
|
The number of blocks remaining until the current stage can be swept.
|
||
|
Negative values indicate how many blocks have passed since becoming
|
||
|
mature.
|
||
|
*/
|
||
|
int32 blocks_til_maturity = 5 [ json_name = "blocks_til_maturity" ];
|
||
|
|
||
|
/// Indicates whether the htlc is in its first or second stage of recovery
|
||
|
uint32 stage = 6 [ json_name = "stage" ];
|
||
|
}
|
||
|
|
||
|
message PendingChannelsRequest {}
|
||
|
message PendingChannelsResponse {
|
||
8 years ago
|
message PendingChannel {
|
||
|
string remote_node_pub = 1 [ json_name = "remote_node_pub" ];
|
||
|
string channel_point = 2 [ json_name = "channel_point" ];
|
||
|
|
||
|
int64 capacity = 3 [ json_name = "capacity" ];
|
||
|
|
||
|
int64 local_balance = 4 [ json_name = "local_balance" ];
|
||
|
int64 remote_balance = 5 [ json_name = "remote_balance" ];
|
||
|
}
|
||
|
|
||
|
message PendingOpenChannel {
|
||
7 years ago
|
/// The pending channel
|
||
8 years ago
|
PendingChannel channel = 1 [ json_name = "channel" ];
|
||
|
|
||
7 years ago
|
/// The height at which this channel will be confirmed
|
||
8 years ago
|
uint32 confirmation_height = 2 [ json_name = "confirmation_height" ];
|
||
7 years ago
|
|
||
|
/**
|
||
|
The amount calculated to be paid in fees for the current set of
|
||
|
commitment transactions. The fee amount is persisted with the channel
|
||
|
in order to allow the fee amount to be removed and recalculated with
|
||
|
each channel state update, including updates that happen after a system
|
||
|
restart.
|
||
|
*/
|
||
8 years ago
|
int64 commit_fee = 4 [json_name = "commit_fee" ];
|
||
7 years ago
|
|
||
|
/// The weight of the commitment transaction
|
||
8 years ago
|
int64 commit_weight = 5 [ json_name = "commit_weight" ];
|
||
7 years ago
|
|
||
|
/**
|
||
|
The required number of satoshis per kilo-weight that the requester will
|
||
|
pay at all times, for both the funding transaction and commitment
|
||
|
transaction. This value can later be updated once the channel is open.
|
||
|
*/
|
||
8 years ago
|
int64 fee_per_kw = 6 [ json_name = "fee_per_kw" ];
|
||
|
}
|
||
|
|
||
7 years ago
|
message WaitingCloseChannel {
|
||
|
/// The pending channel waiting for closing tx to confirm
|
||
|
PendingChannel channel = 1;
|
||
|
|
||
|
/// The balance in satoshis encumbered in this channel
|
||
|
int64 limbo_balance = 2 [ json_name = "limbo_balance" ];
|
||
|
}
|
||
|
|
||
8 years ago
|
message ClosedChannel {
|
||
7 years ago
|
/// The pending channel to be closed
|
||
8 years ago
|
PendingChannel channel = 1;
|
||
|
|
||
7 years ago
|
/// The transaction id of the closing transaction
|
||
8 years ago
|
string closing_txid = 2 [ json_name = "closing_txid" ];
|
||
|
}
|
||
|
|
||
|
message ForceClosedChannel {
|
||
7 years ago
|
/// The pending channel to be force closed
|
||
8 years ago
|
PendingChannel channel = 1 [ json_name = "channel" ];
|
||
|
|
||
7 years ago
|
/// The transaction id of the closing transaction
|
||
8 years ago
|
string closing_txid = 2 [ json_name = "closing_txid" ];
|
||
|
|
||
7 years ago
|
/// The balance in satoshis encumbered in this pending channel
|
||
8 years ago
|
int64 limbo_balance = 3 [ json_name = "limbo_balance" ];
|
||
7 years ago
|
|
||
|
/// The height at which funds can be sweeped into the wallet
|
||
8 years ago
|
uint32 maturity_height = 4 [ json_name = "maturity_height" ];
|
||
7 years ago
|
|
||
7 years ago
|
/*
|
||
|
Remaining # of blocks until the commitment output can be swept.
|
||
|
Negative values indicate how many blocks have passed since becoming
|
||
|
mature.
|
||
|
*/
|
||
|
int32 blocks_til_maturity = 5 [ json_name = "blocks_til_maturity" ];
|
||
|
|
||
|
/// The total value of funds successfully recovered from this channel
|
||
|
int64 recovered_balance = 6 [ json_name = "recovered_balance" ];
|
||
|
|
||
|
repeated PendingHTLC pending_htlcs = 8 [ json_name = "pending_htlcs" ];
|
||
8 years ago
|
}
|
||
|
|
||
7 years ago
|
/// The balance in satoshis encumbered in pending channels
|
||
8 years ago
|
int64 total_limbo_balance = 1 [ json_name = "total_limbo_balance" ];
|
||
7 years ago
|
|
||
|
/// Channels pending opening
|
||
8 years ago
|
repeated PendingOpenChannel pending_open_channels = 2 [ json_name = "pending_open_channels" ];
|
||
7 years ago
|
|
||
|
/// Channels pending closing
|
||
8 years ago
|
repeated ClosedChannel pending_closing_channels = 3 [ json_name = "pending_closing_channels" ];
|
||
7 years ago
|
|
||
|
/// Channels pending force closing
|
||
8 years ago
|
repeated ForceClosedChannel pending_force_closing_channels = 4 [ json_name = "pending_force_closing_channels" ];
|
||
7 years ago
|
|
||
|
/// Channels waiting for closing tx to confirm
|
||
|
repeated WaitingCloseChannel waiting_close_channels = 5 [ json_name = "waiting_close_channels" ];
|
||
8 years ago
|
}
|
||
|
|
||
|
message WalletBalanceRequest {
|
||
|
}
|
||
|
message WalletBalanceResponse {
|
||
7 years ago
|
/// The balance of the wallet
|
||
7 years ago
|
int64 total_balance = 1 [json_name = "total_balance"];
|
||
|
|
||
|
/// The confirmed balance of a wallet(with >= 1 confirmations)
|
||
|
int64 confirmed_balance = 2 [json_name = "confirmed_balance"];
|
||
|
|
||
|
/// The unconfirmed balance of a wallet(with 0 confirmations)
|
||
|
int64 unconfirmed_balance = 3 [json_name = "unconfirmed_balance"];
|
||
8 years ago
|
}
|
||
|
|
||
|
message ChannelBalanceRequest {
|
||
|
}
|
||
|
message ChannelBalanceResponse {
|
||
7 years ago
|
/// Sum of channels balances denominated in satoshis
|
||
8 years ago
|
int64 balance = 1 [json_name = "balance"];
|
||
7 years ago
|
|
||
|
/// Sum of channels pending balances denominated in satoshis
|
||
|
int64 pending_open_balance = 2 [json_name = "pending_open_balance"];
|
||
8 years ago
|
}
|
||
|
|
||
|
message QueryRoutesRequest {
|
||
7 years ago
|
/// The 33-byte hex-encoded public key for the payment destination
|
||
8 years ago
|
string pub_key = 1;
|
||
7 years ago
|
|
||
|
/// The amount to send expressed in satoshis
|
||
8 years ago
|
int64 amt = 2;
|
||
7 years ago
|
|
||
|
/// The max number of routes to return.
|
||
|
int32 num_routes = 3;
|
||
8 years ago
|
}
|
||
|
message QueryRoutesResponse {
|
||
|
repeated Route routes = 1 [ json_name = "routes"];
|
||
|
}
|
||
|
|
||
|
message Hop {
|
||
7 years ago
|
/**
|
||
|
The unique channel ID for the channel. The first 3 bytes are the block
|
||
|
height, the next 3 the index within the block, and the last 2 bytes are the
|
||
|
output index for the channel.
|
||
|
*/
|
||
8 years ago
|
uint64 chan_id = 1 [json_name = "chan_id"];
|
||
|
int64 chan_capacity = 2 [json_name = "chan_capacity"];
|
||
7 years ago
|
int64 amt_to_forward = 3 [json_name = "amt_to_forward", deprecated = true];
|
||
|
int64 fee = 4 [json_name = "fee", deprecated = true];
|
||
7 years ago
|
uint32 expiry = 5 [json_name = "expiry"];
|
||
7 years ago
|
int64 amt_to_forward_msat = 6 [json_name = "amt_to_forward_msat"];
|
||
|
int64 fee_msat = 7 [json_name = "fee_msat"];
|
||
8 years ago
|
}
|
||
|
|
||
7 years ago
|
/**
|
||
|
A path through the channel graph which runs over one or more channels in
|
||
|
succession. This struct carries all the information required to craft the
|
||
|
Sphinx onion packet, and send the payment along the first hop in the path. A
|
||
|
route is only selected as valid if all the channels have sufficient capacity to
|
||
|
carry the initial payment amount after fees are accounted for.
|
||
|
*/
|
||
8 years ago
|
message Route {
|
||
7 years ago
|
|
||
|
/**
|
||
|
The cumulative (final) time lock across the entire route. This is the CLTV
|
||
|
value that should be extended to the first hop in the route. All other hops
|
||
|
will decrement the time-lock as advertised, leaving enough time for all
|
||
|
hops to wait for or present the payment preimage to complete the payment.
|
||
|
*/
|
||
8 years ago
|
uint32 total_time_lock = 1 [json_name = "total_time_lock"];
|
||
7 years ago
|
|
||
|
/**
|
||
|
The sum of the fees paid at each hop within the final route. In the case
|
||
|
of a one-hop payment, this value will be zero as we don't need to pay a fee
|
||
|
it ourself.
|
||
|
*/
|
||
7 years ago
|
int64 total_fees = 2 [json_name = "total_fees", deprecated = true];
|
||
7 years ago
|
|
||
|
/**
|
||
|
The total amount of funds required to complete a payment over this route.
|
||
|
This value includes the cumulative fees at each hop. As a result, the HTLC
|
||
|
extended to the first-hop in the route will need to have at least this many
|
||
|
satoshis, otherwise the route will fail at an intermediate node due to an
|
||
|
insufficient amount of fees.
|
||
|
*/
|
||
7 years ago
|
int64 total_amt = 3 [json_name = "total_amt", deprecated = true];
|
||
8 years ago
|
|
||
7 years ago
|
/**
|
||
|
Contains details concerning the specific forwarding details at each hop.
|
||
|
*/
|
||
8 years ago
|
repeated Hop hops = 4 [json_name = "hops"];
|
||
7 years ago
|
|
||
|
/**
|
||
|
The total fees in millisatoshis.
|
||
|
*/
|
||
|
int64 total_fees_msat = 5 [json_name = "total_fees_msat"];
|
||
|
|
||
|
/**
|
||
|
The total amount in millisatoshis.
|
||
|
*/
|
||
|
int64 total_amt_msat = 6 [json_name = "total_amt_msat"];
|
||
8 years ago
|
}
|
||
|
|
||
|
message NodeInfoRequest {
|
||
7 years ago
|
/// The 33-byte hex-encoded compressed public of the target node
|
||
8 years ago
|
string pub_key = 1;
|
||
|
}
|
||
|
|
||
|
message NodeInfo {
|
||
7 years ago
|
|
||
|
/**
|
||
|
An individual vertex/node within the channel graph. A node is
|
||
|
connected to other nodes by one or more channel edges emanating from it. As
|
||
|
the graph is directed, a node will also have an incoming edge attached to
|
||
|
it for each outgoing edge.
|
||
|
*/
|
||
8 years ago
|
LightningNode node = 1 [json_name = "node"];
|
||
|
|
||
|
uint32 num_channels = 2 [json_name = "num_channels"];
|
||
|
int64 total_capacity = 3 [json_name = "total_capacity"];
|
||
|
}
|
||
|
|
||
7 years ago
|
/**
|
||
|
An individual vertex/node within the channel graph. A node is
|
||
|
connected to other nodes by one or more channel edges emanating from it. As the
|
||
|
graph is directed, a node will also have an incoming edge attached to it for
|
||
|
each outgoing edge.
|
||
|
*/
|
||
8 years ago
|
message LightningNode {
|
||
|
uint32 last_update = 1 [ json_name = "last_update" ];
|
||
|
string pub_key = 2 [ json_name = "pub_key" ];
|
||
|
string alias = 3 [ json_name = "alias" ];
|
||
|
repeated NodeAddress addresses = 4 [ json_name = "addresses" ];
|
||
7 years ago
|
string color = 5 [ json_name = "color" ];
|
||
8 years ago
|
}
|
||
|
|
||
|
message NodeAddress {
|
||
|
string network = 1 [ json_name = "network" ];
|
||
|
string addr = 2 [ json_name = "addr" ];
|
||
|
}
|
||
|
|
||
|
message RoutingPolicy {
|
||
|
uint32 time_lock_delta = 1 [json_name = "time_lock_delta"];
|
||
|
int64 min_htlc = 2 [json_name = "min_htlc"];
|
||
|
int64 fee_base_msat = 3 [json_name = "fee_base_msat"];
|
||
|
int64 fee_rate_milli_msat = 4 [json_name = "fee_rate_milli_msat"];
|
||
|
}
|
||
|
|
||
7 years ago
|
/**
|
||
|
A fully authenticated channel along with all its unique attributes.
|
||
|
Once an authenticated channel announcement has been processed on the network,
|
||
7 years ago
|
then an instance of ChannelEdgeInfo encapsulating the channels attributes is
|
||
7 years ago
|
stored. The other portions relevant to routing policy of a channel are stored
|
||
|
within a ChannelEdgePolicy for each direction of the channel.
|
||
|
*/
|
||
8 years ago
|
message ChannelEdge {
|
||
7 years ago
|
|
||
|
/**
|
||
|
The unique channel ID for the channel. The first 3 bytes are the block
|
||
|
height, the next 3 the index within the block, and the last 2 bytes are the
|
||
|
output index for the channel.
|
||
|
*/
|
||
8 years ago
|
uint64 channel_id = 1 [json_name = "channel_id"];
|
||
|
string chan_point = 2 [json_name = "chan_point"];
|
||
|
|
||
|
uint32 last_update = 3 [json_name = "last_update"];
|
||
|
|
||
|
string node1_pub = 4 [json_name = "node1_pub"];
|
||
|
string node2_pub = 5 [json_name = "node2_pub"];
|
||
|
|
||
|
int64 capacity = 6 [json_name = "capacity"];
|
||
|
|
||
|
RoutingPolicy node1_policy = 7 [json_name = "node1_policy"];
|
||
|
RoutingPolicy node2_policy = 8 [json_name = "node2_policy"];
|
||
|
}
|
||
|
|
||
|
message ChannelGraphRequest {
|
||
|
}
|
||
|
|
||
7 years ago
|
/// Returns a new instance of the directed channel graph.
|
||
8 years ago
|
message ChannelGraph {
|
||
7 years ago
|
/// The list of `LightningNode`s in this channel graph
|
||
8 years ago
|
repeated LightningNode nodes = 1 [json_name = "nodes"];
|
||
7 years ago
|
|
||
|
/// The list of `ChannelEdge`s in this channel graph
|
||
8 years ago
|
repeated ChannelEdge edges = 2 [json_name = "edges"];
|
||
|
}
|
||
|
|
||
|
message ChanInfoRequest {
|
||
7 years ago
|
/**
|
||
|
The unique channel ID for the channel. The first 3 bytes are the block
|
||
|
height, the next 3 the index within the block, and the last 2 bytes are the
|
||
|
output index for the channel.
|
||
|
*/
|
||
8 years ago
|
uint64 chan_id = 1;
|
||
|
}
|
||
|
|
||
|
message NetworkInfoRequest {
|
||
|
}
|
||
|
message NetworkInfo {
|
||
|
uint32 graph_diameter = 1 [json_name = "graph_diameter"];
|
||
|
double avg_out_degree = 2 [json_name = "avg_out_degree"];
|
||
|
uint32 max_out_degree = 3 [json_name = "max_out_degree"];
|
||
|
|
||
|
uint32 num_nodes = 4 [json_name = "num_nodes"];
|
||
|
uint32 num_channels = 5 [json_name = "num_channels"];
|
||
|
|
||
|
int64 total_network_capacity = 6 [json_name = "total_network_capacity"];
|
||
|
|
||
|
double avg_channel_size = 7 [json_name = "avg_channel_size"];
|
||
|
int64 min_channel_size = 8 [json_name = "min_channel_size"];
|
||
|
int64 max_channel_size = 9 [json_name = "max_channel_size"];
|
||
|
|
||
|
// TODO(roasbeef): fee rate info, expiry
|
||
|
// * also additional RPC for tracking fee info once in
|
||
|
}
|
||
|
|
||
|
message StopRequest{}
|
||
|
message StopResponse{}
|
||
|
|
||
|
message GraphTopologySubscription {}
|
||
|
message GraphTopologyUpdate {
|
||
|
repeated NodeUpdate node_updates = 1;
|
||
|
repeated ChannelEdgeUpdate channel_updates = 2;
|
||
|
repeated ClosedChannelUpdate closed_chans = 3;
|
||
|
}
|
||
|
message NodeUpdate {
|
||
|
repeated string addresses = 1;
|
||
|
string identity_key = 2;
|
||
|
bytes global_features = 3;
|
||
|
string alias = 4;
|
||
|
}
|
||
|
message ChannelEdgeUpdate {
|
||
7 years ago
|
/**
|
||
|
The unique channel ID for the channel. The first 3 bytes are the block
|
||
|
height, the next 3 the index within the block, and the last 2 bytes are the
|
||
|
output index for the channel.
|
||
|
*/
|
||
8 years ago
|
uint64 chan_id = 1;
|
||
|
|
||
|
ChannelPoint chan_point = 2;
|
||
|
|
||
|
int64 capacity = 3;
|
||
|
|
||
|
RoutingPolicy routing_policy = 4;
|
||
|
|
||
|
string advertising_node = 5;
|
||
|
string connecting_node = 6;
|
||
|
}
|
||
|
message ClosedChannelUpdate {
|
||
7 years ago
|
/**
|
||
|
The unique channel ID for the channel. The first 3 bytes are the block
|
||
|
height, the next 3 the index within the block, and the last 2 bytes are the
|
||
|
output index for the channel.
|
||
|
*/
|
||
8 years ago
|
uint64 chan_id = 1;
|
||
|
int64 capacity = 2;
|
||
|
uint32 closed_height = 3;
|
||
|
ChannelPoint chan_point = 4;
|
||
|
}
|
||
|
|
||
7 years ago
|
message HopHint {
|
||
|
/// The public key of the node at the start of the channel.
|
||
|
string node_id = 1 [json_name = "node_id"];
|
||
|
|
||
|
/// The unique identifier of the channel.
|
||
|
uint64 chan_id = 2 [json_name = "chan_id"];
|
||
|
|
||
|
/// The base fee of the channel denominated in millisatoshis.
|
||
|
uint32 fee_base_msat = 3 [json_name = "fee_base_msat"];
|
||
|
|
||
|
/**
|
||
|
The fee rate of the channel for sending one satoshi across it denominated in
|
||
|
millionths of a satoshi.
|
||
|
*/
|
||
|
uint32 fee_proportional_millionths = 4 [json_name = "fee_proportional_millionths"];
|
||
|
|
||
|
/// The time-lock delta of the channel.
|
||
|
uint32 cltv_expiry_delta = 5 [json_name = "cltv_expiry_delta"];
|
||
|
}
|
||
|
|
||
|
message RouteHint {
|
||
|
/**
|
||
|
A list of hop hints that when chained together can assist in reaching a
|
||
|
specific destination.
|
||
|
*/
|
||
|
repeated HopHint hop_hints = 1 [json_name = "hop_hints"];
|
||
|
}
|
||
|
|
||
8 years ago
|
message Invoice {
|
||
7 years ago
|
/**
|
||
|
An optional memo to attach along with the invoice. Used for record keeping
|
||
|
purposes for the invoice's creator, and will also be set in the description
|
||
|
field of the encoded payment request if the description_hash field is not
|
||
|
being used.
|
||
|
*/
|
||
8 years ago
|
string memo = 1 [json_name = "memo"];
|
||
7 years ago
|
|
||
|
/// An optional cryptographic receipt of payment
|
||
8 years ago
|
bytes receipt = 2 [json_name = "receipt"];
|
||
|
|
||
7 years ago
|
/**
|
||
|
The hex-encoded preimage (32 byte) which will allow settling an incoming
|
||
|
HTLC payable to this preimage
|
||
|
*/
|
||
8 years ago
|
bytes r_preimage = 3 [json_name = "r_preimage"];
|
||
7 years ago
|
|
||
|
/// The hash of the preimage
|
||
8 years ago
|
bytes r_hash = 4 [json_name = "r_hash"];
|
||
|
|
||
7 years ago
|
/// The value of this invoice in satoshis
|
||
8 years ago
|
int64 value = 5 [json_name = "value"];
|
||
|
|
||
7 years ago
|
/// Whether this invoice has been fulfilled
|
||
8 years ago
|
bool settled = 6 [json_name = "settled"];
|
||
|
|
||
7 years ago
|
/// When this invoice was created
|
||
8 years ago
|
int64 creation_date = 7 [json_name = "creation_date"];
|
||
7 years ago
|
|
||
|
/// When this invoice was settled
|
||
8 years ago
|
int64 settle_date = 8 [json_name = "settle_date"];
|
||
|
|
||
7 years ago
|
/**
|
||
|
A bare-bones invoice for a payment within the Lightning Network. With the
|
||
|
details of the invoice, the sender has all the data necessary to send a
|
||
|
payment to the recipient.
|
||
|
*/
|
||
8 years ago
|
string payment_request = 9 [json_name = "payment_request"];
|
||
7 years ago
|
|
||
|
/**
|
||
|
Hash (SHA-256) of a description of the payment. Used if the description of
|
||
|
payment (memo) is too long to naturally fit within the description field
|
||
|
of an encoded payment request.
|
||
|
*/
|
||
|
bytes description_hash = 10 [json_name = "description_hash"];
|
||
|
|
||
|
/// Payment request expiry time in seconds. Default is 3600 (1 hour).
|
||
|
int64 expiry = 11 [json_name = "expiry"];
|
||
|
|
||
|
/// Fallback on-chain address.
|
||
|
string fallback_addr = 12 [json_name = "fallback_addr"];
|
||
7 years ago
|
|
||
|
/// Delta to use for the time-lock of the CLTV extended to the final hop.
|
||
|
uint64 cltv_expiry = 13 [json_name = "cltv_expiry"];
|
||
7 years ago
|
|
||
|
/**
|
||
|
Route hints that can each be individually used to assist in reaching the
|
||
|
invoice's destination.
|
||
|
*/
|
||
|
repeated RouteHint route_hints = 14 [json_name = "route_hints"];
|
||
|
|
||
|
/// Whether this invoice should include routing hints for private channels.
|
||
|
bool private = 15 [json_name = "private"];
|
||
8 years ago
|
}
|
||
|
message AddInvoiceResponse {
|
||
|
bytes r_hash = 1 [json_name = "r_hash"];
|
||
|
|
||
7 years ago
|
/**
|
||
|
A bare-bones invoice for a payment within the Lightning Network. With the
|
||
|
details of the invoice, the sender has all the data necessary to send a
|
||
|
payment to the recipient.
|
||
|
*/
|
||
8 years ago
|
string payment_request = 2 [json_name = "payment_request"];
|
||
|
}
|
||
|
message PaymentHash {
|
||
7 years ago
|
/**
|
||
|
The hex-encoded payment hash of the invoice to be looked up. The passed
|
||
|
payment hash must be exactly 32 bytes, otherwise an error is returned.
|
||
|
*/
|
||
8 years ago
|
string r_hash_str = 1 [json_name = "r_hash_str"];
|
||
7 years ago
|
|
||
|
/// The payment hash of the invoice to be looked up.
|
||
8 years ago
|
bytes r_hash = 2 [json_name = "r_hash"];
|
||
|
}
|
||
|
message ListInvoiceRequest {
|
||
7 years ago
|
/// Toggles if all invoices should be returned, or only those that are currently unsettled.
|
||
8 years ago
|
bool pending_only = 1;
|
||
|
}
|
||
|
message ListInvoiceResponse {
|
||
|
repeated Invoice invoices = 1 [json_name = "invoices"];
|
||
|
}
|
||
|
|
||
|
message InvoiceSubscription {
|
||
|
}
|
||
|
|
||
|
|
||
|
message Payment {
|
||
7 years ago
|
/// The payment hash
|
||
8 years ago
|
string payment_hash = 1 [json_name = "payment_hash"];
|
||
7 years ago
|
|
||
7 years ago
|
/// The value of the payment in satoshis
|
||
8 years ago
|
int64 value = 2 [json_name = "value"];
|
||
|
|
||
7 years ago
|
/// The date of this payment
|
||
8 years ago
|
int64 creation_date = 3 [json_name = "creation_date"];
|
||
|
|
||
7 years ago
|
/// The path this payment took
|
||
8 years ago
|
repeated string path = 4 [ json_name = "path" ];
|
||
|
|
||
7 years ago
|
/// The fee paid for this payment in satoshis
|
||
8 years ago
|
int64 fee = 5 [json_name = "fee"];
|
||
7 years ago
|
|
||
|
/// The payment preimage
|
||
|
string payment_preimage = 6 [json_name = "payment_preimage"];
|
||
8 years ago
|
}
|
||
|
|
||
|
message ListPaymentsRequest {
|
||
|
}
|
||
|
|
||
|
message ListPaymentsResponse {
|
||
7 years ago
|
/// The list of payments
|
||
8 years ago
|
repeated Payment payments = 1 [json_name = "payments"];
|
||
|
}
|
||
|
|
||
|
message DeleteAllPaymentsRequest {
|
||
|
}
|
||
|
|
||
|
message DeleteAllPaymentsResponse {
|
||
|
}
|
||
|
|
||
|
message DebugLevelRequest {
|
||
|
bool show = 1;
|
||
|
string level_spec = 2;
|
||
|
}
|
||
|
message DebugLevelResponse {
|
||
|
string sub_systems = 1 [json_name = "sub_systems"];
|
||
|
}
|
||
|
|
||
|
message PayReqString {
|
||
7 years ago
|
/// The payment request string to be decoded
|
||
8 years ago
|
string pay_req = 1;
|
||
|
}
|
||
|
message PayReq {
|
||
|
string destination = 1 [json_name = "destination"];
|
||
|
string payment_hash = 2 [json_name = "payment_hash"];
|
||
|
int64 num_satoshis = 3 [json_name = "num_satoshis"];
|
||
7 years ago
|
int64 timestamp = 4 [json_name = "timestamp"];
|
||
|
int64 expiry = 5 [json_name = "expiry"];
|
||
|
string description = 6 [json_name = "description"];
|
||
|
string description_hash = 7 [json_name = "description_hash"];
|
||
|
string fallback_addr = 8 [json_name = "fallback_addr"];
|
||
7 years ago
|
int64 cltv_expiry = 9 [json_name = "cltv_expiry"];
|
||
7 years ago
|
repeated RouteHint route_hints = 10 [json_name = "route_hints"];
|
||
7 years ago
|
}
|
||
|
|
||
|
message FeeReportRequest {}
|
||
|
message ChannelFeeReport {
|
||
|
/// The channel that this fee report belongs to.
|
||
|
string chan_point = 1 [json_name = "channel_point"];
|
||
|
|
||
|
/// The base fee charged regardless of the number of milli-satoshis sent.
|
||
|
int64 base_fee_msat = 2 [json_name = "base_fee_msat"];
|
||
|
|
||
|
/// The amount charged per milli-satoshis transferred expressed in millionths of a satoshi.
|
||
|
int64 fee_per_mil = 3 [json_name = "fee_per_mil"];
|
||
|
|
||
|
/// The effective fee rate in milli-satoshis. Computed by dividing the fee_per_mil value by 1 million.
|
||
|
double fee_rate = 4 [json_name = "fee_rate"];
|
||
|
}
|
||
|
message FeeReportResponse {
|
||
|
/// An array of channel fee reports which describes the current fee schedule for each channel.
|
||
|
repeated ChannelFeeReport channel_fees = 1 [json_name = "channel_fees"];
|
||
7 years ago
|
|
||
|
/// The total amount of fee revenue (in satoshis) the switch has collected over the past 24 hrs.
|
||
|
uint64 day_fee_sum = 2 [json_name = "day_fee_sum"];
|
||
|
|
||
|
/// The total amount of fee revenue (in satoshis) the switch has collected over the past 1 week.
|
||
|
uint64 week_fee_sum = 3 [json_name = "week_fee_sum"];
|
||
|
|
||
|
/// The total amount of fee revenue (in satoshis) the switch has collected over the past 1 month.
|
||
|
uint64 month_fee_sum = 4 [json_name = "month_fee_sum"];
|
||
7 years ago
|
}
|
||
|
|
||
7 years ago
|
message PolicyUpdateRequest {
|
||
7 years ago
|
oneof scope {
|
||
7 years ago
|
/// If set, then this update applies to all currently active channels.
|
||
7 years ago
|
bool global = 1 [json_name = "global"] ;
|
||
|
|
||
7 years ago
|
/// If set, this update will target a specific channel.
|
||
7 years ago
|
ChannelPoint chan_point = 2 [json_name = "chan_point"];
|
||
|
}
|
||
|
|
||
|
/// The base fee charged regardless of the number of milli-satoshis sent.
|
||
|
int64 base_fee_msat = 3 [json_name = "base_fee_msat"];
|
||
|
|
||
|
/// The effective fee rate in milli-satoshis. The precision of this value goes up to 6 decimal places, so 1e-6.
|
||
|
double fee_rate = 4 [json_name = "fee_rate"];
|
||
7 years ago
|
|
||
|
/// The required timelock delta for HTLCs forwarded over the channel.
|
||
|
uint32 time_lock_delta = 5 [json_name = "time_lock_delta"];
|
||
7 years ago
|
}
|
||
7 years ago
|
message PolicyUpdateResponse {
|
||
7 years ago
|
}
|
||
|
|
||
|
message ForwardingHistoryRequest {
|
||
|
/// Start time is the starting point of the forwarding history request. All records beyond this point will be included, respecting the end time, and the index offset.
|
||
|
uint64 start_time = 1 [json_name = "start_time"];
|
||
|
|
||
|
/// End time is the end point of the forwarding history request. The response will carry at most 50k records between the start time and the end time. The index offset can be used to implement pagination.
|
||
|
uint64 end_time = 2 [json_name = "end_time"];
|
||
|
|
||
|
/// Index offset is the offset in the time series to start at. As each response can only contain 50k records, callers can use this to skip around within a packed time series.
|
||
|
uint32 index_offset = 3 [json_name = "index_offset"];
|
||
|
|
||
|
/// The max number of events to return in the response to this query.
|
||
|
uint32 num_max_events = 4 [json_name = "num_max_events"];
|
||
|
}
|
||
|
message ForwardingEvent {
|
||
|
/// Timestamp is the time (unix epoch offset) that this circuit was completed.
|
||
|
uint64 timestamp = 1 [json_name = "timestamp"];
|
||
|
|
||
|
/// The incoming channel ID that carried the HTLC that created the circuit.
|
||
|
uint64 chan_id_in = 2 [json_name = "chan_id_in"];
|
||
|
|
||
|
/// The outgoing channel ID that carried the preimage that completed the circuit.
|
||
|
uint64 chan_id_out = 4 [json_name = "chan_id_out"];
|
||
|
|
||
|
/// The total amount of the incoming HTLC that created half the circuit.
|
||
|
uint64 amt_in = 5 [json_name = "amt_in"];
|
||
|
|
||
|
/// The total amount of the outgoign HTLC that created the second half of the circuit.
|
||
|
uint64 amt_out = 6 [json_name = "amt_out"];
|
||
|
|
||
|
/// The total fee that this payment circuit carried.
|
||
|
uint64 fee = 7 [json_name = "fee"];
|
||
|
|
||
|
// TODO(roasbeef): add settlement latency?
|
||
|
// * use FPE on the chan id?
|
||
|
// * also list failures?
|
||
|
}
|
||
|
message ForwardingHistoryResponse {
|
||
|
/// A list of forwarding events from the time slice of the time series specified in the request.
|
||
|
repeated ForwardingEvent forwarding_events = 1 [json_name = "forwarding_events"];
|
||
|
|
||
|
/// The index of the last time in the set of returned forwarding events. Can be used to seek further, pagination style.
|
||
|
uint32 last_offset_index = 2 [json_name = "last_offset_index"];
|
||
7 years ago
|
}
|
||
|
|