3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class OpenChannel extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.OpenChannel_free(this.ptr);
21 public Uint8Array get_chain_hash() {
22 Uint8Array ret = bindings.OpenChannel_get_chain_hash(this.ptr);
26 public void set_chain_hash(Uint8Array val) {
27 bindings.OpenChannel_set_chain_hash(this.ptr, val);
30 public Uint8Array get_temporary_channel_id() {
31 Uint8Array ret = bindings.OpenChannel_get_temporary_channel_id(this.ptr);
35 public void set_temporary_channel_id(Uint8Array val) {
36 bindings.OpenChannel_set_temporary_channel_id(this.ptr, val);
39 public number get_funding_satoshis() {
40 number ret = bindings.OpenChannel_get_funding_satoshis(this.ptr);
44 public void set_funding_satoshis(number val) {
45 bindings.OpenChannel_set_funding_satoshis(this.ptr, val);
48 public number get_push_msat() {
49 number ret = bindings.OpenChannel_get_push_msat(this.ptr);
53 public void set_push_msat(number val) {
54 bindings.OpenChannel_set_push_msat(this.ptr, val);
57 public number get_dust_limit_satoshis() {
58 number ret = bindings.OpenChannel_get_dust_limit_satoshis(this.ptr);
62 public void set_dust_limit_satoshis(number val) {
63 bindings.OpenChannel_set_dust_limit_satoshis(this.ptr, val);
66 public number get_max_htlc_value_in_flight_msat() {
67 number ret = bindings.OpenChannel_get_max_htlc_value_in_flight_msat(this.ptr);
71 public void set_max_htlc_value_in_flight_msat(number val) {
72 bindings.OpenChannel_set_max_htlc_value_in_flight_msat(this.ptr, val);
75 public number get_channel_reserve_satoshis() {
76 number ret = bindings.OpenChannel_get_channel_reserve_satoshis(this.ptr);
80 public void set_channel_reserve_satoshis(number val) {
81 bindings.OpenChannel_set_channel_reserve_satoshis(this.ptr, val);
84 public number get_htlc_minimum_msat() {
85 number ret = bindings.OpenChannel_get_htlc_minimum_msat(this.ptr);
89 public void set_htlc_minimum_msat(number val) {
90 bindings.OpenChannel_set_htlc_minimum_msat(this.ptr, val);
93 public number get_feerate_per_kw() {
94 number ret = bindings.OpenChannel_get_feerate_per_kw(this.ptr);
98 public void set_feerate_per_kw(number val) {
99 bindings.OpenChannel_set_feerate_per_kw(this.ptr, val);
102 public number get_to_self_delay() {
103 number ret = bindings.OpenChannel_get_to_self_delay(this.ptr);
107 public void set_to_self_delay(number val) {
108 bindings.OpenChannel_set_to_self_delay(this.ptr, val);
111 public number get_max_accepted_htlcs() {
112 number ret = bindings.OpenChannel_get_max_accepted_htlcs(this.ptr);
116 public void set_max_accepted_htlcs(number val) {
117 bindings.OpenChannel_set_max_accepted_htlcs(this.ptr, val);
120 public Uint8Array get_funding_pubkey() {
121 Uint8Array ret = bindings.OpenChannel_get_funding_pubkey(this.ptr);
125 public void set_funding_pubkey(Uint8Array val) {
126 bindings.OpenChannel_set_funding_pubkey(this.ptr, val);
129 public Uint8Array get_revocation_basepoint() {
130 Uint8Array ret = bindings.OpenChannel_get_revocation_basepoint(this.ptr);
134 public void set_revocation_basepoint(Uint8Array val) {
135 bindings.OpenChannel_set_revocation_basepoint(this.ptr, val);
138 public Uint8Array get_payment_point() {
139 Uint8Array ret = bindings.OpenChannel_get_payment_point(this.ptr);
143 public void set_payment_point(Uint8Array val) {
144 bindings.OpenChannel_set_payment_point(this.ptr, val);
147 public Uint8Array get_delayed_payment_basepoint() {
148 Uint8Array ret = bindings.OpenChannel_get_delayed_payment_basepoint(this.ptr);
152 public void set_delayed_payment_basepoint(Uint8Array val) {
153 bindings.OpenChannel_set_delayed_payment_basepoint(this.ptr, val);
156 public Uint8Array get_htlc_basepoint() {
157 Uint8Array ret = bindings.OpenChannel_get_htlc_basepoint(this.ptr);
161 public void set_htlc_basepoint(Uint8Array val) {
162 bindings.OpenChannel_set_htlc_basepoint(this.ptr, val);
165 public Uint8Array get_first_per_commitment_point() {
166 Uint8Array ret = bindings.OpenChannel_get_first_per_commitment_point(this.ptr);
170 public void set_first_per_commitment_point(Uint8Array val) {
171 bindings.OpenChannel_set_first_per_commitment_point(this.ptr, val);
174 public number get_channel_flags() {
175 number ret = bindings.OpenChannel_get_channel_flags(this.ptr);
179 public void set_channel_flags(number val) {
180 bindings.OpenChannel_set_channel_flags(this.ptr, val);
183 public OpenChannel clone() {
184 number ret = bindings.OpenChannel_clone(this.ptr);
185 const ret_hu_conv: OpenChannel = new OpenChannel(null, ret);
186 ret_hu_conv.ptrs_to.add(this);
190 public Uint8Array write() {
191 Uint8Array ret = bindings.OpenChannel_write(this.ptr);
195 public static Result_OpenChannelDecodeErrorZ constructor_read(Uint8Array ser) {
196 number ret = bindings.OpenChannel_read(ser);
197 Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret);