[Java] Update auto-generated Java bindings
[ldk-java] / src / main / java / org / ldk / structs / ChannelManager.java
index 902b633b0253649e19af459127c7eba80385c460..5a2ccd0b1efeead9805b752875391e8d3bf93f07 100644 (file)
@@ -40,6 +40,15 @@ import javax.annotation.Nullable;
  * offline for a full minute. In order to track this, you must call
  * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
  * 
+ * To avoid trivial DoS issues, ChannelManager limits the number of inbound connections and
+ * inbound channels without confirmed funding transactions. This may result in nodes which we do
+ * not have a channel with being unable to connect to us or open new channels with us if we have
+ * many peers with unfunded channels.
+ * 
+ * Because it is an indication of trust, inbound channels which we've accepted as 0conf are
+ * exempted from the count of unfunded channels. Similarly, outbound channels and connections are
+ * never limited. Please ensure you limit the count of such channels yourself.
+ * 
  * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
  * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
  * essentially you should default to using a SimpleRefChannelManager, and use a
@@ -67,13 +76,16 @@ public class ChannelManager extends CommonBase {
         * disconnected using its `block_connected` and `block_disconnected` methods, starting
         * from after `params.latest_hash`.
         */
-       public static ChannelManager of(org.ldk.structs.FeeEstimator fee_est, org.ldk.structs.Watch chain_monitor, org.ldk.structs.BroadcasterInterface tx_broadcaster, org.ldk.structs.Logger logger, org.ldk.structs.KeysInterface keys_manager, org.ldk.structs.UserConfig config, org.ldk.structs.ChainParameters params) {
-               long ret = bindings.ChannelManager_new(fee_est == null ? 0 : fee_est.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, tx_broadcaster == null ? 0 : tx_broadcaster.ptr, logger == null ? 0 : logger.ptr, keys_manager == null ? 0 : keys_manager.ptr, config == null ? 0 : config.ptr, params == null ? 0 : params.ptr);
+       public static ChannelManager of(org.ldk.structs.FeeEstimator fee_est, org.ldk.structs.Watch chain_monitor, org.ldk.structs.BroadcasterInterface tx_broadcaster, org.ldk.structs.Router router, org.ldk.structs.Logger logger, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.SignerProvider signer_provider, org.ldk.structs.UserConfig config, org.ldk.structs.ChainParameters params) {
+               long ret = bindings.ChannelManager_new(fee_est == null ? 0 : fee_est.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, tx_broadcaster == null ? 0 : tx_broadcaster.ptr, router == null ? 0 : router.ptr, logger == null ? 0 : logger.ptr, entropy_source == null ? 0 : entropy_source.ptr, node_signer == null ? 0 : node_signer.ptr, signer_provider == null ? 0 : signer_provider.ptr, config == null ? 0 : config.ptr, params == null ? 0 : params.ptr);
                Reference.reachabilityFence(fee_est);
                Reference.reachabilityFence(chain_monitor);
                Reference.reachabilityFence(tx_broadcaster);
+               Reference.reachabilityFence(router);
                Reference.reachabilityFence(logger);
-               Reference.reachabilityFence(keys_manager);
+               Reference.reachabilityFence(entropy_source);
+               Reference.reachabilityFence(node_signer);
+               Reference.reachabilityFence(signer_provider);
                Reference.reachabilityFence(config);
                Reference.reachabilityFence(params);
                if (ret >= 0 && ret <= 4096) { return null; }
@@ -82,8 +94,11 @@ public class ChannelManager extends CommonBase {
                if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(fee_est); };
                if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(chain_monitor); };
                if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(tx_broadcaster); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(router); };
                if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); };
-               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(keys_manager); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_signer); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(signer_provider); };
                if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(config); };
                if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(params); };
                return ret_hu_conv;
