d3517b54fae0394d95795e14a9874eed512e0ce9
[ldk-java] / ts / structs / InMemoryChannelKeys.ts
1
2 import CommonBase from './CommonBase';
3 import * as bindings from '../bindings' // TODO: figure out location
4
5 public class InMemoryChannelKeys extends CommonBase {
6         InMemoryChannelKeys(Object _dummy, long ptr) { super(ptr); }
7         @Override @SuppressWarnings("deprecation")
8         protected void finalize() throws Throwable {
9                 super.finalize();
10                 if (ptr != 0) { bindings.InMemoryChannelKeys_free(ptr); }
11         }
12
13         public InMemoryChannelKeys clone() {
14                 uint32_t ret = bindings.InMemoryChannelKeys_clone(this.ptr);
15                 InMemoryChannelKeys ret_hu_conv = new InMemoryChannelKeys(null, ret);
16                 return ret_hu_conv;
17         }
18
19         public byte[] get_funding_key() {
20                 byte[] ret = bindings.InMemoryChannelKeys_get_funding_key(this.ptr);
21                 return ret;
22         }
23
24         public void set_funding_key(byte[] val) {
25                 bindings.InMemoryChannelKeys_set_funding_key(this.ptr, val);
26         }
27
28         public byte[] get_revocation_base_key() {
29                 byte[] ret = bindings.InMemoryChannelKeys_get_revocation_base_key(this.ptr);
30                 return ret;
31         }
32
33         public void set_revocation_base_key(byte[] val) {
34                 bindings.InMemoryChannelKeys_set_revocation_base_key(this.ptr, val);
35         }
36
37         public byte[] get_payment_key() {
38                 byte[] ret = bindings.InMemoryChannelKeys_get_payment_key(this.ptr);
39                 return ret;
40         }
41
42         public void set_payment_key(byte[] val) {
43                 bindings.InMemoryChannelKeys_set_payment_key(this.ptr, val);
44         }
45
46         public byte[] get_delayed_payment_base_key() {
47                 byte[] ret = bindings.InMemoryChannelKeys_get_delayed_payment_base_key(this.ptr);
48                 return ret;
49         }
50
51         public void set_delayed_payment_base_key(byte[] val) {
52                 bindings.InMemoryChannelKeys_set_delayed_payment_base_key(this.ptr, val);
53         }
54
55         public byte[] get_htlc_base_key() {
56                 byte[] ret = bindings.InMemoryChannelKeys_get_htlc_base_key(this.ptr);
57                 return ret;
58         }
59
60         public void set_htlc_base_key(byte[] val) {
61                 bindings.InMemoryChannelKeys_set_htlc_base_key(this.ptr, val);
62         }
63
64         public byte[] get_commitment_seed() {
65                 byte[] ret = bindings.InMemoryChannelKeys_get_commitment_seed(this.ptr);
66                 return ret;
67         }
68
69         public void set_commitment_seed(byte[] val) {
70                 bindings.InMemoryChannelKeys_set_commitment_seed(this.ptr, val);
71         }
72
73         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) {
74                 uint32_t 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));
75                 InMemoryChannelKeys ret_hu_conv = new InMemoryChannelKeys(null, ret);
76                 return ret_hu_conv;
77         }
78
79         public ChannelPublicKeys counterparty_pubkeys() {
80                 uint32_t ret = bindings.InMemoryChannelKeys_counterparty_pubkeys(this.ptr);
81                 ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
82                 return ret_hu_conv;
83         }
84
85         public short counterparty_selected_contest_delay() {
86                 short ret = bindings.InMemoryChannelKeys_counterparty_selected_contest_delay(this.ptr);
87                 return ret;
88         }
89
90         public short holder_selected_contest_delay() {
91                 short ret = bindings.InMemoryChannelKeys_holder_selected_contest_delay(this.ptr);
92                 return ret;
93         }
94
95         public boolean is_outbound() {
96                 boolean ret = bindings.InMemoryChannelKeys_is_outbound(this.ptr);
97                 return ret;
98         }
99
100         public OutPoint funding_outpoint() {
101                 uint32_t ret = bindings.InMemoryChannelKeys_funding_outpoint(this.ptr);
102                 OutPoint ret_hu_conv = new OutPoint(null, ret);
103                 return ret_hu_conv;
104         }
105
106         public ChannelTransactionParameters get_channel_parameters() {
107                 uint32_t ret = bindings.InMemoryChannelKeys_get_channel_parameters(this.ptr);
108                 ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret);
109                 return ret_hu_conv;
110         }
111
112         public ChannelKeys as_ChannelKeys() {
113                 uint32_t ret = bindings.InMemoryChannelKeys_as_ChannelKeys(this.ptr);
114                 ChannelKeys ret_hu_conv = new ChannelKeys(null, ret);
115                 ret_hu_conv.ptrs_to.add(this);
116                 return ret_hu_conv;
117         }
118
119         public byte[] write() {
120                 byte[] ret = bindings.InMemoryChannelKeys_write(this.ptr);
121                 return ret;
122         }
123
124         public static Result_InMemoryChannelKeysDecodeErrorZ constructor_read(byte[] ser) {
125                 uint32_t ret = bindings.InMemoryChannelKeys_read(ser);
126                 Result_InMemoryChannelKeysDecodeErrorZ ret_hu_conv = Result_InMemoryChannelKeysDecodeErrorZ.constr_from_ptr(ret);
127                 return ret_hu_conv;
128         }
129
130 }