-
Notifications
You must be signed in to change notification settings - Fork 1
/
hold.proto
133 lines (107 loc) · 2.36 KB
/
hold.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
syntax = "proto3";
package hold;
service Hold {
rpc GetInfo (GetInfoRequest) returns (GetInfoResponse);
rpc Invoice (InvoiceRequest) returns (InvoiceResponse) {}
rpc List (ListRequest) returns (ListResponse) {}
rpc Settle (SettleRequest) returns (SettleResponse) {}
rpc Cancel (CancelRequest) returns (CancelResponse) {}
// Cleans cancelled invoices
rpc Clean (CleanRequest) returns (CleanResponse) {}
rpc Track (TrackRequest) returns (stream TrackResponse) {}
rpc TrackAll (TrackAllRequest) returns (stream TrackAllResponse) {}
}
message GetInfoRequest {}
message GetInfoResponse {
string version = 1;
}
message Hop {
bytes public_key = 1;
uint64 short_channel_id = 2;
uint64 base_fee = 3;
uint64 ppm_fee = 4;
uint64 cltv_expiry_delta = 5;
}
message RoutingHint {
repeated Hop hops = 1;
}
message InvoiceRequest {
bytes payment_hash = 1;
uint64 amount_msat = 2;
oneof description {
string memo = 3;
bytes hash = 4;
}
optional uint64 expiry = 5;
optional uint64 min_final_cltv_expiry = 6;
repeated RoutingHint routing_hints = 7;
}
message InvoiceResponse {
string bolt11 = 1;
}
message ListRequest {
message Pagination {
// Inclusive
int64 index_start = 1;
uint64 limit = 2;
}
oneof constraint {
bytes payment_hash = 1;
Pagination pagination = 2;
}
}
enum InvoiceState {
UNPAID = 0;
ACCEPTED = 1;
PAID = 2;
CANCELLED = 3;
}
message Htlc {
int64 id = 1;
InvoiceState state = 2;
string scid = 3;
uint64 channel_id = 4;
uint64 msat = 5;
uint64 created_at = 6;
}
message Invoice {
int64 id = 1;
bytes payment_hash = 2;
optional bytes preimage = 3;
string bolt11 = 4;
InvoiceState state = 5;
uint64 created_at = 6;
repeated Htlc htlcs = 7;
}
message ListResponse {
repeated Invoice invoices = 1;
}
message SettleRequest {
bytes payment_preimage = 1;
}
message SettleResponse {}
message CancelRequest {
bytes payment_hash = 1;
}
message CancelResponse {}
message CleanRequest {
// Clean everything older than age seconds
optional uint64 age = 1;
}
message CleanResponse {
uint64 cleaned = 1;
}
message TrackRequest {
bytes payment_hash = 1;
}
message TrackResponse {
InvoiceState state = 1;
}
message TrackAllRequest {
repeated bytes payment_hashes = 1;
}
message TrackAllResponse {
bytes payment_hash = 1;
string bolt11 = 2;
InvoiceState state = 3;
}