6 namespace org { namespace ldk { namespace structs {
10 * A tx_ack_rbf message which acknowledges replacement of the transaction after it's been
13 public class TxAckRbf : CommonBase {
14 internal TxAckRbf(object _dummy, long ptr) : base(ptr) { }
16 if (ptr != 0) { bindings.TxAckRbf_free(ptr); }
22 public byte[] get_channel_id() {
23 long ret = bindings.TxAckRbf_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.TxAckRbf_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32)));
40 * The number of satoshis the sender will contribute to or, if negative, remove from
41 * (e.g. splice-out) the funding output of the transaction
43 public Option_i64Z get_funding_output_contribution() {
44 long ret = bindings.TxAckRbf_get_funding_output_contribution(this.ptr);
46 if (ret >= 0 && ret <= 4096) { return null; }
47 org.ldk.structs.Option_i64Z ret_hu_conv = org.ldk.structs.Option_i64Z.constr_from_ptr(ret);
48 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
53 * The number of satoshis the sender will contribute to or, if negative, remove from
54 * (e.g. splice-out) the funding output of the transaction
56 public void set_funding_output_contribution(org.ldk.structs.Option_i64Z val) {
57 bindings.TxAckRbf_set_funding_output_contribution(this.ptr, val.ptr);
60 if (this != null) { this.ptrs_to.AddLast(val); };
64 * Constructs a new TxAckRbf given each field
66 public static TxAckRbf of(byte[] channel_id_arg, org.ldk.structs.Option_i64Z funding_output_contribution_arg) {
67 long ret = bindings.TxAckRbf_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), funding_output_contribution_arg.ptr);
68 GC.KeepAlive(channel_id_arg);
69 GC.KeepAlive(funding_output_contribution_arg);
70 if (ret >= 0 && ret <= 4096) { return null; }
71 org.ldk.structs.TxAckRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAckRbf(null, ret); }
72 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
73 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_output_contribution_arg); };
77 internal long clone_ptr() {
78 long ret = bindings.TxAckRbf_clone_ptr(this.ptr);
84 * Creates a copy of the TxAckRbf
86 public TxAckRbf clone() {
87 long ret = bindings.TxAckRbf_clone(this.ptr);
89 if (ret >= 0 && ret <= 4096) { return null; }
90 org.ldk.structs.TxAckRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAckRbf(null, ret); }
91 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
96 * Checks if two TxAckRbfs contain equal inner contents.
97 * This ignores pointers and is_owned flags and looks at the values in fields.
98 * Two objects with NULL inner values will be considered "equal" here.
100 public bool eq(org.ldk.structs.TxAckRbf b) {
101 bool ret = bindings.TxAckRbf_eq(this.ptr, b == null ? 0 : b.ptr);
104 if (this != null) { this.ptrs_to.AddLast(b); };
108 public override bool Equals(object o) {
109 if (!(o is TxAckRbf)) return false;
110 return this.eq((TxAckRbf)o);
113 * Serialize the TxAckRbf object into a byte array which can be read by TxAckRbf_read
115 public byte[] write() {
116 long ret = bindings.TxAckRbf_write(this.ptr);
118 if (ret >= 0 && ret <= 4096) { return null; }
119 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
124 * Read a TxAckRbf from a byte array, created by TxAckRbf_write
126 public static Result_TxAckRbfDecodeErrorZ read(byte[] ser) {
127 long ret = bindings.TxAckRbf_read(InternalUtils.encodeUint8Array(ser));
129 if (ret >= 0 && ret <= 4096) { return null; }
130 Result_TxAckRbfDecodeErrorZ ret_hu_conv = Result_TxAckRbfDecodeErrorZ.constr_from_ptr(ret);