6 namespace org { namespace ldk { namespace structs {
10 * An update_add_htlc message to be sent or received from a peer
12 public class UpdateAddHTLC : CommonBase {
13 internal UpdateAddHTLC(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.UpdateAddHTLC_free(ptr); }
21 public byte[] get_channel_id() {
22 byte[] ret = bindings.UpdateAddHTLC_get_channel_id(this.ptr);
30 public void set_channel_id(byte[] val) {
31 bindings.UpdateAddHTLC_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
39 public long get_htlc_id() {
40 long ret = bindings.UpdateAddHTLC_get_htlc_id(this.ptr);
48 public void set_htlc_id(long val) {
49 bindings.UpdateAddHTLC_set_htlc_id(this.ptr, val);
55 * The HTLC value in milli-satoshi
57 public long get_amount_msat() {
58 long ret = bindings.UpdateAddHTLC_get_amount_msat(this.ptr);
64 * The HTLC value in milli-satoshi
66 public void set_amount_msat(long val) {
67 bindings.UpdateAddHTLC_set_amount_msat(this.ptr, val);
73 * The payment hash, the pre-image of which controls HTLC redemption
75 public byte[] get_payment_hash() {
76 byte[] ret = bindings.UpdateAddHTLC_get_payment_hash(this.ptr);
82 * The payment hash, the pre-image of which controls HTLC redemption
84 public void set_payment_hash(byte[] val) {
85 bindings.UpdateAddHTLC_set_payment_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
91 * The expiry height of the HTLC
93 public int get_cltv_expiry() {
94 int ret = bindings.UpdateAddHTLC_get_cltv_expiry(this.ptr);
100 * The expiry height of the HTLC
102 public void set_cltv_expiry(int val) {
103 bindings.UpdateAddHTLC_set_cltv_expiry(this.ptr, val);
108 internal long clone_ptr() {
109 long ret = bindings.UpdateAddHTLC_clone_ptr(this.ptr);
115 * Creates a copy of the UpdateAddHTLC
117 public UpdateAddHTLC clone() {
118 long ret = bindings.UpdateAddHTLC_clone(this.ptr);
120 if (ret >= 0 && ret <= 4096) { return null; }
121 org.ldk.structs.UpdateAddHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UpdateAddHTLC(null, ret); }
122 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
127 * Checks if two UpdateAddHTLCs contain equal inner contents.
128 * This ignores pointers and is_owned flags and looks at the values in fields.
129 * Two objects with NULL inner values will be considered "equal" here.
131 public bool eq(org.ldk.structs.UpdateAddHTLC b) {
132 bool ret = bindings.UpdateAddHTLC_eq(this.ptr, b == null ? 0 : b.ptr);
135 if (this != null) { this.ptrs_to.AddLast(b); };
139 public override bool Equals(object o) {
140 if (!(o is UpdateAddHTLC)) return false;
141 return this.eq((UpdateAddHTLC)o);
144 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
146 public byte[] write() {
147 byte[] ret = bindings.UpdateAddHTLC_write(this.ptr);
153 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
155 public static Result_UpdateAddHTLCDecodeErrorZ read(byte[] ser) {
156 long ret = bindings.UpdateAddHTLC_read(ser);
158 if (ret >= 0 && ret <= 4096) { return null; }
159 Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret);