syntax = "proto3";

package fetch.aea.MlTrade;

message MlTradeMessage{

    // Custom Types
    message Description{
        bytes description = 1;
    }

    message Query{
        message Nothing {
        }
        oneof query{
            bytes bytes = 1;
            Nothing nothing = 2;
            bytes query_bytes = 3;
        }
    }


    // Performatives and contents
    message Cfp_Performative{
        Query query = 1;
    }

    message Terms_Performative{
        Description terms = 1;
    }

    message Accept_Performative{
        Description terms = 1;
        string tx_digest = 2;
    }

    message Data_Performative{
        Description terms = 1;
        bytes payload = 2;
    }


    // Standard MlTradeMessage fields
    int32 message_id = 1;
    string dialogue_starter_reference = 2;
    string dialogue_responder_reference = 3;
    int32 target = 4;
    oneof performative{
        Accept_Performative accept = 5;
        Cfp_Performative cfp = 6;
        Data_Performative data = 7;
        Terms_Performative terms = 8;
    }
}
