]> git.bitcoin.ninja Git - ldk-java/blob - ts/structs/HolderCommitmentTransaction.ts
Merge pull request #50 from TheBlueMatt/main
[ldk-java] / ts / structs / HolderCommitmentTransaction.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 HolderCommitmentTransaction 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.HolderCommitmentTransaction_free(this.ptr);
19                     }
20                 }
21         public Uint8Array get_counterparty_sig() {
22                 Uint8Array ret = bindings.HolderCommitmentTransaction_get_counterparty_sig(this.ptr);
23                 return ret;
24         }
25
26         public void set_counterparty_sig(Uint8Array val) {
27                 bindings.HolderCommitmentTransaction_set_counterparty_sig(this.ptr, val);
28         }
29
30         public void set_counterparty_htlc_sigs(Uint8Array[] val) {
31                 bindings.HolderCommitmentTransaction_set_counterparty_htlc_sigs(this.ptr, val);
32         }
33
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);
38                 return ret_hu_conv;
39         }
40
41         public Uint8Array write() {
42                 Uint8Array ret = bindings.HolderCommitmentTransaction_write(this.ptr);
43                 return ret;
44         }
45
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);
49                 return ret_hu_conv;
50         }
51
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);
56                 return ret_hu_conv;
57         }
58
59 }