- public static HolderCommitmentTransaction constructor_read(byte[] ser) {
- long ret = bindings.HolderCommitmentTransaction_read(ser);
+ /**
+ * Create a new holder transaction with the given counterparty signatures.
+ * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
+ */
+ public static HolderCommitmentTransaction of(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 & ~1, counterparty_sig, counterparty_htlc_sigs, holder_funding_key, counterparty_funding_key);
+ if (ret < 1024) { return null; }