lnrpc 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9481909a27ad229cd4d30887ef89068c0b90a8ff45c2113d89f5ae257052fb35
4
- data.tar.gz: 12e72406128b26d54b1512f6bfa56d246916902c2526275a5098922c23ffaf65
3
+ metadata.gz: 353271a0231be5f99b2979774980f7f7500846efaafefe95d04beb2fe7d4b8a5
4
+ data.tar.gz: e5b0b419399029853b50d2738aa299f5cd17403b2eee55dd354c0ca6ef8f0c43
5
5
  SHA512:
6
- metadata.gz: 442c9e2457ad6064fef6ccba011ff733272198a8fbc972fcabcc108e4e6f1d9b4f8c03300f56c5a854f47cfc5a8dc88c22cfdbae76e9d5020537c114c26f1ff1
7
- data.tar.gz: 6bfc611d1450f059c065739a9c8ee36c39b4c90e9c718f04eb60188fefb1769db7a4fef932433d966d8e5f0c2813716570388108eb28ae3ad0f24b725c4d3860
6
+ metadata.gz: f5b0aa7b9c3ce6cfc66c9779e920f6ff3f9cf2ca4bffd98f2ccc8eff18eae5f9c3752b7f26068baa8734c92bb80932a5458f521592a470ab134df6b98a0af9ee
7
+ data.tar.gz: 974f7023636ea5dd841a7bbcf9603b9fa43e657e55ee89850a5eb363ee74620d2d620c10bf3d09f3ce2230a70929070419b7ca5bc419e9398380f51d18267dc0
@@ -1,17 +1,12 @@
1
1
  require "lnrpc"
2
2
 
3
- lnd = Lnrpc::Client.new({
4
- credentials_path: '/home/bumi/lightning/bullet-testnet/2019-02-27/tls.cert',
5
- macaroon_path: '/home/bumi/lightning/bullet-testnet/2019-02-27/admin.macaroon',
6
- address: '79.137.71.183:10009'
7
- }) # use defaults for credentials, macaraoon and address
3
+ lnd = Lnrpc::Client.new() # use defaults for credentials, macaraoon and address
8
4
 
9
5
  get_info_res = lnd.get_info
10
6
  puts get_info_res.alias
11
7
 
12
8
  puts lnd.wallet_balance.total_balance
13
9
 
14
- exit
15
10
  pay_request = "lntb50u1pw9mmndpp5nvnff958pxc9eqknwntyxapjw7l5grt5e2y70cmmnu0lljfa0sdqdpsgfkx7cmtwd68yetpd5s9xct5v4kxc6t5v5s8yatz0ysxwetdcqzysxqyz5vqjkhlyn40z76gyn7dx32p9j58dftve9xrlvnqqazht7w2fdauukhyhr9y4k3ngjn8s6srglj8swk7tm70ng54wdkq47ahytpwffvaeusp500csz"
16
11
  lnd.pay(pay_request) # or:
17
12
  lnd.send_payment_sync(payment_request: pay_request)
