* The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
* taken.
*/
- public Option_PaymentPreimageZ get_preimage() {
+ public Option_ThirtyTwoBytesZ get_preimage() {
long ret = bindings.HTLCDescriptor_get_preimage(this.ptr);
Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
- org.ldk.structs.Option_PaymentPreimageZ ret_hu_conv = org.ldk.structs.Option_PaymentPreimageZ.constr_from_ptr(ret);
+ org.ldk.structs.Option_ThirtyTwoBytesZ ret_hu_conv = org.ldk.structs.Option_ThirtyTwoBytesZ.constr_from_ptr(ret);
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
return ret_hu_conv;
}
* The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
* taken.
*/
- public void set_preimage(org.ldk.structs.Option_PaymentPreimageZ val) {
+ public void set_preimage(org.ldk.structs.Option_ThirtyTwoBytesZ val) {
bindings.HTLCDescriptor_set_preimage(this.ptr, val.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(val);
if (!(o instanceof HTLCDescriptor)) return false;
return this.eq((HTLCDescriptor)o);
}
+ /**
+ * Serialize the HTLCDescriptor object into a byte array which can be read by HTLCDescriptor_read
+ */
+ public byte[] write() {
+ byte[] ret = bindings.HTLCDescriptor_write(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * Read a HTLCDescriptor from a byte array, created by HTLCDescriptor_write
+ */
+ public static Result_HTLCDescriptorDecodeErrorZ read(byte[] ser) {
+ long ret = bindings.HTLCDescriptor_read(ser);
+ Reference.reachabilityFence(ser);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_HTLCDescriptorDecodeErrorZ ret_hu_conv = Result_HTLCDescriptorDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
/**
* Returns the outpoint of the HTLC output in the commitment transaction. This is the outpoint
* being spent by the HTLC input in the HTLC transaction.