- public void set_payment_preimage(UpdateFulfillHTLC this_ptr, byte[] val) {
- bindings.UpdateFulfillHTLC_set_payment_preimage(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
- this.ptrs_to.add(this_ptr);
+ /**
+ * The pre-image of the payment hash, allowing HTLC redemption
+ */
+ public void set_payment_preimage(byte[] val) {
+ bindings.UpdateFulfillHTLC_set_payment_preimage(this.ptr, val);
+ }
+
+ /**
+ * Constructs a new UpdateFulfillHTLC given each field
+ */
+ public static UpdateFulfillHTLC of(byte[] channel_id_arg, long htlc_id_arg, byte[] payment_preimage_arg) {
+ long ret = bindings.UpdateFulfillHTLC_new(channel_id_arg, htlc_id_arg, payment_preimage_arg);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ UpdateFulfillHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFulfillHTLC(null, ret); }
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;