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 ChannelId get_channel_id() {
23 long ret = bindings.TxAckRbf_get_channel_id(this.ptr);
25 if (ret >= 0 && ret <= 4096) { return null; }
26 org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); }
27 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
34 public void set_channel_id(org.ldk.structs.ChannelId val) {
35 bindings.TxAckRbf_set_channel_id(this.ptr, val.ptr);
38 if (this != null) { this.ptrs_to.AddLast(val); };
42 * The number of satoshis the sender will contribute to or, if negative, remove from
43 * (e.g. splice-out) the funding output of the transaction
45 public Option_i64Z get_funding_output_contribution() {
46 long ret = bindings.TxAckRbf_get_funding_output_contribution(this.ptr);
48 if (ret >= 0 && ret <= 4096) { return null; }
49 org.ldk.structs.Option_i64Z ret_hu_conv = org.ldk.structs.Option_i64Z.constr_from_ptr(ret);
50 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
55 * The number of satoshis the sender will contribute to or, if negative, remove from
56 * (e.g. splice-out) the funding output of the transaction
58 public void set_funding_output_contribution(org.ldk.structs.Option_i64Z val) {
59 bindings.TxAckRbf_set_funding_output_contribution(this.ptr, val.ptr);
62 if (this != null) { this.ptrs_to.AddLast(val); };
66 * Constructs a new TxAckRbf given each field
68 public static TxAckRbf of(org.ldk.structs.ChannelId channel_id_arg, org.ldk.structs.Option_i64Z funding_output_contribution_arg) {
69 long ret = bindings.TxAckRbf_new(channel_id_arg.ptr, funding_output_contribution_arg.ptr);
70 GC.KeepAlive(channel_id_arg);
71 GC.KeepAlive(funding_output_contribution_arg);
72 if (ret >= 0 && ret <= 4096) { return null; }
73 org.ldk.structs.TxAckRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAckRbf(null, ret); }
74 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
75 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); };
76 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_output_contribution_arg); };
80 internal long clone_ptr() {
81 long ret = bindings.TxAckRbf_clone_ptr(this.ptr);
87 * Creates a copy of the TxAckRbf
89 public TxAckRbf clone() {
90 long ret = bindings.TxAckRbf_clone(this.ptr);
92 if (ret >= 0 && ret <= 4096) { return null; }
93 org.ldk.structs.TxAckRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAckRbf(null, ret); }
94 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
99 * Generates a non-cryptographic 64-bit hash of the TxAckRbf.
102 long ret = bindings.TxAckRbf_hash(this.ptr);
107 public override int GetHashCode() {
108 return (int)this.hash();
111 * Checks if two TxAckRbfs contain equal inner contents.
112 * This ignores pointers and is_owned flags and looks at the values in fields.
113 * Two objects with NULL inner values will be considered "equal" here.
115 public bool eq(org.ldk.structs.TxAckRbf b) {
116 bool ret = bindings.TxAckRbf_eq(this.ptr, b.ptr);
119 if (this != null) { this.ptrs_to.AddLast(b); };
123 public override bool Equals(object o) {
124 if (!(o is TxAckRbf)) return false;
125 return this.eq((TxAckRbf)o);
128 * Serialize the TxAckRbf object into a byte array which can be read by TxAckRbf_read
130 public byte[] write() {
131 long ret = bindings.TxAckRbf_write(this.ptr);
133 if (ret >= 0 && ret <= 4096) { return null; }
134 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
139 * Read a TxAckRbf from a byte array, created by TxAckRbf_write
141 public static Result_TxAckRbfDecodeErrorZ read(byte[] ser) {
142 long ret = bindings.TxAckRbf_read(InternalUtils.encodeUint8Array(ser));
144 if (ret >= 0 && ret <= 4096) { return null; }
145 Result_TxAckRbfDecodeErrorZ ret_hu_conv = Result_TxAckRbfDecodeErrorZ.constr_from_ptr(ret);