/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

syntax = "proto3";

package resdb.contract;

import "proto/contract/func_params.proto";
import "proto/contract/contract.proto";
import "proto/contract/account.proto";

message Request {
    enum CMD {
        NONE = 0;
        CREATE_ACCOUNT = 1; // deploy contract
        DEPLOY = 2; // deploy contract
        EXECUTE = 3; // execute contract
        GETBALANCE = 4; // get balance directly (key-value)
        SETBALANCE = 5; // set balance directly (key-value)
    };

    CMD cmd = 1;

    // for smart-contract
    string caller_address = 2;
    optional DeployInfo deploy_info = 3;
    optional string contract_address = 4;
    optional Params func_params = 5;

    // for key-value
    optional string account = 6;
    // hex string
    optional string balance = 7;
}



message Response {
  int32 ret = 1;
  optional Account account = 2;
  optional Contract contract = 3;
  optional string res = 4;
}
