3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class HTLCOutputInCommitment extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.HTLCOutputInCommitment_free(this.ptr);
21 public boolean get_offered() {
22 boolean ret = bindings.HTLCOutputInCommitment_get_offered(this.ptr);
26 public void set_offered(boolean val) {
27 bindings.HTLCOutputInCommitment_set_offered(this.ptr, val);
30 public number get_amount_msat() {
31 number ret = bindings.HTLCOutputInCommitment_get_amount_msat(this.ptr);
35 public void set_amount_msat(number val) {
36 bindings.HTLCOutputInCommitment_set_amount_msat(this.ptr, val);
39 public number get_cltv_expiry() {
40 number ret = bindings.HTLCOutputInCommitment_get_cltv_expiry(this.ptr);
44 public void set_cltv_expiry(number val) {
45 bindings.HTLCOutputInCommitment_set_cltv_expiry(this.ptr, val);
48 public Uint8Array get_payment_hash() {
49 Uint8Array ret = bindings.HTLCOutputInCommitment_get_payment_hash(this.ptr);
53 public void set_payment_hash(Uint8Array val) {
54 bindings.HTLCOutputInCommitment_set_payment_hash(this.ptr, val);
57 public Option_u32Z get_transaction_output_index() {
58 number ret = bindings.HTLCOutputInCommitment_get_transaction_output_index(this.ptr);
59 Option_u32Z ret_hu_conv = Option_u32Z.constr_from_ptr(ret);
60 ret_hu_conv.ptrs_to.add(this);
64 public void set_transaction_output_index(Option_u32Z val) {
65 bindings.HTLCOutputInCommitment_set_transaction_output_index(this.ptr, val.ptr);
68 public static HTLCOutputInCommitment constructor_new(boolean offered_arg, number amount_msat_arg, number cltv_expiry_arg, Uint8Array payment_hash_arg, Option_u32Z transaction_output_index_arg) {
69 number ret = bindings.HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg, transaction_output_index_arg.ptr);
70 const ret_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, ret);
71 ret_hu_conv.ptrs_to.add(ret_hu_conv);
75 public HTLCOutputInCommitment clone() {
76 number ret = bindings.HTLCOutputInCommitment_clone(this.ptr);
77 const ret_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, ret);
78 ret_hu_conv.ptrs_to.add(this);
82 public Uint8Array write() {
83 Uint8Array ret = bindings.HTLCOutputInCommitment_write(this.ptr);
87 public static Result_HTLCOutputInCommitmentDecodeErrorZ constructor_read(Uint8Array ser) {
88 number ret = bindings.HTLCOutputInCommitment_read(ser);
89 Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret);