]> git.bitcoin.ninja Git - ldk-java/blobdiff - src/main/java/org/ldk/structs/SpendableOutputDescriptor.java
Update CI references to LDK 0.0.124 drop stale memchr pins
[ldk-java] / src / main / java / org / ldk / structs / SpendableOutputDescriptor.java
index 26dd9ec1e687223a81b602c55bf8e706af817c12..97aebe4e68919d6a71ae14fcc4cbea4ab41846cd 100644 (file)
@@ -60,6 +60,19 @@ public class SpendableOutputDescriptor extends CommonBase {
                 * The output which is referenced by the given outpoint.
                */
                public final org.ldk.structs.TxOut output;
+               /**
+                * The `channel_keys_id` for the channel which this output came from.
+                * 
+                * For channels which were generated on LDK 0.0.119 or later, this is the value which was
+                * passed to the [`SignerProvider::get_destination_script`] call which provided this
+                * output script.
+                * 
+                * For channels which were generated prior to LDK 0.0.119, no such argument existed,
+                * however this field may still be filled in if such data is available.
+                * 
+                * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+               */
+               @Nullable public final byte[] channel_keys_id;
                private StaticOutput(long ptr, bindings.LDKSpendableOutputDescriptor.StaticOutput obj) {
                        super(null, ptr);
                        long outpoint = obj.outpoint;
@@ -69,6 +82,7 @@ public class SpendableOutputDescriptor extends CommonBase {
                        long output = obj.output;
                        TxOut output_conv = new TxOut(null, output);
                        this.output = output_conv;
+                       this.channel_keys_id = obj.channel_keys_id;
                }
        }
        /**
@@ -94,8 +108,8 @@ public class SpendableOutputDescriptor extends CommonBase {
         * To derive the delayed payment key which is used to sign this input, you must pass the
         * holder [`InMemorySigner::delayed_payment_base_key`] (i.e., the private key which corresponds to the
         * [`ChannelPublicKeys::delayed_payment_basepoint`] in [`ChannelSigner::pubkeys`]) and the provided
-        * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to [`chan_utils::derive_private_key`]. The public key can be
-        * generated without the secret key using [`chan_utils::derive_public_key`] and only the
+        * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to [`chan_utils::derive_private_key`]. The DelayedPaymentKey can be
+        * generated without the secret key using [`DelayedPaymentKey::from_basepoint`] and only the
         * [`ChannelPublicKeys::delayed_payment_basepoint`] which appears in [`ChannelSigner::pubkeys`].
         * 
         * To derive the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] provided here (which is
@@ -103,7 +117,7 @@ public class SpendableOutputDescriptor extends CommonBase {
         * [`ChannelPublicKeys::revocation_basepoint`] (which appears in the call to
         * [`ChannelSigner::provide_channel_parameters`]) and the provided
         * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to
-        * [`chan_utils::derive_public_revocation_key`].
+        * [`RevocationKey`].
         * 
         * The witness script which is hashed and included in the output `script_pubkey` may be
         * regenerated by passing the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] (derived
@@ -171,14 +185,14 @@ public class SpendableOutputDescriptor extends CommonBase {
        /**
         * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
         */
-       public static SpendableOutputDescriptor static_output(org.ldk.structs.OutPoint outpoint, org.ldk.structs.TxOut output) {
-               long ret = bindings.SpendableOutputDescriptor_static_output(outpoint == null ? 0 : outpoint.ptr, output.ptr);
+       public static SpendableOutputDescriptor static_output(org.ldk.structs.OutPoint outpoint, org.ldk.structs.TxOut output, byte[] channel_keys_id) {
+               long ret = bindings.SpendableOutputDescriptor_static_output(outpoint.ptr, output.ptr, InternalUtils.check_arr_len(channel_keys_id, 32));
                Reference.reachabilityFence(outpoint);
                Reference.reachabilityFence(output);
+               Reference.reachabilityFence(channel_keys_id);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.SpendableOutputDescriptor ret_hu_conv = org.ldk.structs.SpendableOutputDescriptor.constr_from_ptr(ret);
                if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
-               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(outpoint); };
                return ret_hu_conv;
        }
 
@@ -186,12 +200,11 @@ public class SpendableOutputDescriptor extends CommonBase {
         * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
         */
        public static SpendableOutputDescriptor delayed_payment_output(org.ldk.structs.DelayedPaymentOutputDescriptor a) {
-               long ret = bindings.SpendableOutputDescriptor_delayed_payment_output(a == null ? 0 : a.ptr);
+               long ret = bindings.SpendableOutputDescriptor_delayed_payment_output(a.ptr);
                Reference.reachabilityFence(a);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.SpendableOutputDescriptor ret_hu_conv = org.ldk.structs.SpendableOutputDescriptor.constr_from_ptr(ret);
                if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
-               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); };
                return ret_hu_conv;
        }
 
@@ -199,12 +212,11 @@ public class SpendableOutputDescriptor extends CommonBase {
         * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
         */
        public static SpendableOutputDescriptor static_payment_output(org.ldk.structs.StaticPaymentOutputDescriptor a) {
-               long ret = bindings.SpendableOutputDescriptor_static_payment_output(a == null ? 0 : a.ptr);
+               long ret = bindings.SpendableOutputDescriptor_static_payment_output(a.ptr);
                Reference.reachabilityFence(a);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.SpendableOutputDescriptor ret_hu_conv = org.ldk.structs.SpendableOutputDescriptor.constr_from_ptr(ret);
                if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
-               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); };
                return ret_hu_conv;
        }
 
@@ -225,7 +237,7 @@ public class SpendableOutputDescriptor extends CommonBase {
         * This ignores pointers and is_owned flags and looks at the values in fields.
         */
        public boolean eq(org.ldk.structs.SpendableOutputDescriptor b) {
-               boolean ret = bindings.SpendableOutputDescriptor_eq(this.ptr, b == null ? 0 : b.ptr);
+               boolean ret = bindings.SpendableOutputDescriptor_eq(this.ptr, b.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(b);
                return ret;