[TS] Update auto-generated TypeScript Bindings
[ldk-java] / ts / structs / TxCreationKeys.mts
index 0d0c24c893ebb0699f72ce9ec7a7d46ac5a7916d..5efd0a2e4a02e1629f7d28af567c9239fc4bc1ca 100644 (file)
@@ -281,62 +281,112 @@ import CommonBase from './CommonBase.mjs';
 import * as bindings from '../bindings.mjs'
 
 
+/**
+ * The set of public keys which are used in the creation of one commitment transaction.
+ * These are derived from the channel base keys and per-commitment data.
+ * 
+ * A broadcaster key is provided from potential broadcaster of the computed transaction.
+ * A countersignatory key is coming from a protocol participant unable to broadcast the
+ * transaction.
+ * 
+ * These keys are assumed to be good, either because the code derived them from
+ * channel basepoints via the new function, or they were obtained via
+ * CommitmentTransaction.trust().keys() because we trusted the source of the
+ * pre-calculated keys.
+ */
 export class TxCreationKeys extends CommonBase {
        /* @internal */
        public constructor(_dummy: object, ptr: number) {
                super(ptr, bindings.TxCreationKeys_free);
        }
 
+       /**
+        * The broadcaster's per-commitment public key which was used to derive the other keys.
+        */
        public get_per_commitment_point(): Uint8Array {
                const ret: number = bindings.TxCreationKeys_get_per_commitment_point(this.ptr);
                const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
                return ret_conv;
        }
 
+       /**
+        * The broadcaster's per-commitment public key which was used to derive the other keys.
+        */
        public set_per_commitment_point(val: Uint8Array): void {
                bindings.TxCreationKeys_set_per_commitment_point(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33)));
        }
 
+       /**
+        * The revocation key which is used to allow the broadcaster of the commitment
+        * transaction to provide their counterparty the ability to punish them if they broadcast
+        * an old state.
+        */
        public get_revocation_key(): Uint8Array {
                const ret: number = bindings.TxCreationKeys_get_revocation_key(this.ptr);
                const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
                return ret_conv;
        }
 
+       /**
+        * The revocation key which is used to allow the broadcaster of the commitment
+        * transaction to provide their counterparty the ability to punish them if they broadcast
+        * an old state.
+        */
        public set_revocation_key(val: Uint8Array): void {
                bindings.TxCreationKeys_set_revocation_key(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33)));
        }
 
+       /**
+        * Broadcaster's HTLC Key
+        */
        public get_broadcaster_htlc_key(): Uint8Array {
                const ret: number = bindings.TxCreationKeys_get_broadcaster_htlc_key(this.ptr);
                const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
                return ret_conv;
        }
 
+       /**
+        * Broadcaster's HTLC Key
+        */
        public set_broadcaster_htlc_key(val: Uint8Array): void {
                bindings.TxCreationKeys_set_broadcaster_htlc_key(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33)));
        }
 
+       /**
+        * Countersignatory's HTLC Key
+        */
        public get_countersignatory_htlc_key(): Uint8Array {
                const ret: number = bindings.TxCreationKeys_get_countersignatory_htlc_key(this.ptr);
                const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
                return ret_conv;
        }
 
+       /**
+        * Countersignatory's HTLC Key
+        */
        public set_countersignatory_htlc_key(val: Uint8Array): void {
                bindings.TxCreationKeys_set_countersignatory_htlc_key(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33)));
        }
 
+       /**
+        * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
+        */
        public get_broadcaster_delayed_payment_key(): Uint8Array {
                const ret: number = bindings.TxCreationKeys_get_broadcaster_delayed_payment_key(this.ptr);
                const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
                return ret_conv;
        }
 
+       /**
+        * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
+        */
        public set_broadcaster_delayed_payment_key(val: Uint8Array): void {
                bindings.TxCreationKeys_set_broadcaster_delayed_payment_key(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33)));
        }
 
