6 namespace org { namespace ldk { namespace structs {
10 * Information about a spendable output to a P2WSH script.
12 * See [`SpendableOutputDescriptor::DelayedPaymentOutput`] for more details on how to spend this.
14 public class DelayedPaymentOutputDescriptor : CommonBase {
15 internal DelayedPaymentOutputDescriptor(object _dummy, long ptr) : base(ptr) { }
16 ~DelayedPaymentOutputDescriptor() {
17 if (ptr != 0) { bindings.DelayedPaymentOutputDescriptor_free(ptr); }
21 * The outpoint which is spendable.
23 public OutPoint get_outpoint() {
24 long ret = bindings.DelayedPaymentOutputDescriptor_get_outpoint(this.ptr);
26 if (ret >= 0 && ret <= 4096) { return null; }
27 org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); }
28 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
33 * The outpoint which is spendable.
35 public void set_outpoint(org.ldk.structs.OutPoint val) {
36 bindings.DelayedPaymentOutputDescriptor_set_outpoint(this.ptr, val == null ? 0 : val.ptr);
39 if (this != null) { this.ptrs_to.AddLast(val); };
43 * Per commitment point to derive the delayed payment key by key holder.
45 public byte[] get_per_commitment_point() {
46 long ret = bindings.DelayedPaymentOutputDescriptor_get_per_commitment_point(this.ptr);
48 if (ret >= 0 && ret <= 4096) { return null; }
49 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
54 * Per commitment point to derive the delayed payment key by key holder.
56 public void set_per_commitment_point(byte[] val) {
57 bindings.DelayedPaymentOutputDescriptor_set_per_commitment_point(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33)));
63 * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
66 public short get_to_self_delay() {
67 short ret = bindings.DelayedPaymentOutputDescriptor_get_to_self_delay(this.ptr);
73 * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
76 public void set_to_self_delay(short val) {
77 bindings.DelayedPaymentOutputDescriptor_set_to_self_delay(this.ptr, val);
83 * The output which is referenced by the given outpoint.
85 public TxOut get_output() {
86 long ret = bindings.DelayedPaymentOutputDescriptor_get_output(this.ptr);
88 if (ret >= 0 && ret <= 4096) { return null; }
89 TxOut ret_conv = new TxOut(null, ret);
94 * The output which is referenced by the given outpoint.
96 public void set_output(org.ldk.structs.TxOut val) {
97 bindings.DelayedPaymentOutputDescriptor_set_output(this.ptr, val.ptr);
103 * The revocation point specific to the commitment transaction which was broadcast. Used to
104 * derive the witnessScript for this output.
106 public RevocationKey get_revocation_pubkey() {
107 long ret = bindings.DelayedPaymentOutputDescriptor_get_revocation_pubkey(this.ptr);
109 if (ret >= 0 && ret <= 4096) { return null; }
110 org.ldk.structs.RevocationKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RevocationKey(null, ret); }
111 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
116 * The revocation point specific to the commitment transaction which was broadcast. Used to
117 * derive the witnessScript for this output.
119 public void set_revocation_pubkey(org.ldk.structs.RevocationKey val) {
120 bindings.DelayedPaymentOutputDescriptor_set_revocation_pubkey(this.ptr, val == null ? 0 : val.ptr);
123 if (this != null) { this.ptrs_to.AddLast(val); };
127 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
128 * This may be useful in re-deriving keys used in the channel to spend the output.
130 public byte[] get_channel_keys_id() {
131 long ret = bindings.DelayedPaymentOutputDescriptor_get_channel_keys_id(this.ptr);
133 if (ret >= 0 && ret <= 4096) { return null; }
134 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
139 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
140 * This may be useful in re-deriving keys used in the channel to spend the output.
142 public void set_channel_keys_id(byte[] val) {
143 bindings.DelayedPaymentOutputDescriptor_set_channel_keys_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32)));
149 * The value of the channel which this output originated from, possibly indirectly.
151 public long get_channel_value_satoshis() {
152 long ret = bindings.DelayedPaymentOutputDescriptor_get_channel_value_satoshis(this.ptr);
158 * The value of the channel which this output originated from, possibly indirectly.
160 public void set_channel_value_satoshis(long val) {
161 bindings.DelayedPaymentOutputDescriptor_set_channel_value_satoshis(this.ptr, val);
167 * Constructs a new DelayedPaymentOutputDescriptor given each field
169 public static DelayedPaymentOutputDescriptor of(org.ldk.structs.OutPoint outpoint_arg, byte[] per_commitment_point_arg, short to_self_delay_arg, org.ldk.structs.TxOut output_arg, org.ldk.structs.RevocationKey revocation_pubkey_arg, byte[] channel_keys_id_arg, long channel_value_satoshis_arg) {
170 long ret = bindings.DelayedPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point_arg, 33)), to_self_delay_arg, output_arg.ptr, revocation_pubkey_arg == null ? 0 : revocation_pubkey_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_keys_id_arg, 32)), channel_value_satoshis_arg);
171 GC.KeepAlive(outpoint_arg);
172 GC.KeepAlive(per_commitment_point_arg);
173 GC.KeepAlive(to_self_delay_arg);
174 GC.KeepAlive(output_arg);
175 GC.KeepAlive(revocation_pubkey_arg);
176 GC.KeepAlive(channel_keys_id_arg);
177 GC.KeepAlive(channel_value_satoshis_arg);
178 if (ret >= 0 && ret <= 4096) { return null; }
179 org.ldk.structs.DelayedPaymentOutputDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DelayedPaymentOutputDescriptor(null, ret); }
180 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
181 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outpoint_arg); };
182 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(revocation_pubkey_arg); };
186 internal long clone_ptr() {
187 long ret = bindings.DelayedPaymentOutputDescriptor_clone_ptr(this.ptr);
193 * Creates a copy of the DelayedPaymentOutputDescriptor
195 public DelayedPaymentOutputDescriptor clone() {
196 long ret = bindings.DelayedPaymentOutputDescriptor_clone(this.ptr);
198 if (ret >= 0 && ret <= 4096) { return null; }
199 org.ldk.structs.DelayedPaymentOutputDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DelayedPaymentOutputDescriptor(null, ret); }
200 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
205 * Generates a non-cryptographic 64-bit hash of the DelayedPaymentOutputDescriptor.
208 long ret = bindings.DelayedPaymentOutputDescriptor_hash(this.ptr);
213 public override int GetHashCode() {
214 return (int)this.hash();
217 * Checks if two DelayedPaymentOutputDescriptors contain equal inner contents.
218 * This ignores pointers and is_owned flags and looks at the values in fields.
219 * Two objects with NULL inner values will be considered "equal" here.
221 public bool eq(org.ldk.structs.DelayedPaymentOutputDescriptor b) {
222 bool ret = bindings.DelayedPaymentOutputDescriptor_eq(this.ptr, b == null ? 0 : b.ptr);
225 if (this != null) { this.ptrs_to.AddLast(b); };
229 public override bool Equals(object o) {
230 if (!(o is DelayedPaymentOutputDescriptor)) return false;
231 return this.eq((DelayedPaymentOutputDescriptor)o);
234 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
236 public byte[] write() {
237 long ret = bindings.DelayedPaymentOutputDescriptor_write(this.ptr);
239 if (ret >= 0 && ret <= 4096) { return null; }
240 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
245 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
247 public static Result_DelayedPaymentOutputDescriptorDecodeErrorZ read(byte[] ser) {
248 long ret = bindings.DelayedPaymentOutputDescriptor_read(InternalUtils.encodeUint8Array(ser));
250 if (ret >= 0 && ret <= 4096) { return null; }
251 Result_DelayedPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);