Skip to content

Commit eed8ba5

Browse files
authored
Merge pull request #27 from G8XSU/response-docs
Add docs for API response objects.
2 parents 5ee3080 + 9236e26 commit eed8ba5

File tree

2 files changed

+56
-1
lines changed

2 files changed

+56
-1
lines changed

ldk-server-protos/src/api.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#[allow(clippy::derive_partial_eq_without_eq)]
66
#[derive(Clone, PartialEq, ::prost::Message)]
77
pub struct GetNodeInfoRequest {}
8+
/// The response `content` for the `GetNodeInfo` API, when HttpStatusCode is OK (200).
9+
/// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
810
#[allow(clippy::derive_partial_eq_without_eq)]
911
#[derive(Clone, PartialEq, ::prost::Message)]
1012
pub struct GetNodeInfoResponse {
@@ -50,6 +52,8 @@ pub struct GetNodeInfoResponse {
5052
#[allow(clippy::derive_partial_eq_without_eq)]
5153
#[derive(Clone, PartialEq, ::prost::Message)]
5254
pub struct OnchainReceiveRequest {}
55+
/// The response `content` for the `OnchainReceive` API, when HttpStatusCode is OK (200).
56+
/// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`..
5357
#[allow(clippy::derive_partial_eq_without_eq)]
5458
#[derive(Clone, PartialEq, ::prost::Message)]
5559
pub struct OnchainReceiveResponse {
@@ -80,6 +84,8 @@ pub struct OnchainSendRequest {
8084
#[prost(bool, optional, tag = "3")]
8185
pub send_all: ::core::option::Option<bool>,
8286
}
87+
/// The response `content` for the `OnchainSend` API, when HttpStatusCode is OK (200).
88+
/// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
8389
#[allow(clippy::derive_partial_eq_without_eq)]
8490
#[derive(Clone, PartialEq, ::prost::Message)]
8591
pub struct OnchainSendResponse {
@@ -107,6 +113,8 @@ pub struct Bolt11ReceiveRequest {
107113
#[prost(uint32, tag = "3")]
108114
pub expiry_secs: u32,
109115
}
116+
/// The response `content` for the `Bolt11Receive` API, when HttpStatusCode is OK (200).
117+
/// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
110118
#[allow(clippy::derive_partial_eq_without_eq)]
111119
#[derive(Clone, PartialEq, ::prost::Message)]
112120
pub struct Bolt11ReceiveResponse {
@@ -130,6 +138,8 @@ pub struct Bolt11SendRequest {
130138
#[prost(uint64, optional, tag = "2")]
131139
pub amount_msat: ::core::option::Option<u64>,
132140
}
141+
/// The response `content` for the `Bolt11Send` API, when HttpStatusCode is OK (200).
142+
/// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
133143
#[allow(clippy::derive_partial_eq_without_eq)]
134144
#[derive(Clone, PartialEq, ::prost::Message)]
135145
pub struct Bolt11SendResponse {
@@ -159,6 +169,8 @@ pub struct Bolt12ReceiveRequest {
159169
#[prost(uint64, optional, tag = "4")]
160170
pub quantity: ::core::option::Option<u64>,
161171
}
172+
/// The response `content` for the `Bolt12Receive` API, when HttpStatusCode is OK (200).
173+
/// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
162174
#[allow(clippy::derive_partial_eq_without_eq)]
163175
#[derive(Clone, PartialEq, ::prost::Message)]
164176
pub struct Bolt12ReceiveResponse {
@@ -190,6 +202,8 @@ pub struct Bolt12SendRequest {
190202
#[prost(string, optional, tag = "4")]
191203
pub payer_note: ::core::option::Option<::prost::alloc::string::String>,
192204
}
205+
/// The response `content` for the `Bolt12Send` API, when HttpStatusCode is OK (200).
206+
/// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
193207
#[allow(clippy::derive_partial_eq_without_eq)]
194208
#[derive(Clone, PartialEq, ::prost::Message)]
195209
pub struct Bolt12SendResponse {
@@ -222,6 +236,8 @@ pub struct OpenChannelRequest {
222236
#[prost(bool, tag = "6")]
223237
pub announce_channel: bool,
224238
}
239+
/// The response `content` for the `OpenChannel` API, when HttpStatusCode is OK (200).
240+
/// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
225241
#[allow(clippy::derive_partial_eq_without_eq)]
226242
#[derive(Clone, PartialEq, ::prost::Message)]
227243
pub struct OpenChannelResponse {
@@ -244,6 +260,8 @@ pub struct UpdateChannelConfigRequest {
244260
#[prost(message, optional, tag = "3")]
245261
pub channel_config: ::core::option::Option<super::types::ChannelConfig>,
246262
}
263+
/// The response `content` for the `UpdateChannelConfig` API, when HttpStatusCode is OK (200).
264+
/// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
247265
#[allow(clippy::derive_partial_eq_without_eq)]
248266
#[derive(Clone, PartialEq, ::prost::Message)]
249267
pub struct UpdateChannelConfigResponse {}
@@ -267,6 +285,8 @@ pub struct CloseChannelRequest {
267285
#[prost(string, optional, tag = "4")]
268286
pub force_close_reason: ::core::option::Option<::prost::alloc::string::String>,
269287
}
288+
/// The response `content` for the `CloseChannel` API, when HttpStatusCode is OK (200).
289+
/// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
270290
#[allow(clippy::derive_partial_eq_without_eq)]
271291
#[derive(Clone, PartialEq, ::prost::Message)]
272292
pub struct CloseChannelResponse {}
@@ -275,6 +295,8 @@ pub struct CloseChannelResponse {}
275295
#[allow(clippy::derive_partial_eq_without_eq)]
276296
#[derive(Clone, PartialEq, ::prost::Message)]
277297
pub struct ListChannelsRequest {}
298+
/// The response `content` for the `ListChannels` API, when HttpStatusCode is OK (200).
299+
/// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
278300
#[allow(clippy::derive_partial_eq_without_eq)]
279301
#[derive(Clone, PartialEq, ::prost::Message)]
280302
pub struct ListChannelsResponse {
@@ -291,6 +313,8 @@ pub struct GetPaymentDetailsRequest {
291313
#[prost(string, tag = "1")]
292314
pub payment_id: ::prost::alloc::string::String,
293315
}
316+
/// The response `content` for the `GetPaymentDetails` API, when HttpStatusCode is OK (200).
317+
/// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
294318
#[allow(clippy::derive_partial_eq_without_eq)]
295319
#[derive(Clone, PartialEq, ::prost::Message)]
296320
pub struct GetPaymentDetailsResponse {
@@ -304,6 +328,8 @@ pub struct GetPaymentDetailsResponse {
304328
#[allow(clippy::derive_partial_eq_without_eq)]
305329
#[derive(Clone, PartialEq, ::prost::Message)]
306330
pub struct ListPaymentsRequest {}
331+
/// The response `content` for the `ListPayments` API, when HttpStatusCode is OK (200).
332+
/// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
307333
#[allow(clippy::derive_partial_eq_without_eq)]
308334
#[derive(Clone, PartialEq, ::prost::Message)]
309335
pub struct ListPaymentsResponse {
@@ -316,6 +342,8 @@ pub struct ListPaymentsResponse {
316342
#[allow(clippy::derive_partial_eq_without_eq)]
317343
#[derive(Clone, PartialEq, ::prost::Message)]
318344
pub struct GetBalancesRequest {}
345+
/// The response `content` for the `GetBalances` API, when HttpStatusCode is OK (200).
346+
/// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
319347
#[allow(clippy::derive_partial_eq_without_eq)]
320348
#[derive(Clone, PartialEq, ::prost::Message)]
321349
pub struct GetBalancesResponse {

ldk-server-protos/src/proto/api.proto

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import 'types.proto';
1010
message GetNodeInfoRequest {
1111
}
1212

13+
// The response `content` for the `GetNodeInfo` API, when HttpStatusCode is OK (200).
14+
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
1315
message GetNodeInfoResponse {
1416

1517
// The hex-encoded `node-id` or public key for our own lightning node.
@@ -54,6 +56,8 @@ message GetNodeInfoResponse {
5456
message OnchainReceiveRequest {
5557
}
5658

59+
// The response `content` for the `OnchainReceive` API, when HttpStatusCode is OK (200).
60+
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`..
5761
message OnchainReceiveResponse {
5862

5963
// A Bitcoin on-chain address.
@@ -82,6 +86,8 @@ message OnchainSendRequest {
8286
optional bool send_all = 3;
8387
}
8488

89+
// The response `content` for the `OnchainSend` API, when HttpStatusCode is OK (200).
90+
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
8591
message OnchainSendResponse {
8692

8793
// The transaction ID of the broadcasted transaction.
@@ -107,7 +113,8 @@ message Bolt11ReceiveRequest {
107113
uint32 expiry_secs = 3;
108114
}
109115

110-
116+
// The response `content` for the `Bolt11Receive` API, when HttpStatusCode is OK (200).
117+
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
111118
message Bolt11ReceiveResponse {
112119

113120
// An invoice for a payment within the Lightning Network.
@@ -130,6 +137,8 @@ message Bolt11SendRequest {
130137

131138
}
132139

140+
// The response `content` for the `Bolt11Send` API, when HttpStatusCode is OK (200).
141+
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
133142
message Bolt11SendResponse {
134143

135144
// An identifier used to uniquely identify a payment.
@@ -157,6 +166,8 @@ message Bolt12ReceiveRequest {
157166
optional uint64 quantity = 4;
158167
}
159168

169+
// The response `content` for the `Bolt12Receive` API, when HttpStatusCode is OK (200).
170+
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
160171
message Bolt12ReceiveResponse {
161172

162173
// An offer for a payment within the Lightning Network.
@@ -186,6 +197,8 @@ message Bolt12SendRequest {
186197
optional string payer_note = 4;
187198
}
188199

200+
// The response `content` for the `Bolt12Send` API, when HttpStatusCode is OK (200).
201+
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
189202
message Bolt12SendResponse {
190203

191204
// An identifier used to uniquely identify a payment.
@@ -216,6 +229,8 @@ message OpenChannelRequest {
216229
bool announce_channel = 6;
217230
}
218231

232+
// The response `content` for the `OpenChannel` API, when HttpStatusCode is OK (200).
233+
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
219234
message OpenChannelResponse {
220235

221236
// The channel id of the created channel that user can use to refer to channel.
@@ -236,6 +251,8 @@ message UpdateChannelConfigRequest {
236251
types.ChannelConfig channel_config = 3;
237252
}
238253

254+
// The response `content` for the `UpdateChannelConfig` API, when HttpStatusCode is OK (200).
255+
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
239256
message UpdateChannelConfigResponse {
240257
}
241258

@@ -258,6 +275,8 @@ message CloseChannelRequest {
258275
optional string force_close_reason = 4;
259276
}
260277

278+
// The response `content` for the `CloseChannel` API, when HttpStatusCode is OK (200).
279+
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
261280
message CloseChannelResponse {
262281

263282
}
@@ -266,6 +285,8 @@ message CloseChannelResponse {
266285
// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.list_channels
267286
message ListChannelsRequest {}
268287

288+
// The response `content` for the `ListChannels` API, when HttpStatusCode is OK (200).
289+
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
269290
message ListChannelsResponse {
270291

271292
// List of channels.
@@ -279,6 +300,8 @@ message GetPaymentDetailsRequest {
279300
string payment_id = 1;
280301
}
281302

303+
// The response `content` for the `GetPaymentDetails` API, when HttpStatusCode is OK (200).
304+
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
282305
message GetPaymentDetailsResponse {
283306
// Represents a payment.
284307
// Will be `None` if payment doesn't exist.
@@ -289,6 +312,8 @@ message GetPaymentDetailsResponse {
289312
// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.list_payments
290313
message ListPaymentsRequest {}
291314

315+
// The response `content` for the `ListPayments` API, when HttpStatusCode is OK (200).
316+
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
292317
message ListPaymentsResponse {
293318
// List of payments.
294319
repeated types.Payment payments = 1;
@@ -298,6 +323,8 @@ message ListPaymentsResponse {
298323
// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.list_balances
299324
message GetBalancesRequest {}
300325

326+
// The response `content` for the `GetBalances` API, when HttpStatusCode is OK (200).
327+
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
301328
message GetBalancesResponse {
302329
// The total balance of our on-chain wallet.
303330
uint64 total_onchain_balance_sats = 1;

0 commit comments

Comments
 (0)