3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class BuiltCommitmentTransaction extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.BuiltCommitmentTransaction_free(this.ptr);
21 public Uint8Array get_transaction() {
22 Uint8Array ret = bindings.BuiltCommitmentTransaction_get_transaction(this.ptr);
26 public void set_transaction(Uint8Array val) {
27 bindings.BuiltCommitmentTransaction_set_transaction(this.ptr, val);
30 public Uint8Array get_txid() {
31 Uint8Array ret = bindings.BuiltCommitmentTransaction_get_txid(this.ptr);
35 public void set_txid(Uint8Array val) {
36 bindings.BuiltCommitmentTransaction_set_txid(this.ptr, val);
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);
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);
53 public Uint8Array write() {
54 Uint8Array ret = bindings.BuiltCommitmentTransaction_write(this.ptr);
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);
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);
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);