* Our counterparty's signature for the transaction
*/
public byte[] get_counterparty_sig() {
- byte[] ret = bindings.HolderCommitmentTransaction_get_counterparty_sig(this.ptr);
+ long ret = bindings.HolderCommitmentTransaction_get_counterparty_sig(this.ptr);
GC.KeepAlive(this);
- return ret;
+ if (ret >= 0 && ret <= 4096) { return null; }
+ byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
+ return ret_conv;
}
/**
* Our counterparty's signature for the transaction
*/
public void set_counterparty_sig(byte[] val) {
- bindings.HolderCommitmentTransaction_set_counterparty_sig(this.ptr, InternalUtils.check_arr_len(val, 64));
+ bindings.HolderCommitmentTransaction_set_counterparty_sig(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 64)));
GC.KeepAlive(this);
GC.KeepAlive(val);
}
* Returns a copy of the field.
*/
public byte[][] get_counterparty_htlc_sigs() {
- byte[][] ret = bindings.HolderCommitmentTransaction_get_counterparty_htlc_sigs(this.ptr);
+ long ret = bindings.HolderCommitmentTransaction_get_counterparty_htlc_sigs(this.ptr);
GC.KeepAlive(this);
- return ret;
+ if (ret >= 0 && ret <= 4096) { return null; }
+ int ret_conv_8_len = InternalUtils.getArrayLength(ret);
+ byte[][] ret_conv_8_arr = new byte[ret_conv_8_len][];
+ for (int i = 0; i < ret_conv_8_len; i++) {
+ long ret_conv_8 = InternalUtils.getU64ArrayElem(ret, i);
+ byte[] ret_conv_8_conv = InternalUtils.decodeUint8Array(ret_conv_8);
+ ret_conv_8_arr[i] = ret_conv_8_conv;
+ }
+ bindings.free_buffer(ret);
+ return ret_conv_8_arr;
}
/**
* All non-dust counterparty HTLC signatures, in the order they appear in the transaction
*/
public void set_counterparty_htlc_sigs(byte[][] val) {
- bindings.HolderCommitmentTransaction_set_counterparty_htlc_sigs(this.ptr, val != null ? InternalUtils.mapArray(val, val_conv_8 => InternalUtils.check_arr_len(val_conv_8, 64)) : null);
+ bindings.HolderCommitmentTransaction_set_counterparty_htlc_sigs(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val_conv_8, 64)))));
GC.KeepAlive(this);
GC.KeepAlive(val);
}
* Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
*/
public byte[] write() {
- byte[] ret = bindings.HolderCommitmentTransaction_write(this.ptr);
+ long ret = bindings.HolderCommitmentTransaction_write(this.ptr);
GC.KeepAlive(this);
- return ret;
+ if (ret >= 0 && ret <= 4096) { return null; }
+ byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
+ return ret_conv;
}
/**
* Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
*/
public static Result_HolderCommitmentTransactionDecodeErrorZ read(byte[] ser) {
- long ret = bindings.HolderCommitmentTransaction_read(ser);
+ long ret = bindings.HolderCommitmentTransaction_read(InternalUtils.encodeUint8Array(ser));
GC.KeepAlive(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
* The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
*/
public static HolderCommitmentTransaction of(org.ldk.structs.CommitmentTransaction commitment_tx, byte[] counterparty_sig, byte[][] counterparty_htlc_sigs, byte[] holder_funding_key, byte[] counterparty_funding_key) {
- long ret = bindings.HolderCommitmentTransaction_new(commitment_tx == null ? 0 : commitment_tx.ptr, InternalUtils.check_arr_len(counterparty_sig, 64), counterparty_htlc_sigs != null ? InternalUtils.mapArray(counterparty_htlc_sigs, counterparty_htlc_sigs_conv_8 => InternalUtils.check_arr_len(counterparty_htlc_sigs_conv_8, 64)) : null, InternalUtils.check_arr_len(holder_funding_key, 33), InternalUtils.check_arr_len(counterparty_funding_key, 33));
+ long ret = bindings.HolderCommitmentTransaction_new(commitment_tx == null ? 0 : commitment_tx.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_sig, 64)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(counterparty_htlc_sigs, counterparty_htlc_sigs_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_htlc_sigs_conv_8, 64)))), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(holder_funding_key, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_funding_key, 33)));
GC.KeepAlive(commitment_tx);
GC.KeepAlive(counterparty_sig);
GC.KeepAlive(counterparty_htlc_sigs);