6 namespace org { namespace ldk { namespace structs {
10 * The parameters required to derive a channel signer via [`SignerProvider`].
12 public class ChannelDerivationParameters : CommonBase {
13 internal ChannelDerivationParameters(object _dummy, long ptr) : base(ptr) { }
14 ~ChannelDerivationParameters() {
15 if (ptr != 0) { bindings.ChannelDerivationParameters_free(ptr); }
19 * The value in satoshis of the channel we're attempting to spend the anchor output of.
21 public long get_value_satoshis() {
22 long ret = bindings.ChannelDerivationParameters_get_value_satoshis(this.ptr);
28 * The value in satoshis of the channel we're attempting to spend the anchor output of.
30 public void set_value_satoshis(long val) {
31 bindings.ChannelDerivationParameters_set_value_satoshis(this.ptr, val);
37 * The unique identifier to re-derive the signer for the associated channel.
39 public byte[] get_keys_id() {
40 byte[] ret = bindings.ChannelDerivationParameters_get_keys_id(this.ptr);
46 * The unique identifier to re-derive the signer for the associated channel.
48 public void set_keys_id(byte[] val) {
49 bindings.ChannelDerivationParameters_set_keys_id(this.ptr, InternalUtils.check_arr_len(val, 32));
55 * The necessary channel parameters that need to be provided to the re-derived signer through
56 * [`ChannelSigner::provide_channel_parameters`].
58 * [`ChannelSigner::provide_channel_parameters`]: crate::sign::ChannelSigner::provide_channel_parameters
60 public ChannelTransactionParameters get_transaction_parameters() {
61 long ret = bindings.ChannelDerivationParameters_get_transaction_parameters(this.ptr);
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); };
70 * The necessary channel parameters that need to be provided to the re-derived signer through
71 * [`ChannelSigner::provide_channel_parameters`].
73 * [`ChannelSigner::provide_channel_parameters`]: crate::sign::ChannelSigner::provide_channel_parameters
75 public void set_transaction_parameters(org.ldk.structs.ChannelTransactionParameters val) {
76 bindings.ChannelDerivationParameters_set_transaction_parameters(this.ptr, val == null ? 0 : val.ptr);
79 if (this != null) { this.ptrs_to.AddLast(val); };
83 * Constructs a new ChannelDerivationParameters given each field
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); };
97 internal long clone_ptr() {
98 long ret = bindings.ChannelDerivationParameters_clone_ptr(this.ptr);
104 * Creates a copy of the ChannelDerivationParameters
106 public ChannelDerivationParameters clone() {
107 long ret = bindings.ChannelDerivationParameters_clone(this.ptr);
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); };
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.
120 public bool eq(org.ldk.structs.ChannelDerivationParameters b) {
121 bool ret = bindings.ChannelDerivationParameters_eq(this.ptr, b == null ? 0 : b.ptr);
124 if (this != null) { this.ptrs_to.AddLast(b); };
128 public override bool Equals(object o) {
129 if (!(o is ChannelDerivationParameters)) return false;
130 return this.eq((ChannelDerivationParameters)o);