3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class WatchedOutput extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.WatchedOutput_free(this.ptr);
21 public Uint8Array get_block_hash() {
22 Uint8Array ret = bindings.WatchedOutput_get_block_hash(this.ptr);
26 public void set_block_hash(Uint8Array val) {
27 bindings.WatchedOutput_set_block_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
30 public OutPoint get_outpoint() {
31 number ret = bindings.WatchedOutput_get_outpoint(this.ptr);
32 const ret_hu_conv: OutPoint = new OutPoint(null, ret);
33 ret_hu_conv.ptrs_to.add(this);
37 public void set_outpoint(OutPoint val) {
38 bindings.WatchedOutput_set_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1);
41 public Uint8Array get_script_pubkey() {
42 Uint8Array ret = bindings.WatchedOutput_get_script_pubkey(this.ptr);
46 public void set_script_pubkey(Uint8Array val) {
47 bindings.WatchedOutput_set_script_pubkey(this.ptr, val);
50 public static WatchedOutput constructor_new(Uint8Array block_hash_arg, OutPoint outpoint_arg, Uint8Array script_pubkey_arg) {
51 number ret = bindings.WatchedOutput_new(InternalUtils.check_arr_len(block_hash_arg, 32), outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, script_pubkey_arg);
52 const ret_hu_conv: WatchedOutput = new WatchedOutput(null, ret);
53 ret_hu_conv.ptrs_to.add(ret_hu_conv);
57 public number clone_ptr() {
58 number ret = bindings.WatchedOutput_clone_ptr(this.ptr);
62 public WatchedOutput clone() {
63 number ret = bindings.WatchedOutput_clone(this.ptr);
64 const ret_hu_conv: WatchedOutput = new WatchedOutput(null, ret);
65 ret_hu_conv.ptrs_to.add(this);
69 public number hash() {
70 number ret = bindings.WatchedOutput_hash(this.ptr);