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 byte[] ret = bindings.TxSignatures_get_channel_id(this.ptr);
31 public void set_channel_id(byte[] val) {
32 bindings.TxSignatures_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
40 public byte[] get_tx_hash() {
41 byte[] ret = bindings.TxSignatures_get_tx_hash(this.ptr);
49 public void set_tx_hash(byte[] val) {
50 bindings.TxSignatures_set_tx_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
56 * The list of witnesses
58 * Returns a copy of the field.
60 public byte[][] get_witnesses() {
61 byte[][] ret = bindings.TxSignatures_get_witnesses(this.ptr);
67 * The list of witnesses
69 public void set_witnesses(byte[][] val) {
70 bindings.TxSignatures_set_witnesses(this.ptr, val);
76 * Constructs a new TxSignatures given each field
78 public static TxSignatures of(byte[] channel_id_arg, byte[] tx_hash_arg, byte[][] witnesses_arg) {
79 long ret = bindings.TxSignatures_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(tx_hash_arg, 32), witnesses_arg);
80 GC.KeepAlive(channel_id_arg);
81 GC.KeepAlive(tx_hash_arg);
82 GC.KeepAlive(witnesses_arg);
83 if (ret >= 0 && ret <= 4096) { return null; }
84 org.ldk.structs.TxSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxSignatures(null, ret); }
85 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
89 internal long clone_ptr() {
90 long ret = bindings.TxSignatures_clone_ptr(this.ptr);
96 * Creates a copy of the TxSignatures
98 public TxSignatures clone() {
99 long ret = bindings.TxSignatures_clone(this.ptr);
101 if (ret >= 0 && ret <= 4096) { return null; }
102 org.ldk.structs.TxSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxSignatures(null, ret); }
103 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
108 * Checks if two TxSignaturess contain equal inner contents.
109 * This ignores pointers and is_owned flags and looks at the values in fields.
110 * Two objects with NULL inner values will be considered "equal" here.
112 public bool eq(org.ldk.structs.TxSignatures b) {
113 bool ret = bindings.TxSignatures_eq(this.ptr, b == null ? 0 : b.ptr);
116 if (this != null) { this.ptrs_to.AddLast(b); };
120 public override bool Equals(object o) {
121 if (!(o is TxSignatures)) return false;
122 return this.eq((TxSignatures)o);
125 * Serialize the TxSignatures object into a byte array which can be read by TxSignatures_read
127 public byte[] write() {
128 byte[] ret = bindings.TxSignatures_write(this.ptr);
134 * Read a TxSignatures from a byte array, created by TxSignatures_write
136 public static Result_TxSignaturesDecodeErrorZ read(byte[] ser) {
137 long ret = bindings.TxSignatures_read(ser);
139 if (ret >= 0 && ret <= 4096) { return null; }
140 Result_TxSignaturesDecodeErrorZ ret_hu_conv = Result_TxSignaturesDecodeErrorZ.constr_from_ptr(ret);