+ public static interface WatchInterface {
+ Result_NoneChannelMonitorUpdateErrZ watch_channel(OutPoint funding_txo, ChannelMonitor monitor);
+ Result_NoneChannelMonitorUpdateErrZ update_channel(OutPoint funding_txo, ChannelMonitorUpdate update);
+ MonitorEvent[] release_pending_monitor_events();
+ }
+ public Watch(WatchInterface arg) {
+ this(new bindings.LDKWatch() {
+ @Override public long watch_channel(long funding_txo, long monitor) {
+ OutPoint funding_txo_hu_conv = new OutPoint(null, funding_txo);
+ ChannelMonitor monitor_hu_conv = new ChannelMonitor(null, monitor);
+ Result_NoneChannelMonitorUpdateErrZ ret = arg.watch_channel(funding_txo_hu_conv, monitor_hu_conv);
+ long result = ret != null ? ret.ptr : 0;
+ ret.ptr = 0;
+ return result;
+ }
+ @Override public long update_channel(long funding_txo, long update) {
+ OutPoint funding_txo_hu_conv = new OutPoint(null, funding_txo);
+ ChannelMonitorUpdate update_hu_conv = new ChannelMonitorUpdate(null, update);
+ Result_NoneChannelMonitorUpdateErrZ ret = arg.update_channel(funding_txo_hu_conv, update_hu_conv);
+ long result = ret != null ? ret.ptr : 0;
+ ret.ptr = 0;
+ return result;
+ }
+ @Override public long[] release_pending_monitor_events() {
+ MonitorEvent[] ret = arg.release_pending_monitor_events();
+ long[] result = Arrays.stream(ret).mapToLong(arr_conv_14 -> arr_conv_14 == null ? 0 : arr_conv_14.ptr & ~1).toArray();
+ /* TODO 2 MonitorEvent */
+ return result;
+ }
+ });
+ }