]> git.bitcoin.ninja Git - ldk-java/blob - ts/structs/TrustedCommitmentTransaction.ts
Merge pull request #69 from TheBlueMatt/main
[ldk-java] / ts / structs / TrustedCommitmentTransaction.ts
1
2             
3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
5
6
7
8             export default class TrustedCommitmentTransaction extends CommonBase {
9                 constructor(_dummy: object, ptr: number) {
10                     super(ptr);
11                 }
12
13                 
14                 protected finalize() {
15                     super.finalize();
16
17                     if (this.ptr != 0) {
18                         bindings.TrustedCommitmentTransaction_free(this.ptr);
19                     }
20                 }
21         public Uint8Array txid() {
22                 Uint8Array ret = bindings.TrustedCommitmentTransaction_txid(this.ptr);
23                 return ret;
24         }
25
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);
30                 return ret_hu_conv;
31         }
32
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);
37                 return ret_hu_conv;
38         }
39
40         public boolean opt_anchors() {
41                 boolean ret = bindings.TrustedCommitmentTransaction_opt_anchors(this.ptr);
42                 return ret;
43         }
44
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);
49                 return ret_hu_conv;
50         }
51
52 }