-
Notifications
You must be signed in to change notification settings - Fork 3
/
restentities.go
411 lines (343 loc) · 15.2 KB
/
restentities.go
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
package lightning
import (
"encoding/json"
"github.com/lightningnetwork/lnd/lnrpc"
"github.com/lightningnetwork/lnd/lnrpc/routerrpc"
)
// A hack to override uint64 -> string (REST API)
// GetInfoResponseOverride struct.
type GetInfoResponseOverride struct {
BestHeaderTimestamp string `json:"best_header_timestamp,omitempty"`
lnrpc.GetInfoResponse
}
// Channels struct.
type Channels struct {
Channels []*ChannelOverride `json:"channels"`
}
// ChannelConstraintsOverride struct.
type ChannelConstraintsOverride struct {
ChanReserveSat string `json:"chan_reserve_sat,omitempty"`
DustLimitSat string `json:"dust_limit_sat,omitempty"`
MaxPendingAmtMsat string `json:"max_pending_amt_msat,omitempty"`
MinHtlcMsat string `json:"min_htlc_msat,omitempty"`
lnrpc.ChannelConstraints
}
// HtlcOverride struct.
type HtlcOverride struct {
Amount string `json:"amount,omitempty"`
HashLock string `json:"hash_lock,omitempty"`
HtlcIndex string `json:"htlc_index,omitempty"`
ForwardingChannel string `json:"forwarding_channel,omitempty"`
ForwardingHtlcIndex string `json:"forwarding_htlc_index,omitempty"`
lnrpc.HTLC
}
// ChannelOverride struct.
type ChannelOverride struct {
ChanID string `json:"chan_id,omitempty"`
Capacity string `json:"capacity,omitempty"`
LocalBalance string `json:"local_balance,omitempty"`
RemoteBalance string `json:"remote_balance,omitempty"`
CommitFee string `json:"commit_fee,omitempty"`
CommitWeight string `json:"commit_weight,omitempty"`
FeePerKw string `json:"fee_per_kw,omitempty"`
UnsettledBalance string `json:"unsettled_balance,omitempty"`
TotalSatoshisSent string `json:"total_satoshis_sent,omitempty"`
TotalSatoshisReceived string `json:"total_satoshis_received,omitempty"`
NumUpdates string `json:"num_updates,omitempty"`
// Deprecated
LocalChanReserveSat string `json:"local_chan_reserve_sat,omitempty"`
// Deprecated
RemoteChanReserveSat string `json:"remote_chan_reserve_sat,omitempty"`
CommitmentType string `json:"commitment_type,omitempty"`
PendingHtlcs []*HtlcOverride `json:"pending_htlcs,omitempty"`
Lifetime string `json:"lifetime,omitempty"`
Uptime string `json:"uptime,omitempty"`
PushAmountSat string `json:"push_amount_sat,omitempty"`
LocalConstraints *ChannelConstraintsOverride `json:"local_constraints,omitempty"`
RemoteConstraints *ChannelConstraintsOverride `json:"remote_constraints,omitempty"`
AliasScids []string `json:"alias_scids,omitempty"`
ZeroConfConfirmedScid string `json:"zero_conf_confirmed_scid,omitempty"`
PeerScidAlias string `json:"peer_scid_alias,omitempty"`
lnrpc.Channel
}
// Graph struct.
type Graph struct {
GraphNodeOverride []*GraphNodeOverride `json:"nodes,omitempty"`
GraphEdgesOverride []*GraphEdgeOverride `json:"edges,omitempty"`
}
// RoutingPolicyOverride struct.
type RoutingPolicyOverride struct {
MinHtlc string `json:"min_htlc,omitempty"`
FeeBaseMsat string `json:"fee_base_msat,omitempty"`
FeeRateMilliMsat string `json:"fee_rate_milli_msat,omitempty"`
MaxHtlcMsat string `json:"max_htlc_msat,omitempty"`
lnrpc.RoutingPolicy
}
// GraphNodeOverride struct.
type GraphNodeOverride struct {
lnrpc.LightningNode
}
// GetNodeInfoOverride struct.
type GetNodeInfoOverride struct {
Node *GraphNodeOverride `json:"node,omitempty"`
NumChannels int64 `json:"num_channels,omitempty"`
TotalCapacity string `json:"total_capacity,omitempty"`
Channels []*GraphEdgeOverride `json:"channels"`
lnrpc.NodeInfo
}
// GraphEdgeOverride struct.
type GraphEdgeOverride struct {
ChannelID string `json:"channel_id,omitempty"`
Capacity string `json:"capacity,omitempty"`
Node1Policy *RoutingPolicyOverride `json:"node1_policy,omitempty"`
Node2Policy *RoutingPolicyOverride `json:"node2_policy,omitempty"`
lnrpc.ChannelEdge
}
// ForwardingHistoryRequestOverride struct.
type ForwardingHistoryRequestOverride struct {
StartTime string `json:"start_time,omitempty"`
EndTime string `json:"end_time,omitempty"`
lnrpc.ForwardingHistoryRequest
}
// ForwardingHistoryResponseOverride struct.
type ForwardingHistoryResponseOverride struct {
ForwardingEvents []*ForwardingEventOverride `json:"forwarding_events,omitempty"`
lnrpc.ForwardingHistoryResponse
}
// ForwardingEventOverride struct.
type ForwardingEventOverride struct {
Timestamp string `json:"timestamp,omitempty"`
ChanIDIn string `json:"chan_id_in,omitempty"`
ChanIDOut string `json:"chan_id_out,omitempty"`
AmtIn string `json:"amt_in,omitempty"`
AmtOut string `json:"amt_out,omitempty"`
Fee string `json:"fee,omitempty"`
FeeMsat string `json:"fee_msat,omitempty"`
AmtInMsat string `json:"amt_in_msat,omitempty"`
AmtOutMsat string `json:"amt_out_msat,omitempty"`
TimestampNs string `json:"timestamp_ns,omitempty"`
lnrpc.ForwardingEvent
}
// HtlcEventOverride struct.
type HtlcEventOverride struct {
IncomingChannelID string `json:"incoming_channel_id,omitempty"`
OutgoingChannelID string `json:"outgoing_channel_id,omitempty"`
IncomingHtlcID string `json:"incoming_htlc_id,omitempty"`
OutgoingHtlcID string `json:"outgoing_htlc_id,omitempty"`
TimestampNs string `json:"timestamp_ns,omitempty"`
EventType string `json:"event_type,omitempty"`
Event HtlcEventComposite `json:"event,omitempty"`
routerrpc.HtlcEvent
}
// HtlcInfoOverride struct.
type HtlcInfoOverride struct {
IncomingAmtMsat string `json:"incoming_amt_msat,omitempty"`
OutgoingAmtMsat string `json:"outgoing_amt_msat,omitempty"`
}
// HtlcEventComposite struct (our abstraction over that mess with inheritance).
type HtlcEventComposite struct {
Info *HtlcInfoOverride `json:"info,omitempty"`
Preimage string `json:"preimage,omitempty"`
WireFailure string `json:"wire_failure,omitempty"`
FailureDetail string `json:"failure_detail,omitempty"`
FailureString string `json:"failure_string,omitempty"`
}
// ListInvoiceRequestOverride struct.
type ListInvoiceRequestOverride struct {
IndexOffset string `json:"index_offset,omitempty"`
NumMaxInvoices string `json:"num_max_invoices,omitempty"`
lnrpc.ListInvoiceRequest
}
// ListInvoiceResponseOverride struct.
type ListInvoiceResponseOverride struct {
Invoices []*InvoiceOverride `json:"invoices,omitempty"`
LastIndexOffset string `json:"last_index_offset,omitempty"`
FirstIndexOffset string `json:"first_index_offset,omitempty"`
lnrpc.ListInvoiceResponse
}
// InvoiceOverride struct.
type InvoiceOverride struct {
Value string `json:"value,omitempty"`
ValueMsat string `json:"value_msat,omitempty"`
RPreimage string `json:"r_preimage,omitempty"`
RHash string `json:"r_hash,omitempty"`
CreationDate string `json:"creation_date,omitempty"`
SettleDate string `json:"settle_date,omitempty"`
Expiry string `json:"expiry,omitempty"`
CltvExpiry string `json:"cltv_expiry,omitempty"`
AddIndex string `json:"add_index,omitempty"`
SettleIndex string `json:"settle_index,omitempty"`
AmtPaid string `json:"amt_paid,omitempty"`
AmtPaidSat string `json:"amt_paid_sat,omitempty"`
AmtPaidMsat string `json:"amt_paid_msat,omitempty"`
DescriptionHash string `json:"description_hash,omitempty"`
RouteHints []*RouteHintOverride `json:"route_hints,omitempty"`
State string `json:"state,omitempty"`
// Ignore this stuff
Features json.RawMessage `json:"features,omitempty"`
Htlcs json.RawMessage `json:"htlcs,omitempty"`
AmpInvoiceState json.RawMessage `json:"amp_invoice_state,omitempty"`
lnrpc.Invoice
}
// RouteHintOverride struct.
type RouteHintOverride struct {
HopHints []*HopHintOverride `json:"hop_hints,omitempty"`
lnrpc.RouteHint
}
// HopHintOverride struct.
type HopHintOverride struct {
ChanID string `json:"chan_id,omitempty"`
lnrpc.HopHint
}
// ListPaymentsRequestOverride struct.
type ListPaymentsRequestOverride struct {
IndexOffset string `json:"index_offset,omitempty"`
MaxPayments string `json:"max_payments,omitempty"`
lnrpc.ListPaymentsRequest
}
// ListPaymentsResponseOverride struct.
type ListPaymentsResponseOverride struct {
Payments []*PaymentOverride `json:"payments,omitempty"`
LastIndexOffset string `json:"last_index_offset,omitempty"`
FirstIndexOffset string `json:"first_index_offset,omitempty"`
TotalNumPayments string `json:"total_num_payments,omitempty"`
lnrpc.ListPaymentsResponse
}
// PaymentOverride struct.
type PaymentOverride struct {
Value string `json:"value,omitempty"`
CreationDate string `json:"creation_date,omitempty"`
Fee string `json:"fee,omitempty"`
ValueSat string `json:"value_sat,omitempty"`
ValueMsat string `json:"value_msat,omitempty"`
Status string `json:"status,omitempty"`
FeeSat string `json:"fee_sat,omitempty"`
FeeMsat string `json:"fee_msat,omitempty"`
CreationTimeNs string `json:"creation_time_ns,omitempty"`
Htlcs []*HTLCAttemptOverride `json:"htlcs,omitempty"`
PaymentIndex string `json:"payment_index,omitempty"`
FailureReason string `json:"failure_reason,omitempty"`
lnrpc.Payment
}
// HTLCAttemptOverride struct.
type HTLCAttemptOverride struct {
AttemptID string `json:"attempt_id,omitempty"`
Status string `json:"status,omitempty"`
Route *RouteOverride `json:"route,omitempty"`
AttemptTimeNs string `json:"attempt_time_ns,omitempty"`
ResolveTimeNs string `json:"resolve_time_ns,omitempty"`
Failure json.RawMessage `json:"failure,omitempty"` // ignore
Preimage string `protobuf:"bytes,6,opt,name=preimage,proto3" json:"preimage,omitempty"`
lnrpc.HTLCAttempt
}
// RouteOverride struct.
type RouteOverride struct {
TotalFees string `json:"total_fees,omitempty"`
TotalAmt string `json:"total_amt,omitempty"`
Hops []*HopOverride `json:"hops,omitempty"`
TotalFeesMsat string `json:"total_fees_msat,omitempty"`
TotalAmtMsat string `json:"total_amt_msat,omitempty"`
lnrpc.Route
}
// HopOverride struct.
type HopOverride struct {
ChanID string `json:"chan_id,omitempty"`
ChanCapacity string `json:"chan_capacity,omitempty"`
AmtToForward string `json:"amt_to_forward,omitempty"`
Fee string `json:"fee,omitempty"`
AmtToForwardMsat string `json:"amt_to_forward_msat,omitempty"`
FeeMsat string `json:"fee_msat,omitempty"`
MppRecord json.RawMessage `json:"mpp_record,omitempty"` // ignore
AmpRecord json.RawMessage `json:"amp_record,omitempty"` // ignore
CustomRecords json.RawMessage `json:"custom_records,omitempty"` // ignore
Metadata string `json:"metadata,omitempty"`
lnrpc.Hop
}
// ConnectPeerRequestOverride struct.
type ConnectPeerRequestOverride struct {
Addr *LightningAddressOverride `json:"addr,omitempty"`
Timeout string `json:"timeout,omitempty"`
lnrpc.ConnectPeerRequest
}
// LightningAddressOverride struct.
type LightningAddressOverride struct {
lnrpc.LightningAddress
}
// WalletBalanceResponseOverride struct.
type WalletBalanceResponseOverride struct {
TotalBalance string `json:"total_balance,omitempty"`
ConfirmedBalance string `json:"confirmed_balance,omitempty"`
UnconfirmedBalance string `json:"unconfirmed_balance,omitempty"`
LockedBalance string `json:"locked_balance,omitempty"`
ReservedBalanceAnchorChan string `json:"reserved_balance_anchor_chan,omitempty"`
AccountBalance json.RawMessage `json:"account_balance,omitempty"`
lnrpc.WalletBalanceResponse
}
/*
// AccountBalanceEntryOverride struct.
type AccountBalanceEntryOverride struct {
// ignore
}
*/
// SendCoinsRequestOverride struct.
type SendCoinsRequestOverride struct {
Amount string `json:"amount,omitempty"`
SatPerVbyte string `json:"sat_per_vbyte,omitempty"`
// Deprecated
SatPerByte string `json:"sat_per_byte,omitempty"`
lnrpc.SendCoinsRequest
}
// SendPaymentRequestOverride struct.
type SendPaymentRequestOverride struct {
Dest string `json:"dest,omitempty"`
Amt string `json:"amt,omitempty"`
AmtMsat string `json:"amt_msat,omitempty"`
PaymentHash string `json:"payment_hash,omitempty"`
PaymentAddr string `json:"payment_addr,omitempty"`
FeeLimitSat string `json:"fee_limit_sat,omitempty"`
FeeLimitMsat string `json:"fee_limit_msat,omitempty"`
// Deprecated: Do not use.
OutgoingChanId string `json:"outgoing_chan_id,omitempty"`
OutgoingChanIds []string `json:"outgoing_chan_ids,omitempty"`
LastHopPubkey string `json:"last_hop_pubkey,omitempty"`
RouteHints []RouteHintOverride `json:"route_hints,omitempty"`
DestCustomRecords DestCustomRecordsEntryOverride `json:"dest_custom_records,omitempty"`
DestFeatures []lnrpc.FeatureBit `json:"dest_features,omitempty"`
MaxShardSizeMsat string `json:"max_shard_size_msat,omitempty"`
routerrpc.SendPaymentRequest
}
// DestCustomRecordsEntryOverride struct.
type DestCustomRecordsEntryOverride struct {
// ignore
}
// AddInvoiceResponseOverride struct.
type AddInvoiceResponseOverride struct {
RHash string `json:"r_hash,omitempty"`
AddIndex string `json:"add_index,omitempty"`
PaymentAddr string `json:"payment_addr,omitempty"`
lnrpc.AddInvoiceResponse
}
// TrackPaymentRequestOverride struct.
type TrackPaymentRequestOverride struct {
PaymentHash string `json:"payment_hash,omitempty"`
routerrpc.TrackPaymentRequest
}
// ClosedChannelsResponseOverride struct.
type ClosedChannelsResponseOverride struct {
Channels []*ChannelCloseSummaryOverride `json:"channels,omitempty"`
lnrpc.ClosedChannelsResponse
}
// ChannelCloseSummaryOverride struct
type ChannelCloseSummaryOverride struct {
ChanId string `json:"chan_id,omitempty"`
Capacity string `json:"capacity,omitempty"`
SettledBalance string `json:"settled_balance,omitempty"`
TimeLockedBalance string `json:"time_locked_balance,omitempty"`
CloseType string `json:"close_type,omitempty"`
OpenInitiator string `json:"open_initiator,omitempty"`
CloseInitiator string `json:"close_initiator,omitempty"`
Resolutions json.RawMessage `json:"resolutions,omitempty"`
AliasScids json.RawMessage `json:"alias_scids,omitempty"`
ZeroConfConfirmedScid json.RawMessage `json:"zero_conf_confirmed_scid,omitempty"`
lnrpc.ChannelCloseSummary
}