syntax = "proto3";

package types;
option  go_package = "../types";

enum Status {
    True    = 0;
    False   = 1;
    TimeOut = 2;
}

message Req {
    Event event = 1;
}

message Res {
    Event  event  = 1;
    Status status = 2;
}

message Ret {
    Event  event  = 1;
    uint32 status = 2;
}

message Record {
    string ID          = 1;
    string fromChainID = 2;
    string toChainID   = 3;
    Event  event       = 4;
}

message Event {
    string       txID        = 1;
    uint64       blockNumber = 2;
    Contract     contract    = 3;
    MapAssetInfo payload     = 4;
}

enum EventType {
    Lock   = 0;
    Mint   = 1;
    UnLock = 2;
    Burn   = 3;
}

message MapAssetInfo {
    EventType eventType     = 1;
    string    lockAddress   = 4;
    int64     lockAmount    = 5;
    string    mintAddress   = 6;
    int64     mintAmount    = 7;
    string    unlockAddress = 8;
    int64     unlockAmount  = 9;
    string    burnAddress   = 10;
    int64     burnAmount    = 11;
    string    symbol        = 12;
    bytes     extra         = 13;
    int64     height        = 14;
    int64     nonce         = 15;
}

message Contract {
    string chainID    = 1;
    string execName   = 2;
    string address    = 3;
    string callMethod = 4;
}

message EventPair {
    Event fromEvent = 1;
    Event toEvent   = 2;
}
