3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class CommitmentUpdate extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.CommitmentUpdate_free(this.ptr);
21 public void set_update_add_htlcs(UpdateAddHTLC[] val) {
22 bindings.CommitmentUpdate_set_update_add_htlcs(this.ptr, Arrays.stream(val).map(val_conv_15 -> val_conv_15 == null ? 0 : val_conv_15.ptr & ~1).toArray(number[]::new));
23 /* TODO 2 UpdateAddHTLC */;
26 public void set_update_fulfill_htlcs(UpdateFulfillHTLC[] val) {
27 bindings.CommitmentUpdate_set_update_fulfill_htlcs(this.ptr, Arrays.stream(val).map(val_conv_19 -> val_conv_19 == null ? 0 : val_conv_19.ptr & ~1).toArray(number[]::new));
28 /* TODO 2 UpdateFulfillHTLC */;
31 public void set_update_fail_htlcs(UpdateFailHTLC[] val) {
32 bindings.CommitmentUpdate_set_update_fail_htlcs(this.ptr, Arrays.stream(val).map(val_conv_16 -> val_conv_16 == null ? 0 : val_conv_16.ptr & ~1).toArray(number[]::new));
33 /* TODO 2 UpdateFailHTLC */;
36 public void set_update_fail_malformed_htlcs(UpdateFailMalformedHTLC[] val) {
37 bindings.CommitmentUpdate_set_update_fail_malformed_htlcs(this.ptr, Arrays.stream(val).map(val_conv_25 -> val_conv_25 == null ? 0 : val_conv_25.ptr & ~1).toArray(number[]::new));
38 /* TODO 2 UpdateFailMalformedHTLC */;
41 public UpdateFee get_update_fee() {
42 number ret = bindings.CommitmentUpdate_get_update_fee(this.ptr);
43 const ret_hu_conv: UpdateFee = new UpdateFee(null, ret);
44 ret_hu_conv.ptrs_to.add(this);
48 public void set_update_fee(UpdateFee val) {
49 bindings.CommitmentUpdate_set_update_fee(this.ptr, val == null ? 0 : val.ptr & ~1);
50 this.ptrs_to.add(val);
53 public CommitmentSigned get_commitment_signed() {
54 number ret = bindings.CommitmentUpdate_get_commitment_signed(this.ptr);
55 const ret_hu_conv: CommitmentSigned = new CommitmentSigned(null, ret);
56 ret_hu_conv.ptrs_to.add(this);
60 public void set_commitment_signed(CommitmentSigned val) {
61 bindings.CommitmentUpdate_set_commitment_signed(this.ptr, val == null ? 0 : val.ptr & ~1);
62 this.ptrs_to.add(val);
65 public static CommitmentUpdate constructor_new(UpdateAddHTLC[] update_add_htlcs_arg, UpdateFulfillHTLC[] update_fulfill_htlcs_arg, UpdateFailHTLC[] update_fail_htlcs_arg, UpdateFailMalformedHTLC[] update_fail_malformed_htlcs_arg, UpdateFee update_fee_arg, CommitmentSigned commitment_signed_arg) {
66 number ret = bindings.CommitmentUpdate_new(Arrays.stream(update_add_htlcs_arg).map(update_add_htlcs_arg_conv_15 -> update_add_htlcs_arg_conv_15 == null ? 0 : update_add_htlcs_arg_conv_15.ptr & ~1).toArray(number[]::new), Arrays.stream(update_fulfill_htlcs_arg).map(update_fulfill_htlcs_arg_conv_19 -> update_fulfill_htlcs_arg_conv_19 == null ? 0 : update_fulfill_htlcs_arg_conv_19.ptr & ~1).toArray(number[]::new), Arrays.stream(update_fail_htlcs_arg).map(update_fail_htlcs_arg_conv_16 -> update_fail_htlcs_arg_conv_16 == null ? 0 : update_fail_htlcs_arg_conv_16.ptr & ~1).toArray(number[]::new), Arrays.stream(update_fail_malformed_htlcs_arg).map(update_fail_malformed_htlcs_arg_conv_25 -> update_fail_malformed_htlcs_arg_conv_25 == null ? 0 : update_fail_malformed_htlcs_arg_conv_25.ptr & ~1).toArray(number[]::new), update_fee_arg == null ? 0 : update_fee_arg.ptr & ~1, commitment_signed_arg == null ? 0 : commitment_signed_arg.ptr & ~1);
67 const ret_hu_conv: CommitmentUpdate = new CommitmentUpdate(null, ret);
68 ret_hu_conv.ptrs_to.add(ret_hu_conv);
69 /* TODO 2 UpdateAddHTLC */;
70 /* TODO 2 UpdateFulfillHTLC */;
71 /* TODO 2 UpdateFailHTLC */;
72 /* TODO 2 UpdateFailMalformedHTLC */;
73 ret_hu_conv.ptrs_to.add(update_fee_arg);
74 ret_hu_conv.ptrs_to.add(commitment_signed_arg);
78 public CommitmentUpdate clone() {
79 number ret = bindings.CommitmentUpdate_clone(this.ptr);
80 const ret_hu_conv: CommitmentUpdate = new CommitmentUpdate(null, ret);
81 ret_hu_conv.ptrs_to.add(this);