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 byte[] ret = bindings.TxInitRbf_get_channel_id(this.ptr);
31 public void set_channel_id(byte[] val) {
32 bindings.TxInitRbf_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
38 * The locktime of the transaction
40 public int get_locktime() {
41 int ret = bindings.TxInitRbf_get_locktime(this.ptr);
47 * The locktime of the transaction
49 public void set_locktime(int val) {
50 bindings.TxInitRbf_set_locktime(this.ptr, val);
56 * The feerate of the transaction
58 public int get_feerate_sat_per_1000_weight() {
59 int ret = bindings.TxInitRbf_get_feerate_sat_per_1000_weight(this.ptr);
65 * The feerate of the transaction
67 public void set_feerate_sat_per_1000_weight(int val) {
68 bindings.TxInitRbf_set_feerate_sat_per_1000_weight(this.ptr, val);
74 * The number of satoshis the sender will contribute to or, if negative, remove from
75 * (e.g. splice-out) the funding output of the transaction
77 public Option_i64Z get_funding_output_contribution() {
78 long ret = bindings.TxInitRbf_get_funding_output_contribution(this.ptr);
80 if (ret >= 0 && ret <= 4096) { return null; }
81 org.ldk.structs.Option_i64Z ret_hu_conv = org.ldk.structs.Option_i64Z.constr_from_ptr(ret);
82 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
87 * The number of satoshis the sender will contribute to or, if negative, remove from
88 * (e.g. splice-out) the funding output of the transaction
90 public void set_funding_output_contribution(org.ldk.structs.Option_i64Z val) {
91 bindings.TxInitRbf_set_funding_output_contribution(this.ptr, val.ptr);
94 if (this != null) { this.ptrs_to.AddLast(val); };
98 * Constructs a new TxInitRbf given each field
100 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) {
101 long ret = bindings.TxInitRbf_new(InternalUtils.check_arr_len(channel_id_arg, 32), locktime_arg, feerate_sat_per_1000_weight_arg, funding_output_contribution_arg.ptr);
102 GC.KeepAlive(channel_id_arg);
103 GC.KeepAlive(locktime_arg);
104 GC.KeepAlive(feerate_sat_per_1000_weight_arg);
105 GC.KeepAlive(funding_output_contribution_arg);
106 if (ret >= 0 && ret <= 4096) { return null; }
107 org.ldk.structs.TxInitRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxInitRbf(null, ret); }
108 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
109 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_output_contribution_arg); };
113 internal long clone_ptr() {
114 long ret = bindings.TxInitRbf_clone_ptr(this.ptr);
120 * Creates a copy of the TxInitRbf
122 public TxInitRbf clone() {
123 long ret = bindings.TxInitRbf_clone(this.ptr);
125 if (ret >= 0 && ret <= 4096) { return null; }
126 org.ldk.structs.TxInitRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxInitRbf(null, ret); }
127 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
132 * Checks if two TxInitRbfs contain equal inner contents.
133 * This ignores pointers and is_owned flags and looks at the values in fields.
134 * Two objects with NULL inner values will be considered "equal" here.
136 public bool eq(org.ldk.structs.TxInitRbf b) {
137 bool ret = bindings.TxInitRbf_eq(this.ptr, b == null ? 0 : b.ptr);
140 if (this != null) { this.ptrs_to.AddLast(b); };
144 public override bool Equals(object o) {
145 if (!(o is TxInitRbf)) return false;
146 return this.eq((TxInitRbf)o);
149 * Serialize the TxInitRbf object into a byte array which can be read by TxInitRbf_read
151 public byte[] write() {
152 byte[] ret = bindings.TxInitRbf_write(this.ptr);
158 * Read a TxInitRbf from a byte array, created by TxInitRbf_write
160 public static Result_TxInitRbfDecodeErrorZ read(byte[] ser) {
161 long ret = bindings.TxInitRbf_read(ser);
163 if (ret >= 0 && ret <= 4096) { return null; }
164 Result_TxInitRbfDecodeErrorZ ret_hu_conv = Result_TxInitRbfDecodeErrorZ.constr_from_ptr(ret);