use of com.github.rosklyar.client.account.domain.Hash in project nem-library by rosklyar.
the class SecureTransactionClient method cosignTransaction.
@Override
public NemAnnounceResult cosignTransaction(String privateKey, String transactionHash, String multisigAddress, int timeToLiveInSeconds) {
Signer signer = new DefaultSigner(privateKey);
int currentTime = nodeClient.extendedInfo().nisInfo.currentTime;
Transaction transaction = Transaction.builder().type(MULTISIG_SIGNATURE.type).version(versionProvider.version(network, MULTISIG_SIGNATURE)).timeStamp(currentTime).signer(signer.publicKey()).fee(feeCalculator.cosigningFee()).deadline(currentTime + timeToLiveInSeconds).otherAccount(multisigAddress).otherHash(new Hash(transactionHash)).build();
byte[] data = transactionEncoder.data(transaction);
return feignTransactionClient.prepare(new RequestAnnounce(hexConverter.getString(data), signer.sign(data)));
}
Aggregations