3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class TxCreationKeys extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.TxCreationKeys_free(this.ptr);
21 public Uint8Array get_per_commitment_point() {
22 Uint8Array ret = bindings.TxCreationKeys_get_per_commitment_point(this.ptr);
26 public void set_per_commitment_point(Uint8Array val) {
27 bindings.TxCreationKeys_set_per_commitment_point(this.ptr, val);
30 public Uint8Array get_revocation_key() {
31 Uint8Array ret = bindings.TxCreationKeys_get_revocation_key(this.ptr);
35 public void set_revocation_key(Uint8Array val) {
36 bindings.TxCreationKeys_set_revocation_key(this.ptr, val);
39 public Uint8Array get_broadcaster_htlc_key() {
40 Uint8Array ret = bindings.TxCreationKeys_get_broadcaster_htlc_key(this.ptr);
44 public void set_broadcaster_htlc_key(Uint8Array val) {
45 bindings.TxCreationKeys_set_broadcaster_htlc_key(this.ptr, val);
48 public Uint8Array get_countersignatory_htlc_key() {
49 Uint8Array ret = bindings.TxCreationKeys_get_countersignatory_htlc_key(this.ptr);
53 public void set_countersignatory_htlc_key(Uint8Array val) {
54 bindings.TxCreationKeys_set_countersignatory_htlc_key(this.ptr, val);
57 public Uint8Array get_broadcaster_delayed_payment_key() {
58 Uint8Array ret = bindings.TxCreationKeys_get_broadcaster_delayed_payment_key(this.ptr);
62 public void set_broadcaster_delayed_payment_key(Uint8Array val) {
63 bindings.TxCreationKeys_set_broadcaster_delayed_payment_key(this.ptr, val);
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);
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);
80 public Uint8Array write() {
81 Uint8Array ret = bindings.TxCreationKeys_write(this.ptr);
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);
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);
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);