3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class HolderCommitmentTransaction extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.HolderCommitmentTransaction_free(this.ptr);
21 public HolderCommitmentTransaction clone() {
22 number ret = bindings.HolderCommitmentTransaction_clone(this.ptr);
23 const ret_hu_conv: HolderCommitmentTransaction = new HolderCommitmentTransaction(null, ret);
24 ret_hu_conv.ptrs_to.add(this);
28 public Uint8Array get_counterparty_sig() {
29 Uint8Array ret = bindings.HolderCommitmentTransaction_get_counterparty_sig(this.ptr);
33 public void set_counterparty_sig(Uint8Array val) {
34 bindings.HolderCommitmentTransaction_set_counterparty_sig(this.ptr, val);
37 public void set_counterparty_htlc_sigs(Uint8Array[] val) {
38 bindings.HolderCommitmentTransaction_set_counterparty_htlc_sigs(this.ptr, val);
41 public Uint8Array write() {
42 Uint8Array ret = bindings.HolderCommitmentTransaction_write(this.ptr);
46 public static HolderCommitmentTransaction constructor_read(Uint8Array ser) {
47 number ret = bindings.HolderCommitmentTransaction_read(ser);
48 const ret_hu_conv: HolderCommitmentTransaction = new HolderCommitmentTransaction(null, ret);
49 ret_hu_conv.ptrs_to.add(ret_hu_conv);
53 public static HolderCommitmentTransaction constructor_new(CommitmentTransaction commitment_tx, Uint8Array counterparty_sig, Uint8Array[] counterparty_htlc_sigs, Uint8Array holder_funding_key, Uint8Array counterparty_funding_key) {
54 number ret = bindings.HolderCommitmentTransaction_new(commitment_tx == null ? 0 : commitment_tx.ptr & ~1, counterparty_sig, counterparty_htlc_sigs, holder_funding_key, counterparty_funding_key);
55 const ret_hu_conv: HolderCommitmentTransaction = new HolderCommitmentTransaction(null, ret);
56 ret_hu_conv.ptrs_to.add(ret_hu_conv);
57 ret_hu_conv.ptrs_to.add(commitment_tx);