Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / DelayedPaymentOutputDescriptor.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5 import org.ldk.util.*;
6 import java.util.Arrays;
7
8
9 /**
10  * Information about a spendable output to a P2WSH script. See
11  * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
12  */
13 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
14 public class DelayedPaymentOutputDescriptor extends CommonBase {
15         DelayedPaymentOutputDescriptor(Object _dummy, long ptr) { super(ptr); }
16         @Override @SuppressWarnings("deprecation")
17         protected void finalize() throws Throwable {
18                 super.finalize();
19                 if (ptr != 0) { bindings.DelayedPaymentOutputDescriptor_free(ptr); }
20         }
21
22         /**
23          * The outpoint which is spendable
24          */
25         public OutPoint get_outpoint() {
26                 long ret = bindings.DelayedPaymentOutputDescriptor_get_outpoint(this.ptr);
27                 OutPoint ret_hu_conv = new OutPoint(null, ret);
28                 ret_hu_conv.ptrs_to.add(this);
29                 return ret_hu_conv;
30         }
31
32         /**
33          * The outpoint which is spendable
34          */
35         public void set_outpoint(OutPoint val) {
36                 bindings.DelayedPaymentOutputDescriptor_set_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1);
37                 this.ptrs_to.add(val);
38         }
39
40         /**
41          * Per commitment point to derive delayed_payment_key by key holder
42          */
43         public byte[] get_per_commitment_point() {
44                 byte[] ret = bindings.DelayedPaymentOutputDescriptor_get_per_commitment_point(this.ptr);
45                 return ret;
46         }
47
48         /**
49          * Per commitment point to derive delayed_payment_key by key holder
50          */
51         public void set_per_commitment_point(byte[] val) {
52                 bindings.DelayedPaymentOutputDescriptor_set_per_commitment_point(this.ptr, val);
53         }
54
55         /**
56          * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
57          * the witness_script.
58          */
59         public short get_to_self_delay() {
60                 short ret = bindings.DelayedPaymentOutputDescriptor_get_to_self_delay(this.ptr);
61                 return ret;
62         }
63
64         /**
65          * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
66          * the witness_script.
67          */
68         public void set_to_self_delay(short val) {
69                 bindings.DelayedPaymentOutputDescriptor_set_to_self_delay(this.ptr, val);
70         }
71
72         /**
73          * The output which is referenced by the given outpoint
74          */
75         public void set_output(TxOut val) {
76                 bindings.DelayedPaymentOutputDescriptor_set_output(this.ptr, val.ptr);
77         }
78
79         /**
80          * The revocation point specific to the commitment transaction which was broadcast. Used to
81          * derive the witnessScript for this output.
82          */
83         public byte[] get_revocation_pubkey() {
84                 byte[] ret = bindings.DelayedPaymentOutputDescriptor_get_revocation_pubkey(this.ptr);
85                 return ret;
86         }
87
88         /**
89          * The revocation point specific to the commitment transaction which was broadcast. Used to
90          * derive the witnessScript for this output.
91          */
92         public void set_revocation_pubkey(byte[] val) {
93                 bindings.DelayedPaymentOutputDescriptor_set_revocation_pubkey(this.ptr, val);
94         }
95
96         /**
97          * Arbitrary identification information returned by a call to
98          * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
99          * the channel to spend the output.
100          */
101         public byte[] get_channel_keys_id() {
102                 byte[] ret = bindings.DelayedPaymentOutputDescriptor_get_channel_keys_id(this.ptr);
103                 return ret;
104         }
105
106         /**
107          * Arbitrary identification information returned by a call to
108          * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
109          * the channel to spend the output.
110          */
111         public void set_channel_keys_id(byte[] val) {
112                 bindings.DelayedPaymentOutputDescriptor_set_channel_keys_id(this.ptr, val);
113         }
114
115         /**
116          * The value of the channel which this output originated from, possibly indirectly.
117          */
118         public long get_channel_value_satoshis() {
119                 long ret = bindings.DelayedPaymentOutputDescriptor_get_channel_value_satoshis(this.ptr);
120                 return ret;
121         }
122
123         /**
124          * The value of the channel which this output originated from, possibly indirectly.
125          */
126         public void set_channel_value_satoshis(long val) {
127                 bindings.DelayedPaymentOutputDescriptor_set_channel_value_satoshis(this.ptr, val);
128         }
129
130         /**
131          * Constructs a new DelayedPaymentOutputDescriptor given each field
132          */
133         public static DelayedPaymentOutputDescriptor of(OutPoint outpoint_arg, byte[] per_commitment_point_arg, short to_self_delay_arg, TxOut output_arg, byte[] revocation_pubkey_arg, byte[] channel_keys_id_arg, long channel_value_satoshis_arg) {
134                 long ret = bindings.DelayedPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, per_commitment_point_arg, to_self_delay_arg, output_arg.ptr, revocation_pubkey_arg, channel_keys_id_arg, channel_value_satoshis_arg);
135                 DelayedPaymentOutputDescriptor ret_hu_conv = new DelayedPaymentOutputDescriptor(null, ret);
136                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
137                 ret_hu_conv.ptrs_to.add(outpoint_arg);
138                 return ret_hu_conv;
139         }
140
141         /**
142          * Creates a copy of the DelayedPaymentOutputDescriptor
143          */
144         public DelayedPaymentOutputDescriptor clone() {
145                 long ret = bindings.DelayedPaymentOutputDescriptor_clone(this.ptr);
146                 DelayedPaymentOutputDescriptor ret_hu_conv = new DelayedPaymentOutputDescriptor(null, ret);
147                 ret_hu_conv.ptrs_to.add(this);
148                 return ret_hu_conv;
149         }
150
151         /**
152          * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
153          */
154         public byte[] write() {
155                 byte[] ret = bindings.DelayedPaymentOutputDescriptor_write(this.ptr);
156                 return ret;
157         }
158
159         /**
160          * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
161          */
162         public static Result_DelayedPaymentOutputDescriptorDecodeErrorZ read(byte[] ser) {
163                 long ret = bindings.DelayedPaymentOutputDescriptor_read(ser);
164                 Result_DelayedPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
165                 return ret_hu_conv;
166         }
167
168 }