Fix write method generation w/ upstream changes
[ldk-java] / src / main / java / org / ldk / structs / InMemoryChannelKeys.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5 import org.ldk.util.*;
6 import java.util.Arrays;
7
8 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
9 public class InMemoryChannelKeys extends CommonBase {
10         InMemoryChannelKeys(Object _dummy, long ptr) { super(ptr); }
11         @Override @SuppressWarnings("deprecation")
12         protected void finalize() throws Throwable {
13                 super.finalize();
14                 if (ptr != 0) { bindings.InMemoryChannelKeys_free(ptr); }
15         }
16
17         public static InMemoryChannelKeys constructor_clone(InMemoryChannelKeys orig) {
18                 long ret = bindings.InMemoryChannelKeys_clone(orig == null ? 0 : orig.ptr & ~1);
19                 InMemoryChannelKeys ret_hu_conv = new InMemoryChannelKeys(null, ret);
20                 ret_hu_conv.ptrs_to.add(orig);
21                 return ret_hu_conv;
22         }
23
24         public byte[] get_funding_key() {
25                 byte[] ret = bindings.InMemoryChannelKeys_get_funding_key(this.ptr);
26                 return ret;
27         }
28
29         public void set_funding_key(byte[] val) {
30                 bindings.InMemoryChannelKeys_set_funding_key(this.ptr, val);
31         }
32
33         public byte[] get_revocation_base_key() {
34                 byte[] ret = bindings.InMemoryChannelKeys_get_revocation_base_key(this.ptr);
35                 return ret;
36         }
37
38         public void set_revocation_base_key(byte[] val) {
39                 bindings.InMemoryChannelKeys_set_revocation_base_key(this.ptr, val);
40         }
41
42         public byte[] get_payment_key() {
43                 byte[] ret = bindings.InMemoryChannelKeys_get_payment_key(this.ptr);
44                 return ret;
45         }
46
47         public void set_payment_key(byte[] val) {
48                 bindings.InMemoryChannelKeys_set_payment_key(this.ptr, val);
49         }
50
51         public byte[] get_delayed_payment_base_key() {
52                 byte[] ret = bindings.InMemoryChannelKeys_get_delayed_payment_base_key(this.ptr);
53                 return ret;
54         }
55
56         public void set_delayed_payment_base_key(byte[] val) {
57                 bindings.InMemoryChannelKeys_set_delayed_payment_base_key(this.ptr, val);
58         }
59
60         public byte[] get_htlc_base_key() {
61                 byte[] ret = bindings.InMemoryChannelKeys_get_htlc_base_key(this.ptr);
62                 return ret;
63         }
64
65         public void set_htlc_base_key(byte[] val) {
66                 bindings.InMemoryChannelKeys_set_htlc_base_key(this.ptr, val);
67         }
68
69         public byte[] get_commitment_seed() {
70                 byte[] ret = bindings.InMemoryChannelKeys_get_commitment_seed(this.ptr);
71                 return ret;
72         }
73
74         public void set_commitment_seed(byte[] val) {
75                 bindings.InMemoryChannelKeys_set_commitment_seed(this.ptr, val);
76         }
77
78         public static InMemoryChannelKeys constructor_new(byte[] funding_key, byte[] revocation_base_key, byte[] payment_key, byte[] delayed_payment_base_key, byte[] htlc_base_key, byte[] commitment_seed, long channel_value_satoshis, TwoTuple<Long, Long> key_derivation_params) {
79                 long ret = bindings.InMemoryChannelKeys_new(funding_key, revocation_base_key, payment_key, delayed_payment_base_key, htlc_base_key, commitment_seed, channel_value_satoshis, bindings.C2Tuple_u64u64Z_new(key_derivation_params.a, key_derivation_params.b));
80                 InMemoryChannelKeys ret_hu_conv = new InMemoryChannelKeys(null, ret);
81                 return ret_hu_conv;
82         }
83
84         public ChannelPublicKeys counterparty_pubkeys() {
85                 long ret = bindings.InMemoryChannelKeys_counterparty_pubkeys(this.ptr);
86                 ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
87                 return ret_hu_conv;
88         }
89
90         public short counterparty_selected_contest_delay() {
91                 short ret = bindings.InMemoryChannelKeys_counterparty_selected_contest_delay(this.ptr);
92                 return ret;
93         }
94
95         public short holder_selected_contest_delay() {
96                 short ret = bindings.InMemoryChannelKeys_holder_selected_contest_delay(this.ptr);
97                 return ret;
98         }
99
100         public ChannelKeys as_ChannelKeys() {
101                 long ret = bindings.InMemoryChannelKeys_as_ChannelKeys(this.ptr);
102                 ChannelKeys ret_hu_conv = new ChannelKeys(null, ret);
103                 ret_hu_conv.ptrs_to.add(this);
104                 return ret_hu_conv;
105         }
106
107         public byte[] write() {
108                 byte[] ret = bindings.InMemoryChannelKeys_write(this.ptr);
109                 return ret;
110         }
111
112         public static InMemoryChannelKeys constructor_read(byte[] ser) {
113                 long ret = bindings.InMemoryChannelKeys_read(ser);
114                 InMemoryChannelKeys ret_hu_conv = new InMemoryChannelKeys(null, ret);
115                 return ret_hu_conv;
116         }
117
118 }