- public static interface ChannelKeysInterface {
- byte[] get_per_commitment_point(long idx);
- byte[] release_commitment_secret(long idx);
- TwoTuple<Long, Long> key_derivation_params();
- Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(CommitmentTransaction commitment_tx);
- Result_SignatureNoneZ sign_holder_commitment(HolderCommitmentTransaction commitment_tx);
- Result_CVec_SignatureZNoneZ sign_holder_commitment_htlc_transactions(HolderCommitmentTransaction commitment_tx);
- Result_SignatureNoneZ sign_justice_transaction(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, HTLCOutputInCommitment htlc);
- Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, HTLCOutputInCommitment htlc);
- Result_SignatureNoneZ sign_closing_transaction(byte[] closing_tx);
- Result_SignatureNoneZ sign_channel_announcement(UnsignedChannelAnnouncement msg);
- void ready_channel(ChannelTransactionParameters channel_parameters);
- byte[] write();
- }
- private static class LDKChannelKeysHolder { ChannelKeys held; }
- public static ChannelKeys new_impl(ChannelKeysInterface arg, ChannelPublicKeys pubkeys) {
- final LDKChannelKeysHolder impl_holder = new LDKChannelKeysHolder();
- impl_holder.held = new ChannelKeys(new bindings.LDKChannelKeys() {
- @Override public byte[] get_per_commitment_point(long idx) {
- byte[] ret = arg.get_per_commitment_point(idx);
+
+ export class ChannelKeys extends CommonBase {
+
+ bindings_instance?: bindings.LDKChannelKeys;
+
+ constructor(ptr?: number, arg?: bindings.LDKChannelKeys, pubkeys?: ChannelPublicKeys) {
+ if (Number.isFinite(ptr)) {
+ super(ptr);
+ this.bindings_instance = null;
+ } else {
+ // TODO: private constructor instantiation
+ super(bindings.LDKChannelKeys_new(arg, pubkeys == null ? 0 : pubkeys.ptr & ~1));
+ this.ptrs_to.push(arg);
+ this.ptrs_to.add(pubkeys);
+
+ }
+ }
+
+ protected finalize() {
+ if (this.ptr != 0) {
+ bindings.ChannelKeys_free(this.ptr);
+ }
+ super.finalize();
+ }
+
+ static new_impl(arg: ChannelKeysInterface, pubkeys: ChannelPublicKeys): ChannelKeys {
+ const impl_holder: LDKChannelKeysHolder = new LDKChannelKeysHolder();
+ let structImplementation = <bindings.LDKChannelKeys>{
+ // todo: in-line interface filling
+ get_per_commitment_point (idx: number): Uint8Array {
+ Uint8Array ret = arg.get_per_commitment_point(idx);