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 ChannelId get_channel_id() {
23 long ret = bindings.TxInitRbf_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.TxInitRbf_set_channel_id(this.ptr, val.ptr);
38 if (this != null) { this.ptrs_to.AddLast(val); };
42 * The locktime of the transaction
44 public int get_locktime() {
45 int ret = bindings.TxInitRbf_get_locktime(this.ptr);
51 * The locktime of the transaction
53 public void set_locktime(int val) {
54 bindings.TxInitRbf_set_locktime(this.ptr, val);
60 * The feerate of the transaction
62 public int get_feerate_sat_per_1000_weight() {
63 int ret = bindings.TxInitRbf_get_feerate_sat_per_1000_weight(this.ptr);
69 * The feerate of the transaction
71 public void set_feerate_sat_per_1000_weight(int val) {
72 bindings.TxInitRbf_set_feerate_sat_per_1000_weight(this.ptr, val);
78 * The number of satoshis the sender will contribute to or, if negative, remove from
79 * (e.g. splice-out) the funding output of the transaction
81 public Option_i64Z get_funding_output_contribution() {
82 long ret = bindings.TxInitRbf_get_funding_output_contribution(this.ptr);
84 if (ret >= 0 && ret <= 4096) { return null; }
85 org.ldk.structs.Option_i64Z ret_hu_conv = org.ldk.structs.Option_i64Z.constr_from_ptr(ret);
86 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
91 * The number of satoshis the sender will contribute to or, if negative, remove from
92 * (e.g. splice-out) the funding output of the transaction
94 public void set_funding_output_contribution(org.ldk.structs.Option_i64Z val) {
95 bindings.TxInitRbf_set_funding_output_contribution(this.ptr, val.ptr);
98 if (this != null) { this.ptrs_to.AddLast(val); };
102 * Constructs a new TxInitRbf given each field
104 public static TxInitRbf of(org.ldk.structs.ChannelId channel_id_arg, int locktime_arg, int feerate_sat_per_1000_weight_arg, org.ldk.structs.Option_i64Z funding_output_contribution_arg) {
105 long ret = bindings.TxInitRbf_new(channel_id_arg.ptr, locktime_arg, feerate_sat_per_1000_weight_arg, funding_output_contribution_arg.ptr);
106 GC.KeepAlive(channel_id_arg);
107 GC.KeepAlive(locktime_arg);
108 GC.KeepAlive(feerate_sat_per_1000_weight_arg);
109 GC.KeepAlive(funding_output_contribution_arg);
110 if (ret >= 0 && ret <= 4096) { return null; }
111 org.ldk.structs.TxInitRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxInitRbf(null, ret); }
112 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
113 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); };
114 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_output_contribution_arg); };
118 internal long clone_ptr() {
119 long ret = bindings.TxInitRbf_clone_ptr(this.ptr);
125 * Creates a copy of the TxInitRbf
127 public TxInitRbf clone() {
128 long ret = bindings.TxInitRbf_clone(this.ptr);
130 if (ret >= 0 && ret <= 4096) { return null; }
131 org.ldk.structs.TxInitRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxInitRbf(null, ret); }
132 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
137 * Generates a non-cryptographic 64-bit hash of the TxInitRbf.
140 long ret = bindings.TxInitRbf_hash(this.ptr);
145 public override int GetHashCode() {
146 return (int)this.hash();
149 * Checks if two TxInitRbfs contain equal inner contents.
150 * This ignores pointers and is_owned flags and looks at the values in fields.
151 * Two objects with NULL inner values will be considered "equal" here.
153 public bool eq(org.ldk.structs.TxInitRbf b) {
154 bool ret = bindings.TxInitRbf_eq(this.ptr, b.ptr);
157 if (this != null) { this.ptrs_to.AddLast(b); };
161 public override bool Equals(object o) {
162 if (!(o is TxInitRbf)) return false;
163 return this.eq((TxInitRbf)o);
166 * Serialize the TxInitRbf object into a byte array which can be read by TxInitRbf_read
168 public byte[] write() {
169 long ret = bindings.TxInitRbf_write(this.ptr);
171 if (ret >= 0 && ret <= 4096) { return null; }
172 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
177 * Read a TxInitRbf from a byte array, created by TxInitRbf_write
179 public static Result_TxInitRbfDecodeErrorZ read(byte[] ser) {
180 long ret = bindings.TxInitRbf_read(InternalUtils.encodeUint8Array(ser));
182 if (ret >= 0 && ret <= 4096) { return null; }
183 Result_TxInitRbfDecodeErrorZ ret_hu_conv = Result_TxInitRbfDecodeErrorZ.constr_from_ptr(ret);