]> git.bitcoin.ninja Git - ldk-java/blob - ts/structs/BuiltCommitmentTransaction.ts
Update CI references to LDK 0.0.125
[ldk-java] / ts / structs / BuiltCommitmentTransaction.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 BuiltCommitmentTransaction 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.BuiltCommitmentTransaction_free(this.ptr);
19                     }
20                 }
21         public Uint8Array get_transaction() {
22                 Uint8Array ret = bindings.BuiltCommitmentTransaction_get_transaction(this.ptr);
23                 return ret;
24         }
25
26         public void set_transaction(Uint8Array val) {
27                 bindings.BuiltCommitmentTransaction_set_transaction(this.ptr, val);
28         }
29
30         public Uint8Array get_txid() {
31                 Uint8Array ret = bindings.BuiltCommitmentTransaction_get_txid(this.ptr);
32                 return ret;
33         }
34
35         public void set_txid(Uint8Array val) {
36                 bindings.BuiltCommitmentTransaction_set_txid(this.ptr, val);
37         }
38
39         public static BuiltCommitmentTransaction constructor_new(Uint8Array transaction_arg, Uint8Array txid_arg) {
40                 number ret = bindings.BuiltCommitmentTransaction_new(transaction_arg, txid_arg);
41                 const ret_hu_conv: BuiltCommitmentTransaction = new BuiltCommitmentTransaction(null, ret);
42                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
43                 return ret_hu_conv;
44         }
45
46         public BuiltCommitmentTransaction clone() {
47                 number ret = bindings.BuiltCommitmentTransaction_clone(this.ptr);
48                 const ret_hu_conv: BuiltCommitmentTransaction = new BuiltCommitmentTransaction(null, ret);
49                 ret_hu_conv.ptrs_to.add(this);
50                 return ret_hu_conv;
51         }
52
53         public Uint8Array write() {
54                 Uint8Array ret = bindings.BuiltCommitmentTransaction_write(this.ptr);
55                 return ret;
56         }
57
58         public static Result_BuiltCommitmentTransactionDecodeErrorZ constructor_read(Uint8Array ser) {
59                 number ret = bindings.BuiltCommitmentTransaction_read(ser);
60                 Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
61                 return ret_hu_conv;
62         }
63
64         public Uint8Array get_sighash_all(Uint8Array funding_redeemscript, number channel_value_satoshis) {
65                 Uint8Array ret = bindings.BuiltCommitmentTransaction_get_sighash_all(this.ptr, funding_redeemscript, channel_value_satoshis);
66                 return ret;
67         }
68
69         public Uint8Array sign(Uint8Array funding_key, Uint8Array funding_redeemscript, number channel_value_satoshis) {
70                 Uint8Array ret = bindings.BuiltCommitmentTransaction_sign(this.ptr, funding_key, funding_redeemscript, channel_value_satoshis);
71                 return ret;
72         }
73
74 }