Search in sources :

Example 1 with MultisigTransaction

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

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

the class SecureTransactionClient method multisigTransferNem.

@Override
public NemAnnounceResult multisigTransferNem(String privateKey, String toAddress, long microXemAmount, String message, String multisigPublicKey, int timeToLiveInSeconds) {
    Signer signer = new DefaultSigner(privateKey);
    int currentTime = nodeClient.extendedInfo().nisInfo.currentTime;
    Transaction transferTransaction = transferNemTransaction(multisigPublicKey, toAddress, microXemAmount, 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)

Aggregations

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