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 long ret = bindings.ChannelDerivationParameters_get_keys_id(this.ptr);
42 if (ret >= 0 && ret <= 4096) { return null; }
43 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
48 * The unique identifier to re-derive the signer for the associated channel.
50 public void set_keys_id(byte[] val) {
51 bindings.ChannelDerivationParameters_set_keys_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32)));
57 * The necessary channel parameters that need to be provided to the re-derived signer through
58 * [`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 public void set_transaction_parameters(org.ldk.structs.ChannelTransactionParameters val) {
74 bindings.ChannelDerivationParameters_set_transaction_parameters(this.ptr, val.ptr);
77 if (this != null) { this.ptrs_to.AddLast(val); };
81 * Constructs a new ChannelDerivationParameters given each field
83 public static ChannelDerivationParameters of(long value_satoshis_arg, byte[] keys_id_arg, org.ldk.structs.ChannelTransactionParameters transaction_parameters_arg) {
84 long ret = bindings.ChannelDerivationParameters_new(value_satoshis_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(keys_id_arg, 32)), transaction_parameters_arg.ptr);
85 GC.KeepAlive(value_satoshis_arg);
86 GC.KeepAlive(keys_id_arg);
87 GC.KeepAlive(transaction_parameters_arg);
88 if (ret >= 0 && ret <= 4096) { return null; }
89 org.ldk.structs.ChannelDerivationParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDerivationParameters(null, ret); }
90 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
91 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(transaction_parameters_arg); };
95 internal long clone_ptr() {
96 long ret = bindings.ChannelDerivationParameters_clone_ptr(this.ptr);
102 * Creates a copy of the ChannelDerivationParameters
104 public ChannelDerivationParameters clone() {
105 long ret = bindings.ChannelDerivationParameters_clone(this.ptr);
107 if (ret >= 0 && ret <= 4096) { return null; }
108 org.ldk.structs.ChannelDerivationParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDerivationParameters(null, ret); }
109 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
114 * Checks if two ChannelDerivationParameterss contain equal inner contents.
115 * This ignores pointers and is_owned flags and looks at the values in fields.
116 * Two objects with NULL inner values will be considered "equal" here.
118 public bool eq(org.ldk.structs.ChannelDerivationParameters b) {
119 bool ret = bindings.ChannelDerivationParameters_eq(this.ptr, b.ptr);
122 if (this != null) { this.ptrs_to.AddLast(b); };
126 public override bool Equals(object o) {
127 if (!(o is ChannelDerivationParameters)) return false;
128 return this.eq((ChannelDerivationParameters)o);
131 * Serialize the ChannelDerivationParameters object into a byte array which can be read by ChannelDerivationParameters_read
133 public byte[] write() {
134 long ret = bindings.ChannelDerivationParameters_write(this.ptr);
136 if (ret >= 0 && ret <= 4096) { return null; }
137 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
142 * Read a ChannelDerivationParameters from a byte array, created by ChannelDerivationParameters_write
144 public static Result_ChannelDerivationParametersDecodeErrorZ read(byte[] ser) {
145 long ret = bindings.ChannelDerivationParameters_read(InternalUtils.encodeUint8Array(ser));
147 if (ret >= 0 && ret <= 4096) { return null; }
148 Result_ChannelDerivationParametersDecodeErrorZ ret_hu_conv = Result_ChannelDerivationParametersDecodeErrorZ.constr_from_ptr(ret);