80b67a24358b325557eef77d8c6cb3b262f53bde
[ldk-java] / src / main / java / org / ldk / structs / TxOut.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 import javax.annotation.Nullable;
8
9 public class TxOut extends CommonBase{
10         /** The script_pubkey in this output */
11         public final byte[] script_pubkey;
12         /** The value, in satoshis, of this output */
13         public final long value;
14
15         TxOut(java.lang.Object _dummy, long ptr) {
16                 super(ptr);
17                 this.script_pubkey = bindings.TxOut_get_script_pubkey(ptr);
18                 this.value = bindings.TxOut_get_value(ptr);
19         }
20         public TxOut(long value, byte[] script_pubkey) {
21                 super(bindings.TxOut_new(script_pubkey, value));
22                 this.script_pubkey = bindings.TxOut_get_script_pubkey(ptr);
23                 this.value = bindings.TxOut_get_value(ptr);
24         }
25
26         @Override @SuppressWarnings("deprecation")
27         protected void finalize() throws Throwable {
28                 super.finalize();
29                 if (ptr != 0) { bindings.TxOut_free(ptr); }
30         }
31
32 }