X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FFundingCreated.java;h=a49682c50ed19a99c2c8f496d4afc8e0093ffff9;hb=a442b8532ad57aed1fc740141189899b39a15d79;hp=f45f2c6889509ecda4229cb4c96de296ee59cbe9;hpb=110f2f104ba8fc34caa7e34e04737f36f064b050;p=ldk-java diff --git a/src/main/java/org/ldk/structs/FundingCreated.java b/src/main/java/org/ldk/structs/FundingCreated.java index f45f2c68..a49682c5 100644 --- a/src/main/java/org/ldk/structs/FundingCreated.java +++ b/src/main/java/org/ldk/structs/FundingCreated.java @@ -5,73 +5,113 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A funding_created message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class FundingCreated extends CommonBase { FundingCreated(Object _dummy, long ptr) { super(ptr); } @Override @SuppressWarnings("deprecation") protected void finalize() throws Throwable { super.finalize(); - bindings.FundingCreated_free(ptr); - } - - public static FundingCreated constructor_clone(FundingCreated orig) { - long ret = bindings.FundingCreated_clone(orig == null ? 0 : orig.ptr & ~1); - FundingCreated ret_hu_conv = new FundingCreated(null, ret); - ret_hu_conv.ptrs_to.add(orig); - return ret_hu_conv; + if (ptr != 0) { bindings.FundingCreated_free(ptr); } } + /** + * A temporary channel ID, until the funding is established + */ public byte[] get_temporary_channel_id() { byte[] ret = bindings.FundingCreated_get_temporary_channel_id(this.ptr); return ret; } + /** + * A temporary channel ID, until the funding is established + */ public void set_temporary_channel_id(byte[] val) { bindings.FundingCreated_set_temporary_channel_id(this.ptr, val); } + /** + * The funding transaction ID + */ public byte[] get_funding_txid() { byte[] ret = bindings.FundingCreated_get_funding_txid(this.ptr); return ret; } + /** + * The funding transaction ID + */ public void set_funding_txid(byte[] val) { bindings.FundingCreated_set_funding_txid(this.ptr, val); } + /** + * The specific output index funding this channel + */ public short get_funding_output_index() { short ret = bindings.FundingCreated_get_funding_output_index(this.ptr); return ret; } + /** + * The specific output index funding this channel + */ public void set_funding_output_index(short val) { bindings.FundingCreated_set_funding_output_index(this.ptr, val); } + /** + * The signature of the channel initiator (funder) on the funding transaction + */ public byte[] get_signature() { byte[] ret = bindings.FundingCreated_get_signature(this.ptr); return ret; } + /** + * The signature of the channel initiator (funder) on the funding transaction + */ public void set_signature(byte[] val) { bindings.FundingCreated_set_signature(this.ptr, val); } - public static FundingCreated constructor_new(byte[] temporary_channel_id_arg, byte[] funding_txid_arg, short funding_output_index_arg, byte[] signature_arg) { + /** + * Constructs a new FundingCreated given each field + */ + public static FundingCreated of(byte[] temporary_channel_id_arg, byte[] funding_txid_arg, short funding_output_index_arg, byte[] signature_arg) { long ret = bindings.FundingCreated_new(temporary_channel_id_arg, funding_txid_arg, funding_output_index_arg, signature_arg); FundingCreated ret_hu_conv = new FundingCreated(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } - public byte[] write(FundingCreated obj) { - byte[] ret = bindings.FundingCreated_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + /** + * Creates a copy of the FundingCreated + */ + public FundingCreated clone() { + long ret = bindings.FundingCreated_clone(this.ptr); + FundingCreated ret_hu_conv = new FundingCreated(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read + */ + public byte[] write() { + byte[] ret = bindings.FundingCreated_write(this.ptr); return ret; } - public static FundingCreated constructor_read(byte[] ser) { + /** + * Read a FundingCreated from a byte array, created by FundingCreated_write + */ + public static Result_FundingCreatedDecodeErrorZ read(byte[] ser) { long ret = bindings.FundingCreated_read(ser); - FundingCreated ret_hu_conv = new FundingCreated(null, ret); + Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; }