fa9ad9d5de46b0c3db28cb1c36cbe580d8895f16
[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 byte[] get_funding_key() {
18                 byte[] ret = bindings.InMemoryChannelKeys_get_funding_key(this.ptr);
19                 return ret;
20         }
21
22         public void set_funding_key(byte[] val) {
23                 bindings.InMemoryChannelKeys_set_funding_key(this.ptr, val);
24         }
25
26         public byte[] get_revocation_base_key() {
27                 byte[] ret = bindings.InMemoryChannelKeys_get_revocation_base_key(this.ptr);
28                 return ret;
29         }
30
31         public void set_revocation_base_key(byte[] val) {
32                 bindings.InMemoryChannelKeys_set_revocation_base_key(this.ptr, val);
33         }
34
35         public byte[] get_payment_key() {
36                 byte[] ret = bindings.InMemoryChannelKeys_get_payment_key(this.ptr);
37                 return ret;
38         }
39
40         public void set_payment_key(byte[] val) {
41                 bindings.InMemoryChannelKeys_set_payment_key(this.ptr, val);
42         }
43
44         public byte[] get_delayed_payment_base_key() {
45                 byte[] ret = bindings.InMemoryChannelKeys_get_delayed_payment_base_key(this.ptr);
46                 return ret;
47         }
48
49         public void set_delayed_payment_base_key(byte[] val) {
50                 bindings.InMemoryChannelKeys_set_delayed_payment_base_key(this.ptr, val);
51         }
52
53         public byte[] get_htlc_base_key() {
54                 byte[] ret = bindings.InMemoryChannelKeys_get_htlc_base_key(this.ptr);
55                 return ret;
56         }
57
58         public void set_htlc_base_key(byte[] val) {
59                 bindings.InMemoryChannelKeys_set_htlc_base_key(this.ptr, val);
60         }
61
62         public byte[] get_commitment_seed() {
63                 byte[] ret = bindings.InMemoryChannelKeys_get_commitment_seed(this.ptr);
64                 return ret;
65         }
66
67         public void set_commitment_seed(byte[] val) {
68                 bindings.InMemoryChannelKeys_set_commitment_seed(this.ptr, val);
69         }
70
71         public InMemoryChannelKeys clone() {
72                 long ret = bindings.InMemoryChannelKeys_clone(this.ptr);
73                 InMemoryChannelKeys ret_hu_conv = new InMemoryChannelKeys(null, ret);
74                 ret_hu_conv.ptrs_to.add(this);
75                 return ret_hu_conv;
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                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
82                 return ret_hu_conv;
83         }
84
85         public ChannelPublicKeys counterparty_pubkeys() {
86                 long ret = bindings.InMemoryChannelKeys_counterparty_pubkeys(this.ptr);
87                 ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
88                 ret_hu_conv.ptrs_to.add(this);
89                 return ret_hu_conv;
90         }
91
92         public short counterparty_selected_contest_delay() {
93                 short ret = bindings.InMemoryChannelKeys_counterparty_selected_contest_delay(this.ptr);
94                 return ret;
95         }
96
97         public short holder_selected_contest_delay() {
98                 short ret = bindings.InMemoryChannelKeys_holder_selected_contest_delay(this.ptr);
99                 return ret;
100         }
101
102         public boolean is_outbound() {
103                 boolean ret = bindings.InMemoryChannelKeys_is_outbound(this.ptr);
104                 return ret;
105         }
106
107         public OutPoint funding_outpoint() {
108                 long ret = bindings.InMemoryChannelKeys_funding_outpoint(this.ptr);
109                 OutPoint ret_hu_conv = new OutPoint(null, ret);
110                 ret_hu_conv.ptrs_to.add(this);
111                 return ret_hu_conv;
112         }
113
114         public ChannelTransactionParameters get_channel_parameters() {
115                 long ret = bindings.InMemoryChannelKeys_get_channel_parameters(this.ptr);
116                 ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret);
117                 ret_hu_conv.ptrs_to.add(this);
118                 return ret_hu_conv;
119         }
120
121         public ChannelKeys as_ChannelKeys() {
122                 long ret = bindings.InMemoryChannelKeys_as_ChannelKeys(this.ptr);
123                 ChannelKeys ret_hu_conv = new ChannelKeys(null, ret);
124                 ret_hu_conv.ptrs_to.add(this);
125                 return ret_hu_conv;
126         }
127
128         public byte[] write() {
129                 byte[] ret = bindings.InMemoryChannelKeys_write(this.ptr);
130                 return ret;
131         }
132
133         public static Result_InMemoryChannelKeysDecodeErrorZ constructor_read(byte[] ser) {
134                 long ret = bindings.InMemoryChannelKeys_read(ser);
135                 Result_InMemoryChannelKeysDecodeErrorZ ret_hu_conv = Result_InMemoryChannelKeysDecodeErrorZ.constr_from_ptr(ret);
136                 return ret_hu_conv;
137         }
138
139 }