Skip to content

Commit 1711355

Browse files
committed
Update java bindings with new generator and new upstream code
1 parent d69a40d commit 1711355

File tree

199 files changed

+7178
-1615
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+7178
-1615
lines changed

liblightningjni.so

18.8 KB
Binary file not shown.

src/main/java/org/ldk/enums/LDKAccessError.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package org.ldk.enums;
22

3+
/**
4+
* An error when accessing the chain via [`Access`].
5+
*
6+
* [`Access`]: trait.Access.html
7+
*/
38
public enum LDKAccessError {
49
LDKAccessError_UnknownChain,
510
LDKAccessError_UnknownTx,

src/main/java/org/ldk/enums/LDKChannelMonitorUpdateErr.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package org.ldk.enums;
22

3+
/**
4+
* An error enum representing a failure to persist a channel monitor update.
5+
*/
36
public enum LDKChannelMonitorUpdateErr {
47
LDKChannelMonitorUpdateErr_TemporaryFailure,
58
LDKChannelMonitorUpdateErr_PermanentFailure,

src/main/java/org/ldk/enums/LDKConfirmationTarget.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package org.ldk.enums;
22

3+
/**
4+
* An enum that represents the speed at which we want a transaction to confirm used for feerate
5+
* estimation.
6+
*/
37
public enum LDKConfirmationTarget {
48
LDKConfirmationTarget_Background,
59
LDKConfirmationTarget_Normal,

src/main/java/org/ldk/enums/LDKLevel.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package org.ldk.enums;
22

3+
/**
4+
* An enum representing the available verbosity levels of the logger.
5+
*/
36
public enum LDKLevel {
47
LDKLevel_Off,
58
LDKLevel_Error,

src/main/java/org/ldk/impl/bindings.java

Lines changed: 255 additions & 229 deletions
Large diffs are not rendered by default.

src/main/java/org/ldk/structs/APIError.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
import org.ldk.util.*;
66
import java.util.Arrays;
77

8+
9+
/**
10+
* Indicates an error on the client's part (usually some variant of attempting to use too-low or
11+
* too-high values)
12+
*/
813
@SuppressWarnings("unchecked") // We correctly assign various generic arrays
914
public class APIError extends CommonBase {
1015
private APIError(Object _dummy, long ptr) { super(ptr); }

src/main/java/org/ldk/structs/AcceptChannel.java

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
import org.ldk.util.*;
66
import java.util.Arrays;
77

8+
9+
/**
10+
* An accept_channel message to be sent or received from a peer
11+
*/
812
@SuppressWarnings("unchecked") // We correctly assign various generic arrays
913
public class AcceptChannel extends CommonBase {
1014
AcceptChannel(Object _dummy, long ptr) { super(ptr); }
@@ -14,144 +18,237 @@ protected void finalize() throws Throwable {
1418
if (ptr != 0) { bindings.AcceptChannel_free(ptr); }
1519
}
1620

21+
/**
22+
* A temporary channel ID, until the funding outpoint is announced
23+
*/
1724
public byte[] get_temporary_channel_id() {
1825
byte[] ret = bindings.AcceptChannel_get_temporary_channel_id(this.ptr);
1926
return ret;
2027
}
2128

29+
/**
30+
* A temporary channel ID, until the funding outpoint is announced
31+
*/
2232
public void set_temporary_channel_id(byte[] val) {
2333
bindings.AcceptChannel_set_temporary_channel_id(this.ptr, val);
2434
}
2535

36+
/**
37+
* The threshold below which outputs on transactions broadcast by sender will be omitted
38+
*/
2639
public long get_dust_limit_satoshis() {
2740
long ret = bindings.AcceptChannel_get_dust_limit_satoshis(this.ptr);
2841
return ret;
2942
}
3043

44+
/**
45+
* The threshold below which outputs on transactions broadcast by sender will be omitted
46+
*/
3147
public void set_dust_limit_satoshis(long val) {
3248
bindings.AcceptChannel_set_dust_limit_satoshis(this.ptr, val);
3349
}
3450

51+
/**
52+
* The maximum inbound HTLC value in flight towards sender, in milli-satoshi
53+
*/
3554
public long get_max_htlc_value_in_flight_msat() {
3655
long ret = bindings.AcceptChannel_get_max_htlc_value_in_flight_msat(this.ptr);
3756
return ret;
3857
}
3958

59+
/**
60+
* The maximum inbound HTLC value in flight towards sender, in milli-satoshi
61+
*/
4062
public void set_max_htlc_value_in_flight_msat(long val) {
4163
bindings.AcceptChannel_set_max_htlc_value_in_flight_msat(this.ptr, val);
4264
}
4365

66+
/**
67+
* The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
68+
*/
4469
public long get_channel_reserve_satoshis() {
4570
long ret = bindings.AcceptChannel_get_channel_reserve_satoshis(this.ptr);
4671
return ret;
4772
}
4873

74+
/**
75+
* The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
76+
*/
4977
public void set_channel_reserve_satoshis(long val) {
5078
bindings.AcceptChannel_set_channel_reserve_satoshis(this.ptr, val);
5179
}
5280

81+
/**
82+
* The minimum HTLC size incoming to sender, in milli-satoshi
83+
*/
5384
public long get_htlc_minimum_msat() {
5485
long ret = bindings.AcceptChannel_get_htlc_minimum_msat(this.ptr);
5586
return ret;
5687
}
5788

89+
/**
90+
* The minimum HTLC size incoming to sender, in milli-satoshi
91+
*/
5892
public void set_htlc_minimum_msat(long val) {
5993
bindings.AcceptChannel_set_htlc_minimum_msat(this.ptr, val);
6094
}
6195

96+
/**
97+
* Minimum depth of the funding transaction before the channel is considered open
98+
*/
6299
public int get_minimum_depth() {
63100
int ret = bindings.AcceptChannel_get_minimum_depth(this.ptr);
64101
return ret;
65102
}
66103

104+
/**
105+
* Minimum depth of the funding transaction before the channel is considered open
106+
*/
67107
public void set_minimum_depth(int val) {
68108
bindings.AcceptChannel_set_minimum_depth(this.ptr, val);
69109
}
70110

111+
/**
112+
* The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
113+
*/
71114
public short get_to_self_delay() {
72115
short ret = bindings.AcceptChannel_get_to_self_delay(this.ptr);
73116
return ret;
74117
}
75118

119+
/**
120+
* The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
121+
*/
76122
public void set_to_self_delay(short val) {
77123
bindings.AcceptChannel_set_to_self_delay(this.ptr, val);
78124
}
79125

126+
/**
127+
* The maximum number of inbound HTLCs towards sender
128+
*/
80129
public short get_max_accepted_htlcs() {
81130
short ret = bindings.AcceptChannel_get_max_accepted_htlcs(this.ptr);
82131
return ret;
83132
}
84133

134+
/**
135+
* The maximum number of inbound HTLCs towards sender
136+
*/
85137
public void set_max_accepted_htlcs(short val) {
86138
bindings.AcceptChannel_set_max_accepted_htlcs(this.ptr, val);
87139
}
88140

141+
/**
142+
* The sender's key controlling the funding transaction
143+
*/
89144
public byte[] get_funding_pubkey() {
90145
byte[] ret = bindings.AcceptChannel_get_funding_pubkey(this.ptr);
91146
return ret;
92147
}
93148

149+
/**
150+
* The sender's key controlling the funding transaction
151+
*/
94152
public void set_funding_pubkey(byte[] val) {
95153
bindings.AcceptChannel_set_funding_pubkey(this.ptr, val);
96154
}
97155

156+
/**
157+
* Used to derive a revocation key for transactions broadcast by counterparty
158+
*/
98159
public byte[] get_revocation_basepoint() {
99160
byte[] ret = bindings.AcceptChannel_get_revocation_basepoint(this.ptr);
100161
return ret;
101162
}
102163

164+
/**
165+
* Used to derive a revocation key for transactions broadcast by counterparty
166+
*/
103167
public void set_revocation_basepoint(byte[] val) {
104168
bindings.AcceptChannel_set_revocation_basepoint(this.ptr, val);
105169
}
106170

171+
/**
172+
* A payment key to sender for transactions broadcast by counterparty
173+
*/
107174
public byte[] get_payment_point() {
108175
byte[] ret = bindings.AcceptChannel_get_payment_point(this.ptr);
109176
return ret;
110177
}
111178

179+
/**
180+
* A payment key to sender for transactions broadcast by counterparty
181+
*/
112182
public void set_payment_point(byte[] val) {
113183
bindings.AcceptChannel_set_payment_point(this.ptr, val);
114184
}
115185

186+
/**
187+
* Used to derive a payment key to sender for transactions broadcast by sender
188+
*/
116189
public byte[] get_delayed_payment_basepoint() {
117190
byte[] ret = bindings.AcceptChannel_get_delayed_payment_basepoint(this.ptr);
118191
return ret;
119192
}
120193

194+
/**
195+
* Used to derive a payment key to sender for transactions broadcast by sender
196+
*/
121197
public void set_delayed_payment_basepoint(byte[] val) {
122198
bindings.AcceptChannel_set_delayed_payment_basepoint(this.ptr, val);
123199
}
124200

201+
/**
202+
* Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
203+
*/
125204
public byte[] get_htlc_basepoint() {
126205
byte[] ret = bindings.AcceptChannel_get_htlc_basepoint(this.ptr);
127206
return ret;
128207
}
129208

209+
/**
210+
* Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
211+
*/
130212
public void set_htlc_basepoint(byte[] val) {
131213
bindings.AcceptChannel_set_htlc_basepoint(this.ptr, val);
132214
}
133215

216+
/**
217+
* The first to-be-broadcast-by-sender transaction's per commitment point
218+
*/
134219
public byte[] get_first_per_commitment_point() {
135220
byte[] ret = bindings.AcceptChannel_get_first_per_commitment_point(this.ptr);
136221
return ret;
137222
}
138223

224+
/**
225+
* The first to-be-broadcast-by-sender transaction's per commitment point
226+
*/
139227
public void set_first_per_commitment_point(byte[] val) {
140228
bindings.AcceptChannel_set_first_per_commitment_point(this.ptr, val);
141229
}
142230

231+
/**
232+
* Creates a copy of the AcceptChannel
233+
*/
143234
public AcceptChannel clone() {
144235
long ret = bindings.AcceptChannel_clone(this.ptr);
145236
AcceptChannel ret_hu_conv = new AcceptChannel(null, ret);
146237
ret_hu_conv.ptrs_to.add(this);
147238
return ret_hu_conv;
148239
}
149240

241+
/**
242+
* Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
243+
*/
150244
public byte[] write() {
151245
byte[] ret = bindings.AcceptChannel_write(this.ptr);
152246
return ret;
153247
}
154248

249+
/**
250+
* Read a AcceptChannel from a byte array, created by AcceptChannel_write
251+
*/
155252
public static Result_AcceptChannelDecodeErrorZ constructor_read(byte[] ser) {
156253
long ret = bindings.AcceptChannel_read(ser);
157254
Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret);

src/main/java/org/ldk/structs/Access.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
import org.ldk.util.*;
66
import java.util.Arrays;
77

8+
/**
9+
* The `Access` trait defines behavior for accessing chain data and state, such as blocks and
10+
* UTXOs.
11+
*/
812
@SuppressWarnings("unchecked") // We correctly assign various generic arrays
913
public class Access extends CommonBase {
1014
final bindings.LDKAccess bindings_instance;
@@ -20,6 +24,13 @@ protected void finalize() throws Throwable {
2024
}
2125

2226
public static interface AccessInterface {
27+
/**
28+
* Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
29+
* Returns an error if `genesis_hash` is for a different chain or if such a transaction output
30+
* is unknown.
31+
*
32+
* [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
33+
*/
2334
Result_TxOutAccessErrorZ get_utxo(byte[] genesis_hash, long short_channel_id);
2435
}
2536
private static class LDKAccessHolder { Access held; }
@@ -34,6 +45,13 @@ public static Access new_impl(AccessInterface arg) {
3445
});
3546
return impl_holder.held;
3647
}
48+
/**
49+
* Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
50+
* Returns an error if `genesis_hash` is for a different chain or if such a transaction output
51+
* is unknown.
52+
*
53+
* [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
54+
*/
3755
public Result_TxOutAccessErrorZ get_utxo(byte[] genesis_hash, long short_channel_id) {
3856
long ret = bindings.Access_get_utxo(this.ptr, genesis_hash, short_channel_id);
3957
Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret);

0 commit comments

Comments
 (0)