6 namespace org { namespace ldk { namespace structs {
10 * A tx_complete message signalling the conclusion of a peer's transaction contributions during
11 * interactive transaction construction.
13 public class TxComplete : CommonBase {
14 internal TxComplete(object _dummy, long ptr) : base(ptr) { }
16 if (ptr != 0) { bindings.TxComplete_free(ptr); }
22 public byte[] get_channel_id() {
23 long ret = bindings.TxComplete_get_channel_id(this.ptr);
25 if (ret >= 0 && ret <= 4096) { return null; }
26 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
33 public void set_channel_id(byte[] val) {
34 bindings.TxComplete_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32)));
40 * Constructs a new TxComplete given each field
42 public static TxComplete of(byte[] channel_id_arg) {
43 long ret = bindings.TxComplete_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)));
44 GC.KeepAlive(channel_id_arg);
45 if (ret >= 0 && ret <= 4096) { return null; }
46 org.ldk.structs.TxComplete ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxComplete(null, ret); }
47 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
51 internal long clone_ptr() {
52 long ret = bindings.TxComplete_clone_ptr(this.ptr);
58 * Creates a copy of the TxComplete
60 public TxComplete clone() {
61 long ret = bindings.TxComplete_clone(this.ptr);
63 if (ret >= 0 && ret <= 4096) { return null; }
64 org.ldk.structs.TxComplete ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxComplete(null, ret); }
65 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
70 * Generates a non-cryptographic 64-bit hash of the TxComplete.
73 long ret = bindings.TxComplete_hash(this.ptr);
78 public override int GetHashCode() {
79 return (int)this.hash();
82 * Checks if two TxCompletes contain equal inner contents.
83 * This ignores pointers and is_owned flags and looks at the values in fields.
84 * Two objects with NULL inner values will be considered "equal" here.
86 public bool eq(org.ldk.structs.TxComplete b) {
87 bool ret = bindings.TxComplete_eq(this.ptr, b == null ? 0 : b.ptr);
90 if (this != null) { this.ptrs_to.AddLast(b); };
94 public override bool Equals(object o) {
95 if (!(o is TxComplete)) return false;
96 return this.eq((TxComplete)o);
99 * Serialize the TxComplete object into a byte array which can be read by TxComplete_read
101 public byte[] write() {
102 long ret = bindings.TxComplete_write(this.ptr);
104 if (ret >= 0 && ret <= 4096) { return null; }
105 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
110 * Read a TxComplete from a byte array, created by TxComplete_write
112 public static Result_TxCompleteDecodeErrorZ read(byte[] ser) {
113 long ret = bindings.TxComplete_read(InternalUtils.encodeUint8Array(ser));
115 if (ret >= 0 && ret <= 4096) { return null; }
116 Result_TxCompleteDecodeErrorZ ret_hu_conv = Result_TxCompleteDecodeErrorZ.constr_from_ptr(ret);