@@ -94,13 +94,15 @@ service WalletUnlocker {
94
94
  message GenSeedRequest {
95
95
  /**
96
96
  aezeed_passphrase is an optional user provided passphrase that will be used
97
- to encrypt the generated aezeed cipher seed.
97
+ to encrypt the generated aezeed cipher seed. When using REST, this field
98
+ must be encoded as base64.
98
99
  */
99
100
  bytes aezeed_passphrase = 1;
100
101
 
101
102
  /**
102
103
  seed_entropy is an optional 16-bytes generated via CSPRNG. If not
103
104
  specified, then a fresh set of randomness will be used to create the seed.
105
+ When using REST, this field must be encoded as base64.
104
106
  */
105
107
  bytes seed_entropy = 2;
106
108
  }
@@ -125,7 +127,8 @@ message InitWalletRequest {
125
127
  /**
126
128
  wallet_password is the passphrase that should be used to encrypt the
127
129
  wallet. This MUST be at least 8 chars in length. After creation, this
128
- password is required to unlock the daemon.
130
+ password is required to unlock the daemon. When using REST, this field
131
+ must be encoded as base64.
129
132
  */
130
133
  bytes wallet_password = 1;
131
134
 
@@ -138,7 +141,8 @@ message InitWalletRequest {
138
141
 
139
142
  /**
140
143
  aezeed_passphrase is an optional user provided passphrase that will be used
141
- to encrypt the generated aezeed cipher seed.
144
+ to encrypt the generated aezeed cipher seed. When using REST, this field
145
+ must be encoded as base64.
142
146
  */
143
147
  bytes aezeed_passphrase = 3;
144
148
 
@@ -168,7 +172,7 @@ message UnlockWalletRequest {
168
172
  /**
169
173
  wallet_password should be the current valid passphrase for the daemon. This
170
174
  will be required to decrypt on-disk material that the daemon requires to
171
- function properly.
175
+ function properly. When using REST, this field must be encoded as base64.
172
176
  */
173
177
  bytes wallet_password = 1;
174
178
 
@@ -196,13 +200,13 @@ message UnlockWalletResponse {}
196
200
  message ChangePasswordRequest {
197
201
  /**
198
202
  current_password should be the current valid passphrase used to unlock the
199
- daemon.
203
+ daemon. When using REST, this field must be encoded as base64.
200
204
  */
201
205
  bytes current_password = 1;
202
206
 
203
207
  /**
204
208
  new_password should be the new passphrase that will be needed to unlock the
205
- daemon.
209
+ daemon. When using REST, this field must be encoded as base64.
206
210
  */
207
211
  bytes new_password = 2;
208
212
  }
@@ -355,6 +359,13 @@ service Lightning {
355
359
  };
356
360
  }
357
361
 
362
+ /**
363
+ SubscribePeerEvents creates a uni-directional stream from the server to
364
+ the client in which any events relevant to the state of peers are sent
365
+ over. Events include peers going online and offline.
366
+ */
367
+ rpc SubscribePeerEvents (PeerEventSubscription) returns (stream PeerEvent);
368
+
358
369
  /** lncli: `getinfo`
359
370
  GetInfo returns general information concerning the lightning node including
360
371
  it's identity pubkey, alias, the chains it is connected to, and information
@@ -426,10 +437,25 @@ service Lightning {
426
437
  request to a remote peer. Users are able to specify a target number of
427
438
  blocks that the funding transaction should be confirmed in, or a manual fee
428
439
  rate to us for the funding transaction. If neither are specified, then a
429
- lax block confirmation target is used.
440
+ lax block confirmation target is used. Each OpenStatusUpdate will return
441
+ the pending channel ID of the in-progress channel. Depending on the
442
+ arguments specified in the OpenChannelRequest, this pending channel ID can
443
+ then be used to manually progress the channel funding flow.
430
444
  */
431
445
  rpc OpenChannel (OpenChannelRequest) returns (stream OpenStatusUpdate);
432
446
 
447
+ /**
448
+ FundingStateStep is an advanced funding related call that allows the caller
449
+ to either execute some preparatory steps for a funding workflow, or
450
+ manually progress a funding workflow. The primary way a funding flow is
451
+ identified is via its pending channel ID. As an example, this method can be
452
+ used to specify that we're expecting a funding flow for a particular
453
+ pending channel ID, for which we need to use specific parameters.
454
+ Alternatively, this can be used to interactively drive PSBT signing for
455
+ funding for partially complete funding transactions.
456
+ */
457
+ rpc FundingStateStep(FundingTransitionMsg) returns (FundingStateStepResp);
458
+
433
459
  /**
434
460
  ChannelAcceptor dispatches a bi-directional streaming RPC in which
435
461
  OpenChannel requests are sent to the client and the client responds with
@@ -550,9 +576,9 @@ service Lightning {
550
576
  notifying the client of newly added/settled invoices. The caller can
551
577
  optionally specify the add_index and/or the settle_index. If the add_index
552
578
  is specified, then we'll first start by sending add invoice events for all
553
- invoices with an add_index greater than the specified value. If the
579
+ invoices with an add_index greater than the specified value. If the
554
580
  settle_index is specified, the next, we'll send out all settle events for
555
- invoices with a settle_index greater than the specified value. One or both
581
+ invoices with a settle_index greater than the specified value. One or both
556
582
  of these fields can be set. If no fields are set, then we'll only send out
557
583
  the latest add/settle events.
558
584
  */
@@ -595,7 +621,7 @@ service Lightning {
595
621
  DescribeGraph returns a description of the latest graph state from the
596
622
  point of view of the node. The graph information is partitioned into two
597
623
  components: all the nodes/vertexes, and all the edges that connect the
598
- vertexes themselves. As this is a directed graph, the edges also contain
624
+ vertexes themselves. As this is a directed graph, the edges also contain
599
625
  the node directional specific routing policy which includes: the time lock
600
626
  delta, fee information, etc.
601
627
  */
@@ -703,7 +729,7 @@ service Lightning {
703
729
 
704
730
  A list of forwarding events are returned. The size of each forwarding event
705
731
  is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB.
706
- As a result each message can only contain 50k entries. Each response has
732
+ As a result each message can only contain 50k entries. Each response has
707
733
  the index offset of the last entry. The index offset can be provided to the
708
734
  request to allow the caller to skip a series of records.
709
735
  */
@@ -777,6 +803,18 @@ service Lightning {
777
803
  */
778
804
  rpc SubscribeChannelBackups(ChannelBackupSubscription) returns (stream ChanBackupSnapshot) {
779
805
  };
806
+
807
+ /** lncli: `bakemacaroon`
808
+ BakeMacaroon allows the creation of a new macaroon with custom read and
809
+ write permissions. No first-party caveats are added since this can be done
810
+ offline.
811
+ */
812
+ rpc BakeMacaroon(BakeMacaroonRequest) returns (BakeMacaroonResponse) {
813
+ option (google.api.http) = {
814
+ post: "/v1/macaroon"
815
+ body: "*"
816
+ };
817
+ };
780
818
  }
781
819
 
782
820
  message Utxo {
@@ -836,32 +874,66 @@ message TransactionDetails {
836
874
 
837
875
  message FeeLimit {
838
876
  oneof limit {
839
- /// The fee limit expressed as a fixed amount of satoshis.
877
+ /**
878
+ The fee limit expressed as a fixed amount of satoshis.
879
+
880
+ The fields fixed and fixed_msat are mutually exclusive.
881
+ */
840
882
  int64 fixed = 1;
841
883
 
884
+ /**
885
+ The fee limit expressed as a fixed amount of millisatoshis.
886
+
887
+ The fields fixed and fixed_msat are mutually exclusive.
888
+ */
889
+ int64 fixed_msat = 3;
890
+
842
891
  /// The fee limit expressed as a percentage of the payment amount.
843
892
  int64 percent = 2;
844
893
  }
845
894
  }
846
895
 
847
896
  message SendRequest {
848
- /// The identity pubkey of the payment recipient
897
+ /**
898
+ The identity pubkey of the payment recipient. When using REST, this field
899
+ must be encoded as base64.
900
+ */
849
901
  bytes dest = 1;
850
902
 
851
- /// The hex-encoded identity pubkey of the payment recipient
852
- string dest_string = 2;
903
+ /**
904
+ The hex-encoded identity pubkey of the payment recipient. Deprecated now
905
+ that the REST gateway supports base64 encoding of bytes fields.
906
+ */
907
+ string dest_string = 2 [deprecated = true];
853
908
 
854
- /// Number of satoshis to send.
909
+ /**
910
+ The amount to send expressed in satoshis.
911
+
912
+ The fields amt and amt_msat are mutually exclusive.
913
+ */
855
914
  int64 amt = 3;
856
915
 
857
- /// The hash to use within the payment's HTLC
916
+ /**
917
+ The amount to send expressed in millisatoshis.
918
+
919
+ The fields amt and amt_msat are mutually exclusive.
920
+ */
921
+ int64 amt_msat = 12;
922
+
923
+ /**
924
+ The hash to use within the payment's HTLC. When using REST, this field
925
+ must be encoded as base64.
926
+ */
858
927
  bytes payment_hash = 4;
859
928
 
860
- /// The hex-encoded hash to use within the payment's HTLC
861
- string payment_hash_string = 5;
929
+ /**
930
+ The hex-encoded hash to use within the payment's HTLC. Deprecated now
931
+ that the REST gateway supports base64 encoding of bytes fields.
932
+ */
933
+ string payment_hash_string = 5 [deprecated = true];
862
934
 
863
935
  /**
864
- A bare-bones invoice for a payment within the Lightning Network. With the
936
+ A bare-bones invoice for a payment within the Lightning Network. With the
865
937
  details of the invoice, the sender has all the data necessary to send a
866
938
  payment to the recipient.
867
939
  */
@@ -885,7 +957,12 @@ message SendRequest {
885
957
  The channel id of the channel that must be taken to the first hop. If zero,
886
958
  any channel may be used.
887
959
  */
888
- uint64 outgoing_chan_id = 9;
960
+ uint64 outgoing_chan_id = 9 [jstype = JS_STRING];
961
+
962
+ /**
963
+ The pubkey of the last hop of the route. If empty, any hop may be used.
964
+ */
965
+ bytes last_hop_pubkey = 13;
889
966
 
890
967
  /**
891
968
  An optional maximum total time lock for the route. This should not exceed
@@ -897,9 +974,23 @@ message SendRequest {
897
974
  /**
898
975
  An optional field that can be used to pass an arbitrary set of TLV records
899
976
  to a peer which understands the new records. This can be used to pass
900
- application specific data during the payment attempt.
977
+ application specific data during the payment attempt. Record types are
978
+ required to be in the custom range >= 65536. When using REST, the values
979
+ must be encoded as base64.
901
980
  */
902
- map<uint64, bytes> dest_tlv = 11;
981
+ map<uint64, bytes> dest_custom_records = 11;
982
+
983
+ /// If set, circular payments to self are permitted.
984
+ bool allow_self_payment = 14;
985
+
986
+ /**
987
+ Features assumed to be supported by the final node. All transitive feature
988
+ depdencies must also be set properly. For a given feature bit pair, either
989
+ optional or remote may be set, but not both. If this field is nil or empty,
990
+ the router will try to load destination features from the graph as a
991
+ fallback.
992
+ */
993
+ repeated FeatureBit dest_features = 15;
903
994
  }
904
995
 
905
996
  message SendResponse {
@@ -910,11 +1001,17 @@ message SendResponse {
910
1001
  }
911
1002
 
912
1003
  message SendToRouteRequest {
913
- /// The payment hash to use for the HTLC.
1004
+ /**
1005
+ The payment hash to use for the HTLC. When using REST, this field must be
1006
+ encoded as base64.
1007
+ */
914
1008
  bytes payment_hash = 1;
915
1009
 
916
- /// An optional hex-encoded payment hash to be used for the HTLC.
917
- string payment_hash_string = 2;
1010
+ /**
1011
+ An optional hex-encoded payment hash to be used for the HTLC. Deprecated now
1012
+ that the REST gateway supports base64 encoding of bytes fields.
1013
+ */
1014
+ string payment_hash_string = 2 [deprecated = true];
918
1015
 
919
1016
  reserved 3;
920
1017
 
@@ -976,10 +1073,16 @@ message ChannelAcceptResponse {
976
1073
 
977
1074
  message ChannelPoint {
978
1075
  oneof funding_txid {
979
- /// Txid of the funding transaction
1076
+ /**
1077
+ Txid of the funding transaction. When using REST, this field must be
1078
+ encoded as base64.
1079
+ */
980
1080
  bytes funding_txid_bytes = 1 [json_name = "funding_txid_bytes"];
981
1081
 
982
- /// Hex-encoded string representing the funding transaction
1082
+ /**
1083
+ Hex-encoded string representing the byte-reversed hash of the funding
1084
+ transaction.
1085
+ */
983
1086
  string funding_txid_str = 2 [json_name = "funding_txid_str"];
984
1087
  }
985
1088
 
@@ -1097,7 +1200,10 @@ message NewAddressResponse {
1097
1200
  }
1098
1201
 
1099
1202
  message SignMessageRequest {
1100
- /// The message to be signed
1203
+ /**
1204
+ The message to be signed. When using REST, this field must be encoded as
1205
+ base64.
1206
+ */
1101
1207
  bytes msg = 1 [ json_name = "msg" ];
1102
1208
  }
1103
1209
  message SignMessageResponse {
@@ -1106,7 +1212,10 @@ message SignMessageResponse {
1106
1212
  }
1107
1213
 
1108
1214
  message VerifyMessageRequest {
1109
- /// The message over which the signature is to be verified
1215
+ /**
1216
+ The message over which the signature is to be verified. When using REST,
1217
+ this field must be encoded as base64.
1218
+ */
1110
1219
  bytes msg = 1 [ json_name = "msg" ];
1111
1220
 
1112
1221
  /// The signature to be verified over the given message
@@ -1125,7 +1234,7 @@ message ConnectPeerRequest {
1125
1234
  LightningAddress addr = 1;
1126
1235
 
1127
1236
  /** If set, the daemon will attempt to persistently connect to the target
1128
- * peer. Otherwise, the call will be synchronous. */
1237
+ * peer. Otherwise, the call will be synchronous. */
1129
1238
  bool perm = 2;
1130
1239
  }
1131
1240
  message ConnectPeerResponse {
@@ -1164,7 +1273,7 @@ message Channel {
1164
1273
  height, the next 3 the index within the block, and the last 2 bytes are the
1165
1274
  output index for the channel.
1166
1275
  */
1167
- uint64 chan_id = 4 [json_name = "chan_id"];
1276
+ uint64 chan_id = 4 [json_name = "chan_id", jstype = JS_STRING];
1168
1277
 
1169
1278
  /// The total amount of funds held in this channel
1170
1279
  int64 capacity = 5 [json_name = "capacity"];
@@ -1246,6 +1355,28 @@ message Channel {
1246
1355
  directly to that key.
1247
1356
  */
1248
1357
  bool static_remote_key = 22 [json_name = "static_remote_key"];
1358
+
1359
+ /**
1360
+ The number of seconds that the channel has been monitored by the channel
1361
+ scoring system. Scores are currently not persisted, so this value may be
1362
+ less than the lifetime of the channel [EXPERIMENTAL].
1363
+ */
1364
+ int64 lifetime = 23 [json_name = "lifetime"];
1365
+
1366
+ /**
1367
+ The number of seconds that the remote peer has been observed as being online
1368
+ by the channel scoring system over the lifetime of the channel [EXPERIMENTAL].
1369
+ */
1370
+ int64 uptime = 24 [json_name = "uptime"];
1371
+
1372
+ /**
1373
+ Close address is the address that we will enforce payout to on cooperative
1374
+ close if the channel was opened utilizing option upfront shutdown. This
1375
+ value can be set on channel open by setting close_address in an open channel
1376
+ request. If this value is not set, you can still choose a payout address by
1377
+ cooperatively closing with the delivery_address field set.
1378
+ */
1379
+ string close_address = 25 [json_name ="close_address"];
1249
1380
  }
1250
1381
 
1251
1382
 
@@ -1265,7 +1396,7 @@ message ChannelCloseSummary {
1265
1396
  string channel_point = 1 [json_name = "channel_point"];
1266
1397
 
1267
1398
  /// The unique channel ID for the channel.
1268
- uint64 chan_id = 2 [json_name = "chan_id"];
1399
+ uint64 chan_id = 2 [json_name = "chan_id", jstype = JS_STRING];
1269
1400
 
1270
1401
  /// The hash of the genesis block that this channel resides within.
1271
1402
  string chain_hash = 3 [json_name = "chain_hash"];
@@ -1358,6 +1489,9 @@ message Peer {
1358
1489
 
1359
1490
  // The type of sync we are currently performing with this peer.
1360
1491
  SyncType sync_type = 10 [json_name = "sync_type"];
1492
+
1493
+ /// Features advertised by the remote peer in their init message.
1494
+ map<uint32, Feature> features = 11 [json_name = "features"];
1361
1495
  }
1362
1496
 
1363
1497
  message ListPeersRequest {
@@ -1367,22 +1501,46 @@ message ListPeersResponse {
1367
1501
  repeated Peer peers = 1 [json_name = "peers"];
1368
1502
  }
1369
1503
 
1504
+ message PeerEventSubscription {
1505
+ }
1506
+
1507
+ message PeerEvent {
1508
+ /// The identity pubkey of the peer.
1509
+ string pub_key = 1 [json_name = "pub_key"];
1510
+
1511
+ enum EventType {
1512
+ PEER_ONLINE = 0;
1513
+ PEER_OFFLINE = 1;
1514
+ }
1515
+
1516
+ EventType type = 2 [ json_name = "type" ];
1517
+ }
1518
+
1370
1519
  message GetInfoRequest {
1371
1520
  }
1372
1521
  message GetInfoResponse {
1373
1522
 
1523
+ /// The version of the LND software that the node is running.
1524
+ string version = 14 [ json_name = "version" ];
1525
+
1374
1526
  /// The identity pubkey of the current node.
1375
1527
  string identity_pubkey = 1 [json_name = "identity_pubkey"];
1376
1528
 
1377
1529
  /// If applicable, the alias of the current node, e.g. "bob"
1378
1530
  string alias = 2 [json_name = "alias"];
1379
1531
 
1532
+ /// The color of the current node in hex code format
1533
+ string color = 17 [json_name = "color"];
1534
+
1380
1535
  /// Number of pending channels
1381
1536
  uint32 num_pending_channels = 3 [json_name = "num_pending_channels"];
1382
1537
 
1383
1538
  /// Number of active channels
1384
1539
  uint32 num_active_channels = 4 [json_name = "num_active_channels"];
1385
1540
 
1541
+ /// Number of inactive channels
1542
+ uint32 num_inactive_channels = 15 [json_name = "num_inactive_channels"];
1543
+
1386
1544
  /// Number of peers
1387
1545
  uint32 num_peers = 5 [json_name = "num_peers"];
1388
1546
 
@@ -1392,9 +1550,15 @@ message GetInfoResponse {
1392
1550
  /// The node's current view of the hash of the best block
1393
1551
  string block_hash = 8 [json_name = "block_hash"];
1394
1552
 
1553
+ /// Timestamp of the block best known to the wallet
1554
+ int64 best_header_timestamp = 13 [ json_name = "best_header_timestamp" ];
1555
+
1395
1556
  /// Whether the wallet's view is synced to the main chain
1396
1557
  bool synced_to_chain = 9 [json_name = "synced_to_chain"];
1397
1558
 
1559
+ // Whether we consider ourselves synced with the public channel graph.
1560
+ bool synced_to_graph = 18 [json_name = "synced_to_graph"];
1561
+
1398
1562
  /**
1399
1563
  Whether the current node is connected to testnet. This field is
1400
1564
  deprecated and the network field should be used instead
@@ -1403,26 +1567,17 @@ message GetInfoResponse {
1403
1567
 
1404
1568
  reserved 11;
1405
1569
 
1406
- /// The URIs of the current node.
1407
- repeated string uris = 12 [json_name = "uris"];
1408
-
1409
- /// Timestamp of the block best known to the wallet
1410
- int64 best_header_timestamp = 13 [ json_name = "best_header_timestamp" ];
1411
-
1412
- /// The version of the LND software that the node is running.
1413
- string version = 14 [ json_name = "version" ];
1414
-
1415
- /// Number of inactive channels
1416
- uint32 num_inactive_channels = 15 [json_name = "num_inactive_channels"];
1417
-
1418
1570
  /// A list of active chains the node is connected to
1419
1571
  repeated Chain chains = 16 [json_name = "chains"];
1420
1572
 
1421
- /// The color of the current node in hex code format
1422
- string color = 17 [json_name = "color"];
1573
+ /// The URIs of the current node.
1574
+ repeated string uris = 12 [json_name = "uris"];
1423
1575
 
1424
- // Whether we consider ourselves synced with the public channel graph.
1425
- bool synced_to_graph = 18 [json_name = "synced_to_graph"];
1576
+ /*
1577
+ Features that our node has advertised in our init message, node
1578
+ announcements and invoices.
1579
+ */
1580
+ map<uint32, Feature> features = 19 [json_name = "features"];
1426
1581
  }
1427
1582
 
1428
1583
  message Chain {
@@ -1466,6 +1621,14 @@ message CloseChannelRequest {
1466
1621
 
1467
1622
  /// A manual fee rate set in sat/byte that should be used when crafting the closure transaction.
1468
1623
  int64 sat_per_byte = 4;
1624
+
1625
+ /*
1626
+ An optional address to send funds to in the case of a cooperative close.
1627
+ If the channel was opened with an upfront shutdown script and this field
1628
+ is set, the request to close will fail because the channel must pay out
1629
+ to the upfront shutdown addresss.
1630
+ */
1631
+ string delivery_address = 5 [json_name = "delivery_address"];
1469
1632
  }
1470
1633
 
1471
1634
  message CloseStatusUpdate {
@@ -1481,11 +1644,17 @@ message PendingUpdate {
1481
1644
  }
1482
1645
 
1483
1646
  message OpenChannelRequest {
1484
- /// The pubkey of the node to open a channel with
1647
+ /**
1648
+ The pubkey of the node to open a channel with. When using REST, this field
1649
+ must be encoded as base64.
1650
+ */
1485
1651
  bytes node_pubkey = 2 [json_name = "node_pubkey"];
1486
1652
 
1487
- /// The hex encoded pubkey of the node to open a channel with
1488
- string node_pubkey_string = 3 [json_name = "node_pubkey_string"];
1653
+ /**
1654
+ The hex encoded pubkey of the node to open a channel with. Deprecated now
1655
+ that the REST gateway supports base64 encoding of bytes fields.
1656
+ */
1657
+ string node_pubkey_string = 3 [json_name = "node_pubkey_string", deprecated = true];
1489
1658
 
1490
1659
  /// The number of satoshis the wallet should commit to the channel
1491
1660
  int64 local_funding_amount = 4 [json_name = "local_funding_amount"];
@@ -1513,14 +1682,114 @@ message OpenChannelRequest {
1513
1682
 
1514
1683
  /// Whether unconfirmed outputs should be used as inputs for the funding transaction.
1515
1684
  bool spend_unconfirmed = 12 [json_name = "spend_unconfirmed"];
1685
+
1686
+ /*
1687
+ Close address is an optional address which specifies the address to which
1688
+ funds should be paid out to upon cooperative close. This field may only be
1689
+ set if the peer supports the option upfront feature bit (call listpeers
1690
+ to check). The remote peer will only accept cooperative closes to this
1691
+ address if it is set.
1692
+
1693
+ Note: If this value is set on channel creation, you will *not* be able to
1694
+ cooperatively close out to a different address.
1695
+ */
1696
+ string close_address = 13 [json_name = "close_address"];
1697
+
1698
+ /**
1699
+ Funding shims are an optional argument that allow the caller to intercept
1700
+ certain funding functionality. For example, a shim can be provided to use a
1701
+ particular key for the commitment key (ideally cold) rather than use one
1702
+ that is generated by the wallet as normal, or signal that signing will be
1703
+ carried out in an interactive manner (PSBT based).
1704
+ */
1705
+ FundingShim funding_shim = 14 [json_name = "funding_shim"];
1516
1706
  }
1517
1707
  message OpenStatusUpdate {
1518
1708
  oneof update {
1519
1709
  PendingUpdate chan_pending = 1 [json_name = "chan_pending"];
1520
1710
  ChannelOpenUpdate chan_open = 3 [json_name = "chan_open"];
1711
+ }
1712
+
1713
+ /**
1714
+ The pending channel ID of the created channel. This value may be used to
1715
+ further the funding flow manually via the FundingStateStep method.
1716
+ */
1717
+ bytes pending_chan_id = 4 [json_name = "pending_chan_id"];
1718
+ }
1719
+
1720
+ message KeyLocator {
1721
+ /// The family of key being identified.
1722
+ int32 key_family = 1;
1723
+
1724
+ /// The precise index of the key being identified.
1725
+ int32 key_index = 2;
1726
+ }
1727
+
1728
+ message KeyDescriptor {
1729
+ /**
1730
+ The raw bytes of the key being identified.
1731
+ */
1732
+ bytes raw_key_bytes = 1;
1733
+
1734
+ /**
1735
+ The key locator that identifies which key to use for signing.
1736
+ */
1737
+ KeyLocator key_loc = 2;
1738
+ }
1739
+
1740
+ message ChanPointShim {
1741
+ /**
1742
+ The size of the pre-crafted output to be used as the channel point for this
1743
+ channel funding.
1744
+ */
1745
+ int64 amt = 1;
1746
+
1747
+ /// The target channel point to refrence in created commitment transactions.
1748
+ ChannelPoint chan_point = 2;
1749
+
1750
+ /// Our local key to use when creating the multi-sig output.
1751
+ KeyDescriptor local_key = 3;
1752
+
1753
+ /// The key of the remote party to use when creating the multi-sig output.
1754
+ bytes remote_key = 4;
1755
+
1756
+ /**
1757
+ If non-zero, then this will be used as the pending channel ID on the wire
1758
+ protocol to initate the funding request. This is an optional field, and
1759
+ should only be set if the responder is already expecting a specific pending
1760
+ channel ID.
1761
+ */
1762
+ bytes pending_chan_id = 5;
1763
+ }
1764
+
1765
+ message FundingShim {
1766
+ oneof shim {
1767
+ ChanPointShim chan_point_shim = 1;
1521
1768
  }
1522
1769
  }
1523
1770
 
1771
+ message FundingShimCancel {
1772
+ /// The pending channel ID of the channel to cancel the funding shim for.
1773
+ bytes pending_chan_id = 1;
1774
+ }
1775
+
1776
+ message FundingTransitionMsg {
1777
+ oneof trigger {
1778
+ /**
1779
+ The funding shim to regsiter. This should be used before any
1780
+ channel funding has began by the remote party, as it is intended as a
1781
+ prepatory step for the full channel funding.
1782
+ */
1783
+ FundingShim shim_register = 1;
1784
+
1785
+ /// Used to cancel an existing registered funding shim.
1786
+ FundingShimCancel shim_cancel = 2;
1787
+ }
1788
+ }
1789
+
1790
+ message FundingStateStepResp {
1791
+ }
1792
+
1524
1793
  message PendingHTLC {
1525
1794
 
1526
1795
  /// The direction within the channel that the htlc was sent
@@ -1700,12 +1969,29 @@ message QueryRoutesRequest {
1700
1969
  /// The 33-byte hex-encoded public key for the payment destination
1701
1970
  string pub_key = 1;
1702
1971
 
1703
- /// The amount to send expressed in satoshis
1972
+ /**
1973
+ The amount to send expressed in satoshis.
1974
+
1975
+ The fields amt and amt_msat are mutually exclusive.
1976
+ */
1704
1977
  int64 amt = 2;
1705
1978
 
1979
+ /**
1980
+ The amount to send expressed in millisatoshis.
1981
+
1982
+ The fields amt and amt_msat are mutually exclusive.
1983
+ */
1984
+ int64 amt_msat = 12;
1985
+
1706
1986
  reserved 3;
1707
1987
 
1708
- /// An optional CLTV delta from the current height that should be used for the timelock of the final hop
1988
+ /**
1989
+ An optional CLTV delta from the current height that should be used for the
1990
+ timelock of the final hop. Note that unlike SendPayment, QueryRoutes does
1991
+ not add any additional block padding on top of final_ctlv_delta. This
1992
+ padding of a few blocks needs to be added manually or otherwise failures may
1993
+ happen when a block comes in while the payment is in flight.
1994
+ */
1709
1995
  int32 final_cltv_delta = 4;
1710
1996
 
1711
1997
  /**
@@ -1717,7 +2003,8 @@ message QueryRoutesRequest {
1717
2003
  FeeLimit fee_limit = 5;
1718
2004
 
1719
2005
  /**
1720
- A list of nodes to ignore during path finding.
2006
+ A list of nodes to ignore during path finding. When using REST, these fields
2007
+ must be encoded as base64.
1721
2008
  */
1722
2009
  repeated bytes ignored_nodes = 6;
1723
2010
 
@@ -1749,19 +2036,60 @@ message QueryRoutesRequest {
1749
2036
  zero, then the value of `--max-cltv-expiry` is used as the limit.
1750
2037
  */
1751
2038
  uint32 cltv_limit = 11;
2039
+
2040
+ /**
2041
+ An optional field that can be used to pass an arbitrary set of TLV records
2042
+ to a peer which understands the new records. This can be used to pass
2043
+ application specific data during the payment attempt. If the destination
2044
+ does not support the specified recrods, and error will be returned.
2045
+ Record types are required to be in the custom range >= 65536. When using
2046
+ REST, the values must be encoded as base64.
2047
+ */
2048
+ map<uint64, bytes> dest_custom_records = 13;
2049
+
2050
+ /**
2051
+ The channel id of the channel that must be taken to the first hop. If zero,
2052
+ any channel may be used.
2053
+ */
2054
+ uint64 outgoing_chan_id = 14 [jstype = JS_STRING];
2055
+
2056
+ /**
2057
+ The pubkey of the last hop of the route. If empty, any hop may be used.
2058
+ */
2059
+ bytes last_hop_pubkey = 15;
2060
+
2061
+ /**
2062
+ Optional route hints to reach the destination through private channels.
2063
+ */
2064
+ repeated lnrpc.RouteHint route_hints = 16;
2065
+
2066
+ /**
2067
+ Features assumed to be supported by the final node. All transitive feature
2068
+ depdencies must also be set properly. For a given feature bit pair, either
2069
+ optional or remote may be set, but not both. If this field is nil or empty,
2070
+ the router will try to load destination features from the graph as a
2071
+ fallback.
2072
+ */
2073
+ repeated lnrpc.FeatureBit dest_features = 17;
1752
2074
  }
1753
2075
 
1754
2076
  message NodePair {
1755
- /// The sending node of the pair.
2077
+ /**
2078
+ The sending node of the pair. When using REST, this field must be encoded as
2079
+ base64.
2080
+ */
1756
2081
  bytes from = 1;
1757
2082
 
1758
- /// The receiving node of the pair.
2083
+ /**
2084
+ The receiving node of the pair. When using REST, this field must be encoded
2085
+ as base64.
2086
+ */
1759
2087
  bytes to = 2;
1760
2088
  }
1761
2089
 
1762
2090
  message EdgeLocator {
1763
2091
  /// The short channel id of this edge.
1764
- uint64 channel_id = 1;
2092
+ uint64 channel_id = 1 [jstype = JS_STRING];
1765
2093
 
1766
2094
  /**
1767
2095
  The direction of this edge. If direction_reverse is false, the direction
@@ -1792,7 +2120,7 @@ message Hop {
1792
2120
  height, the next 3 the index within the block, and the last 2 bytes are the
1793
2121
  output index for the channel.
1794
2122
  */
1795
- uint64 chan_id = 1 [json_name = "chan_id"];
2123
+ uint64 chan_id = 1 [json_name = "chan_id", jstype = JS_STRING];
1796
2124
  int64 chan_capacity = 2 [json_name = "chan_capacity"];
1797
2125
  int64 amt_to_forward = 3 [json_name = "amt_to_forward", deprecated = true];
1798
2126
  int64 fee = 4 [json_name = "fee", deprecated = true];
@@ -1808,9 +2136,43 @@ message Hop {
1808
2136
 
1809
2137
  /**
1810
2138
  If set to true, then this hop will be encoded using the new variable length
1811
- TLV format.
2139
+ TLV format. Note that if any custom tlv_records below are specified, then
2140
+ this field MUST be set to true for them to be encoded properly.
1812
2141
  */
1813
2142
  bool tlv_payload = 9 [json_name = "tlv_payload"];
2143
+
2144
+ /**
2145
+ An optional TLV record tha singals the use of an MPP payment. If present,
2146
+ the receiver will enforce that that the same mpp_record is included in the
2147
+ final hop payload of all non-zero payments in the HTLC set. If empty, a
2148
+ regular single-shot payment is or was attempted.
2149
+ */
2150
+ MPPRecord mpp_record = 10 [json_name = "mpp_record"];
2151
+
2152
+ /**
2153
+ An optional set of key-value TLV records. This is useful within the context
2154
+ of the SendToRoute call as it allows callers to specify arbitrary K-V pairs
2155
+ to drop off at each hop within the onion.
2156
+ */
2157
+ map<uint64, bytes> custom_records = 11 [json_name = "custom_records"];
2158
+ }
2159
+
2160
+ message MPPRecord {
2161
+ /**
2162
+ A unique, random identifier used to authenticate the sender as the intended
2163
+ payer of a multi-path payment. The payment_addr must be the same for all
2164
+ subpayments, and match the payment_addr provided in the receiver's invoice.
2165
+ The same payment_addr must be used on all subpayments.
2166
+ */
2167
+ bytes payment_addr = 11 [json_name = "payment_addr"];
2168
+
2169
+ /**
2170
+ The total amount in milli-satoshis being sent as part of a larger multi-path
2171
+ payment. The caller is responsible for ensuring subpayments to the same node
2172
+ and payment_hash sum exactly to total_amt_msat. The same
2173
+ total_amt_msat must be used on all subpayments.
2174
+ */
2175
+ int64 total_amt_msat = 10 [json_name = "total_amt_msat"];
1814
2176
  }
1815
2177
 
1816
2178
  /**
@@ -1823,7 +2185,7 @@ carry the initial payment amount after fees are accounted for.
1823
2185
  message Route {
1824
2186
 
1825
2187
  /**
1826
- The cumulative (final) time lock across the entire route. This is the CLTV
2188
+ The cumulative (final) time lock across the entire route. This is the CLTV
1827
2189
  value that should be extended to the first hop in the route. All other hops
1828
2190
  will decrement the time-lock as advertised, leaving enough time for all
1829
2191
  hops to wait for or present the payment preimage to complete the payment.
@@ -1831,7 +2193,7 @@ message Route {
1831
2193
  uint32 total_time_lock = 1 [json_name = "total_time_lock"];
1832
2194
 
1833
2195
  /**
1834
- The sum of the fees paid at each hop within the final route. In the case
2196
+ The sum of the fees paid at each hop within the final route. In the case
1835
2197
  of a one-hop payment, this value will be zero as we don't need to pay a fee
1836
2198
  to ourselves.
1837
2199
  */
@@ -1902,6 +2264,7 @@ message LightningNode {
1902
2264
  string alias = 3 [ json_name = "alias" ];
1903
2265
  repeated NodeAddress addresses = 4 [ json_name = "addresses" ];
1904
2266
  string color = 5 [ json_name = "color" ];
2267
+ map<uint32, Feature> features = 6 [ json_name = "features" ];
1905
2268
  }
1906
2269
 
1907
2270
  message NodeAddress {
@@ -1933,7 +2296,7 @@ message ChannelEdge {
1933
2296
  height, the next 3 the index within the block, and the last 2 bytes are the
1934
2297
  output index for the channel.
1935
2298
  */
1936
- uint64 channel_id = 1 [json_name = "channel_id"];
2299
+ uint64 channel_id = 1 [json_name = "channel_id", jstype = JS_STRING];
1937
2300
  string chan_point = 2 [json_name = "chan_point"];
1938
2301
 
1939
2302
  uint32 last_update = 3 [json_name = "last_update", deprecated = true];
@@ -1971,7 +2334,7 @@ message ChanInfoRequest {
1971
2334
  height, the next 3 the index within the block, and the last 2 bytes are the
1972
2335
  output index for the channel.
1973
2336
  */
1974
- uint64 chan_id = 1;
2337
+ uint64 chan_id = 1 [jstype = JS_STRING];
1975
2338
  }
1976
2339
 
1977
2340
  message NetworkInfoRequest {
@@ -2020,7 +2383,7 @@ message ChannelEdgeUpdate {
2020
2383
  height, the next 3 the index within the block, and the last 2 bytes are the
2021
2384
  output index for the channel.
2022
2385
  */
2023
- uint64 chan_id = 1;
2386
+ uint64 chan_id = 1 [jstype = JS_STRING];
2024
2387
 
2025
2388
  ChannelPoint chan_point = 2;
2026
2389
 
@@ -2037,7 +2400,7 @@ message ClosedChannelUpdate {
2037
2400
  height, the next 3 the index within the block, and the last 2 bytes are the
2038
2401
  output index for the channel.
2039
2402
  */
2040
- uint64 chan_id = 1;
2403
+ uint64 chan_id = 1 [jstype = JS_STRING];
2041
2404
  int64 capacity = 2;
2042
2405
  uint32 closed_height = 3;
2043
2406
  ChannelPoint chan_point = 4;
@@ -2048,7 +2411,7 @@ message HopHint {
2048
2411
  string node_id = 1 [json_name = "node_id"];
2049
2412
 
2050
2413
  /// The unique identifier of the channel.
2051
- uint64 chan_id = 2 [json_name = "chan_id"];
2414
+ uint64 chan_id = 2 [json_name = "chan_id", jstype = JS_STRING];
2052
2415
 
2053
2416
  /// The base fee of the channel denominated in millisatoshis.
2054
2417
  uint32 fee_base_msat = 3 [json_name = "fee_base_msat"];
@@ -2080,23 +2443,35 @@ message Invoice {
2080
2443
  */
2081
2444
  string memo = 1 [json_name = "memo"];
2082
2445
 
2083
- /** Deprecated. An optional cryptographic receipt of payment which is not
2084
- implemented.
2085
- */
2086
- bytes receipt = 2 [json_name = "receipt", deprecated = true];
2446
+ reserved 2;
2087
2447
 
2088
2448
  /**
2089
2449
  The hex-encoded preimage (32 byte) which will allow settling an incoming
2090
- HTLC payable to this preimage
2450
+ HTLC payable to this preimage. When using REST, this field must be encoded
2451
+ as base64.
2091
2452
  */
2092
2453
  bytes r_preimage = 3 [json_name = "r_preimage"];
2093
2454
 
2094
- /// The hash of the preimage
2455
+ /**
2456
+ The hash of the preimage. When using REST, this field must be encoded as
2457
+ base64.
2458
+ */
2095
2459
  bytes r_hash = 4 [json_name = "r_hash"];
2096
2460
 
2097
- /// The value of this invoice in satoshis
2461
+ /**
2462
+ The value of this invoice in satoshis
2463
+
2464
+ The fields value and value_msat are mutually exclusive.
2465
+ */
2098
2466
  int64 value = 5 [json_name = "value"];
2099
2467
 
2468
+ /**
2469
+ The value of this invoice in millisatoshis
2470
+
2471
+ The fields value and value_msat are mutually exclusive.
2472
+ */
2473
+ int64 value_msat = 23 [json_name = "value_msat"];
2474
+
2100
2475
  /// Whether this invoice has been fulfilled
2101
2476
  bool settled = 6 [json_name = "settled", deprecated = true];
2102
2477
 
@@ -2107,7 +2482,7 @@ message Invoice {
2107
2482
  int64 settle_date = 8 [json_name = "settle_date"];
2108
2483
 
2109
2484
  /**
2110
- A bare-bones invoice for a payment within the Lightning Network. With the
2485
+ A bare-bones invoice for a payment within the Lightning Network. With the
2111
2486
  details of the invoice, the sender has all the data necessary to send a
2112
2487
  payment to the recipient.
2113
2488
  */
@@ -2116,7 +2491,8 @@ message Invoice {
2116
2491
  /**
2117
2492
  Hash (SHA-256) of a description of the payment. Used if the description of
2118
2493
  payment (memo) is too long to naturally fit within the description field
2119
- of an encoded payment request.
2494
+ of an encoded payment request. When using REST, this field must be encoded
2495
+ as base64.
2120
2496
  */
2121
2497
  bytes description_hash = 10 [json_name = "description_hash"];
2122
2498
 
@@ -2191,6 +2567,15 @@ message Invoice {
2191
2567
 
2192
2568
  /// List of HTLCs paying to this invoice [EXPERIMENTAL].
2193
2569
  repeated InvoiceHTLC htlcs = 22 [json_name = "htlcs"];
2570
+
2571
+ /// List of features advertised on the invoice.
2572
+ map<uint32, Feature> features = 24 [json_name = "features"];
2573
+
2574
+ /**
2575
+ Indicates if this invoice was a spontaneous payment that arrived via keysend
2576
+ [EXPERIMENTAL].
2577
+ */
2578
+ bool is_keysend = 25 [json_name = "is_keysend"];
2194
2579
  }
2195
2580
 
2196
2581
  enum InvoiceHTLCState {
@@ -2202,7 +2587,7 @@ enum InvoiceHTLCState {
2202
2587
  /// Details of an HTLC that paid to an invoice
2203
2588
  message InvoiceHTLC {
2204
2589
  /// Short channel id over which the htlc was received.
2205
- uint64 chan_id = 1 [json_name = "chan_id"];
2590
+ uint64 chan_id = 1 [json_name = "chan_id", jstype = JS_STRING];
2206
2591
 
2207
2592
  /// Index identifying the htlc on the channel.
2208
2593
  uint64 htlc_index = 2 [json_name = "htlc_index"];
@@ -2224,13 +2609,19 @@ message InvoiceHTLC {
2224
2609
 
2225
2610
  /// Current state the htlc is in.
2226
2611
  InvoiceHTLCState state = 8 [json_name = "state"];
2612
+
2613
+ /// Custom tlv records.
2614
+ map<uint64, bytes> custom_records = 9 [json_name = "custom_records"];
2615
+
2616
+ /// The total amount of the mpp payment in msat.
2617
+ uint64 mpp_total_amt_msat = 10 [json_name = "mpp_total_amt_msat"];
2227
2618
  }
2228
2619
 
2229
2620
  message AddInvoiceResponse {
2230
2621
  bytes r_hash = 1 [json_name = "r_hash"];
2231
2622
 
2232
2623
  /**
2233
- A bare-bones invoice for a payment within the Lightning Network. With the
2624
+ A bare-bones invoice for a payment within the Lightning Network. With the
2234
2625
  details of the invoice, the sender has all the data necessary to send a
2235
2626
  payment to the recipient.
2236
2627
  */
@@ -2248,15 +2639,23 @@ message PaymentHash {
2248
2639
  /**
2249
2640
  The hex-encoded payment hash of the invoice to be looked up. The passed
2250
2641
  payment hash must be exactly 32 bytes, otherwise an error is returned.
2642
+ Deprecated now that the REST gateway supports base64 encoding of bytes
2643
+ fields.
2251
2644
  */
2252
- string r_hash_str = 1 [json_name = "r_hash_str"];
2645
+ string r_hash_str = 1 [json_name = "r_hash_str", deprecated = true];
2253
2646
 
2254
- /// The payment hash of the invoice to be looked up.
2647
+ /**
2648
+ The payment hash of the invoice to be looked up. When using REST, this field
2649
+ must be encoded as base64.
2650
+ */
2255
2651
  bytes r_hash = 2 [json_name = "r_hash"];
2256
2652
  }
2257
2653
 
2258
2654
  message ListInvoiceRequest {
2259
- /// If set, only unsettled invoices will be returned in the response.
2655
+ /**
2656
+ If set, only invoices that are not settled and not canceled will be returned
2657
+ in the response.
2658
+ */
2260
2659
  bool pending_only = 1 [json_name = "pending_only"];
2261
2660
 
2262
2661
  /**
@@ -2320,11 +2719,11 @@ message Payment {
2320
2719
  /// Deprecated, use value_sat or value_msat.
2321
2720
  int64 value = 2 [json_name = "value", deprecated = true];
2322
2721
 
2323
- /// The date of this payment
2324
- int64 creation_date = 3 [json_name = "creation_date"];
2722
+ /// Deprecated, use creation_time_ns
2723
+ int64 creation_date = 3 [json_name = "creation_date", deprecated = true];
2325
2724
 
2326
- /// The path this payment took
2327
- repeated string path = 4 [ json_name = "path" ];
2725
+ /// The path this payment took.
2726
+ repeated string path = 4 [json_name = "path", deprecated = true];
2328
2727
 
2329
2728
  /// Deprecated, use fee_sat or fee_msat.
2330
2729
  int64 fee = 5 [json_name = "fee", deprecated = true];
@@ -2356,6 +2755,35 @@ message Payment {
2356
2755
 
2357
2756
  /// The fee paid for this payment in milli-satoshis
2358
2757
  int64 fee_msat = 12 [json_name = "fee_msat"];
2758
+
2759
+ /// The time in UNIX nanoseconds at which the payment was created.
2760
+ int64 creation_time_ns = 13 [json_name = "creation_time_ns"];
2761
+
2762
+ /// The HTLCs made in attempt to settle the payment [EXPERIMENTAL].
2763
+ repeated HTLCAttempt htlcs = 14 [json_name = "htlcs"];
2764
+ }
2765
+
2766
+ message HTLCAttempt {
2767
+ enum HTLCStatus {
2768
+ IN_FLIGHT = 0;
2769
+ SUCCEEDED = 1;
2770
+ FAILED = 2;
2771
+ }
2772
+
2773
+ /// The status of the HTLC.
2774
+ HTLCStatus status = 1 [json_name = "status"];
2775
+
2776
+ /// The route taken by this HTLC.
2777
+ Route route = 2 [json_name = "route"];
2778
+
2779
+ /// The time in UNIX nanoseconds at which this HTLC was sent.
2780
+ int64 attempt_time_ns = 3 [json_name = "attempt_time_ns"];
2781
+
2782
+ /**
2783
+ The time in UNIX nanoseconds at which this HTLC was settled or failed.
2784
+ This value will not be set if the HTLC is still IN_FLIGHT.
2785
+ */
2786
+ int64 resolve_time_ns = 4 [json_name = "resolve_time_ns"];
2359
2787
  }
2360
2788
 
2361
2789
  message ListPaymentsRequest {
@@ -2409,6 +2837,35 @@ message PayReq {
2409
2837
  string fallback_addr = 8 [json_name = "fallback_addr"];
2410
2838
  int64 cltv_expiry = 9 [json_name = "cltv_expiry"];
2411
2839
  repeated RouteHint route_hints = 10 [json_name = "route_hints"];
2840
+ bytes payment_addr = 11 [json_name = "payment_addr"];
2841
+ int64 num_msat = 12 [json_name = "num_msat"];
2842
+ map<uint32, Feature> features = 13 [json_name = "features"];
2843
+ }
2844
+
2845
+ enum FeatureBit {
2846
+ DATALOSS_PROTECT_REQ = 0;
2847
+ DATALOSS_PROTECT_OPT = 1;
2848
+ INITIAL_ROUING_SYNC = 3;
2849
+ UPFRONT_SHUTDOWN_SCRIPT_REQ = 4;
2850
+ UPFRONT_SHUTDOWN_SCRIPT_OPT = 5;
2851
+ GOSSIP_QUERIES_REQ = 6;
2852
+ GOSSIP_QUERIES_OPT = 7;
2853
+ TLV_ONION_REQ = 8;
2854
+ TLV_ONION_OPT = 9;
2855
+ EXT_GOSSIP_QUERIES_REQ = 10;
2856
+ EXT_GOSSIP_QUERIES_OPT = 11;
2857
+ STATIC_REMOTE_KEY_REQ = 12;
2858
+ STATIC_REMOTE_KEY_OPT = 13;
2859
+ PAYMENT_ADDR_REQ = 14;
2860
+ PAYMENT_ADDR_OPT = 15;
2861
+ MPP_REQ = 16;
2862
+ MPP_OPT = 17;
2863
+ }
2864
+
2865
+ message Feature {
2866
+ string name = 2 [json_name = "name"];
2867
+ bool is_required = 3 [json_name = "is_required"];
2868
+ bool is_known = 4 [json_name = "is_known"];
2412
2869
  }
2413
2870
 
2414
2871
  message FeeReportRequest {}
@@ -2459,6 +2916,12 @@ message PolicyUpdateRequest {
2459
2916
 
2460
2917
  /// If set, the maximum HTLC size in milli-satoshis. If unset, the maximum HTLC will be unchanged.
2461
2918
  uint64 max_htlc_msat = 6 [json_name = "max_htlc_msat"];
2919
+
2920
+ /// The minimum HTLC size in milli-satoshis. Only applied if min_htlc_msat_specified is true.
2921
+ uint64 min_htlc_msat = 7 [json_name = "min_htlc_msat"];
2922
+
2923
+ /// If true, min_htlc_msat is applied.
2924
+ bool min_htlc_msat_specified = 8 [json_name = "set_min_htlc_msat"];
2462
2925
  }
2463
2926
  message PolicyUpdateResponse {
2464
2927
  }
@@ -2481,10 +2944,10 @@ message ForwardingEvent {
2481
2944
  uint64 timestamp = 1 [json_name = "timestamp"];
2482
2945
 
2483
2946
  /// The incoming channel ID that carried the HTLC that created the circuit.
2484
- uint64 chan_id_in = 2 [json_name = "chan_id_in"];
2947
+ uint64 chan_id_in = 2 [json_name = "chan_id_in", jstype = JS_STRING];
2485
2948
 
2486
2949
  /// The outgoing channel ID that carried the preimage that completed the circuit.
2487
- uint64 chan_id_out = 4 [json_name = "chan_id_out"];
2950
+ uint64 chan_id_out = 4 [json_name = "chan_id_out", jstype = JS_STRING];
2488
2951
 
2489
2952
  /// The total amount (in satoshis) of the incoming HTLC that created half the circuit.
2490
2953
  uint64 amt_in = 5 [json_name = "amt_in"];
@@ -2498,6 +2961,13 @@ message ForwardingEvent {
2498
2961
  /// The total fee (in milli-satoshis) that this payment circuit carried.
2499
2962
  uint64 fee_msat = 8 [json_name = "fee_msat"];
2500
2963
 
2964
+ /// The total amount (in milli-satoshis) of the incoming HTLC that created half the circuit.
2965
+ uint64 amt_in_msat = 9 [json_name = "amt_in_msat"];
2966
+
2967
+ /// The total amount (in milli-satoshis) of the outgoing HTLC that created the second half of the circuit.
2968
+ uint64 amt_out_msat = 10 [json_name = "amt_out_msat"];
2969
+
2970
+
2501
2971
  // TODO(roasbeef): add settlement latency?
2502
2972
  // * use FPE on the chan id?
2503
2973
  // * also list failures?
@@ -2524,7 +2994,8 @@ message ChannelBackup {
2524
2994
  /**
2525
2995
  Is an encrypted single-chan backup. this can be passed to
2526
2996
  RestoreChannelBackups, or the WalletUnlocker Init and Unlock methods in
2527
- order to trigger the recovery protocol.
2997
+ order to trigger the recovery protocol. When using REST, this field must be
2998
+ encoded as base64.
2528
2999
  */
2529
3000
  bytes chan_backup = 2 [ json_name = "chan_backup" ];
2530
3001
  }
@@ -2538,7 +3009,8 @@ message MultiChanBackup {
2538
3009
  /**
2539
3010
  A single encrypted blob containing all the static channel backups of the
2540
3011
  channel listed above. This can be stored as a single file or blob, and
2541
- safely be replaced with any prior/future versions.
3012
+ safely be replaced with any prior/future versions. When using REST, this
3013
+ field must be encoded as base64.
2542
3014
  */
2543
3015
  bytes multi_chan_backup = 2 [ json_name = "multi_chan_backup" ];
2544
3016
  }
@@ -2567,8 +3039,15 @@ message ChannelBackups {
2567
3039
 
2568
3040
  message RestoreChanBackupRequest {
2569
3041
  oneof backup {
3042
+ /**
3043
+ The channels to restore as a list of channel/backup pairs.
3044
+ */
2570
3045
  ChannelBackups chan_backups = 1 [ json_name = "chan_backups" ];
2571
3046
 
3047
+ /**
3048
+ The channels to restore in the packed multi backup format. When using
3049
+ REST, this field must be encoded as base64.
3050
+ */
2572
3051
  bytes multi_chan_backup = 2 [ json_name = "multi_chan_backup" ];
2573
3052
  }
2574
3053
  }
@@ -2578,3 +3057,19 @@ message ChannelBackupSubscription {}
2578
3057
 
2579
3058
  message VerifyChanBackupResponse {
2580
3059
  }
3060
+
3061
+ message MacaroonPermission {
3062
+ /// The entity a permission grants access to.
3063
+ string entity = 1 [json_name = "entity"];
3064
+
3065
+ /// The action that is granted.
3066
+ string action = 2 [json_name = "action"];
3067
+ }
3068
+ message BakeMacaroonRequest {
3069
+ /// The list of permissions the new macaroon should grant.
3070
+ repeated MacaroonPermission permissions = 1 [json_name = "permissions"];
3071
+ }
3072
+ message BakeMacaroonResponse {
3073
+ /// The hex encoded macaroon, serialized in binary format.
3074
+ string macaroon = 1 [json_name = "macaroon"];
3075
+ }