1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
10 public class TxOut extends CommonBase{
11 /** The script_pubkey in this output */
12 public final byte[] script_pubkey;
13 /** The value, in satoshis, of this output */
14 public final long value;
16 TxOut(java.lang.Object _dummy, long ptr) {
18 this.script_pubkey = bindings.TxOut_get_script_pubkey(ptr);
19 this.value = bindings.TxOut_get_value(ptr);
21 public TxOut(long value, byte[] script_pubkey) {
22 super(bindings.TxOut_new(script_pubkey, value));
23 this.script_pubkey = bindings.TxOut_get_script_pubkey(ptr);
24 this.value = bindings.TxOut_get_value(ptr);
27 @Override @SuppressWarnings("deprecation")
28 protected void finalize() throws Throwable {
30 if (ptr != 0) { bindings.TxOut_free(ptr); }