+       /**
+        * Constructs a new TxCreationKeys given each field
+        */
        public static constructor_new(per_commitment_point_arg: Uint8Array, revocation_key_arg: Uint8Array, broadcaster_htlc_key_arg: Uint8Array, countersignatory_htlc_key_arg: Uint8Array, broadcaster_delayed_payment_key_arg: Uint8Array): TxCreationKeys {
                const ret: number = bindings.TxCreationKeys_new(bindings.encodeUint8Array(bindings.check_arr_len(per_commitment_point_arg, 33)), bindings.encodeUint8Array(bindings.check_arr_len(revocation_key_arg, 33)), bindings.encodeUint8Array(bindings.check_arr_len(broadcaster_htlc_key_arg, 33)), bindings.encodeUint8Array(bindings.check_arr_len(countersignatory_htlc_key_arg, 33)), bindings.encodeUint8Array(bindings.check_arr_len(broadcaster_delayed_payment_key_arg, 33)));
                const ret_hu_conv: TxCreationKeys = new TxCreationKeys(null, ret);
@@ -349,6 +399,9 @@ export class TxCreationKeys extends CommonBase {
                return ret;
        }
 
+       /**
+        * Creates a copy of the TxCreationKeys
+        */
        public clone(): TxCreationKeys {
                const ret: number = bindings.TxCreationKeys_clone(this.ptr);
                const ret_hu_conv: TxCreationKeys = new TxCreationKeys(null, ret);
@@ -356,24 +409,38 @@ export class TxCreationKeys extends CommonBase {
                return ret_hu_conv;
        }
 
+       /**
+        * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
+        */
        public write(): Uint8Array {
                const ret: number = bindings.TxCreationKeys_write(this.ptr);
                const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
                return ret_conv;
        }
 
+       /**
+        * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
+        */
        public static constructor_read(ser: Uint8Array): Result_TxCreationKeysDecodeErrorZ {
                const ret: number = bindings.TxCreationKeys_read(bindings.encodeUint8Array(ser));
                const ret_hu_conv: Result_TxCreationKeysDecodeErrorZ = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
 
+       /**
+        * Create per-state keys from channel base points and the per-commitment point.
+        * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
+        */
        public static constructor_derive_new(per_commitment_point: Uint8Array, broadcaster_delayed_payment_base: Uint8Array, broadcaster_htlc_base: Uint8Array, countersignatory_revocation_base: Uint8Array, countersignatory_htlc_base: Uint8Array): Result_TxCreationKeysErrorZ {
                const ret: number = bindings.TxCreationKeys_derive_new(bindings.encodeUint8Array(bindings.check_arr_len(per_commitment_point, 33)), bindings.encodeUint8Array(bindings.check_arr_len(broadcaster_delayed_payment_base, 33)), bindings.encodeUint8Array(bindings.check_arr_len(broadcaster_htlc_base, 33)), bindings.encodeUint8Array(bindings.check_arr_len(countersignatory_revocation_base, 33)), bindings.encodeUint8Array(bindings.check_arr_len(countersignatory_htlc_base, 33)));
                const ret_hu_conv: Result_TxCreationKeysErrorZ = Result_TxCreationKeysErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
 
+       /**
+        * Generate per-state keys from channel static keys.
+        * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
+        */
        public static constructor_from_channel_static_keys(per_commitment_point: Uint8Array, broadcaster_keys: ChannelPublicKeys, countersignatory_keys: ChannelPublicKeys): Result_TxCreationKeysErrorZ {
                const ret: number = bindings.TxCreationKeys_from_channel_static_keys(bindings.encodeUint8Array(bindings.check_arr_len(per_commitment_point, 33)), broadcaster_keys == null ? 0 : CommonBase.get_ptr_of(broadcaster_keys) & ~1, countersignatory_keys == null ? 0 : CommonBase.get_ptr_of(countersignatory_keys) & ~1);
                const ret_hu_conv: Result_TxCreationKeysErrorZ = Result_TxCreationKeysErrorZ.constr_from_ptr(ret);