An envelope transaction is a transaction that is executed within an independent group to protect transaction privacy. The smart contract platform allows you to deploy, call, update, and query envelope transactions of a smart contract. Envelope transactions are divided into encrypted envelope transactions and deposit envelope transactions.
Encrypted envelope transaction
Example:
MychainParams params = new MychainParams.Builder()
.gas(BigInteger.valueOf(3000000))
.setEnvelopePublicKey("")
.privateKeyList(adminPrivateKeys)
.setGroupId(groupId) //Specify groupId.
.setType(EnvelopeType.ENCRYPTION) //Specify the envelope type as ENCRYPTION.
.build();
ContractParameters contractParameters = new ContractParameters();
MychainBaseResult<ReplyTransactionReceipt> result = sdk.getContractService()
.deployContract(
DeployContractRequest.build(adminAccount.getIdentity(),
Utils.getIdentityByName(testContractId), contractCode, VMTypeEnum.EVM,contractParameters, BigInteger.ZERO, params));
Deposit envelope transaction
Example:
MychainParams params = new MychainParams.Builder()
.gas(BigInteger.valueOf(3000000))
.setEnvelopePublicKey("")
.privateKeyList(adminPrivateKeys)
.setGroupId(groupId) //Specify groupId.
.setType(EnvelopeType.DEPOSIT) //Specify DEPOSIT as the envelope type.
.build();
ContractParameters contractParameters = new ContractParameters();
MychainBaseResult<ReplyTransactionReceipt> result = sdk.getContractService()
.deployContract(
DeployContractRequest.build(adminAccount.getIdentity(),
Utils.getIdentityByName(testContractId), contractCode, VMTypeEnum.EVM,contractParameters, BigInteger.ZERO, params));