@@ -163,14 +178,12 @@ public class ChannelManager extends CommonBase {
        }
 
        /**
-        * Gets the list of usable channels, in random order. Useful as an argument to [`find_route`]
-        * to ensure non-announced channels are used.
+        * Gets the list of usable channels, in random order. Useful as an argument to
+        * [`Router::find_route`] to ensure non-announced channels are used.
         * 
         * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
         * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
         * are.
-        * 
-        * [`find_route`]: crate::routing::router::find_route
         */
        public ChannelDetails[] list_usable_channels() {
                long[] ret = bindings.ChannelManager_list_usable_channels(this.ptr);
@@ -186,6 +199,30 @@ public class ChannelManager extends CommonBase {
                return ret_conv_16_arr;
        }
 
+       /**
+        * Returns in an undefined order recent payments that -- if not fulfilled -- have yet to find a
+        * successful path, or have unresolved HTLCs.
+        * 
+        * This can be useful for payments that may have been prepared, but ultimately not sent, as a
+        * result of a crash. If such a payment exists, is not listed here, and an
+        * [`Event::PaymentSent`] has not been received, you may consider resending the payment.
+        * 
+        * [`Event::PaymentSent`]: events::Event::PaymentSent
+        */
+       public RecentPaymentDetails[] list_recent_payments() {
+               long[] ret = bindings.ChannelManager_list_recent_payments(this.ptr);
+               Reference.reachabilityFence(this);
+               int ret_conv_22_len = ret.length;
+               RecentPaymentDetails[] ret_conv_22_arr = new RecentPaymentDetails[ret_conv_22_len];
+               for (int w = 0; w < ret_conv_22_len; w++) {
+                       long ret_conv_22 = ret[w];
+                       org.ldk.structs.RecentPaymentDetails ret_conv_22_hu_conv = org.ldk.structs.RecentPaymentDetails.constr_from_ptr(ret_conv_22);
+                       if (ret_conv_22_hu_conv != null) { ret_conv_22_hu_conv.ptrs_to.add(this); };
+                       ret_conv_22_arr[w] = ret_conv_22_hu_conv;
+               }
+               return ret_conv_22_arr;
+       }
+
        /**
         * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
         * will be accepted on the given channel, and after additional timeout/the closing of all
@@ -302,14 +339,19 @@ public class ChannelManager extends CommonBase {
        /**
         * Sends a payment along a given route.
         * 
-        * Value parameters are provided via the last hop in route, see documentation for RouteHop
+        * Value parameters are provided via the last hop in route, see documentation for [`RouteHop`]
         * fields for more info.
         * 
+        * May generate SendHTLCs message(s) event on success, which should be relayed (e.g. via
+        * [`PeerManager::process_events`]).
+        * 
+        * # Avoiding Duplicate Payments
+        * 
         * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this
         * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment
         * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an
-        * [`Event::PaymentSent`]) LDK will not stop you from sending a second payment with the same
-        * [`PaymentId`].
+        * [`Event::PaymentSent`] or [`Event::PaymentFailed`]) LDK will not stop you from sending a
+        * second payment with the same [`PaymentId`].
         * 
         * Thus, in order to ensure duplicate payments are not sent, you should implement your own
         * tracking of payments, including state to indicate once a payment has completed. Because you
@@ -317,12 +359,16 @@ public class ChannelManager extends CommonBase {
         * consider using the [`PaymentHash`] as the key for tracking payments. In that case, the
         * [`PaymentId`] should be a copy of the [`PaymentHash`] bytes.
         * 
-        * May generate SendHTLCs message(s) event on success, which should be relayed (e.g. via
-        * [`PeerManager::process_events`]).
+        * Additionally, in the scenario where we begin the process of sending a payment, but crash
+        * before `send_payment` returns (or prior to [`ChannelMonitorUpdate`] persistence if you're
+        * using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See
+        * [`ChannelManager::list_recent_payments`] for more information.
+        * 
+        * # Possible Error States on [`PaymentSendFailure`]
         * 
         * Each path may have a different return value, and PaymentSendValue may return a Vec with
         * each entry matching the corresponding-index entry in the route paths, see
-        * PaymentSendFailure for more info.
+        * [`PaymentSendFailure`] for more info.
         * 
         * In general, a path may raise:
         * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee,
@@ -337,18 +383,22 @@ public class ChannelManager extends CommonBase {
         * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
         * different route unless you intend to pay twice!
         * 
-        * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
-        * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
-        * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
-        * must not contain multiple paths as multi-path payments require a recipient-provided
-        * payment_secret.
+        * # A caution on `payment_secret`
+        * 
+        * `payment_secret` is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
+        * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
+        * attacks. For newer nodes, it will be provided to you in the invoice. If you do not have one,
+        * the [`Route`] must not contain multiple paths as multi-path payments require a
+        * recipient-provided `payment_secret`.
         * 
-        * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
-        * bit set (either as required or as available). If multiple paths are present in the Route,
-        * we assume the invoice had the basic_mpp feature set.
+        * If a `payment_secret` *is* provided, we assume that the invoice had the payment_secret
+        * feature bit set (either as required or as available). If multiple paths are present in the
+        * [`Route`], we assume the invoice had the basic_mpp feature set.
         * 
         * [`Event::PaymentSent`]: events::Event::PaymentSent
+        * [`Event::PaymentFailed`]: events::Event::PaymentFailed
         * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
+        * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
         * 
         * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
@@ -366,47 +416,41 @@ public class ChannelManager extends CommonBase {
        }
 
        /**
-        * Retries a payment along the given [`Route`].
+        * Similar to [`ChannelManager::send_payment`], but will automatically find a route based on
+        * `route_params` and retry failed payment paths based on `retry_strategy`.
         * 
-        * Errors returned are a superset of those returned from [`send_payment`], so see
-        * [`send_payment`] documentation for more details on errors. This method will also error if the
-        * retry amount puts the payment more than 10% over the payment's total amount, if the payment
-        * for the given `payment_id` cannot be found (likely due to timeout or success), or if
-        * further retries have been disabled with [`abandon_payment`].
-        * 
-        * [`send_payment`]: [`ChannelManager::send_payment`]
-        * [`abandon_payment`]: [`ChannelManager::abandon_payment`]
+        * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public Result_NonePaymentSendFailureZ retry_payment(org.ldk.structs.Route route, byte[] payment_id) {
-               long ret = bindings.ChannelManager_retry_payment(this.ptr, route == null ? 0 : route.ptr, InternalUtils.check_arr_len(payment_id, 32));
+       public Result_NoneRetryableSendFailureZ send_payment_with_retry(byte[] payment_hash, @Nullable byte[] payment_secret, byte[] payment_id, org.ldk.structs.RouteParameters route_params, org.ldk.structs.Retry retry_strategy) {
+               long ret = bindings.ChannelManager_send_payment_with_retry(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), InternalUtils.check_arr_len(payment_secret, 32), InternalUtils.check_arr_len(payment_id, 32), route_params == null ? 0 : route_params.ptr, retry_strategy.ptr);
                Reference.reachabilityFence(this);
-               Reference.reachabilityFence(route);
+               Reference.reachabilityFence(payment_hash);
+               Reference.reachabilityFence(payment_secret);
                Reference.reachabilityFence(payment_id);
+               Reference.reachabilityFence(route_params);
+               Reference.reachabilityFence(retry_strategy);
                if (ret >= 0 && ret <= 4096) { return null; }
-               Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret);
-               if (this != null) { this.ptrs_to.add(route); };
+               Result_NoneRetryableSendFailureZ ret_hu_conv = Result_NoneRetryableSendFailureZ.constr_from_ptr(ret);
+               if (this != null) { this.ptrs_to.add(route_params); };
+               if (this != null) { this.ptrs_to.add(retry_strategy); };
                return ret_hu_conv;
        }
 
        /**
-        * Signals that no further retries for the given payment will occur.
+        * Signals that no further retries for the given payment should occur. Useful if you have a
+        * pending outbound payment with retries remaining, but wish to stop retrying the payment before
+        * retries are exhausted.
         * 
-        * After this method returns, no future calls to [`retry_payment`] for the given `payment_id`
-        * are allowed. If no [`Event::PaymentFailed`] event had been generated before, one will be
-        * generated as soon as there are no remaining pending HTLCs for this payment.
+        * If no [`Event::PaymentFailed`] event had been generated before, one will be generated as soon
+        * as there are no remaining pending HTLCs for this payment.
         * 
         * Note that calling this method does *not* prevent a payment from succeeding. You must still
         * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
         * determine the ultimate status of a payment.
         * 
         * If an [`Event::PaymentFailed`] event is generated and we restart without this
-        * [`ChannelManager`] having been persisted, the payment may still be in the pending state
-        * upon restart. This allows further calls to [`retry_payment`] (and requiring a second call
-        * to [`abandon_payment`] to mark the payment as failed again). Otherwise, future calls to
-        * [`retry_payment`] will fail with [`PaymentSendFailure::ParameterError`].
+        * [`ChannelManager`] having been persisted, another [`Event::PaymentFailed`] may be generated.
         * 
-        * [`abandon_payment`]: Self::abandon_payment
-        * [`retry_payment`]: Self::retry_payment
         * [`Event::PaymentFailed`]: events::Event::PaymentFailed
         * [`Event::PaymentSent`]: events::Event::PaymentSent
         */
@@ -447,6 +491,31 @@ public class ChannelManager extends CommonBase {
                return ret_hu_conv;
        }
 
+       /**
+        * Similar to [`ChannelManager::send_spontaneous_payment`], but will automatically find a route
+        * based on `route_params` and retry failed payment paths based on `retry_strategy`.
+        * 
+        * See [`PaymentParameters::for_keysend`] for help in constructing `route_params` for spontaneous
+        * payments.
+        * 
+        * [`PaymentParameters::for_keysend`]: crate::routing::router::PaymentParameters::for_keysend
+        * 
+        * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
+        */
+       public Result_PaymentHashRetryableSendFailureZ send_spontaneous_payment_with_retry(@Nullable byte[] payment_preimage, byte[] payment_id, org.ldk.structs.RouteParameters route_params, org.ldk.structs.Retry retry_strategy) {
+               long ret = bindings.ChannelManager_send_spontaneous_payment_with_retry(this.ptr, InternalUtils.check_arr_len(payment_preimage, 32), InternalUtils.check_arr_len(payment_id, 32), route_params == null ? 0 : route_params.ptr, retry_strategy.ptr);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(payment_preimage);
+               Reference.reachabilityFence(payment_id);
+               Reference.reachabilityFence(route_params);
+               Reference.reachabilityFence(retry_strategy);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               Result_PaymentHashRetryableSendFailureZ ret_hu_conv = Result_PaymentHashRetryableSendFailureZ.constr_from_ptr(ret);
+               if (this != null) { this.ptrs_to.add(route_params); };
+               if (this != null) { this.ptrs_to.add(retry_strategy); };
+               return ret_hu_conv;
+       }
+
        /**
         * Send a payment that is probing the given route for liquidity. We calculate the
         * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
@@ -563,12 +632,12 @@ public class ChannelManager extends CommonBase {
         * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
         * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
         */
-       public Result_NoneAPIErrorZ forward_intercepted_htlc(byte[] intercept_id, byte[] next_hop_channel_id, byte[] _next_node_id, long amt_to_forward_msat) {
-               long ret = bindings.ChannelManager_forward_intercepted_htlc(this.ptr, InternalUtils.check_arr_len(intercept_id, 32), InternalUtils.check_arr_len(next_hop_channel_id, 32), InternalUtils.check_arr_len(_next_node_id, 33), amt_to_forward_msat);
+       public Result_NoneAPIErrorZ forward_intercepted_htlc(byte[] intercept_id, byte[] next_hop_channel_id, byte[] next_node_id, long amt_to_forward_msat) {
+               long ret = bindings.ChannelManager_forward_intercepted_htlc(this.ptr, InternalUtils.check_arr_len(intercept_id, 32), InternalUtils.check_arr_len(next_hop_channel_id, 32), InternalUtils.check_arr_len(next_node_id, 33), amt_to_forward_msat);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(intercept_id);
                Reference.reachabilityFence(next_hop_channel_id);
-               Reference.reachabilityFence(_next_node_id);
+               Reference.reachabilityFence(next_node_id);
                Reference.reachabilityFence(amt_to_forward_msat);
                if (ret >= 0 && ret <= 4096) { return null; }
                Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret);
@@ -614,6 +683,7 @@ public class ChannelManager extends CommonBase {
         * the channel.
         * Expiring a channel's previous `ChannelConfig` if necessary to only allow forwarding HTLCs
         * with the current `ChannelConfig`.
+        * Removing peers which have disconnected but and no longer have any channels.
         * 
         * Note that this may cause reentrancy through `chain::Watch::update_channel` calls or feerate
         * estimate fetches.
@@ -644,6 +714,19 @@ public class ChannelManager extends CommonBase {
                Reference.reachabilityFence(payment_hash);
        }
 
+       /**
+        * This is a variant of [`ChannelManager::fail_htlc_backwards`] that allows you to specify the
+        * reason for the failure.
+        * 
+        * See [`FailureCode`] for valid failure codes.
+        */
+       public void fail_htlc_backwards_with_reason(byte[] payment_hash, org.ldk.enums.FailureCode failure_code) {
+               bindings.ChannelManager_fail_htlc_backwards_with_reason(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), failure_code);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(payment_hash);
+               Reference.reachabilityFence(failure_code);
+       }
+
        /**
         * Provides a payment preimage in response to [`Event::PaymentClaimable`], generating any
         * [`MessageSendEvent`]s needed to claim the payment.
@@ -746,7 +829,8 @@ public class ChannelManager extends CommonBase {
         * [`PaymentHash`] and [`PaymentPreimage`] for you.
         * 
         * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`], which
-        * will have the [`PaymentClaimable::payment_preimage`] field filled in. That should then be
+        * will have the [`PaymentClaimable::purpose`] be [`PaymentPurpose::InvoicePayment`] with
+        * its [`PaymentPurpose::InvoicePayment::payment_preimage`] field filled in. That should then be
         * passed directly to [`claim_funds`].
         * 
         * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
@@ -761,18 +845,26 @@ public class ChannelManager extends CommonBase {
         * 
         * Errors if `min_value_msat` is greater than total bitcoin supply.
         * 
+        * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
+        * on versions of LDK prior to 0.0.114.
+        * 
         * [`claim_funds`]: Self::claim_funds
         * [`PaymentClaimable`]: events::Event::PaymentClaimable
-        * [`PaymentClaimable::payment_preimage`]: events::Event::PaymentClaimable::payment_preimage
+        * [`PaymentClaimable::purpose`]: events::Event::PaymentClaimable::purpose
+        * [`PaymentPurpose::InvoicePayment`]: events::PaymentPurpose::InvoicePayment
+        * [`PaymentPurpose::InvoicePayment::payment_preimage`]: events::PaymentPurpose::InvoicePayment::payment_preimage
         * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
         */
-       public Result_C2Tuple_PaymentHashPaymentSecretZNoneZ create_inbound_payment(org.ldk.structs.Option_u64Z min_value_msat, int invoice_expiry_delta_secs) {
-               long ret = bindings.ChannelManager_create_inbound_payment(this.ptr, min_value_msat.ptr, invoice_expiry_delta_secs);
+       public Result_C2Tuple_PaymentHashPaymentSecretZNoneZ create_inbound_payment(org.ldk.structs.Option_u64Z min_value_msat, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) {
+               long ret = bindings.ChannelManager_create_inbound_payment(this.ptr, min_value_msat.ptr, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(min_value_msat);
                Reference.reachabilityFence(invoice_expiry_delta_secs);
+               Reference.reachabilityFence(min_final_cltv_expiry_delta);
                if (ret >= 0 && ret <= 4096) { return null; }
                Result_C2Tuple_PaymentHashPaymentSecretZNoneZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.constr_from_ptr(ret);
+               if (this != null) { this.ptrs_to.add(min_value_msat); };
+               if (this != null) { this.ptrs_to.add(min_final_cltv_expiry_delta); };
                return ret_hu_conv;
        }
 
@@ -794,6 +886,7 @@ public class ChannelManager extends CommonBase {
                Reference.reachabilityFence(invoice_expiry_delta_secs);
                if (ret >= 0 && ret <= 4096) { return null; }
                Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.constr_from_ptr(ret);
+               if (this != null) { this.ptrs_to.add(min_value_msat); };
                return ret_hu_conv;
        }
 
@@ -826,8 +919,8 @@ public class ChannelManager extends CommonBase {
         * If you need exact expiry semantics, you should enforce them upon receipt of
         * [`PaymentClaimable`].
         * 
-        * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
-        * set to at least [`MIN_FINAL_CLTV_EXPIRY`].
+        * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry_delta`
+        * set to at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
         * 
         * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
         * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
@@ -839,17 +932,23 @@ public class ChannelManager extends CommonBase {
         * 
         * Errors if `min_value_msat` is greater than total bitcoin supply.
         * 
+        * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
+        * on versions of LDK prior to 0.0.114.
+        * 
         * [`create_inbound_payment`]: Self::create_inbound_payment
         * [`PaymentClaimable`]: events::Event::PaymentClaimable
         */
-       public Result_PaymentSecretNoneZ create_inbound_payment_for_hash(byte[] payment_hash, org.ldk.structs.Option_u64Z min_value_msat, int invoice_expiry_delta_secs) {
-               long ret = bindings.ChannelManager_create_inbound_payment_for_hash(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), min_value_msat.ptr, invoice_expiry_delta_secs);
+       public Result_PaymentSecretNoneZ create_inbound_payment_for_hash(byte[] payment_hash, org.ldk.structs.Option_u64Z min_value_msat, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry) {
+               long ret = bindings.ChannelManager_create_inbound_payment_for_hash(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), min_value_msat.ptr, invoice_expiry_delta_secs, min_final_cltv_expiry.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(payment_hash);
                Reference.reachabilityFence(min_value_msat);
                Reference.reachabilityFence(invoice_expiry_delta_secs);
+               Reference.reachabilityFence(min_final_cltv_expiry);
                if (ret >= 0 && ret <= 4096) { return null; }
                Result_PaymentSecretNoneZ ret_hu_conv = Result_PaymentSecretNoneZ.constr_from_ptr(ret);
+               if (this != null) { this.ptrs_to.add(min_value_msat); };
+               if (this != null) { this.ptrs_to.add(min_final_cltv_expiry); };
                return ret_hu_conv;
        }
 
@@ -872,6 +971,7 @@ public class ChannelManager extends CommonBase {
                Reference.reachabilityFence(invoice_expiry_delta_secs);
                if (ret >= 0 && ret <= 4096) { return null; }
                Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret);
+               if (this != null) { this.ptrs_to.add(min_value_msat); };
                return ret_hu_conv;
        }
 
@@ -1055,6 +1155,58 @@ public class ChannelManager extends CommonBase {
                return ret_hu_conv;
        }
 
+       /**
+        * Fetches the set of [`NodeFeatures`] flags which are provided by or required by
+        * [`ChannelManager`].
+        */
+       public NodeFeatures node_features() {
+               long ret = bindings.ChannelManager_node_features(this.ptr);
+               Reference.reachabilityFence(this);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); }
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Fetches the set of [`ChannelFeatures`] flags which are provided by or required by
+        * [`ChannelManager`].
+        */
+       public ChannelFeatures channel_features() {
+               long ret = bindings.ChannelManager_channel_features(this.ptr);
+               Reference.reachabilityFence(this);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelFeatures(null, ret); }
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Fetches the set of [`ChannelTypeFeatures`] flags which are provided by or required by
+        * [`ChannelManager`].
+        */
+       public ChannelTypeFeatures channel_type_features() {
+               long ret = bindings.ChannelManager_channel_type_features(this.ptr);
+               Reference.reachabilityFence(this);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); }
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Fetches the set of [`InitFeatures`] flags which are provided by or required by
+        * [`ChannelManager`].
+        */
+       public InitFeatures init_features() {
+               long ret = bindings.ChannelManager_init_features(this.ptr);
+               Reference.reachabilityFence(this);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); }
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
+               return ret_hu_conv;
+       }
+
        /**
         * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
         * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
@@ -1077,17 +1229,4 @@ public class ChannelManager extends CommonBase {
                return ret;
        }
 
-       /**
-        * Constructs a new Payer which calls the relevant methods on this_arg.
-        * This copies the `inner` pointer in this_arg and thus the returned Payer must be freed before this_arg is
-        */
-       public Payer as_Payer() {
-               long ret = bindings.ChannelManager_as_Payer(this.ptr);
-               Reference.reachabilityFence(this);
-               if (ret >= 0 && ret <= 4096) { return null; }
-               Payer ret_hu_conv = new Payer(null, ret);
-               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
-               return ret_hu_conv;
-       }
-
 }