+ /**
+ * Extracts the block height (most significant 3-bytes) from the `short_channel_id`
+ */
+ public static int block_from_scid(long short_channel_id) {
+ int ret = bindings.block_from_scid(short_channel_id);
+ Reference.reachabilityFence(short_channel_id);
+ return ret;
+ }
+
+ /**
+ * Extracts the tx index (bytes [2..4]) from the `short_channel_id`
+ */
+ public static int tx_index_from_scid(long short_channel_id) {
+ int ret = bindings.tx_index_from_scid(short_channel_id);
+ Reference.reachabilityFence(short_channel_id);
+ return ret;
+ }
+
+ /**
+ * Extracts the vout (bytes [0..2]) from the `short_channel_id`
+ */
+ public static short vout_from_scid(long short_channel_id) {
+ short ret = bindings.vout_from_scid(short_channel_id);
+ Reference.reachabilityFence(short_channel_id);
+ return ret;
+ }
+
+ /**
+ * Constructs a `short_channel_id` using the components pieces. Results in an error
+ * if the block height, tx index, or vout index overflow the maximum sizes.
+ */
+ public static Result_u64ShortChannelIdErrorZ scid_from_parts(long block, long tx_index, long vout_index) {
+ long ret = bindings.scid_from_parts(block, tx_index, vout_index);
+ Reference.reachabilityFence(block);
+ Reference.reachabilityFence(tx_index);
+ Reference.reachabilityFence(vout_index);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_u64ShortChannelIdErrorZ ret_hu_conv = Result_u64ShortChannelIdErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Read a C2Tuple_BestBlockOutputSweeperZ from a byte array, created by C2Tuple_BestBlockOutputSweeperZ_write
+ */
+ public static Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ C2Tuple_BestBlockOutputSweeperZ_read(byte[] ser, org.ldk.structs.BroadcasterInterface arg_a, org.ldk.structs.FeeEstimator arg_b, org.ldk.structs.Option_FilterZ arg_c, org.ldk.structs.OutputSpender arg_d, org.ldk.structs.ChangeDestinationSource arg_e, org.ldk.structs.KVStore arg_f, org.ldk.structs.Logger arg_g) {
+ long ret = bindings.C2Tuple_BestBlockOutputSweeperZ_read(ser, arg_a.ptr, arg_b.ptr, arg_c.ptr, arg_d.ptr, arg_e.ptr, arg_f.ptr, arg_g.ptr);
+ Reference.reachabilityFence(ser);
+ Reference.reachabilityFence(arg_a);
+ Reference.reachabilityFence(arg_b);
+ Reference.reachabilityFence(arg_c);
+ Reference.reachabilityFence(arg_d);
+ Reference.reachabilityFence(arg_e);
+ Reference.reachabilityFence(arg_f);
+ Reference.reachabilityFence(arg_g);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(arg_a); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(arg_b); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(arg_c); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(arg_d); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(arg_e); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(arg_f); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(arg_g); };
+ return ret_hu_conv;
+ }
+