Update auto-generated bindings to 0.0.103
[ldk-java] / src / main / java / org / ldk / structs / KeysInterface.java
index 4fdc63351cb9a387353754ef7dd2643865a94160..ea88ec2c61a4377ba40ade74dfca2c7f54fd5058 100644 (file)
@@ -38,13 +38,12 @@ public class KeysInterface extends CommonBase {
                 */
                byte[] get_destination_script();
                /**
-                * Get a public key which we will send funds to (in the form of a P2WPKH output) when closing
-                * a channel.
+                * Get a script pubkey which we will send funds to when closing a channel.
                 * 
                 * This method should return a different value each time it is called, to avoid linking
                 * on-chain funds across channels as controlled to the same user.
                 */
-               byte[] get_shutdown_pubkey();
+               ShutdownScript get_shutdown_scriptpubkey();
                /**
                 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
                 * restarted with some stale data!
@@ -89,9 +88,10 @@ public class KeysInterface extends CommonBase {
                                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_shutdown_scriptpubkey() {
+                               ShutdownScript ret = arg.get_shutdown_scriptpubkey();
+                               long result = ret == null ? 0 : ret.ptr & ~1;
+                               return result;
                        }
                        @Override public long get_channel_signer(boolean inbound, long channel_value_satoshis) {
                                Sign ret = arg.get_channel_signer(inbound, channel_value_satoshis);
@@ -138,15 +138,17 @@ public class KeysInterface extends CommonBase {
        }
 
        /**
-        * Get a public key which we will send funds to (in the form of a P2WPKH output) when closing
-        * a channel.
+        * Get a script pubkey which we will send funds to when closing a channel.
         * 
         * This method should return a different value each time it is called, to avoid linking
         * on-chain funds across channels as controlled to the same user.
         */
-       public byte[] get_shutdown_pubkey() {
-               byte[] ret = bindings.KeysInterface_get_shutdown_pubkey(this.ptr);
-               return ret;
+       public ShutdownScript get_shutdown_scriptpubkey() {
+               long ret = bindings.KeysInterface_get_shutdown_scriptpubkey(this.ptr);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               ShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ShutdownScript(null, ret); }
+               ret_hu_conv.ptrs_to.add(this);
+               return ret_hu_conv;
        }
 
        /**
@@ -157,7 +159,7 @@ public class KeysInterface extends CommonBase {
         */
        public Sign get_channel_signer(boolean inbound, long channel_value_satoshis) {
                long ret = bindings.KeysInterface_get_channel_signer(this.ptr, inbound, channel_value_satoshis);
-               if (ret < 1024) { return null; }
+               if (ret >= 0 && ret <= 4096) { return null; }
                Sign ret_hu_conv = new Sign(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -185,7 +187,7 @@ public class KeysInterface extends CommonBase {
         */
        public Result_SignDecodeErrorZ read_chan_signer(byte[] reader) {
                long ret = bindings.KeysInterface_read_chan_signer(this.ptr, reader);
-               if (ret < 1024) { return null; }
+               if (ret >= 0 && ret <= 4096) { return null; }
                Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -198,7 +200,7 @@ public class KeysInterface extends CommonBase {
         */
        public Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage) {
                long ret = bindings.KeysInterface_sign_invoice(this.ptr, invoice_preimage);
-               if (ret < 1024) { return null; }
+               if (ret >= 0 && ret <= 4096) { return null; }
                Result_RecoverableSignatureNoneZ ret_hu_conv = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }