forCreatingContract static method

XdrHostFunction forCreatingContract(
  1. XdrSCAddress address,
  2. XdrUint256 salt,
  3. String wasmId
)

Implementation

static XdrHostFunction forCreatingContract(
    XdrSCAddress address, XdrUint256 salt, String wasmId) {
  XdrHostFunction result =
      XdrHostFunction(XdrHostFunctionType.HOST_FUNCTION_TYPE_CREATE_CONTRACT);
  XdrContractIDPreimage cId = XdrContractIDPreimage(
      XdrContractIDPreimageType.CONTRACT_ID_PREIMAGE_FROM_ADDRESS);
  cId.address = address;
  cId.salt = salt;
  XdrContractExecutable cCode = XdrContractExecutable(
      XdrContractExecutableType.CONTRACT_EXECUTABLE_WASM);
  cCode.wasmHash = XdrHash(Util.hexToBytes(wasmId));
  result.createContract = XdrCreateContractArgs(cId, cCode);
  return result;
}