@@ -33,8 +33,14 @@ static Balance constr_from_ptr(long ptr) {
3333 if (raw_val .getClass () == bindings .LDKBalance .ContentiousClaimable .class ) {
3434 return new ContentiousClaimable (ptr , (bindings .LDKBalance .ContentiousClaimable )raw_val );
3535 }
36- if (raw_val .getClass () == bindings .LDKBalance .MaybeClaimableHTLCAwaitingTimeout .class ) {
37- return new MaybeClaimableHTLCAwaitingTimeout (ptr , (bindings .LDKBalance .MaybeClaimableHTLCAwaitingTimeout )raw_val );
36+ if (raw_val .getClass () == bindings .LDKBalance .MaybeTimeoutClaimableHTLC .class ) {
37+ return new MaybeTimeoutClaimableHTLC (ptr , (bindings .LDKBalance .MaybeTimeoutClaimableHTLC )raw_val );
38+ }
39+ if (raw_val .getClass () == bindings .LDKBalance .MaybePreimageClaimableHTLC .class ) {
40+ return new MaybePreimageClaimableHTLC (ptr , (bindings .LDKBalance .MaybePreimageClaimableHTLC )raw_val );
41+ }
42+ if (raw_val .getClass () == bindings .LDKBalance .CounterpartyRevokedOutputClaimable .class ) {
43+ return new CounterpartyRevokedOutputClaimable (ptr , (bindings .LDKBalance .CounterpartyRevokedOutputClaimable )raw_val );
3844 }
3945 assert false ; return null ; // Unreachable without extending the (internal) bindings interface
4046 }
@@ -107,23 +113,65 @@ private ContentiousClaimable(long ptr, bindings.LDKBalance.ContentiousClaimable
107113 * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
108114 * likely to be claimed by our counterparty before we do.
109115 */
110- public final static class MaybeClaimableHTLCAwaitingTimeout extends Balance {
116+ public final static class MaybeTimeoutClaimableHTLC extends Balance {
111117 /**
112- * The amount available to claim, in satoshis, excluding the on-chain fees which will be
113- * required to do so.
118+ * The amount potentially available to claim, in satoshis, excluding the on-chain fees
119+ * which will be required to do so.
114120 */
115121 public final long claimable_amount_satoshis ;
116122 /**
117123 * The height at which we will be able to claim the balance if our counterparty has not
118124 * done so.
119125 */
120126 public final int claimable_height ;
121- private MaybeClaimableHTLCAwaitingTimeout (long ptr , bindings .LDKBalance .MaybeClaimableHTLCAwaitingTimeout obj ) {
127+ private MaybeTimeoutClaimableHTLC (long ptr , bindings .LDKBalance .MaybeTimeoutClaimableHTLC obj ) {
122128 super (null , ptr );
123129 this .claimable_amount_satoshis = obj .claimable_amount_satoshis ;
124130 this .claimable_height = obj .claimable_height ;
125131 }
126132 }
133+ /**
134+ * HTLCs which we received from our counterparty which are claimable with a preimage which we
135+ * do not currently have. This will only be claimable if we receive the preimage from the node
136+ * to which we forwarded this HTLC before the timeout.
137+ */
138+ public final static class MaybePreimageClaimableHTLC extends Balance {
139+ /**
140+ * The amount potentially available to claim, in satoshis, excluding the on-chain fees
141+ * which will be required to do so.
142+ */
143+ public final long claimable_amount_satoshis ;
144+ /**
145+ * The height at which our counterparty will be able to claim the balance if we have not
146+ * yet received the preimage and claimed it ourselves.
147+ */
148+ public final int expiry_height ;
149+ private MaybePreimageClaimableHTLC (long ptr , bindings .LDKBalance .MaybePreimageClaimableHTLC obj ) {
150+ super (null , ptr );
151+ this .claimable_amount_satoshis = obj .claimable_amount_satoshis ;
152+ this .expiry_height = obj .expiry_height ;
153+ }
154+ }
155+ /**
156+ * The channel has been closed, and our counterparty broadcasted a revoked commitment
157+ * transaction.
158+ *
159+ * Thus, we're able to claim all outputs in the commitment transaction, one of which has the
160+ * following amount.
161+ */
162+ public final static class CounterpartyRevokedOutputClaimable extends Balance {
163+ /**
164+ * The amount, in satoshis, of the output which we can claim.
165+ *
166+ * Note that for outputs from HTLC balances this may be excluding some on-chain fees that
167+ * were already spent.
168+ */
169+ public final long claimable_amount_satoshis ;
170+ private CounterpartyRevokedOutputClaimable (long ptr , bindings .LDKBalance .CounterpartyRevokedOutputClaimable obj ) {
171+ super (null , ptr );
172+ this .claimable_amount_satoshis = obj .claimable_amount_satoshis ;
173+ }
174+ }
127175 long clone_ptr () {
128176 long ret = bindings .Balance_clone_ptr (this .ptr );
129177 Reference .reachabilityFence (this );
@@ -181,10 +229,10 @@ public static Balance contentious_claimable(long claimable_amount_satoshis, int
181229 }
182230
183231 /**
184- * Utility method to constructs a new MaybeClaimableHTLCAwaitingTimeout -variant Balance
232+ * Utility method to constructs a new MaybeTimeoutClaimableHTLC -variant Balance
185233 */
186- public static Balance maybe_claimable_htlcawaiting_timeout (long claimable_amount_satoshis , int claimable_height ) {
187- long ret = bindings .Balance_maybe_claimable_htlcawaiting_timeout (claimable_amount_satoshis , claimable_height );
234+ public static Balance maybe_timeout_claimable_htlc (long claimable_amount_satoshis , int claimable_height ) {
235+ long ret = bindings .Balance_maybe_timeout_claimable_htlc (claimable_amount_satoshis , claimable_height );
188236 Reference .reachabilityFence (claimable_amount_satoshis );
189237 Reference .reachabilityFence (claimable_height );
190238 if (ret >= 0 && ret <= 4096 ) { return null ; }
@@ -193,6 +241,31 @@ public static Balance maybe_claimable_htlcawaiting_timeout(long claimable_amount
193241 return ret_hu_conv ;
194242 }
195243
244+ /**
245+ * Utility method to constructs a new MaybePreimageClaimableHTLC-variant Balance
246+ */
247+ public static Balance maybe_preimage_claimable_htlc (long claimable_amount_satoshis , int expiry_height ) {
248+ long ret = bindings .Balance_maybe_preimage_claimable_htlc (claimable_amount_satoshis , expiry_height );
249+ Reference .reachabilityFence (claimable_amount_satoshis );
250+ Reference .reachabilityFence (expiry_height );
251+ if (ret >= 0 && ret <= 4096 ) { return null ; }
252+ org .ldk .structs .Balance ret_hu_conv = org .ldk .structs .Balance .constr_from_ptr (ret );
253+ if (ret_hu_conv != null ) { ret_hu_conv .ptrs_to .add (ret_hu_conv ); };
254+ return ret_hu_conv ;
255+ }
256+
257+ /**
258+ * Utility method to constructs a new CounterpartyRevokedOutputClaimable-variant Balance
259+ */
260+ public static Balance counterparty_revoked_output_claimable (long claimable_amount_satoshis ) {
261+ long ret = bindings .Balance_counterparty_revoked_output_claimable (claimable_amount_satoshis );
262+ Reference .reachabilityFence (claimable_amount_satoshis );
263+ if (ret >= 0 && ret <= 4096 ) { return null ; }
264+ org .ldk .structs .Balance ret_hu_conv = org .ldk .structs .Balance .constr_from_ptr (ret );
265+ if (ret_hu_conv != null ) { ret_hu_conv .ptrs_to .add (ret_hu_conv ); };
266+ return ret_hu_conv ;
267+ }
268+
196269 /**
197270 * Checks if two Balances contain equal inner contents.
198271 * This ignores pointers and is_owned flags and looks at the values in fields.
0 commit comments