forked from lightningdevkit/ldk-node
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathldk_node.udl
734 lines (654 loc) · 19.8 KB
/
ldk_node.udl
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
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
namespace ldk_node {
Mnemonic generate_entropy_mnemonic();
Config default_config();
};
dictionary Config {
string storage_dir_path;
Network network;
sequence<SocketAddress>? listening_addresses;
NodeAlias? node_alias;
sequence<PublicKey> trusted_peers_0conf;
u64 probing_liquidity_limit_multiplier;
AnchorChannelsConfig? anchor_channels_config;
SendingParameters? sending_parameters;
};
dictionary AnchorChannelsConfig {
sequence<PublicKey> trusted_peers_no_reserve;
u64 per_channel_reserve_sats;
};
dictionary EsploraSyncConfig {
u64 onchain_wallet_sync_interval_secs;
u64 lightning_wallet_sync_interval_secs;
u64 fee_rate_cache_update_interval_secs;
};
enum LogLevel {
"Gossip",
"Trace",
"Debug",
"Info",
"Warn",
"Error",
};
dictionary LogRecord {
LogLevel level;
string args;
string module_path;
u32 line;
};
[Trait, WithForeign]
interface LogWriter {
void log(LogRecord record);
};
interface Builder {
constructor();
[Name=from_config]
constructor(Config config);
void set_entropy_seed_path(string seed_path);
[Throws=BuildError]
void set_entropy_seed_bytes(sequence<u8> seed_bytes);
void set_entropy_bip39_mnemonic(Mnemonic mnemonic, string? passphrase);
void set_chain_source_esplora(string server_url, EsploraSyncConfig? config);
void set_chain_source_bitcoind_rpc(string rpc_host, u16 rpc_port, string rpc_user, string rpc_password);
void set_gossip_source_p2p();
void set_gossip_source_rgs(string rgs_server_url);
void set_liquidity_source_lsps1(PublicKey node_id, SocketAddress address, string? token);
void set_liquidity_source_lsps2(PublicKey node_id, SocketAddress address, string? token);
void set_storage_dir_path(string storage_dir_path);
void set_filesystem_logger(string? log_file_path, LogLevel? log_level);
void set_log_facade_logger(LogLevel log_level);
void set_custom_logger(LogWriter log_writer);
void set_network(Network network);
[Throws=BuildError]
void set_listening_addresses(sequence<SocketAddress> listening_addresses);
[Throws=BuildError]
void set_node_alias(string node_alias);
[Throws=BuildError]
Node build();
[Throws=BuildError]
Node build_with_fs_store();
[Throws=BuildError]
Node build_with_vss_store(string vss_url, string store_id, string lnurl_auth_server_url, record<string, string> fixed_headers);
[Throws=BuildError]
Node build_with_vss_store_and_fixed_headers(string vss_url, string store_id, record<string, string> fixed_headers);
[Throws=BuildError]
Node build_with_vss_store_and_header_provider(string vss_url, string store_id, VssHeaderProvider header_provider);
};
interface Node {
[Throws=NodeError]
void start();
[Throws=NodeError]
void stop();
NodeStatus status();
Config config();
Event? next_event();
Event wait_next_event();
[Async]
Event next_event_async();
void event_handled();
PublicKey node_id();
sequence<SocketAddress>? listening_addresses();
NodeAlias? node_alias();
Bolt11Payment bolt11_payment();
Bolt12Payment bolt12_payment();
SpontaneousPayment spontaneous_payment();
OnchainPayment onchain_payment();
UnifiedQrPayment unified_qr_payment();
LSPS1Liquidity lsps1_liquidity();
[Throws=NodeError]
void connect(PublicKey node_id, SocketAddress address, boolean persist);
[Throws=NodeError]
void disconnect(PublicKey node_id);
[Throws=NodeError]
UserChannelId open_channel(PublicKey node_id, SocketAddress address, u64 channel_amount_sats, u64? push_to_counterparty_msat, ChannelConfig? channel_config);
[Throws=NodeError]
UserChannelId open_announced_channel(PublicKey node_id, SocketAddress address, u64 channel_amount_sats, u64? push_to_counterparty_msat, ChannelConfig? channel_config);
[Throws=NodeError]
void close_channel([ByRef]UserChannelId user_channel_id, PublicKey counterparty_node_id);
[Throws=NodeError]
void force_close_channel([ByRef]UserChannelId user_channel_id, PublicKey counterparty_node_id, string? reason);
[Throws=NodeError]
void update_channel_config([ByRef]UserChannelId user_channel_id, PublicKey counterparty_node_id, ChannelConfig channel_config);
[Throws=NodeError]
void sync_wallets();
PaymentDetails? payment([ByRef]PaymentId payment_id);
[Throws=NodeError]
void remove_payment([ByRef]PaymentId payment_id);
BalanceDetails list_balances();
sequence<PaymentDetails> list_payments();
sequence<PeerDetails> list_peers();
sequence<ChannelDetails> list_channels();
NetworkGraph network_graph();
string sign_message([ByRef]sequence<u8> msg);
boolean verify_signature([ByRef]sequence<u8> msg, [ByRef]string sig, [ByRef]PublicKey pkey);
};
[Enum]
interface Bolt11InvoiceDescription {
Hash(string hash);
Direct(string description);
};
interface Bolt11Payment {
[Throws=NodeError]
PaymentId send([ByRef]Bolt11Invoice invoice, SendingParameters? sending_parameters);
[Throws=NodeError]
PaymentId send_using_amount([ByRef]Bolt11Invoice invoice, u64 amount_msat, SendingParameters? sending_parameters);
[Throws=NodeError]
void send_probes([ByRef]Bolt11Invoice invoice);
[Throws=NodeError]
void send_probes_using_amount([ByRef]Bolt11Invoice invoice, u64 amount_msat);
[Throws=NodeError]
void claim_for_hash(PaymentHash payment_hash, u64 claimable_amount_msat, PaymentPreimage preimage);
[Throws=NodeError]
void fail_for_hash(PaymentHash payment_hash);
[Throws=NodeError]
Bolt11Invoice receive(u64 amount_msat, [ByRef]Bolt11InvoiceDescription description, u32 expiry_secs);
[Throws=NodeError]
Bolt11Invoice receive_for_hash(u64 amount_msat, [ByRef]Bolt11InvoiceDescription description, u32 expiry_secs, PaymentHash payment_hash);
[Throws=NodeError]
Bolt11Invoice receive_variable_amount([ByRef]Bolt11InvoiceDescription description, u32 expiry_secs);
[Throws=NodeError]
Bolt11Invoice receive_variable_amount_for_hash([ByRef]Bolt11InvoiceDescription description, u32 expiry_secs, PaymentHash payment_hash);
[Throws=NodeError]
Bolt11Invoice receive_via_jit_channel(u64 amount_msat, [ByRef]Bolt11InvoiceDescription description, u32 expiry_secs, u64? max_lsp_fee_limit_msat);
[Throws=NodeError]
Bolt11Invoice receive_variable_amount_via_jit_channel([ByRef]Bolt11InvoiceDescription description, u32 expiry_secs, u64? max_proportional_lsp_fee_limit_ppm_msat);
};
interface Bolt12Payment {
[Throws=NodeError]
PaymentId send([ByRef]Offer offer, u64? quantity, string? payer_note);
[Throws=NodeError]
PaymentId send_using_amount([ByRef]Offer offer, u64 amount_msat, u64? quantity, string? payer_note);
[Throws=NodeError]
Offer receive(u64 amount_msat, [ByRef]string description, u32? expiry_secs, u64? quantity);
[Throws=NodeError]
Offer receive_variable_amount([ByRef]string description, u32? expiry_secs);
[Throws=NodeError]
Bolt12Invoice request_refund_payment([ByRef]Refund refund);
[Throws=NodeError]
Refund initiate_refund(u64 amount_msat, u32 expiry_secs, u64? quantity, string? payer_note);
};
interface SpontaneousPayment {
[Throws=NodeError]
PaymentId send(u64 amount_msat, PublicKey node_id, SendingParameters? sending_parameters);
[Throws=NodeError]
PaymentId send_with_custom_tlvs(u64 amount_msat, PublicKey node_id, SendingParameters? sending_parameters, sequence<CustomTlvRecord> custom_tlvs);
[Throws=NodeError]
void send_probes(u64 amount_msat, PublicKey node_id);
};
interface OnchainPayment {
[Throws=NodeError]
Address new_address();
[Throws=NodeError]
Txid send_to_address([ByRef]Address address, u64 amount_sats, FeeRate? fee_rate);
[Throws=NodeError]
Txid send_all_to_address([ByRef]Address address, boolean retain_reserve, FeeRate? fee_rate);
};
interface FeeRate {
[Name=from_sat_per_kwu]
constructor(u64 sat_kwu);
[Name=from_sat_per_vb_unchecked]
constructor(u64 sat_vb);
u64 to_sat_per_kwu();
u64 to_sat_per_vb_floor();
u64 to_sat_per_vb_ceil();
};
interface UnifiedQrPayment {
[Throws=NodeError]
string receive(u64 amount_sats, [ByRef]string message, u32 expiry_sec);
[Throws=NodeError]
QrPaymentResult send([ByRef]string uri_str);
};
interface LSPS1Liquidity {
[Throws=NodeError]
LSPS1OrderStatus request_channel(u64 lsp_balance_sat, u64 client_balance_sat, u32 channel_expiry_blocks, boolean announce_channel);
[Throws=NodeError]
LSPS1OrderStatus check_order_status(OrderId order_id);
};
[Error]
enum NodeError {
"AlreadyRunning",
"NotRunning",
"OnchainTxCreationFailed",
"ConnectionFailed",
"InvoiceCreationFailed",
"InvoiceRequestCreationFailed",
"OfferCreationFailed",
"RefundCreationFailed",
"PaymentSendingFailed",
"InvalidCustomTlvs",
"ProbeSendingFailed",
"ChannelCreationFailed",
"ChannelClosingFailed",
"ChannelConfigUpdateFailed",
"PersistenceFailed",
"FeerateEstimationUpdateFailed",
"FeerateEstimationUpdateTimeout",
"WalletOperationFailed",
"WalletOperationTimeout",
"OnchainTxSigningFailed",
"TxSyncFailed",
"TxSyncTimeout",
"GossipUpdateFailed",
"GossipUpdateTimeout",
"LiquidityRequestFailed",
"UriParameterParsingFailed",
"InvalidAddress",
"InvalidSocketAddress",
"InvalidPublicKey",
"InvalidSecretKey",
"InvalidOfferId",
"InvalidNodeId",
"InvalidPaymentId",
"InvalidPaymentHash",
"InvalidPaymentPreimage",
"InvalidPaymentSecret",
"InvalidAmount",
"InvalidInvoice",
"InvalidOffer",
"InvalidRefund",
"InvalidChannelId",
"InvalidNetwork",
"InvalidUri",
"InvalidQuantity",
"InvalidNodeAlias",
"InvalidDateTime",
"InvalidFeeRate",
"DuplicatePayment",
"UnsupportedCurrency",
"InsufficientFunds",
"LiquiditySourceUnavailable",
"LiquidityFeeTooHigh",
};
dictionary NodeStatus {
boolean is_running;
boolean is_listening;
BestBlock current_best_block;
u64? latest_lightning_wallet_sync_timestamp;
u64? latest_onchain_wallet_sync_timestamp;
u64? latest_fee_rate_cache_update_timestamp;
u64? latest_rgs_snapshot_timestamp;
u64? latest_node_announcement_broadcast_timestamp;
u32? latest_channel_monitor_archival_height;
};
dictionary BestBlock {
BlockHash block_hash;
u32 height;
};
[Error]
enum BuildError {
"InvalidSeedBytes",
"InvalidSeedFile",
"InvalidSystemTime",
"InvalidChannelMonitor",
"InvalidListeningAddresses",
"InvalidNodeAlias",
"ReadFailed",
"WriteFailed",
"StoragePathAccessFailed",
"KVStoreSetupFailed",
"WalletSetupFailed",
"LoggerSetupFailed",
};
[Trait]
interface VssHeaderProvider {
[Async, Throws=VssHeaderProviderError]
record<string, string> get_headers([ByRef]sequence<u8> request);
};
[Error]
enum VssHeaderProviderError {
"InvalidData",
"RequestError",
"AuthorizationError",
"InternalError",
};
[Enum]
interface Event {
PaymentSuccessful(PaymentId? payment_id, PaymentHash payment_hash, PaymentPreimage? payment_preimage, u64? fee_paid_msat);
PaymentFailed(PaymentId? payment_id, PaymentHash? payment_hash, PaymentFailureReason? reason);
PaymentReceived(PaymentId? payment_id, PaymentHash payment_hash, u64 amount_msat, sequence<CustomTlvRecord> custom_records);
PaymentClaimable(PaymentId payment_id, PaymentHash payment_hash, u64 claimable_amount_msat, u32? claim_deadline, sequence<CustomTlvRecord> custom_records);
PaymentForwarded(ChannelId prev_channel_id, ChannelId next_channel_id, UserChannelId?
prev_user_channel_id, UserChannelId? next_user_channel_id, PublicKey? prev_node_id, PublicKey? next_node_id, u64? total_fee_earned_msat, u64? skimmed_fee_msat, boolean claim_from_onchain_tx, u64? outbound_amount_forwarded_msat);
ChannelPending(ChannelId channel_id, UserChannelId user_channel_id, ChannelId former_temporary_channel_id, PublicKey counterparty_node_id, OutPoint funding_txo);
ChannelReady(ChannelId channel_id, UserChannelId user_channel_id, PublicKey? counterparty_node_id);
ChannelClosed(ChannelId channel_id, UserChannelId user_channel_id, PublicKey? counterparty_node_id, ClosureReason? reason);
};
enum PaymentFailureReason {
"RecipientRejected",
"UserAbandoned",
"RetriesExhausted",
"PaymentExpired",
"RouteNotFound",
"UnexpectedError",
"UnknownRequiredFeatures",
"InvoiceRequestExpired",
"InvoiceRequestRejected",
"BlindedPathCreationFailed",
};
[Enum]
interface ClosureReason {
CounterpartyForceClosed(UntrustedString peer_msg);
HolderForceClosed(boolean? broadcasted_latest_txn);
LegacyCooperativeClosure();
CounterpartyInitiatedCooperativeClosure();
LocallyInitiatedCooperativeClosure();
CommitmentTxConfirmed();
FundingTimedOut();
ProcessingError(string err);
DisconnectedPeer();
OutdatedChannelManager();
CounterpartyCoopClosedUnfundedChannel();
FundingBatchClosure();
HTLCsTimedOut();
PeerFeerateTooLow(u32 peer_feerate_sat_per_kw, u32 required_feerate_sat_per_kw);
};
[Enum]
interface PaymentKind {
Onchain(Txid txid, ConfirmationStatus status);
Bolt11(PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret);
Bolt11Jit(PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret, LSPFeeLimits lsp_fee_limits);
Bolt12Offer(PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret, OfferId offer_id, UntrustedString? payer_note, u64? quantity);
Bolt12Refund(PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret, UntrustedString? payer_note, u64? quantity);
Spontaneous(PaymentHash hash, PaymentPreimage? preimage);
};
[Enum]
interface QrPaymentResult {
Onchain(Txid txid);
Bolt11(PaymentId payment_id);
Bolt12(PaymentId payment_id);
};
enum PaymentDirection {
"Inbound",
"Outbound",
};
enum PaymentStatus {
"Pending",
"Succeeded",
"Failed",
};
dictionary LSPFeeLimits {
u64? max_total_opening_fee_msat;
u64? max_proportional_opening_fee_ppm_msat;
};
[Enum]
interface ConfirmationStatus {
Confirmed (BlockHash block_hash, u32 height, u64 timestamp);
Unconfirmed ();
};
dictionary PaymentDetails {
PaymentId id;
PaymentKind kind;
u64? amount_msat;
PaymentDirection direction;
PaymentStatus status;
u64 latest_update_timestamp;
};
dictionary SendingParameters {
MaxTotalRoutingFeeLimit? max_total_routing_fee_msat;
u32? max_total_cltv_expiry_delta;
u8? max_path_count;
u8? max_channel_saturation_power_of_half;
};
dictionary CustomTlvRecord {
u64 type_num;
sequence<u8> value;
};
dictionary LSPS1OrderStatus {
OrderId order_id;
OrderParameters order_params;
PaymentInfo payment_options;
ChannelOrderInfo? channel_state;
};
dictionary OrderParameters {
u64 lsp_balance_sat;
u64 client_balance_sat;
u16 required_channel_confirmations;
u16 funding_confirms_within_blocks;
u32 channel_expiry_blocks;
string? token;
boolean announce_channel;
};
dictionary PaymentInfo {
Bolt11PaymentInfo? bolt11;
OnchainPaymentInfo? onchain;
};
dictionary Bolt11PaymentInfo {
PaymentState state;
DateTime expires_at;
u64 fee_total_sat;
u64 order_total_sat;
Bolt11Invoice invoice;
};
dictionary OnchainPaymentInfo {
PaymentState state;
DateTime expires_at;
u64 fee_total_sat;
u64 order_total_sat;
Address address;
u16? min_onchain_payment_confirmations;
FeeRate min_fee_for_0conf;
Address? refund_onchain_address;
};
dictionary ChannelOrderInfo {
DateTime funded_at;
OutPoint funding_outpoint;
DateTime expires_at;
};
enum PaymentState {
"ExpectPayment",
"Paid",
"Refunded",
};
[Enum]
interface MaxTotalRoutingFeeLimit {
None ();
Some ( u64 amount_msat );
};
[NonExhaustive]
enum Network {
"Bitcoin",
"Testnet",
"Signet",
"Regtest",
};
dictionary OutPoint {
Txid txid;
u32 vout;
};
dictionary ChannelDetails {
ChannelId channel_id;
PublicKey counterparty_node_id;
OutPoint? funding_txo;
u64? short_channel_id;
u64? outbound_scid_alias;
u64? inbound_scid_alias;
u64 channel_value_sats;
u64? unspendable_punishment_reserve;
UserChannelId user_channel_id;
u32 feerate_sat_per_1000_weight;
u64 outbound_capacity_msat;
u64 inbound_capacity_msat;
u32? confirmations_required;
u32? confirmations;
boolean is_outbound;
boolean is_channel_ready;
boolean is_usable;
boolean is_announced;
u16? cltv_expiry_delta;
u64 counterparty_unspendable_punishment_reserve;
u64? counterparty_outbound_htlc_minimum_msat;
u64? counterparty_outbound_htlc_maximum_msat;
u32? counterparty_forwarding_info_fee_base_msat;
u32? counterparty_forwarding_info_fee_proportional_millionths;
u16? counterparty_forwarding_info_cltv_expiry_delta;
u64 next_outbound_htlc_limit_msat;
u64 next_outbound_htlc_minimum_msat;
u16? force_close_spend_delay;
u64 inbound_htlc_minimum_msat;
u64? inbound_htlc_maximum_msat;
ChannelConfig config;
};
dictionary PeerDetails {
PublicKey node_id;
SocketAddress address;
boolean is_persisted;
boolean is_connected;
};
[Enum]
interface LightningBalance {
ClaimableOnChannelClose (
ChannelId channel_id,
PublicKey counterparty_node_id,
u64 amount_satoshis,
u64 transaction_fee_satoshis,
u64 outbound_payment_htlc_rounded_msat,
u64 outbound_forwarded_htlc_rounded_msat,
u64 inbound_claiming_htlc_rounded_msat,
u64 inbound_htlc_rounded_msat
);
ClaimableAwaitingConfirmations (
ChannelId channel_id,
PublicKey counterparty_node_id,
u64 amount_satoshis,
u32 confirmation_height,
BalanceSource source
);
ContentiousClaimable (
ChannelId channel_id,
PublicKey counterparty_node_id,
u64 amount_satoshis,
u32 timeout_height,
PaymentHash payment_hash,
PaymentPreimage payment_preimage
);
MaybeTimeoutClaimableHTLC (
ChannelId channel_id,
PublicKey counterparty_node_id,
u64 amount_satoshis,
u32 claimable_height,
PaymentHash payment_hash,
boolean outbound_payment
);
MaybePreimageClaimableHTLC (
ChannelId channel_id,
PublicKey counterparty_node_id,
u64 amount_satoshis,
u32 expiry_height,
PaymentHash payment_hash
);
CounterpartyRevokedOutputClaimable (
ChannelId channel_id,
PublicKey counterparty_node_id,
u64 amount_satoshis
);
};
enum BalanceSource {
"HolderForceClosed",
"CounterpartyForceClosed",
"CoopClose",
"Htlc",
};
[Enum]
interface PendingSweepBalance {
PendingBroadcast ( ChannelId? channel_id, u64 amount_satoshis );
BroadcastAwaitingConfirmation ( ChannelId? channel_id, u32 latest_broadcast_height, Txid latest_spending_txid, u64 amount_satoshis );
AwaitingThresholdConfirmations ( ChannelId? channel_id, Txid latest_spending_txid, BlockHash confirmation_hash, u32 confirmation_height, u64 amount_satoshis);
};
dictionary BalanceDetails {
u64 total_onchain_balance_sats;
u64 spendable_onchain_balance_sats;
u64 total_anchor_channels_reserve_sats;
u64 total_lightning_balance_sats;
sequence<LightningBalance> lightning_balances;
sequence<PendingSweepBalance> pending_balances_from_channel_closures;
};
dictionary ChannelConfig {
u32 forwarding_fee_proportional_millionths;
u32 forwarding_fee_base_msat;
u16 cltv_expiry_delta;
MaxDustHTLCExposure max_dust_htlc_exposure;
u64 force_close_avoidance_max_fee_satoshis;
boolean accept_underpaying_htlcs;
};
[Enum]
interface MaxDustHTLCExposure {
FixedLimit ( u64 limit_msat );
FeeRateMultiplier ( u64 multiplier );
};
interface NetworkGraph {
sequence<u64> list_channels();
ChannelInfo? channel(u64 short_channel_id);
sequence<NodeId> list_nodes();
NodeInfo? node([ByRef]NodeId node_id);
};
dictionary ChannelInfo {
NodeId node_one;
ChannelUpdateInfo? one_to_two;
NodeId node_two;
ChannelUpdateInfo? two_to_one;
u64? capacity_sats;
};
dictionary ChannelUpdateInfo {
u32 last_update;
boolean enabled;
u16 cltv_expiry_delta;
u64 htlc_minimum_msat;
u64 htlc_maximum_msat;
RoutingFees fees;
};
dictionary RoutingFees {
u32 base_msat;
u32 proportional_millionths;
};
dictionary NodeInfo {
sequence<u64> channels;
NodeAnnouncementInfo? announcement_info;
};
dictionary NodeAnnouncementInfo {
u32 last_update;
string alias;
sequence<SocketAddress> addresses;
};
[Custom]
typedef string Txid;
[Custom]
typedef string BlockHash;
[Custom]
typedef string SocketAddress;
[Custom]
typedef string PublicKey;
[Custom]
typedef string NodeId;
[Custom]
typedef string Address;
[Custom]
typedef string Bolt11Invoice;
[Custom]
typedef string Offer;
[Custom]
typedef string Refund;
[Custom]
typedef string Bolt12Invoice;
[Custom]
typedef string OfferId;
[Custom]
typedef string PaymentId;
[Custom]
typedef string PaymentHash;
[Custom]
typedef string PaymentPreimage;
[Custom]
typedef string PaymentSecret;
[Custom]
typedef string ChannelId;
[Custom]
typedef string UserChannelId;
[Custom]
typedef string Mnemonic;
[Custom]
typedef string UntrustedString;
[Custom]
typedef string NodeAlias;
[Custom]
typedef string OrderId;
[Custom]
typedef string DateTime;