use of com.github.rosklyar.client.transaction.encode.Signer 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)));
}
use of com.github.rosklyar.client.transaction.encode.Signer 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)));
}
use of com.github.rosklyar.client.transaction.encode.Signer in project nem-library by rosklyar.
the class SecureTransactionClient method addCosignatoriesToMultisigAccount.
@Override
public NemAnnounceResult addCosignatoriesToMultisigAccount(String privateKey, List<String> cosignatories, int relativeChange, String multisigPublicKey, int timeToLiveInSeconds) {
Signer signer = new DefaultSigner(privateKey);
int currentTime = nodeClient.extendedInfo().nisInfo.currentTime;
List<Modification> modifications = cosignatories.stream().map(cosignatory -> new Modification(ADD_COSIGNATORY.type, cosignatory)).collect(toList());
return modifyMultisigAccountTransaction(signer, modifications, relativeChange, multisigPublicKey, currentTime, timeToLiveInSeconds);
}
use of com.github.rosklyar.client.transaction.encode.Signer 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)));
}
use of com.github.rosklyar.client.transaction.encode.Signer 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)));
}
Aggregations