Package com.casper.sdk.helper
Class CasperDeployHelper
- java.lang.Object
-
- com.casper.sdk.helper.CasperDeployHelper
-
public class CasperDeployHelper extends java.lang.ObjectDeploy Service class implementing the process to generate deploys- Since:
- 0.2.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static DeploybuildDeploy(AbstractPrivateKey fromPrivateKey, java.lang.String chainName, ExecutableDeployItem session, ModuleBytes payment, java.lang.Long gasPrice, Ttl ttl, java.util.Date date, java.util.List<Digest> dependencies)Core method to fully build a deploystatic DeployHeaderbuildDeployHeader(PublicKey fromPublicKey, java.lang.String chainName, java.lang.Long gasPrice, Ttl ttl, java.util.Date date, java.util.List<Digest> dependencies, byte[] bodyHash)static byte[]getDeployItemAndModuleBytesHash(ExecutableDeployItem deployItem, ModuleBytes moduleBytes)static ModuleBytesgetPaymentModuleBytes(java.math.BigInteger paymentAmount)static com.casper.sdk.helper.CasperDeployHelper.HashAndSignaturesignDeployHeader(AbstractPrivateKey privateKey, DeployHeader deployHeader)Deprecated.UseAbstractTransaction.sign(AbstractPrivateKey)instead
-
-
-
Method Detail
-
buildDeployHeader
public static DeployHeader buildDeployHeader(PublicKey fromPublicKey, java.lang.String chainName, java.lang.Long gasPrice, Ttl ttl, java.util.Date date, java.util.List<Digest> dependencies, byte[] bodyHash)
-
signDeployHeader
@Deprecated public static com.casper.sdk.helper.CasperDeployHelper.HashAndSignature signDeployHeader(AbstractPrivateKey privateKey, DeployHeader deployHeader) throws java.security.GeneralSecurityException, NoSuchTypeException, ValueSerializationException
Deprecated.UseAbstractTransaction.sign(AbstractPrivateKey)insteadSigns a deploy header.- Throws:
java.security.GeneralSecurityExceptionNoSuchTypeExceptionValueSerializationException
-
getDeployItemAndModuleBytesHash
public static byte[] getDeployItemAndModuleBytesHash(ExecutableDeployItem deployItem, ModuleBytes moduleBytes) throws NoSuchTypeException, ValueSerializationException
-
getPaymentModuleBytes
public static ModuleBytes getPaymentModuleBytes(java.math.BigInteger paymentAmount) throws ValueSerializationException
- Throws:
ValueSerializationException
-
buildDeploy
public static Deploy buildDeploy(AbstractPrivateKey fromPrivateKey, java.lang.String chainName, ExecutableDeployItem session, ModuleBytes payment, java.lang.Long gasPrice, Ttl ttl, java.util.Date date, java.util.List<Digest> dependencies) throws NoSuchTypeException, ValueSerializationException
Core method to fully build a deploy- Parameters:
fromPrivateKey- private key of the senderchainName- name of chainsession- item to deploy ExecutableDeployItemspayment- Module bytes as another ExecuteDeployItemsgasPrice- gasPrice for native transfers can be set to 1ttl- time to live in milliseconds (default value is 1800000 ms (30 minutes))date- deploy datedependencies- list of digest dependencies- Returns:
- the built deploy
- Throws:
NoSuchTypeExceptionValueSerializationException
-
-