6 namespace org { namespace ldk { namespace structs {
10 * A tx_init_rbf message which initiates a replacement of the transaction after it's been
13 public class TxInitRbf : CommonBase {
14 internal TxInitRbf(object _dummy, long ptr) : base(ptr) { }
16 if (ptr != 0) { bindings.TxInitRbf_free(ptr); }
22 public byte[] get_channel_id() {
23 long ret = bindings.TxInitRbf_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.TxInitRbf_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32)));
40 * The locktime of the transaction
42 public int get_locktime() {
43 int ret = bindings.TxInitRbf_get_locktime(this.ptr);
49 * The locktime of the transaction
51 public void set_locktime(int val) {
52 bindings.TxInitRbf_set_locktime(this.ptr, val);
58 * The feerate of the transaction
60 public int get_feerate_sat_per_1000_weight() {
61 int ret = bindings.TxInitRbf_get_feerate_sat_per_1000_weight(this.ptr);
67 * The feerate of the transaction
69 public void set_feerate_sat_per_1000_weight(int val) {
70 bindings.TxInitRbf_set_feerate_sat_per_1000_weight(this.ptr, val);
76 * The number of satoshis the sender will contribute to or, if negative, remove from
77 * (e.g. splice-out) the funding output of the transaction
79 public Option_i64Z get_funding_output_contribution() {
80 long ret = bindings.TxInitRbf_get_funding_output_contribution(this.ptr);
82 if (ret >= 0 && ret <= 4096) { return null; }
83 org.ldk.structs.Option_i64Z ret_hu_conv = org.ldk.structs.Option_i64Z.constr_from_ptr(ret);
84 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
89 * The number of satoshis the sender will contribute to or, if negative, remove from
90 * (e.g. splice-out) the funding output of the transaction
92 public void set_funding_output_contribution(org.ldk.structs.Option_i64Z val) {
93 bindings.TxInitRbf_set_funding_output_contribution(this.ptr, val.ptr);
96 if (this != null) { this.ptrs_to.AddLast(val); };
100 * Constructs a new TxInitRbf given each field
102 public static TxInitRbf of(byte[] channel_id_arg, int locktime_arg, int feerate_sat_per_1000_weight_arg, org.ldk.structs.Option_i64Z funding_output_contribution_arg) {
103 long ret = bindings.TxInitRbf_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), locktime_arg, feerate_sat_per_1000_weight_arg, funding_output_contribution_arg.ptr);
104 GC.KeepAlive(channel_id_arg);
105 GC.KeepAlive(locktime_arg);
106 GC.KeepAlive(feerate_sat_per_1000_weight_arg);
107 GC.KeepAlive(funding_output_contribution_arg);
108 if (ret >= 0 && ret <= 4096) { return null; }
109 org.ldk.structs.TxInitRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxInitRbf(null, ret); }
110 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
111 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_output_contribution_arg); };
115 internal long clone_ptr() {
116 long ret = bindings.TxInitRbf_clone_ptr(this.ptr);
122 * Creates a copy of the TxInitRbf
124 public TxInitRbf clone() {
125 long ret = bindings.TxInitRbf_clone(this.ptr);
127 if (ret >= 0 && ret <= 4096) { return null; }
128 org.ldk.structs.TxInitRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxInitRbf(null, ret); }
129 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
134 * Checks if two TxInitRbfs contain equal inner contents.
135 * This ignores pointers and is_owned flags and looks at the values in fields.
136 * Two objects with NULL inner values will be considered "equal" here.
138 public bool eq(org.ldk.structs.TxInitRbf b) {
139 bool ret = bindings.TxInitRbf_eq(this.ptr, b == null ? 0 : b.ptr);
142 if (this != null) { this.ptrs_to.AddLast(b); };
146 public override bool Equals(object o) {
147 if (!(o is TxInitRbf)) return false;
148 return this.eq((TxInitRbf)o);
151 * Serialize the TxInitRbf object into a byte array which can be read by TxInitRbf_read
153 public byte[] write() {
154 long ret = bindings.TxInitRbf_write(this.ptr);
156 if (ret >= 0 && ret <= 4096) { return null; }
157 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
162 * Read a TxInitRbf from a byte array, created by TxInitRbf_write
164 public static Result_TxInitRbfDecodeErrorZ read(byte[] ser) {
165 long ret = bindings.TxInitRbf_read(InternalUtils.encodeUint8Array(ser));
167 if (ret >= 0 && ret <= 4096) { return null; }
168 Result_TxInitRbfDecodeErrorZ ret_hu_conv = Result_TxInitRbfDecodeErrorZ.constr_from_ptr(ret);