Search in sources :

Example 1 with ImportanceTransferTransaction

use of com.github.rosklyar.client.transaction.domain.importance.ImportanceTransferTransaction in project nem-library by rosklyar.

the class SecureTransactionClient method multisigImportanceTransfer.

@Override
public NemAnnounceResult multisigImportanceTransfer(String privateKey, Action action, String remoteAccountPublicKey, String multisigPublicKey, int timeToLiveInSeconds) {
    Signer signer = new DefaultSigner(privateKey);
    int currentTime = nodeClient.extendedInfo().nisInfo.currentTime;
    String publicKey = signer.publicKey();
    ImportanceTransferTransaction importanceTransferTransaction = importanceTransferTransaction(action, remoteAccountPublicKey, timeToLiveInSeconds, currentTime, publicKey);
    MultisigTransaction<ImportanceTransferTransaction> transaction = MultisigTransaction.<ImportanceTransferTransaction>builder().type(MULTISIG_TRANSACTION.type).version(versionProvider.version(network, MULTISIG_TRANSACTION)).timeStamp(currentTime).signer(signer.publicKey()).fee(feeCalculator.multisigTransactionFee()).deadline(currentTime + timeToLiveInSeconds).otherTrans(importanceTransferTransaction).build();
    byte[] data = transactionEncoder.dataMultisigImportanceTransfer(transaction);
    return feignTransactionClient.prepare(new RequestAnnounce(hexConverter.getString(data), signer.sign(data)));
}
Also used : DefaultSigner(com.github.rosklyar.client.transaction.encode.DefaultSigner) Signer(com.github.rosklyar.client.transaction.encode.Signer) DefaultSigner(com.github.rosklyar.client.transaction.encode.DefaultSigner) RequestAnnounce(com.github.rosklyar.client.transaction.domain.RequestAnnounce) ImportanceTransferTransaction(com.github.rosklyar.client.transaction.domain.importance.ImportanceTransferTransaction)

Example 2 with ImportanceTransferTransaction

use of com.github.rosklyar.client.transaction.domain.importance.ImportanceTransferTransaction in project nem-library by rosklyar.

the class SecureTransactionClient method importanceTransfer.

@Override
public NemAnnounceResult importanceTransfer(String privateKey, Action action, String remoteAccountPublicKey, int timeToLiveInSeconds) {
    Signer signer = new DefaultSigner(privateKey);
    int currentTime = nodeClient.extendedInfo().nisInfo.currentTime;
    String publicKey = signer.publicKey();
    ImportanceTransferTransaction transaction = importanceTransferTransaction(action, remoteAccountPublicKey, timeToLiveInSeconds, currentTime, publicKey);
    byte[] data = transactionEncoder.data(transaction);
    return feignTransactionClient.prepare(new RequestAnnounce(hexConverter.getString(data), signer.sign(data)));
}
Also used : DefaultSigner(com.github.rosklyar.client.transaction.encode.DefaultSigner) Signer(com.github.rosklyar.client.transaction.encode.Signer) DefaultSigner(com.github.rosklyar.client.transaction.encode.DefaultSigner) RequestAnnounce(com.github.rosklyar.client.transaction.domain.RequestAnnounce) ImportanceTransferTransaction(com.github.rosklyar.client.transaction.domain.importance.ImportanceTransferTransaction)

Aggregations

RequestAnnounce (com.github.rosklyar.client.transaction.domain.RequestAnnounce)2 ImportanceTransferTransaction (com.github.rosklyar.client.transaction.domain.importance.ImportanceTransferTransaction)2 DefaultSigner (com.github.rosklyar.client.transaction.encode.DefaultSigner)2 Signer (com.github.rosklyar.client.transaction.encode.Signer)2