Search in sources :

Example 6 with RequestAnnounce

use of com.github.rosklyar.client.transaction.domain.RequestAnnounce 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 7 with RequestAnnounce

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

the class SecureTransactionClient method multisigChangeMosaicSupply.

@Override
public NemAnnounceResult multisigChangeMosaicSupply(String privateKey, MosaicId mosaicId, SupplyType supplyType, long amount, String multisigPublicKey, int timeToLiveInSeconds) {
    Signer signer = new DefaultSigner(privateKey);
    int currentTime = nodeClient.extendedInfo().nisInfo.currentTime;
    MosaicSupplyChangeTransaction supplyChangeTransaction = mosaicSupplyChangeTransaction(mosaicId, supplyType, amount, multisigPublicKey, currentTime, timeToLiveInSeconds);
    MultisigTransaction<MosaicSupplyChangeTransaction> transaction = MultisigTransaction.<MosaicSupplyChangeTransaction>builder().type(MULTISIG_TRANSACTION.type).version(versionProvider.version(network, MULTISIG_TRANSACTION)).timeStamp(currentTime).signer(signer.publicKey()).fee(feeCalculator.multisigTransactionFee()).deadline(currentTime + timeToLiveInSeconds).otherTrans(supplyChangeTransaction).build();
    byte[] data = transactionEncoder.dataMultisigMosaicSupplyChange(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)

Example 8 with RequestAnnounce

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

the class SecureTransactionClient method multisigTransferMosaics.

@Override
public NemAnnounceResult multisigTransferMosaics(String privateKey, String toAddress, List<MosaicTransfer> mosaics, int times, String message, String multisigPublicKey, int timeToLiveInSeconds) {
    Signer signer = new DefaultSigner(privateKey);
    int currentTime = nodeClient.extendedInfo().nisInfo.currentTime;
    Transaction transferTransaction = mosaicsTransferTransaction(multisigPublicKey, toAddress, mosaics, times, message, currentTime, timeToLiveInSeconds);
    MultisigTransaction<Transaction> transaction = MultisigTransaction.<Transaction>builder().type(MULTISIG_TRANSACTION.type).version(versionProvider.version(network, MULTISIG_TRANSACTION)).timeStamp(currentTime).signer(signer.publicKey()).fee(feeCalculator.multisigTransactionFee()).deadline(currentTime + timeToLiveInSeconds).otherTrans(transferTransaction).build();
    byte[] data = transactionEncoder.dataMultisigTransfer(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)

Example 9 with RequestAnnounce

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

the class SecureTransactionClient method transferMosaics.

@Override
public NemAnnounceResult transferMosaics(String privateKey, String toAddress, List<MosaicTransfer> mosaics, int times, String message, int timeToLiveInSeconds) {
    Signer signer = new DefaultSigner(privateKey);
    String publicKey = signer.publicKey();
    int currentTime = nodeClient.extendedInfo().nisInfo.currentTime;
    Transaction transaction = mosaicsTransferTransaction(publicKey, toAddress, mosaics, times, 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)

Example 10 with RequestAnnounce

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

the class SecureTransactionClient method modifyMultisigAccountTransaction.

private NemAnnounceResult modifyMultisigAccountTransaction(Signer signer, List<Modification> modifications, int relativeChange, String multisigPublicKey, int currentTime, int timeToLiveInSeconds) {
    Transaction modificationTransaction = aggregateModificationTransaction(multisigPublicKey, modifications, relativeChange, currentTime, timeToLiveInSeconds);
    Transaction transaction = Transaction.builder().type(MULTISIG_TRANSACTION.type).version(versionProvider.version(network, MULTISIG_TRANSACTION)).timeStamp(currentTime).signer(signer.publicKey()).fee(feeCalculator.multisigTransactionFee()).deadline(currentTime + timeToLiveInSeconds).otherTrans(modificationTransaction).build();
    byte[] data = transactionEncoder.data(transaction);
    return feignTransactionClient.prepare(new RequestAnnounce(hexConverter.getString(data), signer.sign(data)));
}
Also used : 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)15 DefaultSigner (com.github.rosklyar.client.transaction.encode.DefaultSigner)14 Signer (com.github.rosklyar.client.transaction.encode.Signer)14 ProvisionNamespaceTransaction (com.github.rosklyar.client.transaction.domain.ProvisionNamespaceTransaction)9 ImportanceTransferTransaction (com.github.rosklyar.client.transaction.domain.importance.ImportanceTransferTransaction)9 Transaction (com.github.rosklyar.client.transaction.domain.Transaction)7 MultisigTransaction (com.github.rosklyar.client.transaction.domain.multisig.MultisigTransaction)7 Hash (com.github.rosklyar.client.account.domain.Hash)2 Message (com.github.rosklyar.client.account.domain.Message)1 Levy (com.github.rosklyar.client.mosaic.domain.Levy)1 MosaicProperty (com.github.rosklyar.client.mosaic.domain.MosaicProperty)1 NodeClient (com.github.rosklyar.client.node.NodeClient)1 TransactionType (com.github.rosklyar.client.transaction.TransactionType)1 NemAnnounceResult (com.github.rosklyar.client.transaction.domain.NemAnnounceResult)1 Action (com.github.rosklyar.client.transaction.domain.importance.Action)1 com.github.rosklyar.client.transaction.domain.mosaic (com.github.rosklyar.client.transaction.domain.mosaic)1 Modification (com.github.rosklyar.client.transaction.domain.multisig.Modification)1 ADD_COSIGNATORY (com.github.rosklyar.client.transaction.domain.multisig.ModificationType.ADD_COSIGNATORY)1 REMOVE_COSIGNATORY (com.github.rosklyar.client.transaction.domain.multisig.ModificationType.REMOVE_COSIGNATORY)1 RelativeChange (com.github.rosklyar.client.transaction.domain.multisig.RelativeChange)1