Search in sources :

Example 16 with Signer

use of com.github.rosklyar.client.transaction.encode.Signer in project nem-library by rosklyar.

the class SecureTransactionClient method transferNem.

@Override
public NemAnnounceResult transferNem(String privateKey, String toAddress, long microXemAmount, String message, int timeToLiveInSeconds) {
    Signer signer = new DefaultSigner(privateKey);
    String publicKey = signer.publicKey();
    int currentTime = nodeClient.extendedInfo().nisInfo.currentTime;
    Transaction transaction = transferNemTransaction(publicKey, toAddress, microXemAmount, message, currentTime, timeToLiveInSeconds);
    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) ProvisionNamespaceTransaction(com.github.rosklyar.client.transaction.domain.ProvisionNamespaceTransaction) MultisigTransaction(com.github.rosklyar.client.transaction.domain.multisig.MultisigTransaction) ImportanceTransferTransaction(com.github.rosklyar.client.transaction.domain.importance.ImportanceTransferTransaction) Transaction(com.github.rosklyar.client.transaction.domain.Transaction)

Aggregations

RequestAnnounce (com.github.rosklyar.client.transaction.domain.RequestAnnounce)16 DefaultSigner (com.github.rosklyar.client.transaction.encode.DefaultSigner)16 Signer (com.github.rosklyar.client.transaction.encode.Signer)16 ProvisionNamespaceTransaction (com.github.rosklyar.client.transaction.domain.ProvisionNamespaceTransaction)10 ImportanceTransferTransaction (com.github.rosklyar.client.transaction.domain.importance.ImportanceTransferTransaction)10 Transaction (com.github.rosklyar.client.transaction.domain.Transaction)8 MultisigTransaction (com.github.rosklyar.client.transaction.domain.multisig.MultisigTransaction)8 Hash (com.github.rosklyar.client.account.domain.Hash)4 Message (com.github.rosklyar.client.account.domain.Message)3 Levy (com.github.rosklyar.client.mosaic.domain.Levy)3 MosaicProperty (com.github.rosklyar.client.mosaic.domain.MosaicProperty)3 NodeClient (com.github.rosklyar.client.node.NodeClient)3 TransactionType (com.github.rosklyar.client.transaction.TransactionType)3 NemAnnounceResult (com.github.rosklyar.client.transaction.domain.NemAnnounceResult)3 Action (com.github.rosklyar.client.transaction.domain.importance.Action)3 com.github.rosklyar.client.transaction.domain.mosaic (com.github.rosklyar.client.transaction.domain.mosaic)3 Modification (com.github.rosklyar.client.transaction.domain.multisig.Modification)3 ADD_COSIGNATORY (com.github.rosklyar.client.transaction.domain.multisig.ModificationType.ADD_COSIGNATORY)3 REMOVE_COSIGNATORY (com.github.rosklyar.client.transaction.domain.multisig.ModificationType.REMOVE_COSIGNATORY)3 RelativeChange (com.github.rosklyar.client.transaction.domain.multisig.RelativeChange)3