3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class ChannelDetails extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.ChannelDetails_free(this.ptr);
21 public Uint8Array get_channel_id() {
22 Uint8Array ret = bindings.ChannelDetails_get_channel_id(this.ptr);
26 public void set_channel_id(Uint8Array val) {
27 bindings.ChannelDetails_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
30 public ChannelCounterparty get_counterparty() {
31 number ret = bindings.ChannelDetails_get_counterparty(this.ptr);
32 const ret_hu_conv: ChannelCounterparty = new ChannelCounterparty(null, ret);
33 ret_hu_conv.ptrs_to.add(this);
37 public void set_counterparty(ChannelCounterparty val) {
38 bindings.ChannelDetails_set_counterparty(this.ptr, val == null ? 0 : val.ptr & ~1);
41 public OutPoint get_funding_txo() {
42 number ret = bindings.ChannelDetails_get_funding_txo(this.ptr);
43 const ret_hu_conv: OutPoint = new OutPoint(null, ret);
44 ret_hu_conv.ptrs_to.add(this);
48 public void set_funding_txo(OutPoint val) {
49 bindings.ChannelDetails_set_funding_txo(this.ptr, val == null ? 0 : val.ptr & ~1);
52 public Option_u64Z get_short_channel_id() {
53 number ret = bindings.ChannelDetails_get_short_channel_id(this.ptr);
54 Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
55 ret_hu_conv.ptrs_to.add(this);
59 public void set_short_channel_id(Option_u64Z val) {
60 bindings.ChannelDetails_set_short_channel_id(this.ptr, val.ptr);
63 public number get_channel_value_satoshis() {
64 number ret = bindings.ChannelDetails_get_channel_value_satoshis(this.ptr);
68 public void set_channel_value_satoshis(number val) {
69 bindings.ChannelDetails_set_channel_value_satoshis(this.ptr, val);
72 public Option_u64Z get_unspendable_punishment_reserve() {
73 number ret = bindings.ChannelDetails_get_unspendable_punishment_reserve(this.ptr);
74 Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
75 ret_hu_conv.ptrs_to.add(this);
79 public void set_unspendable_punishment_reserve(Option_u64Z val) {
80 bindings.ChannelDetails_set_unspendable_punishment_reserve(this.ptr, val.ptr);
83 public number get_user_channel_id() {
84 number ret = bindings.ChannelDetails_get_user_channel_id(this.ptr);
88 public void set_user_channel_id(number val) {
89 bindings.ChannelDetails_set_user_channel_id(this.ptr, val);
92 public number get_outbound_capacity_msat() {
93 number ret = bindings.ChannelDetails_get_outbound_capacity_msat(this.ptr);
97 public void set_outbound_capacity_msat(number val) {
98 bindings.ChannelDetails_set_outbound_capacity_msat(this.ptr, val);
101 public number get_inbound_capacity_msat() {
102 number ret = bindings.ChannelDetails_get_inbound_capacity_msat(this.ptr);
106 public void set_inbound_capacity_msat(number val) {
107 bindings.ChannelDetails_set_inbound_capacity_msat(this.ptr, val);
110 public Option_u32Z get_confirmations_required() {
111 number ret = bindings.ChannelDetails_get_confirmations_required(this.ptr);
112 Option_u32Z ret_hu_conv = Option_u32Z.constr_from_ptr(ret);
113 ret_hu_conv.ptrs_to.add(this);
117 public void set_confirmations_required(Option_u32Z val) {
118 bindings.ChannelDetails_set_confirmations_required(this.ptr, val.ptr);
121 public Option_u16Z get_force_close_spend_delay() {
122 number ret = bindings.ChannelDetails_get_force_close_spend_delay(this.ptr);
123 Option_u16Z ret_hu_conv = Option_u16Z.constr_from_ptr(ret);
124 ret_hu_conv.ptrs_to.add(this);
128 public void set_force_close_spend_delay(Option_u16Z val) {
129 bindings.ChannelDetails_set_force_close_spend_delay(this.ptr, val.ptr);
132 public boolean get_is_outbound() {
133 boolean ret = bindings.ChannelDetails_get_is_outbound(this.ptr);
137 public void set_is_outbound(boolean val) {
138 bindings.ChannelDetails_set_is_outbound(this.ptr, val);
141 public boolean get_is_funding_locked() {
142 boolean ret = bindings.ChannelDetails_get_is_funding_locked(this.ptr);
146 public void set_is_funding_locked(boolean val) {
147 bindings.ChannelDetails_set_is_funding_locked(this.ptr, val);
150 public boolean get_is_usable() {
151 boolean ret = bindings.ChannelDetails_get_is_usable(this.ptr);
155 public void set_is_usable(boolean val) {
156 bindings.ChannelDetails_set_is_usable(this.ptr, val);
159 public boolean get_is_public() {
160 boolean ret = bindings.ChannelDetails_get_is_public(this.ptr);
164 public void set_is_public(boolean val) {
165 bindings.ChannelDetails_set_is_public(this.ptr, val);
168 public static ChannelDetails constructor_new(Uint8Array channel_id_arg, ChannelCounterparty counterparty_arg, OutPoint funding_txo_arg, Option_u64Z short_channel_id_arg, number channel_value_satoshis_arg, Option_u64Z unspendable_punishment_reserve_arg, number user_channel_id_arg, number outbound_capacity_msat_arg, number inbound_capacity_msat_arg, Option_u32Z confirmations_required_arg, Option_u16Z force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_funding_locked_arg, boolean is_usable_arg, boolean is_public_arg) {
169 number ret = bindings.ChannelDetails_new(InternalUtils.check_arr_len(channel_id_arg, 32), counterparty_arg == null ? 0 : counterparty_arg.ptr & ~1, funding_txo_arg == null ? 0 : funding_txo_arg.ptr & ~1, short_channel_id_arg.ptr, channel_value_satoshis_arg, unspendable_punishment_reserve_arg.ptr, user_channel_id_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg);
170 const ret_hu_conv: ChannelDetails = new ChannelDetails(null, ret);
171 ret_hu_conv.ptrs_to.add(ret_hu_conv);
175 public number clone_ptr() {
176 number ret = bindings.ChannelDetails_clone_ptr(this.ptr);
180 public ChannelDetails clone() {
181 number ret = bindings.ChannelDetails_clone(this.ptr);
182 const ret_hu_conv: ChannelDetails = new ChannelDetails(null, ret);
183 ret_hu_conv.ptrs_to.add(this);