use of com.github.rosklyar.client.transaction.domain.RequestAnnounce 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)));
}
use of com.github.rosklyar.client.transaction.domain.RequestAnnounce in project nem-library by rosklyar.
the class SecureTransactionClient method createMosaic.
@Override
public NemAnnounceResult createMosaic(String privateKey, MosaicId mosaicId, String mosaicDescription, MosaicProperties mosaicProperties, Levy levy, int timeToLiveInSeconds) {
Signer signer = new DefaultSigner(privateKey);
int currentTime = nodeClient.extendedInfo().nisInfo.currentTime;
String publicKey = signer.publicKey();
MosaicDefinitionCreationTransaction mosaicDefinitionCreationTransaction = mosaicDefinitionCreationTransaction(mosaicId, mosaicDescription, mosaicProperties, levy, publicKey, currentTime, timeToLiveInSeconds);
byte[] data = transactionEncoder.data(mosaicDefinitionCreationTransaction);
return feignTransactionClient.prepare(new RequestAnnounce(hexConverter.getString(data), signer.sign(data)));
}
use of com.github.rosklyar.client.transaction.domain.RequestAnnounce in project nem-library by rosklyar.
the class SecureTransactionClient method multisigCreateNamespace.
@Override
public NemAnnounceResult multisigCreateNamespace(String privateKey, String parentNamespace, String namespace, String multisigPublicKey, int timeToLiveInSeconds) {
Signer signer = new DefaultSigner(privateKey);
int currentTime = nodeClient.extendedInfo().nisInfo.currentTime;
ProvisionNamespaceTransaction provisionNamespaceTransaction = provisionNamespaceTransaction(multisigPublicKey, parentNamespace, namespace, currentTime, timeToLiveInSeconds);
MultisigTransaction<ProvisionNamespaceTransaction> transaction = MultisigTransaction.<ProvisionNamespaceTransaction>builder().type(MULTISIG_TRANSACTION.type).version(versionProvider.version(network, MULTISIG_TRANSACTION)).timeStamp(currentTime).signer(signer.publicKey()).fee(feeCalculator.multisigTransactionFee()).deadline(currentTime + timeToLiveInSeconds).otherTrans(provisionNamespaceTransaction).build();
byte[] data = transactionEncoder.dataMultisigProvisionNamespace(transaction);
return feignTransactionClient.prepare(new RequestAnnounce(hexConverter.getString(data), signer.sign(data)));
}
use of com.github.rosklyar.client.transaction.domain.RequestAnnounce 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)));
}
use of com.github.rosklyar.client.transaction.domain.RequestAnnounce 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)));
}
Aggregations