[C#] Update auto-generated files
[ldk-java] / c_sharp / src / org / ldk / structs / ChannelDerivationParameters.cs
1 using org.ldk.impl;
2 using org.ldk.enums;
3 using org.ldk.util;
4 using System;
5
6 namespace org { namespace ldk { namespace structs {
7
8
9 /**
10  * The parameters required to derive a channel signer via [`SignerProvider`].
11  */
12 public class ChannelDerivationParameters : CommonBase {
13         internal ChannelDerivationParameters(object _dummy, long ptr) : base(ptr) { }
14         ~ChannelDerivationParameters() {
15                 if (ptr != 0) { bindings.ChannelDerivationParameters_free(ptr); }
16         }
17
18         /**
19          * The value in satoshis of the channel we're attempting to spend the anchor output of.
20          */
21         public long get_value_satoshis() {
22                 long ret = bindings.ChannelDerivationParameters_get_value_satoshis(this.ptr);
23                 GC.KeepAlive(this);
24                 return ret;
25         }
26
27         /**
28          * The value in satoshis of the channel we're attempting to spend the anchor output of.
29          */
30         public void set_value_satoshis(long val) {
31                 bindings.ChannelDerivationParameters_set_value_satoshis(this.ptr, val);
32                 GC.KeepAlive(this);
33                 GC.KeepAlive(val);
34         }
35
36         /**
37          * The unique identifier to re-derive the signer for the associated channel.
38          */
39         public byte[] get_keys_id() {
40                 byte[] ret = bindings.ChannelDerivationParameters_get_keys_id(this.ptr);
41                 GC.KeepAlive(this);
42                 return ret;
43         }
44
45         /**
46          * The unique identifier to re-derive the signer for the associated channel.
47          */
48         public void set_keys_id(byte[] val) {
49                 bindings.ChannelDerivationParameters_set_keys_id(this.ptr, InternalUtils.check_arr_len(val, 32));
50                 GC.KeepAlive(this);
51                 GC.KeepAlive(val);
52         }
53
54         /**
55          * The necessary channel parameters that need to be provided to the re-derived signer through
56          * [`ChannelSigner::provide_channel_parameters`].
57          * 
58          * [`ChannelSigner::provide_channel_parameters`]: crate::sign::ChannelSigner::provide_channel_parameters
59          */
60         public ChannelTransactionParameters get_transaction_parameters() {
61                 long ret = bindings.ChannelDerivationParameters_get_transaction_parameters(this.ptr);
62                 GC.KeepAlive(this);
63                 if (ret >= 0 && ret <= 4096) { return null; }
64                 org.ldk.structs.ChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTransactionParameters(null, ret); }
65                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
66                 return ret_hu_conv;
67         }
68
69         /**
70          * The necessary channel parameters that need to be provided to the re-derived signer through
71          * [`ChannelSigner::provide_channel_parameters`].
72          * 
73          * [`ChannelSigner::provide_channel_parameters`]: crate::sign::ChannelSigner::provide_channel_parameters
74          */
75         public void set_transaction_parameters(org.ldk.structs.ChannelTransactionParameters val) {
76                 bindings.ChannelDerivationParameters_set_transaction_parameters(this.ptr, val == null ? 0 : val.ptr);
77                 GC.KeepAlive(this);
78                 GC.KeepAlive(val);
79                 if (this != null) { this.ptrs_to.AddLast(val); };
80         }
81
82         /**
83          * Constructs a new ChannelDerivationParameters given each field
84          */
85         public static ChannelDerivationParameters of(long value_satoshis_arg, byte[] keys_id_arg, org.ldk.structs.ChannelTransactionParameters transaction_parameters_arg) {
86                 long ret = bindings.ChannelDerivationParameters_new(value_satoshis_arg, InternalUtils.check_arr_len(keys_id_arg, 32), transaction_parameters_arg == null ? 0 : transaction_parameters_arg.ptr);
87                 GC.KeepAlive(value_satoshis_arg);
88                 GC.KeepAlive(keys_id_arg);
89                 GC.KeepAlive(transaction_parameters_arg);
90                 if (ret >= 0 && ret <= 4096) { return null; }
91                 org.ldk.structs.ChannelDerivationParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDerivationParameters(null, ret); }
92                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
93                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(transaction_parameters_arg); };
94                 return ret_hu_conv;
95         }
96
97         internal long clone_ptr() {
98                 long ret = bindings.ChannelDerivationParameters_clone_ptr(this.ptr);
99                 GC.KeepAlive(this);
100                 return ret;
101         }
102
103         /**
104          * Creates a copy of the ChannelDerivationParameters
105          */
106         public ChannelDerivationParameters clone() {
107                 long ret = bindings.ChannelDerivationParameters_clone(this.ptr);
108                 GC.KeepAlive(this);
109                 if (ret >= 0 && ret <= 4096) { return null; }
110                 org.ldk.structs.ChannelDerivationParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDerivationParameters(null, ret); }
111                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
112                 return ret_hu_conv;
113         }
114
115         /**
116          * Checks if two ChannelDerivationParameterss contain equal inner contents.
117          * This ignores pointers and is_owned flags and looks at the values in fields.
118          * Two objects with NULL inner values will be considered "equal" here.
119          */
120         public bool eq(org.ldk.structs.ChannelDerivationParameters b) {
121                 bool ret = bindings.ChannelDerivationParameters_eq(this.ptr, b == null ? 0 : b.ptr);
122                 GC.KeepAlive(this);
123                 GC.KeepAlive(b);
124                 if (this != null) { this.ptrs_to.AddLast(b); };
125                 return ret;
126         }
127
128         public override bool Equals(object o) {
129                 if (!(o is ChannelDerivationParameters)) return false;
130                 return this.eq((ChannelDerivationParameters)o);
131         }
132 }
133 } } }