use of com.github.rosklyar.client.transaction.domain.ProvisionNamespaceTransaction in project nem-library by rosklyar.
the class SecureTransactionClient method createNamespace.
@Override
public NemAnnounceResult createNamespace(String privateKey, String parentNamespace, String namespace, int timeToLiveInSeconds) {
Signer signer = new DefaultSigner(privateKey);
int currentTime = nodeClient.extendedInfo().nisInfo.currentTime;
ProvisionNamespaceTransaction transaction = provisionNamespaceTransaction(signer.publicKey(), parentNamespace, namespace, 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.ProvisionNamespaceTransaction 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)));
}
Aggregations