3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class ChannelTransactionParameters extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.ChannelTransactionParameters_free(this.ptr);
21 public ChannelPublicKeys get_holder_pubkeys() {
22 number ret = bindings.ChannelTransactionParameters_get_holder_pubkeys(this.ptr);
23 const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret);
24 ret_hu_conv.ptrs_to.add(this);
28 public void set_holder_pubkeys(ChannelPublicKeys val) {
29 bindings.ChannelTransactionParameters_set_holder_pubkeys(this.ptr, val == null ? 0 : val.ptr & ~1);
30 this.ptrs_to.add(val);
33 public number get_holder_selected_contest_delay() {
34 number ret = bindings.ChannelTransactionParameters_get_holder_selected_contest_delay(this.ptr);
38 public void set_holder_selected_contest_delay(number val) {
39 bindings.ChannelTransactionParameters_set_holder_selected_contest_delay(this.ptr, val);
42 public boolean get_is_outbound_from_holder() {
43 boolean ret = bindings.ChannelTransactionParameters_get_is_outbound_from_holder(this.ptr);
47 public void set_is_outbound_from_holder(boolean val) {
48 bindings.ChannelTransactionParameters_set_is_outbound_from_holder(this.ptr, val);
51 public CounterpartyChannelTransactionParameters get_counterparty_parameters() {
52 number ret = bindings.ChannelTransactionParameters_get_counterparty_parameters(this.ptr);
53 const ret_hu_conv: CounterpartyChannelTransactionParameters = new CounterpartyChannelTransactionParameters(null, ret);
54 ret_hu_conv.ptrs_to.add(this);
58 public void set_counterparty_parameters(CounterpartyChannelTransactionParameters val) {
59 bindings.ChannelTransactionParameters_set_counterparty_parameters(this.ptr, val == null ? 0 : val.ptr & ~1);
60 this.ptrs_to.add(val);
63 public OutPoint get_funding_outpoint() {
64 number ret = bindings.ChannelTransactionParameters_get_funding_outpoint(this.ptr);
65 const ret_hu_conv: OutPoint = new OutPoint(null, ret);
66 ret_hu_conv.ptrs_to.add(this);
70 public void set_funding_outpoint(OutPoint val) {
71 bindings.ChannelTransactionParameters_set_funding_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1);
72 this.ptrs_to.add(val);
75 public static ChannelTransactionParameters constructor_new(ChannelPublicKeys holder_pubkeys_arg, number holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, CounterpartyChannelTransactionParameters counterparty_parameters_arg, OutPoint funding_outpoint_arg) {
76 number ret = bindings.ChannelTransactionParameters_new(holder_pubkeys_arg == null ? 0 : holder_pubkeys_arg.ptr & ~1, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg == null ? 0 : counterparty_parameters_arg.ptr & ~1, funding_outpoint_arg == null ? 0 : funding_outpoint_arg.ptr & ~1);
77 const ret_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, ret);
78 ret_hu_conv.ptrs_to.add(ret_hu_conv);
79 ret_hu_conv.ptrs_to.add(holder_pubkeys_arg);
80 ret_hu_conv.ptrs_to.add(counterparty_parameters_arg);
81 ret_hu_conv.ptrs_to.add(funding_outpoint_arg);
85 public ChannelTransactionParameters clone() {
86 number ret = bindings.ChannelTransactionParameters_clone(this.ptr);
87 const ret_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, ret);
88 ret_hu_conv.ptrs_to.add(this);
92 public boolean is_populated() {
93 boolean ret = bindings.ChannelTransactionParameters_is_populated(this.ptr);
97 public DirectedChannelTransactionParameters as_holder_broadcastable() {
98 number ret = bindings.ChannelTransactionParameters_as_holder_broadcastable(this.ptr);
99 const ret_hu_conv: DirectedChannelTransactionParameters = new DirectedChannelTransactionParameters(null, ret);
100 ret_hu_conv.ptrs_to.add(this);
104 public DirectedChannelTransactionParameters as_counterparty_broadcastable() {
105 number ret = bindings.ChannelTransactionParameters_as_counterparty_broadcastable(this.ptr);
106 const ret_hu_conv: DirectedChannelTransactionParameters = new DirectedChannelTransactionParameters(null, ret);
107 ret_hu_conv.ptrs_to.add(this);
111 public Uint8Array write() {
112 Uint8Array ret = bindings.ChannelTransactionParameters_write(this.ptr);
116 public static Result_ChannelTransactionParametersDecodeErrorZ constructor_read(Uint8Array ser) {
117 number ret = bindings.ChannelTransactionParameters_read(ser);
118 Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);