syntax = "proto3";

package aea.valory.contract_api.v1_0_0;

message ContractApiMessage{

  // Custom Types
  message Kwargs{
    bytes kwargs = 1;
  }

  message RawMessage{
    bytes raw_message = 1;
  }

  message RawTransaction{
    bytes raw_transaction = 1;
  }

  message State{
    bytes state = 1;
  }


  // Performatives and contents
  message Get_Deploy_Transaction_Performative{
    string ledger_id = 1;
    string contract_id = 2;
    string callable = 3;
    Kwargs kwargs = 4;
  }

  message Get_Raw_Transaction_Performative{
    string ledger_id = 1;
    string contract_id = 2;
    string contract_address = 3;
    string callable = 4;
    Kwargs kwargs = 5;
  }

  message Get_Raw_Message_Performative{
    string ledger_id = 1;
    string contract_id = 2;
    string contract_address = 3;
    string callable = 4;
    Kwargs kwargs = 5;
  }

  message Get_State_Performative{
    string ledger_id = 1;
    string contract_id = 2;
    string contract_address = 3;
    string callable = 4;
    Kwargs kwargs = 5;
  }

  message State_Performative{
    State state = 1;
  }

  message Raw_Transaction_Performative{
    RawTransaction raw_transaction = 1;
  }

  message Raw_Message_Performative{
    RawMessage raw_message = 1;
  }

  message Error_Performative{
    int32 code = 1;
    bool code_is_set = 2;
    string message = 3;
    bool message_is_set = 4;
    bytes data = 5;
  }


  oneof performative{
    Error_Performative error = 5;
    Get_Deploy_Transaction_Performative get_deploy_transaction = 6;
    Get_Raw_Message_Performative get_raw_message = 7;
    Get_Raw_Transaction_Performative get_raw_transaction = 8;
    Get_State_Performative get_state = 9;
    Raw_Message_Performative raw_message = 10;
    Raw_Transaction_Performative raw_transaction = 11;
    State_Performative state = 12;
  }
}
