3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class TrustedCommitmentTransaction extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.TrustedCommitmentTransaction_free(this.ptr);
21 public Uint8Array txid() {
22 Uint8Array ret = bindings.TrustedCommitmentTransaction_txid(this.ptr);
26 public BuiltCommitmentTransaction built_transaction() {
27 number ret = bindings.TrustedCommitmentTransaction_built_transaction(this.ptr);
28 const ret_hu_conv: BuiltCommitmentTransaction = new BuiltCommitmentTransaction(null, ret);
29 ret_hu_conv.ptrs_to.add(this);
33 public TxCreationKeys keys() {
34 number ret = bindings.TrustedCommitmentTransaction_keys(this.ptr);
35 const ret_hu_conv: TxCreationKeys = new TxCreationKeys(null, ret);
36 ret_hu_conv.ptrs_to.add(this);
40 public boolean opt_anchors() {
41 boolean ret = bindings.TrustedCommitmentTransaction_opt_anchors(this.ptr);
45 public Result_CVec_SignatureZNoneZ get_htlc_sigs(Uint8Array htlc_base_key, DirectedChannelTransactionParameters channel_parameters) {
46 number ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, InternalUtils.check_arr_len(htlc_base_key, 32), channel_parameters == null ? 0 : channel_parameters.ptr & ~1);
47 Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret);
48 this.ptrs_to.add(channel_parameters);