+ /**
+ * Generates a non-cryptographic 64-bit hash of the RouteParameters.
+ */
+ public long hash() {
+ long ret = bindings.RouteParameters_hash(this.ptr);
+ GC.KeepAlive(this);
+ return ret;
+ }
+
+ public override int GetHashCode() {
+ return (int)this.hash();
+ }
+ /**
+ * Checks if two RouteParameterss contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public bool eq(org.ldk.structs.RouteParameters b) {
+ bool ret = bindings.RouteParameters_eq(this.ptr, b.ptr);
+ GC.KeepAlive(this);
+ GC.KeepAlive(b);
+ if (this != null) { this.ptrs_to.AddLast(b); };
+ return ret;
+ }
+
+ public override bool Equals(object o) {
+ if (!(o is RouteParameters)) return false;
+ return this.eq((RouteParameters)o);
+ }
+ /**
+ * Constructs [`RouteParameters`] from the given [`PaymentParameters`] and a payment amount.
+ *
+ * [`Self::max_total_routing_fee_msat`] defaults to 1% of the payment amount + 50 sats
+ */
+ public static RouteParameters from_payment_params_and_value(org.ldk.structs.PaymentParameters payment_params, long final_value_msat) {
+ long ret = bindings.RouteParameters_from_payment_params_and_value(payment_params.ptr, final_value_msat);
+ GC.KeepAlive(payment_params);
+ GC.KeepAlive(final_value_msat);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.RouteParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteParameters(null, ret); }
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_params); };
+ return ret_hu_conv;
+ }
+