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 Uint8Array get_counterparty_sig() {
22 Uint8Array ret = bindings.HolderCommitmentTransaction_get_counterparty_sig(this.ptr);
26 public void set_counterparty_sig(Uint8Array val) {
27 bindings.HolderCommitmentTransaction_set_counterparty_sig(this.ptr, val);
30 public void set_counterparty_htlc_sigs(Uint8Array[] val) {
31 bindings.HolderCommitmentTransaction_set_counterparty_htlc_sigs(this.ptr, val);
34 public HolderCommitmentTransaction clone() {
35 number ret = bindings.HolderCommitmentTransaction_clone(this.ptr);
36 const ret_hu_conv: HolderCommitmentTransaction = new HolderCommitmentTransaction(null, ret);
37 ret_hu_conv.ptrs_to.add(this);
41 public Uint8Array write() {
42 Uint8Array ret = bindings.HolderCommitmentTransaction_write(this.ptr);
46 public static Result_HolderCommitmentTransactionDecodeErrorZ constructor_read(Uint8Array ser) {
47 number ret = bindings.HolderCommitmentTransaction_read(ser);
48 Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
52 public static HolderCommitmentTransaction constructor_new(CommitmentTransaction commitment_tx, Uint8Array counterparty_sig, Uint8Array[] counterparty_htlc_sigs, Uint8Array holder_funding_key, Uint8Array counterparty_funding_key) {
53 number ret = bindings.HolderCommitmentTransaction_new(commitment_tx == null ? 0 : commitment_tx.ptr & ~1, counterparty_sig, counterparty_htlc_sigs, holder_funding_key, counterparty_funding_key);
54 const ret_hu_conv: HolderCommitmentTransaction = new HolderCommitmentTransaction(null, ret);
55 ret_hu_conv.ptrs_to.add(ret_hu_conv);