Messages
Messages contains the keys described below.
JSON key: <message type value>
JSON key | Required? | Type | Value description |
---|---|---|---|
This is the message type and must be in the format described by the "type" of the msg type field. | Yes | String or Integer | This a JSON object containing additional key/values. See Additional Values below. |
Additional values
JSON key | Required? | Type | Value description |
---|---|---|---|
name | Yes | String | The name of the message being decoded. |
fields | Yes | Array | The set of fields for the message type value. |
message_types | No | Array | If the protocol being implemented contains multiple values which map to the same message, then we can specify a JSON array of values as shown in the Messages example below, where the message "SymbolNationalBestOfferUpdate" will be decoded if the message type is 17, 18 or 19. |
Messages example:
"Messages"
: {
"1"
: {
"name"
:
"SymbolMemxTradingStateUpdate"
,
"fields"
: [
{
"name"
:
"TradingState"
,
"type"
:
"SymbolTradingState"
},
{
"name"
:
"StateChangeReason"
,
"type"
:
"SymbolStateReason"
},
]
},
"2"
: {
"name"
:
"Delete Order"
,
"fields"
: [
{
"name"
:
"SymbolId"
,
"type"
:
"ASCII64"
},
{
"name"
:
"OpeningState"
,
"type"
:
"SymbolOpeningState"
},
{
"name"
:
"MatchPrice"
,
"type"
:
"INT64_BE"
},
]
},
"17"
: {
"name"
:
"SymbolNationalBestOfferUpdate"
,
"message_types"
: [
"18"
,
"19"
],
"fields"
: [
{
"name"
:
"SymbolId"
,
"type"
:
"ASCII64"
},
{
"name"
:
"MarketDataTimestamp"
,
"type"
:
"timestamp"
},
{
"name"
:
"MarketDataSequence"
,
"type"
:
"UINT64_BE"
},
{
"name"
:
"NationalAskPrice"
,
"type"
:
"INT64_BE"
},
{
"name"
:
"AwayAskPrice"
,
"type"
:
"INT64_BE"
},
]
},
}
How the decoder decodes Message Definition datafields
Once the decoder has decoded the Message Header and Message Type, its selects a message definition using the Message Type. The internal offset counter is set to 0 again as it decodes each "field" defined for the selected message definition.