]> git.bitcoin.ninja Git - ldk-java/blob - ts/structs/ChannelCounterparty.ts
Merge pull request #47 from TheBlueMatt/main
[ldk-java] / ts / structs / ChannelCounterparty.ts
1
2             
3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
5
6
7
8             export default class ChannelCounterparty extends CommonBase {
9                 constructor(_dummy: object, ptr: number) {
10                     super(ptr);
11                 }
12
13                 
14                 protected finalize() {
15                     super.finalize();
16
17                     if (this.ptr != 0) {
18                         bindings.ChannelCounterparty_free(this.ptr);
19                     }
20                 }
21         public Uint8Array get_node_id() {
22                 Uint8Array ret = bindings.ChannelCounterparty_get_node_id(this.ptr);
23                 return ret;
24         }
25
26         public void set_node_id(Uint8Array val) {
27                 bindings.ChannelCounterparty_set_node_id(this.ptr, val);
28         }
29
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);
34                 return ret_hu_conv;
35         }
36
37         public void set_features(InitFeatures val) {
38                 bindings.ChannelCounterparty_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
39         }
40
41         public number get_unspendable_punishment_reserve() {
42                 number ret = bindings.ChannelCounterparty_get_unspendable_punishment_reserve(this.ptr);
43                 return ret;
44         }
45
46         public void set_unspendable_punishment_reserve(number val) {
47                 bindings.ChannelCounterparty_set_unspendable_punishment_reserve(this.ptr, val);
48         }
49
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);
54                 return ret_hu_conv;
55         }
56
57         public void set_forwarding_info(CounterpartyForwardingInfo val) {
58                 bindings.ChannelCounterparty_set_forwarding_info(this.ptr, val == null ? 0 : val.ptr & ~1);
59         }
60
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);
65                 return ret_hu_conv;
66         }
67
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);
72                 return ret_hu_conv;
73         }
74
75 }