use of com.github.rosklyar.client.transaction.domain.multisig.Modification in project nem-library by rosklyar.
the class SecureTransactionClient method createMultisigAccount.
@Override
public NemAnnounceResult createMultisigAccount(String privateKey, List<String> cosignatories, int minCosignatories, int timeToLiveInSeconds) {
Signer signer = new DefaultSigner(privateKey);
int currentTime = nodeClient.extendedInfo().nisInfo.currentTime;
List<Modification> modifications = cosignatories.stream().map(publicKey -> new Modification(1, publicKey)).collect(toList());
Transaction transaction = aggregateModificationTransaction(signer.publicKey(), modifications, minCosignatories, currentTime, timeToLiveInSeconds);
byte[] data = transactionEncoder.data(transaction);
return feignTransactionClient.prepare(new RequestAnnounce(hexConverter.getString(data), signer.sign(data)));
}
use of com.github.rosklyar.client.transaction.domain.multisig.Modification 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.domain.multisig.Modification in project nem-library by rosklyar.
the class SecureTransactionClient method removeCosignatoriesFromMultisigAccount.
@Override
public NemAnnounceResult removeCosignatoriesFromMultisigAccount(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(REMOVE_COSIGNATORY.type, cosignatory)).collect(toList());
return modifyMultisigAccountTransaction(signer, modifications, relativeChange, multisigPublicKey, currentTime, timeToLiveInSeconds);
}
Aggregations