What I've learnt from MEXC web service that used google protobuf (There are not enough resources on the internet yet)
Zaw Htut Win

Zaw Htut Win @zawhtutwin

About: Developer, Code Poet

Location:
Yangon
Joined:
Jun 4, 2021

What I've learnt from MEXC web service that used google protobuf (There are not enough resources on the internet yet)

Publish Date: Jul 2
0 0

Sometimes there is a point whereby the chatgpt cannot think of and api documentation is lacking the detail that you need. That's what I've learnt from MEXC api documentation.

Note: Don't refer to this https://github.com/mexcdevelop/websocket-proto. You will get stuck because its giving out wrong information.

They specified that their webservice will use the .pb which is Google Protobuf but there is no .proto file in the documentation to compile. So I spend two days banging my head generating the required protofile for Orderbook. Chatgpt gave me the wrong answer citing the internet resource. Can't blame it either since the resources were limited. Then I use this tool https://protogen.marcgravell.com/decode to adjust the output and came up with the order book proto file as following.

syntax = "proto3";

option java_outer_classname = "MEXCDeltaProtocolV3";

message Bid {
  string price = 1;
  string quantity = 2;
}

message Ask {
  string price = 1;
  string quantity = 2;
}

message DepthEntry {
  repeated Bid bids = 1;
  repeated Ask asks = 2;

  string eventtype = 3;
  string version = 4;
}

message MEXCDeltaProtocolV3 {
  string channel = 1;
  string symbol = 3;
  int64 timestamp = 6;
  repeated DepthEntry entries = 313;
}
Enter fullscreen mode Exit fullscreen mode

Comments 0 total

    Add comment