3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class ChainMonitor extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.ChainMonitor_free(this.ptr);
21 public static ChainMonitor constructor_new(Filter chain_source, BroadcasterInterface broadcaster, Logger logger, FeeEstimator feeest, Persist persister) {
22 number ret = bindings.ChainMonitor_new(chain_source == null ? 0 : chain_source.ptr, broadcaster == null ? 0 : broadcaster.ptr, logger == null ? 0 : logger.ptr, feeest == null ? 0 : feeest.ptr, persister == null ? 0 : persister.ptr);
23 const ret_hu_conv: ChainMonitor = new ChainMonitor(null, ret);
24 ret_hu_conv.ptrs_to.add(ret_hu_conv);
25 ret_hu_conv.ptrs_to.add(chain_source);
26 ret_hu_conv.ptrs_to.add(broadcaster);
27 ret_hu_conv.ptrs_to.add(logger);
28 ret_hu_conv.ptrs_to.add(feeest);
29 ret_hu_conv.ptrs_to.add(persister);
33 public Listen as_Listen() {
34 number ret = bindings.ChainMonitor_as_Listen(this.ptr);
35 Listen ret_hu_conv = new Listen(null, ret);
36 ret_hu_conv.ptrs_to.add(this);
40 public Confirm as_Confirm() {
41 number ret = bindings.ChainMonitor_as_Confirm(this.ptr);
42 Confirm ret_hu_conv = new Confirm(null, ret);
43 ret_hu_conv.ptrs_to.add(this);
47 public Watch as_Watch() {
48 number ret = bindings.ChainMonitor_as_Watch(this.ptr);
49 Watch ret_hu_conv = new Watch(null, ret);
50 ret_hu_conv.ptrs_to.add(this);
54 public EventsProvider as_EventsProvider() {
55 number ret = bindings.ChainMonitor_as_EventsProvider(this.ptr);
56 EventsProvider ret_hu_conv = new EventsProvider(null, ret);
57 ret_hu_conv.ptrs_to.add(this);