if (raw_val.getClass() == bindings.LDKEffectiveCapacity.ExactLiquidity.class) {
return new ExactLiquidity(ptr, (bindings.LDKEffectiveCapacity.ExactLiquidity)raw_val);
}
- if (raw_val.getClass() == bindings.LDKEffectiveCapacity.MaximumHTLC.class) {
- return new MaximumHTLC(ptr, (bindings.LDKEffectiveCapacity.MaximumHTLC)raw_val);
+ if (raw_val.getClass() == bindings.LDKEffectiveCapacity.AdvertisedMaxHTLC.class) {
+ return new AdvertisedMaxHTLC(ptr, (bindings.LDKEffectiveCapacity.AdvertisedMaxHTLC)raw_val);
}
if (raw_val.getClass() == bindings.LDKEffectiveCapacity.Total.class) {
return new Total(ptr, (bindings.LDKEffectiveCapacity.Total)raw_val);
if (raw_val.getClass() == bindings.LDKEffectiveCapacity.Infinite.class) {
return new Infinite(ptr, (bindings.LDKEffectiveCapacity.Infinite)raw_val);
}
+ if (raw_val.getClass() == bindings.LDKEffectiveCapacity.HintMaxHTLC.class) {
+ return new HintMaxHTLC(ptr, (bindings.LDKEffectiveCapacity.HintMaxHTLC)raw_val);
+ }
if (raw_val.getClass() == bindings.LDKEffectiveCapacity.Unknown.class) {
return new Unknown(ptr, (bindings.LDKEffectiveCapacity.Unknown)raw_val);
}
/**
* The maximum HTLC amount in one direction as advertised on the gossip network.
*/
- public final static class MaximumHTLC extends EffectiveCapacity {
+ public final static class AdvertisedMaxHTLC extends EffectiveCapacity {
/**
* The maximum HTLC amount denominated in millisatoshi.
*/
public final long amount_msat;
- private MaximumHTLC(long ptr, bindings.LDKEffectiveCapacity.MaximumHTLC obj) {
+ private AdvertisedMaxHTLC(long ptr, bindings.LDKEffectiveCapacity.AdvertisedMaxHTLC obj) {
super(null, ptr);
this.amount_msat = obj.amount_msat;
}
* The funding amount denominated in millisatoshi.
*/
public final long capacity_msat;
+ /**
+ * The maximum HTLC amount denominated in millisatoshi.
+ */
+ public final long htlc_maximum_msat;
private Total(long ptr, bindings.LDKEffectiveCapacity.Total obj) {
super(null, ptr);
this.capacity_msat = obj.capacity_msat;
+ this.htlc_maximum_msat = obj.htlc_maximum_msat;
}
}
/**
super(null, ptr);
}
}
+ /**
+ * The maximum HTLC amount as provided by an invoice route hint.
+ */
+ public final static class HintMaxHTLC extends EffectiveCapacity {
+ /**
+ * The maximum HTLC amount denominated in millisatoshi.
+ */
+ public final long amount_msat;
+ private HintMaxHTLC(long ptr, bindings.LDKEffectiveCapacity.HintMaxHTLC obj) {
+ super(null, ptr);
+ this.amount_msat = obj.amount_msat;
+ }
+ }
/**
* A capacity that is unknown possibly because either the chain state is unavailable to know
* the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
long ret = bindings.EffectiveCapacity_clone(this.ptr);
Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
- EffectiveCapacity ret_hu_conv = EffectiveCapacity.constr_from_ptr(ret);
- ret_hu_conv.ptrs_to.add(this);
+ org.ldk.structs.EffectiveCapacity ret_hu_conv = org.ldk.structs.EffectiveCapacity.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
return ret_hu_conv;
}
long ret = bindings.EffectiveCapacity_exact_liquidity(liquidity_msat);
Reference.reachabilityFence(liquidity_msat);
if (ret >= 0 && ret <= 4096) { return null; }
- EffectiveCapacity ret_hu_conv = EffectiveCapacity.constr_from_ptr(ret);
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ org.ldk.structs.EffectiveCapacity ret_hu_conv = org.ldk.structs.EffectiveCapacity.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
return ret_hu_conv;
}
/**
- * Utility method to constructs a new MaximumHTLC-variant EffectiveCapacity
+ * Utility method to constructs a new AdvertisedMaxHTLC-variant EffectiveCapacity
*/
- public static EffectiveCapacity maximum_htlc(long amount_msat) {
- long ret = bindings.EffectiveCapacity_maximum_htlc(amount_msat);
+ public static EffectiveCapacity advertised_max_htlc(long amount_msat) {
+ long ret = bindings.EffectiveCapacity_advertised_max_htlc(amount_msat);
Reference.reachabilityFence(amount_msat);
if (ret >= 0 && ret <= 4096) { return null; }
- EffectiveCapacity ret_hu_conv = EffectiveCapacity.constr_from_ptr(ret);
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ org.ldk.structs.EffectiveCapacity ret_hu_conv = org.ldk.structs.EffectiveCapacity.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
return ret_hu_conv;
}
/**
* Utility method to constructs a new Total-variant EffectiveCapacity
*/
- public static EffectiveCapacity total(long capacity_msat) {
- long ret = bindings.EffectiveCapacity_total(capacity_msat);
+ public static EffectiveCapacity total(long capacity_msat, long htlc_maximum_msat) {
+ long ret = bindings.EffectiveCapacity_total(capacity_msat, htlc_maximum_msat);
Reference.reachabilityFence(capacity_msat);
+ Reference.reachabilityFence(htlc_maximum_msat);
if (ret >= 0 && ret <= 4096) { return null; }
- EffectiveCapacity ret_hu_conv = EffectiveCapacity.constr_from_ptr(ret);
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ org.ldk.structs.EffectiveCapacity ret_hu_conv = org.ldk.structs.EffectiveCapacity.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
return ret_hu_conv;
}
public static EffectiveCapacity infinite() {
long ret = bindings.EffectiveCapacity_infinite();
if (ret >= 0 && ret <= 4096) { return null; }
- EffectiveCapacity ret_hu_conv = EffectiveCapacity.constr_from_ptr(ret);
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ org.ldk.structs.EffectiveCapacity ret_hu_conv = org.ldk.structs.EffectiveCapacity.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new HintMaxHTLC-variant EffectiveCapacity
+ */
+ public static EffectiveCapacity hint_max_htlc(long amount_msat) {
+ long ret = bindings.EffectiveCapacity_hint_max_htlc(amount_msat);
+ Reference.reachabilityFence(amount_msat);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.EffectiveCapacity ret_hu_conv = org.ldk.structs.EffectiveCapacity.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
return ret_hu_conv;
}
public static EffectiveCapacity unknown() {
long ret = bindings.EffectiveCapacity_unknown();
if (ret >= 0 && ret <= 4096) { return null; }
- EffectiveCapacity ret_hu_conv = EffectiveCapacity.constr_from_ptr(ret);
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ org.ldk.structs.EffectiveCapacity ret_hu_conv = org.ldk.structs.EffectiveCapacity.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
return ret_hu_conv;
}