+ public static interface KeysInterfaceInterface {
+ byte[] get_node_secret();
+ byte[] get_destination_script();
+ byte[] get_shutdown_pubkey();
+ Sign get_channel_signer(boolean inbound, long channel_value_satoshis);
+ byte[] get_secure_random_bytes();
+ Result_SignDecodeErrorZ read_chan_signer(byte[] reader);
+ }
+ private static class LDKKeysInterfaceHolder { KeysInterface held; }
+ public static KeysInterface new_impl(KeysInterfaceInterface arg) {
+ final LDKKeysInterfaceHolder impl_holder = new LDKKeysInterfaceHolder();
+ impl_holder.held = new KeysInterface(new bindings.LDKKeysInterface() {
+ @Override public byte[] get_node_secret() {
+ byte[] ret = arg.get_node_secret();
+ return ret;
+ }
+ @Override public byte[] get_destination_script() {
+ byte[] ret = arg.get_destination_script();
+ return ret;
+ }
+ @Override public byte[] get_shutdown_pubkey() {
+ byte[] ret = arg.get_shutdown_pubkey();
+ return ret;
+ }
+ @Override public long get_channel_signer(boolean inbound, long channel_value_satoshis) {
+ Sign ret = arg.get_channel_signer(inbound, channel_value_satoshis);
+ long result = ret == null ? 0 : ret.ptr;
+ impl_holder.held.ptrs_to.add(ret);
+ return result;
+ }
+ @Override public byte[] get_secure_random_bytes() {
+ byte[] ret = arg.get_secure_random_bytes();
+ return ret;
+ }
+ @Override public long read_chan_signer(byte[] reader) {
+ Result_SignDecodeErrorZ ret = arg.read_chan_signer(reader);
+ long result = ret != null ? ret.ptr : 0;
+ return result;
+ }
+ });
+ return impl_holder.held;
+ }