3034bfd94c8f1359702c3f9d2ddc3211bc35b766
[ldk-java] / src / main / java / org / ldk / structs / ChannelKeys.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4
5 import org.ldk.enums.*;
6
7 public class ChannelKeys extends CommonBase {
8         ChannelKeys(Object _dummy, long ptr) { super(ptr); }
9         public ChannelKeys(bindings.LDKChannelKeys arg) {
10                 super(bindings.LDKChannelKeys_new(arg));
11                 this.ptrs_to.add(arg);
12         }
13         @Override @SuppressWarnings("deprecation")
14         protected void finalize() throws Throwable {
15                 bindings.ChannelKeys_free(ptr); super.finalize();
16         }
17
18         public byte[] get_per_commitment_point(long idx) {
19                 byte[] ret = bindings.ChannelKeys_get_per_commitment_point(this.ptr, idx);
20                 return ret;
21         }
22
23         public byte[] release_commitment_secret(long idx) {
24                 byte[] ret = bindings.ChannelKeys_release_commitment_secret(this.ptr, idx);
25                 return ret;
26         }
27
28         // Skipped ChannelKeys_key_derivation_params
29         // Skipped ChannelKeys_sign_counterparty_commitment
30         // Skipped ChannelKeys_sign_holder_commitment
31         // Skipped ChannelKeys_sign_holder_commitment_htlc_transactions
32         // Skipped ChannelKeys_sign_justice_transaction
33         // Skipped ChannelKeys_sign_counterparty_htlc_transaction
34         // Skipped ChannelKeys_sign_closing_transaction
35         // Skipped ChannelKeys_sign_channel_announcement
36         public void on_accept(ChannelPublicKeys channel_points, short counterparty_selected_contest_delay, short holder_selected_contest_delay) {
37                 bindings.ChannelKeys_on_accept(this.ptr, channel_points == null ? 0 : channel_points.ptr & ~1, counterparty_selected_contest_delay, holder_selected_contest_delay);
38                 this.ptrs_to.add(channel_points);
39         }
40
41 }