X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FTxOut.ts;h=09969ade581fcbf10ecbd22e136cdb5f8e7badbd;hb=ba1af51214a8ea2de62b84cd23b6145173c71752;hp=c0dc8c12ecdad95b8432e1b3927805955bfff8af;hpb=8cf3b60169033bf14824aeed1197f11e232cba0a;p=ldk-java diff --git a/ts/structs/TxOut.ts b/ts/structs/TxOut.ts index c0dc8c12..09969ade 100644 --- a/ts/structs/TxOut.ts +++ b/ts/structs/TxOut.ts @@ -3,11 +3,26 @@ import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location public class TxOut extends CommonBase{ - TxOut(java.lang.Object _dummy, long ptr) { super(ptr); } - long to_c_ptr() { return 0; } + /** The script_pubkey in this output */ + public final byte[] script_pubkey; + /** The value, in satoshis, of this output */ + public final long value; + + TxOut(java.lang.Object _dummy, long ptr) { + super(ptr); + this.script_pubkey = bindings.TxOut_get_script_pubkey(ptr); + this.value = bindings.TxOut_get_value(ptr); + } + public TxOut(long value, byte[] script_pubkey) { + super(bindings.TxOut_new(script_pubkey, value)); + this.script_pubkey = bindings.TxOut_get_script_pubkey(ptr); + this.value = bindings.TxOut_get_value(ptr); + } + @Override @SuppressWarnings("deprecation") protected void finalize() throws Throwable { super.finalize(); if (ptr != 0) { bindings.TxOut_free(ptr); } } + } \ No newline at end of file