]> git.bitcoin.ninja Git - ldk-java/blob - ts/structs/TxCreationKeys.ts
Update bindings to latest upstream + ChannelMonitor_clone patch
[ldk-java] / ts / structs / TxCreationKeys.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 TxCreationKeys 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.TxCreationKeys_free(this.ptr);
19                     }
20                 }
21         public Uint8Array get_per_commitment_point() {
22                 Uint8Array ret = bindings.TxCreationKeys_get_per_commitment_point(this.ptr);
23                 return ret;
24         }
25
26         public void set_per_commitment_point(Uint8Array val) {
27                 bindings.TxCreationKeys_set_per_commitment_point(this.ptr, val);
28         }
29
30         public Uint8Array get_revocation_key() {
31                 Uint8Array ret = bindings.TxCreationKeys_get_revocation_key(this.ptr);
32                 return ret;
33         }
34
35         public void set_revocation_key(Uint8Array val) {
36                 bindings.TxCreationKeys_set_revocation_key(this.ptr, val);
37         }
38
39         public Uint8Array get_broadcaster_htlc_key() {
40                 Uint8Array ret = bindings.TxCreationKeys_get_broadcaster_htlc_key(this.ptr);
41                 return ret;
42         }
43
44         public void set_broadcaster_htlc_key(Uint8Array val) {
45                 bindings.TxCreationKeys_set_broadcaster_htlc_key(this.ptr, val);
46         }
47
48         public Uint8Array get_countersignatory_htlc_key() {
49                 Uint8Array ret = bindings.TxCreationKeys_get_countersignatory_htlc_key(this.ptr);
50                 return ret;
51         }
52
53         public void set_countersignatory_htlc_key(Uint8Array val) {
54                 bindings.TxCreationKeys_set_countersignatory_htlc_key(this.ptr, val);
55         }
56
57         public Uint8Array get_broadcaster_delayed_payment_key() {
58                 Uint8Array ret = bindings.TxCreationKeys_get_broadcaster_delayed_payment_key(this.ptr);
59                 return ret;
60         }
61
62         public void set_broadcaster_delayed_payment_key(Uint8Array val) {
63                 bindings.TxCreationKeys_set_broadcaster_delayed_payment_key(this.ptr, val);
64         }
65
66         public static TxCreationKeys constructor_new(Uint8Array per_commitment_point_arg, Uint8Array revocation_key_arg, Uint8Array broadcaster_htlc_key_arg, Uint8Array countersignatory_htlc_key_arg, Uint8Array broadcaster_delayed_payment_key_arg) {
67                 number ret = bindings.TxCreationKeys_new(per_commitment_point_arg, revocation_key_arg, broadcaster_htlc_key_arg, countersignatory_htlc_key_arg, broadcaster_delayed_payment_key_arg);
68                 const ret_hu_conv: TxCreationKeys = new TxCreationKeys(null, ret);
69                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
70                 return ret_hu_conv;
71         }
72
73         public TxCreationKeys clone() {
74                 number ret = bindings.TxCreationKeys_clone(this.ptr);
75                 const ret_hu_conv: TxCreationKeys = new TxCreationKeys(null, ret);
76                 ret_hu_conv.ptrs_to.add(this);
77                 return ret_hu_conv;
78         }
79
80         public Uint8Array write() {
81                 Uint8Array ret = bindings.TxCreationKeys_write(this.ptr);
82                 return ret;
83         }
84
85         public static Result_TxCreationKeysDecodeErrorZ constructor_read(Uint8Array ser) {
86                 number ret = bindings.TxCreationKeys_read(ser);
87                 Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret);
88                 return ret_hu_conv;
89         }
90
91         public static Result_TxCreationKeysErrorZ constructor_derive_new(Uint8Array per_commitment_point, Uint8Array broadcaster_delayed_payment_base, Uint8Array broadcaster_htlc_base, Uint8Array countersignatory_revocation_base, Uint8Array countersignatory_htlc_base) {
92                 number ret = bindings.TxCreationKeys_derive_new(per_commitment_point, broadcaster_delayed_payment_base, broadcaster_htlc_base, countersignatory_revocation_base, countersignatory_htlc_base);
93                 Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret);
94                 return ret_hu_conv;
95         }
96
97         public static Result_TxCreationKeysErrorZ constructor_from_channel_static_keys(Uint8Array per_commitment_point, ChannelPublicKeys broadcaster_keys, ChannelPublicKeys countersignatory_keys) {
98                 number ret = bindings.TxCreationKeys_from_channel_static_keys(per_commitment_point, broadcaster_keys == null ? 0 : broadcaster_keys.ptr & ~1, countersignatory_keys == null ? 0 : countersignatory_keys.ptr & ~1);
99                 Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret);
100                 ret_hu_conv.ptrs_to.add(broadcaster_keys);
101                 ret_hu_conv.ptrs_to.add(countersignatory_keys);
102                 return ret_hu_conv;
103         }
104
105 }