2015-12-30 23:19:09 +03:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package lnrpc;
|
|
|
|
|
|
|
|
service Lightning {
|
2016-06-29 21:28:10 +03:00
|
|
|
rpc WalletBalance(WalletBalanceRequest) returns (WalletBalanceResponse);
|
2015-12-31 05:58:15 +03:00
|
|
|
rpc SendMany(SendManyRequest) returns (SendManyResponse);
|
2016-06-29 21:28:10 +03:00
|
|
|
rpc SendCoins(SendCoinsRequest) returns (SendCoinsResponse);
|
2015-12-30 23:19:09 +03:00
|
|
|
rpc NewAddress(NewAddressRequest) returns (NewAddressResponse);
|
2015-12-31 06:02:24 +03:00
|
|
|
|
2016-01-17 06:03:47 +03:00
|
|
|
rpc ConnectPeer(ConnectPeerRequest) returns (ConnectPeerResponse);
|
2016-06-21 21:52:09 +03:00
|
|
|
rpc ListPeers(ListPeersRequest) returns (ListPeersResponse);
|
2016-07-06 04:52:05 +03:00
|
|
|
rpc GetInfo(GetInfoRequest) returns (GetInfoResponse);
|
2016-06-21 21:52:09 +03:00
|
|
|
|
2016-08-31 02:42:23 +03:00
|
|
|
rpc OpenChannel(OpenChannelRequest) returns (stream OpenStatusUpdate);
|
|
|
|
rpc CloseChannel(CloseChannelRequest) returns (stream CloseStatusUpdate);
|
2016-07-08 01:24:52 +03:00
|
|
|
rpc PendingChannels(PendingChannelRequest) returns (PendingChannelResponse);
|
2016-07-13 03:36:34 +03:00
|
|
|
|
|
|
|
rpc SendPayment(stream SendRequest) returns (stream SendResponse);
|
2016-07-15 14:02:59 +03:00
|
|
|
rpc ShowRoutingTable(ShowRoutingTableRequest) returns (ShowRoutingTableResponse);
|
2016-07-13 03:36:34 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message SendRequest {
|
|
|
|
bytes dest = 1;
|
|
|
|
int64 amt = 2;
|
|
|
|
bytes payment_hash = 3;
|
|
|
|
|
|
|
|
bool fast_send = 4;
|
|
|
|
}
|
|
|
|
message SendResponse{
|
|
|
|
// TODO(roasbeef): info about route? stats?
|
2015-12-30 23:19:09 +03:00
|
|
|
}
|
|
|
|
|
2016-06-21 21:52:09 +03:00
|
|
|
message ChannelPoint {
|
|
|
|
bytes funding_txid = 1;
|
|
|
|
uint32 output_index = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message LightningAddress {
|
|
|
|
string pubKeyHash = 1;
|
|
|
|
string host = 2;
|
|
|
|
}
|
|
|
|
|
2015-12-30 23:19:09 +03:00
|
|
|
message SendManyRequest {
|
|
|
|
map<string, int64> AddrToAmount = 1;
|
|
|
|
}
|
|
|
|
message SendManyResponse {
|
|
|
|
string txid = 1;
|
|
|
|
}
|
|
|
|
|
2016-06-29 21:28:10 +03:00
|
|
|
message SendCoinsRequest {
|
|
|
|
string addr = 1;
|
|
|
|
int64 amount = 2;
|
|
|
|
}
|
|
|
|
message SendCoinsResponse {
|
|
|
|
string txid = 1;
|
|
|
|
}
|
|
|
|
|
2016-04-25 06:26:32 +03:00
|
|
|
message NewAddressRequest {
|
|
|
|
enum AddressType {
|
|
|
|
WITNESS_PUBKEY_HASH = 0;
|
|
|
|
NESTED_PUBKEY_HASH = 1;
|
|
|
|
PUBKEY_HASH = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
AddressType type = 1;
|
|
|
|
}
|
2015-12-30 23:19:09 +03:00
|
|
|
message NewAddressResponse {
|
|
|
|
string address = 1;
|
|
|
|
}
|
2015-12-31 05:58:15 +03:00
|
|
|
|
2016-01-17 06:03:47 +03:00
|
|
|
message ConnectPeerRequest {
|
2016-06-21 21:52:09 +03:00
|
|
|
LightningAddress addr = 1;
|
2015-12-31 05:58:15 +03:00
|
|
|
}
|
2016-01-17 06:03:47 +03:00
|
|
|
message ConnectPeerResponse {
|
2016-06-21 21:52:09 +03:00
|
|
|
int32 peer_id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message HTLC {
|
|
|
|
int64 id = 1;
|
|
|
|
|
|
|
|
int64 amount = 2;
|
|
|
|
|
|
|
|
bytes hash_lock = 3;
|
|
|
|
|
|
|
|
bool to_us = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ActiveChannel {
|
2016-06-23 08:06:37 +03:00
|
|
|
// TODO(roasbeef): make channel points a string everywhere in rpc?
|
|
|
|
string remote_id = 1;
|
|
|
|
string channel_point = 2;
|
2016-06-21 21:52:09 +03:00
|
|
|
|
2016-06-23 08:06:37 +03:00
|
|
|
int64 capacity = 3;
|
|
|
|
int64 local_balance = 4;
|
|
|
|
int64 remote_balance = 5;
|
2016-06-21 21:52:09 +03:00
|
|
|
|
2016-06-23 08:06:37 +03:00
|
|
|
int64 unsettled_belance = 6;
|
|
|
|
repeated HTLC pending_htlcs = 7;
|
2016-06-21 21:52:09 +03:00
|
|
|
|
2016-06-23 08:06:37 +03:00
|
|
|
uint64 num_updates = 8;
|
2016-06-21 21:52:09 +03:00
|
|
|
// TODO(roasbeef): other stuffs
|
|
|
|
}
|
|
|
|
|
|
|
|
message Peer {
|
|
|
|
string lightning_id = 1;
|
|
|
|
int32 peer_id = 2;
|
|
|
|
string address = 3;
|
|
|
|
|
|
|
|
uint64 bytes_sent = 4;
|
|
|
|
uint64 bytes_recv = 5;
|
|
|
|
|
|
|
|
int64 sat_sent = 6;
|
|
|
|
int64 sat_recv = 7;
|
|
|
|
|
|
|
|
bool inbound = 8;
|
|
|
|
|
|
|
|
// TODO(roasbeef): add pending channels
|
|
|
|
repeated ActiveChannel channels = 9;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ListPeersRequest {}
|
|
|
|
message ListPeersResponse {
|
|
|
|
repeated Peer peers = 1;
|
|
|
|
}
|
2016-06-21 22:32:32 +03:00
|
|
|
|
2016-07-06 04:52:05 +03:00
|
|
|
message GetInfoRequest{}
|
|
|
|
message GetInfoResponse {
|
|
|
|
string lightning_id = 1;
|
|
|
|
string identity_address = 2;
|
|
|
|
|
|
|
|
uint32 num_pending_channels = 3;
|
|
|
|
uint32 num_active_channels = 4;
|
|
|
|
|
|
|
|
uint32 num_peers = 5;
|
|
|
|
}
|
|
|
|
|
2016-07-08 01:23:29 +03:00
|
|
|
message ConfirmationUpdate {
|
|
|
|
bytes block_sha = 1;
|
|
|
|
int32 block_height = 2;
|
|
|
|
|
|
|
|
uint32 num_confs_left = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ChannelOpenUpdate {
|
|
|
|
ChannelPoint channel_point = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ChannelCloseUpdate {
|
|
|
|
bytes closing_txid = 1;
|
|
|
|
|
|
|
|
bool success = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CloseChannelRequest {
|
|
|
|
ChannelPoint channel_point = 1;
|
|
|
|
int64 time_limit = 2;
|
|
|
|
bool allow_force_close = 3;
|
|
|
|
}
|
|
|
|
message CloseStatusUpdate {
|
|
|
|
oneof update {
|
2016-08-31 02:42:23 +03:00
|
|
|
PendingUpdate close_pending = 1;
|
|
|
|
ConfirmationUpdate confirmation = 2;
|
|
|
|
ChannelCloseUpdate chan_close = 3;
|
2016-07-08 01:23:29 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-31 02:42:23 +03:00
|
|
|
message PendingUpdate {
|
|
|
|
bytes txid = 1;
|
|
|
|
}
|
|
|
|
|
2016-06-21 22:32:32 +03:00
|
|
|
message OpenChannelRequest {
|
|
|
|
int32 target_peer_id = 1;
|
|
|
|
LightningAddress target_node = 2;
|
|
|
|
|
|
|
|
int64 local_funding_amount = 3;
|
|
|
|
int64 remote_funding_amount = 4;
|
|
|
|
|
|
|
|
int64 commission_size = 5;
|
|
|
|
|
|
|
|
uint32 num_confs = 6;
|
|
|
|
}
|
2016-07-08 01:23:29 +03:00
|
|
|
message OpenStatusUpdate {
|
|
|
|
oneof update {
|
2016-08-31 02:42:23 +03:00
|
|
|
PendingUpdate chan_pending = 1;
|
|
|
|
ConfirmationUpdate confirmation = 2;
|
|
|
|
ChannelOpenUpdate chan_open = 3;
|
2016-07-08 01:23:29 +03:00
|
|
|
}
|
2016-06-21 22:32:32 +03:00
|
|
|
}
|
|
|
|
|
2016-07-08 01:24:52 +03:00
|
|
|
enum ChannelStatus {
|
|
|
|
ALL = 0;
|
|
|
|
OPENING = 1;
|
|
|
|
CLOSING = 2;
|
2016-06-21 22:32:32 +03:00
|
|
|
}
|
2016-07-08 01:24:52 +03:00
|
|
|
message PendingChannelRequest {
|
|
|
|
ChannelStatus status = 1;
|
|
|
|
}
|
|
|
|
message PendingChannelResponse {
|
|
|
|
message PendingChannel {
|
|
|
|
int32 peer_id = 1;
|
|
|
|
|
|
|
|
string lightning_id = 2;
|
|
|
|
string channel_point = 3;
|
|
|
|
|
|
|
|
int64 capacity = 4;
|
|
|
|
int64 local_balance = 5;
|
|
|
|
int64 remote_balance = 6;
|
|
|
|
|
|
|
|
string closing_txid = 7;
|
|
|
|
|
|
|
|
ChannelStatus status = 8;
|
|
|
|
}
|
|
|
|
|
|
|
|
repeated PendingChannel pending_channels = 1;
|
2016-06-21 22:32:32 +03:00
|
|
|
}
|
|
|
|
|
2016-06-21 21:46:27 +03:00
|
|
|
message WalletBalanceRequest {
|
|
|
|
bool witness_only = 1;
|
|
|
|
}
|
|
|
|
message WalletBalanceResponse {
|
|
|
|
double balance = 1;
|
2015-12-31 05:58:15 +03:00
|
|
|
}
|
2016-07-15 14:02:59 +03:00
|
|
|
|
|
|
|
message ShowRoutingTableRequest {
|
|
|
|
}
|
|
|
|
|
|
|
|
message ShowRoutingTableResponse {
|
|
|
|
string rt = 1;
|
|
|
|
}
|