6 namespace org { namespace ldk { namespace structs {
10 * A tx_signatures message containing the sender's signatures for a transaction constructed with
11 * interactive transaction construction.
13 public class TxSignatures : CommonBase {
14 internal TxSignatures(object _dummy, long ptr) : base(ptr) { }
16 if (ptr != 0) { bindings.TxSignatures_free(ptr); }
22 public byte[] get_channel_id() {
23 long ret = bindings.TxSignatures_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.TxSignatures_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32)));
42 public byte[] get_tx_hash() {
43 long ret = bindings.TxSignatures_get_tx_hash(this.ptr);
45 if (ret >= 0 && ret <= 4096) { return null; }
46 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
53 public void set_tx_hash(byte[] val) {
54 bindings.TxSignatures_set_tx_hash(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32)));
60 * The list of witnesses
62 * Returns a copy of the field.
64 public byte[][] get_witnesses() {
65 long ret = bindings.TxSignatures_get_witnesses(this.ptr);
67 if (ret >= 0 && ret <= 4096) { return null; }
68 int ret_conv_8_len = InternalUtils.getArrayLength(ret);
69 byte[][] ret_conv_8_arr = new byte[ret_conv_8_len][];
70 for (int i = 0; i < ret_conv_8_len; i++) {
71 long ret_conv_8 = InternalUtils.getU64ArrayElem(ret, i);
72 byte[] ret_conv_8_conv = InternalUtils.decodeUint8Array(ret_conv_8);
73 ret_conv_8_arr[i] = ret_conv_8_conv;
75 bindings.free_buffer(ret);
76 return ret_conv_8_arr;
80 * The list of witnesses
82 public void set_witnesses(byte[][] val) {
83 bindings.TxSignatures_set_witnesses(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_8 => InternalUtils.encodeUint8Array(val_conv_8))));
89 * Constructs a new TxSignatures given each field
91 public static TxSignatures of(byte[] channel_id_arg, byte[] tx_hash_arg, byte[][] witnesses_arg) {
92 long ret = bindings.TxSignatures_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(tx_hash_arg, 32)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(witnesses_arg, witnesses_arg_conv_8 => InternalUtils.encodeUint8Array(witnesses_arg_conv_8))));
93 GC.KeepAlive(channel_id_arg);
94 GC.KeepAlive(tx_hash_arg);
95 GC.KeepAlive(witnesses_arg);
96 if (ret >= 0 && ret <= 4096) { return null; }
97 org.ldk.structs.TxSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxSignatures(null, ret); }
98 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
102 internal long clone_ptr() {
103 long ret = bindings.TxSignatures_clone_ptr(this.ptr);
109 * Creates a copy of the TxSignatures
111 public TxSignatures clone() {
112 long ret = bindings.TxSignatures_clone(this.ptr);
114 if (ret >= 0 && ret <= 4096) { return null; }
115 org.ldk.structs.TxSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxSignatures(null, ret); }
116 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
121 * Checks if two TxSignaturess contain equal inner contents.
122 * This ignores pointers and is_owned flags and looks at the values in fields.
123 * Two objects with NULL inner values will be considered "equal" here.
125 public bool eq(org.ldk.structs.TxSignatures b) {
126 bool ret = bindings.TxSignatures_eq(this.ptr, b == null ? 0 : b.ptr);
129 if (this != null) { this.ptrs_to.AddLast(b); };
133 public override bool Equals(object o) {
134 if (!(o is TxSignatures)) return false;
135 return this.eq((TxSignatures)o);
138 * Serialize the TxSignatures object into a byte array which can be read by TxSignatures_read
140 public byte[] write() {
141 long ret = bindings.TxSignatures_write(this.ptr);
143 if (ret >= 0 && ret <= 4096) { return null; }
144 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
149 * Read a TxSignatures from a byte array, created by TxSignatures_write
151 public static Result_TxSignaturesDecodeErrorZ read(byte[] ser) {
152 long ret = bindings.TxSignatures_read(InternalUtils.encodeUint8Array(ser));
154 if (ret >= 0 && ret <= 4096) { return null; }
155 Result_TxSignaturesDecodeErrorZ ret_hu_conv = Result_TxSignaturesDecodeErrorZ.constr_from_ptr(ret);