All Products
Search
Document Center

Envelope Transaction Interfaces

Last Updated: Jan 09, 2020

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:

  1. MychainParams params = new MychainParams.Builder()
  2. .gas(BigInteger.valueOf(3000000))
  3. .setEnvelopePublicKey("")
  4. .privateKeyList(adminPrivateKeys)
  5. .setGroupId(groupId) //Specify groupId.
  6. .setType(EnvelopeType.ENCRYPTION) //Specify the envelope type as ENCRYPTION.
  7. .build();
  8. ContractParameters contractParameters = new ContractParameters();
  9. MychainBaseResult<ReplyTransactionReceipt> result = sdk.getContractService()
  10. .deployContract(
  11. DeployContractRequest.build(adminAccount.getIdentity(),
  12. Utils.getIdentityByName(testContractId), contractCode, VMTypeEnum.EVM,contractParameters, BigInteger.ZERO, params));

Deposit envelope transaction

Example:

  1. MychainParams params = new MychainParams.Builder()
  2. .gas(BigInteger.valueOf(3000000))
  3. .setEnvelopePublicKey("")
  4. .privateKeyList(adminPrivateKeys)
  5. .setGroupId(groupId) //Specify groupId.
  6. .setType(EnvelopeType.DEPOSIT) //Specify DEPOSIT as the envelope type.
  7. .build();
  8. ContractParameters contractParameters = new ContractParameters();
  9. MychainBaseResult<ReplyTransactionReceipt> result = sdk.getContractService()
  10. .deployContract(
  11. DeployContractRequest.build(adminAccount.getIdentity(),
  12. Utils.getIdentityByName(testContractId), contractCode, VMTypeEnum.EVM,contractParameters, BigInteger.ZERO, params));