X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FChainMonitor.ts;h=356c5d4b78dd5dc13181c0b9538eb64c829a968f;hb=c6bac88847b7c09560af81f00ba8dd3c2ebe3a19;hp=4c1c9ef9e7010ade4474be723a3891421f598f75;hpb=7d6be8a5ef72a4ebfe07660cce55f43f6cc30b80;p=ldk-java diff --git a/ts/structs/ChainMonitor.ts b/ts/structs/ChainMonitor.ts index 4c1c9ef9..356c5d4b 100644 --- a/ts/structs/ChainMonitor.ts +++ b/ts/structs/ChainMonitor.ts @@ -38,10 +38,33 @@ import * as bindings from '../bindings' // TODO: figure out location ret_conv_9_hu_conv.ptrs_to.add(this); ret_conv_9_arr[j] = ret_conv_9_hu_conv; } - for (ChannelDetails ignored_channels_conv_16: ignored_channels) { this.ptrs_to.add(ignored_channels_conv_16); }; return ret_conv_9_arr; } + public Result_LockedChannelMonitorNoneZ get_monitor(OutPoint funding_txo) { + number ret = bindings.ChainMonitor_get_monitor(this.ptr, funding_txo == null ? 0 : funding_txo.ptr & ~1); + Result_LockedChannelMonitorNoneZ ret_hu_conv = Result_LockedChannelMonitorNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public OutPoint[] list_monitors() { + number[] ret = bindings.ChainMonitor_list_monitors(this.ptr); + OutPoint[] ret_conv_10_arr = new OutPoint[ret.length]; + for (int k = 0; k < ret.length; k++) { + number ret_conv_10 = ret[k]; + const ret_conv_10_hu_conv: OutPoint = new OutPoint(null, ret_conv_10); + ret_conv_10_hu_conv.ptrs_to.add(this); + ret_conv_10_arr[k] = ret_conv_10_hu_conv; + } + return ret_conv_10_arr; + } + + public Result_NoneAPIErrorZ channel_monitor_updated(OutPoint funding_txo, MonitorUpdateId completed_update_id) { + number ret = bindings.ChainMonitor_channel_monitor_updated(this.ptr, funding_txo == null ? 0 : funding_txo.ptr & ~1, completed_update_id == null ? 0 : completed_update_id.ptr & ~1); + Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + public Listen as_Listen() { number ret = bindings.ChainMonitor_as_Listen(this.ptr); Listen ret_hu_conv = new Listen(null, ret);