3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class ChannelCounterparty extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.ChannelCounterparty_free(this.ptr);
21 public Uint8Array get_node_id() {
22 Uint8Array ret = bindings.ChannelCounterparty_get_node_id(this.ptr);
26 public void set_node_id(Uint8Array val) {
27 bindings.ChannelCounterparty_set_node_id(this.ptr, val);
30 public InitFeatures get_features() {
31 number ret = bindings.ChannelCounterparty_get_features(this.ptr);
32 const ret_hu_conv: InitFeatures = new InitFeatures(null, ret);
33 ret_hu_conv.ptrs_to.add(this);
37 public void set_features(InitFeatures val) {
38 bindings.ChannelCounterparty_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
41 public number get_unspendable_punishment_reserve() {
42 number ret = bindings.ChannelCounterparty_get_unspendable_punishment_reserve(this.ptr);
46 public void set_unspendable_punishment_reserve(number val) {
47 bindings.ChannelCounterparty_set_unspendable_punishment_reserve(this.ptr, val);
50 public CounterpartyForwardingInfo get_forwarding_info() {
51 number ret = bindings.ChannelCounterparty_get_forwarding_info(this.ptr);
52 const ret_hu_conv: CounterpartyForwardingInfo = new CounterpartyForwardingInfo(null, ret);
53 ret_hu_conv.ptrs_to.add(this);
57 public void set_forwarding_info(CounterpartyForwardingInfo val) {
58 bindings.ChannelCounterparty_set_forwarding_info(this.ptr, val == null ? 0 : val.ptr & ~1);
61 public static ChannelCounterparty constructor_new(Uint8Array node_id_arg, InitFeatures features_arg, number unspendable_punishment_reserve_arg, CounterpartyForwardingInfo forwarding_info_arg) {
62 number ret = bindings.ChannelCounterparty_new(node_id_arg, features_arg == null ? 0 : features_arg.ptr & ~1, unspendable_punishment_reserve_arg, forwarding_info_arg == null ? 0 : forwarding_info_arg.ptr & ~1);
63 const ret_hu_conv: ChannelCounterparty = new ChannelCounterparty(null, ret);
64 ret_hu_conv.ptrs_to.add(ret_hu_conv);
68 public ChannelCounterparty clone() {
69 number ret = bindings.ChannelCounterparty_clone(this.ptr);
70 const ret_hu_conv: ChannelCounterparty = new ChannelCounterparty(null, ret);
71 ret_hu_conv.ptrs_to.add(this);